From 75a7a26d623d283eaf7004eab872b8a2e12bd37d Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Wed, 6 Nov 2019 15:59:42 -0700 Subject: [PATCH 01/95] Added history comment. --- isis/src/clementine/apps/clemhirescal/clemhirescal.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isis/src/clementine/apps/clemhirescal/clemhirescal.xml b/isis/src/clementine/apps/clemhirescal/clemhirescal.xml index efcdbfe6f5..791864465e 100644 --- a/isis/src/clementine/apps/clemhirescal/clemhirescal.xml +++ b/isis/src/clementine/apps/clemhirescal/clemhirescal.xml @@ -18,7 +18,7 @@ in Table 5 from Robinson et al. (2003), therefore the pixel values in the output image are the same as they would be if the k values from Table 5 were hard coded into the script. - + The equation for the D filter yields k values that differ from the hard-coded values by less than 1 standard deviation as reported in Table 6 of Robinson et al. (2003). The radiance values that result from the From 7408dc7ab9f65c02286b3473801c17feb76aa300 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 16 Oct 2020 13:20:35 -0700 Subject: [PATCH 02/95] Initial move to core --- isis/Makefile | 508 ++++++------------ isis/src/core/CMakeLists.txt | 87 +++ .../{base/objs => core}/Constants/Constants.h | 0 .../{base/objs => core}/Constants/Makefile | 0 .../{base/objs => core}/FileName/FileName.cpp | 0 .../{base/objs => core}/FileName/FileName.h | 0 .../objs => core}/FileName/FileName.truth | 0 .../src/{base/objs => core}/FileName/Makefile | 0 .../{base/objs => core}/FileName/unitTest.cpp | 0 .../objs => core}/IException/IException.cpp | 34 +- .../objs => core}/IException/IException.h | 0 .../objs => core}/IException/IException.truth | 0 .../{base/objs => core}/IException/Makefile | 0 .../objs => core}/IException/unitTest.cpp | 0 .../objs => core}/IException/unitTest.exclude | 0 .../{base/objs => core}/IString/IString.cpp | 0 .../src/{base/objs => core}/IString/IString.h | 0 .../{base/objs => core}/IString/IString.truth | 0 isis/src/{base/objs => core}/IString/Makefile | 0 .../{base/objs => core}/IString/unitTest.cpp | 0 .../LabelTranslationManager.cpp | 0 .../LabelTranslationManager.h | 0 .../LabelTranslationManager.truth | 0 .../LabelTranslationManager/Makefile | 0 .../LabelTranslationManager/unitTest.cpp | 0 .../Message/ArraySubscriptNotInRange.cpp | 0 .../objs => core}/Message/FileCreate.cpp | 0 .../{base/objs => core}/Message/FileOpen.cpp | 0 .../{base/objs => core}/Message/FileRead.cpp | 0 .../{base/objs => core}/Message/FileWrite.cpp | 0 .../Message/KeywordAmbiguous.cpp | 0 .../Message/KeywordBlockEndMissing.cpp | 0 .../Message/KeywordBlockInvalid.cpp | 0 .../Message/KeywordBlockStartMissing.cpp | 0 .../Message/KeywordDuplicated.cpp | 0 .../objs => core}/Message/KeywordNotArray.cpp | 0 .../objs => core}/Message/KeywordNotFound.cpp | 0 .../Message/KeywordUnrecognized.cpp | 0 .../objs => core}/Message/KeywordValueBad.cpp | 0 .../Message/KeywordValueExpected.cpp | 0 .../Message/KeywordValueNotInList.cpp | 0 .../Message/KeywordValueNotInRange.cpp | 0 isis/src/{base/objs => core}/Message/Makefile | 0 .../Message/MemoryAllocationFailed.cpp | 0 .../src/{base/objs => core}/Message/Message.h | 0 .../{base/objs => core}/Message/Message.truth | 0 .../Message/MissingDelimiter.cpp | 0 .../{base/objs => core}/Message/unitTest.cpp | 0 .../{base/objs => core}/Preference/Makefile | 0 .../objs => core}/Preference/Preference.cpp | 0 .../objs => core}/Preference/Preference.h | 0 .../objs => core}/Preference/Preference.truth | 0 .../objs => core}/Preference/unitTest.cpp | 0 isis/src/core/Pvl/CMakeLists.txt | 6 + isis/src/{base/objs => core}/Pvl/Makefile | 0 isis/src/{base/objs => core}/Pvl/Pvl.cpp | 0 isis/src/{base/objs => core}/Pvl/Pvl.h | 0 isis/src/{base/objs => core}/Pvl/Pvl.truth | 0 .../{base/objs => core}/Pvl/cnetstatsTest.def | 0 isis/src/{base/objs => core}/Pvl/pointdef.def | 0 isis/src/{base/objs => core}/Pvl/unitTest.cpp | 0 isis/src/{base/objs => core}/Pvl/unitTest.pvl | 0 .../src/{base/objs => core}/Pvl/unitTest2.pvl | 0 .../src/{base/objs => core}/Pvl/unitTest3.pvl | 0 .../src/{base/objs => core}/Pvl/unitTest4.pvl | 0 .../{base/objs => core}/PvlContainer/Makefile | 0 .../PvlContainer/PvlContainer.cpp | 0 .../objs => core}/PvlContainer/PvlContainer.h | 0 .../PvlContainer/PvlContainer.truth | 0 .../objs => core}/PvlContainer/unitTest.cpp | 0 .../objs => core}/PvlEditDialog/Makefile | 0 .../PvlEditDialog/PvlEditDialog.cpp | 0 .../PvlEditDialog/PvlEditDialog.h | 0 .../PvlEditDialog/PvlEditDialog.truth | 0 .../objs => core}/PvlEditDialog/unitTest.cpp | 0 .../{base/objs => core}/PvlFlatMap/Makefile | 0 .../objs => core}/PvlFlatMap/PvlFlatMap.cpp | 0 .../objs => core}/PvlFlatMap/PvlFlatMap.h | 0 .../objs => core}/PvlFlatMap/PvlFlatMap.truth | 0 .../objs => core}/PvlFlatMap/unitTest.cpp | 0 .../{base/objs => core}/PvlFormat/Makefile | 0 .../objs => core}/PvlFormat/PvlFormat.cpp | 0 .../{base/objs => core}/PvlFormat/PvlFormat.h | 0 .../objs => core}/PvlFormat/PvlFormat.truth | 0 .../objs => core}/PvlFormat/unitTest.cpp | 0 .../{base/objs => core}/PvlFormatPds/Makefile | 0 .../PvlFormatPds/PvlFormatPds.cpp | 0 .../objs => core}/PvlFormatPds/PvlFormatPds.h | 0 .../PvlFormatPds/PvlFormatPds.truth | 0 .../objs => core}/PvlFormatPds/unitTest.cpp | 0 .../src/{base/objs => core}/PvlGroup/Makefile | 0 .../{base/objs => core}/PvlGroup/PvlGroup.cpp | 0 .../{base/objs => core}/PvlGroup/PvlGroup.h | 0 .../objs => core}/PvlGroup/PvlGroup.truth | 0 .../{base/objs => core}/PvlGroup/unitTest.cpp | 0 isis/src/core/PvlKeyword/CMakeLists.txt | 6 + .../{base/objs => core}/PvlKeyword/Makefile | 0 .../objs => core}/PvlKeyword/PvlKeyword.cpp | 5 + .../objs => core}/PvlKeyword/PvlKeyword.h | 0 isis/src/core/PvlObject/CMakeLists.txt | 4 + .../{base/objs => core}/PvlObject/Makefile | 0 .../objs => core}/PvlObject/PvlObject.cpp | 0 .../{base/objs => core}/PvlObject/PvlObject.h | 0 .../{base/objs => core}/PvlSequence/Makefile | 0 .../objs => core}/PvlSequence/PvlSequence.cpp | 0 .../objs => core}/PvlSequence/PvlSequence.h | 0 .../PvlSequence/PvlSequence.truth | 0 .../objs => core}/PvlSequence/unitTest.cpp | 0 .../PvlToPvlTranslationManager/Makefile | 0 .../PvlToPvlTranslationManager.cpp | 0 .../PvlToPvlTranslationManager.h | 0 .../PvlToPvlTranslationManager.truth | 0 .../PvlToPvlTranslationManager/unitTest.cpp | 0 .../PvlToXmlTranslationManager/Makefile | 0 .../PvlToXmlTranslationManager.cpp | 0 .../PvlToXmlTranslationManager.h | 0 .../PvlToXmlTranslationManager.truth | 0 .../PvlToXmlTranslationManager/unitTest.cpp | 0 .../src/{base/objs => core}/PvlToken/Makefile | 0 .../{base/objs => core}/PvlToken/PvlToken.cpp | 0 .../{base/objs => core}/PvlToken/PvlToken.h | 0 .../objs => core}/PvlToken/PvlToken.truth | 0 .../{base/objs => core}/PvlToken/unitTest.cpp | 0 .../{base/objs => core}/PvlTokenizer/Makefile | 0 .../PvlTokenizer/PvlTokenizer.cpp | 0 .../objs => core}/PvlTokenizer/PvlTokenizer.h | 0 .../PvlTokenizer/PvlTokenizer.truth | 0 .../objs => core}/PvlTokenizer/unitTest.cpp | 0 .../PvlTranslationTable/Makefile | 0 .../PvlTranslationTable.cpp | 0 .../PvlTranslationTable/PvlTranslationTable.h | 0 .../PvlTranslationTable.truth | 0 .../PvlTranslationTable/unitTest.cpp | 0 .../{base/objs => core}/SpecialPixel/Makefile | 0 .../objs => core}/SpecialPixel/SpecialPixel.h | 0 .../SpecialPixel/SpecialPixel.truth | 0 .../objs => core}/SpecialPixel/unitTest.cpp | 0 .../src/{base/objs => core}/TextFile/Makefile | 0 .../{base/objs => core}/TextFile/TextFile.cpp | 0 .../{base/objs => core}/TextFile/TextFile.h | 0 .../objs => core}/TextFile/TextFile.truth | 0 .../{base/objs => core}/TextFile/unitTest.cpp | 0 142 files changed, 302 insertions(+), 348 deletions(-) create mode 100644 isis/src/core/CMakeLists.txt rename isis/src/{base/objs => core}/Constants/Constants.h (100%) rename isis/src/{base/objs => core}/Constants/Makefile (100%) rename isis/src/{base/objs => core}/FileName/FileName.cpp (100%) rename isis/src/{base/objs => core}/FileName/FileName.h (100%) rename isis/src/{base/objs => core}/FileName/FileName.truth (100%) rename isis/src/{base/objs => core}/FileName/Makefile (100%) rename isis/src/{base/objs => core}/FileName/unitTest.cpp (100%) rename isis/src/{base/objs => core}/IException/IException.cpp (96%) rename isis/src/{base/objs => core}/IException/IException.h (100%) rename isis/src/{base/objs => core}/IException/IException.truth (100%) rename isis/src/{base/objs => core}/IException/Makefile (100%) rename isis/src/{base/objs => core}/IException/unitTest.cpp (100%) rename isis/src/{base/objs => core}/IException/unitTest.exclude (100%) rename isis/src/{base/objs => core}/IString/IString.cpp (100%) rename isis/src/{base/objs => core}/IString/IString.h (100%) rename isis/src/{base/objs => core}/IString/IString.truth (100%) rename isis/src/{base/objs => core}/IString/Makefile (100%) rename isis/src/{base/objs => core}/IString/unitTest.cpp (100%) rename isis/src/{base/objs => core}/LabelTranslationManager/LabelTranslationManager.cpp (100%) rename isis/src/{base/objs => core}/LabelTranslationManager/LabelTranslationManager.h (100%) rename isis/src/{base/objs => core}/LabelTranslationManager/LabelTranslationManager.truth (100%) rename isis/src/{base/objs => core}/LabelTranslationManager/Makefile (100%) rename isis/src/{base/objs => core}/LabelTranslationManager/unitTest.cpp (100%) rename isis/src/{base/objs => core}/Message/ArraySubscriptNotInRange.cpp (100%) rename isis/src/{base/objs => core}/Message/FileCreate.cpp (100%) rename isis/src/{base/objs => core}/Message/FileOpen.cpp (100%) rename isis/src/{base/objs => core}/Message/FileRead.cpp (100%) rename isis/src/{base/objs => core}/Message/FileWrite.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordAmbiguous.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordBlockEndMissing.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordBlockInvalid.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordBlockStartMissing.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordDuplicated.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordNotArray.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordNotFound.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordUnrecognized.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordValueBad.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordValueExpected.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordValueNotInList.cpp (100%) rename isis/src/{base/objs => core}/Message/KeywordValueNotInRange.cpp (100%) rename isis/src/{base/objs => core}/Message/Makefile (100%) rename isis/src/{base/objs => core}/Message/MemoryAllocationFailed.cpp (100%) rename isis/src/{base/objs => core}/Message/Message.h (100%) rename isis/src/{base/objs => core}/Message/Message.truth (100%) rename isis/src/{base/objs => core}/Message/MissingDelimiter.cpp (100%) rename isis/src/{base/objs => core}/Message/unitTest.cpp (100%) rename isis/src/{base/objs => core}/Preference/Makefile (100%) rename isis/src/{base/objs => core}/Preference/Preference.cpp (100%) rename isis/src/{base/objs => core}/Preference/Preference.h (100%) rename isis/src/{base/objs => core}/Preference/Preference.truth (100%) rename isis/src/{base/objs => core}/Preference/unitTest.cpp (100%) create mode 100644 isis/src/core/Pvl/CMakeLists.txt rename isis/src/{base/objs => core}/Pvl/Makefile (100%) rename isis/src/{base/objs => core}/Pvl/Pvl.cpp (100%) rename isis/src/{base/objs => core}/Pvl/Pvl.h (100%) rename isis/src/{base/objs => core}/Pvl/Pvl.truth (100%) rename isis/src/{base/objs => core}/Pvl/cnetstatsTest.def (100%) rename isis/src/{base/objs => core}/Pvl/pointdef.def (100%) rename isis/src/{base/objs => core}/Pvl/unitTest.cpp (100%) rename isis/src/{base/objs => core}/Pvl/unitTest.pvl (100%) rename isis/src/{base/objs => core}/Pvl/unitTest2.pvl (100%) rename isis/src/{base/objs => core}/Pvl/unitTest3.pvl (100%) rename isis/src/{base/objs => core}/Pvl/unitTest4.pvl (100%) rename isis/src/{base/objs => core}/PvlContainer/Makefile (100%) rename isis/src/{base/objs => core}/PvlContainer/PvlContainer.cpp (100%) rename isis/src/{base/objs => core}/PvlContainer/PvlContainer.h (100%) rename isis/src/{base/objs => core}/PvlContainer/PvlContainer.truth (100%) rename isis/src/{base/objs => core}/PvlContainer/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlEditDialog/Makefile (100%) rename isis/src/{base/objs => core}/PvlEditDialog/PvlEditDialog.cpp (100%) rename isis/src/{base/objs => core}/PvlEditDialog/PvlEditDialog.h (100%) rename isis/src/{base/objs => core}/PvlEditDialog/PvlEditDialog.truth (100%) rename isis/src/{base/objs => core}/PvlEditDialog/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlFlatMap/Makefile (100%) rename isis/src/{base/objs => core}/PvlFlatMap/PvlFlatMap.cpp (100%) rename isis/src/{base/objs => core}/PvlFlatMap/PvlFlatMap.h (100%) rename isis/src/{base/objs => core}/PvlFlatMap/PvlFlatMap.truth (100%) rename isis/src/{base/objs => core}/PvlFlatMap/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlFormat/Makefile (100%) rename isis/src/{base/objs => core}/PvlFormat/PvlFormat.cpp (100%) rename isis/src/{base/objs => core}/PvlFormat/PvlFormat.h (100%) rename isis/src/{base/objs => core}/PvlFormat/PvlFormat.truth (100%) rename isis/src/{base/objs => core}/PvlFormat/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlFormatPds/Makefile (100%) rename isis/src/{base/objs => core}/PvlFormatPds/PvlFormatPds.cpp (100%) rename isis/src/{base/objs => core}/PvlFormatPds/PvlFormatPds.h (100%) rename isis/src/{base/objs => core}/PvlFormatPds/PvlFormatPds.truth (100%) rename isis/src/{base/objs => core}/PvlFormatPds/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlGroup/Makefile (100%) rename isis/src/{base/objs => core}/PvlGroup/PvlGroup.cpp (100%) rename isis/src/{base/objs => core}/PvlGroup/PvlGroup.h (100%) rename isis/src/{base/objs => core}/PvlGroup/PvlGroup.truth (100%) rename isis/src/{base/objs => core}/PvlGroup/unitTest.cpp (100%) create mode 100644 isis/src/core/PvlKeyword/CMakeLists.txt rename isis/src/{base/objs => core}/PvlKeyword/Makefile (100%) rename isis/src/{base/objs => core}/PvlKeyword/PvlKeyword.cpp (99%) rename isis/src/{base/objs => core}/PvlKeyword/PvlKeyword.h (100%) create mode 100644 isis/src/core/PvlObject/CMakeLists.txt rename isis/src/{base/objs => core}/PvlObject/Makefile (100%) rename isis/src/{base/objs => core}/PvlObject/PvlObject.cpp (100%) rename isis/src/{base/objs => core}/PvlObject/PvlObject.h (100%) rename isis/src/{base/objs => core}/PvlSequence/Makefile (100%) rename isis/src/{base/objs => core}/PvlSequence/PvlSequence.cpp (100%) rename isis/src/{base/objs => core}/PvlSequence/PvlSequence.h (100%) rename isis/src/{base/objs => core}/PvlSequence/PvlSequence.truth (100%) rename isis/src/{base/objs => core}/PvlSequence/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlToPvlTranslationManager/Makefile (100%) rename isis/src/{base/objs => core}/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp (100%) rename isis/src/{base/objs => core}/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h (100%) rename isis/src/{base/objs => core}/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth (100%) rename isis/src/{base/objs => core}/PvlToPvlTranslationManager/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlToXmlTranslationManager/Makefile (100%) rename isis/src/{base/objs => core}/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp (100%) rename isis/src/{base/objs => core}/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h (100%) rename isis/src/{base/objs => core}/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth (100%) rename isis/src/{base/objs => core}/PvlToXmlTranslationManager/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlToken/Makefile (100%) rename isis/src/{base/objs => core}/PvlToken/PvlToken.cpp (100%) rename isis/src/{base/objs => core}/PvlToken/PvlToken.h (100%) rename isis/src/{base/objs => core}/PvlToken/PvlToken.truth (100%) rename isis/src/{base/objs => core}/PvlToken/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlTokenizer/Makefile (100%) rename isis/src/{base/objs => core}/PvlTokenizer/PvlTokenizer.cpp (100%) rename isis/src/{base/objs => core}/PvlTokenizer/PvlTokenizer.h (100%) rename isis/src/{base/objs => core}/PvlTokenizer/PvlTokenizer.truth (100%) rename isis/src/{base/objs => core}/PvlTokenizer/unitTest.cpp (100%) rename isis/src/{base/objs => core}/PvlTranslationTable/Makefile (100%) rename isis/src/{base/objs => core}/PvlTranslationTable/PvlTranslationTable.cpp (100%) rename isis/src/{base/objs => core}/PvlTranslationTable/PvlTranslationTable.h (100%) rename isis/src/{base/objs => core}/PvlTranslationTable/PvlTranslationTable.truth (100%) rename isis/src/{base/objs => core}/PvlTranslationTable/unitTest.cpp (100%) rename isis/src/{base/objs => core}/SpecialPixel/Makefile (100%) rename isis/src/{base/objs => core}/SpecialPixel/SpecialPixel.h (100%) rename isis/src/{base/objs => core}/SpecialPixel/SpecialPixel.truth (100%) rename isis/src/{base/objs => core}/SpecialPixel/unitTest.cpp (100%) rename isis/src/{base/objs => core}/TextFile/Makefile (100%) rename isis/src/{base/objs => core}/TextFile/TextFile.cpp (100%) rename isis/src/{base/objs => core}/TextFile/TextFile.h (100%) rename isis/src/{base/objs => core}/TextFile/TextFile.truth (100%) rename isis/src/{base/objs => core}/TextFile/unitTest.cpp (100%) diff --git a/isis/Makefile b/isis/Makefile index 24fd4e1d5d..a6d3b51b43 100644 --- a/isis/Makefile +++ b/isis/Makefile @@ -1,349 +1,167 @@ -include $(ISISROOT)/make/isismake.os - -#--------------------------------------------------------------------------- -# Set up ISIS versioning -#--------------------------------------------------------------------------- -#ISISVERSIONFULL := $(shell head -n 1 $(ISISROOT)/version | sed 's/\#.*//' | sed 's/ *$$//') -#ISISMAJOR := $(shell echo $(ISISVERSIONFULL) | cut -d"." -f1) -#ISISMINOR := $(shell echo $(ISISVERSIONFULL) | cut -d"." -f2) -#ISISMINORMINOR := $(shell echo $(ISISVERSIONFULL) | cut -d"." -f3) -#ISISMINORMINORMINOR := $(shell echo $(ISISVERSIONFULL) | cut -d"." -f4) -#ISISVERSION := $(ISISMAJOR).$(ISISMINOR).$(ISISMINORMINOR).$(ISISMINORMINORMINOR) -#ISISLIBVERSION := $(shell echo $(ISISMAJOR).$(ISISMINOR).$(ISISMINORMINOR) | sed 's/[a-z].*$$//') -#ISISLOCALVERSION := $(shell head -n 3 $(ISISROOT)/version | tail -n 1 | sed 's/\#.*//' | sed 's/ *$$//') -#ISISRELEASE := REL_0_0 +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.18 +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. .NOTPARALLEL: -#---------------------------------------------------------------------------- -# Let the user know how to use the system -#---------------------------------------------------------------------------- -help: - echo "Isis Make System Commands" - echo "------------------------ " - echo "make all : Build and install the entire system (incs,api,apps,docs)" - echo "make thirdParty : Copy required 3rdParty libraries into distribution" - echo "make incs : Install API include files" - echo "make api : Build and install the Isis API" - echo "make apps : Build and install Isis Applications" - echo "make docs : Build Isis Web Documentation" - echo "make quickclean : Clean binaries from source tree but not app test areas" - echo "make cleansrc : Clean binaries from source tree" - echo "make clean : Clean source tree and install area" - echo "make unitTest : Build and execute unit tests for Isis API" - echo "make appTest : Build and execute application tests" - echo "make catTest : Build and execute category tests" - echo "make coverage : Build a test coverage report from generated coverage info" - -#---------------------------------------------------------------------------- -# Target = all -# Dependencies = includes api applications documentation thirdParty -# -# The API include files must be installed before the API can be constructed. -# After the API is created then the applications can be individually built -# and installed. Finally create the web documentation for the entire system. -#---------------------------------------------------------------------------- -all: incs thirdParty api apps docs - -#---------------------------------------------------------------------------- -# Target = incs -# Dependencies = none -# -# The API include files will be installed in $(ISISROOT)/inc. The Isis -# make system will traverse the objs directories (src/base/objs/*) and -# copy the include file from the individual object directory into the -# system directory $(ISISROOT)/inc. -#---------------------------------------------------------------------------- -incs: - echo $(CURTIMESTAMP) "Installing include files" - mkdir -p inc - $(MAKE) --directory=src includes - echo $(CURTIMESTAMP) "Finished installing include files" - echo $(CURTIMESTAMP) " " - -#---------------------------------------------------------------------------- -# Target = api -# Dependencies = objects -# -# The Isis API is essentially libisis.a which will be created in the -# directory $(ISISROOT)/lib. Make api traverses the objs directories -# (src/base/objs/*) and archives the ".o" files into libisis.a. Therefore -# the ".o" files must exist. -# -# Target = objects -# Dependencies = none -# -# Before the API can be built each individual object must be built. -# This target will traverse the objs directories and create the C++ -# object classes leaving the ".o" file in each individual directory. -# The API is not created until "make api" is performed -# -# Finally after the API is completed the shared libraries will be -# constructed from libisis.a -#---------------------------------------------------------------------------- - -api: - echo $(CURTIMESTAMP) "Building Isis API" - mkdir -p lib - $(MAKE) --directory=src objects - echo $(CURTIMESTAMP) "Finished building Isis API" - echo $(CURTIMESTAMP) "" - echo $(CURTIMESTAMP) "Adding API objects" - if [ "$(HOST_ARCH)" == "Linux" ]; then \ - $(MAKE) --directory=src api; \ - elif [ "$(HOST_ARCH)" == "Darwin" ]; then \ - $(MAKE) osx_static; \ - fi; - echo $(CURTIMESTAMP) "Finished adding API objects" - echo $(CURTIMESTAMP) " " - echo $(CURTIMESTAMP) "Creating Shared Libraries ..." - cp make/Makefile.libs lib/Makefile - $(MAKE) --directory=lib shared - echo $(CURTIMESTAMP) "Finished creating Shared Libraries ..." - echo $(CURTIMESTAMP) " " - -# Make the static library on Macos, faster then recursivly call make -osx_static: - $(eval UNIT_TESTS=$(wildcard src/*/objs/*/unitTest.o)) - $(eval PLUGIN_DIRS=$(dir $(wildcard src/*/objs/*/*.plugin))) - $(eval PLUGIN_FILES=$(foreach dir,$(PLUGIN_DIRS),$(wildcard $(dir)*.o))) - $(eval API_OBJS=$(filter-out $(PLUGIN_FILES),$(filter-out $(UNIT_TESTS),$(wildcard src/*/objs/*/*.o)))) - $(AR) -crs $(ISISROOT)/lib/libisis$(ISISLIBVERSION).a $(API_OBJS); - for i in $(PLUGIN_DIRS); do \ - $(MAKE) --directory=$$i plugin install; \ - done - -# echo "Building Isis API with debugging" -# cd src; $(MAKE) objects MODE=DEBUG -# cd src; $(MAKE) api MODE=DEBUG -# echo "Finished building Isis API with debugging" -# echo " " - -#---------------------------------------------------------------------------- -# Target = apps -# Dependencies = none -# -# This will build and install all the Isis application in the directory -# $(ISISROOT)/bin. It also installs the application Xml file in -# $(ISISROOT/bin/xml. Again the make system traverse the apps directories -# (src/base/apps) and builds/installs each application. Of course the -# API must be built for this to work properly -#---------------------------------------------------------------------------- -apps: - echo $(CURTIMESTAMP) "Building Isis Applications" - mkdir -p bin/xml - $(MAKE) --directory=src applications - echo $(CURTIMESTAMP) "Finished building Isis Applications" - echo $(CURTIMESTAMP) " " - -#---------------------------------------------------------------------------- -# Target = docs -# Dependencies = none -# -# This target traverse both the objs and apps directories and moves the -# Xml and assets directories into specific sub-directories under -# $(ISISROOT)/src/docsys. Then it builds the entire docsys tree which -# generates the Isis Documentation under $(ISISROOT)/doc -#---------------------------------------------------------------------------- -docs: - echo $(CURTIMESTAMP) "Building Isis Documentation" - mkdir -p doc - $(MAKE) --directory=src documentation - $(MAKE) --directory=src/docsys docs - echo $(CURTIMESTAMP) "Finished building Isis Documentation" - - -#---------------------------------------------------------------------------- -# Target = coverage -# Dependencies = none -# -# This target builds a report on how much of Isis is tested in the automated -# tests. This is currently excluding applications that run other applications -# because of the amount of time it takes to generate the report (and that's -# not how we want to test our applications ideally). -#---------------------------------------------------------------------------- -coverage: - if [ "$(CODE_COVERAGE_BIN_DIR)" == "" ]; then \ - echo "Make sure you use MODE=TC when building Isis for a coverage" \ - "report."; \ - exit 1; \ - fi; \ - $(ECHO) $(CURTIMESTAMP) "Finding coverage information..."; \ - CSMESFILES=( lib/libisis$(ISISLIBVERSION).so.csmes \ - `find src/*/apps -name "*.o.csmes" | grep -v moc_` ); \ - CSEXEFILES=(`find src/ -name "*.csexe"` `find bin/ -name "*.csexe"`); \ - if [ "$${#CSMESFILES[@]}" == "0" ] || \ - [ "$${#CSEXEFILES[@]}" == "0" ]; then \ - echo "Please build Isis and run the tests with MODE=TC before " \ - "trying to build a coverage report."; \ - exit 1; \ - fi; \ - $(ECHO) $(CURTIMESTAMP) "Merging source file information into isis.csmes..."; \ - $(CODE_COVERAGE_BIN_DIR)/cmmerge $${CSMESFILES[@]} -o isis.csmes; \ - $(ECHO) $(CURTIMESTAMP) "Adding test execution records into isis.csmes..."; \ - for CSEXEFILE in $${CSEXEFILES[@]}; do \ - EXETESTNAME="$$CSEXEFILE"; \ - APPTESTAPPNAME=`echo $$CSEXEFILE | sed 's#\\(.*/apps/\\)\\([a-zA-Z0-9]*\\)\\(/tsts/\\)\([^/]*\)\(/.*\)#\\2#'`; \ - CSEXEAPPNAME=`basename $$CSEXEFILE | sed 's/.csexe//'`; \ - if [ "$$APPTESTAPPNAME" == "$$CSEXEFILE" ] || \ - [ "$$APPTESTAPPNAME" == "$$CSEXEAPPNAME" ] || \ - [ "`dirname $$CSEXEFILE`" == "bin" ]; then \ - EXETESTNAME=`echo $$EXETESTNAME | sed 's#\\(.*/apps/\\)\\([a-zA-Z0-9]*\\)\\(/tsts/\\)\([^/]*\)\(/.*\)#\\2 Application Test (case \\4\\)#'`; \ - EXETESTNAME=`echo $$EXETESTNAME | sed 's#\\(src/\\)\\([a-zA-Z0-9]*\\)\\(/tsts/\\)\\([a-zA-Z0-9]*\\)\\(.*\\)#\\2 Category Test (case \\4\\)#'`; \ - EXETESTNAME=`echo $$EXETESTNAME | sed 's#\\(.*/\\)\\([^/]*\\)\\(/unitTest.csexe\\)#\\2 Unit Test#'`; \ - $(ECHO) -e $(CURTIMESTAMP) " Adding [$$EXETESTNAME] `basename $$CSEXEFILE`"; \ - $(CODE_COVERAGE_BIN_DIR)/cmcsexeimport -t "$$EXETESTNAME" \ - -e $$CSEXEFILE -m "isis.csmes"; \ - fi; \ - done; \ - $(ECHO) -ne $(CURTIMESTAMP) "Scope Coverage: "; \ - $(CODE_COVERAGE_BIN_DIR)/cmreport \ - --title="Isis System-Wide Test Scope Coverage" \ - -m "`basename $$PWD`.csmes" --select=".*" --bargraph --toc --stat \ - --global=all --method=all --source=all --execution=all \ - --method-sort=coverage --execution-sort=coverage \ - --source-sort=coverage -h scopecoverage; \ - $(ECHO) -ne $(CURTIMESTAMP) "Line Coverage: "; \ - $(CODE_COVERAGE_BIN_DIR)/cmreport \ - --title="Isis System-Wide Test Line Coverage" \ - -m "`basename $$PWD`.csmes" --select=".*" --bargraph --toc --stat \ - --global=all --method=all --source=all --execution=all \ - --method-sort=coverage --execution-sort=coverage \ - --source-sort=coverage --line-coverage -h linecoverage; \ - $(ECHO) -ne $(CURTIMESTAMP) "Function Coverage: "; \ - $(CODE_COVERAGE_BIN_DIR)/cmreport \ - --title="Isis System-Wide Test Function Coverage" \ - -m "`basename $$PWD`.csmes" --select=".*" --bargraph --toc --stat \ - --global=all --method=all --source=all --execution=all \ - --method-sort=coverage --execution-sort=coverage \ - --source-sort=coverage --function-coverage -h functioncoverage; - - -#---------------------------------------------------------------------------- -# Target = quickclean -# -# This target cleans the entire Isis system enough for a recompile. It cleans ".o" files and -# binary executables from the source tree. It also, clears the running -# areas under $ISISROOT (inc, doc, bin, bin/xml, and lib) -# -# Target = quickclean -# Dependencies = none -# -# This walks the src tree and removes ".o" files and binary files -#---------------------------------------------------------------------------- -quickclean: - echo $(CURTIMESTAMP) "Cleaning Isis (quick)"; \ - $(MAKE) --directory=src quickclean; \ - rm -rf inc; \ - rm -rf doc; \ - rm -rf bin; \ - rm -rf lib; \ - rm -rf scripts/tabcomplete.csh; \ - rm -rf scopecoverage scopecoverage.html linecoverage linecoverage.html \ - functioncoverage functioncoverage.html *.csmes *.csexe; \ - $(MAKE) --directory=3rdParty clean; \ - echo $(CURTIMESTAMP) "Finished cleaning Isis"; - -#---------------------------------------------------------------------------- -# Target = clean -# Dependencies = cleansrc -# -# This target cleans the entire Isis system. It cleans ".o" files and -# binary executables from the source tree. It also clears the running -# areas under $ISISROOT (inc, doc, bini, bin/xml, and lib) -# -# Target = cleansrc -# Dependencies = none -# -# This walks the src tree and removes ".o" files and binary files -#---------------------------------------------------------------------------- + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /opt/anaconda3/envs/cmake_test/bin/cmake + +# The command to remove a file. +RM = /opt/anaconda3/envs/cmake_test/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/arsanders/ISIS3/isis/src/core + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/arsanders/ISIS3/isis + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /opt/anaconda3/envs/cmake_test/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /opt/anaconda3/envs/cmake_test/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/arsanders/ISIS3/isis/CMakeFiles /Users/arsanders/ISIS3/isis//CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/arsanders/ISIS3/isis/CMakeFiles 0 +.PHONY : all + +# The main clean target clean: - echo $(CURTIMESTAMP) "Cleaning Isis"; \ - $(MAKE) cleansrc; \ - rm -rf inc; \ - rm -rf doc; \ - rm -rf bin; \ - rm -rf lib; \ - rm -rf scripts/tabcomplete.csh; \ - rm -rf scopecoverage scopecoverage.html linecoverage linecoverage.html \ - functioncoverage functioncoverage.html *.csmes *.csexe; \ - $(MAKE) --directory=3rdParty clean; \ - echo $(CURTIMESTAMP) "Finished cleaning Isis"; - -cleansrc: - $(MAKE) --directory=src clean - -tabcomplete: - if [ ! -d bin ]; then \ - echo $(CURTIMESTAMP) "You must build the applications first"; \ - elif [ ! -f bin/isiscomplete ]; then \ - echo $(CURTIMESTAMP) "Isis application 'isiscomplete' is missing"; \ - else \ - echo "#!/bin/csh" > $$ISISROOT/scripts/tabcomplete.csh; \ - isiscomplete `ls $$ISISROOT/bin | grep -v xml` | sed 's/; /;~/g' | \ - tr '~' '\n' > $$ISISROOT/scripts/tabcomplete.csh; \ - fi; - -#---------------------------------------------------------------------------- -# Target = unitTest appTest appTest2 catTest -# Dependencies = none -# -# This target traverses both the objs and apps directories. In the object -# directories it will build the unitTest executable, run it, and difference -# the results with the unitTest truth data. In the application directories -# it will run the appTest script to ensure the program generates the proper -# output data (whether it be a cube, text file, postscript file, etc) -#---------------------------------------------------------------------------- -unitTest: - echo $(CURTIMESTAMP) "Testing Isis API" - $(MAKE) --directory=src unitTest - echo $(CURTIMESTAMP) "Finished testing Isis API" - -appTest: - echo $(CURTIMESTAMP) "Testing Isis Applications version 2" - $(MAKE) --directory=src appTest - echo $(CURTIMESTAMP) "Finished testing Isis Applications version 2" - -catTest: - echo $(CURTIMESTAMP) "Testing Isis Category" - $(MAKE) --directory=src catTest - echo $(CURTIMESTAMP) "Finished testing Isis Category" - -#---------------------------------------------------------------------------- -# Target = thirdParty -# Dependencies = none -# -# This target is used only for external distributions that do not have -# the need to program. As a convenience we provide the shared libraries -# for 3rdParty packages used in ISIS so that external customers do -# not have to download and install RPMs. -#---------------------------------------------------------------------------- -HOST_ARCH ?= $(shell uname -s) -HOST_MACH ?= $(shell uname -m) - -thirdParty: - echo $(CURTIMESTAMP) "Installing 3rdParty libraries" - rm -f $(ISISROOT)/3rdParty/lib/lib* - $(MAKE) -C $(ISISROOT)/3rdParty install - echo $(CURTIMESTAMP) "Finished installing 3rdParty libraries" - echo $(CURTIMESTAMP) " " - - -#---------------------------------------------------------------------------- -# Use to see values of variables -# Example: make print-HOST_OS -# Will print the make variable HOST_OS -#---------------------------------------------------------------------------- -#print-% : -# @echo '$* = $($*)' - -#---------------------------------------------------------------------------- -# Standard make FORCE target. Do not remove unless you know what you are doing -#---------------------------------------------------------------------------- - -FORCE: - -#---------------------------------------------------------------------------- -# Include the make file debugging targets -#---------------------------------------------------------------------------- -include $(ISISROOT)/make/isismake.print + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named Pvl + +# Build rule for target. +Pvl: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 Pvl +.PHONY : Pvl + +# fast build rule for target. +Pvl/fast: + $(MAKE) $(MAKESILENT) -f Pvl/CMakeFiles/Pvl.dir/build.make Pvl/CMakeFiles/Pvl.dir/build +.PHONY : Pvl/fast + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... Pvl" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt new file mode 100644 index 0000000000..646428cc94 --- /dev/null +++ b/isis/src/core/CMakeLists.txt @@ -0,0 +1,87 @@ +cmake_minimum_required(VERSION 3.10) + +project (CORE VERSION 0.0.1) +option(buildStaticCore "Build libisis static as well as dynamic" OFF ) + + +# Short and long name of this package +set(PACKAGE "CORE") +set(PACKAGE_NAME "USGS ISIS PVL CORE") + +# specify the C++ standard +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +#include cmake files from isis root +get_filename_component(PARENT_DIR ../../ ABSOLUTE) +list(APPEND CMAKE_MODULE_PATH ${PARENT_DIR}/cmake) +message(${CMAKE_MODULE_PATH}) + +include(Utilities) + +FILE(GLOB_RECURSE Pvl_source_files ${PROJECT_SOURCE_DIR} *.h *.cpp) +list(FILTER Pvl_source_files EXCLUDE REGEX .*unitTest.cpp) + +set(reqLibs + geos + Qt +) + + +# Define a target +add_library(CORE "${Pvl_source_files}") + +MACRO(SUBDIRLIST result curdir) + FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) + SET(dirlist "") + FOREACH(child ${children}) + IF(IS_DIRECTORY ${curdir}/${child}) + LIST(APPEND dirlist ${child}) + ENDIF() + ENDFOREACH() + SET(${result} ${dirlist}) +ENDMACRO() + +SUBDIRLIST(subdirs ${PROJECT_SOURCE_DIR}) + +target_include_directories(CORE PUBLIC ${subdirs}) + +find_package(Qt5 REQUIRED COMPONENTS + Core + Concurrent + Gui + Multimedia + MultimediaWidgets + Network + OpenGL # Needed to install mesa-common-dev for this! + PrintSupport + Qml + Quick + Script + ScriptTools + Sql + Svg + Test + WebChannel + Widgets + Xml + XmlPatterns + # Search this path explicitly for MacOS OpenGL Framework + PATHS /System/Library/Frameworks/ REQUIRED) + +find_package(Json REQUIRED) +find_package(Geos REQUIRED) +find_package(nlohmann_json REQUIRED) +find_package(CSPICE 65 REQUIRED) + +include_directories(SYSTEM + ${Qt5Widgets_INCLUDE_DIRS} + ${Qt5Concurrent_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS} + ${Qt5Xml_INCLUDE_DIRS} + ${CSPICE_INCLUDE_DIR} + ${JSON_INCLUDE_DIR}) +include_directories(${CMAKE_BINARY_DIR}/inc) +link_directories(${JSON_LIBRARY} ${CSPICE_LIBRARY}) + +target_link_libraries(CORE PUBLIC Qt5 Geos Json nlohmann_json::nlohmann_json) diff --git a/isis/src/base/objs/Constants/Constants.h b/isis/src/core/Constants/Constants.h similarity index 100% rename from isis/src/base/objs/Constants/Constants.h rename to isis/src/core/Constants/Constants.h diff --git a/isis/src/base/objs/Constants/Makefile b/isis/src/core/Constants/Makefile similarity index 100% rename from isis/src/base/objs/Constants/Makefile rename to isis/src/core/Constants/Makefile diff --git a/isis/src/base/objs/FileName/FileName.cpp b/isis/src/core/FileName/FileName.cpp similarity index 100% rename from isis/src/base/objs/FileName/FileName.cpp rename to isis/src/core/FileName/FileName.cpp diff --git a/isis/src/base/objs/FileName/FileName.h b/isis/src/core/FileName/FileName.h similarity index 100% rename from isis/src/base/objs/FileName/FileName.h rename to isis/src/core/FileName/FileName.h diff --git a/isis/src/base/objs/FileName/FileName.truth b/isis/src/core/FileName/FileName.truth similarity index 100% rename from isis/src/base/objs/FileName/FileName.truth rename to isis/src/core/FileName/FileName.truth diff --git a/isis/src/base/objs/FileName/Makefile b/isis/src/core/FileName/Makefile similarity index 100% rename from isis/src/base/objs/FileName/Makefile rename to isis/src/core/FileName/Makefile diff --git a/isis/src/base/objs/FileName/unitTest.cpp b/isis/src/core/FileName/unitTest.cpp similarity index 100% rename from isis/src/base/objs/FileName/unitTest.cpp rename to isis/src/core/FileName/unitTest.cpp diff --git a/isis/src/base/objs/IException/IException.cpp b/isis/src/core/IException/IException.cpp similarity index 96% rename from isis/src/base/objs/IException/IException.cpp rename to isis/src/core/IException/IException.cpp index cd42a87e53..dfe0995335 100644 --- a/isis/src/base/objs/IException/IException.cpp +++ b/isis/src/core/IException/IException.cpp @@ -16,7 +16,7 @@ find files of those names at the top level of this repository. **/ #include -#include "Application.h" +//#include "Application.h" #include "Preference.h" #include "Pvl.h" @@ -488,7 +488,7 @@ namespace Isis { bool exceptionIsBlank = true; PvlGroup errGroup("Error"); - errGroup += PvlKeyword("Program", Application::Name()); + //errGroup += PvlKeyword("Program", Application::Name()); if (exception.m_errorType != Unknown) { errGroup += PvlKeyword("Class", @@ -641,6 +641,35 @@ namespace Isis { /** +<<<<<<< HEAD:isis/src/base/objs/IException/IException.cpp +======= + * Returns an IException representing the current stack, excluding this + * method. + * + * @return an IException representing a current stack trace + */ + /* + IException IException::createStackTrace() { + vector theStack; + StackTrace::GetStackTrace(&theStack); + QString message; + + for(unsigned int i = 1; i < theStack.size(); i++) { + message += (theStack[i] + "\n").c_str(); + } + + IException result; + if (theStack.size() != 0) { + result = IException(Unknown, message, NULL, -1); + } + + return result; + } + */ + + + /** +>>>>>>> fc0563741 (Initial move to core):isis/src/core/IException/IException.cpp * Returns the source of the error in string format for the given ErrorType. * * @param type the ErrorType enum to convert to a string @@ -727,4 +756,3 @@ namespace Isis { } } } - diff --git a/isis/src/base/objs/IException/IException.h b/isis/src/core/IException/IException.h similarity index 100% rename from isis/src/base/objs/IException/IException.h rename to isis/src/core/IException/IException.h diff --git a/isis/src/base/objs/IException/IException.truth b/isis/src/core/IException/IException.truth similarity index 100% rename from isis/src/base/objs/IException/IException.truth rename to isis/src/core/IException/IException.truth diff --git a/isis/src/base/objs/IException/Makefile b/isis/src/core/IException/Makefile similarity index 100% rename from isis/src/base/objs/IException/Makefile rename to isis/src/core/IException/Makefile diff --git a/isis/src/base/objs/IException/unitTest.cpp b/isis/src/core/IException/unitTest.cpp similarity index 100% rename from isis/src/base/objs/IException/unitTest.cpp rename to isis/src/core/IException/unitTest.cpp diff --git a/isis/src/base/objs/IException/unitTest.exclude b/isis/src/core/IException/unitTest.exclude similarity index 100% rename from isis/src/base/objs/IException/unitTest.exclude rename to isis/src/core/IException/unitTest.exclude diff --git a/isis/src/base/objs/IString/IString.cpp b/isis/src/core/IString/IString.cpp similarity index 100% rename from isis/src/base/objs/IString/IString.cpp rename to isis/src/core/IString/IString.cpp diff --git a/isis/src/base/objs/IString/IString.h b/isis/src/core/IString/IString.h similarity index 100% rename from isis/src/base/objs/IString/IString.h rename to isis/src/core/IString/IString.h diff --git a/isis/src/base/objs/IString/IString.truth b/isis/src/core/IString/IString.truth similarity index 100% rename from isis/src/base/objs/IString/IString.truth rename to isis/src/core/IString/IString.truth diff --git a/isis/src/base/objs/IString/Makefile b/isis/src/core/IString/Makefile similarity index 100% rename from isis/src/base/objs/IString/Makefile rename to isis/src/core/IString/Makefile diff --git a/isis/src/base/objs/IString/unitTest.cpp b/isis/src/core/IString/unitTest.cpp similarity index 100% rename from isis/src/base/objs/IString/unitTest.cpp rename to isis/src/core/IString/unitTest.cpp diff --git a/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp b/isis/src/core/LabelTranslationManager/LabelTranslationManager.cpp similarity index 100% rename from isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp rename to isis/src/core/LabelTranslationManager/LabelTranslationManager.cpp diff --git a/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.h b/isis/src/core/LabelTranslationManager/LabelTranslationManager.h similarity index 100% rename from isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.h rename to isis/src/core/LabelTranslationManager/LabelTranslationManager.h diff --git a/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.truth b/isis/src/core/LabelTranslationManager/LabelTranslationManager.truth similarity index 100% rename from isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.truth rename to isis/src/core/LabelTranslationManager/LabelTranslationManager.truth diff --git a/isis/src/base/objs/LabelTranslationManager/Makefile b/isis/src/core/LabelTranslationManager/Makefile similarity index 100% rename from isis/src/base/objs/LabelTranslationManager/Makefile rename to isis/src/core/LabelTranslationManager/Makefile diff --git a/isis/src/base/objs/LabelTranslationManager/unitTest.cpp b/isis/src/core/LabelTranslationManager/unitTest.cpp similarity index 100% rename from isis/src/base/objs/LabelTranslationManager/unitTest.cpp rename to isis/src/core/LabelTranslationManager/unitTest.cpp diff --git a/isis/src/base/objs/Message/ArraySubscriptNotInRange.cpp b/isis/src/core/Message/ArraySubscriptNotInRange.cpp similarity index 100% rename from isis/src/base/objs/Message/ArraySubscriptNotInRange.cpp rename to isis/src/core/Message/ArraySubscriptNotInRange.cpp diff --git a/isis/src/base/objs/Message/FileCreate.cpp b/isis/src/core/Message/FileCreate.cpp similarity index 100% rename from isis/src/base/objs/Message/FileCreate.cpp rename to isis/src/core/Message/FileCreate.cpp diff --git a/isis/src/base/objs/Message/FileOpen.cpp b/isis/src/core/Message/FileOpen.cpp similarity index 100% rename from isis/src/base/objs/Message/FileOpen.cpp rename to isis/src/core/Message/FileOpen.cpp diff --git a/isis/src/base/objs/Message/FileRead.cpp b/isis/src/core/Message/FileRead.cpp similarity index 100% rename from isis/src/base/objs/Message/FileRead.cpp rename to isis/src/core/Message/FileRead.cpp diff --git a/isis/src/base/objs/Message/FileWrite.cpp b/isis/src/core/Message/FileWrite.cpp similarity index 100% rename from isis/src/base/objs/Message/FileWrite.cpp rename to isis/src/core/Message/FileWrite.cpp diff --git a/isis/src/base/objs/Message/KeywordAmbiguous.cpp b/isis/src/core/Message/KeywordAmbiguous.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordAmbiguous.cpp rename to isis/src/core/Message/KeywordAmbiguous.cpp diff --git a/isis/src/base/objs/Message/KeywordBlockEndMissing.cpp b/isis/src/core/Message/KeywordBlockEndMissing.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordBlockEndMissing.cpp rename to isis/src/core/Message/KeywordBlockEndMissing.cpp diff --git a/isis/src/base/objs/Message/KeywordBlockInvalid.cpp b/isis/src/core/Message/KeywordBlockInvalid.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordBlockInvalid.cpp rename to isis/src/core/Message/KeywordBlockInvalid.cpp diff --git a/isis/src/base/objs/Message/KeywordBlockStartMissing.cpp b/isis/src/core/Message/KeywordBlockStartMissing.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordBlockStartMissing.cpp rename to isis/src/core/Message/KeywordBlockStartMissing.cpp diff --git a/isis/src/base/objs/Message/KeywordDuplicated.cpp b/isis/src/core/Message/KeywordDuplicated.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordDuplicated.cpp rename to isis/src/core/Message/KeywordDuplicated.cpp diff --git a/isis/src/base/objs/Message/KeywordNotArray.cpp b/isis/src/core/Message/KeywordNotArray.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordNotArray.cpp rename to isis/src/core/Message/KeywordNotArray.cpp diff --git a/isis/src/base/objs/Message/KeywordNotFound.cpp b/isis/src/core/Message/KeywordNotFound.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordNotFound.cpp rename to isis/src/core/Message/KeywordNotFound.cpp diff --git a/isis/src/base/objs/Message/KeywordUnrecognized.cpp b/isis/src/core/Message/KeywordUnrecognized.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordUnrecognized.cpp rename to isis/src/core/Message/KeywordUnrecognized.cpp diff --git a/isis/src/base/objs/Message/KeywordValueBad.cpp b/isis/src/core/Message/KeywordValueBad.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordValueBad.cpp rename to isis/src/core/Message/KeywordValueBad.cpp diff --git a/isis/src/base/objs/Message/KeywordValueExpected.cpp b/isis/src/core/Message/KeywordValueExpected.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordValueExpected.cpp rename to isis/src/core/Message/KeywordValueExpected.cpp diff --git a/isis/src/base/objs/Message/KeywordValueNotInList.cpp b/isis/src/core/Message/KeywordValueNotInList.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordValueNotInList.cpp rename to isis/src/core/Message/KeywordValueNotInList.cpp diff --git a/isis/src/base/objs/Message/KeywordValueNotInRange.cpp b/isis/src/core/Message/KeywordValueNotInRange.cpp similarity index 100% rename from isis/src/base/objs/Message/KeywordValueNotInRange.cpp rename to isis/src/core/Message/KeywordValueNotInRange.cpp diff --git a/isis/src/base/objs/Message/Makefile b/isis/src/core/Message/Makefile similarity index 100% rename from isis/src/base/objs/Message/Makefile rename to isis/src/core/Message/Makefile diff --git a/isis/src/base/objs/Message/MemoryAllocationFailed.cpp b/isis/src/core/Message/MemoryAllocationFailed.cpp similarity index 100% rename from isis/src/base/objs/Message/MemoryAllocationFailed.cpp rename to isis/src/core/Message/MemoryAllocationFailed.cpp diff --git a/isis/src/base/objs/Message/Message.h b/isis/src/core/Message/Message.h similarity index 100% rename from isis/src/base/objs/Message/Message.h rename to isis/src/core/Message/Message.h diff --git a/isis/src/base/objs/Message/Message.truth b/isis/src/core/Message/Message.truth similarity index 100% rename from isis/src/base/objs/Message/Message.truth rename to isis/src/core/Message/Message.truth diff --git a/isis/src/base/objs/Message/MissingDelimiter.cpp b/isis/src/core/Message/MissingDelimiter.cpp similarity index 100% rename from isis/src/base/objs/Message/MissingDelimiter.cpp rename to isis/src/core/Message/MissingDelimiter.cpp diff --git a/isis/src/base/objs/Message/unitTest.cpp b/isis/src/core/Message/unitTest.cpp similarity index 100% rename from isis/src/base/objs/Message/unitTest.cpp rename to isis/src/core/Message/unitTest.cpp diff --git a/isis/src/base/objs/Preference/Makefile b/isis/src/core/Preference/Makefile similarity index 100% rename from isis/src/base/objs/Preference/Makefile rename to isis/src/core/Preference/Makefile diff --git a/isis/src/base/objs/Preference/Preference.cpp b/isis/src/core/Preference/Preference.cpp similarity index 100% rename from isis/src/base/objs/Preference/Preference.cpp rename to isis/src/core/Preference/Preference.cpp diff --git a/isis/src/base/objs/Preference/Preference.h b/isis/src/core/Preference/Preference.h similarity index 100% rename from isis/src/base/objs/Preference/Preference.h rename to isis/src/core/Preference/Preference.h diff --git a/isis/src/base/objs/Preference/Preference.truth b/isis/src/core/Preference/Preference.truth similarity index 100% rename from isis/src/base/objs/Preference/Preference.truth rename to isis/src/core/Preference/Preference.truth diff --git a/isis/src/base/objs/Preference/unitTest.cpp b/isis/src/core/Preference/unitTest.cpp similarity index 100% rename from isis/src/base/objs/Preference/unitTest.cpp rename to isis/src/core/Preference/unitTest.cpp diff --git a/isis/src/core/Pvl/CMakeLists.txt b/isis/src/core/Pvl/CMakeLists.txt new file mode 100644 index 0000000000..16ad6da342 --- /dev/null +++ b/isis/src/core/Pvl/CMakeLists.txt @@ -0,0 +1,6 @@ +set(Pvl_source_files + Pvl.cpp + Pvl.h +) + +add_library(Pvl ${Pvl_source_files}) diff --git a/isis/src/base/objs/Pvl/Makefile b/isis/src/core/Pvl/Makefile similarity index 100% rename from isis/src/base/objs/Pvl/Makefile rename to isis/src/core/Pvl/Makefile diff --git a/isis/src/base/objs/Pvl/Pvl.cpp b/isis/src/core/Pvl/Pvl.cpp similarity index 100% rename from isis/src/base/objs/Pvl/Pvl.cpp rename to isis/src/core/Pvl/Pvl.cpp diff --git a/isis/src/base/objs/Pvl/Pvl.h b/isis/src/core/Pvl/Pvl.h similarity index 100% rename from isis/src/base/objs/Pvl/Pvl.h rename to isis/src/core/Pvl/Pvl.h diff --git a/isis/src/base/objs/Pvl/Pvl.truth b/isis/src/core/Pvl/Pvl.truth similarity index 100% rename from isis/src/base/objs/Pvl/Pvl.truth rename to isis/src/core/Pvl/Pvl.truth diff --git a/isis/src/base/objs/Pvl/cnetstatsTest.def b/isis/src/core/Pvl/cnetstatsTest.def similarity index 100% rename from isis/src/base/objs/Pvl/cnetstatsTest.def rename to isis/src/core/Pvl/cnetstatsTest.def diff --git a/isis/src/base/objs/Pvl/pointdef.def b/isis/src/core/Pvl/pointdef.def similarity index 100% rename from isis/src/base/objs/Pvl/pointdef.def rename to isis/src/core/Pvl/pointdef.def diff --git a/isis/src/base/objs/Pvl/unitTest.cpp b/isis/src/core/Pvl/unitTest.cpp similarity index 100% rename from isis/src/base/objs/Pvl/unitTest.cpp rename to isis/src/core/Pvl/unitTest.cpp diff --git a/isis/src/base/objs/Pvl/unitTest.pvl b/isis/src/core/Pvl/unitTest.pvl similarity index 100% rename from isis/src/base/objs/Pvl/unitTest.pvl rename to isis/src/core/Pvl/unitTest.pvl diff --git a/isis/src/base/objs/Pvl/unitTest2.pvl b/isis/src/core/Pvl/unitTest2.pvl similarity index 100% rename from isis/src/base/objs/Pvl/unitTest2.pvl rename to isis/src/core/Pvl/unitTest2.pvl diff --git a/isis/src/base/objs/Pvl/unitTest3.pvl b/isis/src/core/Pvl/unitTest3.pvl similarity index 100% rename from isis/src/base/objs/Pvl/unitTest3.pvl rename to isis/src/core/Pvl/unitTest3.pvl diff --git a/isis/src/base/objs/Pvl/unitTest4.pvl b/isis/src/core/Pvl/unitTest4.pvl similarity index 100% rename from isis/src/base/objs/Pvl/unitTest4.pvl rename to isis/src/core/Pvl/unitTest4.pvl diff --git a/isis/src/base/objs/PvlContainer/Makefile b/isis/src/core/PvlContainer/Makefile similarity index 100% rename from isis/src/base/objs/PvlContainer/Makefile rename to isis/src/core/PvlContainer/Makefile diff --git a/isis/src/base/objs/PvlContainer/PvlContainer.cpp b/isis/src/core/PvlContainer/PvlContainer.cpp similarity index 100% rename from isis/src/base/objs/PvlContainer/PvlContainer.cpp rename to isis/src/core/PvlContainer/PvlContainer.cpp diff --git a/isis/src/base/objs/PvlContainer/PvlContainer.h b/isis/src/core/PvlContainer/PvlContainer.h similarity index 100% rename from isis/src/base/objs/PvlContainer/PvlContainer.h rename to isis/src/core/PvlContainer/PvlContainer.h diff --git a/isis/src/base/objs/PvlContainer/PvlContainer.truth b/isis/src/core/PvlContainer/PvlContainer.truth similarity index 100% rename from isis/src/base/objs/PvlContainer/PvlContainer.truth rename to isis/src/core/PvlContainer/PvlContainer.truth diff --git a/isis/src/base/objs/PvlContainer/unitTest.cpp b/isis/src/core/PvlContainer/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlContainer/unitTest.cpp rename to isis/src/core/PvlContainer/unitTest.cpp diff --git a/isis/src/base/objs/PvlEditDialog/Makefile b/isis/src/core/PvlEditDialog/Makefile similarity index 100% rename from isis/src/base/objs/PvlEditDialog/Makefile rename to isis/src/core/PvlEditDialog/Makefile diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp b/isis/src/core/PvlEditDialog/PvlEditDialog.cpp similarity index 100% rename from isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp rename to isis/src/core/PvlEditDialog/PvlEditDialog.cpp diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.h b/isis/src/core/PvlEditDialog/PvlEditDialog.h similarity index 100% rename from isis/src/base/objs/PvlEditDialog/PvlEditDialog.h rename to isis/src/core/PvlEditDialog/PvlEditDialog.h diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.truth b/isis/src/core/PvlEditDialog/PvlEditDialog.truth similarity index 100% rename from isis/src/base/objs/PvlEditDialog/PvlEditDialog.truth rename to isis/src/core/PvlEditDialog/PvlEditDialog.truth diff --git a/isis/src/base/objs/PvlEditDialog/unitTest.cpp b/isis/src/core/PvlEditDialog/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlEditDialog/unitTest.cpp rename to isis/src/core/PvlEditDialog/unitTest.cpp diff --git a/isis/src/base/objs/PvlFlatMap/Makefile b/isis/src/core/PvlFlatMap/Makefile similarity index 100% rename from isis/src/base/objs/PvlFlatMap/Makefile rename to isis/src/core/PvlFlatMap/Makefile diff --git a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp b/isis/src/core/PvlFlatMap/PvlFlatMap.cpp similarity index 100% rename from isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp rename to isis/src/core/PvlFlatMap/PvlFlatMap.cpp diff --git a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.h b/isis/src/core/PvlFlatMap/PvlFlatMap.h similarity index 100% rename from isis/src/base/objs/PvlFlatMap/PvlFlatMap.h rename to isis/src/core/PvlFlatMap/PvlFlatMap.h diff --git a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.truth b/isis/src/core/PvlFlatMap/PvlFlatMap.truth similarity index 100% rename from isis/src/base/objs/PvlFlatMap/PvlFlatMap.truth rename to isis/src/core/PvlFlatMap/PvlFlatMap.truth diff --git a/isis/src/base/objs/PvlFlatMap/unitTest.cpp b/isis/src/core/PvlFlatMap/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlFlatMap/unitTest.cpp rename to isis/src/core/PvlFlatMap/unitTest.cpp diff --git a/isis/src/base/objs/PvlFormat/Makefile b/isis/src/core/PvlFormat/Makefile similarity index 100% rename from isis/src/base/objs/PvlFormat/Makefile rename to isis/src/core/PvlFormat/Makefile diff --git a/isis/src/base/objs/PvlFormat/PvlFormat.cpp b/isis/src/core/PvlFormat/PvlFormat.cpp similarity index 100% rename from isis/src/base/objs/PvlFormat/PvlFormat.cpp rename to isis/src/core/PvlFormat/PvlFormat.cpp diff --git a/isis/src/base/objs/PvlFormat/PvlFormat.h b/isis/src/core/PvlFormat/PvlFormat.h similarity index 100% rename from isis/src/base/objs/PvlFormat/PvlFormat.h rename to isis/src/core/PvlFormat/PvlFormat.h diff --git a/isis/src/base/objs/PvlFormat/PvlFormat.truth b/isis/src/core/PvlFormat/PvlFormat.truth similarity index 100% rename from isis/src/base/objs/PvlFormat/PvlFormat.truth rename to isis/src/core/PvlFormat/PvlFormat.truth diff --git a/isis/src/base/objs/PvlFormat/unitTest.cpp b/isis/src/core/PvlFormat/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlFormat/unitTest.cpp rename to isis/src/core/PvlFormat/unitTest.cpp diff --git a/isis/src/base/objs/PvlFormatPds/Makefile b/isis/src/core/PvlFormatPds/Makefile similarity index 100% rename from isis/src/base/objs/PvlFormatPds/Makefile rename to isis/src/core/PvlFormatPds/Makefile diff --git a/isis/src/base/objs/PvlFormatPds/PvlFormatPds.cpp b/isis/src/core/PvlFormatPds/PvlFormatPds.cpp similarity index 100% rename from isis/src/base/objs/PvlFormatPds/PvlFormatPds.cpp rename to isis/src/core/PvlFormatPds/PvlFormatPds.cpp diff --git a/isis/src/base/objs/PvlFormatPds/PvlFormatPds.h b/isis/src/core/PvlFormatPds/PvlFormatPds.h similarity index 100% rename from isis/src/base/objs/PvlFormatPds/PvlFormatPds.h rename to isis/src/core/PvlFormatPds/PvlFormatPds.h diff --git a/isis/src/base/objs/PvlFormatPds/PvlFormatPds.truth b/isis/src/core/PvlFormatPds/PvlFormatPds.truth similarity index 100% rename from isis/src/base/objs/PvlFormatPds/PvlFormatPds.truth rename to isis/src/core/PvlFormatPds/PvlFormatPds.truth diff --git a/isis/src/base/objs/PvlFormatPds/unitTest.cpp b/isis/src/core/PvlFormatPds/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlFormatPds/unitTest.cpp rename to isis/src/core/PvlFormatPds/unitTest.cpp diff --git a/isis/src/base/objs/PvlGroup/Makefile b/isis/src/core/PvlGroup/Makefile similarity index 100% rename from isis/src/base/objs/PvlGroup/Makefile rename to isis/src/core/PvlGroup/Makefile diff --git a/isis/src/base/objs/PvlGroup/PvlGroup.cpp b/isis/src/core/PvlGroup/PvlGroup.cpp similarity index 100% rename from isis/src/base/objs/PvlGroup/PvlGroup.cpp rename to isis/src/core/PvlGroup/PvlGroup.cpp diff --git a/isis/src/base/objs/PvlGroup/PvlGroup.h b/isis/src/core/PvlGroup/PvlGroup.h similarity index 100% rename from isis/src/base/objs/PvlGroup/PvlGroup.h rename to isis/src/core/PvlGroup/PvlGroup.h diff --git a/isis/src/base/objs/PvlGroup/PvlGroup.truth b/isis/src/core/PvlGroup/PvlGroup.truth similarity index 100% rename from isis/src/base/objs/PvlGroup/PvlGroup.truth rename to isis/src/core/PvlGroup/PvlGroup.truth diff --git a/isis/src/base/objs/PvlGroup/unitTest.cpp b/isis/src/core/PvlGroup/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlGroup/unitTest.cpp rename to isis/src/core/PvlGroup/unitTest.cpp diff --git a/isis/src/core/PvlKeyword/CMakeLists.txt b/isis/src/core/PvlKeyword/CMakeLists.txt new file mode 100644 index 0000000000..824ea8fdcd --- /dev/null +++ b/isis/src/core/PvlKeyword/CMakeLists.txt @@ -0,0 +1,6 @@ +set(PvlKeyword_source_files + PvlKeyword.cpp + PvlKeyword.h +) + +add_library(PvlKeyword ${PvlKeyword_source_files}) diff --git a/isis/src/base/objs/PvlKeyword/Makefile b/isis/src/core/PvlKeyword/Makefile similarity index 100% rename from isis/src/base/objs/PvlKeyword/Makefile rename to isis/src/core/PvlKeyword/Makefile diff --git a/isis/src/base/objs/PvlKeyword/PvlKeyword.cpp b/isis/src/core/PvlKeyword/PvlKeyword.cpp similarity index 99% rename from isis/src/base/objs/PvlKeyword/PvlKeyword.cpp rename to isis/src/core/PvlKeyword/PvlKeyword.cpp index 0fa0aca35b..b37ce09b44 100644 --- a/isis/src/base/objs/PvlKeyword/PvlKeyword.cpp +++ b/isis/src/core/PvlKeyword/PvlKeyword.cpp @@ -222,6 +222,11 @@ namespace Isis { m_units->resize(m_values.size()); } +<<<<<<< HEAD:isis/src/base/objs/PvlKeyword/PvlKeyword.cpp +======= + //ASSERT(i < (int) m_units->size()); + +>>>>>>> fc0563741 (Initial move to core):isis/src/core/PvlKeyword/PvlKeyword.cpp (*m_units)[i] = units; } else { diff --git a/isis/src/base/objs/PvlKeyword/PvlKeyword.h b/isis/src/core/PvlKeyword/PvlKeyword.h similarity index 100% rename from isis/src/base/objs/PvlKeyword/PvlKeyword.h rename to isis/src/core/PvlKeyword/PvlKeyword.h diff --git a/isis/src/core/PvlObject/CMakeLists.txt b/isis/src/core/PvlObject/CMakeLists.txt new file mode 100644 index 0000000000..22d51cbe2f --- /dev/null +++ b/isis/src/core/PvlObject/CMakeLists.txt @@ -0,0 +1,4 @@ +set(PVLObject_source_files + PvlObject.cpp + PvlObject.h +) diff --git a/isis/src/base/objs/PvlObject/Makefile b/isis/src/core/PvlObject/Makefile similarity index 100% rename from isis/src/base/objs/PvlObject/Makefile rename to isis/src/core/PvlObject/Makefile diff --git a/isis/src/base/objs/PvlObject/PvlObject.cpp b/isis/src/core/PvlObject/PvlObject.cpp similarity index 100% rename from isis/src/base/objs/PvlObject/PvlObject.cpp rename to isis/src/core/PvlObject/PvlObject.cpp diff --git a/isis/src/base/objs/PvlObject/PvlObject.h b/isis/src/core/PvlObject/PvlObject.h similarity index 100% rename from isis/src/base/objs/PvlObject/PvlObject.h rename to isis/src/core/PvlObject/PvlObject.h diff --git a/isis/src/base/objs/PvlSequence/Makefile b/isis/src/core/PvlSequence/Makefile similarity index 100% rename from isis/src/base/objs/PvlSequence/Makefile rename to isis/src/core/PvlSequence/Makefile diff --git a/isis/src/base/objs/PvlSequence/PvlSequence.cpp b/isis/src/core/PvlSequence/PvlSequence.cpp similarity index 100% rename from isis/src/base/objs/PvlSequence/PvlSequence.cpp rename to isis/src/core/PvlSequence/PvlSequence.cpp diff --git a/isis/src/base/objs/PvlSequence/PvlSequence.h b/isis/src/core/PvlSequence/PvlSequence.h similarity index 100% rename from isis/src/base/objs/PvlSequence/PvlSequence.h rename to isis/src/core/PvlSequence/PvlSequence.h diff --git a/isis/src/base/objs/PvlSequence/PvlSequence.truth b/isis/src/core/PvlSequence/PvlSequence.truth similarity index 100% rename from isis/src/base/objs/PvlSequence/PvlSequence.truth rename to isis/src/core/PvlSequence/PvlSequence.truth diff --git a/isis/src/base/objs/PvlSequence/unitTest.cpp b/isis/src/core/PvlSequence/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlSequence/unitTest.cpp rename to isis/src/core/PvlSequence/unitTest.cpp diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/Makefile b/isis/src/core/PvlToPvlTranslationManager/Makefile similarity index 100% rename from isis/src/base/objs/PvlToPvlTranslationManager/Makefile rename to isis/src/core/PvlToPvlTranslationManager/Makefile diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp b/isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp similarity index 100% rename from isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp rename to isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h b/isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h similarity index 100% rename from isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h rename to isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth b/isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth similarity index 100% rename from isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth rename to isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp b/isis/src/core/PvlToPvlTranslationManager/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp rename to isis/src/core/PvlToPvlTranslationManager/unitTest.cpp diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/Makefile b/isis/src/core/PvlToXmlTranslationManager/Makefile similarity index 100% rename from isis/src/base/objs/PvlToXmlTranslationManager/Makefile rename to isis/src/core/PvlToXmlTranslationManager/Makefile diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp b/isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp similarity index 100% rename from isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp rename to isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h b/isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h similarity index 100% rename from isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h rename to isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth b/isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth similarity index 100% rename from isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth rename to isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp b/isis/src/core/PvlToXmlTranslationManager/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp rename to isis/src/core/PvlToXmlTranslationManager/unitTest.cpp diff --git a/isis/src/base/objs/PvlToken/Makefile b/isis/src/core/PvlToken/Makefile similarity index 100% rename from isis/src/base/objs/PvlToken/Makefile rename to isis/src/core/PvlToken/Makefile diff --git a/isis/src/base/objs/PvlToken/PvlToken.cpp b/isis/src/core/PvlToken/PvlToken.cpp similarity index 100% rename from isis/src/base/objs/PvlToken/PvlToken.cpp rename to isis/src/core/PvlToken/PvlToken.cpp diff --git a/isis/src/base/objs/PvlToken/PvlToken.h b/isis/src/core/PvlToken/PvlToken.h similarity index 100% rename from isis/src/base/objs/PvlToken/PvlToken.h rename to isis/src/core/PvlToken/PvlToken.h diff --git a/isis/src/base/objs/PvlToken/PvlToken.truth b/isis/src/core/PvlToken/PvlToken.truth similarity index 100% rename from isis/src/base/objs/PvlToken/PvlToken.truth rename to isis/src/core/PvlToken/PvlToken.truth diff --git a/isis/src/base/objs/PvlToken/unitTest.cpp b/isis/src/core/PvlToken/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlToken/unitTest.cpp rename to isis/src/core/PvlToken/unitTest.cpp diff --git a/isis/src/base/objs/PvlTokenizer/Makefile b/isis/src/core/PvlTokenizer/Makefile similarity index 100% rename from isis/src/base/objs/PvlTokenizer/Makefile rename to isis/src/core/PvlTokenizer/Makefile diff --git a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp b/isis/src/core/PvlTokenizer/PvlTokenizer.cpp similarity index 100% rename from isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp rename to isis/src/core/PvlTokenizer/PvlTokenizer.cpp diff --git a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.h b/isis/src/core/PvlTokenizer/PvlTokenizer.h similarity index 100% rename from isis/src/base/objs/PvlTokenizer/PvlTokenizer.h rename to isis/src/core/PvlTokenizer/PvlTokenizer.h diff --git a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.truth b/isis/src/core/PvlTokenizer/PvlTokenizer.truth similarity index 100% rename from isis/src/base/objs/PvlTokenizer/PvlTokenizer.truth rename to isis/src/core/PvlTokenizer/PvlTokenizer.truth diff --git a/isis/src/base/objs/PvlTokenizer/unitTest.cpp b/isis/src/core/PvlTokenizer/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlTokenizer/unitTest.cpp rename to isis/src/core/PvlTokenizer/unitTest.cpp diff --git a/isis/src/base/objs/PvlTranslationTable/Makefile b/isis/src/core/PvlTranslationTable/Makefile similarity index 100% rename from isis/src/base/objs/PvlTranslationTable/Makefile rename to isis/src/core/PvlTranslationTable/Makefile diff --git a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp b/isis/src/core/PvlTranslationTable/PvlTranslationTable.cpp similarity index 100% rename from isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp rename to isis/src/core/PvlTranslationTable/PvlTranslationTable.cpp diff --git a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.h b/isis/src/core/PvlTranslationTable/PvlTranslationTable.h similarity index 100% rename from isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.h rename to isis/src/core/PvlTranslationTable/PvlTranslationTable.h diff --git a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.truth b/isis/src/core/PvlTranslationTable/PvlTranslationTable.truth similarity index 100% rename from isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.truth rename to isis/src/core/PvlTranslationTable/PvlTranslationTable.truth diff --git a/isis/src/base/objs/PvlTranslationTable/unitTest.cpp b/isis/src/core/PvlTranslationTable/unitTest.cpp similarity index 100% rename from isis/src/base/objs/PvlTranslationTable/unitTest.cpp rename to isis/src/core/PvlTranslationTable/unitTest.cpp diff --git a/isis/src/base/objs/SpecialPixel/Makefile b/isis/src/core/SpecialPixel/Makefile similarity index 100% rename from isis/src/base/objs/SpecialPixel/Makefile rename to isis/src/core/SpecialPixel/Makefile diff --git a/isis/src/base/objs/SpecialPixel/SpecialPixel.h b/isis/src/core/SpecialPixel/SpecialPixel.h similarity index 100% rename from isis/src/base/objs/SpecialPixel/SpecialPixel.h rename to isis/src/core/SpecialPixel/SpecialPixel.h diff --git a/isis/src/base/objs/SpecialPixel/SpecialPixel.truth b/isis/src/core/SpecialPixel/SpecialPixel.truth similarity index 100% rename from isis/src/base/objs/SpecialPixel/SpecialPixel.truth rename to isis/src/core/SpecialPixel/SpecialPixel.truth diff --git a/isis/src/base/objs/SpecialPixel/unitTest.cpp b/isis/src/core/SpecialPixel/unitTest.cpp similarity index 100% rename from isis/src/base/objs/SpecialPixel/unitTest.cpp rename to isis/src/core/SpecialPixel/unitTest.cpp diff --git a/isis/src/base/objs/TextFile/Makefile b/isis/src/core/TextFile/Makefile similarity index 100% rename from isis/src/base/objs/TextFile/Makefile rename to isis/src/core/TextFile/Makefile diff --git a/isis/src/base/objs/TextFile/TextFile.cpp b/isis/src/core/TextFile/TextFile.cpp similarity index 100% rename from isis/src/base/objs/TextFile/TextFile.cpp rename to isis/src/core/TextFile/TextFile.cpp diff --git a/isis/src/base/objs/TextFile/TextFile.h b/isis/src/core/TextFile/TextFile.h similarity index 100% rename from isis/src/base/objs/TextFile/TextFile.h rename to isis/src/core/TextFile/TextFile.h diff --git a/isis/src/base/objs/TextFile/TextFile.truth b/isis/src/core/TextFile/TextFile.truth similarity index 100% rename from isis/src/base/objs/TextFile/TextFile.truth rename to isis/src/core/TextFile/TextFile.truth diff --git a/isis/src/base/objs/TextFile/unitTest.cpp b/isis/src/core/TextFile/unitTest.cpp similarity index 100% rename from isis/src/base/objs/TextFile/unitTest.cpp rename to isis/src/core/TextFile/unitTest.cpp From 5f3cfd0616163a690d7b57ce90147b881e3f3b6a Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 16 Oct 2020 13:24:03 -0700 Subject: [PATCH 03/95] Removed Pvl cmakelists --- isis/src/core/Pvl/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 isis/src/core/Pvl/CMakeLists.txt diff --git a/isis/src/core/Pvl/CMakeLists.txt b/isis/src/core/Pvl/CMakeLists.txt deleted file mode 100644 index 16ad6da342..0000000000 --- a/isis/src/core/Pvl/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set(Pvl_source_files - Pvl.cpp - Pvl.h -) - -add_library(Pvl ${Pvl_source_files}) From 0751b3872e0bb1c9c70b3bdfca569ad7dab33d7d Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 16 Oct 2020 13:25:15 -0700 Subject: [PATCH 04/95] Removed more cmakelists.txt --- isis/src/core/PvlKeyword/CMakeLists.txt | 6 ------ isis/src/core/PvlObject/CMakeLists.txt | 4 ---- 2 files changed, 10 deletions(-) delete mode 100644 isis/src/core/PvlKeyword/CMakeLists.txt delete mode 100644 isis/src/core/PvlObject/CMakeLists.txt diff --git a/isis/src/core/PvlKeyword/CMakeLists.txt b/isis/src/core/PvlKeyword/CMakeLists.txt deleted file mode 100644 index 824ea8fdcd..0000000000 --- a/isis/src/core/PvlKeyword/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set(PvlKeyword_source_files - PvlKeyword.cpp - PvlKeyword.h -) - -add_library(PvlKeyword ${PvlKeyword_source_files}) diff --git a/isis/src/core/PvlObject/CMakeLists.txt b/isis/src/core/PvlObject/CMakeLists.txt deleted file mode 100644 index 22d51cbe2f..0000000000 --- a/isis/src/core/PvlObject/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -set(PVLObject_source_files - PvlObject.cpp - PvlObject.h -) From acdc7eeed776503b71dbe8bf2b4a4c9ab7481874 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 16 Oct 2020 14:47:37 -0700 Subject: [PATCH 05/95] Add subdirectory --- isis/src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isis/src/CMakeLists.txt b/isis/src/CMakeLists.txt index 998a0bdb64..0cf6591a3e 100644 --- a/isis/src/CMakeLists.txt +++ b/isis/src/CMakeLists.txt @@ -6,6 +6,8 @@ get_subdirectory_list(${CMAKE_CURRENT_LIST_DIR} modules) # build core into isis library add_isis_module(${CORE_LIB_NAME} ${CORE_LIST}) +add_subdirectory(core) + # remove duplicates so we dont build to the core targets twice foreach(core ${CORE_LIST}) list(REMOVE_ITEM modules "${CMAKE_CURRENT_LIST_DIR}/${core}") @@ -15,5 +17,3 @@ foreach( mod ${modules} ) string(REPLACE "${CMAKE_CURRENT_LIST_DIR}/" "" strippedmod ${mod}) add_isis_module(${strippedmod} ${strippedmod}) endforeach() - - From 1ca6ec0ba245352d09c92e4f64e74799282d9987 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Thu, 22 Oct 2020 11:39:07 -0700 Subject: [PATCH 06/95] Fully modularized core --- isis/src/core/CMakeLists.txt | 73 +- isis/src/core/Constants/Makefile | 7 - isis/src/core/FileName/FileName.truth | 709 ------------------ isis/src/core/FileName/Makefile | 7 - isis/src/core/IException/Makefile | 7 - isis/src/core/IException/unitTest.exclude | 1 - isis/src/core/IString/IString.truth | 195 ----- isis/src/core/IString/Makefile | 7 - .../LabelTranslationManager.truth | 59 -- .../src/core/LabelTranslationManager/Makefile | 7 - isis/src/core/Message/Makefile | 7 - isis/src/core/Message/Message.truth | 28 - isis/src/core/Preference/Makefile | 7 - isis/src/core/Preference/Preference.truth | 13 - isis/src/core/Pvl/Makefile | 7 - isis/src/core/Pvl/Pvl.truth | 381 ---------- isis/src/core/Pvl/cnetstatsTest.def | 21 - isis/src/core/Pvl/pointdef.def | 18 - isis/src/core/Pvl/unitTest.pvl | 34 - isis/src/core/Pvl/unitTest2.pvl | 12 - isis/src/core/Pvl/unitTest3.pvl | 12 - isis/src/core/Pvl/unitTest4.pvl | 224 ------ isis/src/core/PvlContainer/Makefile | 7 - isis/src/core/PvlContainer/PvlContainer.truth | 14 - isis/src/core/PvlEditDialog/Makefile | 7 - .../core/PvlEditDialog/PvlEditDialog.truth | 3 - isis/src/core/PvlFlatMap/Makefile | 7 - isis/src/core/PvlFlatMap/PvlFlatMap.truth | 209 ------ isis/src/core/PvlFormat/Makefile | 7 - isis/src/core/PvlFormat/PvlFormat.truth | 34 - isis/src/core/PvlFormatPds/Makefile | 7 - isis/src/core/PvlFormatPds/PvlFormatPds.truth | 260 ------- isis/src/core/PvlGroup/Makefile | 7 - isis/src/core/PvlGroup/PvlGroup.truth | 68 -- isis/src/core/PvlKeyword/Makefile | 7 - isis/src/core/PvlObject/Makefile | 7 - isis/src/core/PvlSequence/Makefile | 7 - isis/src/core/PvlSequence/PvlSequence.truth | 10 - .../core/PvlToPvlTranslationManager/Makefile | 7 - .../PvlToPvlTranslationManager.truth | 51 -- .../core/PvlToXmlTranslationManager/Makefile | 7 - .../PvlToXmlTranslationManager.truth | 52 -- isis/src/core/PvlToken/Makefile | 7 - isis/src/core/PvlToken/PvlToken.truth | 18 - isis/src/core/PvlTokenizer/Makefile | 7 - isis/src/core/PvlTokenizer/PvlTokenizer.truth | 44 -- isis/src/core/PvlTranslationTable/Makefile | 7 - .../PvlTranslationTable.truth | 43 -- isis/src/core/SpecialPixel/Makefile | 7 - isis/src/core/SpecialPixel/SpecialPixel.truth | 144 ---- isis/src/core/TextFile/Makefile | 7 - isis/src/core/TextFile/TextFile.truth | 43 -- isis/src/core/cmake/FindCSPICE.cmake | 18 + isis/src/core/cmake/FindGeos.cmake | 24 + .../core/{Constants => include}/Constants.h | 0 .../src/core/{FileName => include}/FileName.h | 0 .../core/{IException => include}/IException.h | 0 isis/src/core/{IString => include}/IString.h | 0 .../LabelTranslationManager.h | 0 isis/src/core/{Message => include}/Message.h | 0 .../core/{Preference => include}/Preference.h | 0 isis/src/core/{Pvl => include}/Pvl.h | 0 .../{PvlContainer => include}/PvlContainer.h | 0 .../core/{PvlFlatMap => include}/PvlFlatMap.h | 0 .../core/{PvlFormat => include}/PvlFormat.h | 0 .../{PvlFormatPds => include}/PvlFormatPds.h | 0 .../src/core/{PvlGroup => include}/PvlGroup.h | 0 .../core/{PvlKeyword => include}/PvlKeyword.h | 0 .../core/{PvlObject => include}/PvlObject.h | 0 .../{PvlSequence => include}/PvlSequence.h | 0 .../PvlToPvlTranslationManager.h | 0 .../PvlToXmlTranslationManager.h | 0 .../src/core/{PvlToken => include}/PvlToken.h | 0 .../{PvlTokenizer => include}/PvlTokenizer.h | 0 .../PvlTranslationTable.h | 0 .../{SpecialPixel => include}/SpecialPixel.h | 0 .../src/core/{TextFile => include}/TextFile.h | 0 .../ArraySubscriptNotInRange.cpp | 0 isis/src/core/{Message => src}/FileCreate.cpp | 0 isis/src/core/{FileName => src}/FileName.cpp | 0 isis/src/core/{Message => src}/FileOpen.cpp | 0 isis/src/core/{Message => src}/FileRead.cpp | 0 isis/src/core/{Message => src}/FileWrite.cpp | 0 .../core/{IException => src}/IException.cpp | 0 isis/src/core/{IString => src}/IString.cpp | 0 .../{Message => src}/KeywordAmbiguous.cpp | 0 .../KeywordBlockEndMissing.cpp | 0 .../{Message => src}/KeywordBlockInvalid.cpp | 0 .../KeywordBlockStartMissing.cpp | 0 .../{Message => src}/KeywordDuplicated.cpp | 0 .../core/{Message => src}/KeywordNotArray.cpp | 0 .../core/{Message => src}/KeywordNotFound.cpp | 0 .../{Message => src}/KeywordUnrecognized.cpp | 0 .../core/{Message => src}/KeywordValueBad.cpp | 0 .../{Message => src}/KeywordValueExpected.cpp | 0 .../KeywordValueNotInList.cpp | 0 .../KeywordValueNotInRange.cpp | 0 .../LabelTranslationManager.cpp | 0 .../MemoryAllocationFailed.cpp | 0 .../{Message => src}/MissingDelimiter.cpp | 0 .../core/{Preference => src}/Preference.cpp | 0 isis/src/core/{Pvl => src}/Pvl.cpp | 0 .../{PvlContainer => src}/PvlContainer.cpp | 0 .../core/{PvlFlatMap => src}/PvlFlatMap.cpp | 0 .../src/core/{PvlFormat => src}/PvlFormat.cpp | 0 .../{PvlFormatPds => src}/PvlFormatPds.cpp | 0 isis/src/core/{PvlGroup => src}/PvlGroup.cpp | 0 .../core/{PvlKeyword => src}/PvlKeyword.cpp | 0 .../src/core/{PvlObject => src}/PvlObject.cpp | 0 .../core/{PvlSequence => src}/PvlSequence.cpp | 0 .../PvlToPvlTranslationManager.cpp | 0 .../PvlToXmlTranslationManager.cpp | 0 isis/src/core/{PvlToken => src}/PvlToken.cpp | 0 .../{PvlTokenizer => src}/PvlTokenizer.cpp | 0 .../PvlTranslationTable.cpp | 0 isis/src/core/{TextFile => src}/TextFile.cpp | 0 isis/src/core/tests/CMakeLists.txt | 11 + isis/src/core/tests/IsisCoreTestMain.cpp | 6 + 118 files changed, 86 insertions(+), 2914 deletions(-) delete mode 100644 isis/src/core/Constants/Makefile delete mode 100644 isis/src/core/FileName/FileName.truth delete mode 100644 isis/src/core/FileName/Makefile delete mode 100644 isis/src/core/IException/Makefile delete mode 100644 isis/src/core/IException/unitTest.exclude delete mode 100644 isis/src/core/IString/IString.truth delete mode 100644 isis/src/core/IString/Makefile delete mode 100644 isis/src/core/LabelTranslationManager/LabelTranslationManager.truth delete mode 100644 isis/src/core/LabelTranslationManager/Makefile delete mode 100644 isis/src/core/Message/Makefile delete mode 100644 isis/src/core/Message/Message.truth delete mode 100644 isis/src/core/Preference/Makefile delete mode 100644 isis/src/core/Preference/Preference.truth delete mode 100644 isis/src/core/Pvl/Makefile delete mode 100644 isis/src/core/Pvl/Pvl.truth delete mode 100644 isis/src/core/Pvl/cnetstatsTest.def delete mode 100644 isis/src/core/Pvl/pointdef.def delete mode 100644 isis/src/core/Pvl/unitTest.pvl delete mode 100644 isis/src/core/Pvl/unitTest2.pvl delete mode 100644 isis/src/core/Pvl/unitTest3.pvl delete mode 100644 isis/src/core/Pvl/unitTest4.pvl delete mode 100644 isis/src/core/PvlContainer/Makefile delete mode 100644 isis/src/core/PvlContainer/PvlContainer.truth delete mode 100644 isis/src/core/PvlEditDialog/Makefile delete mode 100644 isis/src/core/PvlEditDialog/PvlEditDialog.truth delete mode 100644 isis/src/core/PvlFlatMap/Makefile delete mode 100644 isis/src/core/PvlFlatMap/PvlFlatMap.truth delete mode 100644 isis/src/core/PvlFormat/Makefile delete mode 100644 isis/src/core/PvlFormat/PvlFormat.truth delete mode 100644 isis/src/core/PvlFormatPds/Makefile delete mode 100644 isis/src/core/PvlFormatPds/PvlFormatPds.truth delete mode 100644 isis/src/core/PvlGroup/Makefile delete mode 100644 isis/src/core/PvlGroup/PvlGroup.truth delete mode 100644 isis/src/core/PvlKeyword/Makefile delete mode 100644 isis/src/core/PvlObject/Makefile delete mode 100644 isis/src/core/PvlSequence/Makefile delete mode 100644 isis/src/core/PvlSequence/PvlSequence.truth delete mode 100644 isis/src/core/PvlToPvlTranslationManager/Makefile delete mode 100644 isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth delete mode 100644 isis/src/core/PvlToXmlTranslationManager/Makefile delete mode 100644 isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth delete mode 100644 isis/src/core/PvlToken/Makefile delete mode 100644 isis/src/core/PvlToken/PvlToken.truth delete mode 100644 isis/src/core/PvlTokenizer/Makefile delete mode 100644 isis/src/core/PvlTokenizer/PvlTokenizer.truth delete mode 100644 isis/src/core/PvlTranslationTable/Makefile delete mode 100644 isis/src/core/PvlTranslationTable/PvlTranslationTable.truth delete mode 100644 isis/src/core/SpecialPixel/Makefile delete mode 100644 isis/src/core/SpecialPixel/SpecialPixel.truth delete mode 100644 isis/src/core/TextFile/Makefile delete mode 100644 isis/src/core/TextFile/TextFile.truth create mode 100644 isis/src/core/cmake/FindCSPICE.cmake create mode 100644 isis/src/core/cmake/FindGeos.cmake rename isis/src/core/{Constants => include}/Constants.h (100%) rename isis/src/core/{FileName => include}/FileName.h (100%) rename isis/src/core/{IException => include}/IException.h (100%) rename isis/src/core/{IString => include}/IString.h (100%) rename isis/src/core/{LabelTranslationManager => include}/LabelTranslationManager.h (100%) rename isis/src/core/{Message => include}/Message.h (100%) rename isis/src/core/{Preference => include}/Preference.h (100%) rename isis/src/core/{Pvl => include}/Pvl.h (100%) rename isis/src/core/{PvlContainer => include}/PvlContainer.h (100%) rename isis/src/core/{PvlFlatMap => include}/PvlFlatMap.h (100%) rename isis/src/core/{PvlFormat => include}/PvlFormat.h (100%) rename isis/src/core/{PvlFormatPds => include}/PvlFormatPds.h (100%) rename isis/src/core/{PvlGroup => include}/PvlGroup.h (100%) rename isis/src/core/{PvlKeyword => include}/PvlKeyword.h (100%) rename isis/src/core/{PvlObject => include}/PvlObject.h (100%) rename isis/src/core/{PvlSequence => include}/PvlSequence.h (100%) rename isis/src/core/{PvlToPvlTranslationManager => include}/PvlToPvlTranslationManager.h (100%) rename isis/src/core/{PvlToXmlTranslationManager => include}/PvlToXmlTranslationManager.h (100%) rename isis/src/core/{PvlToken => include}/PvlToken.h (100%) rename isis/src/core/{PvlTokenizer => include}/PvlTokenizer.h (100%) rename isis/src/core/{PvlTranslationTable => include}/PvlTranslationTable.h (100%) rename isis/src/core/{SpecialPixel => include}/SpecialPixel.h (100%) rename isis/src/core/{TextFile => include}/TextFile.h (100%) rename isis/src/core/{Message => src}/ArraySubscriptNotInRange.cpp (100%) rename isis/src/core/{Message => src}/FileCreate.cpp (100%) rename isis/src/core/{FileName => src}/FileName.cpp (100%) rename isis/src/core/{Message => src}/FileOpen.cpp (100%) rename isis/src/core/{Message => src}/FileRead.cpp (100%) rename isis/src/core/{Message => src}/FileWrite.cpp (100%) rename isis/src/core/{IException => src}/IException.cpp (100%) rename isis/src/core/{IString => src}/IString.cpp (100%) rename isis/src/core/{Message => src}/KeywordAmbiguous.cpp (100%) rename isis/src/core/{Message => src}/KeywordBlockEndMissing.cpp (100%) rename isis/src/core/{Message => src}/KeywordBlockInvalid.cpp (100%) rename isis/src/core/{Message => src}/KeywordBlockStartMissing.cpp (100%) rename isis/src/core/{Message => src}/KeywordDuplicated.cpp (100%) rename isis/src/core/{Message => src}/KeywordNotArray.cpp (100%) rename isis/src/core/{Message => src}/KeywordNotFound.cpp (100%) rename isis/src/core/{Message => src}/KeywordUnrecognized.cpp (100%) rename isis/src/core/{Message => src}/KeywordValueBad.cpp (100%) rename isis/src/core/{Message => src}/KeywordValueExpected.cpp (100%) rename isis/src/core/{Message => src}/KeywordValueNotInList.cpp (100%) rename isis/src/core/{Message => src}/KeywordValueNotInRange.cpp (100%) rename isis/src/core/{LabelTranslationManager => src}/LabelTranslationManager.cpp (100%) rename isis/src/core/{Message => src}/MemoryAllocationFailed.cpp (100%) rename isis/src/core/{Message => src}/MissingDelimiter.cpp (100%) rename isis/src/core/{Preference => src}/Preference.cpp (100%) rename isis/src/core/{Pvl => src}/Pvl.cpp (100%) rename isis/src/core/{PvlContainer => src}/PvlContainer.cpp (100%) rename isis/src/core/{PvlFlatMap => src}/PvlFlatMap.cpp (100%) rename isis/src/core/{PvlFormat => src}/PvlFormat.cpp (100%) rename isis/src/core/{PvlFormatPds => src}/PvlFormatPds.cpp (100%) rename isis/src/core/{PvlGroup => src}/PvlGroup.cpp (100%) rename isis/src/core/{PvlKeyword => src}/PvlKeyword.cpp (100%) rename isis/src/core/{PvlObject => src}/PvlObject.cpp (100%) rename isis/src/core/{PvlSequence => src}/PvlSequence.cpp (100%) rename isis/src/core/{PvlToPvlTranslationManager => src}/PvlToPvlTranslationManager.cpp (100%) rename isis/src/core/{PvlToXmlTranslationManager => src}/PvlToXmlTranslationManager.cpp (100%) rename isis/src/core/{PvlToken => src}/PvlToken.cpp (100%) rename isis/src/core/{PvlTokenizer => src}/PvlTokenizer.cpp (100%) rename isis/src/core/{PvlTranslationTable => src}/PvlTranslationTable.cpp (100%) rename isis/src/core/{TextFile => src}/TextFile.cpp (100%) create mode 100644 isis/src/core/tests/CMakeLists.txt create mode 100644 isis/src/core/tests/IsisCoreTestMain.cpp diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 646428cc94..8595ec2c50 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -1,8 +1,9 @@ cmake_minimum_required(VERSION 3.10) -project (CORE VERSION 0.0.1) +project (core VERSION 0.0.1) option(buildStaticCore "Build libisis static as well as dynamic" OFF ) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") # Short and long name of this package set(PACKAGE "CORE") @@ -12,46 +13,16 @@ set(PACKAGE_NAME "USGS ISIS PVL CORE") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED True) -#include cmake files from isis root -get_filename_component(PARENT_DIR ../../ ABSOLUTE) -list(APPEND CMAKE_MODULE_PATH ${PARENT_DIR}/cmake) -message(${CMAKE_MODULE_PATH}) - -include(Utilities) - -FILE(GLOB_RECURSE Pvl_source_files ${PROJECT_SOURCE_DIR} *.h *.cpp) -list(FILTER Pvl_source_files EXCLUDE REGEX .*unitTest.cpp) - -set(reqLibs - geos - Qt -) - +FILE(GLOB_RECURSE Pvl_source_files ${PROJECT_SOURCE_DIR}/src *.cpp) # Define a target -add_library(CORE "${Pvl_source_files}") +add_library(core "${Pvl_source_files}") -MACRO(SUBDIRLIST result curdir) - FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) - SET(dirlist "") - FOREACH(child ${children}) - IF(IS_DIRECTORY ${curdir}/${child}) - LIST(APPEND dirlist ${child}) - ENDIF() - ENDFOREACH() - SET(${result} ${dirlist}) -ENDMACRO() - -SUBDIRLIST(subdirs ${PROJECT_SOURCE_DIR}) - -target_include_directories(CORE PUBLIC ${subdirs}) +target_include_directories(core PUBLIC ${PROJECT_SOURCE_DIR}/include) find_package(Qt5 REQUIRED COMPONENTS Core Concurrent - Gui - Multimedia - MultimediaWidgets Network OpenGL # Needed to install mesa-common-dev for this! PrintSupport @@ -69,19 +40,29 @@ find_package(Qt5 REQUIRED COMPONENTS # Search this path explicitly for MacOS OpenGL Framework PATHS /System/Library/Frameworks/ REQUIRED) -find_package(Json REQUIRED) +# find_package(Json REQUIRED) find_package(Geos REQUIRED) find_package(nlohmann_json REQUIRED) find_package(CSPICE 65 REQUIRED) -include_directories(SYSTEM - ${Qt5Widgets_INCLUDE_DIRS} - ${Qt5Concurrent_INCLUDE_DIRS} - ${Qt5Network_INCLUDE_DIRS} - ${Qt5Xml_INCLUDE_DIRS} - ${CSPICE_INCLUDE_DIR} - ${JSON_INCLUDE_DIR}) -include_directories(${CMAKE_BINARY_DIR}/inc) -link_directories(${JSON_LIBRARY} ${CSPICE_LIBRARY}) - -target_link_libraries(CORE PUBLIC Qt5 Geos Json nlohmann_json::nlohmann_json) +#include_directories(SYSTEM +# ${Qt5Widgets_INCLUDE_DIRS} +# ${Qt5Concurrent_INCLUDE_DIRS} +# ${Qt5Network_INCLUDE_DIRS} +# ${Qt5Xml_INCLUDE_DIRS} +# ${CSPICE_INCLUDE_DIR} +# ${JSON_INCLUDE_DIR}) +#include_directories(${CMAKE_BINARY_DIR}/inc) +#link_directories(${JSON_LIBRARY} ${CSPICE_LIBRARY} {Qt5_Library}) + +target_link_libraries(core PUBLIC Qt5::Core + Qt5::Concurrent + Qt5::Widgets + Qt5::Network + Qt5::Xml + nlohmann_json::nlohmann_json) + +target_link_libraries(core PUBLIC ${GEOS_LIBRARY} ${CSPICE_LIBRARY}) +target_include_directories(core PUBLIC ${GEOS_INCLUDE_DIR} ${CSPICE_INCLUDE_DIR}) +install(DIRECTORY ${PROJECT_SOURCE_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX}/include/isis) +install(TARGETS core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) diff --git a/isis/src/core/Constants/Makefile b/isis/src/core/Constants/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/Constants/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/FileName/FileName.truth b/isis/src/core/FileName/FileName.truth deleted file mode 100644 index 2da01a684f..0000000000 --- a/isis/src/core/FileName/FileName.truth +++ /dev/null @@ -1,709 +0,0 @@ -Running Full Test on [/path/base.ext+attr] - Testing Basics [/path/base.ext+attr] - Name: base.ext - Base Name: base - Path: /path - Original path /path - Extension: ext - Comparison (==): 1 - Comparison (!=): 0 - Expanded /path/base.ext - Exists 0 - - Testing Extension change [/path/base.ext+attr] - Before modification: /path/base.ext - Changed: 0 - Unchanged: 1 - Removed Extension: /path/base - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: /path/base.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path/base.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path/base.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /path/base.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path/base.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /path/base.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/path/base.ext+attr] - Name: base.ext - Base Name: base - Extension: ext - Original path /path - Exists 0 - -Running Full Test on [/path1/.path2/base.ext+attr] - Testing Basics [/path1/.path2/base.ext+attr] - Name: base.ext - Base Name: base - Path: /path1/.path2 - Original path /path1/.path2 - Extension: ext - Comparison (==): 1 - Comparison (!=): 0 - Expanded /path1/.path2/base.ext - Exists 0 - - Testing Extension change [/path1/.path2/base.ext+attr] - Before modification: /path1/.path2/base.ext - Changed: 0 - Unchanged: 1 - Removed Extension: /path1/.path2/base - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: /path1/.path2/base.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path1/.path2/base.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path1/.path2/base.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /path1/.path2/base.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path1/.path2/base.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /path1/.path2/base.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/path1/.path2/base.ext+attr] - Name: base.ext - Base Name: base - Extension: ext - Original path /path1/.path2 - Exists 0 - -Running Full Test on [/path1/pat.h2/base+attr] - Testing Basics [/path1/pat.h2/base+attr] - Name: base - Base Name: base - Path: /path1/pat.h2 - Original path /path1/pat.h2 - Extension: - Comparison (==): 1 - Comparison (!=): 0 - Expanded /path1/pat.h2/base - Exists 0 - - Testing Extension change [/path1/pat.h2/base+attr] - Before modification: /path1/pat.h2/base - Changed: 0 - Unchanged: 1 - Removed Extension: /path1/pat.h2/base - Changed: 0 - Unchanged: 1 - Added Extension [tmp]: /path1/pat.h2/base.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path1/pat.h2/base.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path1/pat.h2/base.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /path1/pat.h2/base.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /path1/pat.h2/base.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /path1/pat.h2/base.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/path1/pat.h2/base+attr] - Name: base - Base Name: base - Extension: - Original path /path1/pat.h2 - Exists 0 - -Running Full Test on [/.path1/path2/base] - Testing Basics [/.path1/path2/base] - Name: base - Base Name: base - Path: /.path1/path2 - Original path /.path1/path2 - Extension: - Comparison (==): 1 - Comparison (!=): 0 - Expanded /.path1/path2/base - Exists 0 - - Testing Extension change [/.path1/path2/base] - Before modification: /.path1/path2/base - Changed: 0 - Unchanged: 1 - Removed Extension: /.path1/path2/base - Changed: 0 - Unchanged: 1 - Added Extension [tmp]: /.path1/path2/base.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/path2/base.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/path2/base.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /.path1/path2/base.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/path2/base.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /.path1/path2/base.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/.path1/path2/base] - Name: base - Base Name: base - Extension: - Original path /.path1/path2 - Exists 0 - -Running Full Test on [/.path1/path2/base.+attr] - Testing Basics [/.path1/path2/base.+attr] - Name: base. - Base Name: base - Path: /.path1/path2 - Original path /.path1/path2 - Extension: - Comparison (==): 1 - Comparison (!=): 0 - Expanded /.path1/path2/base. - Exists 0 - - Testing Extension change [/.path1/path2/base.+attr] - Before modification: /.path1/path2/base. - Changed: 0 - Unchanged: 1 - Removed Extension: /.path1/path2/base - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: /.path1/path2/base.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/path2/base.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/path2/base.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /.path1/path2/base.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/path2/base.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /.path1/path2/base.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/.path1/path2/base.+attr] - Name: base. - Base Name: base - Extension: - Original path /.path1/path2 - Exists 0 - -Running Full Test on [/another/path/base.ex1.exten2.ext3] - Testing Basics [/another/path/base.ex1.exten2.ext3] - Name: base.ex1.exten2.ext3 - Base Name: base.ex1.exten2 - Path: /another/path - Original path /another/path - Extension: ext3 - Comparison (==): 1 - Comparison (!=): 0 - Expanded /another/path/base.ex1.exten2.ext3 - Exists 0 - - Testing Extension change [/another/path/base.ex1.exten2.ext3] - Before modification: /another/path/base.ex1.exten2.ext3 - Changed: 0 - Unchanged: 1 - Removed Extension: /another/path/base.ex1.exten2 - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: /another/path/base.ex1.exten2.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /another/path/base.ex1.exten2.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /another/path/base.ex1.exten2.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /another/path/base.ex1.exten2.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /another/path/base.ex1.exten2.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /another/path/base.ex1.exten2.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/another/path/base.ex1.exten2.ext3] - Name: base.ex1.exten2.ext3 - Base Name: base.ex1.exten2 - Extension: ext3 - Original path /another/path - Exists 0 - -Running Full Test on [/$BADENV/base.ext+attr] - Testing Basics [/$BADENV/base.ext+attr] - Name: base.ext - Base Name: base - Path: /$BADENV - Original path /$BADENV - Extension: ext - Comparison (==): 1 - Comparison (!=): 0 - Expanded /$BADENV/base.ext - Exists 0 - - Testing Extension change [/$BADENV/base.ext+attr] - Before modification: /$BADENV/base.ext - Changed: 0 - Unchanged: 1 - Removed Extension: /$BADENV/base - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: /$BADENV/base.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /$BADENV/base.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /$BADENV/base.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /$BADENV/base.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /$BADENV/base.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /$BADENV/base.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/$BADENV/base.ext+attr] - Name: base.ext - Base Name: base - Extension: ext - Original path /$BADENV - Exists 0 - -Running Full Test on [/.path1/base+attr1+attr2] - Testing Basics [/.path1/base+attr1+attr2] - Name: base - Base Name: base - Path: /.path1 - Original path /.path1 - Extension: - Comparison (==): 1 - Comparison (!=): 0 - Expanded /.path1/base - Exists 0 - - Testing Extension change [/.path1/base+attr1+attr2] - Before modification: /.path1/base - Changed: 0 - Unchanged: 1 - Removed Extension: /.path1/base - Changed: 0 - Unchanged: 1 - Added Extension [tmp]: /.path1/base.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/base.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/base.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /.path1/base.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /.path1/base.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /.path1/base.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/.path1/base+attr1+attr2] - Name: base - Base Name: base - Extension: - Original path /.path1 - Exists 0 - -Running Full Test on [unitTest.cpp] - Testing Basics [unitTest.cpp] - Name: unitTest.cpp - Base Name: unitTest - Path: . - Original path . - Extension: cpp - Comparison (==): 1 - Comparison (!=): 0 - Expanded unitTest.cpp - Exists 1 - - Testing Extension change [unitTest.cpp] - Before modification: unitTest.cpp - Changed: 0 - Unchanged: 1 - Removed Extension: ./unitTest - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: ./unitTest.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./unitTest.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./unitTest.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: ./unitTest.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./unitTest.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: ./unitTest.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [unitTest.cpp] - Name: unitTest.cpp - Base Name: unitTest - Extension: cpp - Original path . - Exists 1 - -Running Full Test on [./unitTest.cpp] - Testing Basics [./unitTest.cpp] - Name: unitTest.cpp - Base Name: unitTest - Path: . - Original path . - Extension: cpp - Comparison (==): 1 - Comparison (!=): 0 - Expanded ./unitTest.cpp - Exists 1 - - Testing Extension change [./unitTest.cpp] - Before modification: ./unitTest.cpp - Changed: 0 - Unchanged: 1 - Removed Extension: ./unitTest - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: ./unitTest.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./unitTest.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./unitTest.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: ./unitTest.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./unitTest.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: ./unitTest.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [./unitTest.cpp] - Name: unitTest.cpp - Base Name: unitTest - Extension: cpp - Original path . - Exists 1 - -Running Full Test on [Makefile] - Testing Basics [Makefile] - Name: Makefile - Base Name: Makefile - Path: . - Original path . - Extension: - Comparison (==): 1 - Comparison (!=): 0 - Expanded Makefile - Exists 1 - - Testing Extension change [Makefile] - Before modification: Makefile - Changed: 0 - Unchanged: 1 - Removed Extension: ./Makefile - Changed: 0 - Unchanged: 1 - Added Extension [tmp]: ./Makefile.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./Makefile.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./Makefile.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: ./Makefile.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./Makefile.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: ./Makefile.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [Makefile] - Name: Makefile - Base Name: Makefile - Extension: - Original path . - Exists 1 - -Running Full Test on [.cub] - Testing Basics [.cub] - Name: .cub - Base Name: - Path: . - Original path . - Extension: cub - Comparison (==): 1 - Comparison (!=): 0 - Expanded .cub - Exists 0 - - Testing Extension change [.cub] - Before modification: .cub - Changed: 0 - Unchanged: 1 - Removed Extension: ./ - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: ./.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: ./.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: ./.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: ./.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [.cub] - Name: .cub - Base Name: - Extension: cub - Original path . - Exists 0 - -Running Full Test on [/$TEMPORARY/unitTest.cpp] - Testing Basics [/$TEMPORARY/unitTest.cpp] - Name: unitTest.cpp - Base Name: unitTest - Path: /. - Original path /$TEMPORARY - Extension: cpp - Comparison (==): 1 - Comparison (!=): 0 - Expanded /./unitTest.cpp - Exists 0 - - Testing Extension change [/$TEMPORARY/unitTest.cpp] - Before modification: /./unitTest.cpp - Changed: 0 - Unchanged: 1 - Removed Extension: /./unitTest - Changed: 1 - Unchanged: 0 - Added Extension [tmp]: /./unitTest.tmp - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /./unitTest.tmp.jpg - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /./unitTest.tmp.jpg - Changed: 0 - Unchanged: 1 - Set Extension [gif]: /./unitTest.tmp.gif - Changed: 1 - Unchanged: 0 - Added Extension [jpg]: /./unitTest.tmp.gif.jpg - Changed: 1 - Unchanged: 0 - Removed Extension: /./unitTest.tmp.gif - Changed: 1 - Unchanged: 0 - - Testing Expanded [/$TEMPORARY/unitTest.cpp] - Name: unitTest.cpp - Base Name: unitTest - Extension: cpp - Original path /$TEMPORARY - Exists 0 - -Testing temporary file name placement - Input name and extension : $TEMPORARY/tttt.tmp - Extension: : tmp - Original Path: : $TEMPORARY - Exists: : 1 - Name (cleaned): : tttt??????.tmp - -Testing parallel temporary file name creation for atomicity - Success! - -Testing Versioning Missing Problems - Testing Versioning Methods [tttt] - Highest Version Name: Highest Version Failed: **ERROR** Asked for highest version of file named [tttt] in [.] but there are no version sequences in the name. - New Version Name: New Version Failed: **ERROR** Asked for new version of file named [tttt] in [.] but there are no version sequences in the name. - - Testing Versioning Methods [tttt{}.tmp] - Highest Version Name: Highest Version Failed: **ERROR** The date version sequences are not recognized in the file named [tttt{}.tmp]. - New Version Name: New Version Failed: **ERROR** The date version sequences are not recognized in the file named [tttt{}.tmp]. - - Testing Versioning Methods [ttttt{}.tmp] - Highest Version Name: Highest Version Failed: **ERROR** The date version sequences are not recognized in the file named [ttttt{}.tmp]. - New Version Name: New Version Failed: **ERROR** The date version sequences are not recognized in the file named [ttttt{}.tmp]. - -Testing Numerical-Only Versioning - Testing Versioning Methods [tttt??????] - Highest Version Name: tttt000001 - Highest Version Orig: ./tttt000001 - Highest Version Orig Path: . - High version changed FileName: 1 - New Version Name: tttt000002 - New Version Orig: ./tttt000002 - New Version Orig Path: . - New version changed FileName: 1 - - Testing Versioning Methods [tttt??????.tmp] - Highest Version Name: tttt000008.tmp - Highest Version Orig: ./tttt000008.tmp - Highest Version Orig Path: . - High version changed FileName: 1 - New Version Name: tttt000009.tmp - New Version Orig: ./tttt000009.tmp - New Version Orig Path: . - New version changed FileName: 1 - - Testing Versioning Methods [tttt_?.tmp] - Highest Version Name: tttt_0.tmp - Highest Version Orig: ./tttt_0.tmp - Highest Version Orig Path: . - High version changed FileName: 1 - New Version Name: tttt_1.tmp - New Version Orig: ./tttt_1.tmp - New Version Orig Path: . - New version changed FileName: 1 - - Testing Versioning Methods [??tttt] - Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a numerical version matching [??tttt] in [.]. - New Version Name: 01tttt - New Version Orig: ./01tttt - New Version Orig Path: . - New version changed FileName: 1 - - Testing Versioning Methods [?tttt000008.tmp] - Highest Version Name: 2tttt000008.tmp - Highest Version Orig: ./2tttt000008.tmp - Highest Version Orig Path: . - High version changed FileName: 1 - New Version Name: 3tttt000008.tmp - New Version Orig: ./3tttt000008.tmp - New Version Orig Path: . - New version changed FileName: 1 - - Testing Versioning Methods [junk?] - Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a numerical version matching [junk?] in [.]. - New Version Name: junk1 - New Version Orig: ./junk1 - New Version Orig Path: . - New version changed FileName: 1 - - Testing Versioning Methods [??tttt??] - Highest Version Name: Highest Version Failed: **ERROR** Only one numerical version sequence is allowed in a filename; there are multiple in [??tttt??]. - New Version Name: New Version Failed: **ERROR** Only one numerical version sequence is allowed in a filename; there are multiple in [??tttt??]. - -Testing Date-Only Versioning - Testing Versioning Methods [tttt{ddMMMyyyy}.tmp] - Highest Version Name: tttt14Apr2010.tmp - Highest Version Orig: ./tttt14Apr2010.tmp - Highest Version Orig Path: . - High version changed FileName: 1 - - Testing Versioning Methods [tt{MMM}tt{dd}yy{yy}.tmp] - Highest Version Name: ttFebtt04yy01.tmp - Highest Version Orig: ./ttFebtt04yy01.tmp - Highest Version Orig Path: . - High version changed FileName: 1 - - Testing Versioning Methods [tt{d}tt{MMM}.tmp] - Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a date version matching [tt{d}tt{MMM}.tmp] in [.]. - - Testing Versioning Methods [tt{d}tt{MMMM}.tmp] - Highest Version Name: tt2ttDecember.tmp - Highest Version Orig: ./tt2ttDecember.tmp - Highest Version Orig Path: . - High version changed FileName: 1 - - Testing Versioning Methods [tt{dd}.tmp] - Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a date version matching [tt{dd}.tmp] in [.]. - - Testing Versioning Methods [tttt{dd}.tmp] - Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a date version matching [tttt{dd}.tmp] in [.]. - - Testing Versioning Methods [tttt{aaaa}.tmp] - Highest Version Name: Highest Version Failed: **ERROR** The date version sequences are not recognized in the file named [tttt{aaaa}.tmp]. - New Version Name: New Version Failed: **ERROR** The date version sequences are not recognized in the file named [tttt{aaaa}.tmp]. - -Testing Date and Numerical Versioning Combined - Testing Versioning Methods [$TEMPORARY/{MMM}-{dd}-{yy}_v???.tmp] - Highest Version Name: Apr-22-99_v004.tmp - Highest Version Orig: $TEMPORARY/Apr-22-99_v004.tmp - Highest Version Orig Path: $TEMPORARY - High version changed FileName: 1 - -Verifying NewVersion for file tttt{dd}tt{yyyy}tt{MMM}.tmp is today - Made today's filename successfully? 1 - diff --git a/isis/src/core/FileName/Makefile b/isis/src/core/FileName/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/FileName/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/IException/Makefile b/isis/src/core/IException/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/IException/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/IException/unitTest.exclude b/isis/src/core/IException/unitTest.exclude deleted file mode 100644 index 220f4aa98a..0000000000 --- a/isis/src/core/IException/unitTest.exclude +++ /dev/null @@ -1 +0,0 @@ -File diff --git a/isis/src/core/IString/IString.truth b/isis/src/core/IString/IString.truth deleted file mode 100644 index f70c5ebc5f..0000000000 --- a/isis/src/core/IString/IString.truth +++ /dev/null @@ -1,195 +0,0 @@ -Testing toBool - True: 1 - False: 0 - **ERROR** Failed to convert string [...] to a boolean. Please specify one of [1, on, t, true, y, yes] for true, or one of [0, f, false, n, no, off] for false. - -Testing toInt - 0 - 5 - -5 - 2147483647 - -2147483647 - **ERROR** Failed to convert string [-5.0] to an integer. - **ERROR** Failed to convert string [2147483648] to an integer. - -Testing toBigInt - 0 - 5 - -5 - 9223372036854775807 - -9223372036854775807 - **ERROR** Failed to convert string [-5.0] to a big integer. - **ERROR** Failed to convert string [9223372036854775808] to a big integer. - -Testing toDouble - 0 - 5.25 - -5.25 - -3.4028226550889e+38 - 1e+100 - -1e+100 - 1.7976931348623e+308 - **ERROR** Failed to convert string [fred] to a double. - -Testing toString - bool(false): No - bool(true): Yes - char(A): A - int(2147483647): 2147483647 - uint(2147483648): 2147483648 - BigInt(2147483648): 2147483648 - double(0.0): 0.0 - double(DBL_MIN): 2.2250738585072e-308 - double(DBL_MAX*2): 1.79769313486232e+308 - double(-DBL_MAX*2): -1.79769313486232e+308 - double(sqrt(-1)): nan - double(5.25): 5.25 - double(-5.25): -5.25 - double(1e13): 10000000000000 - double(1e13+1): 1.0000000000001e+13 - double(1e-3): 0.001 - double(9e-4): 9.0e-04 - double(1e100): 1.0e+100 - double(-1e100): -1.0e+100 - -Testing cerr with QString and with QStringRef - QString - QStringRef - ----------------------------------- --- Now testing deprecated class -- ----------------------------------- - -No arg construtor : Test string -Constructor IString: Test string again -Constructor char : 65 -Constructor int : 999 -Constructor BigInt : 9999999999 -Constructor double :999.999 -Before Trim : ABCDefghijkBCAD -Return Trim : efghijk -After Trim : efghijk -Before TrimHead : ABCDefghijkBCAD -Return TrimHead : efghijkBCAD -After TrimHead : efghijkBCAD -Middle test : efghijkBCAD -Before TrimTail : ABCDefghijkBCAD -Return TrimTail : ABCDefghijk -After TrimTail : ABCDefghijk -Middle test : ABCDefghijk -Before TrimHead : ABCDefghijkBCAD -After TrimHead : efghijkBCAD -Middle test : efghijkBCAD -Before TrimTail : ABCDefghijkBCAD -After TrimTail : ABCDefghijk -Middle test : ABCDefghijk -Before Upcase : abcdefghijklmnopqrstuvwxyzABC!@#$%^&*() -After Upcase : ABCDEFGHIJKLMNOPQRSTUVWXYZABC!@#$%^&*() -Before DownCase : ABCDEFGHIJKLMNOPQRSTUVWXYZABC!@#$%^&*() -After DownCase : abcdefghijklmnopqrstuvwxyzabc!@#$%^&*() -Integer : 987654321 -Integer : 987654321 -**ERROR** Failed to convert string [987trew] to an integer. -BigInteger : 9876543210 -BigInteger : 9876543210 -**ERROR** Failed to convert string [987trew] to a big integer. -Double : 9876.54321 -Double : 9876.54321 -**ERROR** Failed to convert string [123$987] to a double. -Exponent : 123.0E45 -Exponent : 1.23e+47 -25:255 35:15 -25 -255 -35 -15 -key1=tok1 key2="t o k 2" key3=(1,2,3,4) -key1 -tok1 -key2 -"t -o -k -2" -key3 -(1,2,3,4) -"abcd","1234" -"abcd" -"1234" -",1234","ab,cd" -" -1234" -"ab -cd" -/this/is/a/long/filename.jnk,seperated/by/a/comma/ending/with/ -/this/is/a/long/filename.jnk -seperated/by/a/comma/ending/with/ -/this/is/another/long/filename.jnk seperated/by/3/spaces/file2.tmp -token# 1>> /this/is/another/long/filename.jnk -token# 2>> -token# 3>> -token# 4>> seperated/by/3/spaces/file2.tmp - -Before compress > " " < -After compress > " " < -Before compress >| " " ' ' |< -After compress >| " " ' ' |< -Before compress > AB CD < -After compress > AB CD < -Before force compress > " " < -After force compress > " " < -Before force compress > "AB CD" < -After force compress > "AB CD" < -Before force compress > < -After force compress > < -Before convert >ABCDEFG< -After convert >A-C-E--< -Before replace >Thirteen is bigger than fourteen< -After replace >Thirteen is smaller than fourteen< -After convert white space >a b c< -Before Upcase >xxxXXX0< -After Upcase >XXXXXX0< -Before DownCase >XXXXXX0< -After DownCase >xxxxxx0< -Testing QT conversion: 1 -255.0 -0.333 --255.0 -1.235e-20 -1.23456789012346e+19 -5.0e-04 -Before Remove >a 1 b 2 c 3 d 4 e 5< -After Remove >a b c 3 d e < -100 -100000000000 -100.1 -Before Replace (honor quotes) >I is a test string: 'I is' is "is a string"< -After Replace (honor quotes) >I am a test string: 'I is' is "is a string"< -Before Replace (dont honor quotes) >I is a test string: 'I is' is "is a string"< -After Replace (dont honor quotes) >I am a test string: 'I am' am "am a string"< -Before split >This is a test string< -After split > -Element 0: This -Element 1: is -Element 2: a -Element 3: test -Element 4: string -< - -Qt QStringList values: -String1 -String2 -String3 -String4 - -Converted to std::vector... -String1 -String2 -String3 -String4 -Are they equivalent? -Counts? Yes -string(String1) == QString(String1)? Yes -string(String2) == QString(String2)? Yes -string(String3) == QString(String3)? Yes -string(String4) == QString(String4)? Yes diff --git a/isis/src/core/IString/Makefile b/isis/src/core/IString/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/IString/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/LabelTranslationManager/LabelTranslationManager.truth b/isis/src/core/LabelTranslationManager/LabelTranslationManager.truth deleted file mode 100644 index 3d46e24b94..0000000000 --- a/isis/src/core/LabelTranslationManager/LabelTranslationManager.truth +++ /dev/null @@ -1,59 +0,0 @@ -Testing LabelTranslationManager object - -Testing Translate method: - -Translating Extra: Test Input, Index 0 - -Testing Auto method: - -Object = IsisCube - Object = BandBin - BandName = "Test Input, Index 0" - End_Object - - Group = Dimensions - NumberOfLines = "Test Input, Index 0" - NumberOfBands = "Test Input, Index 0" - End_Group -End_Object - -Group = Mapping - CenterLongitude = "Test Input, Index 0" -End_Group -End - -Testing parseSpecification method: att@name|value - -Testing parseSpecification method: tag@name|value - -Testing parseSpecification method: att@name - -Testing parseSpecification method: new@name - -Testing parseSpecification method: name|value - -Testing parseSpecification method: value - -Testing parseSpecification method: namespace:name - -Testing parseSpecification method: namespace:name|value - -Testing parseSpecification method: att@namespace:name|value - -Testing parseSpecification method: tag@name|value - -Testing parseSpecification method: att|name|value -**PROGRAMMER ERROR** Malformed dependency specification [att|name|value]. -**PROGRAMMER ERROR** [att|name|value] has unexpected number of '@' or '|' delimiters. - -Testing parseSpecification method: att@name@value -**PROGRAMMER ERROR** Malformed dependency specification [att@name@value]. -**PROGRAMMER ERROR** [att@name@value] has unexpected number of '@' or '|' delimiters. - -Testing parseSpecification method: not@name|value -**PROGRAMMER ERROR** Malformed dependency specification [not@name|value]. -**PROGRAMMER ERROR** Dependency type specification [not] is invalid. Valid types are [att], [tag] and [new]. - -Testing parseSpecification method: att@name|value1|value2 -**PROGRAMMER ERROR** Malformed dependency specification [att@name|value1|value2]. -**PROGRAMMER ERROR** Malformed dependency specification [att@name|value1|value2]. diff --git a/isis/src/core/LabelTranslationManager/Makefile b/isis/src/core/LabelTranslationManager/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/LabelTranslationManager/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/Message/Makefile b/isis/src/core/Message/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/Message/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/Message/Message.truth b/isis/src/core/Message/Message.truth deleted file mode 100644 index 2146228161..0000000000 --- a/isis/src/core/Message/Message.truth +++ /dev/null @@ -1,28 +0,0 @@ -Array subscript [100000] is out of array bounds - -Keyword [KEY] ambiguous -Keyword [KEY] unrecognized -Keyword [KEY] duplicated -Keyword [KEY] is not an array -Keyword [KEY] required but was not found - -Keyword block [BLOCK] is invalid -Expecting start of keyword block [BLOCK] but found [FOUND] -Expecting end of keyword block [BLOCK] but found [FOUND] - -Keyword [KEY] has bad value -Keyword [KEY] has bad value [12345678901234567890] -Keyword [KEY] has bad value [abcdefghijklmnopqrst ...] -Keyword value for [KEY] expected but was not found -Keyword [KEY=0] is not in the range of (0,20] -Keyword [KEY=A] must be one of [X,Y,Z] - -Missing delimiter [)] -Missing delimiter [)] at or near [12345678901234567890] -Missing delimiter [)] at or near [abcdefghijklmnopqrst ...] - -Unable to open [test.dat] -Unable to create [test.dat] -Unable to read [test.dat] -Unable to write [test.dat] - diff --git a/isis/src/core/Preference/Makefile b/isis/src/core/Preference/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/Preference/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/Preference/Preference.truth b/isis/src/core/Preference/Preference.truth deleted file mode 100644 index 82cfeb16f8..0000000000 --- a/isis/src/core/Preference/Preference.truth +++ /dev/null @@ -1,13 +0,0 @@ -Testing normally -Group = Junk - Fruit = Tomato - Vegetable = Potato -End_Group -Group = Junk - Fruit = Tomato - Vegetable = Potatoe -End_Group - - -Value of Vegetable is : Potatoe -**USER ERROR** The preference file dummyPrefs was not found or does not exist. diff --git a/isis/src/core/Pvl/Makefile b/isis/src/core/Pvl/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/Pvl/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/Pvl/Pvl.truth b/isis/src/core/Pvl/Pvl.truth deleted file mode 100644 index cb690474d7..0000000000 --- a/isis/src/core/Pvl/Pvl.truth +++ /dev/null @@ -1,381 +0,0 @@ -p: LongKeyword = "This is a very long keyword value which was causing some - problems when the Pvl was output. The fist couple of lines - looked good, but after that things went south. Some lines get - nothing, others get bad indenting, most were too short" -End -copy deleted a keyword... -p: LongKeyword = "This is a very long keyword value which was causing some - problems when the Pvl was output. The fist couple of lines - looked good, but after that things went south. Some lines get - nothing, others get bad indenting, most were too short" -End - -copy: End - - -LongKeyword = "This is a very long keyword value which was causing some - problems when the Pvl was output. The fist couple of lines - looked good, but after that things went south. Some lines get - nothing, others get bad indenting, most were too short" -LongKeyword = "This is a very long keyword value which was causing some - problems when the Pvl was output. The fist couple of lines - looked good, but after that things went south. Some lines get - nothing, others get bad indenting, most were too short" - -Group = Test - Keyword = Value -End_Group - -Group = Test - Keyword = Value -End_Group -End - -THE_INTERNET = "Seven thousand eight - hundred forty three million - seventy four nine seventy - six forty two eighty nine - sixty seven thirty five - million jillion bajillion - google six nine four one two - three four five six seven - eight nine ten eleven twelve - thirteen fourteen" - -BIG_HUGE_LONG_NAME_THAT_SHOULD_TEST_OUT_PARSING = "Seven thousand eight - hundred forty three million - seventy four" -ARRAY_TEST = (5.87 , - 5465.6 , - 574.6 , - 42 ) -FIRST_100_DIGITS_OF_PI = 3.1415926535897932384626433- - 832795028841971693993751058- - 209749445923078164062862089- - 986280348253421170679 -A = XXXXXXXXXXxxxxxxxxxxXXXXXXX- - XXXxxxxxxxxxxXXXXXXXXXXxxxx- - xxxxxxXXXXXXXXXXxxxx -UGHHHHHHHHHHHH = (59999.0, 59999.0, 59999.0, - 59999.0, 59999.0, 59999.0, - 59999.0, 59999.0, 59999.0, - 59999.0, 59999.0, 59999.0) -NAME = 5.2 -KEY = Null - -# Hello World! This is a really really long comment that needs to be -# wrapped onto several different lines to make the PVL file look really -# pretty! -KEY = (5, Null, 3.3 , - "Hello World!") - -# Hello World! This is a really really long comment that needs to be -# wrapped onto several different lines to make the PVL file look really -# pretty! -KEY = (5, 88, 3.3 , - "Hello World!") -dog = Big - -# Big -Cat = (Big, Tabby) -key = ((a, b, c), ("Hubba Hubba", - Bubba)) -End - -temp = (a, b, c) -End - -**ERROR** Unable to read PVL file [unitTest2.pvl]. -**ERROR** Error in PVL file on line [9]. -**ERROR** Unable to read PVL keyword [Dog = Big Dog]. -**ERROR** Keyword has extraneous data [Dog] at the end. - -**ERROR** Unable to read PVL file [unitTest3.pvl]. -**ERROR** Error in PVL file on line [12]. -**ERROR** Unexpected [EndGroup] in PVL Object [A]. - -Testing MESSENGER labels with data at bottom... - -PDS_VERSION_ID = PDS3 - -/* ** FILE FORMAT ** */ -RECORD_TYPE = FIXED_LENGTH -RECORD_BYTES = 1024 -FILE_RECORDS = 1031 -LABEL_RECORDS = 0007 - -/* ** POINTERS TO START BYTE OFFSET OF OBJECTS IN IMAGE FILE ** */ -^IMAGE = 0008 - -/* ** GENERAL DATA DESCRIPTION PARAMETERS ** */ -MISSION_NAME = MESSENGER -INSTRUMENT_HOST_NAME = MESSENGER -DATA_SET_ID = MESS-E/V/H-MDIS-2-EDR-RAWDATA-V1.0 -DATA_QUALITY_ID = 0000000000000000 -PRODUCT_ID = EN0131771763M -PRODUCT_VERSION_ID = 3 -SOURCE_PRODUCT_ID = 0131771763_IM5 -PRODUCER_INSTITUTION_NAME = "APPLIED COHERENT TECHNOLOGY CORPORATION" -SOFTWARE_NAME = MDIS2EDR -SOFTWARE_VERSION_ID = 0.7 -MISSION_PHASE_NAME = "MERCURY 2 FLYBY" -TARGET_NAME = MERCURY -SEQUENCE_NAME = 08280_DEP_NAC_MOSAIC_2 -OBSERVATION_ID = 6623 - -/* ** TIME PARAMETERS ** */ -START_TIME = 2008-10-06T09:12:00.325595 -STOP_TIME = 2008-10-06T09:12:00.339595 -SPACECRAFT_CLOCK_START_COUNT = 1/0131771763:976000 -SPACECRAFT_CLOCK_STOP_COUNT = 1/0131771763:990000 -PRODUCT_CREATION_TIME = 2009-12-14T21:38:50 - -/* ** INSTRUMENT ENGINEERING PARAMETERS ** */ -INSTRUMENT_NAME = "MERCURY DUAL IMAGING SYSTEM NARROW ANGLE - CAMERA" -INSTRUMENT_ID = MDIS-NAC -FILTER_NAME = "748 BP 53" -FILTER_NUMBER = N/A -CENTER_FILTER_WAVELENGTH = 747.7 -BANDWIDTH = 52.6 -EXPOSURE_DURATION = 14 -EXPOSURE_TYPE = AUTO -DETECTOR_TEMPERATURE = -37.62 -FOCAL_PLANE_TEMPERATURE = -28.76 -FILTER_TEMPERATURE = N/A -OPTICS_TEMPERATURE = -28.61 - -/* ** INSTRUMENT RAW PARAMETERS ** */ -MESS:MET_EXP = 131771763 -MESS:IMG_ID_LSB = N/A -MESS:IMG_ID_MSB = N/A -MESS:ATT_CLOCK_COUNT = 131771761 -MESS:ATT_Q1 = -0.49568507 -MESS:ATT_Q2 = -0.63451749 -MESS:ATT_Q3 = 0.35215572 -MESS:ATT_Q4 = -0.47714800 -MESS:ATT_FLAG = 7 -MESS:PIV_POS_MOTOR = N/A -MESS:PIV_GOAL = 7895 -MESS:PIV_POS = 7896 -MESS:PIV_READ = 23068 -MESS:PIV_CAL = -26758 -MESS:FW_GOAL = 6492 -MESS:FW_POS = 6436 -MESS:FW_READ = 6436 -MESS:CCD_TEMP = 1044 -MESS:CAM_T1 = 468 -MESS:CAM_T2 = 496 -MESS:EXPOSURE = 14 -MESS:DPU_ID = 0 -MESS:IMAGER = 1 -MESS:SOURCE = 0 -MESS:FPU_BIN = 0 -MESS:COMP12_8 = 1 -MESS:COMP_ALG = 2 -MESS:COMP_FST = 1 -MESS:TIME_PLS = 2 -MESS:LATCH_UP = 0 -MESS:EXP_MODE = 1 -MESS:PIV_STAT = 3 -MESS:PIV_MPEN = 1 -MESS:PIV_PV = 1 -MESS:PIV_RV = 1 -MESS:FW_PV = 1 -MESS:FW_RV = 1 -MESS:AEX_STAT = 512 -MESS:AEX_STHR = 5 -MESS:AEX_TGTB = 2400 -MESS:AEX_BACB = 240 -MESS:AEX_MAXE = 14 -MESS:AEX_MINE = 1 -MESS:DLNKPRIO = 5 -MESS:WVLRATIO = 8 -MESS:PIXELBIN = 0 -MESS:SUBFRAME = 0 -MESS:SUBF_X1 = 4 -MESS:SUBF_Y1 = 0 -MESS:SUBF_DX1 = 0 -MESS:SUBF_DY1 = 0 -MESS:SUBF_X2 = 4 -MESS:SUBF_Y2 = 0 -MESS:SUBF_DX2 = 0 -MESS:SUBF_DY2 = 0 -MESS:SUBF_X3 = 0 -MESS:SUBF_Y3 = 0 -MESS:SUBF_DX3 = 0 -MESS:SUBF_DY3 = 0 -MESS:SUBF_X4 = 0 -MESS:SUBF_Y4 = 0 -MESS:SUBF_DX4 = 0 -MESS:SUBF_DY4 = 0 -MESS:SUBF_X5 = 0 -MESS:SUBF_Y5 = 0 -MESS:SUBF_DX5 = 0 -MESS:SUBF_DY5 = 0 -MESS:CRITOPNV = 0 -MESS:JAILBARS = 0 -MESS:JB_X0 = 0 -MESS:JB_X1 = 0 -MESS:JB_SPACE = 0 - -/* ** GEOMETRY INFORMATION ** */ -RIGHT_ASCENSION = 329.96796 -DECLINATION = -11.56931 -TWIST_ANGLE = 13.73197 -RA_DEC_REF_PIXEL = (512.00000, 512.00000) -RETICLE_POINT_RA = (329.41279, 330.88844, 329.04957, - 330.52952) -RETICLE_POINT_DECLINATION = (-12.47527, -12.12267, -11.02525, - -10.67174) - -/* ** TARGET PARAMETERS ** */ -SC_TARGET_POSITION_VECTOR = (-8919.18729, 5554.99303, 3662.51393) -TARGET_CENTER_DISTANCE = 11127.61690 - -/* ** TARGET WITHIN SENSOR FOV ** */ -SLANT_DISTANCE = 9115.65447 -CENTER_LATITUDE = 24.03182 -CENTER_LONGITUDE = 297.29424 -HORIZONTAL_PIXEL_SCALE = 232.40761 -VERTICAL_PIXEL_SCALE = 232.40761 -SMEAR_MAGNITUDE = 0.10555 -SMEAR_AZIMUTH = 94.46806 -NORTH_AZIMUTH = 108.06205 -RETICLE_POINT_LATITUDE = (21.08301, 20.54907, 27.64956, 27.16452) -RETICLE_POINT_LONGITUDE = (301.32304, 295.12377, 299.48568, - 292.69017) - -/* ** SPACECRAFT POSITION WITH RESPECT TO CENTRAL BODY ** */ -SUB_SPACECRAFT_LATITUDE = -1.04438 -SUB_SPACECRAFT_LONGITUDE = 315.57322 -SPACECRAFT_ALTITUDE = 8687.61690 -SUB_SPACECRAFT_AZIMUTH = 243.13066 - -/* ** SPACECRAFT LOCATION ** */ -SPACECRAFT_SOLAR_DISTANCE = 51220537.58833 -SC_SUN_POSITION_VECTOR = (50079853.32484, 10735834.95784, - 541857.50763) -SC_SUN_VELOCITY_VECTOR = (24.24499, -44.99506, -26.54238) - -/* ** VIEWING AND LIGHTING GEOMETRY (SUN ON TARGET) ** */ -SOLAR_DISTANCE = 51228055.72874 -SUB_SOLAR_AZIMUTH = 194.38217 -SUB_SOLAR_LATITUDE = -0.01056 -SUB_SOLAR_LONGITUDE = 3.05715 -INCIDENCE_ANGLE = 67.98720 -PHASE_ANGLE = 43.57603 -EMISSION_ANGLE = 38.58010 -LOCAL_HOUR_ANGLE = 114.23708 - -Object = IMAGE - LINES = 1024 - LINE_SAMPLES = 1024 - SAMPLE_TYPE = MSB_UNSIGNED_INTEGER - SAMPLE_BITS = 8 - UNIT = N/A - DARK_STRIP_MEAN = 10.107 - - /* ** IMAGE STATISTICS OF ** */ - /* ** THE EXPOSED CCD AREA ** */ - MINIMUM = 16.000 - MAXIMUM = 124.000 - MEAN = 65.736 - STANDARD_DEVIATION = 8.835 - - /* ** PIXEL COUNTS ** */ - SATURATED_PIXEL_COUNT = 0 - MISSING_PIXELS = 0 -End_Object - -/* ** GEOMETRY FOR EACH SUBFRAME ** */ -Group = SUBFRAME1_PARAMETERS - RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) - RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) -End_Group - -Group = SUBFRAME2_PARAMETERS - RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) - RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) -End_Group - -Group = SUBFRAME3_PARAMETERS - RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) - RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) -End_Group - -Group = SUBFRAME4_PARAMETERS - RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) - RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) -End_Group - -Group = SUBFRAME5_PARAMETERS - RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) - RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) -End_Group -End - - - -***Template PVL** -Object = Filters - Filters__Required = true - Test_Required = false - Test_Repeated = true - Test = string - - Group = Point_ErrorMagnitude - Point_ErrorMagnitude__Required = false - LessThan = double - LessThan__Required = false - LessThan__Repeated = false - GreaterThan = double - GreaterThan__Required = false - GreaterThan__Repeated = false - End_Group - - Group = Point_CubeNames - Point_CubeNames__Required = false - Cube = string - Cube__Required = false - Cube__Repeated = true - End_Group -End_Object -End - - -***Test PVL** -Object = Filters - Test12 = Testing - Test = Testing - Test = Testing - - Group = Pointerrormagnitude - LessThan = 3.5 - GreaterThan = 0 - End_Group - - Group = Point_errormagnitude2 - lessthan = 3.5 - GreaterThan = 0 - End_Group - - Group = Point_CubeNames - Cube = SerialNumber1 - Cube = SerialNumber2 - Cube = SerialNumber3 - End_Group -End_Object -End - - -**Result PVL** -Object = Filters - Test12 = Testing - - Group = Point_errormagnitude2 - lessthan = 3.5 - GreaterThan = 0 - End_Group -End_Object -End diff --git a/isis/src/core/Pvl/cnetstatsTest.def b/isis/src/core/Pvl/cnetstatsTest.def deleted file mode 100644 index eba46825b6..0000000000 --- a/isis/src/core/Pvl/cnetstatsTest.def +++ /dev/null @@ -1,21 +0,0 @@ -Object = Filters - Filters__Required = true - Group = Point_ErrorMagnitude - Point_ErrorMagnitude__Required = false - LessThan = double - LessThan__Required = false - LessThan__Repeated = false - GreaterThan = double - GreaterThan__Required = false - GreaterThan__Repeated = false - EndGroup - Group = Point_CubeNames - Point_CubeNames__Required = false - Cube = string - Cube__Required = false - Cube__Repeated = true - EndGroup - Test_Required = false - Test_Repeated = true - Test = string -EndObject \ No newline at end of file diff --git a/isis/src/core/Pvl/pointdef.def b/isis/src/core/Pvl/pointdef.def deleted file mode 100644 index 0f6c0031d5..0000000000 --- a/isis/src/core/Pvl/pointdef.def +++ /dev/null @@ -1,18 +0,0 @@ -Object = Filters - Group = Pointerrormagnitude - LessThan = 3.5 - GreaterThan=0 - EndGroup - Group = Point_errormagnitude2 - lessthan = 3.5 - GreaterThan=0 - EndGroup - Group = Point_CubeNames - Cube = SerialNumber1 - Cube = SerialNumber2 - Cube = SerialNumber3 - EndGroup - Test12 = "Testing" - Test = "Testing" - Test = "Testing" -EndObject diff --git a/isis/src/core/Pvl/unitTest.pvl b/isis/src/core/Pvl/unitTest.pvl deleted file mode 100644 index 16de2e79bf..0000000000 --- a/isis/src/core/Pvl/unitTest.pvl +++ /dev/null @@ -1,34 +0,0 @@ -THE_INTERNET = "Seven thousand eight hundred forty three million seventy four - nine seventy six forty two eighty nine sixty seven thirty five - million jillion bajillion google six nine four one two three - four five six seven eight nine ten eleven twelve thirteen - fourteen" -BIG_HUGE_LONG_NAME_THAT_SHOULD_TEST_OUT_PARSING = "Seven thousand eight - hundred forty three million - seventy four" -ARRAY_TEST = (5.87 , 5465.6 , 574.6 , - 42 ) -FIRST_100_DIGITS_OF_PI = 3.14159265358979323846264338327950288419716939937510- - 58209749445923078164062862089986280348253421170679 -A = XXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxx -UGHHHHHHHHHHHH = (59999.0, 59999.0, 59999.0, 59999.0, 59999.0, 59999.0, - 59999.0, 59999.0, 59999.0, 59999.0, 59999.0, 59999.0) -NAME = 5.2 -KEY = Null -# Hello World! This is a really really long comment that needs to be -# wrapped onto several different lines to make the PVL file look really -# pretty! -KEY = (5, Null, 3.3 , "Hello World!") - -# Hello World! This is a really really long comment that needs to be -# wrapped onto several different lines to make the PVL file look really -# pretty! -KEY = (5, 88, 3.3 , "Hello World!") -dog = Big - -# Big -Cat = (Big, Tabby) - -key = ((a, b, c), ("Hubba Hubba", Bubba)) - -# Some Junk Comment diff --git a/isis/src/core/Pvl/unitTest2.pvl b/isis/src/core/Pvl/unitTest2.pvl deleted file mode 100644 index efb595f0cc..0000000000 --- a/isis/src/core/Pvl/unitTest2.pvl +++ /dev/null @@ -1,12 +0,0 @@ -Object = A - Object = B - - Key = Value - EndObject - - Object = C - Group = D - Dog = Big Dog - EndGroup - EndObject -EndObject diff --git a/isis/src/core/Pvl/unitTest3.pvl b/isis/src/core/Pvl/unitTest3.pvl deleted file mode 100644 index 95419c9afb..0000000000 --- a/isis/src/core/Pvl/unitTest3.pvl +++ /dev/null @@ -1,12 +0,0 @@ -Object = A - Object = B - - Key = Value - EndObject - - Object = C - Group = D - Dog = Big - EndGroup - EndObject -EndGroup diff --git a/isis/src/core/Pvl/unitTest4.pvl b/isis/src/core/Pvl/unitTest4.pvl deleted file mode 100644 index 0e5a4e8676..0000000000 --- a/isis/src/core/Pvl/unitTest4.pvl +++ /dev/null @@ -1,224 +0,0 @@ -PDS_VERSION_ID = PDS3 - -/* ** FILE FORMAT ** */ -RECORD_TYPE = FIXED_LENGTH -RECORD_BYTES = 1024 -FILE_RECORDS = 1031 -LABEL_RECORDS = 0007 - -/* ** POINTERS TO START BYTE OFFSET OF OBJECTS IN IMAGE FILE ** */ -^IMAGE = 0008 - -/* ** GENERAL DATA DESCRIPTION PARAMETERS ** */ -MISSION_NAME = "MESSENGER" -INSTRUMENT_HOST_NAME = "MESSENGER" -DATA_SET_ID = "MESS-E/V/H-MDIS-2-EDR-RAWDATA-V1.0" -DATA_QUALITY_ID = "0000000000000000" -PRODUCT_ID = "EN0131771763M" -PRODUCT_VERSION_ID = "3" -SOURCE_PRODUCT_ID = ("0131771763_IM5") -PRODUCER_INSTITUTION_NAME = "APPLIED COHERENT TECHNOLOGY CORPORATION" -SOFTWARE_NAME = "MDIS2EDR" -SOFTWARE_VERSION_ID = "0.7" -MISSION_PHASE_NAME = "MERCURY 2 FLYBY" -TARGET_NAME = "MERCURY" -SEQUENCE_NAME = "08280_DEP_NAC_MOSAIC_2" -OBSERVATION_ID = "6623" - -/* ** TIME PARAMETERS ** */ -START_TIME = 2008-10-06T09:12:00.325595 -STOP_TIME = 2008-10-06T09:12:00.339595 -SPACECRAFT_CLOCK_START_COUNT = "1/0131771763:976000" -SPACECRAFT_CLOCK_STOP_COUNT = "1/0131771763:990000" -PRODUCT_CREATION_TIME = 2009-12-14T21:38:50 - -/* ** INSTRUMENT ENGINEERING PARAMETERS ** */ -INSTRUMENT_NAME = "MERCURY DUAL IMAGING SYSTEM NARROW ANGLE CAMERA" -INSTRUMENT_ID = "MDIS-NAC" -FILTER_NAME = "748 BP 53" -FILTER_NUMBER = "N/A" -CENTER_FILTER_WAVELENGTH = 747.7 -BANDWIDTH = 52.6 -EXPOSURE_DURATION = 14 -EXPOSURE_TYPE = AUTO -DETECTOR_TEMPERATURE = -37.62 -FOCAL_PLANE_TEMPERATURE = -28.76 -FILTER_TEMPERATURE = "N/A" -OPTICS_TEMPERATURE = -28.61 - -/* ** INSTRUMENT RAW PARAMETERS ** */ -MESS:MET_EXP = 131771763 -MESS:IMG_ID_LSB = "N/A" -MESS:IMG_ID_MSB = "N/A" -MESS:ATT_CLOCK_COUNT = 131771761 -MESS:ATT_Q1 = -0.49568507 -MESS:ATT_Q2 = -0.63451749 -MESS:ATT_Q3 = 0.35215572 -MESS:ATT_Q4 = -0.47714800 -MESS:ATT_FLAG = 7 -MESS:PIV_POS_MOTOR = "N/A" -MESS:PIV_GOAL = 7895 -MESS:PIV_POS = 7896 -MESS:PIV_READ = 23068 -MESS:PIV_CAL = -26758 -MESS:FW_GOAL = 6492 -MESS:FW_POS = 6436 -MESS:FW_READ = 6436 -MESS:CCD_TEMP = 1044 -MESS:CAM_T1 = 468 -MESS:CAM_T2 = 496 -MESS:EXPOSURE = 14 -MESS:DPU_ID = 0 -MESS:IMAGER = 1 -MESS:SOURCE = 0 -MESS:FPU_BIN = 0 -MESS:COMP12_8 = 1 -MESS:COMP_ALG = 2 -MESS:COMP_FST = 1 -MESS:TIME_PLS = 2 -MESS:LATCH_UP = 0 -MESS:EXP_MODE = 1 -MESS:PIV_STAT = 3 -MESS:PIV_MPEN = 1 -MESS:PIV_PV = 1 -MESS:PIV_RV = 1 -MESS:FW_PV = 1 -MESS:FW_RV = 1 -MESS:AEX_STAT = 512 -MESS:AEX_STHR = 5 -MESS:AEX_TGTB = 2400 -MESS:AEX_BACB = 240 -MESS:AEX_MAXE = 14 -MESS:AEX_MINE = 1 -MESS:DLNKPRIO = 5 -MESS:WVLRATIO = 8 -MESS:PIXELBIN = 0 -MESS:SUBFRAME = 0 -MESS:SUBF_X1 = 4 -MESS:SUBF_Y1 = 0 -MESS:SUBF_DX1 = 0 -MESS:SUBF_DY1 = 0 -MESS:SUBF_X2 = 4 -MESS:SUBF_Y2 = 0 -MESS:SUBF_DX2 = 0 -MESS:SUBF_DY2 = 0 -MESS:SUBF_X3 = 0 -MESS:SUBF_Y3 = 0 -MESS:SUBF_DX3 = 0 -MESS:SUBF_DY3 = 0 -MESS:SUBF_X4 = 0 -MESS:SUBF_Y4 = 0 -MESS:SUBF_DX4 = 0 -MESS:SUBF_DY4 = 0 -MESS:SUBF_X5 = 0 -MESS:SUBF_Y5 = 0 -MESS:SUBF_DX5 = 0 -MESS:SUBF_DY5 = 0 -MESS:CRITOPNV = 0 -MESS:JAILBARS = 0 -MESS:JB_X0 = 0 -MESS:JB_X1 = 0 -MESS:JB_SPACE = 0 - -/* ** GEOMETRY INFORMATION ** */ -RIGHT_ASCENSION = 329.96796 -DECLINATION = -11.56931 -TWIST_ANGLE = 13.73197 -RA_DEC_REF_PIXEL = (512.00000,512.00000) -RETICLE_POINT_RA = (329.41279 ,330.88844 ,329.04957 , - 330.52952 ) -RETICLE_POINT_DECLINATION = (-12.47527 ,-12.12267 ,-11.02525 , - -10.67174 ) - -/* ** TARGET PARAMETERS ** */ -SC_TARGET_POSITION_VECTOR = (-8919.18729 ,5554.99303 ,3662.51393 ) -TARGET_CENTER_DISTANCE = 11127.61690 - -/* ** TARGET WITHIN SENSOR FOV ** */ -SLANT_DISTANCE = 9115.65447 -CENTER_LATITUDE = 24.03182 -CENTER_LONGITUDE = 297.29424 -HORIZONTAL_PIXEL_SCALE = 232.40761 -VERTICAL_PIXEL_SCALE = 232.40761 -SMEAR_MAGNITUDE = 0.10555 -SMEAR_AZIMUTH = 94.46806 -NORTH_AZIMUTH = 108.06205 -RETICLE_POINT_LATITUDE = (21.08301 ,20.54907 ,27.64956 , - 27.16452 ) -RETICLE_POINT_LONGITUDE = (301.32304 ,295.12377 ,299.48568 , - 292.69017 ) - -/* ** SPACECRAFT POSITION WITH RESPECT TO CENTRAL BODY ** */ -SUB_SPACECRAFT_LATITUDE = -1.04438 -SUB_SPACECRAFT_LONGITUDE = 315.57322 -SPACECRAFT_ALTITUDE = 8687.61690 -SUB_SPACECRAFT_AZIMUTH = 243.13066 - -/* ** SPACECRAFT LOCATION ** */ -SPACECRAFT_SOLAR_DISTANCE = 51220537.58833 -SC_SUN_POSITION_VECTOR = (50079853.32484 ,10735834.95784 , - 541857.50763 ) -SC_SUN_VELOCITY_VECTOR = (24.24499 ,-44.99506 ,-26.54238 ) - -/* ** VIEWING AND LIGHTING GEOMETRY (SUN ON TARGET) ** */ -SOLAR_DISTANCE = 51228055.72874 -SUB_SOLAR_AZIMUTH = 194.38217 -SUB_SOLAR_LATITUDE = -0.01056 -SUB_SOLAR_LONGITUDE = 3.05715 -INCIDENCE_ANGLE = 67.98720 -PHASE_ANGLE = 43.57603 -EMISSION_ANGLE = 38.58010 -LOCAL_HOUR_ANGLE = 114.23708 - -/* ** GEOMETRY FOR EACH SUBFRAME ** */ -GROUP = SUBFRAME1_PARAMETERS - RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") - RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") -END_GROUP = SUBFRAME1_PARAMETERS - -GROUP = SUBFRAME2_PARAMETERS - RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") - RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") -END_GROUP = SUBFRAME2_PARAMETERS - -GROUP = SUBFRAME3_PARAMETERS - RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") - RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") -END_GROUP = SUBFRAME3_PARAMETERS - -GROUP = SUBFRAME4_PARAMETERS - RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") - RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") -END_GROUP = SUBFRAME4_PARAMETERS - -GROUP = SUBFRAME5_PARAMETERS - RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") - RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") -END_GROUP = SUBFRAME5_PARAMETERS - - -OBJECT = IMAGE - LINES = 1024 - LINE_SAMPLES = 1024 - SAMPLE_TYPE = MSB_UNSIGNED_INTEGER - SAMPLE_BITS = 8 - UNIT = "N/A" - DARK_STRIP_MEAN = 10.107 - -/* ** IMAGE STATISTICS OF ** */ -/* ** THE EXPOSED CCD AREA ** */ - MINIMUM = 16.000 - MAXIMUM = 124.000 - MEAN = 65.736 - STANDARD_DEVIATION = 8.835 - -/* ** PIXEL COUNTS ** */ - SATURATED_PIXEL_COUNT = 0 - MISSING_PIXELS = 0 -END_OBJECT = IMAGE -END - - - - -<;:764569;<=?>>==<<:;;=>@BBCEDCB?=<:9::;;<<;;<=>>?@A@>?=<<;;;;;;=>?AAAA@><;73.+'$""$&'+-.02468;<>>@BDEFFIFFB?;7410//12110./1358;?@BCCBB?;630..0//00323321333456998766779:;<===;;;:99::;<>>?>;779>@@A<979::;<==<<;::<==>>?@BBA><989;:99;=??=<>==>>?@ABCDDDDFEDFHJKKLKJHFCBA@AAAA?@????@BDECBC@>=:866677766545668:;:;=ADGHJIIHFGGHHGGEDDHIKLJJIIGIHIJKLMOOQRSSSRRPONMKIG=/#)-++36<<<<=>@@CDDDDC@?<96469863-*-3:@FJMORSSSRQJC=63213457:=?BCA@;61.147;>BDD?>@DEHFC@??>==<>>?>;;;;;<==<=>?>=;;;;::::::9876878987878887757699:;:::742112369;=?ADEFFGHHFC?;;<>?=;8633322343236:>=:7658:<;;97544557567:=?CEGHGFD?:86768ABB?<7-'#%*0240*$!#'-2454668999:964335453.*(+/48=ADDEFDB=;:;:::<=<>>>@BBEEFGGGFEEECA>9520000//./022323456767899;;:9::;;=<<<==>?@ABCCCCCBBAA@@?>>===>@?AABBCEEFHHHHDB>;:::9863335544445687553456877797655445678:::9::::;<==<:9853+$!*036888999::;<<=<<<<:97431359<<=>?AA?<;878:=>?ABCDEGGFHHIJKLMNMKHE?;512///,&! !#'-358;=AEGHGEB?;976 diff --git a/isis/src/core/PvlContainer/Makefile b/isis/src/core/PvlContainer/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlContainer/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlContainer/PvlContainer.truth b/isis/src/core/PvlContainer/PvlContainer.truth deleted file mode 100644 index 7e365d9ca2..0000000000 --- a/isis/src/core/PvlContainer/PvlContainer.truth +++ /dev/null @@ -1,14 +0,0 @@ -DOG = 5.2 - -# Cats shed -CATTLE = Meow -5.2 -# Cats shed -CATTLE = Meow - -Test inserter ... -Orangutan = gross -DOG = 5.2 - -Test reallocation ... -Pointer to DOG is equivalent diff --git a/isis/src/core/PvlEditDialog/Makefile b/isis/src/core/PvlEditDialog/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlEditDialog/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlEditDialog/PvlEditDialog.truth b/isis/src/core/PvlEditDialog/PvlEditDialog.truth deleted file mode 100644 index b41dc856c3..0000000000 --- a/isis/src/core/PvlEditDialog/PvlEditDialog.truth +++ /dev/null @@ -1,3 +0,0 @@ - -Unit test for PvlEditDialog -Replace this when we decide how to do unit tests for interactive objects diff --git a/isis/src/core/PvlFlatMap/Makefile b/isis/src/core/PvlFlatMap/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlFlatMap/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlFlatMap/PvlFlatMap.truth b/isis/src/core/PvlFlatMap/PvlFlatMap.truth deleted file mode 100644 index 37624d927e..0000000000 --- a/isis/src/core/PvlFlatMap/PvlFlatMap.truth +++ /dev/null @@ -1,209 +0,0 @@ -PvlFlatMap1 Source (PvlObject): -Object = Beasts - CAT = Meow - Cat = Null - cat = Purr - Eagle = Swoop - Rattler = coil - - Object = ExcludeObject - Dog = Moo - End_Object - - Group = Fish - Trout = Brown - Bass = "Large mouth" - End_Group - - Group = Birds - Sparrow = House - Crow = Null - EAGLE = Claws - End_Group - - Group = ExcludeGroup - CAT = Woof - End_Group -End_Object - -Map1 - CAT and EAGLE values are overwritten. No Constraints: - Bass = "Large mouth" - CAT = Woof - Crow = Null - Dog = Moo - EAGLE = Claws - Rattler = coil - Sparrow = House - Trout = Brown - -Map1B Constraints: - excludes: ("ExcludeGroup", "ExcludeObject") - includes: () - key list: () - -Map1B - ExcludeGroup and ExcludeObject are excluded: - Bass = "Large mouth" - cat = Purr - Crow = Null - EAGLE = Claws - Rattler = coil - Sparrow = House - Trout = Brown - - Map1C Constraints: - size of excludes: 2 - size of includes: 1 - excludes: ("ExcludeGroup", "ExcludeObject") - includes: ("Beasts") - key list: () - cat is excluded? false - ExcludeGroup is excluded? true - cat is included? false - Beasts is included? true - -Map1C - ExcludeGroup and ExcludeObject are excluded. - Beasts object is included: - Bass = "Large mouth" - cat = Purr - Crow = Null - EAGLE = Claws - Rattler = coil - Sparrow = House - Trout = Brown - -Map1D Constraints: - excludes: () - includes: ("Fish", "Birds") - key list: () - -Map1D - Fish group and Birds object are included. - However, parent object Beasts is not included, - so all subgroups/subobjects are skipped: - - -Map1E Constraints: - size of key list: 7 - excludes: () - includes: () - key list: ("cat", "eagle", "rattler", "trout", "bass", "sparrow", "crow") - cat is in list? true - dog is in list? false - -Map1E - key list provided: - Bass = "Large mouth" - CAT = Woof - Crow = Null - EAGLE = Claws - Rattler = coil - Sparrow = House - Trout = Brown - -Map1F Constraints: - size of key list: 7 - excludes: () - includes: () - key list: ("dog", "eagle", "rattler", "trout", "bass", "sparrow", "crow") - cat is in list? false - dog is in list? true - -Map1F - key list file provided: - Bass = "Large mouth" - Crow = Null - Dog = Moo - EAGLE = Claws - Rattler = coil - Sparrow = House - Trout = Brown - -Map1 Copy: - Bass = "Large mouth" - CAT = Woof - Crow = Null - Dog = Moo - EAGLE = Claws - Rattler = coil - Sparrow = House - Trout = Brown - -PvlFlatMap2 Source (PvlGroup): -# Are slimey -Group = Snake - Rattler = DiamondBack -End_Group - -Map2 - No constraints: - Rattler = DiamondBack - -Map1 and Map2 combined - RATTLER is overwritten: - Bass = "Large mouth" - CAT = Woof - Crow = Null - Dog = Moo - EAGLE = Claws - Rattler = DiamondBack - Sparrow = House - Trout = Brown - -Map3 - CLIMB values are appended: - Climb = (Wall, Rock, Tree) - Field = Run - Fly = Sugar - -Merging Map3 to Maps 1,2. Adding [ "3" ] new keywords. -Map1, Map2, and Map3 merged: - Bass = "Large mouth" - CAT = Woof - Climb = (Wall, Rock, Tree) - Crow = Null - Dog = Moo - EAGLE = Claws - Field = Run - Fly = Sugar - Rattler = DiamondBack - Sparrow = House - Trout = Brown - -Get map info for existing keys: - Map has keyword=crow? true - crow is Null? true - Map has keyword=climb? true - All Values for climb: ("Wall", "Rock", "Tree") - climb count: 3 - climb at index "0" is Null? false - climb at index "1" is Null? false - climb at index "2" is Null? false - Get first value of climb: "Wall" - Get second value of climb: "Rock" - Get third value of climb: "Tree" - Get fourth value of climb or return KingKong: "KingKong" - Get climb as PvlKeyword: Climb = (Wall, Rock, Tree) - -Get map info for non-existent keys: - Map has keyword=pencil? false - All Values for pencil: () - pencil count: 0 - pencil is Null? true - Get value of pencil or return Lucy: "Lucy" - Get values for PvlKeyword('pencil', 'Linus'): ("Linus") - -Erasing climb keyword: true -Reprint Map123 merged with CLIMB keyword erased: - Bass = "Large mouth" - CAT = Woof - Crow = Null - Dog = Moo - EAGLE = Claws - Field = Run - Fly = Sugar - Rattler = DiamondBack - Sparrow = House - Trout = Brown - -Try to get CLIMB keyword after erased... -**PROGRAMMER ERROR** Keyword Climb does not exist!. - -Try to get CAT keyword at non-existent index... -**PROGRAMMER ERROR** Index 10 does not exist for keyword CAT!. - -Try to get non-existent pencil keyword... -**PROGRAMMER ERROR** Keyword pencil does not exist!. diff --git a/isis/src/core/PvlFormat/Makefile b/isis/src/core/PvlFormat/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlFormat/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlFormat/PvlFormat.truth b/isis/src/core/PvlFormat/PvlFormat.truth deleted file mode 100644 index 865d45b261..0000000000 --- a/isis/src/core/PvlFormat/PvlFormat.truth +++ /dev/null @@ -1,34 +0,0 @@ -mystring = stringval -mystring = "string val" -myint = 12345 -myfloat = 12345.67e+89 -myarray = (12345, "a short string", 1.234) -myarray = {12345, "a short string", 1.234} -Group = Group1 - mystring = stringval - mystring = "string val" - myint = 12345 - myfloat = 12345.67e+89 - myarray = (12345,"a short string",1.234) -End_Group -Object = Object1 - Object = Object2 - mystring = stringval - mystring = "string val" - myint = 12345 - myfloat = 12345.67e+89 - myarray = (12345,"a short string",1.234) - End_Object - - Group = Group1 - mystring = stringval - mystring = "string val" - myint = 12345 - myfloat = 12345.67e+89 - myarray = (12345,"a short string",1.234) - End_Group -End_Object -myequation = "(f1-f2) * 5" -myequation = "(f1-f2)*5" -mysequence = ((a,b), (c,d)) -mycommas = ",,," diff --git a/isis/src/core/PvlFormatPds/Makefile b/isis/src/core/PvlFormatPds/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlFormatPds/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlFormatPds/PvlFormatPds.truth b/isis/src/core/PvlFormatPds/PvlFormatPds.truth deleted file mode 100644 index c87045875d..0000000000 --- a/isis/src/core/PvlFormatPds/PvlFormatPds.truth +++ /dev/null @@ -1,260 +0,0 @@ -skey = somestringval -SKEY = "somestringval" -skey = "string val" -SKEY = "string val" -sNAstring = N/A -SNASTRING = "N/A" -sUNKquote = "UNK" -SUNKQUOTE = "UNK" -ssinglequote = 'NA' -SSINGLEQUOTE = 'NA' -notinmap = "junk string" -NOTINMAP = "junk string" -myint = 12345 -MYINT = 12345 -myfloat = -1.234567e+93 -MYFLOAT = -1.234567e+93 -fkey = -12345.6789 -FKEY = -12345.6789 -fkey0 = -9876.543 -FKEY0 = -9877 -fkey0 = -9.876543e-96 -FKEY0 = -0 -fkey2 = 0.123456 -FKEY2 = 0.12 -fkey2 = (0.123456, 987.123) -FKEY2 = (0.12 , 987.12 ) -fkey2 = (0.123456 , 987.123) -FKEY2 = (0.12 , 987.12) -ekey = unsigned -EKEY = unsigned -myarray = (12345,"a short string",1.234) -MYARRAY = (12345,"a short string",1.234) -hkey0 = 1311768467463790335 -HKEY0 = 16#123456789ABCDEFF# -hkey2 = 31371 -HKEY2 = 16#7A8B# -hkey4 = 439041101 -HKEY4 = 16#1A2B3C4D# -binkey = 10 -BINKEY = 2#0001010# -binkey16 = 65535 -BINKEY16 = 2#1111111111111111# -intkeyarray = (1, NULL, 3, NULL) -INTKEYARRAY = (1, "NULL", 3, "NULL") -intkeyarray = (1 , NULL , 3 , N/A, UNK) -INTKEYARRAY = (1 , "NULL" , 3 , "N/A", "UNK") -dblkeyarray = (1.01, NULL, 3.4, UNK) -DBLKEYARRAY = (1.01, "NULL", 3.40, "UNK") -=============================== Before -Group = Group1 - skey = stringval - mystring = "string val" - sNULLstring = NULL - sUNKquote = "UNK" - sNAsingle = 'N/A' - myint = 12345 - myfloat = 1.234567e+93 - myarray = (12345,"a short string",1.234) -End_Group -=============================== After -GROUP = GROUP1 - SKEY = "stringval" - MYSTRING = "string val" - SNULLSTRING = "NULL" - SUNKQUOTE = "UNK" - SNASINGLE = 'N/A' - MYINT = 12345 - MYFLOAT = 1.234567e+93 - MYARRAY = (12345,"a short string",1.234) -END_GROUP = GROUP1 -=============================== Before -Object = Object1 - skey = stringval - mystring = "string val" - sNULLstring = NULL - sUNKquote = "UNK" - sNAsingle = 'N/A' - myint = 12345 - myfloat = 1.234567e+93 - myarray = (12345,"a short string",1.234) - - Object = Object2 - skey = stringval - mystring = "string val" - sNULLstring = NULL - sUNKquote = "UNK" - sNAsingle = 'N/A' - myint = 12345 - myfloat = 1.234567e+93 - myarray = (12345,"a short string",1.234) - End_Object - - Group = Group1 - skey = stringval - mystring = "string val" - sNULLstring = NULL - sUNKquote = "UNK" - sNAsingle = 'N/A' - myint = 12345 - myfloat = 1.234567e+93 - myarray = (12345,"a short string",1.234) - End_Group -End_Object -=============================== After -OBJECT = OBJECT1 - SKEY = "stringval" - MYSTRING = "string val" - SNULLSTRING = "NULL" - SUNKQUOTE = "UNK" - SNASINGLE = 'N/A' - MYINT = 12345 - MYFLOAT = 1.234567e+93 - MYARRAY = (12345,"a short string",1.234) - - OBJECT = OBJECT2 - SKEY = "stringval" - MYSTRING = "string val" - SNULLSTRING = "NULL" - SUNKQUOTE = "UNK" - SNASINGLE = 'N/A' - MYINT = 12345 - MYFLOAT = 1.234567e+93 - MYARRAY = (12345,"a short string",1.234) - END_OBJECT = OBJECT2 - - GROUP = GROUP1 - SKEY = "stringval" - MYSTRING = "string val" - SNULLSTRING = "NULL" - SUNKQUOTE = "UNK" - SNASINGLE = 'N/A' - MYINT = 12345 - MYFLOAT = 1.234567e+93 - MYARRAY = (12345,"a short string",1.234) - END_GROUP = GROUP1 -END_OBJECT = OBJECT1 -=============================== Before -skey = stringval -mystring = "string val" -sNULLstring = NULL -sUNKquote = "UNK" -sNAsingle = 'N/A' -myint = 12345 -myfloat = 1.234567e+93 -myarray = (12345,"a short string",1.234) - -Object = Object1 - skey = stringval - mystring = "string val" - sNULLstring = NULL - sUNKquote = "UNK" - sNAsingle = 'N/A' - myint = 12345 - myfloat = 1.234567e+93 - myarray = (12345,"a short string",1.234) - - Object = Object2 - skey = stringval - mystring = "string val" - sNULLstring = NULL - sUNKquote = "UNK" - sNAsingle = 'N/A' - myint = 12345 - myfloat = 1.234567e+93 - myarray = (12345,"a short string",1.234) - binkey16 = 496 - End_Object - - Group = Group1 - skey = stringval - mystring = "string val" - sNULLstring = NULL - sUNKquote = "UNK" - sNAsingle = 'N/A' - myint = 12345 - myfloat = 1.234567e+93 - myarray = (12345,"a short string",1.234) - End_Group -End_Object - -Group = Group2 - skey = stringval - mystring = "string val" - sNULLstring = NULL - sUNKquote = "UNK" - sNAsingle = 'N/A' - myint = 12345 - myfloat = 1.234567e+93 - myarray = (12345,"a short string",1.234) - binkey16 = 32769 - wrapword = "The quick brown fox jumped over the lazy duck. Repunzel - Repunzel let down your hair. The little toy dog is covered - with dust, but sturdy and staunch he stands; and the little - toy soldier is red with rust." - array = (12345, 67890, 12345, 67890, 12345, 67890, 12345, 67890, - 12345, 67890, 12345, 67890, 12345, 67890, 12345) -End_Group -End -=============================== After -SKEY = "stringval" -MYSTRING = "string val" -SNULLSTRING = "NULL" -SUNKQUOTE = "UNK" -SNASINGLE = 'N/A' -MYINT = 12345 -MYFLOAT = 1.234567e+93 -MYARRAY = (12345,"a short string",1.234) - -OBJECT = OBJECT1 - SKEY = "stringval" - MYSTRING = "string val" - SNULLSTRING = "NULL" - SUNKQUOTE = "UNK" - SNASINGLE = 'N/A' - MYINT = 12345 - MYFLOAT = 1.234567e+93 - MYARRAY = (12345,"a short string",1.234) - - OBJECT = OBJECT2 - SKEY = "stringval" - MYSTRING = "string val" - SNULLSTRING = "NULL" - SUNKQUOTE = "UNK" - SNASINGLE = 'N/A' - MYINT = 12345 - MYFLOAT = 1.234567e+93 - MYARRAY = (12345,"a short string",1.234) - BINKEY16 = 2#0000000111110000# - END_OBJECT = OBJECT2 - - GROUP = GROUP1 - SKEY = "stringval" - MYSTRING = "string val" - SNULLSTRING = "NULL" - SUNKQUOTE = "UNK" - SNASINGLE = 'N/A' - MYINT = 12345 - MYFLOAT = 1.234567e+93 - MYARRAY = (12345,"a short string",1.234) - END_GROUP = GROUP1 -END_OBJECT = OBJECT1 - -GROUP = GROUP2 - SKEY = "stringval" - MYSTRING = "string val" - SNULLSTRING = "NULL" - SUNKQUOTE = "UNK" - SNASINGLE = 'N/A' - MYINT = 12345 - MYFLOAT = 1.234567e+93 - MYARRAY = (12345,"a short string",1.234) - BINKEY16 = 2#1000000000000001# - WRAPWORD = "The quick brown fox jumped over the lazy duck. Repunzel - Repunzel let down your hair. The little toy dog is covered - with dust, but sturdy and staunch he stands; and the little - toy soldier is red with rust." - ARRAY = (12345, 67890, 12345, 67890, 12345, 67890, 12345, 67890, - 12345, 67890, 12345, 67890, 12345, 67890, 12345) -END_GROUP = GROUP2 -End diff --git a/isis/src/core/PvlGroup/Makefile b/isis/src/core/PvlGroup/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlGroup/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlGroup/PvlGroup.truth b/isis/src/core/PvlGroup/PvlGroup.truth deleted file mode 100644 index 767f7ff5e1..0000000000 --- a/isis/src/core/PvlGroup/PvlGroup.truth +++ /dev/null @@ -1,68 +0,0 @@ -/* Pets are cool -Group = Animals - DOG = 5.2 - - # Cats shed - CATTLE = Meow -End_Group -5.2 - -/* Pets are cool -Group = Animals - # Cats shed - CATTLE = Meow -End_Group - -/* Pets are cool -Group = Animals -End_Group - -# Testing -/* 123 */ -Group = POODLE - CAT = TABBY - BIRD = PARROT - REPTILE = (SNAKE, LIZARD) - BOVINE = (COW, CAMEL) - TREE = (MAPLE, ELM, PINE) - - # This is a comment - FLOWER = "DAISY & TULIP " - - /* This is another comment */ - BIG = (" NOT ", "REALLY LARGE") -End_Group -**ERROR** Group [POODLE] EndGroup not found before end of file when reading PVL. -Template Group: -Group = Point_ErrorMagnitude - Point_ErrorMagnitude__Required = false - LessThan = double - LessThan__Required = false - LessThan__Repeated = false - GreaterThan = double - GreaterThan__Required = true - GreaterThan__Repeated = true -End_Group - - -**Test1**RequiredKeyword -Results Group: -Group = Point_errormagnitude -End_Group -**PVL ERROR** Required Keyword "GreaterThan" not found in the PvlGroup -********** - -**Test2** -Repeated values are allowed if Repeat flag is set -Results Group: -Group = Point_errormagnitude -End_Group -********** - -**Test3** -Unvalidated Keywords -Results Group: -Group = Point_errormagnitude - Less123Than = 2.5 -End_Group -********** diff --git a/isis/src/core/PvlKeyword/Makefile b/isis/src/core/PvlKeyword/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlKeyword/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlObject/Makefile b/isis/src/core/PvlObject/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlObject/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlSequence/Makefile b/isis/src/core/PvlSequence/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlSequence/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlSequence/PvlSequence.truth b/isis/src/core/PvlSequence/PvlSequence.truth deleted file mode 100644 index 3da7513ec5..0000000000 --- a/isis/src/core/PvlSequence/PvlSequence.truth +++ /dev/null @@ -1,10 +0,0 @@ -8 -xyzzy plover -2 b | ^ 2 b -a b c -d e -singleton -1 2 --1 -2 -3 -1.0 0.0 -1.0 -0 diff --git a/isis/src/core/PvlToPvlTranslationManager/Makefile b/isis/src/core/PvlToPvlTranslationManager/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlToPvlTranslationManager/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth b/isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth deleted file mode 100644 index 4fd157329d..0000000000 --- a/isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth +++ /dev/null @@ -1,51 +0,0 @@ -Testing PvlToPvlTranslationManager object - Testing InputValue member - DataFileName = SomeFile.dat - StartByte = 32 - NumberOfBands = 27 - PixelResolution = 100 - Error messages: - **PROGRAMMER ERROR** Unable to find input group [Bad1,Bad2,Bad3] for output name [BadGroup] in file []. - **PROGRAMMER ERROR** Unable to find input keyword [BadKey] for output name [GoodGroupBadKey] in file []. - - Testing InputUnits member - PixelResolution = meters - NumberOfBands = - Error messages: - **PROGRAMMER ERROR** Unable to find input group [Bad1,Bad2,Bad3] for output name [BadGroup] in file []. - **PROGRAMMER ERROR** Unable to find input keyword [BadKey] for output name [GoodGroupBadKey] in file []. - - Testing InputSize member - BandName = 3 - PixelResolution = 1 - Error messages: - **PROGRAMMER ERROR** Unable to find input group [Bad1,Bad2,Bad3] for output name [BadGroup] in file []. - **PROGRAMMER ERROR** Unable to find input keyword [BadKey] for output name [GoodGroupBadKey] in file []. - - Testing InputHasKeyword member - BandName = 1 - GoodGroupBadKey = 0 - - Testing Translate member - DataFileName = SomeFile.dat - ImageStartByte = 32 - Lines = 500 - - Testing Auto member -PixelBytes = 2 - -Object = IsisCube - Object = BandBin - Band = (Red, Green, Blue) - End_Object - - Group = Dimensions - Lines = 500 - Bands = (27, 12, 1) - End_Group -End_Object - -Group = Mapping - CenterLongitude = 44.4975624 -End_Group -End diff --git a/isis/src/core/PvlToXmlTranslationManager/Makefile b/isis/src/core/PvlToXmlTranslationManager/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlToXmlTranslationManager/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth b/isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth deleted file mode 100644 index 0b587b848c..0000000000 --- a/isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth +++ /dev/null @@ -1,52 +0,0 @@ - Testing Setting Input Label - Testing Translating Something -Filter = NIR - Testing InputKeyword -ExposureDuration = 1.920e-003 - Testing Bad InputKeyword -**PROGRAMMER ERROR** Unable to find translation group [BAD] in file [temp.trn]. - - Testing Translate -2048 - Testing Bad Translate -**PROGRAMMER ERROR** Unable to find translation group [BAD] in file [temp.trn]. - - Testing InputHasKeyword True -1 - Testing InputHasKeyword False -**PROGRAMMER ERROR** Unable to find translation group [False] in file [temp.trn]. - - Testing bad InputKeyword, does not exist in group -**PROGRAMMER ERROR** Unable to find input keyword [NotInLabel] for output name [DefaultOutput] in file [temp.trn]. - - Testing bad InputKeyword, group does not exist -**PROGRAMMER ERROR** Unable to find translation group [BadInputGroup] in file [temp.trn]. - - Testing SetLabel - SetLabel Succesful - - Testing Auto member - - - - - - 2048 - Sample - - - 255 - Line - - - - - - - NIR - DefaultValue - - - - - diff --git a/isis/src/core/PvlToken/Makefile b/isis/src/core/PvlToken/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlToken/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlToken/PvlToken.truth b/isis/src/core/PvlToken/PvlToken.truth deleted file mode 100644 index dc2e6309a8..0000000000 --- a/isis/src/core/PvlToken/PvlToken.truth +++ /dev/null @@ -1,18 +0,0 @@ -Info on dog - key: Dog - upperkey: DOG - valuesize: 1 - value: drools - uppervalue: DROOLS - -Adding another value to dog - valuesize: 2 - value: wags tail - uppervalue: WAGS TAIL - -Clearing dog values - valuesize: 0 - -Testing Throws in dog -**PROGRAMMER ERROR** Array subscript [-1] is out of array bounds. -**PROGRAMMER ERROR** Array subscript [1] is out of array bounds. diff --git a/isis/src/core/PvlTokenizer/Makefile b/isis/src/core/PvlTokenizer/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlTokenizer/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlTokenizer/PvlTokenizer.truth b/isis/src/core/PvlTokenizer/PvlTokenizer.truth deleted file mode 100644 index 2153019f8b..0000000000 --- a/isis/src/core/PvlTokenizer/PvlTokenizer.truth +++ /dev/null @@ -1,44 +0,0 @@ -TESTING TOKENIZER -DOG is POODLE -CAT is TABBY -BIRD is PARROT -REPTILE is SNAKE LIZARD --VEGGIE is -BOVINE is COW CAMEL -TREE is MAPLE ELM PINE -_COMMENT_ is # This is a comment -FLOWER is DAISY & TULIP -_COMMENT_ is /* This is another comment -BIG is NOT REALLY LARGE -SEQUENCE is (a,b,c) (d,e,f) -QUOTED_STRING is A QUOTED STRING -QuotedNewLine is abcdefgh ijk lmn -ApostNewLine is abcdefgh ijk lmn - -TESTING TOKENIZER CLEAR -0 - -TESTING TOKEN ERROR [PHRASE = "The quick brown fox jumped over the lazy dog] -**ERROR** Keyword [PHRASE] has bad value. -**ERROR** Missing delimiter ["] at or near [The quick brown fox ...]. - -TESTING TOKEN ERROR [PHRASE = {To Be or Not To Be That is the Question] -**ERROR** Keyword [PHRASE] has bad value. -**ERROR** Missing delimiter [}] at or near [To Be or Not To Be T ...]. - -TESTING TOKEN ERROR [PHRASE = (I came, I saw, I conquered] -**ERROR** Keyword [PHRASE] has bad value. -**ERROR** Missing delimiter [)] at or near [I came, I saw, I con ...]. - -TESTING TOKEN ERROR [FOOD = ("french","fries,"good") ] -**ERROR** Keyword [FOOD] has bad value. -**ERROR** Missing delimiter ["] at or near ["french","fries,"goo ...]. - -TESTING TOKEN ERROR [FOOD = ("burgers","hotdogs,"good")] -**ERROR** Keyword [FOOD] has bad value. -**ERROR** Missing delimiter ["] at or near ["burgers","hotdogs," ...]. - -TESTING TOKEN ERROR [FOOD = ("pickels,pizza")] - -TESTING TOKEN ERROR [FISH = ("trout","pizz"a)] - diff --git a/isis/src/core/PvlTranslationTable/Makefile b/isis/src/core/PvlTranslationTable/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/PvlTranslationTable/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/PvlTranslationTable/PvlTranslationTable.truth b/isis/src/core/PvlTranslationTable/PvlTranslationTable.truth deleted file mode 100644 index 9b72235ee1..0000000000 --- a/isis/src/core/PvlTranslationTable/PvlTranslationTable.truth +++ /dev/null @@ -1,43 +0,0 @@ -Unit test for Isis::PvlTranslationTable - - Test InputGroup : - InputGroup ("DataFileName") = ROOT - InputGroup ("CoreLines") = IMAGE - **PROGRAMMER ERROR** Unable to find translation group [tttt1] in file []. - - Test InputKey : - InputKeywordName ("DataFileName") = ^IMAGE - InputKeywordName ("CoreLines") = LINES - **PROGRAMMER ERROR** Unable to find translation group [tttt2] in file []. - - Test InputDefault : - InputDefault ("DataFileName") = - InputDefault ("CoreBitsPerPixel") = 8 - **PROGRAMMER ERROR** Unable to find translation group [tttt3] in file []. - - Test Translate : - Translate ("DataFileName", "tttt4") = tttt4 - Translate ("CoreByteOrder","MSB_INTEGER") = BigEndian - Translate ("CorePixelType") = Integer - Translate ("CorePixelType") = Unknown - **PROGRAMMER ERROR** Unable to find translation group [tttt6] in file []. - **PROGRAMMER ERROR** No value or default value to translate for translation group [DataFileRecordBytes] in file []. - **PROGRAMMER ERROR** Unable to find a translation value for [CoreBitsPerPixel, 31] in file []. - - Test AddTable : - Translate ("CoreLinePrefixBytes", "128") = 128 - - Test IsAuto : - IsAuto ("DataFileName") = 0 - IsAuto ("CoreBitsPerPixel") = 1 - - Test IsOptional : - IsAuto ("DataFileName") = 0 - IsAuto ("CoreBitsPerPixel") = 1 - - Test OutputPosition : - OutputPosition ("CoreBitsPerPixel") yields : OutputPosition = (Object, IsisCube, Object, Core, Group, Pixels) - - Test OutputName : - OutputName ("CoreBitsPerPixel") = BitsPerPixel - diff --git a/isis/src/core/SpecialPixel/Makefile b/isis/src/core/SpecialPixel/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/SpecialPixel/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/SpecialPixel/SpecialPixel.truth b/isis/src/core/SpecialPixel/SpecialPixel.truth deleted file mode 100644 index 942fe92a80..0000000000 --- a/isis/src/core/SpecialPixel/SpecialPixel.truth +++ /dev/null @@ -1,144 +0,0 @@ -Unit test for IsisSpecialPixel -Valid minimum (1 byte): 1 -Null (1 byte): 0 -Low Representation (1 byte): 0 -Low Instrument (1 byte): 0 -High Representation (1 byte): 255 -High Instrument (1 byte): 255 -Valid maximum (1 byte): 254 - -Valid minimum (2 byte): -32752 -Null (2 byte): -32768 -Low Representation (2 byte): -32767 -Low Instrument (2 byte): -32766 -High Representation (2 byte): -32764 -High Instrument (2 byte): -32765 -Valid maximum (2 byte): 32767 - -Valid minimum (4 byte): -3.40282e+38 -Null (4 byte): -3.40282e+38 -Low Representation (4 byte): -3.40282e+38 -Low Instrument (4 byte): -3.40282e+38 -High Representation (4 byte): -3.40282e+38 -High Instrument (4 byte): -3.40282e+38 -Valid maximum (4 byte): 3.40282e+38 - -Valid minimum (8 byte): -1.797693134862315e+308 -Null (8 byte): -1.797693134862315e+308 -Low Representation (8 byte): -1.797693134862315e+308 -Low Instrument (8 byte): -1.797693134862315e+308 -High Representation (8 byte): -1.797693134862316e+308 -High Instrument (8 byte): -1.797693134862316e+308 -Valid maximum (8 byte): 1.797693134862316e+308 - -Testing 0.0 ... -IsSpecial: 0 -IsValidPixel: 1 -IsNullPixel: 0 -IsLowPixel: 0 -IsHighPixel: 0 -IsHrsPixel: 0 -IsHisPixel: 0 -IsLrsPixel: 0 -IsLisPixel: 0 - -Testing Isis::Null ... -IsSpecial: 1 -IsValidPixel: 0 -IsNullPixel: 1 -IsLowPixel: 0 -IsHighPixel: 0 -IsHrsPixel: 0 -IsHisPixel: 0 -IsLrsPixel: 0 -IsLisPixel: 0 - -Testing Isis::Lis ... -IsSpecial: 1 -IsValidPixel: 0 -IsNullPixel: 0 -IsLowPixel: 1 -IsHighPixel: 0 -IsHrsPixel: 0 -IsHisPixel: 0 -IsLrsPixel: 0 -IsLisPixel: 1 - -Testing Isis::Lrs ... -IsSpecial: 1 -IsValidPixel: 0 -IsNullPixel: 0 -IsLowPixel: 1 -IsHighPixel: 0 -IsHrsPixel: 0 -IsHisPixel: 0 -IsLrsPixel: 1 -IsLisPixel: 0 - -Testing Isis::His ... -IsSpecial: 1 -IsValidPixel: 0 -IsNullPixel: 0 -IsLowPixel: 0 -IsHighPixel: 1 -IsHrsPixel: 0 -IsHisPixel: 1 -IsLrsPixel: 0 -IsLisPixel: 0 - -Testing Isis::Hrs ... -IsSpecial: 1 -IsValidPixel: 0 -IsNullPixel: 0 -IsLowPixel: 0 -IsHighPixel: 1 -IsHrsPixel: 1 -IsHisPixel: 0 -IsLrsPixel: 0 -IsLisPixel: 0 - -Testing PixelToString(double): -Isis::Null to String: Null -Isis::Lrs to String: Lrs -Isis::Hrs to String: Hrs -Isis::His to String: His -Isis::Lis to String: Lis -0.0 to String: 0 -1.5 to String: 1.5 --6.0 to String: -6 - -Testing StringToPixel(QString): -NuLl to Pixel: -1.797693134862315e+308 -lrs to Pixel: -1.797693134862315e+308 -Hrs to Pixel: -1.797693134862316e+308 -HIs to Pixel: -1.797693134862316e+308 -LIS to Pixel: -1.797693134862315e+308 -0.0 to Pixel: 0 -1.5 to Pixel: 1.5 --6.0 to Pixel: -6 --6 to Pixel: -6 - -Testing unique value shortcut for StringToPixel(QString): -Nul to Pixel: -1.797693134862315e+308 -N to Pixel: -1.797693134862315e+308 -Lr to Pixel: -1.797693134862315e+308 -Hr to Pixel: -1.797693134862316e+308 -Hi to Pixel: -1.797693134862316e+308 -Li to Pixel: -1.797693134862315e+308 - -Testing illegal shortcuts/expressions for StringToPixel(QString): -**USER ERROR** Input [Nl] does not appear to be a legal special pixel abbreviation or double value. -**ERROR** Failed to convert string [NL] to a double. -**USER ERROR** Input [Nulll] does not appear to be a legal special pixel abbreviation or double value. -**ERROR** Failed to convert string [NULLL] to a double. -**USER ERROR** Input [L] is not a unique abbreviation. Use LI or LR. -**USER ERROR** Input [Ls] does not appear to be a legal special pixel abbreviation or double value. -**ERROR** Failed to convert string [LS] to a double. -**USER ERROR** Input [H] is not a unique abbreviation. Use HI or HR. -**USER ERROR** Input [Hs] does not appear to be a legal special pixel abbreviation or double value. -**ERROR** Failed to convert string [HS] to a double. -**USER ERROR** Input [Hrsr] does not appear to be a legal special pixel abbreviation or double value. -**ERROR** Failed to convert string [HRSR] to a double. -**USER ERROR** Input [nonsense] does not appear to be a legal special pixel abbreviation or double value. -**ERROR** Failed to convert string [NONSENSE] to a double. - diff --git a/isis/src/core/TextFile/Makefile b/isis/src/core/TextFile/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/core/TextFile/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/TextFile/TextFile.truth b/isis/src/core/TextFile/TextFile.truth deleted file mode 100644 index d4ff128052..0000000000 --- a/isis/src/core/TextFile/TextFile.truth +++ /dev/null @@ -1,43 +0,0 @@ -Unit test for TextFile - -1) Create / Overwrite file $temporary/TextFile.tmp with prefilled vector - -2) Read file $temporary/TextFile.tmp into vector - -3) Create / Overwrite file $temporary/TextFile.tmp with prefilled QString array - -4) Read file $temporary/TextFile.tmp into QString array - -5) Overwrite file $temporary/TextFile.tmp - -6) Overwrite file and write 6 lines $temporary/TextFile.tmp - -7) Append 6 lines to file $temporary/TextFile.tmp - -8) Input (read) file $temporary/TextFile.tmp - -10) Trigger Error messages - a) Try to open non-existent file -**I/O ERROR** TextFile:Open:-> Unable to open: [Input]:[./NoSuchDir/TextFile.tmp]. - - b) Try open as output to pre-existing file -**I/O ERROR** TextFile:Open: -> Output file already exists [Output]:[./TextFile.tmp]. - - c) Open file with bad open mode -**PROGRAMMER ERROR** TextFile::-> Unknown openmode: (input, output, overwrite, append):[xxxInputxxx]:[./TextFile.tmp]. - - d) Try to write to Input - Read Only file -**PROGRAMMER ERROR** TextFile:PutLine: -> Attempt to write to INPUT - Read Only text file: [./TextFile.tmp]. - - e) Try to Write to a closed file -**PROGRAMMER ERROR** TextFile::-> File not open: [./TextFile.tmp]. - - f) Try to Read from a closed file -**PROGRAMMER ERROR** TextFile::-> File not open: [./TextFile.tmp]. - -testing GetLine for files that do not end in a newline: Passed - -this file has no newline chars in it! - -11) Remove temp file -> $temporary/TextFile.tmp <- - diff --git a/isis/src/core/cmake/FindCSPICE.cmake b/isis/src/core/cmake/FindCSPICE.cmake new file mode 100644 index 0000000000..3df2e1ff87 --- /dev/null +++ b/isis/src/core/cmake/FindCSPICE.cmake @@ -0,0 +1,18 @@ +# CMake module for find_package(CSPICE) +# Finds include directory and all applicable libraries +# +# Sets the following: +# CSPICE_INCLUDE_DIR +# CSPICE_LIBRARY + +find_path(CSPICE_INCLUDE_DIR + NAME SpiceUsr.h + PATH_SUFFIXES naif cspice +) + +find_library(CSPICE_LIBRARY + NAMES cspice +) + +message(STATUS "CSPICE INCLUDE: " ${CSPICE_INCLUDE_DIR} ) +message(STATUS "CSPICE LIB: " ${CSPICE_LIBRARY} ) diff --git a/isis/src/core/cmake/FindGeos.cmake b/isis/src/core/cmake/FindGeos.cmake new file mode 100644 index 0000000000..2c88116adb --- /dev/null +++ b/isis/src/core/cmake/FindGeos.cmake @@ -0,0 +1,24 @@ +# CMake module for find_package(Geos) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GEOS_INCLUDE_DIR +# GEOS_LIBRARY + +find_path(GEOS_INCLUDE_DIR + NAMES geos.h + PATH_SUFFIXES "geos/geos${Geos_FIND_VERSION}" "geos" +) + +find_library(GEOS_LIBRARY + NAMES geos +) +find_library(GEOS_C_LIBRARY + NAMES geos_c +) + +message(STATUS "GEOS INCLUDE DIR: " ${GEOS_INCLUDE_DIR} ) +message(STATUS "GEOS LIB: " ${GEOS_LIBRARY} ) +message(STATUS "GEOS C LIB: " ${GEOS_C_LIBRARY} ) + +get_filename_component(GEOS_ROOT_INCLUDE_DIR "${GEOS_INCLUDE_DIR}" DIRECTORY) diff --git a/isis/src/core/Constants/Constants.h b/isis/src/core/include/Constants.h similarity index 100% rename from isis/src/core/Constants/Constants.h rename to isis/src/core/include/Constants.h diff --git a/isis/src/core/FileName/FileName.h b/isis/src/core/include/FileName.h similarity index 100% rename from isis/src/core/FileName/FileName.h rename to isis/src/core/include/FileName.h diff --git a/isis/src/core/IException/IException.h b/isis/src/core/include/IException.h similarity index 100% rename from isis/src/core/IException/IException.h rename to isis/src/core/include/IException.h diff --git a/isis/src/core/IString/IString.h b/isis/src/core/include/IString.h similarity index 100% rename from isis/src/core/IString/IString.h rename to isis/src/core/include/IString.h diff --git a/isis/src/core/LabelTranslationManager/LabelTranslationManager.h b/isis/src/core/include/LabelTranslationManager.h similarity index 100% rename from isis/src/core/LabelTranslationManager/LabelTranslationManager.h rename to isis/src/core/include/LabelTranslationManager.h diff --git a/isis/src/core/Message/Message.h b/isis/src/core/include/Message.h similarity index 100% rename from isis/src/core/Message/Message.h rename to isis/src/core/include/Message.h diff --git a/isis/src/core/Preference/Preference.h b/isis/src/core/include/Preference.h similarity index 100% rename from isis/src/core/Preference/Preference.h rename to isis/src/core/include/Preference.h diff --git a/isis/src/core/Pvl/Pvl.h b/isis/src/core/include/Pvl.h similarity index 100% rename from isis/src/core/Pvl/Pvl.h rename to isis/src/core/include/Pvl.h diff --git a/isis/src/core/PvlContainer/PvlContainer.h b/isis/src/core/include/PvlContainer.h similarity index 100% rename from isis/src/core/PvlContainer/PvlContainer.h rename to isis/src/core/include/PvlContainer.h diff --git a/isis/src/core/PvlFlatMap/PvlFlatMap.h b/isis/src/core/include/PvlFlatMap.h similarity index 100% rename from isis/src/core/PvlFlatMap/PvlFlatMap.h rename to isis/src/core/include/PvlFlatMap.h diff --git a/isis/src/core/PvlFormat/PvlFormat.h b/isis/src/core/include/PvlFormat.h similarity index 100% rename from isis/src/core/PvlFormat/PvlFormat.h rename to isis/src/core/include/PvlFormat.h diff --git a/isis/src/core/PvlFormatPds/PvlFormatPds.h b/isis/src/core/include/PvlFormatPds.h similarity index 100% rename from isis/src/core/PvlFormatPds/PvlFormatPds.h rename to isis/src/core/include/PvlFormatPds.h diff --git a/isis/src/core/PvlGroup/PvlGroup.h b/isis/src/core/include/PvlGroup.h similarity index 100% rename from isis/src/core/PvlGroup/PvlGroup.h rename to isis/src/core/include/PvlGroup.h diff --git a/isis/src/core/PvlKeyword/PvlKeyword.h b/isis/src/core/include/PvlKeyword.h similarity index 100% rename from isis/src/core/PvlKeyword/PvlKeyword.h rename to isis/src/core/include/PvlKeyword.h diff --git a/isis/src/core/PvlObject/PvlObject.h b/isis/src/core/include/PvlObject.h similarity index 100% rename from isis/src/core/PvlObject/PvlObject.h rename to isis/src/core/include/PvlObject.h diff --git a/isis/src/core/PvlSequence/PvlSequence.h b/isis/src/core/include/PvlSequence.h similarity index 100% rename from isis/src/core/PvlSequence/PvlSequence.h rename to isis/src/core/include/PvlSequence.h diff --git a/isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h b/isis/src/core/include/PvlToPvlTranslationManager.h similarity index 100% rename from isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h rename to isis/src/core/include/PvlToPvlTranslationManager.h diff --git a/isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h b/isis/src/core/include/PvlToXmlTranslationManager.h similarity index 100% rename from isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h rename to isis/src/core/include/PvlToXmlTranslationManager.h diff --git a/isis/src/core/PvlToken/PvlToken.h b/isis/src/core/include/PvlToken.h similarity index 100% rename from isis/src/core/PvlToken/PvlToken.h rename to isis/src/core/include/PvlToken.h diff --git a/isis/src/core/PvlTokenizer/PvlTokenizer.h b/isis/src/core/include/PvlTokenizer.h similarity index 100% rename from isis/src/core/PvlTokenizer/PvlTokenizer.h rename to isis/src/core/include/PvlTokenizer.h diff --git a/isis/src/core/PvlTranslationTable/PvlTranslationTable.h b/isis/src/core/include/PvlTranslationTable.h similarity index 100% rename from isis/src/core/PvlTranslationTable/PvlTranslationTable.h rename to isis/src/core/include/PvlTranslationTable.h diff --git a/isis/src/core/SpecialPixel/SpecialPixel.h b/isis/src/core/include/SpecialPixel.h similarity index 100% rename from isis/src/core/SpecialPixel/SpecialPixel.h rename to isis/src/core/include/SpecialPixel.h diff --git a/isis/src/core/TextFile/TextFile.h b/isis/src/core/include/TextFile.h similarity index 100% rename from isis/src/core/TextFile/TextFile.h rename to isis/src/core/include/TextFile.h diff --git a/isis/src/core/Message/ArraySubscriptNotInRange.cpp b/isis/src/core/src/ArraySubscriptNotInRange.cpp similarity index 100% rename from isis/src/core/Message/ArraySubscriptNotInRange.cpp rename to isis/src/core/src/ArraySubscriptNotInRange.cpp diff --git a/isis/src/core/Message/FileCreate.cpp b/isis/src/core/src/FileCreate.cpp similarity index 100% rename from isis/src/core/Message/FileCreate.cpp rename to isis/src/core/src/FileCreate.cpp diff --git a/isis/src/core/FileName/FileName.cpp b/isis/src/core/src/FileName.cpp similarity index 100% rename from isis/src/core/FileName/FileName.cpp rename to isis/src/core/src/FileName.cpp diff --git a/isis/src/core/Message/FileOpen.cpp b/isis/src/core/src/FileOpen.cpp similarity index 100% rename from isis/src/core/Message/FileOpen.cpp rename to isis/src/core/src/FileOpen.cpp diff --git a/isis/src/core/Message/FileRead.cpp b/isis/src/core/src/FileRead.cpp similarity index 100% rename from isis/src/core/Message/FileRead.cpp rename to isis/src/core/src/FileRead.cpp diff --git a/isis/src/core/Message/FileWrite.cpp b/isis/src/core/src/FileWrite.cpp similarity index 100% rename from isis/src/core/Message/FileWrite.cpp rename to isis/src/core/src/FileWrite.cpp diff --git a/isis/src/core/IException/IException.cpp b/isis/src/core/src/IException.cpp similarity index 100% rename from isis/src/core/IException/IException.cpp rename to isis/src/core/src/IException.cpp diff --git a/isis/src/core/IString/IString.cpp b/isis/src/core/src/IString.cpp similarity index 100% rename from isis/src/core/IString/IString.cpp rename to isis/src/core/src/IString.cpp diff --git a/isis/src/core/Message/KeywordAmbiguous.cpp b/isis/src/core/src/KeywordAmbiguous.cpp similarity index 100% rename from isis/src/core/Message/KeywordAmbiguous.cpp rename to isis/src/core/src/KeywordAmbiguous.cpp diff --git a/isis/src/core/Message/KeywordBlockEndMissing.cpp b/isis/src/core/src/KeywordBlockEndMissing.cpp similarity index 100% rename from isis/src/core/Message/KeywordBlockEndMissing.cpp rename to isis/src/core/src/KeywordBlockEndMissing.cpp diff --git a/isis/src/core/Message/KeywordBlockInvalid.cpp b/isis/src/core/src/KeywordBlockInvalid.cpp similarity index 100% rename from isis/src/core/Message/KeywordBlockInvalid.cpp rename to isis/src/core/src/KeywordBlockInvalid.cpp diff --git a/isis/src/core/Message/KeywordBlockStartMissing.cpp b/isis/src/core/src/KeywordBlockStartMissing.cpp similarity index 100% rename from isis/src/core/Message/KeywordBlockStartMissing.cpp rename to isis/src/core/src/KeywordBlockStartMissing.cpp diff --git a/isis/src/core/Message/KeywordDuplicated.cpp b/isis/src/core/src/KeywordDuplicated.cpp similarity index 100% rename from isis/src/core/Message/KeywordDuplicated.cpp rename to isis/src/core/src/KeywordDuplicated.cpp diff --git a/isis/src/core/Message/KeywordNotArray.cpp b/isis/src/core/src/KeywordNotArray.cpp similarity index 100% rename from isis/src/core/Message/KeywordNotArray.cpp rename to isis/src/core/src/KeywordNotArray.cpp diff --git a/isis/src/core/Message/KeywordNotFound.cpp b/isis/src/core/src/KeywordNotFound.cpp similarity index 100% rename from isis/src/core/Message/KeywordNotFound.cpp rename to isis/src/core/src/KeywordNotFound.cpp diff --git a/isis/src/core/Message/KeywordUnrecognized.cpp b/isis/src/core/src/KeywordUnrecognized.cpp similarity index 100% rename from isis/src/core/Message/KeywordUnrecognized.cpp rename to isis/src/core/src/KeywordUnrecognized.cpp diff --git a/isis/src/core/Message/KeywordValueBad.cpp b/isis/src/core/src/KeywordValueBad.cpp similarity index 100% rename from isis/src/core/Message/KeywordValueBad.cpp rename to isis/src/core/src/KeywordValueBad.cpp diff --git a/isis/src/core/Message/KeywordValueExpected.cpp b/isis/src/core/src/KeywordValueExpected.cpp similarity index 100% rename from isis/src/core/Message/KeywordValueExpected.cpp rename to isis/src/core/src/KeywordValueExpected.cpp diff --git a/isis/src/core/Message/KeywordValueNotInList.cpp b/isis/src/core/src/KeywordValueNotInList.cpp similarity index 100% rename from isis/src/core/Message/KeywordValueNotInList.cpp rename to isis/src/core/src/KeywordValueNotInList.cpp diff --git a/isis/src/core/Message/KeywordValueNotInRange.cpp b/isis/src/core/src/KeywordValueNotInRange.cpp similarity index 100% rename from isis/src/core/Message/KeywordValueNotInRange.cpp rename to isis/src/core/src/KeywordValueNotInRange.cpp diff --git a/isis/src/core/LabelTranslationManager/LabelTranslationManager.cpp b/isis/src/core/src/LabelTranslationManager.cpp similarity index 100% rename from isis/src/core/LabelTranslationManager/LabelTranslationManager.cpp rename to isis/src/core/src/LabelTranslationManager.cpp diff --git a/isis/src/core/Message/MemoryAllocationFailed.cpp b/isis/src/core/src/MemoryAllocationFailed.cpp similarity index 100% rename from isis/src/core/Message/MemoryAllocationFailed.cpp rename to isis/src/core/src/MemoryAllocationFailed.cpp diff --git a/isis/src/core/Message/MissingDelimiter.cpp b/isis/src/core/src/MissingDelimiter.cpp similarity index 100% rename from isis/src/core/Message/MissingDelimiter.cpp rename to isis/src/core/src/MissingDelimiter.cpp diff --git a/isis/src/core/Preference/Preference.cpp b/isis/src/core/src/Preference.cpp similarity index 100% rename from isis/src/core/Preference/Preference.cpp rename to isis/src/core/src/Preference.cpp diff --git a/isis/src/core/Pvl/Pvl.cpp b/isis/src/core/src/Pvl.cpp similarity index 100% rename from isis/src/core/Pvl/Pvl.cpp rename to isis/src/core/src/Pvl.cpp diff --git a/isis/src/core/PvlContainer/PvlContainer.cpp b/isis/src/core/src/PvlContainer.cpp similarity index 100% rename from isis/src/core/PvlContainer/PvlContainer.cpp rename to isis/src/core/src/PvlContainer.cpp diff --git a/isis/src/core/PvlFlatMap/PvlFlatMap.cpp b/isis/src/core/src/PvlFlatMap.cpp similarity index 100% rename from isis/src/core/PvlFlatMap/PvlFlatMap.cpp rename to isis/src/core/src/PvlFlatMap.cpp diff --git a/isis/src/core/PvlFormat/PvlFormat.cpp b/isis/src/core/src/PvlFormat.cpp similarity index 100% rename from isis/src/core/PvlFormat/PvlFormat.cpp rename to isis/src/core/src/PvlFormat.cpp diff --git a/isis/src/core/PvlFormatPds/PvlFormatPds.cpp b/isis/src/core/src/PvlFormatPds.cpp similarity index 100% rename from isis/src/core/PvlFormatPds/PvlFormatPds.cpp rename to isis/src/core/src/PvlFormatPds.cpp diff --git a/isis/src/core/PvlGroup/PvlGroup.cpp b/isis/src/core/src/PvlGroup.cpp similarity index 100% rename from isis/src/core/PvlGroup/PvlGroup.cpp rename to isis/src/core/src/PvlGroup.cpp diff --git a/isis/src/core/PvlKeyword/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp similarity index 100% rename from isis/src/core/PvlKeyword/PvlKeyword.cpp rename to isis/src/core/src/PvlKeyword.cpp diff --git a/isis/src/core/PvlObject/PvlObject.cpp b/isis/src/core/src/PvlObject.cpp similarity index 100% rename from isis/src/core/PvlObject/PvlObject.cpp rename to isis/src/core/src/PvlObject.cpp diff --git a/isis/src/core/PvlSequence/PvlSequence.cpp b/isis/src/core/src/PvlSequence.cpp similarity index 100% rename from isis/src/core/PvlSequence/PvlSequence.cpp rename to isis/src/core/src/PvlSequence.cpp diff --git a/isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp b/isis/src/core/src/PvlToPvlTranslationManager.cpp similarity index 100% rename from isis/src/core/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp rename to isis/src/core/src/PvlToPvlTranslationManager.cpp diff --git a/isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp b/isis/src/core/src/PvlToXmlTranslationManager.cpp similarity index 100% rename from isis/src/core/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp rename to isis/src/core/src/PvlToXmlTranslationManager.cpp diff --git a/isis/src/core/PvlToken/PvlToken.cpp b/isis/src/core/src/PvlToken.cpp similarity index 100% rename from isis/src/core/PvlToken/PvlToken.cpp rename to isis/src/core/src/PvlToken.cpp diff --git a/isis/src/core/PvlTokenizer/PvlTokenizer.cpp b/isis/src/core/src/PvlTokenizer.cpp similarity index 100% rename from isis/src/core/PvlTokenizer/PvlTokenizer.cpp rename to isis/src/core/src/PvlTokenizer.cpp diff --git a/isis/src/core/PvlTranslationTable/PvlTranslationTable.cpp b/isis/src/core/src/PvlTranslationTable.cpp similarity index 100% rename from isis/src/core/PvlTranslationTable/PvlTranslationTable.cpp rename to isis/src/core/src/PvlTranslationTable.cpp diff --git a/isis/src/core/TextFile/TextFile.cpp b/isis/src/core/src/TextFile.cpp similarity index 100% rename from isis/src/core/TextFile/TextFile.cpp rename to isis/src/core/src/TextFile.cpp diff --git a/isis/src/core/tests/CMakeLists.txt b/isis/src/core/tests/CMakeLists.txt new file mode 100644 index 0000000000..0476aeeea6 --- /dev/null +++ b/isis/src/core/tests/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.10) + +file(GLOB test_source "${CMAKE_SOURCE_DIR}/tests/*.cpp") + +# Link runISISTests with what we want to test and the GTest and pthread library +add_executable(runISISCoreTests + ${test_source}) + +target_link_libraries(runISISCoreTests core ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} Threads::Threads) + +gtest_discover_tests(runISISCoreTests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) diff --git a/isis/src/core/tests/IsisCoreTestMain.cpp b/isis/src/core/tests/IsisCoreTestMain.cpp new file mode 100644 index 0000000000..472b173ed7 --- /dev/null +++ b/isis/src/core/tests/IsisCoreTestMain.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} From 4dc859f16520b544db7d641a78521d12d68e8486 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Thu, 22 Oct 2020 11:41:13 -0700 Subject: [PATCH 07/95] Fully modularized core --- isis/cmake/AddIsisModule.cmake | 2 +- isis/src/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/isis/cmake/AddIsisModule.cmake b/isis/cmake/AddIsisModule.cmake index fbd1be7ea5..93262e5d33 100644 --- a/isis/cmake/AddIsisModule.cmake +++ b/isis/cmake/AddIsisModule.cmake @@ -230,7 +230,7 @@ function(add_isis_module name) # - Base module depends on 3rd party libs, other libs also depend on base. # - Only the base module gets both a static and shared library. if(${name} STREQUAL ${CORE_LIB_NAME}) - set(reqLibs "${ALLLIBS};${CMAKE_THREAD_LIBS_INIT}") + set(reqLibs "${ALLLIBS};core;${CMAKE_THREAD_LIBS_INIT}") set(alsoStatic ON) else() set(reqLibs "${CORE_LIB_NAME};${ALLLIBS};${CMAKE_THREAD_LIBS_INIT}") diff --git a/isis/src/CMakeLists.txt b/isis/src/CMakeLists.txt index 0cf6591a3e..475a3291ac 100644 --- a/isis/src/CMakeLists.txt +++ b/isis/src/CMakeLists.txt @@ -1,6 +1,7 @@ #=============================================================================== set(CORE_LIST base database control qisis system socet dev) +include_directories(".") get_subdirectory_list(${CMAKE_CURRENT_LIST_DIR} modules) # build core into isis library @@ -13,6 +14,8 @@ foreach(core ${CORE_LIST}) list(REMOVE_ITEM modules "${CMAKE_CURRENT_LIST_DIR}/${core}") endforeach() +list(REMOVE_ITEM modules "${CMAKE_CURRENT_LIST_DIR}/core") + foreach( mod ${modules} ) string(REPLACE "${CMAKE_CURRENT_LIST_DIR}/" "" strippedmod ${mod}) add_isis_module(${strippedmod} ${strippedmod}) From d73eac90e5a0a56d1e74d35fc6d1b079e29b60e9 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Thu, 22 Oct 2020 13:07:03 -0700 Subject: [PATCH 08/95] replaced PvlEditDialog that was accidentally removed in prev commit --- isis/src/base/objs/PvlEditDialog/Makefile | 7 + .../base/objs/PvlEditDialog/PvlEditDialog.cpp | 145 ++++++++++++++++++ .../base/objs/PvlEditDialog/PvlEditDialog.h | 57 +++++++ .../objs/PvlEditDialog/PvlEditDialog.truth | 3 + isis/src/base/objs/PvlEditDialog/unitTest.cpp | 14 ++ 5 files changed, 226 insertions(+) create mode 100644 isis/src/base/objs/PvlEditDialog/Makefile create mode 100644 isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp create mode 100644 isis/src/base/objs/PvlEditDialog/PvlEditDialog.h create mode 100644 isis/src/base/objs/PvlEditDialog/PvlEditDialog.truth create mode 100644 isis/src/base/objs/PvlEditDialog/unitTest.cpp diff --git a/isis/src/base/objs/PvlEditDialog/Makefile b/isis/src/base/objs/PvlEditDialog/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/PvlEditDialog/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp new file mode 100644 index 0000000000..19b4144b1f --- /dev/null +++ b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp @@ -0,0 +1,145 @@ +#include "PvlEditDialog.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "IException.h" +#include "Pvl.h" + +using namespace std; + +namespace Isis { + /** + * This constructor creates a PvlEditDialog object given a + * pointer to a Pvl object. + * + * @param pvl Pvl file to be viewed or edited + * @author 2008-12-10 Jeannie Walldren + * @internal + * @history 2008-12-10 Jeannie Walldren - Original Version + * @history 2008-12-15 Jeannie Walldren - Removed unneccesary + * error catch. + */ + PvlEditDialog::PvlEditDialog(Pvl &pvl, QWidget *parent) : QDialog(parent) { + + // Create text edit box and fill it with pvl file contents + p_textEdit = new QTextEdit; + fstream input; + + // open as input from pvl file + input.open(pvl.fileName().toLatin1().data(), ios::in); + string output; + + // read first line of input and write as first output line + getline(input, output); + while(!input.eof()) { + // append this line of output to the QTextEdit box + p_textEdit->append(QString::fromStdString(output)); + + // read next line of input and write as next output line + getline(input, output); + } + input.close(); + + // Create Close and Save buttons in an QHBoxLayout + p_saveButton = new QPushButton("Save Changes &As..."); + p_saveButton->setEnabled(false); + QPushButton *closeButton = new QPushButton("&Close"); + + QHBoxLayout *buttonLayout = new QHBoxLayout; + buttonLayout->addWidget(p_saveButton); + buttonLayout->addWidget(closeButton); + + // Add QTextEdit box and button layout to QVBoxLayout + // and set this to the layout of the QDialog window + QVBoxLayout *vLayout = new QVBoxLayout; + vLayout->addWidget(p_textEdit); + vLayout->addLayout(buttonLayout); + + setLayout(vLayout); + QString titleBar = "Pvl File: " + QString(pvl.fileName()) ; + setWindowTitle(titleBar); + + // Add functionality to buttons + connect(p_textEdit, SIGNAL(textChanged()), this, SLOT(enableSaveButton())); + connect(p_saveButton, SIGNAL(clicked()), this, SLOT(saveTextEdit())); + connect(closeButton, SIGNAL(clicked()), this, SLOT(reject())); + + } + + /** + * Allow the "Save Changes" button to be activated. + * + * @author 2008-12-10 Jeannie Walldren + * @internal + * @history 2008-12-10 Jeannie Walldren - Original Version. + */ + void PvlEditDialog::enableSaveButton() { + p_saveButton->setEnabled(true); + } + + /** + * Save the edited text as a new Pvl file. + * @author 2008-12-10 Jeannie Walldren + * @internal + * @history 2008-12-10 Jeannie Walldren - Original Version. + * @history 2008-12-15 Jeannie Walldren - Added a verification + * that the edited file is in Pvl format before + * allowing save. Replaced error throw with + * QMessageBox warning. + */ + void PvlEditDialog::saveTextEdit() { + // Check validity of format by placing QTextEdit contents into a Pvl object + Pvl pvl; + stringstream ss; + string textEditContents = p_textEdit->toPlainText().toStdString(); + + //fill stringstream with contents of QTextEdit + ss << textEditContents; + + try { + // fill pvl with contents of stringstream + ss >> pvl; + } + catch(IException &e) { + // catch errors in Pvl format when populating pvl object + QString message = e.toString(); + QMessageBox::warning((QWidget *)parent(), "Error", message); + return; + } + + // get a window to choose a name and location for the saved file + // default: look in user's current directory for *.def or *.pvl files + QString filter = "Select registration template (*.def *.pvl);;"; + filter += "All (*)"; + QString pvlFile = QFileDialog::getSaveFileName((QWidget *)parent(), + "Select a registration template", + ".", + filter); + if(!pvlFile.isEmpty()) { + // convert QString to std::string needed to open file stream + QString saveFile = pvlFile; + try { + pvl.write(saveFile); + } + catch(IException &e) { + // report exception(s) to mesage box + QString message = e.toString(); + QMessageBox::warning((QWidget *)parent(), "Error", message); + return; + } + } + + // refresh titleBar with new file name + setWindowTitle("Pvl File: " + pvlFile); + } +} diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.h b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.h new file mode 100644 index 0000000000..8d5c7a1d75 --- /dev/null +++ b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.h @@ -0,0 +1,57 @@ +#ifndef PvlEditDialog_h +#define PvlEditDialog_h + +#include +#include + +#include "Pvl.h" + +class QLabel; +class QLineEdit; +class QListWidget; +class QPushButton; +class QTextEdit; + +#include + +namespace Isis { + /** + * PvlEditDialog creates a QDialog window in which a QTextEdit + * box displays the contents of a pvl file. This file may be + * viewed or edited and saved as a new pvl file. + * + * @ingroup ApplicationInterface + * + * @author 2008-12-10 Jeannie Walldren + * @internal + * @history 2008-12-10 Jeannie Walldren - Original version + * written to view and edit the template file in the + * qnet application. + * @history 2008-12-10 Jeannie Walldren - Changed namespace + * from Qisis to Isis + * @history 2008-12-10 Jeannie Walldren - Cleaned up code and + * fixed bugs arising from moving this class from + * Qisis and to Isis. Added moc commands to Makefile. + * @history 2008-12-15 Jeannie Walldren - Added a verification + * that the edited file is in Pvl format. Replaced + * error throws with QMessage warning boxes. + */ + class PvlEditDialog : public QDialog { + Q_OBJECT + + public: + PvlEditDialog(Pvl &pvl, QWidget *parent = 0); + + private: + QTextEdit *p_textEdit; + QPushButton *p_saveButton; + + private slots: + void enableSaveButton(); + void saveTextEdit(); + }; +}; + +#endif + + diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.truth b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.truth new file mode 100644 index 0000000000..b41dc856c3 --- /dev/null +++ b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.truth @@ -0,0 +1,3 @@ + +Unit test for PvlEditDialog +Replace this when we decide how to do unit tests for interactive objects diff --git a/isis/src/base/objs/PvlEditDialog/unitTest.cpp b/isis/src/base/objs/PvlEditDialog/unitTest.cpp new file mode 100644 index 0000000000..626ee9a9bb --- /dev/null +++ b/isis/src/base/objs/PvlEditDialog/unitTest.cpp @@ -0,0 +1,14 @@ +#include +#include "PvlEditDialog.h" +#include "Preference.h" + +using namespace std; +using namespace Isis; + +int main(int argc, char *argv[]) { + Preference::Preferences(true); + cout << endl << "Unit test for PvlEditDialog" << endl; + cout << "Replace this when we decide how to do unit tests for interactive objects" << endl; + return 0; +} + From 04842ba77dd36676c2c57b0743a6dc97a66720bb Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 23 Oct 2020 11:09:24 -0700 Subject: [PATCH 09/95] Initial constants unit gtest --- isis/src/core/tests/ConstantsTests.cpp | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 isis/src/core/tests/ConstantsTests.cpp diff --git a/isis/src/core/tests/ConstantsTests.cpp b/isis/src/core/tests/ConstantsTests.cpp new file mode 100644 index 0000000000..e5df71944a --- /dev/null +++ b/isis/src/core/tests/ConstantsTests.cpp @@ -0,0 +1,29 @@ +#include "Constants.h" +#include + +TEST (ConstantsTests, TestPi){ + ASSERT_NEAR(Isis::PI, 3.141592653589793, .000000000000001); +} + + +TEST (ConstantsTests, TestHalfPi){ + ASSERT_NEAR(Isis::PI/2, 1.570796326794897, .000000000000001); +} + +TEST (ConstantsTests, TestE){ + ASSERT_NEAR(Isis::E, 2.718281828459045, .000000000000001); +} + +TEST (ConstantsTests, TestDeg2Rad){ + ASSERT_NEAR(Isis::DEG2RAD, 0.0174532925199433, .000000000000001); + ASSERT_EQ(Isis::DEG2RAD * 180, Isis::PI); +} + +TEST (ConstantsTests, TestRad2Deg){ + ASSERT_NEAR(Isis::RAD2DEG, 57.29577951308232, .000000000000001); + ASSERT_EQ(Isis::RAD2DEG * Isis::PI/2, 90); +} + +TEST (ConstantsTests, TestBigInt){ + ASSERT_EQ(sizeof(Isis::BigInt), 8); +} From 674dd72ee9708d4a8e5cb6ccb69ed10ff796d3c5 Mon Sep 17 00:00:00 2001 From: Jesse Mapel Date: Tue, 9 Mar 2021 17:34:36 -0700 Subject: [PATCH 10/95] Fixed pvl core test config (#4349) * Fixed pvl core test config * Changed cmake_source to project_source for submodule --- isis/src/core/CMakeLists.txt | 59 +++++++++++++++++++++++------- isis/src/core/cmake/gtest.cmake | 39 ++++++++++++++++++++ isis/src/core/tests/CMakeLists.txt | 12 ++++-- 3 files changed, 94 insertions(+), 16 deletions(-) create mode 100644 isis/src/core/cmake/gtest.cmake diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 8595ec2c50..9deea3bed3 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 3.10) project (core VERSION 0.0.1) option(buildStaticCore "Build libisis static as well as dynamic" OFF ) +option (BUILD_CORE_TESTS "Build core module tests" ON) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") # Short and long name of this package set(PACKAGE "CORE") @@ -13,8 +14,45 @@ set(PACKAGE_NAME "USGS ISIS PVL CORE") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED True) -FILE(GLOB_RECURSE Pvl_source_files ${PROJECT_SOURCE_DIR}/src *.cpp) - +set(Pvl_source_files ${PROJECT_SOURCE_DIR}/src/ArraySubscriptNotInRange.cpp + ${PROJECT_SOURCE_DIR}/src/FileCreate.cpp + ${PROJECT_SOURCE_DIR}/src/FileName.cpp + ${PROJECT_SOURCE_DIR}/src/FileOpen.cpp + ${PROJECT_SOURCE_DIR}/src/FileRead.cpp + ${PROJECT_SOURCE_DIR}/src/FileWrite.cpp + ${PROJECT_SOURCE_DIR}/src/IException.cpp + ${PROJECT_SOURCE_DIR}/src/IString.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordAmbiguous.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordBlockEndMissing.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordBlockInvalid.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordBlockStartMissing.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordDuplicated.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordNotArray.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordNotFound.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordUnrecognized.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordValueBad.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordValueExpected.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordValueNotInList.cpp + ${PROJECT_SOURCE_DIR}/src/KeywordValueNotInRange.cpp + ${PROJECT_SOURCE_DIR}/src/LabelTranslationManager.cpp + ${PROJECT_SOURCE_DIR}/src/MemoryAllocationFailed.cpp + ${PROJECT_SOURCE_DIR}/src/MissingDelimiter.cpp + ${PROJECT_SOURCE_DIR}/src/Preference.cpp + ${PROJECT_SOURCE_DIR}/src/Pvl.cpp + ${PROJECT_SOURCE_DIR}/src/PvlContainer.cpp + ${PROJECT_SOURCE_DIR}/src/PvlFlatMap.cpp + ${PROJECT_SOURCE_DIR}/src/PvlFormat.cpp + ${PROJECT_SOURCE_DIR}/src/PvlFormatPds.cpp + ${PROJECT_SOURCE_DIR}/src/PvlGroup.cpp + ${PROJECT_SOURCE_DIR}/src/PvlKeyword.cpp + ${PROJECT_SOURCE_DIR}/src/PvlObject.cpp + ${PROJECT_SOURCE_DIR}/src/PvlSequence.cpp + ${PROJECT_SOURCE_DIR}/src/PvlToPvlTranslationManager.cpp + ${PROJECT_SOURCE_DIR}/src/PvlToXmlTranslationManager.cpp + ${PROJECT_SOURCE_DIR}/src/PvlToken.cpp + ${PROJECT_SOURCE_DIR}/src/PvlTokenizer.cpp + ${PROJECT_SOURCE_DIR}/src/PvlTranslationTable.cpp + ${PROJECT_SOURCE_DIR}/src/TextFile.cpp) # Define a target add_library(core "${Pvl_source_files}") @@ -45,16 +83,6 @@ find_package(Geos REQUIRED) find_package(nlohmann_json REQUIRED) find_package(CSPICE 65 REQUIRED) -#include_directories(SYSTEM -# ${Qt5Widgets_INCLUDE_DIRS} -# ${Qt5Concurrent_INCLUDE_DIRS} -# ${Qt5Network_INCLUDE_DIRS} -# ${Qt5Xml_INCLUDE_DIRS} -# ${CSPICE_INCLUDE_DIR} -# ${JSON_INCLUDE_DIR}) -#include_directories(${CMAKE_BINARY_DIR}/inc) -#link_directories(${JSON_LIBRARY} ${CSPICE_LIBRARY} {Qt5_Library}) - target_link_libraries(core PUBLIC Qt5::Core Qt5::Concurrent Qt5::Widgets @@ -66,3 +94,8 @@ target_link_libraries(core PUBLIC ${GEOS_LIBRARY} ${CSPICE_LIBRARY}) target_include_directories(core PUBLIC ${GEOS_INCLUDE_DIR} ${CSPICE_INCLUDE_DIR}) install(DIRECTORY ${PROJECT_SOURCE_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX}/include/isis) install(TARGETS core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + +if (BUILD_CORE_TESTS) + enable_testing() + add_subdirectory(tests) +endif() \ No newline at end of file diff --git a/isis/src/core/cmake/gtest.cmake b/isis/src/core/cmake/gtest.cmake new file mode 100644 index 0000000000..1c62653866 --- /dev/null +++ b/isis/src/core/cmake/gtest.cmake @@ -0,0 +1,39 @@ +if (NOT TARGET gtest) + set(GOOGLETEST_ROOT ${PROJECT_SOURCE_DIR}/../../../gtest/googletest CACHE STRING "Google Test source root") + + include_directories(SYSTEM + ${GOOGLETEST_ROOT} + ${GOOGLETEST_ROOT}/include + ) + + set(GOOGLETEST_SOURCES + ${GOOGLETEST_ROOT}/src/gtest-all.cc + ${GOOGLETEST_ROOT}/src/gtest_main.cc + ) + + foreach(_source ${GOOGLETEST_SOURCES}) + set_source_files_properties(${_source} PROPERTIES GENERATED 1) + endforeach() + + add_library(gtest ${GOOGLETEST_SOURCES}) +endif() + +if (NOT TARGET gmock) + set(GOOGLEMOCK_ROOT ${PROJECT_SOURCE_DIR}/../../../gtest/googlemock CACHE STRING "Google Mock source root") + + include_directories(SYSTEM + ${GOOGLEMOCK_ROOT} + ${GOOGLEMOCK_ROOT}/include + ) + + set(GOOGLEMOCK_SOURCES + ${GOOGLEMOCK_ROOT}/src/gmock-all.cc + ${GOOGLEMOCK_ROOT}/src/gmock_main.cc + ) + + foreach(_source ${GOOGLEMOCK_SOURCES}) + set_source_files_properties(${_source} PROPERTIES GENERATED 1) + endforeach() + + add_library(gmock ${GOOGLEMOCK_SOURCES}) +endif() diff --git a/isis/src/core/tests/CMakeLists.txt b/isis/src/core/tests/CMakeLists.txt index 0476aeeea6..d5bdfded24 100644 --- a/isis/src/core/tests/CMakeLists.txt +++ b/isis/src/core/tests/CMakeLists.txt @@ -1,11 +1,17 @@ cmake_minimum_required(VERSION 3.10) -file(GLOB test_source "${CMAKE_SOURCE_DIR}/tests/*.cpp") +find_package(Threads) + +include(../cmake/gtest.cmake) +include(GoogleTest) + +set(test_source ${PROJECT_SOURCE_DIR}/tests/ConstantsTests.cpp + ${PROJECT_SOURCE_DIR}/tests/IsisCoreTestMain.cpp) # Link runISISTests with what we want to test and the GTest and pthread library add_executable(runISISCoreTests ${test_source}) -target_link_libraries(runISISCoreTests core ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} Threads::Threads) +target_link_libraries(runISISCoreTests core gtest Threads::Threads) -gtest_discover_tests(runISISCoreTests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) +gtest_discover_tests(runISISCoreTests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests) From 766a0ae8cb8153049f6dea227d08ae1e34754891 Mon Sep 17 00:00:00 2001 From: Jesse Mapel Date: Tue, 9 Mar 2021 08:22:30 -0700 Subject: [PATCH 11/95] Fixed pvl core test config --- isis/src/core/cmake/gtest.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/isis/src/core/cmake/gtest.cmake b/isis/src/core/cmake/gtest.cmake index 1c62653866..6cee5f6b7c 100644 --- a/isis/src/core/cmake/gtest.cmake +++ b/isis/src/core/cmake/gtest.cmake @@ -21,6 +21,7 @@ endif() if (NOT TARGET gmock) set(GOOGLEMOCK_ROOT ${PROJECT_SOURCE_DIR}/../../../gtest/googlemock CACHE STRING "Google Mock source root") + include_directories(SYSTEM ${GOOGLEMOCK_ROOT} ${GOOGLEMOCK_ROOT}/include From bc76f7ae5d063180727d4ef09cc0d8ffe994e761 Mon Sep 17 00:00:00 2001 From: Jesse Mapel Date: Tue, 9 Mar 2021 08:28:19 -0700 Subject: [PATCH 12/95] Changed cmake_source to project_source for submodule --- isis/src/core/cmake/gtest.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/isis/src/core/cmake/gtest.cmake b/isis/src/core/cmake/gtest.cmake index 6cee5f6b7c..1c62653866 100644 --- a/isis/src/core/cmake/gtest.cmake +++ b/isis/src/core/cmake/gtest.cmake @@ -21,7 +21,6 @@ endif() if (NOT TARGET gmock) set(GOOGLEMOCK_ROOT ${PROJECT_SOURCE_DIR}/../../../gtest/googlemock CACHE STRING "Google Mock source root") - include_directories(SYSTEM ${GOOGLEMOCK_ROOT} ${GOOGLEMOCK_ROOT}/include From 013b7712b1e426baca52dcf55b51195287014596 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Tue, 9 Mar 2021 17:30:38 -0700 Subject: [PATCH 13/95] First working swig wrappers --- isis/CMakeLists.txt | 4 + isis/src/core/CMakeLists.txt | 16 ++- isis/src/core/swig/CMakeLists.txt | 6 ++ isis/src/core/swig/isispvl.i | 30 ++++++ isis/src/core/swig/pvlKeyword.i | 16 +++ isis/src/core/swig/python/CMakeLists.txt | 54 ++++++++++ .../core/swig/python/FindPythonAnaconda.cmake | 102 ++++++++++++++++++ isis/src/core/swig/python/__init__.py | 0 isis/src/core/swig/python/setup.py.in | 13 +++ 9 files changed, 240 insertions(+), 1 deletion(-) create mode 100644 isis/src/core/swig/CMakeLists.txt create mode 100644 isis/src/core/swig/isispvl.i create mode 100644 isis/src/core/swig/pvlKeyword.i create mode 100644 isis/src/core/swig/python/CMakeLists.txt create mode 100644 isis/src/core/swig/python/FindPythonAnaconda.cmake create mode 100644 isis/src/core/swig/python/__init__.py create mode 100644 isis/src/core/swig/python/setup.py.in diff --git a/isis/CMakeLists.txt b/isis/CMakeLists.txt index 8584042726..bbd39f5e85 100644 --- a/isis/CMakeLists.txt +++ b/isis/CMakeLists.txt @@ -75,6 +75,8 @@ option(buildStaticCore "Build libisis static as well as dynamic" OFF ) option(buildTests "Set up unit, application, and module tests." ON ) option(JP2KFLAG "Whether or not to build using JPEG2000 support" OFF ) option(pybindings "Turn on to build Python bindings" ON ) +option(buildSwig "Turn on to build swig wrappers" OFF ) +option(BUILD_CORE_TESTS "Turn on to build core tests" ON ) # if cmake install prefix is not set, and conda env is activated, use the # conda env as the install directory. @@ -123,6 +125,7 @@ message("\tBUILD STATIC CORE: ${buildStaticCore}") message("\tBUILD TESTS: ${buildTests}") message("\tBUILD CORE: ${buildCore}") message("\tBUILD MISSIONS: ${buildMissions}") +message("\tBUILD CORE TESTS: ${BUILD_CORE_TESTS}") message("\tJP2K SUPPORT: ${JP2KFLAG}") message("\tPYTHON BINDINGS: ${pybindings}") message("\tISISDATA: ${isisData}") @@ -178,6 +181,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" ) # Flag to fix numeric literals problem with boost on linux # Add gold linker (and therefore, phtread) to speed up linux (spec. Ubuntu18.04) builds if(NOT APPLE) + message("$ENV{CONDA_PREFIX}") set(thirdPartyCppFlags ${thirdPartyCppFlags} -fuse-ld=gold -pthread -fext-numeric-literals diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 9deea3bed3..5c7a3cd085 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -83,6 +83,16 @@ find_package(Geos REQUIRED) find_package(nlohmann_json REQUIRED) find_package(CSPICE 65 REQUIRED) +include_directories(SYSTEM + ${Qt5Widgets_INCLUDE_DIRS} + ${Qt5Concurrent_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS} + ${Qt5Xml_INCLUDE_DIRS} + ${CSPICE_INCLUDE_DIR} + ${JSON_INCLUDE_DIR}) +#include_directories(${CMAKE_BINARY_DIR}/inc) +#link_directories(${JSON_LIBRARY} ${CSPICE_LIBRARY} {Qt5_Library}) + target_link_libraries(core PUBLIC Qt5::Core Qt5::Concurrent Qt5::Widgets @@ -98,4 +108,8 @@ install(TARGETS core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) if (BUILD_CORE_TESTS) enable_testing() add_subdirectory(tests) -endif() \ No newline at end of file +endif() + +if(buildSwig) + add_subdirectory(swig) +endif() diff --git a/isis/src/core/swig/CMakeLists.txt b/isis/src/core/swig/CMakeLists.txt new file mode 100644 index 0000000000..95b796b225 --- /dev/null +++ b/isis/src/core/swig/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.10) + +find_package(SWIG REQUIRED) +include(${SWIG_USE_FILE}) + +add_subdirectory(python) diff --git a/isis/src/core/swig/isispvl.i b/isis/src/core/swig/isispvl.i new file mode 100644 index 0000000000..8e25ef3066 --- /dev/null +++ b/isis/src/core/swig/isispvl.i @@ -0,0 +1,30 @@ +%module isispvl +%include "pvlKeyword.i" + +%include std_string.i +%include std_vector.i +%include exception.i + +class QString +{ +public: + static QString fromStdString(const std::string &s); + std::string toStdString() const; + QString(const char* str); + ~QString(); + + int size() const; + int count() const; + int length() const; + bool isEmpty() const; +}; + +%exception{ + try { + $action + } catch (std::exception const& e) { + SWIG_exception(SWIG_RuntimeError, (std::string("std::exception: ") + e.what()).c_str()); + } catch (...) { + SWIG_exception(SWIG_UnknownError, "Unknown error"); + } +} diff --git a/isis/src/core/swig/pvlKeyword.i b/isis/src/core/swig/pvlKeyword.i new file mode 100644 index 0000000000..4d3c591c2f --- /dev/null +++ b/isis/src/core/swig/pvlKeyword.i @@ -0,0 +1,16 @@ +%module(package="isispvl") PvlKeyword +%{ + #include "PvlKeyword.h" +%} + + +%include "PvlKeyword.h" + +%extend Isis::PvlKeyword{ + PvlKeyword(const char* key, const char* val){ + QString qkey(key); + QString qval(val); + Isis::PvlKeyword *kw = new Isis::PvlKeyword(qkey, qval); + return kw; + } +} diff --git a/isis/src/core/swig/python/CMakeLists.txt b/isis/src/core/swig/python/CMakeLists.txt new file mode 100644 index 0000000000..1fef0e5d34 --- /dev/null +++ b/isis/src/core/swig/python/CMakeLists.txt @@ -0,0 +1,54 @@ +# Include python +include(FindPythonAnaconda.cmake) +include_directories(${PYTHON_INCLUDE_DIR}) + +set(CMAKE_SWIG_FLAGS "") +set(CMAKE_SWIG_OUTDIR isispvl) +message(">>>> ${CMAKE_SWIG_OUTDIR}") +set_source_files_properties(../isispvl.i + PROPERTIES CPLUSPLUS ON) + +#Find dependencies +message(">>>> ${PROJECT_SOURCE_DIR}") +message(">>>> ${PYTHON_LIBRARY}") +message(">>>> ${CMAKE_SOURCE_DIR}") +find_path(PVL_INCLUDE_DIR NAMES Pvl.h + PATH_SUFFIXES include + PATHS ${PROJECT_SOURCE_DIR}/) +find_library(PVL_LIBRARY NAMES core + PATHS ${CMAKE_SOURCE_DIR}/../build/objects/core/) +message("-- Found PVL Include: ${PVL_INCLUDE_DIR}") +message("-- Found PVL Lib: ${PVL_LIBRARY}") +include_directories(${PVL_INCLUDE_DIR}) + +# Add and link +swig_add_library(isispvl + LANGUAGE python + SOURCES ../isispvl.i) + +set_target_properties(_isispvl PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SWIG_OUTDIR}) + +SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + +if (APPLE) + set_target_properties(_isispvl PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + # On OSX, do not link python - this causes segfaults + swig_link_libraries(isispvl ${PVL_LIBRARY}) +else() + swig_link_libraries(isispvl ${PVL_LIBRARY} ${PYTHON_LIBRARY}) +endif() + +# Build out a standard directory structure +# file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests) + +# Move the static files +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in + ${CMAKE_CURRENT_BINARY_DIR}/setup.py + COPYONLY) +#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py +# ${CMAKE_CURRENT_BINARY_DIR}/isispvl/__init__.py +# COPYONLY) + +## Move the tests +#file(COPY ${CMAKE_SOURCE_DIR}/python/tests +# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/isis/src/core/swig/python/FindPythonAnaconda.cmake b/isis/src/core/swig/python/FindPythonAnaconda.cmake new file mode 100644 index 0000000000..d59ada6542 --- /dev/null +++ b/isis/src/core/swig/python/FindPythonAnaconda.cmake @@ -0,0 +1,102 @@ +# tested on OSX Yosemite and Ubuntu 14.04 LTS +# handle anaconda dependencies +cmake_minimum_required(VERSION 3.7) + +option(ANACONDA_PYTHON_VERBOSE "Anaconda dependency info" OFF) + +if(NOT CMAKE_FIND_ANACONDA_PYTHON_INCLUDED) + set(CMAKE_FIND_ANACONDA_PYTHON_INCLUDED 1) + + # find anaconda installation + set(_cmd conda info --root) + execute_process( + COMMAND ${_cmd} + RESULT_VARIABLE _r + OUTPUT_VARIABLE _o + ERROR_VARIABLE _e + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(ANACONDA_PYTHON_VERBOSE) + message("Executing conda info --root") + message("_r = ${_r}") + message("_o = ${_o}") + message("_e = ${_e}") + endif() + + IF(IS_DIRECTORY ${_o}) + set(ANACONDA_PYTHON_FOUND True) + endif() + + if(ANACONDA_PYTHON_FOUND) + set( ANACONDA_PYTHON_DIR ${_o} ) + message( "Found anaconda root directory ${ANACONDA_PYTHON_DIR}" ) + + # find python version + # + set(_cmd python --version) + execute_process( + COMMAND ${_cmd} + RESULT_VARIABLE _r + OUTPUT_VARIABLE _o + ERROR_VARIABLE _o + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(ANACONDA_PYTHON_VERBOSE) + message("Executing python --version") + message("_r = ${_r}") + # Different python version pipe to stdout vs. stderr + message("_o = ${_o}") + message("_e = ${_o}") + endif() + + string (REGEX MATCH "Python ([0-9]+)[.]([0-9]+)[.]([0-9]+)" _py_version_found "${_o}") + #message("_py_version_found = ${_py_version_found}") + #message("CMAKE_MATCH_0 = ${CMAKE_MATCH_0}") + set( _py_version_major ${CMAKE_MATCH_1} ) + set( _py_version_minor ${CMAKE_MATCH_2} ) + set( _py_version_patch ${CMAKE_MATCH_3} ) + set( ANACONDA_PYTHON_VERSION ${_py_version_major}.${_py_version_minor} ) + + + if( (${_py_version_major} MATCHES 2) OR + (${_py_version_major} MATCHES 3 AND ${_py_version_minor} MATCHES 8) ) + set( _py_ext "") + else() + set( _py_ext "m") + endif() + + set(_py_id "python${ANACONDA_PYTHON_VERSION}${_py_ext}") + + if( NOT DEFINED ENV{CONDA_PREFIX} ) + set( env_CONDA_DEFAULT_ENV "root" ) + message( WARNING "Could not find anaconda environment setting; using default root" ) + else() + set( env_CONDA_DEFAULT_ENV $ENV{CONDA_PREFIX} ) + endif() + + message( "Using anaconda ${env_CONDA_DEFAULT_ENV} environment" ) + if( env_CONDA_DEFAULT_ENV STREQUAL "root" ) + set(PYTHON_INCLUDE_DIR "${ANACONDA_PYTHON_DIR}/include/${_py_id}" CACHE INTERNAL "") + set(PYTHON_LIBRARY "${ANACONDA_PYTHON_DIR}/lib/lib${_py_id}${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + else() + set(PYTHON_INCLUDE_DIR "${env_CONDA_DEFAULT_ENV}/include/${_py_id}" CACHE INTERNAL "") + set(PYTHON_LIBRARY "${env_CONDA_DEFAULT_ENV}/lib/lib${_py_id}${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + endif() + + set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") + set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") + + set(FOUND_PYTHONLIBS TRUE) + else() + message( "Not found: anaconda root directory..." ) + message( "Trying system python install..." ) + FindPythonLibs() + endif() + + message( "PYTHON_INCLUDE_DIR = ${PYTHON_INCLUDE_DIR}") + message( "PYTHON_LIBRARY = ${PYTHON_LIBRARY}") +endif() diff --git a/isis/src/core/swig/python/__init__.py b/isis/src/core/swig/python/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/isis/src/core/swig/python/setup.py.in b/isis/src/core/swig/python/setup.py.in new file mode 100644 index 0000000000..dd500bd710 --- /dev/null +++ b/isis/src/core/swig/python/setup.py.in @@ -0,0 +1,13 @@ +import setuptools + +if __name__ == '__main__': + setuptools.setup( + name='isispvl', + version='0.0.1', + packages=['isispvl'], + package_data={'':['_isispvl.so']}, + zip_safe=False, # Some OSes can not dynamically load an so from an egg (zipfile) + license='UnLicense', + author='arsanders/acpaquette', + author_email='arsanders@usgs.gov' +) From 6f536722573f11044e8fbc512ce87195746b883c Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Tue, 9 Mar 2021 17:50:25 -0700 Subject: [PATCH 14/95] Rebased off of pvl_core --- isis/src/core/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 5c7a3cd085..65f3cd14cb 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -90,8 +90,6 @@ include_directories(SYSTEM ${Qt5Xml_INCLUDE_DIRS} ${CSPICE_INCLUDE_DIR} ${JSON_INCLUDE_DIR}) -#include_directories(${CMAKE_BINARY_DIR}/inc) -#link_directories(${JSON_LIBRARY} ${CSPICE_LIBRARY} {Qt5_Library}) target_link_libraries(core PUBLIC Qt5::Core Qt5::Concurrent From 0e03712cad6494f3864e57aa3b314d7b983bc81f Mon Sep 17 00:00:00 2001 From: Jesse Mapel Date: Thu, 11 Mar 2021 15:24:11 -0700 Subject: [PATCH 15/95] Moved old ISIS unitTests into core (#4351) * First pass at old unitTests * re-removed old files * Slim down and unittest port * installing IsisPreferences * Fixed tests in a full build --- .../LabelTranslationManager.cpp | 0 .../LabelTranslationManager.h | 1 - .../LabelTranslationManager.truth | 59 ++ .../objs/LabelTranslationManager/Makefile | 7 + .../objs/LabelTranslationManager/unitTest.cpp | 191 +++++ .../base/objs/ProcessImport/ProcessImport.cpp | 1 - .../ProcessImportPds/ProcessImportPds.cpp | 1 - isis/src/base/objs/PvlFlatMap/Makefile | 7 + .../objs/PvlFlatMap}/PvlFlatMap.cpp | 0 .../objs/PvlFlatMap}/PvlFlatMap.h | 0 .../src/base/objs/PvlFlatMap/PvlFlatMap.truth | 209 ++++++ isis/src/base/objs/PvlFlatMap/unitTest.cpp | 285 ++++++++ .../objs/PvlToPvlTranslationManager/Makefile | 7 + .../PvlToPvlTranslationManager.cpp | 0 .../PvlToPvlTranslationManager.h | 3 +- .../PvlToPvlTranslationManager.truth | 51 ++ .../PvlToPvlTranslationManager/unitTest.cpp | 250 +++++++ .../objs/PvlToXmlTranslationManager/Makefile | 7 + .../PvlToXmlTranslationManager.cpp | 0 .../PvlToXmlTranslationManager.h | 3 +- .../PvlToXmlTranslationManager.truth | 52 ++ .../PvlToXmlTranslationManager/unitTest.cpp | 229 ++++++ isis/src/base/objs/PvlToken/Makefile | 7 + .../src => base/objs/PvlToken}/PvlToken.cpp | 0 .../include => base/objs/PvlToken}/PvlToken.h | 0 isis/src/base/objs/PvlToken/PvlToken.truth | 18 + isis/src/base/objs/PvlToken/unitTest.cpp | 52 ++ isis/src/base/objs/PvlTokenizer/Makefile | 7 + .../objs/PvlTokenizer}/PvlTokenizer.cpp | 0 .../objs/PvlTokenizer}/PvlTokenizer.h | 0 .../base/objs/PvlTokenizer/PvlTokenizer.truth | 44 ++ isis/src/base/objs/PvlTokenizer/unitTest.cpp | 144 ++++ .../base/objs/PvlTranslationTable/Makefile | 7 + .../PvlTranslationTable.cpp | 0 .../PvlTranslationTable.h | 0 .../PvlTranslationTable.truth | 43 ++ .../objs/PvlTranslationTable/unitTest.cpp | 226 ++++++ isis/src/base/objs/TextFile/Makefile | 7 + .../src => base/objs/TextFile}/TextFile.cpp | 0 .../include => base/objs/TextFile}/TextFile.h | 0 isis/src/base/objs/TextFile/TextFile.truth | 43 ++ isis/src/base/objs/TextFile/unitTest.cpp | 541 ++++++++++++++ .../base/objs/UserInterface/UserInterface.h | 3 +- .../XmlToPvlTranslationManager.h | 1 - isis/src/core/CMakeLists.txt | 17 +- isis/src/core/TestPreferences | 217 ++++++ isis/src/core/cmake/RunUnitTest.cmake | 77 ++ isis/src/core/src/Pvl.cpp | 1 - isis/src/core/src/PvlFormat.cpp | 1 - isis/src/core/src/PvlFormatPds.cpp | 1 - isis/src/core/tests/CMakeLists.txt | 3 + isis/src/core/tests/unitTests/CMakeLists.txt | 38 + .../tests/unitTests/FileName/FileName.truth | 664 ++++++++++++++++++ .../tests/unitTests/FileName/unitTest.cpp | 339 +++++++++ .../unitTests/IException/IException.truth | 256 +++++++ .../tests/unitTests/IException/unitTest.cpp | 193 +++++ .../unitTests/IException/unitTest.exclude | 1 + .../tests/unitTests/IString/IString.truth | 195 +++++ .../core/tests/unitTests/IString/unitTest.cpp | 400 +++++++++++ .../tests/unitTests/Message/Message.truth | 28 + .../core/tests/unitTests/Message/unitTest.cpp | 99 +++ .../unitTests/Preference/Preference.truth | 13 + .../tests/unitTests/Preference/unitTest.cpp | 70 ++ isis/src/core/tests/unitTests/Pvl/Pvl.truth | 381 ++++++++++ .../tests/unitTests/Pvl/cnetstatsTest.def | 21 + .../src/core/tests/unitTests/Pvl/pointdef.def | 18 + .../src/core/tests/unitTests/Pvl/unitTest.cpp | 144 ++++ .../src/core/tests/unitTests/Pvl/unitTest.pvl | 34 + .../core/tests/unitTests/Pvl/unitTest2.pvl | 12 + .../core/tests/unitTests/Pvl/unitTest3.pvl | 12 + .../core/tests/unitTests/Pvl/unitTest4.pvl | 224 ++++++ .../unitTests/PvlContainer/PvlContainer.truth | 14 + .../tests/unitTests/PvlContainer/unitTest.cpp | 57 ++ .../tests/unitTests/PvlFormat/PvlFormat.truth | 34 + .../tests/unitTests/PvlFormat/unitTest.cpp | 100 +++ .../unitTests/PvlFormatPds/PvlFormatPds.truth | 260 +++++++ .../tests/unitTests/PvlFormatPds/unitTest.cpp | 451 ++++++++++++ .../tests/unitTests/PvlGroup/PvlGroup.truth | 69 ++ .../tests/unitTests/PvlGroup/unitTest.cpp | 173 +++++ .../unitTests/PvlKeyword/PvlKeyword.truth | 632 +++++++++++++++++ .../tests/unitTests/PvlKeyword/unitTest.cpp | 394 +++++++++++ .../unitTests/PvlSequence/PvlSequence.truth | 10 + .../tests/unitTests/PvlSequence/unitTest.cpp | 53 ++ .../unitTests/SpecialPixel/SpecialPixel.truth | 144 ++++ .../tests/unitTests/SpecialPixel/unitTest.cpp | 295 ++++++++ 85 files changed, 8628 insertions(+), 23 deletions(-) rename isis/src/{core/src => base/objs/LabelTranslationManager}/LabelTranslationManager.cpp (100%) rename isis/src/{core/include => base/objs/LabelTranslationManager}/LabelTranslationManager.h (98%) create mode 100644 isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.truth create mode 100644 isis/src/base/objs/LabelTranslationManager/Makefile create mode 100644 isis/src/base/objs/LabelTranslationManager/unitTest.cpp create mode 100644 isis/src/base/objs/PvlFlatMap/Makefile rename isis/src/{core/src => base/objs/PvlFlatMap}/PvlFlatMap.cpp (100%) rename isis/src/{core/include => base/objs/PvlFlatMap}/PvlFlatMap.h (100%) create mode 100644 isis/src/base/objs/PvlFlatMap/PvlFlatMap.truth create mode 100644 isis/src/base/objs/PvlFlatMap/unitTest.cpp create mode 100644 isis/src/base/objs/PvlToPvlTranslationManager/Makefile rename isis/src/{core/src => base/objs/PvlToPvlTranslationManager}/PvlToPvlTranslationManager.cpp (100%) rename isis/src/{core/include => base/objs/PvlToPvlTranslationManager}/PvlToPvlTranslationManager.h (98%) create mode 100644 isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth create mode 100644 isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp create mode 100644 isis/src/base/objs/PvlToXmlTranslationManager/Makefile rename isis/src/{core/src => base/objs/PvlToXmlTranslationManager}/PvlToXmlTranslationManager.cpp (100%) rename isis/src/{core/include => base/objs/PvlToXmlTranslationManager}/PvlToXmlTranslationManager.h (99%) create mode 100644 isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth create mode 100644 isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp create mode 100644 isis/src/base/objs/PvlToken/Makefile rename isis/src/{core/src => base/objs/PvlToken}/PvlToken.cpp (100%) rename isis/src/{core/include => base/objs/PvlToken}/PvlToken.h (100%) create mode 100644 isis/src/base/objs/PvlToken/PvlToken.truth create mode 100644 isis/src/base/objs/PvlToken/unitTest.cpp create mode 100644 isis/src/base/objs/PvlTokenizer/Makefile rename isis/src/{core/src => base/objs/PvlTokenizer}/PvlTokenizer.cpp (100%) rename isis/src/{core/include => base/objs/PvlTokenizer}/PvlTokenizer.h (100%) create mode 100644 isis/src/base/objs/PvlTokenizer/PvlTokenizer.truth create mode 100644 isis/src/base/objs/PvlTokenizer/unitTest.cpp create mode 100644 isis/src/base/objs/PvlTranslationTable/Makefile rename isis/src/{core/src => base/objs/PvlTranslationTable}/PvlTranslationTable.cpp (100%) rename isis/src/{core/include => base/objs/PvlTranslationTable}/PvlTranslationTable.h (100%) create mode 100644 isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.truth create mode 100644 isis/src/base/objs/PvlTranslationTable/unitTest.cpp create mode 100644 isis/src/base/objs/TextFile/Makefile rename isis/src/{core/src => base/objs/TextFile}/TextFile.cpp (100%) rename isis/src/{core/include => base/objs/TextFile}/TextFile.h (100%) create mode 100644 isis/src/base/objs/TextFile/TextFile.truth create mode 100644 isis/src/base/objs/TextFile/unitTest.cpp create mode 100644 isis/src/core/TestPreferences create mode 100644 isis/src/core/cmake/RunUnitTest.cmake create mode 100644 isis/src/core/tests/unitTests/CMakeLists.txt create mode 100644 isis/src/core/tests/unitTests/FileName/FileName.truth create mode 100644 isis/src/core/tests/unitTests/FileName/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/IException/IException.truth create mode 100644 isis/src/core/tests/unitTests/IException/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/IException/unitTest.exclude create mode 100644 isis/src/core/tests/unitTests/IString/IString.truth create mode 100644 isis/src/core/tests/unitTests/IString/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/Message/Message.truth create mode 100644 isis/src/core/tests/unitTests/Message/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/Preference/Preference.truth create mode 100644 isis/src/core/tests/unitTests/Preference/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/Pvl/Pvl.truth create mode 100644 isis/src/core/tests/unitTests/Pvl/cnetstatsTest.def create mode 100644 isis/src/core/tests/unitTests/Pvl/pointdef.def create mode 100644 isis/src/core/tests/unitTests/Pvl/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/Pvl/unitTest.pvl create mode 100644 isis/src/core/tests/unitTests/Pvl/unitTest2.pvl create mode 100644 isis/src/core/tests/unitTests/Pvl/unitTest3.pvl create mode 100644 isis/src/core/tests/unitTests/Pvl/unitTest4.pvl create mode 100644 isis/src/core/tests/unitTests/PvlContainer/PvlContainer.truth create mode 100644 isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/PvlFormat/PvlFormat.truth create mode 100644 isis/src/core/tests/unitTests/PvlFormat/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/PvlFormatPds/PvlFormatPds.truth create mode 100644 isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/PvlGroup/PvlGroup.truth create mode 100644 isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/PvlKeyword/PvlKeyword.truth create mode 100644 isis/src/core/tests/unitTests/PvlKeyword/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/PvlSequence/PvlSequence.truth create mode 100644 isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp create mode 100644 isis/src/core/tests/unitTests/SpecialPixel/SpecialPixel.truth create mode 100644 isis/src/core/tests/unitTests/SpecialPixel/unitTest.cpp diff --git a/isis/src/core/src/LabelTranslationManager.cpp b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp similarity index 100% rename from isis/src/core/src/LabelTranslationManager.cpp rename to isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp diff --git a/isis/src/core/include/LabelTranslationManager.h b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.h similarity index 98% rename from isis/src/core/include/LabelTranslationManager.h rename to isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.h index eacd749c95..f71a90b698 100644 --- a/isis/src/core/include/LabelTranslationManager.h +++ b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.h @@ -10,7 +10,6 @@ find files of those names at the top level of this repository. **/ #include #include "FileName.h" -#include "PvlTokenizer.h" #include "PvlTranslationTable.h" namespace Isis { diff --git a/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.truth b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.truth new file mode 100644 index 0000000000..3d46e24b94 --- /dev/null +++ b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.truth @@ -0,0 +1,59 @@ +Testing LabelTranslationManager object + +Testing Translate method: + +Translating Extra: Test Input, Index 0 + +Testing Auto method: + +Object = IsisCube + Object = BandBin + BandName = "Test Input, Index 0" + End_Object + + Group = Dimensions + NumberOfLines = "Test Input, Index 0" + NumberOfBands = "Test Input, Index 0" + End_Group +End_Object + +Group = Mapping + CenterLongitude = "Test Input, Index 0" +End_Group +End + +Testing parseSpecification method: att@name|value + +Testing parseSpecification method: tag@name|value + +Testing parseSpecification method: att@name + +Testing parseSpecification method: new@name + +Testing parseSpecification method: name|value + +Testing parseSpecification method: value + +Testing parseSpecification method: namespace:name + +Testing parseSpecification method: namespace:name|value + +Testing parseSpecification method: att@namespace:name|value + +Testing parseSpecification method: tag@name|value + +Testing parseSpecification method: att|name|value +**PROGRAMMER ERROR** Malformed dependency specification [att|name|value]. +**PROGRAMMER ERROR** [att|name|value] has unexpected number of '@' or '|' delimiters. + +Testing parseSpecification method: att@name@value +**PROGRAMMER ERROR** Malformed dependency specification [att@name@value]. +**PROGRAMMER ERROR** [att@name@value] has unexpected number of '@' or '|' delimiters. + +Testing parseSpecification method: not@name|value +**PROGRAMMER ERROR** Malformed dependency specification [not@name|value]. +**PROGRAMMER ERROR** Dependency type specification [not] is invalid. Valid types are [att], [tag] and [new]. + +Testing parseSpecification method: att@name|value1|value2 +**PROGRAMMER ERROR** Malformed dependency specification [att@name|value1|value2]. +**PROGRAMMER ERROR** Malformed dependency specification [att@name|value1|value2]. diff --git a/isis/src/base/objs/LabelTranslationManager/Makefile b/isis/src/base/objs/LabelTranslationManager/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/LabelTranslationManager/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/base/objs/LabelTranslationManager/unitTest.cpp b/isis/src/base/objs/LabelTranslationManager/unitTest.cpp new file mode 100644 index 0000000000..b87406c76b --- /dev/null +++ b/isis/src/base/objs/LabelTranslationManager/unitTest.cpp @@ -0,0 +1,191 @@ +#include +#include "LabelTranslationManager.h" +#include "Preference.h" +#include "IException.h" +#include "IString.h" +#include "Preference.h" + +using namespace Isis; +using namespace std; +/** + * Child class of LabelTranslationManager to implement pure virtual methods. + * + * @author 2017-01-11 Jeannie Backer + * + * @internal + * @history 2017-01-11 Jeannie Backer - Original Version. Fixes #4584. + * @history 2017-10-16 Kristin Berry - Updated for changes to dependency specification format and + * the addition of xml namspaces. References #5202 + */ +class TestTranslationManager : public LabelTranslationManager { + public: + + TestTranslationManager(const QString &transFile) : LabelTranslationManager() { + AddTable(transFile); + } + + TestTranslationManager(std::istream &transStrm) : LabelTranslationManager() { + AddTable(transStrm); + } + + ~TestTranslationManager() { + } + + virtual QString Translate(QString nName, int findex = 0) { + QString inputValue = "Test Input, Index " + toString(findex); + return PvlTranslationTable::Translate(nName, inputValue); + } +}; + +int main(void) { + + Preference::Preferences(true); + stringstream trnsStrm; + trnsStrm << "Group = NumberOfLines" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " OutputName = Lines" << endl; + trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; + trnsStrm << "\"Group\",\"Dimensions\")" << endl; + trnsStrm << " InputPosition = (Image,Size)" << endl; + trnsStrm << " InputKey = NL" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = NumberOfBands" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " Optional" << endl; + trnsStrm << " OutputName = Bands" << endl; + trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; + trnsStrm << "\"Group\",\"Dimensions\")" << endl; + trnsStrm << " InputPosition = (Image,Size)" << endl; + trnsStrm << " InputKey = Nb" << endl; + trnsStrm << " InputDefault = 1" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = Bonus" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " Optional" << endl; + trnsStrm << " InputPosition = (Image,Pixel)" << endl; + trnsStrm << " InputKey = Bonus" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = Extra" << endl; + trnsStrm << " Optional" << endl; + trnsStrm << " InputPosition = (Image,Bogus)" << endl; + trnsStrm << " InputKey = Extra" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = PixelResolution" << endl; + trnsStrm << " InputPosition = (Image,Pixel)" << endl; + trnsStrm << " InputKey = Resolution" << endl; + trnsStrm << " InputDefault = 1" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = BandName" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " OutputName = Band" << endl; + trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; + trnsStrm << "\"Object\",\"BandBin\")" << endl; + trnsStrm << " InputPosition = (Image,BandInfo)" << endl; + trnsStrm << " InputKey = Band" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = CenterLongitude" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " OutputPosition = (\"Group\",\"Mapping\")" << endl; + trnsStrm << " OutputName = CenterLongitude" << endl; + trnsStrm << " InputPosition = IMAGE_MAP_PROJECTION" << endl; + trnsStrm << " InputPosition = (QUBE,IMAGE_MAP_PROJECTION)" << endl; + trnsStrm << " InputPosition = (SPECTRAL_QUBE,IMAGE_MAP_PROJECTION)" << endl; + trnsStrm << " InputKey = CENTER_LONGITUDE" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + + trnsStrm << "End" << endl; + + TestTranslationManager transMgr(trnsStrm); + + try { + cout << "Testing LabelTranslationManager object" << endl; + + cout << endl << "Testing Translate method:" << endl; + cout << endl << "Translating Extra: "; + cout << transMgr.Translate("Extra") << endl; + + cout << endl << "Testing Auto method:" << endl; + Pvl translatedLabel; + transMgr.Auto(translatedLabel); + cout << endl << translatedLabel << endl; + } + catch(IException &e) { + e.print(); + } + try { + cout << endl << "Testing parseSpecification method: att@name|value" << endl; + transMgr.parseSpecification((QString)"att@name:value"); + + cout << endl << "Testing parseSpecification method: tag@name|value" << endl; + transMgr.parseSpecification((QString)"tag@name|value"); + + cout << endl << "Testing parseSpecification method: att@name" << endl; + transMgr.parseSpecification((QString)"att@name"); + + cout << endl << "Testing parseSpecification method: new@name" << endl; + transMgr.parseSpecification((QString)"new@name"); + + cout << endl << "Testing parseSpecification method: name|value" << endl; + transMgr.parseSpecification((QString)"name|value"); + + cout << endl << "Testing parseSpecification method: value" << endl; + transMgr.parseSpecification((QString)"value"); + + cout << endl << "Testing parseSpecification method: namespace:name" << endl; + transMgr.parseSpecification((QString)"namespace:name"); + + cout << endl << "Testing parseSpecification method: namespace:name|value" << endl; + transMgr.parseSpecification((QString)"namespace:name|value"); + + cout << endl << "Testing parseSpecification method: att@namespace:name|value" << endl; + transMgr.parseSpecification((QString)"att@namepsace:name|value"); + + cout << endl << "Testing parseSpecification method: tag@name|value" << endl; + transMgr.parseSpecification((QString)"tag@namespace:name|value"); + } + catch(IException &e) { + e.print(); + } + + + try { + cout << endl << "Testing parseSpecification method: att|name|value" << endl; + transMgr.parseSpecification((QString)"att|name|value"); + } + catch(IException &e) { + e.print(); + } + + + try { + cout << endl << "Testing parseSpecification method: att@name@value" << endl; + transMgr.parseSpecification((QString)"att@name@value"); + } + catch(IException &e) { + e.print(); + } + + try { + cout << endl << "Testing parseSpecification method: not@name|value" << endl; + transMgr.parseSpecification((QString)"not@name|value"); + } + catch(IException &e) { + e.print(); + } + + try { + cout << endl << "Testing parseSpecification method: att@name|value1|value2" << endl; + transMgr.parseSpecification((QString)"att@name|value1|value2"); + } + catch(IException &e) { + e.print(); + } + return 0; +} diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.cpp b/isis/src/base/objs/ProcessImport/ProcessImport.cpp index cdd535aafa..bde33889c1 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.cpp +++ b/isis/src/base/objs/ProcessImport/ProcessImport.cpp @@ -23,7 +23,6 @@ find files of those names at the top level of this repository. **/ #include "PixelType.h" #include "Process.h" #include "Pvl.h" -#include "PvlTokenizer.h" #include "SpecialPixel.h" #include "UserInterface.h" diff --git a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp index 58e0dfeca8..ee3489b9bd 100644 --- a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp +++ b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp @@ -25,7 +25,6 @@ find files of those names at the top level of this repository. **/ #include "PvlKeyword.h" #include "PvlGroup.h" #include "PvlObject.h" -#include "PvlTokenizer.h" #include "PvlToPvlTranslationManager.h" #include "SpecialPixel.h" #include "Table.h" diff --git a/isis/src/base/objs/PvlFlatMap/Makefile b/isis/src/base/objs/PvlFlatMap/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/PvlFlatMap/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/core/src/PvlFlatMap.cpp b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp similarity index 100% rename from isis/src/core/src/PvlFlatMap.cpp rename to isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp diff --git a/isis/src/core/include/PvlFlatMap.h b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.h similarity index 100% rename from isis/src/core/include/PvlFlatMap.h rename to isis/src/base/objs/PvlFlatMap/PvlFlatMap.h diff --git a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.truth b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.truth new file mode 100644 index 0000000000..37624d927e --- /dev/null +++ b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.truth @@ -0,0 +1,209 @@ +PvlFlatMap1 Source (PvlObject): +Object = Beasts + CAT = Meow + Cat = Null + cat = Purr + Eagle = Swoop + Rattler = coil + + Object = ExcludeObject + Dog = Moo + End_Object + + Group = Fish + Trout = Brown + Bass = "Large mouth" + End_Group + + Group = Birds + Sparrow = House + Crow = Null + EAGLE = Claws + End_Group + + Group = ExcludeGroup + CAT = Woof + End_Group +End_Object + +Map1 - CAT and EAGLE values are overwritten. No Constraints: + Bass = "Large mouth" + CAT = Woof + Crow = Null + Dog = Moo + EAGLE = Claws + Rattler = coil + Sparrow = House + Trout = Brown + +Map1B Constraints: + excludes: ("ExcludeGroup", "ExcludeObject") + includes: () + key list: () + +Map1B - ExcludeGroup and ExcludeObject are excluded: + Bass = "Large mouth" + cat = Purr + Crow = Null + EAGLE = Claws + Rattler = coil + Sparrow = House + Trout = Brown + + Map1C Constraints: + size of excludes: 2 + size of includes: 1 + excludes: ("ExcludeGroup", "ExcludeObject") + includes: ("Beasts") + key list: () + cat is excluded? false + ExcludeGroup is excluded? true + cat is included? false + Beasts is included? true + +Map1C - ExcludeGroup and ExcludeObject are excluded. + Beasts object is included: + Bass = "Large mouth" + cat = Purr + Crow = Null + EAGLE = Claws + Rattler = coil + Sparrow = House + Trout = Brown + +Map1D Constraints: + excludes: () + includes: ("Fish", "Birds") + key list: () + +Map1D - Fish group and Birds object are included. + However, parent object Beasts is not included, + so all subgroups/subobjects are skipped: + + +Map1E Constraints: + size of key list: 7 + excludes: () + includes: () + key list: ("cat", "eagle", "rattler", "trout", "bass", "sparrow", "crow") + cat is in list? true + dog is in list? false + +Map1E - key list provided: + Bass = "Large mouth" + CAT = Woof + Crow = Null + EAGLE = Claws + Rattler = coil + Sparrow = House + Trout = Brown + +Map1F Constraints: + size of key list: 7 + excludes: () + includes: () + key list: ("dog", "eagle", "rattler", "trout", "bass", "sparrow", "crow") + cat is in list? false + dog is in list? true + +Map1F - key list file provided: + Bass = "Large mouth" + Crow = Null + Dog = Moo + EAGLE = Claws + Rattler = coil + Sparrow = House + Trout = Brown + +Map1 Copy: + Bass = "Large mouth" + CAT = Woof + Crow = Null + Dog = Moo + EAGLE = Claws + Rattler = coil + Sparrow = House + Trout = Brown + +PvlFlatMap2 Source (PvlGroup): +# Are slimey +Group = Snake + Rattler = DiamondBack +End_Group + +Map2 - No constraints: + Rattler = DiamondBack + +Map1 and Map2 combined - RATTLER is overwritten: + Bass = "Large mouth" + CAT = Woof + Crow = Null + Dog = Moo + EAGLE = Claws + Rattler = DiamondBack + Sparrow = House + Trout = Brown + +Map3 - CLIMB values are appended: + Climb = (Wall, Rock, Tree) + Field = Run + Fly = Sugar + +Merging Map3 to Maps 1,2. Adding [ "3" ] new keywords. +Map1, Map2, and Map3 merged: + Bass = "Large mouth" + CAT = Woof + Climb = (Wall, Rock, Tree) + Crow = Null + Dog = Moo + EAGLE = Claws + Field = Run + Fly = Sugar + Rattler = DiamondBack + Sparrow = House + Trout = Brown + +Get map info for existing keys: + Map has keyword=crow? true + crow is Null? true + Map has keyword=climb? true + All Values for climb: ("Wall", "Rock", "Tree") + climb count: 3 + climb at index "0" is Null? false + climb at index "1" is Null? false + climb at index "2" is Null? false + Get first value of climb: "Wall" + Get second value of climb: "Rock" + Get third value of climb: "Tree" + Get fourth value of climb or return KingKong: "KingKong" + Get climb as PvlKeyword: Climb = (Wall, Rock, Tree) + +Get map info for non-existent keys: + Map has keyword=pencil? false + All Values for pencil: () + pencil count: 0 + pencil is Null? true + Get value of pencil or return Lucy: "Lucy" + Get values for PvlKeyword('pencil', 'Linus'): ("Linus") + +Erasing climb keyword: true +Reprint Map123 merged with CLIMB keyword erased: + Bass = "Large mouth" + CAT = Woof + Crow = Null + Dog = Moo + EAGLE = Claws + Field = Run + Fly = Sugar + Rattler = DiamondBack + Sparrow = House + Trout = Brown + +Try to get CLIMB keyword after erased... +**PROGRAMMER ERROR** Keyword Climb does not exist!. + +Try to get CAT keyword at non-existent index... +**PROGRAMMER ERROR** Index 10 does not exist for keyword CAT!. + +Try to get non-existent pencil keyword... +**PROGRAMMER ERROR** Keyword pencil does not exist!. diff --git a/isis/src/base/objs/PvlFlatMap/unitTest.cpp b/isis/src/base/objs/PvlFlatMap/unitTest.cpp new file mode 100644 index 0000000000..3ca924b9a0 --- /dev/null +++ b/isis/src/base/objs/PvlFlatMap/unitTest.cpp @@ -0,0 +1,285 @@ +#include +#include +#include + +#include "FileName.h" +#include "IException.h" +#include "IString.h" +#include "Preference.h" +#include "Pvl.h" +#include "PvlFlatMap.h" +#include "PvlGroup.h" +#include "PvlFlatMap.h" +#include "PvlObject.h" +#include "TextFile.h" + +using namespace Isis; +using namespace std; + +static void print(const PvlFlatMap &map); + +/** + * Unit test for PvlFlatMap and PvlContraints classes. + * + * + * @author 2016-02-28 Jeannie Backer + * + * @internal + * @history 2016-02-28 Jeannie Backer - Original version. + * + * @todo 2016-02-28 Jeannie Backer - The code coverage software was not + * working when this test was originally checked in. + */ +int main() { + Preference::Preferences(true); + + // Create a PvlObject to map + PvlObject pvlObject("Beasts"); + pvlObject += PvlKeyword("CAT", "Meow"); + pvlObject += PvlKeyword("Cat"); + pvlObject += PvlKeyword("cat", "Purr"); + pvlObject += PvlKeyword("Eagle", "Swoop"); + pvlObject += PvlKeyword("Rattler", "coil"); + + PvlGroup includeGroup("Fish"); + includeGroup += PvlKeyword("Trout", "Brown"); + includeGroup += PvlKeyword("Bass", "Large mouth"); + pvlObject += includeGroup; + + PvlGroup includeObject("Birds"); + includeObject += PvlKeyword("Sparrow", "House"); + includeObject += PvlKeyword("Crow"); + includeObject += PvlKeyword("EAGLE", "Claws"); + pvlObject += includeObject; + + PvlGroup excludeGroup("ExcludeGroup"); + excludeGroup += PvlKeyword("CAT", "Woof"); + pvlObject += excludeGroup; + + PvlObject excludeObject("ExcludeObject"); + excludeObject += PvlKeyword("Dog", "Moo"); + pvlObject += excludeObject; + + qDebug() << "PvlFlatMap1 Source (PvlObject):"; + cout << pvlObject << endl; + qDebug() << ""; + + // Constructed from PvlObject no constraints + PvlFlatMap map1(pvlObject); + qDebug() << "Map1 - CAT and EAGLE values are overwritten. No Constraints:"; + print(map1); + + // Testing PvlConstraints from exclude list + QStringList excludeList; + excludeList << "ExcludeGroup"; + PvlConstraints constraints = PvlConstraints::withExcludes(excludeList); + constraints.addExclude("ExcludeObject"); + qDebug() << "Map1B Constraints:"; + qDebug() << " excludes: " << constraints.excludes(); + qDebug() << " includes: " << constraints.includes(); + qDebug() << " key list: " << constraints.keyList(); + qDebug() << ""; + PvlFlatMap map1b(pvlObject, constraints); + qDebug() << "Map1B - ExcludeGroup and ExcludeObject are excluded:"; + print(map1b); + + // Testing adding includes to PvlConstraints + constraints.addInclude("Beasts"); + qDebug() << " Map1C Constraints:"; + qDebug() << " size of excludes: " << constraints.excludeSize(); + qDebug() << " size of includes: " << constraints.includeSize(); + qDebug() << " excludes: " << constraints.excludes(); + qDebug() << " includes: " << constraints.includes(); + qDebug() << " key list: " << constraints.keyList(); + qDebug() << " cat is excluded? " << constraints.isExcluded("cat"); + qDebug() << " ExcludeGroup is excluded? " << constraints.isExcluded("ExcludeGroup"); + qDebug() << " cat is included? " << constraints.isIncluded("cat"); + qDebug() << " Beasts is included? " << constraints.isIncluded("Beasts"); + qDebug() << ""; + PvlFlatMap map1c(pvlObject, constraints); + qDebug() << "Map1C - ExcludeGroup and ExcludeObject are excluded.\n" + " Beasts object is included:"; + print(map1c); + + // Testing PvlConstraints from include list + QStringList includeList; + includeList << "Fish" << "Birds"; + constraints = PvlConstraints::withIncludes(includeList); + qDebug() << "Map1D Constraints:"; + qDebug() << " excludes: " << constraints.excludes(); + qDebug() << " includes: " << constraints.includes(); + qDebug() << " key list: " << constraints.keyList(); + qDebug() << ""; + PvlFlatMap map1d(pvlObject, constraints); + qDebug() << "Map1D - Fish group and Birds object are included.\n" + " However, parent object Beasts is not included,\n" + " so all subgroups/subobjects are skipped:"; + print(map1d); + + // Testing PvlConstraints from QStringList + QStringList keyList; + keyList << "cat" << "eagle" << "rattler" << "trout" << "bass" << "sparrow" << "crow"; + PvlConstraints keywordConstraints; + keywordConstraints.addKeyToList(keyList); + qDebug() << "Map1E Constraints:"; + qDebug() << " size of key list: " << keywordConstraints.keyListSize(); + qDebug() << " excludes: " << keywordConstraints.excludes(); + qDebug() << " includes: " << keywordConstraints.includes(); + qDebug() << " key list: " << keywordConstraints.keyList(); + qDebug() << " cat is in list? " << keywordConstraints.isKeyInList("cat"); + qDebug() << " dog is in list? " << keywordConstraints.isKeyInList("dog"); + qDebug() << ""; + PvlFlatMap map1e(pvlObject, keywordConstraints); + qDebug() << "Map1E - key list provided:"; + print(map1e); + + // Testing PvlConstraints from file + QString keyListFileName = FileName("$temporary/keyListFile.txt").expanded(); + keyList.replaceInStrings("cat", "dog"); + // write the keylist to a text file + TextFile keyListFile(keyListFileName, "output"); + for (int i = 0; i < keyList.size(); i++) { + keyListFile.PutLine(keyList[i]); + } + keyListFile.Close(); + PvlConstraints constraintsFromFile(keyListFileName); + if (!QFile::remove(keyListFileName)) { + throw IException(IException::Io, "Unable to remove file, [keyListFile.txt]", _FILEINFO_); + } + qDebug() << "Map1F Constraints:"; + qDebug() << " size of key list: " << constraintsFromFile.keyListSize(); + qDebug() << " excludes: " << constraintsFromFile.excludes(); + qDebug() << " includes: " << constraintsFromFile.includes(); + qDebug() << " key list: " << constraintsFromFile.keyList(); + qDebug() << " cat is in list? " << constraintsFromFile.isKeyInList("cat"); + qDebug() << " dog is in list? " << constraintsFromFile.isKeyInList("dog"); + qDebug() << ""; + PvlFlatMap map1f(pvlObject, constraintsFromFile); + qDebug() << "Map1F - key list file provided:"; + print(map1f); + + // PvlFlatMap Copy Constructor + PvlFlatMap otherMap(map1); + qDebug() << "Map1 Copy:"; + print(otherMap); + + // Construct PvlFlatMap from PvlGroup + PvlGroup pvlGroup("Snake"); + pvlGroup.addComment("Are slimey"); + pvlGroup += PvlKeyword("Rattler", "DiamondBack"); + + qDebug() << "PvlFlatMap2 Source (PvlGroup):"; + cout << pvlGroup << endl; + qDebug() << ""; + + + PvlFlatMap map2(pvlGroup, keywordConstraints); + qDebug() << "Map2 - No constraints:"; + print(map2); + + // Construct map from maps 1,2 + PvlFlatMap map12(map1, map2); + qDebug() << "Map1 and Map2 combined - RATTLER is overwritten:"; + print(map12); + + // Empty constructor + PvlFlatMap map3; + map3.add("Field", "Run"); + PvlKeyword climb("Climb", "Wall"); + climb.addValue("Rock"); + map3.add(climb); + map3.append("CLIMB", "Tree");// append to existing + map3.append("Fly", "Sugar");// append new + qDebug() << "Map3 - CLIMB values are appended:"; + print(map3); + + // merge all three maps + qDebug() << "Merging Map3 to Maps 1,2. Adding [" + << toString(map12.merge(map3)) << "] new keywords."; + qDebug() << "Map1, Map2, and Map3 merged:"; + print(map12); + + // get map info + qDebug() << "Get map info for existing keys:"; + qDebug() << " Map has keyword=crow?" << map12.exists("crow"); + qDebug() << " crow is Null? " << map12.isNull("crow"); + qDebug() << " Map has keyword=climb?" << map12.exists("climb"); + qDebug() << " All Values for climb:" << map12.allValues("Climb"); + int climbs = map12.count("climb"); + qDebug() << " climb count: " << climbs; + for (int i = 0; i < climbs; i++) { + qDebug() << " climb at index" << toString(i) << "is Null? " << map12.isNull("climb", i); + } + + // test more map accessor methods + qDebug() << " Get first value of climb: " << map12("Climb"); + qDebug() << " Get second value of climb: " << map12.get("Climb", 1); + qDebug() << " Get third value of climb: " << map12.get("Climb", 2); + qDebug() << " Get fourth value of climb or return KingKong: " + << map12.get("Climb", "KingKong", 3); + cout << " Get climb as PvlKeyword: " << map12.keyword("Climb") << endl; + + qDebug() << ""; + qDebug() << "Get map info for non-existent keys:"; + qDebug() << " Map has keyword=pencil?" << map12.exists("pencil"); + qDebug() << " All Values for pencil:" << map12.allValues("pencil"); + qDebug() << " pencil count: " << map12.count("pencil"); + qDebug() << " pencil is Null? " << map12.isNull("pencil"); + qDebug() << " Get value of pencil or return Lucy: " << map12.get("pencil", "Lucy"); + qDebug() << " Get values for PvlKeyword('pencil', 'Linus'): " + << map12.keywordValues(PvlKeyword("Sally", "Linus")); + qDebug() << ""; + + // erase... + qDebug() << "Erasing climb keyword: " << map12.erase("Climb"); + qDebug() << "Reprint Map123 merged with CLIMB keyword erased:"; + print(map12); + + // test throw DNE + qDebug() << "Try to get CLIMB keyword after erased..."; + try { + map12.get("Climb"); + } + catch (IException &e) { + e.print(); + } + + qDebug() << ""; + qDebug() << "Try to get CAT keyword at non-existent index..."; + try { + map12.get("CAT", 10); + } + catch (IException &e) { + e.print(); + } + + qDebug() << ""; + qDebug() << "Try to get non-existent pencil keyword..."; + try { + map12.keyword("pencil"); + } + catch (IException &e) { + e.print(); + } + +} + +/** + * Unit test convenience function for printing the contents of PvlFlatMaps. If + * the map is empty, the string " < Empty Map >" will be printed. + * + * @param map The PvlFlatMap to print. + * + * @author 2016-02-28 Jeannie Backer + */ +static void print(const PvlFlatMap &map) { + if (map.isEmpty()) { + cout << "\t " << endl; + } + QMapIterator iterator(map); + while(iterator.hasNext()) { + iterator.next(); + cout << "\t" << iterator.value() << endl; + } + qDebug() << ""; +} diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/Makefile b/isis/src/base/objs/PvlToPvlTranslationManager/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/PvlToPvlTranslationManager/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/core/src/PvlToPvlTranslationManager.cpp b/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp similarity index 100% rename from isis/src/core/src/PvlToPvlTranslationManager.cpp rename to isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp diff --git a/isis/src/core/include/PvlToPvlTranslationManager.h b/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h similarity index 98% rename from isis/src/core/include/PvlToPvlTranslationManager.h rename to isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h index 06bccfad96..e28376b39d 100644 --- a/isis/src/core/include/PvlToPvlTranslationManager.h +++ b/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h @@ -12,7 +12,6 @@ find files of those names at the top level of this repository. **/ #include #include "FileName.h" -#include "PvlTokenizer.h" namespace Isis { class Pvl; @@ -54,7 +53,7 @@ namespace Isis { * 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 + * @history 2018-01-10 Christopher Combs - Changed ProcessDataFilePointer call to reflect * changes made to voy2isis. Fixes #4345, #4421. * @history 2018-04-16 Jeannie Backer - Fixed indentation of history comments and * brought code closer to coding standards. diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth b/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth new file mode 100644 index 0000000000..4fd157329d --- /dev/null +++ b/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.truth @@ -0,0 +1,51 @@ +Testing PvlToPvlTranslationManager object + Testing InputValue member + DataFileName = SomeFile.dat + StartByte = 32 + NumberOfBands = 27 + PixelResolution = 100 + Error messages: + **PROGRAMMER ERROR** Unable to find input group [Bad1,Bad2,Bad3] for output name [BadGroup] in file []. + **PROGRAMMER ERROR** Unable to find input keyword [BadKey] for output name [GoodGroupBadKey] in file []. + + Testing InputUnits member + PixelResolution = meters + NumberOfBands = + Error messages: + **PROGRAMMER ERROR** Unable to find input group [Bad1,Bad2,Bad3] for output name [BadGroup] in file []. + **PROGRAMMER ERROR** Unable to find input keyword [BadKey] for output name [GoodGroupBadKey] in file []. + + Testing InputSize member + BandName = 3 + PixelResolution = 1 + Error messages: + **PROGRAMMER ERROR** Unable to find input group [Bad1,Bad2,Bad3] for output name [BadGroup] in file []. + **PROGRAMMER ERROR** Unable to find input keyword [BadKey] for output name [GoodGroupBadKey] in file []. + + Testing InputHasKeyword member + BandName = 1 + GoodGroupBadKey = 0 + + Testing Translate member + DataFileName = SomeFile.dat + ImageStartByte = 32 + Lines = 500 + + Testing Auto member +PixelBytes = 2 + +Object = IsisCube + Object = BandBin + Band = (Red, Green, Blue) + End_Object + + Group = Dimensions + Lines = 500 + Bands = (27, 12, 1) + End_Group +End_Object + +Group = Mapping + CenterLongitude = 44.4975624 +End_Group +End diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp b/isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp new file mode 100644 index 0000000000..df0cb33e0d --- /dev/null +++ b/isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp @@ -0,0 +1,250 @@ +#include +#include "PvlToPvlTranslationManager.h" +#include "Preference.h" +#include "IException.h" +#include "IString.h" +#include "Preference.h" + +using namespace Isis; +using namespace std; + +int main(void) { + Preference::Preferences(true); + + try { + + stringstream fStrm; + fStrm << "^IMAGE = (SomeFile.dat, 32)" << endl; + fStrm << "Object = Image" << endl; + fStrm << " Group = Size" << endl; + fStrm << " NL = 500" << endl; + fStrm << " NS = 400" << endl; + fStrm << " NB = (27,12,1)" << endl; + fStrm << " EndGroup" << endl; + fStrm << " Group = Pixel" << endl; + fStrm << " Bits = 16" << endl; + fStrm << " Signed = True" << endl; + fStrm << " Architecture = Sun" << endl; + fStrm << " Resolution = 100" << endl; + fStrm << " EndGroup" << endl; + fStrm << " Object = BandInfo" << endl; + fStrm << " Band = (r,g,b)" << endl; + fStrm << " Center = (2, 8, 1.9)" << endl; + fStrm << " EndObject" << endl; + fStrm << "EndObject" << endl; + + fStrm << "OBJECT = QUBE" << endl; + fStrm << " GROUP = IMAGE_MAP_PROJECTION" << endl; + fStrm << " MAP_PROJECTION_TYPE = SINUSOIDAL" << endl; + fStrm << " A_AXIS_RADIUS = 1737.4000000" << endl; + fStrm << " CENTER_LONGITUDE = 44.4975624" << endl; + fStrm << " END_GROUP = IMAGE_MAP_PROJECTION" << endl; + fStrm << "END_OBJECT = QUBE" << endl; + fStrm << "End" << endl; + Pvl fLabel; + fStrm >> fLabel; + + stringstream trnsStrm; + trnsStrm << "Group = DataFileName" << endl; + trnsStrm << " InputKey = ^IMAGE" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = ImageStartByte" << endl; + trnsStrm << " InputKey = ^IMAGE" << endl; + trnsStrm << " InputDefault = 1" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = NumberOfLines" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " OutputName = Lines" << endl; + trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; + trnsStrm << "\"Group\",\"Dimensions\")" << endl; + trnsStrm << " InputPosition = (Image,Size)" << endl; + trnsStrm << " InputKey = NL" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = NumberOfBands" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " Optional" << endl; + trnsStrm << " OutputName = Bands" << endl; + trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; + trnsStrm << "\"Group\",\"Dimensions\")" << endl; + trnsStrm << " InputPosition = (Image,Size)" << endl; + trnsStrm << " InputKey = Nb" << endl; + trnsStrm << " InputDefault = 1" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = Bonus" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " Optional" << endl; + trnsStrm << " InputPosition = (Image,Pixel)" << endl; + trnsStrm << " InputKey = Bonus" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = Extra" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " Optional" << endl; + trnsStrm << " InputPosition = (Image,Bogus)" << endl; + trnsStrm << " InputKey = Extra" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = BytesPerPixel" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " InputPosition = Size" << endl; + trnsStrm << " InputPosition = (Image,Size)" << endl; + trnsStrm << " InputPosition = (Image,Pixel)" << endl; + trnsStrm << " InputKey = Bits" << endl; + trnsStrm << " InputDefault = 8" << endl; + trnsStrm << " OutputName = PixelBytes" << endl; + trnsStrm << " OutputPosition = Root" << endl; + trnsStrm << " Translation = (1,8)" << endl; + trnsStrm << " Translation = (2,16)" << endl; + trnsStrm << " Translation = (4,32)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = PixelResolution" << endl; + trnsStrm << " InputPosition = (Image,Pixel)" << endl; + trnsStrm << " InputKey = Resolution" << endl; + trnsStrm << " InputDefault = 1" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = Sign" << endl; + trnsStrm << " InputPosition = (Image,Pixel)" << endl; + trnsStrm << " InputKey = Signed" << endl; + trnsStrm << " InputDefault = True" << endl; + trnsStrm << " Translation = (True,True)" << endl; + trnsStrm << " Translation = (False,False)" << endl; + trnsStrm << " Translation = (True,Yes)" << endl; + trnsStrm << " Translation = (False,No)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = BandName" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " OutputName = Band" << endl; + trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; + trnsStrm << "\"Object\",\"BandBin\")" << endl; + trnsStrm << " InputPosition = (Image,BandInfo)" << endl; + trnsStrm << " InputKey = Band" << endl; + trnsStrm << " Translation = (Red,r)" << endl; + trnsStrm << " Translation = (Green,g)" << endl; + trnsStrm << " Translation = (Blue,b)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = BadGroup" << endl; + trnsStrm << " InputPosition = (Bad1,Bad2,Bad3)" << endl; + trnsStrm << " InputKey = BadKey" << endl; + trnsStrm << " InputDefault = 1" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + trnsStrm << "Group = GoodGroupBadKey" << endl; + trnsStrm << " InputPosition = (Image,Pixel)" << endl; + trnsStrm << " InputKey = BadKey" << endl; + trnsStrm << " InputDefault = 1" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + + trnsStrm << "Group = CenterLongitude" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " OutputPosition = (\"Group\",\"Mapping\")" << endl; + trnsStrm << " OutputName = CenterLongitude" << endl; + trnsStrm << " InputPosition = IMAGE_MAP_PROJECTION" << endl; + trnsStrm << " InputPosition = (QUBE,IMAGE_MAP_PROJECTION)" << endl; + trnsStrm << " InputPosition = (SPECTRAL_QUBE,IMAGE_MAP_PROJECTION)" << endl; + trnsStrm << " InputKey = CENTER_LONGITUDE" << endl; + trnsStrm << " Translation = (*,*)" << endl; + trnsStrm << "EndGroup" << endl; + + trnsStrm << "End" << endl; + + PvlToPvlTranslationManager transMgr(fLabel, trnsStrm); + + cout << "Testing PvlToPvlTranslationManager object" << endl; + + cout << " Testing InputValue member" << endl; + cout << " DataFileName = " << transMgr.InputKeyword("DataFileName")[0] << endl; + cout << " StartByte = " << transMgr.InputKeyword("ImageStartByte")[1] << endl; + cout << " NumberOfBands = " << transMgr.InputKeyword("NumberOfBands")[0] << endl; + cout << " PixelResolution = " << transMgr.InputKeyword("PixelResolution")[0] << endl; + cout << " Error messages:" << endl; + try { + transMgr.InputKeyword("BadGroup"); + } + catch(IException &e) { + cerr << " "; + e.print(); + } + try { + transMgr.InputKeyword("GoodGroupBadKey"); + } + catch(IException &e) { + cerr << " "; + e.print(); + } + cout << endl; + + cout << " Testing InputUnits member" << endl; + cout << " PixelResolution = " << transMgr.InputKeyword("PixelResolution").unit() << endl; + cout << " NumberOfBands = " << transMgr.InputKeyword("NumberOfBands").unit() << endl; + cout << " Error messages:" << endl; + try { + transMgr.InputKeyword("BadGroup").unit(); + } + catch(IException &e) { + cerr << " "; + e.print(); + } + try { + transMgr.InputKeyword("GoodGroupBadKey").unit(); + } + catch(IException &e) { + cerr << " "; + e.print(); + } + cout << endl; + + cout << " Testing InputSize member" << endl; + cout << " BandName = " << transMgr.InputKeyword("BandName").size() << endl; + cout << " PixelResolution = " << transMgr.InputKeyword("PixelResolution").size() << endl; + cout << " Error messages:" << endl; + try { + transMgr.InputKeyword("BadGroup").size(); + } + catch(IException &e) { + cerr << " "; + e.print(); + } + try { + transMgr.InputKeyword("GoodGroupBadKey").size(); + } + catch(IException &e) { + cerr << " "; + e.print(); + } + cout << endl; + + cout << " Testing InputHasKeyword member" << endl; + cout << " BandName = " << transMgr.InputHasKeyword("BandName") << endl; + cout << " GoodGroupBadKey = " << transMgr.InputHasKeyword("GoodGroupBadKey") << endl; + cout << endl; + +// cout << " Testing InputHasGroup member" << endl; +// cout << " BandName = " << transMgr.InputHasGroup ("BandName") << endl; +// cout << " BadGroup = " << transMgr.InputHasGroup ("BadGroup") << endl; +// cout << endl; + + cout << " Testing Translate member" << endl; + cout << " DataFileName = " << transMgr.Translate("DataFileName") << endl; + cout << " ImageStartByte = " << transMgr.Translate("ImageStartByte", 1) << endl; + cout << " Lines = " << transMgr.Translate("NumberOfLines") << endl; + cout << endl; + + cout << " Testing Auto member" << endl; + Pvl pvl; + transMgr.Auto(pvl); + cout << pvl << endl; + + + } + catch(IException &e) { + e.print(); + } + + return 0; +} diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/Makefile b/isis/src/base/objs/PvlToXmlTranslationManager/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/PvlToXmlTranslationManager/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/core/src/PvlToXmlTranslationManager.cpp b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp similarity index 100% rename from isis/src/core/src/PvlToXmlTranslationManager.cpp rename to isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp diff --git a/isis/src/core/include/PvlToXmlTranslationManager.h b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h similarity index 99% rename from isis/src/core/include/PvlToXmlTranslationManager.h rename to isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h index f1d9cdfef1..43051b79a5 100644 --- a/isis/src/core/include/PvlToXmlTranslationManager.h +++ b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.h @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include "FileName.h" #include "Pvl.h" -#include "PvlTokenizer.h" class QDomElement; class QString; @@ -72,7 +71,7 @@ namespace Isis { virtual bool InputHasKeyword(const QString translationGroupName); void SetLabel(Pvl &inputLabel); - + static void addElement(QDomElement &parent, QString name, QString value, QString units = ""); static void setElementValue(QDomElement &element, QString value, QString units = ""); static void resetElementValue(QDomElement &element, QString value, QString units = ""); diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth new file mode 100644 index 0000000000..0b587b848c --- /dev/null +++ b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.truth @@ -0,0 +1,52 @@ + Testing Setting Input Label + Testing Translating Something +Filter = NIR + Testing InputKeyword +ExposureDuration = 1.920e-003 + Testing Bad InputKeyword +**PROGRAMMER ERROR** Unable to find translation group [BAD] in file [temp.trn]. + + Testing Translate +2048 + Testing Bad Translate +**PROGRAMMER ERROR** Unable to find translation group [BAD] in file [temp.trn]. + + Testing InputHasKeyword True +1 + Testing InputHasKeyword False +**PROGRAMMER ERROR** Unable to find translation group [False] in file [temp.trn]. + + Testing bad InputKeyword, does not exist in group +**PROGRAMMER ERROR** Unable to find input keyword [NotInLabel] for output name [DefaultOutput] in file [temp.trn]. + + Testing bad InputKeyword, group does not exist +**PROGRAMMER ERROR** Unable to find translation group [BadInputGroup] in file [temp.trn]. + + Testing SetLabel + SetLabel Succesful + + Testing Auto member + + + + + + 2048 + Sample + + + 255 + Line + + + + + + + NIR + DefaultValue + + + + + diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp b/isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp new file mode 100644 index 0000000000..ece66bc732 --- /dev/null +++ b/isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp @@ -0,0 +1,229 @@ +#include +#include + +#include + +#include "IException.h" +#include "IString.h" +#include "Preference.h" + +#include "PvlToXmlTranslationManager.h" + + +using namespace Isis; +using namespace std; + +int main(void) { + Preference::Preferences(true); + + QDomDocument *QDomDoc; + + QDomDoc = new QDomDocument("XML_LABEL"); + QDomElement root = QDomDoc->createElement("Product_Observational"); + QDomDoc->appendChild(root); + + try { + stringstream fStrm; + fStrm << "Object = IsisCube" << endl; + fStrm << " Object = Core" << endl; + fStrm << " Group = Dimensions" << endl; + fStrm << " Samples = 2048" << endl; + fStrm << " Lines = 255" << endl; + fStrm << " Bands = 1" << endl; + fStrm << " EndGroup" << endl; + fStrm << " Group = Pixel" << endl; + fStrm << " Type = SignedWord" << endl; + fStrm << " ByteOrder = Lsb" << endl; + fStrm << " Base = 0.0" << endl; + fStrm << " Multiplier = 1.0" << endl; + fStrm << " EndGroup" << endl; + fStrm << " EndObject" << endl; + fStrm << " Group = Instrument" << endl; + fStrm << " SpacecraftId = TGO" << endl; + fStrm << " ExposureDuration = 1.920e-003 " << endl; + fStrm << " InstrumentId = CaSSIS" << endl; + fStrm << " Filter = NIR" << endl; + fStrm << " EndGroup" << endl; + fStrm << "EndObject" << endl; + + fStrm << "End" << endl; + Pvl fLabel; + fStrm >> fLabel; + + ofstream trnsStrm; + trnsStrm.open ("temp.trn"); + trnsStrm << "Group = Samples" << endl; + trnsStrm << " Auto" << endl; + trnsStrm << " InputKey = Samples" <toString() << endl; + cout << endl; + } + catch(IException &e) { + e.print(); + } + } + catch(IException &e) { + e.print(); + } + remove("temp.trn"); +} diff --git a/isis/src/base/objs/PvlToken/Makefile b/isis/src/base/objs/PvlToken/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/PvlToken/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/core/src/PvlToken.cpp b/isis/src/base/objs/PvlToken/PvlToken.cpp similarity index 100% rename from isis/src/core/src/PvlToken.cpp rename to isis/src/base/objs/PvlToken/PvlToken.cpp diff --git a/isis/src/core/include/PvlToken.h b/isis/src/base/objs/PvlToken/PvlToken.h similarity index 100% rename from isis/src/core/include/PvlToken.h rename to isis/src/base/objs/PvlToken/PvlToken.h diff --git a/isis/src/base/objs/PvlToken/PvlToken.truth b/isis/src/base/objs/PvlToken/PvlToken.truth new file mode 100644 index 0000000000..dc2e6309a8 --- /dev/null +++ b/isis/src/base/objs/PvlToken/PvlToken.truth @@ -0,0 +1,18 @@ +Info on dog + key: Dog + upperkey: DOG + valuesize: 1 + value: drools + uppervalue: DROOLS + +Adding another value to dog + valuesize: 2 + value: wags tail + uppervalue: WAGS TAIL + +Clearing dog values + valuesize: 0 + +Testing Throws in dog +**PROGRAMMER ERROR** Array subscript [-1] is out of array bounds. +**PROGRAMMER ERROR** Array subscript [1] is out of array bounds. diff --git a/isis/src/base/objs/PvlToken/unitTest.cpp b/isis/src/base/objs/PvlToken/unitTest.cpp new file mode 100644 index 0000000000..1c8fc0512f --- /dev/null +++ b/isis/src/base/objs/PvlToken/unitTest.cpp @@ -0,0 +1,52 @@ +#include +#include "PvlToken.h" +#include "IException.h" +#include "Preference.h" + +using namespace Isis; +using namespace std; + +int main(int argc, char *argv[]) { + Preference::Preferences(true); + + PvlToken dog("Dog"); + dog.addValue("drools"); + + cout << "Info on dog" << endl; + cout << " key: " << dog.key() << endl; + cout << " upperkey: " << dog.keyUpper() << endl; + cout << " valuesize: " << dog.valueSize() << endl; + cout << " value: " << dog.value() << endl; + cout << " uppervalue: " << dog.valueUpper() << endl; + cout << endl; + + cout << "Adding another value to dog" << endl; + dog.addValue("wags tail"); + cout << " valuesize: " << dog.valueSize() << endl; + cout << " value: " << dog.value(1) << endl; + cout << " uppervalue: " << dog.valueUpper(1) << endl; + cout << endl; + + cout << "Clearing dog values" << endl; + dog.valueClear(); + cout << " valuesize: " << dog.valueSize() << endl; + cout << endl; + + cout << "Testing Throws in dog" << endl; + + try { + dog.value(-1); + } + catch(IException &e) { + e.print(); + } + + try { + dog.value(1); + } + catch(IException &e) { + e.print(); + } + + return 0; +} diff --git a/isis/src/base/objs/PvlTokenizer/Makefile b/isis/src/base/objs/PvlTokenizer/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/PvlTokenizer/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/core/src/PvlTokenizer.cpp b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp similarity index 100% rename from isis/src/core/src/PvlTokenizer.cpp rename to isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp diff --git a/isis/src/core/include/PvlTokenizer.h b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.h similarity index 100% rename from isis/src/core/include/PvlTokenizer.h rename to isis/src/base/objs/PvlTokenizer/PvlTokenizer.h diff --git a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.truth b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.truth new file mode 100644 index 0000000000..2153019f8b --- /dev/null +++ b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.truth @@ -0,0 +1,44 @@ +TESTING TOKENIZER +DOG is POODLE +CAT is TABBY +BIRD is PARROT +REPTILE is SNAKE LIZARD +-VEGGIE is +BOVINE is COW CAMEL +TREE is MAPLE ELM PINE +_COMMENT_ is # This is a comment +FLOWER is DAISY & TULIP +_COMMENT_ is /* This is another comment +BIG is NOT REALLY LARGE +SEQUENCE is (a,b,c) (d,e,f) +QUOTED_STRING is A QUOTED STRING +QuotedNewLine is abcdefgh ijk lmn +ApostNewLine is abcdefgh ijk lmn + +TESTING TOKENIZER CLEAR +0 + +TESTING TOKEN ERROR [PHRASE = "The quick brown fox jumped over the lazy dog] +**ERROR** Keyword [PHRASE] has bad value. +**ERROR** Missing delimiter ["] at or near [The quick brown fox ...]. + +TESTING TOKEN ERROR [PHRASE = {To Be or Not To Be That is the Question] +**ERROR** Keyword [PHRASE] has bad value. +**ERROR** Missing delimiter [}] at or near [To Be or Not To Be T ...]. + +TESTING TOKEN ERROR [PHRASE = (I came, I saw, I conquered] +**ERROR** Keyword [PHRASE] has bad value. +**ERROR** Missing delimiter [)] at or near [I came, I saw, I con ...]. + +TESTING TOKEN ERROR [FOOD = ("french","fries,"good") ] +**ERROR** Keyword [FOOD] has bad value. +**ERROR** Missing delimiter ["] at or near ["french","fries,"goo ...]. + +TESTING TOKEN ERROR [FOOD = ("burgers","hotdogs,"good")] +**ERROR** Keyword [FOOD] has bad value. +**ERROR** Missing delimiter ["] at or near ["burgers","hotdogs," ...]. + +TESTING TOKEN ERROR [FOOD = ("pickels,pizza")] + +TESTING TOKEN ERROR [FISH = ("trout","pizz"a)] + diff --git a/isis/src/base/objs/PvlTokenizer/unitTest.cpp b/isis/src/base/objs/PvlTokenizer/unitTest.cpp new file mode 100644 index 0000000000..94d1377738 --- /dev/null +++ b/isis/src/base/objs/PvlTokenizer/unitTest.cpp @@ -0,0 +1,144 @@ +#include +#include "PvlToken.h" +#include "PvlTokenizer.h" +#include "IException.h" +#include "Preference.h" + +using namespace Isis; +using namespace std; + +int main(void) { + Preference::Preferences(true); + +//***************************************************************************** +// Create Instances of the Tokenizer +//***************************************************************************** + + PvlTokenizer tizer; + +//***************************************************************************** +// Create a stream and load it +//***************************************************************************** + + stringstream os; + os << "DOG=POODLE " + << "CAT=\"TABBY\" " + << "BIRD=(PARROT) \0" + << "REPTILE={SNAKE,LIZARD} \t" + << "-VEGGIE \n" + << " " + << " BOVINE = ( COW , CAMEL ) \n " + << "TREE = { \"MAPLE\" ,\n \"ELM\" \n, \"PINE\" }" + << "FLOWER = \"DAISY & \nTULIP \"" + << "# This is a comment\n" + << "/* This is another comment\n" + << "BIG = (\" NOT \",\"REALLY LARGE\")\n" + << "SEQUENCE = ((a,b,c), (d,e,f))" + << "QUOTED_STRING=\"A QUOTED STRING\"" + << "QuotedNewLine=\"abcd\nefgh \nijk\n lmn\"" + << "ApostNewLine=\'abcd\nefgh \nijk\n lmn\'"; + + try { + tizer.Load(os); + } + catch(IException &e) { + e.print(); + } + + vector t = tizer.GetTokenList(); + + cout << "TESTING TOKENIZER" << endl; + int i, j; + for(i = 0; i < (int)t.size(); i++) { + cout << t[i].key() << " is "; + for(j = 0; j < t[i].valueSize(); j++) { + cout << t[i].value(j) << " "; + } + cout << endl; + } + cout << endl; + + cout << "TESTING TOKENIZER CLEAR" << endl; + tizer.Clear(); + vector t2 = tizer.GetTokenList(); + cout << t2.size() << endl << endl; + + stringstream os2; + os2 << "PHRASE = \"The quick brown fox jumped over the lazy dog"; + cout << "TESTING TOKEN ERROR [" << os2.str() << "]" << endl; + try { + tizer.Load(os2); + } + catch(IException &e) { + e.print(); + } + cout << endl; + + stringstream os3; + os3 << "PHRASE = {To Be or Not To Be That is the Question"; + cout << "TESTING TOKEN ERROR [" << os3.str() << "]" << endl; + try { + tizer.Load(os3); + } + catch(IException &e) { + e.print(); + } + cout << endl; + + stringstream os4; + os4 << "PHRASE = (I came, I saw, I conquered"; + cout << "TESTING TOKEN ERROR [" << os4.str() << "]" << endl; + try { + tizer.Load(os4); + } + catch(IException &e) { + e.print(); + } + cout << endl; + + stringstream os5; + os5 << "FOOD = (\"french\",\"fries,\"good\") "; + cout << "TESTING TOKEN ERROR [" << os5.str() << "]" << endl; + try { + tizer.Load(os5); + } + catch(IException &e) { + e.print(); + } + cout << endl; + + stringstream os6; + os6 << "FOOD = (\"burgers\",\"hotdogs,\"good\")"; + cout << "TESTING TOKEN ERROR [" << os6.str() << "]" << endl; + try { + tizer.Load(os6); + } + catch(IException &e) { + e.print(); + } + cout << endl; + + stringstream os7; + os7 << "FOOD = (\"pickels,pizza\")"; + cout << "TESTING TOKEN ERROR [" << os7.str() << "]" << endl; + try { + tizer.Load(os7); + } + catch(IException &e) { + e.print(); + } + cout << endl; + + stringstream os8; + os8 << "FISH = (\"trout\",\"pizz\"a)"; + cout << "TESTING TOKEN ERROR [" << os8.str() << "]" << endl; + try { + tizer.Load(os8); + } + catch(IException &e) { + e.print(); + } + cout << endl; + + return 0; +} diff --git a/isis/src/base/objs/PvlTranslationTable/Makefile b/isis/src/base/objs/PvlTranslationTable/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/PvlTranslationTable/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/core/src/PvlTranslationTable.cpp b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp similarity index 100% rename from isis/src/core/src/PvlTranslationTable.cpp rename to isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp diff --git a/isis/src/core/include/PvlTranslationTable.h b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.h similarity index 100% rename from isis/src/core/include/PvlTranslationTable.h rename to isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.h diff --git a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.truth b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.truth new file mode 100644 index 0000000000..9b72235ee1 --- /dev/null +++ b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.truth @@ -0,0 +1,43 @@ +Unit test for Isis::PvlTranslationTable + + Test InputGroup : + InputGroup ("DataFileName") = ROOT + InputGroup ("CoreLines") = IMAGE + **PROGRAMMER ERROR** Unable to find translation group [tttt1] in file []. + + Test InputKey : + InputKeywordName ("DataFileName") = ^IMAGE + InputKeywordName ("CoreLines") = LINES + **PROGRAMMER ERROR** Unable to find translation group [tttt2] in file []. + + Test InputDefault : + InputDefault ("DataFileName") = + InputDefault ("CoreBitsPerPixel") = 8 + **PROGRAMMER ERROR** Unable to find translation group [tttt3] in file []. + + Test Translate : + Translate ("DataFileName", "tttt4") = tttt4 + Translate ("CoreByteOrder","MSB_INTEGER") = BigEndian + Translate ("CorePixelType") = Integer + Translate ("CorePixelType") = Unknown + **PROGRAMMER ERROR** Unable to find translation group [tttt6] in file []. + **PROGRAMMER ERROR** No value or default value to translate for translation group [DataFileRecordBytes] in file []. + **PROGRAMMER ERROR** Unable to find a translation value for [CoreBitsPerPixel, 31] in file []. + + Test AddTable : + Translate ("CoreLinePrefixBytes", "128") = 128 + + Test IsAuto : + IsAuto ("DataFileName") = 0 + IsAuto ("CoreBitsPerPixel") = 1 + + Test IsOptional : + IsAuto ("DataFileName") = 0 + IsAuto ("CoreBitsPerPixel") = 1 + + Test OutputPosition : + OutputPosition ("CoreBitsPerPixel") yields : OutputPosition = (Object, IsisCube, Object, Core, Group, Pixels) + + Test OutputName : + OutputName ("CoreBitsPerPixel") = BitsPerPixel + diff --git a/isis/src/base/objs/PvlTranslationTable/unitTest.cpp b/isis/src/base/objs/PvlTranslationTable/unitTest.cpp new file mode 100644 index 0000000000..9ea68d514c --- /dev/null +++ b/isis/src/base/objs/PvlTranslationTable/unitTest.cpp @@ -0,0 +1,226 @@ +#include +#include "PvlTranslationTable.h" +#include "Preference.h" +#include "IException.h" +#include "IString.h" +#include "Preference.h" + +using namespace std; +using namespace Isis; + +int main(void) { + Preference::Preferences(true); + + try { + stringstream in; + in << "Group = DataFileName" << endl; + in << " InputPosition = ROOT" << endl; + in << " InputKey = ^IMAGE" << endl; + in << " Translation = (*,*)" << endl; + in << "EndGroup" << endl; + in << "Group = DataFileRecordBytes" << endl; + in << " InputKey = RECORD_BYTES" << endl; + in << " Translation = (*,*)" << endl; + in << "EndGroup" << endl; + in << "Group = CoreLines" << endl; + in << " InputPosition = IMAGE" << endl; + in << " InputKey = LINES" << endl; + in << " Translation = (*,*)" << endl; + in << "EndGroup" << endl; + in << "Group = CoreBitsPerPixel" << endl; + in << " Auto" << endl; + in << " OutputName = BitsPerPixel" << endl; + in << " OutputPosition = (\"Object\",\"IsisCube\", \"Object\",\"Core\","; + in << "\"Group\",\"Pixels\")" << endl; + in << " InputPosition = IMAGE" << endl; + in << " InputKey = SAMPLE_BITS" << endl; + in << " InputDefault = 8" << endl; + in << " Translation = (8,8)" << endl; + in << " Translation = (16,16)" << endl; + in << " Translation = (32,32)" << endl; + in << "EndGroup" << endl; + in << "Group = CorePixelType" << endl; + in << " InputPosition = IMAGE" << endl; + in << " InputKey = SAMPLE_TYPE" << endl; + in << " InputDefault = LSB_INTEGER" << endl; + in << " Translation = (Integer,LSB_INTEGER)" << endl; + in << " Translation = (Integer,MSB_INTEGER)" << endl; + in << " Translation = (Integer,PC_INTEGER)" << endl; + in << " Translation = (Integer,MAC_INTEGER)" << endl; + in << " Translation = (Integer,SUN_INTEGER)" << endl; + in << " Translation = (Natural,UNSIGNED_INTEGER)" << endl; + in << " Translation = (Unknown,*)" << endl; + in << "EndGroup" << endl; + in << "Group = CoreByteOrder" << endl; + in << " InputPosition = IMAGE" << endl; + in << " InputKey = SAMPLE_TYPE" << endl; + in << " InputDefault = LSB_INTEGER" << endl; + in << " Translation = (LittleEndian,LSB_INTEGER)" << endl; + in << " Translation = (BigEndian,MSB_INTEGER)" << endl; + in << " Translation = (LittleEndian,PC_INTEGER)" << endl; + in << " Translation = (BigEndian,MAC_INTEGER)" << endl; + in << " Translation = (BigEndian,SUN_INTEGER)" << endl; + in << " Translation = (LittleEndian,UNSIGNED_INTEGER)" << endl; + in << "EndGroup" << endl; + in << "End" << endl; + + PvlTranslationTable table(in); + + string group, key; + + cout << "Unit test for Isis::PvlTranslationTable" << endl << endl; + + cout << " Test InputGroup :" << endl; + + cout << " InputGroup (\"DataFileName\") = " << + table.InputGroup("DataFileName")[0] << endl; + cout << " InputGroup (\"CoreLines\") = " << + table.InputGroup("CoreLines")[0] << endl; + try { + table.InputGroup("tttt1"); + } + catch(IException &e) { + cerr << " "; + e.print(); + cerr << endl; + } + + cout << " Test InputKey :" << endl; + + cout << " InputKeywordName (\"DataFileName\") = " << + table.InputKeywordName("DataFileName") << endl; + cout << " InputKeywordName (\"CoreLines\") = " << + table.InputKeywordName("CoreLines") << endl; + try { + table.InputKeywordName("tttt2"); + } + catch(IException &e) { + cerr << " "; + e.print(); + cerr << endl; + } + + cout << " Test InputDefault :" << endl; + + cout << " InputDefault (\"DataFileName\") = " << + table.InputDefault("DataFileName") << endl; + cout << " InputDefault (\"CoreBitsPerPixel\") = " << + table.InputDefault("CoreBitsPerPixel") << endl; + try { + table.InputDefault("tttt3"); + } + catch(IException &e) { + cerr << " "; + e.print(); + cerr << endl; + } + + cout << " Test Translate :" << endl; + + cout << " Translate (\"DataFileName\", \"tttt4\") = " << + table.Translate("DataFileName", "tttt4") << endl; + cout << " Translate (\"CoreByteOrder\",\"MSB_INTEGER\") = " << + table.Translate("CoreByteOrder", "MSB_INTEGER") << endl; + cout << " Translate (\"CorePixelType\") = " << + table.Translate("CorePixelType") << endl; + cout << " Translate (\"CorePixelType\") = " << + table.Translate("CorePixelType", "baddata") << endl; + try { + table.Translate("tttt6"); + } + catch(IException &e) { + cerr << " "; + e.print(); + } + + try { + table.Translate("DataFileRecordBytes"); + } + catch(IException &e) { + cerr << " "; + e.print(); + } + + try { + table.Translate("CoreBitsPerPixel", "31"); + } + catch(Isis::IException &e) { + cerr << " "; + e.print(); + cerr << endl; + } + + cout << " Test AddTable :" << endl; + + in.clear(); + in << "Group = CoreLineSuffixBytes" << endl; + in << " InputKey = LINE_SUFFIX_BYTES" << endl; + in << " Translation = (*,*)" << endl; + in << "EndGroup" << endl; + in << "Group = CoreLinePrefixBytes" << endl; + in << " InputKey = LINE_PREFIX_BYTES" << endl; + in << " Translation = (*,*)" << endl; + in << "EndGroup" << endl; + table.AddTable(in); + + cout << " Translate (\"CoreLinePrefixBytes\", \"128\") = " << + table.Translate("CoreLinePrefixBytes", "128") << endl << endl; + + + class protectedTester : public Isis::PvlTranslationTable { + public: + void tester() { + stringstream in2; + in2 << "Group = DataFileName" << endl; + in2 << " InputKey = ^IMAGE" << endl; + in2 << " Translation = (*,*)" << endl; + in2 << "EndGroup" << endl; + in2 << "Group = CoreBitsPerPixel" << endl; + in2 << " Auto" << endl; + in2 << " Optional" << endl; + in2 << " OutputName = BitsPerPixel" << endl; + in2 << " OutputPosition = (\"Object\",\"IsisCube\", \"Object\",\"Core\","; + in2 << "\"Group\",\"Pixels\")" << endl; + in2 << " InputGroup = IMAGE" << endl; + in2 << " InputKey = SAMPLE_BITS" << endl; + in2 << " InputDefault = 8" << endl; + in2 << " Translation = (8,8)" << endl; + in2 << " Translation = (16,16)" << endl; + in2 << " Translation = (32,32)" << endl; + in2 << "EndGroup" << endl; + in2 << "End" << endl; + + AddTable(in2); + + cout << " Test IsAuto :" << endl; + cout << " IsAuto (\"DataFileName\") = " << + IsAuto("DataFileName") << endl; + cout << " IsAuto (\"CoreBitsPerPixel\") = " << + IsAuto("CoreBitsPerPixel") << endl << endl; + + cout << " Test IsOptional :" << endl; + cout << " IsAuto (\"DataFileName\") = " << + IsOptional("DataFileName") << endl; + cout << " IsAuto (\"CoreBitsPerPixel\") = " << + IsOptional("CoreBitsPerPixel") << endl << endl; + + cout << " Test OutputPosition :" << endl; + cout << " OutputPosition (\"CoreBitsPerPixel\") yields : " << + OutputPosition("CoreBitsPerPixel") << endl << endl; + + cout << " Test OutputName :" << endl; + cout << " OutputName (\"CoreBitsPerPixel\") = " << + OutputName("CoreBitsPerPixel") << endl << endl; + + }; + }; + protectedTester t; + t.tester(); + + } + catch(IException &e) { + e.print(); + } + + return 0; +} diff --git a/isis/src/base/objs/TextFile/Makefile b/isis/src/base/objs/TextFile/Makefile new file mode 100644 index 0000000000..f122bc8822 --- /dev/null +++ b/isis/src/base/objs/TextFile/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.objs +endif \ No newline at end of file diff --git a/isis/src/core/src/TextFile.cpp b/isis/src/base/objs/TextFile/TextFile.cpp similarity index 100% rename from isis/src/core/src/TextFile.cpp rename to isis/src/base/objs/TextFile/TextFile.cpp diff --git a/isis/src/core/include/TextFile.h b/isis/src/base/objs/TextFile/TextFile.h similarity index 100% rename from isis/src/core/include/TextFile.h rename to isis/src/base/objs/TextFile/TextFile.h diff --git a/isis/src/base/objs/TextFile/TextFile.truth b/isis/src/base/objs/TextFile/TextFile.truth new file mode 100644 index 0000000000..d4ff128052 --- /dev/null +++ b/isis/src/base/objs/TextFile/TextFile.truth @@ -0,0 +1,43 @@ +Unit test for TextFile + +1) Create / Overwrite file $temporary/TextFile.tmp with prefilled vector + +2) Read file $temporary/TextFile.tmp into vector + +3) Create / Overwrite file $temporary/TextFile.tmp with prefilled QString array + +4) Read file $temporary/TextFile.tmp into QString array + +5) Overwrite file $temporary/TextFile.tmp + +6) Overwrite file and write 6 lines $temporary/TextFile.tmp + +7) Append 6 lines to file $temporary/TextFile.tmp + +8) Input (read) file $temporary/TextFile.tmp + +10) Trigger Error messages + a) Try to open non-existent file +**I/O ERROR** TextFile:Open:-> Unable to open: [Input]:[./NoSuchDir/TextFile.tmp]. + + b) Try open as output to pre-existing file +**I/O ERROR** TextFile:Open: -> Output file already exists [Output]:[./TextFile.tmp]. + + c) Open file with bad open mode +**PROGRAMMER ERROR** TextFile::-> Unknown openmode: (input, output, overwrite, append):[xxxInputxxx]:[./TextFile.tmp]. + + d) Try to write to Input - Read Only file +**PROGRAMMER ERROR** TextFile:PutLine: -> Attempt to write to INPUT - Read Only text file: [./TextFile.tmp]. + + e) Try to Write to a closed file +**PROGRAMMER ERROR** TextFile::-> File not open: [./TextFile.tmp]. + + f) Try to Read from a closed file +**PROGRAMMER ERROR** TextFile::-> File not open: [./TextFile.tmp]. + +testing GetLine for files that do not end in a newline: Passed + +this file has no newline chars in it! + +11) Remove temp file -> $temporary/TextFile.tmp <- + diff --git a/isis/src/base/objs/TextFile/unitTest.cpp b/isis/src/base/objs/TextFile/unitTest.cpp new file mode 100644 index 0000000000..cf0fb14860 --- /dev/null +++ b/isis/src/base/objs/TextFile/unitTest.cpp @@ -0,0 +1,541 @@ +#include "TextFile.h" +#include "FileName.h" +#include "IException.h" +#include "IString.h" +#include "Preference.h" +#include +#include +#include + +using namespace std; +using namespace Isis; + +int main(int argc, char *argv[]) { + Isis::Preference::Preferences(true); + void ReportError(QString err); + + cout << "Unit test for TextFile" << endl << endl; + + +// ---------------------------------------------------------------------------------- + + QString testFile = "$temporary/TextFile.tmp"; + // setup test data + QString testLines[21]; + + // setup line test data + testLines[0] = "# 0 zero line"; + testLines[1] = "# 1 first line"; + testLines[2] = "# 2 second line"; + testLines[3] = " #3 third line"; + testLines[4] = "/# 4 fourth line"; + testLines[5] = ""; + testLines[6] = "#"; + testLines[7] = "// 7 seventh line"; + testLines[8] = "// 8 eighth line"; + testLines[9] = "/* 9 ninth line"; + testLines[10] = "/* 10 tenth line"; + testLines[11] = "/* 11 eleventh line"; + testLines[12] = "/* 12 twelfth line"; + testLines[13] = " 1 replacement"; + testLines[14] = " 2 replacement"; + testLines[15] = " 3 replacement"; + testLines[16] = " even line replace"; + testLines[17] = ""; + testLines[18] = ""; + testLines[19] = ""; + testLines[20] = "\0"; + + + // calc cumulative byte counts for each line - to check TextFile.Size() + + streamsize testLineBytes[21]; + streamsize numBytes = 0; + streamsize numBytesFiltered = 0; + + vector testLinesVector; + + for(int i = 0; i <= 19; i++) { + numBytes += testLines[i].length() + strlen("\n"); + testLineBytes[i] = numBytes; + testLinesVector.push_back(testLines[i]); + int locComment = testLines[i].indexOf("#", 0); + if((locComment != -1) && (locComment != 1)) { + numBytesFiltered += testLines[i].length() + strlen("\n"); + } + } + + numBytesFiltered = numBytes - numBytesFiltered; + + +// ---------------------------------------------------------------------------------- + + cout << "1) Create / Overwrite file " << testFile << " with prefilled vector" << endl; + + try { + Isis::TextFile p(testFile, "overwrite", testLinesVector); // write file + + if(p.Size() != numBytes) { // test file size + cout << " *** Failed Size Test WRITE *** " << endl; + cout << "Calc bytes = " << numBytes << " methodSize = " + << p.Size() << endl; + } + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + +// ---------------------------------------------------------------------------------- + + cout << "2) Read file " << testFile << " into vector" << endl; + + try { + vector linesIn; + + // read entire file, filter comments + Isis::TextFile g(testFile, "input", linesIn); + + int chkVectorSize = 0; // chk num bytes read + for(int i = 0; i < (int) linesIn.size(); i++) { + chkVectorSize += QString(linesIn[i]).length() + strlen("\n"); + } + if(chkVectorSize != numBytesFiltered) { + cout << " *** Failed Size Test Filtered *** " << endl; + cout << "Calc bytes = " << numBytesFiltered << " Vector Size = " + << chkVectorSize << endl; + } + g.Close(); + + linesIn.erase(linesIn.begin(), linesIn.end()); + + // read entire file, do not filter comments + Isis::TextFile g2(testFile, "input", linesIn, 0, false); + + if(g2.Size() != numBytes) { // chk num bytes read + cout << " *** Failed Size Test READ *** " << endl; + cout << "Calc bytes = " << numBytes << " methodSize = " + << g2.Size() << endl; + } + + for(int i = 0; i <= 19; i++) { // compare data read to orig data + if(linesIn[i] != testLines[i]) { + cout << " *** Failed IString Comparison Test *** " << endl; + cout << i + << " Original IString =>" << testLines[i] + << "<= Vector read =>" << linesIn[i] + << "<=" << endl; + } + } + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + +// ---------------------------------------------------------------------------------- + + cout << "3) Create / Overwrite file " << testFile << " with prefilled QString array" << endl; + + try { + // write first four lines + Isis::TextFile p(testFile, "overwrite", testLines, 4); + + if(p.Size() != testLineBytes[4]) { // chk num bytes + cout << " *** Failed Size Test WRITE sense NULL in QString array*** " << endl; + cout << "Calc bytes = " << testLineBytes[4] << " methodSize = " + << p.Size() << endl; + } + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + +// ---------------------------------------------------------------------------------- + + cout << "4) Read file " << testFile << " into QString array" << endl; + + try { + // prefill QString array to nonnull, set last element to null + // the read file call below will not specify howmany lines to read + // so TextFile will stop filling QString array when it encounters a null in output array + + QString linesIn[4] = {" ", " ", " ", ""}; + + Isis::TextFile g(testFile, "input", linesIn, 0, false); // read entire file unfiltered + + for(int i = 0; i <= 2; i++) { // chk orig data against data read + if(linesIn[i] != testLines[i]) { + cout << " *** Failed Compare Test READ sense NULL in QString array*** " << endl; + break; + } + } + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + +// ---------------------------------------------------------------------------------- + + cout << "5) Overwrite file " << testFile << endl; + + try { // open file, will truncate + Isis::TextFile f(testFile, "OverWrite"); + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + +// ---------------------------------------------------------------------------------- + + cout << "6) Overwrite file and write 6 lines $temporary/TextFile.tmp" << endl; + + try { + Isis::TextFile f(testFile, "OverWrite"); // open overwrite + + f.SetNewLine(""); // turn off append new line + f.SetComment(""); // turn off comment character + + f.PutLine("# 0 zero line\n"); // char output + + f.SetNewLine(); // reset default append new line + f.SetComment(); // reset default comment QString + + f.PutLineComment(" 1 first line"); // char output + f.PutLineComment(" 2 second line"); // char output + + f.PutLine(testLines[3]); + // line count + if(f.LineCount() != 4) { + cout << " *** Failed Line Count = 4 *** " << endl; + cout << " methodLineCount = " << f.LineCount() << endl; + } + // byte count + if(f.Size() != testLineBytes[3]) { + cout << " *** Failed Size Test After Line 4 *** " << endl; + cout << "Calc bytes = " << testLineBytes[3] << " methodSize = " + << f.Size() << endl; + } + + f.PutLine(testLines[4]); + + f.PutLine(); // output blank line + + if(f.LineCount() != 6) { // line count + cout << " *** Failed Line Count = 6 *** " << endl; + cout << " methodLineCount = " << f.LineCount() << endl; + } + + f.PutLineComment(); // output blank comment line + + if(f.Size() != testLineBytes[6]) { // byte count + cout << " *** Failed Size Test After Line 7 *** " << endl; + cout << "Calc bytes = " << testLineBytes[6] << " methodSize = " + << f.Size() << endl; + } + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + +// ---------------------------------------------------------------------------------- + + cout << "7) Append 6 lines to file $temporary/TextFile.tmp" << endl; + + try { + Isis::TextFile f(testFile, "Append"); + // append lines 7 & 8 + f.PutLine(testLines[7]); + f.PutLine(testLines[8]); + + if(f.LineCount() != 9) { // line count + cout << " *** Failed Line Count = 9 *** " << endl; + cout << " methodLineCount = " << f.LineCount() << endl; + } + + if(f.Size() != testLineBytes[8]) { // byte count + cout << " *** Failed Size Test After Line 9 *** " << endl; + cout << "Calc bytes = " << testLineBytes[8] << " methodSize = " + << f.Size() << endl; + } + + f.PutLine(testLines[9]); // append line 9 + + if(f.Size() != testLineBytes[9]) { // byte count + cout << " *** Failed Size Test After Line 9 *** " << endl; + cout << "Calc bytes = " << testLineBytes[9] << " methodSize = " + << f.Size() << endl; + } + + for(int i = 10; i <= 12; i++) { // append lines 10 -> 12 + f.PutLine(testLines[i]); + } + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + +// ---------------------------------------------------------------------------------- + + cout << "8) Input (read) file $temporary/TextFile.tmp" << endl; + + try { + Isis::TextFile f(testFile, "Input"); + + QString line; + + for(int i = 0; i <= 12; i++) { // chk each file line against internal array + f.GetLineNoFilter(line); + if(line != testLines[i]) { + cout << " *** Failed Compare Input Array Line: " << i << " *** " << endl; + } + } + + f.Rewind(); // set input ptr back to beginning + f.SetComment(); // set comment chk, default is '#' + + f.GetLine(line); + // first 3 lines are commented + // so should return fourth line + if(line != testLines[4]) { + cout << " *** Failed Ignore comment lines *** " << endl; + cout << "should be: =>" << testLines[4] << "<=" << endl; + cout << "returned is: =>" << line << "<=" << endl; + } + if(f.LineCount() != 13) { // total line count should be 12 + cout << " *** Failed Line Count = 13 *** " << endl; + cout << " methodLineCount = " << f.LineCount() << endl; + } + + if(f.Size() != testLineBytes[12]) { // byte count + cout << " *** Failed Size Test with Lines = 12 *** " << endl; + cout << "Calc bytes = " << testLineBytes[12] << " methodSize = " + << f.Size() << endl; + } + + f.Rewind(); // set input ptr back to beginning + f.SetComment("/*"); // set comment to '/*' + + QString lastLine; + + while(f.GetLine(line)) { // read file's 12 lines + lastLine = line; + } + if(lastLine != testLines[8]) { // line 8 was last non '/*' line read + cout << " *** Failed To see last 4 lines as comments *** " << endl; + } + + f.Rewind(); // set input ptr back to beginning + f.SetComment(); // set comment to default # + f.GetLineNoFilter(line); // should return line 1 + if(line != testLines[0]) { + cout << " *** Failed Read Do Not Skip Comment lines *** " << endl; + } + + f.Rewind(); // reset input ptr to beginning + while(f.GetLine(line)) { // read file's 12 lines + lastLine = line; + } + if(lastLine != testLines[12]) { // line 12 does not begin with '#' + cout << " *** Failed Read to end of file *** " << endl; + } + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + +#if 0 +// Jeff Anderson removed this test. It seems strange that you would want +// to open a file for append and then rewind it. This test used to pass +// but didn't when we went to a newer operating system. Again saying +// you want to open append and then rewind is lame. +// ---------------------------------------------------------------------------------- + + cout << "9) Replace Lines and Verify Replacement in $temporary/TextFile.tmp" << endl; + + + try { + Isis::TextFile f(testFile, "Append"); + + // although opened append, + f.Rewind(); // can set ptr to beginning + + for(int i = 1; i <= 3; i++) { + f.PutLine(testLines[i+12]); // replace lines 1 to 3 + } + + f.Rewind(); // set ptr back to begining + + QString(line); + // re-read file to line 3 + for(int i = 1; i <= 3; i++) { // to chk replacement + f.GetLineNoFilter(line); + if(line != testLines[i+12]) { + cout << " *** Failed Read Replaced line: " << i << " *** " << endl; + } + } + + f.Rewind(); // set ptr back to begining + + // replace even lines + for(int i = 1; i <= 6; i++) { + f.GetLineNoFilter(); // moves ptr to next line + f.PutLine(testLines[16]); // replaces line + } + + f.Rewind(); // set ptr back to begining + + // re-read file to line 2 + for(int i = 1; i <= 2; i++) { + f.GetLineNoFilter(line); + } // chk line 2 was replaced + if(line != testLines[16]) { + cout << " *** Failed Read Replaced lines *** " << endl; + } + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + +// ---------------------------------------------------------------------------------- +#endif + + cout << "10) Trigger Error messages" << endl; + + cout << " a) Try to open non-existent file" << endl; + + testFile = "$temporary/NoSuchDir/TextFile.tmp"; + + try { + Isis::TextFile f(testFile, "Input"); + } + catch(Isis::IException &e) { + ReportError(e.toString()); + } + cout << endl; + + + cout << " b) Try open as output to pre-existing file" << endl; + + testFile = "$temporary/TextFile.tmp"; + + try { + Isis::TextFile f(testFile, "Output"); + } + catch(Isis::IException &e) { + ReportError(e.toString()); + } + cout << endl; + + + cout << " c) Open file with bad open mode" << endl; + + try { + Isis::TextFile fxText(testFile, "xxxInputxxx"); + } + catch(Isis::IException &e) { + ReportError(e.toString()); + } + cout << endl; + + + cout << " d) Try to write to Input - Read Only file" << endl; + + try { + Isis::TextFile f(testFile, "Input"); + f.PutLine("Line 1"); + } + catch(Isis::IException &e) { + ReportError(e.toString()); + } + cout << endl; + + + cout << " e) Try to Write to a closed file" << endl; + + try { + Isis::TextFile f(testFile, "append"); + f.Close(); + f.PutLine("Line 1"); + } + catch(Isis::IException &e) { + ReportError(e.toString()); + } + cout << endl; + + + cout << " f) Try to Read from a closed file" << endl; + + try { + Isis::TextFile f(testFile, "input"); + f.Close(); + f.GetLine(); + } + catch(Isis::IException &e) { + ReportError(e.toString()); + } + cout << endl; + + // create file that doesn't end in a newline and then test GetLine + FILE *fp; + FileName testFileName(testFile); + fp = fopen(testFileName.expanded().toLatin1().data(), "w"); + fprintf(fp, "this file has no newline chars in it!"); //???SEG FAULT HERE!!!!!!! + fclose(fp); + TextFile tf; + tf.Open(testFile); + + QString fileContents = ""; + QString line = ""; + while(tf.GetLine(line, true)) { + fileContents += line; + line = ""; + } + + // this is the real test - line shouldn't be wiped even though tf.GetLine's + // call to getline returned false. + fileContents += line; + + QString passed = "Failed"; + if(fileContents != "") + passed = "Passed"; + + cout << "testing GetLine for files that do not end in a newline: " << passed << "\n\n"; + cout << fileContents << "\n\n"; + + +// ---------------------------------------------------------------------------------- + + cout << "11) Remove temp file -> " << testFile << " <-\n" << endl; + + if(std::remove(testFileName.expanded().toLatin1().data())) { // cleanup tmp file + cout << "*** Failed to remove tmp file: " << testFile << endl; + } +} + +/** + * Reports error messages from Isis:iException without full paths of filenames + * @param err Error QString of iException + * @author Jeannie Walldren + * @internal + * @history 2011-08-05 Jeannie Backer - Copied from Cube class. + */ +void ReportError(QString err) { + cout << err.replace(QRegExp("\\[[^\\]*\\]"), "[]") << endl; +} + diff --git a/isis/src/base/objs/UserInterface/UserInterface.h b/isis/src/base/objs/UserInterface/UserInterface.h index 9f33680fe6..0949788ba3 100644 --- a/isis/src/base/objs/UserInterface/UserInterface.h +++ b/isis/src/base/objs/UserInterface/UserInterface.h @@ -8,7 +8,6 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "Gui.h" #include "IsisAml.h" -#include "PvlTokenizer.h" class Gui; @@ -210,7 +209,7 @@ namespace Isis { private: void loadBatchList(const QString file); void loadCommandLine(QVector &args, bool ignoreAppName=true); - + void loadCommandLine(int argc, char *argv[]); void loadHistory(const QString file); diff --git a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.h b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.h index 714946d7e2..74df1270d3 100644 --- a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.h +++ b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.h @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include #include "FileName.h" -#include "PvlTokenizer.h" namespace Isis { class Pvl; diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 65f3cd14cb..7eca141ff6 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -34,25 +34,17 @@ set(Pvl_source_files ${PROJECT_SOURCE_DIR}/src/ArraySubscriptNotInRange.cpp ${PROJECT_SOURCE_DIR}/src/KeywordValueExpected.cpp ${PROJECT_SOURCE_DIR}/src/KeywordValueNotInList.cpp ${PROJECT_SOURCE_DIR}/src/KeywordValueNotInRange.cpp - ${PROJECT_SOURCE_DIR}/src/LabelTranslationManager.cpp ${PROJECT_SOURCE_DIR}/src/MemoryAllocationFailed.cpp ${PROJECT_SOURCE_DIR}/src/MissingDelimiter.cpp ${PROJECT_SOURCE_DIR}/src/Preference.cpp ${PROJECT_SOURCE_DIR}/src/Pvl.cpp ${PROJECT_SOURCE_DIR}/src/PvlContainer.cpp - ${PROJECT_SOURCE_DIR}/src/PvlFlatMap.cpp ${PROJECT_SOURCE_DIR}/src/PvlFormat.cpp ${PROJECT_SOURCE_DIR}/src/PvlFormatPds.cpp ${PROJECT_SOURCE_DIR}/src/PvlGroup.cpp ${PROJECT_SOURCE_DIR}/src/PvlKeyword.cpp ${PROJECT_SOURCE_DIR}/src/PvlObject.cpp - ${PROJECT_SOURCE_DIR}/src/PvlSequence.cpp - ${PROJECT_SOURCE_DIR}/src/PvlToPvlTranslationManager.cpp - ${PROJECT_SOURCE_DIR}/src/PvlToXmlTranslationManager.cpp - ${PROJECT_SOURCE_DIR}/src/PvlToken.cpp - ${PROJECT_SOURCE_DIR}/src/PvlTokenizer.cpp - ${PROJECT_SOURCE_DIR}/src/PvlTranslationTable.cpp - ${PROJECT_SOURCE_DIR}/src/TextFile.cpp) + ${PROJECT_SOURCE_DIR}/src/PvlSequence.cpp) # Define a target add_library(core "${Pvl_source_files}") @@ -103,11 +95,16 @@ target_include_directories(core PUBLIC ${GEOS_INCLUDE_DIR} ${CSPICE_INCLUDE_DIR} install(DIRECTORY ${PROJECT_SOURCE_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX}/include/isis) install(TARGETS core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) +# Copy the preferences file +EXECUTE_PROCESS(COMMAND cp -f ${PROJECT_SOURCE_DIR}/IsisPreferences ${CMAKE_BINARY_DIR}/) +install(FILES ${CMAKE_SOURCE_DIR}/IsisPreferences DESTINATION ${CMAKE_INSTALL_PREFIX}) + if (BUILD_CORE_TESTS) + # Copy the test preferences file + EXECUTE_PROCESS(COMMAND cp -f ${PROJECT_SOURCE_DIR}/TestPreferences ${CMAKE_BINARY_DIR}/) enable_testing() add_subdirectory(tests) endif() - if(buildSwig) add_subdirectory(swig) endif() diff --git a/isis/src/core/TestPreferences b/isis/src/core/TestPreferences new file mode 100644 index 0000000000..663d4de2f0 --- /dev/null +++ b/isis/src/core/TestPreferences @@ -0,0 +1,217 @@ +####################################################### +# This file allows the user to customize their Isis +# configuration. See the Isis Preference Dictionary +# on our website isis.astrogeology.usgs.gov for a +# full description of each group. +######################################################## + +######################################################## +# Customize elements of the user interface +# +# ProgressBarPercent = 1 | 2 | 5 | 10 +# ProgressBar = On | Off +# GuiStyle = windows | motif | cde | motifplus | +# platinum | sgi | kde | aqua +# GuiHelpBrowser = { your preferred browser, may need path } +# GuiFontName = helvetica | times | charter | any legal font +# GuiFontSize = 10 | 12 | 14 | any font point size +# HistoryPath = { your preferred loaction for the application +# .par files } +# HistoryRecording = On | Off +# HistoryLength = (your preferred count of history entries +# to remember) +######################################################## + +Group=UserInterface + ProgressBarPercent = 10 + ProgressBar = Off + GuiHelpBrowser = firefox + GuiFontName = helvetica + GuiFontSize = 10 + GuiWidth = 460 + GuiHeight = 600 + HistoryPath = $HOME/.Isis/history + HistoryRecording = Off + HistoryLength = 10 +EndGroup + +######################################################## +# Customize how errors are reported +# +# FileLine = On | Off +# Format = Standard | Pvl +# StackTrace = On | Off +######################################################## + +Group = ErrorFacility + FileLine = Off + Format = Standard + StackTrace = Off +EndGroup + +######################################################## +# Specify which ray-tracing engine to use for shape +# models. +# +# Leave the ShapeModel Group commented-out to continue +# using the ISIS3 default. +# +# RayTraceEngine = Bullet | Embree +# OnError = Continue | Fail +# Tolerance = { numerical value that will be set as the +# tolerance for the Bullet or Embree shape +# model } +# +######################################################## + +#Group = ShapeModel +# RayTraceEngine = Embree +# OnError = Continue +# CubeSupported = False +# Tolerance = DBL_MAX +#EndGroup + +######################################################## +# Customize how session logging is handled +# +# TerminalOutput = On | Off +# On - in command-line mode - user input parameters, +# results, and accounting are +# reported to the terminal. +# Errors are reported in Pvl +# also to the terminal. +# - in interactive mode - same as command-line +# mode, but output is directed +# to the gui. In the case of +# an error, nothing is reported +# to the gui except a pop-up +# window displaying the error. +# Off - in command-line mode - only the results are +# reported to the terminal, or +# in the case of an error, +# the error is reported in Pvl +# to the terminal. +# - in interactive mode - same as command-line mode, +# but the error is reported in +# a pop-up window in the gui. +# FileOutput = On | Off +# FileName = print.prt | /mydirectory/myfile.prt +# FileAccess = Append | Overwrite +######################################################## + +Group = SessionLog + TerminalOutput = Off + FileOutput = On + FileName = print.prt + FileAccess = Append +EndGroup + +######################################################## +# Customize how cubes are created +# +# Overwrite = Error | Allow +# Format = Attached | Detached +# History = On | Off +# MaximumSize = max # of gigabytes +######################################################## + +Group = CubeCustomization + Overwrite = Allow + Format = Attached + History = On + MaximumSize = 12 +EndGroup + +######################################################## +# Customize how other files are created +# +# Overwrite = Error | Allow +# +# If Error, then overwrites of any non-cube +# file will be disallowed and an error will be thrown +######################################################## + +Group = FileCustomization + Overwrite = Allow +EndGroup + +######################################################## +# Customize how Isis uses your computer's resources. +# +# CubeWriteThread = Always | Optimized | Never +# Always - Override Isis program defaults and always +# use a separate thread for writing out cubes. This +# will probably improve performance for some +# programs, will probably negatively impact programs +# that read/write the same file. This option should +# be used with caution. +# Optimized - Let the Isis program decide based on +# it's own internal knowledge. +# Never - Revert to the original method of writing +# cubes always. +# +# GlobalThreads = Optimized | N +# Optimized - The number of global (active processing) +# threads used will match the current system's number +# of CPU cores. +# N - +# Global (processing threads) encapsulate most of Isis' +# CPU-intensive operations. This should be a +# positive whole number greater than 0. This number +# does not cull the number of other thread-types in +# Isis, for example the cube write thread, but it +# should fairly accurately reflect overall potential +# CPU usage in Isis. +######################################################## +Group = Performance + CubeWriteThread = Optimized + GlobalThreads = 2 +EndGroup + +######################################################## +# Customize the location of mission specific data +# files (calibration and spice kernels). Usually this +# should be left to the Isis administrator +######################################################## + +Group = DataDirectory + Apollo15 = $ISISDATA/apollo15 + Apollo16 = $ISISDATA/apollo16 + Apollo17 = $ISISDATA/apollo17 + Base = $ISISDATA/base + Cassini = $ISISDATA/cassini + Chan1 = $ISISDATA/chan1 + Chandrayaan1 = $ISISDATA/chandrayaan1 + Clementine1 = $ISISDATA/clementine1 + Clipper = $ISISDATA/../datalocal/clipper + Control = $ISISDATA/control + Dawn = $ISISDATA/dawn + Galileo = $ISISDATA/galileo + Hayabusa = $ISISDATA/hayabusa + Hayabusa2 = $ISISDATA/hayabusa2 + Juno = $ISISDATA/juno + Kaguya = $ISISDATA/kaguya + Lo = $ISISDATA/lo + Lro = $ISISDATA/lro + Mariner10 = $ISISDATA/mariner10 + Mer = $ISISDATA/mer + Mex = $ISISDATA/mex + Messenger = $ISISDATA/messenger + Mgs = $ISISDATA/mgs + Mro = $ISISDATA/mro + Near = $ISISDATA/near + NewHorizons = $ISISDATA/newhorizons + Odyssey = $ISISDATA/odyssey + OsirisRex = $ISISDATA/../datalocal/osirisrex + Rolo = $ISISDATA/rolo + Rosetta = $ISISDATA/rosetta + Smart1 = $ISISDATA/smart1 + Tgo = $ISISDATA/tgo + Viking1 = $ISISDATA/viking1 + Viking2 = $ISISDATA/viking2 + Voyager1 = $ISISDATA/voyager1 + Voyager2 = $ISISDATA/voyager2 + Temporary = . +EndGroup + +End diff --git a/isis/src/core/cmake/RunUnitTest.cmake b/isis/src/core/cmake/RunUnitTest.cmake new file mode 100644 index 0000000000..5df277b51d --- /dev/null +++ b/isis/src/core/cmake/RunUnitTest.cmake @@ -0,0 +1,77 @@ +#========================================================================= +# Script to run a basic unit test and compare the result to a truth file. +# - This replaces the ISIS UnitTester script. +#========================================================================= + +# Multiple ISIS files need to find things relative to ISISROOT +# and ISISDATA so make sure those are set. +set(ENV{ISISDATA} "${DATA_ROOT}") + +message(STATUS "ISISROOT = $ENV{ISISROOT}") +message(STATUS "ISISDATA = $ENV{ISISDATA}") + +# Set up a file for program output +set(outputFile "${TEST_PROG}.output") +message("outputFile = ${outputFile}") +file(REMOVE ${outputFile}) # Make sure no old file exists + +# The test programs need to be run from their source folders +# so that they can find input data files. +get_filename_component(truthFolder ${TRUTH_FILE} DIRECTORY) + +# Test programs also need to be run with the EXACT name "unitTest", +# otherwise a GUI will pop up and ruin the test. +get_filename_component(binFolder ${TEST_PROG} DIRECTORY) +get_filename_component(binName ${TEST_PROG} NAME) +set(tempDir ${binFolder}/${binName}_temp) +execute_process(COMMAND rm -rf ${tempDir}) +execute_process(COMMAND mkdir -p ${tempDir}) +execute_process(COMMAND ln -s ${TEST_PROG} ${truthFolder}/unitTest) + +# Run the unit test executable and pipe the output to a text file. +execute_process(COMMAND ./unitTest + WORKING_DIRECTORY ${truthFolder} + OUTPUT_FILE ${outputFile} + ERROR_FILE ${outputFile} + OUTPUT_VARIABLE result + RESULT_VARIABLE code) +if(result) + message("Test failed: ${result}, ${code}") +endif() + +# If an exclusion file is present, use it to filter out selected lines. +# - Do this by comparing filtered versions of the two files, then +# running the diff on those two temporary files. +set(comp1 ${outputFile}) +set(comp2 ${TRUTH_FILE}) +set(exclusionPath ${truthFolder}/unitTest.exclude) +if(EXISTS ${exclusionPath}) + set(comp1 ${tempDir}/output_exclude.txt) + set(comp2 ${tempDir}/truth_exclude.txt) + # This throws out all lines containing a word from the exclusion file. + execute_process(COMMAND cat ${outputFile} COMMAND grep -v -f ${exclusionPath} + OUTPUT_FILE "${comp1}") + execute_process(COMMAND cat ${TRUTH_FILE} COMMAND grep -v -f ${exclusionPath} + OUTPUT_FILE "${comp2}") + +endif() + +# Verify that the files are exactly the same +execute_process(COMMAND ${CMAKE_COMMAND} -E compare_files + ${comp1} ${comp2} + RESULT_VARIABLE DIFFERENT) + +if(DIFFERENT) + message("------------------ DIFFERENCES ------------------ ") + execute_process(COMMAND diff ${comp1} ${comp2} OUTPUT_VARIABLE compdiff) + message("${compdiff}") + message("------------------------------------------------- ") + message(FATAL_ERROR "Test failed - files differ") + # On error the result file is left around to aid in debugging. +else() + file(REMOVE ${outputFile}) # On success, clean out the result file. + execute_process(COMMAND rm -rf ${tempdir}) +endif() + +# Clean up our temporary folder +execute_process(COMMAND rm -f ${truthFolder}/unitTest) diff --git a/isis/src/core/src/Pvl.cpp b/isis/src/core/src/Pvl.cpp index 1c62405093..d321259bfb 100644 --- a/isis/src/core/src/Pvl.cpp +++ b/isis/src/core/src/Pvl.cpp @@ -15,7 +15,6 @@ find files of those names at the top level of this repository. **/ #include "FileName.h" #include "IException.h" #include "Message.h" -#include "PvlTokenizer.h" #include "PvlFormat.h" using namespace std; diff --git a/isis/src/core/src/PvlFormat.cpp b/isis/src/core/src/PvlFormat.cpp index 2a01ef0e25..96e9141df9 100644 --- a/isis/src/core/src/PvlFormat.cpp +++ b/isis/src/core/src/PvlFormat.cpp @@ -9,7 +9,6 @@ find files of those names at the top level of this repository. **/ #include "Message.h" #include "FileName.h" #include "PvlKeyword.h" -#include "TextFile.h" #include "Pvl.h" #include "PvlFormat.h" diff --git a/isis/src/core/src/PvlFormatPds.cpp b/isis/src/core/src/PvlFormatPds.cpp index a464b86594..e08207d9ea 100644 --- a/isis/src/core/src/PvlFormatPds.cpp +++ b/isis/src/core/src/PvlFormatPds.cpp @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include "IString.h" #include "FileName.h" #include "Constants.h" -#include "TextFile.h" #include "PvlFormatPds.h" diff --git a/isis/src/core/tests/CMakeLists.txt b/isis/src/core/tests/CMakeLists.txt index d5bdfded24..2b3cb7ce9b 100644 --- a/isis/src/core/tests/CMakeLists.txt +++ b/isis/src/core/tests/CMakeLists.txt @@ -15,3 +15,6 @@ add_executable(runISISCoreTests target_link_libraries(runISISCoreTests core gtest Threads::Threads) gtest_discover_tests(runISISCoreTests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests) + +# Add old ISIS unitTests +add_subdirectory(unitTests) diff --git a/isis/src/core/tests/unitTests/CMakeLists.txt b/isis/src/core/tests/unitTests/CMakeLists.txt new file mode 100644 index 0000000000..68d12d5b9e --- /dev/null +++ b/isis/src/core/tests/unitTests/CMakeLists.txt @@ -0,0 +1,38 @@ +# List of classes with old ISIS unitTests +set(unitTestClasses "FileName" + "IException" + "IString" + "Message" + "Preference" + "Pvl" + "PvlContainer" + "PvlFormat" + "PvlFormatPds" + "PvlGroup" + "PvlKeyword" + "PvlSequence") + +foreach (class ${unitTestClasses}) + set(testFile "${CMAKE_CURRENT_SOURCE_DIR}/${class}/unitTest.cpp") + set(truthFile "${CMAKE_CURRENT_SOURCE_DIR}/${class}/${class}.truth") + set(executableName "core_unit_test_${class}") + + # Create the test executable + add_executable(${executableName} ${testFile}) + target_link_libraries(${executableName} core) + + # Set up a cmake script which will run the executable + # and then check the results against the truth file. + set(testScript "${PROJECT_SOURCE_DIR}/cmake/RunUnitTest.cmake") + set(fullTestPath $) + + set(testName ${executableName}) + add_test(NAME ${testName} + COMMAND ${CMAKE_COMMAND} + -DTEST_PROG=${fullTestPath} + -DTRUTH_FILE=${truthFile} + -DDATA_ROOT=$ENV{ISISDATA} + -DCODE_ROOT=${PROJECT_SOURCE_DIR} + -P ${testScript}) + set_tests_properties(${testName} PROPERTIES LABELS "unit;core") +endforeach() \ No newline at end of file diff --git a/isis/src/core/tests/unitTests/FileName/FileName.truth b/isis/src/core/tests/unitTests/FileName/FileName.truth new file mode 100644 index 0000000000..113a89ebc4 --- /dev/null +++ b/isis/src/core/tests/unitTests/FileName/FileName.truth @@ -0,0 +1,664 @@ +Running Full Test on [/path/base.ext+attr] + Testing Basics [/path/base.ext+attr] + Name: base.ext + Base Name: base + Path: /path + Original path /path + Extension: ext + Comparison (==): 1 + Comparison (!=): 0 + Expanded /path/base.ext + Exists 0 + + Testing Extension change [/path/base.ext+attr] + Before modification: /path/base.ext + Changed: 0 + Unchanged: 1 + Removed Extension: /path/base + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: /path/base.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path/base.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path/base.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /path/base.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path/base.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /path/base.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/path/base.ext+attr] + Name: base.ext + Base Name: base + Extension: ext + Original path /path + Exists 0 + +Running Full Test on [/path1/.path2/base.ext+attr] + Testing Basics [/path1/.path2/base.ext+attr] + Name: base.ext + Base Name: base + Path: /path1/.path2 + Original path /path1/.path2 + Extension: ext + Comparison (==): 1 + Comparison (!=): 0 + Expanded /path1/.path2/base.ext + Exists 0 + + Testing Extension change [/path1/.path2/base.ext+attr] + Before modification: /path1/.path2/base.ext + Changed: 0 + Unchanged: 1 + Removed Extension: /path1/.path2/base + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: /path1/.path2/base.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path1/.path2/base.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path1/.path2/base.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /path1/.path2/base.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path1/.path2/base.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /path1/.path2/base.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/path1/.path2/base.ext+attr] + Name: base.ext + Base Name: base + Extension: ext + Original path /path1/.path2 + Exists 0 + +Running Full Test on [/path1/pat.h2/base+attr] + Testing Basics [/path1/pat.h2/base+attr] + Name: base + Base Name: base + Path: /path1/pat.h2 + Original path /path1/pat.h2 + Extension: + Comparison (==): 1 + Comparison (!=): 0 + Expanded /path1/pat.h2/base + Exists 0 + + Testing Extension change [/path1/pat.h2/base+attr] + Before modification: /path1/pat.h2/base + Changed: 0 + Unchanged: 1 + Removed Extension: /path1/pat.h2/base + Changed: 0 + Unchanged: 1 + Added Extension [tmp]: /path1/pat.h2/base.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path1/pat.h2/base.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path1/pat.h2/base.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /path1/pat.h2/base.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /path1/pat.h2/base.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /path1/pat.h2/base.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/path1/pat.h2/base+attr] + Name: base + Base Name: base + Extension: + Original path /path1/pat.h2 + Exists 0 + +Running Full Test on [/.path1/path2/base] + Testing Basics [/.path1/path2/base] + Name: base + Base Name: base + Path: /.path1/path2 + Original path /.path1/path2 + Extension: + Comparison (==): 1 + Comparison (!=): 0 + Expanded /.path1/path2/base + Exists 0 + + Testing Extension change [/.path1/path2/base] + Before modification: /.path1/path2/base + Changed: 0 + Unchanged: 1 + Removed Extension: /.path1/path2/base + Changed: 0 + Unchanged: 1 + Added Extension [tmp]: /.path1/path2/base.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/path2/base.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/path2/base.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /.path1/path2/base.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/path2/base.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /.path1/path2/base.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/.path1/path2/base] + Name: base + Base Name: base + Extension: + Original path /.path1/path2 + Exists 0 + +Running Full Test on [/.path1/path2/base.+attr] + Testing Basics [/.path1/path2/base.+attr] + Name: base. + Base Name: base + Path: /.path1/path2 + Original path /.path1/path2 + Extension: + Comparison (==): 1 + Comparison (!=): 0 + Expanded /.path1/path2/base. + Exists 0 + + Testing Extension change [/.path1/path2/base.+attr] + Before modification: /.path1/path2/base. + Changed: 0 + Unchanged: 1 + Removed Extension: /.path1/path2/base + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: /.path1/path2/base.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/path2/base.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/path2/base.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /.path1/path2/base.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/path2/base.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /.path1/path2/base.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/.path1/path2/base.+attr] + Name: base. + Base Name: base + Extension: + Original path /.path1/path2 + Exists 0 + +Running Full Test on [/another/path/base.ex1.exten2.ext3] + Testing Basics [/another/path/base.ex1.exten2.ext3] + Name: base.ex1.exten2.ext3 + Base Name: base.ex1.exten2 + Path: /another/path + Original path /another/path + Extension: ext3 + Comparison (==): 1 + Comparison (!=): 0 + Expanded /another/path/base.ex1.exten2.ext3 + Exists 0 + + Testing Extension change [/another/path/base.ex1.exten2.ext3] + Before modification: /another/path/base.ex1.exten2.ext3 + Changed: 0 + Unchanged: 1 + Removed Extension: /another/path/base.ex1.exten2 + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: /another/path/base.ex1.exten2.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /another/path/base.ex1.exten2.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /another/path/base.ex1.exten2.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /another/path/base.ex1.exten2.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /another/path/base.ex1.exten2.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /another/path/base.ex1.exten2.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/another/path/base.ex1.exten2.ext3] + Name: base.ex1.exten2.ext3 + Base Name: base.ex1.exten2 + Extension: ext3 + Original path /another/path + Exists 0 + +Running Full Test on [/$BADENV/base.ext+attr] + Testing Basics [/$BADENV/base.ext+attr] + Name: base.ext + Base Name: base + Path: /$BADENV + Original path /$BADENV + Extension: ext + Comparison (==): 1 + Comparison (!=): 0 + Expanded /$BADENV/base.ext + Exists 0 + + Testing Extension change [/$BADENV/base.ext+attr] + Before modification: /$BADENV/base.ext + Changed: 0 + Unchanged: 1 + Removed Extension: /$BADENV/base + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: /$BADENV/base.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /$BADENV/base.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /$BADENV/base.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /$BADENV/base.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /$BADENV/base.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /$BADENV/base.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/$BADENV/base.ext+attr] + Name: base.ext + Base Name: base + Extension: ext + Original path /$BADENV + Exists 0 + +Running Full Test on [/.path1/base+attr1+attr2] + Testing Basics [/.path1/base+attr1+attr2] + Name: base + Base Name: base + Path: /.path1 + Original path /.path1 + Extension: + Comparison (==): 1 + Comparison (!=): 0 + Expanded /.path1/base + Exists 0 + + Testing Extension change [/.path1/base+attr1+attr2] + Before modification: /.path1/base + Changed: 0 + Unchanged: 1 + Removed Extension: /.path1/base + Changed: 0 + Unchanged: 1 + Added Extension [tmp]: /.path1/base.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/base.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/base.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /.path1/base.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /.path1/base.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /.path1/base.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/.path1/base+attr1+attr2] + Name: base + Base Name: base + Extension: + Original path /.path1 + Exists 0 + +Running Full Test on [unitTest.cpp] + Testing Basics [unitTest.cpp] + Name: unitTest.cpp + Base Name: unitTest + Path: . + Original path . + Extension: cpp + Comparison (==): 1 + Comparison (!=): 0 + Expanded unitTest.cpp + Exists 1 + + Testing Extension change [unitTest.cpp] + Before modification: unitTest.cpp + Changed: 0 + Unchanged: 1 + Removed Extension: ./unitTest + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: ./unitTest.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./unitTest.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./unitTest.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: ./unitTest.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./unitTest.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: ./unitTest.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [unitTest.cpp] + Name: unitTest.cpp + Base Name: unitTest + Extension: cpp + Original path . + Exists 1 + +Running Full Test on [./unitTest.cpp] + Testing Basics [./unitTest.cpp] + Name: unitTest.cpp + Base Name: unitTest + Path: . + Original path . + Extension: cpp + Comparison (==): 1 + Comparison (!=): 0 + Expanded ./unitTest.cpp + Exists 1 + + Testing Extension change [./unitTest.cpp] + Before modification: ./unitTest.cpp + Changed: 0 + Unchanged: 1 + Removed Extension: ./unitTest + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: ./unitTest.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./unitTest.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./unitTest.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: ./unitTest.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./unitTest.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: ./unitTest.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [./unitTest.cpp] + Name: unitTest.cpp + Base Name: unitTest + Extension: cpp + Original path . + Exists 1 + +Running Full Test on [.cub] + Testing Basics [.cub] + Name: .cub + Base Name: + Path: . + Original path . + Extension: cub + Comparison (==): 1 + Comparison (!=): 0 + Expanded .cub + Exists 0 + + Testing Extension change [.cub] + Before modification: .cub + Changed: 0 + Unchanged: 1 + Removed Extension: ./ + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: ./.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: ./.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: ./.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: ./.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [.cub] + Name: .cub + Base Name: + Extension: cub + Original path . + Exists 0 + +Running Full Test on [/$TEMPORARY/unitTest.cpp] + Testing Basics [/$TEMPORARY/unitTest.cpp] + Name: unitTest.cpp + Base Name: unitTest + Path: /. + Original path /$TEMPORARY + Extension: cpp + Comparison (==): 1 + Comparison (!=): 0 + Expanded /./unitTest.cpp + Exists 0 + + Testing Extension change [/$TEMPORARY/unitTest.cpp] + Before modification: /./unitTest.cpp + Changed: 0 + Unchanged: 1 + Removed Extension: /./unitTest + Changed: 1 + Unchanged: 0 + Added Extension [tmp]: /./unitTest.tmp + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /./unitTest.tmp.jpg + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /./unitTest.tmp.jpg + Changed: 0 + Unchanged: 1 + Set Extension [gif]: /./unitTest.tmp.gif + Changed: 1 + Unchanged: 0 + Added Extension [jpg]: /./unitTest.tmp.gif.jpg + Changed: 1 + Unchanged: 0 + Removed Extension: /./unitTest.tmp.gif + Changed: 1 + Unchanged: 0 + + Testing Expanded [/$TEMPORARY/unitTest.cpp] + Name: unitTest.cpp + Base Name: unitTest + Extension: cpp + Original path /$TEMPORARY + Exists 0 + +Testing temporary file name placement + Input name and extension : $TEMPORARY/tttt.tmp + Extension: : tmp + Original Path: : $TEMPORARY + Exists: : 1 + Name (cleaned): : tttt??????.tmp + +Testing parallel temporary file name creation for atomicity + Success! + +Testing Versioning Missing Problems + Testing Versioning Methods [tttt] + Highest Version Name: Highest Version Failed: **ERROR** Asked for highest version of file named [tttt] in [.] but there are no version sequences in the name. + New Version Name: New Version Failed: **ERROR** Asked for new version of file named [tttt] in [.] but there are no version sequences in the name. + + Testing Versioning Methods [tttt{}.tmp] + Highest Version Name: Highest Version Failed: **ERROR** The date version sequences are not recognized in the file named [tttt{}.tmp]. + New Version Name: New Version Failed: **ERROR** The date version sequences are not recognized in the file named [tttt{}.tmp]. + + Testing Versioning Methods [ttttt{}.tmp] + Highest Version Name: Highest Version Failed: **ERROR** The date version sequences are not recognized in the file named [ttttt{}.tmp]. + New Version Name: New Version Failed: **ERROR** The date version sequences are not recognized in the file named [ttttt{}.tmp]. + +Testing Numerical-Only Versioning + Testing Versioning Methods [tttt??????] + Highest Version Name: tttt000001 + Highest Version Orig: ./tttt000001 + Highest Version Orig Path: . + High version changed FileName: 1 + New Version Name: tttt000002 + New Version Orig: ./tttt000002 + New Version Orig Path: . + New version changed FileName: 1 + + Testing Versioning Methods [tttt??????.tmp] + Highest Version Name: tttt000008.tmp + Highest Version Orig: ./tttt000008.tmp + Highest Version Orig Path: . + High version changed FileName: 1 + New Version Name: tttt000009.tmp + New Version Orig: ./tttt000009.tmp + New Version Orig Path: . + New version changed FileName: 1 + + Testing Versioning Methods [tttt_?.tmp] + Highest Version Name: tttt_0.tmp + Highest Version Orig: ./tttt_0.tmp + Highest Version Orig Path: . + High version changed FileName: 1 + New Version Name: tttt_1.tmp + New Version Orig: ./tttt_1.tmp + New Version Orig Path: . + New version changed FileName: 1 + + Testing Versioning Methods [??tttt] + Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a numerial version matching [??tttt] in [.]. + New Version Name: 01tttt + New Version Orig: ./01tttt + New Version Orig Path: . + New version changed FileName: 1 + + Testing Versioning Methods [?tttt000008.tmp] + Highest Version Name: 2tttt000008.tmp + Highest Version Orig: ./2tttt000008.tmp + Highest Version Orig Path: . + High version changed FileName: 1 + New Version Name: 3tttt000008.tmp + New Version Orig: ./3tttt000008.tmp + New Version Orig Path: . + New version changed FileName: 1 + + Testing Versioning Methods [junk?] + Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a numerial version matching [junk?] in [.]. + New Version Name: junk1 + New Version Orig: ./junk1 + New Version Orig Path: . + New version changed FileName: 1 + + Testing Versioning Methods [??tttt??] + Highest Version Name: Highest Version Failed: **ERROR** Only one numerical version sequence is allowed in a filename; there are multiple in [??tttt??]. + New Version Name: New Version Failed: **ERROR** Only one numerical version sequence is allowed in a filename; there are multiple in [??tttt??]. + +Testing Date-Only Versioning + Testing Versioning Methods [tttt{ddMMMyyyy}.tmp] + Highest Version Name: tttt14Apr2010.tmp + Highest Version Orig: ./tttt14Apr2010.tmp + Highest Version Orig Path: . + High version changed FileName: 1 + + Testing Versioning Methods [tt{MMM}tt{dd}yy{yy}.tmp] + Highest Version Name: ttFebtt04yy01.tmp + Highest Version Orig: ./ttFebtt04yy01.tmp + Highest Version Orig Path: . + High version changed FileName: 1 + + Testing Versioning Methods [tt{d}tt{MMM}.tmp] + Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a date version matching [tt{d}tt{MMM}.tmp] in [.]. + + Testing Versioning Methods [tt{d}tt{MMMM}.tmp] + Highest Version Name: tt2ttDecember.tmp + Highest Version Orig: ./tt2ttDecember.tmp + Highest Version Orig Path: . + High version changed FileName: 1 + + Testing Versioning Methods [tt{dd}.tmp] + Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a date version matching [tt{dd}.tmp] in [.]. + + Testing Versioning Methods [tttt{dd}.tmp] + Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a date version matching [tttt{dd}.tmp] in [.]. + + Testing Versioning Methods [tttt{aaaa}.tmp] + Highest Version Name: Highest Version Failed: **ERROR** The date version sequences are not recognized in the file named [tttt{aaaa}.tmp]. + New Version Name: New Version Failed: **ERROR** The date version sequences are not recognized in the file named [tttt{aaaa}.tmp]. + +Testing Date and Numerical Versioning Combined + Testing Versioning Methods [$TEMPORARY/{MMM}-{dd}-{yy}_v???.tmp] + Highest Version Name: Apr-22-99_v004.tmp + Highest Version Orig: $TEMPORARY/Apr-22-99_v004.tmp + Highest Version Orig Path: $TEMPORARY + High version changed FileName: 1 + +Verifying NewVersion for file tttt{dd}tt{yyyy}tt{MMM}.tmp is today + Made today's filename successfully? 1 + diff --git a/isis/src/core/tests/unitTests/FileName/unitTest.cpp b/isis/src/core/tests/unitTests/FileName/unitTest.cpp new file mode 100644 index 0000000000..6f20375034 --- /dev/null +++ b/isis/src/core/tests/unitTests/FileName/unitTest.cpp @@ -0,0 +1,339 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "FileName.h" +#include "IException.h" +#include "Preference.h" + +using namespace std; +using namespace Isis; + +void TestVersioning(QString prefix, QString name, bool containsDate = false); +void TestExpanded(QString prefix, QString name); +void TestExtensionChanges(QString prefix, QString name, bool showExpandedValues); +void TestGenericAccessors(QString prefix, QString name, bool showExpandedValues); + +int main(int argc, char *argv[]) { + Preference::Preferences(true); + + QCoreApplication app(argc, argv); + + QStringList filesToFullTest; + filesToFullTest << "/path/base.ext+attr" << "/path1/.path2/base.ext+attr" + << "/path1/pat.h2/base+attr" << "/.path1/path2/base" + << "/.path1/path2/base.+attr" << "/another/path/base.ex1.exten2.ext3" + << "/$BADENV/base.ext+attr" << "/.path1/base+attr1+attr2" + << "unitTest.cpp" << "./unitTest.cpp" << ".cub" + << "/$TEMPORARY/unitTest.cpp"; + + foreach (QString fileToTest, filesToFullTest) { + cout << "Running Full Test on [" << qPrintable(fileToTest) << "]" << endl; + TestGenericAccessors("\t", fileToTest, true); + TestExtensionChanges("\t", fileToTest, true); + TestExpanded("\t", fileToTest); + } + + // Test temp files thoroughly + cout << "Testing temporary file name placement" << endl; + QString tempFileNameTestStr = "$TEMPORARY/tttt.tmp"; + FileName n = FileName::createTempFile(tempFileNameTestStr); + cout << "\tInput name and extension : " << tempFileNameTestStr << endl; + cout << "\tExtension: : " << n.extension() << endl; + cout << "\tOriginal Path: : " << n.originalPath() << endl; + cout << "\tExists: : " << n.fileExists() << endl; + cout << "\tName (cleaned): : " << + QString(n.name().mid(0, 4) + + QString("%1").arg("", n.name().size() - 8, '?') + + n.name().mid(n.name().size() - 4)) << endl; + cout << endl; + + if (!QFile(n.toString()).remove()) { + cout << "\t**Failed to delete temporary file [" << n.toString() << "]**" << endl; + } + + { + cout << "Testing parallel temporary file name creation for atomicity" << endl; + int numToTest = QThreadPool::globalInstance()->maxThreadCount() * 20; + + QStringList templateFileNames; + for (int i = 0; i < numToTest; i++) + templateFileNames.append(QString("tttt.tmp")); + + QList results = QtConcurrent::blockingMapped(templateFileNames, + &FileName::createTempFile); + bool success = true; + + while (results.count()) { + FileName result = results.first(); + int count = results.removeAll(result); + + if (count != 1) { + cout << "File name: " << result.toString() << " encountered " + << count << " times" << endl; + success = false; + } + + if (!result.fileExists()) { + cout << "File name: " << result.toString() << " encountered does not exists"; + success = false; + } + + QFile(result.toString()).remove(); + } + + if (success) { + cout << "\tSuccess!" << endl; + } + else { + cout << "\t**Failed to uniquely create temporary files in parallel**" << endl; + } + + cout << endl; + } + + + // Test versioning thoroughly + { + QStringList tempFiles; + tempFiles << "tttt000001" << "tttt000001.tmp" << "tttt000005.tmp" << "tttt000006.tmp" + << "tttt000008.tmp" << "1tttt000008.tmp" << "2tttt000008.tmp" + << "tttt_0.tmp" << "junk06.tmp" << "junk09.tmp" << "tttt05Sep2002.tmp" + << "tttt20Jan2010.tmp" << "tttt14Apr2010.tmp" << "ttAPRtt22yy99.tmp" + << "ttMARtt11yy00.tmp" << "ttFEBtt04yy01.tmp" << "ttMARtt072003.tmp" + << "tt14ttNovember.tmp" << "tt2ttDecember.tmp" << "tttt.tmp" << "APR-22-99_v001.tmp" + << "APR-22-99_v004.tmp" << "APR-21-99_v009.tmp"; + + foreach (QString fileName, tempFiles) { + if (!QFile(fileName).open(QIODevice::WriteOnly | QIODevice::Truncate)) { + cout << "Failed to create temporary file for test: " << qPrintable(fileName) << endl; + } + } + + + cout << "Testing Versioning Missing Problems" << endl; + TestVersioning("\t", "tttt"); + TestVersioning("\t", "tttt{}.tmp"); + TestVersioning("\t", "ttttt{}.tmp"); + + cout << "Testing Numerical-Only Versioning" << endl; + TestVersioning("\t", "tttt??????"); + TestVersioning("\t", "tttt??????.tmp"); + TestVersioning("\t", "tttt_?.tmp"); + TestVersioning("\t", "??tttt"); + TestVersioning("\t", "?tttt000008.tmp"); + TestVersioning("\t", "junk?"); + TestVersioning("\t", "??tttt??"); + + + cout << "Testing Date-Only Versioning" << endl; + TestVersioning("\t", "tttt{ddMMMyyyy}.tmp", true); + TestVersioning("\t", "tt{MMM}tt{dd}yy{yy}.tmp", true); + TestVersioning("\t", "tt{d}tt{MMM}.tmp", true); + TestVersioning("\t", "tt{d}tt{MMMM}.tmp", true); + TestVersioning("\t", "tt{dd}.tmp", true); + TestVersioning("\t", "tttt{dd}.tmp", true); + TestVersioning("\t", "tttt{aaaa}.tmp"); + + + cout << "Testing Date and Numerical Versioning Combined" << endl; + TestVersioning("\t", "$TEMPORARY/{MMM}-{dd}-{yy}_v???.tmp", true); + + // Test new version for date file. Makes a file for today, which cannot be + // printed as truth, so compare it with what we expect and print the result. + FileName todayFileName("tttt{dd}tt{yyyy}tt{MMM}.tmp"); + cout << "Verifying NewVersion for file " << todayFileName.name() << " is today" << endl; + bool success = false; + try { + todayFileName = todayFileName.newVersion(); + QDate today = QDate::currentDate(); + QString expected = today.toString("'tttt'dd'tt'yyyy'tt'MMM'.tmp'"); + success = todayFileName.name() == expected; + cout << "\tMade today's filename successfully? " << success << endl; + + if (!success) + cout << "\t\tMade: " << todayFileName.name() << "; expected: " << expected.toStdString() + << endl; + } + catch(IException &error) { + error.print(); + } + cout << endl; + + foreach (QString fileName, tempFiles) { + if (!QFile(fileName).remove()) { + cout << "Failed to delete temporary file for test: " << qPrintable(fileName) << endl; + cout << "Was it specified twice?" << endl; + } + } + } + + return 0; +} + + +void TestVersioning(QString prefix, QString name, bool containsDate) { + cout << prefix << "Testing Versioning Methods [" << name << "]" << endl; + + try { + FileName test(name); + + try { + cout << prefix << "\tHighest Version Name: "; + cout << test.highestVersion().name() << endl; + cout << prefix << "\tHighest Version Orig: "; + cout << test.highestVersion().original() << endl; + cout << prefix << "\tHighest Version Orig Path: "; + cout << test.highestVersion().originalPath() << endl; + cout << prefix << "\tHigh version changed FileName: "; + cout << (test != test.highestVersion()) << endl; + } + catch (IException &e) { + cout << prefix << "\tHighest Version Failed: " << e.toString() << endl; + } + + try { + if (!containsDate) { + cout << prefix << "\tNew Version Name: "; + cout << test.newVersion().name() << endl; + cout << prefix << "\tNew Version Orig: "; + cout << test.newVersion().original() << endl; + cout << prefix << "\tNew Version Orig Path: "; + cout << test.newVersion().originalPath() << endl; + cout << prefix << "\tNew version changed FileName: "; + cout << (test != test.newVersion()) << endl; + } + } + catch (IException &e) { + cout << prefix << "\tNew Version Failed: " << e.toString() << endl; + } + } + catch(IException &e) { + cout << prefix << "\tError creating file name: " << e.toString() << endl; + } + + cout << endl; +} + + +void TestGenericAccessors(QString prefix, QString name, bool showExpandedValues) { + FileName a(name); + + // Test our assignment & copy construct every time + FileName b; + b = a; + FileName c(b); + FileName test; + test = c; + + cout << prefix << "Testing Basics [" << name << "]" << endl; + cout << prefix << "\tName: " << test.name() << endl; + cout << prefix << "\tBase Name: " << test.baseName() << endl; + + if (showExpandedValues) { + cout << prefix << "\tPath: " << test.path() << endl; + } + + cout << prefix << "\tOriginal path " << test.originalPath() << endl; + + cout << prefix << "\tExtension: " << test.extension() << endl; + + cout << prefix << "\tComparison (==): " << (a == c) << endl; + + cout << prefix << "\tComparison (!=): " << (a != c) << endl; + + if (showExpandedValues) { + cout << prefix << "\tExpanded " << test.expanded() << endl; + } + + cout << prefix << "\tExists " << test.fileExists() << endl; + cout << endl; +} + + +void TestExtensionChanges(QString prefix, QString name, bool showExpandedValues) { + FileName a(name); + + // Test our assignment & copy construct every time + FileName b; + b = a; + FileName c(b); + FileName test; + test = c; + + QString (FileName::*toStringMethod)() const = &FileName::toString; + + FileName beforeLastChange = test; + + if (!showExpandedValues) { + toStringMethod = &FileName::original; + } + + cout << prefix << "Testing Extension change [" << name << "]" << endl; + cout << prefix << "\tBefore modification: " << (test.*toStringMethod)() << endl; + cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; + cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; + beforeLastChange = test; + test = test.removeExtension(); + cout << prefix << "\tRemoved Extension: " << (test.*toStringMethod)() << endl; + cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; + cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; + beforeLastChange = test; + test = test.addExtension("tmp"); + cout << prefix << "\tAdded Extension [tmp]: " << (test.*toStringMethod)() << endl; + cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; + cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; + beforeLastChange = test; + test = test.addExtension("jpg"); + cout << prefix << "\tAdded Extension [jpg]: " << (test.*toStringMethod)() << endl; + cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; + cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; + beforeLastChange = test; + test = test.addExtension("jpg"); + cout << prefix << "\tAdded Extension [jpg]: " << (test.*toStringMethod)() << endl; + cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; + cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; + beforeLastChange = test; + test = test.setExtension("gif"); + cout << prefix << "\tSet Extension [gif]: " << (test.*toStringMethod)() << endl; + cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; + cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; + beforeLastChange = test; + test = test.addExtension("jpg"); + cout << prefix << "\tAdded Extension [jpg]: " << (test.*toStringMethod)() << endl; + cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; + cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; + beforeLastChange = test; + test = test.removeExtension(); + cout << prefix << "\tRemoved Extension: " << (test.*toStringMethod)() << endl; + cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; + cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; + cout << endl; +} + + +void TestExpanded(QString prefix, QString name) { + FileName a(name); + + // Test our assignment & copy construct every time + FileName b; + b = a; + FileName c(b); + FileName test; + test = c; + + cout << prefix << "Testing Expanded [" << name << "]" << endl; + + cout << prefix << "\tName: " << test.name() << endl; + cout << prefix << "\tBase Name: " << test.baseName() << endl; + cout << prefix << "\tExtension: " << test.extension() << endl; + cout << prefix << "\tOriginal path " << test.originalPath() << endl; + cout << prefix << "\tExists " << test.fileExists() << endl; + + cout << endl; +} diff --git a/isis/src/core/tests/unitTests/IException/IException.truth b/isis/src/core/tests/unitTests/IException/IException.truth new file mode 100644 index 0000000000..b5a95a3c62 --- /dev/null +++ b/isis/src/core/tests/unitTests/IException/IException.truth @@ -0,0 +1,256 @@ +Test Error 1 +print(): +what(): + + +Test Error 2 +print(): +**USER ERROR** +what(): +**USER ERROR** + +Test Error 3 +print(): +**USER ERROR** +**USER ERROR** +what(): +**USER ERROR** +**USER ERROR** + +Test Error 4 +print(): +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** +what(): +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Test Error 5 +toPvl(): +Group = Error + Class = "USER ERROR" + Code = 2 + Message = "Testing user error" + File = unitTest.cpp + Line = 63 +End_Group + +Group = Error + Code = 1 + Message = "Testing unknown error" + File = unitTest.cpp + Line = 50 +End_Group + +Group = Error + Class = "USER ERROR" + Code = 2 + File = unitTest.cpp + Line = 38 +End_Group + +Group = Error + Class = "USER ERROR" + Code = 2 +End_Group +End +what(): +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Test Error 6 +print(): +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** +what(): +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Test Error 7 +print(): +**I/O ERROR** Testing I/O error in unitTest.cpp at 88. +**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 75. +**USER ERROR** Testing user error in unitTest.cpp at 63. +**ERROR** Testing unknown error in unitTest.cpp at 50. +**USER ERROR** in unitTest.cpp at 38. +**USER ERROR** +what(): +**I/O ERROR** Testing I/O error. +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Test Throwing Error: No reaction + +Test Throwing Error: Print +print(): +**I/O ERROR** Testing I/O error. +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** +what(): +**I/O ERROR** Testing I/O error. +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Test Throwing Error: Rethrow and print +**ERROR** Another error. +**I/O ERROR** Testing I/O error. +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Test Preference 'FileLine' +Turned ON -- print(): +**I/O ERROR** Testing I/O error in unitTest.cpp at 88. +**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 75. +**USER ERROR** Testing user error in unitTest.cpp at 63. +**ERROR** Testing unknown error in unitTest.cpp at 50. +**USER ERROR** in unitTest.cpp at 38. +**USER ERROR** + +Turned OFF -- print(): +**I/O ERROR** Testing I/O error. +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Turned ON, override to OFF -- print(false): +**I/O ERROR** Testing I/O error. +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Test Preference 'Format' +Standard Format -- print(): +**I/O ERROR** Testing I/O error. +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Standard Format -- toString(): +**I/O ERROR** Testing I/O error. +**PROGRAMMER ERROR** Testing programmer error. +**USER ERROR** Testing user error. +**ERROR** Testing unknown error. +**USER ERROR** +**USER ERROR** + +Pvl Format -- print(): +Group = Error + Class = "I/O ERROR" + Code = 4 + Message = "Testing I/O error" + File = unitTest.cpp + Line = 88 +End_Group + +Group = Error + Class = "PROGRAMMER ERROR" + Code = 3 + Message = "Testing programmer error" + File = unitTest.cpp + Line = 75 +End_Group + +Group = Error + Class = "USER ERROR" + Code = 2 + Message = "Testing user error" + File = unitTest.cpp + Line = 63 +End_Group + +Group = Error + Code = 1 + Message = "Testing unknown error" + File = unitTest.cpp + Line = 50 +End_Group + +Group = Error + Class = "USER ERROR" + Code = 2 + File = unitTest.cpp + Line = 38 +End_Group + +Group = Error + Class = "USER ERROR" + Code = 2 +End_Group +End + +Pvl Format -- toString(): +Group = Error + Class = "I/O ERROR" + Code = 4 + Message = "Testing I/O error" + File = unitTest.cpp + Line = 88 +End_Group + +Group = Error + Class = "PROGRAMMER ERROR" + Code = 3 + Message = "Testing programmer error" + File = unitTest.cpp + Line = 75 +End_Group + +Group = Error + Class = "USER ERROR" + Code = 2 + Message = "Testing user error" + File = unitTest.cpp + Line = 63 +End_Group + +Group = Error + Code = 1 + Message = "Testing unknown error" + File = unitTest.cpp + Line = 50 +End_Group + +Group = Error + Class = "USER ERROR" + Code = 2 + File = unitTest.cpp + Line = 38 +End_Group + +Group = Error + Class = "USER ERROR" + Code = 2 +End_Group +End + +Pvl Format -- empty toString(): + + diff --git a/isis/src/core/tests/unitTests/IException/unitTest.cpp b/isis/src/core/tests/unitTests/IException/unitTest.cpp new file mode 100644 index 0000000000..ebfee0db14 --- /dev/null +++ b/isis/src/core/tests/unitTests/IException/unitTest.cpp @@ -0,0 +1,193 @@ +#include +#include "Preference.h" + +#include "IException.h" + +using namespace std; +using namespace Isis; + +int main(void) { + Isis::Preference::Preferences(true); + + IException lastError; + + cerr << "Test Error 1\n"; + { + IException error; + error.append(lastError); + cerr << "print():\n"; + error.print(); + cerr << "what():\n" << error.what() << "\n"; + lastError = error; + } + cerr << "\n"; + + cerr << "Test Error 2\n"; + { + IException error(IException::User, "", "", -1); + error.append(lastError); + cerr << "print():\n"; + error.print(); + cerr << "what():\n" << error.what() << "\n"; + lastError = error; + } + cerr << "\n"; + + cerr << "Test Error 3\n"; + { + IException error(IException::User, "", _FILEINFO_); + error.append(lastError); + cerr << "print():\n"; + error.print(); + cerr << "what():\n" << error.what() << "\n"; + lastError = error; + } + cerr << "\n"; + + cerr << "Test Error 4\n"; + { + IException error( + IException::Unknown, "Testing unknown error.", _FILEINFO_); + error.append(lastError); + cerr << "print():\n"; + error.print(); + cerr << "what():\n" << error.what() << "\n"; + lastError = error; + } + cerr << "\n"; + + cerr << "Test Error 5\n"; + { + IException error( + lastError, + IException::User, "Testing user error", _FILEINFO_); + cerr << "toPvl():\n"; + Pvl pvlOutput(error.toPvl()); + cerr << pvlOutput << "\n"; + cerr << "what():\n" << error.what() << "\n"; + lastError = error; + } + cerr << "\n"; + + cerr << "Test Error 6\n"; + { + IException error( + IException::Programmer, "Testing programmer error.", _FILEINFO_); + error.append(lastError); + cerr << "print():\n"; + error.print(); + cerr << "what():\n" << error.what() << "\n"; + lastError = error; + } + cerr << "\n"; + + cerr << "Test Error 7\n"; + { + IException error( + lastError, + IException::Io, "Testing I/O error.", _FILEINFO_); + cerr << "print():\n"; + error.print(true); + cerr << "what():\n" << error.what() << "\n"; + lastError = error; + } + cerr << "\n"; + + cerr << "Test Throwing Error: No reaction\n"; + { + try { + throw lastError; + } + catch (IException &e) { + } + } + cerr << "\n"; + + cerr << "Test Throwing Error: Print\n"; + { + try { + throw lastError; + } + catch (IException &e) { + cerr << "print():\n"; + e.print(); + cerr << "what():\n" << e.what() << "\n"; + } + } + cerr << "\n"; + + cerr << "Test Throwing Error: Rethrow and print\n"; + { + try { + try { + throw lastError; + } + catch (IException &e) { + throw IException(e, IException::Unknown, "Another error", _FILEINFO_); + } + } + catch (IException &e) { + e.print(); + } + } + cerr << "\n"; + + Pvl &prefs = Preference::Preferences(); + PvlGroup &errorPrefs = prefs.findGroup("ErrorFacility"); + + cerr << "Test Preference 'FileLine'\n"; + { + QString &fileLineValue = errorPrefs["FileLine"][0]; + + fileLineValue = "On"; + + cerr << "Turned ON -- print():\n"; + lastError.print(); + cerr << "\n"; + + fileLineValue = "Off"; + + cerr << "Turned OFF -- print():\n"; + lastError.print(); + cerr << "\n"; + + fileLineValue = "On"; + + cerr << "Turned ON, override to OFF -- print(false):\n"; + lastError.print(false); + cerr << "\n"; + + fileLineValue = "Off"; // restore original value + } + + cerr << "Test Preference 'Format'\n"; + { + QString &formatValue = errorPrefs["Format"][0]; + + formatValue = "Standard"; + + cerr << "Standard Format -- print():\n"; + lastError.print(); + cerr << "\n"; + + cerr << "Standard Format -- toString():\n"; + cerr << lastError.toString() << "\n\n"; + + formatValue = "Pvl"; + + cerr << "Pvl Format -- print():\n"; + lastError.print(); + cerr << "\n"; + + cerr << "Pvl Format -- toString():\n"; + cerr << lastError.toString() << "\n\n"; + + cerr << "Pvl Format -- empty toString():\n"; + cerr << IException().toString() << "\n\n"; + + formatValue = "Standard"; // restore original value + } + + return 0; +} + diff --git a/isis/src/core/tests/unitTests/IException/unitTest.exclude b/isis/src/core/tests/unitTests/IException/unitTest.exclude new file mode 100644 index 0000000000..220f4aa98a --- /dev/null +++ b/isis/src/core/tests/unitTests/IException/unitTest.exclude @@ -0,0 +1 @@ +File diff --git a/isis/src/core/tests/unitTests/IString/IString.truth b/isis/src/core/tests/unitTests/IString/IString.truth new file mode 100644 index 0000000000..f70c5ebc5f --- /dev/null +++ b/isis/src/core/tests/unitTests/IString/IString.truth @@ -0,0 +1,195 @@ +Testing toBool + True: 1 + False: 0 + **ERROR** Failed to convert string [...] to a boolean. Please specify one of [1, on, t, true, y, yes] for true, or one of [0, f, false, n, no, off] for false. + +Testing toInt + 0 + 5 + -5 + 2147483647 + -2147483647 + **ERROR** Failed to convert string [-5.0] to an integer. + **ERROR** Failed to convert string [2147483648] to an integer. + +Testing toBigInt + 0 + 5 + -5 + 9223372036854775807 + -9223372036854775807 + **ERROR** Failed to convert string [-5.0] to a big integer. + **ERROR** Failed to convert string [9223372036854775808] to a big integer. + +Testing toDouble + 0 + 5.25 + -5.25 + -3.4028226550889e+38 + 1e+100 + -1e+100 + 1.7976931348623e+308 + **ERROR** Failed to convert string [fred] to a double. + +Testing toString + bool(false): No + bool(true): Yes + char(A): A + int(2147483647): 2147483647 + uint(2147483648): 2147483648 + BigInt(2147483648): 2147483648 + double(0.0): 0.0 + double(DBL_MIN): 2.2250738585072e-308 + double(DBL_MAX*2): 1.79769313486232e+308 + double(-DBL_MAX*2): -1.79769313486232e+308 + double(sqrt(-1)): nan + double(5.25): 5.25 + double(-5.25): -5.25 + double(1e13): 10000000000000 + double(1e13+1): 1.0000000000001e+13 + double(1e-3): 0.001 + double(9e-4): 9.0e-04 + double(1e100): 1.0e+100 + double(-1e100): -1.0e+100 + +Testing cerr with QString and with QStringRef + QString + QStringRef + +---------------------------------- +-- Now testing deprecated class -- +---------------------------------- + +No arg construtor : Test string +Constructor IString: Test string again +Constructor char : 65 +Constructor int : 999 +Constructor BigInt : 9999999999 +Constructor double :999.999 +Before Trim : ABCDefghijkBCAD +Return Trim : efghijk +After Trim : efghijk +Before TrimHead : ABCDefghijkBCAD +Return TrimHead : efghijkBCAD +After TrimHead : efghijkBCAD +Middle test : efghijkBCAD +Before TrimTail : ABCDefghijkBCAD +Return TrimTail : ABCDefghijk +After TrimTail : ABCDefghijk +Middle test : ABCDefghijk +Before TrimHead : ABCDefghijkBCAD +After TrimHead : efghijkBCAD +Middle test : efghijkBCAD +Before TrimTail : ABCDefghijkBCAD +After TrimTail : ABCDefghijk +Middle test : ABCDefghijk +Before Upcase : abcdefghijklmnopqrstuvwxyzABC!@#$%^&*() +After Upcase : ABCDEFGHIJKLMNOPQRSTUVWXYZABC!@#$%^&*() +Before DownCase : ABCDEFGHIJKLMNOPQRSTUVWXYZABC!@#$%^&*() +After DownCase : abcdefghijklmnopqrstuvwxyzabc!@#$%^&*() +Integer : 987654321 +Integer : 987654321 +**ERROR** Failed to convert string [987trew] to an integer. +BigInteger : 9876543210 +BigInteger : 9876543210 +**ERROR** Failed to convert string [987trew] to a big integer. +Double : 9876.54321 +Double : 9876.54321 +**ERROR** Failed to convert string [123$987] to a double. +Exponent : 123.0E45 +Exponent : 1.23e+47 +25:255 35:15 +25 +255 +35 +15 +key1=tok1 key2="t o k 2" key3=(1,2,3,4) +key1 +tok1 +key2 +"t +o +k +2" +key3 +(1,2,3,4) +"abcd","1234" +"abcd" +"1234" +",1234","ab,cd" +" +1234" +"ab +cd" +/this/is/a/long/filename.jnk,seperated/by/a/comma/ending/with/ +/this/is/a/long/filename.jnk +seperated/by/a/comma/ending/with/ +/this/is/another/long/filename.jnk seperated/by/3/spaces/file2.tmp +token# 1>> /this/is/another/long/filename.jnk +token# 2>> +token# 3>> +token# 4>> seperated/by/3/spaces/file2.tmp + +Before compress > " " < +After compress > " " < +Before compress >| " " ' ' |< +After compress >| " " ' ' |< +Before compress > AB CD < +After compress > AB CD < +Before force compress > " " < +After force compress > " " < +Before force compress > "AB CD" < +After force compress > "AB CD" < +Before force compress > < +After force compress > < +Before convert >ABCDEFG< +After convert >A-C-E--< +Before replace >Thirteen is bigger than fourteen< +After replace >Thirteen is smaller than fourteen< +After convert white space >a b c< +Before Upcase >xxxXXX0< +After Upcase >XXXXXX0< +Before DownCase >XXXXXX0< +After DownCase >xxxxxx0< +Testing QT conversion: 1 +255.0 +0.333 +-255.0 +1.235e-20 +1.23456789012346e+19 +5.0e-04 +Before Remove >a 1 b 2 c 3 d 4 e 5< +After Remove >a b c 3 d e < +100 +100000000000 +100.1 +Before Replace (honor quotes) >I is a test string: 'I is' is "is a string"< +After Replace (honor quotes) >I am a test string: 'I is' is "is a string"< +Before Replace (dont honor quotes) >I is a test string: 'I is' is "is a string"< +After Replace (dont honor quotes) >I am a test string: 'I am' am "am a string"< +Before split >This is a test string< +After split > +Element 0: This +Element 1: is +Element 2: a +Element 3: test +Element 4: string +< + +Qt QStringList values: +String1 +String2 +String3 +String4 + +Converted to std::vector... +String1 +String2 +String3 +String4 +Are they equivalent? +Counts? Yes +string(String1) == QString(String1)? Yes +string(String2) == QString(String2)? Yes +string(String3) == QString(String3)? Yes +string(String4) == QString(String4)? Yes diff --git a/isis/src/core/tests/unitTests/IString/unitTest.cpp b/isis/src/core/tests/unitTests/IString/unitTest.cpp new file mode 100644 index 0000000000..a24fc43987 --- /dev/null +++ b/isis/src/core/tests/unitTests/IString/unitTest.cpp @@ -0,0 +1,400 @@ +#include "IString.h" + +#include +#include +#include +#include + +#include "IException.h" +#include "Preference.h" + +using namespace Isis; +using namespace std; + +inline string yesOrNo(bool b) { + if(b) return (string("Yes")); + return (string("No")); +} + +int main(int argc, char *argv[]) { + Preference::Preferences(true); + cerr.precision(14); + + // Tests for the functions + cerr << "Testing toBool" << endl; + cerr << "\tTrue: " << toBool("True") << endl; + cerr << "\tFalse: " << toBool("False") << endl; + + try { + toBool("..."); + } + catch (IException &e) { + cerr << "\t" << e.toString() << endl; + } + + cerr << endl; + cerr << "Testing toInt" << endl; + cerr << "\t" << toInt("0") << endl; + cerr << "\t" << toInt("5") << endl; + cerr << "\t" << toInt("-5") << endl; + cerr << "\t" << toInt("2147483647") << endl; + cerr << "\t" << toInt("-2147483647") << endl; + + try { + toInt("-5.0"); + } + catch (IException &e) { + cerr << "\t" << e.toString() << endl; + } + + try { + toInt("2147483648"); + } + catch (IException &e) { + cerr << "\t" << e.toString() << endl; + } + cerr << endl; + + cerr << "Testing toBigInt" << endl; + cerr << "\t" << toBigInt("0") << endl; + cerr << "\t" << toBigInt("5") << endl; + cerr << "\t" << toBigInt("-5") << endl; + cerr << "\t" << toBigInt("9223372036854775807") << endl; + cerr << "\t" << toBigInt("-9223372036854775807") << endl; + + try { + toBigInt("-5.0"); + } + catch (IException &e) { + cerr << "\t" << e.toString() << endl; + } + + try { + toBigInt("9223372036854775808"); + } + catch (IException &e) { + cerr << "\t" << e.toString() << endl; + } + cerr << endl; + + cerr << "Testing toDouble" << endl; + cerr << "\t" << toDouble("0.0") << endl; + cerr << "\t" << toDouble("5.25") << endl; + cerr << "\t" << toDouble("-5.25") << endl; + cerr << "\t" << toDouble("16#FF7FFFFB#") << endl; + cerr << "\t" << toDouble("1e100") << endl; + cerr << "\t" << toDouble("-1E100") << endl; + cerr << "\t" << toDouble("1.79769313486232e+308") << endl; + + try { + toDouble("fred"); + } + catch (IException &e) { + cerr << "\t" << e.toString() << endl; + } + cerr << endl; + + cerr << "Testing toString" << endl; + cerr << "\tbool(false): " << toString(false) << endl; + cerr << "\tbool(true): " << toString(true) << endl; + cerr << "\tchar(A): " << toString('A') << endl; + cerr << "\tint(2147483647): " << toString(2147483647) << endl; + cerr << "\tuint(2147483648): " << toString((unsigned int)2147483648) << endl; + cerr << "\tBigInt(2147483648): " << toString(2147483648) << endl; + cerr << "\tdouble(0.0): " << toString(0.0) << endl; + cerr << "\tdouble(DBL_MIN): " << toString(DBL_MIN) << endl; + cerr << "\tdouble(DBL_MAX*2): " << toString(DBL_MAX * 2) << endl; + cerr << "\tdouble(-DBL_MAX*2): " << toString(-DBL_MAX * 2) << endl; + cerr << "\tdouble(sqrt(-1)): " << toString(sqrt(-1)) << endl; + cerr << "\tdouble(5.25): " << toString(5.25) << endl; + cerr << "\tdouble(-5.25): " << toString(-5.25) << endl; + cerr << "\tdouble(1e13): " << toString(1e13) << endl; + cerr << "\tdouble(1e13+1): " << toString(1e13 + 1) << endl; + cerr << "\tdouble(1e-3): " << toString(1e-3) << endl; + cerr << "\tdouble(9e-4): " << toString(9e-4) << endl; + cerr << "\tdouble(1e100): " << toString(1e100) << endl; + cerr << "\tdouble(-1e100): " << toString(-1e100) << endl; + + cerr << endl; + cerr << "Testing cerr with QString and with QStringRef" << endl; + cerr << QString("\tQString\n"); + cerr << QString("\tQStringRef - FAIL!\n").leftRef(11) << endl; + + cerr << endl; + cerr << "----------------------------------" << endl; + cerr << "-- Now testing deprecated class --" << endl; + cerr << "----------------------------------" << endl; + cerr << endl; + + // Tests for non-static functions + try { + IString str0; + str0 = "Test string"; + cerr << "No arg construtor : " << str0 << endl; + + IString str1 = str0 + " again"; + cerr << "Constructor IString: " << str1 << endl; + + IString str1_5 = 'A'; + cerr << "Constructor char : " << str1_5 << endl; + + IString str2 = 999; + cerr << "Constructor int : " << str2 << endl; + + IString str2a = BigInt(9999999999LL); + cerr << "Constructor BigInt : " << str2a << endl; + + IString str3 = 999.999; + cerr << "Constructor double :" << str3 << endl; + + IString str4 = "ABCDefghijkBCAD"; + cerr << "Before Trim : " << str4 << endl; + cerr << "Return Trim : " << str4.Trim("ABCD") << endl; + cerr << "After Trim : " << str4 << endl; + + IString str5 = "ABCDefghijkBCAD"; + cerr << "Before TrimHead : " << str5 << endl; + cerr << "Return TrimHead : " << str5.TrimHead("DBCA") << endl; + cerr << "After TrimHead : " << str5 << endl; + cerr << "Middle test : " << str5.TrimHead("g") << endl; + + IString str6 = "ABCDefghijkBCAD"; + cerr << "Before TrimTail : " << str6 << endl; + cerr << "Return TrimTail : " << str6.TrimTail("DBCA") << endl; + cerr << "After TrimTail : " << str6 << endl; + cerr << "Middle test : " << str6.TrimTail("f") << endl; + + std::string str35 = "ABCDefghijkBCAD"; + cerr << "Before TrimHead : " << str35 << endl; + str35 = IString::TrimHead("DBCA", str35); + cerr << "After TrimHead : " << str35 << endl; + str35 = IString::TrimHead("g", str35); + cerr << "Middle test : " << str35 << endl; + + std::string str36 = "ABCDefghijkBCAD"; + cerr << "Before TrimTail : " << str36 << endl; + str36 = IString::TrimTail("DBCA", str36); + cerr << "After TrimTail : " << str36 << endl; + str36 = IString::TrimTail("f", str36); + cerr << "Middle test : " << str36 << endl; + + IString str7 = "abcdefghijklmnopqrstuvwxyzABC!@#$%^&*()"; + cerr << "Before Upcase : " << str7 << endl; + cerr << "After Upcase : " << str7.UpCase() << endl; + + cerr << "Before DownCase : " << str7 << endl; + cerr << "After DownCase : " << str7.DownCase() << endl; + + IString str8 = 987654321; + cerr << "Integer : " << str8 << endl; + cerr << "Integer : " << str8.ToInteger() << endl; + str8 = "987trew"; + try { + str8.ToInteger(); + } + catch(IException &error) { + error.print(); + } + + IString str8a = BigInt(9876543210LL); + cerr << "BigInteger : " << str8a << endl; + cerr << "BigInteger : " << str8a.ToBigInteger() << endl; + str8a = "987trew"; + try { + str8a.ToBigInteger(); + } + catch(IException &error) { + error.print(); + } + + IString str9 = 9876.54321; + cerr << "Double : " << str9.c_str() << endl; + cerr << "Double : " << str9.ToDouble() << endl; + str9 = "123$987"; + try { + str9.ToDouble(); + } + catch(IException &error) { + error.print(); + } + + IString str10 = "123.0E45"; + cerr << "Exponent : " << str10 << endl; + cerr << "Exponent : " << str10.ToDouble() << endl; + + IString str11 = "25:255 35:15"; + cerr << str11 << endl; + while(str11.length() > 0) { + cerr << str11.Token(": ") << endl; + } + + str11 = "key1=tok1 key2=\"t o k 2\" key3=(1,2,3,4)"; + cerr << str11 << endl; + while(str11.length() > 0) { + cerr << str11.Token("= ") << endl; + } + + str11 = "\"abcd\",\"1234\""; + cerr << str11 << endl; + while(str11.length() > 0) { + cerr << str11.Token(",") << endl; + } + + str11 = "\",1234\",\"ab,cd\""; + cerr << str11 << endl; + while(str11.length() > 0) { + cerr << str11.Token(",") << endl; + } + + str11 = "/this/is/a/long/filename.jnk,seperated/by/a/comma/ending/with/\r\n"; + cerr << str11.Trim("\r\n") << endl; + while(str11.length() > 0) { + cerr << str11.Token(",") << endl; + } + + str11 = "/this/is/another/long/filename.jnk seperated/by/3/spaces/file2.tmp"; + cerr << str11.Trim("\r\n") << endl; + int m = 1; + while(str11.length() > 0) { + cerr << "token# " << m++ << ">> " << str11.Token(" ") << endl; + } + + cerr << endl; + + IString str12 = " \" \" "; + cerr << "Before compress >" << str12 << "<" << endl; + str12.Compress(); + cerr << "After compress >" << str12 << "<" << endl; + + IString str12b = "| \" \" \' \' |"; + cerr << "Before compress >" << str12b << "<" << endl; + str12b.Compress(); + cerr << "After compress >" << str12b << "<" << endl; + + IString str13 = " AB CD "; + cerr << "Before compress >" << str13 << "<" << endl; + str13.Compress(); + cerr << "After compress >" << str13 << "<" << endl; + + IString str14 = " \" \" "; + cerr << "Before force compress >" << str14 << "<" << endl; + cerr << "After force compress >" << str14.Compress(true) << "<" << endl; + + IString str15 = " \"AB CD\" "; + cerr << "Before force compress >" << str15 << "<" << endl; + cerr << "After force compress >" << str15.Compress(true) << "<" << endl; + + IString str16 = " "; + cerr << "Before force compress >" << str16 << "<" << endl; + cerr << "After force compress >" << str16.Compress(true) << "<" << endl; + + IString str17 = "ABCDEFG"; + cerr << "Before convert >" << str17 << "<" << endl; + cerr << "After convert >" << str17.Convert("BDFG", '-') << "<" << endl; + + IString str18 = "Thirteen is bigger than fourteen"; + cerr << "Before replace >" << str18 << "<" << endl; + cerr << "After replace >" << str18.Replace("bigger", "smaller") << "<" << endl; + + IString str19 = "a\tb\b\n\v\f\r c"; + // Don't cerr the before string, it will cause all sorts of problems + // cerr << "Before convert >" << str19 << "<" << endl; + cerr << "After convert white space >" << str19.ConvertWhiteSpace() << "<" << endl; + + IString str20 = "xxxXXX0"; + cerr << "Before Upcase >" << str20 << "<" << endl; + cerr << "After Upcase >" << str20.UpCase() << "<" << endl; + + cerr << "Before DownCase >" << str20 << "<" << endl; + cerr << "After DownCase >" << str20.DownCase() << "<" << endl; + + IString str21 = "Test String"; + QString qstr1 = "Test String"; + cerr << "Testing QT conversion: " << (str21.ToQt() == qstr1) << endl; + + IString str22(255.0); + IString str23(0.333); + IString str24(-255.0); + IString str25(1.235E-20); + IString str26(12345678901234567890.0); + IString str27(0.0005); + cerr << str22 << endl; + cerr << str23 << endl; + cerr << str24 << endl; + cerr << str25 << endl; + cerr << str26 << endl; + cerr << str27 << endl; + + IString str28("a 1 b 2 c 3 d 4 e 5"); + cerr << "Before Remove >" << str28 << "<" << endl; + cerr << "After Remove >" << str28.Remove("1245") << "<" << endl; + + IString str29("100"); + int i = str29; + cerr << i << endl; + + IString str29a("100000000000"); + BigInt j = str29a; + cerr << j << endl; + + IString str30("100.1"); + double d = str30; + cerr << d << endl; + + IString str31("I is a test string: 'I is' is \"is a string\""); + IString str31a("I is a test string: 'I is' is \"is a string\""); + cerr << "Before Replace (honor quotes) >" << str31 << "<" << endl; + str31.Replace("is", "am", true); + cerr << "After Replace (honor quotes) >" << str31 << "<" << endl; + cerr << "Before Replace (dont honor quotes) >" << str31a << "<" << endl; + str31a.Replace("is", "am", false); + cerr << "After Replace (dont honor quotes) >" << str31a << "<" << endl; + + } + catch(IException &error) { + error.print(); + } + + //Tests for static functions untested above + try { + //Split test + string str1 = "This is a test string"; + vector strVec; + IString::Split(' ', str1, strVec); + cerr << "Before split >" << str1 << "<" << endl; + cerr << "After split >"; + for(unsigned int i = 0 ; i < strVec.size() ; i++) { + cerr << endl << "Element " << i << ": " << strVec[i]; + } + cerr << endl << "<" << endl; + + QStringList qlist; + qlist << "String1" + << "String2" + << "String3" + << "String4"; + + cerr << "\nQt QStringList values:\n"; + for(int i = 0 ; i < qlist.size() ; i++) { + cerr << qlist.at(i).toLocal8Bit().constData() << endl; + } + + cerr << "\nConverted to std::vector...\n"; + vector slist = IString::ToStd(qlist); + copy(slist.begin(), slist.end(), ostream_iterator(cerr, "\n")); + + cerr << "Are they equivalent?\n"; + cerr << "Counts? " << yesOrNo((int) slist.size() == qlist.size()) << endl; + for(int j = 0 ; j < qlist.size() ; j++) { + QString qs = qlist.at(j); + string ss = slist.at(j); + cerr << "string(" << ss << ") == QString(" + << qs.toLocal8Bit().constData() << ")? " + << yesOrNo(ss == qs.toStdString()) << endl; + } + + } + catch(IException &error) { + error.print(); + } +} diff --git a/isis/src/core/tests/unitTests/Message/Message.truth b/isis/src/core/tests/unitTests/Message/Message.truth new file mode 100644 index 0000000000..2146228161 --- /dev/null +++ b/isis/src/core/tests/unitTests/Message/Message.truth @@ -0,0 +1,28 @@ +Array subscript [100000] is out of array bounds + +Keyword [KEY] ambiguous +Keyword [KEY] unrecognized +Keyword [KEY] duplicated +Keyword [KEY] is not an array +Keyword [KEY] required but was not found + +Keyword block [BLOCK] is invalid +Expecting start of keyword block [BLOCK] but found [FOUND] +Expecting end of keyword block [BLOCK] but found [FOUND] + +Keyword [KEY] has bad value +Keyword [KEY] has bad value [12345678901234567890] +Keyword [KEY] has bad value [abcdefghijklmnopqrst ...] +Keyword value for [KEY] expected but was not found +Keyword [KEY=0] is not in the range of (0,20] +Keyword [KEY=A] must be one of [X,Y,Z] + +Missing delimiter [)] +Missing delimiter [)] at or near [12345678901234567890] +Missing delimiter [)] at or near [abcdefghijklmnopqrst ...] + +Unable to open [test.dat] +Unable to create [test.dat] +Unable to read [test.dat] +Unable to write [test.dat] + diff --git a/isis/src/core/tests/unitTests/Message/unitTest.cpp b/isis/src/core/tests/unitTests/Message/unitTest.cpp new file mode 100644 index 0000000000..05b3741238 --- /dev/null +++ b/isis/src/core/tests/unitTests/Message/unitTest.cpp @@ -0,0 +1,99 @@ +#include + +#include "Message.h" +#include "Preference.h" +#include "IString.h" + +using namespace Isis; +using namespace std; + +int main(void) { + Preference::Preferences(true); + + +//*************************************************************************** + cout << Message::ArraySubscriptNotInRange(100000) + << endl; + + cout << endl; + +//*************************************************************************** + + cout << Message::KeywordAmbiguous("KEY") + << endl; + + cout << Message::KeywordUnrecognized("KEY") + << endl; + + cout << Message::KeywordDuplicated("KEY") + << endl; + + cout << Message::KeywordNotArray("KEY") + << endl; + + cout << Message::KeywordNotFound("KEY") + << endl; + + cout << endl; + +//*************************************************************************** + + cout << Message::KeywordBlockInvalid("BLOCK") + << endl; + + cout << Message::KeywordBlockStartMissing("BLOCK", "FOUND") + << endl; + + cout << Message::KeywordBlockEndMissing("BLOCK", "FOUND") + << endl; + + cout << endl; + +//*************************************************************************** + + cout << Message::KeywordValueBad("KEY") + << endl; + + cout << Message::KeywordValueBad("KEY", "12345678901234567890") + << endl; + + cout << Message::KeywordValueBad("KEY", "abcdefghijklmnopqrstuvwxyz") + << endl; + + cout << Message::KeywordValueExpected("KEY") + << endl; + + cout << Message::KeywordValueNotInRange("KEY", "0", "(0,20]") + << endl; + + vector list; + list.push_back("X"); + list.push_back("Y"); + list.push_back("Z"); + cout << Message::KeywordValueNotInList("KEY", "A", list) + << endl; + + cout << endl; + +//*************************************************************************** + + cout << Message::MissingDelimiter(')') + << endl; + + cout << Message::MissingDelimiter(')', "12345678901234567890") + << endl; + + cout << Message::MissingDelimiter(')', "abcdefghijklmnopqrstuvwxyz") + << endl; + + cout << endl; + +//*************************************************************************** + + cout << Message::FileOpen("test.dat") << endl; + cout << Message::FileCreate("test.dat") << endl; + cout << Message::FileRead("test.dat") << endl; + cout << Message::FileWrite("test.dat") << endl; + + cout << endl; +} diff --git a/isis/src/core/tests/unitTests/Preference/Preference.truth b/isis/src/core/tests/unitTests/Preference/Preference.truth new file mode 100644 index 0000000000..82cfeb16f8 --- /dev/null +++ b/isis/src/core/tests/unitTests/Preference/Preference.truth @@ -0,0 +1,13 @@ +Testing normally +Group = Junk + Fruit = Tomato + Vegetable = Potato +End_Group +Group = Junk + Fruit = Tomato + Vegetable = Potatoe +End_Group + + +Value of Vegetable is : Potatoe +**USER ERROR** The preference file dummyPrefs was not found or does not exist. diff --git a/isis/src/core/tests/unitTests/Preference/unitTest.cpp b/isis/src/core/tests/unitTests/Preference/unitTest.cpp new file mode 100644 index 0000000000..2835523137 --- /dev/null +++ b/isis/src/core/tests/unitTests/Preference/unitTest.cpp @@ -0,0 +1,70 @@ +#include + +#include "Preference.h" +#include "IException.h" + +using namespace Isis; +using namespace std; + +int main() { + try { + // Note: Normally a call to Preferences in a unitTest would be called + // with a true. In this case however, we can't have the Preferences + // call clearing the the Pvl everytime. We aren't using any keywords + // from the preferences anyway, just the ones we add. + Isis::Preference::Preferences(false); + Isis::Pvl system; + Isis::PvlGroup j1("Junk"); + j1 += Isis::PvlKeyword("Fruit", "Tomato"); + j1 += Isis::PvlKeyword("Vegetable", "Potato"); + system.addGroup(j1); + system.write("tmpSystem"); + + Isis::Pvl user; + Isis::PvlGroup j2("Junk"); + j2 += Isis::PvlKeyword("Vegetable", "Potatoe"); + user.addGroup(j2); + user.write("tmpUser"); + + cout << "Testing normally" << endl; +#if 0 + Isis::Preference p2; + p2.Load("tmpSystem"); + cout << p2 << endl; + p2.Load("tmpUser"); + cout << p2 << endl; +#endif + + Isis::Preference::Preferences(false).Load("tmpSystem"); + Isis::PvlGroup j3 = Isis::Preference::Preferences(false).findGroup("Junk"); + cout << j3 << endl; + Isis::Preference::Preferences(false).Load("tmpUser"); + Isis::PvlGroup j4 = Isis::Preference::Preferences(false).findGroup("Junk"); + cout << j4 << endl; + + cout << endl << endl; + // if (p2.hasGroup("Junk")) { + if(Isis::Preference::Preferences(false).hasGroup("Junk")) { + Isis::PvlGroup &g = Isis::Preference::Preferences(false).findGroup("Junk"); + cout << "Value of Vegetable is : " << (QString) g["Vegetable"] << endl; + } + + remove("tmpSystem"); + remove("tmpUser"); + } + catch(Isis::IException &error) { + error.print(); + } + + // Now test without a preference file to see if the expected exception is thrown + try { + Isis::Preference::Preferences(true); + Isis::Preference::Preferences(true).Load("dummyPrefs"); + } + // Expect to see: "The preference file dummyPrefs was not found or does not exist." + catch(Isis::IException &error) { + error.print(); + } + + return 0; +} diff --git a/isis/src/core/tests/unitTests/Pvl/Pvl.truth b/isis/src/core/tests/unitTests/Pvl/Pvl.truth new file mode 100644 index 0000000000..cb690474d7 --- /dev/null +++ b/isis/src/core/tests/unitTests/Pvl/Pvl.truth @@ -0,0 +1,381 @@ +p: LongKeyword = "This is a very long keyword value which was causing some + problems when the Pvl was output. The fist couple of lines + looked good, but after that things went south. Some lines get + nothing, others get bad indenting, most were too short" +End +copy deleted a keyword... +p: LongKeyword = "This is a very long keyword value which was causing some + problems when the Pvl was output. The fist couple of lines + looked good, but after that things went south. Some lines get + nothing, others get bad indenting, most were too short" +End + +copy: End + + +LongKeyword = "This is a very long keyword value which was causing some + problems when the Pvl was output. The fist couple of lines + looked good, but after that things went south. Some lines get + nothing, others get bad indenting, most were too short" +LongKeyword = "This is a very long keyword value which was causing some + problems when the Pvl was output. The fist couple of lines + looked good, but after that things went south. Some lines get + nothing, others get bad indenting, most were too short" + +Group = Test + Keyword = Value +End_Group + +Group = Test + Keyword = Value +End_Group +End + +THE_INTERNET = "Seven thousand eight + hundred forty three million + seventy four nine seventy + six forty two eighty nine + sixty seven thirty five + million jillion bajillion + google six nine four one two + three four five six seven + eight nine ten eleven twelve + thirteen fourteen" + +BIG_HUGE_LONG_NAME_THAT_SHOULD_TEST_OUT_PARSING = "Seven thousand eight + hundred forty three million + seventy four" +ARRAY_TEST = (5.87 , + 5465.6 , + 574.6 , + 42 ) +FIRST_100_DIGITS_OF_PI = 3.1415926535897932384626433- + 832795028841971693993751058- + 209749445923078164062862089- + 986280348253421170679 +A = XXXXXXXXXXxxxxxxxxxxXXXXXXX- + XXXxxxxxxxxxxXXXXXXXXXXxxxx- + xxxxxxXXXXXXXXXXxxxx +UGHHHHHHHHHHHH = (59999.0, 59999.0, 59999.0, + 59999.0, 59999.0, 59999.0, + 59999.0, 59999.0, 59999.0, + 59999.0, 59999.0, 59999.0) +NAME = 5.2 +KEY = Null + +# Hello World! This is a really really long comment that needs to be +# wrapped onto several different lines to make the PVL file look really +# pretty! +KEY = (5, Null, 3.3 , + "Hello World!") + +# Hello World! This is a really really long comment that needs to be +# wrapped onto several different lines to make the PVL file look really +# pretty! +KEY = (5, 88, 3.3 , + "Hello World!") +dog = Big + +# Big +Cat = (Big, Tabby) +key = ((a, b, c), ("Hubba Hubba", + Bubba)) +End + +temp = (a, b, c) +End + +**ERROR** Unable to read PVL file [unitTest2.pvl]. +**ERROR** Error in PVL file on line [9]. +**ERROR** Unable to read PVL keyword [Dog = Big Dog]. +**ERROR** Keyword has extraneous data [Dog] at the end. + +**ERROR** Unable to read PVL file [unitTest3.pvl]. +**ERROR** Error in PVL file on line [12]. +**ERROR** Unexpected [EndGroup] in PVL Object [A]. + +Testing MESSENGER labels with data at bottom... + +PDS_VERSION_ID = PDS3 + +/* ** FILE FORMAT ** */ +RECORD_TYPE = FIXED_LENGTH +RECORD_BYTES = 1024 +FILE_RECORDS = 1031 +LABEL_RECORDS = 0007 + +/* ** POINTERS TO START BYTE OFFSET OF OBJECTS IN IMAGE FILE ** */ +^IMAGE = 0008 + +/* ** GENERAL DATA DESCRIPTION PARAMETERS ** */ +MISSION_NAME = MESSENGER +INSTRUMENT_HOST_NAME = MESSENGER +DATA_SET_ID = MESS-E/V/H-MDIS-2-EDR-RAWDATA-V1.0 +DATA_QUALITY_ID = 0000000000000000 +PRODUCT_ID = EN0131771763M +PRODUCT_VERSION_ID = 3 +SOURCE_PRODUCT_ID = 0131771763_IM5 +PRODUCER_INSTITUTION_NAME = "APPLIED COHERENT TECHNOLOGY CORPORATION" +SOFTWARE_NAME = MDIS2EDR +SOFTWARE_VERSION_ID = 0.7 +MISSION_PHASE_NAME = "MERCURY 2 FLYBY" +TARGET_NAME = MERCURY +SEQUENCE_NAME = 08280_DEP_NAC_MOSAIC_2 +OBSERVATION_ID = 6623 + +/* ** TIME PARAMETERS ** */ +START_TIME = 2008-10-06T09:12:00.325595 +STOP_TIME = 2008-10-06T09:12:00.339595 +SPACECRAFT_CLOCK_START_COUNT = 1/0131771763:976000 +SPACECRAFT_CLOCK_STOP_COUNT = 1/0131771763:990000 +PRODUCT_CREATION_TIME = 2009-12-14T21:38:50 + +/* ** INSTRUMENT ENGINEERING PARAMETERS ** */ +INSTRUMENT_NAME = "MERCURY DUAL IMAGING SYSTEM NARROW ANGLE + CAMERA" +INSTRUMENT_ID = MDIS-NAC +FILTER_NAME = "748 BP 53" +FILTER_NUMBER = N/A +CENTER_FILTER_WAVELENGTH = 747.7 +BANDWIDTH = 52.6 +EXPOSURE_DURATION = 14 +EXPOSURE_TYPE = AUTO +DETECTOR_TEMPERATURE = -37.62 +FOCAL_PLANE_TEMPERATURE = -28.76 +FILTER_TEMPERATURE = N/A +OPTICS_TEMPERATURE = -28.61 + +/* ** INSTRUMENT RAW PARAMETERS ** */ +MESS:MET_EXP = 131771763 +MESS:IMG_ID_LSB = N/A +MESS:IMG_ID_MSB = N/A +MESS:ATT_CLOCK_COUNT = 131771761 +MESS:ATT_Q1 = -0.49568507 +MESS:ATT_Q2 = -0.63451749 +MESS:ATT_Q3 = 0.35215572 +MESS:ATT_Q4 = -0.47714800 +MESS:ATT_FLAG = 7 +MESS:PIV_POS_MOTOR = N/A +MESS:PIV_GOAL = 7895 +MESS:PIV_POS = 7896 +MESS:PIV_READ = 23068 +MESS:PIV_CAL = -26758 +MESS:FW_GOAL = 6492 +MESS:FW_POS = 6436 +MESS:FW_READ = 6436 +MESS:CCD_TEMP = 1044 +MESS:CAM_T1 = 468 +MESS:CAM_T2 = 496 +MESS:EXPOSURE = 14 +MESS:DPU_ID = 0 +MESS:IMAGER = 1 +MESS:SOURCE = 0 +MESS:FPU_BIN = 0 +MESS:COMP12_8 = 1 +MESS:COMP_ALG = 2 +MESS:COMP_FST = 1 +MESS:TIME_PLS = 2 +MESS:LATCH_UP = 0 +MESS:EXP_MODE = 1 +MESS:PIV_STAT = 3 +MESS:PIV_MPEN = 1 +MESS:PIV_PV = 1 +MESS:PIV_RV = 1 +MESS:FW_PV = 1 +MESS:FW_RV = 1 +MESS:AEX_STAT = 512 +MESS:AEX_STHR = 5 +MESS:AEX_TGTB = 2400 +MESS:AEX_BACB = 240 +MESS:AEX_MAXE = 14 +MESS:AEX_MINE = 1 +MESS:DLNKPRIO = 5 +MESS:WVLRATIO = 8 +MESS:PIXELBIN = 0 +MESS:SUBFRAME = 0 +MESS:SUBF_X1 = 4 +MESS:SUBF_Y1 = 0 +MESS:SUBF_DX1 = 0 +MESS:SUBF_DY1 = 0 +MESS:SUBF_X2 = 4 +MESS:SUBF_Y2 = 0 +MESS:SUBF_DX2 = 0 +MESS:SUBF_DY2 = 0 +MESS:SUBF_X3 = 0 +MESS:SUBF_Y3 = 0 +MESS:SUBF_DX3 = 0 +MESS:SUBF_DY3 = 0 +MESS:SUBF_X4 = 0 +MESS:SUBF_Y4 = 0 +MESS:SUBF_DX4 = 0 +MESS:SUBF_DY4 = 0 +MESS:SUBF_X5 = 0 +MESS:SUBF_Y5 = 0 +MESS:SUBF_DX5 = 0 +MESS:SUBF_DY5 = 0 +MESS:CRITOPNV = 0 +MESS:JAILBARS = 0 +MESS:JB_X0 = 0 +MESS:JB_X1 = 0 +MESS:JB_SPACE = 0 + +/* ** GEOMETRY INFORMATION ** */ +RIGHT_ASCENSION = 329.96796 +DECLINATION = -11.56931 +TWIST_ANGLE = 13.73197 +RA_DEC_REF_PIXEL = (512.00000, 512.00000) +RETICLE_POINT_RA = (329.41279, 330.88844, 329.04957, + 330.52952) +RETICLE_POINT_DECLINATION = (-12.47527, -12.12267, -11.02525, + -10.67174) + +/* ** TARGET PARAMETERS ** */ +SC_TARGET_POSITION_VECTOR = (-8919.18729, 5554.99303, 3662.51393) +TARGET_CENTER_DISTANCE = 11127.61690 + +/* ** TARGET WITHIN SENSOR FOV ** */ +SLANT_DISTANCE = 9115.65447 +CENTER_LATITUDE = 24.03182 +CENTER_LONGITUDE = 297.29424 +HORIZONTAL_PIXEL_SCALE = 232.40761 +VERTICAL_PIXEL_SCALE = 232.40761 +SMEAR_MAGNITUDE = 0.10555 +SMEAR_AZIMUTH = 94.46806 +NORTH_AZIMUTH = 108.06205 +RETICLE_POINT_LATITUDE = (21.08301, 20.54907, 27.64956, 27.16452) +RETICLE_POINT_LONGITUDE = (301.32304, 295.12377, 299.48568, + 292.69017) + +/* ** SPACECRAFT POSITION WITH RESPECT TO CENTRAL BODY ** */ +SUB_SPACECRAFT_LATITUDE = -1.04438 +SUB_SPACECRAFT_LONGITUDE = 315.57322 +SPACECRAFT_ALTITUDE = 8687.61690 +SUB_SPACECRAFT_AZIMUTH = 243.13066 + +/* ** SPACECRAFT LOCATION ** */ +SPACECRAFT_SOLAR_DISTANCE = 51220537.58833 +SC_SUN_POSITION_VECTOR = (50079853.32484, 10735834.95784, + 541857.50763) +SC_SUN_VELOCITY_VECTOR = (24.24499, -44.99506, -26.54238) + +/* ** VIEWING AND LIGHTING GEOMETRY (SUN ON TARGET) ** */ +SOLAR_DISTANCE = 51228055.72874 +SUB_SOLAR_AZIMUTH = 194.38217 +SUB_SOLAR_LATITUDE = -0.01056 +SUB_SOLAR_LONGITUDE = 3.05715 +INCIDENCE_ANGLE = 67.98720 +PHASE_ANGLE = 43.57603 +EMISSION_ANGLE = 38.58010 +LOCAL_HOUR_ANGLE = 114.23708 + +Object = IMAGE + LINES = 1024 + LINE_SAMPLES = 1024 + SAMPLE_TYPE = MSB_UNSIGNED_INTEGER + SAMPLE_BITS = 8 + UNIT = N/A + DARK_STRIP_MEAN = 10.107 + + /* ** IMAGE STATISTICS OF ** */ + /* ** THE EXPOSED CCD AREA ** */ + MINIMUM = 16.000 + MAXIMUM = 124.000 + MEAN = 65.736 + STANDARD_DEVIATION = 8.835 + + /* ** PIXEL COUNTS ** */ + SATURATED_PIXEL_COUNT = 0 + MISSING_PIXELS = 0 +End_Object + +/* ** GEOMETRY FOR EACH SUBFRAME ** */ +Group = SUBFRAME1_PARAMETERS + RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) + RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) +End_Group + +Group = SUBFRAME2_PARAMETERS + RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) + RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) +End_Group + +Group = SUBFRAME3_PARAMETERS + RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) + RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) +End_Group + +Group = SUBFRAME4_PARAMETERS + RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) + RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) +End_Group + +Group = SUBFRAME5_PARAMETERS + RETICLE_POINT_LATITUDE = (N/A, N/A, N/A, N/A) + RETICLE_POINT_LONGITUDE = (N/A, N/A, N/A, N/A) +End_Group +End + + + +***Template PVL** +Object = Filters + Filters__Required = true + Test_Required = false + Test_Repeated = true + Test = string + + Group = Point_ErrorMagnitude + Point_ErrorMagnitude__Required = false + LessThan = double + LessThan__Required = false + LessThan__Repeated = false + GreaterThan = double + GreaterThan__Required = false + GreaterThan__Repeated = false + End_Group + + Group = Point_CubeNames + Point_CubeNames__Required = false + Cube = string + Cube__Required = false + Cube__Repeated = true + End_Group +End_Object +End + + +***Test PVL** +Object = Filters + Test12 = Testing + Test = Testing + Test = Testing + + Group = Pointerrormagnitude + LessThan = 3.5 + GreaterThan = 0 + End_Group + + Group = Point_errormagnitude2 + lessthan = 3.5 + GreaterThan = 0 + End_Group + + Group = Point_CubeNames + Cube = SerialNumber1 + Cube = SerialNumber2 + Cube = SerialNumber3 + End_Group +End_Object +End + + +**Result PVL** +Object = Filters + Test12 = Testing + + Group = Point_errormagnitude2 + lessthan = 3.5 + GreaterThan = 0 + End_Group +End_Object +End diff --git a/isis/src/core/tests/unitTests/Pvl/cnetstatsTest.def b/isis/src/core/tests/unitTests/Pvl/cnetstatsTest.def new file mode 100644 index 0000000000..eba46825b6 --- /dev/null +++ b/isis/src/core/tests/unitTests/Pvl/cnetstatsTest.def @@ -0,0 +1,21 @@ +Object = Filters + Filters__Required = true + Group = Point_ErrorMagnitude + Point_ErrorMagnitude__Required = false + LessThan = double + LessThan__Required = false + LessThan__Repeated = false + GreaterThan = double + GreaterThan__Required = false + GreaterThan__Repeated = false + EndGroup + Group = Point_CubeNames + Point_CubeNames__Required = false + Cube = string + Cube__Required = false + Cube__Repeated = true + EndGroup + Test_Required = false + Test_Repeated = true + Test = string +EndObject \ No newline at end of file diff --git a/isis/src/core/tests/unitTests/Pvl/pointdef.def b/isis/src/core/tests/unitTests/Pvl/pointdef.def new file mode 100644 index 0000000000..0f6c0031d5 --- /dev/null +++ b/isis/src/core/tests/unitTests/Pvl/pointdef.def @@ -0,0 +1,18 @@ +Object = Filters + Group = Pointerrormagnitude + LessThan = 3.5 + GreaterThan=0 + EndGroup + Group = Point_errormagnitude2 + lessthan = 3.5 + GreaterThan=0 + EndGroup + Group = Point_CubeNames + Cube = SerialNumber1 + Cube = SerialNumber2 + Cube = SerialNumber3 + EndGroup + Test12 = "Testing" + Test = "Testing" + Test = "Testing" +EndObject diff --git a/isis/src/core/tests/unitTests/Pvl/unitTest.cpp b/isis/src/core/tests/unitTests/Pvl/unitTest.cpp new file mode 100644 index 0000000000..f2b6d41e0c --- /dev/null +++ b/isis/src/core/tests/unitTests/Pvl/unitTest.cpp @@ -0,0 +1,144 @@ +#include "Pvl.h" +#include "IException.h" +#include "Preference.h" + +#include +#include + +using namespace Isis; +using namespace std; + +int main() { + Preference::Preferences(true); + + Pvl p; + p += PvlKeyword("LongKeyword", "This is a very long keyword value which " + "was causing some problems when the Pvl was output." + " The fist couple of lines looked good, but after that " + "things went south. Some lines get nothing, others get" + " bad indenting, most were too short"); + + cout << "p: " << p << "\n"; + Pvl &ref = p; + Pvl copy(p); + copy.deleteKeyword("LongKeyword"); + cout << "copy deleted a keyword...\np: " << p << "\n\ncopy: " << copy << "\n\n\n"; + + PvlGroup g("Test"); + g += PvlKeyword("Keyword", "Value"); + p.addGroup(g); + + p.setTerminator(""); + ref.write("tmp.unitTest"); + p.append("tmp.unitTest"); + + Pvl p2; + p2.read("tmp.unitTest"); + cout << p2 << endl << endl; + + Pvl p3; + p3.read("unitTest.pvl"); + cout << p3 << endl << endl; + + stringstream os; + os << "temp = (a,b,c)"; + + Pvl p4; + os >> p4; + cout << p4 << endl << endl; + remove("tmp.unitTest"); + + try { + Pvl p5; + p5.read("unitTest2.pvl"); + cout << p5 << endl << endl; + } + catch(IException &e) { + cout.flush(); + + // make this error work regardless of directory... + QString errors = e.toString(); + + while(errors.indexOf("/") != -1) { + int pos = errors.indexOf("/"); + + if(errors.indexOf("/", pos + 1) < errors.indexOf("]")) { + errors = errors.mid(0, pos + 1) + + errors.mid(errors.indexOf("/", pos + 1) + 1); + } + else { + errors = errors.mid(0, pos - 1) + errors.mid(pos + 1); + } + } + + cout << errors; + } + + cout << endl << endl; + + try { + Pvl p6; + p6.read("unitTest3.pvl"); + cout << p6 << endl << endl; + } + catch(IException &e) { + cout.flush(); + + // make this error work regardless of directory... + QString errors = e.toString(); + + while(errors.indexOf("/") != -1) { + int pos = errors.indexOf("/"); + + if(errors.indexOf("/", pos + 1) < errors.indexOf("]")) { + errors = errors.mid(0, pos + 1) + + errors.mid(errors.indexOf("/", pos + 1) + 1); + } + else { + errors = errors.mid(0, pos - 1) + errors.mid(pos + 1); + } + } + + cout << errors; + } + + cout << endl << endl; + + cout << "Testing MESSENGER labels with data at bottom..." << endl << endl; + try { + Pvl p7; + p7.read("unitTest4.pvl"); + cout << p7 << endl << endl; + } + catch(IException &e) { + cout.flush(); + + // make this error work regardless of directory... + QString errors = e.toString(); + + while(errors.indexOf("/") != -1) { + int pos = errors.indexOf("/"); + + if(errors.indexOf("/", pos + 1) < errors.indexOf("]")) { + errors = errors.mid(0, pos + 1) + + errors.mid(errors.indexOf("/", pos + 1) + 1); + } + else { + errors = errors.mid(0, pos - 1) + errors.mid(pos + 1); + } + } + + cout << errors; + } + + // Validate a PVL + Pvl pvlTmpl("cnetstatsTest.def"); + cout << "\n\n***Template PVL**\n" << pvlTmpl << endl; + + Pvl pvlUser("pointdef.def"); + cout << "\n\n***Test PVL**\n" << pvlUser << endl; + + Pvl pvlResults; + pvlTmpl.validatePvl(pvlUser, pvlResults); + cout << "\n\n**Result PVL**\n" << pvlResults << endl; +} diff --git a/isis/src/core/tests/unitTests/Pvl/unitTest.pvl b/isis/src/core/tests/unitTests/Pvl/unitTest.pvl new file mode 100644 index 0000000000..16de2e79bf --- /dev/null +++ b/isis/src/core/tests/unitTests/Pvl/unitTest.pvl @@ -0,0 +1,34 @@ +THE_INTERNET = "Seven thousand eight hundred forty three million seventy four + nine seventy six forty two eighty nine sixty seven thirty five + million jillion bajillion google six nine four one two three + four five six seven eight nine ten eleven twelve thirteen + fourteen" +BIG_HUGE_LONG_NAME_THAT_SHOULD_TEST_OUT_PARSING = "Seven thousand eight + hundred forty three million + seventy four" +ARRAY_TEST = (5.87 , 5465.6 , 574.6 , + 42 ) +FIRST_100_DIGITS_OF_PI = 3.14159265358979323846264338327950288419716939937510- + 58209749445923078164062862089986280348253421170679 +A = XXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxx +UGHHHHHHHHHHHH = (59999.0, 59999.0, 59999.0, 59999.0, 59999.0, 59999.0, + 59999.0, 59999.0, 59999.0, 59999.0, 59999.0, 59999.0) +NAME = 5.2 +KEY = Null +# Hello World! This is a really really long comment that needs to be +# wrapped onto several different lines to make the PVL file look really +# pretty! +KEY = (5, Null, 3.3 , "Hello World!") + +# Hello World! This is a really really long comment that needs to be +# wrapped onto several different lines to make the PVL file look really +# pretty! +KEY = (5, 88, 3.3 , "Hello World!") +dog = Big + +# Big +Cat = (Big, Tabby) + +key = ((a, b, c), ("Hubba Hubba", Bubba)) + +# Some Junk Comment diff --git a/isis/src/core/tests/unitTests/Pvl/unitTest2.pvl b/isis/src/core/tests/unitTests/Pvl/unitTest2.pvl new file mode 100644 index 0000000000..efb595f0cc --- /dev/null +++ b/isis/src/core/tests/unitTests/Pvl/unitTest2.pvl @@ -0,0 +1,12 @@ +Object = A + Object = B + + Key = Value + EndObject + + Object = C + Group = D + Dog = Big Dog + EndGroup + EndObject +EndObject diff --git a/isis/src/core/tests/unitTests/Pvl/unitTest3.pvl b/isis/src/core/tests/unitTests/Pvl/unitTest3.pvl new file mode 100644 index 0000000000..95419c9afb --- /dev/null +++ b/isis/src/core/tests/unitTests/Pvl/unitTest3.pvl @@ -0,0 +1,12 @@ +Object = A + Object = B + + Key = Value + EndObject + + Object = C + Group = D + Dog = Big + EndGroup + EndObject +EndGroup diff --git a/isis/src/core/tests/unitTests/Pvl/unitTest4.pvl b/isis/src/core/tests/unitTests/Pvl/unitTest4.pvl new file mode 100644 index 0000000000..0e5a4e8676 --- /dev/null +++ b/isis/src/core/tests/unitTests/Pvl/unitTest4.pvl @@ -0,0 +1,224 @@ +PDS_VERSION_ID = PDS3 + +/* ** FILE FORMAT ** */ +RECORD_TYPE = FIXED_LENGTH +RECORD_BYTES = 1024 +FILE_RECORDS = 1031 +LABEL_RECORDS = 0007 + +/* ** POINTERS TO START BYTE OFFSET OF OBJECTS IN IMAGE FILE ** */ +^IMAGE = 0008 + +/* ** GENERAL DATA DESCRIPTION PARAMETERS ** */ +MISSION_NAME = "MESSENGER" +INSTRUMENT_HOST_NAME = "MESSENGER" +DATA_SET_ID = "MESS-E/V/H-MDIS-2-EDR-RAWDATA-V1.0" +DATA_QUALITY_ID = "0000000000000000" +PRODUCT_ID = "EN0131771763M" +PRODUCT_VERSION_ID = "3" +SOURCE_PRODUCT_ID = ("0131771763_IM5") +PRODUCER_INSTITUTION_NAME = "APPLIED COHERENT TECHNOLOGY CORPORATION" +SOFTWARE_NAME = "MDIS2EDR" +SOFTWARE_VERSION_ID = "0.7" +MISSION_PHASE_NAME = "MERCURY 2 FLYBY" +TARGET_NAME = "MERCURY" +SEQUENCE_NAME = "08280_DEP_NAC_MOSAIC_2" +OBSERVATION_ID = "6623" + +/* ** TIME PARAMETERS ** */ +START_TIME = 2008-10-06T09:12:00.325595 +STOP_TIME = 2008-10-06T09:12:00.339595 +SPACECRAFT_CLOCK_START_COUNT = "1/0131771763:976000" +SPACECRAFT_CLOCK_STOP_COUNT = "1/0131771763:990000" +PRODUCT_CREATION_TIME = 2009-12-14T21:38:50 + +/* ** INSTRUMENT ENGINEERING PARAMETERS ** */ +INSTRUMENT_NAME = "MERCURY DUAL IMAGING SYSTEM NARROW ANGLE CAMERA" +INSTRUMENT_ID = "MDIS-NAC" +FILTER_NAME = "748 BP 53" +FILTER_NUMBER = "N/A" +CENTER_FILTER_WAVELENGTH = 747.7 +BANDWIDTH = 52.6 +EXPOSURE_DURATION = 14 +EXPOSURE_TYPE = AUTO +DETECTOR_TEMPERATURE = -37.62 +FOCAL_PLANE_TEMPERATURE = -28.76 +FILTER_TEMPERATURE = "N/A" +OPTICS_TEMPERATURE = -28.61 + +/* ** INSTRUMENT RAW PARAMETERS ** */ +MESS:MET_EXP = 131771763 +MESS:IMG_ID_LSB = "N/A" +MESS:IMG_ID_MSB = "N/A" +MESS:ATT_CLOCK_COUNT = 131771761 +MESS:ATT_Q1 = -0.49568507 +MESS:ATT_Q2 = -0.63451749 +MESS:ATT_Q3 = 0.35215572 +MESS:ATT_Q4 = -0.47714800 +MESS:ATT_FLAG = 7 +MESS:PIV_POS_MOTOR = "N/A" +MESS:PIV_GOAL = 7895 +MESS:PIV_POS = 7896 +MESS:PIV_READ = 23068 +MESS:PIV_CAL = -26758 +MESS:FW_GOAL = 6492 +MESS:FW_POS = 6436 +MESS:FW_READ = 6436 +MESS:CCD_TEMP = 1044 +MESS:CAM_T1 = 468 +MESS:CAM_T2 = 496 +MESS:EXPOSURE = 14 +MESS:DPU_ID = 0 +MESS:IMAGER = 1 +MESS:SOURCE = 0 +MESS:FPU_BIN = 0 +MESS:COMP12_8 = 1 +MESS:COMP_ALG = 2 +MESS:COMP_FST = 1 +MESS:TIME_PLS = 2 +MESS:LATCH_UP = 0 +MESS:EXP_MODE = 1 +MESS:PIV_STAT = 3 +MESS:PIV_MPEN = 1 +MESS:PIV_PV = 1 +MESS:PIV_RV = 1 +MESS:FW_PV = 1 +MESS:FW_RV = 1 +MESS:AEX_STAT = 512 +MESS:AEX_STHR = 5 +MESS:AEX_TGTB = 2400 +MESS:AEX_BACB = 240 +MESS:AEX_MAXE = 14 +MESS:AEX_MINE = 1 +MESS:DLNKPRIO = 5 +MESS:WVLRATIO = 8 +MESS:PIXELBIN = 0 +MESS:SUBFRAME = 0 +MESS:SUBF_X1 = 4 +MESS:SUBF_Y1 = 0 +MESS:SUBF_DX1 = 0 +MESS:SUBF_DY1 = 0 +MESS:SUBF_X2 = 4 +MESS:SUBF_Y2 = 0 +MESS:SUBF_DX2 = 0 +MESS:SUBF_DY2 = 0 +MESS:SUBF_X3 = 0 +MESS:SUBF_Y3 = 0 +MESS:SUBF_DX3 = 0 +MESS:SUBF_DY3 = 0 +MESS:SUBF_X4 = 0 +MESS:SUBF_Y4 = 0 +MESS:SUBF_DX4 = 0 +MESS:SUBF_DY4 = 0 +MESS:SUBF_X5 = 0 +MESS:SUBF_Y5 = 0 +MESS:SUBF_DX5 = 0 +MESS:SUBF_DY5 = 0 +MESS:CRITOPNV = 0 +MESS:JAILBARS = 0 +MESS:JB_X0 = 0 +MESS:JB_X1 = 0 +MESS:JB_SPACE = 0 + +/* ** GEOMETRY INFORMATION ** */ +RIGHT_ASCENSION = 329.96796 +DECLINATION = -11.56931 +TWIST_ANGLE = 13.73197 +RA_DEC_REF_PIXEL = (512.00000,512.00000) +RETICLE_POINT_RA = (329.41279 ,330.88844 ,329.04957 , + 330.52952 ) +RETICLE_POINT_DECLINATION = (-12.47527 ,-12.12267 ,-11.02525 , + -10.67174 ) + +/* ** TARGET PARAMETERS ** */ +SC_TARGET_POSITION_VECTOR = (-8919.18729 ,5554.99303 ,3662.51393 ) +TARGET_CENTER_DISTANCE = 11127.61690 + +/* ** TARGET WITHIN SENSOR FOV ** */ +SLANT_DISTANCE = 9115.65447 +CENTER_LATITUDE = 24.03182 +CENTER_LONGITUDE = 297.29424 +HORIZONTAL_PIXEL_SCALE = 232.40761 +VERTICAL_PIXEL_SCALE = 232.40761 +SMEAR_MAGNITUDE = 0.10555 +SMEAR_AZIMUTH = 94.46806 +NORTH_AZIMUTH = 108.06205 +RETICLE_POINT_LATITUDE = (21.08301 ,20.54907 ,27.64956 , + 27.16452 ) +RETICLE_POINT_LONGITUDE = (301.32304 ,295.12377 ,299.48568 , + 292.69017 ) + +/* ** SPACECRAFT POSITION WITH RESPECT TO CENTRAL BODY ** */ +SUB_SPACECRAFT_LATITUDE = -1.04438 +SUB_SPACECRAFT_LONGITUDE = 315.57322 +SPACECRAFT_ALTITUDE = 8687.61690 +SUB_SPACECRAFT_AZIMUTH = 243.13066 + +/* ** SPACECRAFT LOCATION ** */ +SPACECRAFT_SOLAR_DISTANCE = 51220537.58833 +SC_SUN_POSITION_VECTOR = (50079853.32484 ,10735834.95784 , + 541857.50763 ) +SC_SUN_VELOCITY_VECTOR = (24.24499 ,-44.99506 ,-26.54238 ) + +/* ** VIEWING AND LIGHTING GEOMETRY (SUN ON TARGET) ** */ +SOLAR_DISTANCE = 51228055.72874 +SUB_SOLAR_AZIMUTH = 194.38217 +SUB_SOLAR_LATITUDE = -0.01056 +SUB_SOLAR_LONGITUDE = 3.05715 +INCIDENCE_ANGLE = 67.98720 +PHASE_ANGLE = 43.57603 +EMISSION_ANGLE = 38.58010 +LOCAL_HOUR_ANGLE = 114.23708 + +/* ** GEOMETRY FOR EACH SUBFRAME ** */ +GROUP = SUBFRAME1_PARAMETERS + RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") + RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") +END_GROUP = SUBFRAME1_PARAMETERS + +GROUP = SUBFRAME2_PARAMETERS + RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") + RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") +END_GROUP = SUBFRAME2_PARAMETERS + +GROUP = SUBFRAME3_PARAMETERS + RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") + RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") +END_GROUP = SUBFRAME3_PARAMETERS + +GROUP = SUBFRAME4_PARAMETERS + RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") + RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") +END_GROUP = SUBFRAME4_PARAMETERS + +GROUP = SUBFRAME5_PARAMETERS + RETICLE_POINT_LATITUDE = ("N/A","N/A","N/A","N/A") + RETICLE_POINT_LONGITUDE = ("N/A","N/A","N/A","N/A") +END_GROUP = SUBFRAME5_PARAMETERS + + +OBJECT = IMAGE + LINES = 1024 + LINE_SAMPLES = 1024 + SAMPLE_TYPE = MSB_UNSIGNED_INTEGER + SAMPLE_BITS = 8 + UNIT = "N/A" + DARK_STRIP_MEAN = 10.107 + +/* ** IMAGE STATISTICS OF ** */ +/* ** THE EXPOSED CCD AREA ** */ + MINIMUM = 16.000 + MAXIMUM = 124.000 + MEAN = 65.736 + STANDARD_DEVIATION = 8.835 + +/* ** PIXEL COUNTS ** */ + SATURATED_PIXEL_COUNT = 0 + MISSING_PIXELS = 0 +END_OBJECT = IMAGE +END + + + + +<;:764569;<=?>>==<<:;;=>@BBCEDCB?=<:9::;;<<;;<=>>?@A@>?=<<;;;;;;=>?AAAA@><;73.+'$""$&'+-.02468;<>>@BDEFFIFFB?;7410//12110./1358;?@BCCBB?;630..0//00323321333456998766779:;<===;;;:99::;<>>?>;779>@@A<979::;<==<<;::<==>>?@BBA><989;:99;=??=<>==>>?@ABCDDDDFEDFHJKKLKJHFCBA@AAAA?@????@BDECBC@>=:866677766545668:;:;=ADGHJIIHFGGHHGGEDDHIKLJJIIGIHIJKLMOOQRSSSRRPONMKIG=/#)-++36<<<<=>@@CDDDDC@?<96469863-*-3:@FJMORSSSRQJC=63213457:=?BCA@;61.147;>BDD?>@DEHFC@??>==<>>?>;;;;;<==<=>?>=;;;;::::::9876878987878887757699:;:::742112369;=?ADEFFGHHFC?;;<>?=;8633322343236:>=:7658:<;;97544557567:=?CEGHGFD?:86768ABB?<7-'#%*0240*$!#'-2454668999:964335453.*(+/48=ADDEFDB=;:;:::<=<>>>@BBEEFGGGFEEECA>9520000//./022323456767899;;:9::;;=<<<==>?@ABCCCCCBBAA@@?>>===>@?AABBCEEFHHHHDB>;:::9863335544445687553456877797655445678:::9::::;<==<:9853+$!*036888999::;<<=<<<<:97431359<<=>?AA?<;878:=>?ABCDEGGFHHIJKLMNMKHE?;512///,&! !#'-358;=AEGHGEB?;976 diff --git a/isis/src/core/tests/unitTests/PvlContainer/PvlContainer.truth b/isis/src/core/tests/unitTests/PvlContainer/PvlContainer.truth new file mode 100644 index 0000000000..7e365d9ca2 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlContainer/PvlContainer.truth @@ -0,0 +1,14 @@ +DOG = 5.2 + +# Cats shed +CATTLE = Meow +5.2 +# Cats shed +CATTLE = Meow + +Test inserter ... +Orangutan = gross +DOG = 5.2 + +Test reallocation ... +Pointer to DOG is equivalent diff --git a/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp b/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp new file mode 100644 index 0000000000..1eaf3c5ff2 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp @@ -0,0 +1,57 @@ +#include + +#include "IString.h" + +#include "PvlContainer.h" +#include "Preference.h" + +using namespace Isis; +using namespace std; + +int main() { + Preference::Preferences(true); + + PvlKeyword dog("DOG", toString(5.2), "meters"); + PvlKeyword cat("CATTLE"); + cat = "Meow"; + cat.addComment("Cats shed"); + + PvlContainer ani("Animals"); + ani += dog; + ani += cat; + ani.addComment("/* Pets are cool */"); + +// cout << "1 ..." << endl; + cout << ani << endl; + +// cout << "2 ..." << endl; + cout << (double) ani["dog"] << endl; + + ani -= "dog"; +// cout << "3 ..." << endl; + cout << ani << endl; + +// cout << "4 ..." << endl; + ani -= ani[0]; + cout << ani << endl; + + cout << "Test inserter ..." << endl; + PvlKeyword monkey("Orangutan", "gross"); + ani.addKeyword(dog, ani.begin()); + ani.addKeyword(monkey, ani.begin()); + cout << ani << endl; + + // This is testing reallocation caused by adds, + // was a problem when using std::vector + cout << endl << "Test reallocation ..." << endl; + PvlKeyword * ptr1 = &ani["DOG"]; + for (int i = 0; i < 250; i++) + ani += PvlKeyword("Test_keyword", toString(i)); + + PvlKeyword * ptr2 = &ani["DOG"]; + if (ptr1 == ptr2) + cout << "Pointer to DOG is equivalent" << endl; + else + cout << "FAILURE: Pointer to DOG changed after multiple adds" << endl; + +} diff --git a/isis/src/core/tests/unitTests/PvlFormat/PvlFormat.truth b/isis/src/core/tests/unitTests/PvlFormat/PvlFormat.truth new file mode 100644 index 0000000000..865d45b261 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlFormat/PvlFormat.truth @@ -0,0 +1,34 @@ +mystring = stringval +mystring = "string val" +myint = 12345 +myfloat = 12345.67e+89 +myarray = (12345, "a short string", 1.234) +myarray = {12345, "a short string", 1.234} +Group = Group1 + mystring = stringval + mystring = "string val" + myint = 12345 + myfloat = 12345.67e+89 + myarray = (12345,"a short string",1.234) +End_Group +Object = Object1 + Object = Object2 + mystring = stringval + mystring = "string val" + myint = 12345 + myfloat = 12345.67e+89 + myarray = (12345,"a short string",1.234) + End_Object + + Group = Group1 + mystring = stringval + mystring = "string val" + myint = 12345 + myfloat = 12345.67e+89 + myarray = (12345,"a short string",1.234) + End_Group +End_Object +myequation = "(f1-f2) * 5" +myequation = "(f1-f2)*5" +mysequence = ((a,b), (c,d)) +mycommas = ",,," diff --git a/isis/src/core/tests/unitTests/PvlFormat/unitTest.cpp b/isis/src/core/tests/unitTests/PvlFormat/unitTest.cpp new file mode 100644 index 0000000000..e6055b02f4 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlFormat/unitTest.cpp @@ -0,0 +1,100 @@ +#include "PvlKeyword.h" +#include "PvlGroup.h" +#include "PvlObject.h" +#include "PvlFormat.h" +#include "Preference.h" + +using namespace std; +int main() { + Isis::Preference::Preferences(true); + + // Test keywords + { + Isis::PvlKeyword key("mystring", "stringval"); + cout << key << endl; + } + + { + Isis::PvlKeyword key("mystring", "string val"); + cout << key << endl; + } + + { + Isis::PvlKeyword key("myint", "12345"); + cout << key << endl; + } + + { + Isis::PvlKeyword key("myfloat", "12345.67e+89"); + cout << key << endl; + } + + { + Isis::PvlKeyword key("myarray", "(12345, \"a short string\", 1.234)"); + cout << key << endl; + } + + + { + Isis::PvlKeyword key("myarray", "{12345, \"a short string\", 1.234}"); + cout << key << endl; + } + + // Test Groups + { + Isis::PvlGroup grp("Group1"); + grp += Isis::PvlKeyword("mystring", "stringval"); + grp += Isis::PvlKeyword("mystring", "string val"); + grp += Isis::PvlKeyword("myint", "12345"); + grp += Isis::PvlKeyword("myfloat", "12345.67e+89"); + grp += Isis::PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + cout << grp << endl; + } + + + // Test Objects + { + Isis::PvlGroup grp("Group1"); + grp += Isis::PvlKeyword("mystring", "stringval"); + grp += Isis::PvlKeyword("mystring", "string val"); + grp += Isis::PvlKeyword("myint", "12345"); + grp += Isis::PvlKeyword("myfloat", "12345.67e+89"); + grp += Isis::PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + Isis::PvlObject obj("Object1"); + obj.addGroup(grp); + + Isis::PvlObject obj2("Object2"); + obj2 += Isis::PvlKeyword("mystring", "stringval"); + obj2 += Isis::PvlKeyword("mystring", "string val"); + obj2 += Isis::PvlKeyword("myint", "12345"); + obj2 += Isis::PvlKeyword("myfloat", "12345.67e+89"); + obj2 += Isis::PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + obj.addObject(obj2); + cout << obj << endl; + } + + { + Isis::PvlKeyword key("myequation", "(f1-f2) * 5"); + cout << key << endl; + } + + { + Isis::PvlKeyword key("myequation", "(f1-f2)*5"); + cout << key << endl; + } + + + { + Isis::PvlKeyword key("mysequence"); + key += "(a,b)"; + key += "(c,d)"; + cout << key << endl; + } + + { + Isis::PvlKeyword key("mycommas"); + key += ",,,"; + cout << key << endl; + } +} + diff --git a/isis/src/core/tests/unitTests/PvlFormatPds/PvlFormatPds.truth b/isis/src/core/tests/unitTests/PvlFormatPds/PvlFormatPds.truth new file mode 100644 index 0000000000..c87045875d --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlFormatPds/PvlFormatPds.truth @@ -0,0 +1,260 @@ +skey = somestringval +SKEY = "somestringval" +skey = "string val" +SKEY = "string val" +sNAstring = N/A +SNASTRING = "N/A" +sUNKquote = "UNK" +SUNKQUOTE = "UNK" +ssinglequote = 'NA' +SSINGLEQUOTE = 'NA' +notinmap = "junk string" +NOTINMAP = "junk string" +myint = 12345 +MYINT = 12345 +myfloat = -1.234567e+93 +MYFLOAT = -1.234567e+93 +fkey = -12345.6789 +FKEY = -12345.6789 +fkey0 = -9876.543 +FKEY0 = -9877 +fkey0 = -9.876543e-96 +FKEY0 = -0 +fkey2 = 0.123456 +FKEY2 = 0.12 +fkey2 = (0.123456, 987.123) +FKEY2 = (0.12 , 987.12 ) +fkey2 = (0.123456 , 987.123) +FKEY2 = (0.12 , 987.12) +ekey = unsigned +EKEY = unsigned +myarray = (12345,"a short string",1.234) +MYARRAY = (12345,"a short string",1.234) +hkey0 = 1311768467463790335 +HKEY0 = 16#123456789ABCDEFF# +hkey2 = 31371 +HKEY2 = 16#7A8B# +hkey4 = 439041101 +HKEY4 = 16#1A2B3C4D# +binkey = 10 +BINKEY = 2#0001010# +binkey16 = 65535 +BINKEY16 = 2#1111111111111111# +intkeyarray = (1, NULL, 3, NULL) +INTKEYARRAY = (1, "NULL", 3, "NULL") +intkeyarray = (1 , NULL , 3 , N/A, UNK) +INTKEYARRAY = (1 , "NULL" , 3 , "N/A", "UNK") +dblkeyarray = (1.01, NULL, 3.4, UNK) +DBLKEYARRAY = (1.01, "NULL", 3.40, "UNK") +=============================== Before +Group = Group1 + skey = stringval + mystring = "string val" + sNULLstring = NULL + sUNKquote = "UNK" + sNAsingle = 'N/A' + myint = 12345 + myfloat = 1.234567e+93 + myarray = (12345,"a short string",1.234) +End_Group +=============================== After +GROUP = GROUP1 + SKEY = "stringval" + MYSTRING = "string val" + SNULLSTRING = "NULL" + SUNKQUOTE = "UNK" + SNASINGLE = 'N/A' + MYINT = 12345 + MYFLOAT = 1.234567e+93 + MYARRAY = (12345,"a short string",1.234) +END_GROUP = GROUP1 +=============================== Before +Object = Object1 + skey = stringval + mystring = "string val" + sNULLstring = NULL + sUNKquote = "UNK" + sNAsingle = 'N/A' + myint = 12345 + myfloat = 1.234567e+93 + myarray = (12345,"a short string",1.234) + + Object = Object2 + skey = stringval + mystring = "string val" + sNULLstring = NULL + sUNKquote = "UNK" + sNAsingle = 'N/A' + myint = 12345 + myfloat = 1.234567e+93 + myarray = (12345,"a short string",1.234) + End_Object + + Group = Group1 + skey = stringval + mystring = "string val" + sNULLstring = NULL + sUNKquote = "UNK" + sNAsingle = 'N/A' + myint = 12345 + myfloat = 1.234567e+93 + myarray = (12345,"a short string",1.234) + End_Group +End_Object +=============================== After +OBJECT = OBJECT1 + SKEY = "stringval" + MYSTRING = "string val" + SNULLSTRING = "NULL" + SUNKQUOTE = "UNK" + SNASINGLE = 'N/A' + MYINT = 12345 + MYFLOAT = 1.234567e+93 + MYARRAY = (12345,"a short string",1.234) + + OBJECT = OBJECT2 + SKEY = "stringval" + MYSTRING = "string val" + SNULLSTRING = "NULL" + SUNKQUOTE = "UNK" + SNASINGLE = 'N/A' + MYINT = 12345 + MYFLOAT = 1.234567e+93 + MYARRAY = (12345,"a short string",1.234) + END_OBJECT = OBJECT2 + + GROUP = GROUP1 + SKEY = "stringval" + MYSTRING = "string val" + SNULLSTRING = "NULL" + SUNKQUOTE = "UNK" + SNASINGLE = 'N/A' + MYINT = 12345 + MYFLOAT = 1.234567e+93 + MYARRAY = (12345,"a short string",1.234) + END_GROUP = GROUP1 +END_OBJECT = OBJECT1 +=============================== Before +skey = stringval +mystring = "string val" +sNULLstring = NULL +sUNKquote = "UNK" +sNAsingle = 'N/A' +myint = 12345 +myfloat = 1.234567e+93 +myarray = (12345,"a short string",1.234) + +Object = Object1 + skey = stringval + mystring = "string val" + sNULLstring = NULL + sUNKquote = "UNK" + sNAsingle = 'N/A' + myint = 12345 + myfloat = 1.234567e+93 + myarray = (12345,"a short string",1.234) + + Object = Object2 + skey = stringval + mystring = "string val" + sNULLstring = NULL + sUNKquote = "UNK" + sNAsingle = 'N/A' + myint = 12345 + myfloat = 1.234567e+93 + myarray = (12345,"a short string",1.234) + binkey16 = 496 + End_Object + + Group = Group1 + skey = stringval + mystring = "string val" + sNULLstring = NULL + sUNKquote = "UNK" + sNAsingle = 'N/A' + myint = 12345 + myfloat = 1.234567e+93 + myarray = (12345,"a short string",1.234) + End_Group +End_Object + +Group = Group2 + skey = stringval + mystring = "string val" + sNULLstring = NULL + sUNKquote = "UNK" + sNAsingle = 'N/A' + myint = 12345 + myfloat = 1.234567e+93 + myarray = (12345,"a short string",1.234) + binkey16 = 32769 + wrapword = "The quick brown fox jumped over the lazy duck. Repunzel + Repunzel let down your hair. The little toy dog is covered + with dust, but sturdy and staunch he stands; and the little + toy soldier is red with rust." + array = (12345, 67890, 12345, 67890, 12345, 67890, 12345, 67890, + 12345, 67890, 12345, 67890, 12345, 67890, 12345) +End_Group +End +=============================== After +SKEY = "stringval" +MYSTRING = "string val" +SNULLSTRING = "NULL" +SUNKQUOTE = "UNK" +SNASINGLE = 'N/A' +MYINT = 12345 +MYFLOAT = 1.234567e+93 +MYARRAY = (12345,"a short string",1.234) + +OBJECT = OBJECT1 + SKEY = "stringval" + MYSTRING = "string val" + SNULLSTRING = "NULL" + SUNKQUOTE = "UNK" + SNASINGLE = 'N/A' + MYINT = 12345 + MYFLOAT = 1.234567e+93 + MYARRAY = (12345,"a short string",1.234) + + OBJECT = OBJECT2 + SKEY = "stringval" + MYSTRING = "string val" + SNULLSTRING = "NULL" + SUNKQUOTE = "UNK" + SNASINGLE = 'N/A' + MYINT = 12345 + MYFLOAT = 1.234567e+93 + MYARRAY = (12345,"a short string",1.234) + BINKEY16 = 2#0000000111110000# + END_OBJECT = OBJECT2 + + GROUP = GROUP1 + SKEY = "stringval" + MYSTRING = "string val" + SNULLSTRING = "NULL" + SUNKQUOTE = "UNK" + SNASINGLE = 'N/A' + MYINT = 12345 + MYFLOAT = 1.234567e+93 + MYARRAY = (12345,"a short string",1.234) + END_GROUP = GROUP1 +END_OBJECT = OBJECT1 + +GROUP = GROUP2 + SKEY = "stringval" + MYSTRING = "string val" + SNULLSTRING = "NULL" + SUNKQUOTE = "UNK" + SNASINGLE = 'N/A' + MYINT = 12345 + MYFLOAT = 1.234567e+93 + MYARRAY = (12345,"a short string",1.234) + BINKEY16 = 2#1000000000000001# + WRAPWORD = "The quick brown fox jumped over the lazy duck. Repunzel + Repunzel let down your hair. The little toy dog is covered + with dust, but sturdy and staunch he stands; and the little + toy soldier is red with rust." + ARRAY = (12345, 67890, 12345, 67890, 12345, 67890, 12345, 67890, + 12345, 67890, 12345, 67890, 12345, 67890, 12345) +END_GROUP = GROUP2 +End diff --git a/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp b/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp new file mode 100644 index 0000000000..b62b4e7734 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp @@ -0,0 +1,451 @@ +#include + +#include + +#include "Pvl.h" +#include "PvlKeyword.h" +#include "PvlGroup.h" +#include "PvlObject.h" +#include "FileName.h" +#include "IException.h" +#include "Constants.h" +#include "PvlFormatPds.h" +#include "Preference.h" + +using namespace Isis; +using namespace std; + +int main() { + Preference::Preferences(true); + + try { + + PvlFormatPds *pdsFormatter; + + // Create a temp file for the keyword to type map + { + FileName fname = FileName::createTempFile("tempPvlFormatPDSunitTest_.tmp"); + QString pdsFile = fname.expanded(); + + ofstream out; + out.open(pdsFile.toLatin1().data(), std::ios::out); + + { + PvlKeyword key("skey", "string"); + out << key << endl; + } + { + PvlKeyword key("ikey", "integer"); + out << key << endl; + } + { + PvlKeyword key("fkey2", "rEaL"); + key.addValue(toString(2)); + out << key << endl; + } + { + PvlKeyword key("bkey", "bool"); + out << key << endl; + } + { + PvlKeyword key("fkey0", "real"); + key.addValue(toString(0)); + out << key << endl; + } + { + PvlKeyword key("fkey", "real"); + out << key << endl; + } + { + PvlKeyword key("ekey", "enum"); + out << key << endl; + } + { + PvlKeyword key("hkey0", "hEX"); + out << key << endl; + } + { + PvlKeyword key("hkey2", "hEX"); + key.addValue(toString(2)); + out << key << endl; + } + { + PvlKeyword key("hkey4", "hEX"); + key.addValue(toString(4)); + out << key << endl; + } + { + PvlKeyword key("binkey", "binary"); + key.addValue(toString(7)); + out << key << endl; + } + { + PvlKeyword key("binkey16", "binary"); + key.addValue(toString(16)); + out << key << endl; + } + { + PvlKeyword key("intkeyarray", "integer"); + out << key << endl; + } + { + PvlKeyword key("dblkeyarray", "rEaL"); + key.addValue(toString(2)); + out << key << endl; + } + { + PvlKeyword key("wrapword", "string"); + out << key << endl; + } + { + PvlKeyword key("array", "integer"); + out << key << endl; + } + + out.close(); + + pdsFormatter = new PvlFormatPds(pdsFile); + QFile::remove(pdsFile); + } + + // Test Keywords + { + PvlKeyword key("skey", "somestringval"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("skey", "string val", "chars"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("sNAstring", "N/A"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("sUNKquote", "\"UNK\""); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("ssinglequote", "\'NA\'"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("notinmap", "junk string"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("myint", "12345"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("myfloat", toString(-12345.67e+89), "degrees"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("fkey", toString(-12345.6789)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("fkey0", toString(-9876.543)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("fkey0", toString(-9876.543e-99)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("fkey2", toString(0.123456)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("fkey2", toString(0.123456), "goofys"); + key.addValue(toString(987.123), "goofys"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("fkey2", toString(0.123456), "goofys"); + key.addValue(toString(987.123)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("ekey", "unsigned"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("myarray", "(12345,\"a short string\",1.234)"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("hkey0", toString((BigInt)0x123456789abcdeffLL)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("hkey2", toString(0x7a8b)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("hkey4", toString(0x1a2b3c4d)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("binkey", toString(0xA)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("binkey16", toString(0xffff)); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("intkeyarray", toString(1)); + key.addValue("NULL"); + key.addValue("3"); + key.addValue("NULL"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("intkeyarray", toString(1), "m"); + key.addValue("NULL", "m"); + key.addValue("3", "m"); + key.addValue("N/A"); + key.addValue("UNK"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + { + PvlKeyword key("dblkeyarray", toString(1.01)); + key.addValue("NULL"); + key.addValue("3.4"); + key.addValue("UNK"); + cout << key << endl; + key.setFormat(pdsFormatter); + cout << key << pdsFormatter->formatEOL(); + } + + + // Test Groups + { + PvlGroup grp("Group1"); + grp += PvlKeyword("skey", "stringval"); + grp += PvlKeyword("mystring", "string val"); + grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + grp += PvlKeyword("myint", toString(12345)); + grp += PvlKeyword("myfloat", toString(12345.67e+89)); + grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + cout << "=============================== Before" << endl; + cout << grp << endl; + grp.setFormat(pdsFormatter); + cout << "=============================== After" << endl; + cout << grp << pdsFormatter->formatEOL(); + } + + + // Test Objects + { + PvlGroup grp("Group1"); + grp += PvlKeyword("skey", "stringval"); + grp += PvlKeyword("mystring", "string val"); + grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + grp += PvlKeyword("myint", toString(12345)); + grp += PvlKeyword("myfloat", toString(12345.67e+89)); + grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + PvlObject obj("Object1"); + obj.addGroup(grp); + + PvlObject obj2("Object2"); + obj2 += PvlKeyword("skey", "stringval"); + obj2 += PvlKeyword("mystring", "string val"); + obj2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + obj2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + obj2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + obj2 += PvlKeyword("myint", toString(12345)); + obj2 += PvlKeyword("myfloat", toString(12345.67e+89)); + obj2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + obj.addObject(obj2); + + obj += PvlKeyword("skey", "stringval"); + obj += PvlKeyword("mystring", "string val"); + obj += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + obj += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + obj += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + obj += PvlKeyword("myint", toString(12345)); + obj += PvlKeyword("myfloat", toString(12345.67e+89)); + obj += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + + + cout << "=============================== Before" << endl; + cout << obj << endl; + obj.setFormat(pdsFormatter); + cout << "=============================== After" << endl; + cout << obj << pdsFormatter->formatEOL(); + } + + + // Test Pvl + { + Pvl pvl; + + PvlObject obj("Object1"); + + PvlGroup grp("Group1"); + grp += PvlKeyword("skey", "stringval"); + grp += PvlKeyword("mystring", "string val"); + grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + grp += PvlKeyword("myint", toString(12345)); + grp += PvlKeyword("myfloat", toString(12345.67e+89)); + grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + obj.addGroup(grp); + + PvlObject obj2("Object2"); + obj2 += PvlKeyword("skey", "stringval"); + obj2 += PvlKeyword("mystring", "string val"); + obj2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + obj2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + obj2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + obj2 += PvlKeyword("myint", toString(12345)); + obj2 += PvlKeyword("myfloat", toString(12345.67e+89)); + obj2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + obj2 += PvlKeyword("binkey16", toString(0x01f0)); + obj.addObject(obj2); + + obj += PvlKeyword("skey", "stringval"); + obj += PvlKeyword("mystring", "string val"); + obj += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + obj += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + obj += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + obj += PvlKeyword("myint", toString(12345)); + obj += PvlKeyword("myfloat", toString(12345.67e+89)); + obj += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + + pvl += PvlKeyword("skey", "stringval"); + pvl += PvlKeyword("mystring", "string val"); + pvl += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + pvl += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + pvl += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + pvl += PvlKeyword("myint", toString(12345)); + pvl += PvlKeyword("myfloat", toString(12345.67e+89)); + pvl += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + + pvl.addObject(obj); + + PvlGroup grp2("Group2"); + grp2 += PvlKeyword("skey", "stringval"); + grp2 += PvlKeyword("mystring", "string val"); + grp2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set + grp2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes + grp2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes + grp2 += PvlKeyword("myint", toString(12345)); + grp2 += PvlKeyword("myfloat", toString(12345.67e+89)); + grp2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); + grp2 += PvlKeyword("binkey16", toString(0x8001)); + grp2 += PvlKeyword("wrapword", "The quick brown fox jumped over the lazy duck. " + "Repunzel Repunzel let down your hair. The little toy dog is covered with dust," + " but sturdy and staunch he stands; and the little toy soldier is red with rust."); + PvlKeyword key(PvlKeyword("array", toString(12345))); + key.addValue(toString(67890)); + key.addValue(toString(12345)); + key.addValue(toString(67890)); + key.addValue(toString(12345)); + key.addValue(toString(67890)); + key.addValue(toString(12345)); + key.addValue(toString(67890)); + key.addValue(toString(12345)); + key.addValue(toString(67890)); + key.addValue(toString(12345)); + key.addValue(toString(67890)); + key.addValue(toString(12345)); + key.addValue(toString(67890)); + key.addValue(toString(12345)); + grp2 += key; + pvl.addGroup(grp2); + + + cout << "=============================== Before" << endl; + cout << pvl << endl; + pvl.setFormat(pdsFormatter); + cout << "=============================== After" << endl; + cout << pvl << pdsFormatter->formatEOL(); + } + + + } + catch(IException &e) { + e.print(); + } + + +} + diff --git a/isis/src/core/tests/unitTests/PvlGroup/PvlGroup.truth b/isis/src/core/tests/unitTests/PvlGroup/PvlGroup.truth new file mode 100644 index 0000000000..9abd867b49 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlGroup/PvlGroup.truth @@ -0,0 +1,69 @@ +/* Pets are cool +Group = Animals + DOG = 5.2 + + # Cats shed + CATTLE = Meow +End_Group +5.2 + +/* Pets are cool +Group = Animals + # Cats shed + CATTLE = Meow +End_Group + +/* Pets are cool +Group = Animals +End_Group + +# Testing +/* 123 */ +Group = POODLE + CAT = TABBY + BIRD = PARROT + REPTILE = (SNAKE, LIZARD) + -VEGGIE = Null + BOVINE = (COW, CAMEL) + TREE = (MAPLE, ELM, PINE) + + # This is a comment + FLOWER = "DAISY & TULIP " + + /* This is another comment */ + BIG = (" NOT ", "REALLY LARGE") +End_Group +**ERROR** Group [POODLE] EndGroup not found before end of file when reading PVL. +Template Group: +Group = Point_ErrorMagnitude + Point_ErrorMagnitude__Required = false + LessThan = double + LessThan__Required = false + LessThan__Repeated = false + GreaterThan = double + GreaterThan__Required = true + GreaterThan__Repeated = true +End_Group + + +**Test1**RequiredKeyword +Results Group: +Group = Point_errormagnitude +End_Group +**PVL ERROR** Required Keyword "GreaterThan" not found in the PvlGroup +********** + +**Test2** +Repeated values are allowed if Repeat flag is set +Results Group: +Group = Point_errormagnitude +End_Group +********** + +**Test3** +Unvalidated Keywords +Results Group: +Group = Point_errormagnitude + Less123Than = 2.5 +End_Group +********** diff --git a/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp b/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp new file mode 100644 index 0000000000..c5aaf775b7 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp @@ -0,0 +1,173 @@ +#include +#include +#include "PvlGroup.h" +#include "Preference.h" +#include "IException.h" + +using namespace std; +using namespace Isis; + +int main() { + Isis::Preference::Preferences(true); + + Isis::PvlKeyword dog("DOG", toString(5.2), "meters"); + Isis::PvlKeyword cat("CATTLE"); + cat = "Meow"; + cat.addComment("Cats shed"); + + Isis::PvlGroup ani("Animals"); + ani += dog; + ani += cat; + ani.addComment("/* Pets are cool"); + + cout << ani << endl; + + cout << (double) ani["dog"] << endl << endl; + + ani -= "dog"; + cout << ani << endl << endl; + + ani -= ani[0]; + cout << ani << endl << endl; + + stringstream os; + os << "# Testing" << endl + << "/* 123 */" << endl + << "Group=POODLE " << endl + << "CAT=\"TABBY\" " << endl + << "BIRD=(PARROT) \0" << endl + << "REPTILE={SNAKE,LIZARD} \t" << endl + << "-VEGGIE \n" + << " " + << " BOVINE = ( COW , CAMEL ) \n " + << "TREE = { \"MAPLE\" ,\n \"ELM\" \n, \"PINE\" }" << endl + << "FLOWER = \"DAISY & \nTULIP \"" + << "# This is a comment\n" + << "/* This is another comment */\n" + << "BIG = (\" NOT \",\"REALLY LARGE\")" << endl + << "EndGroup" << endl; + + PvlGroup g; + os >> g; + cout << g << endl; + + try { + stringstream os2; + os2 << "# Testing" << endl + << "/* 123 */" << endl + << "Group=POODLE " << endl + << "CAT=\"TABBY\" " << endl + << "BIRD=(PARROT) \0" << endl + << "REPTILE={SNAKE,LIZARD} \t" << endl + << "-VEGGIE \n" + << " " + << " BOVINE = ( COW , CAMEL ) \n " + << "TREE = { \"MAPLE\" ,\n \"ELM\" \n, \"PINE\" }" << endl + << "FLOWER = \"DAISY & \nTULIP \"" + << "# This is a comment\n" + << "/* This is another comment */\n" + << "BIG = (\" NOT \",\"REALLY LARGE\")" << endl; + + PvlGroup g2; + os2 >> g2; + cout << g2 << endl; + } + catch(IException &e) { + cout.flush(); + e.print(); + } + + // Validate Group + + // Template Group + PvlGroup pvlTmplGrp("Point_ErrorMagnitude"); + PvlKeyword pvlTmplKwrd("Point_ErrorMagnitude__Required", "false"); + pvlTmplGrp += pvlTmplKwrd; + pvlTmplKwrd.clear(); + + pvlTmplKwrd = PvlKeyword("LessThan", "double"); + pvlTmplGrp += pvlTmplKwrd; + pvlTmplKwrd.clear(); + + pvlTmplKwrd = PvlKeyword("LessThan__Required", "false"); + pvlTmplGrp += pvlTmplKwrd; + pvlTmplKwrd.clear(); + + pvlTmplKwrd = PvlKeyword("LessThan__Repeated", "false"); + pvlTmplGrp += pvlTmplKwrd; + pvlTmplKwrd.clear(); + + pvlTmplKwrd = PvlKeyword("GreaterThan", "double"); + pvlTmplGrp += pvlTmplKwrd; + pvlTmplKwrd.clear(); + + pvlTmplKwrd = PvlKeyword("GreaterThan__Required", "true"); + pvlTmplGrp += pvlTmplKwrd; + pvlTmplKwrd.clear(); + + pvlTmplKwrd = PvlKeyword("GreaterThan__Repeated", "true"); + pvlTmplGrp += pvlTmplKwrd; + pvlTmplKwrd.clear(); + cout << "Template Group:\n" << pvlTmplGrp << endl << endl; + + // PvlGroup to be Validated + PvlGroup pvlGrp("Point_errormagnitude"); + PvlKeyword pvlKwrd("LessThan", toString(2.5)); + + try { + pvlTmplGrp.validateGroup(pvlGrp); + } + catch (IException &e) { + cerr << "\n**Test1**RequiredKeyword\nResults Group:\n" << pvlGrp << endl; + cerr << "**PVL ERROR** Required Keyword \"GreaterThan\" not found in the PvlGroup\n"; + cerr << "**********\n"; + } + + // Test Repeated values + try { + pvlKwrd.clear(); + PvlKeyword pvlKwrd("LessThan", toString(2.5)); + pvlGrp += pvlKwrd; + + pvlKwrd.clear(); + pvlKwrd = PvlKeyword("GreaterThan", toString(3.5)); + pvlGrp += pvlKwrd; + + pvlKwrd.clear(); + pvlKwrd = PvlKeyword("GreaterThan", toString(4.4545)); + pvlGrp += pvlKwrd; + + pvlKwrd.clear(); + pvlKwrd = PvlKeyword("GreaterThan", toString(100.8988095)); + pvlGrp += pvlKwrd; + pvlTmplGrp.validateGroup(pvlGrp); + + cout << "\n**Test2**\nRepeated values are allowed if Repeat flag is set\n"; + cout << "Results Group:\n" << pvlGrp << endl; + cerr << "**********\n"; + } + catch (IException &e) { + e.print(); + } + + // Test for unvalidated elements + try { + pvlKwrd.clear(); + PvlKeyword pvlKwrd("Less123Than", toString(2.5)); + pvlGrp += pvlKwrd; + + pvlKwrd.clear(); + pvlKwrd = PvlKeyword("GreaterThan", toString(3.5)); + pvlGrp += pvlKwrd; + + pvlTmplGrp.validateGroup(pvlGrp); + + cout << "\n**Test3**\nUnvalidated Keywords\n"; + cout << "Results Group:\n" << pvlGrp << endl; + cerr << "**********\n"; + } + catch (IException &e) { + e.print(); + } + +} diff --git a/isis/src/core/tests/unitTests/PvlKeyword/PvlKeyword.truth b/isis/src/core/tests/unitTests/PvlKeyword/PvlKeyword.truth new file mode 100644 index 0000000000..9720a61bcc --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlKeyword/PvlKeyword.truth @@ -0,0 +1,632 @@ + + +----- Testing Basic Read/Write ----- +'KEYWORD' -----------------------> VALID + NAME: KEYWORD +'KEYWORD X' ---------------------> INVALID + **ERROR** Expected an assignment [=] when reading PVL, but found [X]. +'KEYWORD =' ---------------------> INCOMPLETE +'KEYWORD = SOME_VAL' ------------> VALID + NAME: KEYWORD + VALUE: SOME_VAL +'KEYWORD = " val "' -----------> VALID + NAME: KEYWORD + VALUE: val +'KEYWORD = " 'val' "' -----------> VALID + NAME: KEYWORD + VALUE: 'val' +'KEYWORD = (VAL' ----------------> INCOMPLETE +'KEYWORD = (VAL1,VAL2' ----------> INCOMPLETE +'KEYWORD = (A B,C,D)' -----------> INVALID + **ERROR** Found extra data after [A] in array when reading PVL. +'KEYWORD = ((A B),(C),(D' -------> INCOMPLETE +'KEYWORD = (SOME_VAL)' ----------> VALID + NAME: KEYWORD + VALUE: SOME_VAL +'KEYWORD = (SOME_VAL) ' ------> VALID + NAME: KEYWORD + VALUE: SOME_VAL +'KEYWORD=(SOME_VAL)' ---------> VALID + NAME: KEYWORD + VALUE: SOME_VAL +'KEYWORD = (A, )' ---------------> INVALID + **ERROR** Unexpected close of keyword-value array when reading PVL. +'KEYWORD = ()' ------------------> VALID + NAME: KEYWORD +'KEYWORD = (A,B)' ---------------> VALID + NAME: KEYWORD + VALUE: A + VALUE: B +'KEYWORD = {A, B}' --------------> VALID + NAME: KEYWORD + VALUE: A + VALUE: B +'KEYWORD = (A,B) #comment this' -> VALID + COMMENT: #comment this + NAME: KEYWORD + VALUE: A + VALUE: B +'KEYWORD = ( A , B )' -----------> VALID + NAME: KEYWORD + VALUE: A + VALUE: B +'KEYWORD = ( A , B )' -----------> VALID + NAME: KEYWORD + VALUE: A + VALUE: B +'KEYWORD = (A, B,C,D,E))' -------> INVALID + **ERROR** Keyword has extraneous data [)] at the end. +'KEYWORD = ((1, 2), {3, 4}, (5), 6)' > VALID + NAME: KEYWORD + VALUE: (1, 2) + VALUE: {3, 4} + VALUE: (5) + VALUE: 6 +'KEYWORD = { "VAL1" , "VAL2", "VAL3"}' > VALID + NAME: KEYWORD + VALUE: VAL1 + VALUE: VAL2 + VALUE: VAL3 +'KEYWORD = { "VAL1" , "VAL2", "VAL3")' > INVALID + **ERROR** Incorrect array close when reading PVL; expected [}] but found [)] in keyword named [KEYWORD]. +'KEYWORD = { "VAL1" ,' ----------> INCOMPLETE +'KEYWORD = "(A,B,"' -------------> VALID + NAME: KEYWORD + VALUE: (A,B, +'KEYWORD = ',E)'' ---------------> VALID + NAME: KEYWORD + VALUE: ,E) +'KEYWORD = ((1,2))' -------------> VALID + NAME: KEYWORD + VALUE: (1,2) +'KEYWORD = ("(f1+f2)","/(f1-f2)")' > VALID + NAME: KEYWORD + VALUE: (f1+f2) + VALUE: /(f1-f2) +'KEYWORD = "(F1+F2)/(F1-F2)"' ---> VALID + NAME: KEYWORD + VALUE: (F1+F2)/(F1-F2) +'KEYWORD = ( (1,2) , (A,B) )' --> VALID + NAME: KEYWORD + VALUE: (1,2) + VALUE: (A,B) +'KEYWORD = "(f1 + min(f2,f3))"' -> VALID + NAME: KEYWORD + VALUE: (f1 + min(f2,f3)) +'KEYWORD = "(min(f2,f3) + f1)"' -> VALID + NAME: KEYWORD + VALUE: (min(f2,f3) + f1) +'KEYWORD = "min(f2,f3) + f1"' ---> VALID + NAME: KEYWORD + VALUE: min(f2,f3) + f1 +'KEYWORD = "f1 + min(f2,f3)"' ---> VALID + NAME: KEYWORD + VALUE: f1 + min(f2,f3) +'KEYWORD = (A , B , C, D )' > VALID + NAME: KEYWORD + VALUE: A + VALUE: B + VALUE: C + VALUE: D +'KEYWORD = (A , B , C, D ) ' > VALID + NAME: KEYWORD + VALUE: A + VALUE: B + VALUE: C + VALUE: D +'KEYWORD = ',E) ' ---------> INCOMPLETE +'KEYWORD = ,E) ' ----------> INVALID + **ERROR** Keyword has extraneous data [,E) ] at the end. +#SOMECOMMENT +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: #SOMECOMMENT + NAME: KEYWORD + VALUE: SOME_VAL +#SOMECOMMENT1 +#SOMECOMMENT2 +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: #SOMECOMMENT1 + COMMENT: #SOMECOMMENT2 + NAME: KEYWORD + VALUE: SOME_VAL +//SOMECOMMENT1 +#SOMECOMMENT2 +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: //SOMECOMMENT1 + COMMENT: #SOMECOMMENT2 + NAME: KEYWORD + VALUE: SOME_VAL +/*SOMECOMMENT1*/ +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: /* SOMECOMMENT1 */ + NAME: KEYWORD + VALUE: SOME_VAL +KEYWORD = '/* +'*/'' ---------------------------> VALID + NAME: KEYWORD + VALUE: /* */ +/* SOMECOMMENT1 + SOMECOMMENT2 +SOMECOMMENT3 */ +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: /* SOMECOMMENT1 */ + COMMENT: /* SOMECOMMENT2 */ + COMMENT: /* SOMECOMMENT3 */ + NAME: KEYWORD + VALUE: SOME_VAL +/*C1 + +A +/* +C3*/ +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: /* C1 */ + COMMENT: /* A */ + COMMENT: /* */ + COMMENT: /* C3 */ + NAME: KEYWORD + VALUE: SOME_VAL +/*C1 +/**/ +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: /* C1 */ + COMMENT: /* */ + NAME: KEYWORD + VALUE: SOME_VAL +/*C1 +A/**/ +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: /* C1 */ + COMMENT: /* A/* */ + NAME: KEYWORD + VALUE: SOME_VAL +/* A */ +/* B *//*C*/ +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: /* A */ + COMMENT: /* B *//*C */ + NAME: KEYWORD + VALUE: SOME_VAL +/*C1/**/ +'KEYWORD = SOME_VAL' ------------> VALID + COMMENT: /* C1/* */ + NAME: KEYWORD + VALUE: SOME_VAL +/*C1 + +A + +C3*//*Neato*//*Man*/KEYWORD = (A,B,C) /*Right? +'Yes!*/' ------------------------> VALID + COMMENT: /* C1 */ + COMMENT: /* A */ + COMMENT: /* C3 */ + COMMENT: /* Neato */ + COMMENT: /* Man */ + COMMENT: /*Right? Yes!*/ + NAME: KEYWORD + VALUE: A + VALUE: B + VALUE: C + + +----- Testing Stream Read/Write ----- +Input: +KEYWORD + +Output: +KEYWORD = Null + +Input: +KEYWORD X + +Output: +**ERROR** Unable to read PVL keyword [KEYWORD X]. +**ERROR** Expected an assignment [=] when reading PVL, but found [X]. + +Input: +KEYWORD = + +Output: +**ERROR** The PVL keyword [KEYWORD =] does not appear to be a valid Pvl Keyword. + +Input: +KEYWORD = SOME_VAL + +Output: +KEYWORD = SOME_VAL + +Input: +KEYWORD = " val " + +Output: +KEYWORD = " val " + +Input: +KEYWORD = " 'val' " + +Output: +KEYWORD = " 'val' " + +Input: +KEYWORD = (VAL + +Output: +**ERROR** The PVL keyword [KEYWORD = (VAL] does not appear to be a valid Pvl Keyword. + +Input: +KEYWORD = (VAL1,VAL2 + +Output: +**ERROR** The PVL keyword [KEYWORD = (VAL1,VAL2] does not appear to be a valid Pvl Keyword. + +Input: +KEYWORD = (A B,C,D) + +Output: +**ERROR** Unable to read PVL keyword [KEYWORD = (A B,C,D)]. +**ERROR** Found extra data after [A] in array when reading PVL. + +Input: +KEYWORD = ((A B),(C),(D + +Output: +**ERROR** The PVL keyword [KEYWORD = ((A B),(C),(D] does not appear to be a valid Pvl Keyword. + +Input: +KEYWORD = (SOME_VAL) + +Output: +KEYWORD = SOME_VAL + +Input: +KEYWORD = (SOME_VAL) + +Output: +KEYWORD = SOME_VAL + +Input: +KEYWORD=(SOME_VAL) + +Output: +KEYWORD = SOME_VAL + +Input: +KEYWORD = (A, ) + +Output: +**ERROR** Unable to read PVL keyword [KEYWORD = (A, )]. +**ERROR** Unexpected close of keyword-value array when reading PVL. + +Input: +KEYWORD = () + +Output: +KEYWORD = Null + +Input: +KEYWORD = (A,B) + +Output: +KEYWORD = (A, B) + +Input: +KEYWORD = {A, B} + +Output: +KEYWORD = (A, B) + +Input: +KEYWORD = (A,B) #comment this + +Output: +#comment this +KEYWORD = (A, B) + +Input: +KEYWORD = ( A , B ) + +Output: +KEYWORD = (A, B) + +Input: +KEYWORD = ( A , B ) + +Output: +KEYWORD = (A, B) + +Input: +KEYWORD = (A, B,C,D,E)) + +Output: +**ERROR** Unable to read PVL keyword [KEYWORD = (A, B,C,D,E))]. +**ERROR** Keyword has extraneous data [)] at the end. + +Input: +KEYWORD = ((1, 2), {3, 4}, (5), 6) + +Output: +KEYWORD = ((1, 2), {3, 4}, (5), 6) + +Input: +KEYWORD = { "VAL1" , "VAL2", "VAL3"} + +Output: +KEYWORD = (VAL1, VAL2, VAL3) + +Input: +KEYWORD = { "VAL1" , "VAL2", "VAL3") + +Output: +**ERROR** Unable to read PVL keyword [KEYWORD = { "VAL1" , "VAL2", "VAL3")]. +**ERROR** Incorrect array close when reading PVL; expected [}] but found [)] in keyword named [KEYWORD]. + +Input: +KEYWORD = { "VAL1" , + +Output: +**ERROR** The PVL keyword [KEYWORD = { "VAL1" ,] does not appear to be a valid Pvl Keyword. + +Input: +KEYWORD = "(A,B," + +Output: +KEYWORD = "(A,B," + +Input: +KEYWORD = ',E)' + +Output: +KEYWORD = ",E)" + +Input: +KEYWORD = ((1,2)) + +Output: +KEYWORD = (1,2) + +Input: +KEYWORD = ("(f1+f2)","/(f1-f2)") + +Output: +KEYWORD = ((f1+f2), "/(f1-f2)") + +Input: +KEYWORD = "(F1+F2)/(F1-F2)" + +Output: +KEYWORD = "(F1+F2)/(F1-F2)" + +Input: +KEYWORD = ( (1,2) , (A,B) ) + +Output: +KEYWORD = ((1,2), (A,B)) + +Input: +KEYWORD = "(f1 + min(f2,f3))" + +Output: +KEYWORD = "(f1 + min(f2,f3))" + +Input: +KEYWORD = "(min(f2,f3) + f1)" + +Output: +KEYWORD = "(min(f2,f3) + f1)" + +Input: +KEYWORD = "min(f2,f3) + f1" + +Output: +KEYWORD = "min(f2,f3) + f1" + +Input: +KEYWORD = "f1 + min(f2,f3)" + +Output: +KEYWORD = "f1 + min(f2,f3)" + +Input: +KEYWORD = (A , B , C, D ) + +Output: +KEYWORD = (A , B , C, D ) + +Input: +KEYWORD = (A , B , C, D ) + +Output: +KEYWORD = (A , B , C , D ) + +Input: +KEYWORD = ',E) + +Output: +**ERROR** The PVL keyword [KEYWORD = ',E) ] does not appear to be a valid Pvl Keyword. + +Input: +KEYWORD = ,E) + +Output: +**ERROR** Unable to read PVL keyword [KEYWORD = ,E) ]. +**ERROR** Keyword has extraneous data [,E) ] at the end. + +Input: +#SOMECOMMENT +KEYWORD = SOME_VAL + +Output: +#SOMECOMMENT +KEYWORD = SOME_VAL + +Input: +#SOMECOMMENT1 +#SOMECOMMENT2 +KEYWORD = SOME_VAL + +Output: +#SOMECOMMENT1 +#SOMECOMMENT2 +KEYWORD = SOME_VAL + +Input: +//SOMECOMMENT1 +#SOMECOMMENT2 +KEYWORD = SOME_VAL + +Output: +//SOMECOMMENT1 +#SOMECOMMENT2 +KEYWORD = SOME_VAL + +Input: +/*SOMECOMMENT1*/ +KEYWORD = SOME_VAL + +Output: +/* SOMECOMMENT1 */ +KEYWORD = SOME_VAL + +Input: +KEYWORD = '/* +*/' + +Output: +KEYWORD = "/* */" + +Input: +/* SOMECOMMENT1 + SOMECOMMENT2 +SOMECOMMENT3 */ +KEYWORD = SOME_VAL + +Output: +/* SOMECOMMENT1 */ +/* SOMECOMMENT2 */ +/* SOMECOMMENT3 */ +KEYWORD = SOME_VAL + +Input: +/*C1 + +A +/* +C3*/ +KEYWORD = SOME_VAL + +Output: +**ERROR** Error when reading a pvl: Cannot have ['/*'] inside a multi-line comment. + +Input: +/*C1 +/**/ +KEYWORD = SOME_VAL + +Output: +**ERROR** Error when reading a pvl: Cannot have ['/*'] inside a multi-line comment. + +Input: +/*C1 +A/**/ +KEYWORD = SOME_VAL + +Output: +**ERROR** Error when reading a pvl: Cannot have ['/*'] inside a multi-line comment. + +Input: +/* A */ +/* B *//*C*/ +KEYWORD = SOME_VAL + +Output: +/* A */ +/* B */ +/* C */ +KEYWORD = SOME_VAL + +Input: +/*C1/**/ +KEYWORD = SOME_VAL + +Output: +**ERROR** Error when reading a pvl: Cannot have ['/*'] inside a multi-line comment. + +Input: +/*C1 + +A + +C3*//*Neato*//*Man*/KEYWORD = (A,B,C) /*Right? +Yes!*/ + +Output: +/* C1 */ +/* A */ +/* C3 */ +/* Neato */ +/* Man */ +/*Right? Yes!*/ +KEYWORD = (A, B, C) + +----- Testing Difficult Cases Read/Write ----- +FROM = /archive/projects/cassini/VIMS/UnivAZraw/tour/S60/cubes/GLO000OBMAP00- + 2//V1654449360_4.QUB +THE_INTERNET = "Seven thousand eight hundred forty three million seventy four + nine seventy six forty two eighty nine sixty seven thirty five + million jillion bajillion google six nine four one two three + four five six seven eight nine ten eleven twelve thirteen + fourteen" +BIG_HUGE_LONG_NAME_THAT_SHOULD_TEST_OUT_PARSING = "Seven thousand eight + hundred forty three million + seventy four" +ARRAY_TEST = (5.87, 5465.6, 574.6) +FIRST_100_DIGITS_OF_PI = 3.14159265358979323846264338327950288419716939937510- + 58209749445923078164062862089986280348253421170679 +Raw Data --> +3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 + +A = XXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxx +TREE = (MAPLE, ELM, PINE) +UGHHHHHHHHHHHH = (59999.0, 59999.0, 59999.0, 59999.0, 59999.0, 59999.0, + 59999.0, 59999.0, 59999.0, 59999.0, 59999.0, 59999.0) +NAME = 5.2 +KEY = Null +# Hello World! This is a really really long comment that needs to be +# wrapped onto several different lines to make the PVL file look really +# pretty! +KEY = (5, Null, 3.3 , "Hello World!") + +# Hello World! This is a really really long comment that needs to be +# wrapped onto several different lines to make the PVL file look really +# pretty! +KEY = (5, 88, 3.3 , "Hello World!") +key = ((a, b, c), ("Hubba Hubba", Bubba)) + + +Test SetUnits methods: + + original condition of Keyword k : + k = (radius, circumference) + + after k.SetUnits("circumference", "Fathoms") : + k = (radius , circumference ) + + after k.SetUnits("TeraFathoms") : + k = (radius, circumference) + + +---------------------------------------- +Testing cast operators +string = I'm being casted +int = 465721 +BigInt = 465721 +double = 131.244 +Test_key_2 = "Might work" +**USER ERROR** [Bob is a name] is invalid. Keyword name cannot contain whitespace. +Test_key_3 = "Might'not work" +Invalid Keyword Type: Integer Expected +Positive number Expected +Integer not in the Range. Expected (0-10) +Invalid Keyword Value: Expected values "value1", "value2", "value3" +Invalid Keyword Type: Expected Boolean values "true", "false", "null" diff --git a/isis/src/core/tests/unitTests/PvlKeyword/unitTest.cpp b/isis/src/core/tests/unitTests/PvlKeyword/unitTest.cpp new file mode 100644 index 0000000000..8ee62d1840 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlKeyword/unitTest.cpp @@ -0,0 +1,394 @@ +#include "PvlKeyword.h" +#include "IException.h" +#include "PvlSequence.h" +#include "Preference.h" + +#include +#include + +using namespace std; +using namespace Isis; + +int main() { + Isis::Preference::Preferences(true); + + QString keywordsToTry[] = { + "KEYWORD", + "KEYWORD X", + "KEYWORD =", + "KEYWORD = SOME_VAL", + "KEYWORD = \" val \"", + "KEYWORD = \" 'val' \"", + "KEYWORD = (VAL", + "KEYWORD = (VAL1,VAL2", + "KEYWORD = (A B,C,D)", + "KEYWORD = ((A B),(C),(D", + "KEYWORD = (SOME_VAL)", + "KEYWORD = (SOME_VAL) ", + "KEYWORD=(SOME_VAL)", + "KEYWORD = (A, )", + "KEYWORD = ()", + "KEYWORD = (A,B)", + "KEYWORD = {A, B}", + "KEYWORD = (A,B) #comment this", + "KEYWORD = ( A , B )", + "KEYWORD\t=\t( A\t,\tB )", + "KEYWORD = (A, B,C,D,E))", + "KEYWORD = ((1, 2), {3, 4}, (5), 6)", + "KEYWORD = { \"VAL1\" , \"VAL2\", \"VAL3\"}", + "KEYWORD = { \"VAL1\" , \"VAL2\", \"VAL3\")", + "KEYWORD = { \"VAL1\" ,", + "KEYWORD = \"(A,B,\"", + "KEYWORD = ',E)'", + "KEYWORD = ((1,2))", + "KEYWORD = (\"(f1+f2)\",\"/(f1-f2)\")", + "KEYWORD = \"(F1+F2)/(F1-F2)\"", + "KEYWORD = ( (1,2) , (A,B) )", + "KEYWORD = \"(f1 + min(f2,f3))\"", + "KEYWORD = \"(min(f2,f3) + f1)\"", + "KEYWORD = \"min(f2,f3) + f1\"", + "KEYWORD = \"f1 + min(f2,f3)\"", + "KEYWORD = (A , B , C, D )", + "KEYWORD = (A , B , C, D ) ", + "KEYWORD = ',E) ", + "KEYWORD = ,E) ", + "#SOMECOMMENT\nKEYWORD = SOME_VAL", + "#SOMECOMMENT1\n#SOMECOMMENT2\nKEYWORD = SOME_VAL", + "//SOMECOMMENT1\n#SOMECOMMENT2\nKEYWORD = SOME_VAL", + "/*SOMECOMMENT1*/\nKEYWORD = SOME_VAL", + "KEYWORD = '/*\n*/'", + "/* SOMECOMMENT1\n SOMECOMMENT2\nSOMECOMMENT3 */\nKEYWORD = SOME_VAL", + "/*C1\n\nA\n/*\nC3*/\nKEYWORD = SOME_VAL", + "/*C1\n/**/\nKEYWORD = SOME_VAL", + "/*C1\nA/**/\nKEYWORD = SOME_VAL", + "/* A */\n/* B *//*C*/\nKEYWORD = SOME_VAL", + "/*C1/**/\nKEYWORD = SOME_VAL", + "/*C1 \n\nA\n\nC3*//*Neato*//*Man*/KEYWORD = (A,B,C) /*Right?\nYes!*/" + }; + + cout << endl << endl; + cout << "----- Testing Basic Read/Write -----" << endl; + PvlKeyword keyword; + for(unsigned int key = 0; + key < sizeof(keywordsToTry) / sizeof(QString); + key++) { + QString keywordCpy = keywordsToTry[key]; + while(keywordCpy.contains("\n")) { + cout << keywordCpy.mid(0, keywordCpy.indexOf("\n") + 1); + keywordCpy = keywordCpy.mid(keywordCpy.indexOf("\n") + 1); + } + + cout << "'" << keywordCpy << "' "; + + for(int pad = keywordCpy.size(); pad < 30; pad++) { + cout << "-"; + } + + cout << "> "; + + vector< QString > keywordComments; + QString keywordName; + vector< pair > keywordValues; + + bool result = false; + + try { + result = keyword.readCleanKeyword(keywordsToTry[key], + keywordComments, + keywordName, + keywordValues); + + if(result) cout << "VALID" << endl; + else cout << "INCOMPLETE" << endl; + } + catch(IException &e) { + cout << "INVALID" << endl; + cout << " "; + cout.flush(); + e.print(); + } + + if(result) { + for(unsigned int comment = 0; comment < keywordComments.size(); comment++) + cout << " COMMENT: " << keywordComments[comment] << endl; + + cout << " NAME: " << keywordName << endl; + + for(unsigned int value = 0; value < keywordValues.size(); value++) { + cout << " VALUE: " << keywordValues[value].first; + + if(!keywordValues[value].second.isEmpty()) { + cout << " <" << keywordValues[value].second << ">"; + } + + cout << endl; + } + } + + } + + cout << endl << endl; + cout << "----- Testing Stream Read/Write -----" << endl; + for(unsigned int key = 0; + key < sizeof(keywordsToTry) / sizeof(QString); + key ++) { + stringstream stream; + PvlKeyword someKey; + + cout << "Input:\n" << keywordsToTry[key] << endl; + + cout << endl << "Output: " << endl; + try { + stream.write(keywordsToTry[key].toLatin1().data(), keywordsToTry[key].size()); + stream >> someKey; + cout << someKey << endl; + } + catch(IException &e) { + e.print(); + } + + cout << endl; + } + + cout << "----- Testing Difficult Cases Read/Write -----\n"; + + + try { + + const Isis::PvlKeyword keyL("FROM", + "/archive/projects/cassini/VIMS/UnivAZraw/tour/S60/cubes/GLO000OBMAP002//V1654449360_4.QUB"); + PvlKeyword keyLRead; + stringstream streamL; + streamL << keyL; + streamL >> keyLRead; + cout << keyLRead << endl; + + const Isis::PvlKeyword keyN("THE_INTERNET", + "Seven thousand eight hundred forty three million seventy four nine seventy six forty two eighty nine sixty seven thirty five million jillion bajillion google six nine four one two three four five six seven eight nine ten eleven twelve thirteen fourteen", + "terrabytes"); + PvlKeyword keyNRead; + stringstream streamN; + streamN << keyN; + streamN >> keyNRead; + cout << keyNRead << endl; + + const Isis::PvlKeyword keyZ("BIG_HUGE_LONG_NAME_THAT_SHOULD_TEST_OUT_PARSING", + "Seven thousand eight hundred forty three million seventy four", + "bubble baths"); + PvlKeyword keyZRead; + stringstream streamZ; + streamZ << keyZ; + streamZ >> keyZRead; + cout << keyZRead << endl; + + Isis::PvlKeyword keyU("ARRAY_TEST", toString(5.87), "lightyears"); + keyU.addValue("5465.6", "lightyears"); + keyU.addValue("574.6", "lightyears"); + + PvlKeyword keyURead; + stringstream streamU; + streamU << keyU; + streamU >> keyURead; + cout << keyURead << endl; + + const Isis::PvlKeyword keyV("FIRST_100_DIGITS_OF_PI", "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"); + PvlKeyword keyVRead; + stringstream streamV; + streamV << keyV; + streamV >> keyVRead; + cout << keyVRead << endl; + cout << "Raw Data -->" << endl; + cout << keyVRead[0] << endl << endl; + + + const Isis::PvlKeyword keyJ("A", "XXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxx"); + PvlKeyword keyJRead; + stringstream streamJ; + streamJ << keyJ; + streamJ >> keyJRead; + cout << keyJRead << endl; + + string keyB = "TREE = { \"MAPLE\" ,\n \"ELM\" \n, \"PINE\" }"; + PvlKeyword keyBRead; + stringstream streamB; + streamB << keyB; + streamB >> keyBRead; + cout << keyBRead << endl; + + Isis::PvlKeyword keyW("UGHHHHHHHHHHHH"); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + keyW += toString(59999.0); + + PvlKeyword keyWRead; + stringstream streamW; + streamW << keyW; + streamW >> keyWRead; + cout << keyWRead << endl; + + const Isis::PvlKeyword key("NAME", "5.2", "meters"); + + cout << key << endl; + + Isis::PvlKeyword key2("KEY"); + cout << key2 << endl; + + key2 += "5"; + key2 += QString(""); + key2.addValue("3.3", "feet"); + key2.addValue("Hello World!"); + QString str = "Hello World! This is a really really long comment that needs to" + " be wrapped onto several different lines to make the PVL file " + "look really pretty!"; + key2.addCommentWrapped(str); + cout << key2 << endl; + + cout << key2[1] << endl; + key2[1] = toString(88); + cout << key2 << endl; + + Isis::PvlSequence seq; + cout.flush(); + seq += "(a,b,c)"; + cout.flush(); + seq += "(\"Hubba Hubba\",\"Bubba\")"; + cout.flush(); + Isis::PvlKeyword k("key"); + k = seq; + cout << k << endl; + + // Test SetUnits methods + k = Isis::PvlKeyword("k", "radius", "meters"); + k.addValue("circumference", "meters"); + cout << "\n\n" + << "Test SetUnits methods:\n\n" + << " original condition of Keyword k :\n" + << " " << k << "\n\n" + << " after k.SetUnits(\"circumference\", \"Fathoms\") :\n"; + k.setUnits("circumference", "Fathoms"); + cout << " " << k << "\n\n" + << " after k.SetUnits(\"TeraFathoms\") :\n"; + k.setUnits("TeraFathoms"); + cout << " " << k << "\n\n\n"; + + //Test casting operators + cout << "----------------------------------------" << endl; + cout << "Testing cast operators" << endl; + Isis::PvlKeyword cast01("cast1", "I'm being casted"); + Isis::PvlKeyword cast02("cast2", "465721"); + Isis::PvlKeyword cast03("cast3", "131.2435"); + cout << "string = " << (QString)cast01 << endl; + cout << "int = " << (int)cast02 << endl; + cout << "BigInt = " << (Isis::BigInt)cast02 << endl; + cout << "double = " << (double)cast03 << endl; + + } + catch(Isis::IException &e) { + e.print(); + } + catch(...) { + cout << "Unknown error" << endl; + } + + try { + Isis::PvlKeyword key(" Test_key_2 ", "Might work"); + cout << key << endl; + Isis::PvlKeyword key2("Bob is a name", "Yes it is"); + } + catch(Isis::IException &e) { + e.print(); + } + + + try { + Isis::PvlKeyword key(" Test_key_3 ", "Might'not work"); + cerr << key << endl; + } + catch(Isis::IException &e) { + e.print(); + } + + // Test Validation of PvlKeywords + // Validate type integer + try { + // Template Keyword + PvlKeyword pvlTmplKwrd("KeyName", "integer"); + PvlKeyword pvlKwrd("KeyName", "3"); + pvlTmplKwrd.validateKeyword(pvlKwrd); + pvlKwrd.clear(); + + pvlKwrd=PvlKeyword("KeyName", "null"); + pvlTmplKwrd.validateKeyword(pvlKwrd); + pvlKwrd.clear(); + + pvlKwrd=PvlKeyword("KeyName", toString(3.5)); + pvlTmplKwrd.validateKeyword(pvlKwrd); + } + catch(Isis::IException &e) { + cerr << "Invalid Keyword Type: Integer Expected" << endl; + } + + // Test keyword__Type + try { + PvlKeyword pvlTmplKwrd("KeyName", "integer"); + PvlKeyword pvlKwrd("KeyName", toString(-3)); + pvlTmplKwrd.validateKeyword(pvlKwrd, "positive"); + } catch(Isis::IException &e) { + cerr <<"Positive number Expected" << endl; + } + + // Test keyword__Type + try { + PvlKeyword pvlTmplKwrd("KeyName", "integer"); + PvlKeyword pvlTmplKwrdRange("KeyName__Range", toString(0-10)); + PvlKeyword pvlKwrd("KeyName", toString(11)); + pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdRange); + } catch(Isis::IException &e) { + cerr <<"Integer not in the Range. Expected (0-10)" << endl; + } + + // Validate String + try { + PvlKeyword pvlTmplKwrd("KeyName", "string"); + PvlKeyword pvlTmplKwrdValue("KeyName__Value", "value0"); + pvlTmplKwrdValue.addValue("value1"); + pvlTmplKwrdValue.addValue("value2"); + pvlTmplKwrdValue.addValue("value3"); + PvlKeyword pvlKwrd("KeyName", "VALUe3"); + pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdValue); + pvlKwrd.clear(); + + pvlKwrd=PvlKeyword("KeyName", "value"); + pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdValue); + } + catch(Isis::IException &e) { + cerr << "Invalid Keyword Value: Expected values \"value1\", \"value2\", \"value3\"" << endl; + } + + // Validate Boolean + try { + PvlKeyword pvlTmplKwrd("KeyName", "boolean"); + PvlKeyword pvlKwrd("KeyName", "true"); + pvlTmplKwrd.validateKeyword(pvlKwrd); + pvlKwrd.clear(); + + pvlKwrd=PvlKeyword("KeyName", "null"); + pvlTmplKwrd.validateKeyword(pvlKwrd); + pvlKwrd.clear(); + + pvlKwrd=PvlKeyword("KeyName", "value"); + pvlTmplKwrd.validateKeyword(pvlKwrd); + } + catch(Isis::IException &e) { + cerr << "Invalid Keyword Type: Expected Boolean values \"true\", \"false\", \"null\"" << endl; + } +} diff --git a/isis/src/core/tests/unitTests/PvlSequence/PvlSequence.truth b/isis/src/core/tests/unitTests/PvlSequence/PvlSequence.truth new file mode 100644 index 0000000000..3da7513ec5 --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlSequence/PvlSequence.truth @@ -0,0 +1,10 @@ +8 +xyzzy plover +2 b | ^ 2 b +a b c +d e +singleton +1 2 +-1 -2 -3 +1.0 0.0 -1.0 +0 diff --git a/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp b/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp new file mode 100644 index 0000000000..bd97866dea --- /dev/null +++ b/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp @@ -0,0 +1,53 @@ +#include + +#include + +#include "PvlKeyword.h" +#include "PvlSequence.h" +#include "Preference.h" + +using namespace Isis; + +int main(void) { + Preference::Preferences(true); + + PvlKeyword key("Key"); + key += QString("(xyzzy,plover)"); + key += QString("(2,b,|,^,2,b)"); + + PvlSequence seq; + seq = key; + + seq += QString("(a,b,c)"); + seq += QString("(d,e)"); + seq += QString("singleton"); + + std::vector slist; + slist.push_back("1"); + slist.push_back("2"); + seq += slist; + + std::vector ilist; + ilist.push_back(-1); + ilist.push_back(-2); + ilist.push_back(-3); + seq += ilist; + + std::vector dlist; + dlist.push_back(1.0); + dlist.push_back(0.0); + dlist.push_back(-1.0); + seq += dlist; + + std::cout << seq.Size() << std::endl; + for(int i = 0; i < seq.Size(); i++) { + for(int j = 0; j < (int)seq[i].size(); j++) { + std::cout << seq[i][j] << " "; + } + std::cout << std::endl; + } + + seq.Clear(); + std::cout << seq.Size() << std::endl; + return 0; +} diff --git a/isis/src/core/tests/unitTests/SpecialPixel/SpecialPixel.truth b/isis/src/core/tests/unitTests/SpecialPixel/SpecialPixel.truth new file mode 100644 index 0000000000..942fe92a80 --- /dev/null +++ b/isis/src/core/tests/unitTests/SpecialPixel/SpecialPixel.truth @@ -0,0 +1,144 @@ +Unit test for IsisSpecialPixel +Valid minimum (1 byte): 1 +Null (1 byte): 0 +Low Representation (1 byte): 0 +Low Instrument (1 byte): 0 +High Representation (1 byte): 255 +High Instrument (1 byte): 255 +Valid maximum (1 byte): 254 + +Valid minimum (2 byte): -32752 +Null (2 byte): -32768 +Low Representation (2 byte): -32767 +Low Instrument (2 byte): -32766 +High Representation (2 byte): -32764 +High Instrument (2 byte): -32765 +Valid maximum (2 byte): 32767 + +Valid minimum (4 byte): -3.40282e+38 +Null (4 byte): -3.40282e+38 +Low Representation (4 byte): -3.40282e+38 +Low Instrument (4 byte): -3.40282e+38 +High Representation (4 byte): -3.40282e+38 +High Instrument (4 byte): -3.40282e+38 +Valid maximum (4 byte): 3.40282e+38 + +Valid minimum (8 byte): -1.797693134862315e+308 +Null (8 byte): -1.797693134862315e+308 +Low Representation (8 byte): -1.797693134862315e+308 +Low Instrument (8 byte): -1.797693134862315e+308 +High Representation (8 byte): -1.797693134862316e+308 +High Instrument (8 byte): -1.797693134862316e+308 +Valid maximum (8 byte): 1.797693134862316e+308 + +Testing 0.0 ... +IsSpecial: 0 +IsValidPixel: 1 +IsNullPixel: 0 +IsLowPixel: 0 +IsHighPixel: 0 +IsHrsPixel: 0 +IsHisPixel: 0 +IsLrsPixel: 0 +IsLisPixel: 0 + +Testing Isis::Null ... +IsSpecial: 1 +IsValidPixel: 0 +IsNullPixel: 1 +IsLowPixel: 0 +IsHighPixel: 0 +IsHrsPixel: 0 +IsHisPixel: 0 +IsLrsPixel: 0 +IsLisPixel: 0 + +Testing Isis::Lis ... +IsSpecial: 1 +IsValidPixel: 0 +IsNullPixel: 0 +IsLowPixel: 1 +IsHighPixel: 0 +IsHrsPixel: 0 +IsHisPixel: 0 +IsLrsPixel: 0 +IsLisPixel: 1 + +Testing Isis::Lrs ... +IsSpecial: 1 +IsValidPixel: 0 +IsNullPixel: 0 +IsLowPixel: 1 +IsHighPixel: 0 +IsHrsPixel: 0 +IsHisPixel: 0 +IsLrsPixel: 1 +IsLisPixel: 0 + +Testing Isis::His ... +IsSpecial: 1 +IsValidPixel: 0 +IsNullPixel: 0 +IsLowPixel: 0 +IsHighPixel: 1 +IsHrsPixel: 0 +IsHisPixel: 1 +IsLrsPixel: 0 +IsLisPixel: 0 + +Testing Isis::Hrs ... +IsSpecial: 1 +IsValidPixel: 0 +IsNullPixel: 0 +IsLowPixel: 0 +IsHighPixel: 1 +IsHrsPixel: 1 +IsHisPixel: 0 +IsLrsPixel: 0 +IsLisPixel: 0 + +Testing PixelToString(double): +Isis::Null to String: Null +Isis::Lrs to String: Lrs +Isis::Hrs to String: Hrs +Isis::His to String: His +Isis::Lis to String: Lis +0.0 to String: 0 +1.5 to String: 1.5 +-6.0 to String: -6 + +Testing StringToPixel(QString): +NuLl to Pixel: -1.797693134862315e+308 +lrs to Pixel: -1.797693134862315e+308 +Hrs to Pixel: -1.797693134862316e+308 +HIs to Pixel: -1.797693134862316e+308 +LIS to Pixel: -1.797693134862315e+308 +0.0 to Pixel: 0 +1.5 to Pixel: 1.5 +-6.0 to Pixel: -6 +-6 to Pixel: -6 + +Testing unique value shortcut for StringToPixel(QString): +Nul to Pixel: -1.797693134862315e+308 +N to Pixel: -1.797693134862315e+308 +Lr to Pixel: -1.797693134862315e+308 +Hr to Pixel: -1.797693134862316e+308 +Hi to Pixel: -1.797693134862316e+308 +Li to Pixel: -1.797693134862315e+308 + +Testing illegal shortcuts/expressions for StringToPixel(QString): +**USER ERROR** Input [Nl] does not appear to be a legal special pixel abbreviation or double value. +**ERROR** Failed to convert string [NL] to a double. +**USER ERROR** Input [Nulll] does not appear to be a legal special pixel abbreviation or double value. +**ERROR** Failed to convert string [NULLL] to a double. +**USER ERROR** Input [L] is not a unique abbreviation. Use LI or LR. +**USER ERROR** Input [Ls] does not appear to be a legal special pixel abbreviation or double value. +**ERROR** Failed to convert string [LS] to a double. +**USER ERROR** Input [H] is not a unique abbreviation. Use HI or HR. +**USER ERROR** Input [Hs] does not appear to be a legal special pixel abbreviation or double value. +**ERROR** Failed to convert string [HS] to a double. +**USER ERROR** Input [Hrsr] does not appear to be a legal special pixel abbreviation or double value. +**ERROR** Failed to convert string [HRSR] to a double. +**USER ERROR** Input [nonsense] does not appear to be a legal special pixel abbreviation or double value. +**ERROR** Failed to convert string [NONSENSE] to a double. + diff --git a/isis/src/core/tests/unitTests/SpecialPixel/unitTest.cpp b/isis/src/core/tests/unitTests/SpecialPixel/unitTest.cpp new file mode 100644 index 0000000000..ab80a979a5 --- /dev/null +++ b/isis/src/core/tests/unitTests/SpecialPixel/unitTest.cpp @@ -0,0 +1,295 @@ +#include +#include +#include "IException.h" +#include "IString.h" +#include "SpecialPixel.h" +#include "Preference.h" + +#include + +using namespace Isis; +using namespace std; + +int main(int argc, char *argv[]) { + Isis::Preference::Preferences(true); + + cout << "Unit test for IsisSpecialPixel" << endl; + + cout << "Valid minimum (1 byte): " << (int) Isis::VALID_MIN1 << endl; + cout << "Null (1 byte): " << (int) Isis::NULL1 << endl; + cout << "Low Representation (1 byte): " << (int) Isis::LOW_REPR_SAT1 << endl; + cout << "Low Instrument (1 byte): " << (int) Isis::LOW_INSTR_SAT1 << endl; + cout << "High Representation (1 byte): " << (int) Isis::HIGH_REPR_SAT1 << endl; + cout << "High Instrument (1 byte): " << (int) Isis::HIGH_INSTR_SAT1 << endl; + cout << "Valid maximum (1 byte): " << (int) Isis::VALID_MAX1 << endl; + cout << endl; + + cout << "Valid minimum (2 byte): " << Isis::VALID_MIN2 << endl; + cout << "Null (2 byte): " << Isis::NULL2 << endl; + cout << "Low Representation (2 byte): " << Isis::LOW_REPR_SAT2 << endl; + cout << "Low Instrument (2 byte): " << Isis::LOW_INSTR_SAT2 << endl; + cout << "High Representation (2 byte): " << Isis::HIGH_REPR_SAT2 << endl; + cout << "High Instrument (2 byte): " << Isis::HIGH_INSTR_SAT2 << endl; + cout << "Valid maximum (2 byte): " << Isis::VALID_MAX2 << endl; + cout << endl; + + cout << "Valid minimum (4 byte): " << Isis::VALID_MIN4 << endl; + cout << "Null (4 byte): " << Isis::NULL4 << endl; + cout << "Low Representation (4 byte): " << Isis::LOW_REPR_SAT4 << endl; + cout << "Low Instrument (4 byte): " << Isis::LOW_INSTR_SAT4 << endl; + cout << "High Representation (4 byte): " << Isis::HIGH_REPR_SAT4 << endl; + cout << "High Instrument (4 byte): " << Isis::HIGH_INSTR_SAT4 << endl; + cout << "Valid maximum (4 byte): " << Isis::VALID_MAX4 << endl; + cout << endl; + + cout << setprecision(16); + cout << "Valid minimum (8 byte): " << Isis::VALID_MIN8 << endl; + cout << "Null (8 byte): " << Isis::NULL8 << endl; + cout << "Low Representation (8 byte): " << Isis::LOW_REPR_SAT8 << endl; + cout << "Low Instrument (8 byte): " << Isis::LOW_INSTR_SAT8 << endl; + cout << "High Representation (8 byte): " << Isis::HIGH_REPR_SAT8 << endl; + cout << "High Instrument (8 byte): " << Isis::HIGH_INSTR_SAT8 << endl; + cout << "Valid maximum (8 byte): " << Isis::VALID_MAX8 << endl; + cout << endl; + + + + double d = 0.0; + cout << "Testing 0.0 ... " << endl; + cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; + cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; + cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; + cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; + cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; + cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; + cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; + cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; + cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; + cout << endl; + + d = Isis::Null; + cout << "Testing Isis::Null ... " << endl; + cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; + cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; + cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; + cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; + cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; + cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; + cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; + cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; + cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; + cout << endl; + + d = Isis::Lis; + cout << "Testing Isis::Lis ... " << endl; + cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; + cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; + cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; + cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; + cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; + cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; + cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; + cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; + cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; + cout << endl; + + d = Isis::Lrs; + cout << "Testing Isis::Lrs ... " << endl; + cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; + cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; + cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; + cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; + cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; + cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; + cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; + cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; + cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; + cout << endl; + + d = Isis::His; + cout << "Testing Isis::His ... " << endl; + cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; + cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; + cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; + cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; + cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; + cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; + cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; + cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; + cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; + cout << endl; + + d = Isis::Hrs; + cout << "Testing Isis::Hrs ... " << endl; + cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; + cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; + cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; + cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; + cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; + cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; + cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; + cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; + cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; + cout << endl; + +#if 0 + cout << Isis::IsEqual(Isis::NULL4, Isis::NULL4) << endl; + cout << Isis::IsEqual(Isis::NULL4, Isis::LOW_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::NULL4, Isis::LOW_REPR_SAT4) << endl; + cout << Isis::IsEqual(Isis::NULL4, Isis::HIGH_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::NULL4, Isis::HIGH_REPR_SAT4) << endl; + cout << endl; + + cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::NULL4) << endl; + cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::LOW_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::LOW_REPR_SAT4) << endl; + cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::HIGH_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::HIGH_REPR_SAT4) << endl; + cout << endl; + + cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::NULL4) << endl; + cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::LOW_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::LOW_REPR_SAT4) << endl; + cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::HIGH_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::HIGH_REPR_SAT4) << endl; + cout << endl; + + cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::NULL4) << endl; + cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::LOW_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::LOW_REPR_SAT4) << endl; + cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::HIGH_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::HIGH_REPR_SAT4) << endl; + cout << endl; + + cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::NULL4) << endl; + cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::LOW_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::LOW_REPR_SAT4) << endl; + cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::HIGH_INSTR_SAT4) << endl; + cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::HIGH_REPR_SAT4) << endl; + cout << endl; +#endif + + cout << "Testing PixelToString(double):" << endl; + d = Isis::Null; + cout << "Isis::Null to String:\t" << Isis::PixelToString(d) << endl; + d = Isis::Lrs; + cout << "Isis::Lrs to String:\t" << Isis::PixelToString(d) << endl; + d = Isis::Hrs; + cout << "Isis::Hrs to String:\t" << Isis::PixelToString(d) << endl; + d = Isis::His; + cout << "Isis::His to String:\t" << Isis::PixelToString(d) << endl; + d = Isis::Lis; + cout << "Isis::Lis to String:\t" << Isis::PixelToString(d) << endl; + d = 0.0; + cout << "0.0 to String:\t\t" << Isis::PixelToString(d) << endl; + d = 1.5; + cout << "1.5 to String:\t\t" << Isis::PixelToString(d) << endl; + d = -6.0; + cout << "-6.0 to String:\t\t" << Isis::PixelToString(d) << endl; + cout << endl; + + cout << "Testing StringToPixel(QString):" << endl; + QString s = "NuLl"; + cout << "NuLl to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "lrs"; + cout << "lrs to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "Hrs"; + cout << "Hrs to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "HIs"; + cout << "HIs to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "LIS"; + cout << "LIS to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "0.0"; + cout << "0.0 to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "1.5"; + cout << "1.5 to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "-6.0"; + cout << "-6.0 to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + cout << Isis::PixelToString(d) << " to Pixel:\t" << Isis::StringToPixel(Isis::PixelToString(d)) << endl; + cout << endl; + + cout << "Testing unique value shortcut for StringToPixel(QString):" << endl; + s = "Nul"; + cout << "Nul to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "N"; + cout << "N to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "Lr"; + cout << "Lr to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "Hr"; + cout << "Hr to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "Hi"; + cout << "Hi to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + s = "Li"; + cout << "Li to Pixel:\t\t" << Isis::StringToPixel(s) << endl; + cout << endl; + + cout << "Testing illegal shortcuts/expressions for StringToPixel(QString):" << endl; + try { + s = "Nl"; + Isis::StringToPixel(s); + } + catch(Isis::IException &e) { + e.print(); + } + try { + s = "Nulll"; + Isis::StringToPixel(s); + } + catch(Isis::IException &e) { + e.print(); + } + try { + s = "L"; + Isis::StringToPixel(s); + } + catch(Isis::IException &e) { + e.print(); + } + try { + s = "Ls"; + Isis::StringToPixel(s); + } + catch(Isis::IException &e) { + e.print(); + } + try { + s = "H"; + Isis::StringToPixel(s); + } + catch(Isis::IException &e) { + e.print(); + } + try { + s = "Hs"; + Isis::StringToPixel(s); + } + catch(Isis::IException &e) { + e.print(); + } + try { + s = "Hrsr"; + Isis::StringToPixel(s); + } + catch(Isis::IException &e) { + e.print(); + } + try { + s = "nonsense"; + Isis::StringToPixel(s); + } + catch(Isis::IException &e) { + e.print(); + } + cout << endl; + + + + + + + + + + +} + From 7e71f5a3aa0410b5a400de0650f2273ee1ed5031 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Fri, 12 Mar 2021 08:26:25 -0700 Subject: [PATCH 16/95] Finished swig wrapper with some syntax sugar for ease of use in python (#4352) --- isis/src/core/include/PvlContainer.h | 1 + isis/src/core/swig/isispvl.i | 43 +++++++++++++++++++++++- isis/src/core/swig/pvlGroup.i | 23 +++++++++++++ isis/src/core/swig/pvlKeyword.i | 14 ++++++-- isis/src/core/swig/pvlObject.i | 23 +++++++++++++ isis/src/core/swig/python/CMakeLists.txt | 4 +-- 6 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 isis/src/core/swig/pvlGroup.i create mode 100644 isis/src/core/swig/pvlObject.i diff --git a/isis/src/core/include/PvlContainer.h b/isis/src/core/include/PvlContainer.h index 284e189988..ced2cbcd4d 100644 --- a/isis/src/core/include/PvlContainer.h +++ b/isis/src/core/include/PvlContainer.h @@ -48,6 +48,7 @@ namespace Isis { */ class PvlContainer { public: + PvlContainer() = default; PvlContainer(const QString &type); PvlContainer(const QString &type, const QString &name); PvlContainer(const PvlContainer &other); diff --git a/isis/src/core/swig/isispvl.i b/isis/src/core/swig/isispvl.i index 8e25ef3066..3495220fff 100644 --- a/isis/src/core/swig/isispvl.i +++ b/isis/src/core/swig/isispvl.i @@ -1,10 +1,51 @@ %module isispvl -%include "pvlKeyword.i" +%{ + #include + #include + #include "Pvl.h" +%} %include std_string.i %include std_vector.i %include exception.i +%include "pvlKeyword.i" +%include "PvlContainer.h" +%include "pvlGroup.i" + +%include "pvlObject.i" +%nodefaultdtor Isis::PvlObject; + +%include "Pvl.h" +%nodefaultdtor Isis::Pvl; + +%extend Isis::Pvl { + const char* __str__() { + std::ostringstream out; + out << *$self; + std::string str = out.str(); + char * cstr = new char [str.length()+1]; + std::strcpy (cstr, str.c_str()); + return cstr; + } + + Pvl(const char* file) { + QString qfile(file); + Isis::Pvl *pvl = new Isis::Pvl(qfile); + return pvl; + } + + void read(const char* file) { + QString qfile(file); + $self->read(qfile); + } + + void write(const char* file) { + QString qfile(file); + $self->write(qfile); + } +} + class QString { public: diff --git a/isis/src/core/swig/pvlGroup.i b/isis/src/core/swig/pvlGroup.i new file mode 100644 index 0000000000..5460084700 --- /dev/null +++ b/isis/src/core/swig/pvlGroup.i @@ -0,0 +1,23 @@ +%module(package="isispvl") PvlGroup +%{ + #include "PvlGroup.h" +%} + +%include "PvlGroup.h" + +%extend Isis::PvlGroup { + const char* __str__() { + std::ostringstream out; + out << *$self; + std::string str = out.str(); + char * cstr = new char [str.length()+1]; + std::strcpy (cstr, str.c_str()); + return cstr; + } + + PvlGroup(const char* groupName) { + QString qgroupName(groupName); + Isis::PvlGroup *group = new Isis::PvlGroup(qgroupName); + return group; + } +} diff --git a/isis/src/core/swig/pvlKeyword.i b/isis/src/core/swig/pvlKeyword.i index 4d3c591c2f..e08a113ece 100644 --- a/isis/src/core/swig/pvlKeyword.i +++ b/isis/src/core/swig/pvlKeyword.i @@ -3,11 +3,19 @@ #include "PvlKeyword.h" %} - %include "PvlKeyword.h" -%extend Isis::PvlKeyword{ - PvlKeyword(const char* key, const char* val){ +%extend Isis::PvlKeyword { + const char* __str__() { + std::ostringstream out; + out << *$self; + std::string str = out.str(); + char * cstr = new char [str.length()+1]; + std::strcpy (cstr, str.c_str()); + return cstr; + } + + PvlKeyword(const char* key, const char* val) { QString qkey(key); QString qval(val); Isis::PvlKeyword *kw = new Isis::PvlKeyword(qkey, qval); diff --git a/isis/src/core/swig/pvlObject.i b/isis/src/core/swig/pvlObject.i new file mode 100644 index 0000000000..d4948a9438 --- /dev/null +++ b/isis/src/core/swig/pvlObject.i @@ -0,0 +1,23 @@ +%module(package="isispvl") PvlObject +%{ + #include "PvlObject.h" +%} + +%include "PvlObject.h" + +%extend Isis::PvlObject { + const char* __str__() { + std::ostringstream out; + out << *$self; + std::string str = out.str(); + char * cstr = new char [str.length()+1]; + std::strcpy (cstr, str.c_str()); + return cstr; + } + + PvlObject(const char* objectName) { + QString qobjectName(objectName); + Isis::PvlObject *object = new Isis::PvlObject(qobjectName); + return object; + } +} diff --git a/isis/src/core/swig/python/CMakeLists.txt b/isis/src/core/swig/python/CMakeLists.txt index 1fef0e5d34..3f93b670a0 100644 --- a/isis/src/core/swig/python/CMakeLists.txt +++ b/isis/src/core/swig/python/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_SWIG_FLAGS "") set(CMAKE_SWIG_OUTDIR isispvl) message(">>>> ${CMAKE_SWIG_OUTDIR}") set_source_files_properties(../isispvl.i - PROPERTIES CPLUSPLUS ON) + PROPERTIES CPLUSPLUS ON SWIG_FLAGS "-py3") #Find dependencies message(">>>> ${PROJECT_SOURCE_DIR}") @@ -16,7 +16,7 @@ find_path(PVL_INCLUDE_DIR NAMES Pvl.h PATH_SUFFIXES include PATHS ${PROJECT_SOURCE_DIR}/) find_library(PVL_LIBRARY NAMES core - PATHS ${CMAKE_SOURCE_DIR}/../build/objects/core/) + PATHS ${CMAKE_SOURCE_DIR}/../build/objects/core/) message("-- Found PVL Include: ${PVL_INCLUDE_DIR}") message("-- Found PVL Lib: ${PVL_LIBRARY}") include_directories(${PVL_INCLUDE_DIR}) From 48a92e6714684f388c4056fb8ebd7d48b52a2577 Mon Sep 17 00:00:00 2001 From: AustinSanders Date: Fri, 12 Mar 2021 14:32:07 -0700 Subject: [PATCH 17/95] Initial core deployment (#4355) --- isis/CMakeLists.txt | 2 +- isis/src/core/CMakeLists.txt | 19 +++++++++---------- isis/src/core/cmake/FindCSPICE.cmake | 18 ------------------ isis/src/core/cmake/FindGeos.cmake | 24 ------------------------ isis/src/core/swig/python/CMakeLists.txt | 11 ++--------- recipe/build_core.sh | 7 +++++++ 6 files changed, 19 insertions(+), 62 deletions(-) delete mode 100644 isis/src/core/cmake/FindCSPICE.cmake delete mode 100644 isis/src/core/cmake/FindGeos.cmake create mode 100755 recipe/build_core.sh diff --git a/isis/CMakeLists.txt b/isis/CMakeLists.txt index bbd39f5e85..4483b67d60 100644 --- a/isis/CMakeLists.txt +++ b/isis/CMakeLists.txt @@ -75,7 +75,7 @@ option(buildStaticCore "Build libisis static as well as dynamic" OFF ) option(buildTests "Set up unit, application, and module tests." ON ) option(JP2KFLAG "Whether or not to build using JPEG2000 support" OFF ) option(pybindings "Turn on to build Python bindings" ON ) -option(buildSwig "Turn on to build swig wrappers" OFF ) +option(ISIS_BUILD_SWIG "Turn on to build swig wrappers" OFF ) option(BUILD_CORE_TESTS "Turn on to build core tests" ON ) # if cmake install prefix is not set, and conda env is activated, use the diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 7eca141ff6..9072aa8add 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.10) project (core VERSION 0.0.1) option(buildStaticCore "Build libisis static as well as dynamic" OFF ) -option (BUILD_CORE_TESTS "Build core module tests" ON) +option (BUILD_TESTS "Build core module tests" ON) +option(ISIS_BUILD_SWIG "Turn on to build swig wrappers" OFF ) list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") @@ -46,7 +47,7 @@ set(Pvl_source_files ${PROJECT_SOURCE_DIR}/src/ArraySubscriptNotInRange.cpp ${PROJECT_SOURCE_DIR}/src/PvlObject.cpp ${PROJECT_SOURCE_DIR}/src/PvlSequence.cpp) # Define a target -add_library(core "${Pvl_source_files}") +add_library(core SHARED "${Pvl_source_files}") target_include_directories(core PUBLIC ${PROJECT_SOURCE_DIR}/include) @@ -70,10 +71,7 @@ find_package(Qt5 REQUIRED COMPONENTS # Search this path explicitly for MacOS OpenGL Framework PATHS /System/Library/Frameworks/ REQUIRED) -# find_package(Json REQUIRED) -find_package(Geos REQUIRED) find_package(nlohmann_json REQUIRED) -find_package(CSPICE 65 REQUIRED) include_directories(SYSTEM ${Qt5Widgets_INCLUDE_DIRS} @@ -90,21 +88,22 @@ target_link_libraries(core PUBLIC Qt5::Core Qt5::Xml nlohmann_json::nlohmann_json) -target_link_libraries(core PUBLIC ${GEOS_LIBRARY} ${CSPICE_LIBRARY}) -target_include_directories(core PUBLIC ${GEOS_INCLUDE_DIR} ${CSPICE_INCLUDE_DIR}) -install(DIRECTORY ${PROJECT_SOURCE_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX}/include/isis) +install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/isis + FILES_MATCHING PATTERN "*.h") + install(TARGETS core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) # Copy the preferences file EXECUTE_PROCESS(COMMAND cp -f ${PROJECT_SOURCE_DIR}/IsisPreferences ${CMAKE_BINARY_DIR}/) install(FILES ${CMAKE_SOURCE_DIR}/IsisPreferences DESTINATION ${CMAKE_INSTALL_PREFIX}) -if (BUILD_CORE_TESTS) +if (BUILD_TESTS) # Copy the test preferences file EXECUTE_PROCESS(COMMAND cp -f ${PROJECT_SOURCE_DIR}/TestPreferences ${CMAKE_BINARY_DIR}/) enable_testing() add_subdirectory(tests) endif() -if(buildSwig) +if(ISIS_BUILD_SWIG) add_subdirectory(swig) endif() diff --git a/isis/src/core/cmake/FindCSPICE.cmake b/isis/src/core/cmake/FindCSPICE.cmake deleted file mode 100644 index 3df2e1ff87..0000000000 --- a/isis/src/core/cmake/FindCSPICE.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# CMake module for find_package(CSPICE) -# Finds include directory and all applicable libraries -# -# Sets the following: -# CSPICE_INCLUDE_DIR -# CSPICE_LIBRARY - -find_path(CSPICE_INCLUDE_DIR - NAME SpiceUsr.h - PATH_SUFFIXES naif cspice -) - -find_library(CSPICE_LIBRARY - NAMES cspice -) - -message(STATUS "CSPICE INCLUDE: " ${CSPICE_INCLUDE_DIR} ) -message(STATUS "CSPICE LIB: " ${CSPICE_LIBRARY} ) diff --git a/isis/src/core/cmake/FindGeos.cmake b/isis/src/core/cmake/FindGeos.cmake deleted file mode 100644 index 2c88116adb..0000000000 --- a/isis/src/core/cmake/FindGeos.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# CMake module for find_package(Geos) -# Finds include directory and all applicable libraries -# -# Sets the following: -# GEOS_INCLUDE_DIR -# GEOS_LIBRARY - -find_path(GEOS_INCLUDE_DIR - NAMES geos.h - PATH_SUFFIXES "geos/geos${Geos_FIND_VERSION}" "geos" -) - -find_library(GEOS_LIBRARY - NAMES geos -) -find_library(GEOS_C_LIBRARY - NAMES geos_c -) - -message(STATUS "GEOS INCLUDE DIR: " ${GEOS_INCLUDE_DIR} ) -message(STATUS "GEOS LIB: " ${GEOS_LIBRARY} ) -message(STATUS "GEOS C LIB: " ${GEOS_C_LIBRARY} ) - -get_filename_component(GEOS_ROOT_INCLUDE_DIR "${GEOS_INCLUDE_DIR}" DIRECTORY) diff --git a/isis/src/core/swig/python/CMakeLists.txt b/isis/src/core/swig/python/CMakeLists.txt index 3f93b670a0..1e6d4493a0 100644 --- a/isis/src/core/swig/python/CMakeLists.txt +++ b/isis/src/core/swig/python/CMakeLists.txt @@ -4,21 +4,14 @@ include_directories(${PYTHON_INCLUDE_DIR}) set(CMAKE_SWIG_FLAGS "") set(CMAKE_SWIG_OUTDIR isispvl) -message(">>>> ${CMAKE_SWIG_OUTDIR}") set_source_files_properties(../isispvl.i PROPERTIES CPLUSPLUS ON SWIG_FLAGS "-py3") #Find dependencies -message(">>>> ${PROJECT_SOURCE_DIR}") -message(">>>> ${PYTHON_LIBRARY}") -message(">>>> ${CMAKE_SOURCE_DIR}") find_path(PVL_INCLUDE_DIR NAMES Pvl.h PATH_SUFFIXES include PATHS ${PROJECT_SOURCE_DIR}/) -find_library(PVL_LIBRARY NAMES core - PATHS ${CMAKE_SOURCE_DIR}/../build/objects/core/) message("-- Found PVL Include: ${PVL_INCLUDE_DIR}") -message("-- Found PVL Lib: ${PVL_LIBRARY}") include_directories(${PVL_INCLUDE_DIR}) # Add and link @@ -33,9 +26,9 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") if (APPLE) set_target_properties(_isispvl PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") # On OSX, do not link python - this causes segfaults - swig_link_libraries(isispvl ${PVL_LIBRARY}) + swig_link_libraries(isispvl core) else() - swig_link_libraries(isispvl ${PVL_LIBRARY} ${PYTHON_LIBRARY}) + swig_link_libraries(isispvl core ${PYTHON_LIBRARY}) endif() # Build out a standard directory structure diff --git a/recipe/build_core.sh b/recipe/build_core.sh new file mode 100755 index 0000000000..81d2ae2b41 --- /dev/null +++ b/recipe/build_core.sh @@ -0,0 +1,7 @@ +mkdir build_core install_core +cd build_core +export ISISROOT=$PWD +cmake -GNinja -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DISIS_BUILD_SWIG=ON -DCMAKE_INSTALL_PREFIX=../install_core ../isis/src/core +ninja core && ninja install +cd swig/python/ +python setup.py install From 5e504ebe5c1e8d67978da569d481cd49d9655680 Mon Sep 17 00:00:00 2001 From: Jesse Mapel Date: Fri, 12 Mar 2021 15:17:12 -0700 Subject: [PATCH 18/95] Updated preference files (#4354) --- .gitignore | 3 +- isis/src/core/IsisPreferences | 235 ++++++++++++++++++++++++++++++++++ isis/src/core/TestPreferences | 31 +++-- 3 files changed, 260 insertions(+), 9 deletions(-) create mode 100644 isis/src/core/IsisPreferences diff --git a/.gitignore b/.gitignore index 62a5c097e5..a8cdcdc8ce 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,10 @@ # Unignore all dirs !*/ -# Unignore Makefiles, and TestPreferences +# Unignore Makefiles, IsisPreferences, and TestPreferences !Makefile !TestPreferences +!IsisPreferences !*/3rdParty/Makefile # Unignore version file diff --git a/isis/src/core/IsisPreferences b/isis/src/core/IsisPreferences new file mode 100644 index 0000000000..26c2b36515 --- /dev/null +++ b/isis/src/core/IsisPreferences @@ -0,0 +1,235 @@ +####################################################### +# This file allows the user to customize their Isis +# configuration. See the Isis Preference Dictionary +# on our website isis.astrogeology.usgs.gov for a +# full description of each group. +######################################################## + +######################################################## +# Customize elements of the user interface +# +# ProgressBarPercent = 1 | 2 | 5 | 10 +# ProgressBar = On | Off +# GuiStyle = windows | motif | cde | motifplus | +# platinum | sgi | kde | aqua +# GuiHelpBrowser = { your preferred browser, may need path } +# GuiFontName = helvetica | times | charter | any legal font +# GuiFontSize = 10 | 12 | 14 | any font point size +# HistoryPath = { your preferred loaction for the application +# .par files } +# HistoryRecording = On | Off +# HistoryLength = (your preferred count of history entries +# to remember) +######################################################## + +Group=UserInterface + ProgressBarPercent = 10 + ProgressBar = Off + GuiHelpBrowser = firefox + GuiFontName = helvetica + GuiFontSize = 10 + GuiWidth = 460 + GuiHeight = 600 + HistoryPath = $HOME/.Isis/history + HistoryRecording = On + HistoryLength = 10 +EndGroup + +######################################################## +# Customize how errors are reported +# +# FileLine = On | Off +# Format = Standard | Pvl +# StackTrace = On | Off +######################################################## + +Group = ErrorFacility + FileLine = Off + Format = Standard + StackTrace = Off +EndGroup + +######################################################## +# Specify which ray-tracing engine to use for shape +# models. +# +# Leave the ShapeModel Group commented-out to continue +# using the ISIS default. +# +# RayTraceEngine = Bullet | Embree +# OnError = Continue | Fail +# Tolerance = { numerical value that will be set as the +# tolerance for the Bullet or Embree shape +# model } +# +######################################################## + +#Group = ShapeModel +# RayTraceEngine = Embree +# OnError = Continue +# CubeSupported = False +# Tolerance = DBL_MAX +#EndGroup + +######################################################## +# Customize how session logging is handled +# +# TerminalOutput = On | Off +# On - in command-line mode - user input parameters, +# results, and accounting are +# reported to the terminal. +# Errors are reported in Pvl +# also to the terminal. +# - in interactive mode - same as command-line +# mode, but output is directed +# to the gui. In the case of +# an error, nothing is reported +# to the gui except a pop-up +# window displaying the error. +# Off - in command-line mode - only the results are +# reported to the terminal, or +# in the case of an error, +# the error is reported in Pvl +# to the terminal. +# - in interactive mode - same as command-line mode, +# but the error is reported in +# a pop-up window in the gui. +# FileOutput = On | Off +# FileName = print.prt | /mydirectory/myfile.prt +# FileAccess = Append | Overwrite +######################################################## + +Group = SessionLog + TerminalOutput = Off + FileOutput = On + FileName = print.prt + FileAccess = Append +EndGroup + +######################################################## +# Customize how cubes are created +# +# Overwrite = Error | Allow +# Format = Attached | Detached +# History = On | Off +# MaximumSize = max # of gigabytes +######################################################## + +Group = CubeCustomization + Overwrite = Allow + Format = Attached + History = On + MaximumSize = 12 +EndGroup + +######################################################## +# Customize how other files are created +# +# Overwrite = Error | Allow +# +# If Error, then overwrites of any non-cube +# file will be disallowed and an error will be thrown +######################################################## + +Group = FileCustomization + Overwrite = Allow +EndGroup + +######################################################## +# Customize how Isis uses your computer's resources. +# +# CubeWriteThread = Always | Optimized | Never +# Always - Override Isis program defaults and always +# use a separate thread for writing out cubes. This +# will probably improve performance for some +# programs, will probably negatively impact programs +# that read/write the same file. This option should +# be used with caution. +# Optimized - Let the Isis program decide based on +# it's own internal knowledge. +# Never - Revert to the original method of writing +# cubes always. +# +# GlobalThreads = Optimized | N +# Optimized - The number of global (active processing) +# threads used will match the current system's number +# of CPU cores. +# N - +# Global (processing threads) encapsulate most of Isis' +# CPU-intensive operations. This should be a +# positive whole number greater than 0. This number +# does not cull the number of other thread-types in +# Isis, for example the cube write thread, but it +# should fairly accurately reflect overall potential +# CPU usage in Isis. +######################################################## +Group = Performance + CubeWriteThread = Optimized + GlobalThreads = Optimized +EndGroup + +######################################################## +# +# Indicate where ISIS should search for Community +# Sensor Model (CSM) plugins. The value of this keyword +# should be a list of paths, that contain CSM plugin +# libraries. +# +######################################################## + +Group = Plugins + CSMDirectory = ("$ISISROOT/lib/isis/csm3.0.3/", - + "$ISISROOT/csmlibs/3.0.3/", - + "$HOME/.Isis/csm3.0.3/") +EndGroup + +######################################################## +# Customize the location of mission specific data +# files (calibration and spice kernels). Usually this +# should be left to the Isis administrator +######################################################## + +Group = DataDirectory +# Backwards compatability for versions prior to 4.1.0 + ISIS3DATA = $ISISDATA + + Apollo15 = $ISISDATA/apollo15 + Apollo16 = $ISISDATA/apollo16 + Apollo17 = $ISISDATA/apollo17 + Base = $ISISDATA/base + Cassini = $ISISDATA/cassini + Chan1 = $ISISDATA/chan1 + Chandrayaan1 = $ISISDATA/chandrayaan1 + Clementine1 = $ISISDATA/clementine1 + Clipper = $ISISDATA/../datalocal/clipper + Control = $ISISDATA/control + Dawn = $ISISDATA/dawn + Galileo = $ISISDATA/galileo + Hayabusa = $ISISDATA/hayabusa + Hayabusa2 = $ISISDATA/hayabusa2 + Juno = $ISISDATA/juno + Kaguya = $ISISDATA/kaguya + Lo = $ISISDATA/lo + Lro = $ISISDATA/lro + Mariner10 = $ISISDATA/mariner10 + Mer = $ISISDATA/mer + Mex = $ISISDATA/mex + Messenger = $ISISDATA/messenger + Mgs = $ISISDATA/mgs + Mro = $ISISDATA/mro + Near = $ISISDATA/near + NewHorizons = $ISISDATA/newhorizons + Odyssey = $ISISDATA/odyssey + OsirisRex = $ISISDATA/osirisrex + Rolo = $ISISDATA/rolo + Rosetta = $ISISDATA/rosetta + Smart1 = $ISISDATA/smart1 + Tgo = $ISISDATA/tgo + Viking1 = $ISISDATA/viking1 + Viking2 = $ISISDATA/viking2 + Voyager1 = $ISISDATA/voyager1 + Voyager2 = $ISISDATA/voyager2 + Temporary = . +EndGroup + +End diff --git a/isis/src/core/TestPreferences b/isis/src/core/TestPreferences index 663d4de2f0..fee162b7c2 100644 --- a/isis/src/core/TestPreferences +++ b/isis/src/core/TestPreferences @@ -10,7 +10,7 @@ # # ProgressBarPercent = 1 | 2 | 5 | 10 # ProgressBar = On | Off -# GuiStyle = windows | motif | cde | motifplus | +# GuiStyle = windows | motif | cde | motifplus | # platinum | sgi | kde | aqua # GuiHelpBrowser = { your preferred browser, may need path } # GuiFontName = helvetica | times | charter | any legal font @@ -52,16 +52,16 @@ EndGroup ######################################################## # Specify which ray-tracing engine to use for shape # models. -# +# # Leave the ShapeModel Group commented-out to continue -# using the ISIS3 default. +# using the ISIS default. # # RayTraceEngine = Bullet | Embree # OnError = Continue | Fail # Tolerance = { numerical value that will be set as the # tolerance for the Bullet or Embree shape -# model } -# +# model } +# ######################################################## #Group = ShapeModel @@ -88,7 +88,7 @@ EndGroup # window displaying the error. # Off - in command-line mode - only the results are # reported to the terminal, or -# in the case of an error, +# in the case of an error, # the error is reported in Pvl # to the terminal. # - in interactive mode - same as command-line mode, @@ -119,7 +119,7 @@ Group = CubeCustomization Overwrite = Allow Format = Attached History = On - MaximumSize = 12 + MaximumSize = 12 EndGroup ######################################################## @@ -168,6 +168,21 @@ Group = Performance GlobalThreads = 2 EndGroup +######################################################## +# +# Indicate where ISIS should search for Community +# Sensor Model (CSM) plugins. The value of this keyword +# should be a list of paths, that contain CSM plugin +# libraries. +# +######################################################## + +Group = Plugins + CSMDirectory = ("$CONDA_PREFIX/lib/isis/csm3.0.3/", - + "$CONDA_PREFIX/csmlibs/3.0.3/", - + "$HOME/.Isis/csm3.0.3/") +EndGroup + ######################################################## # Customize the location of mission specific data # files (calibration and spice kernels). Usually this @@ -202,7 +217,7 @@ Group = DataDirectory Near = $ISISDATA/near NewHorizons = $ISISDATA/newhorizons Odyssey = $ISISDATA/odyssey - OsirisRex = $ISISDATA/../datalocal/osirisrex + OsirisRex = $ISISDATA/osirisrex Rolo = $ISISDATA/rolo Rosetta = $ISISDATA/rosetta Smart1 = $ISISDATA/smart1 From c63d653a2ae7ae065cb7b3f1dfb1c1188060a90b Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Wed, 9 Jun 2021 11:34:20 -0700 Subject: [PATCH 19/95] Reset main build and created core recipe Forgot meta.yaml Change where the build is pulling from Fixed qt requirement in core recipe Removed complier definition Turn swig build on --- core_recipe/build.sh | 8 +++++ core_recipe/meta.yaml | 70 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 core_recipe/build.sh create mode 100644 core_recipe/meta.yaml diff --git a/core_recipe/build.sh b/core_recipe/build.sh new file mode 100644 index 0000000000..1af92c9004 --- /dev/null +++ b/core_recipe/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash +mkdir build +cd build +export ISISROOT=$PWD +cmake -GNinja -DJP2KFLAG=ON -Dpybindings=OFF -DKAKADU_INCLUDE_DIR=/isisData/kakadu -DbuildTests=OFF -DCMAKE_BUILD_TYPE=Release -DISIS_BUILD_SWIG=ON -DCMAKE_INSTALL_PREFIX=$PREFIX ../isis/src/core +ninja install +cd ${SRC_DIR}/build/swig/python +python setup.py install diff --git a/core_recipe/meta.yaml b/core_recipe/meta.yaml new file mode 100644 index 0000000000..8c702324d5 --- /dev/null +++ b/core_recipe/meta.yaml @@ -0,0 +1,70 @@ +# When building ISIS for a public release, be sure that these variables are properly set to reflect +# your current build. Keep in mind that these values are how conda build names its .tar.bz2 build +# file, and so must be unique to other builds sitting in the USGS-Astrogeology channel on Anaconda +# Cloud, or they will be overwritten when you upload this current build. It is always a good idea to +# confirm that you will not be overwriting a file that has already been uploaded by checking the +# channel before building. + +# Also keep in mind that there must already be a Release or a Tag by the name _ +# on the USGS-Astrogeology/ISIS3 repo before invoking the conda build system as this will pull the +# tar.gz of that name to build. After pushing changes for a release build (so as to +# include these changes in the release), but before building using the conda build system, be +# sure to create this Release or Tag. + +# This is the version of ISIS that you are building. (Please refer to +# RFC2 (https://github.com/USGS-Astrogeology/ISIS3/wiki/RFC2:-Release-Process) if you are not sure +# about what version you are building.) +# Examples: +# A Public Release for ISIS3.6.1: {% set version = "3.6.1" %} +# A Release Candidate for ISIS3.6.1: {% set version = "3.6.1_RC" %} +# A custom build of ISIS3.6.1 for the CaSSIS mission: {% set version = "3.6.1_cassis" %} +{% set version = "5.1.0" %} + +# This is the build number for the current version you are building. If this is the first build of +# this version, the build number will be 0. It is incremented by 1 with every consecutive build of +# the same version. +{% set build_number = "0" %} + +package: + name: isispvl + version: {{ version }} + +source: + git_url: 'https://github.com/acpaquette/ISIS3.git' + git_tag: 'pvl_core' + + # url: 'https://github.com/USGS-Astrogeology/ISIS3/archive/{{ version }}.tar.gz' + # sha256 is the prefered checksum -- you can get it for a file with: + # `openssl sha256 `. Simply run this command with the .tar.gz + # file specified in the "url" tag above. + # sha256: '62b88bec88471588feb581e28afc2aa9248bd4e165ad83c448a4c5fa7b59a6e1' + +build: + number: {{ build_number }} + +# Shotgun strat on requirements until we can narrow them down +requirements: + build: + - cmake >=3.15 + - ninja + - nlohmann_json + - python + - qt >=5.9.6 + - swig + run: + - nlohmann_json + - {{ pin_compatible('qt', max_pin='x.x') }} + +tests: + imports: + - isispvl + commands: + - test -e $PREFIX/lib/libcore${SHLIB_EXT} + - test -e $PREFIX/include/isis/Pvl.h + + +about: + home: https://github.com/USGS-Astrogeology/ISIS3 + license: CC0-1.0 + license_file: LICENSE.md + summary: "Integrated Software for Imagers and Spectrometers" From a4a963deb73fc262e0121dc6dd1ae585645d1cf0 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Wed, 9 Jun 2021 14:53:24 -0700 Subject: [PATCH 20/95] Changed pvl recipe url to point to usgsastro --- core_recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core_recipe/meta.yaml b/core_recipe/meta.yaml index 8c702324d5..a0e0cefd1d 100644 --- a/core_recipe/meta.yaml +++ b/core_recipe/meta.yaml @@ -30,7 +30,7 @@ package: version: {{ version }} source: - git_url: 'https://github.com/acpaquette/ISIS3.git' + git_url: 'https://github.com/USGS-astrogeology/ISIS3.git' git_tag: 'pvl_core' # url: 'https://github.com/USGS-Astrogeology/ISIS3/archive/{{ version }}.tar.gz' From 486a28a5538e224abb672787e119c2a6b81bc7be Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Wed, 9 Jun 2021 14:54:14 -0700 Subject: [PATCH 21/95] Fixed typo --- core_recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core_recipe/meta.yaml b/core_recipe/meta.yaml index a0e0cefd1d..2e0ce7dd83 100644 --- a/core_recipe/meta.yaml +++ b/core_recipe/meta.yaml @@ -30,7 +30,7 @@ package: version: {{ version }} source: - git_url: 'https://github.com/USGS-astrogeology/ISIS3.git' + git_url: 'https://github.com/USGS-Astrogeology/ISIS3.git' git_tag: 'pvl_core' # url: 'https://github.com/USGS-Astrogeology/ISIS3/archive/{{ version }}.tar.gz' From dffc56e83cc33a120f9e6e62c6ec20bd04d4920c Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 10 Jun 2021 09:03:57 -0700 Subject: [PATCH 22/95] Removed a chunk of files that made it through the rebase (#4523) --- isis/src/core/FileName/unitTest.cpp | 346 ----------- isis/src/core/IException/IException.truth | 272 --------- isis/src/core/IException/unitTest.cpp | 199 ------- isis/src/core/IString/unitTest.cpp | 406 ------------- .../core/LabelTranslationManager/unitTest.cpp | 197 ------- isis/src/core/Message/unitTest.cpp | 105 ---- isis/src/core/Preference/unitTest.cpp | 76 --- isis/src/core/Pvl/unitTest.cpp | 150 ----- isis/src/core/PvlContainer/unitTest.cpp | 63 -- isis/src/core/PvlEditDialog/PvlEditDialog.cpp | 151 ----- isis/src/core/PvlEditDialog/PvlEditDialog.h | 63 -- isis/src/core/PvlEditDialog/unitTest.cpp | 20 - isis/src/core/PvlFlatMap/unitTest.cpp | 291 ---------- isis/src/core/PvlFormat/unitTest.cpp | 106 ---- isis/src/core/PvlFormatPds/unitTest.cpp | 456 --------------- isis/src/core/PvlGroup/unitTest.cpp | 178 ------ isis/src/core/PvlSequence/unitTest.cpp | 59 -- .../PvlToPvlTranslationManager/unitTest.cpp | 256 -------- .../PvlToXmlTranslationManager/unitTest.cpp | 235 -------- isis/src/core/PvlToken/unitTest.cpp | 58 -- isis/src/core/PvlTokenizer/unitTest.cpp | 150 ----- .../src/core/PvlTranslationTable/unitTest.cpp | 232 -------- isis/src/core/SpecialPixel/unitTest.cpp | 301 ---------- isis/src/core/TextFile/unitTest.cpp | 547 ------------------ 24 files changed, 4917 deletions(-) delete mode 100644 isis/src/core/FileName/unitTest.cpp delete mode 100644 isis/src/core/IException/IException.truth delete mode 100644 isis/src/core/IException/unitTest.cpp delete mode 100644 isis/src/core/IString/unitTest.cpp delete mode 100644 isis/src/core/LabelTranslationManager/unitTest.cpp delete mode 100644 isis/src/core/Message/unitTest.cpp delete mode 100644 isis/src/core/Preference/unitTest.cpp delete mode 100644 isis/src/core/Pvl/unitTest.cpp delete mode 100644 isis/src/core/PvlContainer/unitTest.cpp delete mode 100644 isis/src/core/PvlEditDialog/PvlEditDialog.cpp delete mode 100644 isis/src/core/PvlEditDialog/PvlEditDialog.h delete mode 100644 isis/src/core/PvlEditDialog/unitTest.cpp delete mode 100644 isis/src/core/PvlFlatMap/unitTest.cpp delete mode 100644 isis/src/core/PvlFormat/unitTest.cpp delete mode 100644 isis/src/core/PvlFormatPds/unitTest.cpp delete mode 100644 isis/src/core/PvlGroup/unitTest.cpp delete mode 100644 isis/src/core/PvlSequence/unitTest.cpp delete mode 100644 isis/src/core/PvlToPvlTranslationManager/unitTest.cpp delete mode 100644 isis/src/core/PvlToXmlTranslationManager/unitTest.cpp delete mode 100644 isis/src/core/PvlToken/unitTest.cpp delete mode 100644 isis/src/core/PvlTokenizer/unitTest.cpp delete mode 100644 isis/src/core/PvlTranslationTable/unitTest.cpp delete mode 100644 isis/src/core/SpecialPixel/unitTest.cpp delete mode 100644 isis/src/core/TextFile/unitTest.cpp diff --git a/isis/src/core/FileName/unitTest.cpp b/isis/src/core/FileName/unitTest.cpp deleted file mode 100644 index c553c745d7..0000000000 --- a/isis/src/core/FileName/unitTest.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include - -#include -#include -#include -#include -#include - -#include "FileName.h" -#include "IException.h" -#include "Preference.h" -#include "ProgramLauncher.h" - -using namespace std; -using namespace Isis; - -void TestVersioning(QString prefix, QString name, bool containsDate = false); -void TestExpanded(QString prefix, QString name); -void TestExtensionChanges(QString prefix, QString name, bool showExpandedValues); -void TestGenericAccessors(QString prefix, QString name, bool showExpandedValues); - -int main(int argc, char *argv[]) { - Preference::Preferences(true); - - QCoreApplication app(argc, argv); - - QStringList filesToFullTest; - filesToFullTest << "/path/base.ext+attr" << "/path1/.path2/base.ext+attr" - << "/path1/pat.h2/base+attr" << "/.path1/path2/base" - << "/.path1/path2/base.+attr" << "/another/path/base.ex1.exten2.ext3" - << "/$BADENV/base.ext+attr" << "/.path1/base+attr1+attr2" - << "unitTest.cpp" << "./unitTest.cpp" << "Makefile" << ".cub" - << "/$TEMPORARY/unitTest.cpp"; - - foreach (QString fileToTest, filesToFullTest) { - cout << "Running Full Test on [" << qPrintable(fileToTest) << "]" << endl; - TestGenericAccessors("\t", fileToTest, true); - TestExtensionChanges("\t", fileToTest, true); - TestExpanded("\t", fileToTest); - } - - // Test temp files thoroughly - cout << "Testing temporary file name placement" << endl; - QString tempFileNameTestStr = "$TEMPORARY/tttt.tmp"; - FileName n = FileName::createTempFile(tempFileNameTestStr); - cout << "\tInput name and extension : " << tempFileNameTestStr << endl; - cout << "\tExtension: : " << n.extension() << endl; - cout << "\tOriginal Path: : " << n.originalPath() << endl; - cout << "\tExists: : " << n.fileExists() << endl; - cout << "\tName (cleaned): : " << - QString(n.name().mid(0, 4) + - QString("%1").arg("", n.name().size() - 8, '?') + - n.name().mid(n.name().size() - 4)) << endl; - cout << endl; - - if (!QFile(n.toString()).remove()) { - cout << "\t**Failed to delete temporary file [" << n.toString() << "]**" << endl; - } - - { - cout << "Testing parallel temporary file name creation for atomicity" << endl; - int numToTest = QThreadPool::globalInstance()->maxThreadCount() * 20; - - QStringList templateFileNames; - for (int i = 0; i < numToTest; i++) - templateFileNames.append(QString("tttt.tmp")); - - QList results = QtConcurrent::blockingMapped(templateFileNames, - &FileName::createTempFile); - bool success = true; - - while (results.count()) { - FileName result = results.first(); - int count = results.removeAll(result); - - if (count != 1) { - cout << "File name: " << result.toString() << " encountered " - << count << " times" << endl; - success = false; - } - - if (!result.fileExists()) { - cout << "File name: " << result.toString() << " encountered does not exists"; - success = false; - } - - QFile(result.toString()).remove(); - } - - if (success) { - cout << "\tSuccess!" << endl; - } - else { - cout << "\t**Failed to uniquely create temporary files in parallel**" << endl; - } - - cout << endl; - } - - - // Test versioning thoroughly - { - QStringList tempFiles; - tempFiles << "tttt000001" << "tttt000001.tmp" << "tttt000005.tmp" << "tttt000006.tmp" - << "tttt000008.tmp" << "1tttt000008.tmp" << "2tttt000008.tmp" - << "tttt_0.tmp" << "junk06.tmp" << "junk09.tmp" << "tttt05Sep2002.tmp" - << "tttt20Jan2010.tmp" << "tttt14Apr2010.tmp" << "ttAPRtt22yy99.tmp" - << "ttMARtt11yy00.tmp" << "ttFEBtt04yy01.tmp" << "ttMARtt072003.tmp" - << "tt14ttNovember.tmp" << "tt2ttDecember.tmp" << "tttt.tmp" << "APR-22-99_v001.tmp" - << "APR-22-99_v004.tmp" << "APR-21-99_v009.tmp"; - - foreach (QString fileName, tempFiles) { - if (!QFile(fileName).open(QIODevice::WriteOnly | QIODevice::Truncate)) { - cout << "Failed to create temporary file for test: " << qPrintable(fileName) << endl; - } - } - - - cout << "Testing Versioning Missing Problems" << endl; - TestVersioning("\t", "tttt"); - TestVersioning("\t", "tttt{}.tmp"); - TestVersioning("\t", "ttttt{}.tmp"); - - cout << "Testing Numerical-Only Versioning" << endl; - TestVersioning("\t", "tttt??????"); - TestVersioning("\t", "tttt??????.tmp"); - TestVersioning("\t", "tttt_?.tmp"); - TestVersioning("\t", "??tttt"); - TestVersioning("\t", "?tttt000008.tmp"); - TestVersioning("\t", "junk?"); - TestVersioning("\t", "??tttt??"); - - - cout << "Testing Date-Only Versioning" << endl; - TestVersioning("\t", "tttt{ddMMMyyyy}.tmp", true); - TestVersioning("\t", "tt{MMM}tt{dd}yy{yy}.tmp", true); - TestVersioning("\t", "tt{d}tt{MMM}.tmp", true); - TestVersioning("\t", "tt{d}tt{MMMM}.tmp", true); - TestVersioning("\t", "tt{dd}.tmp", true); - TestVersioning("\t", "tttt{dd}.tmp", true); - TestVersioning("\t", "tttt{aaaa}.tmp"); - - - cout << "Testing Date and Numerical Versioning Combined" << endl; - TestVersioning("\t", "$TEMPORARY/{MMM}-{dd}-{yy}_v???.tmp", true); - - // Test new version for date file. Makes a file for today, which cannot be - // printed as truth, so compare it with what we expect and print the result. - FileName todayFileName("tttt{dd}tt{yyyy}tt{MMM}.tmp"); - cout << "Verifying NewVersion for file " << todayFileName.name() << " is today" << endl; - bool success = false; - try { - todayFileName = todayFileName.newVersion(); - QDate today = QDate::currentDate(); - QString expected = today.toString("'tttt'dd'tt'yyyy'tt'MMM'.tmp'"); - success = todayFileName.name() == expected; - cout << "\tMade today's filename successfully? " << success << endl; - - if (!success) - cout << "\t\tMade: " << todayFileName.name() << "; expected: " << expected.toStdString() - << endl; - } - catch(IException &error) { - error.print(); - } - cout << endl; - - foreach (QString fileName, tempFiles) { - if (!QFile(fileName).remove()) { - cout << "Failed to delete temporary file for test: " << qPrintable(fileName) << endl; - cout << "Was it specified twice?" << endl; - } - } - } - - return 0; -} - - -void TestVersioning(QString prefix, QString name, bool containsDate) { - cout << prefix << "Testing Versioning Methods [" << name << "]" << endl; - - try { - FileName test(name); - - try { - cout << prefix << "\tHighest Version Name: "; - cout << test.highestVersion().name() << endl; - cout << prefix << "\tHighest Version Orig: "; - cout << test.highestVersion().original() << endl; - cout << prefix << "\tHighest Version Orig Path: "; - cout << test.highestVersion().originalPath() << endl; - cout << prefix << "\tHigh version changed FileName: "; - cout << (test != test.highestVersion()) << endl; - } - catch (IException &e) { - cout << prefix << "\tHighest Version Failed: " << e.toString() << endl; - } - - try { - if (!containsDate) { - cout << prefix << "\tNew Version Name: "; - cout << test.newVersion().name() << endl; - cout << prefix << "\tNew Version Orig: "; - cout << test.newVersion().original() << endl; - cout << prefix << "\tNew Version Orig Path: "; - cout << test.newVersion().originalPath() << endl; - cout << prefix << "\tNew version changed FileName: "; - cout << (test != test.newVersion()) << endl; - } - } - catch (IException &e) { - cout << prefix << "\tNew Version Failed: " << e.toString() << endl; - } - } - catch(IException &e) { - cout << prefix << "\tError creating file name: " << e.toString() << endl; - } - - cout << endl; -} - - -void TestGenericAccessors(QString prefix, QString name, bool showExpandedValues) { - FileName a(name); - - // Test our assignment & copy construct every time - FileName b; - b = a; - FileName c(b); - FileName test; - test = c; - - cout << prefix << "Testing Basics [" << name << "]" << endl; - cout << prefix << "\tName: " << test.name() << endl; - cout << prefix << "\tBase Name: " << test.baseName() << endl; - - if (showExpandedValues) { - cout << prefix << "\tPath: " << test.path() << endl; - } - - cout << prefix << "\tOriginal path " << test.originalPath() << endl; - - cout << prefix << "\tExtension: " << test.extension() << endl; - - cout << prefix << "\tComparison (==): " << (a == c) << endl; - - cout << prefix << "\tComparison (!=): " << (a != c) << endl; - - if (showExpandedValues) { - cout << prefix << "\tExpanded " << test.expanded() << endl; - } - - cout << prefix << "\tExists " << test.fileExists() << endl; - cout << endl; -} - - -void TestExtensionChanges(QString prefix, QString name, bool showExpandedValues) { - FileName a(name); - - // Test our assignment & copy construct every time - FileName b; - b = a; - FileName c(b); - FileName test; - test = c; - - QString (FileName::*toStringMethod)() const = &FileName::toString; - - FileName beforeLastChange = test; - - if (!showExpandedValues) { - toStringMethod = &FileName::original; - } - - cout << prefix << "Testing Extension change [" << name << "]" << endl; - cout << prefix << "\tBefore modification: " << (test.*toStringMethod)() << endl; - cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; - cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; - beforeLastChange = test; - test = test.removeExtension(); - cout << prefix << "\tRemoved Extension: " << (test.*toStringMethod)() << endl; - cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; - cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; - beforeLastChange = test; - test = test.addExtension("tmp"); - cout << prefix << "\tAdded Extension [tmp]: " << (test.*toStringMethod)() << endl; - cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; - cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; - beforeLastChange = test; - test = test.addExtension("jpg"); - cout << prefix << "\tAdded Extension [jpg]: " << (test.*toStringMethod)() << endl; - cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; - cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; - beforeLastChange = test; - test = test.addExtension("jpg"); - cout << prefix << "\tAdded Extension [jpg]: " << (test.*toStringMethod)() << endl; - cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; - cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; - beforeLastChange = test; - test = test.setExtension("gif"); - cout << prefix << "\tSet Extension [gif]: " << (test.*toStringMethod)() << endl; - cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; - cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; - beforeLastChange = test; - test = test.addExtension("jpg"); - cout << prefix << "\tAdded Extension [jpg]: " << (test.*toStringMethod)() << endl; - cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; - cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; - beforeLastChange = test; - test = test.removeExtension(); - cout << prefix << "\tRemoved Extension: " << (test.*toStringMethod)() << endl; - cout << prefix << "\t\tChanged: " << (beforeLastChange != test) << endl; - cout << prefix << "\t\tUnchanged: " << (beforeLastChange == test) << endl; - cout << endl; -} - - -void TestExpanded(QString prefix, QString name) { - FileName a(name); - - // Test our assignment & copy construct every time - FileName b; - b = a; - FileName c(b); - FileName test; - test = c; - - cout << prefix << "Testing Expanded [" << name << "]" << endl; - - cout << prefix << "\tName: " << test.name() << endl; - cout << prefix << "\tBase Name: " << test.baseName() << endl; - cout << prefix << "\tExtension: " << test.extension() << endl; - cout << prefix << "\tOriginal path " << test.originalPath() << endl; - cout << prefix << "\tExists " << test.fileExists() << endl; - - cout << endl; -} diff --git a/isis/src/core/IException/IException.truth b/isis/src/core/IException/IException.truth deleted file mode 100644 index ed7e5320df..0000000000 --- a/isis/src/core/IException/IException.truth +++ /dev/null @@ -1,272 +0,0 @@ -Test Error 1 -print(): -what(): - - -Test Error 2 -print(): -**USER ERROR** -what(): -**USER ERROR** - -Test Error 3 -print(): -**USER ERROR** -**USER ERROR** -what(): -**USER ERROR** -**USER ERROR** - -Test Error 4 -print(): -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** -what(): -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Test Error 5 -toPvl(): -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 - Message = "Testing user error" - File = unitTest.cpp - Line = 69 -End_Group - -Group = Error - Program = Unknown - Code = 1 - Message = "Testing unknown error" - File = unitTest.cpp - Line = 56 -End_Group - -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 - File = unitTest.cpp - Line = 44 -End_Group - -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 -End_Group -End -what(): -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Test Error 6 -print(): -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** -what(): -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Test Error 7 -print(): -**I/O ERROR** Testing I/O error in unitTest.cpp at 94. -**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 81. -**USER ERROR** Testing user error in unitTest.cpp at 69. -**ERROR** Testing unknown error in unitTest.cpp at 56. -**USER ERROR** in unitTest.cpp at 44. -**USER ERROR** -what(): -**I/O ERROR** Testing I/O error. -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Test Throwing Error: No reaction - -Test Throwing Error: Print -print(): -**I/O ERROR** Testing I/O error. -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** -what(): -**I/O ERROR** Testing I/O error. -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Test Throwing Error: Rethrow and print -**ERROR** Another error. -**I/O ERROR** Testing I/O error. -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Test Preference 'FileLine' -Turned ON -- print(): -**I/O ERROR** Testing I/O error in unitTest.cpp at 94. -**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 81. -**USER ERROR** Testing user error in unitTest.cpp at 69. -**ERROR** Testing unknown error in unitTest.cpp at 56. -**USER ERROR** in unitTest.cpp at 44. -**USER ERROR** - -Turned OFF -- print(): -**I/O ERROR** Testing I/O error. -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Turned ON, override to OFF -- print(false): -**I/O ERROR** Testing I/O error. -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Test Preference 'Format' -Standard Format -- print(): -**I/O ERROR** Testing I/O error. -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Standard Format -- toString(): -**I/O ERROR** Testing I/O error. -**PROGRAMMER ERROR** Testing programmer error. -**USER ERROR** Testing user error. -**ERROR** Testing unknown error. -**USER ERROR** -**USER ERROR** - -Pvl Format -- print(): -Group = Error - Program = Unknown - Class = "I/O ERROR" - Code = 4 - Message = "Testing I/O error" - File = unitTest.cpp - Line = 94 -End_Group - -Group = Error - Program = Unknown - Class = "PROGRAMMER ERROR" - Code = 3 - Message = "Testing programmer error" - File = unitTest.cpp - Line = 81 -End_Group - -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 - Message = "Testing user error" - File = unitTest.cpp - Line = 69 -End_Group - -Group = Error - Program = Unknown - Code = 1 - Message = "Testing unknown error" - File = unitTest.cpp - Line = 56 -End_Group - -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 - File = unitTest.cpp - Line = 44 -End_Group - -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 -End_Group -End - -Pvl Format -- toString(): -Group = Error - Program = Unknown - Class = "I/O ERROR" - Code = 4 - Message = "Testing I/O error" - File = unitTest.cpp - Line = 94 -End_Group - -Group = Error - Program = Unknown - Class = "PROGRAMMER ERROR" - Code = 3 - Message = "Testing programmer error" - File = unitTest.cpp - Line = 81 -End_Group - -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 - Message = "Testing user error" - File = unitTest.cpp - Line = 69 -End_Group - -Group = Error - Program = Unknown - Code = 1 - Message = "Testing unknown error" - File = unitTest.cpp - Line = 56 -End_Group - -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 - File = unitTest.cpp - Line = 44 -End_Group - -Group = Error - Program = Unknown - Class = "USER ERROR" - Code = 2 -End_Group -End - -Pvl Format -- empty toString(): - - diff --git a/isis/src/core/IException/unitTest.cpp b/isis/src/core/IException/unitTest.cpp deleted file mode 100644 index b08b76a149..0000000000 --- a/isis/src/core/IException/unitTest.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include "Preference.h" - -#include "IException.h" - -using namespace std; -using namespace Isis; - -int main(void) { - Isis::Preference::Preferences(true); - - IException lastError; - - cerr << "Test Error 1\n"; - { - IException error; - error.append(lastError); - cerr << "print():\n"; - error.print(); - cerr << "what():\n" << error.what() << "\n"; - lastError = error; - } - cerr << "\n"; - - cerr << "Test Error 2\n"; - { - IException error(IException::User, "", "", -1); - error.append(lastError); - cerr << "print():\n"; - error.print(); - cerr << "what():\n" << error.what() << "\n"; - lastError = error; - } - cerr << "\n"; - - cerr << "Test Error 3\n"; - { - IException error(IException::User, "", _FILEINFO_); - error.append(lastError); - cerr << "print():\n"; - error.print(); - cerr << "what():\n" << error.what() << "\n"; - lastError = error; - } - cerr << "\n"; - - cerr << "Test Error 4\n"; - { - IException error( - IException::Unknown, "Testing unknown error.", _FILEINFO_); - error.append(lastError); - cerr << "print():\n"; - error.print(); - cerr << "what():\n" << error.what() << "\n"; - lastError = error; - } - cerr << "\n"; - - cerr << "Test Error 5\n"; - { - IException error( - lastError, - IException::User, "Testing user error", _FILEINFO_); - cerr << "toPvl():\n"; - Pvl pvlOutput(error.toPvl()); - cerr << pvlOutput << "\n"; - cerr << "what():\n" << error.what() << "\n"; - lastError = error; - } - cerr << "\n"; - - cerr << "Test Error 6\n"; - { - IException error( - IException::Programmer, "Testing programmer error.", _FILEINFO_); - error.append(lastError); - cerr << "print():\n"; - error.print(); - cerr << "what():\n" << error.what() << "\n"; - lastError = error; - } - cerr << "\n"; - - cerr << "Test Error 7\n"; - { - IException error( - lastError, - IException::Io, "Testing I/O error.", _FILEINFO_); - cerr << "print():\n"; - error.print(true); - cerr << "what():\n" << error.what() << "\n"; - lastError = error; - } - cerr << "\n"; - - cerr << "Test Throwing Error: No reaction\n"; - { - try { - throw lastError; - } - catch (IException &e) { - } - } - cerr << "\n"; - - cerr << "Test Throwing Error: Print\n"; - { - try { - throw lastError; - } - catch (IException &e) { - cerr << "print():\n"; - e.print(); - cerr << "what():\n" << e.what() << "\n"; - } - } - cerr << "\n"; - - cerr << "Test Throwing Error: Rethrow and print\n"; - { - try { - try { - throw lastError; - } - catch (IException &e) { - throw IException(e, IException::Unknown, "Another error", _FILEINFO_); - } - } - catch (IException &e) { - e.print(); - } - } - cerr << "\n"; - - Pvl &prefs = Preference::Preferences(); - PvlGroup &errorPrefs = prefs.findGroup("ErrorFacility"); - - cerr << "Test Preference 'FileLine'\n"; - { - QString &fileLineValue = errorPrefs["FileLine"][0]; - - fileLineValue = "On"; - - cerr << "Turned ON -- print():\n"; - lastError.print(); - cerr << "\n"; - - fileLineValue = "Off"; - - cerr << "Turned OFF -- print():\n"; - lastError.print(); - cerr << "\n"; - - fileLineValue = "On"; - - cerr << "Turned ON, override to OFF -- print(false):\n"; - lastError.print(false); - cerr << "\n"; - - fileLineValue = "Off"; // restore original value - } - - cerr << "Test Preference 'Format'\n"; - { - QString &formatValue = errorPrefs["Format"][0]; - - formatValue = "Standard"; - - cerr << "Standard Format -- print():\n"; - lastError.print(); - cerr << "\n"; - - cerr << "Standard Format -- toString():\n"; - cerr << lastError.toString() << "\n\n"; - - formatValue = "Pvl"; - - cerr << "Pvl Format -- print():\n"; - lastError.print(); - cerr << "\n"; - - cerr << "Pvl Format -- toString():\n"; - cerr << lastError.toString() << "\n\n"; - - cerr << "Pvl Format -- empty toString():\n"; - cerr << IException().toString() << "\n\n"; - - formatValue = "Standard"; // restore original value - } - - return 0; -} - diff --git a/isis/src/core/IString/unitTest.cpp b/isis/src/core/IString/unitTest.cpp deleted file mode 100644 index 1ee2c6bdb9..0000000000 --- a/isis/src/core/IString/unitTest.cpp +++ /dev/null @@ -1,406 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include "IString.h" - -#include -#include -#include -#include - -#include "IException.h" -#include "Preference.h" - -using namespace Isis; -using namespace std; - -inline string yesOrNo(bool b) { - if(b) return (string("Yes")); - return (string("No")); -} - -int main(int argc, char *argv[]) { - Preference::Preferences(true); - cerr.precision(14); - - // Tests for the functions - cerr << "Testing toBool" << endl; - cerr << "\tTrue: " << toBool("True") << endl; - cerr << "\tFalse: " << toBool("False") << endl; - - try { - toBool("..."); - } - catch (IException &e) { - cerr << "\t" << e.toString() << endl; - } - - cerr << endl; - cerr << "Testing toInt" << endl; - cerr << "\t" << toInt("0") << endl; - cerr << "\t" << toInt("5") << endl; - cerr << "\t" << toInt("-5") << endl; - cerr << "\t" << toInt("2147483647") << endl; - cerr << "\t" << toInt("-2147483647") << endl; - - try { - toInt("-5.0"); - } - catch (IException &e) { - cerr << "\t" << e.toString() << endl; - } - - try { - toInt("2147483648"); - } - catch (IException &e) { - cerr << "\t" << e.toString() << endl; - } - cerr << endl; - - cerr << "Testing toBigInt" << endl; - cerr << "\t" << toBigInt("0") << endl; - cerr << "\t" << toBigInt("5") << endl; - cerr << "\t" << toBigInt("-5") << endl; - cerr << "\t" << toBigInt("9223372036854775807") << endl; - cerr << "\t" << toBigInt("-9223372036854775807") << endl; - - try { - toBigInt("-5.0"); - } - catch (IException &e) { - cerr << "\t" << e.toString() << endl; - } - - try { - toBigInt("9223372036854775808"); - } - catch (IException &e) { - cerr << "\t" << e.toString() << endl; - } - cerr << endl; - - cerr << "Testing toDouble" << endl; - cerr << "\t" << toDouble("0.0") << endl; - cerr << "\t" << toDouble("5.25") << endl; - cerr << "\t" << toDouble("-5.25") << endl; - cerr << "\t" << toDouble("16#FF7FFFFB#") << endl; - cerr << "\t" << toDouble("1e100") << endl; - cerr << "\t" << toDouble("-1E100") << endl; - cerr << "\t" << toDouble("1.79769313486232e+308") << endl; - - try { - toDouble("fred"); - } - catch (IException &e) { - cerr << "\t" << e.toString() << endl; - } - cerr << endl; - - cerr << "Testing toString" << endl; - cerr << "\tbool(false): " << toString(false) << endl; - cerr << "\tbool(true): " << toString(true) << endl; - cerr << "\tchar(A): " << toString('A') << endl; - cerr << "\tint(2147483647): " << toString(2147483647) << endl; - cerr << "\tuint(2147483648): " << toString((unsigned int)2147483648) << endl; - cerr << "\tBigInt(2147483648): " << toString(2147483648) << endl; - cerr << "\tdouble(0.0): " << toString(0.0) << endl; - cerr << "\tdouble(DBL_MIN): " << toString(DBL_MIN) << endl; - cerr << "\tdouble(DBL_MAX*2): " << toString(DBL_MAX * 2) << endl; - cerr << "\tdouble(-DBL_MAX*2): " << toString(-DBL_MAX * 2) << endl; - cerr << "\tdouble(sqrt(-1)): " << toString(sqrt(-1)) << endl; - cerr << "\tdouble(5.25): " << toString(5.25) << endl; - cerr << "\tdouble(-5.25): " << toString(-5.25) << endl; - cerr << "\tdouble(1e13): " << toString(1e13) << endl; - cerr << "\tdouble(1e13+1): " << toString(1e13 + 1) << endl; - cerr << "\tdouble(1e-3): " << toString(1e-3) << endl; - cerr << "\tdouble(9e-4): " << toString(9e-4) << endl; - cerr << "\tdouble(1e100): " << toString(1e100) << endl; - cerr << "\tdouble(-1e100): " << toString(-1e100) << endl; - - cerr << endl; - cerr << "Testing cerr with QString and with QStringRef" << endl; - cerr << QString("\tQString\n"); - cerr << QString("\tQStringRef - FAIL!\n").leftRef(11) << endl; - - cerr << endl; - cerr << "----------------------------------" << endl; - cerr << "-- Now testing deprecated class --" << endl; - cerr << "----------------------------------" << endl; - cerr << endl; - - // Tests for non-static functions - try { - IString str0; - str0 = "Test string"; - cerr << "No arg construtor : " << str0 << endl; - - IString str1 = str0 + " again"; - cerr << "Constructor IString: " << str1 << endl; - - IString str1_5 = 'A'; - cerr << "Constructor char : " << str1_5 << endl; - - IString str2 = 999; - cerr << "Constructor int : " << str2 << endl; - - IString str2a = BigInt(9999999999LL); - cerr << "Constructor BigInt : " << str2a << endl; - - IString str3 = 999.999; - cerr << "Constructor double :" << str3 << endl; - - IString str4 = "ABCDefghijkBCAD"; - cerr << "Before Trim : " << str4 << endl; - cerr << "Return Trim : " << str4.Trim("ABCD") << endl; - cerr << "After Trim : " << str4 << endl; - - IString str5 = "ABCDefghijkBCAD"; - cerr << "Before TrimHead : " << str5 << endl; - cerr << "Return TrimHead : " << str5.TrimHead("DBCA") << endl; - cerr << "After TrimHead : " << str5 << endl; - cerr << "Middle test : " << str5.TrimHead("g") << endl; - - IString str6 = "ABCDefghijkBCAD"; - cerr << "Before TrimTail : " << str6 << endl; - cerr << "Return TrimTail : " << str6.TrimTail("DBCA") << endl; - cerr << "After TrimTail : " << str6 << endl; - cerr << "Middle test : " << str6.TrimTail("f") << endl; - - std::string str35 = "ABCDefghijkBCAD"; - cerr << "Before TrimHead : " << str35 << endl; - str35 = IString::TrimHead("DBCA", str35); - cerr << "After TrimHead : " << str35 << endl; - str35 = IString::TrimHead("g", str35); - cerr << "Middle test : " << str35 << endl; - - std::string str36 = "ABCDefghijkBCAD"; - cerr << "Before TrimTail : " << str36 << endl; - str36 = IString::TrimTail("DBCA", str36); - cerr << "After TrimTail : " << str36 << endl; - str36 = IString::TrimTail("f", str36); - cerr << "Middle test : " << str36 << endl; - - IString str7 = "abcdefghijklmnopqrstuvwxyzABC!@#$%^&*()"; - cerr << "Before Upcase : " << str7 << endl; - cerr << "After Upcase : " << str7.UpCase() << endl; - - cerr << "Before DownCase : " << str7 << endl; - cerr << "After DownCase : " << str7.DownCase() << endl; - - IString str8 = 987654321; - cerr << "Integer : " << str8 << endl; - cerr << "Integer : " << str8.ToInteger() << endl; - str8 = "987trew"; - try { - str8.ToInteger(); - } - catch(IException &error) { - error.print(); - } - - IString str8a = BigInt(9876543210LL); - cerr << "BigInteger : " << str8a << endl; - cerr << "BigInteger : " << str8a.ToBigInteger() << endl; - str8a = "987trew"; - try { - str8a.ToBigInteger(); - } - catch(IException &error) { - error.print(); - } - - IString str9 = 9876.54321; - cerr << "Double : " << str9.c_str() << endl; - cerr << "Double : " << str9.ToDouble() << endl; - str9 = "123$987"; - try { - str9.ToDouble(); - } - catch(IException &error) { - error.print(); - } - - IString str10 = "123.0E45"; - cerr << "Exponent : " << str10 << endl; - cerr << "Exponent : " << str10.ToDouble() << endl; - - IString str11 = "25:255 35:15"; - cerr << str11 << endl; - while(str11.length() > 0) { - cerr << str11.Token(": ") << endl; - } - - str11 = "key1=tok1 key2=\"t o k 2\" key3=(1,2,3,4)"; - cerr << str11 << endl; - while(str11.length() > 0) { - cerr << str11.Token("= ") << endl; - } - - str11 = "\"abcd\",\"1234\""; - cerr << str11 << endl; - while(str11.length() > 0) { - cerr << str11.Token(",") << endl; - } - - str11 = "\",1234\",\"ab,cd\""; - cerr << str11 << endl; - while(str11.length() > 0) { - cerr << str11.Token(",") << endl; - } - - str11 = "/this/is/a/long/filename.jnk,seperated/by/a/comma/ending/with/\r\n"; - cerr << str11.Trim("\r\n") << endl; - while(str11.length() > 0) { - cerr << str11.Token(",") << endl; - } - - str11 = "/this/is/another/long/filename.jnk seperated/by/3/spaces/file2.tmp"; - cerr << str11.Trim("\r\n") << endl; - int m = 1; - while(str11.length() > 0) { - cerr << "token# " << m++ << ">> " << str11.Token(" ") << endl; - } - - cerr << endl; - - IString str12 = " \" \" "; - cerr << "Before compress >" << str12 << "<" << endl; - str12.Compress(); - cerr << "After compress >" << str12 << "<" << endl; - - IString str12b = "| \" \" \' \' |"; - cerr << "Before compress >" << str12b << "<" << endl; - str12b.Compress(); - cerr << "After compress >" << str12b << "<" << endl; - - IString str13 = " AB CD "; - cerr << "Before compress >" << str13 << "<" << endl; - str13.Compress(); - cerr << "After compress >" << str13 << "<" << endl; - - IString str14 = " \" \" "; - cerr << "Before force compress >" << str14 << "<" << endl; - cerr << "After force compress >" << str14.Compress(true) << "<" << endl; - - IString str15 = " \"AB CD\" "; - cerr << "Before force compress >" << str15 << "<" << endl; - cerr << "After force compress >" << str15.Compress(true) << "<" << endl; - - IString str16 = " "; - cerr << "Before force compress >" << str16 << "<" << endl; - cerr << "After force compress >" << str16.Compress(true) << "<" << endl; - - IString str17 = "ABCDEFG"; - cerr << "Before convert >" << str17 << "<" << endl; - cerr << "After convert >" << str17.Convert("BDFG", '-') << "<" << endl; - - IString str18 = "Thirteen is bigger than fourteen"; - cerr << "Before replace >" << str18 << "<" << endl; - cerr << "After replace >" << str18.Replace("bigger", "smaller") << "<" << endl; - - IString str19 = "a\tb\b\n\v\f\r c"; - // Don't cerr the before string, it will cause all sorts of problems - // cerr << "Before convert >" << str19 << "<" << endl; - cerr << "After convert white space >" << str19.ConvertWhiteSpace() << "<" << endl; - - IString str20 = "xxxXXX0"; - cerr << "Before Upcase >" << str20 << "<" << endl; - cerr << "After Upcase >" << str20.UpCase() << "<" << endl; - - cerr << "Before DownCase >" << str20 << "<" << endl; - cerr << "After DownCase >" << str20.DownCase() << "<" << endl; - - IString str21 = "Test String"; - QString qstr1 = "Test String"; - cerr << "Testing QT conversion: " << (str21.ToQt() == qstr1) << endl; - - IString str22(255.0); - IString str23(0.333); - IString str24(-255.0); - IString str25(1.235E-20); - IString str26(12345678901234567890.0); - IString str27(0.0005); - cerr << str22 << endl; - cerr << str23 << endl; - cerr << str24 << endl; - cerr << str25 << endl; - cerr << str26 << endl; - cerr << str27 << endl; - - IString str28("a 1 b 2 c 3 d 4 e 5"); - cerr << "Before Remove >" << str28 << "<" << endl; - cerr << "After Remove >" << str28.Remove("1245") << "<" << endl; - - IString str29("100"); - int i = str29; - cerr << i << endl; - - IString str29a("100000000000"); - BigInt j = str29a; - cerr << j << endl; - - IString str30("100.1"); - double d = str30; - cerr << d << endl; - - IString str31("I is a test string: 'I is' is \"is a string\""); - IString str31a("I is a test string: 'I is' is \"is a string\""); - cerr << "Before Replace (honor quotes) >" << str31 << "<" << endl; - str31.Replace("is", "am", true); - cerr << "After Replace (honor quotes) >" << str31 << "<" << endl; - cerr << "Before Replace (dont honor quotes) >" << str31a << "<" << endl; - str31a.Replace("is", "am", false); - cerr << "After Replace (dont honor quotes) >" << str31a << "<" << endl; - - } - catch(IException &error) { - error.print(); - } - - //Tests for static functions untested above - try { - //Split test - string str1 = "This is a test string"; - vector strVec; - IString::Split(' ', str1, strVec); - cerr << "Before split >" << str1 << "<" << endl; - cerr << "After split >"; - for(unsigned int i = 0 ; i < strVec.size() ; i++) { - cerr << endl << "Element " << i << ": " << strVec[i]; - } - cerr << endl << "<" << endl; - - QStringList qlist; - qlist << "String1" - << "String2" - << "String3" - << "String4"; - - cerr << "\nQt QStringList values:\n"; - for(int i = 0 ; i < qlist.size() ; i++) { - cerr << qlist.at(i).toLocal8Bit().constData() << endl; - } - - cerr << "\nConverted to std::vector...\n"; - vector slist = IString::ToStd(qlist); - copy(slist.begin(), slist.end(), ostream_iterator(cerr, "\n")); - - cerr << "Are they equivalent?\n"; - cerr << "Counts? " << yesOrNo((int) slist.size() == qlist.size()) << endl; - for(int j = 0 ; j < qlist.size() ; j++) { - QString qs = qlist.at(j); - string ss = slist.at(j); - cerr << "string(" << ss << ") == QString(" - << qs.toLocal8Bit().constData() << ")? " - << yesOrNo(ss == qs.toStdString()) << endl; - } - - } - catch(IException &error) { - error.print(); - } -} diff --git a/isis/src/core/LabelTranslationManager/unitTest.cpp b/isis/src/core/LabelTranslationManager/unitTest.cpp deleted file mode 100644 index 2b84640e06..0000000000 --- a/isis/src/core/LabelTranslationManager/unitTest.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include "LabelTranslationManager.h" -#include "Preference.h" -#include "IException.h" -#include "IString.h" -#include "Preference.h" - -using namespace Isis; -using namespace std; -/** - * Child class of LabelTranslationManager to implement pure virtual methods. - * - * @author 2017-01-11 Jeannie Backer - * - * @internal - * @history 2017-01-11 Jeannie Backer - Original Version. Fixes #4584. - * @history 2017-10-16 Kristin Berry - Updated for changes to dependency specification format and - * the addition of xml namspaces. References #5202 - */ -class TestTranslationManager : public LabelTranslationManager { - public: - - TestTranslationManager(const QString &transFile) : LabelTranslationManager() { - AddTable(transFile); - } - - TestTranslationManager(std::istream &transStrm) : LabelTranslationManager() { - AddTable(transStrm); - } - - ~TestTranslationManager() { - } - - virtual QString Translate(QString nName, int findex = 0) { - QString inputValue = "Test Input, Index " + toString(findex); - return PvlTranslationTable::Translate(nName, inputValue); - } -}; - -int main(void) { - - Preference::Preferences(true); - stringstream trnsStrm; - trnsStrm << "Group = NumberOfLines" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " OutputName = Lines" << endl; - trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; - trnsStrm << "\"Group\",\"Dimensions\")" << endl; - trnsStrm << " InputPosition = (Image,Size)" << endl; - trnsStrm << " InputKey = NL" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = NumberOfBands" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " Optional = 1" << endl; - trnsStrm << " OutputName = Bands" << endl; - trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; - trnsStrm << "\"Group\",\"Dimensions\")" << endl; - trnsStrm << " InputPosition = (Image,Size)" << endl; - trnsStrm << " InputKey = Nb" << endl; - trnsStrm << " InputDefault = 1" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = Bonus" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " Optional = 1" << endl; - trnsStrm << " InputPosition = (Image,Pixel)" << endl; - trnsStrm << " InputKey = Bonus" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = Extra" << endl; - trnsStrm << " Optional = 1" << endl; - trnsStrm << " InputPosition = (Image,Bogus)" << endl; - trnsStrm << " InputKey = Extra" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = PixelResolution" << endl; - trnsStrm << " InputPosition = (Image,Pixel)" << endl; - trnsStrm << " InputKey = Resolution" << endl; - trnsStrm << " InputDefault = 1" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = BandName" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " OutputName = Band" << endl; - trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; - trnsStrm << "\"Object\",\"BandBin\")" << endl; - trnsStrm << " InputPosition = (Image,BandInfo)" << endl; - trnsStrm << " InputKey = Band" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = CenterLongitude" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " OutputPosition = (\"Group\",\"Mapping\")" << endl; - trnsStrm << " OutputName = CenterLongitude" << endl; - trnsStrm << " InputPosition = IMAGE_MAP_PROJECTION" << endl; - trnsStrm << " InputPosition = (QUBE,IMAGE_MAP_PROJECTION)" << endl; - trnsStrm << " InputPosition = (SPECTRAL_QUBE,IMAGE_MAP_PROJECTION)" << endl; - trnsStrm << " InputKey = CENTER_LONGITUDE" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - - trnsStrm << "End" << endl; - - TestTranslationManager transMgr(trnsStrm); - - try { - cout << "Testing LabelTranslationManager object" << endl; - - cout << endl << "Testing Translate method:" << endl; - cout << endl << "Translating Extra: "; - cout << transMgr.Translate("Extra") << endl; - - cout << endl << "Testing Auto method:" << endl; - Pvl translatedLabel; - transMgr.Auto(translatedLabel); - cout << endl << translatedLabel << endl; - } - catch(IException &e) { - e.print(); - } - try { - cout << endl << "Testing parseSpecification method: att@name|value" << endl; - transMgr.parseSpecification((QString)"att@name:value"); - - cout << endl << "Testing parseSpecification method: tag@name|value" << endl; - transMgr.parseSpecification((QString)"tag@name|value"); - - cout << endl << "Testing parseSpecification method: att@name" << endl; - transMgr.parseSpecification((QString)"att@name"); - - cout << endl << "Testing parseSpecification method: new@name" << endl; - transMgr.parseSpecification((QString)"new@name"); - - cout << endl << "Testing parseSpecification method: name|value" << endl; - transMgr.parseSpecification((QString)"name|value"); - - cout << endl << "Testing parseSpecification method: value" << endl; - transMgr.parseSpecification((QString)"value"); - - cout << endl << "Testing parseSpecification method: namespace:name" << endl; - transMgr.parseSpecification((QString)"namespace:name"); - - cout << endl << "Testing parseSpecification method: namespace:name|value" << endl; - transMgr.parseSpecification((QString)"namespace:name|value"); - - cout << endl << "Testing parseSpecification method: att@namespace:name|value" << endl; - transMgr.parseSpecification((QString)"att@namepsace:name|value"); - - cout << endl << "Testing parseSpecification method: tag@name|value" << endl; - transMgr.parseSpecification((QString)"tag@namespace:name|value"); - } - catch(IException &e) { - e.print(); - } - - - try { - cout << endl << "Testing parseSpecification method: att|name|value" << endl; - transMgr.parseSpecification((QString)"att|name|value"); - } - catch(IException &e) { - e.print(); - } - - - try { - cout << endl << "Testing parseSpecification method: att@name@value" << endl; - transMgr.parseSpecification((QString)"att@name@value"); - } - catch(IException &e) { - e.print(); - } - - try { - cout << endl << "Testing parseSpecification method: not@name|value" << endl; - transMgr.parseSpecification((QString)"not@name|value"); - } - catch(IException &e) { - e.print(); - } - - try { - cout << endl << "Testing parseSpecification method: att@name|value1|value2" << endl; - transMgr.parseSpecification((QString)"att@name|value1|value2"); - } - catch(IException &e) { - e.print(); - } - return 0; -} diff --git a/isis/src/core/Message/unitTest.cpp b/isis/src/core/Message/unitTest.cpp deleted file mode 100644 index b7c74661a0..0000000000 --- a/isis/src/core/Message/unitTest.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include - -#include "Message.h" -#include "Preference.h" -#include "IString.h" - -using namespace Isis; -using namespace std; - -int main(void) { - Preference::Preferences(true); - - -//*************************************************************************** - cout << Message::ArraySubscriptNotInRange(100000) - << endl; - - cout << endl; - -//*************************************************************************** - - cout << Message::KeywordAmbiguous("KEY") - << endl; - - cout << Message::KeywordUnrecognized("KEY") - << endl; - - cout << Message::KeywordDuplicated("KEY") - << endl; - - cout << Message::KeywordNotArray("KEY") - << endl; - - cout << Message::KeywordNotFound("KEY") - << endl; - - cout << endl; - -//*************************************************************************** - - cout << Message::KeywordBlockInvalid("BLOCK") - << endl; - - cout << Message::KeywordBlockStartMissing("BLOCK", "FOUND") - << endl; - - cout << Message::KeywordBlockEndMissing("BLOCK", "FOUND") - << endl; - - cout << endl; - -//*************************************************************************** - - cout << Message::KeywordValueBad("KEY") - << endl; - - cout << Message::KeywordValueBad("KEY", "12345678901234567890") - << endl; - - cout << Message::KeywordValueBad("KEY", "abcdefghijklmnopqrstuvwxyz") - << endl; - - cout << Message::KeywordValueExpected("KEY") - << endl; - - cout << Message::KeywordValueNotInRange("KEY", "0", "(0,20]") - << endl; - - vector list; - list.push_back("X"); - list.push_back("Y"); - list.push_back("Z"); - cout << Message::KeywordValueNotInList("KEY", "A", list) - << endl; - - cout << endl; - -//*************************************************************************** - - cout << Message::MissingDelimiter(')') - << endl; - - cout << Message::MissingDelimiter(')', "12345678901234567890") - << endl; - - cout << Message::MissingDelimiter(')', "abcdefghijklmnopqrstuvwxyz") - << endl; - - cout << endl; - -//*************************************************************************** - - cout << Message::FileOpen("test.dat") << endl; - cout << Message::FileCreate("test.dat") << endl; - cout << Message::FileRead("test.dat") << endl; - cout << Message::FileWrite("test.dat") << endl; - - cout << endl; -} diff --git a/isis/src/core/Preference/unitTest.cpp b/isis/src/core/Preference/unitTest.cpp deleted file mode 100644 index a4b22f15d0..0000000000 --- a/isis/src/core/Preference/unitTest.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include - -#include "Preference.h" -#include "IException.h" - -using namespace Isis; -using namespace std; - -int main() { - try { - // Note: Normally a call to Preferences in a unitTest would be called - // with a true. In this case however, we can't have the Preferences - // call clearing the the Pvl everytime. We aren't using any keywords - // from the preferences anyway, just the ones we add. - Isis::Preference::Preferences(false); - Isis::Pvl system; - Isis::PvlGroup j1("Junk"); - j1 += Isis::PvlKeyword("Fruit", "Tomato"); - j1 += Isis::PvlKeyword("Vegetable", "Potato"); - system.addGroup(j1); - system.write("tmpSystem"); - - Isis::Pvl user; - Isis::PvlGroup j2("Junk"); - j2 += Isis::PvlKeyword("Vegetable", "Potatoe"); - user.addGroup(j2); - user.write("tmpUser"); - - cout << "Testing normally" << endl; -#if 0 - Isis::Preference p2; - p2.Load("tmpSystem"); - cout << p2 << endl; - p2.Load("tmpUser"); - cout << p2 << endl; -#endif - - Isis::Preference::Preferences(false).Load("tmpSystem"); - Isis::PvlGroup j3 = Isis::Preference::Preferences(false).findGroup("Junk"); - cout << j3 << endl; - Isis::Preference::Preferences(false).Load("tmpUser"); - Isis::PvlGroup j4 = Isis::Preference::Preferences(false).findGroup("Junk"); - cout << j4 << endl; - - cout << endl << endl; - // if (p2.hasGroup("Junk")) { - if(Isis::Preference::Preferences(false).hasGroup("Junk")) { - Isis::PvlGroup &g = Isis::Preference::Preferences(false).findGroup("Junk"); - cout << "Value of Vegetable is : " << (QString) g["Vegetable"] << endl; - } - - remove("tmpSystem"); - remove("tmpUser"); - } - catch(Isis::IException &error) { - error.print(); - } - - // Now test without a preference file to see if the expected exception is thrown - try { - Isis::Preference::Preferences(true); - Isis::Preference::Preferences(true).Load("dummyPrefs"); - } - // Expect to see: "The preference file dummyPrefs was not found or does not exist." - catch(Isis::IException &error) { - error.print(); - } - - return 0; -} diff --git a/isis/src/core/Pvl/unitTest.cpp b/isis/src/core/Pvl/unitTest.cpp deleted file mode 100644 index f5650c1a39..0000000000 --- a/isis/src/core/Pvl/unitTest.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include "Pvl.h" -#include "IException.h" -#include "Preference.h" - -#include -#include - -using namespace Isis; -using namespace std; - -int main() { - Preference::Preferences(true); - - Pvl p; - p += PvlKeyword("LongKeyword", "This is a very long keyword value which " - "was causing some problems when the Pvl was output." - " The fist couple of lines looked good, but after that " - "things went south. Some lines get nothing, others get" - " bad indenting, most were too short"); - - cout << "p: " << p << "\n"; - Pvl &ref = p; - Pvl copy(p); - copy.deleteKeyword("LongKeyword"); - cout << "copy deleted a keyword...\np: " << p << "\n\ncopy: " << copy << "\n\n\n"; - - PvlGroup g("Test"); - g += PvlKeyword("Keyword", "Value"); - p.addGroup(g); - - p.setTerminator(""); - ref.write("tmp.unitTest"); - p.append("tmp.unitTest"); - - Pvl p2; - p2.read("tmp.unitTest"); - cout << p2 << endl << endl; - - Pvl p3; - p3.read("unitTest.pvl"); - cout << p3 << endl << endl; - - stringstream os; - os << "temp = (a,b,c)"; - - Pvl p4; - os >> p4; - cout << p4 << endl << endl; - remove("tmp.unitTest"); - - try { - Pvl p5; - p5.read("unitTest2.pvl"); - cout << p5 << endl << endl; - } - catch(IException &e) { - cout.flush(); - - // make this error work regardless of directory... - QString errors = e.toString(); - - while(errors.indexOf("/") != -1) { - int pos = errors.indexOf("/"); - - if(errors.indexOf("/", pos + 1) < errors.indexOf("]")) { - errors = errors.mid(0, pos + 1) + - errors.mid(errors.indexOf("/", pos + 1) + 1); - } - else { - errors = errors.mid(0, pos - 1) + errors.mid(pos + 1); - } - } - - cout << errors; - } - - cout << endl << endl; - - try { - Pvl p6; - p6.read("unitTest3.pvl"); - cout << p6 << endl << endl; - } - catch(IException &e) { - cout.flush(); - - // make this error work regardless of directory... - QString errors = e.toString(); - - while(errors.indexOf("/") != -1) { - int pos = errors.indexOf("/"); - - if(errors.indexOf("/", pos + 1) < errors.indexOf("]")) { - errors = errors.mid(0, pos + 1) + - errors.mid(errors.indexOf("/", pos + 1) + 1); - } - else { - errors = errors.mid(0, pos - 1) + errors.mid(pos + 1); - } - } - - cout << errors; - } - - cout << endl << endl; - - cout << "Testing MESSENGER labels with data at bottom..." << endl << endl; - try { - Pvl p7; - p7.read("unitTest4.pvl"); - cout << p7 << endl << endl; - } - catch(IException &e) { - cout.flush(); - - // make this error work regardless of directory... - QString errors = e.toString(); - - while(errors.indexOf("/") != -1) { - int pos = errors.indexOf("/"); - - if(errors.indexOf("/", pos + 1) < errors.indexOf("]")) { - errors = errors.mid(0, pos + 1) + - errors.mid(errors.indexOf("/", pos + 1) + 1); - } - else { - errors = errors.mid(0, pos - 1) + errors.mid(pos + 1); - } - } - - cout << errors; - } - - // Validate a PVL - Pvl pvlTmpl("cnetstatsTest.def"); - cout << "\n\n***Template PVL**\n" << pvlTmpl << endl; - - Pvl pvlUser("pointdef.def"); - cout << "\n\n***Test PVL**\n" << pvlUser << endl; - - Pvl pvlResults; - pvlTmpl.validatePvl(pvlUser, pvlResults); - cout << "\n\n**Result PVL**\n" << pvlResults << endl; -} diff --git a/isis/src/core/PvlContainer/unitTest.cpp b/isis/src/core/PvlContainer/unitTest.cpp deleted file mode 100644 index 175428b6fa..0000000000 --- a/isis/src/core/PvlContainer/unitTest.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include - -#include "IString.h" - -#include "PvlContainer.h" -#include "Preference.h" - -using namespace Isis; -using namespace std; - -int main() { - Preference::Preferences(true); - - PvlKeyword dog("DOG", toString(5.2), "meters"); - PvlKeyword cat("CATTLE"); - cat = "Meow"; - cat.addComment("Cats shed"); - - PvlContainer ani("Animals"); - ani += dog; - ani += cat; - ani.addComment("/* Pets are cool */"); - -// cout << "1 ..." << endl; - cout << ani << endl; - -// cout << "2 ..." << endl; - cout << (double) ani["dog"] << endl; - - ani -= "dog"; -// cout << "3 ..." << endl; - cout << ani << endl; - -// cout << "4 ..." << endl; - ani -= ani[0]; - cout << ani << endl; - - cout << "Test inserter ..." << endl; - PvlKeyword monkey("Orangutan", "gross"); - ani.addKeyword(dog, ani.begin()); - ani.addKeyword(monkey, ani.begin()); - cout << ani << endl; - - // This is testing reallocation caused by adds, - // was a problem when using std::vector - cout << endl << "Test reallocation ..." << endl; - PvlKeyword * ptr1 = &ani["DOG"]; - for (int i = 0; i < 250; i++) - ani += PvlKeyword("Test_keyword", toString(i)); - - PvlKeyword * ptr2 = &ani["DOG"]; - if (ptr1 == ptr2) - cout << "Pointer to DOG is equivalent" << endl; - else - cout << "FAILURE: Pointer to DOG changed after multiple adds" << endl; - -} diff --git a/isis/src/core/PvlEditDialog/PvlEditDialog.cpp b/isis/src/core/PvlEditDialog/PvlEditDialog.cpp deleted file mode 100644 index 9d74c1806f..0000000000 --- a/isis/src/core/PvlEditDialog/PvlEditDialog.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include "PvlEditDialog.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "IException.h" -#include "Pvl.h" - -using namespace std; - -namespace Isis { - /** - * This constructor creates a PvlEditDialog object given a - * pointer to a Pvl object. - * - * @param pvl Pvl file to be viewed or edited - * @author 2008-12-10 Jeannie Walldren - * @internal - * @history 2008-12-10 Jeannie Walldren - Original Version - * @history 2008-12-15 Jeannie Walldren - Removed unneccesary - * error catch. - */ - PvlEditDialog::PvlEditDialog(Pvl &pvl, QWidget *parent) : QDialog(parent) { - - // Create text edit box and fill it with pvl file contents - p_textEdit = new QTextEdit; - fstream input; - - // open as input from pvl file - input.open(pvl.fileName().toLatin1().data(), ios::in); - string output; - - // read first line of input and write as first output line - getline(input, output); - while(!input.eof()) { - // append this line of output to the QTextEdit box - p_textEdit->append(QString::fromStdString(output)); - - // read next line of input and write as next output line - getline(input, output); - } - input.close(); - - // Create Close and Save buttons in an QHBoxLayout - p_saveButton = new QPushButton("Save Changes &As..."); - p_saveButton->setEnabled(false); - QPushButton *closeButton = new QPushButton("&Close"); - - QHBoxLayout *buttonLayout = new QHBoxLayout; - buttonLayout->addWidget(p_saveButton); - buttonLayout->addWidget(closeButton); - - // Add QTextEdit box and button layout to QVBoxLayout - // and set this to the layout of the QDialog window - QVBoxLayout *vLayout = new QVBoxLayout; - vLayout->addWidget(p_textEdit); - vLayout->addLayout(buttonLayout); - - setLayout(vLayout); - QString titleBar = "Pvl File: " + QString(pvl.fileName()) ; - setWindowTitle(titleBar); - - // Add functionality to buttons - connect(p_textEdit, SIGNAL(textChanged()), this, SLOT(enableSaveButton())); - connect(p_saveButton, SIGNAL(clicked()), this, SLOT(saveTextEdit())); - connect(closeButton, SIGNAL(clicked()), this, SLOT(reject())); - - } - - /** - * Allow the "Save Changes" button to be activated. - * - * @author 2008-12-10 Jeannie Walldren - * @internal - * @history 2008-12-10 Jeannie Walldren - Original Version. - */ - void PvlEditDialog::enableSaveButton() { - p_saveButton->setEnabled(true); - } - - /** - * Save the edited text as a new Pvl file. - * @author 2008-12-10 Jeannie Walldren - * @internal - * @history 2008-12-10 Jeannie Walldren - Original Version. - * @history 2008-12-15 Jeannie Walldren - Added a verification - * that the edited file is in Pvl format before - * allowing save. Replaced error throw with - * QMessageBox warning. - */ - void PvlEditDialog::saveTextEdit() { - // Check validity of format by placing QTextEdit contents into a Pvl object - Pvl pvl; - stringstream ss; - string textEditContents = p_textEdit->toPlainText().toStdString(); - - //fill stringstream with contents of QTextEdit - ss << textEditContents; - - try { - // fill pvl with contents of stringstream - ss >> pvl; - } - catch(IException &e) { - // catch errors in Pvl format when populating pvl object - QString message = e.toString(); - QMessageBox::warning((QWidget *)parent(), "Error", message); - return; - } - - // get a window to choose a name and location for the saved file - // default: look in user's current directory for *.def or *.pvl files - QString filter = "Select registration template (*.def *.pvl);;"; - filter += "All (*)"; - QString pvlFile = QFileDialog::getSaveFileName((QWidget *)parent(), - "Select a registration template", - ".", - filter); - if(!pvlFile.isEmpty()) { - // convert QString to std::string needed to open file stream - QString saveFile = pvlFile; - try { - pvl.write(saveFile); - } - catch(IException &e) { - // report exception(s) to mesage box - QString message = e.toString(); - QMessageBox::warning((QWidget *)parent(), "Error", message); - return; - } - } - - // refresh titleBar with new file name - setWindowTitle("Pvl File: " + pvlFile); - } -} diff --git a/isis/src/core/PvlEditDialog/PvlEditDialog.h b/isis/src/core/PvlEditDialog/PvlEditDialog.h deleted file mode 100644 index cad940f5b4..0000000000 --- a/isis/src/core/PvlEditDialog/PvlEditDialog.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef PvlEditDialog_h -#define PvlEditDialog_h -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ - -#include -#include - -#include "Pvl.h" - -class QLabel; -class QLineEdit; -class QListWidget; -class QPushButton; -class QTextEdit; - -#include - -namespace Isis { - /** - * PvlEditDialog creates a QDialog window in which a QTextEdit - * box displays the contents of a pvl file. This file may be - * viewed or edited and saved as a new pvl file. - * - * @ingroup ApplicationInterface - * - * @author 2008-12-10 Jeannie Walldren - * @internal - * @history 2008-12-10 Jeannie Walldren - Original version - * written to view and edit the template file in the - * qnet application. - * @history 2008-12-10 Jeannie Walldren - Changed namespace - * from Qisis to Isis - * @history 2008-12-10 Jeannie Walldren - Cleaned up code and - * fixed bugs arising from moving this class from - * Qisis and to Isis. Added moc commands to Makefile. - * @history 2008-12-15 Jeannie Walldren - Added a verification - * that the edited file is in Pvl format. Replaced - * error throws with QMessage warning boxes. - */ - class PvlEditDialog : public QDialog { - Q_OBJECT - - public: - PvlEditDialog(Pvl &pvl, QWidget *parent = 0); - - private: - QTextEdit *p_textEdit; - QPushButton *p_saveButton; - - private slots: - void enableSaveButton(); - void saveTextEdit(); - }; -}; - -#endif - - diff --git a/isis/src/core/PvlEditDialog/unitTest.cpp b/isis/src/core/PvlEditDialog/unitTest.cpp deleted file mode 100644 index 827b90c7fc..0000000000 --- a/isis/src/core/PvlEditDialog/unitTest.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include "PvlEditDialog.h" -#include "Preference.h" - -using namespace std; -using namespace Isis; - -int main(int argc, char *argv[]) { - Preference::Preferences(true); - cout << endl << "Unit test for PvlEditDialog" << endl; - cout << "Replace this when we decide how to do unit tests for interactive objects" << endl; - return 0; -} - diff --git a/isis/src/core/PvlFlatMap/unitTest.cpp b/isis/src/core/PvlFlatMap/unitTest.cpp deleted file mode 100644 index bbe1bf6976..0000000000 --- a/isis/src/core/PvlFlatMap/unitTest.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include -#include - -#include "FileName.h" -#include "IException.h" -#include "IString.h" -#include "Preference.h" -#include "Pvl.h" -#include "PvlFlatMap.h" -#include "PvlGroup.h" -#include "PvlFlatMap.h" -#include "PvlObject.h" -#include "TextFile.h" - -using namespace Isis; -using namespace std; - -static void print(const PvlFlatMap &map); - -/** - * Unit test for PvlFlatMap and PvlContraints classes. - * - * - * @author 2016-02-28 Jeannie Backer - * - * @internal - * @history 2016-02-28 Jeannie Backer - Original version. - * - * @todo 2016-02-28 Jeannie Backer - The code coverage software was not - * working when this test was originally checked in. - */ -int main() { - Preference::Preferences(true); - - // Create a PvlObject to map - PvlObject pvlObject("Beasts"); - pvlObject += PvlKeyword("CAT", "Meow"); - pvlObject += PvlKeyword("Cat"); - pvlObject += PvlKeyword("cat", "Purr"); - pvlObject += PvlKeyword("Eagle", "Swoop"); - pvlObject += PvlKeyword("Rattler", "coil"); - - PvlGroup includeGroup("Fish"); - includeGroup += PvlKeyword("Trout", "Brown"); - includeGroup += PvlKeyword("Bass", "Large mouth"); - pvlObject += includeGroup; - - PvlGroup includeObject("Birds"); - includeObject += PvlKeyword("Sparrow", "House"); - includeObject += PvlKeyword("Crow"); - includeObject += PvlKeyword("EAGLE", "Claws"); - pvlObject += includeObject; - - PvlGroup excludeGroup("ExcludeGroup"); - excludeGroup += PvlKeyword("CAT", "Woof"); - pvlObject += excludeGroup; - - PvlObject excludeObject("ExcludeObject"); - excludeObject += PvlKeyword("Dog", "Moo"); - pvlObject += excludeObject; - - qDebug() << "PvlFlatMap1 Source (PvlObject):"; - cout << pvlObject << endl; - qDebug() << ""; - - // Constructed from PvlObject no constraints - PvlFlatMap map1(pvlObject); - qDebug() << "Map1 - CAT and EAGLE values are overwritten. No Constraints:"; - print(map1); - - // Testing PvlConstraints from exclude list - QStringList excludeList; - excludeList << "ExcludeGroup"; - PvlConstraints constraints = PvlConstraints::withExcludes(excludeList); - constraints.addExclude("ExcludeObject"); - qDebug() << "Map1B Constraints:"; - qDebug() << " excludes: " << constraints.excludes(); - qDebug() << " includes: " << constraints.includes(); - qDebug() << " key list: " << constraints.keyList(); - qDebug() << ""; - PvlFlatMap map1b(pvlObject, constraints); - qDebug() << "Map1B - ExcludeGroup and ExcludeObject are excluded:"; - print(map1b); - - // Testing adding includes to PvlConstraints - constraints.addInclude("Beasts"); - qDebug() << " Map1C Constraints:"; - qDebug() << " size of excludes: " << constraints.excludeSize(); - qDebug() << " size of includes: " << constraints.includeSize(); - qDebug() << " excludes: " << constraints.excludes(); - qDebug() << " includes: " << constraints.includes(); - qDebug() << " key list: " << constraints.keyList(); - qDebug() << " cat is excluded? " << constraints.isExcluded("cat"); - qDebug() << " ExcludeGroup is excluded? " << constraints.isExcluded("ExcludeGroup"); - qDebug() << " cat is included? " << constraints.isIncluded("cat"); - qDebug() << " Beasts is included? " << constraints.isIncluded("Beasts"); - qDebug() << ""; - PvlFlatMap map1c(pvlObject, constraints); - qDebug() << "Map1C - ExcludeGroup and ExcludeObject are excluded.\n" - " Beasts object is included:"; - print(map1c); - - // Testing PvlConstraints from include list - QStringList includeList; - includeList << "Fish" << "Birds"; - constraints = PvlConstraints::withIncludes(includeList); - qDebug() << "Map1D Constraints:"; - qDebug() << " excludes: " << constraints.excludes(); - qDebug() << " includes: " << constraints.includes(); - qDebug() << " key list: " << constraints.keyList(); - qDebug() << ""; - PvlFlatMap map1d(pvlObject, constraints); - qDebug() << "Map1D - Fish group and Birds object are included.\n" - " However, parent object Beasts is not included,\n" - " so all subgroups/subobjects are skipped:"; - print(map1d); - - // Testing PvlConstraints from QStringList - QStringList keyList; - keyList << "cat" << "eagle" << "rattler" << "trout" << "bass" << "sparrow" << "crow"; - PvlConstraints keywordConstraints; - keywordConstraints.addKeyToList(keyList); - qDebug() << "Map1E Constraints:"; - qDebug() << " size of key list: " << keywordConstraints.keyListSize(); - qDebug() << " excludes: " << keywordConstraints.excludes(); - qDebug() << " includes: " << keywordConstraints.includes(); - qDebug() << " key list: " << keywordConstraints.keyList(); - qDebug() << " cat is in list? " << keywordConstraints.isKeyInList("cat"); - qDebug() << " dog is in list? " << keywordConstraints.isKeyInList("dog"); - qDebug() << ""; - PvlFlatMap map1e(pvlObject, keywordConstraints); - qDebug() << "Map1E - key list provided:"; - print(map1e); - - // Testing PvlConstraints from file - QString keyListFileName = FileName("$temporary/keyListFile.txt").expanded(); - keyList.replaceInStrings("cat", "dog"); - // write the keylist to a text file - TextFile keyListFile(keyListFileName, "output"); - for (int i = 0; i < keyList.size(); i++) { - keyListFile.PutLine(keyList[i]); - } - keyListFile.Close(); - PvlConstraints constraintsFromFile(keyListFileName); - if (!QFile::remove(keyListFileName)) { - throw IException(IException::Io, "Unable to remove file, [keyListFile.txt]", _FILEINFO_); - } - qDebug() << "Map1F Constraints:"; - qDebug() << " size of key list: " << constraintsFromFile.keyListSize(); - qDebug() << " excludes: " << constraintsFromFile.excludes(); - qDebug() << " includes: " << constraintsFromFile.includes(); - qDebug() << " key list: " << constraintsFromFile.keyList(); - qDebug() << " cat is in list? " << constraintsFromFile.isKeyInList("cat"); - qDebug() << " dog is in list? " << constraintsFromFile.isKeyInList("dog"); - qDebug() << ""; - PvlFlatMap map1f(pvlObject, constraintsFromFile); - qDebug() << "Map1F - key list file provided:"; - print(map1f); - - // PvlFlatMap Copy Constructor - PvlFlatMap otherMap(map1); - qDebug() << "Map1 Copy:"; - print(otherMap); - - // Construct PvlFlatMap from PvlGroup - PvlGroup pvlGroup("Snake"); - pvlGroup.addComment("Are slimey"); - pvlGroup += PvlKeyword("Rattler", "DiamondBack"); - - qDebug() << "PvlFlatMap2 Source (PvlGroup):"; - cout << pvlGroup << endl; - qDebug() << ""; - - - PvlFlatMap map2(pvlGroup, keywordConstraints); - qDebug() << "Map2 - No constraints:"; - print(map2); - - // Construct map from maps 1,2 - PvlFlatMap map12(map1, map2); - qDebug() << "Map1 and Map2 combined - RATTLER is overwritten:"; - print(map12); - - // Empty constructor - PvlFlatMap map3; - map3.add("Field", "Run"); - PvlKeyword climb("Climb", "Wall"); - climb.addValue("Rock"); - map3.add(climb); - map3.append("CLIMB", "Tree");// append to existing - map3.append("Fly", "Sugar");// append new - qDebug() << "Map3 - CLIMB values are appended:"; - print(map3); - - // merge all three maps - qDebug() << "Merging Map3 to Maps 1,2. Adding [" - << toString(map12.merge(map3)) << "] new keywords."; - qDebug() << "Map1, Map2, and Map3 merged:"; - print(map12); - - // get map info - qDebug() << "Get map info for existing keys:"; - qDebug() << " Map has keyword=crow?" << map12.exists("crow"); - qDebug() << " crow is Null? " << map12.isNull("crow"); - qDebug() << " Map has keyword=climb?" << map12.exists("climb"); - qDebug() << " All Values for climb:" << map12.allValues("Climb"); - int climbs = map12.count("climb"); - qDebug() << " climb count: " << climbs; - for (int i = 0; i < climbs; i++) { - qDebug() << " climb at index" << toString(i) << "is Null? " << map12.isNull("climb", i); - } - - // test more map accessor methods - qDebug() << " Get first value of climb: " << map12("Climb"); - qDebug() << " Get second value of climb: " << map12.get("Climb", 1); - qDebug() << " Get third value of climb: " << map12.get("Climb", 2); - qDebug() << " Get fourth value of climb or return KingKong: " - << map12.get("Climb", "KingKong", 3); - cout << " Get climb as PvlKeyword: " << map12.keyword("Climb") << endl; - - qDebug() << ""; - qDebug() << "Get map info for non-existent keys:"; - qDebug() << " Map has keyword=pencil?" << map12.exists("pencil"); - qDebug() << " All Values for pencil:" << map12.allValues("pencil"); - qDebug() << " pencil count: " << map12.count("pencil"); - qDebug() << " pencil is Null? " << map12.isNull("pencil"); - qDebug() << " Get value of pencil or return Lucy: " << map12.get("pencil", "Lucy"); - qDebug() << " Get values for PvlKeyword('pencil', 'Linus'): " - << map12.keywordValues(PvlKeyword("Sally", "Linus")); - qDebug() << ""; - - // erase... - qDebug() << "Erasing climb keyword: " << map12.erase("Climb"); - qDebug() << "Reprint Map123 merged with CLIMB keyword erased:"; - print(map12); - - // test throw DNE - qDebug() << "Try to get CLIMB keyword after erased..."; - try { - map12.get("Climb"); - } - catch (IException &e) { - e.print(); - } - - qDebug() << ""; - qDebug() << "Try to get CAT keyword at non-existent index..."; - try { - map12.get("CAT", 10); - } - catch (IException &e) { - e.print(); - } - - qDebug() << ""; - qDebug() << "Try to get non-existent pencil keyword..."; - try { - map12.keyword("pencil"); - } - catch (IException &e) { - e.print(); - } - -} - -/** - * Unit test convenience function for printing the contents of PvlFlatMaps. If - * the map is empty, the string " < Empty Map >" will be printed. - * - * @param map The PvlFlatMap to print. - * - * @author 2016-02-28 Jeannie Backer - */ -static void print(const PvlFlatMap &map) { - if (map.isEmpty()) { - cout << "\t " << endl; - } - QMapIterator iterator(map); - while(iterator.hasNext()) { - iterator.next(); - cout << "\t" << iterator.value() << endl; - } - qDebug() << ""; -} diff --git a/isis/src/core/PvlFormat/unitTest.cpp b/isis/src/core/PvlFormat/unitTest.cpp deleted file mode 100644 index 848edba60f..0000000000 --- a/isis/src/core/PvlFormat/unitTest.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include "PvlKeyword.h" -#include "PvlGroup.h" -#include "PvlObject.h" -#include "PvlFormat.h" -#include "Preference.h" - -using namespace std; -int main() { - Isis::Preference::Preferences(true); - - // Test keywords - { - Isis::PvlKeyword key("mystring", "stringval"); - cout << key << endl; - } - - { - Isis::PvlKeyword key("mystring", "string val"); - cout << key << endl; - } - - { - Isis::PvlKeyword key("myint", "12345"); - cout << key << endl; - } - - { - Isis::PvlKeyword key("myfloat", "12345.67e+89"); - cout << key << endl; - } - - { - Isis::PvlKeyword key("myarray", "(12345, \"a short string\", 1.234)"); - cout << key << endl; - } - - - { - Isis::PvlKeyword key("myarray", "{12345, \"a short string\", 1.234}"); - cout << key << endl; - } - - // Test Groups - { - Isis::PvlGroup grp("Group1"); - grp += Isis::PvlKeyword("mystring", "stringval"); - grp += Isis::PvlKeyword("mystring", "string val"); - grp += Isis::PvlKeyword("myint", "12345"); - grp += Isis::PvlKeyword("myfloat", "12345.67e+89"); - grp += Isis::PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - cout << grp << endl; - } - - - // Test Objects - { - Isis::PvlGroup grp("Group1"); - grp += Isis::PvlKeyword("mystring", "stringval"); - grp += Isis::PvlKeyword("mystring", "string val"); - grp += Isis::PvlKeyword("myint", "12345"); - grp += Isis::PvlKeyword("myfloat", "12345.67e+89"); - grp += Isis::PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - Isis::PvlObject obj("Object1"); - obj.addGroup(grp); - - Isis::PvlObject obj2("Object2"); - obj2 += Isis::PvlKeyword("mystring", "stringval"); - obj2 += Isis::PvlKeyword("mystring", "string val"); - obj2 += Isis::PvlKeyword("myint", "12345"); - obj2 += Isis::PvlKeyword("myfloat", "12345.67e+89"); - obj2 += Isis::PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - obj.addObject(obj2); - cout << obj << endl; - } - - { - Isis::PvlKeyword key("myequation", "(f1-f2) * 5"); - cout << key << endl; - } - - { - Isis::PvlKeyword key("myequation", "(f1-f2)*5"); - cout << key << endl; - } - - - { - Isis::PvlKeyword key("mysequence"); - key += "(a,b)"; - key += "(c,d)"; - cout << key << endl; - } - - { - Isis::PvlKeyword key("mycommas"); - key += ",,,"; - cout << key << endl; - } -} - diff --git a/isis/src/core/PvlFormatPds/unitTest.cpp b/isis/src/core/PvlFormatPds/unitTest.cpp deleted file mode 100644 index 4d307e31c4..0000000000 --- a/isis/src/core/PvlFormatPds/unitTest.cpp +++ /dev/null @@ -1,456 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include - -#include "Pvl.h" -#include "PvlKeyword.h" -#include "PvlGroup.h" -#include "PvlObject.h" -#include "FileName.h" -#include "IException.h" -#include "Constants.h" -#include "PvlFormatPds.h" -#include "Preference.h" - -using namespace Isis; -using namespace std; - -int main() { - Preference::Preferences(true); - - try { - - PvlFormatPds *pdsFormatter; - - // Create a temp file for the keyword to type map - { - FileName fname = FileName::createTempFile("tempPvlFormatPDSunitTest_.tmp"); - QString pdsFile = fname.expanded(); - - ofstream out; - out.open(pdsFile.toLatin1().data(), std::ios::out); - - { - PvlKeyword key("skey", "string"); - out << key << endl; - } - { - PvlKeyword key("ikey", "integer"); - out << key << endl; - } - { - PvlKeyword key("fkey2", "rEaL"); - key.addValue(toString(2)); - out << key << endl; - } - { - PvlKeyword key("bkey", "bool"); - out << key << endl; - } - { - PvlKeyword key("fkey0", "real"); - key.addValue(toString(0)); - out << key << endl; - } - { - PvlKeyword key("fkey", "real"); - out << key << endl; - } - { - PvlKeyword key("ekey", "enum"); - out << key << endl; - } - { - PvlKeyword key("hkey0", "hEX"); - out << key << endl; - } - { - PvlKeyword key("hkey2", "hEX"); - key.addValue(toString(2)); - out << key << endl; - } - { - PvlKeyword key("hkey4", "hEX"); - key.addValue(toString(4)); - out << key << endl; - } - { - PvlKeyword key("binkey", "binary"); - key.addValue(toString(7)); - out << key << endl; - } - { - PvlKeyword key("binkey16", "binary"); - key.addValue(toString(16)); - out << key << endl; - } - { - PvlKeyword key("intkeyarray", "integer"); - out << key << endl; - } - { - PvlKeyword key("dblkeyarray", "rEaL"); - key.addValue(toString(2)); - out << key << endl; - } - { - PvlKeyword key("wrapword", "string"); - out << key << endl; - } - { - PvlKeyword key("array", "integer"); - out << key << endl; - } - - out.close(); - - pdsFormatter = new PvlFormatPds(pdsFile); - QFile::remove(pdsFile); - } - - // Test Keywords - { - PvlKeyword key("skey", "somestringval"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("skey", "string val", "chars"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("sNAstring", "N/A"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("sUNKquote", "\"UNK\""); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("ssinglequote", "\'NA\'"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("notinmap", "junk string"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("myint", "12345"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("myfloat", toString(-12345.67e+89), "degrees"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("fkey", toString(-12345.6789)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("fkey0", toString(-9876.543)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("fkey0", toString(-9876.543e-99)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("fkey2", toString(0.123456)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("fkey2", toString(0.123456), "goofys"); - key.addValue(toString(987.123), "goofys"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("fkey2", toString(0.123456), "goofys"); - key.addValue(toString(987.123)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("ekey", "unsigned"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("myarray", "(12345,\"a short string\",1.234)"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("hkey0", toString((BigInt)0x123456789abcdeffLL)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("hkey2", toString(0x7a8b)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("hkey4", toString(0x1a2b3c4d)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("binkey", toString(0xA)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("binkey16", toString(0xffff)); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("intkeyarray", toString(1)); - key.addValue("NULL"); - key.addValue("3"); - key.addValue("NULL"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("intkeyarray", toString(1), "m"); - key.addValue("NULL", "m"); - key.addValue("3", "m"); - key.addValue("N/A"); - key.addValue("UNK"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - { - PvlKeyword key("dblkeyarray", toString(1.01)); - key.addValue("NULL"); - key.addValue("3.4"); - key.addValue("UNK"); - cout << key << endl; - key.setFormat(pdsFormatter); - cout << key << pdsFormatter->formatEOL(); - } - - - // Test Groups - { - PvlGroup grp("Group1"); - grp += PvlKeyword("skey", "stringval"); - grp += PvlKeyword("mystring", "string val"); - grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - grp += PvlKeyword("myint", toString(12345)); - grp += PvlKeyword("myfloat", toString(12345.67e+89)); - grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - cout << "=============================== Before" << endl; - cout << grp << endl; - grp.setFormat(pdsFormatter); - cout << "=============================== After" << endl; - cout << grp << pdsFormatter->formatEOL(); - } - - - // Test Objects - { - PvlGroup grp("Group1"); - grp += PvlKeyword("skey", "stringval"); - grp += PvlKeyword("mystring", "string val"); - grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - grp += PvlKeyword("myint", toString(12345)); - grp += PvlKeyword("myfloat", toString(12345.67e+89)); - grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - PvlObject obj("Object1"); - obj.addGroup(grp); - - PvlObject obj2("Object2"); - obj2 += PvlKeyword("skey", "stringval"); - obj2 += PvlKeyword("mystring", "string val"); - obj2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - obj2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - obj2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - obj2 += PvlKeyword("myint", toString(12345)); - obj2 += PvlKeyword("myfloat", toString(12345.67e+89)); - obj2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - obj.addObject(obj2); - - obj += PvlKeyword("skey", "stringval"); - obj += PvlKeyword("mystring", "string val"); - obj += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - obj += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - obj += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - obj += PvlKeyword("myint", toString(12345)); - obj += PvlKeyword("myfloat", toString(12345.67e+89)); - obj += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - - - cout << "=============================== Before" << endl; - cout << obj << endl; - obj.setFormat(pdsFormatter); - cout << "=============================== After" << endl; - cout << obj << pdsFormatter->formatEOL(); - } - - - // Test Pvl - { - Pvl pvl; - - PvlObject obj("Object1"); - - PvlGroup grp("Group1"); - grp += PvlKeyword("skey", "stringval"); - grp += PvlKeyword("mystring", "string val"); - grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - grp += PvlKeyword("myint", toString(12345)); - grp += PvlKeyword("myfloat", toString(12345.67e+89)); - grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - obj.addGroup(grp); - - PvlObject obj2("Object2"); - obj2 += PvlKeyword("skey", "stringval"); - obj2 += PvlKeyword("mystring", "string val"); - obj2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - obj2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - obj2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - obj2 += PvlKeyword("myint", toString(12345)); - obj2 += PvlKeyword("myfloat", toString(12345.67e+89)); - obj2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - obj2 += PvlKeyword("binkey16", toString(0x01f0)); - obj.addObject(obj2); - - obj += PvlKeyword("skey", "stringval"); - obj += PvlKeyword("mystring", "string val"); - obj += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - obj += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - obj += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - obj += PvlKeyword("myint", toString(12345)); - obj += PvlKeyword("myfloat", toString(12345.67e+89)); - obj += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - - pvl += PvlKeyword("skey", "stringval"); - pvl += PvlKeyword("mystring", "string val"); - pvl += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - pvl += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - pvl += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - pvl += PvlKeyword("myint", toString(12345)); - pvl += PvlKeyword("myfloat", toString(12345.67e+89)); - pvl += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - - pvl.addObject(obj); - - PvlGroup grp2("Group2"); - grp2 += PvlKeyword("skey", "stringval"); - grp2 += PvlKeyword("mystring", "string val"); - grp2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set - grp2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes - grp2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - grp2 += PvlKeyword("myint", toString(12345)); - grp2 += PvlKeyword("myfloat", toString(12345.67e+89)); - grp2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - grp2 += PvlKeyword("binkey16", toString(0x8001)); - grp2 += PvlKeyword("wrapword", "The quick brown fox jumped over the lazy duck. " - "Repunzel Repunzel let down your hair. The little toy dog is covered with dust," - " but sturdy and staunch he stands; and the little toy soldier is red with rust."); - PvlKeyword key(PvlKeyword("array", toString(12345))); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - grp2 += key; - pvl.addGroup(grp2); - - - cout << "=============================== Before" << endl; - cout << pvl << endl; - pvl.setFormat(pdsFormatter); - cout << "=============================== After" << endl; - cout << pvl << pdsFormatter->formatEOL(); - } - - - } - catch(IException &e) { - e.print(); - } - - -} - diff --git a/isis/src/core/PvlGroup/unitTest.cpp b/isis/src/core/PvlGroup/unitTest.cpp deleted file mode 100644 index 59fc539421..0000000000 --- a/isis/src/core/PvlGroup/unitTest.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include -#include "PvlGroup.h" -#include "PvlTokenizer.h" -#include "Preference.h" -#include "IException.h" - -using namespace std; -using namespace Isis; - -int main() { - Isis::Preference::Preferences(true); - - Isis::PvlKeyword dog("DOG", toString(5.2), "meters"); - Isis::PvlKeyword cat("CATTLE"); - cat = "Meow"; - cat.addComment("Cats shed"); - - Isis::PvlGroup ani("Animals"); - ani += dog; - ani += cat; - ani.addComment("/* Pets are cool"); - - cout << ani << endl; - - cout << (double) ani["dog"] << endl << endl; - - ani -= "dog"; - cout << ani << endl << endl; - - ani -= ani[0]; - cout << ani << endl << endl; - - stringstream os; - os << "# Testing" << endl - << "/* 123 */" << endl - << "Group=POODLE " << endl - << "CAT=\"TABBY\" " << endl - << "BIRD=(PARROT) \0" << endl - << "REPTILE={SNAKE,LIZARD} \t" << endl - << " " - << " BOVINE = ( COW , CAMEL ) \n " - << "TREE = { \"MAPLE\" ,\n \"ELM\" \n, \"PINE\" }" << endl - << "FLOWER = \"DAISY & \nTULIP \"" - << "# This is a comment\n" - << "/* This is another comment */\n" - << "BIG = (\" NOT \",\"REALLY LARGE\")" << endl - << "EndGroup" << endl; - - PvlGroup g; - os >> g; - cout << g << endl; - - try { - stringstream os2; - os2 << "# Testing" << endl - << "/* 123 */" << endl - << "Group=POODLE " << endl - << "CAT=\"TABBY\" " << endl - << "BIRD=(PARROT) \0" << endl - << "REPTILE={SNAKE,LIZARD} \t" << endl - << " " - << " BOVINE = ( COW , CAMEL ) \n " - << "TREE = { \"MAPLE\" ,\n \"ELM\" \n, \"PINE\" }" << endl - << "FLOWER = \"DAISY & \nTULIP \"" - << "# This is a comment\n" - << "/* This is another comment */\n" - << "BIG = (\" NOT \",\"REALLY LARGE\")" << endl; - - PvlGroup g2; - os2 >> g2; - cout << g2 << endl; - } - catch(IException &e) { - cout.flush(); - e.print(); - } - - // Validate Group - - // Template Group - PvlGroup pvlTmplGrp("Point_ErrorMagnitude"); - PvlKeyword pvlTmplKwrd("Point_ErrorMagnitude__Required", "false"); - pvlTmplGrp += pvlTmplKwrd; - pvlTmplKwrd.clear(); - - pvlTmplKwrd = PvlKeyword("LessThan", "double"); - pvlTmplGrp += pvlTmplKwrd; - pvlTmplKwrd.clear(); - - pvlTmplKwrd = PvlKeyword("LessThan__Required", "false"); - pvlTmplGrp += pvlTmplKwrd; - pvlTmplKwrd.clear(); - - pvlTmplKwrd = PvlKeyword("LessThan__Repeated", "false"); - pvlTmplGrp += pvlTmplKwrd; - pvlTmplKwrd.clear(); - - pvlTmplKwrd = PvlKeyword("GreaterThan", "double"); - pvlTmplGrp += pvlTmplKwrd; - pvlTmplKwrd.clear(); - - pvlTmplKwrd = PvlKeyword("GreaterThan__Required", "true"); - pvlTmplGrp += pvlTmplKwrd; - pvlTmplKwrd.clear(); - - pvlTmplKwrd = PvlKeyword("GreaterThan__Repeated", "true"); - pvlTmplGrp += pvlTmplKwrd; - pvlTmplKwrd.clear(); - cout << "Template Group:\n" << pvlTmplGrp << endl << endl; - - // PvlGroup to be Validated - PvlGroup pvlGrp("Point_errormagnitude"); - PvlKeyword pvlKwrd("LessThan", toString(2.5)); - - try { - pvlTmplGrp.validateGroup(pvlGrp); - } - catch (IException &e) { - cerr << "\n**Test1**RequiredKeyword\nResults Group:\n" << pvlGrp << endl; - cerr << "**PVL ERROR** Required Keyword \"GreaterThan\" not found in the PvlGroup\n"; - cerr << "**********\n"; - } - - // Test Repeated values - try { - pvlKwrd.clear(); - PvlKeyword pvlKwrd("LessThan", toString(2.5)); - pvlGrp += pvlKwrd; - - pvlKwrd.clear(); - pvlKwrd = PvlKeyword("GreaterThan", toString(3.5)); - pvlGrp += pvlKwrd; - - pvlKwrd.clear(); - pvlKwrd = PvlKeyword("GreaterThan", toString(4.4545)); - pvlGrp += pvlKwrd; - - pvlKwrd.clear(); - pvlKwrd = PvlKeyword("GreaterThan", toString(100.8988095)); - pvlGrp += pvlKwrd; - pvlTmplGrp.validateGroup(pvlGrp); - - cout << "\n**Test2**\nRepeated values are allowed if Repeat flag is set\n"; - cout << "Results Group:\n" << pvlGrp << endl; - cerr << "**********\n"; - } - catch (IException &e) { - e.print(); - } - - // Test for unvalidated elements - try { - pvlKwrd.clear(); - PvlKeyword pvlKwrd("Less123Than", toString(2.5)); - pvlGrp += pvlKwrd; - - pvlKwrd.clear(); - pvlKwrd = PvlKeyword("GreaterThan", toString(3.5)); - pvlGrp += pvlKwrd; - - pvlTmplGrp.validateGroup(pvlGrp); - - cout << "\n**Test3**\nUnvalidated Keywords\n"; - cout << "Results Group:\n" << pvlGrp << endl; - cerr << "**********\n"; - } - catch (IException &e) { - e.print(); - } - -} diff --git a/isis/src/core/PvlSequence/unitTest.cpp b/isis/src/core/PvlSequence/unitTest.cpp deleted file mode 100644 index fbc2964a98..0000000000 --- a/isis/src/core/PvlSequence/unitTest.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include - -#include - -#include "PvlKeyword.h" -#include "PvlSequence.h" -#include "Preference.h" - -using namespace Isis; - -int main(void) { - Preference::Preferences(true); - - PvlKeyword key("Key"); - key += QString("(xyzzy,plover)"); - key += QString("(2,b,|,^,2,b)"); - - PvlSequence seq; - seq = key; - - seq += QString("(a,b,c)"); - seq += QString("(d,e)"); - seq += QString("singleton"); - - std::vector slist; - slist.push_back("1"); - slist.push_back("2"); - seq += slist; - - std::vector ilist; - ilist.push_back(-1); - ilist.push_back(-2); - ilist.push_back(-3); - seq += ilist; - - std::vector dlist; - dlist.push_back(1.0); - dlist.push_back(0.0); - dlist.push_back(-1.0); - seq += dlist; - - std::cout << seq.Size() << std::endl; - for(int i = 0; i < seq.Size(); i++) { - for(int j = 0; j < (int)seq[i].size(); j++) { - std::cout << seq[i][j] << " "; - } - std::cout << std::endl; - } - - seq.Clear(); - std::cout << seq.Size() << std::endl; - return 0; -} diff --git a/isis/src/core/PvlToPvlTranslationManager/unitTest.cpp b/isis/src/core/PvlToPvlTranslationManager/unitTest.cpp deleted file mode 100644 index 5be5e7d1ce..0000000000 --- a/isis/src/core/PvlToPvlTranslationManager/unitTest.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include "PvlToPvlTranslationManager.h" -#include "Preference.h" -#include "IException.h" -#include "IString.h" -#include "Preference.h" - -using namespace Isis; -using namespace std; - -int main(void) { - Preference::Preferences(true); - - try { - - stringstream fStrm; - fStrm << "^IMAGE = (SomeFile.dat, 32)" << endl; - fStrm << "Object = Image" << endl; - fStrm << " Group = Size" << endl; - fStrm << " NL = 500" << endl; - fStrm << " NS = 400" << endl; - fStrm << " NB = (27,12,1)" << endl; - fStrm << " EndGroup" << endl; - fStrm << " Group = Pixel" << endl; - fStrm << " Bits = 16" << endl; - fStrm << " Signed = True" << endl; - fStrm << " Architecture = Sun" << endl; - fStrm << " Resolution = 100" << endl; - fStrm << " EndGroup" << endl; - fStrm << " Object = BandInfo" << endl; - fStrm << " Band = (r,g,b)" << endl; - fStrm << " Center = (2, 8, 1.9)" << endl; - fStrm << " EndObject" << endl; - fStrm << "EndObject" << endl; - - fStrm << "OBJECT = QUBE" << endl; - fStrm << " GROUP = IMAGE_MAP_PROJECTION" << endl; - fStrm << " MAP_PROJECTION_TYPE = SINUSOIDAL" << endl; - fStrm << " A_AXIS_RADIUS = 1737.4000000" << endl; - fStrm << " CENTER_LONGITUDE = 44.4975624" << endl; - fStrm << " END_GROUP = IMAGE_MAP_PROJECTION" << endl; - fStrm << "END_OBJECT = QUBE" << endl; - fStrm << "End" << endl; - Pvl fLabel; - fStrm >> fLabel; - - stringstream trnsStrm; - trnsStrm << "Group = DataFileName" << endl; - trnsStrm << " InputKey = ^IMAGE" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = ImageStartByte" << endl; - trnsStrm << " InputKey = ^IMAGE" << endl; - trnsStrm << " InputDefault = 1" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = NumberOfLines" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " OutputName = Lines" << endl; - trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; - trnsStrm << "\"Group\",\"Dimensions\")" << endl; - trnsStrm << " InputPosition = (Image,Size)" << endl; - trnsStrm << " InputKey = NL" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = NumberOfBands" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " Optional = 1" << endl; - trnsStrm << " OutputName = Bands" << endl; - trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; - trnsStrm << "\"Group\",\"Dimensions\")" << endl; - trnsStrm << " InputPosition = (Image,Size)" << endl; - trnsStrm << " InputKey = Nb" << endl; - trnsStrm << " InputDefault = 1" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = Bonus" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " Optional = 1" << endl; - trnsStrm << " InputPosition = (Image,Pixel)" << endl; - trnsStrm << " InputKey = Bonus" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = Extra" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " Optional = 1" << endl; - trnsStrm << " InputPosition = (Image,Bogus)" << endl; - trnsStrm << " InputKey = Extra" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = BytesPerPixel" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " InputPosition = Size" << endl; - trnsStrm << " InputPosition = (Image,Size)" << endl; - trnsStrm << " InputPosition = (Image,Pixel)" << endl; - trnsStrm << " InputKey = Bits" << endl; - trnsStrm << " InputDefault = 8" << endl; - trnsStrm << " OutputName = PixelBytes" << endl; - trnsStrm << " OutputPosition = Root" << endl; - trnsStrm << " Translation = (1,8)" << endl; - trnsStrm << " Translation = (2,16)" << endl; - trnsStrm << " Translation = (4,32)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = PixelResolution" << endl; - trnsStrm << " InputPosition = (Image,Pixel)" << endl; - trnsStrm << " InputKey = Resolution" << endl; - trnsStrm << " InputDefault = 1" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = Sign" << endl; - trnsStrm << " InputPosition = (Image,Pixel)" << endl; - trnsStrm << " InputKey = Signed" << endl; - trnsStrm << " InputDefault = True" << endl; - trnsStrm << " Translation = (True,True)" << endl; - trnsStrm << " Translation = (False,False)" << endl; - trnsStrm << " Translation = (True,Yes)" << endl; - trnsStrm << " Translation = (False,No)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = BandName" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " OutputName = Band" << endl; - trnsStrm << " OutputPosition = (\"Object\",\"IsisCube\","; - trnsStrm << "\"Object\",\"BandBin\")" << endl; - trnsStrm << " InputPosition = (Image,BandInfo)" << endl; - trnsStrm << " InputKey = Band" << endl; - trnsStrm << " Translation = (Red,r)" << endl; - trnsStrm << " Translation = (Green,g)" << endl; - trnsStrm << " Translation = (Blue,b)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = BadGroup" << endl; - trnsStrm << " InputPosition = (Bad1,Bad2,Bad3)" << endl; - trnsStrm << " InputKey = BadKey" << endl; - trnsStrm << " InputDefault = 1" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - trnsStrm << "Group = GoodGroupBadKey" << endl; - trnsStrm << " InputPosition = (Image,Pixel)" << endl; - trnsStrm << " InputKey = BadKey" << endl; - trnsStrm << " InputDefault = 1" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - - trnsStrm << "Group = CenterLongitude" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " OutputPosition = (\"Group\",\"Mapping\")" << endl; - trnsStrm << " OutputName = CenterLongitude" << endl; - trnsStrm << " InputPosition = IMAGE_MAP_PROJECTION" << endl; - trnsStrm << " InputPosition = (QUBE,IMAGE_MAP_PROJECTION)" << endl; - trnsStrm << " InputPosition = (SPECTRAL_QUBE,IMAGE_MAP_PROJECTION)" << endl; - trnsStrm << " InputKey = CENTER_LONGITUDE" << endl; - trnsStrm << " Translation = (*,*)" << endl; - trnsStrm << "EndGroup" << endl; - - trnsStrm << "End" << endl; - - PvlToPvlTranslationManager transMgr(fLabel, trnsStrm); - - cout << "Testing PvlToPvlTranslationManager object" << endl; - - cout << " Testing InputValue member" << endl; - cout << " DataFileName = " << transMgr.InputKeyword("DataFileName")[0] << endl; - cout << " StartByte = " << transMgr.InputKeyword("ImageStartByte")[1] << endl; - cout << " NumberOfBands = " << transMgr.InputKeyword("NumberOfBands")[0] << endl; - cout << " PixelResolution = " << transMgr.InputKeyword("PixelResolution")[0] << endl; - cout << " Error messages:" << endl; - try { - transMgr.InputKeyword("BadGroup"); - } - catch(IException &e) { - cerr << " "; - e.print(); - } - try { - transMgr.InputKeyword("GoodGroupBadKey"); - } - catch(IException &e) { - cerr << " "; - e.print(); - } - cout << endl; - - cout << " Testing InputUnits member" << endl; - cout << " PixelResolution = " << transMgr.InputKeyword("PixelResolution").unit() << endl; - cout << " NumberOfBands = " << transMgr.InputKeyword("NumberOfBands").unit() << endl; - cout << " Error messages:" << endl; - try { - transMgr.InputKeyword("BadGroup").unit(); - } - catch(IException &e) { - cerr << " "; - e.print(); - } - try { - transMgr.InputKeyword("GoodGroupBadKey").unit(); - } - catch(IException &e) { - cerr << " "; - e.print(); - } - cout << endl; - - cout << " Testing InputSize member" << endl; - cout << " BandName = " << transMgr.InputKeyword("BandName").size() << endl; - cout << " PixelResolution = " << transMgr.InputKeyword("PixelResolution").size() << endl; - cout << " Error messages:" << endl; - try { - transMgr.InputKeyword("BadGroup").size(); - } - catch(IException &e) { - cerr << " "; - e.print(); - } - try { - transMgr.InputKeyword("GoodGroupBadKey").size(); - } - catch(IException &e) { - cerr << " "; - e.print(); - } - cout << endl; - - cout << " Testing InputHasKeyword member" << endl; - cout << " BandName = " << transMgr.InputHasKeyword("BandName") << endl; - cout << " GoodGroupBadKey = " << transMgr.InputHasKeyword("GoodGroupBadKey") << endl; - cout << endl; - -// cout << " Testing InputHasGroup member" << endl; -// cout << " BandName = " << transMgr.InputHasGroup ("BandName") << endl; -// cout << " BadGroup = " << transMgr.InputHasGroup ("BadGroup") << endl; -// cout << endl; - - cout << " Testing Translate member" << endl; - cout << " DataFileName = " << transMgr.Translate("DataFileName") << endl; - cout << " ImageStartByte = " << transMgr.Translate("ImageStartByte", 1) << endl; - cout << " Lines = " << transMgr.Translate("NumberOfLines") << endl; - cout << endl; - - cout << " Testing Auto member" << endl; - Pvl pvl; - transMgr.Auto(pvl); - cout << pvl << endl; - - - } - catch(IException &e) { - e.print(); - } - - return 0; -} diff --git a/isis/src/core/PvlToXmlTranslationManager/unitTest.cpp b/isis/src/core/PvlToXmlTranslationManager/unitTest.cpp deleted file mode 100644 index d28326f486..0000000000 --- a/isis/src/core/PvlToXmlTranslationManager/unitTest.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include - -#include - -#include "IException.h" -#include "IString.h" -#include "Preference.h" - -#include "PvlToXmlTranslationManager.h" - - -using namespace Isis; -using namespace std; - -int main(void) { - Preference::Preferences(true); - - QDomDocument *QDomDoc; - - QDomDoc = new QDomDocument("XML_LABEL"); - QDomElement root = QDomDoc->createElement("Product_Observational"); - QDomDoc->appendChild(root); - - try { - stringstream fStrm; - fStrm << "Object = IsisCube" << endl; - fStrm << " Object = Core" << endl; - fStrm << " Group = Dimensions" << endl; - fStrm << " Samples = 2048" << endl; - fStrm << " Lines = 255" << endl; - fStrm << " Bands = 1" << endl; - fStrm << " EndGroup" << endl; - fStrm << " Group = Pixel" << endl; - fStrm << " Type = SignedWord" << endl; - fStrm << " ByteOrder = Lsb" << endl; - fStrm << " Base = 0.0" << endl; - fStrm << " Multiplier = 1.0" << endl; - fStrm << " EndGroup" << endl; - fStrm << " EndObject" << endl; - fStrm << " Group = Instrument" << endl; - fStrm << " SpacecraftId = TGO" << endl; - fStrm << " ExposureDuration = 1.920e-003 " << endl; - fStrm << " InstrumentId = CaSSIS" << endl; - fStrm << " Filter = NIR" << endl; - fStrm << " EndGroup" << endl; - fStrm << "EndObject" << endl; - - fStrm << "End" << endl; - Pvl fLabel; - fStrm >> fLabel; - - ofstream trnsStrm; - trnsStrm.open ("temp.trn"); - trnsStrm << "Group = Samples" << endl; - trnsStrm << " Auto = 1" << endl; - trnsStrm << " InputKey = Samples" <toString() << endl; - cout << endl; - } - catch(IException &e) { - e.print(); - } - } - catch(IException &e) { - e.print(); - } - remove("temp.trn"); -} diff --git a/isis/src/core/PvlToken/unitTest.cpp b/isis/src/core/PvlToken/unitTest.cpp deleted file mode 100644 index 3eb2fb1614..0000000000 --- a/isis/src/core/PvlToken/unitTest.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include "PvlToken.h" -#include "IException.h" -#include "Preference.h" - -using namespace Isis; -using namespace std; - -int main(int argc, char *argv[]) { - Preference::Preferences(true); - - PvlToken dog("Dog"); - dog.addValue("drools"); - - cout << "Info on dog" << endl; - cout << " key: " << dog.key() << endl; - cout << " upperkey: " << dog.keyUpper() << endl; - cout << " valuesize: " << dog.valueSize() << endl; - cout << " value: " << dog.value() << endl; - cout << " uppervalue: " << dog.valueUpper() << endl; - cout << endl; - - cout << "Adding another value to dog" << endl; - dog.addValue("wags tail"); - cout << " valuesize: " << dog.valueSize() << endl; - cout << " value: " << dog.value(1) << endl; - cout << " uppervalue: " << dog.valueUpper(1) << endl; - cout << endl; - - cout << "Clearing dog values" << endl; - dog.valueClear(); - cout << " valuesize: " << dog.valueSize() << endl; - cout << endl; - - cout << "Testing Throws in dog" << endl; - - try { - dog.value(-1); - } - catch(IException &e) { - e.print(); - } - - try { - dog.value(1); - } - catch(IException &e) { - e.print(); - } - - return 0; -} diff --git a/isis/src/core/PvlTokenizer/unitTest.cpp b/isis/src/core/PvlTokenizer/unitTest.cpp deleted file mode 100644 index bad4c56593..0000000000 --- a/isis/src/core/PvlTokenizer/unitTest.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include "PvlToken.h" -#include "PvlTokenizer.h" -#include "IException.h" -#include "Preference.h" - -using namespace Isis; -using namespace std; - -int main(void) { - Preference::Preferences(true); - -//***************************************************************************** -// Create Instances of the Tokenizer -//***************************************************************************** - - PvlTokenizer tizer; - -//***************************************************************************** -// Create a stream and load it -//***************************************************************************** - - stringstream os; - os << "DOG=POODLE " - << "CAT=\"TABBY\" " - << "BIRD=(PARROT) \0" - << "REPTILE={SNAKE,LIZARD} \t" - << "-VEGGIE \n" - << " " - << " BOVINE = ( COW , CAMEL ) \n " - << "TREE = { \"MAPLE\" ,\n \"ELM\" \n, \"PINE\" }" - << "FLOWER = \"DAISY & \nTULIP \"" - << "# This is a comment\n" - << "/* This is another comment\n" - << "BIG = (\" NOT \",\"REALLY LARGE\")\n" - << "SEQUENCE = ((a,b,c), (d,e,f))" - << "QUOTED_STRING=\"A QUOTED STRING\"" - << "QuotedNewLine=\"abcd\nefgh \nijk\n lmn\"" - << "ApostNewLine=\'abcd\nefgh \nijk\n lmn\'"; - - try { - tizer.Load(os); - } - catch(IException &e) { - e.print(); - } - - vector t = tizer.GetTokenList(); - - cout << "TESTING TOKENIZER" << endl; - int i, j; - for(i = 0; i < (int)t.size(); i++) { - cout << t[i].key() << " is "; - for(j = 0; j < t[i].valueSize(); j++) { - cout << t[i].value(j) << " "; - } - cout << endl; - } - cout << endl; - - cout << "TESTING TOKENIZER CLEAR" << endl; - tizer.Clear(); - vector t2 = tizer.GetTokenList(); - cout << t2.size() << endl << endl; - - stringstream os2; - os2 << "PHRASE = \"The quick brown fox jumped over the lazy dog"; - cout << "TESTING TOKEN ERROR [" << os2.str() << "]" << endl; - try { - tizer.Load(os2); - } - catch(IException &e) { - e.print(); - } - cout << endl; - - stringstream os3; - os3 << "PHRASE = {To Be or Not To Be That is the Question"; - cout << "TESTING TOKEN ERROR [" << os3.str() << "]" << endl; - try { - tizer.Load(os3); - } - catch(IException &e) { - e.print(); - } - cout << endl; - - stringstream os4; - os4 << "PHRASE = (I came, I saw, I conquered"; - cout << "TESTING TOKEN ERROR [" << os4.str() << "]" << endl; - try { - tizer.Load(os4); - } - catch(IException &e) { - e.print(); - } - cout << endl; - - stringstream os5; - os5 << "FOOD = (\"french\",\"fries,\"good\") "; - cout << "TESTING TOKEN ERROR [" << os5.str() << "]" << endl; - try { - tizer.Load(os5); - } - catch(IException &e) { - e.print(); - } - cout << endl; - - stringstream os6; - os6 << "FOOD = (\"burgers\",\"hotdogs,\"good\")"; - cout << "TESTING TOKEN ERROR [" << os6.str() << "]" << endl; - try { - tizer.Load(os6); - } - catch(IException &e) { - e.print(); - } - cout << endl; - - stringstream os7; - os7 << "FOOD = (\"pickels,pizza\")"; - cout << "TESTING TOKEN ERROR [" << os7.str() << "]" << endl; - try { - tizer.Load(os7); - } - catch(IException &e) { - e.print(); - } - cout << endl; - - stringstream os8; - os8 << "FISH = (\"trout\",\"pizz\"a)"; - cout << "TESTING TOKEN ERROR [" << os8.str() << "]" << endl; - try { - tizer.Load(os8); - } - catch(IException &e) { - e.print(); - } - cout << endl; - - return 0; -} diff --git a/isis/src/core/PvlTranslationTable/unitTest.cpp b/isis/src/core/PvlTranslationTable/unitTest.cpp deleted file mode 100644 index 10560750d8..0000000000 --- a/isis/src/core/PvlTranslationTable/unitTest.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include "PvlTranslationTable.h" -#include "Preference.h" -#include "IException.h" -#include "IString.h" -#include "Preference.h" - -using namespace std; -using namespace Isis; - -int main(void) { - Preference::Preferences(true); - - try { - stringstream in; - in << "Group = DataFileName" << endl; - in << " InputPosition = ROOT" << endl; - in << " InputKey = ^IMAGE" << endl; - in << " Translation = (*,*)" << endl; - in << "EndGroup" << endl; - in << "Group = DataFileRecordBytes" << endl; - in << " InputKey = RECORD_BYTES" << endl; - in << " Translation = (*,*)" << endl; - in << "EndGroup" << endl; - in << "Group = CoreLines" << endl; - in << " InputPosition = IMAGE" << endl; - in << " InputKey = LINES" << endl; - in << " Translation = (*,*)" << endl; - in << "EndGroup" << endl; - in << "Group = CoreBitsPerPixel" << endl; - in << " Auto = 1" << endl; - in << " OutputName = BitsPerPixel" << endl; - in << " OutputPosition = (\"Object\",\"IsisCube\", \"Object\",\"Core\","; - in << "\"Group\",\"Pixels\")" << endl; - in << " InputPosition = IMAGE" << endl; - in << " InputKey = SAMPLE_BITS" << endl; - in << " InputDefault = 8" << endl; - in << " Translation = (8,8)" << endl; - in << " Translation = (16,16)" << endl; - in << " Translation = (32,32)" << endl; - in << "EndGroup" << endl; - in << "Group = CorePixelType" << endl; - in << " InputPosition = IMAGE" << endl; - in << " InputKey = SAMPLE_TYPE" << endl; - in << " InputDefault = LSB_INTEGER" << endl; - in << " Translation = (Integer,LSB_INTEGER)" << endl; - in << " Translation = (Integer,MSB_INTEGER)" << endl; - in << " Translation = (Integer,PC_INTEGER)" << endl; - in << " Translation = (Integer,MAC_INTEGER)" << endl; - in << " Translation = (Integer,SUN_INTEGER)" << endl; - in << " Translation = (Natural,UNSIGNED_INTEGER)" << endl; - in << " Translation = (Unknown,*)" << endl; - in << "EndGroup" << endl; - in << "Group = CoreByteOrder" << endl; - in << " InputPosition = IMAGE" << endl; - in << " InputKey = SAMPLE_TYPE" << endl; - in << " InputDefault = LSB_INTEGER" << endl; - in << " Translation = (LittleEndian,LSB_INTEGER)" << endl; - in << " Translation = (BigEndian,MSB_INTEGER)" << endl; - in << " Translation = (LittleEndian,PC_INTEGER)" << endl; - in << " Translation = (BigEndian,MAC_INTEGER)" << endl; - in << " Translation = (BigEndian,SUN_INTEGER)" << endl; - in << " Translation = (LittleEndian,UNSIGNED_INTEGER)" << endl; - in << "EndGroup" << endl; - in << "End" << endl; - - PvlTranslationTable table(in); - - string group, key; - - cout << "Unit test for Isis::PvlTranslationTable" << endl << endl; - - cout << " Test InputGroup :" << endl; - - cout << " InputGroup (\"DataFileName\") = " << - table.InputGroup("DataFileName")[0] << endl; - cout << " InputGroup (\"CoreLines\") = " << - table.InputGroup("CoreLines")[0] << endl; - try { - table.InputGroup("tttt1"); - } - catch(IException &e) { - cerr << " "; - e.print(); - cerr << endl; - } - - cout << " Test InputKey :" << endl; - - cout << " InputKeywordName (\"DataFileName\") = " << - table.InputKeywordName("DataFileName") << endl; - cout << " InputKeywordName (\"CoreLines\") = " << - table.InputKeywordName("CoreLines") << endl; - try { - table.InputKeywordName("tttt2"); - } - catch(IException &e) { - cerr << " "; - e.print(); - cerr << endl; - } - - cout << " Test InputDefault :" << endl; - - cout << " InputDefault (\"DataFileName\") = " << - table.InputDefault("DataFileName") << endl; - cout << " InputDefault (\"CoreBitsPerPixel\") = " << - table.InputDefault("CoreBitsPerPixel") << endl; - try { - table.InputDefault("tttt3"); - } - catch(IException &e) { - cerr << " "; - e.print(); - cerr << endl; - } - - cout << " Test Translate :" << endl; - - cout << " Translate (\"DataFileName\", \"tttt4\") = " << - table.Translate("DataFileName", "tttt4") << endl; - cout << " Translate (\"CoreByteOrder\",\"MSB_INTEGER\") = " << - table.Translate("CoreByteOrder", "MSB_INTEGER") << endl; - cout << " Translate (\"CorePixelType\") = " << - table.Translate("CorePixelType") << endl; - cout << " Translate (\"CorePixelType\") = " << - table.Translate("CorePixelType", "baddata") << endl; - try { - table.Translate("tttt6"); - } - catch(IException &e) { - cerr << " "; - e.print(); - } - - try { - table.Translate("DataFileRecordBytes"); - } - catch(IException &e) { - cerr << " "; - e.print(); - } - - try { - table.Translate("CoreBitsPerPixel", "31"); - } - catch(Isis::IException &e) { - cerr << " "; - e.print(); - cerr << endl; - } - - cout << " Test AddTable :" << endl; - - in.clear(); - in << "Group = CoreLineSuffixBytes" << endl; - in << " InputKey = LINE_SUFFIX_BYTES" << endl; - in << " Translation = (*,*)" << endl; - in << "EndGroup" << endl; - in << "Group = CoreLinePrefixBytes" << endl; - in << " InputKey = LINE_PREFIX_BYTES" << endl; - in << " Translation = (*,*)" << endl; - in << "EndGroup" << endl; - table.AddTable(in); - - cout << " Translate (\"CoreLinePrefixBytes\", \"128\") = " << - table.Translate("CoreLinePrefixBytes", "128") << endl << endl; - - - class protectedTester : public Isis::PvlTranslationTable { - public: - void tester() { - stringstream in2; - in2 << "Group = DataFileName" << endl; - in2 << " InputKey = ^IMAGE" << endl; - in2 << " Translation = (*,*)" << endl; - in2 << "EndGroup" << endl; - in2 << "Group = CoreBitsPerPixel" << endl; - in2 << " Auto = 1" << endl; - in2 << " Optional = 1" << endl; - in2 << " OutputName = BitsPerPixel" << endl; - in2 << " OutputPosition = (\"Object\",\"IsisCube\", \"Object\",\"Core\","; - in2 << "\"Group\",\"Pixels\")" << endl; - in2 << " InputGroup = IMAGE" << endl; - in2 << " InputKey = SAMPLE_BITS" << endl; - in2 << " InputDefault = 8" << endl; - in2 << " Translation = (8,8)" << endl; - in2 << " Translation = (16,16)" << endl; - in2 << " Translation = (32,32)" << endl; - in2 << "EndGroup" << endl; - in2 << "End" << endl; - - AddTable(in2); - - cout << " Test IsAuto :" << endl; - cout << " IsAuto (\"DataFileName\") = " << - IsAuto("DataFileName") << endl; - cout << " IsAuto (\"CoreBitsPerPixel\") = " << - IsAuto("CoreBitsPerPixel") << endl << endl; - - cout << " Test IsOptional :" << endl; - cout << " IsAuto (\"DataFileName\") = " << - IsOptional("DataFileName") << endl; - cout << " IsAuto (\"CoreBitsPerPixel\") = " << - IsOptional("CoreBitsPerPixel") << endl << endl; - - cout << " Test OutputPosition :" << endl; - cout << " OutputPosition (\"CoreBitsPerPixel\") yields : " << - OutputPosition("CoreBitsPerPixel") << endl << endl; - - cout << " Test OutputName :" << endl; - cout << " OutputName (\"CoreBitsPerPixel\") = " << - OutputName("CoreBitsPerPixel") << endl << endl; - - }; - }; - protectedTester t; - t.tester(); - - } - catch(IException &e) { - e.print(); - } - - return 0; -} diff --git a/isis/src/core/SpecialPixel/unitTest.cpp b/isis/src/core/SpecialPixel/unitTest.cpp deleted file mode 100644 index 6142b0a0c1..0000000000 --- a/isis/src/core/SpecialPixel/unitTest.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include -#include -#include "IException.h" -#include "IString.h" -#include "SpecialPixel.h" -#include "Preference.h" - -#include - -using namespace Isis; -using namespace std; - -int main(int argc, char *argv[]) { - Isis::Preference::Preferences(true); - - cout << "Unit test for IsisSpecialPixel" << endl; - - cout << "Valid minimum (1 byte): " << (int) Isis::VALID_MIN1 << endl; - cout << "Null (1 byte): " << (int) Isis::NULL1 << endl; - cout << "Low Representation (1 byte): " << (int) Isis::LOW_REPR_SAT1 << endl; - cout << "Low Instrument (1 byte): " << (int) Isis::LOW_INSTR_SAT1 << endl; - cout << "High Representation (1 byte): " << (int) Isis::HIGH_REPR_SAT1 << endl; - cout << "High Instrument (1 byte): " << (int) Isis::HIGH_INSTR_SAT1 << endl; - cout << "Valid maximum (1 byte): " << (int) Isis::VALID_MAX1 << endl; - cout << endl; - - cout << "Valid minimum (2 byte): " << Isis::VALID_MIN2 << endl; - cout << "Null (2 byte): " << Isis::NULL2 << endl; - cout << "Low Representation (2 byte): " << Isis::LOW_REPR_SAT2 << endl; - cout << "Low Instrument (2 byte): " << Isis::LOW_INSTR_SAT2 << endl; - cout << "High Representation (2 byte): " << Isis::HIGH_REPR_SAT2 << endl; - cout << "High Instrument (2 byte): " << Isis::HIGH_INSTR_SAT2 << endl; - cout << "Valid maximum (2 byte): " << Isis::VALID_MAX2 << endl; - cout << endl; - - cout << "Valid minimum (4 byte): " << Isis::VALID_MIN4 << endl; - cout << "Null (4 byte): " << Isis::NULL4 << endl; - cout << "Low Representation (4 byte): " << Isis::LOW_REPR_SAT4 << endl; - cout << "Low Instrument (4 byte): " << Isis::LOW_INSTR_SAT4 << endl; - cout << "High Representation (4 byte): " << Isis::HIGH_REPR_SAT4 << endl; - cout << "High Instrument (4 byte): " << Isis::HIGH_INSTR_SAT4 << endl; - cout << "Valid maximum (4 byte): " << Isis::VALID_MAX4 << endl; - cout << endl; - - cout << setprecision(16); - cout << "Valid minimum (8 byte): " << Isis::VALID_MIN8 << endl; - cout << "Null (8 byte): " << Isis::NULL8 << endl; - cout << "Low Representation (8 byte): " << Isis::LOW_REPR_SAT8 << endl; - cout << "Low Instrument (8 byte): " << Isis::LOW_INSTR_SAT8 << endl; - cout << "High Representation (8 byte): " << Isis::HIGH_REPR_SAT8 << endl; - cout << "High Instrument (8 byte): " << Isis::HIGH_INSTR_SAT8 << endl; - cout << "Valid maximum (8 byte): " << Isis::VALID_MAX8 << endl; - cout << endl; - - - - double d = 0.0; - cout << "Testing 0.0 ... " << endl; - cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; - cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; - cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; - cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; - cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; - cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; - cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; - cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; - cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; - cout << endl; - - d = Isis::Null; - cout << "Testing Isis::Null ... " << endl; - cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; - cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; - cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; - cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; - cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; - cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; - cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; - cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; - cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; - cout << endl; - - d = Isis::Lis; - cout << "Testing Isis::Lis ... " << endl; - cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; - cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; - cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; - cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; - cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; - cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; - cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; - cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; - cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; - cout << endl; - - d = Isis::Lrs; - cout << "Testing Isis::Lrs ... " << endl; - cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; - cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; - cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; - cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; - cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; - cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; - cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; - cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; - cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; - cout << endl; - - d = Isis::His; - cout << "Testing Isis::His ... " << endl; - cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; - cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; - cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; - cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; - cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; - cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; - cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; - cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; - cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; - cout << endl; - - d = Isis::Hrs; - cout << "Testing Isis::Hrs ... " << endl; - cout << "IsSpecial: " << Isis::IsSpecial(d) << endl; - cout << "IsValidPixel: " << Isis::IsValidPixel(d) << endl; - cout << "IsNullPixel: " << Isis::IsNullPixel(d) << endl; - cout << "IsLowPixel: " << Isis::IsLowPixel(d) << endl; - cout << "IsHighPixel: " << Isis::IsHighPixel(d) << endl; - cout << "IsHrsPixel: " << Isis::IsHrsPixel(d) << endl; - cout << "IsHisPixel: " << Isis::IsHisPixel(d) << endl; - cout << "IsLrsPixel: " << Isis::IsLrsPixel(d) << endl; - cout << "IsLisPixel: " << Isis::IsLisPixel(d) << endl; - cout << endl; - -#if 0 - cout << Isis::IsEqual(Isis::NULL4, Isis::NULL4) << endl; - cout << Isis::IsEqual(Isis::NULL4, Isis::LOW_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::NULL4, Isis::LOW_REPR_SAT4) << endl; - cout << Isis::IsEqual(Isis::NULL4, Isis::HIGH_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::NULL4, Isis::HIGH_REPR_SAT4) << endl; - cout << endl; - - cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::NULL4) << endl; - cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::LOW_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::LOW_REPR_SAT4) << endl; - cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::HIGH_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::LOW_INSTR_SAT4, Isis::HIGH_REPR_SAT4) << endl; - cout << endl; - - cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::NULL4) << endl; - cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::LOW_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::LOW_REPR_SAT4) << endl; - cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::HIGH_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::LOW_REPR_SAT4, Isis::HIGH_REPR_SAT4) << endl; - cout << endl; - - cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::NULL4) << endl; - cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::LOW_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::LOW_REPR_SAT4) << endl; - cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::HIGH_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::HIGH_INSTR_SAT4, Isis::HIGH_REPR_SAT4) << endl; - cout << endl; - - cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::NULL4) << endl; - cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::LOW_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::LOW_REPR_SAT4) << endl; - cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::HIGH_INSTR_SAT4) << endl; - cout << Isis::IsEqual(Isis::HIGH_REPR_SAT4, Isis::HIGH_REPR_SAT4) << endl; - cout << endl; -#endif - - cout << "Testing PixelToString(double):" << endl; - d = Isis::Null; - cout << "Isis::Null to String:\t" << Isis::PixelToString(d) << endl; - d = Isis::Lrs; - cout << "Isis::Lrs to String:\t" << Isis::PixelToString(d) << endl; - d = Isis::Hrs; - cout << "Isis::Hrs to String:\t" << Isis::PixelToString(d) << endl; - d = Isis::His; - cout << "Isis::His to String:\t" << Isis::PixelToString(d) << endl; - d = Isis::Lis; - cout << "Isis::Lis to String:\t" << Isis::PixelToString(d) << endl; - d = 0.0; - cout << "0.0 to String:\t\t" << Isis::PixelToString(d) << endl; - d = 1.5; - cout << "1.5 to String:\t\t" << Isis::PixelToString(d) << endl; - d = -6.0; - cout << "-6.0 to String:\t\t" << Isis::PixelToString(d) << endl; - cout << endl; - - cout << "Testing StringToPixel(QString):" << endl; - QString s = "NuLl"; - cout << "NuLl to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "lrs"; - cout << "lrs to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "Hrs"; - cout << "Hrs to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "HIs"; - cout << "HIs to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "LIS"; - cout << "LIS to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "0.0"; - cout << "0.0 to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "1.5"; - cout << "1.5 to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "-6.0"; - cout << "-6.0 to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - cout << Isis::PixelToString(d) << " to Pixel:\t" << Isis::StringToPixel(Isis::PixelToString(d)) << endl; - cout << endl; - - cout << "Testing unique value shortcut for StringToPixel(QString):" << endl; - s = "Nul"; - cout << "Nul to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "N"; - cout << "N to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "Lr"; - cout << "Lr to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "Hr"; - cout << "Hr to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "Hi"; - cout << "Hi to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - s = "Li"; - cout << "Li to Pixel:\t\t" << Isis::StringToPixel(s) << endl; - cout << endl; - - cout << "Testing illegal shortcuts/expressions for StringToPixel(QString):" << endl; - try { - s = "Nl"; - Isis::StringToPixel(s); - } - catch(Isis::IException &e) { - e.print(); - } - try { - s = "Nulll"; - Isis::StringToPixel(s); - } - catch(Isis::IException &e) { - e.print(); - } - try { - s = "L"; - Isis::StringToPixel(s); - } - catch(Isis::IException &e) { - e.print(); - } - try { - s = "Ls"; - Isis::StringToPixel(s); - } - catch(Isis::IException &e) { - e.print(); - } - try { - s = "H"; - Isis::StringToPixel(s); - } - catch(Isis::IException &e) { - e.print(); - } - try { - s = "Hs"; - Isis::StringToPixel(s); - } - catch(Isis::IException &e) { - e.print(); - } - try { - s = "Hrsr"; - Isis::StringToPixel(s); - } - catch(Isis::IException &e) { - e.print(); - } - try { - s = "nonsense"; - Isis::StringToPixel(s); - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - - - - - - - - - -} - diff --git a/isis/src/core/TextFile/unitTest.cpp b/isis/src/core/TextFile/unitTest.cpp deleted file mode 100644 index 3ab4720f22..0000000000 --- a/isis/src/core/TextFile/unitTest.cpp +++ /dev/null @@ -1,547 +0,0 @@ -/** This is free and unencumbered software released into the public domain. -The authors of ISIS do not claim copyright on the contents of this file. -For more details about the LICENSE terms and the AUTHORS, you will -find files of those names at the top level of this repository. **/ - -/* SPDX-License-Identifier: CC0-1.0 */ -#include "TextFile.h" -#include "FileName.h" -#include "IException.h" -#include "IString.h" -#include "Preference.h" -#include -#include -#include - -using namespace std; -using namespace Isis; - -int main(int argc, char *argv[]) { - Isis::Preference::Preferences(true); - void ReportError(QString err); - - cout << "Unit test for TextFile" << endl << endl; - - -// ---------------------------------------------------------------------------------- - - QString testFile = "$temporary/TextFile.tmp"; - // setup test data - QString testLines[21]; - - // setup line test data - testLines[0] = "# 0 zero line"; - testLines[1] = "# 1 first line"; - testLines[2] = "# 2 second line"; - testLines[3] = " #3 third line"; - testLines[4] = "/# 4 fourth line"; - testLines[5] = ""; - testLines[6] = "#"; - testLines[7] = "// 7 seventh line"; - testLines[8] = "// 8 eighth line"; - testLines[9] = "/* 9 ninth line"; - testLines[10] = "/* 10 tenth line"; - testLines[11] = "/* 11 eleventh line"; - testLines[12] = "/* 12 twelfth line"; - testLines[13] = " 1 replacement"; - testLines[14] = " 2 replacement"; - testLines[15] = " 3 replacement"; - testLines[16] = " even line replace"; - testLines[17] = ""; - testLines[18] = ""; - testLines[19] = ""; - testLines[20] = "\0"; - - - // calc cumulative byte counts for each line - to check TextFile.Size() - - streamsize testLineBytes[21]; - streamsize numBytes = 0; - streamsize numBytesFiltered = 0; - - vector testLinesVector; - - for(int i = 0; i <= 19; i++) { - numBytes += testLines[i].length() + strlen("\n"); - testLineBytes[i] = numBytes; - testLinesVector.push_back(testLines[i]); - int locComment = testLines[i].indexOf("#", 0); - if((locComment != -1) && (locComment != 1)) { - numBytesFiltered += testLines[i].length() + strlen("\n"); - } - } - - numBytesFiltered = numBytes - numBytesFiltered; - - -// ---------------------------------------------------------------------------------- - - cout << "1) Create / Overwrite file " << testFile << " with prefilled vector" << endl; - - try { - Isis::TextFile p(testFile, "overwrite", testLinesVector); // write file - - if(p.Size() != numBytes) { // test file size - cout << " *** Failed Size Test WRITE *** " << endl; - cout << "Calc bytes = " << numBytes << " methodSize = " - << p.Size() << endl; - } - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - -// ---------------------------------------------------------------------------------- - - cout << "2) Read file " << testFile << " into vector" << endl; - - try { - vector linesIn; - - // read entire file, filter comments - Isis::TextFile g(testFile, "input", linesIn); - - int chkVectorSize = 0; // chk num bytes read - for(int i = 0; i < (int) linesIn.size(); i++) { - chkVectorSize += QString(linesIn[i]).length() + strlen("\n"); - } - if(chkVectorSize != numBytesFiltered) { - cout << " *** Failed Size Test Filtered *** " << endl; - cout << "Calc bytes = " << numBytesFiltered << " Vector Size = " - << chkVectorSize << endl; - } - g.Close(); - - linesIn.erase(linesIn.begin(), linesIn.end()); - - // read entire file, do not filter comments - Isis::TextFile g2(testFile, "input", linesIn, 0, false); - - if(g2.Size() != numBytes) { // chk num bytes read - cout << " *** Failed Size Test READ *** " << endl; - cout << "Calc bytes = " << numBytes << " methodSize = " - << g2.Size() << endl; - } - - for(int i = 0; i <= 19; i++) { // compare data read to orig data - if(linesIn[i] != testLines[i]) { - cout << " *** Failed IString Comparison Test *** " << endl; - cout << i - << " Original IString =>" << testLines[i] - << "<= Vector read =>" << linesIn[i] - << "<=" << endl; - } - } - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - -// ---------------------------------------------------------------------------------- - - cout << "3) Create / Overwrite file " << testFile << " with prefilled QString array" << endl; - - try { - // write first four lines - Isis::TextFile p(testFile, "overwrite", testLines, 4); - - if(p.Size() != testLineBytes[4]) { // chk num bytes - cout << " *** Failed Size Test WRITE sense NULL in QString array*** " << endl; - cout << "Calc bytes = " << testLineBytes[4] << " methodSize = " - << p.Size() << endl; - } - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - -// ---------------------------------------------------------------------------------- - - cout << "4) Read file " << testFile << " into QString array" << endl; - - try { - // prefill QString array to nonnull, set last element to null - // the read file call below will not specify howmany lines to read - // so TextFile will stop filling QString array when it encounters a null in output array - - QString linesIn[4] = {" ", " ", " ", ""}; - - Isis::TextFile g(testFile, "input", linesIn, 0, false); // read entire file unfiltered - - for(int i = 0; i <= 2; i++) { // chk orig data against data read - if(linesIn[i] != testLines[i]) { - cout << " *** Failed Compare Test READ sense NULL in QString array*** " << endl; - break; - } - } - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - -// ---------------------------------------------------------------------------------- - - cout << "5) Overwrite file " << testFile << endl; - - try { // open file, will truncate - Isis::TextFile f(testFile, "OverWrite"); - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - -// ---------------------------------------------------------------------------------- - - cout << "6) Overwrite file and write 6 lines $temporary/TextFile.tmp" << endl; - - try { - Isis::TextFile f(testFile, "OverWrite"); // open overwrite - - f.SetNewLine(""); // turn off append new line - f.SetComment(""); // turn off comment character - - f.PutLine("# 0 zero line\n"); // char output - - f.SetNewLine(); // reset default append new line - f.SetComment(); // reset default comment QString - - f.PutLineComment(" 1 first line"); // char output - f.PutLineComment(" 2 second line"); // char output - - f.PutLine(testLines[3]); - // line count - if(f.LineCount() != 4) { - cout << " *** Failed Line Count = 4 *** " << endl; - cout << " methodLineCount = " << f.LineCount() << endl; - } - // byte count - if(f.Size() != testLineBytes[3]) { - cout << " *** Failed Size Test After Line 4 *** " << endl; - cout << "Calc bytes = " << testLineBytes[3] << " methodSize = " - << f.Size() << endl; - } - - f.PutLine(testLines[4]); - - f.PutLine(); // output blank line - - if(f.LineCount() != 6) { // line count - cout << " *** Failed Line Count = 6 *** " << endl; - cout << " methodLineCount = " << f.LineCount() << endl; - } - - f.PutLineComment(); // output blank comment line - - if(f.Size() != testLineBytes[6]) { // byte count - cout << " *** Failed Size Test After Line 7 *** " << endl; - cout << "Calc bytes = " << testLineBytes[6] << " methodSize = " - << f.Size() << endl; - } - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - -// ---------------------------------------------------------------------------------- - - cout << "7) Append 6 lines to file $temporary/TextFile.tmp" << endl; - - try { - Isis::TextFile f(testFile, "Append"); - // append lines 7 & 8 - f.PutLine(testLines[7]); - f.PutLine(testLines[8]); - - if(f.LineCount() != 9) { // line count - cout << " *** Failed Line Count = 9 *** " << endl; - cout << " methodLineCount = " << f.LineCount() << endl; - } - - if(f.Size() != testLineBytes[8]) { // byte count - cout << " *** Failed Size Test After Line 9 *** " << endl; - cout << "Calc bytes = " << testLineBytes[8] << " methodSize = " - << f.Size() << endl; - } - - f.PutLine(testLines[9]); // append line 9 - - if(f.Size() != testLineBytes[9]) { // byte count - cout << " *** Failed Size Test After Line 9 *** " << endl; - cout << "Calc bytes = " << testLineBytes[9] << " methodSize = " - << f.Size() << endl; - } - - for(int i = 10; i <= 12; i++) { // append lines 10 -> 12 - f.PutLine(testLines[i]); - } - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - -// ---------------------------------------------------------------------------------- - - cout << "8) Input (read) file $temporary/TextFile.tmp" << endl; - - try { - Isis::TextFile f(testFile, "Input"); - - QString line; - - for(int i = 0; i <= 12; i++) { // chk each file line against internal array - f.GetLineNoFilter(line); - if(line != testLines[i]) { - cout << " *** Failed Compare Input Array Line: " << i << " *** " << endl; - } - } - - f.Rewind(); // set input ptr back to beginning - f.SetComment(); // set comment chk, default is '#' - - f.GetLine(line); - // first 3 lines are commented - // so should return fourth line - if(line != testLines[4]) { - cout << " *** Failed Ignore comment lines *** " << endl; - cout << "should be: =>" << testLines[4] << "<=" << endl; - cout << "returned is: =>" << line << "<=" << endl; - } - if(f.LineCount() != 13) { // total line count should be 12 - cout << " *** Failed Line Count = 13 *** " << endl; - cout << " methodLineCount = " << f.LineCount() << endl; - } - - if(f.Size() != testLineBytes[12]) { // byte count - cout << " *** Failed Size Test with Lines = 12 *** " << endl; - cout << "Calc bytes = " << testLineBytes[12] << " methodSize = " - << f.Size() << endl; - } - - f.Rewind(); // set input ptr back to beginning - f.SetComment("/*"); // set comment to '/*' - - QString lastLine; - - while(f.GetLine(line)) { // read file's 12 lines - lastLine = line; - } - if(lastLine != testLines[8]) { // line 8 was last non '/*' line read - cout << " *** Failed To see last 4 lines as comments *** " << endl; - } - - f.Rewind(); // set input ptr back to beginning - f.SetComment(); // set comment to default # - f.GetLineNoFilter(line); // should return line 1 - if(line != testLines[0]) { - cout << " *** Failed Read Do Not Skip Comment lines *** " << endl; - } - - f.Rewind(); // reset input ptr to beginning - while(f.GetLine(line)) { // read file's 12 lines - lastLine = line; - } - if(lastLine != testLines[12]) { // line 12 does not begin with '#' - cout << " *** Failed Read to end of file *** " << endl; - } - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - -#if 0 -// Jeff Anderson removed this test. It seems strange that you would want -// to open a file for append and then rewind it. This test used to pass -// but didn't when we went to a newer operating system. Again saying -// you want to open append and then rewind is lame. -// ---------------------------------------------------------------------------------- - - cout << "9) Replace Lines and Verify Replacement in $temporary/TextFile.tmp" << endl; - - - try { - Isis::TextFile f(testFile, "Append"); - - // although opened append, - f.Rewind(); // can set ptr to beginning - - for(int i = 1; i <= 3; i++) { - f.PutLine(testLines[i+12]); // replace lines 1 to 3 - } - - f.Rewind(); // set ptr back to begining - - QString(line); - // re-read file to line 3 - for(int i = 1; i <= 3; i++) { // to chk replacement - f.GetLineNoFilter(line); - if(line != testLines[i+12]) { - cout << " *** Failed Read Replaced line: " << i << " *** " << endl; - } - } - - f.Rewind(); // set ptr back to begining - - // replace even lines - for(int i = 1; i <= 6; i++) { - f.GetLineNoFilter(); // moves ptr to next line - f.PutLine(testLines[16]); // replaces line - } - - f.Rewind(); // set ptr back to begining - - // re-read file to line 2 - for(int i = 1; i <= 2; i++) { - f.GetLineNoFilter(line); - } // chk line 2 was replaced - if(line != testLines[16]) { - cout << " *** Failed Read Replaced lines *** " << endl; - } - } - catch(Isis::IException &e) { - e.print(); - } - cout << endl; - - -// ---------------------------------------------------------------------------------- -#endif - - cout << "10) Trigger Error messages" << endl; - - cout << " a) Try to open non-existent file" << endl; - - testFile = "$temporary/NoSuchDir/TextFile.tmp"; - - try { - Isis::TextFile f(testFile, "Input"); - } - catch(Isis::IException &e) { - ReportError(e.toString()); - } - cout << endl; - - - cout << " b) Try open as output to pre-existing file" << endl; - - testFile = "$temporary/TextFile.tmp"; - - try { - Isis::TextFile f(testFile, "Output"); - } - catch(Isis::IException &e) { - ReportError(e.toString()); - } - cout << endl; - - - cout << " c) Open file with bad open mode" << endl; - - try { - Isis::TextFile fxText(testFile, "xxxInputxxx"); - } - catch(Isis::IException &e) { - ReportError(e.toString()); - } - cout << endl; - - - cout << " d) Try to write to Input - Read Only file" << endl; - - try { - Isis::TextFile f(testFile, "Input"); - f.PutLine("Line 1"); - } - catch(Isis::IException &e) { - ReportError(e.toString()); - } - cout << endl; - - - cout << " e) Try to Write to a closed file" << endl; - - try { - Isis::TextFile f(testFile, "append"); - f.Close(); - f.PutLine("Line 1"); - } - catch(Isis::IException &e) { - ReportError(e.toString()); - } - cout << endl; - - - cout << " f) Try to Read from a closed file" << endl; - - try { - Isis::TextFile f(testFile, "input"); - f.Close(); - f.GetLine(); - } - catch(Isis::IException &e) { - ReportError(e.toString()); - } - cout << endl; - - // create file that doesn't end in a newline and then test GetLine - FILE *fp; - FileName testFileName(testFile); - fp = fopen(testFileName.expanded().toLatin1().data(), "w"); - fprintf(fp, "this file has no newline chars in it!"); //???SEG FAULT HERE!!!!!!! - fclose(fp); - TextFile tf; - tf.Open(testFile); - - QString fileContents = ""; - QString line = ""; - while(tf.GetLine(line, true)) { - fileContents += line; - line = ""; - } - - // this is the real test - line shouldn't be wiped even though tf.GetLine's - // call to getline returned false. - fileContents += line; - - QString passed = "Failed"; - if(fileContents != "") - passed = "Passed"; - - cout << "testing GetLine for files that do not end in a newline: " << passed << "\n\n"; - cout << fileContents << "\n\n"; - - -// ---------------------------------------------------------------------------------- - - cout << "11) Remove temp file -> " << testFile << " <-\n" << endl; - - if(std::remove(testFileName.expanded().toLatin1().data())) { // cleanup tmp file - cout << "*** Failed to remove tmp file: " << testFile << endl; - } -} - -/** - * Reports error messages from Isis:iException without full paths of filenames - * @param err Error QString of iException - * @author Jeannie Walldren - * @internal - * @history 2011-08-05 Jeannie Backer - Copied from Cube class. - */ -void ReportError(QString err) { - cout << err.replace(QRegExp("\\[[^\\]*\\]"), "[]") << endl; -} - From 1958af6fef249501584f50eb2bde05e7432bc769 Mon Sep 17 00:00:00 2001 From: Stuart Sides Date: Mon, 14 Jun 2021 08:12:41 -0700 Subject: [PATCH 23/95] Add Blob to core from base (#4525) * Fixed tests * Remove Blob from base --- isis/src/base/objs/Blob/Makefile | 7 ------- isis/src/core/CMakeLists.txt | 1 + .../{base/objs/Blob => core/include}/Blob.h | 0 .../src/{base/objs/Blob => core/src}/Blob.cpp | 0 .../tests/unitTests}/Blob/Blob.truth | 0 .../tests/unitTests}/Blob/unitTest.cpp | 0 isis/src/core/tests/unitTests/CMakeLists.txt | 5 +++-- isis/tests/FunctionalTestsApolloremrx.cpp | 4 ++-- isis/tests/FunctionalTestsHidtmgen.cpp | 20 +++++++++---------- isis/tests/FunctionalTestsHrsc2isis.cpp | 2 +- isis/tests/FunctionalTestsSegment.cpp | 2 +- isis/tests/FunctionalTestsShadow.cpp | 2 +- isis/tests/FunctionalTestsSumspice.cpp | 2 +- 13 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 isis/src/base/objs/Blob/Makefile rename isis/src/{base/objs/Blob => core/include}/Blob.h (100%) rename isis/src/{base/objs/Blob => core/src}/Blob.cpp (100%) rename isis/src/{base/objs => core/tests/unitTests}/Blob/Blob.truth (100%) rename isis/src/{base/objs => core/tests/unitTests}/Blob/unitTest.cpp (100%) diff --git a/isis/src/base/objs/Blob/Makefile b/isis/src/base/objs/Blob/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/base/objs/Blob/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 9072aa8add..61a985551c 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -16,6 +16,7 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED True) set(Pvl_source_files ${PROJECT_SOURCE_DIR}/src/ArraySubscriptNotInRange.cpp + ${PROJECT_SOURCE_DIR}/src/Blob.cpp ${PROJECT_SOURCE_DIR}/src/FileCreate.cpp ${PROJECT_SOURCE_DIR}/src/FileName.cpp ${PROJECT_SOURCE_DIR}/src/FileOpen.cpp diff --git a/isis/src/base/objs/Blob/Blob.h b/isis/src/core/include/Blob.h similarity index 100% rename from isis/src/base/objs/Blob/Blob.h rename to isis/src/core/include/Blob.h diff --git a/isis/src/base/objs/Blob/Blob.cpp b/isis/src/core/src/Blob.cpp similarity index 100% rename from isis/src/base/objs/Blob/Blob.cpp rename to isis/src/core/src/Blob.cpp diff --git a/isis/src/base/objs/Blob/Blob.truth b/isis/src/core/tests/unitTests/Blob/Blob.truth similarity index 100% rename from isis/src/base/objs/Blob/Blob.truth rename to isis/src/core/tests/unitTests/Blob/Blob.truth diff --git a/isis/src/base/objs/Blob/unitTest.cpp b/isis/src/core/tests/unitTests/Blob/unitTest.cpp similarity index 100% rename from isis/src/base/objs/Blob/unitTest.cpp rename to isis/src/core/tests/unitTests/Blob/unitTest.cpp diff --git a/isis/src/core/tests/unitTests/CMakeLists.txt b/isis/src/core/tests/unitTests/CMakeLists.txt index 68d12d5b9e..42c2021277 100644 --- a/isis/src/core/tests/unitTests/CMakeLists.txt +++ b/isis/src/core/tests/unitTests/CMakeLists.txt @@ -1,5 +1,6 @@ # List of classes with old ISIS unitTests -set(unitTestClasses "FileName" +set(unitTestClasses "Blob" + "FileName" "IException" "IString" "Message" @@ -35,4 +36,4 @@ foreach (class ${unitTestClasses}) -DCODE_ROOT=${PROJECT_SOURCE_DIR} -P ${testScript}) set_tests_properties(${testName} PROPERTIES LABELS "unit;core") -endforeach() \ No newline at end of file +endforeach() diff --git a/isis/tests/FunctionalTestsApolloremrx.cpp b/isis/tests/FunctionalTestsApolloremrx.cpp index 0e4988ee96..394ccbde99 100644 --- a/isis/tests/FunctionalTestsApolloremrx.cpp +++ b/isis/tests/FunctionalTestsApolloremrx.cpp @@ -117,7 +117,7 @@ TEST_F(ApolloCube, FunctionalTestApolloremrxRemovedError) { FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("appears to already have reseaus removed.")); + EXPECT_THAT(e.what(), HasSubstr("appears to already have reseaus removed")); } } @@ -135,7 +135,7 @@ TEST_F(ApolloCube, FunctionalTestApolloremrxSpacecraftError) { FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("This application is for use with Apollo spacecrafts only.")); + EXPECT_THAT(e.what(), HasSubstr("This application is for use with Apollo spacecrafts only")); } } diff --git a/isis/tests/FunctionalTestsHidtmgen.cpp b/isis/tests/FunctionalTestsHidtmgen.cpp index cce0661ad0..467a50e472 100644 --- a/isis/tests/FunctionalTestsHidtmgen.cpp +++ b/isis/tests/FunctionalTestsHidtmgen.cpp @@ -326,7 +326,7 @@ TEST(Hidtmgen, HidtmgenTestErrorEmptyOrthoFromList){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("File [data/hidtmgen/error/orthoInputListEmpty.txt] contains no data.")); + EXPECT_THAT(e.what(), HasSubstr("File [data/hidtmgen/error/orthoInputListEmpty.txt] contains no data")); } } @@ -347,7 +347,7 @@ TEST(Hidtmgen, HidtmgenTestErrorInvalidDtm){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("Input cube [data/hidtmgen/ortho/ESP_042252_1930_3-BAND_COLOR_2m_o_cropped.cub] does not appear to be a DTM.")); + EXPECT_THAT(e.what(), HasSubstr("Input cube [data/hidtmgen/ortho/ESP_042252_1930_3-BAND_COLOR_2m_o_cropped.cub] does not appear to be a DTM")); } } @@ -366,7 +366,7 @@ TEST(Hidtmgen, HidtmgenTestErrorNoInput){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("User must supply DTM or ORTHOFROMLIST or both.")); + EXPECT_THAT(e.what(), HasSubstr("User must supply DTM or ORTHOFROMLIST or both")); } } @@ -386,7 +386,7 @@ TEST(Hidtmgen, HidtmgenTestErrorDtmInvalidProjection){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("The projection type [SINUSOIDAL] is not supported.")); + EXPECT_THAT(e.what(), HasSubstr("The projection type [SINUSOIDAL] is not supported")); } } @@ -406,7 +406,7 @@ TEST(Hidtmgen, HidtmgenTestErrorInputSeqMismatch){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("Output sequence number list must correspond to the input ortho list.")); + EXPECT_THAT(e.what(), HasSubstr("Output sequence number list must correspond to the input ortho list")); } } @@ -431,7 +431,7 @@ TEST(Hidtmgen, HidtmgenTestErrorInputOutputMismatch){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("Output ortho list and product id list must correspond to the input ortho list.")); + EXPECT_THAT(e.what(), HasSubstr("Output ortho list and product id list must correspond to the input ortho list")); } } @@ -452,7 +452,7 @@ TEST(Hidtmgen, HidtmgenTestErrorInvalidInstitution){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("PRODUCING_INSTITUTION value [USGS] in the PARAMSPVL file must be a single character.")); + EXPECT_THAT(e.what(), HasSubstr("PRODUCING_INSTITUTION value [USGS] in the PARAMSPVL file must be a single character")); } } @@ -472,7 +472,7 @@ TEST(Hidtmgen, HidtmgenTestErrorInvalidVersionId){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("Version number [-4.0] is invalid.")); + EXPECT_THAT(e.what(), HasSubstr("Version number [-4.0] is invalid")); } } @@ -493,7 +493,7 @@ TEST(Hidtmgen, HidtmgenTestErrorDtmInvalidBandSize){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("Input cube [data/hidtmgen/dtm/DTM_2Bands_cropped.cub] does not appear to be a DTM.")); + EXPECT_THAT(e.what(), HasSubstr("Input cube [data/hidtmgen/dtm/DTM_2Bands_cropped.cub] does not appear to be a DTM")); } } @@ -514,7 +514,7 @@ TEST(Hidtmgen, HidtmgenTestErrorOrthoInvalidBandSize){ FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("The file [data/hidtmgen/ortho/2BandImage.cub] found in the ORTHOFROMLIST is not a valid orthorectified image. Band count must be 1 (RED) or 3 (color).")); + EXPECT_THAT(e.what(), HasSubstr("The file [data/hidtmgen/ortho/2BandImage.cub] found in the ORTHOFROMLIST is not a valid orthorectified image. Band count must be 1 (RED) or 3 (color)")); } } diff --git a/isis/tests/FunctionalTestsHrsc2isis.cpp b/isis/tests/FunctionalTestsHrsc2isis.cpp index 6a91b94e29..04858d53bb 100644 --- a/isis/tests/FunctionalTestsHrsc2isis.cpp +++ b/isis/tests/FunctionalTestsHrsc2isis.cpp @@ -158,7 +158,7 @@ TEST(Hrsc2isis, Hrsc2IsisTestProjection) { FAIL() << "Should throw an exception" << std::endl; } catch (IException &e){ - EXPECT_THAT(e.what(), HasSubstr("has keyword [PROCESSING_LEVEL_ID = 4] and can not be read by this program.")); + EXPECT_THAT(e.what(), HasSubstr("has keyword [PROCESSING_LEVEL_ID = 4] and can not be read by this program")); } } diff --git a/isis/tests/FunctionalTestsSegment.cpp b/isis/tests/FunctionalTestsSegment.cpp index aac96a6f05..86a42c6024 100644 --- a/isis/tests/FunctionalTestsSegment.cpp +++ b/isis/tests/FunctionalTestsSegment.cpp @@ -162,6 +162,6 @@ TEST_F(LargeCube, FunctionalTestSegmentNolError) { FAIL() << "Should throw an exception" << std::endl; } catch (IException &e) { - EXPECT_THAT(e.what(), HasSubstr("The Line Overlap (OVERLAP) must be less than the Number of Lines (LN).")); + EXPECT_THAT(e.what(), HasSubstr("The Line Overlap (OVERLAP) must be less than the Number of Lines (LN)")); } } diff --git a/isis/tests/FunctionalTestsShadow.cpp b/isis/tests/FunctionalTestsShadow.cpp index 3efb78c579..9c7ce62383 100644 --- a/isis/tests/FunctionalTestsShadow.cpp +++ b/isis/tests/FunctionalTestsShadow.cpp @@ -249,7 +249,7 @@ TEST_F(DemCube, FunctionalTestShadowErrors) { shadow(demCube, shadowUi); FAIL() << "Shouldn't have been able to generate a shadow file" << std::endl; } catch(IException &e) { - std::string expectedStr = "the shadowing algorithm must be a DEM which stores radii; The input DEM contains zero or negative radii."; + std::string expectedStr = "the shadowing algorithm must be a DEM which stores radii; The input DEM contains zero or negative radii"; EXPECT_THAT(e.what(), testing::HasSubstr(expectedStr)); } diff --git a/isis/tests/FunctionalTestsSumspice.cpp b/isis/tests/FunctionalTestsSumspice.cpp index 6286f4bd91..6e929a57f8 100644 --- a/isis/tests/FunctionalTestsSumspice.cpp +++ b/isis/tests/FunctionalTestsSumspice.cpp @@ -233,6 +233,6 @@ TEST(Sumspice, FunctionalTestSumspiceNoSumError) { } catch (IException &e){ - EXPECT_THAT(e.what(), HasSubstr("User must provide either a sum file or a sum file list.")); + EXPECT_THAT(e.what(), HasSubstr("User must provide either a sum file or a sum file list")); } } From f5002a09e80345ac24300326166f39d8cb41f768 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 17 Jun 2021 11:05:24 -0700 Subject: [PATCH 24/95] Pvl core Docs (#4536) * Small doc string changes * Fixed more doc strings and updated RTD configs * Added core docs * Removed path setup from config * Added subprocess import * Added back os import * Added breathe to env file * Maybe fix? * Added doxyfile * Trying doxygen change --- isis/src/core/include/Blob.h | 2 ++ isis/src/core/include/PvlObject.h | 8 ++--- isis/src/core/src/Blob.cpp | 50 +++++++++++++++---------------- isis/src/core/src/PvlObject.cpp | 12 ++++---- 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/isis/src/core/include/Blob.h b/isis/src/core/include/Blob.h index 1abf7828e4..9b31c085be 100644 --- a/isis/src/core/include/Blob.h +++ b/isis/src/core/include/Blob.h @@ -17,6 +17,8 @@ namespace Isis { bool IsBlob(PvlObject &obj); class Pvl; /** + * @brief Interface for pvl cube data reading and write. + * * @author ????-??-?? Unknown * * @internal diff --git a/isis/src/core/include/PvlObject.h b/isis/src/core/include/PvlObject.h index 6e76ad7a56..bdcc5f2d5b 100644 --- a/isis/src/core/include/PvlObject.h +++ b/isis/src/core/include/PvlObject.h @@ -20,10 +20,10 @@ template class QList; namespace Isis { /** - * @brief Contains Pvl Groups and Pvl Objects. + * @brief Container for PvlGroup and PvlObject objects. * - * Contains Pvl groups and objects. Organizes text on output to be indented - * correctly. + * Container for PvlGroup and PvlObject objects. Organizes text on output to + * be indented correctly. * * @ingroup Parsing * @@ -327,7 +327,7 @@ namespace Isis { /** - * Compares two PvlObjects. Returns a boolean value based on the + * Compares one PvlObject to another. Returns a boolean value based on the * StringEqual() method. * @param object The PvlObject to compare. * @return True if they are equal, false if not. diff --git a/isis/src/core/src/Blob.cpp b/isis/src/core/src/Blob.cpp index 42791b03d9..8f1c99098d 100644 --- a/isis/src/core/src/Blob.cpp +++ b/isis/src/core/src/Blob.cpp @@ -20,7 +20,7 @@ find files of those names at the top level of this repository. **/ using namespace std; namespace Isis { /** - * Constructs a Blob object using a name and type. + * Constructs an Blob object using a name and type. * * @param name The blob name * @param type The blob type @@ -58,7 +58,7 @@ namespace Isis { } /** - * This copies the blob object. + * This copies the Blob object. * * @param other Blob to be copied */ @@ -83,7 +83,7 @@ namespace Isis { } /** - * This makes the two blob objects exactly the same (copies the blob) + * This makes the two Blob objects exactly the same (copies the Blob) * * @param other Blob to be copied * @@ -119,7 +119,7 @@ namespace Isis { /** * Accessor method that returns a string containing the Blob type. * - * @return @b string Type of blob. + * @return @b string Type of Blob. */ QString Blob::Type() const { return p_type; @@ -128,16 +128,16 @@ namespace Isis { /** * Accessor method that returns a string containing the Blob name. * - * @return @b string The name of the blob. + * @return @b string The name of the Blob. */ QString Blob::Name() const { return p_blobName; } /** - * Accessor method that returns the number of bytes in the blob data. + * Accessor method that returns the number of bytes in the Blob data. * - * @return @b int Number of bytes in the blob data. + * @return @b int Number of bytes in the Blob data. */ int Blob::Size() const { return p_nbytes; @@ -146,7 +146,7 @@ namespace Isis { /** * Accessor method that returns a PvlObject containing the Blob label. * - * @return @b PvlObject The label of the blob. + * @return @b PvlObject The label of the Blob. */ PvlObject &Blob::Label() { return p_blobPvl; @@ -156,13 +156,13 @@ namespace Isis { * This method searches the given Pvl for the Blob by the Blob's type and * name. If found, the start byte, number of bytes are read from the Pvl. * Also, if a keyword label pointer is found, the filename for the detached - * blob is stored and the pointer is removed from the blob pvl. + * Blob is stored and the pointer is removed from the Blob pvl. * * @param pvl The Pvl to be searched - * @param keywords A list of keyword, value pairs to match inside the blob's - * PVL object. Only if all the keyword match is the blob processed. This is used - * when there are multiple blobs with the same name, but different keywords that - * define the exact blob (see Stretch with a band number) + * @param keywords A list of keyword, value pairs to match inside the Blob's + * PVL object. Only if all the keyword match is the Blob processed. This is used + * when there are multiple Blobs with the same name, but different keywords that + * define the exact Blob (see Stretch with a band number) */ void Blob::Find(const Pvl &pvl, const std::vector keywords) { bool found = false; @@ -306,7 +306,7 @@ namespace Isis { * This method reads the Blob data from an open input file stream. * * @param pvl A Pvl containing the label information. - * @param istm The input file stream containing the blob data to be read. + * @param istm The input file stream containing the Blob data to be read. * * @throws iException::Io - Unable to open file */ @@ -370,12 +370,12 @@ namespace Isis { /** - * Set the data stored in the BLOB. + * Set the data stored in the Blob. * * This function will copy the data buffer, if you want to avoid that use * takeData which will take ownership of the buffer. * - * @param buffer The buffer of data. The BLOB does not take ownership of this, + * @param buffer The buffer of data. The Blob does not take ownership of this, * the caller is still responsible for cleaning it up. * @param nbytes The amount of data in the buffer */ @@ -387,12 +387,12 @@ namespace Isis { /** - * Set the data stored in the BLOB without copying it. + * Set the data stored in the Blob without copying it. * - * This function takes ownership of the data buffer and will delete is when the BLOB + * This function takes ownership of the data buffer and will delete is when the Blob * is cleaned up. * - * @param buffer The buffer of data. The BLOB takes ownership of this. + * @param buffer The buffer of data. The Blob takes ownership of this. * @param nbytes The amount of data in the buffer */ void Blob::takeData(char *buffer, int nbytes) { @@ -406,7 +406,7 @@ namespace Isis { } /** - * Write the blob data out to a file. + * Write the Blob data out to a file. * * @param file The filename to write to. * @@ -457,7 +457,7 @@ namespace Isis { } /** - * Write the blob data out to a Pvl object. + * Write the Blob data out to a Pvl object. * @param pvl The pvl object to update * @param stm stream to write data to * @param detachedFileName If the stream is detached from the labels give @@ -468,7 +468,7 @@ namespace Isis { // Handle 64-bit I/O WriteInit(); - // Find out where they wanted to write the blob + // Find out where they wanted to write the Blob streampos sbyte = stm.tellp(); sbyte += 1; @@ -555,9 +555,9 @@ namespace Isis { } /** - * Writes blob data to a stream + * Writes Blob data to a stream * - * @param stream Output steam blob data will be written to + * @param stream Output steam Blob data will be written to * * @throws IException::Io - Error writing data to stream */ @@ -575,7 +575,7 @@ namespace Isis { * * @param obj Pvl object * - * @return bool Returns true if the object is a blob, and false if it is not + * @return bool Returns true if the object is a Blob, and false if it is not */ bool IsBlob(PvlObject &obj) { if (obj.isNamed("TABLE")) return true; diff --git a/isis/src/core/src/PvlObject.cpp b/isis/src/core/src/PvlObject.cpp index 39b92c174f..9f3ea875d9 100644 --- a/isis/src/core/src/PvlObject.cpp +++ b/isis/src/core/src/PvlObject.cpp @@ -152,9 +152,9 @@ namespace Isis { /** * Finds a keyword in the current PvlObject, or deeper inside - * other PvlObjects and Pvlgroups within this one. Note: This - * member has the same name as the PvlContainer and hides those - * implementations, but with the using statement the parents + * child objects, like PvlObject and PvlGroup contained within the PvlObject + * being searched. Note: This member has the same name as the PvlContainer + * and hides those implementations, but with the using statement the parents * FindKeyword members ar made visible. Note: If more than one * occurance of a Keyword appears below this Object no * guarantee is made as to which one is returned. @@ -215,9 +215,9 @@ namespace Isis { /** * See if a keyword is in the current PvlObject, or deeper inside - * other PvlObjects and Pvlgroups within this one. Note: This - * member has the same name as the PvlContainer and hides those - * implementations, but with the using statement the parents + * child objects, like PvlObject and PvlGroup contained within the PvlObject + * being searched. Note: This member has the same name as the PvlContainer + * and hides those implementations, but with the using statement the parents * FindKeyword members ar made visible. * * @param kname The name of the keyword to look for. From fefc9f9e25a7df2e1a8e0f5fe34e9cf689802c87 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Sun, 5 Sep 2021 17:24:16 -0700 Subject: [PATCH 25/95] Blob Swig Wrapper (#4613) * Moved wrapper under one package * Add pvl construction from reading a string, give access to blob internals * Updated meta.yaml to build isisio rather than isispvl --- core_recipe/meta.yaml | 4 +-- isis/CMakeLists.txt | 1 + isis/src/core/swig/isisblob.i | 45 ++++++++++++++++++++++++ isis/src/core/swig/isisio.i | 45 ++++++++++++++++++++++++ isis/src/core/swig/isispvl.i | 42 +++------------------- isis/src/core/swig/python/CMakeLists.txt | 26 +++++++------- isis/src/core/swig/python/setup.py.in | 6 ++-- 7 files changed, 114 insertions(+), 55 deletions(-) create mode 100644 isis/src/core/swig/isisblob.i create mode 100644 isis/src/core/swig/isisio.i diff --git a/core_recipe/meta.yaml b/core_recipe/meta.yaml index 2e0ce7dd83..9863741550 100644 --- a/core_recipe/meta.yaml +++ b/core_recipe/meta.yaml @@ -26,7 +26,7 @@ {% set build_number = "0" %} package: - name: isispvl + name: isisio version: {{ version }} source: @@ -57,7 +57,7 @@ requirements: tests: imports: - - isispvl + - isisio commands: - test -e $PREFIX/lib/libcore${SHLIB_EXT} - test -e $PREFIX/include/isis/Pvl.h diff --git a/isis/CMakeLists.txt b/isis/CMakeLists.txt index 4483b67d60..d42a757964 100644 --- a/isis/CMakeLists.txt +++ b/isis/CMakeLists.txt @@ -126,6 +126,7 @@ message("\tBUILD TESTS: ${buildTests}") message("\tBUILD CORE: ${buildCore}") message("\tBUILD MISSIONS: ${buildMissions}") message("\tBUILD CORE TESTS: ${BUILD_CORE_TESTS}") +message("\tBUILD SWIG: ${ISIS_BUILD_SWIG}") message("\tJP2K SUPPORT: ${JP2KFLAG}") message("\tPYTHON BINDINGS: ${pybindings}") message("\tISISDATA: ${isisData}") diff --git a/isis/src/core/swig/isisblob.i b/isis/src/core/swig/isisblob.i new file mode 100644 index 0000000000..451b32ef64 --- /dev/null +++ b/isis/src/core/swig/isisblob.i @@ -0,0 +1,45 @@ +%module isisblob +%{ + #include "Blob.h" +%} + +%include "Blob.h" +%nodefaultdtor Isis::Blob; + +%extend Isis::Blob { + + Blob(const char* name, const char* type) { + QString qname(name); + QString qtype(type); + Isis::Blob *blob = new Isis::Blob(qname, qtype); + return blob; + } + + Blob(const char* name, const char* type, const char* file) { + QString qname(name); + QString qtype(type); + QString qfile(file); + Isis::Blob *blob = new Isis::Blob(qname, qtype, file); + return blob; + } + + void Write(const char *file) { + QString qfile(file); + + $self->Write(file); + } + + char * getStringBuffer() { + int bufferSize = $self->Size(); + char * buffer = $self->getBuffer(); + std::ostringstream os; + for (int i = 0; i < bufferSize; i++) os << buffer[i]; + os << '\0'; + + std::string str = os.str(); + char * cstr = new char [str.length()+1]; + std::strcpy (cstr, str.c_str()); + return cstr; + } + +} diff --git a/isis/src/core/swig/isisio.i b/isis/src/core/swig/isisio.i new file mode 100644 index 0000000000..279dcc2662 --- /dev/null +++ b/isis/src/core/swig/isisio.i @@ -0,0 +1,45 @@ +%module isisio + +%{ + #include + #include +%} + +%include std_string.i +%include std_vector.i +%include exception.i + +%include "pvlKeyword.i" +%include "PvlContainer.h" +%include "pvlGroup.i" + +%include "pvlObject.i" +%nodefaultdtor Isis::PvlObject; + + +class QString +{ +public: + static QString fromStdString(const std::string &s); + std::string toStdString() const; + QString(const char* str); + ~QString(); + + int size() const; + int count() const; + int length() const; + bool isEmpty() const; +}; + +%exception{ + try { + $action + } catch (std::exception const& e) { + SWIG_exception(SWIG_RuntimeError, (std::string("std::exception: ") + e.what()).c_str()); + } catch (...) { + SWIG_exception(SWIG_UnknownError, "Unknown error"); + } +} + +%include "isisblob.i" +%include "isispvl.i" diff --git a/isis/src/core/swig/isispvl.i b/isis/src/core/swig/isispvl.i index 3495220fff..1be639214c 100644 --- a/isis/src/core/swig/isispvl.i +++ b/isis/src/core/swig/isispvl.i @@ -1,21 +1,8 @@ %module isispvl %{ - #include - #include #include "Pvl.h" %} -%include std_string.i -%include std_vector.i -%include exception.i - -%include "pvlKeyword.i" -%include "PvlContainer.h" -%include "pvlGroup.i" - -%include "pvlObject.i" -%nodefaultdtor Isis::PvlObject; - %include "Pvl.h" %nodefaultdtor Isis::Pvl; @@ -35,6 +22,11 @@ return pvl; } + void readString(const char *pvlString) { + std::istringstream in(pvlString); + in >> *$self; + } + void read(const char* file) { QString qfile(file); $self->read(qfile); @@ -45,27 +37,3 @@ $self->write(qfile); } } - -class QString -{ -public: - static QString fromStdString(const std::string &s); - std::string toStdString() const; - QString(const char* str); - ~QString(); - - int size() const; - int count() const; - int length() const; - bool isEmpty() const; -}; - -%exception{ - try { - $action - } catch (std::exception const& e) { - SWIG_exception(SWIG_RuntimeError, (std::string("std::exception: ") + e.what()).c_str()); - } catch (...) { - SWIG_exception(SWIG_UnknownError, "Unknown error"); - } -} diff --git a/isis/src/core/swig/python/CMakeLists.txt b/isis/src/core/swig/python/CMakeLists.txt index 1e6d4493a0..87c22edc1d 100644 --- a/isis/src/core/swig/python/CMakeLists.txt +++ b/isis/src/core/swig/python/CMakeLists.txt @@ -3,32 +3,32 @@ include(FindPythonAnaconda.cmake) include_directories(${PYTHON_INCLUDE_DIR}) set(CMAKE_SWIG_FLAGS "") -set(CMAKE_SWIG_OUTDIR isispvl) -set_source_files_properties(../isispvl.i +set(CMAKE_SWIG_OUTDIR isisio) +set_source_files_properties(../isisio.i PROPERTIES CPLUSPLUS ON SWIG_FLAGS "-py3") #Find dependencies -find_path(PVL_INCLUDE_DIR NAMES Pvl.h - PATH_SUFFIXES include - PATHS ${PROJECT_SOURCE_DIR}/) -message("-- Found PVL Include: ${PVL_INCLUDE_DIR}") -include_directories(${PVL_INCLUDE_DIR}) +find_path(INCLUDE_DIR NAMES Pvl.h + PATH_SUFFIXES include + PATHS ${PROJECT_SOURCE_DIR}/) +message("-- Found Include: ${INCLUDE_DIR}") +include_directories(${INCLUDE_DIR}) # Add and link -swig_add_library(isispvl +swig_add_library(isisio LANGUAGE python - SOURCES ../isispvl.i) + SOURCES ../isisio.i) -set_target_properties(_isispvl PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SWIG_OUTDIR}) +set_target_properties(_isisio PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SWIG_OUTDIR}) SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") if (APPLE) - set_target_properties(_isispvl PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + set_target_properties(_isisio PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") # On OSX, do not link python - this causes segfaults - swig_link_libraries(isispvl core) + swig_link_libraries(isisio core) else() - swig_link_libraries(isispvl core ${PYTHON_LIBRARY}) + swig_link_libraries(isisio core ${PYTHON_LIBRARY}) endif() # Build out a standard directory structure diff --git a/isis/src/core/swig/python/setup.py.in b/isis/src/core/swig/python/setup.py.in index dd500bd710..d94c3c6ca2 100644 --- a/isis/src/core/swig/python/setup.py.in +++ b/isis/src/core/swig/python/setup.py.in @@ -2,10 +2,10 @@ import setuptools if __name__ == '__main__': setuptools.setup( - name='isispvl', + name='isisio', version='0.0.1', - packages=['isispvl'], - package_data={'':['_isispvl.so']}, + packages=['isisio'], + package_data={'':['_isisio.so']}, zip_safe=False, # Some OSes can not dynamically load an so from an egg (zipfile) license='UnLicense', author='arsanders/acpaquette', From da239b374d886cb79864fd4d0befdfbfd76028a2 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Fri, 7 Jul 2023 15:16:29 -0700 Subject: [PATCH 26/95] Post rebase fixes --- isis/src/core/src/PvlKeyword.cpp | 5 ----- isis/src/core/tests/unitTests/FileName/FileName.truth | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index b37ce09b44..0fa0aca35b 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -222,11 +222,6 @@ namespace Isis { m_units->resize(m_values.size()); } -<<<<<<< HEAD:isis/src/base/objs/PvlKeyword/PvlKeyword.cpp -======= - //ASSERT(i < (int) m_units->size()); - ->>>>>>> fc0563741 (Initial move to core):isis/src/core/PvlKeyword/PvlKeyword.cpp (*m_units)[i] = units; } else { diff --git a/isis/src/core/tests/unitTests/FileName/FileName.truth b/isis/src/core/tests/unitTests/FileName/FileName.truth index 113a89ebc4..6d05fb2bc0 100644 --- a/isis/src/core/tests/unitTests/FileName/FileName.truth +++ b/isis/src/core/tests/unitTests/FileName/FileName.truth @@ -593,7 +593,7 @@ Testing Numerical-Only Versioning New version changed FileName: 1 Testing Versioning Methods [??tttt] - Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a numerial version matching [??tttt] in [.]. + Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a numerical version matching [??tttt] in [.]. New Version Name: 01tttt New Version Orig: ./01tttt New Version Orig Path: . @@ -610,7 +610,7 @@ Testing Numerical-Only Versioning New version changed FileName: 1 Testing Versioning Methods [junk?] - Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a numerial version matching [junk?] in [.]. + Highest Version Name: Highest Version Failed: **ERROR** No existing files found with a numerical version matching [junk?] in [.]. New Version Name: junk1 New Version Orig: ./junk1 New Version Orig Path: . From ef3612c5eb79df1b8dc861e4d5bc5d2e31464bb4 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Mon, 17 Jul 2023 15:33:03 -0700 Subject: [PATCH 27/95] Fixed app logging for all call able apps --- isis/src/base/apps/getsn/main.cpp | 8 ++++---- isis/src/core/CMakeLists.txt | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/isis/src/base/apps/getsn/main.cpp b/isis/src/base/apps/getsn/main.cpp index ce359e4edb..90d6dea781 100644 --- a/isis/src/base/apps/getsn/main.cpp +++ b/isis/src/base/apps/getsn/main.cpp @@ -21,14 +21,14 @@ using namespace std; void IsisMain() { // Set Preferences to always turn off Terminal Output - PvlGroup &grp = Isis::Preference::Preferences().findGroup("SessionLog", Isis::Pvl::Traverse); - grp["TerminalOutput"].setValue("Off"); + // PvlGroup &grp = Isis::Preference::Preferences().findGroup("SessionLog", Isis::Pvl::Traverse); + // grp["TerminalOutput"].setValue("Off"); UserInterface &ui = Application::GetUserInterface(); Pvl appLog; getsn(ui, &appLog); - PvlGroup results = appLog.findGroup("Results"); - SessionLog::TheLog().AddResults(results); + // PvlGroup results = appLog.findGroup("Results"); + // SessionLog::TheLog().AddResults(results); } diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 61a985551c..8132cda92c 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -46,7 +46,8 @@ set(Pvl_source_files ${PROJECT_SOURCE_DIR}/src/ArraySubscriptNotInRange.cpp ${PROJECT_SOURCE_DIR}/src/PvlGroup.cpp ${PROJECT_SOURCE_DIR}/src/PvlKeyword.cpp ${PROJECT_SOURCE_DIR}/src/PvlObject.cpp - ${PROJECT_SOURCE_DIR}/src/PvlSequence.cpp) + ${PROJECT_SOURCE_DIR}/src/PvlSequence.cpp + ${PROJECT_SOURCE_DIR}/src/Table.cpp) # Define a target add_library(core SHARED "${Pvl_source_files}") From 31f084500ab3291897a9be03bf9eb3ddc4cd3768 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Mon, 17 Jul 2023 16:17:44 -0700 Subject: [PATCH 28/95] Moved table reading/writing into core --- isis/src/base/objs/Table/Makefile | 7 ------- isis/src/base/objs/TableField/Makefile | 7 ------- isis/src/base/objs/TableRecord/Makefile | 7 ------- isis/src/core/CMakeLists.txt | 4 +++- isis/src/{base/objs/Table => core/include}/Table.h | 0 .../{base/objs/TableField => core/include}/TableField.h | 0 .../{base/objs/TableRecord => core/include}/TableRecord.h | 0 isis/src/{base/objs/Table => core/src}/Table.cpp | 0 isis/src/{base/objs/TableField => core/src}/TableField.cpp | 0 .../{base/objs/TableRecord => core/src}/TableRecord.cpp | 0 isis/src/core/tests/CMakeLists.txt | 5 +++-- isis/{ => src/core}/tests/TableTests.cpp | 5 ++++- isis/src/core/tests/unitTests/CMakeLists.txt | 4 +++- .../tests/unitTests}/TableField/TableField.truth | 0 .../objs => core/tests/unitTests}/TableField/unitTest.cpp | 0 .../tests/unitTests}/TableRecord/TableRecord.truth | 0 .../objs => core/tests/unitTests}/TableRecord/unitTest.cpp | 0 17 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 isis/src/base/objs/Table/Makefile delete mode 100644 isis/src/base/objs/TableField/Makefile delete mode 100644 isis/src/base/objs/TableRecord/Makefile rename isis/src/{base/objs/Table => core/include}/Table.h (100%) rename isis/src/{base/objs/TableField => core/include}/TableField.h (100%) rename isis/src/{base/objs/TableRecord => core/include}/TableRecord.h (100%) rename isis/src/{base/objs/Table => core/src}/Table.cpp (100%) rename isis/src/{base/objs/TableField => core/src}/TableField.cpp (100%) rename isis/src/{base/objs/TableRecord => core/src}/TableRecord.cpp (100%) rename isis/{ => src/core}/tests/TableTests.cpp (98%) rename isis/src/{base/objs => core/tests/unitTests}/TableField/TableField.truth (100%) rename isis/src/{base/objs => core/tests/unitTests}/TableField/unitTest.cpp (100%) rename isis/src/{base/objs => core/tests/unitTests}/TableRecord/TableRecord.truth (100%) rename isis/src/{base/objs => core/tests/unitTests}/TableRecord/unitTest.cpp (100%) diff --git a/isis/src/base/objs/Table/Makefile b/isis/src/base/objs/Table/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/base/objs/Table/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/base/objs/TableField/Makefile b/isis/src/base/objs/TableField/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/base/objs/TableField/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/base/objs/TableRecord/Makefile b/isis/src/base/objs/TableRecord/Makefile deleted file mode 100644 index f122bc8822..0000000000 --- a/isis/src/base/objs/TableRecord/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.objs -endif \ No newline at end of file diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 8132cda92c..2af0d26e24 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -47,7 +47,9 @@ set(Pvl_source_files ${PROJECT_SOURCE_DIR}/src/ArraySubscriptNotInRange.cpp ${PROJECT_SOURCE_DIR}/src/PvlKeyword.cpp ${PROJECT_SOURCE_DIR}/src/PvlObject.cpp ${PROJECT_SOURCE_DIR}/src/PvlSequence.cpp - ${PROJECT_SOURCE_DIR}/src/Table.cpp) + ${PROJECT_SOURCE_DIR}/src/Table.cpp + ${PROJECT_SOURCE_DIR}/src/TableField.cpp + ${PROJECT_SOURCE_DIR}/src/TableRecord.cpp) # Define a target add_library(core SHARED "${Pvl_source_files}") diff --git a/isis/src/base/objs/Table/Table.h b/isis/src/core/include/Table.h similarity index 100% rename from isis/src/base/objs/Table/Table.h rename to isis/src/core/include/Table.h diff --git a/isis/src/base/objs/TableField/TableField.h b/isis/src/core/include/TableField.h similarity index 100% rename from isis/src/base/objs/TableField/TableField.h rename to isis/src/core/include/TableField.h diff --git a/isis/src/base/objs/TableRecord/TableRecord.h b/isis/src/core/include/TableRecord.h similarity index 100% rename from isis/src/base/objs/TableRecord/TableRecord.h rename to isis/src/core/include/TableRecord.h diff --git a/isis/src/base/objs/Table/Table.cpp b/isis/src/core/src/Table.cpp similarity index 100% rename from isis/src/base/objs/Table/Table.cpp rename to isis/src/core/src/Table.cpp diff --git a/isis/src/base/objs/TableField/TableField.cpp b/isis/src/core/src/TableField.cpp similarity index 100% rename from isis/src/base/objs/TableField/TableField.cpp rename to isis/src/core/src/TableField.cpp diff --git a/isis/src/base/objs/TableRecord/TableRecord.cpp b/isis/src/core/src/TableRecord.cpp similarity index 100% rename from isis/src/base/objs/TableRecord/TableRecord.cpp rename to isis/src/core/src/TableRecord.cpp diff --git a/isis/src/core/tests/CMakeLists.txt b/isis/src/core/tests/CMakeLists.txt index 2b3cb7ce9b..b2aaf04273 100644 --- a/isis/src/core/tests/CMakeLists.txt +++ b/isis/src/core/tests/CMakeLists.txt @@ -6,13 +6,14 @@ include(../cmake/gtest.cmake) include(GoogleTest) set(test_source ${PROJECT_SOURCE_DIR}/tests/ConstantsTests.cpp - ${PROJECT_SOURCE_DIR}/tests/IsisCoreTestMain.cpp) + ${PROJECT_SOURCE_DIR}/tests/IsisCoreTestMain.cpp + ${PROJECT_SOURCE_DIR}/tests/TableTests.cpp) # Link runISISTests with what we want to test and the GTest and pthread library add_executable(runISISCoreTests ${test_source}) -target_link_libraries(runISISCoreTests core gtest Threads::Threads) +target_link_libraries(runISISCoreTests core gtest gmock Threads::Threads) gtest_discover_tests(runISISCoreTests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests) diff --git a/isis/tests/TableTests.cpp b/isis/src/core/tests/TableTests.cpp similarity index 98% rename from isis/tests/TableTests.cpp rename to isis/src/core/tests/TableTests.cpp index ee00d25515..53cbe0bc94 100644 --- a/isis/tests/TableTests.cpp +++ b/isis/src/core/tests/TableTests.cpp @@ -166,7 +166,10 @@ TEST(TableTests, ToFromBlob) { } -TEST_F(TempTestingFiles, TableTestsWriteRead) { +TEST(TableTests, TableTestsWriteRead) { + QTemporaryDir tempDir; + ASSERT_TRUE(tempDir.isValid()); + TableField f1("Column1", TableField::Integer); TableField f2("Column2", TableField::Double); TableField f3("Column3", TableField::Text, 10); diff --git a/isis/src/core/tests/unitTests/CMakeLists.txt b/isis/src/core/tests/unitTests/CMakeLists.txt index 42c2021277..78736b62f2 100644 --- a/isis/src/core/tests/unitTests/CMakeLists.txt +++ b/isis/src/core/tests/unitTests/CMakeLists.txt @@ -11,7 +11,9 @@ set(unitTestClasses "Blob" "PvlFormatPds" "PvlGroup" "PvlKeyword" - "PvlSequence") + "PvlSequence" + "TableField" + "TableRecord") foreach (class ${unitTestClasses}) set(testFile "${CMAKE_CURRENT_SOURCE_DIR}/${class}/unitTest.cpp") diff --git a/isis/src/base/objs/TableField/TableField.truth b/isis/src/core/tests/unitTests/TableField/TableField.truth similarity index 100% rename from isis/src/base/objs/TableField/TableField.truth rename to isis/src/core/tests/unitTests/TableField/TableField.truth diff --git a/isis/src/base/objs/TableField/unitTest.cpp b/isis/src/core/tests/unitTests/TableField/unitTest.cpp similarity index 100% rename from isis/src/base/objs/TableField/unitTest.cpp rename to isis/src/core/tests/unitTests/TableField/unitTest.cpp diff --git a/isis/src/base/objs/TableRecord/TableRecord.truth b/isis/src/core/tests/unitTests/TableRecord/TableRecord.truth similarity index 100% rename from isis/src/base/objs/TableRecord/TableRecord.truth rename to isis/src/core/tests/unitTests/TableRecord/TableRecord.truth diff --git a/isis/src/base/objs/TableRecord/unitTest.cpp b/isis/src/core/tests/unitTests/TableRecord/unitTest.cpp similarity index 100% rename from isis/src/base/objs/TableRecord/unitTest.cpp rename to isis/src/core/tests/unitTests/TableRecord/unitTest.cpp From 774abeb765574f8db514bad6d78f4713dc3c760b Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 20 Jul 2023 14:52:36 -0700 Subject: [PATCH 29/95] Fixed missing license identifiers, and leftover merge conflict from rebase --- .../objs/LabelTranslationManager/unitTest.cpp | 6 + .../base/objs/PvlEditDialog/PvlEditDialog.cpp | 6 + .../base/objs/PvlEditDialog/PvlEditDialog.h | 6 + isis/src/base/objs/PvlEditDialog/unitTest.cpp | 6 + isis/src/base/objs/PvlFlatMap/unitTest.cpp | 6 + .../PvlToPvlTranslationManager/unitTest.cpp | 6 + .../PvlToXmlTranslationManager/unitTest.cpp | 6 + isis/src/base/objs/PvlToken/unitTest.cpp | 6 + isis/src/base/objs/PvlTokenizer/unitTest.cpp | 6 + .../objs/PvlTranslationTable/unitTest.cpp | 6 + isis/src/base/objs/TextFile/unitTest.cpp | 6 + isis/src/core/src/IException.cpp | 30 - isis/{ => src/core}/tests/PvlKeywordTests.cpp | 0 .../tests/unitTests/FileName/unitTest.cpp | 6 + .../tests/unitTests/IException/unitTest.cpp | 6 + .../core/tests/unitTests/IString/unitTest.cpp | 6 + .../core/tests/unitTests/Message/unitTest.cpp | 6 + .../tests/unitTests/Preference/unitTest.cpp | 8 + .../src/core/tests/unitTests/Pvl/unitTest.cpp | 6 + .../tests/unitTests/PvlContainer/unitTest.cpp | 6 + .../tests/unitTests/PvlFormat/unitTest.cpp | 6 + .../tests/unitTests/PvlFormatPds/unitTest.cpp | 6 + .../tests/unitTests/PvlGroup/unitTest.cpp | 6 + .../unitTests/PvlKeyword/PvlKeyword.truth | 632 ------------------ .../tests/unitTests/PvlKeyword/unitTest.cpp | 394 ----------- .../tests/unitTests/PvlSequence/unitTest.cpp | 6 + .../tests/unitTests/SpecialPixel/unitTest.cpp | 6 + 27 files changed, 140 insertions(+), 1056 deletions(-) rename isis/{ => src/core}/tests/PvlKeywordTests.cpp (100%) delete mode 100644 isis/src/core/tests/unitTests/PvlKeyword/PvlKeyword.truth delete mode 100644 isis/src/core/tests/unitTests/PvlKeyword/unitTest.cpp diff --git a/isis/src/base/objs/LabelTranslationManager/unitTest.cpp b/isis/src/base/objs/LabelTranslationManager/unitTest.cpp index b87406c76b..c0279e8adf 100644 --- a/isis/src/base/objs/LabelTranslationManager/unitTest.cpp +++ b/isis/src/base/objs/LabelTranslationManager/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "LabelTranslationManager.h" #include "Preference.h" diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp index 19b4144b1f..9d74c1806f 100644 --- a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp +++ b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include "PvlEditDialog.h" #include diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.h b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.h index 8d5c7a1d75..cad940f5b4 100644 --- a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.h +++ b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.h @@ -1,5 +1,11 @@ #ifndef PvlEditDialog_h #define PvlEditDialog_h +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include diff --git a/isis/src/base/objs/PvlEditDialog/unitTest.cpp b/isis/src/base/objs/PvlEditDialog/unitTest.cpp index 626ee9a9bb..827b90c7fc 100644 --- a/isis/src/base/objs/PvlEditDialog/unitTest.cpp +++ b/isis/src/base/objs/PvlEditDialog/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "PvlEditDialog.h" #include "Preference.h" diff --git a/isis/src/base/objs/PvlFlatMap/unitTest.cpp b/isis/src/base/objs/PvlFlatMap/unitTest.cpp index 3ca924b9a0..bbe1bf6976 100644 --- a/isis/src/base/objs/PvlFlatMap/unitTest.cpp +++ b/isis/src/base/objs/PvlFlatMap/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include #include diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp b/isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp index df0cb33e0d..8ada40775e 100644 --- a/isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp +++ b/isis/src/base/objs/PvlToPvlTranslationManager/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "PvlToPvlTranslationManager.h" #include "Preference.h" diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp b/isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp index ece66bc732..f9a8d66739 100644 --- a/isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp +++ b/isis/src/base/objs/PvlToXmlTranslationManager/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include diff --git a/isis/src/base/objs/PvlToken/unitTest.cpp b/isis/src/base/objs/PvlToken/unitTest.cpp index 1c8fc0512f..3eb2fb1614 100644 --- a/isis/src/base/objs/PvlToken/unitTest.cpp +++ b/isis/src/base/objs/PvlToken/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "PvlToken.h" #include "IException.h" diff --git a/isis/src/base/objs/PvlTokenizer/unitTest.cpp b/isis/src/base/objs/PvlTokenizer/unitTest.cpp index 94d1377738..bad4c56593 100644 --- a/isis/src/base/objs/PvlTokenizer/unitTest.cpp +++ b/isis/src/base/objs/PvlTokenizer/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "PvlToken.h" #include "PvlTokenizer.h" diff --git a/isis/src/base/objs/PvlTranslationTable/unitTest.cpp b/isis/src/base/objs/PvlTranslationTable/unitTest.cpp index 9ea68d514c..e2048bc15e 100644 --- a/isis/src/base/objs/PvlTranslationTable/unitTest.cpp +++ b/isis/src/base/objs/PvlTranslationTable/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "PvlTranslationTable.h" #include "Preference.h" diff --git a/isis/src/base/objs/TextFile/unitTest.cpp b/isis/src/base/objs/TextFile/unitTest.cpp index cf0fb14860..3ab4720f22 100644 --- a/isis/src/base/objs/TextFile/unitTest.cpp +++ b/isis/src/base/objs/TextFile/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include "TextFile.h" #include "FileName.h" #include "IException.h" diff --git a/isis/src/core/src/IException.cpp b/isis/src/core/src/IException.cpp index dfe0995335..86fcb48499 100644 --- a/isis/src/core/src/IException.cpp +++ b/isis/src/core/src/IException.cpp @@ -16,7 +16,6 @@ find files of those names at the top level of this repository. **/ #include -//#include "Application.h" #include "Preference.h" #include "Pvl.h" @@ -641,35 +640,6 @@ namespace Isis { /** -<<<<<<< HEAD:isis/src/base/objs/IException/IException.cpp -======= - * Returns an IException representing the current stack, excluding this - * method. - * - * @return an IException representing a current stack trace - */ - /* - IException IException::createStackTrace() { - vector theStack; - StackTrace::GetStackTrace(&theStack); - QString message; - - for(unsigned int i = 1; i < theStack.size(); i++) { - message += (theStack[i] + "\n").c_str(); - } - - IException result; - if (theStack.size() != 0) { - result = IException(Unknown, message, NULL, -1); - } - - return result; - } - */ - - - /** ->>>>>>> fc0563741 (Initial move to core):isis/src/core/IException/IException.cpp * Returns the source of the error in string format for the given ErrorType. * * @param type the ErrorType enum to convert to a string diff --git a/isis/tests/PvlKeywordTests.cpp b/isis/src/core/tests/PvlKeywordTests.cpp similarity index 100% rename from isis/tests/PvlKeywordTests.cpp rename to isis/src/core/tests/PvlKeywordTests.cpp diff --git a/isis/src/core/tests/unitTests/FileName/unitTest.cpp b/isis/src/core/tests/unitTests/FileName/unitTest.cpp index 6f20375034..4991d7041c 100644 --- a/isis/src/core/tests/unitTests/FileName/unitTest.cpp +++ b/isis/src/core/tests/unitTests/FileName/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include diff --git a/isis/src/core/tests/unitTests/IException/unitTest.cpp b/isis/src/core/tests/unitTests/IException/unitTest.cpp index ebfee0db14..b08b76a149 100644 --- a/isis/src/core/tests/unitTests/IException/unitTest.cpp +++ b/isis/src/core/tests/unitTests/IException/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "Preference.h" diff --git a/isis/src/core/tests/unitTests/IString/unitTest.cpp b/isis/src/core/tests/unitTests/IString/unitTest.cpp index a24fc43987..1ee2c6bdb9 100644 --- a/isis/src/core/tests/unitTests/IString/unitTest.cpp +++ b/isis/src/core/tests/unitTests/IString/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include "IString.h" #include diff --git a/isis/src/core/tests/unitTests/Message/unitTest.cpp b/isis/src/core/tests/unitTests/Message/unitTest.cpp index 05b3741238..b7c74661a0 100644 --- a/isis/src/core/tests/unitTests/Message/unitTest.cpp +++ b/isis/src/core/tests/unitTests/Message/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "Message.h" diff --git a/isis/src/core/tests/unitTests/Preference/unitTest.cpp b/isis/src/core/tests/unitTests/Preference/unitTest.cpp index 2835523137..e1130ef576 100644 --- a/isis/src/core/tests/unitTests/Preference/unitTest.cpp +++ b/isis/src/core/tests/unitTests/Preference/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "Preference.h" @@ -66,5 +72,7 @@ int main() { error.print(); } + // Add test for two new methods + return 0; } diff --git a/isis/src/core/tests/unitTests/Pvl/unitTest.cpp b/isis/src/core/tests/unitTests/Pvl/unitTest.cpp index f2b6d41e0c..f5650c1a39 100644 --- a/isis/src/core/tests/unitTests/Pvl/unitTest.cpp +++ b/isis/src/core/tests/unitTests/Pvl/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include "Pvl.h" #include "IException.h" #include "Preference.h" diff --git a/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp b/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp index 1eaf3c5ff2..175428b6fa 100644 --- a/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include "IString.h" diff --git a/isis/src/core/tests/unitTests/PvlFormat/unitTest.cpp b/isis/src/core/tests/unitTests/PvlFormat/unitTest.cpp index e6055b02f4..848edba60f 100644 --- a/isis/src/core/tests/unitTests/PvlFormat/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlFormat/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include "PvlKeyword.h" #include "PvlGroup.h" #include "PvlObject.h" diff --git a/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp b/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp index b62b4e7734..cf78a78eb4 100644 --- a/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include diff --git a/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp b/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp index c5aaf775b7..710b18a5f6 100644 --- a/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include #include "PvlGroup.h" diff --git a/isis/src/core/tests/unitTests/PvlKeyword/PvlKeyword.truth b/isis/src/core/tests/unitTests/PvlKeyword/PvlKeyword.truth deleted file mode 100644 index 9720a61bcc..0000000000 --- a/isis/src/core/tests/unitTests/PvlKeyword/PvlKeyword.truth +++ /dev/null @@ -1,632 +0,0 @@ - - ------ Testing Basic Read/Write ----- -'KEYWORD' -----------------------> VALID - NAME: KEYWORD -'KEYWORD X' ---------------------> INVALID - **ERROR** Expected an assignment [=] when reading PVL, but found [X]. -'KEYWORD =' ---------------------> INCOMPLETE -'KEYWORD = SOME_VAL' ------------> VALID - NAME: KEYWORD - VALUE: SOME_VAL -'KEYWORD = " val "' -----------> VALID - NAME: KEYWORD - VALUE: val -'KEYWORD = " 'val' "' -----------> VALID - NAME: KEYWORD - VALUE: 'val' -'KEYWORD = (VAL' ----------------> INCOMPLETE -'KEYWORD = (VAL1,VAL2' ----------> INCOMPLETE -'KEYWORD = (A B,C,D)' -----------> INVALID - **ERROR** Found extra data after [A] in array when reading PVL. -'KEYWORD = ((A B),(C),(D' -------> INCOMPLETE -'KEYWORD = (SOME_VAL)' ----------> VALID - NAME: KEYWORD - VALUE: SOME_VAL -'KEYWORD = (SOME_VAL) ' ------> VALID - NAME: KEYWORD - VALUE: SOME_VAL -'KEYWORD=(SOME_VAL)' ---------> VALID - NAME: KEYWORD - VALUE: SOME_VAL -'KEYWORD = (A, )' ---------------> INVALID - **ERROR** Unexpected close of keyword-value array when reading PVL. -'KEYWORD = ()' ------------------> VALID - NAME: KEYWORD -'KEYWORD = (A,B)' ---------------> VALID - NAME: KEYWORD - VALUE: A - VALUE: B -'KEYWORD = {A, B}' --------------> VALID - NAME: KEYWORD - VALUE: A - VALUE: B -'KEYWORD = (A,B) #comment this' -> VALID - COMMENT: #comment this - NAME: KEYWORD - VALUE: A - VALUE: B -'KEYWORD = ( A , B )' -----------> VALID - NAME: KEYWORD - VALUE: A - VALUE: B -'KEYWORD = ( A , B )' -----------> VALID - NAME: KEYWORD - VALUE: A - VALUE: B -'KEYWORD = (A, B,C,D,E))' -------> INVALID - **ERROR** Keyword has extraneous data [)] at the end. -'KEYWORD = ((1, 2), {3, 4}, (5), 6)' > VALID - NAME: KEYWORD - VALUE: (1, 2) - VALUE: {3, 4} - VALUE: (5) - VALUE: 6 -'KEYWORD = { "VAL1" , "VAL2", "VAL3"}' > VALID - NAME: KEYWORD - VALUE: VAL1 - VALUE: VAL2 - VALUE: VAL3 -'KEYWORD = { "VAL1" , "VAL2", "VAL3")' > INVALID - **ERROR** Incorrect array close when reading PVL; expected [}] but found [)] in keyword named [KEYWORD]. -'KEYWORD = { "VAL1" ,' ----------> INCOMPLETE -'KEYWORD = "(A,B,"' -------------> VALID - NAME: KEYWORD - VALUE: (A,B, -'KEYWORD = ',E)'' ---------------> VALID - NAME: KEYWORD - VALUE: ,E) -'KEYWORD = ((1,2))' -------------> VALID - NAME: KEYWORD - VALUE: (1,2) -'KEYWORD = ("(f1+f2)","/(f1-f2)")' > VALID - NAME: KEYWORD - VALUE: (f1+f2) - VALUE: /(f1-f2) -'KEYWORD = "(F1+F2)/(F1-F2)"' ---> VALID - NAME: KEYWORD - VALUE: (F1+F2)/(F1-F2) -'KEYWORD = ( (1,2) , (A,B) )' --> VALID - NAME: KEYWORD - VALUE: (1,2) - VALUE: (A,B) -'KEYWORD = "(f1 + min(f2,f3))"' -> VALID - NAME: KEYWORD - VALUE: (f1 + min(f2,f3)) -'KEYWORD = "(min(f2,f3) + f1)"' -> VALID - NAME: KEYWORD - VALUE: (min(f2,f3) + f1) -'KEYWORD = "min(f2,f3) + f1"' ---> VALID - NAME: KEYWORD - VALUE: min(f2,f3) + f1 -'KEYWORD = "f1 + min(f2,f3)"' ---> VALID - NAME: KEYWORD - VALUE: f1 + min(f2,f3) -'KEYWORD = (A , B , C, D )' > VALID - NAME: KEYWORD - VALUE: A - VALUE: B - VALUE: C - VALUE: D -'KEYWORD = (A , B , C, D ) ' > VALID - NAME: KEYWORD - VALUE: A - VALUE: B - VALUE: C - VALUE: D -'KEYWORD = ',E) ' ---------> INCOMPLETE -'KEYWORD = ,E) ' ----------> INVALID - **ERROR** Keyword has extraneous data [,E) ] at the end. -#SOMECOMMENT -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: #SOMECOMMENT - NAME: KEYWORD - VALUE: SOME_VAL -#SOMECOMMENT1 -#SOMECOMMENT2 -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: #SOMECOMMENT1 - COMMENT: #SOMECOMMENT2 - NAME: KEYWORD - VALUE: SOME_VAL -//SOMECOMMENT1 -#SOMECOMMENT2 -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: //SOMECOMMENT1 - COMMENT: #SOMECOMMENT2 - NAME: KEYWORD - VALUE: SOME_VAL -/*SOMECOMMENT1*/ -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: /* SOMECOMMENT1 */ - NAME: KEYWORD - VALUE: SOME_VAL -KEYWORD = '/* -'*/'' ---------------------------> VALID - NAME: KEYWORD - VALUE: /* */ -/* SOMECOMMENT1 - SOMECOMMENT2 -SOMECOMMENT3 */ -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: /* SOMECOMMENT1 */ - COMMENT: /* SOMECOMMENT2 */ - COMMENT: /* SOMECOMMENT3 */ - NAME: KEYWORD - VALUE: SOME_VAL -/*C1 - -A -/* -C3*/ -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: /* C1 */ - COMMENT: /* A */ - COMMENT: /* */ - COMMENT: /* C3 */ - NAME: KEYWORD - VALUE: SOME_VAL -/*C1 -/**/ -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: /* C1 */ - COMMENT: /* */ - NAME: KEYWORD - VALUE: SOME_VAL -/*C1 -A/**/ -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: /* C1 */ - COMMENT: /* A/* */ - NAME: KEYWORD - VALUE: SOME_VAL -/* A */ -/* B *//*C*/ -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: /* A */ - COMMENT: /* B *//*C */ - NAME: KEYWORD - VALUE: SOME_VAL -/*C1/**/ -'KEYWORD = SOME_VAL' ------------> VALID - COMMENT: /* C1/* */ - NAME: KEYWORD - VALUE: SOME_VAL -/*C1 - -A - -C3*//*Neato*//*Man*/KEYWORD = (A,B,C) /*Right? -'Yes!*/' ------------------------> VALID - COMMENT: /* C1 */ - COMMENT: /* A */ - COMMENT: /* C3 */ - COMMENT: /* Neato */ - COMMENT: /* Man */ - COMMENT: /*Right? Yes!*/ - NAME: KEYWORD - VALUE: A - VALUE: B - VALUE: C - - ------ Testing Stream Read/Write ----- -Input: -KEYWORD - -Output: -KEYWORD = Null - -Input: -KEYWORD X - -Output: -**ERROR** Unable to read PVL keyword [KEYWORD X]. -**ERROR** Expected an assignment [=] when reading PVL, but found [X]. - -Input: -KEYWORD = - -Output: -**ERROR** The PVL keyword [KEYWORD =] does not appear to be a valid Pvl Keyword. - -Input: -KEYWORD = SOME_VAL - -Output: -KEYWORD = SOME_VAL - -Input: -KEYWORD = " val " - -Output: -KEYWORD = " val " - -Input: -KEYWORD = " 'val' " - -Output: -KEYWORD = " 'val' " - -Input: -KEYWORD = (VAL - -Output: -**ERROR** The PVL keyword [KEYWORD = (VAL] does not appear to be a valid Pvl Keyword. - -Input: -KEYWORD = (VAL1,VAL2 - -Output: -**ERROR** The PVL keyword [KEYWORD = (VAL1,VAL2] does not appear to be a valid Pvl Keyword. - -Input: -KEYWORD = (A B,C,D) - -Output: -**ERROR** Unable to read PVL keyword [KEYWORD = (A B,C,D)]. -**ERROR** Found extra data after [A] in array when reading PVL. - -Input: -KEYWORD = ((A B),(C),(D - -Output: -**ERROR** The PVL keyword [KEYWORD = ((A B),(C),(D] does not appear to be a valid Pvl Keyword. - -Input: -KEYWORD = (SOME_VAL) - -Output: -KEYWORD = SOME_VAL - -Input: -KEYWORD = (SOME_VAL) - -Output: -KEYWORD = SOME_VAL - -Input: -KEYWORD=(SOME_VAL) - -Output: -KEYWORD = SOME_VAL - -Input: -KEYWORD = (A, ) - -Output: -**ERROR** Unable to read PVL keyword [KEYWORD = (A, )]. -**ERROR** Unexpected close of keyword-value array when reading PVL. - -Input: -KEYWORD = () - -Output: -KEYWORD = Null - -Input: -KEYWORD = (A,B) - -Output: -KEYWORD = (A, B) - -Input: -KEYWORD = {A, B} - -Output: -KEYWORD = (A, B) - -Input: -KEYWORD = (A,B) #comment this - -Output: -#comment this -KEYWORD = (A, B) - -Input: -KEYWORD = ( A , B ) - -Output: -KEYWORD = (A, B) - -Input: -KEYWORD = ( A , B ) - -Output: -KEYWORD = (A, B) - -Input: -KEYWORD = (A, B,C,D,E)) - -Output: -**ERROR** Unable to read PVL keyword [KEYWORD = (A, B,C,D,E))]. -**ERROR** Keyword has extraneous data [)] at the end. - -Input: -KEYWORD = ((1, 2), {3, 4}, (5), 6) - -Output: -KEYWORD = ((1, 2), {3, 4}, (5), 6) - -Input: -KEYWORD = { "VAL1" , "VAL2", "VAL3"} - -Output: -KEYWORD = (VAL1, VAL2, VAL3) - -Input: -KEYWORD = { "VAL1" , "VAL2", "VAL3") - -Output: -**ERROR** Unable to read PVL keyword [KEYWORD = { "VAL1" , "VAL2", "VAL3")]. -**ERROR** Incorrect array close when reading PVL; expected [}] but found [)] in keyword named [KEYWORD]. - -Input: -KEYWORD = { "VAL1" , - -Output: -**ERROR** The PVL keyword [KEYWORD = { "VAL1" ,] does not appear to be a valid Pvl Keyword. - -Input: -KEYWORD = "(A,B," - -Output: -KEYWORD = "(A,B," - -Input: -KEYWORD = ',E)' - -Output: -KEYWORD = ",E)" - -Input: -KEYWORD = ((1,2)) - -Output: -KEYWORD = (1,2) - -Input: -KEYWORD = ("(f1+f2)","/(f1-f2)") - -Output: -KEYWORD = ((f1+f2), "/(f1-f2)") - -Input: -KEYWORD = "(F1+F2)/(F1-F2)" - -Output: -KEYWORD = "(F1+F2)/(F1-F2)" - -Input: -KEYWORD = ( (1,2) , (A,B) ) - -Output: -KEYWORD = ((1,2), (A,B)) - -Input: -KEYWORD = "(f1 + min(f2,f3))" - -Output: -KEYWORD = "(f1 + min(f2,f3))" - -Input: -KEYWORD = "(min(f2,f3) + f1)" - -Output: -KEYWORD = "(min(f2,f3) + f1)" - -Input: -KEYWORD = "min(f2,f3) + f1" - -Output: -KEYWORD = "min(f2,f3) + f1" - -Input: -KEYWORD = "f1 + min(f2,f3)" - -Output: -KEYWORD = "f1 + min(f2,f3)" - -Input: -KEYWORD = (A , B , C, D ) - -Output: -KEYWORD = (A , B , C, D ) - -Input: -KEYWORD = (A , B , C, D ) - -Output: -KEYWORD = (A , B , C , D ) - -Input: -KEYWORD = ',E) - -Output: -**ERROR** The PVL keyword [KEYWORD = ',E) ] does not appear to be a valid Pvl Keyword. - -Input: -KEYWORD = ,E) - -Output: -**ERROR** Unable to read PVL keyword [KEYWORD = ,E) ]. -**ERROR** Keyword has extraneous data [,E) ] at the end. - -Input: -#SOMECOMMENT -KEYWORD = SOME_VAL - -Output: -#SOMECOMMENT -KEYWORD = SOME_VAL - -Input: -#SOMECOMMENT1 -#SOMECOMMENT2 -KEYWORD = SOME_VAL - -Output: -#SOMECOMMENT1 -#SOMECOMMENT2 -KEYWORD = SOME_VAL - -Input: -//SOMECOMMENT1 -#SOMECOMMENT2 -KEYWORD = SOME_VAL - -Output: -//SOMECOMMENT1 -#SOMECOMMENT2 -KEYWORD = SOME_VAL - -Input: -/*SOMECOMMENT1*/ -KEYWORD = SOME_VAL - -Output: -/* SOMECOMMENT1 */ -KEYWORD = SOME_VAL - -Input: -KEYWORD = '/* -*/' - -Output: -KEYWORD = "/* */" - -Input: -/* SOMECOMMENT1 - SOMECOMMENT2 -SOMECOMMENT3 */ -KEYWORD = SOME_VAL - -Output: -/* SOMECOMMENT1 */ -/* SOMECOMMENT2 */ -/* SOMECOMMENT3 */ -KEYWORD = SOME_VAL - -Input: -/*C1 - -A -/* -C3*/ -KEYWORD = SOME_VAL - -Output: -**ERROR** Error when reading a pvl: Cannot have ['/*'] inside a multi-line comment. - -Input: -/*C1 -/**/ -KEYWORD = SOME_VAL - -Output: -**ERROR** Error when reading a pvl: Cannot have ['/*'] inside a multi-line comment. - -Input: -/*C1 -A/**/ -KEYWORD = SOME_VAL - -Output: -**ERROR** Error when reading a pvl: Cannot have ['/*'] inside a multi-line comment. - -Input: -/* A */ -/* B *//*C*/ -KEYWORD = SOME_VAL - -Output: -/* A */ -/* B */ -/* C */ -KEYWORD = SOME_VAL - -Input: -/*C1/**/ -KEYWORD = SOME_VAL - -Output: -**ERROR** Error when reading a pvl: Cannot have ['/*'] inside a multi-line comment. - -Input: -/*C1 - -A - -C3*//*Neato*//*Man*/KEYWORD = (A,B,C) /*Right? -Yes!*/ - -Output: -/* C1 */ -/* A */ -/* C3 */ -/* Neato */ -/* Man */ -/*Right? Yes!*/ -KEYWORD = (A, B, C) - ------ Testing Difficult Cases Read/Write ----- -FROM = /archive/projects/cassini/VIMS/UnivAZraw/tour/S60/cubes/GLO000OBMAP00- - 2//V1654449360_4.QUB -THE_INTERNET = "Seven thousand eight hundred forty three million seventy four - nine seventy six forty two eighty nine sixty seven thirty five - million jillion bajillion google six nine four one two three - four five six seven eight nine ten eleven twelve thirteen - fourteen" -BIG_HUGE_LONG_NAME_THAT_SHOULD_TEST_OUT_PARSING = "Seven thousand eight - hundred forty three million - seventy four" -ARRAY_TEST = (5.87, 5465.6, 574.6) -FIRST_100_DIGITS_OF_PI = 3.14159265358979323846264338327950288419716939937510- - 58209749445923078164062862089986280348253421170679 -Raw Data --> -3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 - -A = XXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxx -TREE = (MAPLE, ELM, PINE) -UGHHHHHHHHHHHH = (59999.0, 59999.0, 59999.0, 59999.0, 59999.0, 59999.0, - 59999.0, 59999.0, 59999.0, 59999.0, 59999.0, 59999.0) -NAME = 5.2 -KEY = Null -# Hello World! This is a really really long comment that needs to be -# wrapped onto several different lines to make the PVL file look really -# pretty! -KEY = (5, Null, 3.3 , "Hello World!") - -# Hello World! This is a really really long comment that needs to be -# wrapped onto several different lines to make the PVL file look really -# pretty! -KEY = (5, 88, 3.3 , "Hello World!") -key = ((a, b, c), ("Hubba Hubba", Bubba)) - - -Test SetUnits methods: - - original condition of Keyword k : - k = (radius, circumference) - - after k.SetUnits("circumference", "Fathoms") : - k = (radius , circumference ) - - after k.SetUnits("TeraFathoms") : - k = (radius, circumference) - - ----------------------------------------- -Testing cast operators -string = I'm being casted -int = 465721 -BigInt = 465721 -double = 131.244 -Test_key_2 = "Might work" -**USER ERROR** [Bob is a name] is invalid. Keyword name cannot contain whitespace. -Test_key_3 = "Might'not work" -Invalid Keyword Type: Integer Expected -Positive number Expected -Integer not in the Range. Expected (0-10) -Invalid Keyword Value: Expected values "value1", "value2", "value3" -Invalid Keyword Type: Expected Boolean values "true", "false", "null" diff --git a/isis/src/core/tests/unitTests/PvlKeyword/unitTest.cpp b/isis/src/core/tests/unitTests/PvlKeyword/unitTest.cpp deleted file mode 100644 index 8ee62d1840..0000000000 --- a/isis/src/core/tests/unitTests/PvlKeyword/unitTest.cpp +++ /dev/null @@ -1,394 +0,0 @@ -#include "PvlKeyword.h" -#include "IException.h" -#include "PvlSequence.h" -#include "Preference.h" - -#include -#include - -using namespace std; -using namespace Isis; - -int main() { - Isis::Preference::Preferences(true); - - QString keywordsToTry[] = { - "KEYWORD", - "KEYWORD X", - "KEYWORD =", - "KEYWORD = SOME_VAL", - "KEYWORD = \" val \"", - "KEYWORD = \" 'val' \"", - "KEYWORD = (VAL", - "KEYWORD = (VAL1,VAL2", - "KEYWORD = (A B,C,D)", - "KEYWORD = ((A B),(C),(D", - "KEYWORD = (SOME_VAL)", - "KEYWORD = (SOME_VAL) ", - "KEYWORD=(SOME_VAL)", - "KEYWORD = (A, )", - "KEYWORD = ()", - "KEYWORD = (A,B)", - "KEYWORD = {A, B}", - "KEYWORD = (A,B) #comment this", - "KEYWORD = ( A , B )", - "KEYWORD\t=\t( A\t,\tB )", - "KEYWORD = (A, B,C,D,E))", - "KEYWORD = ((1, 2), {3, 4}, (5), 6)", - "KEYWORD = { \"VAL1\" , \"VAL2\", \"VAL3\"}", - "KEYWORD = { \"VAL1\" , \"VAL2\", \"VAL3\")", - "KEYWORD = { \"VAL1\" ,", - "KEYWORD = \"(A,B,\"", - "KEYWORD = ',E)'", - "KEYWORD = ((1,2))", - "KEYWORD = (\"(f1+f2)\",\"/(f1-f2)\")", - "KEYWORD = \"(F1+F2)/(F1-F2)\"", - "KEYWORD = ( (1,2) , (A,B) )", - "KEYWORD = \"(f1 + min(f2,f3))\"", - "KEYWORD = \"(min(f2,f3) + f1)\"", - "KEYWORD = \"min(f2,f3) + f1\"", - "KEYWORD = \"f1 + min(f2,f3)\"", - "KEYWORD = (A , B , C, D )", - "KEYWORD = (A , B , C, D ) ", - "KEYWORD = ',E) ", - "KEYWORD = ,E) ", - "#SOMECOMMENT\nKEYWORD = SOME_VAL", - "#SOMECOMMENT1\n#SOMECOMMENT2\nKEYWORD = SOME_VAL", - "//SOMECOMMENT1\n#SOMECOMMENT2\nKEYWORD = SOME_VAL", - "/*SOMECOMMENT1*/\nKEYWORD = SOME_VAL", - "KEYWORD = '/*\n*/'", - "/* SOMECOMMENT1\n SOMECOMMENT2\nSOMECOMMENT3 */\nKEYWORD = SOME_VAL", - "/*C1\n\nA\n/*\nC3*/\nKEYWORD = SOME_VAL", - "/*C1\n/**/\nKEYWORD = SOME_VAL", - "/*C1\nA/**/\nKEYWORD = SOME_VAL", - "/* A */\n/* B *//*C*/\nKEYWORD = SOME_VAL", - "/*C1/**/\nKEYWORD = SOME_VAL", - "/*C1 \n\nA\n\nC3*//*Neato*//*Man*/KEYWORD = (A,B,C) /*Right?\nYes!*/" - }; - - cout << endl << endl; - cout << "----- Testing Basic Read/Write -----" << endl; - PvlKeyword keyword; - for(unsigned int key = 0; - key < sizeof(keywordsToTry) / sizeof(QString); - key++) { - QString keywordCpy = keywordsToTry[key]; - while(keywordCpy.contains("\n")) { - cout << keywordCpy.mid(0, keywordCpy.indexOf("\n") + 1); - keywordCpy = keywordCpy.mid(keywordCpy.indexOf("\n") + 1); - } - - cout << "'" << keywordCpy << "' "; - - for(int pad = keywordCpy.size(); pad < 30; pad++) { - cout << "-"; - } - - cout << "> "; - - vector< QString > keywordComments; - QString keywordName; - vector< pair > keywordValues; - - bool result = false; - - try { - result = keyword.readCleanKeyword(keywordsToTry[key], - keywordComments, - keywordName, - keywordValues); - - if(result) cout << "VALID" << endl; - else cout << "INCOMPLETE" << endl; - } - catch(IException &e) { - cout << "INVALID" << endl; - cout << " "; - cout.flush(); - e.print(); - } - - if(result) { - for(unsigned int comment = 0; comment < keywordComments.size(); comment++) - cout << " COMMENT: " << keywordComments[comment] << endl; - - cout << " NAME: " << keywordName << endl; - - for(unsigned int value = 0; value < keywordValues.size(); value++) { - cout << " VALUE: " << keywordValues[value].first; - - if(!keywordValues[value].second.isEmpty()) { - cout << " <" << keywordValues[value].second << ">"; - } - - cout << endl; - } - } - - } - - cout << endl << endl; - cout << "----- Testing Stream Read/Write -----" << endl; - for(unsigned int key = 0; - key < sizeof(keywordsToTry) / sizeof(QString); - key ++) { - stringstream stream; - PvlKeyword someKey; - - cout << "Input:\n" << keywordsToTry[key] << endl; - - cout << endl << "Output: " << endl; - try { - stream.write(keywordsToTry[key].toLatin1().data(), keywordsToTry[key].size()); - stream >> someKey; - cout << someKey << endl; - } - catch(IException &e) { - e.print(); - } - - cout << endl; - } - - cout << "----- Testing Difficult Cases Read/Write -----\n"; - - - try { - - const Isis::PvlKeyword keyL("FROM", - "/archive/projects/cassini/VIMS/UnivAZraw/tour/S60/cubes/GLO000OBMAP002//V1654449360_4.QUB"); - PvlKeyword keyLRead; - stringstream streamL; - streamL << keyL; - streamL >> keyLRead; - cout << keyLRead << endl; - - const Isis::PvlKeyword keyN("THE_INTERNET", - "Seven thousand eight hundred forty three million seventy four nine seventy six forty two eighty nine sixty seven thirty five million jillion bajillion google six nine four one two three four five six seven eight nine ten eleven twelve thirteen fourteen", - "terrabytes"); - PvlKeyword keyNRead; - stringstream streamN; - streamN << keyN; - streamN >> keyNRead; - cout << keyNRead << endl; - - const Isis::PvlKeyword keyZ("BIG_HUGE_LONG_NAME_THAT_SHOULD_TEST_OUT_PARSING", - "Seven thousand eight hundred forty three million seventy four", - "bubble baths"); - PvlKeyword keyZRead; - stringstream streamZ; - streamZ << keyZ; - streamZ >> keyZRead; - cout << keyZRead << endl; - - Isis::PvlKeyword keyU("ARRAY_TEST", toString(5.87), "lightyears"); - keyU.addValue("5465.6", "lightyears"); - keyU.addValue("574.6", "lightyears"); - - PvlKeyword keyURead; - stringstream streamU; - streamU << keyU; - streamU >> keyURead; - cout << keyURead << endl; - - const Isis::PvlKeyword keyV("FIRST_100_DIGITS_OF_PI", "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"); - PvlKeyword keyVRead; - stringstream streamV; - streamV << keyV; - streamV >> keyVRead; - cout << keyVRead << endl; - cout << "Raw Data -->" << endl; - cout << keyVRead[0] << endl << endl; - - - const Isis::PvlKeyword keyJ("A", "XXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxxxxxxxxXXXXXXXXXXxxxx"); - PvlKeyword keyJRead; - stringstream streamJ; - streamJ << keyJ; - streamJ >> keyJRead; - cout << keyJRead << endl; - - string keyB = "TREE = { \"MAPLE\" ,\n \"ELM\" \n, \"PINE\" }"; - PvlKeyword keyBRead; - stringstream streamB; - streamB << keyB; - streamB >> keyBRead; - cout << keyBRead << endl; - - Isis::PvlKeyword keyW("UGHHHHHHHHHHHH"); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - - PvlKeyword keyWRead; - stringstream streamW; - streamW << keyW; - streamW >> keyWRead; - cout << keyWRead << endl; - - const Isis::PvlKeyword key("NAME", "5.2", "meters"); - - cout << key << endl; - - Isis::PvlKeyword key2("KEY"); - cout << key2 << endl; - - key2 += "5"; - key2 += QString(""); - key2.addValue("3.3", "feet"); - key2.addValue("Hello World!"); - QString str = "Hello World! This is a really really long comment that needs to" - " be wrapped onto several different lines to make the PVL file " - "look really pretty!"; - key2.addCommentWrapped(str); - cout << key2 << endl; - - cout << key2[1] << endl; - key2[1] = toString(88); - cout << key2 << endl; - - Isis::PvlSequence seq; - cout.flush(); - seq += "(a,b,c)"; - cout.flush(); - seq += "(\"Hubba Hubba\",\"Bubba\")"; - cout.flush(); - Isis::PvlKeyword k("key"); - k = seq; - cout << k << endl; - - // Test SetUnits methods - k = Isis::PvlKeyword("k", "radius", "meters"); - k.addValue("circumference", "meters"); - cout << "\n\n" - << "Test SetUnits methods:\n\n" - << " original condition of Keyword k :\n" - << " " << k << "\n\n" - << " after k.SetUnits(\"circumference\", \"Fathoms\") :\n"; - k.setUnits("circumference", "Fathoms"); - cout << " " << k << "\n\n" - << " after k.SetUnits(\"TeraFathoms\") :\n"; - k.setUnits("TeraFathoms"); - cout << " " << k << "\n\n\n"; - - //Test casting operators - cout << "----------------------------------------" << endl; - cout << "Testing cast operators" << endl; - Isis::PvlKeyword cast01("cast1", "I'm being casted"); - Isis::PvlKeyword cast02("cast2", "465721"); - Isis::PvlKeyword cast03("cast3", "131.2435"); - cout << "string = " << (QString)cast01 << endl; - cout << "int = " << (int)cast02 << endl; - cout << "BigInt = " << (Isis::BigInt)cast02 << endl; - cout << "double = " << (double)cast03 << endl; - - } - catch(Isis::IException &e) { - e.print(); - } - catch(...) { - cout << "Unknown error" << endl; - } - - try { - Isis::PvlKeyword key(" Test_key_2 ", "Might work"); - cout << key << endl; - Isis::PvlKeyword key2("Bob is a name", "Yes it is"); - } - catch(Isis::IException &e) { - e.print(); - } - - - try { - Isis::PvlKeyword key(" Test_key_3 ", "Might'not work"); - cerr << key << endl; - } - catch(Isis::IException &e) { - e.print(); - } - - // Test Validation of PvlKeywords - // Validate type integer - try { - // Template Keyword - PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlKwrd("KeyName", "3"); - pvlTmplKwrd.validateKeyword(pvlKwrd); - pvlKwrd.clear(); - - pvlKwrd=PvlKeyword("KeyName", "null"); - pvlTmplKwrd.validateKeyword(pvlKwrd); - pvlKwrd.clear(); - - pvlKwrd=PvlKeyword("KeyName", toString(3.5)); - pvlTmplKwrd.validateKeyword(pvlKwrd); - } - catch(Isis::IException &e) { - cerr << "Invalid Keyword Type: Integer Expected" << endl; - } - - // Test keyword__Type - try { - PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlKwrd("KeyName", toString(-3)); - pvlTmplKwrd.validateKeyword(pvlKwrd, "positive"); - } catch(Isis::IException &e) { - cerr <<"Positive number Expected" << endl; - } - - // Test keyword__Type - try { - PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlTmplKwrdRange("KeyName__Range", toString(0-10)); - PvlKeyword pvlKwrd("KeyName", toString(11)); - pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdRange); - } catch(Isis::IException &e) { - cerr <<"Integer not in the Range. Expected (0-10)" << endl; - } - - // Validate String - try { - PvlKeyword pvlTmplKwrd("KeyName", "string"); - PvlKeyword pvlTmplKwrdValue("KeyName__Value", "value0"); - pvlTmplKwrdValue.addValue("value1"); - pvlTmplKwrdValue.addValue("value2"); - pvlTmplKwrdValue.addValue("value3"); - PvlKeyword pvlKwrd("KeyName", "VALUe3"); - pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdValue); - pvlKwrd.clear(); - - pvlKwrd=PvlKeyword("KeyName", "value"); - pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdValue); - } - catch(Isis::IException &e) { - cerr << "Invalid Keyword Value: Expected values \"value1\", \"value2\", \"value3\"" << endl; - } - - // Validate Boolean - try { - PvlKeyword pvlTmplKwrd("KeyName", "boolean"); - PvlKeyword pvlKwrd("KeyName", "true"); - pvlTmplKwrd.validateKeyword(pvlKwrd); - pvlKwrd.clear(); - - pvlKwrd=PvlKeyword("KeyName", "null"); - pvlTmplKwrd.validateKeyword(pvlKwrd); - pvlKwrd.clear(); - - pvlKwrd=PvlKeyword("KeyName", "value"); - pvlTmplKwrd.validateKeyword(pvlKwrd); - } - catch(Isis::IException &e) { - cerr << "Invalid Keyword Type: Expected Boolean values \"true\", \"false\", \"null\"" << endl; - } -} diff --git a/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp b/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp index bd97866dea..fbc2964a98 100644 --- a/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include diff --git a/isis/src/core/tests/unitTests/SpecialPixel/unitTest.cpp b/isis/src/core/tests/unitTests/SpecialPixel/unitTest.cpp index ab80a979a5..6142b0a0c1 100644 --- a/isis/src/core/tests/unitTests/SpecialPixel/unitTest.cpp +++ b/isis/src/core/tests/unitTests/SpecialPixel/unitTest.cpp @@ -1,3 +1,9 @@ +/** This is free and unencumbered software released into the public domain. +The authors of ISIS do not claim copyright on the contents of this file. +For more details about the LICENSE terms and the AUTHORS, you will +find files of those names at the top level of this repository. **/ + +/* SPDX-License-Identifier: CC0-1.0 */ #include #include #include "IException.h" From 7a5959f284f1e15e0a63aa72aa3bed29eeae892f Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 20 Jul 2023 15:03:24 -0700 Subject: [PATCH 30/95] Removed unnecessary includes to classes outside of core --- isis/src/base/objs/Isis/Isis.h | 1 - isis/src/base/objs/TextFile/TextFile.cpp | 1 - isis/src/core/tests/unitTests/TableRecord/unitTest.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/isis/src/base/objs/Isis/Isis.h b/isis/src/base/objs/Isis/Isis.h index a9c8709c2c..cb445c1f55 100644 --- a/isis/src/base/objs/Isis/Isis.h +++ b/isis/src/base/objs/Isis/Isis.h @@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/ #include #include "Application.h" -#include "UserInterface.h" // this is an unnecessary include #ifndef APPLICATION #define APPLICATION IsisMain diff --git a/isis/src/base/objs/TextFile/TextFile.cpp b/isis/src/base/objs/TextFile/TextFile.cpp index 038a342156..31fdcd9891 100644 --- a/isis/src/base/objs/TextFile/TextFile.cpp +++ b/isis/src/base/objs/TextFile/TextFile.cpp @@ -5,7 +5,6 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "IException.h" -#include "IException.h" #include "FileName.h" #include "Message.h" #include "TextFile.h" diff --git a/isis/src/core/tests/unitTests/TableRecord/unitTest.cpp b/isis/src/core/tests/unitTests/TableRecord/unitTest.cpp index 77a373145b..7e3cf2f622 100644 --- a/isis/src/core/tests/unitTests/TableRecord/unitTest.cpp +++ b/isis/src/core/tests/unitTests/TableRecord/unitTest.cpp @@ -6,7 +6,6 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include -#include "Buffer.h" #include "IException.h" #include "Preference.h" #include "PvlGroup.h" From 76a5745191e0de90d6466b408f37ff72b00ab78c Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 20 Jul 2023 15:04:31 -0700 Subject: [PATCH 31/95] Removed tempFixtures include in core tests --- isis/src/core/tests/TableTests.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/isis/src/core/tests/TableTests.cpp b/isis/src/core/tests/TableTests.cpp index 53cbe0bc94..a24cc80237 100644 --- a/isis/src/core/tests/TableTests.cpp +++ b/isis/src/core/tests/TableTests.cpp @@ -1,11 +1,13 @@ #include "Blob.h" -#include "TempFixtures.h" #include "Table.h" #include "TableField.h" #include "TableRecord.h" +#include "IException.h" #include "gmock/gmock.h" +#include + using namespace Isis; TEST(TableTests, RecordConstructor) { @@ -116,6 +118,24 @@ TEST(TableTests, AddingRecords) { ASSERT_EQ(t.Records(), 2); EXPECT_EQ(TableRecord::toString(t[1]).toStdString(), TableRecord::toString(rec).toStdString()); + + TableField f5("Column1", TableField::Integer); + TableField f6("Column2", TableField::Double); + TableField f7("Column3", TableField::Text, 10); + TableField f8("Column4", TableField::Integer); + TableRecord rec2; + rec2 += f5; + rec2 += f6; + rec2 += f7; + rec2 += f8; + try { + t += rec2; + FAIL() << "Expected an exception to be thrown"; + } + catch(Isis::IException &e) { + EXPECT_TRUE(e.toString().toLatin1().contains("Unable to add the given record with size")) + << e.toString().toStdString(); + } } From ae9273868dc8e43a73b321fe41ed134a5d2e0a0b Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 20 Jul 2023 15:46:59 -0700 Subject: [PATCH 32/95] Updates sources and includes for building --- isis/src/core/tests/CMakeLists.txt | 1 + isis/src/core/tests/PvlKeywordTests.cpp | 2 +- isis/src/core/tests/unitTests/CMakeLists.txt | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/isis/src/core/tests/CMakeLists.txt b/isis/src/core/tests/CMakeLists.txt index b2aaf04273..6f57b40426 100644 --- a/isis/src/core/tests/CMakeLists.txt +++ b/isis/src/core/tests/CMakeLists.txt @@ -7,6 +7,7 @@ include(GoogleTest) set(test_source ${PROJECT_SOURCE_DIR}/tests/ConstantsTests.cpp ${PROJECT_SOURCE_DIR}/tests/IsisCoreTestMain.cpp + ${PROJECT_SOURCE_DIR}/tests/PvlKeywordTests.cpp ${PROJECT_SOURCE_DIR}/tests/TableTests.cpp) # Link runISISTests with what we want to test and the GTest and pthread library diff --git a/isis/src/core/tests/PvlKeywordTests.cpp b/isis/src/core/tests/PvlKeywordTests.cpp index bf82756377..764d224e5c 100644 --- a/isis/src/core/tests/PvlKeywordTests.cpp +++ b/isis/src/core/tests/PvlKeywordTests.cpp @@ -2,7 +2,6 @@ #include "PvlSequence.h" #include "IException.h" -#include "TestUtilities.h" #include "Fixtures.h" #include @@ -13,6 +12,7 @@ #include #include +#include "gmock/gmock.h" #include #include diff --git a/isis/src/core/tests/unitTests/CMakeLists.txt b/isis/src/core/tests/unitTests/CMakeLists.txt index 78736b62f2..6e03b39934 100644 --- a/isis/src/core/tests/unitTests/CMakeLists.txt +++ b/isis/src/core/tests/unitTests/CMakeLists.txt @@ -10,7 +10,6 @@ set(unitTestClasses "Blob" "PvlFormat" "PvlFormatPds" "PvlGroup" - "PvlKeyword" "PvlSequence" "TableField" "TableRecord") From e74c69c26ef9f65fb7fcb93789ac8b0515066550 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 20 Jul 2023 15:47:59 -0700 Subject: [PATCH 33/95] Moves necessary fixtures into core --- isis/src/core/tests/CMakeLists.txt | 1 + isis/src/core/tests/Fixtures.cpp | 238 +++++++++++++++++++++++++++++ isis/src/core/tests/Fixtures.h | 27 ++++ isis/tests/Fixtures.h | 16 +- 4 files changed, 267 insertions(+), 15 deletions(-) create mode 100644 isis/src/core/tests/Fixtures.cpp create mode 100644 isis/src/core/tests/Fixtures.h diff --git a/isis/src/core/tests/CMakeLists.txt b/isis/src/core/tests/CMakeLists.txt index 6f57b40426..ed8864db7f 100644 --- a/isis/src/core/tests/CMakeLists.txt +++ b/isis/src/core/tests/CMakeLists.txt @@ -6,6 +6,7 @@ include(../cmake/gtest.cmake) include(GoogleTest) set(test_source ${PROJECT_SOURCE_DIR}/tests/ConstantsTests.cpp + ${PROJECT_SOURCE_DIR}/tests/Fixtures.cpp ${PROJECT_SOURCE_DIR}/tests/IsisCoreTestMain.cpp ${PROJECT_SOURCE_DIR}/tests/PvlKeywordTests.cpp ${PROJECT_SOURCE_DIR}/tests/TableTests.cpp) diff --git a/isis/src/core/tests/Fixtures.cpp b/isis/src/core/tests/Fixtures.cpp new file mode 100644 index 0000000000..6b10bebc3d --- /dev/null +++ b/isis/src/core/tests/Fixtures.cpp @@ -0,0 +1,238 @@ +#include "Fixtures.h" + +namespace Isis { + + void RawPvlKeywords::SetUp() { + keywordsToTry = { + "KEYWORD", + "KEYWORD X", + "KEYWORD =", + "KEYWORD = SOME_VAL", + "KEYWORD = \" val \"", + "KEYWORD = \" 'val' \"", + "KEYWORD = (VAL", + "KEYWORD = (VAL1,VAL2", + "KEYWORD = (A B,C,D)", + "KEYWORD = ((A B),(C),(D", + "KEYWORD = (SOME_VAL)", + "KEYWORD = (SOME_VAL) ", + "KEYWORD=(SOME_VAL)", + "KEYWORD = (A, )", + "KEYWORD = ()", + "KEYWORD = (A,B)", + "KEYWORD = {A, B}", + "KEYWORD = (A,B) #comment this", + "KEYWORD = ( A , B )", + "KEYWORD\t=\t( A\t,\tB )", + "KEYWORD = (A, B,C,D,E))", + "KEYWORD = ((1, 2), {3, 4}, (5), 6)", + "KEYWORD = { \"VAL1\" , \"VAL2\", \"VAL3\"}", + "KEYWORD = { \"VAL1\" , \"VAL2\", \"VAL3\")", + "KEYWORD = { \"VAL1\" ,", + "KEYWORD = \"(A,B,\"", + "KEYWORD = ',E)'", + "KEYWORD = ((1,2))", + "KEYWORD = (\"(f1+f2)\",\"/(f1-f2)\")", + "KEYWORD = \"(F1+F2)/(F1-F2)\"", + "KEYWORD = ( (1,2) , (A,B) )", + "KEYWORD = \"(f1 + min(f2,f3))\"", + "KEYWORD = \"(min(f2,f3) + f1)\"", + "KEYWORD = \"min(f2,f3) + f1\"", + "KEYWORD = \"f1 + min(f2,f3)\"", + "KEYWORD = (A , B , C, D )", + "KEYWORD = (A , B , C, D ) ", + "KEYWORD = ',E) ", + "KEYWORD = ,E) ", + "#SOMECOMMENT\nKEYWORD = SOME_VAL", + "#SOMECOMMENT1\n#SOMECOMMENT2\nKEYWORD = SOME_VAL", + "//SOMECOMMENT1\n#SOMECOMMENT2\nKEYWORD = SOME_VAL", + "/*SOMECOMMENT1*/\nKEYWORD = SOME_VAL", + "KEYWORD = '/*\n*/'", + "/* SOMECOMMENT1\n SOMECOMMENT2\nSOMECOMMENT3 */\nKEYWORD = SOME_VAL", + "/*C1\n\nA\n/*\nC3*/\nKEYWORD = SOME_VAL", + "/*C1\n/**/\nKEYWORD = SOME_VAL", + "/*C1\nA/**/\nKEYWORD = SOME_VAL", + "/* A */\n/* B *//*C*/\nKEYWORD = SOME_VAL", + "/*C1/**/\nKEYWORD = SOME_VAL", + "/*C1 \n\nA\n\nC3*//*Neato*//*Man*/KEYWORD = (A,B,C) /*Right?\nYes!*/" + }; + + results = { + PvlKeyword("KEYWORD"), // 0 + PvlKeyword("KEYWORD", "SOME_VAL"), // 1 + PvlKeyword("KEYWORD", " val "), // 2 + PvlKeyword("KEYWORD", " \'val\' "), // 3 + PvlKeyword("KEYWORD", "SOME_VAL"), // 4 + PvlKeyword("KEYWORD", "SOME_VAL", "a"), // 5 + PvlKeyword("KEYWORD", "SOME_VAL", "a"), // 6 + PvlKeyword("KEYWORD"), // 7 + PvlKeyword("KEYWORD"), // 8 + PvlKeyword("KEYWORD"), // 9 + PvlKeyword("KEYWORD"), // 10 + PvlKeyword("KEYWORD"), // 11 + PvlKeyword("KEYWORD"), // 12 + PvlKeyword("KEYWORD"), // 13 + PvlKeyword("KEYWORD"), // 14 + PvlKeyword("KEYWORD", "(A,B,"), // 15 + PvlKeyword("KEYWORD", ",E)"), // 16 + PvlKeyword("KEYWORD", "(1,2)"), // 17 + PvlKeyword("KEYWORD"), // 18 + PvlKeyword("KEYWORD", "(F1+F2)/(F1-F2)"), // 19 + PvlKeyword("KEYWORD"), // 20 + PvlKeyword("KEYWORD", "(f1 + min(f2,f3))"), // 21 + PvlKeyword("KEYWORD", "(min(f2,f3) + f1)"), // 22 + PvlKeyword("KEYWORD", "min(f2,f3) + f1"), // 23 + PvlKeyword("KEYWORD", "f1 + min(f2,f3)"), // 24 + PvlKeyword("KEYWORD"), // 25 + PvlKeyword("KEYWORD"), // 26 + PvlKeyword("KEYWORD", "SOME_VAL"), // 27 + PvlKeyword("KEYWORD", "SOME_VAL"), // 28 + PvlKeyword("KEYWORD", "SOME_VAL"), // 29 + PvlKeyword("KEYWORD", "SOME_VAL"), // 30 + PvlKeyword("KEYWORD", "/*\n*/"), // 31 + PvlKeyword("KEYWORD", "SOME_VAL"), // 32 + PvlKeyword("KEYWORD", "SOME_VAL"), // 33 + PvlKeyword("KEYWORD", "SOME_VAL"), // 34 + PvlKeyword("KEYWORD", "SOME_VAL"), // 35 + PvlKeyword("KEYWORD", "SOME_VAL"), // 36 + PvlKeyword("KEYWORD", "SOME_VAL"), // 37 + PvlKeyword("KEYWORD"), // 38 + }; + + results[8].addValue("A"); + results[8].addValue("B"); + + results[9].addValue("A"); + results[9].addValue("B"); + + results[10].addValue("A"); + results[10].addValue("B"); + results[10].addComment("#comment this"); + + results[11].addValue("A"); + results[11].addValue("B"); + + results[12].addValue("A"); + results[12].addValue("B"); + + results[13].addValue("(1, 2)"); + results[13].addValue("{3, 4}"); + results[13].addValue("(5)"); + results[13].addValue("6"); + + results[14].addValue("VAL1"); + results[14].addValue("VAL2"); + results[14].addValue("VAL3"); + + results[18].addValue("(f1+f2)"); + results[18].addValue("/(f1-f2)"); + + results[20].addValue("(1,2)"); + results[20].addValue("(A,B)"); + + results[25].addValue("A", "a"); + results[25].addValue("B", "b"); + results[25].addValue("C"); + results[25].addValue("D", "d"); + + results[26].addValue("A", "a"); + results[26].addValue("B", "b"); + results[26].addValue("C", "e"); + results[26].addValue("D", "d"); + + results[27].addComment("#SOMECOMMENT"); + + results[28].addComment("#SOMECOMMENT1"); + results[28].addComment("#SOMECOMMENT2"); + + results[29].addComment("//SOMECOMMENT1"); + results[29].addComment("#SOMECOMMENT2"); + + results[30].addComment("/* SOMECOMMENT1 */"); + + results[32].addComment("/* SOMECOMMENT1 */"); + results[32].addComment("/* SOMECOMMENT2 */"); + results[32].addComment("/* SOMECOMMENT3 */"); + + results[33].addComment("/* C1 */"); + results[33].addComment("/* A */"); + results[33].addComment("/* */"); + results[33].addComment("/* C3 */"); + + results[34].addComment("/* C1 */"); + results[34].addComment("/* */"); + + results[35].addComment("/* C1 */"); + results[35].addComment("/* A/* */"); + + results[36].addComment("/* A */"); + results[36].addComment("/* B *//*C */"); + + results[37].addComment("/* C1/* */"); + + results[38].addValue("A"); + results[38].addValue("B"); + results[38].addValue("C"); + results[38].addComment("/* C1 */"); + results[38].addComment("/* A */"); + results[38].addComment("/* C3 */"); + results[38].addComment("/* Neato */"); + results[38].addComment("/* Man */"); + results[38].addComment("/*Right? Yes!*/"); + + valid = { + true, + false, + false, + true, + true, + true, + false, + false, + false, + false, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true, + false, + true, + true, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true}; + } + + void RawPvlKeywords::TearDown() {} +} \ No newline at end of file diff --git a/isis/src/core/tests/Fixtures.h b/isis/src/core/tests/Fixtures.h new file mode 100644 index 0000000000..2a0bfcc758 --- /dev/null +++ b/isis/src/core/tests/Fixtures.h @@ -0,0 +1,27 @@ +#ifndef Fixtures_h +#define Fixtures_h + +#include "gtest/gtest.h" + +#include + +#include "PvlKeyword.h" + +namespace Isis { + +class RawPvlKeywords : public ::testing::Test { + protected: + // You can define per-test set-up logic as usual. + void SetUp() override; + + // You can define per-test tear-down logic as usual. + void TearDown() override; + + + std::vector keywordsToTry; + std::vector results; + std::vector valid; + }; +} + +#endif \ No newline at end of file diff --git a/isis/tests/Fixtures.h b/isis/tests/Fixtures.h index d3b5668d65..ca1e729634 100644 --- a/isis/tests/Fixtures.h +++ b/isis/tests/Fixtures.h @@ -36,7 +36,7 @@ class TgoCassisModuleKernels : public ::testing::Test { QString binaryCkKernelsAsString; QString binarySpkKernelsAsString; -}; + }; class HistoryBlob : public TempTestingFiles { @@ -45,20 +45,6 @@ class HistoryBlob : public TempTestingFiles { PvlObject historyPvl; void SetUp() override; -}; - -class RawPvlKeywords : public ::testing::Test { - protected: - // You can define per-test set-up logic as usual. - void SetUp() override; - - // You can define per-test tear-down logic as usual. - void TearDown() override; - - - std::vector keywordsToTry; - std::vector results; - std::vector valid; }; } From 612ebec5ca444e0aa7f3e03b117dad4db50f8798 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 20 Jul 2023 15:48:27 -0700 Subject: [PATCH 34/95] Enforce that core unit tests use the test preferences --- isis/src/core/tests/IsisCoreTestMain.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/isis/src/core/tests/IsisCoreTestMain.cpp b/isis/src/core/tests/IsisCoreTestMain.cpp index 472b173ed7..41806236f2 100644 --- a/isis/src/core/tests/IsisCoreTestMain.cpp +++ b/isis/src/core/tests/IsisCoreTestMain.cpp @@ -1,6 +1,12 @@ #include +#include "Preference.h" + +using namespace Isis; + int main(int argc, char **argv) { + Isis::Preference::Preferences(true); + ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } From c124f24ede360b7787b7b328ac7c71d2be52fa8a Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 20 Jul 2023 15:51:59 -0700 Subject: [PATCH 35/95] Removed commented Application::Name all --- isis/src/core/src/IException.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/isis/src/core/src/IException.cpp b/isis/src/core/src/IException.cpp index 86fcb48499..1b10e12d6f 100644 --- a/isis/src/core/src/IException.cpp +++ b/isis/src/core/src/IException.cpp @@ -487,8 +487,6 @@ namespace Isis { bool exceptionIsBlank = true; PvlGroup errGroup("Error"); - //errGroup += PvlKeyword("Program", Application::Name()); - if (exception.m_errorType != Unknown) { errGroup += PvlKeyword("Class", errorTypeToString(exception.m_errorType)); From f8eac139d1aa9c70bc05a2691ba3c271ce6780e7 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Fri, 21 Jul 2023 14:25:33 -0700 Subject: [PATCH 36/95] Initial round of test fixes --- isis/src/base/apps/getsn/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/isis/src/base/apps/getsn/main.cpp b/isis/src/base/apps/getsn/main.cpp index 90d6dea781..ce359e4edb 100644 --- a/isis/src/base/apps/getsn/main.cpp +++ b/isis/src/base/apps/getsn/main.cpp @@ -21,14 +21,14 @@ using namespace std; void IsisMain() { // Set Preferences to always turn off Terminal Output - // PvlGroup &grp = Isis::Preference::Preferences().findGroup("SessionLog", Isis::Pvl::Traverse); - // grp["TerminalOutput"].setValue("Off"); + PvlGroup &grp = Isis::Preference::Preferences().findGroup("SessionLog", Isis::Pvl::Traverse); + grp["TerminalOutput"].setValue("Off"); UserInterface &ui = Application::GetUserInterface(); Pvl appLog; getsn(ui, &appLog); - // PvlGroup results = appLog.findGroup("Results"); - // SessionLog::TheLog().AddResults(results); + PvlGroup results = appLog.findGroup("Results"); + SessionLog::TheLog().AddResults(results); } From 03cdf0e699cb87334f11c0ccbc4e869181e610a8 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Mon, 24 Jul 2023 09:28:54 -0700 Subject: [PATCH 37/95] Updated IException test truth data --- .../unitTests/IException/IException.truth | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/isis/src/core/tests/unitTests/IException/IException.truth b/isis/src/core/tests/unitTests/IException/IException.truth index b5a95a3c62..0c87d6765e 100644 --- a/isis/src/core/tests/unitTests/IException/IException.truth +++ b/isis/src/core/tests/unitTests/IException/IException.truth @@ -34,21 +34,21 @@ Group = Error Code = 2 Message = "Testing user error" File = unitTest.cpp - Line = 63 + Line = 69 End_Group Group = Error Code = 1 Message = "Testing unknown error" File = unitTest.cpp - Line = 50 + Line = 56 End_Group Group = Error Class = "USER ERROR" Code = 2 File = unitTest.cpp - Line = 38 + Line = 44 End_Group Group = Error @@ -78,11 +78,11 @@ what(): Test Error 7 print(): -**I/O ERROR** Testing I/O error in unitTest.cpp at 88. -**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 75. -**USER ERROR** Testing user error in unitTest.cpp at 63. -**ERROR** Testing unknown error in unitTest.cpp at 50. -**USER ERROR** in unitTest.cpp at 38. +**I/O ERROR** Testing I/O error in unitTest.cpp at 94. +**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 81. +**USER ERROR** Testing user error in unitTest.cpp at 69. +**ERROR** Testing unknown error in unitTest.cpp at 56. +**USER ERROR** in unitTest.cpp at 44. **USER ERROR** what(): **I/O ERROR** Testing I/O error. @@ -121,11 +121,11 @@ Test Throwing Error: Rethrow and print Test Preference 'FileLine' Turned ON -- print(): -**I/O ERROR** Testing I/O error in unitTest.cpp at 88. -**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 75. -**USER ERROR** Testing user error in unitTest.cpp at 63. -**ERROR** Testing unknown error in unitTest.cpp at 50. -**USER ERROR** in unitTest.cpp at 38. +**I/O ERROR** Testing I/O error in unitTest.cpp at 94. +**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 81. +**USER ERROR** Testing user error in unitTest.cpp at 69. +**ERROR** Testing unknown error in unitTest.cpp at 56. +**USER ERROR** in unitTest.cpp at 44. **USER ERROR** Turned OFF -- print(): @@ -167,7 +167,7 @@ Group = Error Code = 4 Message = "Testing I/O error" File = unitTest.cpp - Line = 88 + Line = 94 End_Group Group = Error @@ -175,7 +175,7 @@ Group = Error Code = 3 Message = "Testing programmer error" File = unitTest.cpp - Line = 75 + Line = 81 End_Group Group = Error @@ -183,21 +183,21 @@ Group = Error Code = 2 Message = "Testing user error" File = unitTest.cpp - Line = 63 + Line = 69 End_Group Group = Error Code = 1 Message = "Testing unknown error" File = unitTest.cpp - Line = 50 + Line = 56 End_Group Group = Error Class = "USER ERROR" Code = 2 File = unitTest.cpp - Line = 38 + Line = 44 End_Group Group = Error @@ -212,7 +212,7 @@ Group = Error Code = 4 Message = "Testing I/O error" File = unitTest.cpp - Line = 88 + Line = 94 End_Group Group = Error @@ -220,7 +220,7 @@ Group = Error Code = 3 Message = "Testing programmer error" File = unitTest.cpp - Line = 75 + Line = 81 End_Group Group = Error @@ -228,21 +228,21 @@ Group = Error Code = 2 Message = "Testing user error" File = unitTest.cpp - Line = 63 + Line = 69 End_Group Group = Error Code = 1 Message = "Testing unknown error" File = unitTest.cpp - Line = 50 + Line = 56 End_Group Group = Error Class = "USER ERROR" Code = 2 File = unitTest.cpp - Line = 38 + Line = 44 End_Group Group = Error From 3e353ce26b3b27a79a18cdc64e1eb3b33ab29adc Mon Sep 17 00:00:00 2001 From: acpaquette Date: Wed, 26 Jul 2023 13:47:18 -0700 Subject: [PATCH 38/95] Moved Endian into core --- isis/src/{base/objs/Endian => core/include}/Endian.h | 0 isis/src/core/tests/unitTests/CMakeLists.txt | 1 + isis/src/{base/objs => core/tests/unitTests}/Endian/Endian.truth | 0 isis/src/{base/objs => core/tests/unitTests}/Endian/unitTest.cpp | 0 4 files changed, 1 insertion(+) rename isis/src/{base/objs/Endian => core/include}/Endian.h (100%) rename isis/src/{base/objs => core/tests/unitTests}/Endian/Endian.truth (100%) rename isis/src/{base/objs => core/tests/unitTests}/Endian/unitTest.cpp (100%) diff --git a/isis/src/base/objs/Endian/Endian.h b/isis/src/core/include/Endian.h similarity index 100% rename from isis/src/base/objs/Endian/Endian.h rename to isis/src/core/include/Endian.h diff --git a/isis/src/core/tests/unitTests/CMakeLists.txt b/isis/src/core/tests/unitTests/CMakeLists.txt index 6e03b39934..5fca8f1ebc 100644 --- a/isis/src/core/tests/unitTests/CMakeLists.txt +++ b/isis/src/core/tests/unitTests/CMakeLists.txt @@ -1,5 +1,6 @@ # List of classes with old ISIS unitTests set(unitTestClasses "Blob" + "Endian" "FileName" "IException" "IString" diff --git a/isis/src/base/objs/Endian/Endian.truth b/isis/src/core/tests/unitTests/Endian/Endian.truth similarity index 100% rename from isis/src/base/objs/Endian/Endian.truth rename to isis/src/core/tests/unitTests/Endian/Endian.truth diff --git a/isis/src/base/objs/Endian/unitTest.cpp b/isis/src/core/tests/unitTests/Endian/unitTest.cpp similarity index 100% rename from isis/src/base/objs/Endian/unitTest.cpp rename to isis/src/core/tests/unitTests/Endian/unitTest.cpp From cf8a1de9127801e00fdb6ba752fb53fa515fc8bf Mon Sep 17 00:00:00 2001 From: acpaquette Date: Wed, 26 Jul 2023 14:05:49 -0700 Subject: [PATCH 39/95] Remove additional 'm' extension for python 3.10 --- isis/src/core/swig/python/FindPythonAnaconda.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/isis/src/core/swig/python/FindPythonAnaconda.cmake b/isis/src/core/swig/python/FindPythonAnaconda.cmake index d59ada6542..cb2665fef1 100644 --- a/isis/src/core/swig/python/FindPythonAnaconda.cmake +++ b/isis/src/core/swig/python/FindPythonAnaconda.cmake @@ -63,7 +63,8 @@ if(NOT CMAKE_FIND_ANACONDA_PYTHON_INCLUDED) if( (${_py_version_major} MATCHES 2) OR - (${_py_version_major} MATCHES 3 AND ${_py_version_minor} MATCHES 8) ) + (${_py_version_major} MATCHES 3 AND ${_py_version_minor} MATCHES 8) OR + (${_py_version_major} MATCHES 3 AND ${_py_version_minor} MATCHES 10) ) set( _py_ext "") else() set( _py_ext "m") From 2c8986941b307b6752e3589f1e5cd28ee9229fe1 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Wed, 26 Jul 2023 14:18:02 -0700 Subject: [PATCH 40/95] Set version to 0.0.1 and clamped qt bellow 5.15 --- core_recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core_recipe/meta.yaml b/core_recipe/meta.yaml index 9863741550..a67cb772ea 100644 --- a/core_recipe/meta.yaml +++ b/core_recipe/meta.yaml @@ -18,7 +18,7 @@ # A Public Release for ISIS3.6.1: {% set version = "3.6.1" %} # A Release Candidate for ISIS3.6.1: {% set version = "3.6.1_RC" %} # A custom build of ISIS3.6.1 for the CaSSIS mission: {% set version = "3.6.1_cassis" %} -{% set version = "5.1.0" %} +{% set version = "0.0.1" %} # This is the build number for the current version you are building. If this is the first build of # this version, the build number will be 0. It is incremented by 1 with every consecutive build of @@ -49,7 +49,7 @@ requirements: - ninja - nlohmann_json - python - - qt >=5.9.6 + - qt >=5.9.6,<5.15.0 - swig run: - nlohmann_json From 825e725504b85b176b5b88711ea79190439aad05 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Mon, 14 Aug 2023 14:41:15 -0700 Subject: [PATCH 41/95] Initial changes for isis pvl python interface --- isis/src/core/src/FileName.cpp | 6 + isis/src/core/swig/isisblob.i | 76 +++++----- isis/src/core/swig/isisio.i | 176 +++++++++++++++++++---- isis/src/core/swig/isispvl.i | 32 ----- isis/src/core/swig/pvlGroup.i | 17 --- isis/src/core/swig/pvlKeyword.i | 7 +- isis/src/core/swig/pvlObject.i | 18 +-- isis/src/core/swig/python/CMakeLists.txt | 9 +- 8 files changed, 199 insertions(+), 142 deletions(-) diff --git a/isis/src/core/src/FileName.cpp b/isis/src/core/src/FileName.cpp index 425e0801a5..a221a1cef7 100644 --- a/isis/src/core/src/FileName.cpp +++ b/isis/src/core/src/FileName.cpp @@ -18,6 +18,7 @@ find files of those names at the top level of this repository. **/ #include #include "Preference.h" +#include "PvlGroup.h" #include "IException.h" #include "IString.h" @@ -843,6 +844,10 @@ namespace Isis { int varSearchStartPos = 0; int varStartPos = -1; + if(Preference::Preferences().hasGroup("DataDirectory")) { + PvlGroup &testing = Preference::Preferences().findGroup("DataDirectory"); + cout << testing << endl; + } // Loop while there are any "$" at the current position or after // Some "$" might be skipped if no translation can be found while((varStartPos = expandedStr.indexOf("$", varSearchStartPos)) != -1) { @@ -886,6 +891,7 @@ namespace Isis { } } } + cout << expandedStr << endl; if (variableValid) { // We could expand multiple times... diff --git a/isis/src/core/swig/isisblob.i b/isis/src/core/swig/isisblob.i index 451b32ef64..cc4b5b8462 100644 --- a/isis/src/core/swig/isisblob.i +++ b/isis/src/core/swig/isisblob.i @@ -1,4 +1,4 @@ -%module isisblob +%module(package="isisio") Blob %{ #include "Blob.h" %} @@ -6,40 +6,40 @@ %include "Blob.h" %nodefaultdtor Isis::Blob; -%extend Isis::Blob { - - Blob(const char* name, const char* type) { - QString qname(name); - QString qtype(type); - Isis::Blob *blob = new Isis::Blob(qname, qtype); - return blob; - } - - Blob(const char* name, const char* type, const char* file) { - QString qname(name); - QString qtype(type); - QString qfile(file); - Isis::Blob *blob = new Isis::Blob(qname, qtype, file); - return blob; - } - - void Write(const char *file) { - QString qfile(file); - - $self->Write(file); - } - - char * getStringBuffer() { - int bufferSize = $self->Size(); - char * buffer = $self->getBuffer(); - std::ostringstream os; - for (int i = 0; i < bufferSize; i++) os << buffer[i]; - os << '\0'; - - std::string str = os.str(); - char * cstr = new char [str.length()+1]; - std::strcpy (cstr, str.c_str()); - return cstr; - } - -} +// %extend Isis::Blob { + +// Blob(const char* name, const char* type) { +// QString qname(name); +// QString qtype(type); +// Isis::Blob *blob = new Isis::Blob(qname, qtype); +// return blob; +// } + +// Blob(const char* name, const char* type, const char* file) { +// QString qname(name); +// QString qtype(type); +// QString qfile(file); +// Isis::Blob *blob = new Isis::Blob(qname, qtype, file); +// return blob; +// } + +// void Write(const char *file) { +// QString qfile(file); + +// $self->Write(file); +// } + +// char * getStringBuffer() { +// int bufferSize = $self->Size(); +// char * buffer = $self->getBuffer(); +// std::ostringstream os; +// for (int i = 0; i < bufferSize; i++) os << buffer[i]; +// os << '\0'; + +// std::string str = os.str(); +// char * cstr = new char [str.length()+1]; +// std::strcpy (cstr, str.c_str()); +// return cstr; +// } + +// } diff --git a/isis/src/core/swig/isisio.i b/isis/src/core/swig/isisio.i index 279dcc2662..e8585a1ae8 100644 --- a/isis/src/core/swig/isisio.i +++ b/isis/src/core/swig/isisio.i @@ -1,45 +1,163 @@ %module isisio %{ + #include + #include + #include #include #include %} -%include std_string.i -%include std_vector.i -%include exception.i +%include "std_vector.i" +%include "std_string.i" +%include "std_array.i" +%include "std_map.i" +%include "carrays.i" +%include "std_pair.i" +%include "exception.i" -%include "pvlKeyword.i" -%include "PvlContainer.h" -%include "pvlGroup.i" +#include +#include +#include -%include "pvlObject.i" -%nodefaultdtor Isis::PvlObject; +%typemap(in) nlohmann::json { + if (PyDict_Check($input) || PyList_Check($input)) { + PyObject* module = PyImport_ImportModule("json"); + PyObject* jsonDumps = PyUnicode_FromString("dumps"); + PyObject* pythonJsonString = PyObject_CallMethodObjArgs(module, jsonDumps, $input, NULL); + $1 = nlohmann::json::parse(PyUnicode_AsUTF8(pythonJsonString)); + } + else { + PyErr_SetString(PyExc_TypeError, "not a json serializable type"); + SWIG_fail; + } +} +%typemap(typecheck, precedence=SWIG_TYPECHECK_MAP) nlohmann::json { + $1 = PyDict_Check($input) ? 1 : 0; +} + +%typemap(out) nlohmann::json { + PyObject* module = PyImport_ImportModule("json"); + PyObject* jsonLoads = PyUnicode_FromString("loads"); + std::string jsonString = ($1).dump(); + PyObject* pythonJsonString = PyUnicode_DecodeUTF8(jsonString.c_str(), jsonString.size(), NULL); + $result = PyObject_CallMethodObjArgs(module, jsonLoads, pythonJsonString, NULL); +} -class QString -{ -public: - static QString fromStdString(const std::string &s); - std::string toStdString() const; - QString(const char* str); - ~QString(); - - int size() const; - int count() const; - int length() const; - bool isEmpty() const; -}; - -%exception{ - try { - $action - } catch (std::exception const& e) { - SWIG_exception(SWIG_RuntimeError, (std::string("std::exception: ") + e.what()).c_str()); - } catch (...) { - SWIG_exception(SWIG_UnknownError, "Unknown error"); +%typemap(in) QVector & { + int i; + if (!PySequence_Check($input)) { + PyErr_SetString(PyExc_ValueError,"Expected a List"); + SWIG_fail; + } + + int size = PySequence_Length($input); + $1 = new QVector(size); + + for (i = 0; i < size; i++) { + PyObject *o = PySequence_GetItem($input,i); + if (PyUnicode_Check(o)) { + QString s = QString::fromUtf8(PyUnicode_AsUTF8(o)); + (*$1)[i] = s; + } else { + PyErr_SetString(PyExc_ValueError,"Sequence elements must be string"); + SWIG_fail; } + } } + + +%typemap(out) QVector & { + $result = PyList_New($1_dim0); + for (i = 0; i < $1_dim0; i++) { + PyObject *o = PyString_AsString($1->at(i)); + PyList_SetItem($result,i,o); + } +} + + +%typemap(in) QString const & { + if (!PyUnicode_Check($input)) { + PyErr_SetString(PyExc_ValueError,"Expected a String"); + SWIG_fail; + } + $1 = new QString(QString::fromUtf8(PyUnicode_AsUTF8($input))); +} + + +%typemap(out) QString const & { + $result = Py_BuildValue("s#", $1.toStdString().c_str(), $1.size()); +} + + +%typemap(in) QString { + if (!PyUnicode_Check($input)) { + std::cout << "TANGERINE" << std::endl; + PyErr_SetString(PyExc_ValueError,"Expected a String"); + SWIG_fail; + } + $1 = QString::fromUtf8(PyUnicode_AsUTF8($input)); +} + +%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) QString { + $1 = !PyUnicode_Check($input); + std::cout << PyUnicode_AsUTF8($input) << std::endl; +} + +%typemap(out) QString = QString const &; + +%typemap(in) QVector { + int i; + if (!PySequence_Check($input)) { + PyErr_SetString(PyExc_ValueError,"Expected a List"); + SWIG_fail; + } + + int size = PySequence_Length($input); + $1 = new QVector(size); + + for (i = 0; i < size; i++) { + PyObject *o = PySequence_GetItem($input,i); + if (PyUnicode_Check(o)) { + QString s = QString::fromUtf8(PyUnicode_AsUTF8(o)); + (*$1)[i] = s; + } else { + PyErr_SetString(PyExc_ValueError,"Sequence elements must be string"); + SWIG_fail; + } + } +} + + +%typemap(out) QVector = QVector &; + +namespace std { + %template(IntVector) vector; + %template(DoubleVector) vector; + %template(VectorDoubleVector) vector< vector >; + %template(StringVector) vector; + %template(ConstCharVector) vector; + %template(PairDoubleVector) vector>; + %template(DoubleArray6) array; +} + +%exception { + try { + $action + } catch (std::exception const& e) { + SWIG_exception(SWIG_RuntimeError, (std::string("std::exception: ") + e.what()).c_str()); + } catch (...) { + SWIG_exception(SWIG_UnknownError, "Unknown error"); + } +} + +%include "pvlKeyword.i" +%include "PvlContainer.h" +%include "pvlGroup.i" +%include "pvlObject.i" +%nodefaultdtor Isis::PvlObject; +// %include "UserInterface.i" %include "isisblob.i" %include "isispvl.i" diff --git a/isis/src/core/swig/isispvl.i b/isis/src/core/swig/isispvl.i index 1be639214c..343cf4bf6d 100644 --- a/isis/src/core/swig/isispvl.i +++ b/isis/src/core/swig/isispvl.i @@ -5,35 +5,3 @@ %include "Pvl.h" %nodefaultdtor Isis::Pvl; - -%extend Isis::Pvl { - const char* __str__() { - std::ostringstream out; - out << *$self; - std::string str = out.str(); - char * cstr = new char [str.length()+1]; - std::strcpy (cstr, str.c_str()); - return cstr; - } - - Pvl(const char* file) { - QString qfile(file); - Isis::Pvl *pvl = new Isis::Pvl(qfile); - return pvl; - } - - void readString(const char *pvlString) { - std::istringstream in(pvlString); - in >> *$self; - } - - void read(const char* file) { - QString qfile(file); - $self->read(qfile); - } - - void write(const char* file) { - QString qfile(file); - $self->write(qfile); - } -} diff --git a/isis/src/core/swig/pvlGroup.i b/isis/src/core/swig/pvlGroup.i index 5460084700..8057630265 100644 --- a/isis/src/core/swig/pvlGroup.i +++ b/isis/src/core/swig/pvlGroup.i @@ -4,20 +4,3 @@ %} %include "PvlGroup.h" - -%extend Isis::PvlGroup { - const char* __str__() { - std::ostringstream out; - out << *$self; - std::string str = out.str(); - char * cstr = new char [str.length()+1]; - std::strcpy (cstr, str.c_str()); - return cstr; - } - - PvlGroup(const char* groupName) { - QString qgroupName(groupName); - Isis::PvlGroup *group = new Isis::PvlGroup(qgroupName); - return group; - } -} diff --git a/isis/src/core/swig/pvlKeyword.i b/isis/src/core/swig/pvlKeyword.i index e08a113ece..6a7e7498d9 100644 --- a/isis/src/core/swig/pvlKeyword.i +++ b/isis/src/core/swig/pvlKeyword.i @@ -1,4 +1,4 @@ -%module(package="isispvl") PvlKeyword +%module(package="isisio") PvlKeyword %{ #include "PvlKeyword.h" %} @@ -16,9 +16,8 @@ } PvlKeyword(const char* key, const char* val) { - QString qkey(key); - QString qval(val); - Isis::PvlKeyword *kw = new Isis::PvlKeyword(qkey, qval); + Isis::PvlKeyword *kw = new Isis::PvlKeyword(key, val); return kw; } } + diff --git a/isis/src/core/swig/pvlObject.i b/isis/src/core/swig/pvlObject.i index d4948a9438..7748d49a6e 100644 --- a/isis/src/core/swig/pvlObject.i +++ b/isis/src/core/swig/pvlObject.i @@ -4,20 +4,4 @@ %} %include "PvlObject.h" - -%extend Isis::PvlObject { - const char* __str__() { - std::ostringstream out; - out << *$self; - std::string str = out.str(); - char * cstr = new char [str.length()+1]; - std::strcpy (cstr, str.c_str()); - return cstr; - } - - PvlObject(const char* objectName) { - QString qobjectName(objectName); - Isis::PvlObject *object = new Isis::PvlObject(qobjectName); - return object; - } -} +%nodefaultdtor Isis::PvlObject; diff --git a/isis/src/core/swig/python/CMakeLists.txt b/isis/src/core/swig/python/CMakeLists.txt index 87c22edc1d..e0686f0541 100644 --- a/isis/src/core/swig/python/CMakeLists.txt +++ b/isis/src/core/swig/python/CMakeLists.txt @@ -36,11 +36,10 @@ endif() # Move the static files configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in - ${CMAKE_CURRENT_BINARY_DIR}/setup.py - COPYONLY) -#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py -# ${CMAKE_CURRENT_BINARY_DIR}/isispvl/__init__.py -# COPYONLY) + ${CMAKE_CURRENT_BINARY_DIR}/setup.py) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py + ${CMAKE_CURRENT_BINARY_DIR}/isisio/__init__.py + COPYONLY) ## Move the tests #file(COPY ${CMAKE_SOURCE_DIR}/python/tests From 443d460255ce8e2247b81c27500931c1648413b6 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Tue, 3 Oct 2023 17:46:20 -0700 Subject: [PATCH 42/95] Removed prints causing test failures --- isis/src/core/src/FileName.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/isis/src/core/src/FileName.cpp b/isis/src/core/src/FileName.cpp index a221a1cef7..a759b0ce4f 100644 --- a/isis/src/core/src/FileName.cpp +++ b/isis/src/core/src/FileName.cpp @@ -846,7 +846,6 @@ namespace Isis { int varStartPos = -1; if(Preference::Preferences().hasGroup("DataDirectory")) { PvlGroup &testing = Preference::Preferences().findGroup("DataDirectory"); - cout << testing << endl; } // Loop while there are any "$" at the current position or after // Some "$" might be skipped if no translation can be found @@ -891,7 +890,6 @@ namespace Isis { } } } - cout << expandedStr << endl; if (variableValid) { // We could expand multiple times... From 0324026ab7a6a845520ac4a739c4d6311c6ffea3 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Wed, 11 Oct 2023 07:42:07 -0700 Subject: [PATCH 43/95] QPair -> std::pair --- isis/src/core/include/FileName.h | 4 +--- isis/src/core/src/FileName.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/isis/src/core/include/FileName.h b/isis/src/core/include/FileName.h index 0867f549c7..87380309bd 100644 --- a/isis/src/core/include/FileName.h +++ b/isis/src/core/include/FileName.h @@ -13,8 +13,6 @@ class QDate; class QDir; class QString; -template struct QPair; - namespace Isis { /** * @brief File name manipulation and expansion. @@ -190,7 +188,7 @@ namespace Isis { long highestVersionNum() const; void validateVersioningState() const; QString fileNameQDatePattern() const; - QPair splitNameAroundVersionNum() const; + std::pair splitNameAroundVersionNum() const; private: /** diff --git a/isis/src/core/src/FileName.cpp b/isis/src/core/src/FileName.cpp index a759b0ce4f..c678a15572 100644 --- a/isis/src/core/src/FileName.cpp +++ b/isis/src/core/src/FileName.cpp @@ -13,7 +13,6 @@ find files of those names at the top level of this repository. **/ #include #include #include -#include #include #include @@ -417,7 +416,7 @@ namespace Isis { _FILEINFO_); } - QPair splitName = splitNameAroundVersionNum(); + std::pair splitName = splitNameAroundVersionNum(); QString &before = splitName.first; QString &after = splitName.second; @@ -579,7 +578,7 @@ namespace Isis { QDate FileName::highestVersionDate() const { QString fileQDatePattern = fileNameQDatePattern(); - QPair truncateRange(-1, -1); + std::pair truncateRange(-1, -1); if (fileQDatePattern.contains("?")) { QString trueLengthName = name().replace(QRegExp("[{}]"), ""); truncateRange.first = trueLengthName.indexOf("?"); @@ -644,7 +643,7 @@ namespace Isis { int width = file.count("?"); - QPair splitName = splitNameAroundVersionNum(); + std::pair splitName = splitNameAroundVersionNum(); QString &before = splitName.first; QString &after = splitName.second; @@ -750,12 +749,12 @@ namespace Isis { } /** - * This returns a QPair of the text (before, after) a version number in a file. Before being + * This returns a std::pair of the text (before, after) a version number in a file. Before being * the text before the version number and after being the text after the version number. * - * @return QPair + * @return std::pair */ - QPair FileName::splitNameAroundVersionNum() const { + std::pair FileName::splitNameAroundVersionNum() const { QString file = FileName(expanded()).name(); QString before; QString after; @@ -768,7 +767,7 @@ namespace Isis { after = file.mid(file.lastIndexOf("?") + 1); } - return QPair(before, after); + return std::pair(before, after); } /** From 32c487ce3de84ce0da808d3a79a06d8bc072c229 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Wed, 11 Oct 2023 11:26:27 -0700 Subject: [PATCH 44/95] removed QT from ArraySubscriptNotInRange --- isis/src/base/objs/Buffer/Buffer.cpp | 10 +++++----- isis/src/base/objs/Histogram/Histogram.cpp | 6 +++--- .../base/objs/ImageHistogram/ImageHistogram.cpp | 2 +- isis/src/core/include/Message.h | 4 ++-- isis/src/core/src/ArraySubscriptNotInRange.cpp | 6 ++---- isis/src/core/src/PvlContainer.cpp | 4 ++-- isis/src/core/src/PvlKeyword.cpp | 14 +++++++------- isis/src/core/src/PvlObject.cpp | 8 ++++---- isis/src/lro/apps/lrowaccal/lrowaccal.cpp | 6 +++--- 9 files changed, 29 insertions(+), 31 deletions(-) diff --git a/isis/src/base/objs/Buffer/Buffer.cpp b/isis/src/base/objs/Buffer/Buffer.cpp index 0757c99bc3..1d35870977 100644 --- a/isis/src/base/objs/Buffer/Buffer.cpp +++ b/isis/src/base/objs/Buffer/Buffer.cpp @@ -197,17 +197,17 @@ namespace Isis { int Buffer::Index(const int i_samp, const int i_line, const int i_band) const { if((i_samp < p_sample) || (i_samp > (p_sample + p_nsamps - 1))) { - QString message = Message::ArraySubscriptNotInRange(i_samp); + std::string message = Message::ArraySubscriptNotInRange(i_samp); throw IException(IException::Programmer, message, _FILEINFO_); } if((i_line < p_line) || (i_line > (p_line + p_nlines - 1))) { - QString message = Message::ArraySubscriptNotInRange(i_line); + std::string message = Message::ArraySubscriptNotInRange(i_line); throw IException(IException::Programmer, message, _FILEINFO_); } if((i_band < p_band) || (i_band > (p_band + p_nbands - 1))) { - QString message = Message::ArraySubscriptNotInRange(i_band); + std::string message = Message::ArraySubscriptNotInRange(i_band); throw IException(IException::Programmer, message, _FILEINFO_); } @@ -230,11 +230,11 @@ namespace Isis { */ double Buffer::at(const int index) const { if(index < 0) { - QString message = Message::ArraySubscriptNotInRange(index); + std::string message = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } else if(index >= p_npixels) { - QString message = Message::ArraySubscriptNotInRange(index); + std::string message = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } diff --git a/isis/src/base/objs/Histogram/Histogram.cpp b/isis/src/base/objs/Histogram/Histogram.cpp index 94e5a9dcb6..4ffc7abbba 100644 --- a/isis/src/base/objs/Histogram/Histogram.cpp +++ b/isis/src/base/objs/Histogram/Histogram.cpp @@ -404,7 +404,7 @@ namespace Isis { if ( (index < 0) || (index >= (int)p_bins.size() ) ) { - QString message = Message::ArraySubscriptNotInRange(index); + std::string message = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } @@ -428,7 +428,7 @@ namespace Isis { double &low, double &high) const { if ( (index < 0) || (index >= (int)p_bins.size() ) ) { - QString message = Message::ArraySubscriptNotInRange(index); + std::string message = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } @@ -449,7 +449,7 @@ namespace Isis { double Histogram::BinMiddle(const int index) const { if ( (index < 0) || (index >= (int)p_bins.size() ) ) { - QString message = Message::ArraySubscriptNotInRange(index); + std::string message = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } diff --git a/isis/src/base/objs/ImageHistogram/ImageHistogram.cpp b/isis/src/base/objs/ImageHistogram/ImageHistogram.cpp index 68b1a0418d..53f1507ca7 100644 --- a/isis/src/base/objs/ImageHistogram/ImageHistogram.cpp +++ b/isis/src/base/objs/ImageHistogram/ImageHistogram.cpp @@ -319,7 +319,7 @@ namespace Isis { double &low, double &high) const { if ( (index < 0) || (index >= (int)p_bins.size() ) ) { - QString message = Message::ArraySubscriptNotInRange(index); + std::string message = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } diff --git a/isis/src/core/include/Message.h b/isis/src/core/include/Message.h index e8647acb9f..9f2622274b 100644 --- a/isis/src/core/include/Message.h +++ b/isis/src/core/include/Message.h @@ -24,10 +24,10 @@ namespace Isis { * * @param index - Array index which is out of bounds * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString ArraySubscriptNotInRange(int index); + std::string ArraySubscriptNotInRange(int index); /** * This error should be used when a supplied keyword for an Isis application diff --git a/isis/src/core/src/ArraySubscriptNotInRange.cpp b/isis/src/core/src/ArraySubscriptNotInRange.cpp index 4149f51321..4ac958df8d 100644 --- a/isis/src/core/src/ArraySubscriptNotInRange.cpp +++ b/isis/src/core/src/ArraySubscriptNotInRange.cpp @@ -22,12 +22,10 @@ */ #include - -#include "IString.h" #include "Message.h" using namespace std; -QString Isis::Message::ArraySubscriptNotInRange(int index) { - return "Array subscript [" + toString(index) + "] is out of array bounds"; +std::string Isis::Message::ArraySubscriptNotInRange(int index) { + return "Array subscript [" + std::to_string(index) + "] is out of array bounds"; } diff --git a/isis/src/core/src/PvlContainer.cpp b/isis/src/core/src/PvlContainer.cpp index 77b78c6d3c..4de7630338 100644 --- a/isis/src/core/src/PvlContainer.cpp +++ b/isis/src/core/src/PvlContainer.cpp @@ -171,7 +171,7 @@ namespace Isis { */ PvlKeyword &PvlContainer::operator[](const int index) { if(index < 0 || index >= (int)m_keywords.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } return *(m_keywords.begin() + index); @@ -186,7 +186,7 @@ namespace Isis { */ const Isis::PvlKeyword &PvlContainer::operator[](const int index) const { if(index < 0 || index >= (int)m_keywords.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } return *(m_keywords.begin() + index); diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index 0fa0aca35b..103bd66ad6 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -104,7 +104,7 @@ namespace Isis { bool PvlKeyword::isNull(int index) const { if (size() == 0) return true; if (index < 0 || index >= (int)m_values.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } if (stringEqual("NULL", m_values[index])) return true; @@ -376,8 +376,8 @@ namespace Isis { */ QString &PvlKeyword::operator[](int index) { if (index < 0 || index >= (int)m_values.size()) { - QString msg = (Message::ArraySubscriptNotInRange(index)) + - "for Keyword [" + QString(m_name) + "]"; + std::string msg = (Message::ArraySubscriptNotInRange(index)) + + "for Keyword [" + m_name + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -398,7 +398,7 @@ namespace Isis { */ const QString &PvlKeyword::operator[](int index) const { if (index < 0 || index >= (int)m_values.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } return m_values[index]; @@ -417,7 +417,7 @@ namespace Isis { if (!m_units) return ""; if (index < 0 || index >= (int)m_units->size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } return (*m_units)[index]; @@ -501,7 +501,7 @@ namespace Isis { if (!m_comments) return ""; if (index < 0 || index >= (int)m_comments->size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } return (*m_comments)[index]; @@ -620,7 +620,7 @@ namespace Isis { */ bool PvlKeyword::isEquivalent(QString QString1, int index) const { if (index < 0 || index >= (int)m_values.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/core/src/PvlObject.cpp b/isis/src/core/src/PvlObject.cpp index 9f3ea875d9..fbc7c798d9 100644 --- a/isis/src/core/src/PvlObject.cpp +++ b/isis/src/core/src/PvlObject.cpp @@ -443,7 +443,7 @@ namespace Isis { */ Isis::PvlGroup &PvlObject::group(const int index) { if(index < 0 || index >= (int)m_groups.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -462,7 +462,7 @@ namespace Isis { */ const Isis::PvlGroup &PvlObject::group(const int index) const { if(index < 0 || index >= (int)m_groups.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -480,7 +480,7 @@ namespace Isis { */ PvlObject &PvlObject::object(const int index) { if(index < 0 || index >= (int)m_objects.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(Isis::IException::Programmer, msg, _FILEINFO_); } @@ -498,7 +498,7 @@ namespace Isis { */ const PvlObject &PvlObject::object(const int index) const { if(index < 0 || index >= (int)m_objects.size()) { - QString msg = Message::ArraySubscriptNotInRange(index); + std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp index 5439cde1f9..4c0f611698 100644 --- a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp +++ b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp @@ -366,11 +366,11 @@ namespace Isis { // We're bypassing Buffer::at for speed, so we need to make sure our // index will not overrun the buffer if(offset + frameSize > g_darkCube1->size()) { - QString message = Message::ArraySubscriptNotInRange(offset + frameSize) + " (Dark cube 1)"; + std::string message = Message::ArraySubscriptNotInRange(offset + frameSize) + " (Dark cube 1)"; throw IException(IException::Programmer, message, _FILEINFO_); } if(offset + frameSize > g_darkCube2->size()) { - QString message = Message::ArraySubscriptNotInRange(offset + frameSize) + " (Dark cube 2)"; + std::string message = Message::ArraySubscriptNotInRange(offset + frameSize) + " (Dark cube 2)"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -424,7 +424,7 @@ namespace Isis { // We're bypassing Buffer::at for speed, so we need to make sure our // index will not overrun the buffer if(offset + frameSize > g_flatCube->size()) { - QString message = Message::ArraySubscriptNotInRange(offset + frameSize) + " (Flat-field cube)"; + std::string message = Message::ArraySubscriptNotInRange(offset + frameSize) + " (Flat-field cube)"; throw IException(IException::Programmer, message, _FILEINFO_); } From d02d74c5a6c1d6adcd14c5c65f373e5381299a5d Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Wed, 11 Oct 2023 13:00:06 -0700 Subject: [PATCH 45/95] removed QT from Message::Keyword* --- isis/src/base/objs/PvlToken/PvlToken.cpp | 4 +- .../base/objs/PvlTokenizer/PvlTokenizer.cpp | 8 +-- isis/src/core/include/Message.h | 60 +++++++++---------- isis/src/core/src/KeywordAmbiguous.cpp | 2 +- isis/src/core/src/KeywordBlockEndMissing.cpp | 2 +- isis/src/core/src/KeywordBlockInvalid.cpp | 2 +- .../src/core/src/KeywordBlockStartMissing.cpp | 2 +- isis/src/core/src/KeywordDuplicated.cpp | 2 +- isis/src/core/src/KeywordNotArray.cpp | 2 +- isis/src/core/src/KeywordNotFound.cpp | 2 +- isis/src/core/src/KeywordUnrecognized.cpp | 2 +- isis/src/core/src/KeywordValueBad.cpp | 8 +-- isis/src/core/src/KeywordValueExpected.cpp | 2 +- isis/src/core/src/KeywordValueNotInList.cpp | 6 +- isis/src/core/src/KeywordValueNotInRange.cpp | 2 +- .../core/tests/unitTests/Message/unitTest.cpp | 2 +- 16 files changed, 54 insertions(+), 54 deletions(-) diff --git a/isis/src/base/objs/PvlToken/PvlToken.cpp b/isis/src/base/objs/PvlToken/PvlToken.cpp index 935b883f54..11b7101b69 100644 --- a/isis/src/base/objs/PvlToken/PvlToken.cpp +++ b/isis/src/base/objs/PvlToken/PvlToken.cpp @@ -94,7 +94,7 @@ namespace Isis { */ QString PvlToken::value(const int index) const { if((index < 0) || (index >= (int) m_value.size())) { - QString message = Isis::Message::ArraySubscriptNotInRange(index); + std::string message = Isis::Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } return m_value[index]; @@ -111,7 +111,7 @@ namespace Isis { */ QString PvlToken::valueUpper(int index) const { if((index < 0) || (index >= (int) m_value.size())) { - QString message = Isis::Message::ArraySubscriptNotInRange(index); + std::string message = Isis::Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } diff --git a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp index 5efa2547bc..af51308fd6 100644 --- a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp +++ b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp @@ -138,7 +138,7 @@ namespace Isis { ParseCommaList(t, s); } catch(IException &e) { - QString message = Isis::Message::KeywordValueBad(t.key()); + std::string message = Isis::Message::KeywordValueBad(t.key().toStdString()); throw IException(e, IException::Unknown, message, _FILEINFO_); } tokens.push_back(t); @@ -152,7 +152,7 @@ namespace Isis { ParseCommaList(t, s); } catch(IException &e) { - QString message = Isis::Message::KeywordValueBad(t.key()); + std::string message = Isis::Message::KeywordValueBad(t.key().toStdString()); throw IException(e, IException::Unknown, message, _FILEINFO_); } tokens.push_back(t); @@ -165,7 +165,7 @@ namespace Isis { s = ReadToDoubleQuote(stream); } catch(IException &e) { - QString message = Isis::Message::KeywordValueBad(t.key()); + std::string message = Isis::Message::KeywordValueBad(t.key().toStdString()); throw IException(e, IException::Unknown, message, _FILEINFO_); } t.addValue(s); @@ -179,7 +179,7 @@ namespace Isis { s = ReadToSingleQuote(stream); } catch(IException &e) { - QString message = Isis::Message::KeywordValueBad(t.key()); + std::string message = Isis::Message::KeywordValueBad(t.key().toStdString()); throw IException(IException::Unknown, message, _FILEINFO_); } t.addValue(s); diff --git a/isis/src/core/include/Message.h b/isis/src/core/include/Message.h index 9f2622274b..d4b822fd2c 100644 --- a/isis/src/core/include/Message.h +++ b/isis/src/core/include/Message.h @@ -36,10 +36,10 @@ namespace Isis { * * @param key - The name of the keyword which is ambiguous * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordAmbiguous(const QString &key); + std::string KeywordAmbiguous(const std::string key); /** * This error should be used when a supplied keyword for an Isis application @@ -47,10 +47,10 @@ namespace Isis { * * @param key - The name of the keyword which is unrecognized * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordUnrecognized(const QString &key); + std::string KeywordUnrecognized(const std::string key); /** * This error should be used when a supplied keyword for an Isis application @@ -58,10 +58,10 @@ namespace Isis { * * @param key - The name of the keyword which has been duplicated * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordDuplicated(const QString &key); + std::string KeywordDuplicated(const std::string key); /** * This error should be used when a supplied keyword is being used as an @@ -69,10 +69,10 @@ namespace Isis { * * @param key - The name of the keyword which is not an array * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordNotArray(const QString &key); + std::string KeywordNotArray(const std::string key); /** * This error should be used when a supplied keyword is not defined in the @@ -80,42 +80,42 @@ namespace Isis { * * @param key - The name of the keyword which was not found * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordNotFound(const QString &key); + std::string KeywordNotFound(const std::string key); /** * This error has been deprecated and should not be used in new code. * * @param block - The name of the invalid keyword block * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordBlockInvalid(const QString &block); + std::string KeywordBlockInvalid(const std::string block); /** * This error has been deprecated and should not be used in new code. * * @param block - The name of the block with the missing start tag - * @param found - The QString found in the place of the missing block start + * @param found - The std::string found in the place of the missing block start * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordBlockStartMissing(const QString &block, const QString &found); + std::string KeywordBlockStartMissing(const std::string block, const std::string found); /** * This error has been deprecated and should not be used in new code. * * @param block - The name of the block with the missing end tag - * @param found - The QString found in the place of the missing block end + * @param found - The std::string found in the place of the missing block end * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordBlockEndMissing(const QString &block, const QString &found); + std::string KeywordBlockEndMissing(const std::string block, const std::string found); /** * This error should be used when a supplied keyword does not appear in @@ -123,10 +123,10 @@ namespace Isis { * * @param key - The name of the keyword which is bad * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordValueBad(const QString &key); + std::string KeywordValueBad(const std::string key); /** * This error should be used when the value of a supplied keyword is @@ -135,10 +135,10 @@ namespace Isis { * @param key - The keyword name which is bad * @param value - The value of the keyword which is bad * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordValueBad(const QString &key, const QString &value); + std::string KeywordValueBad(const std::string key, const std::string value); /** * This error should be used when the value of a supplied keyword was @@ -146,10 +146,10 @@ namespace Isis { * * @param key - The keyword name which is bad * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordValueExpected(const QString &key); + std::string KeywordValueExpected(const std::string key); /** * This error should be used when the value of a supplied keyword is @@ -160,11 +160,11 @@ namespace Isis { * @param range - The minimum and maximum allowed values for the keyword * formatted and inserted into a QString * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordValueNotInRange(const QString &key, const QString &value, - const QString &range); + std::string KeywordValueNotInRange(const std::string key, const std::string value, + const std::string range); /** * This error should be used when the value of a supplied keyword is @@ -174,11 +174,11 @@ namespace Isis { * @param value - The value of the keyword * @param list - A vector of all the legal values for the keyword * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString KeywordValueNotInList(const QString &key, const QString &value, - const std::vector &list); + std::string KeywordValueNotInList(const std::string key, const std::string value, + const std::vector &list); /** * This error should be used when a delimiter is missing. diff --git a/isis/src/core/src/KeywordAmbiguous.cpp b/isis/src/core/src/KeywordAmbiguous.cpp index 4d7d56480a..a25d783d67 100644 --- a/isis/src/core/src/KeywordAmbiguous.cpp +++ b/isis/src/core/src/KeywordAmbiguous.cpp @@ -8,6 +8,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordAmbiguous(const QString &key) { +std::string Isis::Message::KeywordAmbiguous(const std::string key) { return "Keyword [" + key + "] ambiguous"; } diff --git a/isis/src/core/src/KeywordBlockEndMissing.cpp b/isis/src/core/src/KeywordBlockEndMissing.cpp index da323fdfe1..8cf7633756 100644 --- a/isis/src/core/src/KeywordBlockEndMissing.cpp +++ b/isis/src/core/src/KeywordBlockEndMissing.cpp @@ -8,6 +8,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordBlockEndMissing(const QString &block, const QString &found) { +std::string Isis::Message::KeywordBlockEndMissing(const std::string block, const std::string found) { return "Expecting end of keyword block [" + block + "] but found [" + found + "]"; } diff --git a/isis/src/core/src/KeywordBlockInvalid.cpp b/isis/src/core/src/KeywordBlockInvalid.cpp index 93876aff7c..b4b9d5fae2 100644 --- a/isis/src/core/src/KeywordBlockInvalid.cpp +++ b/isis/src/core/src/KeywordBlockInvalid.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordBlockInvalid(const QString &block) { +std::string Isis::Message::KeywordBlockInvalid(const std::string block) { return "Keyword block [" + block + "] is invalid"; } diff --git a/isis/src/core/src/KeywordBlockStartMissing.cpp b/isis/src/core/src/KeywordBlockStartMissing.cpp index 8582af59bc..a52fbb1612 100644 --- a/isis/src/core/src/KeywordBlockStartMissing.cpp +++ b/isis/src/core/src/KeywordBlockStartMissing.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordBlockStartMissing(const QString &block, const QString &found) { +std::string Isis::Message::KeywordBlockStartMissing(const std::string block, const std::string found) { return "Expecting start of keyword block [" + block + "] but found [" + found + "]"; } diff --git a/isis/src/core/src/KeywordDuplicated.cpp b/isis/src/core/src/KeywordDuplicated.cpp index 3a05e2078e..31cfbf775b 100644 --- a/isis/src/core/src/KeywordDuplicated.cpp +++ b/isis/src/core/src/KeywordDuplicated.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordDuplicated(const QString &key) { +std::string Isis::Message::KeywordDuplicated(const std::string key) { return "Keyword [" + key + "] duplicated"; } diff --git a/isis/src/core/src/KeywordNotArray.cpp b/isis/src/core/src/KeywordNotArray.cpp index 9b5895cd1d..75bde43971 100644 --- a/isis/src/core/src/KeywordNotArray.cpp +++ b/isis/src/core/src/KeywordNotArray.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordNotArray(const QString &key) { +std::string Isis::Message::KeywordNotArray(const std::string key) { return "Keyword [" + key + "] is not an array"; } diff --git a/isis/src/core/src/KeywordNotFound.cpp b/isis/src/core/src/KeywordNotFound.cpp index c5e62e63c5..f7966e1927 100644 --- a/isis/src/core/src/KeywordNotFound.cpp +++ b/isis/src/core/src/KeywordNotFound.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordNotFound(const QString &key) { +std::string Isis::Message::KeywordNotFound(const std::string key) { return "Keyword [" + key + "] required but was not found"; } diff --git a/isis/src/core/src/KeywordUnrecognized.cpp b/isis/src/core/src/KeywordUnrecognized.cpp index dc887d7658..cf66c43a0c 100644 --- a/isis/src/core/src/KeywordUnrecognized.cpp +++ b/isis/src/core/src/KeywordUnrecognized.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordUnrecognized(const QString &key) { +std::string Isis::Message::KeywordUnrecognized(const std::string key) { return "Keyword [" + key + "] unrecognized"; } diff --git a/isis/src/core/src/KeywordValueBad.cpp b/isis/src/core/src/KeywordValueBad.cpp index fa974c29d8..c0b6648005 100644 --- a/isis/src/core/src/KeywordValueBad.cpp +++ b/isis/src/core/src/KeywordValueBad.cpp @@ -8,19 +8,19 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordValueBad(const QString &key) { +std::string Isis::Message::KeywordValueBad(const std::string key) { return "Keyword [" + key + "] has bad value"; } -QString Isis::Message::KeywordValueBad(const QString &key, const QString &value) { - QString message; +std::string Isis::Message::KeywordValueBad(const std::string key, const std::string value) { + std::string message; message = "Keyword [" + key + "] has bad value ["; if(value.size() <= 20) { message += value + "]"; } else { - message += value.mid(0, 20) + " ...]"; + message += value.substr(0, 20) + " ...]"; } return message; } diff --git a/isis/src/core/src/KeywordValueExpected.cpp b/isis/src/core/src/KeywordValueExpected.cpp index 6fbd197340..035c2cc812 100644 --- a/isis/src/core/src/KeywordValueExpected.cpp +++ b/isis/src/core/src/KeywordValueExpected.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordValueExpected(const QString &key) { +std::string Isis::Message::KeywordValueExpected(const std::string key) { return "Keyword value for [" + key + "] expected but was not found"; } diff --git a/isis/src/core/src/KeywordValueNotInList.cpp b/isis/src/core/src/KeywordValueNotInList.cpp index 4942c5a52f..6d829bc305 100644 --- a/isis/src/core/src/KeywordValueNotInList.cpp +++ b/isis/src/core/src/KeywordValueNotInList.cpp @@ -9,9 +9,9 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordValueNotInList(const QString &key, const QString &value, - const vector &list) { - QString message; +std::string Isis::Message::KeywordValueNotInList(const std::string key, const std::string value, + const vector &list) { + std::string message; message = "Keyword [" + key + "=" + value + "] must be one of ["; for(unsigned int i = 0; i < list.size(); i++) { message += list[i]; diff --git a/isis/src/core/src/KeywordValueNotInRange.cpp b/isis/src/core/src/KeywordValueNotInRange.cpp index b7f3b309bc..fe04ee6c6e 100644 --- a/isis/src/core/src/KeywordValueNotInRange.cpp +++ b/isis/src/core/src/KeywordValueNotInRange.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::KeywordValueNotInRange(const QString &key, const QString &value, const QString &range) { +std::string Isis::Message::KeywordValueNotInRange(const std::string key, const std::string value, const std::string range) { return "Keyword [" + key + "=" + value + "] is not in the range of " + range; } diff --git a/isis/src/core/tests/unitTests/Message/unitTest.cpp b/isis/src/core/tests/unitTests/Message/unitTest.cpp index b7c74661a0..0234db4b6e 100644 --- a/isis/src/core/tests/unitTests/Message/unitTest.cpp +++ b/isis/src/core/tests/unitTests/Message/unitTest.cpp @@ -72,7 +72,7 @@ int main(void) { cout << Message::KeywordValueNotInRange("KEY", "0", "(0,20]") << endl; - vector list; + vector list; list.push_back("X"); list.push_back("Y"); list.push_back("Z"); From 2889ee9422e4b73f3c14a503566e070abda330b6 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Thu, 12 Oct 2023 11:16:15 -0700 Subject: [PATCH 46/95] Updated MissingDelimiter.cpp and deps --- isis/src/base/objs/PvlToken/PvlToken.cpp | 34 +++--- isis/src/base/objs/PvlToken/PvlToken.h | 20 +-- .../base/objs/PvlTokenizer/PvlTokenizer.cpp | 115 ++++++++++-------- .../src/base/objs/PvlTokenizer/PvlTokenizer.h | 16 +-- isis/src/core/include/Message.h | 4 +- isis/src/core/src/MissingDelimiter.cpp | 12 +- 6 files changed, 112 insertions(+), 89 deletions(-) diff --git a/isis/src/base/objs/PvlToken/PvlToken.cpp b/isis/src/base/objs/PvlToken/PvlToken.cpp index 11b7101b69..34cd75f114 100644 --- a/isis/src/base/objs/PvlToken/PvlToken.cpp +++ b/isis/src/base/objs/PvlToken/PvlToken.cpp @@ -16,7 +16,7 @@ namespace Isis { * * @param k Value of the keyword */ - PvlToken::PvlToken(const QString &k) { + PvlToken::PvlToken(const std::string k) { setKey(k); valueClear(); } @@ -35,28 +35,30 @@ namespace Isis { /** * Set the token keyword. * - * @param k IString to load into the token keyword + * @param k std::string to load into the token keyword */ - void PvlToken::setKey(const QString &k) { + void PvlToken::setKey(const std::string k) { m_key = k; }; /** * Returns the token keyword * - * @return QString + * @return std::string */ - QString PvlToken::key() const { + std::string PvlToken::key() const { return m_key; }; /** * Returns the token keyword in all uppercase characters * - * @return QString + * @return std::string */ - QString PvlToken::keyUpper() const { - return m_key.toUpper(); + std::string PvlToken::keyUpper() const { + std::string keyUpper(m_key); + std::transform(keyUpper.begin(), keyUpper.end(), keyUpper.begin(), ::toupper); + return keyUpper; } //! Removes all elements from the value-vector @@ -79,7 +81,7 @@ namespace Isis { * * @param v IString add to the value-vector list */ - void PvlToken::addValue(const QString &v) { + void PvlToken::addValue(const std::string v) { m_value.push_back(v); } @@ -88,11 +90,11 @@ namespace Isis { * * @param index Zero-based index of vector element to return. Defaults to 0 * - * @return QString + * @return std::string * * @throws Isis::IException::Programmer */ - QString PvlToken::value(const int index) const { + std::string PvlToken::value(const int index) const { if((index < 0) || (index >= (int) m_value.size())) { std::string message = Isis::Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); @@ -105,16 +107,18 @@ namespace Isis { * * @param index Zero-based index of vector element to return. Defaults to 0 * - * @return QString + * @return std::string * * @throws Isis::IException::Programmer */ - QString PvlToken::valueUpper(int index) const { + std::string PvlToken::valueUpper(int index) const { if((index < 0) || (index >= (int) m_value.size())) { std::string message = Isis::Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, message, _FILEINFO_); } - - return m_value[index].toUpper(); + + std::string valueUpper(m_value[index]); + std::transform(valueUpper.begin(), valueUpper.end(), valueUpper.begin(), ::toupper); + return valueUpper; } } // end namespace isis diff --git a/isis/src/base/objs/PvlToken/PvlToken.h b/isis/src/base/objs/PvlToken/PvlToken.h index 06d1677698..610ade9874 100644 --- a/isis/src/base/objs/PvlToken/PvlToken.h +++ b/isis/src/base/objs/PvlToken/PvlToken.h @@ -37,27 +37,27 @@ namespace Isis { class PvlToken { private: - QString m_key; //!< Storage for the keyword name - std::vector m_value; /** m_value; /** &valueVector() const { + inline const std::vector &valueVector() const { return m_value; }; }; diff --git a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp index af51308fd6..e8f914b226 100644 --- a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp +++ b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.cpp @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ #include #include +#include #include @@ -36,18 +37,19 @@ namespace Isis { /** * Loads the Token list from a stream. The loading will be terminated upon * reaching either 1) end-of-stream, or - * 2) a programmer specified terminator QString + * 2) a programmer specified terminator std::string * * @param stream The input stream to tokenize * - * @param terminator If the tokenizer see's this QString as a token in the input + * @param terminator If the tokenizer see's this std::string as a token in the input * stream it will cease tokenizing. Defaults to "END" * * @throws Isis::iException::Parse */ - void PvlTokenizer::Load(std::istream &stream, const QString &terminator) { - QString upTerminator(terminator.toUpper()); - QString s; + void PvlTokenizer::Load(std::istream &stream, const std::string terminator) { + std::string upTerminator(terminator); + std::transform(upTerminator.begin(), upTerminator.end(), upTerminator.begin(), ::toupper); + std::string s; int c; bool newlineFound = false; @@ -138,7 +140,7 @@ namespace Isis { ParseCommaList(t, s); } catch(IException &e) { - std::string message = Isis::Message::KeywordValueBad(t.key().toStdString()); + std::string message = Isis::Message::KeywordValueBad(t.key()); throw IException(e, IException::Unknown, message, _FILEINFO_); } tokens.push_back(t); @@ -152,7 +154,7 @@ namespace Isis { ParseCommaList(t, s); } catch(IException &e) { - std::string message = Isis::Message::KeywordValueBad(t.key().toStdString()); + std::string message = Isis::Message::KeywordValueBad(t.key()); throw IException(e, IException::Unknown, message, _FILEINFO_); } tokens.push_back(t); @@ -165,7 +167,7 @@ namespace Isis { s = ReadToDoubleQuote(stream); } catch(IException &e) { - std::string message = Isis::Message::KeywordValueBad(t.key().toStdString()); + std::string message = Isis::Message::KeywordValueBad(t.key()); throw IException(e, IException::Unknown, message, _FILEINFO_); } t.addValue(s); @@ -179,7 +181,7 @@ namespace Isis { s = ReadToSingleQuote(stream); } catch(IException &e) { - std::string message = Isis::Message::KeywordValueBad(t.key().toStdString()); + std::string message = Isis::Message::KeywordValueBad(t.key()); throw IException(IException::Unknown, message, _FILEINFO_); } t.addValue(s); @@ -200,10 +202,10 @@ namespace Isis { * * @param stream Input stream to read from * - * @return QString + * @return std::string */ - QString PvlTokenizer::ReadComment(std::istream &stream) { - QString s; + std::string PvlTokenizer::ReadComment(std::istream &stream) { + std::string s; int c; c = stream.get(); @@ -228,10 +230,10 @@ namespace Isis { * * @param stream Input stream to read from * - * @return QString + * @return std::string */ - QString PvlTokenizer::ReadToken(std::istream &stream) { - QString s; + std::string PvlTokenizer::ReadToken(std::istream &stream) { + std::string s; int c; c = stream.get(); @@ -274,15 +276,15 @@ namespace Isis { } - QString PvlTokenizer::ReadToDoubleQuote(std::istream &stream) { - QString s; + std::string PvlTokenizer::ReadToDoubleQuote(std::istream &stream) { + std::string s; int c; do { c = stream.get(); ValidateCharacter(c); if(c == EOF) { - QString message = Isis::Message::MissingDelimiter('"', s); + std::string message = Isis::Message::MissingDelimiter('"', s); throw IException(IException::Unknown, message, _FILEINFO_); } else if(c != '"') { @@ -291,36 +293,43 @@ namespace Isis { } while(c != '"'); - int pos = s.indexOf(QRegExp("[\\n\\r]")); + std::regex re("[\\n\\r]"); + std::smatch sm; + + std::regex_match(s, sm, re); + int pos = sm.position(1); while(pos != -1) { - QString first = s.mid(0, pos); + std::string first = s.substr(0, pos); bool addspace = false; if(first[pos-1] == ' ') addspace = true; - first = first.remove(QRegExp("[\\s]*$")); - QString second = s.mid(pos + 1); + std::regex e("[\\s]*$"); + first = std::regex_replace(first, e, ""); + std::string second = s.substr(pos + 1); if(second[0] == ' ') addspace = true; if(second[0] == '\r') addspace = true; if(second[0] == '\n') addspace = true; - second = second.remove(QRegExp("^[\\s]*")); + e = ("^[\\s]*"); + second = std::regex_replace(second, e, ""); if(second[0] == ',') addspace = false; s = first; if(addspace) s += " "; s += second; - pos = s.indexOf(QRegExp("[\\n\\r]")); + std::regex_match(s, sm, re); + pos = sm.position(1); } return s; } - QString PvlTokenizer::ReadToSingleQuote(std::istream &stream) { - QString s; + std::string PvlTokenizer::ReadToSingleQuote(std::istream &stream) { + std::string s; int c; do { c = stream.get(); ValidateCharacter(c); if(c == EOF) { - QString message = Isis::Message::MissingDelimiter('\'', s); + std::string message = Isis::Message::MissingDelimiter('\'', s); throw IException(IException::Unknown, message, _FILEINFO_); } else if(c != '\'') { @@ -329,29 +338,37 @@ namespace Isis { } while(c != '\''); - int pos = s.indexOf(QRegExp("[\\n\\r]")); + std::regex re("[\\n\\r]"); + std::smatch sm; + + std::regex_match(s, sm, re); + int pos = sm.position(1); while(pos != -1) { - QString first = s.mid(0, pos); + std::string first = s.substr(0, pos); bool addspace = false; if(first[pos-1] == ' ') addspace = true; - first = first.remove(QRegExp("[\\s]*$")); - QString second = s.mid(pos + 1); + std::regex e("[\\s]*$"); + first = std::regex_replace(first, e, ""); + std::string second = s.substr(pos + 1); if(second[0] == ' ') addspace = true; if(second[0] == '\r') addspace = true; if(second[0] == '\n') addspace = true; - second = second.remove(QRegExp("^[\\s]*")); + e = ("^[\\s]*"); + second = std::regex_replace(second, e, ""); if(second[0] == ',') addspace = false; s = first; if(addspace) s += " "; s += second; - pos = s.indexOf(QRegExp("[\\n\\r]")); + + std::regex_match(s, sm, re); + pos = sm.position(1); } return s; } - QString PvlTokenizer::ReadToParen(std::istream &stream) { - QString s; + std::string PvlTokenizer::ReadToParen(std::istream &stream) { + std::string s; int c; int leftParenCount = 1; @@ -359,7 +376,7 @@ namespace Isis { c = stream.get(); ValidateCharacter(c); if(c == EOF) { - QString message = Isis::Message::MissingDelimiter(')', s); + std::string message = Isis::Message::MissingDelimiter(')', s); throw IException(IException::Unknown, message, _FILEINFO_); } else if(c == '"') { @@ -367,7 +384,7 @@ namespace Isis { s += "\"" + ReadToDoubleQuote(stream) + "\""; } catch(IException &) { - QString message = Isis::Message::MissingDelimiter('"', s); + std::string message = Isis::Message::MissingDelimiter('"', s); throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -376,7 +393,7 @@ namespace Isis { s += "'" + ReadToSingleQuote(stream) + "'"; } catch(IException &) { - QString message = Isis::Message::MissingDelimiter('\'', s); + std::string message = Isis::Message::MissingDelimiter('\'', s); throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -394,8 +411,8 @@ namespace Isis { return s; } - QString PvlTokenizer::ReadToBrace(std::istream &stream) { - QString s; + std::string PvlTokenizer::ReadToBrace(std::istream &stream) { + std::string s; int c; int leftBraceCount = 1; @@ -403,7 +420,7 @@ namespace Isis { c = stream.get(); ValidateCharacter(c); if(c == EOF) { - QString message = Isis::Message::MissingDelimiter('}', s); + std::string message = Isis::Message::MissingDelimiter('}', s); throw IException(IException::Unknown, message, _FILEINFO_); } else if(c == '"') { @@ -411,7 +428,7 @@ namespace Isis { s += "\"" + ReadToDoubleQuote(stream) + "\""; } catch(IException &e) { - QString message = Isis::Message::MissingDelimiter('"', s); + std::string message = Isis::Message::MissingDelimiter('"', s); throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -420,7 +437,7 @@ namespace Isis { s += "'" + ReadToSingleQuote(stream) + "'"; } catch(IException &) { - QString message = Isis::Message::MissingDelimiter('\'', s); + std::string message = Isis::Message::MissingDelimiter('\'', s); throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -439,17 +456,17 @@ namespace Isis { } /** - * This routine parses a QString containing a comma separated list. Each of the + * This routine parses a std::string containing a comma separated list. Each of the * items in the list is stored as a value in the Token. * * @param t Token to load the comma separated list * - * @param cl QString containing comma separated list + * @param cl std::string containing comma separated list */ - void PvlTokenizer::ParseCommaList(Isis::PvlToken &t, const QString &cl) { - stringstream stream(cl.toLatin1().data()); + void PvlTokenizer::ParseCommaList(Isis::PvlToken &t, const std::string cl) { + stringstream stream(cl); int c; - QString s; + std::string s; do { SkipWhiteSpace(stream); @@ -499,7 +516,7 @@ namespace Isis { if(isspace(c)) return; if(c == '\0') return; - QString message = "ASCII data expected but found unprintable (binary) data"; + std::string message = "ASCII data expected but found unprintable (binary) data"; throw IException(IException::Unknown, message, _FILEINFO_); } } // end namespace isis diff --git a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.h b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.h index 2138d2c5f7..e8d702a086 100644 --- a/isis/src/base/objs/PvlTokenizer/PvlTokenizer.h +++ b/isis/src/base/objs/PvlTokenizer/PvlTokenizer.h @@ -80,21 +80,21 @@ namespace Isis { the stream*/ - QString ReadComment(std::istream &stream); - QString ReadToken(std::istream &stream); + std::string ReadComment(std::istream &stream); + std::string ReadToken(std::istream &stream); bool SkipWhiteSpace(std::istream &stream); - QString ReadToSingleQuote(std::istream &stream); - QString ReadToDoubleQuote(std::istream &stream); - QString ReadToParen(std::istream &stream); - QString ReadToBrace(std::istream &stream); - void ParseCommaList(Isis::PvlToken &t, const QString &cl); + std::string ReadToSingleQuote(std::istream &stream); + std::string ReadToDoubleQuote(std::istream &stream); + std::string ReadToParen(std::istream &stream); + std::string ReadToBrace(std::istream &stream); + void ParseCommaList(Isis::PvlToken &t, const std::string cl); void ValidateCharacter(int c); public: PvlTokenizer(); ~PvlTokenizer(); - void Load(std::istream &stream, const QString &terminator = "END"); + void Load(std::istream &stream, const std::string terminator = "END"); void Clear(); std::vector & GetTokenList(); diff --git a/isis/src/core/include/Message.h b/isis/src/core/include/Message.h index d4b822fd2c..e484dd4b44 100644 --- a/isis/src/core/include/Message.h +++ b/isis/src/core/include/Message.h @@ -188,7 +188,7 @@ namespace Isis { * @return QString - A standardized Isis error message with the parameter * inserted */ - QString MissingDelimiter(const char delimiter); + std::string MissingDelimiter(const char delimiter); /** * This error should be used when a delimiter is missing. @@ -199,7 +199,7 @@ namespace Isis { * @return QString - A standardized Isis error message with the parameter * inserted */ - QString MissingDelimiter(const char delimiter, const QString &near); + std::string MissingDelimiter(const char delimiter, const std::string near); /** * This error should be used when a file could not be opened. diff --git a/isis/src/core/src/MissingDelimiter.cpp b/isis/src/core/src/MissingDelimiter.cpp index 5227ecffe4..78a37d41cc 100644 --- a/isis/src/core/src/MissingDelimiter.cpp +++ b/isis/src/core/src/MissingDelimiter.cpp @@ -12,18 +12,20 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::MissingDelimiter(char d) { - return "Missing delimiter [" + toString(d) + "]"; +std::string Isis::Message::MissingDelimiter(char d) { + std::string del(1, d); + return "Missing delimiter [" + del + "]"; } -QString Isis::Message::MissingDelimiter(char d, const QString &near) { - QString message = "Missing delimiter [" + toString(d) + "] at or near ["; +std::string Isis::Message::MissingDelimiter(char d, const std::string near) { + std::string del(1, d); + std::string message = "Missing delimiter [" + del + "] at or near ["; if(near.size() <= 20) { message += near + "]"; } else { - message += near.mid(0, 20) + " ...]"; + message += near.substr(0, 20) + " ...]"; } return message; From b19b4c5396dd1326676ed629cc4f32b112f14ef9 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Thu, 12 Oct 2023 11:24:44 -0700 Subject: [PATCH 47/95] Updated MemoryAllocFailed --- isis/src/base/objs/Buffer/Buffer.cpp | 2 +- isis/src/core/include/Message.h | 4 ++-- isis/src/core/src/MemoryAllocationFailed.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/isis/src/base/objs/Buffer/Buffer.cpp b/isis/src/base/objs/Buffer/Buffer.cpp index 1d35870977..a896a36e73 100644 --- a/isis/src/base/objs/Buffer/Buffer.cpp +++ b/isis/src/base/objs/Buffer/Buffer.cpp @@ -361,7 +361,7 @@ namespace Isis { p_buf = NULL; p_rawbuf = NULL; } - QString message = Message::MemoryAllocationFailed(); + std::string message = Message::MemoryAllocationFailed(); throw IException(IException::Unknown, message, _FILEINFO_); } } diff --git a/isis/src/core/include/Message.h b/isis/src/core/include/Message.h index e484dd4b44..788897b5d0 100644 --- a/isis/src/core/include/Message.h +++ b/isis/src/core/include/Message.h @@ -245,10 +245,10 @@ namespace Isis { * This error should be used when an error accrues during a memory * allocation such as "new". * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString MemoryAllocationFailed(); + std::string MemoryAllocationFailed(); } } diff --git a/isis/src/core/src/MemoryAllocationFailed.cpp b/isis/src/core/src/MemoryAllocationFailed.cpp index 24ef183d1a..2fcb743740 100644 --- a/isis/src/core/src/MemoryAllocationFailed.cpp +++ b/isis/src/core/src/MemoryAllocationFailed.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::MemoryAllocationFailed() { +std::string Isis::Message::MemoryAllocationFailed() { return "Unable to allocate dynamic memory"; } From 97088ed630cf0f8d676f55eea229f55af674ba29 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Mon, 16 Oct 2023 11:28:38 -0700 Subject: [PATCH 48/95] compiling updates --- .../apollo/apps/apollofindrx/apollofindrx.cpp | 4 +-- isis/src/apollo/apps/apollopaninit/main.cpp | 2 +- .../apollo/apps/apolloremrx/apolloremrx.cpp | 2 +- isis/src/apollo/apps/apollowarp/main.cpp | 4 +-- isis/src/apollo/objs/Apollo/Apollo.h | 4 +-- .../ApolloMetricCamera/ApolloMetricCamera.cpp | 2 +- .../ApolloPanoramicCamera.cpp | 2 +- .../apps/appjit/LineScanCameraRotation.cpp | 4 +-- isis/src/base/apps/appjit/PixelOffset.cpp | 2 +- isis/src/base/apps/barscale/main.cpp | 6 ++-- isis/src/base/apps/blend/main.cpp | 4 +-- isis/src/base/apps/caminfo/caminfo.cpp | 4 +-- isis/src/base/apps/campt/campt.cpp | 2 +- isis/src/base/apps/center/main.cpp | 2 +- isis/src/base/apps/crop/crop.cpp | 4 +-- isis/src/base/apps/cropspecial/main.cpp | 2 +- isis/src/base/apps/cubenorm/main.cpp | 4 +-- .../src/base/apps/framestitch/framestitch.cpp | 6 ++-- isis/src/base/apps/hist/hist.cpp | 2 +- isis/src/base/apps/isis2fits/main.cpp | 2 +- isis/src/base/apps/isisexport/isisexport.cpp | 2 +- isis/src/base/apps/makeflat/main.cpp | 4 +-- isis/src/base/apps/mappt/mappt.cpp | 4 +-- isis/src/base/apps/maptemplate/main.cpp | 4 +-- .../base/objs/LinearAlgebra/LinearAlgebra.cpp | 12 +++---- .../ProcessMapMosaic/ProcessMapMosaic.cpp | 10 +++--- .../base/objs/ProcessMosaic/ProcessMosaic.cpp | 8 ++--- isis/src/base/objs/Projection/Projection.cpp | 2 +- .../ProjectionFactory/ProjectionFactory.cpp | 6 ++-- .../PushFrameCameraCcdLayout/unitTest.cpp | 4 +-- isis/src/base/objs/QtExporter/QtExporter.cpp | 2 +- .../RingPlaneProjection.cpp | 4 +-- isis/src/base/objs/ShapeModel/ShapeModel.cpp | 2 +- .../ShapeModelFactory/ShapeModelFactory.cpp | 14 ++++---- isis/src/base/objs/Spice/Spice.cpp | 22 ++++++------- .../base/objs/SpicePosition/SpicePosition.cpp | 16 +++++----- .../base/objs/SpiceRotation/SpiceRotation.cpp | 32 +++++++++---------- isis/src/base/objs/Statistics/Statistics.cpp | 4 +-- isis/src/base/objs/Stretch/Stretch.cpp | 2 +- .../src/base/objs/TProjection/TProjection.cpp | 12 +++---- isis/src/cassini/apps/ciss2isis/ciss2isis.cpp | 2 +- isis/src/cassini/apps/cisscal/DarkCurrent.cpp | 2 +- .../objs/BundleAdjust/BundleAdjust.cpp | 8 ++--- .../objs/BundleSettings/BundleSettings.cpp | 2 +- isis/src/core/src/Pvl.cpp | 6 ++-- isis/src/system/apps/blobdump/main.cpp | 2 +- .../apps/tgocassisstitch/tgocassisstitch.cpp | 2 +- .../objs/TgoCassisCamera/TgoCassisCamera.cpp | 2 +- isis/src/viking/apps/vikcal/CalParameters.cpp | 10 +++--- isis/src/voyager/apps/voy2isis/main.cpp | 4 +-- isis/tests/FunctionalTestsIsisImport.cpp | 1 - .../FunctionalTestsIsisImportCassiniISS.cpp | 1 - isis/tests/FunctionalTestsIsisImportEis.cpp | 1 - .../FunctionalTestsIsisImportKaguyaMI.cpp | 1 - .../FunctionalTestsIsisImportKaguyaTC.cpp | 1 - isis/tests/FunctionalTestsIsisImportLo.cpp | 1 - .../tests/FunctionalTestsIsisImportLroNac.cpp | 1 - isis/tests/FunctionalTestsIsisImportMerMI.cpp | 1 - 58 files changed, 135 insertions(+), 143 deletions(-) diff --git a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp b/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp index fc37181964..3b517ad17c 100644 --- a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp +++ b/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp @@ -58,7 +58,7 @@ namespace Isis { QString instrument = (cube->label()->findGroup("Instrument",Pvl::Traverse))["InstrumentId"]; Apollo apollo(mission, instrument); if (mission.mid(0,6) != "APOLLO") { - QString msg = "This application is for use with Apollo spacecrafts only."; + std::string msg = "This application is for use with Apollo spacecrafts only."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -163,7 +163,7 @@ namespace Isis { reseaus["Status"] = "Refined"; } else { - QString msg = "No Reseaus located. Labels will not be changed."; + std::string msg = "No Reseaus located. Labels will not be changed."; msg += "Try changing the registration parameters."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/apollo/apps/apollopaninit/main.cpp b/isis/src/apollo/apps/apollopaninit/main.cpp index d22d990508..84e8269eb7 100644 --- a/isis/src/apollo/apps/apollopaninit/main.cpp +++ b/isis/src/apollo/apps/apollopaninit/main.cpp @@ -617,7 +617,7 @@ void IsisMain() { FileName fiducialFileName("$apollo15/calibration/ApolloPanFiducialMark.cub"); fidC.open(fiducialFileName.expanded(),"r"); if( !fidC.isOpen() ) { - QString msg = "Unable to open the fiducial patternS cube: ApolloPanFiducialMark.cub\n"; + std::string msg = "Unable to open the fiducial patternS cube: ApolloPanFiducialMark.cub\n"; throw IException(IException::User, msg, _FILEINFO_); } refL = fidC.lineCount(); diff --git a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp b/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp index d9318aa800..6d85ef4574 100644 --- a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp +++ b/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp @@ -50,7 +50,7 @@ namespace Isis { QString spacecraft = (info->group("Instrument")["SpacecraftName"]); QString instrument = (info->group("Instrument")["InstrumentId"]); if (spacecraft.mid(0,6) != "APOLLO") { - QString msg = "This application is for use with Apollo spacecrafts only. "; + std::string msg = "This application is for use with Apollo spacecrafts only. "; throw IException(IException::Unknown, msg, _FILEINFO_); } Apollo apollo(spacecraft, instrument); diff --git a/isis/src/apollo/apps/apollowarp/main.cpp b/isis/src/apollo/apps/apollowarp/main.cpp index a554a26757..25bd0fe8c9 100644 --- a/isis/src/apollo/apps/apollowarp/main.cpp +++ b/isis/src/apollo/apps/apollowarp/main.cpp @@ -29,11 +29,11 @@ void IsisMain() { PvlGroup &reseaus = ipacket->group("Reseaus"); QString mission = (ipacket->group("Instrument"))["SpacecraftName"]; if (mission.mid(0,6) != "APOLLO") { - QString msg = "This application is for use with Apollo spacecrafts only. "; + std::string msg = "This application is for use with Apollo spacecrafts only. "; throw IException(IException::Unknown, msg, _FILEINFO_); } if ((QString)reseaus["Status"] != "Refined" && (QString)reseaus["Status"] != "Removed") { - QString msg = "This application can only be run after findapollorx."; + std::string msg = "This application can only be run after findapollorx."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/apollo/objs/Apollo/Apollo.h b/isis/src/apollo/objs/Apollo/Apollo.h index d5e6c11c64..faed80550f 100644 --- a/isis/src/apollo/objs/Apollo/Apollo.h +++ b/isis/src/apollo/objs/Apollo/Apollo.h @@ -57,7 +57,7 @@ namespace Isis { else if (filename.mid(0,4) == "AS17") spacecraft = "APOLLO 17"; // throw an error else { - QString msg = "The image filename does not match the required formatting."; + std::string msg = "The image filename does not match the required formatting."; throw IException(IException::User,msg,_FILEINFO_); } @@ -66,7 +66,7 @@ namespace Isis { else if (filename.mid(5,1) == "H") instrument = "HASSELBLAD"; // throw an error else { - QString msg = "The image filename does not match the required formatting."; + std::string msg = "The image filename does not match the required formatting."; throw IException(IException::User,msg,_FILEINFO_); } diff --git a/isis/src/apollo/objs/ApolloMetricCamera/ApolloMetricCamera.cpp b/isis/src/apollo/objs/ApolloMetricCamera/ApolloMetricCamera.cpp index fbab806e38..28982c394e 100644 --- a/isis/src/apollo/objs/ApolloMetricCamera/ApolloMetricCamera.cpp +++ b/isis/src/apollo/objs/ApolloMetricCamera/ApolloMetricCamera.cpp @@ -75,7 +75,7 @@ namespace Isis { m_spacecraftNameShort = "Apollo17"; } else { - QString msg = "File does not appear to be an Apollo image"; + std::string msg = "File does not appear to be an Apollo image"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicCamera.cpp b/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicCamera.cpp index 8b485ca84d..cc41d6b203 100644 --- a/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicCamera.cpp +++ b/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicCamera.cpp @@ -63,7 +63,7 @@ namespace Isis { m_spacecraftNameShort = "Apollo17"; } else { - QString msg = "File does not appear to be an Apollo image"; + std::string msg = "File does not appear to be an Apollo image"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/appjit/LineScanCameraRotation.cpp b/isis/src/base/apps/appjit/LineScanCameraRotation.cpp index 245429100a..bb23710744 100644 --- a/isis/src/base/apps/appjit/LineScanCameraRotation.cpp +++ b/isis/src/base/apps/appjit/LineScanCameraRotation.cpp @@ -45,7 +45,7 @@ namespace Isis { // Make sure the kernels are written to the labels and not just the tables (blobs) Pvl &lab = *cube.label(); if(!p_spi->hasKernels(lab)) { - QString msg = "The master file must contain the kernel files. Rerun spiceinit with attach=no"; + std::string msg = "The master file must contain the kernel files. Rerun spiceinit with attach=no"; throw IException(IException::User, msg, _FILEINFO_); } @@ -199,7 +199,7 @@ namespace Isis { // Make sure caches are already loaded if(!p_cachesLoaded) { - QString msg = "A LineScanCameraRotation cache has not been loaded yet"; + std::string msg = "A LineScanCameraRotation cache has not been loaded yet"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/appjit/PixelOffset.cpp b/isis/src/base/apps/appjit/PixelOffset.cpp index 62fc1f8448..ff1b3ce863 100644 --- a/isis/src/base/apps/appjit/PixelOffset.cpp +++ b/isis/src/base/apps/appjit/PixelOffset.cpp @@ -60,7 +60,7 @@ namespace Isis { for(size_t iline = 0; iline < lines.size(); iline++) { fields = lines[iline].simplified().split(" ", Qt::SkipEmptyParts); if(fields.count() != 3) { - QString msg = "Three fields are required: sample, line, and ephemeris time."; + std::string msg = "Three fields are required: sample, line, and ephemeris time."; throw IException(IException::Io, msg, _FILEINFO_); } p_samples.push_back(toDouble(fields[0])); diff --git a/isis/src/base/apps/barscale/main.cpp b/isis/src/base/apps/barscale/main.cpp index 12d74f3816..d1179ee8b3 100644 --- a/isis/src/base/apps/barscale/main.cpp +++ b/isis/src/base/apps/barscale/main.cpp @@ -63,7 +63,7 @@ void IsisMain() { leftSegs = ui.GetInteger("LEFTSEGS"); } else { - QString msg = "Number of segments was not specified for left side of scale - " + std::string msg = "Number of segments was not specified for left side of scale - " "must be at least 1"; throw IException(IException::User, msg, _FILEINFO_); } @@ -94,7 +94,7 @@ void IsisMain() { } else { if (!ui.WasEntered("CORNERLINE") || !ui.WasEntered("CORNERSAMPLE") ) { - QString msg = "The upper left placement of the scale bar must be specified "; + std::string msg = "The upper left placement of the scale bar must be specified "; msg = msg + "if you are not padding the image."; throw IException(IException::User, msg, _FILEINFO_); } @@ -106,7 +106,7 @@ void IsisMain() { // scale will be printed at int barHeight = ui.GetInteger("BARHEIGHT"); if (barHeight < 5) { - QString msg = "Requested BARHEIGHT is too small to produce a bar scale"; + std::string msg = "Requested BARHEIGHT is too small to produce a bar scale"; throw IException(IException::User, msg, _FILEINFO_); } int barWidth = ( (rightLimit + leftLimit) * scaleUnit) / resolution + .5; diff --git a/isis/src/base/apps/blend/main.cpp b/isis/src/base/apps/blend/main.cpp index 56fc8e6bb4..e44556c0a0 100644 --- a/isis/src/base/apps/blend/main.cpp +++ b/isis/src/base/apps/blend/main.cpp @@ -130,7 +130,7 @@ void IsisMain() { FileList inputs(ui.GetFileName("FROMLIST")); if (inputs.size() < 2) { - QString msg = "FROMLIST must have at least two images to blend"; + std::string msg = "FROMLIST must have at least two images to blend"; throw IException(IException::User, msg, _FILEINFO_); } @@ -284,7 +284,7 @@ Chip * createRamp(Chip *pic1, Chip *pic2, int stop) { int y = pic1->Lines(); if (x != pic2->Samples() || y != pic2->Lines()) { - QString msg = "The two pictures need to be of the exact same dimensions"; + std::string msg = "The two pictures need to be of the exact same dimensions"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/caminfo/caminfo.cpp b/isis/src/base/apps/caminfo/caminfo.cpp index 8aea7f82b4..ee534b4c37 100644 --- a/isis/src/base/apps/caminfo/caminfo.cpp +++ b/isis/src/base/apps/caminfo/caminfo.cpp @@ -217,7 +217,7 @@ namespace Isis{ QString sFormat = ui.GetAsString("FORMAT"); if (!ui.GetBoolean("CAMSTATS") && ui.GetBoolean("USECAMSTATSTBL")){ - QString msg = "[CAMSTATS] must be set to true when using [USECAMSTATSTBL]."; + std::string msg = "[CAMSTATS] must be set to true when using [USECAMSTATSTBL]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -448,7 +448,7 @@ namespace Isis{ } } if (!found) { - QString msg = "Footprint blob was not found in input image history"; + std::string msg = "Footprint blob was not found in input image history"; throw IException(IException::User, msg, _FILEINFO_); } QString prec = (QString)fpgrp.findKeyword("INCREASEPRECISION"); diff --git a/isis/src/base/apps/campt/campt.cpp b/isis/src/base/apps/campt/campt.cpp index 74ddd8395f..58a45412ec 100644 --- a/isis/src/base/apps/campt/campt.cpp +++ b/isis/src/base/apps/campt/campt.cpp @@ -77,7 +77,7 @@ namespace Isis{ reader.read(FileName(ui.GetFileName("COORDLIST")).expanded()); if (!reader.isTableValid(reader.getTable()) || reader.columns() != 2) { - QString msg = "Coordinate file formatted incorrectly.\n" + std::string msg = "Coordinate file formatted incorrectly.\n" "Each row must have two columns: a sample,line or a latitude,longitude pair."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/center/main.cpp b/isis/src/base/apps/center/main.cpp index dc1f6b8230..389c92cf3c 100644 --- a/isis/src/base/apps/center/main.cpp +++ b/isis/src/base/apps/center/main.cpp @@ -26,7 +26,7 @@ void IsisMain() { // Setup the input cube Cube *icube = p.SetInputCube("FROM"); if (icube->bandCount() != 1) { - QString msg = "center only works for single-band images."; + std::string msg = "center only works for single-band images."; throw IException(IException::User, msg, _FILEINFO_); } sumall.Reset(); diff --git a/isis/src/base/apps/crop/crop.cpp b/isis/src/base/apps/crop/crop.cpp index 6943e20c3a..7bd02b1957 100644 --- a/isis/src/base/apps/crop/crop.cpp +++ b/isis/src/base/apps/crop/crop.cpp @@ -80,13 +80,13 @@ namespace Isis { // Make sure starting positions fall within the cube if (ss > cube->sampleCount()) { cube->close(); - QString msg = "[SAMPLE] exceeds number of samples in the [FROM] cube"; + std::string msg = "[SAMPLE] exceeds number of samples in the [FROM] cube"; throw IException(IException::User, msg, _FILEINFO_); } if (sl > cube->lineCount()) { cube->close(); - QString msg = "[LINE] exceeds number of lines in the [FROM] cube"; + std::string msg = "[LINE] exceeds number of lines in the [FROM] cube"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/cropspecial/main.cpp b/isis/src/base/apps/cropspecial/main.cpp index 95c51efc54..1750c8999e 100644 --- a/isis/src/base/apps/cropspecial/main.cpp +++ b/isis/src/base/apps/cropspecial/main.cpp @@ -55,7 +55,7 @@ void IsisMain() { if (g_minSample == cube.sampleCount() + 1) { cube.close(); - QString msg = "There are no valid pixels in the [FROM] cube"; + std::string msg = "There are no valid pixels in the [FROM] cube"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/cubenorm/main.cpp b/isis/src/base/apps/cubenorm/main.cpp index e33e4c545b..51b19bde26 100644 --- a/isis/src/base/apps/cubenorm/main.cpp +++ b/isis/src/base/apps/cubenorm/main.cpp @@ -60,7 +60,7 @@ void IsisMain() { // parameters. UserInterface &ui = Application::GetUserInterface(); if(!(ui.WasEntered("TO")) && !(ui.WasEntered("STATS"))) { - QString msg = "User must specify a TO and/or STATS file."; + std::string msg = "User must specify a TO and/or STATS file."; throw IException(IException::User, msg, _FILEINFO_); } @@ -123,7 +123,7 @@ void IsisMain() { if(ui.GetString("MODE") == "MULTIPLY") { for(unsigned int i = 0; i < st.size(); i++) { if(IsValidPixel(normalizer[i]) && normalizer[i] <= 0.0) { - QString msg = "Cube file can not be normalized with [MULTIPLY] "; + std::string msg = "Cube file can not be normalized with [MULTIPLY] "; msg += "option, some column averages <= 0.0"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/framestitch/framestitch.cpp b/isis/src/base/apps/framestitch/framestitch.cpp index 52c8246a36..03be752106 100644 --- a/isis/src/base/apps/framestitch/framestitch.cpp +++ b/isis/src/base/apps/framestitch/framestitch.cpp @@ -98,7 +98,7 @@ namespace Isis { if (evenCube->sampleCount() != oddCube->sampleCount() || evenCube->lineCount() != oddCube->lineCount() || evenCube->bandCount() != oddCube->bandCount()) { - QString msg = "Even and odd cube dimensions must match."; + std::string msg = "Even and odd cube dimensions must match."; throw IException(IException::User, msg, _FILEINFO_); } @@ -109,13 +109,13 @@ namespace Isis { const PvlGroup &oddInst = oddCube->group("Instrument"); // Use the start time as an indicator of being the same original image if (QString::compare(QString(evenInst["StartTime"]), QString(oddInst["StartTime"])) != 0) { - QString msg = "Even and odd cube start times must match."; + std::string msg = "Even and odd cube start times must match."; throw IException(IException::User, msg, _FILEINFO_); } if (evenInst.hasKeyword("DataFlipped") && oddInst.hasKeyword("DataFlipped")) { if (toBool(evenInst["DataFlipped"]) != toBool(oddInst["DataFlipped"])) { - QString msg = "Both input cubes must be flipped or not flipped. Cannot combine " + std::string msg = "Both input cubes must be flipped or not flipped. Cannot combine " "a flipped and unflipped cube."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/hist/hist.cpp b/isis/src/base/apps/hist/hist.cpp index 7271efd78d..3d6728724c 100644 --- a/isis/src/base/apps/hist/hist.cpp +++ b/isis/src/base/apps/hist/hist.cpp @@ -34,7 +34,7 @@ namespace Isis { Process p; if (!ui.WasEntered("TO") && !ui.IsInteractive()) { - QString msg = "The [TO] parameter must be entered"; + std::string msg = "The [TO] parameter must be entered"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/isis2fits/main.cpp b/isis/src/base/apps/isis2fits/main.cpp index b970ac6c0e..b7c166fe51 100644 --- a/isis/src/base/apps/isis2fits/main.cpp +++ b/isis/src/base/apps/isis2fits/main.cpp @@ -184,7 +184,7 @@ void IsisMain() { ofstream fout; fout.open(to.toLatin1().data(), ios::out | ios::binary); if (!fout.is_open()) { - QString msg = "Cannot open fits output file"; + std::string msg = "Cannot open fits output file"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/isisexport/isisexport.cpp b/isis/src/base/apps/isisexport/isisexport.cpp index 4583a68016..bb2963dded 100644 --- a/isis/src/base/apps/isisexport/isisexport.cpp +++ b/isis/src/base/apps/isisexport/isisexport.cpp @@ -278,7 +278,7 @@ namespace Isis { pds4Type = "IEEE754LSBSingle"; } else { - QString msg = "Unsupported PDS pixel type or sample size"; + std::string msg = "Unsupported PDS pixel type or sample size"; throw Isis::IException(Isis::IException::User, msg, _FILEINFO_); } return pds4Type; diff --git a/isis/src/base/apps/makeflat/main.cpp b/isis/src/base/apps/makeflat/main.cpp index 39e1d72904..7d074ea2b6 100644 --- a/isis/src/base/apps/makeflat/main.cpp +++ b/isis/src/base/apps/makeflat/main.cpp @@ -355,7 +355,7 @@ void IsisMain() { * found a legitimate cube. */ if(numOutputSamples <= 0) { - QString msg = "No valid input cubes were found"; + std::string msg = "No valid input cubes were found"; throw IException(IException::User, msg, _FILEINFO_); } @@ -364,7 +364,7 @@ void IsisMain() { * the input cubes, then we havent found any valid data. */ if(tempFileLength <= 0) { - QString msg = "No valid input data was found"; + std::string msg = "No valid input data was found"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/mappt/mappt.cpp b/isis/src/base/apps/mappt/mappt.cpp index d0d1438884..16bab86a1c 100644 --- a/isis/src/base/apps/mappt/mappt.cpp +++ b/isis/src/base/apps/mappt/mappt.cpp @@ -106,7 +106,7 @@ void mappt(Cube *icube, UserInterface &ui, Pvl *log, CubeAttributeInput* inAtt) } else if(ui.GetString("FORMAT") == "FLAT") { - QString msg = "Flat file must have a name."; + std::string msg = "Flat file must have a name."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -389,7 +389,7 @@ QList< QPair > getMapPoints(const UserInterface &ui, bool usePoi reader.read(FileName(ui.GetFileName("COORDLIST")).expanded()); if (!reader.isTableValid(reader.getTable()) || reader.columns() != 2) { - QString msg = "Coordinate file formatted incorrectly.\n" + std::string msg = "Coordinate file formatted incorrectly.\n" "Each row must have two columns: a sample,line or a latitude,longitude pair."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/maptemplate/main.cpp b/isis/src/base/apps/maptemplate/main.cpp index 0285a9ce6a..98fb338dba 100644 --- a/isis/src/base/apps/maptemplate/main.cpp +++ b/isis/src/base/apps/maptemplate/main.cpp @@ -466,7 +466,7 @@ void addTarget(PvlGroup &mapping) { radii = Target::radiiGroup(targetName); } catch (IException &e) { - QString msg = "Unable to find target radii automatically. " + std::string msg = "Unable to find target radii automatically. " "User must provide EQRADIUS and POLRADIUS values for this target."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -583,7 +583,7 @@ void calcRange(double &minLat, double &maxLat, radii = Target::radiiGroup(cubeLab, radii); } catch (IException &e) { - QString msg = "Unable to find target radii automatically. " + std::string msg = "Unable to find target radii automatically. " "User must provide EQRADIUS and POLRADIUS values for this target."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/LinearAlgebra/LinearAlgebra.cpp b/isis/src/base/objs/LinearAlgebra/LinearAlgebra.cpp index 53c617d815..c86fa7ab93 100644 --- a/isis/src/base/objs/LinearAlgebra/LinearAlgebra.cpp +++ b/isis/src/base/objs/LinearAlgebra/LinearAlgebra.cpp @@ -194,7 +194,7 @@ namespace Isis { } catch (IException &e) { // since we can only calculate the determinant for 2x2 or 3x3 - QString msg = "Unable to determine whether the given matrix is a rotation matrix."; + std::string msg = "Unable to determine whether the given matrix is a rotation matrix."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } return false; @@ -290,7 +290,7 @@ namespace Isis { if (qFuzzyCompare(det + 1.0, 1.0)) { // the inverse exists <==> the determinant is not 0.0 - QString msg = "The given matrix is not invertible. The determinant is 0.0."; + std::string msg = "The given matrix is not invertible. The determinant is 0.0."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -323,7 +323,7 @@ namespace Isis { return inverse; } catch (IException &e) { - QString msg = "Unable to invert the given matrix."; + std::string msg = "Unable to invert the given matrix."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } } @@ -477,7 +477,7 @@ namespace Isis { LinearAlgebra::Vector LinearAlgebra::normalize(const Vector &vector) { // impossible to unitize the zero vector if (LinearAlgebra::isZero(vector)) { - QString msg = "Unable to normalize the zero vector."; + std::string msg = "Unable to normalize the zero vector."; throw IException(IException::Unknown, msg, _FILEINFO_); } return vector / LinearAlgebra::magnitude(vector); @@ -982,7 +982,7 @@ namespace Isis { // if given matrix is not a rotation matrix, we can't proceed. if ( !isRotationMatrix(rotationMatrix) ) { - QString msg = "Unable to convert the given matrix to an axis of rotation " + std::string msg = "Unable to convert the given matrix to an axis of rotation " "and a rotation angle. The given matrix is not a rotation matrix."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1087,7 +1087,7 @@ namespace Isis { } if ( !isRotationMatrix(rotationMatrix) ) { - QString msg = "Unable to convert the given matrix to Euler angles. " + std::string msg = "Unable to convert the given matrix to Euler angles. " "The given matrix is not a rotation matrix."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp index 90368f87ce..398a51db47 100644 --- a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp +++ b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp @@ -208,7 +208,7 @@ namespace Isis { TProjection *proj = NULL; if (propagationCubes.size() < 1) { - QString msg = "The list does not contain any data"; + std::string msg = "The list does not contain any data"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -286,7 +286,7 @@ namespace Isis { RingPlaneProjection *proj = NULL; if (propagationCubes.size() < 1) { - QString msg = "The list does not contain any data"; + std::string msg = "The list does not contain any data"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -348,7 +348,7 @@ namespace Isis { double slat, double elat, double slon, double elon, CubeAttributeOutput &oAtt, const QString &mosaicFile) { if (propagationCubes.size() < 1) { - QString msg = "The list does not contain any data"; + std::string msg = "The list does not contain any data"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -437,7 +437,7 @@ namespace Isis { double srad, double erad, double saz, double eaz, CubeAttributeOutput &oAtt, const QString &mosaicFile) { if (propagationCubes.size() < 1) { - QString msg = "The list does not contain any data"; + std::string msg = "The list does not contain any data"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -673,7 +673,7 @@ namespace Isis { Isis::Cube *ProcessMapMosaic::SetOutputCube(const QString &inputFile, PvlGroup mapping, CubeAttributeOutput &oAtt, const QString &mosaicFile) { if (OutputCubes.size() != 0) { - QString msg = "You can only specify one output cube and projection"; + std::string msg = "You can only specify one output cube and projection"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp index 8966480f5f..f4ae856355 100644 --- a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp +++ b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp @@ -339,7 +339,7 @@ namespace Isis { // If no tracking group exists in mosaic cube, warn user to run utility application to // add it and create a separate tracking cube else { - QString msg = "Tracking cannot be enabled when adding to an existing mosaic " + std::string msg = "Tracking cannot be enabled when adding to an existing mosaic " "that does not already have a tracking cube. Mosaics with a tracking band must " "have the tracking band extracted into an external tracking cube."; throw IException(IException::User, msg, _FILEINFO_); @@ -374,7 +374,7 @@ namespace Isis { else if (m_imageOverlay == AverageImageWithMosaic) { m_onb /= 2; if (m_onb < 1) { - QString msg = "The mosaic cube needs a count band."; + std::string msg = "The mosaic cube needs a count band."; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -1087,7 +1087,7 @@ namespace Isis { PvlGroup &inBin = inLab->findGroup("BandBin", Pvl::Traverse); PvlGroup &outBin = outLab->findGroup("BandBin", Pvl::Traverse); if (inBin.keywords() != outBin.keywords()) { - QString msg = "Pvl Group [BandBin] does not match between the input and output cubes"; + std::string msg = "Pvl Group [BandBin] does not match between the input and output cubes"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1315,7 +1315,7 @@ namespace Isis { } } if (!bFound) { - QString msg = "Invalid Band / Key Name, Value "; + std::string msg = "Invalid Band / Key Name, Value "; throw IException(IException::User, msg, _FILEINFO_); } return iBandIndex; diff --git a/isis/src/base/objs/Projection/Projection.cpp b/isis/src/base/objs/Projection/Projection.cpp index 2de62c15e2..28033eab73 100644 --- a/isis/src/base/objs/Projection/Projection.cpp +++ b/isis/src/base/objs/Projection/Projection.cpp @@ -139,7 +139,7 @@ namespace Isis { m_y = Null; } catch(IException &e) { - QString msg = "Projection failed. Invalid label group [Mapping]"; + std::string msg = "Projection failed. Invalid label group [Mapping]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp index b088a734e0..2b6bbc66df 100644 --- a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp +++ b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp @@ -240,7 +240,7 @@ namespace Isis { // Couldn't find the cube size from the labels so compute it if (!sizeFound) { if (!proj->HasGroundRange()) { - QString msg = "Invalid ground range [MinimumLatitude,MaximumLatitude,"; + std::string msg = "Invalid ground range [MinimumLatitude,MaximumLatitude,"; msg += "MinimumLongitude,MaximumLongitude] missing or invalid"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -491,14 +491,14 @@ namespace Isis { // Couldn't find the cube size from the labels so compute it if (!sizeFound) { if (!proj->HasGroundRange()) { - QString msg = "Invalid ring range [MinimumRingRadius,MaximumRingRadius,"; + std::string msg = "Invalid ring range [MinimumRingRadius,MaximumRingRadius,"; msg += "MinimumRingLongitude,MaximumRingLongitude] missing or invalid"; throw IException(IException::Unknown, msg, _FILEINFO_); } double minX, maxX, minY, maxY; if (!proj->XYRange(minX, maxX, minY, maxY)) { - QString msg = "Invalid ring range [MinimumRingRadius,MaximumRingRadius,"; + std::string msg = "Invalid ring range [MinimumRingRadius,MaximumRingRadius,"; msg += "MinimumRingLongitude,MaximumRingLongitude] cause invalid computation "; msg += "of image size"; throw IException(IException::Unknown, msg, _FILEINFO_); diff --git a/isis/src/base/objs/PushFrameCameraCcdLayout/unitTest.cpp b/isis/src/base/objs/PushFrameCameraCcdLayout/unitTest.cpp index 55924d43c0..f975249bc6 100644 --- a/isis/src/base/objs/PushFrameCameraCcdLayout/unitTest.cpp +++ b/isis/src/base/objs/PushFrameCameraCcdLayout/unitTest.cpp @@ -58,11 +58,11 @@ int main(void) { PushFrameCameraCcdLayout junoLayout(-61500); qDebug() << "Load the JunoCam kernels"; if (!junoLayout.addKernel("$juno/kernels/ik/juno_junocam_v??.ti")) { - QString msg = "Failed to load the JunoCam Instrument Kernel."; + std::string msg = "Failed to load the JunoCam Instrument Kernel."; throw IException(IException::Io, msg, _FILEINFO_); } if (!junoLayout.addKernel("$juno/kernels/iak/junoAddendum???.ti")) { - QString msg = "Failed to load the JunoCam Instrument Addendum."; + std::string msg = "Failed to load the JunoCam Instrument Addendum."; throw IException(IException::Io, msg, _FILEINFO_); } qDebug() << "JunoCam CCD samples:" << junoLayout.ccdSamples(); diff --git a/isis/src/base/objs/QtExporter/QtExporter.cpp b/isis/src/base/objs/QtExporter/QtExporter.cpp index 7a05c641cc..400cb2c2b9 100644 --- a/isis/src/base/objs/QtExporter/QtExporter.cpp +++ b/isis/src/base/objs/QtExporter/QtExporter.cpp @@ -136,7 +136,7 @@ namespace Isis { // the following if statement does it informally. m_qimage->setPixel(sampleIndex, lineIndex, pixelValue); if (!m_qimage->valid(sampleIndex, lineIndex)) { - QString msg = "Qt has detected your file size as exceeding 2GB."; + std::string msg = "Qt has detected your file size as exceeding 2GB."; msg += " While your image might be under 2GB, your image labels are more"; msg += " than likely pushing the file size over 2GB."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/base/objs/RingPlaneProjection/RingPlaneProjection.cpp b/isis/src/base/objs/RingPlaneProjection/RingPlaneProjection.cpp index 27e40df1a1..21773a4726 100644 --- a/isis/src/base/objs/RingPlaneProjection/RingPlaneProjection.cpp +++ b/isis/src/base/objs/RingPlaneProjection/RingPlaneProjection.cpp @@ -77,7 +77,7 @@ namespace Isis { m_ringLongitudeDirection = CounterClockwise; } else { - QString msg = "Projection failed. Invalid value for keyword " + std::string msg = "Projection failed. Invalid value for keyword " "[RingLongitudeDirection] must be " "[Clockwise or CounterClockwise]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -91,7 +91,7 @@ namespace Isis { m_ringLongitudeDomain = 180; } else { - QString msg = "Projection failed. Invalid value for keyword " + std::string msg = "Projection failed. Invalid value for keyword " "[RingLongitudeDomain] must be [180 or 360]"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ShapeModel/ShapeModel.cpp b/isis/src/base/objs/ShapeModel/ShapeModel.cpp index 243f1918b8..2d00291d27 100644 --- a/isis/src/base/objs/ShapeModel/ShapeModel.cpp +++ b/isis/src/base/objs/ShapeModel/ShapeModel.cpp @@ -146,7 +146,7 @@ namespace Isis { // Jeff and Stuart respond. if (!m_hasIntersection || !surfaceIntersection()->Valid()) { - QString msg = "A valid intersection must be defined before computing the surface normal"; + std::string msg = "A valid intersection must be defined before computing the surface normal"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp index 63a36a61a4..5f05b8b9d3 100644 --- a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp +++ b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp @@ -112,7 +112,7 @@ namespace Isis { if (shapeModelFilenames == "") { // No file name given. If EllipsoidShape throws an error or returns null, the following // exception will be appended to the finalError. - QString msg = "Unable to construct an Ellipsoid shape model."; + std::string msg = "Unable to construct an Ellipsoid shape model."; try { shapeModel = new EllipsoidShape(target); @@ -129,7 +129,7 @@ namespace Isis { else if (shapeModelFilenames == "RingPlane") { // No file name given, RingPlane indicated. If PlaneShape throws an error or returns // null, the following exception will be appended to the finalError. - QString msg = "Unable to construct a RingPlane shape model."; + std::string msg = "Unable to construct a RingPlane shape model."; try { shapeModel = new PlaneShape(target, pvl); @@ -239,7 +239,7 @@ namespace Isis { // If NaifDskShape throws an error or returns null and DEM construction is // unsuccessful, the following exception will be appended to the fileError. - QString msg = "The given shape model file is not a valid NAIF DSK file. " + std::string msg = "The given shape model file is not a valid NAIF DSK file. " "Unable to construct a NAIF DSK shape model."; IException dskError(IException::Unknown, msg, _FILEINFO_); @@ -267,7 +267,7 @@ namespace Isis { } catch (IException &e) { // The file is neither a valid DSK nor an ISIS cube. Append a message and throw the error. - QString msg = "The given shape model file is not a valid ISIS DEM. " + std::string msg = "The given shape model file is not a valid ISIS DEM. " "Unable to open as an ISIS cube."; fileError.append(IException(e, IException::Unknown, msg, _FILEINFO_)); finalError.append(fileError); @@ -281,7 +281,7 @@ namespace Isis { } catch (IException &e) { // The file is neither a valid DSK nor a valid ISIS DEM. Append message and throw the error. - QString msg = "The given shape model file is not a valid ISIS DEM cube. " + std::string msg = "The given shape model file is not a valid ISIS DEM cube. " "It is not map-projected."; fileError.append(IException(e, IException::Unknown, msg, _FILEINFO_)); finalError.append(fileError); @@ -291,7 +291,7 @@ namespace Isis { if (projection->IsEquatorialCylindrical()) { // If the EquatorialCylindricalShape constructor throws an error or returns null, the // following exception will be appended to the fileError. (Later added to the finalError) - QString msg = "Unable to construct a DEM shape model from the given " + std::string msg = "Unable to construct a DEM shape model from the given " "EquatorialCylindrical projected ISIS cube."; try { @@ -309,7 +309,7 @@ namespace Isis { else { // If the DemShape constructor throws an error or returns null, the following // exception will be appended to the fileError. (Later added to the finalError) - QString msg = "Unable to construct a DEM shape model " + std::string msg = "Unable to construct a DEM shape model " "from the given projected ISIS cube file."; try { diff --git a/isis/src/base/objs/Spice/Spice.cpp b/isis/src/base/objs/Spice/Spice.cpp index 1e357c77d7..29b4d3641b 100644 --- a/isis/src/base/objs/Spice/Spice.cpp +++ b/isis/src/base/objs/Spice/Spice.cpp @@ -370,7 +370,7 @@ namespace Isis { frameCode = getInteger("BODY_FRAME_CODE", 0); } catch(IException &e) { - QString msg = "Unable to read BODY_FRAME_CODE from naifkeywords group"; + std::string msg = "Unable to read BODY_FRAME_CODE from naifkeywords group"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -652,22 +652,22 @@ namespace Isis { // Check for errors if (cacheSize <= 0) { - QString msg = "Argument cacheSize must be greater than zero"; + std::string msg = "Argument cacheSize must be greater than zero"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (startTime > endTime) { - QString msg = "Argument startTime must be less than or equal to endTime"; + std::string msg = "Argument startTime must be less than or equal to endTime"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (*m_cacheSize > 0) { - QString msg = "A cache has already been created"; + std::string msg = "A cache has already been created"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (cacheSize == 1 && (*m_startTimePadding != 0 || *m_endTimePadding != 0)) { - QString msg = "This instrument does not support time padding"; + std::string msg = "This instrument does not support time padding"; throw IException(IException::User, msg, _FILEINFO_); } @@ -841,7 +841,7 @@ namespace Isis { */ void Spice::instrumentBodyFixedPosition(double p[3]) const { if (m_et == NULL) { - QString msg = "Unable to retrieve instrument's body fixed position." + std::string msg = "Unable to retrieve instrument's body fixed position." " Spice::SetTime must be called first."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -859,7 +859,7 @@ namespace Isis { */ void Spice::instrumentBodyFixedVelocity(double v[3]) const { if (m_et == NULL) { - QString msg = "Unable to retrieve instrument's body fixed velocity." + std::string msg = "Unable to retrieve instrument's body fixed velocity." " Spice::SetTime must be called first."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -890,7 +890,7 @@ namespace Isis { */ iTime Spice::time() const { if (m_et == NULL) { - QString msg = "Unable to retrieve the time." + std::string msg = "Unable to retrieve the time." " Spice::SetTime must be called first."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -908,7 +908,7 @@ namespace Isis { */ void Spice::sunPosition(double p[3]) const { if (m_et == NULL) { - QString msg = "Unable to retrieve sun's position." + std::string msg = "Unable to retrieve sun's position." " Spice::SetTime must be called first."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1291,7 +1291,7 @@ namespace Isis { NaifStatus::CheckErrors(); if (m_et == NULL) { - QString msg = "Unable to retrieve subspacecraft position." + std::string msg = "Unable to retrieve subspacecraft position." " Spice::SetTime must be called first."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1342,7 +1342,7 @@ namespace Isis { NaifStatus::CheckErrors(); if (m_et == NULL) { - QString msg = "Unable to retrieve subsolar point." + std::string msg = "Unable to retrieve subsolar point." " Spice::SetTime must be called first."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/SpicePosition/SpicePosition.cpp b/isis/src/base/objs/SpicePosition/SpicePosition.cpp index 717a96c2b4..9e09946c44 100644 --- a/isis/src/base/objs/SpicePosition/SpicePosition.cpp +++ b/isis/src/base/objs/SpicePosition/SpicePosition.cpp @@ -297,17 +297,17 @@ namespace Isis { void SpicePosition::LoadCache(double startTime, double endTime, int size) { // Make sure cache isn't already loaded if(p_source == Memcache || p_source == HermiteCache) { - QString msg = "A SpicePosition cache has already been created"; + std::string msg = "A SpicePosition cache has already been created"; throw IException(IException::Programmer, msg, _FILEINFO_); } if(startTime > endTime) { - QString msg = "Argument startTime must be less than or equal to endTime"; + std::string msg = "Argument startTime must be less than or equal to endTime"; throw IException(IException::Programmer, msg, _FILEINFO_); } if((startTime != endTime) && (size == 1)) { - QString msg = "Cache size must be more than 1 if startTime endTime differ"; + std::string msg = "Cache size must be more than 1 if startTime endTime differ"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -430,7 +430,7 @@ namespace Isis { // Make sure cache isn't alread loaded if(p_source == Memcache || p_source == HermiteCache) { - QString msg = "A SpicePosition cache has already been created"; + std::string msg = "A SpicePosition cache has already been created"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -480,7 +480,7 @@ namespace Isis { p_hasVelocity = false; } else { - QString msg = "Expecting four or seven fields in the SpicePosition table"; + std::string msg = "Expecting four or seven fields in the SpicePosition table"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -707,7 +707,7 @@ namespace Isis { if(p_source >= HermiteCache) ReloadCache(); if(p_source != Memcache) { - QString msg = "Only cached positions can be returned as a line cache of positions and time"; + std::string msg = "Only cached positions can be returned as a line cache of positions and time"; throw IException(IException::Programmer, msg, _FILEINFO_); } // Load the table and return it to caller @@ -806,7 +806,7 @@ namespace Isis { // Make sure a polynomial function is already loaded if(p_source != PolyFunction) { - QString msg = "A SpicePosition polynomial function has not been created yet"; + std::string msg = "A SpicePosition polynomial function has not been created yet"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1271,7 +1271,7 @@ namespace Isis { return p_velocity; } else { - QString msg = "No velocity vector available"; + std::string msg = "No velocity vector available"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp index c4af96fdb7..610532e437 100644 --- a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp +++ b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp @@ -350,23 +350,23 @@ namespace Isis { // Check for valid arguments if (size <= 0) { - QString msg = "Argument cacheSize must not be less or equal to zero"; + std::string msg = "Argument cacheSize must not be less or equal to zero"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (startTime > endTime) { - QString msg = "Argument startTime must be less than or equal to endTime"; + std::string msg = "Argument startTime must be less than or equal to endTime"; throw IException(IException::Programmer, msg, _FILEINFO_); } if ((startTime != endTime) && (size == 1)) { - QString msg = "Cache size must be more than 1 if startTime and endTime differ"; + std::string msg = "Cache size must be more than 1 if startTime and endTime differ"; throw IException(IException::Programmer, msg, _FILEINFO_); } // Make sure cache isn't already loaded if (p_source == Memcache) { - QString msg = "A SpiceRotation cache has already been created"; + std::string msg = "A SpiceRotation cache has already been created"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -710,7 +710,7 @@ namespace Isis { } } else { - QString msg = "Expecting either three, five, or eight fields in the SpiceRotation table"; + std::string msg = "Expecting either three, five, or eight fields in the SpiceRotation table"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -776,7 +776,7 @@ namespace Isis { } } else { //(p_source < PolyFunction) - QString msg = "The SpiceRotation has not yet been fit to a function"; + std::string msg = "The SpiceRotation has not yet been fit to a function"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -822,7 +822,7 @@ namespace Isis { if (p_source >= PolyFunction) ReloadCache(); if (p_source != Memcache) { - QString msg = "Only cached rotations can be returned as a line cache of quaternions and time"; + std::string msg = "Only cached rotations can be returned as a line cache of quaternions and time"; throw IException(IException::Programmer, msg, _FILEINFO_); } // Load the table and return it to caller @@ -962,7 +962,7 @@ namespace Isis { } else { // throw an error -- should not get here -- invalid Spice Source - QString msg = "To create table source of data must be either Memcache or PolyFunction"; + std::string msg = "To create table source of data must be either Memcache or PolyFunction"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1613,7 +1613,7 @@ namespace Isis { // Get the derivative of the polynomial with respect to partialVar double dpoly = 0.; - QString msg; + std::string msg; switch (m_frameType) { case CK: case DYN: @@ -1947,7 +1947,7 @@ namespace Isis { // No target body orientation information available -- throw an error if (!m_tOrientationAvailable) { - QString msg = "Target body orientation information not available. Rerun spiceinit."; + std::string msg = "Target body orientation information not available. Rerun spiceinit."; throw IException(IException::User, msg, _FILEINFO_); } @@ -2251,7 +2251,7 @@ namespace Isis { dpoly = DPckPolynomial(partialVar, coeffIndex); break; default: - QString msg = "Only CK, DYN, and PCK partials can be calculated"; + std::string msg = "Only CK, DYN, and PCK partials can be calculated"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -2482,7 +2482,7 @@ namespace Isis { // final step -- downsize loaded cache and reload if (p_fullCacheSize != (int) p_cacheTime.size()) { - QString msg = + std::string msg = "Full cache size does NOT match cache size in LoadTimeCache -- should never happen"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -2670,7 +2670,7 @@ namespace Isis { } } else if (count == 0 && p_source != Nadir && p_minimizeCache == Yes) { - QString msg = "No camera kernels loaded...Unable to determine time cache to downsize"; + std::string msg = "No camera kernels loaded...Unable to determine time cache to downsize"; throw IException(IException::User, msg, _FILEINFO_); } @@ -2701,7 +2701,7 @@ namespace Isis { // No time cache was initialized -- throw an error if (p_fullCacheSize < 1) { - QString msg = "Time cache not available -- rerun spiceinit"; + std::string msg = "Time cache not available -- rerun spiceinit"; throw IException(IException::User, msg, _FILEINFO_); } @@ -2976,12 +2976,12 @@ namespace Isis { // Make sure the angles have been fit to polynomials so we can calculate the derivative if (p_source < PolyFunction ) { - QString msg = "The SpiceRotation pointing angles must be fit to polynomials in order to "; + std::string msg = "The SpiceRotation pointing angles must be fit to polynomials in order to "; msg += "compute angular velocity."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (p_source == PckPolyFunction) { - QString msg = "Planetary angular velocity must be fit computed with PCK polynomials "; + std::string msg = "Planetary angular velocity must be fit computed with PCK polynomials "; throw IException(IException::Programmer, msg, _FILEINFO_); } std::vector dCJdt; diff --git a/isis/src/base/objs/Statistics/Statistics.cpp b/isis/src/base/objs/Statistics/Statistics.cpp index d3afb9c444..14ba41772b 100644 --- a/isis/src/base/objs/Statistics/Statistics.cpp +++ b/isis/src/base/objs/Statistics/Statistics.cpp @@ -396,7 +396,7 @@ namespace Isis { } if (m_totalPixels < 0) { - QString msg = "You are removing non-existant data in [Statistics::RemoveData]"; + std::string msg = "You are removing non-existant data in [Statistics::RemoveData]"; throw IException(IException::Programmer, msg, _FILEINFO_); } // what happens to saved off min/max??? @@ -695,7 +695,7 @@ namespace Isis { */ double Statistics::ChebyshevMinimum(const double percent) const { if ((percent <= 0.0) || (percent >= 100.0)) { - QString msg = "Invalid value for percent"; + std::string msg = "Invalid value for percent"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Stretch/Stretch.cpp b/isis/src/base/objs/Stretch/Stretch.cpp index 4d6ab4c76a..b51142c817 100644 --- a/isis/src/base/objs/Stretch/Stretch.cpp +++ b/isis/src/base/objs/Stretch/Stretch.cpp @@ -345,7 +345,7 @@ namespace Isis { PvlKeyword outputs = grp.findKeyword("Output"); if(inputs.size() != outputs.size()) { - QString msg = "Invalid Pvl file: The number of Input values must equal the number of Output values"; + std::string msg = "Invalid Pvl file: The number of Input values must equal the number of Output values"; throw IException(IException::User, msg, _FILEINFO_); } for(int i = 0; i < inputs.size(); i++) { diff --git a/isis/src/base/objs/TProjection/TProjection.cpp b/isis/src/base/objs/TProjection/TProjection.cpp index 9b629d90bf..27ccc32e54 100644 --- a/isis/src/base/objs/TProjection/TProjection.cpp +++ b/isis/src/base/objs/TProjection/TProjection.cpp @@ -103,7 +103,7 @@ namespace Isis { m_polarRadius = radii["PolarRadius"]; } catch (IException &e) { - QString msg = "Projection failed. No target radii are available " + std::string msg = "Projection failed. No target radii are available " "through keywords [EquatorialRadius and PolarRadius] " "or [TargetName]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); @@ -111,12 +111,12 @@ namespace Isis { // Check the radii for validity if (m_equatorialRadius <= 0.0) { - QString msg = "Projection failed. Invalid value for keyword " + std::string msg = "Projection failed. Invalid value for keyword " "[EquatorialRadius]. It must be greater than zero"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (m_polarRadius <= 0.0) { - QString msg = "Projection failed. Invalid value for keyword " + std::string msg = "Projection failed. Invalid value for keyword " "[PolarRadius]. It must be greater than zero"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -157,7 +157,7 @@ namespace Isis { m_longitudeDomain = 180; } else { - QString msg = "Projection failed. Invalid value for keyword " + std::string msg = "Projection failed. Invalid value for keyword " "[LongitudeDomain] must be [180 or 360]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -238,7 +238,7 @@ namespace Isis { setProjectionType(Triaxial); } catch (IException &e) { - QString msg = "Projection failed. Invalid label group [Mapping]"; + std::string msg = "Projection failed. Invalid label group [Mapping]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -1823,7 +1823,7 @@ namespace Isis { } if (iteration >= MAX_ITERATIONS) { - QString msg = "Failed to converge in TProjection::phi2Compute()"; + std::string msg = "Failed to converge in TProjection::phi2Compute()"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp index 4643c8ea0c..fc7b5358af 100644 --- a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp +++ b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp @@ -386,7 +386,7 @@ namespace Isis{ kerns += PvlKeyword("NaifFrameCode", "-82361"); } else { - QString msg = "CISS2ISIS only imports Cassini ISS narrow "; + std::string msg = "CISS2ISIS only imports Cassini ISS narrow "; msg += "angle or wide angle images"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/cassini/apps/cisscal/DarkCurrent.cpp b/isis/src/cassini/apps/cisscal/DarkCurrent.cpp index 30ec2d27d3..adc7cb109d 100644 --- a/isis/src/cassini/apps/cisscal/DarkCurrent.cpp +++ b/isis/src/cassini/apps/cisscal/DarkCurrent.cpp @@ -1497,7 +1497,7 @@ namespace Isis { lowKey = (--lowIt).key(); } if (fabs(highKey - lowKey) < 1.0e-10) { - QString msg("Cannot Interpolate Repeated X Values"); + std::string msg("Cannot Interpolate Repeated X Values"); throw IException(IException::Programmer, msg, _FILEINFO_); } slope = (value(highKey) - value(lowKey)) / (highKey - lowKey); diff --git a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp index 8f12d71f8a..defc1886f5 100644 --- a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp +++ b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp @@ -1802,7 +1802,7 @@ namespace Isis { // load cholmod triplet if ( !loadCholmodTriplet() ) { - QString msg = "CHOLMOD: Failed to load Triplet matrix"; + std::string msg = "CHOLMOD: Failed to load Triplet matrix"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -2493,12 +2493,12 @@ namespace Isis { m_imageLists.append(imgList); } catch (IException &e) { - QString msg = "Invalid image in serial number list\n"; + std::string msg = "Invalid image in serial number list\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } } else { - QString msg = "No images used in bundle adjust\n"; + std::string msg = "No images used in bundle adjust\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -2750,7 +2750,7 @@ namespace Isis { catch (std::exception &e) { outputBundleStatus("\n\n"); - QString msg = "Input data and settings are not sufficiently stable " + std::string msg = "Input data and settings are not sufficiently stable " "for error propagation."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.cpp b/isis/src/control/objs/BundleSettings/BundleSettings.cpp index 2db12c1aa9..25f9127d82 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.cpp +++ b/isis/src/control/objs/BundleSettings/BundleSettings.cpp @@ -703,7 +703,7 @@ namespace Isis { double maxModelCQuantile) { if (m_maximumLikelihood.size() == 0 && model > MaximumLikelihoodWFunctions::HuberModified) { - QString msg = "For bundle adjustments with multiple maximum likelihood estimators, the first " + std::string msg = "For bundle adjustments with multiple maximum likelihood estimators, the first " "model must be of type HUBER or HUBER_MODIFIED."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/core/src/Pvl.cpp b/isis/src/core/src/Pvl.cpp index d321259bfb..1e80eb6d44 100644 --- a/isis/src/core/src/Pvl.cpp +++ b/isis/src/core/src/Pvl.cpp @@ -60,7 +60,7 @@ namespace Isis { stringstream stm; stm << str; if(!stm) { - QString message = "Failed to use string: " + QString::fromStdString(str) + "to create Pvl"; + std::string message = "Failed to use string: " + str + "to create Pvl"; throw IException(IException::Io, message, _FILEINFO_); } @@ -69,11 +69,11 @@ namespace Isis { stm >> *this; } catch(IException &e) { - QString message = "Unable to create PVL from string: " + QString::fromStdString(str); + std::string message = "Unable to create PVL from string: " + str; throw IException(e, IException::Unknown, message, _FILEINFO_); } catch(...) { - QString message = "Unable to create PVL from string: " + QString::fromStdString(str); + std::string message = "Unable to create PVL from string: " + str; throw IException(IException::Unknown, message, _FILEINFO_); } } diff --git a/isis/src/system/apps/blobdump/main.cpp b/isis/src/system/apps/blobdump/main.cpp index 22c57e817c..90a1657c62 100644 --- a/isis/src/system/apps/blobdump/main.cpp +++ b/isis/src/system/apps/blobdump/main.cpp @@ -65,7 +65,7 @@ void helperButtonGetBlobList() { // If we've gone through all objects and found nothing, throw an exception if(cnt >= label.objects()) { pos = 0; - QString msg = "Parameter [FROM] has no blobs."; + std::string msg = "Parameter [FROM] has no blobs."; throw IException(IException::User, msg, _FILEINFO_); } // When the end of the objects is hit, diff --git a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp index d20c81f30e..e23c9b10f1 100644 --- a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp +++ b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp @@ -62,7 +62,7 @@ namespace Isis { frameMap = sortFramelets(frameletListFile); } catch (IException &e) { - QString msg = "Failed reading and sorting framelets into frames."; + std::string msg = "Failed reading and sorting framelets into frames."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp index 3ef9d76f28..37a1610721 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp @@ -94,7 +94,7 @@ namespace Isis { catch (IException &e) { // Set NULL so that cameras destructor wont seg fault trying to delete SetDistortionMap(NULL, false); - QString msg = "Unable to Create TgoCassisDistortionMap"; + std::string msg = "Unable to Create TgoCassisDistortionMap"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } // Setup the ground and sky map diff --git a/isis/src/viking/apps/vikcal/CalParameters.cpp b/isis/src/viking/apps/vikcal/CalParameters.cpp index 00f74e7277..a183360323 100644 --- a/isis/src/viking/apps/vikcal/CalParameters.cpp +++ b/isis/src/viking/apps/vikcal/CalParameters.cpp @@ -161,7 +161,7 @@ namespace Isis { tokens[14] + ".cub"; return; } - QString msg = "Could not find match in [vikcal.sav] calibration file"; + std::string msg = "Could not find match in [vikcal.sav] calibration file"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -231,7 +231,7 @@ namespace Isis { p_normpow = toDouble(tokens[9]); return; } - QString msg = "Could not find match in [viklin.sav] calibration file"; + std::string msg = "Could not find match in [viklin.sav] calibration file"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -313,7 +313,7 @@ namespace Isis { pp2_off[4] = pp2_off[2] + toDouble(tokens[6]); } if(frm1 == -1.0 || frm2 == -1.0) { - QString msg = "Could not find match in [vikoff.sav] calibration file"; + std::string msg = "Could not find match in [vikoff.sav] calibration file"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -358,7 +358,7 @@ namespace Isis { return; } - QString msg = "Could not find match in [vikoff.sav] calibration file"; + std::string msg = "Could not find match in [vikoff.sav] calibration file"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -398,7 +398,7 @@ namespace Isis { NaifStatus::CheckErrors(); } catch(IException &e) { - QString msg = "Unable to determine the distance from Mars to the Sun"; + std::string msg = "Unable to determine the distance from Mars to the Sun"; throw IException(e, IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/voyager/apps/voy2isis/main.cpp b/isis/src/voyager/apps/voy2isis/main.cpp index 8593bf86c8..dde6561c3b 100644 --- a/isis/src/voyager/apps/voy2isis/main.cpp +++ b/isis/src/voyager/apps/voy2isis/main.cpp @@ -88,13 +88,13 @@ void IsisMain() { if (pdsLabel->hasKeyword("LBL") && pdsLabel->findKeyword("LBL").isNull()) { - QString msg = "No label information."; + std::string msg = "No label information."; throw IException(IException::User, msg, _FILEINFO_); } if (pdsLabel->hasKeyword("PRODUCT_TYPE") && !pdsLabel->findKeyword("PRODUCT_TYPE").isEquivalent("DECOMPRESSED_RAW_IMAGE")) { - QString msg = "ISIS does not currently support images of product types other than raw."; + std::string msg = "ISIS does not currently support images of product types other than raw."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/tests/FunctionalTestsIsisImport.cpp b/isis/tests/FunctionalTestsIsisImport.cpp index 12510cb981..845404892b 100644 --- a/isis/tests/FunctionalTestsIsisImport.cpp +++ b/isis/tests/FunctionalTestsIsisImport.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include diff --git a/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp b/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp index 6d136a63f5..e38e0ce5e2 100644 --- a/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp +++ b/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include diff --git a/isis/tests/FunctionalTestsIsisImportEis.cpp b/isis/tests/FunctionalTestsIsisImportEis.cpp index 6692be5104..98fa92f413 100644 --- a/isis/tests/FunctionalTestsIsisImportEis.cpp +++ b/isis/tests/FunctionalTestsIsisImportEis.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include #include diff --git a/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp b/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp index f8fe6ac5c1..c886da8ce2 100644 --- a/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp +++ b/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include diff --git a/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp b/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp index 4d55bc3090..7324dc745a 100644 --- a/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp +++ b/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include diff --git a/isis/tests/FunctionalTestsIsisImportLo.cpp b/isis/tests/FunctionalTestsIsisImportLo.cpp index 1f23491f2e..3b0d3f97f5 100644 --- a/isis/tests/FunctionalTestsIsisImportLo.cpp +++ b/isis/tests/FunctionalTestsIsisImportLo.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include #include diff --git a/isis/tests/FunctionalTestsIsisImportLroNac.cpp b/isis/tests/FunctionalTestsIsisImportLroNac.cpp index c5ec2050ef..cd4ea1f7a2 100644 --- a/isis/tests/FunctionalTestsIsisImportLroNac.cpp +++ b/isis/tests/FunctionalTestsIsisImportLroNac.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include diff --git a/isis/tests/FunctionalTestsIsisImportMerMI.cpp b/isis/tests/FunctionalTestsIsisImportMerMI.cpp index fea30f02da..1b750c85ae 100644 --- a/isis/tests/FunctionalTestsIsisImportMerMI.cpp +++ b/isis/tests/FunctionalTestsIsisImportMerMI.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include From 1de2c688f5df7f05b85be274f222b04553f445c3 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Mon, 16 Oct 2023 12:05:48 -0700 Subject: [PATCH 49/95] PvlSequence updated --- isis/src/base/apps/cubeavg/main.cpp | 1 - isis/src/base/apps/isis2fits/main.cpp | 1 - .../RadarSlantRangeMap/RadarSlantRangeMap.cpp | 12 +++++----- isis/src/core/include/PvlSequence.h | 10 ++++----- isis/src/core/src/PvlKeyword.cpp | 9 ++++---- isis/src/core/src/PvlSequence.cpp | 22 +++++++++---------- .../tests/unitTests/PvlSequence/unitTest.cpp | 8 +++---- isis/src/mro/apps/hi2isis/hi2isis.cpp | 2 +- 8 files changed, 30 insertions(+), 35 deletions(-) diff --git a/isis/src/base/apps/cubeavg/main.cpp b/isis/src/base/apps/cubeavg/main.cpp index 20fb6d0a4c..7d0266ec46 100644 --- a/isis/src/base/apps/cubeavg/main.cpp +++ b/isis/src/base/apps/cubeavg/main.cpp @@ -3,7 +3,6 @@ #include "Statistics.h" #include "Application.h" #include "PvlGroup.h" -#include "PvlSequence.h" using namespace std; using namespace Isis; diff --git a/isis/src/base/apps/isis2fits/main.cpp b/isis/src/base/apps/isis2fits/main.cpp index b7c166fe51..9377f3e8f2 100644 --- a/isis/src/base/apps/isis2fits/main.cpp +++ b/isis/src/base/apps/isis2fits/main.cpp @@ -12,7 +12,6 @@ #include "Pvl.h" #include "PvlGroup.h" #include "PvlKeyword.h" -#include "PvlSequence.h" #include "UserInterface.h" using namespace std; diff --git a/isis/src/base/objs/RadarSlantRangeMap/RadarSlantRangeMap.cpp b/isis/src/base/objs/RadarSlantRangeMap/RadarSlantRangeMap.cpp index 46248fa0aa..18d08f062a 100644 --- a/isis/src/base/objs/RadarSlantRangeMap/RadarSlantRangeMap.cpp +++ b/isis/src/base/objs/RadarSlantRangeMap/RadarSlantRangeMap.cpp @@ -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 array = seq[i]; + std::vector 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 } diff --git a/isis/src/core/include/PvlSequence.h b/isis/src/core/include/PvlSequence.h index 6cdee9a797..64a7277e5e 100644 --- a/isis/src/core/include/PvlSequence.h +++ b/isis/src/core/include/PvlSequence.h @@ -8,8 +8,6 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include -#include - #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 &array); + PvlSequence &operator+=(std::vector &array); PvlSequence &operator+=(std::vector &array); PvlSequence &operator+=(std::vector &array); //! Return the ith Array of the sequence - std::vector &operator[](int i) { + std::vector &operator[](int i) { return p_sequence[i]; }; @@ -77,7 +75,7 @@ namespace Isis { }; private: - std::vector > p_sequence; /** > p_sequence; /**operator+=(temp); + this->operator+=(QString::fromStdString(temp)); } return *this; diff --git a/isis/src/core/src/PvlSequence.cpp b/isis/src/core/src/PvlSequence.cpp index ab2b868a41..7ecb55a4c9 100644 --- a/isis/src/core/src/PvlSequence.cpp +++ b/isis/src/core/src/PvlSequence.cpp @@ -7,8 +7,6 @@ find files of those names at the top level of this repository. **/ #include -#include - #include "PvlSequence.h" #include "Pvl.h" #include "IString.h" @@ -24,7 +22,7 @@ namespace Isis { */ PvlSequence &PvlSequence::operator=(PvlKeyword &key) { for(int i = 0; i < key.size(); i++) { - this->operator+=(key[i]); + this->operator+=(key[i].toStdString()); } return *this; } @@ -36,15 +34,15 @@ namespace Isis { * * @param array A string representing an array. */ - PvlSequence &PvlSequence::operator+=(const QString &array) { + PvlSequence &PvlSequence::operator+=(const std::string array) { std::stringstream str; str << "temp = " << array; Pvl pvl; str >> pvl; PvlKeyword &key = pvl["temp"]; - std::vector temp; + std::vector temp; for(int i = 0; i < key.size(); i++) { - temp.push_back(key[i]); + temp.push_back(key[i].toStdString()); } p_sequence.push_back(temp); return *this; @@ -56,8 +54,8 @@ namespace Isis { * * @param array vector of strings */ - PvlSequence &PvlSequence::operator+=(std::vector &array) { - std::vector temp; + PvlSequence &PvlSequence::operator+=(std::vector &array) { + std::vector temp; for(int i = 0; i < (int)array.size(); i++) { temp.push_back(array[i]); } @@ -72,9 +70,9 @@ namespace Isis { * @param array vector of integers */ PvlSequence &PvlSequence::operator+=(std::vector &array) { - std::vector temp; + std::vector temp; for(int i = 0; i < (int)array.size(); i++) { - temp.push_back(toString(array[i])); + temp.push_back(std::to_string(array[i])); } p_sequence.push_back(temp); return *this; @@ -87,9 +85,9 @@ namespace Isis { * @param array vector of doubles */ PvlSequence &PvlSequence::operator+=(std::vector &array) { - std::vector temp; + std::vector temp; for(int i = 0; i < (int)array.size(); i++) { - temp.push_back(toString(array[i])); + temp.push_back(std::to_string(array[i])); } p_sequence.push_back(temp); return *this; diff --git a/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp b/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp index fbc2964a98..c78302ff4c 100644 --- a/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp @@ -24,11 +24,11 @@ int main(void) { PvlSequence seq; seq = key; - seq += QString("(a,b,c)"); - seq += QString("(d,e)"); - seq += QString("singleton"); + seq += "(a,b,c)"; + seq += "(d,e)"; + seq += "singleton"; - std::vector slist; + std::vector slist; slist.push_back("1"); slist.push_back("2"); seq += slist; diff --git a/isis/src/mro/apps/hi2isis/hi2isis.cpp b/isis/src/mro/apps/hi2isis/hi2isis.cpp index 19b7f765e3..462002d1c9 100644 --- a/isis/src/mro/apps/hi2isis/hi2isis.cpp +++ b/isis/src/mro/apps/hi2isis/hi2isis.cpp @@ -144,7 +144,7 @@ namespace Isis { // The user wants it unlutted else if(ui.GetBoolean("UNLUT")) { for(int i = 0; i < lutSeq.Size(); i++) { - stretch.AddPair(i, ((toDouble(lutSeq[i][0]) + toDouble(lutSeq[i][1])) / 2.0)); + stretch.AddPair(i, ((std::stod(lutSeq[i][0]) + std::stod(lutSeq[i][1])) / 2.0)); } instgrp.addKeyword(PvlKeyword("Unlutted", "TRUE")); instgrp.deleteKeyword("LookupTable"); From 51c42f88bee5ae08ce6ec8b577b395e0342cfd11 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Tue, 17 Oct 2023 17:31:43 -0700 Subject: [PATCH 50/95] Updated table, tablefield, and tablerecord --- isis/src/base/apps/caminfo/caminfo.cpp | 2 +- isis/src/base/apps/camstats/camstats.cpp | 2 +- isis/src/base/apps/csv2table/main.cpp | 2 +- isis/src/base/apps/table2cube/main.cpp | 14 +-- isis/src/base/apps/tabledump/main.cpp | 6 +- isis/src/base/objs/Blobber/Blobber.cpp | 10 +- .../objs/ExportPdsTable/ExportPdsTable.cpp | 11 +- .../src/base/objs/ExportPdsTable/unitTest.cpp | 4 +- .../objs/ImportPdsTable/ImportPdsTable.cpp | 26 ++--- .../src/base/objs/ImportPdsTable/unitTest.cpp | 4 +- isis/src/base/objs/ProcessMosaic/unitTest.cpp | 2 +- .../base/objs/TrackingTable/TrackingTable.cpp | 10 +- isis/src/base/objs/TrackingTable/unitTest.cpp | 40 +++---- .../apps/chan1m32isis/chan1m32isis.cpp | 20 ++-- isis/src/core/include/Table.h | 2 +- isis/src/core/include/TableField.h | 17 ++- isis/src/core/include/TableRecord.h | 4 +- isis/src/core/src/Table.cpp | 6 +- isis/src/core/src/TableField.cpp | 109 +++++++++--------- isis/src/core/src/TableRecord.cpp | 18 +-- isis/src/core/tests/TableTests.cpp | 18 +-- .../tests/unitTests/TableField/unitTest.cpp | 8 +- .../dawn/objs/DawnVirCamera/DawnVirCamera.cpp | 4 +- .../AdvancedTrackTool/AdvancedTrackTool.cpp | 4 +- isis/src/qisis/objs/Image/Image.cpp | 2 +- isis/src/qisis/objs/Shape/Shape.cpp | 2 +- .../rosetta/apps/rosvirtis2isis/VirtisHK.cpp | 2 +- isis/src/rosetta/apps/rosvirtis2isis/main.cpp | 2 +- .../RosettaVirtisCamera.cpp | 2 +- isis/tests/FunctionalTestsCaminfo.cpp | 4 +- 30 files changed, 178 insertions(+), 179 deletions(-) diff --git a/isis/src/base/apps/caminfo/caminfo.cpp b/isis/src/base/apps/caminfo/caminfo.cpp index ee534b4c37..475854368f 100644 --- a/isis/src/base/apps/caminfo/caminfo.cpp +++ b/isis/src/base/apps/caminfo/caminfo.cpp @@ -262,7 +262,7 @@ namespace Isis{ Table csTable = incube->readTable("CameraStatistics"); for (int rec = 0; rec < csTable.Records(); rec++) { - QString tableRec = TableRecord::toString(csTable[rec]); + QString tableRec = QString::fromStdString(TableRecord::toString(csTable[rec])); QString recordName = tableRec.split(",").at(0); camstats->append(MakePair(recordName + "Minimum", tableRec.split(",").at(1))); diff --git a/isis/src/base/apps/camstats/camstats.cpp b/isis/src/base/apps/camstats/camstats.cpp index d63e0acdd3..8f7e7e6f92 100644 --- a/isis/src/base/apps/camstats/camstats.cpp +++ b/isis/src/base/apps/camstats/camstats.cpp @@ -192,7 +192,7 @@ namespace Isis { PvlGroup &group = statsPvl.group(i); int entry = 0; - record[entry] = group.name(); + record[entry] = group.name().toStdString(); entry++; for (int j = 0; j < group.keywords(); j++) { record[entry] = toDouble(group[j][0]); diff --git a/isis/src/base/apps/csv2table/main.cpp b/isis/src/base/apps/csv2table/main.cpp index b0a65f9bfb..33cbe4f11e 100644 --- a/isis/src/base/apps/csv2table/main.cpp +++ b/isis/src/base/apps/csv2table/main.cpp @@ -20,4 +20,4 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); Pvl appLog; csv2table(ui, &appLog); -} \ No newline at end of file +} diff --git a/isis/src/base/apps/table2cube/main.cpp b/isis/src/base/apps/table2cube/main.cpp index c30673b695..e1316ed6a4 100644 --- a/isis/src/base/apps/table2cube/main.cpp +++ b/isis/src/base/apps/table2cube/main.cpp @@ -40,7 +40,7 @@ void IsisMain() { g_numElements = ui.GetInteger("NUMELEM"); } else { - g_numElements = (*g_table)[g_startRecord][g_field].size() - (g_startElement - 1); + g_numElements = (*g_table)[g_startRecord][g_field.toStdString()].size() - (g_startElement - 1); } p.SetOutputCube("TO", g_numElements, g_numRecords); @@ -56,16 +56,16 @@ void readTable(Isis::Buffer &outcube) { for (int element = g_startElement; element < g_startElement + g_numElements; element ++) { int index = (g_numElements * (record - 1)) + (element - g_startElement); - if ((*g_table)[record-1][g_field].isReal()) { - std::vector data = (*g_table)[record-1][g_field]; + if ((*g_table)[record-1][g_field.toStdString()].isReal()) { + std::vector data = (*g_table)[record-1][g_field.toStdString()]; outcube[index] = data.at(element - 1); } - else if ((*g_table)[record-1][g_field].isInteger()) { - std::vector data = (*g_table)[record-1][g_field]; + else if ((*g_table)[record-1][g_field.toStdString()].isInteger()) { + std::vector data = (*g_table)[record-1][g_field.toStdString()]; outcube[index] = data.at(element - 1); } - else if ((*g_table)[record-1][g_field].isDouble()) { - std::vector data = (*g_table)[record-1][g_field]; + else if ((*g_table)[record-1][g_field.toStdString()].isDouble()) { + std::vector data = (*g_table)[record-1][g_field.toStdString()]; outcube[index] = data.at(element - 1); } } diff --git a/isis/src/base/apps/tabledump/main.cpp b/isis/src/base/apps/tabledump/main.cpp index 1880572f58..adeae6572c 100644 --- a/isis/src/base/apps/tabledump/main.cpp +++ b/isis/src/base/apps/tabledump/main.cpp @@ -46,7 +46,7 @@ void IsisMain() { for (int i = 0; i < table[0].Fields(); i++) { for (int j = 0; j < table[0][i].size(); j++) { - QString title = table[0][i].name(); + QString title = QString::fromStdString(table[0][i].name()); if (table[0][i].isText()) { j += table[0][i].bytes(); } @@ -79,7 +79,7 @@ void IsisMain() { ss << IString((double)table[i][j]); } else if (table[i][j].isText()) { - ss << (QString)table[i][j]; + ss << (std::string)table[i][j]; } if (j < table[i].Fields() - 1) { ss << delimit; @@ -89,7 +89,7 @@ void IsisMain() { // and output them with the delimiter character between else { if (table[i][j].isText()) { - ss << (QString)table[i][j] << delimit; + ss << (std::string)table[i][j] << delimit; } else if (table[i][j].isInteger()) { vector currField = table[i][j]; diff --git a/isis/src/base/objs/Blobber/Blobber.cpp b/isis/src/base/objs/Blobber/Blobber.cpp index 15603bc887..38533a6b34 100644 --- a/isis/src/base/objs/Blobber/Blobber.cpp +++ b/isis/src/base/objs/Blobber/Blobber.cpp @@ -139,7 +139,7 @@ namespace Isis { */ void Blobber::load(Cube &cube) { Table tbl = cube.readTable(getBlobName()); - TableField data = tbl[0][getFieldName()]; + TableField data = tbl[0][getFieldName().toStdString()]; if (data.isDouble()) { loadDouble(tbl); } @@ -166,10 +166,10 @@ namespace Isis { */ void Blobber::loadDouble(Table &tbl) { int nlines = tbl.Records(); - int nsamps = tbl[0][getFieldName()].size(); + int nsamps = tbl[0][getFieldName().toStdString()].size(); BlobBuf pixels(nlines, nsamps); for (int i = 0 ; i < nlines ; i++) { - vector d = tbl[i][getFieldName()]; + vector d = tbl[i][getFieldName().toStdString()]; for (unsigned int j = 0 ; j < d.size() ; j++) { pixels[i][j] = d[j]; } @@ -192,10 +192,10 @@ namespace Isis { */ void Blobber::loadInteger(Table &tbl) { int nlines = tbl.Records(); - int nsamps = tbl[0][getFieldName()].size(); + int nsamps = tbl[0][getFieldName().toStdString()].size(); BlobBuf pixels(nlines, nsamps); for (int i = 0 ; i < nlines ; i++) { - vector d = tbl[i][getFieldName()]; + vector d = tbl[i][getFieldName().toStdString()]; for (unsigned int j = 0 ; j < d.size(); j++) { pixels[i][j] = int2ToDouble(d[j]); } diff --git a/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp b/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp index 3d6a0517e7..52a53f0146 100644 --- a/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp +++ b/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp @@ -136,12 +136,11 @@ namespace Isis { TableField field = (*m_isisTable)[0][fieldIndex]; PvlObject columnObj("COLUMN"); columnObj.addKeyword(PvlKeyword("COLUMN_NUMBER", toString(fieldIndex + 1))); - columnObj.addKeyword(PvlKeyword("NAME", field.name())); + columnObj.addKeyword(PvlKeyword("NAME", QString::fromStdString(field.name()))); if (field.type() == TableField::Text) { columnObj.addKeyword(PvlKeyword("DATA_TYPE", "CHARACTER")); - QString val = field; for(int i = 0; i < field.size(); i++) { columnBytes++; } @@ -182,7 +181,7 @@ namespace Isis { else { // This error is not covered in the unitTest since currently, there // are no other valid values for TableField types. It is meant to // catch other values if they are added to Table Field. - QString msg = "Unable to export Isis::Table object to PDS. Invalid " + std::string msg = "Unable to export Isis::Table object to PDS. Invalid " "field type found for [" + field.name() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -270,11 +269,11 @@ namespace Isis { } } else if(field.isText()) { - QString val = field; + std::string val = field; // copy each character and count each byte individually for(int i = 0; i < field.size(); i++) { if(i < (int)val.length()) { - buffer[startByte] = val[i].toLatin1(); + buffer[startByte] = val[i]; } else { // this line is not covered by unitTest since this is a case that @@ -296,7 +295,7 @@ namespace Isis { else { // This error is not covered in the unitTest since currently, there // are no other valid values for TableField types. It is meant to // catch other values if they are added to Table Field. - QString msg = "Unable to export Isis::Table object to PDS. Invalid " + std::string msg = "Unable to export Isis::Table object to PDS. Invalid " "field type found for [" + field.name() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ExportPdsTable/unitTest.cpp b/isis/src/base/objs/ExportPdsTable/unitTest.cpp index 53ec31aba5..b2fda6e4e1 100644 --- a/isis/src/base/objs/ExportPdsTable/unitTest.cpp +++ b/isis/src/base/objs/ExportPdsTable/unitTest.cpp @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { for (int i = 0; i < reimportedLsbTable.Records(); i++) { cout << toString((double) reimportedLsbTable[i][0]) << "\t\t\t"; cout << toString((int) reimportedLsbTable[i][1]) << "\t\t\t\t"; - cout << (QString) reimportedLsbTable[i][2] << "\t\t\t"; + cout << (std::string) reimportedLsbTable[i][2] << "\t\t\t"; cout << toString((float) reimportedLsbTable[i][3]) << "\n"; } // remove files and reset buffer @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) { for (int i = 0; i < reimportedMsbTable.Records(); i++) { cout << IString((double) reimportedMsbTable[i][0]) << "\t\t\t"; cout << IString((int) reimportedMsbTable[i][1]) << "\t\t\t\t"; - cout << IString((QString) reimportedMsbTable[i][2]) << "\t\t\t"; + cout << IString((std::string) reimportedMsbTable[i][2]) << "\t\t\t"; cout << IString((float) reimportedMsbTable[i][3]) << "\n"; } // remove files and reset buffer and tableRecBytes diff --git a/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp b/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp index cf94c37d4c..4fdb2b59ed 100644 --- a/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp +++ b/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp @@ -822,15 +822,15 @@ namespace Isis { QString name = getFormattedName(cdesc.m_name); if (m_pdsTableType == "ASCII") { if ( dtype == "INTEGER" ) { - return (TableField(name, TableField::Integer)); + return (TableField(name.toStdString(), TableField::Integer)); } else if ( ((dtype == "DOUBLE") || (dtype == "REAL") || (dtype == "FLOAT")) ) { - return (TableField(name, TableField::Double)); + return (TableField(name.toStdString(), TableField::Double)); } else { - return (TableField(name, TableField::Text, cdesc.m_numBytes)); + return (TableField(name.toStdString(), TableField::Text, cdesc.m_numBytes)); } } else { @@ -896,7 +896,7 @@ namespace Isis { else { // Its a text field QString str(tfield.size(), ' '); str.insert(0, data.Trim(" \t\r\n").ToQt()); - tfield = str; + tfield = str.toStdString(); } } catch (IException &e) { @@ -1033,7 +1033,7 @@ namespace Isis { for (int colIndex = 0; colIndex < columns(); colIndex++) { QString columnName = m_coldesc[colIndex].m_name; for (int fieldIndex = 0 ; fieldIndex < record.Fields() ; fieldIndex++) { - QString fieldName = record[fieldIndex].name(); + QString fieldName = QString::fromStdString(record[fieldIndex].name()); if (fieldName == columnName) { int startByte = m_coldesc[colIndex].m_startByte; int numBytes = m_coldesc[colIndex].m_numBytes; @@ -1067,7 +1067,7 @@ namespace Isis { for (int byte = 0; byte < numBytes; byte++) { fieldValue[byte] = rowBuffer[startByte + byte]; } - record[fieldIndex] = fieldValue; + record[fieldIndex] = fieldValue.toStdString(); } } @@ -1113,7 +1113,7 @@ namespace Isis { throw IException(IException::Unknown, msg, _FILEINFO_); } setPdsByteOrder("MSB"); - return TableField(name, TableField::Integer); + return TableField(name.toStdString(), TableField::Integer); } else if (dataType == "LSB_INTEGER" || dataType == "VAX_INTEGER" || dataType == "PC_INTEGER" ) { @@ -1125,7 +1125,7 @@ namespace Isis { throw IException(IException::Unknown, msg, _FILEINFO_); } setPdsByteOrder("LSB"); - return TableField(name, TableField::Integer); + return TableField(name.toStdString(), TableField::Integer); } else if (dataType == "FLOAT" //IEEE_REAL alias (MSB) || dataType == "REAL" //IEEE_REAL alias (MSB) @@ -1134,10 +1134,10 @@ namespace Isis { || dataType == "IEEE_REAL" ) { setPdsByteOrder("MSB"); if (cdesc.m_numBytes == 8) { - return TableField(name, TableField::Double); + return TableField(name.toStdString(), TableField::Double); } else if (cdesc.m_numBytes == 4) { - return TableField(name, TableField::Real); + return TableField(name.toStdString(), TableField::Real); } else { IString msg = "Only 4 byte or 8 byte real values are supported in Isis. " @@ -1150,10 +1150,10 @@ namespace Isis { else if (dataType == "PC_REAL") { setPdsByteOrder("LSB"); if (cdesc.m_numBytes == 8) { - return TableField(name, TableField::Double); + return TableField(name.toStdString(), TableField::Double); } else if (cdesc.m_numBytes == 4) { - return TableField(name, TableField::Real); + return TableField(name.toStdString(), TableField::Real); } else { QString msg = "Only 4 byte or 8 byte real values are supported in Isis. " @@ -1166,7 +1166,7 @@ namespace Isis { else if (dataType.contains("CHARACTER") || dataType.contains("ASCII") || dataType == "DATE" || dataType == "TIME" ) { - return TableField(name, TableField::Text, cdesc.m_numBytes); + return TableField(name.toStdString(), TableField::Text, cdesc.m_numBytes); } // Isis tables currently don't support any of the following PDS DATA_TYPE: // BIT_STRING, COMPLEX, N/A, BOOLEAN, UNSIGNED_INTEGER, IBM types, some VAX types diff --git a/isis/src/base/objs/ImportPdsTable/unitTest.cpp b/isis/src/base/objs/ImportPdsTable/unitTest.cpp index e6658c1fad..67ff545a0b 100644 --- a/isis/src/base/objs/ImportPdsTable/unitTest.cpp +++ b/isis/src/base/objs/ImportPdsTable/unitTest.cpp @@ -184,7 +184,7 @@ int main(int argc, char *argv[]) { for (int i = 0; i < isisTableFromMsb.Records(); i++) { cout << toString((double) isisTableFromMsb[i][0]) << "\t\t\t"; cout << toString((int) isisTableFromMsb[i][1]) << "\t\t\t\t"; - cout << QString( isisTableFromMsb[i][2]) << "\t\t\t"; + cout << std::string( isisTableFromMsb[i][2]) << "\t\t\t"; cout << toString((float) isisTableFromMsb[i][3]) << "\n"; } @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) { for (int i = 0; i < isisTableFromLsb.Records(); i++) { cout << toString((double) isisTableFromLsb[i][0]) << "\t\t\t"; cout << toString((int) isisTableFromLsb[i][1]) << "\t\t\t\t"; - cout << QString( isisTableFromLsb[i][2]) << "\t\t\t"; + cout << std::string( isisTableFromLsb[i][2]) << "\t\t\t"; cout << toString((float) isisTableFromLsb[i][3]) << "\n"; } cout << endl; diff --git a/isis/src/base/objs/ProcessMosaic/unitTest.cpp b/isis/src/base/objs/ProcessMosaic/unitTest.cpp index ce7a3a409f..ff89827f9c 100644 --- a/isis/src/base/objs/ProcessMosaic/unitTest.cpp +++ b/isis/src/base/objs/ProcessMosaic/unitTest.cpp @@ -81,7 +81,7 @@ void IsisMain() { try { Table trackTable = trackingCube1->readTable(ProcessMosaic::TRACKING_TABLE_NAME); qDebug() << "b. SUCCESS - Track Table Exists in [" << trackingCube1->fileName() << "]"; - qDebug().noquote() << Table::toString( trackTable, "\t" ); + qDebug().noquote() << QString::fromStdString(Table::toString( trackTable, "\t" )); } catch (IException&) { qDebug() << "b. FAILURE - Track Table does not Exist in [" << trackingCube1->fileName() << "]"; diff --git a/isis/src/base/objs/TrackingTable/TrackingTable.cpp b/isis/src/base/objs/TrackingTable/TrackingTable.cpp index f8b4845d60..9ae5665b56 100644 --- a/isis/src/base/objs/TrackingTable/TrackingTable.cpp +++ b/isis/src/base/objs/TrackingTable/TrackingTable.cpp @@ -39,7 +39,7 @@ namespace Isis { for (int i=0; i < table.Records(); i++) { TableRecord record = table[i]; - QString nameField = QString(record["FileName"]).split("/").last(); + QString nameField = QString::fromStdString(record["FileName"]).split("/").last(); QString extension(FileName(nameField).extension()); int found = nameField.lastIndexOf(extension); if (found != -1) { @@ -47,8 +47,8 @@ namespace Isis { nameField.remove(found + 3); } FileName fileName(nameField); - QString serialNumber = QString(record["SerialNumber"]); - m_fileList.append(QPair(fileName, serialNumber)); + std::string serialNumber = record["SerialNumber"]; + m_fileList.append(QPair(fileName, QString::fromStdString(serialNumber))); } } @@ -94,8 +94,8 @@ namespace Isis { // Loop through m_fileList and add records to the table with the proper information. for (int i=0; i < m_fileList.size(); i++) { - fileNameField = m_fileList[i].first.name(); - serialNumberField = m_fileList[i].second; + fileNameField = m_fileList[i].first.name().toStdString(); + serialNumberField = m_fileList[i].second.toStdString(); indexField = (int) (i + VALID_MINUI4); TableRecord record; diff --git a/isis/src/base/objs/TrackingTable/unitTest.cpp b/isis/src/base/objs/TrackingTable/unitTest.cpp index 1093bdc42e..62a8199983 100644 --- a/isis/src/base/objs/TrackingTable/unitTest.cpp +++ b/isis/src/base/objs/TrackingTable/unitTest.cpp @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) { Table tableOut1 = trackingTable1.toTable(); - cout << "Record added: " << QString(tableOut1[0][0]) << ", " << QString(tableOut1[0][1]) << endl; + cout << "Record added: " << std::string(tableOut1[0][0]) << ", " << std::string(tableOut1[0][1]) << endl; cout << endl; @@ -63,9 +63,9 @@ int main(int argc, char *argv[]) { record[1] = "456789"; tableIn += record; - cout << "First record : " << QString(tableIn[0][0]) << ", " << QString(tableIn[0][1]) << endl; - cout << "Second record: " << QString(tableIn[1][0]) << ", " << QString(tableIn[1][1]) << endl; - cout << "Third record : " << QString(tableIn[2][0]) << ", " << QString(tableIn[2][1]) << endl; + cout << "First record : " << (std::string)tableIn[0][0] << ", " << (std::string)tableIn[0][1] << endl; + cout << "Second record: " << (std::string)tableIn[1][0] << ", " << (std::string)tableIn[1][1] << endl; + cout << "Third record : " << (std::string)tableIn[2][0] << ", " << (std::string)tableIn[2][1] << endl; TrackingTable trackingTable2(tableIn); @@ -109,17 +109,17 @@ int main(int argc, char *argv[]) { Table tableOut2 = trackingTable2.toTable(); - cout << "First record : " << QString(tableOut2[0][0]) << ", " - << QString(tableOut2[0][1]) << ", " + cout << "First record : " << std::string(tableOut2[0][0]) << ", " + << std::string(tableOut2[0][1]) << ", " << int(tableOut2[0][2]) << endl; - cout << "Second record: " << QString(tableOut2[1][0]) << ", " - << QString(tableOut2[1][1]) << ", " + cout << "Second record: " << std::string(tableOut2[1][0]) << ", " + << std::string(tableOut2[1][1]) << ", " << int(tableOut2[1][2]) << endl; - cout << "Third record : " << QString(tableOut2[2][0]) << ", " - << QString(tableOut2[2][1]) << ", " + cout << "Third record : " << std::string(tableOut2[2][0]) << ", " + << std::string(tableOut2[2][1]) << ", " << int(tableOut2[2][2]) << endl; - cout << "Fourth record: " << QString(tableOut2[3][0]) << ", " - << QString(tableOut2[3][1]) << ", " + cout << "Fourth record: " << std::string(tableOut2[3][0]) << ", " + << std::string(tableOut2[3][1]) << ", " << int(tableOut2[3][2]) << endl; cout << endl; @@ -151,17 +151,17 @@ int main(int argc, char *argv[]) { Table tableOut3 = trackingTable3.toTable(); - cout << "First record : " << QString(tableOut3[0][0]) << ", " - << QString(tableOut3[0][1]) << ", " + cout << "First record : " << std::string(tableOut3[0][0]) << ", " + << std::string(tableOut3[0][1]) << ", " << int(tableOut3[0][2]) << endl; - cout << "Second record: " << QString(tableOut3[1][0]) << ", " - << QString(tableOut3[1][1]) << ", " + cout << "Second record: " << std::string(tableOut3[1][0]) << ", " + << std::string(tableOut3[1][1]) << ", " << int(tableOut3[1][2]) << endl; - cout << "Third record : " << QString(tableOut3[2][0]) << ", " - << QString(tableOut3[2][1]) << ", " + cout << "Third record : " << std::string(tableOut3[2][0]) << ", " + << std::string(tableOut3[2][1]) << ", " << int(tableOut3[2][2]) << endl; - cout << "Fourth record: " << QString(tableOut3[3][0]) << ", " - << QString(tableOut3[3][1]) << ", " + cout << "Fourth record: " << std::string(tableOut3[3][0]) << ", " + << std::string(tableOut3[3][1]) << ", " << int(tableOut3[3][2]) << endl; } diff --git a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp index 371fab97fa..e249e12574 100644 --- a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp +++ b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp @@ -161,8 +161,8 @@ namespace Isis { for (int rec = 0; rec < g_utcTable->Records() - 1; rec++) { outputLines++; // One for this line - iTime thisEt((QString)(*g_utcTable)[rec]["UtcTime"]); - iTime nextEt((QString)(*g_utcTable)[rec+1]["UtcTime"]); + iTime thisEt(QString::fromStdString((std::string)(*g_utcTable)[rec]["UtcTime"])); + iTime nextEt(QString::fromStdString((std::string)(*g_utcTable)[rec+1]["UtcTime"])); double delta = fabs(nextEt - thisEt); // Time table may be assending or decenting times while (delta > g_expectedLineRate * 1.9) { @@ -172,8 +172,8 @@ namespace Isis { } outputLines++; // One more for the last line - iTime firstEt((QString)(*g_utcTable)[0]["UtcTime"]); - iTime lastEt((QString)(*g_utcTable)[g_utcTable->Records()-1]["UtcTime"]); + iTime firstEt(QString::fromStdString((std::string)(*g_utcTable)[0]["UtcTime"])); + iTime lastEt(QString::fromStdString((std::string)(*g_utcTable)[g_utcTable->Records()-1]["UtcTime"])); calcOutputLines = fabs((lastEt + g_expectedLineRate / 2.0) - (firstEt - g_expectedLineRate / 2.0)) / g_expectedLineRate; } @@ -289,11 +289,11 @@ namespace Isis { if (in.Band() == g_oCube->bandCount() && in.Line() < g_utcTable->Records()) { - QString tt = (QString)(*g_utcTable)[in.Line() - 1]["UtcTime"]; - QString ttt = (QString)(*g_utcTable)[in.Line()]["UtcTime"]; + QString tt = QString::fromStdString((std::string)(*g_utcTable)[in.Line() - 1]["UtcTime"]); + QString ttt = QString::fromStdString((std::string)(*g_utcTable)[in.Line()]["UtcTime"]); - iTime thisEt((QString)(*g_utcTable)[in.Line() - 1]["UtcTime"]); - iTime nextEt((QString)(*g_utcTable)[in.Line()]["UtcTime"]); + iTime thisEt(QString::fromStdString((std::string)(*g_utcTable)[in.Line() - 1]["UtcTime"])); + iTime nextEt(QString::fromStdString((std::string)(*g_utcTable)[in.Line()]["UtcTime"])); double delta = fabs(nextEt - thisEt); @@ -377,8 +377,8 @@ namespace Isis { // Assume the UTC table times are better, so change the labels to match the table // The start and stop clock counts need to match the start/stop time, so convert the times // to new clock counts. - iTime firstEt((QString)(*g_utcTable)[0]["UtcTime"]); - iTime lastEt((QString)(*g_utcTable)[utcTable.Records()-1]["UtcTime"]); + iTime firstEt(QString::fromStdString((std::string)(*g_utcTable)[0]["UtcTime"])); + iTime lastEt(QString::fromStdString((std::string)(*g_utcTable)[utcTable.Records()-1]["UtcTime"])); // The table is in assending order // The table contains the middle of the exposure. include times to cover the beginning of diff --git a/isis/src/core/include/Table.h b/isis/src/core/include/Table.h index 7179141ed6..794b0d863d 100644 --- a/isis/src/core/include/Table.h +++ b/isis/src/core/include/Table.h @@ -116,7 +116,7 @@ namespace Isis { Blob toBlob() const; - static QString toString(Table table, QString fieldDelimiter=","); + static std::string toString(Table table, std::string fieldDelimiter=","); protected: diff --git a/isis/src/core/include/TableField.h b/isis/src/core/include/TableField.h index 6bcc92a30d..5acf0536a8 100644 --- a/isis/src/core/include/TableField.h +++ b/isis/src/core/include/TableField.h @@ -7,8 +7,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include - -#include +#include namespace Isis { class PvlGroup; @@ -58,12 +57,12 @@ namespace Isis { }; //Constructors and Destructor - TableField(const QString &name, Type type, int size = 1); + TableField(const std::string name, Type type, int size = 1); TableField(PvlGroup &field); ~TableField(); - QString name() const; + std::string name() const; Type type() const; bool isInteger() const; bool isDouble() const; @@ -75,7 +74,7 @@ namespace Isis { operator int() const; operator double() const; operator float() const; - operator QString() const; + operator std::string() const; operator std::vector() const; operator std::vector() const; operator std::vector() const; @@ -83,7 +82,7 @@ namespace Isis { void operator=(const int value); void operator=(const double value); void operator=(const float value); - void operator=(const QString &value); + void operator=(const std::string value); void operator=(const std::vector &values); void operator=(const std::vector &values); void operator=(const std::vector &value); @@ -92,10 +91,10 @@ namespace Isis { PvlGroup pvlGroup(); - static QString toString(const TableField &field, QString delimiter = ","); + static std::string toString(const TableField &field, std::string delimiter = ","); private: - QString m_name; //!< Field name + std::string m_name; //!< Field name Type m_type; //!< Field value type int m_size; /**< Field size. This is the number of values per field entry of the table.*/ @@ -109,7 +108,7 @@ namespace Isis { std::vector m_rvalues; /**< Vector containing Real field values. If the field Type is not Real, this vector will be empty.*/ - QString m_svalue; /**< String containing text value of field. + std::string m_svalue; /**< String containing text value of field. If the field Type is not Text, this string will be empty.*/ }; diff --git a/isis/src/core/include/TableRecord.h b/isis/src/core/include/TableRecord.h index 0df1a3cff2..fc16938662 100644 --- a/isis/src/core/include/TableRecord.h +++ b/isis/src/core/include/TableRecord.h @@ -43,11 +43,11 @@ namespace Isis { ~TableRecord(); - static QString toString(TableRecord record, QString fieldDelimiter = ",", bool fieldNames = false, bool endLine = true); + static std::string toString(TableRecord record, std::string fieldDelimiter = ",", bool fieldNames = false, bool endLine = true); void operator+=(Isis::TableField &field); TableField&operator [](const int field); - TableField &operator[](const QString &field); + TableField &operator[](const std::string field); int Fields() const; int RecordSize() const; diff --git a/isis/src/core/src/Table.cpp b/isis/src/core/src/Table.cpp index 34b3aa1549..b93bed9798 100644 --- a/isis/src/core/src/Table.cpp +++ b/isis/src/core/src/Table.cpp @@ -533,10 +533,10 @@ namespace Isis { * @param table The Table to serialize * @param fieldDelimiter The delimiter to use between fields * - * @return @b QString The Table data as a string + * @return @b std::string The Table data as a string */ - QString Table::toString(Table table, QString fieldDelimiter) { - QString tableValues; + std::string Table::toString(Table table, std::string fieldDelimiter) { + std::string tableValues; // add the first record with header, the given delimiter, and a new line after each record tableValues += TableRecord::toString(table[0], fieldDelimiter, true, true); // add remaining records without header, the same delimeter, and new line after each record diff --git a/isis/src/core/src/TableField.cpp b/isis/src/core/src/TableField.cpp index 4be8fa0a6c..9fdb31d424 100644 --- a/isis/src/core/src/TableField.cpp +++ b/isis/src/core/src/TableField.cpp @@ -22,7 +22,7 @@ namespace Isis { * @param size The size of the field. This is the number of values for a * single table entry. Defaults to 1. */ - TableField::TableField(const QString &name, TableField::Type type, + TableField::TableField(const std::string name, TableField::Type type, int size) { m_name = name; m_type = type; @@ -57,7 +57,8 @@ namespace Isis { * @throws IException::Programmer - Invalid field type */ TableField::TableField(PvlGroup &field) { - m_name = (QString) field["Name"]; + QString name = (QString)field["Name"]; + m_name = name.toStdString(); m_size = (int) field["Size"]; if ((QString) field["Type"] == "Integer") { m_type = TableField::Integer; @@ -80,7 +81,7 @@ namespace Isis { m_rvalues.resize(m_size); } else { - QString msg = "Field [" + m_name + "] has invalid type."; + std::string msg = "Field [" + m_name + "] has invalid type."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -94,7 +95,7 @@ namespace Isis { * * @return @b string Name of TableField */ - QString TableField::name() const { + std::string TableField::name() const { return m_name; } @@ -187,11 +188,11 @@ namespace Isis { */ TableField::operator int() const { if (m_type != TableField::Integer) { - QString msg = "Field [" + m_name + "] is not Integer."; + std::string msg = "Field [" + m_name + "] is not Integer."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (m_ivalues.size() > 1) { - QString msg = "Field [" + m_name + "] has multiple Integer values. " + std::string msg = "Field [" + m_name + "] has multiple Integer values. " "Use std::vector()."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -216,11 +217,11 @@ namespace Isis { */ TableField::operator double() const { if (m_type != TableField::Double) { - QString msg = "Field [" + m_name + "] is not a Double."; + std::string msg = "Field [" + m_name + "] is not a Double."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (m_dvalues.size() > 1) { - QString msg = "Field [" + m_name + "] has multiple Double values. " + std::string msg = "Field [" + m_name + "] has multiple Double values. " "Use std::vector()."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -245,11 +246,11 @@ namespace Isis { */ TableField::operator float() const { if (m_type != TableField::Real) { - QString msg = "Field [" + m_name + "] is not Real."; + std::string msg = "Field [" + m_name + "] is not Real."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (m_rvalues.size() > 1) { - QString msg = "Field [" + m_name + "] has multiple Real values. " + std::string msg = "Field [" + m_name + "] has multiple Real values. " "Use std::vector()."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -262,20 +263,20 @@ namespace Isis { * * TableField field("Field 1", FieldType::Text, 9); * // The following lines are equivalent - * string value = QString(field); - * string value = (QString) field; + * string value = std::string(field); + * string value = (std::string) field; * * * @return @b string The value of the field. * * @throws IException::Programmer - Field is not a string */ - TableField::operator QString() const { + TableField::operator std::string() const { if (m_type != TableField::Text) { - QString msg = "Field [" + m_name + "] is not Text."; + std::string msg = "Field [" + m_name + "] is not Text."; throw IException(IException::Programmer, msg, _FILEINFO_); } - return QString(m_svalue.toLatin1().data()); + return m_svalue; } /** @@ -292,7 +293,7 @@ namespace Isis { */ TableField::operator std::vector() const { if (m_type != TableField::Integer) { - QString msg = "Field [" + m_name + "] is not an Integer array."; + std::string msg = "Field [" + m_name + "] is not an Integer array."; throw IException(IException::Programmer, msg, _FILEINFO_); } return m_ivalues; @@ -312,7 +313,7 @@ namespace Isis { */ TableField::operator std::vector() const { if (m_type != TableField::Double) { - QString msg = "Field [" + m_name + "] is not a Double array."; + std::string msg = "Field [" + m_name + "] is not a Double array."; throw IException(IException::Programmer, msg, _FILEINFO_); } return m_dvalues; @@ -332,7 +333,7 @@ namespace Isis { */ TableField::operator std::vector() const { if (m_type != TableField::Real) { - QString msg = "Field [" + m_name + "] is not a Real array."; + std::string msg = "Field [" + m_name + "] is not a Real array."; throw IException(IException::Programmer, msg, _FILEINFO_); } return m_rvalues; @@ -349,13 +350,13 @@ namespace Isis { */ void TableField::operator=(const int value) { if (m_type != TableField::Integer) { - QString msg = "Unable to set field to the given int value. Field [" + std::string msg = "Unable to set field to the given int value. Field [" + m_name + "] Type is not Integer."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (m_size > 1) { - QString msg = "Unable to set field to the given int value. " - "Field [" + m_name + "] has [" + Isis::toString(m_size) + "] " + std::string msg = "Unable to set field to the given int value. " + "Field [" + m_name + "] has [" + std::to_string(m_size) + "] " "Integer values. Use operator=(vector)."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -373,13 +374,13 @@ namespace Isis { */ void TableField::operator=(const double value) { if (m_type != TableField::Double) { - QString msg = "Unable to set field to the given double value. Field [" + std::string msg = "Unable to set field to the given double value. Field [" + m_name + "] Type is not Double."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (m_size > 1) { - QString msg = "Unable to set field to the given double value. " - "Field [" + m_name + "] has [" + Isis::toString(m_size) + "] " + std::string msg = "Unable to set field to the given double value. " + "Field [" + m_name + "] has [" + std::to_string(m_size) + "] " "Double values. Use operator=(vector)."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -397,13 +398,13 @@ namespace Isis { */ void TableField::operator=(const float value) { if (m_type != TableField::Real) { - QString msg = "Unable to set field to the given float value. Field [" + std::string msg = "Unable to set field to the given float value. Field [" + m_name + "] Type is not Real."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (m_size > 1) { - QString msg = "Unable to set field to the given float value. " - "Field [" + m_name + "] has [" + Isis::toString(m_size) + "] " + std::string msg = "Unable to set field to the given float value. " + "Field [" + m_name + "] has [" + std::to_string(m_size) + "] " "Real values. Use operator=(vector)."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -417,10 +418,10 @@ namespace Isis { * * @throws IException::Programmer - Field is not a string */ - void TableField::operator=(const QString &value) { - QString val = value; + void TableField::operator=(const std::string value) { + std::string val = value; if (m_type != TableField::Text) { - QString msg = "Unable to set field to the given string value. Field [" + std::string msg = "Unable to set field to the given string value. Field [" + m_name + "] Type is not Text."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -428,9 +429,9 @@ namespace Isis { for (int i = m_size; i < val.size(); i++) { // if the extra characters are not spaces or nulls, throw an erro if (val[i] != ' ' && val[i] != '\0') { - QString msg = "Unable to set the Text TableField to the given string. " + std::string msg = "Unable to set the Text TableField to the given string. " "The number of bytes allowed for this field value [" - + Isis::toString(m_size) + "] is less than the length of the " + + std::to_string(m_size) + "] is less than the length of the " "given string [" + value + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -452,14 +453,14 @@ namespace Isis { */ void TableField::operator=(const std::vector &values) { if (m_type != TableField::Integer) { - QString msg = "Unable to set field to the given vector of int values. " + std::string msg = "Unable to set field to the given vector of int values. " "Field [" + m_name + "] Type is not Integer."; throw IException(IException::Programmer, msg, _FILEINFO_); } else if ((int) values.size() != m_size) { - QString msg = "Unable to set field to the given vector of int values. " + std::string msg = "Unable to set field to the given vector of int values. " "Field [" + m_name + "] values has size [" - + Isis::toString(m_size) + "]."; + + std::to_string(m_size) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } m_ivalues = values; @@ -476,14 +477,14 @@ namespace Isis { */ void TableField::operator=(const std::vector &values) { if (m_type != TableField::Double) { - QString msg = "Unable to set field to the given vector of double values. " + std::string msg = "Unable to set field to the given vector of double values. " "Field [" + m_name + "] Type is not Double."; throw IException(IException::Programmer, msg, _FILEINFO_); } else if ((int) values.size() != m_size) { - QString msg = "Unable to set field to the given vector of double values. " + std::string msg = "Unable to set field to the given vector of double values. " "Field [" + m_name + "] values has size [" - + Isis::toString(m_size) + "]."; + + std::to_string(m_size) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } m_dvalues = values; @@ -501,14 +502,14 @@ namespace Isis { */ void TableField::operator=(const std::vector &values) { if (m_type != TableField::Real) { - QString msg = "Unable to set field to the given vector of float values. " + std::string msg = "Unable to set field to the given vector of float values. " "Field [" + m_name + "] Type is not Real."; throw IException(IException::Programmer, msg, _FILEINFO_); } else if ((int) values.size() != m_size) { - QString msg = "Unable to set field to the given vector of float values. " + std::string msg = "Unable to set field to the given vector of float values. " "Field [" + m_name + "] values has size [" - + Isis::toString(m_size) + "]."; + + std::to_string(m_size) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } m_rvalues = values; @@ -574,7 +575,7 @@ namespace Isis { */ void TableField::operator=(const char *buf) { if (m_type != TableField::Text) { - QString msg = "Unable to set field to the given string value. Field [" + m_name + "] Type is not Text."; + std::string msg = "Unable to set field to the given string value. Field [" + m_name + "] Type is not Text."; throw IException(IException::Programmer, msg, _FILEINFO_); } m_svalue = buf; @@ -588,7 +589,7 @@ namespace Isis { */ PvlGroup TableField::pvlGroup() { PvlGroup group("Field"); - group += PvlKeyword("Name", m_name); + group += PvlKeyword("Name", QString::fromStdString(m_name)); if (m_type == TableField::Double) { group += PvlKeyword("Type", "Double"); } @@ -601,37 +602,37 @@ namespace Isis { else if (m_type == TableField::Real) { group += PvlKeyword("Type", "Real"); } - group += PvlKeyword("Size", Isis::toString(m_size)); + group += PvlKeyword("Size", QString::number(m_size)); return group; } - QString TableField::toString(const TableField &field, QString delimiter){ - QString fieldValues = ""; + std::string TableField::toString(const TableField &field, std::string delimiter){ + std::string fieldValues = ""; if (field.size()== 1){ if (field.isText()){ - fieldValues = (QString)field; + fieldValues = (std::string)field; } else if (field.isInteger()){ - fieldValues = Isis::toString((int)field); + fieldValues = std::to_string((int)field); } else if (field.isDouble()){ - fieldValues = Isis::toString((double)field); + fieldValues = std::to_string((double)field); } else { //real - fieldValues = Isis::toString((float)field); + fieldValues = std::to_string((float)field); } } // Otherwise, build a vector to contain the entries else { if (field.isText()){ - fieldValues +=(QString)field; + fieldValues +=(std::string)field; } else if (field.isInteger()){ vector< int > currField = field; for (int i = 0;i <(int)currField.size();i++){ - fieldValues += Isis::toString(currField[i]); + fieldValues += std::to_string(currField[i]); if (i <(int)currField.size()- 1){ // add delimiter for all but the last element of the field fieldValues += delimiter; @@ -641,7 +642,7 @@ namespace Isis { else if (field.isDouble()){ vector< double > currField = field; for (int i = 0;i <(int)currField.size();i++){ - fieldValues += Isis::toString(currField[i]); + fieldValues += std::to_string(currField[i]); if (i <(int)currField.size()- 1){ fieldValues += delimiter; } @@ -650,7 +651,7 @@ namespace Isis { else { //if (field.isReal()) { vector< float > currField = field; for (int i = 0;i <(int)currField.size();i++){ - fieldValues += Isis::toString(currField[i]); + fieldValues += std::to_string(currField[i]); if (i <(int)currField.size()- 1){ fieldValues += delimiter; } diff --git a/isis/src/core/src/TableRecord.cpp b/isis/src/core/src/TableRecord.cpp index 7e72df9915..6e9e7196b6 100644 --- a/isis/src/core/src/TableRecord.cpp +++ b/isis/src/core/src/TableRecord.cpp @@ -81,7 +81,7 @@ namespace Isis { * @throws Isis::IException::Programmer - The field does not exist in the * record */ - TableField &TableRecord::operator[](const QString &field) { + TableField &TableRecord::operator[](const std::string field) { Isis::IString upTemp = field; upTemp.UpCase(); for (int i = 0; i < (int)p_fields.size(); i++) { @@ -90,7 +90,7 @@ namespace Isis { if (upTemp == upField) return p_fields[i]; } - QString msg = "Field [" + field + "] does not exist in record"; + std::string msg = "Field [" + field + "] does not exist in record"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -142,10 +142,10 @@ namespace Isis { } } else if (field.isText()) { - QString val = (QString)field; + std::string val = (std::string)field; for (int i = 0; i < field.size(); i++) { if (i < (int)val.length()) { - buf[sbyte] = val[i].toLatin1(); + buf[sbyte] = val[i]; } else { buf[sbyte] = 0; @@ -251,10 +251,10 @@ namespace Isis { - QString TableRecord::toString(TableRecord record, QString fieldDelimiter, bool fieldNames, bool endLine) { - QString recordValues; + std::string TableRecord::toString(TableRecord record, std::string fieldDelimiter, bool fieldNames, bool endLine) { + std::string recordValues; if (fieldNames) { - for (int fieldIndex = 0;fieldIndex < record.Fields();fieldIndex++) { + for (int fieldIndex = 0; fieldIndex < record.Fields(); fieldIndex++) { // write out the name of each field if (record[fieldIndex].size() == 1) { recordValues += record[fieldIndex].name(); @@ -268,7 +268,7 @@ namespace Isis { } else { // if the field is multivalued, write the index of the field - recordValues += "(" + Isis::toString(fieldValueIndex) + ")"; + recordValues += "(" + std::to_string(fieldValueIndex) + ")"; } if (fieldValueIndex != record[fieldIndex].size() - 1) { // add a delimiter to all but the last value in this field @@ -285,7 +285,7 @@ namespace Isis { recordValues += "\n"; } - for (int fieldIndex = 0;fieldIndex < record.Fields();fieldIndex++) { + for (int fieldIndex = 0; fieldIndex < record.Fields(); fieldIndex++) { // add value for each field in the record recordValues += TableField::toString(record[fieldIndex], fieldDelimiter); if (fieldIndex != record.Fields() - 1) { diff --git a/isis/src/core/tests/TableTests.cpp b/isis/src/core/tests/TableTests.cpp index a24cc80237..9901f1e4ab 100644 --- a/isis/src/core/tests/TableTests.cpp +++ b/isis/src/core/tests/TableTests.cpp @@ -76,7 +76,7 @@ TEST(TableTests, UpdatingRecords) { t += rec; ASSERT_EQ(t.Records(), 1); - EXPECT_EQ(TableRecord::toString(t[0]).toStdString(), TableRecord::toString(rec).toStdString()); + EXPECT_EQ(TableRecord::toString(t[0]), TableRecord::toString(rec)); rec[0] = -1; rec[1] = 0.5; @@ -85,7 +85,7 @@ TEST(TableTests, UpdatingRecords) { t.Update(rec, 0); ASSERT_EQ(t.Records(), 1); - EXPECT_EQ(TableRecord::toString(t[0]).toStdString(), TableRecord::toString(rec).toStdString()); + EXPECT_EQ(TableRecord::toString(t[0]), TableRecord::toString(rec)); } @@ -108,7 +108,7 @@ TEST(TableTests, AddingRecords) { t += rec; ASSERT_EQ(t.Records(), 1); - EXPECT_EQ(TableRecord::toString(t[0]).toStdString(), TableRecord::toString(rec).toStdString()); + EXPECT_EQ(TableRecord::toString(t[0]), TableRecord::toString(rec)); rec[0] = -1; rec[1] = 0.5; @@ -117,7 +117,7 @@ TEST(TableTests, AddingRecords) { t += rec; ASSERT_EQ(t.Records(), 2); - EXPECT_EQ(TableRecord::toString(t[1]).toStdString(), TableRecord::toString(rec).toStdString()); + EXPECT_EQ(TableRecord::toString(t[1]), TableRecord::toString(rec)); TableField f5("Column1", TableField::Integer); TableField f6("Column2", TableField::Double); @@ -181,7 +181,7 @@ TEST(TableTests, ToFromBlob) { ASSERT_EQ(t.Records(), t2.Records()); for (int i = 0; i < t.Records(); i++) { - EXPECT_EQ(TableRecord::toString(t[i]).toStdString(), TableRecord::toString(t2[i]).toStdString()); + EXPECT_EQ(TableRecord::toString(t[i]), TableRecord::toString(t2[i])); } } @@ -228,7 +228,7 @@ TEST(TableTests, TableTestsWriteRead) { ASSERT_EQ(t.Records(), t2.Records()); for (int i = 0; i < t.Records(); i++) { - EXPECT_EQ(TableRecord::toString(t[i]).toStdString(), TableRecord::toString(t2[i]).toStdString()); + EXPECT_EQ(TableRecord::toString(t[i]), TableRecord::toString(t2[i])); } Table t3("UNITTEST", tableFile); @@ -241,7 +241,7 @@ TEST(TableTests, TableTestsWriteRead) { ASSERT_EQ(t.Records(), t3.Records()); for (int i = 0; i < t.Records(); i++) { - EXPECT_EQ(TableRecord::toString(t[i]).toStdString(), TableRecord::toString(t3[i]).toStdString()); + EXPECT_EQ(TableRecord::toString(t[i]), TableRecord::toString(t3[i])); } Table t4("NOT_UNITTEST"); @@ -276,7 +276,7 @@ TEST(TableTests, Assignment) { Table t2 = t; - EXPECT_EQ(t.Name().toStdString(), t2.Name().toStdString()); + EXPECT_EQ(t.Name(), t2.Name()); EXPECT_EQ(t.RecordFields(), t2.RecordFields()); EXPECT_EQ(t.RecordSize(), t2.RecordSize()); EXPECT_EQ(t.IsSampleAssociated(), t2.IsSampleAssociated()); @@ -285,7 +285,7 @@ TEST(TableTests, Assignment) { ASSERT_EQ(t.Records(), t2.Records()); for (int i = 0; i < t.Records(); i++) { - EXPECT_EQ(TableRecord::toString(t[i]).toStdString(), TableRecord::toString(t2[i]).toStdString()); + EXPECT_EQ(TableRecord::toString(t[i]), TableRecord::toString(t2[i])); } } diff --git a/isis/src/core/tests/unitTests/TableField/unitTest.cpp b/isis/src/core/tests/unitTests/TableField/unitTest.cpp index fa231c21a0..0167700390 100644 --- a/isis/src/core/tests/unitTests/TableField/unitTest.cpp +++ b/isis/src/core/tests/unitTests/TableField/unitTest.cpp @@ -58,8 +58,8 @@ int main(int argc, char *argv[]) { cout << "IsReal = " << textField.isReal() << endl; cout << "Size = " << textField.size() << endl; cout << "Bytes = " << textField.bytes() << endl; - textField = (QString) "Bah humbug"; - cout << "Value = " << (QString)textField << endl; + textField = (std::string) "Bah humbug"; + cout << "Value = " << (std::string)textField << endl; g = textField.pvlGroup(); cout << g << endl; cout << "----------------------------------------" << endl << endl; @@ -258,12 +258,12 @@ int main(int argc, char *argv[]) { cout << endl; cout << " operator std::string() " << endl; try { - cout << QString(realSingletonField); // try to cast a non-Text type + cout << std::string(realSingletonField); // try to cast a non-Text type } catch (IException &e) { e.print(); } - + cout << endl; cout << " operator float()" << endl; try { diff --git a/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp b/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp index a0b4f9ae7e..42d7aa56a8 100644 --- a/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp +++ b/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp @@ -315,8 +315,8 @@ namespace Isis { NumericalApproximation angFit; for (int i = 0; i < hktable.Records(); i++) { TableRecord &trec = hktable[i]; - QString scet = scrub(trec["ScetTimeClock"]); - QString shutterMode = scrub(trec["ShutterStatus"]); + QString scet = scrub(QString::fromStdString(trec["ScetTimeClock"])); + QString shutterMode = scrub(QString::fromStdString(trec["ShutterStatus"])); // Compute the optical mirror angle double mirrorSin = trec["MirrorSin"]; diff --git a/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp b/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp index 5c5ecd12b6..8fdc3ca9f9 100644 --- a/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp +++ b/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp @@ -744,8 +744,8 @@ namespace Isis { Table cFileTable = cCube->readTable(trackingTableName); int iRecs = cFileTable.Records(); if(piOrigin >= 0 && piOrigin < iRecs) { - psSrcFileName = QString(cFileTable[piOrigin][0]); - psSrcSerialNum = QString(cFileTable[piOrigin][1]); + psSrcFileName = QString::fromStdString(cFileTable[piOrigin][0]); + psSrcSerialNum = QString::fromStdString(cFileTable[piOrigin][1]); } } } diff --git a/isis/src/qisis/objs/Image/Image.cpp b/isis/src/qisis/objs/Image/Image.cpp index 576f8fc9a7..e2fd0ee9d2 100644 --- a/isis/src/qisis/objs/Image/Image.cpp +++ b/isis/src/qisis/objs/Image/Image.cpp @@ -733,7 +733,7 @@ namespace Isis { // The TableField class gives us a std::string with NULL (\0) characters... be careful not // to keep them when going to QString. - QString recordName((QString)record["Name"]); + std::string recordName(record["Name"]); double avgValue = (double)record["Average"]; if (recordName == "AspectRatio") { diff --git a/isis/src/qisis/objs/Shape/Shape.cpp b/isis/src/qisis/objs/Shape/Shape.cpp index 0061a412fe..7042dd84cf 100644 --- a/isis/src/qisis/objs/Shape/Shape.cpp +++ b/isis/src/qisis/objs/Shape/Shape.cpp @@ -674,7 +674,7 @@ namespace Isis { // The TableField class gives us a std::string with NULL (\0) characters... be careful not // to keep them when going to QString. - QString recordName((QString)record["Name"]); + std::string recordName(record["Name"]); double avgValue = (double)record["Average"]; if (recordName == "AspectRatio") { diff --git a/isis/src/rosetta/apps/rosvirtis2isis/VirtisHK.cpp b/isis/src/rosetta/apps/rosvirtis2isis/VirtisHK.cpp index b3aeb34bd7..1294a3bf4f 100644 --- a/isis/src/rosetta/apps/rosvirtis2isis/VirtisHK.cpp +++ b/isis/src/rosetta/apps/rosvirtis2isis/VirtisHK.cpp @@ -73,7 +73,7 @@ namespace Isis { * @return TableField The entire appropriate TableField for this HK */ TableField VirtisHK::tableField(){ - return TableField(m_name, m_tableType); + return TableField(m_name.toStdString(), m_tableType); } diff --git a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp index 34e866112a..3694f706fd 100644 --- a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp +++ b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp @@ -371,7 +371,7 @@ void IsisMain () // Calculate the SCET and add it to the table QString translatedScet = convertSCET(scetWords[0], scetWords[1], scetWords[2]); - rec[0] = translatedScet; + rec[0] = translatedScet.toStdString(); table += rec; // Save off first and last scet values. diff --git a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp index 85601ae208..c662600947 100644 --- a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp +++ b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp @@ -307,7 +307,7 @@ namespace Isis { double lineEndTime = 0; for (int i = 0; i < hktable.Records(); i++) { TableRecord &trec = hktable[i]; - QString scetString = trec["dataSCET"]; + QString scetString = QString::fromStdString(trec["dataSCET"]); lineEndTime = getClockTime(scetString, naifSpkCode()).Et(); m_lineRates.push_back(LineRateChange(lineno, lineEndTime-exposureTime(), diff --git a/isis/tests/FunctionalTestsCaminfo.cpp b/isis/tests/FunctionalTestsCaminfo.cpp index b92e5f15b5..5ecd167849 100644 --- a/isis/tests/FunctionalTestsCaminfo.cpp +++ b/isis/tests/FunctionalTestsCaminfo.cpp @@ -197,7 +197,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoDefault) { PvlGroup &group = statsPvl.group(i); int entry = 0; - record[entry] = group.name(); + record[entry] = group.name().toStdString(); entry++; for (int j = 0; j < group.keywords(); j++) { record[entry] = toDouble(group[j][0]); @@ -466,7 +466,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCamStatsTable) { PvlGroup &group = statsPvl.group(i); int entry = 0; - record[entry] = group.name(); + record[entry] = group.name().toStdString(); entry++; for (int j = 0; j < group.keywords(); j++) { record[entry] = toDouble(group[j][0]); From 3337b38595b90e994ccb32249e8cdfd1ff9759e4 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Wed, 25 Oct 2023 21:41:56 -0700 Subject: [PATCH 51/95] large chunk of PVL updates --- isis/src/apollo/apps/apollo2isis/main.cpp | 16 +- isis/src/apollo/apps/apollopaninit/main.cpp | 26 +- isis/src/base/apps/automos/automos.cpp | 2 +- isis/src/base/apps/cam2cam/cam2cam.cpp | 2 +- isis/src/base/apps/cam2map/cam2map.cpp | 54 +- isis/src/base/apps/caminfo/CamTools.cpp | 26 +- isis/src/base/apps/caminfo/CamTools.h | 6 +- isis/src/base/apps/caminfo/caminfo.cpp | 50 +- isis/src/base/apps/campt/campt.cpp | 12 +- isis/src/base/apps/camrange/camrange.cpp | 40 +- isis/src/base/apps/camstats/camstats.cpp | 8 +- .../src/base/apps/ckwriter/CkSpiceSegment.cpp | 14 +- isis/src/base/apps/crop/crop.cpp | 24 +- isis/src/base/apps/cropspecial/main.cpp | 16 +- isis/src/base/apps/csminit/csminit.cpp | 29 +- isis/src/base/apps/cubeavg/main.cpp | 6 +- isis/src/base/apps/cubediff/main.cpp | 38 +- isis/src/base/apps/cubefunc/main.cpp | 2 +- isis/src/base/apps/cubeit/cubeit.cpp | 2 +- isis/src/base/apps/cubenorm/main.cpp | 16 +- isis/src/base/apps/ddd2isis/main.cpp | 12 +- isis/src/base/apps/demprep/demprep.cpp | 16 +- isis/src/base/apps/editlab/main.cpp | 2 +- isis/src/base/apps/fillgap/fillgap.cpp | 2 +- .../base/apps/findgaps/FindGapsFunctor.cpp | 24 +- isis/src/base/apps/findgaps/findgaps.cpp | 2 +- .../findimageoverlaps/findimageoverlaps.cpp | 4 +- .../base/apps/footprintinit/footprintinit.cpp | 6 +- .../src/base/apps/framestitch/framestitch.cpp | 10 +- isis/src/base/apps/getsn/getsn.cpp | 12 +- isis/src/base/apps/isis2pds/isis2pds.cpp | 28 +- isis/src/base/apps/isis2std/isis2std.cpp | 6 +- isis/src/base/apps/isisexport/isisexport.cpp | 12 +- .../base/apps/isisimport/CassiniImportUtils.h | 28 +- isis/src/base/apps/isisimport/importUtils.h | 2 +- isis/src/base/apps/isisimport/isisimport.cpp | 56 +- .../apps/isisminer/CalculatorStrategy.cpp | 8 +- .../apps/isisminer/CnetReaderStrategy.cpp | 4 +- .../apps/isisminer/GisIntersectStrategy.cpp | 4 +- .../apps/isisminer/GisOverlapStrategy.cpp | 4 +- isis/src/base/apps/isisminer/PdsColumn.cpp | 18 +- .../isisminer/PdsTableCreatorStrategy.cpp | 4 +- .../apps/isisminer/PdsTableFormatStrategy.cpp | 4 +- .../apps/isisminer/PdsTableReaderStrategy.cpp | 4 +- .../base/apps/isisminer/PvlReaderStrategy.cpp | 2 +- .../apps/isisminer/RunCommandStrategy.cpp | 8 +- .../apps/isisminer/StereoPairStrategy.cpp | 8 +- .../base/apps/isisminer/StrategyFactory.cpp | 34 +- isis/src/base/apps/map2map/map2map.cpp | 48 +- isis/src/base/apps/mapmos/mapmos.cpp | 10 +- isis/src/base/apps/mappt/mappt.cpp | 42 +- isis/src/base/apps/maptrim/maptrim.cpp | 4 +- isis/src/base/apps/mosrange/mosrange.cpp | 98 +-- isis/src/base/apps/nocam2map/nocam2map.cpp | 70 +-- isis/src/base/apps/noproj/noproj.cpp | 72 +-- .../base/apps/overlapstats/overlapstats.cpp | 38 +- isis/src/base/apps/phocube/phocube.cpp | 14 +- isis/src/base/apps/phoempglobal/main.cpp | 12 +- isis/src/base/apps/phohillier/Hillier.cpp | 42 +- .../base/apps/ringsautomos/ringsautomos.cpp | 2 +- .../apps/ringspt/CameraRingsPointInfo.cpp | 110 ++-- isis/src/base/apps/shadow/ShadowFunctor.cpp | 28 +- isis/src/base/apps/shadow/shadow.cpp | 4 +- isis/src/base/apps/spiceinit/SpiceClient.cpp | 2 +- isis/src/base/apps/spiceinit/spiceinit.cpp | 40 +- .../src/base/apps/spiceserver/spiceserver.cpp | 48 +- .../base/apps/spkwriter/SpkSpiceSegment.cpp | 14 +- isis/src/base/apps/stats/stats.cpp | 46 +- isis/src/base/apps/stretch/stretch_app.cpp | 2 +- isis/src/base/objs/AlphaCube/AlphaCube.cpp | 32 +- .../src/base/objs/Application/Application.cpp | 24 +- isis/src/base/objs/Application/unitTest.cpp | 2 +- .../AtmosModelFactory/AtmosModelFactory.cpp | 6 +- isis/src/base/objs/AutoReg/AutoReg.cpp | 58 +- .../objs/AutoRegFactory/AutoRegFactory.cpp | 2 +- .../BulletShapeModel/BulletShapeModel.cpp | 4 +- isis/src/base/objs/CSMCamera/CSMCamera.cpp | 5 +- isis/src/base/objs/Camera/Camera.cpp | 46 +- .../base/objs/CameraFactory/CameraFactory.cpp | 16 +- .../objs/CameraPointInfo/CameraPointInfo.cpp | 130 ++-- .../base/objs/CameraPointInfo/unitTest.cpp | 4 +- .../CameraStatistics/CameraStatistics.cpp | 4 +- isis/src/base/objs/Cube/Cube.cpp | 96 +-- isis/src/base/objs/Cube/CubeIoHandler.cpp | 4 +- isis/src/base/objs/Cube/CubeTileHandler.cpp | 4 +- .../src/base/objs/CubeStretch/CubeStretch.cpp | 12 +- isis/src/base/objs/DemShape/DemShape.cpp | 4 +- .../EmbreeShapeModel/EmbreeShapeModel.cpp | 4 +- isis/src/base/objs/Enlarge/Enlarge.cpp | 20 +- .../base/objs/Equalization/Equalization.cpp | 58 +- .../objs/Equirectangular/Equirectangular.cpp | 6 +- .../base/objs/Equirectangular/unitTest.cpp | 4 +- .../objs/ExportPdsTable/ExportPdsTable.cpp | 26 +- isis/src/base/objs/FitsToJson/FitsToJson.cpp | 20 +- .../GridPolygonSeeder/GridPolygonSeeder.cpp | 26 +- isis/src/base/objs/GroundGrid/GroundGrid.cpp | 8 +- isis/src/base/objs/Gruen/Gruen.cpp | 30 +- isis/src/base/objs/Gruen/Gruen.h | 8 +- isis/src/base/objs/Gui/Gui.cpp | 18 +- isis/src/base/objs/Hapke/Hapke.cpp | 4 +- .../src/base/objs/IdealCamera/IdealCamera.cpp | 5 +- .../objs/ImageOverlapSet/ImageOverlapSet.cpp | 30 +- .../objs/ImportPdsTable/ImportPdsTable.cpp | 26 +- isis/src/base/objs/IsisAml/IsisAml.cpp | 26 +- isis/src/base/objs/Kernels/Kernels.cpp | 10 +- .../LabelTranslationManager.cpp | 14 +- .../LambertAzimuthalEqualArea.cpp | 4 +- .../LambertAzimuthalEqualArea/unitTest.cpp | 6 +- .../LambertConformal/LambertConformal.cpp | 4 +- isis/src/base/objs/Latitude/Latitude.cpp | 36 +- .../LimitPolygonSeeder/LimitPolygonSeeder.cpp | 18 +- .../objs/LunarAzimuthalEqualArea/unitTest.cpp | 2 +- .../LunarLambertEmpirical.cpp | 12 +- isis/src/base/objs/Mercator/Mercator.cpp | 4 +- .../MinnaertEmpirical/MinnaertEmpirical.cpp | 12 +- isis/src/base/objs/Mollweide/Mollweide.cpp | 2 +- .../MultivariateStatistics.cpp | 18 +- .../base/objs/NaifDskShape/NaifDskShape.cpp | 4 +- .../NormModelFactory/NormModelFactory.cpp | 10 +- .../ObliqueCylindrical/ObliqueCylindrical.cpp | 24 +- .../ObservationNumber/ObservationNumber.cpp | 10 +- .../OriginalXmlLabel/OriginalXmlLabel.cpp | 4 +- .../base/objs/Orthographic/Orthographic.cpp | 4 +- .../OverlapStatistics/OverlapStatistics.cpp | 50 +- isis/src/base/objs/PhotoModel/PhotoModel.cpp | 4 +- .../PhotoModelFactory/PhotoModelFactory.cpp | 4 +- isis/src/base/objs/Pipeline/Pipeline.cpp | 2 +- isis/src/base/objs/Planar/Planar.cpp | 8 +- isis/src/base/objs/Plugin/Plugin.cpp | 6 +- .../PointPerspective/PointPerspective.cpp | 4 +- .../PolarStereographic/PolarStereographic.cpp | 6 +- .../base/objs/PolygonSeeder/PolygonSeeder.cpp | 26 +- .../PolygonSeederFactory.cpp | 2 +- isis/src/base/objs/Process/Process.cpp | 16 +- .../ProcessExportPds/ProcessExportPds.cpp | 238 +++---- .../ProcessExportPds4/ProcessExportPds4.cpp | 32 +- .../ProcessImportFits/ProcessImportFits.cpp | 60 +- .../ProcessImportPds/ProcessImportPds.cpp | 84 +-- .../ProcessImportVicar/ProcessImportVicar.cpp | 6 +- .../ProcessMapMosaic/ProcessMapMosaic.cpp | 52 +- .../base/objs/ProcessMosaic/ProcessMosaic.cpp | 50 +- .../objs/ProgramLauncher/ProgramLauncher.cpp | 4 +- isis/src/base/objs/Progress/Progress.cpp | 2 +- isis/src/base/objs/Projection/Projection.cpp | 6 +- .../ProjectionFactory/ProjectionFactory.cpp | 80 +-- .../base/objs/PvlEditDialog/PvlEditDialog.cpp | 6 +- isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp | 30 +- isis/src/base/objs/PvlToJSON/PvlToJSON.cpp | 48 +- .../PvlToPvlTranslationManager.cpp | 40 +- .../PvlToXmlTranslationManager.cpp | 6 +- .../PvlTranslationTable.cpp | 28 +- isis/src/base/objs/Reduce/Reduce.cpp | 20 +- .../ReseauDistortionMap.cpp | 10 +- isis/src/base/objs/Resource/Resource.cpp | 4 +- .../objs/RingCylindrical/RingCylindrical.cpp | 8 +- .../RingPlaneProjection.cpp | 8 +- isis/src/base/objs/Robinson/Robinson.cpp | 2 +- .../base/objs/SerialNumber/SerialNumber.cpp | 10 +- .../SerialNumberList/SerialNumberList.cpp | 24 +- isis/src/base/objs/SessionLog/SessionLog.cpp | 12 +- .../ShapeModelFactory/ShapeModelFactory.cpp | 16 +- .../SimpleCylindrical/SimpleCylindrical.cpp | 2 +- isis/src/base/objs/Sinusoidal/Sinusoidal.cpp | 2 +- .../src/base/objs/SmtkMatcher/SmtkMatcher.cpp | 2 +- isis/src/base/objs/Spice/Spice.cpp | 68 +- .../base/objs/SpicePosition/SpicePosition.cpp | 18 +- isis/src/base/objs/SpicePosition/unitTest.cpp | 6 +- .../base/objs/SpiceRotation/SpiceRotation.cpp | 64 +- isis/src/base/objs/Statistics/Statistics.cpp | 50 +- isis/src/base/objs/Strategy/Strategy.cpp | 14 +- isis/src/base/objs/Strategy/Strategy.h | 4 +- isis/src/base/objs/Stretch/Stretch.cpp | 14 +- .../StripPolygonSeeder/StripPolygonSeeder.cpp | 18 +- isis/src/base/objs/SubArea/SubArea.cpp | 26 +- .../src/base/objs/TProjection/TProjection.cpp | 62 +- isis/src/base/objs/Target/Target.cpp | 36 +- .../base/objs/TiffImporter/TiffImporter.cpp | 18 +- .../base/objs/TrackingTable/TrackingTable.cpp | 2 +- .../TransverseMercator/TransverseMercator.cpp | 6 +- .../base/objs/TransverseMercator/unitTest.cpp | 40 +- .../UpturnedEllipsoidTransverseAzimuthal.cpp | 20 +- .../unitTest.cpp | 2 +- .../base/objs/UserInterface/UserInterface.cpp | 90 +-- .../XmlToPvlTranslationManager.cpp | 16 +- isis/src/base/objs/iTime/iTime.cpp | 2 +- isis/src/cassini/apps/ciss2isis/ciss2isis.cpp | 8 +- isis/src/cassini/apps/vims2isis/main.cpp | 2 +- .../apps/chan1m32isis/chan1m32isis.cpp | 2 +- isis/src/clementine/apps/clem2isis/main.cpp | 4 +- isis/src/clipper/apps/jitterfit/jitterfit.cpp | 4 +- isis/src/control/apps/autoseed/autoseed.cpp | 18 +- isis/src/control/apps/cnetcheck/cnetcheck.cpp | 14 +- .../apps/cnetcombinept/cnetcombinept.cpp | 18 +- .../control/apps/cnetextract/cnetextract.cpp | 44 +- .../apps/cnetref/CnetRefByEmission.cpp | 40 +- .../apps/cnetref/CnetRefByIncidence.cpp | 40 +- .../apps/cnetref/CnetRefByResolution.cpp | 44 +- isis/src/control/apps/cnetstats/cnetstats.cpp | 4 +- isis/src/control/apps/cnettable/main.cpp | 20 +- .../apps/findfeatures/FeatureAlgorithm.h | 10 +- .../apps/findfeatures/FeatureInventory.cpp | 14 +- .../control/apps/findfeatures/ImageSource.cpp | 2 +- .../control/apps/findfeatures/MatchMaker.cpp | 26 +- .../apps/findfeatures/MatcherAlgorithms.cpp | 2 +- .../apps/findfeatures/RobustMatcher.cpp | 2 +- .../apps/findfeatures/findfeatures.cpp | 16 +- isis/src/control/apps/jigsaw/jigsaw.cpp | 12 +- isis/src/control/apps/pointreg/pointreg.cpp | 16 +- isis/src/control/apps/sumspice/SumFile.cpp | 8 +- isis/src/control/apps/sumspice/SumFinder.cpp | 32 +- isis/src/control/apps/sumspice/sumspice.cpp | 6 +- isis/src/control/apps/warp/WarpTransform.cpp | 6 +- .../objs/BundleAdjust/BundleAdjust.cpp | 40 +- .../BundleObservationSolveSettings.cpp | 22 +- .../objs/BundleUtilities/BundleTargetBody.cpp | 8 +- .../ControlMeasureLogData.cpp | 8 +- .../control/objs/ControlNet/ControlNet.cpp | 6 +- .../objs/ControlNetDiff/ControlNetDiff.cpp | 78 +-- .../ControlNetFilter/ControlNetFilter.cpp | 22 +- .../ControlNetStatistics.cpp | 72 +-- .../ControlNetValidMeasure.cpp | 90 +-- .../ControlNetVersioner.cpp | 300 ++++----- .../ControlNetVersioner/ControlPointV0001.cpp | 155 ++--- .../ControlNetVersioner/ControlPointV0002.cpp | 84 +-- .../ControlNetVersioner/ControlPointV0003.cpp | 72 +-- .../ControlPointList/ControlPointList.cpp | 8 +- .../CorrelationMatrix/CorrelationMatrix.cpp | 14 +- .../InterestOperator/InterestOperator.cpp | 80 +-- .../objs/InterestOperator/InterestOperator.h | 2 +- .../InterestOperatorFactory.cpp | 2 +- isis/src/core/include/Blob.h | 8 +- isis/src/core/include/Preference.h | 2 +- isis/src/core/include/Pvl.h | 16 +- isis/src/core/include/PvlContainer.h | 48 +- isis/src/core/include/PvlFormat.h | 26 +- isis/src/core/include/PvlFormatPds.h | 28 +- isis/src/core/include/PvlGroup.h | 2 +- isis/src/core/include/PvlKeyword.h | 87 ++- isis/src/core/include/PvlObject.h | 32 +- isis/src/core/include/Table.h | 12 +- isis/src/core/src/Blob.cpp | 60 +- isis/src/core/src/FileName.cpp | 8 +- isis/src/core/src/IException.cpp | 10 +- isis/src/core/src/Preference.cpp | 19 +- isis/src/core/src/Pvl.cpp | 42 +- isis/src/core/src/PvlContainer.cpp | 63 +- isis/src/core/src/PvlFormat.cpp | 49 +- isis/src/core/src/PvlFormatPds.cpp | 145 +++-- isis/src/core/src/PvlGroup.cpp | 12 +- isis/src/core/src/PvlKeyword.cpp | 587 ++++++++++-------- isis/src/core/src/PvlObject.cpp | 70 +-- isis/src/core/src/PvlSequence.cpp | 4 +- isis/src/core/src/Table.cpp | 36 +- isis/src/core/src/TableField.cpp | 16 +- isis/src/core/tests/Fixtures.h | 2 +- isis/src/core/tests/PvlKeywordTests.cpp | 66 +- isis/src/core/tests/TableTests.cpp | 2 +- .../tests/unitTests/IException/unitTest.cpp | 4 +- .../tests/unitTests/Preference/unitTest.cpp | 2 +- .../tests/unitTests/PvlContainer/unitTest.cpp | 4 +- .../tests/unitTests/PvlFormatPds/unitTest.cpp | 120 ++-- .../tests/unitTests/PvlGroup/unitTest.cpp | 16 +- .../tests/unitTests/PvlSequence/unitTest.cpp | 6 +- .../tests/unitTests/TableField/unitTest.cpp | 12 +- .../objs/DatabaseFactory/DatabaseFactory.cpp | 4 +- isis/src/database/objs/DbAccess/DbAccess.cpp | 2 +- .../src/database/objs/DbProfile/DbProfile.cpp | 8 +- .../dawn/objs/DawnVirCamera/DawnVirCamera.cpp | 4 +- isis/src/galileo/apps/gllnims2isis/main.cpp | 4 +- isis/src/galileo/apps/gllssi2isis/main.cpp | 2 +- isis/src/hayabusa/apps/amicacal/main.cpp | 18 +- isis/src/hayabusa2/apps/hyb2onccal/main.cpp | 6 +- isis/src/lro/apps/lronacpho/LROCEmpirical.cpp | 12 +- isis/src/lro/apps/lrowaccal/lrowaccal.cpp | 4 +- isis/src/lro/apps/lrowacpho/Exponential.cpp | 12 +- .../lro/apps/lrowacpho/HapkeExponential.cpp | 12 +- isis/src/lro/apps/lrowacpho/Hillier.cpp | 22 +- .../LroNarrowAngleCamera.cpp | 4 +- isis/src/messenger/apps/mdiscal/main.cpp | 2 +- .../apps/mdisedrinfo/SpiceManager.cpp | 2 +- isis/src/mro/apps/hidtmgen/hidtmgen.cpp | 6 +- isis/src/mro/apps/hirdrgen/main.cpp | 6 +- isis/src/odyssey/apps/thm2isis/thm2isis.cpp | 2 +- .../qisis/objs/BandSpinBox/BandSpinBox.cpp | 4 +- isis/src/qisis/objs/BandTool/BandTool.cpp | 6 +- .../RosettaVirtisCamera.cpp | 4 +- 286 files changed, 3655 insertions(+), 3609 deletions(-) diff --git a/isis/src/apollo/apps/apollo2isis/main.cpp b/isis/src/apollo/apps/apollo2isis/main.cpp index d9371e7076..a051c66b0d 100644 --- a/isis/src/apollo/apps/apollo2isis/main.cpp +++ b/isis/src/apollo/apps/apollo2isis/main.cpp @@ -239,9 +239,9 @@ void TranslateApolloLabels (IString filename, Cube *opack) { PvlGroup error("ERROR"); error.addComment("The decrypted code is invalid."); for (int i=0; i<4; i++) { - PvlKeyword keyword("Column"+toString(i+1)); + PvlKeyword keyword("Column"+std::to_string(i+1)); for (int j=0; j<32; j++) { - keyword += toString((int)code[i][j]); + keyword += std::to_string((int)code[i][j]); } error.addKeyword(keyword); codeGroup += keyword; @@ -250,17 +250,17 @@ void TranslateApolloLabels (IString filename, Cube *opack) { } else { codeGroup += PvlKeyword("StartTime", FrameTime()); - codeGroup += PvlKeyword("SpacecraftAltitude", toString(Altitude()),"meters"); + codeGroup += PvlKeyword("SpacecraftAltitude", std::to_string(Altitude()),"meters"); if (apollo->IsMetric()){ - codeGroup += PvlKeyword("ExposureDuration", toString(ShutterInterval()), "milliseconds"); + codeGroup += PvlKeyword("ExposureDuration", std::to_string(ShutterInterval()), "milliseconds"); codeGroup += PvlKeyword("ForwardMotionCompensation", FMC()); } for (int i=0; i<4; i++) { - PvlKeyword keyword("Column"+toString(i+1)); + PvlKeyword keyword("Column"+ std::to_string(i+1)); for (int j=0; j<32; j++) { - keyword += toString((int)code[i][j]); + keyword += std::to_string((int)code[i][j]); } codeGroup += keyword; } @@ -292,9 +292,9 @@ void TranslateApolloLabels (IString filename, Cube *opack) { y += 20; } - reseaus->findKeyword("Sample")[i] = toString( + reseaus->findKeyword("Sample")[i] = std::to_string( cos(rotation)*(x-sampleTranslation) - sin(rotation)*(y-lineTranslation) + sampleTranslation); - reseaus->findKeyword("Line")[i] = toString( + reseaus->findKeyword("Line")[i] = std::to_string( sin(rotation)*(x-sampleTranslation) + cos(rotation)*(y-lineTranslation) + lineTranslation); } inst += PvlKeyword("StartTime", utcTime); diff --git a/isis/src/apollo/apps/apollopaninit/main.cpp b/isis/src/apollo/apps/apollopaninit/main.cpp index 84e8269eb7..47e93836bb 100644 --- a/isis/src/apollo/apps/apollopaninit/main.cpp +++ b/isis/src/apollo/apps/apollopaninit/main.cpp @@ -181,7 +181,7 @@ void IsisMain() { keyword.setName("LineExposureDuration"); //converted led to msec/mm--negative sign to account for the anti-parallel time and line axes - keyword.setValue(iStrTEMP=toString(-led),"sec/mm"); + keyword.setValue(iStrTEMP=std::to_string(-led),"sec/mm"); inst_pvlG.addKeyword(keyword); panCube.putGroup(inst_pvlG); @@ -191,7 +191,7 @@ void IsisMain() { kernels_pvlG.clear(); keyword.setName("NaifFrameCode"); - keyword.setValue(toString(insCode)); + keyword.setValue(std::to_string(insCode)); kernels_pvlG.addKeyword(keyword); keyword.setName("LeapSecond"); @@ -404,7 +404,7 @@ void IsisMain() { recordPos[2] = posJ20[2]; recordPos[3] = temp; //temp = et (right now anyway) tablePos += recordPos; - tablePos.Label() += PvlKeyword("SpkTableStartTime",toString(temp)); + tablePos.Label() += PvlKeyword("SpkTableStartTime",std::to_string(temp)); //now the other node temp = 0.515*(time1-time0); //3% extension posSel[0] = pos0[0] + temp*vel[0]; //selenocentric coordinate calculation @@ -424,7 +424,7 @@ void IsisMain() { recordPos[2] = posJ20[2]; recordPos[3] = temp; //temp = et (right now anyway) tablePos += recordPos; - tablePos.Label() += PvlKeyword("SpkTableEndTime",toString(temp)); + tablePos.Label() += PvlKeyword("SpkTableEndTime",std::to_string(temp)); tablePos.Label() += PvlKeyword("CacheType","Linear"); tablePos.Label() += PvlKeyword("Description","Created by apollopaninit"); panCube.write(tablePos); //now attach it to the table @@ -547,18 +547,18 @@ void IsisMain() { recordRot[4] = Q[i][4]; tableRot += recordRot; } - tableRot.Label() += PvlKeyword("CkTableStartTime", toString(Q[0][4])); - tableRot.Label() += PvlKeyword("CkTableEndTime", toString(Q[NODES-1][4])); + tableRot.Label() += PvlKeyword("CkTableStartTime", std::to_string(Q[0][4])); + tableRot.Label() += PvlKeyword("CkTableEndTime", std::to_string(Q[NODES-1][4])); tableRot.Label() += PvlKeyword("Description", "Created by appollopan2isis"); keyword.setName("TimeDependentFrames"); - keyword.setValue(toString(scFrameCode)); + keyword.setValue(std::to_string(scFrameCode)); keyword.addValue("1"); tableRot.Label() += keyword; keyword.setName("ConstantFrames"); - keyword.setValue(toString(insCode)); - keyword.addValue(toString(scFrameCode)); + keyword.setValue(std::to_string(insCode)); + keyword.addValue(std::to_string(scFrameCode)); tableRot.Label() += keyword; keyword.setName("ConstantRotation"); @@ -777,10 +777,10 @@ void IsisMain() { ApolloPanoramicCamera* cam = (ApolloPanoramicCamera*)(panCube.camera()); //log the residual report from interior orientation PvlGroup residualStats("InteriorOrientationStats"); - residualStats += PvlKeyword("FiducialsFound", toString(tableFid.Records())); - residualStats += PvlKeyword("ResidualMax", toString(cam->intOriResidualMax()),"pixels"); - residualStats += PvlKeyword("ResidualMean", toString(cam->intOriResidualMean()),"pixels"); - residualStats += PvlKeyword("ResidualStdev", toString(cam->intOriResidualStdev()),"pixels"); + residualStats += PvlKeyword("FiducialsFound", std::to_string(tableFid.Records())); + residualStats += PvlKeyword("ResidualMax", std::to_string(cam->intOriResidualMax()),"pixels"); + residualStats += PvlKeyword("ResidualMean", std::to_string(cam->intOriResidualMean()),"pixels"); + residualStats += PvlKeyword("ResidualStdev", std::to_string(cam->intOriResidualStdev()),"pixels"); Application::Log( residualStats ); diff --git a/isis/src/base/apps/automos/automos.cpp b/isis/src/base/apps/automos/automos.cpp index 90896db327..7cc1cca5e0 100644 --- a/isis/src/base/apps/automos/automos.cpp +++ b/isis/src/base/apps/automos/automos.cpp @@ -78,7 +78,7 @@ namespace Isis { for (int i = 0; i < list.size(); i++) { if (!m.StartProcess(list[i].toString())) { PvlGroup outsiders("Outside"); - outsiders += PvlKeyword("File", list[i].toString()); + outsiders += PvlKeyword("File", (list[i].toString().toStdString())); Application::AppendAndLog(outsiders, log); } else { diff --git a/isis/src/base/apps/cam2cam/cam2cam.cpp b/isis/src/base/apps/cam2cam/cam2cam.cpp index 566fd5cd72..4f03f56c12 100644 --- a/isis/src/base/apps/cam2cam/cam2cam.cpp +++ b/isis/src/base/apps/cam2cam/cam2cam.cpp @@ -70,7 +70,7 @@ namespace Isis { // Set the reference band we want to match PvlGroup instgrp = mcube->group("Instrument"); if (!outcam->IsBandIndependent()) { - PvlKeyword rBand("ReferenceBand", toString(referenceBand)); + PvlKeyword rBand("ReferenceBand", std::to_string(referenceBand)); rBand.addComment("# All bands are aligned to reference band"); instgrp += rBand; mcube->putGroup(instgrp); diff --git a/isis/src/base/apps/cam2map/cam2map.cpp b/isis/src/base/apps/cam2map/cam2map.cpp index 10b93a8d61..b1370b8259 100644 --- a/isis/src/base/apps/cam2map/cam2map.cpp +++ b/isis/src/base/apps/cam2map/cam2map.cpp @@ -31,7 +31,7 @@ namespace Isis { // Get the map projection file provided by the user Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); cam2map(&icube, userMap, userGrp, ui, log); @@ -66,10 +66,10 @@ namespace Isis { // Make the target info match the user mapfile double minlat, maxlat, minlon, maxlon; incam->GroundRange(minlat, maxlat, minlon, maxlon, userMap); - camGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minlat)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxlat)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minlon)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxlon)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(minlat)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(maxlat)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(minlon)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(maxlon)), Pvl::Replace); // We want to delete the keywords we just added if the user wants the range @@ -84,10 +84,10 @@ namespace Isis { // Make sure the target name of the input cube and map file match. if (userGrp.hasKeyword("TargetName") && !icube->group("Instrument").findKeyword("TargetName").isNull()) { - if (!PvlKeyword::stringEqual(incam->target()->name(), userGrp.findKeyword("TargetName")[0])) { - QString msg = "The TargetName: [" + incam->target()->name() + "] of the input cube: [" + icube->fileName() + + if (!PvlKeyword::stringEqual(incam->target()->name().toStdString(), userGrp.findKeyword("TargetName")[0])) { + std::string msg = "The TargetName: [" + incam->target()->name().toStdString() + "] of the input cube: [" + icube->fileName().toStdString() + "] does not match the TargetName: [" + userGrp.findKeyword("TargetName")[0] + "] of the map file: [" + - ui.GetFileName("MAP") + "]."; + ui.GetFileName("MAP").toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -119,22 +119,22 @@ namespace Isis { // If the user decided to enter a ground range then override if ( ui.WasEntered("MINLON") ) { userGrp.addKeyword(PvlKeyword("MinimumLongitude", - toString(ui.GetDouble("MINLON"))), Pvl::Replace); + std::to_string(ui.GetDouble("MINLON"))), Pvl::Replace); } if ( ui.WasEntered("MAXLON") ) { userGrp.addKeyword(PvlKeyword("MaximumLongitude", - toString(ui.GetDouble("MAXLON"))), Pvl::Replace); + std::to_string(ui.GetDouble("MAXLON"))), Pvl::Replace); } if ( ui.WasEntered("MINLAT") ) { userGrp.addKeyword(PvlKeyword("MinimumLatitude", - toString(ui.GetDouble("MINLAT"))), Pvl::Replace); + std::to_string(ui.GetDouble("MINLAT"))), Pvl::Replace); } if ( ui.WasEntered("MAXLAT") ) { userGrp.addKeyword(PvlKeyword("MaximumLatitude", - toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); + std::to_string(ui.GetDouble("MAXLAT"))), Pvl::Replace); } // If they want the res. from the mapfile, delete it from the camera so @@ -164,7 +164,7 @@ namespace Isis { if (ui.WasEntered("PIXRES")) { if (ui.GetString("PIXRES") == "MPP") { userGrp.addKeyword(PvlKeyword("PixelResolution", - toString(ui.GetDouble("RESOLUTION"))), + std::to_string(ui.GetDouble("RESOLUTION"))), Pvl::Replace); if (userGrp.hasKeyword("Scale")) { userGrp.deleteKeyword("Scale"); @@ -172,7 +172,7 @@ namespace Isis { } else if (ui.GetString("PIXRES") == "PPD") { userGrp.addKeyword(PvlKeyword("Scale", - toString(ui.GetDouble("RESOLUTION"))), + std::to_string(ui.GetDouble("RESOLUTION"))), Pvl::Replace); if (userGrp.hasKeyword("PixelResolution")) { userGrp.deleteKeyword("PixelResolution"); @@ -205,16 +205,16 @@ namespace Isis { double minlat, maxlat, minlon, maxlon; incam->GroundRange(minlat, maxlat, minlon, maxlon, userMap); if (!ui.WasEntered("MINLAT")) { - userGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minlat)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(minlat)), Pvl::Replace); } if (!ui.WasEntered("MAXLAT")) { - userGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxlat)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(maxlat)), Pvl::Replace); } if (!ui.WasEntered("MINLON")) { - userGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minlon)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(minlon)), Pvl::Replace); } if (!ui.WasEntered("MAXLON")) { - userGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxlon)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(maxlon)), Pvl::Replace); } } @@ -294,14 +294,14 @@ namespace Isis { // Create an alpha cube group for the output cube if (!ocube->hasGroup("AlphaCube")) { PvlGroup alpha("AlphaCube"); - alpha += PvlKeyword("AlphaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("AlphaLines", toString(icube->lineCount())); - alpha += PvlKeyword("AlphaStartingSample", toString(0.5)); - alpha += PvlKeyword("AlphaStartingLine", toString(0.5)); - alpha += PvlKeyword("AlphaEndingSample", toString(icube->sampleCount() + 0.5)); - alpha += PvlKeyword("AlphaEndingLine", toString(icube->lineCount() + 0.5)); - alpha += PvlKeyword("BetaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("BetaLines", toString(icube->lineCount())); + alpha += PvlKeyword("AlphaSamples", std::to_string(icube->sampleCount())); + alpha += PvlKeyword("AlphaLines", std::to_string(icube->lineCount())); + alpha += PvlKeyword("AlphaStartingSample", std::to_string(0.5)); + alpha += PvlKeyword("AlphaStartingLine", std::to_string(0.5)); + alpha += PvlKeyword("AlphaEndingSample", std::to_string(icube->sampleCount() + 0.5)); + alpha += PvlKeyword("AlphaEndingLine", std::to_string(icube->lineCount() + 0.5)); + alpha += PvlKeyword("BetaSamples", std::to_string(icube->sampleCount())); + alpha += PvlKeyword("BetaLines", std::to_string(icube->lineCount())); ocube->putGroup(alpha); } @@ -404,7 +404,7 @@ namespace Isis { startLine -= offset; } - if (((QString)instGrp["Framelets"]).toUpper() == "EVEN") { + if ((QString::fromStdString(instGrp["Framelets"])).toUpper() == "EVEN") { startLine += frameSize; } diff --git a/isis/src/base/apps/caminfo/CamTools.cpp b/isis/src/base/apps/caminfo/CamTools.cpp index 1cee5bff68..cf610766e2 100644 --- a/isis/src/base/apps/caminfo/CamTools.cpp +++ b/isis/src/base/apps/caminfo/CamTools.cpp @@ -368,14 +368,14 @@ namespace Isis { GProperties g = getGeometrySummary(); //geometry keywords for band output - pband += PvlKeyword("BandsUsed", toString(size())); - pband += PvlKeyword("ReferenceBand", toString(g.band)); - pband += PvlKeyword("OriginalBand", toString(g.realBand)); + pband += PvlKeyword("BandsUsed", std::to_string(size())); + pband += PvlKeyword("ReferenceBand", std::to_string(g.band)); + pband += PvlKeyword("OriginalBand", std::to_string(g.realBand)); - pband += PvlKeyword("Target", g.target); + pband += PvlKeyword("Target", g.target.toStdString()); - pband += PvlKeyword("StartTime", g.startTime); - pband += PvlKeyword("EndTime", g.endTime); + pband += PvlKeyword("StartTime", g.startTime.toStdString()); + pband += PvlKeyword("EndTime", g.endTime.toStdString()); pband += ValidateKey("CenterLine", g.centerLine); pband += ValidateKey("CenterSample", g.centerSamp); @@ -591,8 +591,8 @@ namespace Isis { // Compute new ranges double minLat180, maxLat180, minLon180, maxLon180; camera.GroundRange(minLat180, maxLat180, minLon180, maxLon180, sinuMap); - minkey.setValue(ToString(minLon180)); - maxkey.setValue(ToString(maxLon180)); + minkey.setValue(ToString(minLon180).toStdString()); + maxkey.setValue(ToString(maxLon180).toStdString()); clon = (minLon180 + maxLon180) / 2.0; // Convert the polygon to 180 domain @@ -600,7 +600,7 @@ namespace Isis { } } - mapping += PvlKeyword("CenterLongitude", toString(clon)); + mapping += PvlKeyword("CenterLongitude", std::to_string(clon)); TProjection *sinu = (TProjection *) ProjectionFactory::Create(sinuMap, true); geos::geom::MultiPolygon *sPoly = PolygonTools::LatLonToXY(*poly, sinu); @@ -647,15 +647,15 @@ namespace Isis { pband += ValidateKey("SurfaceArea", _summary.surfaceArea, "km^2"); pband += ValidateKey("GlobalCoverage", globalCoverage, "percent"); if(_combined != 0) { - pband += PvlKeyword("SampleIncrement", toString(_sampleInc)); - pband += PvlKeyword("LineIncrement", toString(_lineInc)); + pband += PvlKeyword("SampleIncrement", std::to_string(_sampleInc)); + pband += PvlKeyword("LineIncrement", std::to_string(_lineInc)); if(_combined->getGeometryTypeId() != geos::geom::GEOS_MULTIPOLYGON) { geos::geom::MultiPolygon *geom = makeMultiPolygon(_combined); - pband += PvlKeyword("GisFootprint", geom->toString().c_str()); + pband += PvlKeyword("GisFootprint", geom->toString()); delete geom; } else { - pband += PvlKeyword("GisFootprint", _combined->toString().c_str()); + pband += PvlKeyword("GisFootprint", _combined->toString()); } } else { diff --git a/isis/src/base/apps/caminfo/CamTools.h b/isis/src/base/apps/caminfo/CamTools.h index 7a7f79aaed..9fddecbc95 100644 --- a/isis/src/base/apps/caminfo/CamTools.h +++ b/isis/src/base/apps/caminfo/CamTools.h @@ -53,10 +53,10 @@ namespace Isis { const double &value, const QString &unit = "") { if(IsSpecial(value)) { - return (PvlKeyword(keyname, "NULL")); + return (PvlKeyword(keyname.toStdString(), "NULL")); } else { - return (PvlKeyword(keyname, toString(value), unit)); + return (PvlKeyword(keyname.toStdString(), std::to_string(value), unit.toStdString())); } } @@ -75,7 +75,7 @@ namespace Isis { inline PvlKeyword ValidateKey(const QString keyname, PvlKeyword &key, const QString &unit = "") { if(key.isNull()) { - return (PvlKeyword(keyname, "NULL")); + return (PvlKeyword(keyname.toStdString(), "NULL")); } else { return (ValidateKey(keyname, (double) key, unit)); diff --git a/isis/src/base/apps/caminfo/caminfo.cpp b/isis/src/base/apps/caminfo/caminfo.cpp index 475854368f..2dc5469b94 100644 --- a/isis/src/base/apps/caminfo/caminfo.cpp +++ b/isis/src/base/apps/caminfo/caminfo.cpp @@ -61,7 +61,7 @@ namespace Isis{ PvlObject params("Caminfo"); PvlObject common("Parameters"); for(int i = 0; i < general->size(); i++) - common += PvlKeyword((*general)[i].first, (*general)[i].second); + common += PvlKeyword((*general)[i].first.toStdString(), (*general)[i].second.toStdString()); params.addObject(common); // Add the camstats @@ -123,9 +123,9 @@ namespace Isis{ pout.addObject(params); if(ui.GetBoolean("APPEND")) - pout.append(outFile); + pout.append(outFile.toStdString()); else - pout.write(outFile); + pout.write(outFile.toStdString()); } @@ -181,8 +181,8 @@ namespace Isis{ PvlObject geomGrp("Geometry"); bandGeom->generateGeometryKeys(geomGrp); for(int i = 0; i < geomGrp.keywords(); i++) { - if(not appending) keys += "Geom_" + geomGrp[i].name() + delim; - values += geomGrp[i][0] + delim; + if(not appending) keys += "Geom_" + QString::fromStdString(geomGrp[i].name()) + delim; + values += QString::fromStdString(geomGrp[i][0]) + delim; } } @@ -308,36 +308,36 @@ namespace Isis{ // Add keywords for backwards comaptibility PvlGroup cg = camPvl.findGroup("Latitude", Pvl::Traverse); - camstats->append(MakePair("MinimumLatitude", cg["latitudeminimum"][0])); - camstats->append(MakePair("MaximumLatitude", cg["latitudemaximum"][0])); + camstats->append(MakePair("MinimumLatitude", QString::fromStdString(cg["latitudeminimum"][0]))); + camstats->append(MakePair("MaximumLatitude", QString::fromStdString(cg["latitudemaximum"][0]))); cg = camPvl.findGroup("Longitude", Pvl::Traverse); - camstats->append(MakePair("MinimumLongitude", cg["longitudeminimum"][0])); - camstats->append(MakePair("MaximumLongitude", cg["longitudemaximum"][0])); + camstats->append(MakePair("MinimumLongitude", QString::fromStdString(cg["longitudeminimum"][0]))); + camstats->append(MakePair("MaximumLongitude", QString::fromStdString(cg["longitudemaximum"][0]))); cg = camPvl.findGroup("Resolution", Pvl::Traverse); - camstats->append(MakePair("MinimumResolution", cg["resolutionminimum"][0])); - camstats->append(MakePair("MaximumResolution", cg["resolutionmaximum"][0])); + camstats->append(MakePair("MinimumResolution", QString::fromStdString(cg["resolutionminimum"][0]))); + camstats->append(MakePair("MaximumResolution", QString::fromStdString(cg["resolutionmaximum"][0]))); cg = camPvl.findGroup("PhaseAngle", Pvl::Traverse); - camstats->append(MakePair("MinimumPhase", cg["phaseminimum"][0])); - camstats->append(MakePair("MaximumPhase", cg["phasemaximum"][0])); + camstats->append(MakePair("MinimumPhase", QString::fromStdString(cg["phaseminimum"][0]))); + camstats->append(MakePair("MaximumPhase", QString::fromStdString(cg["phasemaximum"][0]))); cg = camPvl.findGroup("EmissionAngle", Pvl::Traverse); - camstats->append(MakePair("MinimumEmission", cg["emissionminimum"][0])); - camstats->append(MakePair("MaximumEmission", cg["emissionmaximum"][0])); + camstats->append(MakePair("MinimumEmission", QString::fromStdString(cg["emissionminimum"][0]))); + camstats->append(MakePair("MaximumEmission", QString::fromStdString(cg["emissionmaximum"][0]))); cg = camPvl.findGroup("IncidenceAngle", Pvl::Traverse); - camstats->append(MakePair("MinimumIncidence", cg["incidenceminimum"][0])); - camstats->append(MakePair("MaximumIncidence", cg["incidencemaximum"][0])); + camstats->append(MakePair("MinimumIncidence", QString::fromStdString(cg["incidenceminimum"][0]))); + camstats->append(MakePair("MaximumIncidence", QString::fromStdString(cg["incidencemaximum"][0]))); cg = camPvl.findGroup("LocalSolarTime", Pvl::Traverse); - camstats->append(MakePair("LocalTimeMinimum", cg["localsolartimeMinimum"][0])); - camstats->append(MakePair("LocalTimeMaximum", cg["localsolartimeMaximum"][0])); + camstats->append(MakePair("LocalTimeMinimum", QString::fromStdString(cg["localsolartimeMinimum"][0]))); + camstats->append(MakePair("LocalTimeMaximum", QString::fromStdString(cg["localsolartimeMaximum"][0]))); cg = camPvl.findGroup("ObliqueResolution", Pvl::Traverse); - camstats->append(MakePair("ObliqueResolutionMinimum", cg["ObliqueResolutionMinimum"][0])); - camstats->append(MakePair("ObliqueResolutionMaximum", cg["ObliqueResolutionMaximum"][0])); + camstats->append(MakePair("ObliqueResolutionMinimum", QString::fromStdString(cg["ObliqueResolutionMinimum"][0]))); + camstats->append(MakePair("ObliqueResolutionMaximum", QString::fromStdString(cg["ObliqueResolutionMaximum"][0]))); // Add keywords for all camera values // Skips first "UserParameters" group. @@ -346,7 +346,7 @@ namespace Isis{ for (int j = 0; j < group.keywords(); j++) { PvlKeyword &keyword = group[j]; - camstats->append(MakePair(keyword.name(), keyword[0])); + camstats->append(MakePair(QString::fromStdString(keyword.name()), QString::fromStdString(keyword[0]))); } } } @@ -441,7 +441,7 @@ namespace Isis{ bool found = false; PvlGroup fpgrp; for (objIter=pvl.endObject()-1; objIter>=pvl.beginObject(); objIter--) { - if (objIter->name().toUpper() == "FOOTPRINTINIT") { + if (QString::fromStdString(objIter->name()).toUpper() == "FOOTPRINTINIT") { found = true; fpgrp = objIter->findGroup("UserParameters"); break; @@ -451,7 +451,7 @@ namespace Isis{ std::string msg = "Footprint blob was not found in input image history"; throw IException(IException::User, msg, _FILEINFO_); } - QString prec = (QString)fpgrp.findKeyword("INCREASEPRECISION"); + QString prec = QString::fromStdString(fpgrp.findKeyword("INCREASEPRECISION")); prec = prec.toUpper(); if (prec == "TRUE") { precision = true; @@ -459,7 +459,7 @@ namespace Isis{ else { precision = false; } - QString inctype = (QString)fpgrp.findKeyword("INCTYPE"); + QString inctype = QString::fromStdString(fpgrp.findKeyword("INCTYPE")); inctype = inctype.toUpper(); if (inctype == "LINCSINC") { int linc = fpgrp.findKeyword("LINC"); diff --git a/isis/src/base/apps/campt/campt.cpp b/isis/src/base/apps/campt/campt.cpp index 58a45412ec..93173929b9 100644 --- a/isis/src/base/apps/campt/campt.cpp +++ b/isis/src/base/apps/campt/campt.cpp @@ -203,10 +203,10 @@ namespace Isis{ // we don't want to overwrite successive points in outfile if (append || p > 0) { - temp.append(outFile); + temp.append(outFile.toStdString()); } else { - temp.write(outFile); + temp.write(outFile.toStdString()); } } // Create a flatfile from PVL data @@ -247,12 +247,12 @@ namespace Isis{ for (int i = 0; i < (*point).keywords(); i++) { if ((*point)[i].size() == 3) { - os << (QString)(*point)[i][0] << "," - << (QString)(*point)[i][1] << "," - << (QString)(*point)[i][2]; + os << (*point)[i][0] << "," + << (*point)[i][1] << "," + << (*point)[i][2]; } else { - os << (QString)(*point)[i]; + os << (*point)[i]; } if (i < (*point).keywords() - 1) { diff --git a/isis/src/base/apps/camrange/camrange.cpp b/isis/src/base/apps/camrange/camrange.cpp index e4a6c2f375..13be4c86cd 100644 --- a/isis/src/base/apps/camrange/camrange.cpp +++ b/isis/src/base/apps/camrange/camrange.cpp @@ -33,18 +33,18 @@ namespace Isis { cam->radii(radii); Target *camTarget = cam->target(); PvlGroup target("Target"); - target += PvlKeyword("From", ui.GetCubeName("FROM")); - target += PvlKeyword("TargetName", camTarget->name()); - target += PvlKeyword("RadiusA", toString(radii[0].meters()), "meters"); - target += PvlKeyword("RadiusB", toString(radii[1].meters()), "meters"); - target += PvlKeyword("RadiusC", toString(radii[2].meters()), "meters"); + target += PvlKeyword("From", ui.GetCubeName("FROM").toStdString()); + target += PvlKeyword("TargetName", camTarget->name().toStdString()); + target += PvlKeyword("RadiusA", std::to_string(radii[0].meters()), "meters"); + target += PvlKeyword("RadiusB", std::to_string(radii[1].meters()), "meters"); + target += PvlKeyword("RadiusC", std::to_string(radii[2].meters()), "meters"); // Get resolution PvlGroup res("PixelResolution"); double lowres = cam->LowestImageResolution(); double hires = cam->HighestImageResolution(); - res += PvlKeyword("Lowest", toString(lowres), "meters"); - res += PvlKeyword("Highest", toString(hires), "meters"); + res += PvlKeyword("Lowest", std::to_string(lowres), "meters"); + res += PvlKeyword("Highest", std::to_string(hires), "meters"); // Get the universal ground range PvlGroup ugr("UniversalGroundRange"); @@ -53,10 +53,10 @@ namespace Isis { ugr += PvlKeyword("LatitudeType", "Planetocentric"); ugr += PvlKeyword("LongitudeDirection", "PositiveEast"); ugr += PvlKeyword("LongitudeDomain", "360"); - ugr += PvlKeyword("MinimumLatitude", toString(minlat)); - ugr += PvlKeyword("MaximumLatitude", toString(maxlat)); - ugr += PvlKeyword("MinimumLongitude", toString(minlon)); - ugr += PvlKeyword("MaximumLongitude", toString(maxlon)); + ugr += PvlKeyword("MinimumLatitude", std::to_string(minlat)); + ugr += PvlKeyword("MaximumLatitude", std::to_string(maxlat)); + ugr += PvlKeyword("MinimumLongitude", std::to_string(minlon)); + ugr += PvlKeyword("MaximumLongitude", std::to_string(maxlon)); // Get the ographic latitude range mapgrp.addKeyword(PvlKeyword("LatitudeType", "Planetographic"), @@ -64,8 +64,8 @@ namespace Isis { cam->GroundRange(minlat, maxlat, minlon, maxlon, mapping); PvlGroup ogr("LatitudeRange"); ogr += PvlKeyword("LatitudeType", "Planetographic"); - ogr += PvlKeyword("MinimumLatitude", toString(minlat)); - ogr += PvlKeyword("MaximumLatitude", toString(maxlat)); + ogr += PvlKeyword("MinimumLatitude", std::to_string(minlat)); + ogr += PvlKeyword("MaximumLatitude", std::to_string(maxlat)); // Get positive west longitude coordinates in 360 domain mapgrp.addKeyword(PvlKeyword("LongitudeDirection", "PositiveWest"), @@ -74,8 +74,8 @@ namespace Isis { PvlGroup pos360("PositiveWest360"); pos360 += PvlKeyword("LongitudeDirection", "PositiveWest"); pos360 += PvlKeyword("LongitudeDomain", "360"); - pos360 += PvlKeyword("MinimumLongitude", toString(minlon)); - pos360 += PvlKeyword("MaximumLongitude", toString(maxlon)); + pos360 += PvlKeyword("MinimumLongitude", std::to_string(minlon)); + pos360 += PvlKeyword("MaximumLongitude", std::to_string(maxlon)); // Get positive east longitude coordinates in 180 domain mapgrp.addKeyword(PvlKeyword("LongitudeDirection", "PositiveEast"), @@ -86,8 +86,8 @@ namespace Isis { PvlGroup pos180("PositiveEast180"); pos180 += PvlKeyword("LongitudeDirection", "PositiveEast"); pos180 += PvlKeyword("LongitudeDomain", "180"); - pos180 += PvlKeyword("MinimumLongitude", toString(minlon)); - pos180 += PvlKeyword("MaximumLongitude", toString(maxlon)); + pos180 += PvlKeyword("MinimumLongitude", std::to_string(minlon)); + pos180 += PvlKeyword("MaximumLongitude", std::to_string(maxlon)); // Get positive west longitude coordinates in 180 domain mapgrp.addKeyword(PvlKeyword("LongitudeDirection", "PositiveWest"), @@ -96,8 +96,8 @@ namespace Isis { PvlGroup neg180("PositiveWest180"); neg180 += PvlKeyword("LongitudeDirection", "PositiveWest"); neg180 += PvlKeyword("LongitudeDomain", "180"); - neg180 += PvlKeyword("MinimumLongitude", toString(minlon)); - neg180 += PvlKeyword("MaximumLongitude", toString(maxlon)); + neg180 += PvlKeyword("MinimumLongitude", std::to_string(minlon)); + neg180 += PvlKeyword("MaximumLongitude", std::to_string(maxlon)); Application::AppendAndLog(target, log); Application::AppendAndLog(res, log); @@ -109,7 +109,7 @@ namespace Isis { // Write the log->file if requested if(ui.WasEntered("TO")) { - log->write(ui.GetFileName("TO", "txt")); + log->write(ui.GetFileName("TO", "txt").toStdString()); } p.EndProcess(); diff --git a/isis/src/base/apps/camstats/camstats.cpp b/isis/src/base/apps/camstats/camstats.cpp index 8f7e7e6f92..8123bffac7 100644 --- a/isis/src/base/apps/camstats/camstats.cpp +++ b/isis/src/base/apps/camstats/camstats.cpp @@ -63,7 +63,7 @@ namespace Isis { // If the user chose a format of PVL, then write to the output file ("TO") if(ui.GetString("FORMAT") == "PVL") { - (append) ? statsPvl.append(outfile) : statsPvl.write(outfile); + (append) ? statsPvl.append(outfile.toStdString()) : statsPvl.write(outfile.toStdString()); } else { // Create a flatfile of the data with columhn headings the flatfile is @@ -184,7 +184,7 @@ namespace Isis { record += favg; record += fstd; - Table table(cam_name, record); + Table table(cam_name.toStdString(), record); // Place all the gathered camera statistics in a table and attach it to the // cube. Skip "UserParameters" group. @@ -192,10 +192,10 @@ namespace Isis { PvlGroup &group = statsPvl.group(i); int entry = 0; - record[entry] = group.name().toStdString(); + record[entry] = group.name(); entry++; for (int j = 0; j < group.keywords(); j++) { - record[entry] = toDouble(group[j][0]); + record[entry] = std::stod(group[j][0]); entry++; } table += record; diff --git a/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp index b81e84ff39..9e1bd26d70 100644 --- a/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp +++ b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp @@ -157,11 +157,11 @@ CkSpiceSegment::SVector CkSpiceSegment::TickRate() const { QString CkSpiceSegment::getKeyValue(PvlObject &label, const QString &keyword) { - QString value(""); - if ( label.hasKeyword(keyword,Pvl::Traverse) ) { - value = label.findKeyword(keyword,Pvl::Traverse)[0]; + std::string value(""); + if ( label.hasKeyword(keyword.toStdString(), Pvl::Traverse) ) { + value = label.findKeyword(keyword.toStdString(), Pvl::Traverse)[0]; } - return (value); + return QString::fromStdString(value); } void CkSpiceSegment::import(Cube &cube, const QString &tblname) { @@ -360,7 +360,7 @@ bool CkSpiceSegment::getTimeDependentFrameIds(Table &table, int &toId, int &from if ( table.Label().hasKeyword("TimeDependentFrames") ) { PvlKeyword labelTimeFrames = table.Label()["TimeDependentFrames"]; for (int i=0; igetPluginName()); + std:string currentPluginName = plugin->getPluginName(); for (size_t modelIndex = 0; modelIndex < plugin->getNumModels(); modelIndex++) { - QString modelName = QString::fromStdString(plugin->getModelName(modelIndex)); + std::string modelName = plugin->getModelName(modelIndex); message += "Plugin [" + currentPluginName + "], Model [" + modelName + "]\n"; } } @@ -215,7 +215,7 @@ namespace Isis { } PvlGroup &instrumentGroup = cube->group("Instrument"); if (ui.WasEntered("TARGETNAME")) { - instrumentGroup.addKeyword(PvlKeyword("TargetName", ui.GetString("TARGETNAME")), Pvl::Replace); + instrumentGroup.addKeyword(PvlKeyword("TargetName", ui.GetString("TARGETNAME").toStdString()), Pvl::Replace); } // If the user doesn't specify a target name, then we will still need // something on the label for the Target & ShapeModel so add Unknown @@ -226,19 +226,16 @@ namespace Isis { } if (!instrumentGroup.hasKeyword("InstrumentId")) { - PvlKeyword instrumentIdKey("InstrumentId", QString::fromStdString(model->getSensorIdentifier())); + PvlKeyword instrumentIdKey("InstrumentId", model->getSensorIdentifier()); instrumentGroup.addKeyword(instrumentIdKey, Pvl::Replace); } // Populate the CsmInfo group with useful information cube->deleteGroup("CsmInfo"); PvlGroup infoGroup("CsmInfo"); - infoGroup += PvlKeyword("CSMPlatformID", - QString::fromStdString(model->getPlatformIdentifier())); - infoGroup += PvlKeyword("CSMInstrumentId", - QString::fromStdString(model->getSensorIdentifier())); - infoGroup += PvlKeyword("ReferenceTime", - QString::fromStdString(model->getReferenceDateAndTime())); + infoGroup += PvlKeyword("CSMPlatformID", model->getPlatformIdentifier()); + infoGroup += PvlKeyword("CSMInstrumentId", model->getSensorIdentifier()); + infoGroup += PvlKeyword("ReferenceTime", model->getReferenceDateAndTime()); csm::GeometricModel *modelWithParams = dynamic_cast(model); if (modelWithParams) { @@ -246,8 +243,8 @@ namespace Isis { PvlKeyword paramUnits("ModelParameterUnits"); PvlKeyword paramTypes("ModelParameterTypes"); for (const csm::GeometricModel::Parameter ¶m : modelWithParams->getParameters()) { - paramNames += QString::fromStdString(param.name); - paramUnits += QString::fromStdString(param.units); + paramNames += param.name; + paramUnits += param.units; switch (param.type) { case csm::param::NONE: paramTypes += "NONE"; @@ -285,7 +282,7 @@ namespace Isis { if (ui.WasEntered("SHAPEMODEL")) { // TODO validate the shapemodel - kernelsGroup.addKeyword(PvlKeyword("ShapeModel", ui.GetFileName("SHAPEMODEL")), Pvl::Replace); + kernelsGroup.addKeyword(PvlKeyword("ShapeModel", ui.GetFileName("SHAPEMODEL").toStdString()), Pvl::Replace); } else { kernelsGroup.addKeyword(PvlKeyword("ShapeModel", "Null"), Pvl::Replace); @@ -415,8 +412,8 @@ namespace Isis { Blob csmStateBlob("CSMState", "String"); csmStateBlob.setData(modelState.c_str(), modelState.size()); PvlObject &blobLabel = csmStateBlob.Label(); - blobLabel += PvlKeyword("ModelName", modelName); - blobLabel += PvlKeyword("PluginName", pluginName); + blobLabel += PvlKeyword("ModelName", modelName.toStdString()); + blobLabel += PvlKeyword("PluginName", pluginName.toStdString()); cube->write(csmStateBlob); // Try to add naif keywords diff --git a/isis/src/base/apps/cubeavg/main.cpp b/isis/src/base/apps/cubeavg/main.cpp index 7d0266ec46..709ec41a33 100644 --- a/isis/src/base/apps/cubeavg/main.cpp +++ b/isis/src/base/apps/cubeavg/main.cpp @@ -145,14 +145,14 @@ void compute(vector centers, vector widths, small = (double)centers[i] - (double)widths[i] / 2.0; } } - pvlCenter.setValue(toString((large - small) / 2 + small), centerUnit); + pvlCenter.setValue(std::to_string((large - small) / 2 + small), centerUnit); if(hasWidth) { PvlKeyword &pvlWidth = pvlg.findKeyword("Width"); - pvlWidth.setValue(toString(large - small), pvlWidth.unit()); + pvlWidth.setValue(std::to_string(large - small), pvlWidth.unit()); } else { PvlKeyword pvlWidth = PvlKeyword("Width"); - pvlWidth.setValue(toString(large - small), centerUnit); + pvlWidth.setValue(std::to_string(large - small), centerUnit); pvlg.addKeyword(pvlWidth); } diff --git a/isis/src/base/apps/cubediff/main.cpp b/isis/src/base/apps/cubediff/main.cpp index a2abc76439..c4da886ed4 100644 --- a/isis/src/base/apps/cubediff/main.cpp +++ b/isis/src/base/apps/cubediff/main.cpp @@ -85,9 +85,9 @@ void IsisMain() { } else { results += PvlKeyword("Compare", "Different"); - results += PvlKeyword("Sample", toString(sample)); - results += PvlKeyword("Line", toString(line)); - results += PvlKeyword("Band", toString(band)); + results += PvlKeyword("Sample", std::to_string(sample)); + results += PvlKeyword("Line", std::to_string(line)); + results += PvlKeyword("Band", std::to_string(band)); if(stats.TotalPixels() < 1) { results += PvlKeyword("AverageDifference", "0"); results += PvlKeyword("StandardDeviation", "0"); @@ -96,21 +96,21 @@ void IsisMain() { results += PvlKeyword("MaximumDifference", "0"); } else { - results += PvlKeyword("AverageDifference", toString(stats.Average())); - results += PvlKeyword("StandardDeviation", toString(stats.StandardDeviation())); - results += PvlKeyword("Variance", toString(stats.Variance())); - results += PvlKeyword("MinimumDifference", toString(stats.Minimum())); - results += PvlKeyword("MaximumDifference", toString(stats.Maximum())); - results += PvlKeyword("MaxDifferenceSample", toString(gMaxDiffSample)); - results += PvlKeyword("MaxDifferenceLine", toString(gMaxDiffLine)); - results += PvlKeyword("MaxDifferenceBand", toString(gMaxDiffBand)); + results += PvlKeyword("AverageDifference", std::to_string(stats.Average())); + results += PvlKeyword("StandardDeviation", std::to_string(stats.StandardDeviation())); + results += PvlKeyword("Variance", std::to_string(stats.Variance())); + results += PvlKeyword("MinimumDifference", std::to_string(stats.Minimum())); + results += PvlKeyword("MaximumDifference", std::to_string(stats.Maximum())); + results += PvlKeyword("MaxDifferenceSample", std::to_string(gMaxDiffSample)); + results += PvlKeyword("MaxDifferenceLine", std::to_string(gMaxDiffLine)); + results += PvlKeyword("MaxDifferenceBand", std::to_string(gMaxDiffBand)); } - results += PvlKeyword("ValidPixelDifferences", toString(stats.TotalPixels())); - results += PvlKeyword("SpecialPixelDifferences", toString(spCount)); - results += PvlKeyword("SigFigAccuracy", toString(sigFigAccuracy)); - results += PvlKeyword("SigFigMaxDifferenceSample", toString(sigFigSample)); - results += PvlKeyword("SigFigMaxDifferenceLine", toString(sigFigLine)); - results += PvlKeyword("SigFigMaxDifferenceBand", toString(sigFigBand)); + results += PvlKeyword("ValidPixelDifferences", std::to_string(stats.TotalPixels())); + results += PvlKeyword("SpecialPixelDifferences", std::to_string(spCount)); + results += PvlKeyword("SigFigAccuracy", std::to_string(sigFigAccuracy)); + results += PvlKeyword("SigFigMaxDifferenceSample", std::to_string(sigFigSample)); + results += PvlKeyword("SigFigMaxDifferenceLine", std::to_string(sigFigLine)); + results += PvlKeyword("SigFigMaxDifferenceBand", std::to_string(sigFigBand)); } Application::Log(results); @@ -278,7 +278,7 @@ void diffTable(std::ofstream &target, int precision) { for(unsigned int i = 0; i < samps.size(); i++) { Column currCol; //Prepare and add the first file's column - currCol.SetName(QString("File1_") + toString(samps[i])); + currCol.SetName(QString("File1_") + std::to_string(samps[i])); if((int)(colWidth + precision + 1) < (int)currCol.Name().length()) { currCol.SetWidth(currCol.Name().length() + 1); } @@ -290,7 +290,7 @@ void diffTable(std::ofstream &target, int precision) { cols.push_back(currCol); //Prepare and add the second file's column - currCol.SetName(QString("File2_") + toString(samps[i])); + currCol.SetName(QString("File2_") + std::to_string(samps[i])); cols.push_back(currCol); } diff --git a/isis/src/base/apps/cubefunc/main.cpp b/isis/src/base/apps/cubefunc/main.cpp index fffe7669d0..4602f488e1 100644 --- a/isis/src/base/apps/cubefunc/main.cpp +++ b/isis/src/base/apps/cubefunc/main.cpp @@ -75,7 +75,7 @@ void IsisMain() { PvlGroup results("Results"); QString message = "Invalid input pixels converted to Isis NULL values"; results += PvlKeyword("Error", message); - results += PvlKeyword("Count", toString(bad)); + results += PvlKeyword("Count", std::to_string(bad)); Application::Log(results); } p.EndProcess(); diff --git a/isis/src/base/apps/cubeit/cubeit.cpp b/isis/src/base/apps/cubeit/cubeit.cpp index 91e4eb9027..5a23cf4aae 100644 --- a/isis/src/base/apps/cubeit/cubeit.cpp +++ b/isis/src/base/apps/cubeit/cubeit.cpp @@ -58,7 +58,7 @@ namespace Isis { newBands.push_back(QString::number(j+1)); } else { - QString msg = "TRACKING band not propagated from " + cubeList[i].toString(); + std::string msg = "TRACKING band not propagated from " + cubeList[i].toString().toStdString(); results += PvlKeyword("UnpropagatedBand", msg); } } diff --git a/isis/src/base/apps/cubenorm/main.cpp b/isis/src/base/apps/cubenorm/main.cpp index 51b19bde26..635766ece5 100644 --- a/isis/src/base/apps/cubenorm/main.cpp +++ b/isis/src/base/apps/cubenorm/main.cpp @@ -219,15 +219,15 @@ void getStats(Buffer &in) { void pvlOut(const QString &StatFile) { PvlGroup results("Results"); for(unsigned int i = 0; i < st.size(); i++) { - results += PvlKeyword("Band", toString(band[i])); - results += PvlKeyword("RowCol", toString(element[i])); - results += PvlKeyword("ValidPixels", toString(st[i].ValidPixels())); + results += PvlKeyword("Band", std::to_string(band[i])); + results += PvlKeyword("RowCol", std::to_string(element[i])); + results += PvlKeyword("ValidPixels", std::to_string(st[i].ValidPixels())); if(st[i].ValidPixels() > 0) { - results += PvlKeyword("Mean", toString(st[i].Average())); - results += PvlKeyword("Median", toString(median[i])); - results += PvlKeyword("Std", toString(st[i].StandardDeviation())); - results += PvlKeyword("Minimum", toString(st[i].Minimum())); - results += PvlKeyword("Maximum", toString(st[i].Maximum())); + results += PvlKeyword("Mean", std::to_string(st[i].Average())); + results += PvlKeyword("Median", std::to_string(median[i])); + results += PvlKeyword("Std", std::to_string(st[i].StandardDeviation())); + results += PvlKeyword("Minimum", std::to_string(st[i].Minimum())); + results += PvlKeyword("Maximum", std::to_string(st[i].Maximum())); } else { results += PvlKeyword("Mean", "0.0"); diff --git a/isis/src/base/apps/ddd2isis/main.cpp b/isis/src/base/apps/ddd2isis/main.cpp index ec6121a2e4..25a8d41edc 100644 --- a/isis/src/base/apps/ddd2isis/main.cpp +++ b/isis/src/base/apps/ddd2isis/main.cpp @@ -140,14 +140,14 @@ void IsisMain() { fin.close(); PvlGroup results("FileInfo"); - results += PvlKeyword( "NumberOfLines", toString(nLines) ); - results += PvlKeyword( "NumberOfBytesPerLine", toString(nBytes) ); - results += PvlKeyword( "BitType", toString(bitType) ); + results += PvlKeyword( "NumberOfLines", std::to_string(nLines) ); + results += PvlKeyword( "NumberOfBytesPerLine", std::to_string(nBytes) ); + results += PvlKeyword( "BitType", std::to_string(bitType) ); int nSamples = nBytes / (totalBandBits / 8); - results += PvlKeyword( "NumberOfSamples", toString(nSamples) ); + results += PvlKeyword( "NumberOfSamples", std::to_string(nSamples) ); int nBands = (totalBandBits / 8) / dataTypeBytes; - results += PvlKeyword( "NumberOfBands", toString(nBands) ); - results += PvlKeyword( "LabelBytes", toString(nOffset) ); + results += PvlKeyword( "NumberOfBands", std::to_string(nBands) ); + results += PvlKeyword( "LabelBytes", std::to_string(nOffset) ); Application::Log(results); ProcessImport p; diff --git a/isis/src/base/apps/demprep/demprep.cpp b/isis/src/base/apps/demprep/demprep.cpp index f3c73e6298..97bb829f78 100644 --- a/isis/src/base/apps/demprep/demprep.cpp +++ b/isis/src/base/apps/demprep/demprep.cpp @@ -66,8 +66,8 @@ namespace Isis{ p.StartProcess(GetStats); PvlGroup demRange("Results"); - demRange += PvlKeyword("MinimumRadius", toString(inCubeStats.Minimum()), "meters"); - demRange += PvlKeyword("MaximumRadius", toString(inCubeStats.Maximum()), "meters"); + demRange += PvlKeyword("MinimumRadius", std::to_string(inCubeStats.Minimum()), "meters"); + demRange += PvlKeyword("MaximumRadius", std::to_string(inCubeStats.Maximum()), "meters"); Application::Log(demRange); // Store min/max radii values in new ShapeModelStatistics table @@ -79,7 +79,7 @@ namespace Isis{ record += fmin; record += fmax; - Table table(shp_name,record); + Table table(shp_name.toStdString(), record); record[0] = Distance(inCubeStats.Minimum(), Distance::Meters).kilometers(); @@ -237,12 +237,12 @@ namespace Isis{ double upperLeftCorner = mapgrp["UpperLeftCornerX"]; upperLeftCorner -= leftPad * proj->Resolution(); - mapgrp.addKeyword(PvlKeyword("UpperLeftCornerX", toString(upperLeftCorner), "meters"), + mapgrp.addKeyword(PvlKeyword("UpperLeftCornerX", std::to_string(upperLeftCorner), "meters"), Pvl::Replace); upperLeftCorner = mapgrp["UpperLeftCornerY"]; upperLeftCorner += topPad * proj->Resolution(); - mapgrp.addKeyword(PvlKeyword("UpperLeftCornerY", toString(upperLeftCorner), "meters"), + mapgrp.addKeyword(PvlKeyword("UpperLeftCornerY", std::to_string(upperLeftCorner), "meters"), Pvl::Replace); @@ -264,8 +264,8 @@ namespace Isis{ ocube->putGroup(mapgrp); PvlGroup demRange("Results"); - demRange += PvlKeyword("MinimumRadius", toString(outCubeStats.Minimum()), "meters"); - demRange += PvlKeyword("MaximumRadius", toString(outCubeStats.Maximum()), "meters"); + demRange += PvlKeyword("MinimumRadius", std::to_string(outCubeStats.Minimum()), "meters"); + demRange += PvlKeyword("MaximumRadius", std::to_string(outCubeStats.Maximum()), "meters"); Application::Log(demRange); // Store min/max radii values in new ShapeModelStatistics table @@ -277,7 +277,7 @@ namespace Isis{ record += fmin; record += fmax; - Table table(shp_name,record); + Table table(shp_name.toStdString(), record); record[0] = Distance(outCubeStats.Minimum(), Distance::Meters).kilometers(); diff --git a/isis/src/base/apps/editlab/main.cpp b/isis/src/base/apps/editlab/main.cpp index 4e402aeb36..68d4f9f595 100644 --- a/isis/src/base/apps/editlab/main.cpp +++ b/isis/src/base/apps/editlab/main.cpp @@ -76,7 +76,7 @@ void IsisMain() { // Set Keyword else if(option == "SETKEY") { - if(grp.hasKeyword(key)) { + if(grp.hasKeyword(key.toStdString())) { PvlKeyword *first = NULL; // Clean duplicate keywords of ONLY the provided keyword for(int i = 0; i < grp.keywords(); i++) { diff --git a/isis/src/base/apps/fillgap/fillgap.cpp b/isis/src/base/apps/fillgap/fillgap.cpp index 5757c6be76..d58276204d 100644 --- a/isis/src/base/apps/fillgap/fillgap.cpp +++ b/isis/src/base/apps/fillgap/fillgap.cpp @@ -78,7 +78,7 @@ namespace Isis { if(numSpecPixKept > 0) { PvlGroup mLog("Messages"); mLog += PvlKeyword("Warning", - "Unable to fill " + toString(numSpecPixKept) + " special pixels."); + "Unable to fill " + std::to_string(numSpecPixKept) + " special pixels."); Application::AppendAndLog(mLog, log); } return; diff --git a/isis/src/base/apps/findgaps/FindGapsFunctor.cpp b/isis/src/base/apps/findgaps/FindGapsFunctor.cpp index 690e77aa0d..1701ad8760 100644 --- a/isis/src/base/apps/findgaps/FindGapsFunctor.cpp +++ b/isis/src/base/apps/findgaps/FindGapsFunctor.cpp @@ -115,7 +115,7 @@ namespace Isis { * @return Pvl group of gaps to be displayed */ void FindGapsFunctor::setModification(QString newModValue) { - m_gaps->findKeyword("Modification").setValue(newModValue); + m_gaps->findKeyword("Modification").setValue(newModValue.toStdString()); } @@ -151,18 +151,18 @@ namespace Isis { if( !(*m_inGap) ) { *m_inGap = true; - m_gap->addKeyword(PvlKeyword("NewGapInBand", toString(in.Band()))); - m_gap->addKeyword(PvlKeyword("StartLine", toString(in.Line()))); + m_gap->addKeyword(PvlKeyword("NewGapInBand", std::to_string(in.Band()))); + m_gap->addKeyword(PvlKeyword("StartLine", std::to_string(in.Line()))); if(correlation == Isis::Null) { correlation = 0.0; } - m_gap->addKeyword(PvlKeyword("Correlation", toString(correlation))); + m_gap->addKeyword(PvlKeyword("Correlation", std::to_string(correlation))); } if (in.Line() == m_lineCount) { - m_gap->addKeyword(PvlKeyword("LastGapLine", toString(in.Line()))); - m_gap->addKeyword(PvlKeyword("ToEndOfBand", toString(m_lineCount))); + m_gap->addKeyword(PvlKeyword("LastGapLine", std::to_string(in.Line()))); + m_gap->addKeyword(PvlKeyword("ToEndOfBand", std::to_string(m_lineCount))); addGapToGroup(); } @@ -174,7 +174,7 @@ namespace Isis { * correlate. Or this line is the last line and it is in the gap. */ - m_gap->addKeyword(PvlKeyword("LastGapLine", toString(in.Line() - 2))); + m_gap->addKeyword(PvlKeyword("LastGapLine", std::to_string(in.Line() - 2))); addGapToGroup(); } @@ -195,9 +195,9 @@ namespace Isis { for (int i = 0; i < m_gaps->groups(); i++) { - int gapBand = toInt((*m_gaps).group(i).findKeyword(" NewGapInBand")[0]); - int gapStart = toInt((*m_gaps).group(i).findKeyword("StartLine")[0]); - int gapEnd = toInt((*m_gaps).group(i).findKeyword("LastGapLine")[0]); + int gapBand = std::stoi((*m_gaps).group(i).findKeyword(" NewGapInBand")[0]); + int gapStart = std::stoi((*m_gaps).group(i).findKeyword("StartLine")[0]); + int gapEnd = std::stoi((*m_gaps).group(i).findKeyword("LastGapLine")[0]); if ( (in.Line() >= gapStart - m_bufferSizeBeforeGap) && (in.Line() <= gapEnd + m_bufferSizeAfterGap) && @@ -239,8 +239,8 @@ namespace Isis { * In case the gap is a flase positive. The end of the gap will end up being the line * before the start of the gap. */ - if (toInt(m_gap->findKeyword("StartLine")[0]) < - toInt(m_gap->findKeyword("LastGapLine")[0])) { + if (std::stoi(m_gap->findKeyword("StartLine")[0]) < + std::stoi(m_gap->findKeyword("LastGapLine")[0])) { m_gaps->addGroup(*m_gap); } diff --git a/isis/src/base/apps/findgaps/findgaps.cpp b/isis/src/base/apps/findgaps/findgaps.cpp index 0f0ef6df55..25cc559046 100644 --- a/isis/src/base/apps/findgaps/findgaps.cpp +++ b/isis/src/base/apps/findgaps/findgaps.cpp @@ -65,7 +65,7 @@ namespace Isis { } if (logFileSpecified) { - gapsFunctor.gaps().write(ui.GetFileName("LOG")); + gapsFunctor.gaps().write(ui.GetFileName("LOG").toStdString()); } } else { diff --git a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp index 65b9a9721a..a86a593f02 100644 --- a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp +++ b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp @@ -80,11 +80,11 @@ namespace Isis { } } - outFile.write(FileName(ui.GetFileName("ERRORS")).expanded()); + outFile.write(FileName(ui.GetFileName("ERRORS")).expanded().toStdString()); } PvlGroup results("Results"); - results += PvlKeyword("ErrorCount", toString((BigInt)overlaps.Errors().size())); + results += PvlKeyword("ErrorCount", std::to_string((BigInt)overlaps.Errors().size())); Application::Log(results); } diff --git a/isis/src/base/apps/footprintinit/footprintinit.cpp b/isis/src/base/apps/footprintinit/footprintinit.cpp index a7dd4ad3de..01ba059725 100644 --- a/isis/src/base/apps/footprintinit/footprintinit.cpp +++ b/isis/src/base/apps/footprintinit/footprintinit.cpp @@ -86,7 +86,7 @@ namespace Isis { } if (testXY) { - Pvl map(ui.GetFileName("MAP")); + Pvl map(ui.GetFileName("MAP").toStdString()); PvlGroup &mapGroup = map.findGroup("MAPPING"); // This call adds TargetName, EquatorialRadius and PolarRadius to mapGroup @@ -142,8 +142,8 @@ namespace Isis { if (precision) { PvlGroup results("Results"); - results.addKeyword(PvlKeyword("SINC", toString(sinc))); - results.addKeyword(PvlKeyword("LINC", toString(linc))); + results.addKeyword(PvlKeyword("SINC", std::to_string(sinc))); + results.addKeyword(PvlKeyword("LINC", std::to_string(linc))); Application::AppendAndLog(results, log); } diff --git a/isis/src/base/apps/framestitch/framestitch.cpp b/isis/src/base/apps/framestitch/framestitch.cpp index 03be752106..153dc9d521 100644 --- a/isis/src/base/apps/framestitch/framestitch.cpp +++ b/isis/src/base/apps/framestitch/framestitch.cpp @@ -108,18 +108,18 @@ namespace Isis { const PvlGroup &evenInst = evenCube->group("Instrument"); const PvlGroup &oddInst = oddCube->group("Instrument"); // Use the start time as an indicator of being the same original image - if (QString::compare(QString(evenInst["StartTime"]), QString(oddInst["StartTime"])) != 0) { + if (QString::compare(QString::fromStdString(evenInst["StartTime"]), QString::fromStdString(oddInst["StartTime"])) != 0) { std::string msg = "Even and odd cube start times must match."; throw IException(IException::User, msg, _FILEINFO_); } if (evenInst.hasKeyword("DataFlipped") && oddInst.hasKeyword("DataFlipped")) { - if (toBool(evenInst["DataFlipped"]) != toBool(oddInst["DataFlipped"])) { + if (toBool(QString::fromStdString(evenInst["DataFlipped"])) != toBool(QString::fromStdString(oddInst["DataFlipped"]))) { std::string msg = "Both input cubes must be flipped or not flipped. Cannot combine " "a flipped and unflipped cube."; throw IException(IException::User, msg, _FILEINFO_); } - inputFlipped = toBool(evenInst["DataFlipped"]); + inputFlipped = toBool(QString::fromStdString(evenInst["DataFlipped"])); } } @@ -234,13 +234,13 @@ namespace Isis { if (!outInst.hasKeyword("DataFlipped")) { outInst.addKeyword(PvlKeyword("DataFlipped")); } - outInst["DataFlipped"].setValue(toString(!inputFlipped)); + outInst["DataFlipped"].setValue(std::to_string(!inputFlipped)); } // Record numLinesOverlap if (!outInst.hasKeyword("NumLinesOverlap")) outInst.addKeyword(PvlKeyword("NumLinesOverlap")); - outInst["numLinesOverlap"].setValue(toString(numLinesOverlap)); + outInst["numLinesOverlap"].setValue(std::to_string(numLinesOverlap)); process.EndProcess(); diff --git a/isis/src/base/apps/getsn/getsn.cpp b/isis/src/base/apps/getsn/getsn.cpp index 4dbdd72df8..20e15b2505 100644 --- a/isis/src/base/apps/getsn/getsn.cpp +++ b/isis/src/base/apps/getsn/getsn.cpp @@ -52,9 +52,9 @@ namespace Isis { PvlGroup sn("Results"); - if (WriteFile) sn += PvlKeyword("Filename", from); - if (WriteSN) sn += PvlKeyword( "SerialNumber", SerialNumber::Compose( *label, ui.GetBoolean("DEFAULT") ) ); - if (WriteObservation) sn += PvlKeyword( "ObservationNumber", ObservationNumber::Compose( *label, ui.GetBoolean("DEFAULT") ) ); + if (WriteFile) sn += PvlKeyword("Filename", from.toStdString()); + if (WriteSN) sn += PvlKeyword( "SerialNumber", SerialNumber::Compose( *label, ui.GetBoolean("DEFAULT") ).toStdString() ); + if (WriteObservation) sn += PvlKeyword( "ObservationNumber", ObservationNumber::Compose( *label, ui.GetBoolean("DEFAULT") ).toStdString() ); if ( ui.WasEntered("TO") ) { // PVL option @@ -63,9 +63,9 @@ namespace Isis { Pvl pvl; pvl.addGroup(sn); if ( ui.GetBoolean("APPEND") ) - pvl.append( ui.GetFileName("TO") ); + pvl.append( ui.GetFileName("TO").toStdString() ); else - pvl.write( ui.GetFileName("TO") ); + pvl.write( ui.GetFileName("TO").toStdString() ); } // FLAT option else { @@ -78,7 +78,7 @@ namespace Isis { for (int i = 0; i < sn.keywords(); i++) { if (i != 0) line += ","; - line += sn[i][0]; + line += QString::fromStdString(sn[i][0]); } txt.PutLine(line); } diff --git a/isis/src/base/apps/isis2pds/isis2pds.cpp b/isis/src/base/apps/isis2pds/isis2pds.cpp index 9250d82bd9..8ce5ea6b9c 100644 --- a/isis/src/base/apps/isis2pds/isis2pds.cpp +++ b/isis/src/base/apps/isis2pds/isis2pds.cpp @@ -113,13 +113,13 @@ namespace Isis{ //Records what it did to the print.prt file PvlGroup results("DNs Used"); - results += PvlKeyword("Null", toString(p.OutputNull())); - results += PvlKeyword("LRS", toString(p.OutputLrs())); - results += PvlKeyword("LIS", toString(p.OutputLis())); - results += PvlKeyword("HIS", toString(p.OutputHis())); - results += PvlKeyword("HRS", toString(p.OutputHrs())); - results += PvlKeyword("ValidMin", toString(min)); - results += PvlKeyword("ValidMax", toString(max)); + results += PvlKeyword("Null", std::to_string(p.OutputNull())); + results += PvlKeyword("LRS", std::to_string(p.OutputLrs())); + results += PvlKeyword("LIS", std::to_string(p.OutputLis())); + results += PvlKeyword("HIS", std::to_string(p.OutputHis())); + results += PvlKeyword("HRS", std::to_string(p.OutputHrs())); + results += PvlKeyword("ValidMin", std::to_string(min)); + results += PvlKeyword("ValidMax", std::to_string(max)); Application::Log(results); } else { @@ -187,13 +187,13 @@ namespace Isis{ // Records what it did to the print.prt file PvlGroup results("DNs Used"); - results += PvlKeyword("Null", toString(process.OutputNull())); - results += PvlKeyword("LRS", toString(process.OutputLrs())); - results += PvlKeyword("LIS", toString(process.OutputLis())); - results += PvlKeyword("HIS", toString(process.OutputHis())); - results += PvlKeyword("HRS", toString(process.OutputHrs())); - results += PvlKeyword("ValidMin", toString(min)); - results += PvlKeyword("ValidMax", toString(max)); + results += PvlKeyword("Null", std::to_string(process.OutputNull())); + results += PvlKeyword("LRS", std::to_string(process.OutputLrs())); + results += PvlKeyword("LIS", std::to_string(process.OutputLis())); + results += PvlKeyword("HIS", std::to_string(process.OutputHis())); + results += PvlKeyword("HRS", std::to_string(process.OutputHrs())); + results += PvlKeyword("ValidMin", std::to_string(min)); + results += PvlKeyword("ValidMax", std::to_string(max)); Application::Log(results); process.StandardPds4Label(); diff --git a/isis/src/base/apps/isis2std/isis2std.cpp b/isis/src/base/apps/isis2std/isis2std.cpp index 0d4749d229..9a5c2a5417 100644 --- a/isis/src/base/apps/isis2std/isis2std.cpp +++ b/isis/src/base/apps/isis2std/isis2std.cpp @@ -94,7 +94,7 @@ namespace Isis { // Write out the results PvlGroup results("Results"); - results += PvlKeyword("OutputFileName", outputName.expanded()); + results += PvlKeyword("OutputFileName", outputName.expanded().toStdString()); if (mode == "GRAYSCALE") { addResults(results, exporter, "", 0); @@ -138,8 +138,8 @@ namespace Isis { void addResults(PvlGroup &results, ImageExporter *exporter, QString channel, int index) { - results += PvlKeyword(channel + "InputMinimum", toString(exporter->inputMinimum(index))); - results += PvlKeyword(channel + "InputMaximum", toString(exporter->inputMaximum(index))); + results += PvlKeyword(channel.toStdString() + "InputMinimum", std::to_string(exporter->inputMinimum(index))); + results += PvlKeyword(channel.toStdString() + "InputMaximum", std::to_string(exporter->inputMaximum(index))); } } \ No newline at end of file diff --git a/isis/src/base/apps/isisexport/isisexport.cpp b/isis/src/base/apps/isisexport/isisexport.cpp index bb2963dded..b4d9a9539c 100644 --- a/isis/src/base/apps/isisexport/isisexport.cpp +++ b/isis/src/base/apps/isisexport/isisexport.cpp @@ -116,7 +116,7 @@ namespace Isis { vector extraPvlFiles; ui.GetFileName("EXTRAPVL", extraPvlFiles); for (QString pvlFile : extraPvlFiles) { - Pvl extraPvl(pvlFile); + Pvl extraPvl(pvlFile.toStdString()); json extraJson = pvlToJSON(extraPvl); // Notify users of duplicate keys that will be overwritten if (log) { @@ -127,7 +127,7 @@ namespace Isis { + "] in extra Pvl file [" + pvlFile + "]. " + "Previous value [" + QString::fromStdString(dataSource["ExtraPvl"][element.key()].dump()) + "] will be overwritten."; - duplicateWarnings += PvlKeyword("Duplicate", message); + duplicateWarnings += PvlKeyword("Duplicate", message.toStdString()); Application::AppendAndLog(duplicateWarnings, log); } } @@ -146,9 +146,9 @@ namespace Isis { for (auto& element : extraJson.items()) { if (dataSource["ExtraXml"].contains(element.key())) { PvlGroup duplicateWarnings("Warning"); - QString message = "Duplicate element [" + QString::fromStdString(element.key()) - + "] in extra xml file [" + xmlFile + "]. " - + "Previous value [" + QString::fromStdString(dataSource["ExtraXml"][element.key()].dump()) + std::string message = "Duplicate element [" + element.key() + + "] in extra xml file [" + xmlFile.toStdString() + "]. " + + "Previous value [" + dataSource["ExtraXml"][element.key()].dump() + "] will be overwritten."; duplicateWarnings += PvlKeyword("Duplicate", message); Application::AppendAndLog(duplicateWarnings, log); @@ -174,7 +174,7 @@ namespace Isis { + "] in extra json file [" + jsonFile + "]. " + "Previous value [" + QString::fromStdString(dataSource["ExtraJson"][element.key()].dump()) + "] will be overwritten."; - duplicateWarnings += PvlKeyword("Duplicate", message); + duplicateWarnings += PvlKeyword("Duplicate", message.toStdString()); Application::AppendAndLog(duplicateWarnings, log); } } diff --git a/isis/src/base/apps/isisimport/CassiniImportUtils.h b/isis/src/base/apps/isisimport/CassiniImportUtils.h index 2173798035..7a04941390 100644 --- a/isis/src/base/apps/isisimport/CassiniImportUtils.h +++ b/isis/src/base/apps/isisimport/CassiniImportUtils.h @@ -40,8 +40,8 @@ namespace Isis { CassiniIssFixDnFunctor(PvlKeyword &stretchPairs, QString dataConversionType, int validMax) { m_stretch = Stretch(); for (size_t i = 0; i < (size_t)stretchPairs.size(); i+=2) { - m_stretch.AddPair(toDouble(stretchPairs[i]), - toDouble(stretchPairs[i + 1])); + m_stretch.AddPair(std::stod(stretchPairs[i]), + std::stod(stretchPairs[i + 1])); } m_validMax = validMax; m_dataConversionType = dataConversionType; @@ -75,8 +75,8 @@ namespace Isis { void cassiniIssFixDnPostProcess(QString ioFile, PvlObject postProcessObj) { PvlKeyword stretchPairsKeyword = postProcessObj["stretchPairs"]; - QString dataConversionType = postProcessObj["DataConversionType"]; - int validMax = toInt(postProcessObj["ValidMaximum"]); + QString dataConversionType = QString::fromStdString(postProcessObj["DataConversionType"]); + int validMax = std::stoi(postProcessObj["ValidMaximum"]); CassiniIssFixDnFunctor cassiniIssFixDnFunctor(stretchPairsKeyword, dataConversionType, validMax); ProcessByLine postProcess; @@ -98,16 +98,16 @@ namespace Isis { void cassiniIssCreateLinePrefixTable(Cube *cube, vector prefixData, PvlObject translation) { int sumMode = translation["SummingMode"]; - QString compressionType = translation["CompressionType"]; + QString compressionType = QString::fromStdString(translation["CompressionType"]); double flightSoftware = 0.0; - if (QString(translation["flightSoftwareVersionId"]).toStdString() != std::string("Unknown")) { - flightSoftware = toDouble(translation["flightSoftwareVersionId"]); + if (translation["flightSoftwareVersionId"] != std::string("Unknown")) { + flightSoftware = std::stod(translation["flightSoftwareVersionId"]); } PvlKeyword stretchPairsKeyword = translation["stretchPairs"]; - QString dataConversionType = translation["DataConversionType"]; - int validMax = toInt(translation["ValidMaximum"]); + QString dataConversionType = QString::fromStdString(translation["DataConversionType"]); + int validMax = std::stoi(translation["ValidMaximum"]); CassiniIssFixDnFunctor cassiniIssFixDnFunctor(stretchPairsKeyword, dataConversionType, validMax); TableField overclockPixels("OverclockPixels", TableField::Double, 3); @@ -193,11 +193,11 @@ namespace Isis { PvlKeyword stretchPairs = translation["stretchPairs"]; Stretch stretch; for (size_t i = 0; i < (size_t)stretchPairs.size(); i+=2) { - stretch.AddPair(toDouble(stretchPairs[i]), - toDouble(stretchPairs[i + 1])); + stretch.AddPair(std::stod(stretchPairs[i]), + std::stod(stretchPairs[i + 1])); } PvlGroup &inst = outputLabel->findGroup("Instrument", Pvl::Traverse); - QString dataConversionType = translation["DataConversionType"]; + QString dataConversionType = QString::fromStdString(translation["DataConversionType"]); if(dataConversionType != "Table") { //Conversion Type is 12Bit or 8LSB, only save off overclocked pixels if(dataConversionType == "12Bit") { importer->Progress()->SetText("Image was 12 bit. No conversion needed. \nSaving line prefix data..."); @@ -208,7 +208,7 @@ namespace Isis { } else { double biasStripMean = inst.findKeyword("BiasStripMean"); - inst.findKeyword("BiasStripMean").setValue(toString(stretch.Map(biasStripMean))); + inst.findKeyword("BiasStripMean").setValue(std::to_string(stretch.Map(biasStripMean))); inst.findKeyword("BiasStripMean").addComment("BiasStripMean value converted back to 12 bit."); importer->Progress()->SetText("Image was converted using 12-to-8 bit table. \nConverting prefix pixels back to 12 bit and saving line prefix data..."); } @@ -217,7 +217,7 @@ namespace Isis { int vicarLabelBytes = translation.findKeyword("VicarLabelBytes"); int roo = *(header + 50 + vicarLabelBytes) / 32 % 2; //**** THIS MAY NEED TO BE CHANGED, // SEE BOTTOM OF THIS FILE FOR IN DEPTH COMMENTS ON READOUTORDER - inst.addKeyword(PvlKeyword("ReadoutOrder", toString(roo))); + inst.addKeyword(PvlKeyword("ReadoutOrder", std::to_string(roo))); }; } diff --git a/isis/src/base/apps/isisimport/importUtils.h b/isis/src/base/apps/isisimport/importUtils.h index 0ba60799b1..4471c175f0 100644 --- a/isis/src/base/apps/isisimport/importUtils.h +++ b/isis/src/base/apps/isisimport/importUtils.h @@ -68,7 +68,7 @@ namespace Isis { }; void runProcess(QString ioFile, PvlObject process) { - std::string functionString = QString(process["ProcessFunction"]).toStdString(); + std::string functionString = process["ProcessFunction"]; switch (processMap[functionString]) { case 1: cassiniIssFixDnPostProcess(ioFile, process); diff --git a/isis/src/base/apps/isisimport/isisimport.cpp b/isis/src/base/apps/isisimport/isisimport.cpp index 57423acd01..27aefaec7c 100644 --- a/isis/src/base/apps/isisimport/isisimport.cpp +++ b/isis/src/base/apps/isisimport/isisimport.cpp @@ -149,7 +149,7 @@ namespace Isis { env.add_callback("CassiniIssStretchPairs", 0, [](Arguments& args) { PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - QString missionDir = (QString) dataDir["Cassini"]; + QString missionDir = QString::fromStdString(dataDir["Cassini"]); FileName *lutFile = new FileName(missionDir + "/calibration/lut/lut.tab"); TextFile *stretchPairs = new TextFile(lutFile->expanded()); @@ -381,19 +381,19 @@ namespace Isis { PvlObject translation = newLabel.findObject("Translation"); if (translation.hasKeyword("Failure")) { - throw IException(IException::Io, QString(translation.findKeyword("Failure")), _FILEINFO_); + throw IException(IException::Io, QString::fromStdString(translation.findKeyword("Failure")), _FILEINFO_); } // Set everything needed by ProcessImport PvlGroup dimensions = newLabel.findObject("IsisCube").findObject("Core").findGroup("Dimensions"); - int ns = toInt(dimensions["Samples"]); - int nl = toInt(dimensions["Lines"]); - int nb = toInt(dimensions["Bands"]); + int ns = std::stoi(dimensions["Samples"]); + int nl = std::stoi(dimensions["Lines"]); + int nb = std::stoi(dimensions["Bands"]); importer.SetDimensions(ns, nl, nb); PvlGroup pixels = newLabel.findObject("IsisCube").findObject("Core").findGroup("Pixels"); - QString pixelType = pixels["Type"]; - QString byteOrder = pixels["ByteOrder"]; + QString pixelType = QString::fromStdString(pixels["Type"]); + QString byteOrder = QString::fromStdString(pixels["ByteOrder"]); double base = pixels["Base"]; double multiplier = pixels["Multiplier"]; importer.SetPixelType(PixelTypeEnumeration(pixelType)); @@ -404,7 +404,7 @@ namespace Isis { // Update TargetName if Target parameter entered if (ui.WasEntered("TARGET")) { PvlGroup &inst = newLabel.findGroup("Instrument",Pvl::Traverse); - inst["TargetName"] = ui.GetString("TARGET"); + inst["TargetName"] = ui.GetString("TARGET").toStdString(); } // Check translation for potential PDS3 offset @@ -417,8 +417,8 @@ namespace Isis { if (dataFilePointer.size() == 1) { try { - offset = toInt(dataFilePointer) - 1; - units = dataFilePointer.unit(); + offset = std::stoi(dataFilePointer) - 1; + units = QString::fromStdString(dataFilePointer.unit()); } catch(IException &e) { // Failed to parse to an int, means we have a file name @@ -428,8 +428,8 @@ namespace Isis { } } else if (dataFilePointer.size() == 2) { - offset = toInt(dataFilePointer[1]) - 1; - units = dataFilePointer.unit(1); + offset = std::stoi(dataFilePointer[1]) - 1; + units = QString::fromStdString(dataFilePointer.unit(1)); } else { QString msg = "Improperly formatted data file pointer keyword ^IMAGE or " @@ -445,7 +445,7 @@ namespace Isis { } else { if (translation.hasKeyword("DataFileRecordBytes")) { - recSize = toInt(translation["DataFileRecordBytes"]); + recSize = std::stoi(translation["DataFileRecordBytes"]); } } importer.SetFileHeaderBytes(offset * recSize); @@ -458,11 +458,11 @@ namespace Isis { // Checks that are unique to mgsmoc if (translation.hasKeyword("compressed") && translation.hasKeyword("projected")) { - if (toBool(translation["compressed"])) { + if (toBool(QString::fromStdString(translation["compressed"]))) { QString msg = "[" + inputFileName.name() + "] may be compressed. Please run image through mocuncompress to uncompress."; throw IException(IException::User, msg, _FILEINFO_); } - if (toBool(translation["projected"])) { + if (toBool(QString::fromStdString(translation["projected"]))) { QString msg = "[" + inputFileName.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); @@ -471,20 +471,20 @@ namespace Isis { // Processing unique to mroctx if (translation.hasKeyword("DataPrefixBytes")) { importer.SetDataPrefixBytes(translation["DataPrefixBytes"]); - if (toInt(translation["DataPrefixBytes"]) > 0) { + if (std::stoi(translation["DataPrefixBytes"]) > 0) { importer.SaveDataPrefix(); } } if (translation.hasKeyword("DataSuffixBytes")) { importer.SetDataSuffixBytes(translation["DataSuffixBytes"]); - if (toInt(translation["DataSuffixBytes"]) > 0) { + if (std::stoi(translation["DataSuffixBytes"]) > 0) { importer.SaveDataSuffix(); } } if (translation.hasKeyword("CoreAxisNames")) { - QString originalAxisOrder = QString(translation["CoreAxisNames"]); + QString originalAxisOrder = QString::fromStdString(translation["CoreAxisNames"]); if (originalAxisOrder == "SAMPLELINEBAND") { importer.SetOrganization(ProcessImport::BSQ); } @@ -498,7 +498,7 @@ namespace Isis { stringstream pdsOrgStream; pdsOrgStream << originalAxisOrder; - QString msg = "Unsupported axis order [" + QString(originalAxisOrder) + "]"; + std::string msg = "Unsupported axis order [" + originalAxisOrder.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -506,7 +506,7 @@ namespace Isis { // Set any special pixel values double pdsNull = Isis::NULL8; if (translation.hasKeyword("CoreNull")) { - str = QString(translation["CoreNull"]); + str = QString::fromStdString(translation["CoreNull"]); if(str != "NULL") { pdsNull = toDouble(str); } @@ -514,7 +514,7 @@ namespace Isis { double pdsLrs = Isis::Lrs; if (translation.hasKeyword("CoreLRS")) { - str = QString(translation["CoreLRS"]); + str = QString::fromStdString(translation["CoreLRS"]); if(str != "NULL") { pdsLrs = toDouble(str); } @@ -522,7 +522,7 @@ namespace Isis { double pdsLis = Isis::Lis; if (translation.hasKeyword("CoreLIS")) { - str = QString(translation["CoreLIS"]); + str = QString::fromStdString(translation["CoreLIS"]); if(str != "NULL") { pdsLis = toDouble(str); } @@ -530,7 +530,7 @@ namespace Isis { double pdsHrs = Isis::Hrs; if (translation.hasKeyword("CoreHRS")) { - str = QString(translation["CoreHRS"]); + str = QString::fromStdString(translation["CoreHRS"]); if(str != "NULL") { pdsHrs = toDouble(str); } @@ -538,7 +538,7 @@ namespace Isis { double pdsHis = Isis::His; if (translation.hasKeyword("CoreHIS")) { - str = QString(translation["CoreHIS"]); + str = QString::fromStdString(translation["CoreHIS"]); if(str != "NULL") { pdsHis = toDouble(str); } @@ -547,7 +547,7 @@ namespace Isis { QString cubeAtts = ""; if (translation.hasKeyword("CubeAtts")) { - cubeAtts = QString(translation["CubeAtts"]); + cubeAtts = QString::fromStdString(translation["CubeAtts"]); } CubeAttributeOutput outputAtts = CubeAttributeOutput(cubeAtts); Cube *outputCube = importer.SetOutputCube(ui.GetCubeName("TO"), outputAtts); @@ -559,7 +559,7 @@ namespace Isis { } // Assume PDS3 else { - Pvl pdsLab(inputFileName.expanded()); + Pvl pdsLab(inputFileName.expanded().toStdString()); OriginalLabel pds3Label(pdsLab); outputCube->write(pds3Label); } @@ -577,9 +577,9 @@ namespace Isis { if (translation.hasObject("AncillaryProcess")) { for(int i = 0; i < translation.objects(); ++i) { PvlObject &object = translation.object(i); - QString objectName = object.name(); + QString objectName = QString::fromStdString(object.name()); if (objectName == "AncillaryProcess") { - applyAncillaryProcess(outputCube, QString(object["ProcessFunction"]), translation, &importer); + applyAncillaryProcess(outputCube, QString::fromStdString(object["ProcessFunction"]), translation, &importer); } } } diff --git a/isis/src/base/apps/isisminer/CalculatorStrategy.cpp b/isis/src/base/apps/isisminer/CalculatorStrategy.cpp index ca38e90b43..e4c82bd322 100644 --- a/isis/src/base/apps/isisminer/CalculatorStrategy.cpp +++ b/isis/src/base/apps/isisminer/CalculatorStrategy.cpp @@ -96,10 +96,10 @@ namespace Isis { PvlGroup::PvlKeywordIterator i; for (i = eqns.begin(); i != eqns.end(); i++) { Equation eqn; - eqn.equation = QString(*i); + eqn.equation = QString::fromStdString(*i); InlineCalculator *calc = new InlineCalculator(eqn.equation); eqn.calculator = QSharedPointer (calc); - eqn.store = i->name(); + eqn.store = QString::fromStdString(i->name()); m_equations.append(eqn); } @@ -192,8 +192,8 @@ namespace Isis { BOOST_FOREACH ( PvlKeyword key, *m_initializers) { PvlKeyword newkey(key.name()); for (int i = 0 ; i < key.size() ; i++) { - QString value = processArgs(key[i], m_initArgs, myGlobals); - newkey.addValue(value); + QString value = processArgs(QString::fromStdString(key[i]), m_initArgs, myGlobals); + newkey.addValue(value.toStdString()); if ( isDebug() ) { cout << "Initializing " << key.name() << "[" << i << "] = " << value << "\n"; diff --git a/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp b/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp index f0361ea492..536d0126fb 100644 --- a/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp @@ -127,13 +127,13 @@ namespace Isis { for ( int p = 0 ; p < network.objects() ; p++ ) { PvlObject &point = network.object(p); - if ( "controlpoint" == point.name().toLower() ) { + if ( "controlpoint" == QString::fromStdString(point.name()).toLower() ) { PvlFlatMap netpoint(netkeys, loadkeys(point)); for (int m = 0; m < point.groups() ; m++ ) { PvlGroup &measure = point.group(m); - if ( "controlmeasure" == measure.name().toLower() ) { + if ( "controlmeasure" == QString::fromStdString(measure.name()).toLower() ) { PvlFlatMap netmeasure(netpoint, loadkeys(measure)); QString rowId = QString::number(nrows++); SharedResource rowmeasure(new Resource(rowId, netmeasure)); diff --git a/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp b/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp index 4ecb911c96..ee039372ce 100644 --- a/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp @@ -123,11 +123,11 @@ namespace Isis { QString pfile = translateKeywordArgs("GisGeometry", globals); - Pvl pvl(pfile); + Pvl pvl(pfile.toStdString()); //Keywoard in IsisMiner PVL that has an assoc. geometric value in pfile QString key = parms.get("GisGeometryRef"); - QString gisgeom = pvl.findKeyword(key, PvlObject::Traverse); + QString gisgeom = QString::fromStdString(pvl.findKeyword(key.toStdString(), PvlObject::Traverse)); QString gistype = parms.get("GisType"); //must be pvlWKT or pvlWKB gistype = gistype.remove("pvl", Qt::CaseInsensitive); diff --git a/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp b/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp index 197af54b91..190dcf5e0e 100644 --- a/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp @@ -528,8 +528,8 @@ namespace Isis { if ( !config.isEmpty() ) { miner = factory->buildRun(config, globals); } - else if ( getDefinition().hasObject(minerName+"Miner") ) { - miner = factory->buildRun(getDefinition().findObject(minerName+"Miner"), + else if ( getDefinition().hasObject(minerName.toStdString() + "Miner") ) { + miner = factory->buildRun(getDefinition().findObject(minerName.toStdString() + "Miner"), globals); } diff --git a/isis/src/base/apps/isisminer/PdsColumn.cpp b/isis/src/base/apps/isisminer/PdsColumn.cpp index 282dd433d1..2c3f237908 100644 --- a/isis/src/base/apps/isisminer/PdsColumn.cpp +++ b/isis/src/base/apps/isisminer/PdsColumn.cpp @@ -338,28 +338,28 @@ namespace Isis { * @return PvlObject An object with all keywords in the map */ PvlObject PdsColumn::toPvl(const QString &object) const { - PvlObject column(object.toUpper()); + PvlObject column(object.toUpper().toStdString()); - column.addKeyword(PvlKeyword("COLUMN_NUMBER", value("COLUMN_NUMBER"))); - column.addKeyword(PvlKeyword("NAME", value("NAME"))); - column.addKeyword(PvlKeyword("DATA_TYPE", value("DATA_TYPE"))); + column.addKeyword(PvlKeyword("COLUMN_NUMBER", value("COLUMN_NUMBER").toStdString())); + column.addKeyword(PvlKeyword("NAME", value("NAME").toStdString())); + column.addKeyword(PvlKeyword("DATA_TYPE", value("DATA_TYPE").toStdString())); // Check for optional parameters if ( exists("UNIT") ) { QString unit = value("UNIT"); if ( unit.size() > 0 ) { - column.addKeyword(PvlKeyword("UNIT", value("UNIT"))); + column.addKeyword(PvlKeyword("UNIT", value("UNIT").toStdString())); } } - column.addKeyword(PvlKeyword("START_BYTE", value("START_BYTE"))); - column.addKeyword(PvlKeyword("BYTES", value("BYTES"))); + column.addKeyword(PvlKeyword("START_BYTE", value("START_BYTE").toStdString())); + column.addKeyword(PvlKeyword("BYTES", value("BYTES").toStdString())); if ( exists("FORMAT") ) { - column.addKeyword(PvlKeyword("FORMAT", format())); + column.addKeyword(PvlKeyword("FORMAT", format().toStdString())); } - column.addKeyword(PvlKeyword("DESCRIPTION", value("DESCRIPTION"))); + column.addKeyword(PvlKeyword("DESCRIPTION", value("DESCRIPTION").toStdString())); return (column); diff --git a/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp index d9f3dd9d7f..ea5a6f7a76 100644 --- a/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp @@ -108,7 +108,7 @@ namespace Isis { if ( isDebug() ) { cout << "PdsTableCreator::PdsFormatFile = " << fmtfile << "\n"; } - Pvl fmtpvl(fmtfile); + Pvl fmtpvl(fmtfile.toStdString()); readColumns(fmtpvl); // Check for argument replacement @@ -195,7 +195,7 @@ namespace Isis { */ int PdsTableCreatorStrategy::readColumns(PvlObject &pvl) { QString colobj = m_parameters->value("ColumnObject", ""); - PvlObject &obj = ( colobj.isEmpty() ? pvl : pvl.findObject(colobj, PvlObject::Traverse) ); + PvlObject &obj = ( colobj.isEmpty() ? pvl : pvl.findObject(colobj.toStdString(), PvlObject::Traverse) ); PvlObject::PvlObjectIterator pvlcol = obj.beginObject(); while ( pvlcol != obj.endObject() ) { diff --git a/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp index 3f54c34ceb..5ea81b9e3e 100644 --- a/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp @@ -120,7 +120,7 @@ namespace Isis { Pvl fmtpvl; // Apply only if provided if ( !keyfmt.isEmpty() ) { - fmtpvl.setFormat(new PvlFormatPds(keyfmt)); + fmtpvl.setFormat(new PvlFormatPds(keyfmt.toStdString())); } fmtpvl.setTerminator("END"); @@ -147,7 +147,7 @@ namespace Isis { } // Now write the Pvl column file - fmtpvl.write(fmtfile); + fmtpvl.write(fmtfile.toStdString()); return (resources.size()); } diff --git a/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp index 6e7b552b0f..dd866a78f1 100644 --- a/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp @@ -172,11 +172,11 @@ bool PdsTableReaderStrategy::processRow(const int &row, resource->add("Row", crow); BOOST_FOREACH (QString column, columns ) { ColumnDescr *description = findColumn(column); - PvlKeyword colkey = PvlKeyword(column); + PvlKeyword colkey = PvlKeyword(column.toStdString()); if ( 0 != description ) { QStringList fields = getColumnFields(rowdata, *description, m_delimiter); BOOST_FOREACH (QString field, fields ) { - colkey.addValue(field.trimmed()); + colkey.addValue(field.trimmed().toStdString()); } } resource->add(colkey); diff --git a/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp b/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp index 38c02bc26c..31b5cfffb1 100644 --- a/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp @@ -161,7 +161,7 @@ namespace Isis { QString rowBase(keys.get("PvlBaseName","Pvl")); QString rowId = rowBase + QString::number(nth); - Pvl pvl(pvlfile); + Pvl pvl(pvlfile.toStdString()); PvlFlatMap pvlImports(pvl, m_pvlparms); SharedResource pvlsrc(new Resource(rowId, pvlImports)); diff --git a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp index 0f7d42774a..568af9129d 100644 --- a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp +++ b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp @@ -80,7 +80,7 @@ namespace Isis { // Flatten RunCommand Strategy object definition PvlObject config( getDefinition() ); if ( config.hasKeyword("Command") ) { - m_commands.push_back(Command("Command", config["Command"][0])); + m_commands.push_back(Command("Command", QString::fromStdString(config["Command"][0]))); } // Read and store all PRE commands @@ -88,7 +88,7 @@ namespace Isis { PvlGroup &commands = config.findGroup("PreCommands"); PvlContainer::ConstPvlKeywordIterator key = commands.begin(); while ( key != commands.end() ) { - m_preCommands.push_back(Command(key->name(), (*key)[0])); + m_preCommands.push_back(Command(QString::fromStdString(key->name()), QString::fromStdString((*key)[0]))); ++key; } } @@ -98,7 +98,7 @@ namespace Isis { PvlGroup &commands = config.findGroup("Commands"); PvlContainer::ConstPvlKeywordIterator key = commands.begin(); while ( key != commands.end() ) { - m_commands.push_back(Command(key->name(), (*key)[0])); + m_commands.push_back(Command(QString::fromStdString(key->name()), QString::fromStdString((*key)[0]))); ++key; } } @@ -108,7 +108,7 @@ namespace Isis { PvlGroup &commands = config.findGroup("PostCommands"); PvlContainer::ConstPvlKeywordIterator key = commands.begin(); while ( key != commands.end() ) { - m_postCommands.push_back(Command(key->name(), (*key)[0])); + m_postCommands.push_back(Command(QString::fromStdString(key->name()), QString::fromStdString((*key)[0]))); ++key; } } diff --git a/isis/src/base/apps/isisminer/StereoPairStrategy.cpp b/isis/src/base/apps/isisminer/StereoPairStrategy.cpp index 8f7823e7f1..7653840cd5 100644 --- a/isis/src/base/apps/isisminer/StereoPairStrategy.cpp +++ b/isis/src/base/apps/isisminer/StereoPairStrategy.cpp @@ -411,12 +411,12 @@ namespace Isis { QVector threshold; try { for ( nval = 0 ; nval < key.size() ; nval++ ) { - threshold.push_back(toDouble(key[nval])); + threshold.push_back(std::stod(key[nval])); } } catch (IException &ie) { // Traps float conversion errors - QString mess = "Error converting value [" + QString::number(nval+1) + + std::string mess = "Error converting value [" + std::to_string(nval+1) + "] in keyword [" + key.name() + "] to double."; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -425,13 +425,13 @@ namespace Isis { if ( (threshold.size() >= 3) ) { // Check for valid pivot value if ( (threshold[2] < threshold[0]) || (threshold[2] > threshold[1]) ) { - QString mess = "Criteria keyword [" + key.name() + "] pivot value [" + + std::string mess = "Criteria keyword [" + key.name() + "] pivot value [" + key[2] + "] exceeds min/max ranges [" + key[0] + "," + key[1] + "]."; throw IException(IException::User, mess, _FILEINFO_); } } - cmap.insert(key.name().toLower(), threshold); + cmap.insert(QString::fromStdString(key.name()).toLower(), threshold); } return (cmap); diff --git a/isis/src/base/apps/isisminer/StrategyFactory.cpp b/isis/src/base/apps/isisminer/StrategyFactory.cpp index 3c172e0f97..ed70ce85d1 100644 --- a/isis/src/base/apps/isisminer/StrategyFactory.cpp +++ b/isis/src/base/apps/isisminer/StrategyFactory.cpp @@ -209,7 +209,7 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; */ StrategyList StrategyFactory::buildRun(const QString &configFile, const ResourceList &globals) const { - Pvl pvl(configFile); + Pvl pvl(configFile.toStdString()); if (!pvl.hasObject("IsisMiner") ) { throw IException(IException::User, "Strategy config file [" + configFile + @@ -270,10 +270,14 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; const ResourceList &globals) const { Strategy *strategy = findStrategy(definition, globals); if ( !strategy ) { - QString sname("UNKNOWN"), stype("UNKNOWN"); - if ( definition.hasKeyword("Name") ) { sname = definition["Name"][0]; } - if ( definition.hasKeyword("Type") ) { stype = definition["Type"][0]; } - QString mess = "Could not create a " + sname + + std:string sname("UNKNOWN"), stype("UNKNOWN"); + if ( definition.hasKeyword("Name") ) { + sname = definition["Name"][0]; + } + if ( definition.hasKeyword("Type") ) { + stype = definition["Type"][0]; + } + std::string mess = "Could not create a " + sname + " strategy for type [" + stype + "]."; throw IException(IException::User, mess, _FILEINFO_); } @@ -318,12 +322,12 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; // Search Resource list for parameter int found(0); BOOST_FOREACH ( SharedResource resource, parameters ) { - if ( resource->exists(keys[i]) ) found++; + if ( resource->exists(QString::fromStdString(keys[i])) ) found++; } // If it doesn't exist in any resource, this is an error. Save it off // for reporting. - if ( !found) missing.push_back(keys[i]); + if ( !found) missing.push_back(QString::fromStdString(keys[i])); } if ( !missing.isEmpty() ) { @@ -358,11 +362,13 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; QString stype; try { - stype = definition["Type"][0].toLower(); + stype = QString::fromStdString(definition["Type"][0]).toLower(); } catch (IException &ie) { QString sname("UNKNOWN"); - if ( definition.hasKeyword("Name") ) { sname = definition["Name"][0]; } + if ( definition.hasKeyword("Name") ) { + sname = QString::fromStdString(definition["Name"][0]); + } QString mess = "Strategy Type does not exist in configuration for " + sname + " strategy!"; throw IException(ie, IException::User, mess, _FILEINFO_); @@ -542,10 +548,12 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; strategy = maker(definition, globals); } catch (IException &ie) { - QString sname("UNKNOWN"); - if ( definition.hasKeyword("Name") ) { sname = definition["Name"][0]; } - QString mess = "Failed to load " + sname + " Strategy plugin!"; - throw IException(ie, IException::User, mess, _FILEINFO_); + std::string sname("UNKNOWN"); + if ( definition.hasKeyword("Name") ) { + sname = definition["Name"][0]; + } + std::string mess = "Failed to load " + sname + " Strategy plugin!"; + throw IException(ie, IException::User, mess, _FILEINFO_); } return ( strategy ); diff --git a/isis/src/base/apps/map2map/map2map.cpp b/isis/src/base/apps/map2map/map2map.cpp index c791aa3519..3f31d836fe 100644 --- a/isis/src/base/apps/map2map/map2map.cpp +++ b/isis/src/base/apps/map2map/map2map.cpp @@ -24,7 +24,7 @@ namespace Isis { ProcessRubberSheet p; // Get the map projection file provided by the user - Pvl userPvl(ui.GetFileName("MAP")); + Pvl userPvl(ui.GetFileName("MAP").toStdString()); PvlGroup &userMappingGrp = userPvl.findGroup("Mapping", Pvl::Traverse); CubeAttributeInput &inputAtt =ui.GetInputAttribute("FROM"); @@ -57,19 +57,19 @@ namespace Isis { // Deal with user overrides entered in the GUI. Do this by changing the user's mapping group, which // will then overlay anything in the output mapping group. if(ui.WasEntered("MINLAT") && !ui.GetBoolean("MATCHMAP")) { - userMappingGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(ui.GetDouble("MINLAT"))), Pvl::Replace); + userMappingGrp.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(ui.GetDouble("MINLAT"))), Pvl::Replace); } if(ui.WasEntered("MAXLAT") && !ui.GetBoolean("MATCHMAP")) { - userMappingGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); + userMappingGrp.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(ui.GetDouble("MAXLAT"))), Pvl::Replace); } if(ui.WasEntered("MINLON") && !ui.GetBoolean("MATCHMAP")) { - userMappingGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(ui.GetDouble("MINLON"))), Pvl::Replace); + userMappingGrp.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(ui.GetDouble("MINLON"))), Pvl::Replace); } if(ui.WasEntered("MAXLON") && !ui.GetBoolean("MATCHMAP")) { - userMappingGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(ui.GetDouble("MAXLON"))), Pvl::Replace); + userMappingGrp.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(ui.GetDouble("MAXLON"))), Pvl::Replace); } /** @@ -81,7 +81,7 @@ namespace Isis { */ bool sameDirection = true; if(userMappingGrp.hasKeyword("LongitudeDirection")) { - if(((QString)userMappingGrp["LongitudeDirection"]).compare(fromMappingGrp["LongitudeDirection"]) != 0) { + if(((std::string)userMappingGrp["LongitudeDirection"]).compare(fromMappingGrp["LongitudeDirection"]) != 0) { sameDirection = false; } } @@ -92,8 +92,8 @@ namespace Isis { double minLon = outMappingGrp["MinimumLongitude"]; double maxLon = outMappingGrp["MaximumLongitude"]; - outMappingGrp["MaximumLongitude"] = toString(minLon); - outMappingGrp["MinimumLongitude"] = toString(maxLon); + outMappingGrp["MaximumLongitude"] = std::to_string(minLon); + outMappingGrp["MinimumLongitude"] = std::to_string(maxLon); } if(ui.GetString("PIXRES").compare("FROM") == 0 && !ui.GetBoolean("MATCHMAP")) { @@ -151,7 +151,7 @@ namespace Isis { userMappingGrp.deleteKeyword("PixelResolution"); } - outMappingGrp.addKeyword(PvlKeyword("PixelResolution", toString(ui.GetDouble("RESOLUTION")), "meters/pixel"), Pvl::Replace); + outMappingGrp.addKeyword(PvlKeyword("PixelResolution", std::to_string(ui.GetDouble("RESOLUTION")), "meters/pixel"), Pvl::Replace); } else if(ui.GetString("PIXRES").compare("PPD") == 0) { // Resolution specified - delete all and add to outMappingGrp @@ -179,7 +179,7 @@ namespace Isis { userMappingGrp.deleteKeyword("PixelResolution"); } - outMappingGrp.addKeyword(PvlKeyword("Scale", toString(ui.GetDouble("RESOLUTION")), "pixels/degree"), Pvl::Replace); + outMappingGrp.addKeyword(PvlKeyword("Scale", std::to_string(ui.GetDouble("RESOLUTION")), "pixels/degree"), Pvl::Replace); } // Rotation will NOT Propagate @@ -216,13 +216,13 @@ namespace Isis { for(int index = 0; index < longitudes.keywords(); index ++) { if(!userMappingGrp.hasKeyword(longitudes[index].name())) { // use the from domain because that's where our values are coming from - if(((QString)userMappingGrp["LongitudeDirection"]).compare("PositiveEast") == 0) { - outMappingGrp[longitudes[index].name()] = toString( + if(((std::string)userMappingGrp["LongitudeDirection"]).compare("PositiveEast") == 0) { + outMappingGrp[longitudes[index].name()] = std::to_string( TProjection::ToPositiveEast(outMappingGrp[longitudes[index].name()], outMappingGrp["LongitudeDomain"])); } else { - outMappingGrp[longitudes[index].name()] = toString( + outMappingGrp[longitudes[index].name()] = std::to_string( TProjection::ToPositiveWest(outMappingGrp[longitudes[index].name()], outMappingGrp["LongitudeDomain"])); } @@ -238,11 +238,11 @@ namespace Isis { for(int index = 0; index < longitudes.keywords(); index ++) { if(!userMappingGrp.hasKeyword(longitudes[index].name())) { if((int)userMappingGrp["LongitudeDomain"] == 180) { - outMappingGrp[longitudes[index].name()] = toString( + outMappingGrp[longitudes[index].name()] = std::to_string( TProjection::To180Domain(outMappingGrp[longitudes[index].name()])); } else { - outMappingGrp[longitudes[index].name()] = toString( + outMappingGrp[longitudes[index].name()] = std::to_string( TProjection::To360Domain(outMappingGrp[longitudes[index].name()])); } } @@ -252,20 +252,20 @@ namespace Isis { // Third, planetographic/planetocentric if(userMappingGrp.hasKeyword("LatitudeType")) { // user set a new domain? - if(((QString)userMappingGrp["LatitudeType"]).compare(fromMappingGrp["LatitudeType"]) != 0) { // new lat type different? + if((QString::fromStdString(userMappingGrp["LatitudeType"])).compare(QString::fromStdString(fromMappingGrp["LatitudeType"])) != 0) { // new lat type different? PvlGroup latitudes = inproj->MappingLatitudes(); for(int index = 0; index < latitudes.keywords(); index ++) { if(!userMappingGrp.hasKeyword(latitudes[index].name())) { - if(((QString)userMappingGrp["LatitudeType"]).compare("Planetographic") == 0) { - outMappingGrp[latitudes[index].name()] = toString(TProjection::ToPlanetographic( + if(((std::string)userMappingGrp["LatitudeType"]).compare("Planetographic") == 0) { + outMappingGrp[latitudes[index].name()] = std::to_string(TProjection::ToPlanetographic( (double)fromMappingGrp[latitudes[index].name()], (double)fromMappingGrp["EquatorialRadius"], (double)fromMappingGrp["PolarRadius"])); } else { - outMappingGrp[latitudes[index].name()] = toString(TProjection::ToPlanetocentric( + outMappingGrp[latitudes[index].name()] = std::to_string(TProjection::ToPlanetocentric( (double)fromMappingGrp[latitudes[index].name()], (double)fromMappingGrp["EquatorialRadius"], (double)fromMappingGrp["PolarRadius"])); @@ -279,19 +279,19 @@ namespace Isis { if ((double)outMappingGrp["MinimumLongitude"] >= (double)outMappingGrp["MaximumLongitude"]) { - if ((QString)outMappingGrp["MinimumLongitude"] == "180.0" && + if ((std::string)outMappingGrp["MinimumLongitude"] == "180.0" && (int)userMappingGrp["LongitudeDomain"] == 180) outMappingGrp["MinimumLongitude"] = "-180"; - if ((QString)outMappingGrp["MaximumLongitude"] == "-180.0" && + if ((std::string)outMappingGrp["MaximumLongitude"] == "-180.0" && (int)userMappingGrp["LongitudeDomain"] == 180) outMappingGrp["MaximumLongitude"] = "180"; - if ((QString)outMappingGrp["MinimumLongitude"] == "360.0" && + if ((std::string)outMappingGrp["MinimumLongitude"] == "360.0" && (int)userMappingGrp["LongitudeDomain"] == 360) outMappingGrp["MinimumLongitude"] = "0"; - if ((QString)outMappingGrp["MaximumLongitude"] == "0.0" && + if ((std::string)outMappingGrp["MaximumLongitude"] == "0.0" && (int)userMappingGrp["LongitudeDomain"] == 360) outMappingGrp["MaximumLongitude"] = "360"; } @@ -299,7 +299,7 @@ namespace Isis { // If MinLon/MaxLon out of order, we weren't able to calculate the correct values if((double)outMappingGrp["MinimumLongitude"] >= (double)outMappingGrp["MaximumLongitude"]) { if(!ui.WasEntered("MINLON") || !ui.WasEntered("MAXLON")) { - QString msg = "Unable to determine the correct [MinimumLongitude,MaximumLongitude]."; + std::string msg = "Unable to determine the correct [MinimumLongitude,MaximumLongitude]."; msg += " Please specify these values in the [MINLON,MAXLON] parameters"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/mapmos/mapmos.cpp b/isis/src/base/apps/mapmos/mapmos.cpp index 0201b6f2dc..55423d0909 100644 --- a/isis/src/base/apps/mapmos/mapmos.cpp +++ b/isis/src/base/apps/mapmos/mapmos.cpp @@ -62,19 +62,19 @@ namespace Isis { inCube->close(); if ( ui.WasEntered("MINLAT") ) { - mapGroup.addKeyword(PvlKeyword( "MinimumLatitude", toString( ui.GetDouble("MINLAT") ) ), + mapGroup.addKeyword(PvlKeyword( "MinimumLatitude", std::to_string( ui.GetDouble("MINLAT") ) ), Pvl::Replace); } if ( ui.WasEntered("MAXLAT") ) { - mapGroup.addKeyword(PvlKeyword( "MaximumLatitude", toString( ui.GetDouble("MAXLAT") ) ), + mapGroup.addKeyword(PvlKeyword( "MaximumLatitude", std::to_string( ui.GetDouble("MAXLAT") ) ), Pvl::Replace); } if ( ui.WasEntered("MINLON") ) { - mapGroup.addKeyword(PvlKeyword( "MinimumLongitude", toString( ui.GetDouble("MINLON") ) ), + mapGroup.addKeyword(PvlKeyword( "MinimumLongitude", std::to_string( ui.GetDouble("MINLON") ) ), Pvl::Replace); } if ( ui.WasEntered("MAXLON") ) { - mapGroup.addKeyword(PvlKeyword( "MaximumLongitude", toString( ui.GetDouble("MAXLON") ) ), + mapGroup.addKeyword(PvlKeyword( "MaximumLongitude", std::to_string( ui.GetDouble("MAXLON") ) ), Pvl::Replace); } //check to make sure they're all there. If not, throw error, need to enter all. @@ -100,7 +100,7 @@ namespace Isis { if(!m.StartProcess(sInputFile)) { // Logs the cube if it falls outside of the given mosaic PvlGroup outsiders("Outside"); - outsiders += PvlKeyword("File", sInputFile); + outsiders += PvlKeyword("File", sInputFile.toStdString()); Application::AppendAndLog(outsiders, log); } else { diff --git a/isis/src/base/apps/mappt/mappt.cpp b/isis/src/base/apps/mappt/mappt.cpp index 16bab86a1c..5df4a96857 100644 --- a/isis/src/base/apps/mappt/mappt.cpp +++ b/isis/src/base/apps/mappt/mappt.cpp @@ -56,10 +56,10 @@ void mappt(Cube *icube, UserInterface &ui, Pvl *log, CubeAttributeInput* inAtt) // Write the pvl group out to the file if(ui.GetString("FORMAT") == "PVL") { if(append) { - log->append(outFile); + log->append(outFile.toStdString()); } else { - log->write(outFile); + log->write(outFile.toStdString()); } } @@ -95,7 +95,7 @@ void mappt(Cube *icube, UserInterface &ui, Pvl *log, CubeAttributeInput* inAtt) for(int i = 0; i < log->groups(); i++) { PvlGroup group = log->group(i); for(int j = 0; j < group.keywords(); j++) { - os << (QString)group[j]; + os << group[j]; if(j < group.keywords() - 1) { os << ","; } @@ -140,8 +140,8 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac // Make sure we have a valid latitude value if(fabs(lat) > 90.0) { - QString msg = "Invalid value for LATITUDE [" - + toString(lat) + "] outside range of "; + std::string msg = "Invalid value for LATITUDE [" + + std::to_string(lat) + "] outside range of "; msg += "[-90,90]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -175,7 +175,7 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac // Load it up into a new projection Pvl mapPvl; - mapPvl.read(mapFile.expanded()); + mapPvl.read(mapFile.expanded().toStdString()); TProjection *altmap = (TProjection *) ProjectionFactory::CreateFromCube(mapPvl); // Set lat and lon in its system @@ -247,44 +247,44 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac if ( icube->label()->findObject("IsisCube").hasGroup("BandBin")) { PvlGroup bandBin = icube->label()->findObject("IsisCube").findGroup("BandBin"); if (bandBin.hasKeyword("FilterName")) { - filterName = bandBin.findKeyword("FilterName")[0]; + filterName = QString::fromStdString(bandBin.findKeyword("FilterName")[0]); } } // Log the position if(proj->IsGood()) { results += PvlKeyword("Filename", - FileName(icube->fileName()).expanded()); - results += PvlKeyword("Sample", toString(proj->WorldX())); - results += PvlKeyword("Line", toString(proj->WorldY())); - results += PvlKeyword("Band", toString(icube->physicalBand(1))); - results += PvlKeyword("FilterName", filterName); - results += PvlKeyword("PixelValue", PixelToString(b[0])); - results += PvlKeyword("X", toString(proj->XCoord())); - results += PvlKeyword("Y", toString(proj->YCoord())); + FileName(icube->fileName()).expanded().toStdString()); + results += PvlKeyword("Sample", std::to_string(proj->WorldX())); + results += PvlKeyword("Line", std::to_string(proj->WorldY())); + results += PvlKeyword("Band", std::to_string(icube->physicalBand(1))); + results += PvlKeyword("FilterName", filterName.toStdString()); + results += PvlKeyword("PixelValue", PixelToString(b[0]).toStdString()); + results += PvlKeyword("X", std::to_string(proj->XCoord())); + results += PvlKeyword("Y", std::to_string(proj->YCoord())); // Put together all the keywords for different coordinate systems. PvlKeyword centLat = - PvlKeyword("PlanetocentricLatitude", toString(proj->UniversalLatitude())); + PvlKeyword("PlanetocentricLatitude", std::to_string(proj->UniversalLatitude())); PvlKeyword graphLat = PvlKeyword("PlanetographicLatitude", - toString(proj->ToPlanetographic(proj->UniversalLatitude()))); + std::to_string(proj->ToPlanetographic(proj->UniversalLatitude()))); PvlKeyword pE360 = - PvlKeyword("PositiveEast360Longitude", toString(proj->UniversalLongitude())); + PvlKeyword("PositiveEast360Longitude", std::to_string(proj->UniversalLongitude())); PvlKeyword pW360 = PvlKeyword("PositiveWest360Longitude", - toString(proj->ToPositiveWest(proj->UniversalLongitude(), 360))); + std::to_string(proj->ToPositiveWest(proj->UniversalLongitude(), 360))); PvlKeyword pE180 = PvlKeyword("PositiveEast180Longitude", - toString(proj->To180Domain(proj->UniversalLongitude()))); + std::to_string(proj->To180Domain(proj->UniversalLongitude()))); PvlKeyword pW180 = PvlKeyword("PositiveWest180Longitude", - toString(proj->To180Domain(proj->ToPositiveEast( + std::to_string(proj->To180Domain(proj->ToPositiveEast( proj->UniversalLongitude(), 360)))); diff --git a/isis/src/base/apps/maptrim/maptrim.cpp b/isis/src/base/apps/maptrim/maptrim.cpp index 89fdc5c12b..ad845ad24a 100644 --- a/isis/src/base/apps/maptrim/maptrim.cpp +++ b/isis/src/base/apps/maptrim/maptrim.cpp @@ -26,7 +26,7 @@ namespace Isis{ void maptrim(UserInterface &ui, Pvl *log) { // Get the projection - Pvl pvl(ui.GetCubeName("FROM")); + Pvl pvl(ui.GetCubeName("FROM").toStdString()); proj = (TProjection *) ProjectionFactory::CreateFromCube(pvl); // Determine ground range to crop and/or trim @@ -89,7 +89,7 @@ namespace Isis{ if(mode == "BOTH") { delete proj; proj = NULL; - Pvl pvl(tempFileName.ToQt()); + Pvl pvl(tempFileName); proj = (TProjection *) ProjectionFactory::CreateFromCube(pvl); } } diff --git a/isis/src/base/apps/mosrange/mosrange.cpp b/isis/src/base/apps/mosrange/mosrange.cpp index 714f4e7c52..61045b2b94 100644 --- a/isis/src/base/apps/mosrange/mosrange.cpp +++ b/isis/src/base/apps/mosrange/mosrange.cpp @@ -91,8 +91,8 @@ namespace Isis { QString projection("Equirectangular"); if(ui.WasEntered("MAP")) { - Pvl mapfile(ui.GetFileName("MAP")); - projection = (QString) mapfile.findGroup("Mapping")["ProjectionName"]; + Pvl mapfile(ui.GetFileName("MAP").toStdString()); + projection = QString::fromStdString(mapfile.findGroup("Mapping")["ProjectionName"]); } if(ui.WasEntered("PROJECTION")) { @@ -131,7 +131,7 @@ namespace Isis { for(int i = 0 ; i < cubeFileList.size() ; i++) { PvlObject fmap("File"); - fmap += PvlKeyword("Name", cubeFileList[i].toString()); + fmap += PvlKeyword("Name", cubeFileList[i].toString().toStdString()); try { // Set input image, get camera model, and a basic mapping group @@ -142,18 +142,18 @@ namespace Isis { int samples = cube.sampleCount(); PvlObject fmap("File"); - fmap += PvlKeyword("Name", cubeFileList[i].toString()); - fmap += PvlKeyword("Lines", toString(lines)); - fmap += PvlKeyword("Samples", toString(samples)); + fmap += PvlKeyword("Name", cubeFileList[i].toString().toStdString()); + fmap += PvlKeyword("Lines", std::to_string(lines)); + fmap += PvlKeyword("Samples", std::to_string(samples)); Camera *cam = cube.camera(); Pvl mapping; cam->BasicMapping(mapping); PvlGroup &mapgrp = mapping.findGroup("Mapping"); - mapgrp.addKeyword(PvlKeyword("ProjectionName", projection), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("LatitudeType", lattype), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("LongitudeDirection", londir), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("LongitudeDomain", londom), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("ProjectionName", projection.toStdString()), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("LatitudeType", lattype.toStdString()), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("LongitudeDirection", londir.toStdString()), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("LongitudeDomain", londom.toStdString()), Pvl::Replace); // Get the radii Distance radii[3]; @@ -182,20 +182,20 @@ namespace Isis { double pixres = (lowres + hires) / 2.0; double scale = Scale(pixres, poleRad, eqRad); - mapgrp.addKeyword(PvlKeyword("PixelResolution", toString(pixres)), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("Scale", toString(scale), "pixels/degree"), Pvl::Replace); - mapgrp += PvlKeyword("MinPixelResolution", toString(lowres), "meters/pixel"); - mapgrp += PvlKeyword("MaxPixelResolution", toString(hires), "meters/pixel"); - mapgrp += PvlKeyword("MinObliquePixelResolution", toString(lowObliqueRes), "meters/pixel"); - mapgrp += PvlKeyword("MaxObliquePixelResolution", toString(hiObliqueRes), "meters/pixel"); + mapgrp.addKeyword(PvlKeyword("PixelResolution", std::to_string(pixres)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("Scale", std::to_string(scale), "pixels/degree"), Pvl::Replace); + mapgrp += PvlKeyword("MinPixelResolution", std::to_string(lowres), "meters/pixel"); + mapgrp += PvlKeyword("MaxPixelResolution", std::to_string(hires), "meters/pixel"); + mapgrp += PvlKeyword("MinObliquePixelResolution", std::to_string(lowObliqueRes), "meters/pixel"); + mapgrp += PvlKeyword("MaxObliquePixelResolution", std::to_string(hiObliqueRes), "meters/pixel"); // Get the universal ground range double minlat, maxlat, minlon, maxlon; cam->GroundRange(minlat, maxlat, minlon, maxlon, mapping); - mapgrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minlat)), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxlat)), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minlon)), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxlon)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(minlat)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(maxlat)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(minlon)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(maxlon)), Pvl::Replace); fmap.addGroup(mapgrp); fileset.addObject(fmap); @@ -206,7 +206,7 @@ namespace Isis { latitudeStat.AddData(&maxlat, 1); } catch(IException &ie) { - QString mess = cubeFileList[i].toString() + " - " + ie.what(); + std::string mess = cubeFileList[i].toString().toStdString() + " - " + ie.what(); fmap += PvlKeyword("Error", mess); errorset.addObject(fmap); @@ -223,7 +223,7 @@ namespace Isis { if ( ui.WasEntered("ERRORLOG") ) { Pvl temp; temp.addObject(errorset); - temp.write(ui.GetFileName("ERRORLOG", "log")); + temp.write(ui.GetFileName("ERRORLOG", "log").toStdString()); } if ( ui.WasEntered("ERRORLIST") ) { @@ -261,40 +261,40 @@ namespace Isis { double avgPoleRad((poleRadStat.Minimum() + poleRadStat.Maximum()) / 2.0); double scale = Scale(avgPixRes, avgPoleRad, avgEqRad); - mapping += PvlKeyword("ProjectionName", projection); - mapping += PvlKeyword("TargetName", target); - mapping += PvlKeyword("EquatorialRadius", toString(eqRad), "meters"); - mapping += PvlKeyword("PolarRadius", toString(poleRad), "meters"); - mapping += PvlKeyword("LatitudeType", lattype); - mapping += PvlKeyword("LongitudeDirection", londir); - mapping += PvlKeyword("LongitudeDomain", londom); - mapping += PvlKeyword("PixelResolution", toString(SetRound(avgPixRes, digits)), "meters/pixel"); - mapping += PvlKeyword("Scale", toString(SetRound(scale, digits)), "pixels/degree"); - mapping += PvlKeyword("MinPixelResolution", toString(scaleStat.Minimum()), "meters/pixel"); - mapping += PvlKeyword("MaxPixelResolution", toString(scaleStat.Maximum()), "meters/pixel"); - mapping += PvlKeyword("MinObliquePixelResolution", toString(obliqueScaleStat.Minimum()), + mapping += PvlKeyword("ProjectionName", projection.toStdString()); + mapping += PvlKeyword("TargetName", target.toStdString()); + mapping += PvlKeyword("EquatorialRadius", std::to_string(eqRad), "meters"); + mapping += PvlKeyword("PolarRadius", std::to_string(poleRad), "meters"); + mapping += PvlKeyword("LatitudeType", lattype.toStdString()); + mapping += PvlKeyword("LongitudeDirection", londir.toStdString()); + mapping += PvlKeyword("LongitudeDomain", londom.toStdString()); + mapping += PvlKeyword("PixelResolution", std::to_string(SetRound(avgPixRes, digits)), "meters/pixel"); + mapping += PvlKeyword("Scale", std::to_string(SetRound(scale, digits)), "pixels/degree"); + mapping += PvlKeyword("MinPixelResolution", std::to_string(scaleStat.Minimum()), "meters/pixel"); + mapping += PvlKeyword("MaxPixelResolution", std::to_string(scaleStat.Maximum()), "meters/pixel"); + mapping += PvlKeyword("MinObliquePixelResolution", std::to_string(obliqueScaleStat.Minimum()), "meters/pixel"); - mapping += PvlKeyword("MaxObliquePixelResolution", toString(obliqueScaleStat.Maximum()), + mapping += PvlKeyword("MaxObliquePixelResolution", std::to_string(obliqueScaleStat.Maximum()), "meters/pixel"); - mapping += PvlKeyword("CenterLongitude", toString(SetRound(avgLon, digits))); - mapping += PvlKeyword("CenterLatitude", toString(SetRound(avgLat, digits))); - mapping += PvlKeyword("MinimumLatitude", toString(std::max(SetFloor(latitudeStat.Minimum(), + mapping += PvlKeyword("CenterLongitude", std::to_string(SetRound(avgLon, digits))); + mapping += PvlKeyword("CenterLatitude", std::to_string(SetRound(avgLat, digits))); + mapping += PvlKeyword("MinimumLatitude", std::to_string(std::max(SetFloor(latitudeStat.Minimum(), digits), -90.0))); - mapping += PvlKeyword("MaximumLatitude", toString(std::min(SetCeil(latitudeStat.Maximum(), + mapping += PvlKeyword("MaximumLatitude", std::to_string(std::min(SetCeil(latitudeStat.Maximum(), digits), 90.0))); - mapping += PvlKeyword("MinimumLongitude", toString(std::max(SetFloor(longitudeStat.Minimum(), + mapping += PvlKeyword("MinimumLongitude", std::to_string(std::max(SetFloor(longitudeStat.Minimum(), digits), -180.0))); - mapping += PvlKeyword("MaximumLongitude", toString(std::min(SetCeil(longitudeStat.Maximum(), + mapping += PvlKeyword("MaximumLongitude", std::to_string(std::min(SetCeil(longitudeStat.Maximum(), digits), 360.0))); - PvlKeyword clat("PreciseCenterLongitude", toString(avgLon)); + PvlKeyword clat("PreciseCenterLongitude", std::to_string(avgLon)); clat.addComment("Actual Parameters without precision applied"); mapping += clat; - mapping += PvlKeyword("PreciseCenterLatitude", toString(avgLat)); - mapping += PvlKeyword("PreciseMinimumLatitude", toString(latitudeStat.Minimum())); - mapping += PvlKeyword("PreciseMaximumLatitude", toString(latitudeStat.Maximum())); - mapping += PvlKeyword("PreciseMinimumLongitude", toString(longitudeStat.Minimum())); - mapping += PvlKeyword("PreciseMaximumLongitude", toString(longitudeStat.Maximum())); + mapping += PvlKeyword("PreciseCenterLatitude", std::to_string(avgLat)); + mapping += PvlKeyword("PreciseMinimumLatitude", std::to_string(latitudeStat.Minimum())); + mapping += PvlKeyword("PreciseMaximumLatitude", std::to_string(latitudeStat.Maximum())); + mapping += PvlKeyword("PreciseMinimumLongitude", std::to_string(longitudeStat.Minimum())); + mapping += PvlKeyword("PreciseMaximumLongitude", std::to_string(longitudeStat.Maximum())); Application::AppendAndLog(mapping, &log); @@ -302,13 +302,13 @@ namespace Isis { if(ui.WasEntered("TO")) { Pvl temp; temp.addGroup(mapping); - temp.write(ui.GetFileName("TO", "map")); + temp.write(ui.GetFileName("TO", "map").toStdString()); } if(ui.WasEntered("LOG")) { Pvl temp; temp.addObject(fileset); - temp.write(ui.GetFileName("LOG", "log")); + temp.write(ui.GetFileName("LOG", "log").toStdString()); } p.EndProcess(); diff --git a/isis/src/base/apps/nocam2map/nocam2map.cpp b/isis/src/base/apps/nocam2map/nocam2map.cpp index 22923aa938..b2b59980d7 100644 --- a/isis/src/base/apps/nocam2map/nocam2map.cpp +++ b/isis/src/base/apps/nocam2map/nocam2map.cpp @@ -175,16 +175,16 @@ namespace Isis { //Records the error to the log PvlGroup error("Error"); - error += PvlKeyword("Degree", toString(degree)); - error += PvlKeyword("NumberOfPoints", toString((int)sampResiduals.size())); - error += PvlKeyword("SampleMinimumError", toString(sampErr.Minimum())); - error += PvlKeyword("SampleAverageError", toString(sampErr.Average())); - error += PvlKeyword("SampleMaximumError", toString(sampErr.Maximum())); - error += PvlKeyword("SampleStdDeviationError", toString(sampErr.StandardDeviation())); - error += PvlKeyword("LineMinimumError", toString(lineErr.Minimum())); - error += PvlKeyword("LineAverageError", toString(lineErr.Average())); - error += PvlKeyword("LineMaximumError", toString(lineErr.Maximum())); - error += PvlKeyword("LineStdDeviationError", toString(lineErr.StandardDeviation())); + error += PvlKeyword("Degree", std::to_string(degree)); + error += PvlKeyword("NumberOfPoints", std::to_string((int)sampResiduals.size())); + error += PvlKeyword("SampleMinimumError", std::to_string(sampErr.Minimum())); + error += PvlKeyword("SampleAverageError", std::to_string(sampErr.Average())); + error += PvlKeyword("SampleMaximumError", std::to_string(sampErr.Maximum())); + error += PvlKeyword("SampleStdDeviationError", std::to_string(sampErr.StandardDeviation())); + error += PvlKeyword("LineMinimumError", std::to_string(lineErr.Minimum())); + error += PvlKeyword("LineAverageError", std::to_string(lineErr.Average())); + error += PvlKeyword("LineMaximumError", std::to_string(lineErr.Maximum())); + error += PvlKeyword("LineStdDeviationError", std::to_string(lineErr.StandardDeviation())); Application::Log(error); @@ -195,7 +195,7 @@ namespace Isis { if (!ui.GetBoolean("NOWARP")) { //Creates the mapping group Pvl mapFile; - mapFile.read(ui.GetFileName("MAP")); + mapFile.read(ui.GetFileName("MAP").toStdString()); PvlGroup &mapGrp = mapFile.findGroup("Mapping", Pvl::Traverse); //Reopen the lat and long cubes @@ -211,12 +211,12 @@ namespace Isis { //If the user entered the target name if (ui.WasEntered("TARGET")) { - targetName = PvlKeyword("TargetName", ui.GetString("TARGET")); + targetName = PvlKeyword("TargetName", ui.GetString("TARGET").toStdString()); } //Else read the target name from the input cube else { Pvl fromFile; - fromFile.read(inCube->fileName()); + fromFile.read(inCube->fileName().toStdString()); targetName = fromFile.findKeyword("TargetName", Pvl::Traverse); } @@ -226,12 +226,12 @@ namespace Isis { PvlKeyword polRadius; //If the user entered the equatorial and polar radii if (ui.WasEntered("EQURADIUS") && ui.WasEntered("POLRADIUS")) { - equRadius = PvlKeyword("EquatorialRadius", toString(ui.GetDouble("EQURADIUS"))); - polRadius = PvlKeyword("PolarRadius", toString(ui.GetDouble("POLRADIUS"))); + equRadius = PvlKeyword("EquatorialRadius", std::to_string(ui.GetDouble("EQURADIUS"))); + polRadius = PvlKeyword("PolarRadius", std::to_string(ui.GetDouble("POLRADIUS"))); } //Else read them from the pck else { - PvlGroup radii = Target::radiiGroup(targetName[0]); + PvlGroup radii = Target::radiiGroup(QString::fromStdString(targetName[0])); equRadius = radii["EquatorialRadius"]; polRadius = radii["PolarRadius"]; } @@ -277,7 +277,7 @@ namespace Isis { double minLat = latStats->Minimum(); double maxLat = latStats->Maximum(); - bool isOcentric = ((QString)mapGrp.findKeyword("LatitudeType")) == "Planetocentric"; + bool isOcentric = ((std::string)mapGrp.findKeyword("LatitudeType")) == "Planetocentric"; if (isOcentric) { if (ui.GetString("LATTYPE") != "PLANETOCENTRIC") { @@ -298,7 +298,7 @@ namespace Isis { double maxLon = lonDomain == 360 ? TProjection::To360Domain(lonStats->Maximum()) : TProjection::To180Domain(lonStats->Maximum()); - bool isPosEast = ((QString)mapGrp.findKeyword("LongitudeDirection")) == "PositiveEast"; + bool isPosEast = ((std::string)mapGrp.findKeyword("LongitudeDirection")) == "PositiveEast"; if (isPosEast) { if (ui.GetString("LONDIR") != "POSITIVEEAST") { @@ -319,31 +319,31 @@ namespace Isis { maxLon = temp; } - mapGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minLat)), Pvl::Replace); - mapGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxLat)), Pvl::Replace); - mapGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minLon)), Pvl::Replace); - mapGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxLon)), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(minLat)), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(maxLat)), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(minLon)), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(maxLon)), Pvl::Replace); } //If the user decided to enter a ground range then override if (ui.WasEntered("MINLAT")) { mapGrp.addKeyword(PvlKeyword("MinimumLatitude", - toString(ui.GetDouble("MINLAT"))), Pvl::Replace); + std::to_string(ui.GetDouble("MINLAT"))), Pvl::Replace); } if (ui.WasEntered("MAXLAT")) { mapGrp.addKeyword(PvlKeyword("MaximumLatitude", - toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); + std::to_string(ui.GetDouble("MAXLAT"))), Pvl::Replace); } if (ui.WasEntered("MINLON")) { mapGrp.addKeyword(PvlKeyword("MinimumLongitude", - toString(ui.GetDouble("MINLON"))), Pvl::Replace); + std::to_string(ui.GetDouble("MINLON"))), Pvl::Replace); } if (ui.WasEntered("MAXLON")) { mapGrp.addKeyword(PvlKeyword("MaximumLongitude", - toString(ui.GetDouble("MAXLON"))), Pvl::Replace); + std::to_string(ui.GetDouble("MAXLON"))), Pvl::Replace); } //If the pixel resolution is to be computed, compute the pixels/degree from the input @@ -378,7 +378,7 @@ namespace Isis { //Add the scale in pixels/degree to the mapping group mapGrp.addKeyword(PvlKeyword("Scale", - toString(pixels / angle), "pixels/degree"), + std::to_string(pixels / angle), "pixels/degree"), Pvl::Replace); if (mapGrp.hasKeyword("PixelResolution")) { mapGrp.deleteKeyword("PixelResolution"); @@ -389,7 +389,7 @@ namespace Isis { // If the user decided to enter a resolution then override if (ui.GetString("PIXRES") == "MPP") { mapGrp.addKeyword(PvlKeyword("PixelResolution", - toString(ui.GetDouble("RESOLUTION")), "meters/pixel"), + std::to_string(ui.GetDouble("RESOLUTION")), "meters/pixel"), Pvl::Replace); if (mapGrp.hasKeyword("Scale")) { mapGrp.deleteKeyword("Scale"); @@ -397,7 +397,7 @@ namespace Isis { } else if (ui.GetString("PIXRES") == "PPD") { mapGrp.addKeyword(PvlKeyword("Scale", - toString(ui.GetDouble("RESOLUTION")), "pixels/degree"), + std::to_string(ui.GetDouble("RESOLUTION")), "pixels/degree"), Pvl::Replace); if (mapGrp.hasKeyword("PixelResolution")) { mapGrp.deleteKeyword("PixelResolution"); @@ -705,16 +705,16 @@ namespace Isis { tablesToDelete.push_back( tmpTablesToDelete[i] ); } for (int j=0; j < kernels.keywords(); j++) { - if (kernels[j].operator[](0) == tableStr) { + if (kernels[j].operator[](0) == tableStr.toStdString()) { bool newTableToDelete=true; for (int k = 0; kobjects(); k++) { PvlObject ¤tObject=(*label).object(k); - if (currentObject.name() == tableStr) { - PvlKeyword &nameKeyword = currentObject.findKeyword(nameStr); + if (currentObject.name() == tableStr.toStdString()) { + PvlKeyword &nameKeyword = currentObject.findKeyword(nameStr.toStdString()); for (int l=0; l < tablesToDeleteSize; l++) { - if ( nameKeyword[0] == tablesToDelete[l] ) { + if ( nameKeyword[0] == tablesToDelete[l].toStdString() ) { indecesToDelete.push_back(k-indecesToDeleteSize); indecesToDeleteSize++; //(*label).deleteObject(k); diff --git a/isis/src/base/apps/noproj/noproj.cpp b/isis/src/base/apps/noproj/noproj.cpp index 021792ec28..d7bf37c750 100644 --- a/isis/src/base/apps/noproj/noproj.cpp +++ b/isis/src/base/apps/noproj/noproj.cpp @@ -88,8 +88,8 @@ namespace Isis { // Extract Instrument groups from input labels for the output match and noproj'd cubes PvlGroup inst = mcube->group("Instrument"); PvlGroup fromInst = icube->group("Instrument"); - QString groupName = (QString) inst["SpacecraftName"] + "/"; - groupName += (QString) inst.findKeyword("InstrumentId"); + QString groupName = QString::fromStdString(inst["SpacecraftName"]) + "/"; + groupName += QString::fromStdString(inst.findKeyword("InstrumentId")); // Get Ideal camera specifications FileName specs; @@ -99,10 +99,10 @@ namespace Isis { else { specs = "$ISISROOT/appdata/templates/noproj/noprojInstruments.pvl"; } - Pvl idealSpecs(specs.expanded()); + Pvl idealSpecs(specs.expanded().toStdString()); PvlObject obSpecs = idealSpecs.findObject("IdealInstrumentsSpecifications"); - PvlGroup idealGp = obSpecs.findGroup(groupName); + PvlGroup idealGp = obSpecs.findGroup(groupName.toStdString()); double transx, transy, transl, transs; transx = transy = transl = transs = 0.; if(idealGp.hasKeyword("TransX")) transx = idealGp["TransX"]; @@ -201,11 +201,11 @@ namespace Isis { Cube *ocube = p.SetOutputCube(matchCubeFile.expanded(), cao, 1, 1, 1); // Extract the times and the target from the instrument group - QString startTime = inst["StartTime"]; + QString startTime = QString::fromStdString(inst["StartTime"]); QString stopTime; - if (inst.hasKeyword("StopTime")) stopTime = (QString) inst["StopTime"]; + if (inst.hasKeyword("StopTime")) stopTime = QString::fromStdString(inst["StopTime"]); - QString target = inst["TargetName"]; + QString target = QString::fromStdString(inst["TargetName"]); // rename the instrument groups inst.setName("OriginalInstrument"); @@ -230,19 +230,19 @@ namespace Isis { inst.addKeyword(key); key.setName("TargetName"); - key.setValue(target); + key.setValue(target.toStdString()); inst.addKeyword(key); key.setName("SampleDetectors"); - key.setValue(Isis::toString(detectorSamples)); + key.setValue(std::to_string(detectorSamples)); inst.addKeyword(key); key.setName("LineDetectors"); - key.setValue(Isis::toString(detectorLines)); + key.setValue(std::to_string(detectorLines)); inst.addKeyword(key); key.setName("InstrumentType"); - key.setValue(instType); + key.setValue(instType.toStdString()); inst.addKeyword(key); Pvl &ocubeLabel = *ocube->label(); @@ -253,7 +253,7 @@ namespace Isis { // Clean up the naif keywords object... delete everything that isn't a radii for (int keyIndex = naifKeywordsObject->keywords() - 1; keyIndex >= 0; keyIndex--) { - QString keyName = (*naifKeywordsObject)[keyIndex].name(); + QString keyName = QString::fromStdString((*naifKeywordsObject)[keyIndex].name()); if (!keyName.contains("RADII")) { naifKeywordsObject->deleteKeyword(keyIndex); @@ -287,47 +287,47 @@ namespace Isis { } if (naifKeywordsObject) { - naifKeywordsObject->addKeyword(PvlKeyword("IDEAL_FOCAL_LENGTH", toString(incam->FocalLength())), + naifKeywordsObject->addKeyword(PvlKeyword("IDEAL_FOCAL_LENGTH", std::to_string(incam->FocalLength())), Pvl::Replace); } else { - inst.addKeyword(PvlKeyword("FocalLength", toString(incam->FocalLength()), "millimeters")); + inst.addKeyword(PvlKeyword("FocalLength", std::to_string(incam->FocalLength()), "millimeters")); } double newPixelPitch = incam->PixelPitch() * summingMode; if (naifKeywordsObject) { - naifKeywordsObject->addKeyword(PvlKeyword("IDEAL_PIXEL_PITCH", toString(newPixelPitch)), + naifKeywordsObject->addKeyword(PvlKeyword("IDEAL_PIXEL_PITCH", std::to_string(newPixelPitch)), Pvl::Replace); } else { - inst.addKeyword(PvlKeyword("PixelPitch", toString(newPixelPitch), "millimeters")); + inst.addKeyword(PvlKeyword("PixelPitch", std::to_string(newPixelPitch), "millimeters")); } key.setName("EphemerisTime"); - key.setValue(Isis::toString(et), "seconds"); + key.setValue(std::to_string(et), "seconds"); inst.addKeyword(key); key.setName("StartTime"); - key.setValue(startTime); + key.setValue(startTime.toStdString()); inst.addKeyword(key); if(stopTime != "") { key.setName("StopTime"); - key.setValue(stopTime); + key.setValue(stopTime.toStdString()); inst.addKeyword(key); } key.setName("FocalPlaneXDependency"); - key.setValue(toString((int)incam->FocalPlaneMap()->FocalPlaneXDependency())); + key.setValue(std::to_string((int)incam->FocalPlaneMap()->FocalPlaneXDependency())); inst.addKeyword(key); int xDependency = incam->FocalPlaneMap()->FocalPlaneXDependency(); double newInstrumentTransX = incam->FocalPlaneMap()->SignMostSigX(); - inst.addKeyword(PvlKeyword("TransX", toString(newInstrumentTransX))); + inst.addKeyword(PvlKeyword("TransX", std::to_string(newInstrumentTransX))); double newInstrumentTransY = incam->FocalPlaneMap()->SignMostSigY(); - inst.addKeyword(PvlKeyword("TransY", toString(newInstrumentTransY))); + inst.addKeyword(PvlKeyword("TransY", std::to_string(newInstrumentTransY))); storeSpice(&inst, naifKeywordsObject, "TransX0", "IDEAL_TRANSX", transx, newPixelPitch * newInstrumentTransX, (xDependency == CameraFocalPlaneMap::Sample)); @@ -349,12 +349,12 @@ namespace Isis { if(instType == "LINESCAN") { key.setName("ExposureDuration"); - key.setValue(Isis::toString(incam->DetectorMap()->LineRate() * 1000.), "milliseconds"); + key.setValue(std::to_string(incam->DetectorMap()->LineRate() * 1000.), "milliseconds"); inst.addKeyword(key); } key.setName("MatchedCube"); - key.setValue(mcube->fileName()); + key.setValue(mcube->fileName().toStdString()); inst.addKeyword(key); ocube->putGroup(inst); @@ -365,12 +365,12 @@ namespace Isis { // taking all the space it would require for the image data Pvl label; QString matchLbl = matchCubeFileNoExt + ".lbl"; - label.read(matchLbl); + label.read(matchLbl.toStdString()); PvlGroup &dims = label.findGroup("Dimensions", Pvl::Traverse); - dims["Lines"] = toString(numberLines); - dims["Samples"] = toString(detectorSamples); - dims["Bands"] = toString(numberBands); - label.write(matchLbl); + dims["Lines"] = std::to_string(numberLines); + dims["Samples"] = std::to_string(detectorSamples); + dims["Bands"] = std::to_string(numberBands); + label.write(matchLbl.toStdString()); // And run cam2cam to apply the transformation QVector args = {"to=" + ui.GetCubeName("TO"), "INTERP=" + ui.GetString("INTERP")}; @@ -413,19 +413,19 @@ namespace Isis { QString oldName, QString spiceName, double constantCoeff, double multiplierCoeff, bool putMultiplierInX) { if(constantCoeff != 0 && !naifKeywordsObject && instrumentGroup) { - instrumentGroup->addKeyword(PvlKeyword(oldName, toString(constantCoeff))); + instrumentGroup->addKeyword(PvlKeyword(oldName.toStdString(), std::to_string(constantCoeff))); } else if (naifKeywordsObject) { - PvlKeyword spiceKeyword(spiceName); - spiceKeyword += toString(constantCoeff); + PvlKeyword spiceKeyword(spiceName.toStdString()); + spiceKeyword += std::to_string(constantCoeff); if (putMultiplierInX) { - spiceKeyword += toString(multiplierCoeff); - spiceKeyword += toString(0.0); + spiceKeyword += std::to_string(multiplierCoeff); + spiceKeyword += std::to_string(0.0); } else { - spiceKeyword += toString(0.0); - spiceKeyword += toString(multiplierCoeff); + spiceKeyword += std::to_string(0.0); + spiceKeyword += std::to_string(multiplierCoeff); } naifKeywordsObject->addKeyword(spiceKeyword, Pvl::Replace); diff --git a/isis/src/base/apps/overlapstats/overlapstats.cpp b/isis/src/base/apps/overlapstats/overlapstats.cpp index d7d7ecadea..af39d467d2 100644 --- a/isis/src/base/apps/overlapstats/overlapstats.cpp +++ b/isis/src/base/apps/overlapstats/overlapstats.cpp @@ -112,7 +112,7 @@ namespace Isis { const geos::geom::MultiPolygon *mpLatLon = overlaps[index]->Polygon(); // Construct a Projection for converting between Lon/Lat and X/Y - Pvl cubeLab(serialNumbers.fileName(0)); + Pvl cubeLab(serialNumbers.fileName(0).toStdString()); // Get empty mapping label Pvl maplab; @@ -218,30 +218,30 @@ namespace Isis { //Create and Log the BRIEF description PvlGroup brief("Results"); - brief += PvlKeyword("ThicknessMinimum", toString(thickness.Minimum())); - brief += PvlKeyword("ThicknessMaximum", toString(thickness.Maximum())); - brief += PvlKeyword("ThicknessAverage", toString(thickness.Average())); - brief += PvlKeyword("ThicknessStandardDeviation", toString(thickness.StandardDeviation())); - brief += PvlKeyword("ThicknessVariance", toString(thickness.Variance())); + brief += PvlKeyword("ThicknessMinimum", std::to_string(thickness.Minimum())); + brief += PvlKeyword("ThicknessMaximum", std::to_string(thickness.Maximum())); + brief += PvlKeyword("ThicknessAverage", std::to_string(thickness.Average())); + brief += PvlKeyword("ThicknessStandardDeviation", std::to_string(thickness.StandardDeviation())); + brief += PvlKeyword("ThicknessVariance", std::to_string(thickness.Variance())); - brief += PvlKeyword("AreaMinimum", toString(area.Minimum())); - brief += PvlKeyword("AreaMaximum", toString(area.Maximum())); - brief += PvlKeyword("AreaAverage", toString(area.Average())); - brief += PvlKeyword("AreaStandardDeviation", toString(area.StandardDeviation())); - brief += PvlKeyword("AreaVariance", toString(area.Variance())); + brief += PvlKeyword("AreaMinimum", std::to_string(area.Minimum())); + brief += PvlKeyword("AreaMaximum", std::to_string(area.Maximum())); + brief += PvlKeyword("AreaAverage", std::to_string(area.Average())); + brief += PvlKeyword("AreaStandardDeviation", std::to_string(area.StandardDeviation())); + brief += PvlKeyword("AreaVariance", std::to_string(area.Variance())); - brief += PvlKeyword("ImageStackMinimum", toString(sncount.Minimum())); - brief += PvlKeyword("ImageStackMaximum", toString(sncount.Maximum())); - brief += PvlKeyword("ImageStackAverage", toString(sncount.Average())); - brief += PvlKeyword("ImageStackStandardDeviation", toString(sncount.StandardDeviation())); - brief += PvlKeyword("ImageStackVariance", toString(sncount.Variance())); + brief += PvlKeyword("ImageStackMinimum", std::to_string(sncount.Minimum())); + brief += PvlKeyword("ImageStackMaximum", std::to_string(sncount.Maximum())); + brief += PvlKeyword("ImageStackAverage", std::to_string(sncount.Average())); + brief += PvlKeyword("ImageStackStandardDeviation", std::to_string(sncount.StandardDeviation())); + brief += PvlKeyword("ImageStackVariance", std::to_string(sncount.Variance())); - brief += PvlKeyword("PolygonCount", toString(overlaps.Size())); + brief += PvlKeyword("PolygonCount", std::to_string(overlaps.Size())); // Add non-overlapping cubes to the output if (!nooverlap.empty()) { for (set::iterator itt = nooverlap.begin(); itt != nooverlap.end(); itt ++) { - brief += PvlKeyword("NoOverlap", serialNumbers.fileName(*itt)); + brief += PvlKeyword("NoOverlap", serialNumbers.fileName(*itt).toStdString()); } } @@ -259,7 +259,7 @@ namespace Isis { //Log error num in print.prt if there were errors if (errorNum > 0) { PvlGroup grp("OverlapStats"); - PvlKeyword key("ErrorNumber", toString(errorNum)); + PvlKeyword key("ErrorNumber", std::to_string(errorNum)); grp.addKeyword(key); Application::AppendAndLog(grp, log); } diff --git a/isis/src/base/apps/phocube/phocube.cpp b/isis/src/base/apps/phocube/phocube.cpp index 760a29fb42..8e217f58e7 100644 --- a/isis/src/base/apps/phocube/phocube.cpp +++ b/isis/src/base/apps/phocube/phocube.cpp @@ -189,10 +189,10 @@ namespace Isis { if (dn && icube->hasGroup("BandBin")) { PvlGroup &mybb = icube->group("BandBin"); if ( mybb.hasKeyword("Name") ) { - bname = mybb["Name"][0]; + bname = QString::fromStdString(mybb["Name"][0]); } else if (mybb.hasKeyword("FilterName")) { - bname = mybb["FilterName"][0]; + bname = QString::fromStdString(mybb["FilterName"][0]); } } else if (alldn && icube->hasGroup("BandBin")) { @@ -208,7 +208,7 @@ namespace Isis { // Create a bandbin group for the output label PvlKeyword name("Name"); if (dn) { - name += bname; + name += bname.toStdString(); raBandNum++; } else if (alldn) { @@ -704,9 +704,9 @@ namespace Isis { template PvlKeyword makeKey(const QString &name, const int &nvals, const T &value) { - PvlKeyword key(name); + PvlKeyword key(name.toStdString()); for (int i = 0 ; i < nvals ; i++) { - key += value; + key += value.toStdString(); } return (key); } @@ -757,8 +757,8 @@ namespace Isis { const QString &default_value) { QString defVal(default_value); - if ( bb.hasKeyword(keyname) ) { - defVal = bb[keyname][0]; + if ( bb.hasKeyword(keyname.toStdString()) ) { + defVal = QString::fromStdString(bb[keyname.toStdString()][0]); } bb.addKeyword(makeKey(keyname, nvals, defVal), PvlContainer::Replace); diff --git a/isis/src/base/apps/phoempglobal/main.cpp b/isis/src/base/apps/phoempglobal/main.cpp index 1c343dab84..5db5486337 100644 --- a/isis/src/base/apps/phoempglobal/main.cpp +++ b/isis/src/base/apps/phoempglobal/main.cpp @@ -247,16 +247,16 @@ void IsisMain() { if (!iord) { // Fit with no additive offset: output multiplier normalized to // zero phase, which is the desired phase curve B, and unnormalized - phaseAngle.addValue(toString(lFitParams.phase)); - limbValue.addValue(toString(rmsmin)); - phaseCurve.addValue(toString(c1/c1_0)); + phaseAngle.addValue(std::to_string(lFitParams.phase)); + limbValue.addValue(std::to_string(rmsmin)); + phaseCurve.addValue(std::to_string(c1/c1_0)); } else { // Fit with additive offset: normalizing would make no sense, just // output additive offset and multiplier from fit - phaseAngle.addValue(toString(lFitParams.phase)); - limbValue.addValue(toString(rmsmin)); - phaseCurve.addValue(toString(c1)); + phaseAngle.addValue(std::to_string(lFitParams.phase)); + limbValue.addValue(std::to_string(rmsmin)); + phaseCurve.addValue(std::to_string(c1)); } } diff --git a/isis/src/base/apps/phohillier/Hillier.cpp b/isis/src/base/apps/phohillier/Hillier.cpp index 67f4fe776b..0dff030194 100644 --- a/isis/src/base/apps/phohillier/Hillier.cpp +++ b/isis/src/base/apps/phohillier/Hillier.cpp @@ -107,7 +107,7 @@ namespace Isis { double Hillier::photometry(double i, double e, double g, int band) const { // Test for valid band if((band <= 0) || (band > (int) _bandpho.size())) { - QString mess = "Provided band " + toString(band) + " out of range."; + std::string mess = "Provided band " + std::to_string(band) + " out of range."; throw IException(IException::Programmer, mess, _FILEINFO_); } double ph = photometry(_bandpho[band-1], i, e, g); @@ -170,9 +170,9 @@ namespace Isis { */ void Hillier::Report(PvlContainer &pvl) { pvl += PvlKeyword("Algorithm", "Hillier"); - pvl += PvlKeyword("IncRef", toString(_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(_gRef), "degrees"); + pvl += PvlKeyword("IncRef", std::to_string(_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", std::to_string(_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", std::to_string(_gRef), "degrees"); PvlKeyword units("HillierUnits"); PvlKeyword phostd("PhotometricStandard"); PvlKeyword bbc("BandBinCenter"); @@ -187,18 +187,18 @@ namespace Isis { PvlKeyword a4("A4"); for(unsigned int i = 0 ; i < _bandpho.size() ; i++) { Parameters &p = _bandpho[i]; - units.addValue(p.units); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); - b0.addValue(toString(p.b0)); - b1.addValue(toString(p.b1)); - a0.addValue(toString(p.a0)); - a1.addValue(toString(p.a1)); - a2.addValue(toString(p.a2)); - a3.addValue(toString(p.a3)); - a4.addValue(toString(p.a4)); + units.addValue(p.units.toStdString()); + phostd.addValue(std::to_string(p.phoStd)); + bbc.addValue(std::to_string(p.wavelength)); + bbct.addValue(std::to_string(p.tolerance)); + bbn.addValue(std::to_string(p.band)); + b0.addValue(std::to_string(p.b0)); + b1.addValue(std::to_string(p.b1)); + a0.addValue(std::to_string(p.a0)); + a1.addValue(std::to_string(p.a1)); + a2.addValue(std::to_string(p.a2)); + a3.addValue(std::to_string(p.a3)); + a4.addValue(std::to_string(p.a4)); } pvl += units; pvl += phostd; @@ -325,7 +325,7 @@ namespace Isis { DbProfile phoProf = DbProfile(phoObj); PvlObject::PvlGroupIterator algo = phoObj.beginGroup(); while(algo != phoObj.endGroup()) { - if(algo->name().toLower() == "algorithm") { + if(QString::fromStdString(algo->name()).toLower() == "algorithm") { _profiles.push_back(DbProfile(phoProf, DbProfile(*algo))); } ++algo; @@ -333,9 +333,9 @@ namespace Isis { Pvl *label = cube.label(); PvlKeyword center = label->findGroup("BandBin", Pvl::Traverse)["Center"]; - QString errs(""); + std::string errs(""); for(int i = 0; i < cube.bandCount() ; i++) { - Parameters parms = findParameters(toDouble(center[i])); + Parameters parms = findParameters(std::stod(center[i])); if(parms.IsValid()) { parms.band = i + 1; _camera->SetBand(i + 1); @@ -347,12 +347,12 @@ namespace Isis { mess << "Band " << i + 1 << " with wavelength Center = " << center[i] << " does not have PhotometricModel Algorithm group/profile"; IException e(IException::User, mess.str(), _FILEINFO_); - errs += e.toString() + "\n"; + errs += e.toString().toStdString() + "\n"; } } // Check for errors and throw them all at the same time - if(!errs.isEmpty()) { + if(!errs.empty()) { errs += " --> Errors in the input PVL file \"" + pvl.fileName() + "\""; throw IException(IException::User, errs, _FILEINFO_); } diff --git a/isis/src/base/apps/ringsautomos/ringsautomos.cpp b/isis/src/base/apps/ringsautomos/ringsautomos.cpp index ad8f0d1ad5..56b9828a19 100644 --- a/isis/src/base/apps/ringsautomos/ringsautomos.cpp +++ b/isis/src/base/apps/ringsautomos/ringsautomos.cpp @@ -79,7 +79,7 @@ namespace Isis { for (int i = 0; i < list.size(); i++) { if (!m.StartProcess(list[i].toString())) { PvlGroup outsiders("Outside"); - outsiders += PvlKeyword("File", list[i].toString()); + outsiders += PvlKeyword("File", list[i].toString().toStdString()); Application::Log(outsiders); } else { diff --git a/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp b/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp index 7b53ba4377..3c68959018 100644 --- a/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp +++ b/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp @@ -135,7 +135,7 @@ namespace Isis { if (!noErrors) { for (int i = 0; i < gp->keywords(); i++) { - QString name = (*gp)[i].name(); + QString name = QString::fromStdString((*gp)[i].name()); // These three keywords have 3 values, so they must have 3 NULLs if (name == "BodyFixedCoordinate" || name == "SpacecraftPosition" || name == "SunPosition") { @@ -148,14 +148,14 @@ namespace Isis { } } // Set all keywords that still have valid information - gp->findKeyword("Error").setValue(error); - gp->findKeyword("FileName").setValue(cube()->fileName()); - gp->findKeyword("Sample").setValue(toString(camera()->Sample())); - gp->findKeyword("Line").setValue(toString(camera()->Line())); - gp->findKeyword("EphemerisTime").setValue(toString(camera()->time().Et()), "seconds"); + gp->findKeyword("Error").setValue(error.toStdString()); + gp->findKeyword("FileName").setValue(cube()->fileName().toStdString()); + gp->findKeyword("Sample").setValue(std::to_string(camera()->Sample())); + gp->findKeyword("Line").setValue(std::to_string(camera()->Line())); + gp->findKeyword("EphemerisTime").setValue(std::to_string(camera()->time().Et()), "seconds"); gp->findKeyword("EphemerisTime").addComment("Time"); QString utc = camera()->time().UTC(); - gp->findKeyword("UTC").setValue(utc); + gp->findKeyword("UTC").setValue(utc.toStdString()); gp->findKeyword("SpacecraftPosition").addComment("Spacecraft Information"); gp->findKeyword("SunPosition").addComment("Sun Information"); gp->findKeyword("Phase").addComment("Illumination and Other"); @@ -176,13 +176,13 @@ namespace Isis { // double ssplat, ssplon, sslat, sslon, pwlon, oglat; { - gp->findKeyword("FileName").setValue(cube()->fileName()); - gp->findKeyword("Sample").setValue(toString(camera()->Sample())); - gp->findKeyword("Line").setValue(toString(camera()->Line())); - gp->findKeyword("PixelValue").setValue(PixelToString(b[0])); - gp->findKeyword("RightAscension").setValue(toString(camera()->RightAscension())); - gp->findKeyword("Declination").setValue(toString(camera()->Declination())); - // gp->findKeyword("PlanetocentricLatitude").setValue(toString( + gp->findKeyword("FileName").setValue(cube()->fileName().toStdString()); + gp->findKeyword("Sample").setValue(std::to_string(camera()->Sample())); + gp->findKeyword("Line").setValue(std::to_string(camera()->Line())); + gp->findKeyword("PixelValue").setValue(PixelToString(b[0]).toStdString()); + gp->findKeyword("RightAscension").setValue(std::to_string(camera()->RightAscension())); + gp->findKeyword("Declination").setValue(std::to_string(camera()->Declination())); + // gp->findKeyword("PlanetocentricLatitude").setValue(std::to_string( // camera()->UniversalLatitude())); // Convert lat to planetographic @@ -190,114 +190,114 @@ namespace Isis { // camera()->radii(radii); // oglat = Isis::TProjection::ToPlanetographic(camera()->UniversalLatitude(), // radii[0].kilometers(), radii[2].kilometers()); - // gp->findKeyword("PlanetographicLatitude").setValue(toString(oglat)); + // gp->findKeyword("PlanetographicLatitude").setValue(std::to_string(oglat)); - gp->findKeyword("CounterClockwise360RingLongitude").setValue(toString( + gp->findKeyword("CounterClockwise360RingLongitude").setValue(std::to_string( camera()->UniversalLongitude())); - // gp->findKeyword("PositiveEast360Longitude").setValue(toString( + // gp->findKeyword("PositiveEast360Longitude").setValue(std::to_string( // camera()->UniversalLongitude())); //Convert lon to -180 - 180 range - gp->findKeyword("CounterClockwise180RingLongitude").setValue(toString( + gp->findKeyword("CounterClockwise180RingLongitude").setValue(std::to_string( RingPlaneProjection::To180Domain( camera()->UniversalLongitude()))); - // gp->findKeyword("PositiveEast180Longitude").setValue(toString( + // gp->findKeyword("PositiveEast180Longitude").setValue(std::to_string( // Isis::TProjection::To180Domain( // camera()->UniversalLongitude()))); //Convert ring longitude (az) to clockwise cwaz = Isis::RingPlaneProjection::ToClockwise(camera()->UniversalLongitude(), 360); - gp->findKeyword("Clockwise360RingLongitude").setValue(toString(cwaz)); + gp->findKeyword("Clockwise360RingLongitude").setValue(std::to_string(cwaz)); //Convert lon to positive west // pwlon = Isis::TProjection::ToPositiveWest(camera()->UniversalLongitude(), // 360); - // gp->findKeyword("PositiveWest360Longitude").setValue(toString(pwlon)); + // gp->findKeyword("PositiveWest360Longitude").setValue(std::to_string(pwlon)); //Convert cwaz to -180 - 180 range - gp->findKeyword("Clockwise180RingLongitude").setValue(toString( + gp->findKeyword("Clockwise180RingLongitude").setValue(std::to_string( Isis::RingPlaneProjection::To180Domain(cwaz))); //Convert pwlon to -180 - 180 range - // gp->findKeyword("PositiveWest180Longitude").setValue(toString( + // gp->findKeyword("PositiveWest180Longitude").setValue(std::to_string( // Isis::TProjection::To180Domain(pwlon))); camera()->Coordinate(pB); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[0]), "km"); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[1]), "km"); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[2]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(std::to_string(pB[0]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(std::to_string(pB[1]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(std::to_string(pB[2]), "km"); - gp->findKeyword("LocalRingRadius").setValue(toString( + gp->findKeyword("LocalRingRadius").setValue(std::to_string( camera()->LocalRadius().meters()), "meters"); - gp->findKeyword("SampleResolution").setValue(toString( + gp->findKeyword("SampleResolution").setValue(std::to_string( camera()->SampleResolution()), "meters/pixel"); - gp->findKeyword("LineResolution").setValue(toString( + gp->findKeyword("LineResolution").setValue(std::to_string( camera()->LineResolution()), "meters/pixel"); //body fixed camera()->instrumentPosition(spB); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[1]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[2]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[0]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[1]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[2]), "km"); gp->findKeyword("SpacecraftPosition").addComment("Spacecraft Information"); // if IsValid if (Isis::IsValidPixel(camera()->SpacecraftAzimuth())) { double spacecraftAzi = camera()->SpacecraftAzimuth(); - gp->findKeyword("SpacecraftAzimuth").setValue(toString(spacecraftAzi)); + gp->findKeyword("SpacecraftAzimuth").setValue(std::to_string(spacecraftAzi)); } else { gp->findKeyword("SpacecraftAzimuth").setValue("NULL"); } - gp->findKeyword("SlantDistance").setValue(toString(camera()->SlantDistance()), "km"); - gp->findKeyword("TargetCenterDistance").setValue(toString( + gp->findKeyword("SlantDistance").setValue(std::to_string(camera()->SlantDistance()), "km"); + gp->findKeyword("TargetCenterDistance").setValue(std::to_string( camera()->targetCenterDistance()), "km"); camera()->subSpacecraftPoint(ssplat, ssplon); - gp->findKeyword("SubSpacecraftLatitude").setValue(toString(ssplat)); - gp->findKeyword("SubSpacecraftLongitude").setValue(toString(ssplon)); - gp->findKeyword("SpacecraftAltitude").setValue(toString( + gp->findKeyword("SubSpacecraftLatitude").setValue(std::to_string(ssplat)); + gp->findKeyword("SubSpacecraftLongitude").setValue(std::to_string(ssplon)); + gp->findKeyword("SpacecraftAltitude").setValue(std::to_string( camera()->SpacecraftAltitude()), "km"); - gp->findKeyword("OffNadirAngle").setValue(toString(camera()->OffNadirAngle())); + gp->findKeyword("OffNadirAngle").setValue(std::to_string(camera()->OffNadirAngle())); double subspcgrdaz = camera()->GroundAzimuth(camera()->UniversalLatitude(), camera()->UniversalLongitude(), ssplat, ssplon); - gp->findKeyword("SubSpacecraftGroundAzimuth").setValue(toString(subspcgrdaz)); + gp->findKeyword("SubSpacecraftGroundAzimuth").setValue(std::to_string(subspcgrdaz)); camera()->sunPosition(sB); - gp->findKeyword("SunPosition").addValue(toString(sB[0]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[1]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[2]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[0]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[1]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[2]), "km"); gp->findKeyword("SunPosition").addComment("Sun Information"); if (Isis::IsValidPixel(camera()->SunAzimuth())) { double sunAzi = camera()->SunAzimuth(); - gp->findKeyword("SubSolarAzimuth").setValue(toString(sunAzi)); + gp->findKeyword("SubSolarAzimuth").setValue(std::to_string(sunAzi)); } else { gp->findKeyword("SubSolarAzimuth").setValue("NULL"); } - gp->findKeyword("SolarDistance").setValue(toString(camera()->SolarDistance()), "AU"); + gp->findKeyword("SolarDistance").setValue(std::to_string(camera()->SolarDistance()), "AU"); camera()->subSolarPoint(sslat, sslon); - gp->findKeyword("SubSolarLatitude").setValue(toString(sslat)); - gp->findKeyword("SubSolarLongitude").setValue(toString(sslon)); + gp->findKeyword("SubSolarLatitude").setValue(std::to_string(sslat)); + gp->findKeyword("SubSolarLongitude").setValue(std::to_string(sslon)); double subsolgrdaz; subsolgrdaz = camera()->GroundAzimuth(camera()->UniversalLatitude(), camera()->UniversalLongitude(), sslat, sslon); - gp->findKeyword("SubSolarGroundAzimuth").setValue(toString(subsolgrdaz)); + gp->findKeyword("SubSolarGroundAzimuth").setValue(std::to_string(subsolgrdaz)); - gp->findKeyword("Phase").setValue(toString(camera()->PhaseAngle())); + gp->findKeyword("Phase").setValue(std::to_string(camera()->PhaseAngle())); gp->findKeyword("Phase").addComment("Illumination and Other"); - gp->findKeyword("Incidence").setValue(toString(camera()->IncidenceAngle())); - gp->findKeyword("Emission").setValue(toString(camera()->EmissionAngle())); + gp->findKeyword("Incidence").setValue(std::to_string(camera()->IncidenceAngle())); + gp->findKeyword("Emission").setValue(std::to_string(camera()->EmissionAngle())); - gp->findKeyword("EphemerisTime").setValue(toString(camera()->time().Et()), "seconds"); + gp->findKeyword("EphemerisTime").setValue(std::to_string(camera()->time().Et()), "seconds"); gp->findKeyword("EphemerisTime").addComment("Time"); utc = camera()->time().UTC(); - gp->findKeyword("UTC").setValue(utc); - gp->findKeyword("LocalSolarTime").setValue(toString(camera()->LocalSolarTime()), "hour"); - gp->findKeyword("SolarLongitude").setValue(toString(camera()->solarLongitude().degrees())); + gp->findKeyword("UTC").setValue(utc.toStdString()); + gp->findKeyword("LocalSolarTime").setValue(std::to_string(camera()->LocalSolarTime()), "hour"); + gp->findKeyword("SolarLongitude").setValue(std::to_string(camera()->solarLongitude().degrees())); if (allowErrors) gp->findKeyword("Error").setValue("NULL"); } } diff --git a/isis/src/base/apps/shadow/ShadowFunctor.cpp b/isis/src/base/apps/shadow/ShadowFunctor.cpp index 02447dbfae..3b8e7318fd 100644 --- a/isis/src/base/apps/shadow/ShadowFunctor.cpp +++ b/isis/src/base/apps/shadow/ShadowFunctor.cpp @@ -138,49 +138,49 @@ namespace Isis { PvlGroup shadowStats("ShadowStatistics"); shadowStats += PvlKeyword("NumComputedAzimuthElevations", - toString(m_azimuthStats->ValidPixels())); + std::to_string(m_azimuthStats->ValidPixels())); if (m_azimuthStats->ValidPixels() > 0) { PvlKeyword averageAzimuth("AverageAzimuth", - toString(m_azimuthStats->Average())); + std::to_string(m_azimuthStats->Average())); averageAzimuth.addCommentWrapped("The azimuth is measured from three o'clock, going " "clockwise, in degrees"); shadowStats += averageAzimuth; - shadowStats += PvlKeyword("MinimumAzimuth", toString(m_azimuthStats->Minimum())); - shadowStats += PvlKeyword("MaximumAzimuth", toString(m_azimuthStats->Maximum())); + shadowStats += PvlKeyword("MinimumAzimuth", std::to_string(m_azimuthStats->Minimum())); + shadowStats += PvlKeyword("MaximumAzimuth", std::to_string(m_azimuthStats->Maximum())); - PvlKeyword averageElevation("AverageElevation", toString(m_elevationStats->Average())); + PvlKeyword averageElevation("AverageElevation", std::to_string(m_elevationStats->Average())); averageElevation.addCommentWrapped("The elevation is measured from the normal, with directly " "overhead being 0 degrees and the horizon 90 degrees. Elevations are prevented from " "going below the horizon."); shadowStats += averageElevation; - shadowStats += PvlKeyword("MinimumElevation", toString(m_elevationStats->Minimum())); - shadowStats += PvlKeyword("MaximumElevation", toString(m_elevationStats->Maximum())); + shadowStats += PvlKeyword("MinimumElevation", std::to_string(m_elevationStats->Minimum())); + shadowStats += PvlKeyword("MaximumElevation", std::to_string(m_elevationStats->Maximum())); } - PvlKeyword numRays("NumRays", toString(m_rayLengthStats->ValidPixels())); + PvlKeyword numRays("NumRays", std::to_string(m_rayLengthStats->ValidPixels())); numRays.addCommentWrapped("This is the total number of rays traced from the surface towards " "the sun in order to detect if any given pixel is in shadow"); shadowStats += numRays; shadowStats += PvlKeyword("NumRayDemIntersections", - toString(qRound(m_rayLengthStats->Sum()))); + std::to_string(qRound(m_rayLengthStats->Sum()))); if (m_rayLengthStats->ValidPixels() > 0) { shadowStats += PvlKeyword("AverageRayDemIntersectionsPerRay", - toString(m_rayLengthStats->Average())); + std::to_string(m_rayLengthStats->Average())); } shadowStats += PvlKeyword("NumLightedPixels", - toString(qRound((1.0 - m_shadowedStats->Average()) * m_shadowedStats->ValidPixels()))); + std::to_string(qRound((1.0 - m_shadowedStats->Average()) * m_shadowedStats->ValidPixels()))); shadowStats += PvlKeyword("NumShadowedPixels", - toString(qRound(m_shadowedStats->Average() * m_shadowedStats->ValidPixels()))); + std::to_string(qRound(m_shadowedStats->Average() * m_shadowedStats->ValidPixels()))); shadowStats += PvlKeyword("NumSpecialPixels", - toString(m_shadowedStats->TotalPixels() - m_shadowedStats->ValidPixels())); + std::to_string(m_shadowedStats->TotalPixels() - m_shadowedStats->ValidPixels())); shadowStats += PvlKeyword("NumPixelsShadowedByRays", - toString(qRound(m_shadowedByRayStats->Sum()))); + std::to_string(qRound(m_shadowedByRayStats->Sum()))); return shadowStats; } diff --git a/isis/src/base/apps/shadow/shadow.cpp b/isis/src/base/apps/shadow/shadow.cpp index 337f5aa252..d095ad12b4 100644 --- a/isis/src/base/apps/shadow/shadow.cpp +++ b/isis/src/base/apps/shadow/shadow.cpp @@ -49,12 +49,12 @@ namespace Isis { NaifStatus::CheckErrors(); foreach (QString kernelFile, allKernelFiles) { - kernelsUsed += kernelFile; + kernelsUsed += kernelFile.toStdString(); furnsh_c(FileName(kernelFile).expanded().toLatin1().data()); } // Find the NAIF target code for the DEM's target - QString name = demCube->label()->findGroup("Mapping", Pvl::Traverse)["TargetName"]; + QString name = QString::fromStdString(demCube->label()->findGroup("Mapping", Pvl::Traverse)["TargetName"]); SpiceDouble sunPosition[3]; SpiceDouble lightTime; diff --git a/isis/src/base/apps/spiceinit/SpiceClient.cpp b/isis/src/base/apps/spiceinit/SpiceClient.cpp index 3156ee7f54..27d5f3b52a 100644 --- a/isis/src/base/apps/spiceinit/SpiceClient.cpp +++ b/isis/src/base/apps/spiceinit/SpiceClient.cpp @@ -197,7 +197,7 @@ namespace Isis { if (err.findKeyword("Message")[0] != "") { *p_error += " The error reported was: "; - *p_error += err.findKeyword("Message")[0]; + *p_error += QString::fromStdString(err.findKeyword("Message")[0]); } } catch(IException &) { diff --git a/isis/src/base/apps/spiceinit/spiceinit.cpp b/isis/src/base/apps/spiceinit/spiceinit.cpp index cd9f23d493..f5757ad46d 100644 --- a/isis/src/base/apps/spiceinit/spiceinit.cpp +++ b/isis/src/base/apps/spiceinit/spiceinit.cpp @@ -330,28 +330,28 @@ namespace Isis { PvlKeyword exkKeyword("Extra"); for (int i = 0; i < lk.size(); i++) { - lkKeyword.addValue(lk[i]); + lkKeyword.addValue(lk[i].toStdString()); } for (int i = 0; i < pck.size(); i++) { - pckKeyword.addValue(pck[i]); + pckKeyword.addValue(pck[i].toStdString()); } for (int i = 0; i < targetSpk.size(); i++) { - targetSpkKeyword.addValue(targetSpk[i]); + targetSpkKeyword.addValue(targetSpk[i].toStdString()); } for (int i = 0; i < ck.size(); i++) { - ckKeyword.addValue(ck[i]); + ckKeyword.addValue(ck[i].toStdString()); } for (int i = 0; i < ik.size(); i++) { - ikKeyword.addValue(ik[i]); + ikKeyword.addValue(ik[i].toStdString()); } for (int i = 0; i < sclk.size(); i++) { - sclkKeyword.addValue(sclk[i]); + sclkKeyword.addValue(sclk[i].toStdString()); } for (int i = 0; i < spk.size(); i++) { - spkKeyword.addValue(spk[i]); + spkKeyword.addValue(spk[i].toStdString()); } for (int i = 0; i < iak.size(); i++) { - iakKeyword.addValue(iak[i]); + iakKeyword.addValue(iak[i].toStdString()); } if (ui.GetString("SHAPE") == "RINGPLANE") { @@ -359,11 +359,11 @@ namespace Isis { } else { for (int i = 0; i < dem.size(); i++) { - demKeyword.addValue(dem[i]); + demKeyword.addValue(dem[i].toStdString()); } } for (int i = 0; i < exk.size(); i++) { - exkKeyword.addValue(exk[i]); + exkKeyword.addValue(exk[i].toStdString()); } PvlGroup originalKernels = icube->group("Kernels"); @@ -440,16 +440,16 @@ namespace Isis { // Add any time padding the user specified to the spice group if (ui.GetDouble("STARTPAD") > DBL_EPSILON) { currentKernels.addKeyword(PvlKeyword("StartPadding", - toString(ui.GetDouble("STARTPAD")), "seconds")); + std::to_string(ui.GetDouble("STARTPAD")), "seconds")); } if (ui.GetDouble("ENDPAD") > DBL_EPSILON) { currentKernels.addKeyword(PvlKeyword("EndPadding", - toString(ui.GetDouble("ENDPAD")), "seconds")); + std::to_string(ui.GetDouble("ENDPAD")), "seconds")); } currentKernels.addKeyword( - PvlKeyword("CameraVersion", toString(CameraFactory::CameraVersion(*icube))), + PvlKeyword("CameraVersion", std::to_string(CameraFactory::CameraVersion(*icube))), Pvl::Replace); // Add the modified Kernels group to the input cube labels @@ -518,7 +518,7 @@ namespace Isis { bodyTable.Label()["Kernels"].addValue(pckKeyword[i]); bodyTable.Label() += PvlKeyword("SolarLongitude", - toString(cam->solarLongitude().degrees())); + std::to_string(cam->solarLongitude().degrees())); icube->write(bodyTable); Table sunTable = cam->sunPosition()->Cache("SunPosition"); @@ -569,10 +569,10 @@ namespace Isis { while (i < label->objects()) { PvlObject currObj = label->object(i); if (currObj.isNamed("Table")) { - if (currObj["Name"][0] == QString("InstrumentPointing") || - currObj["Name"][0] == QString("InstrumentPosition") || - currObj["Name"][0] == QString("BodyRotation") || - currObj["Name"][0] == QString("SunPosition")) { + if (currObj["Name"][0] == "InstrumentPointing" || + currObj["Name"][0] == "InstrumentPosition" || + currObj["Name"][0] == "BodyRotation" || + currObj["Name"][0] == "SunPosition") { label->deleteObject(i); } else { @@ -608,7 +608,7 @@ namespace Isis { */ void requestSpice(Cube *icube, UserInterface &ui, Pvl *log, Pvl &labels, QString missionName) { QString instrumentId = - labels.findGroup("Instrument", Pvl::Traverse)["InstrumentId"][0]; + QString::fromStdString(labels.findGroup("Instrument", Pvl::Traverse)["InstrumentId"][0]); if (instrumentId == "HRSC"){ QString msg = "Spice Server does not support MEX HRSC images. Please rerun spiceinit with local MEX data."; @@ -680,7 +680,7 @@ namespace Isis { } if (ui.GetString("SHAPE") == "USER") { - kernelsGroup["ShapeModel"] = ui.GetCubeName("MODEL"); + kernelsGroup["ShapeModel"] = ui.GetCubeName("MODEL").toStdString(); } icube->putGroup(kernelsGroup); diff --git a/isis/src/base/apps/spiceserver/spiceserver.cpp b/isis/src/base/apps/spiceserver/spiceserver.cpp index 8399ada9e7..64369154b6 100644 --- a/isis/src/base/apps/spiceserver/spiceserver.cpp +++ b/isis/src/base/apps/spiceserver/spiceserver.cpp @@ -119,10 +119,10 @@ namespace Isis { } } else { - QString err = "Unable to read XML. The reason given was ["; - err += error; - err += "] on line [" + toString(errorLine) + "] column ["; - err += toString(errorCol) + "]"; + std::string err = "Unable to read XML. The reason given was ["; + err += error.toStdString(); + err += "] on line [" + std::to_string(errorLine) + "] column ["; + err += std::to_string(errorCol) + "]"; throw IException(IException::Io, err, _FILEINFO_); } } @@ -216,7 +216,7 @@ namespace Isis { demPvlKeyStream >> key; for (int value = 0; value < key.size(); value++) { - dem.push_back(key[value]); + dem.push_back(QString::fromStdString(key[value])); } } @@ -273,7 +273,7 @@ namespace Isis { * This program has read and write access on the spice server in /tmp/spice_web_service. */ inputLabels = FileName::createTempFile( ui.GetCubeName("TEMPFILE") ); - label.write( inputLabels.expanded() ); + label.write( inputLabels.expanded().toStdString() ); Cube cube; cube.open(inputLabels.expanded(), "rw"); kernelSuccess = tryKernels(cube, ui, log, label, p, lk, pck, targetSpk, @@ -332,34 +332,34 @@ namespace Isis { PvlKeyword exkKeyword("Extra"); for (int i = 0; i < lk.size(); i++) { - lkKeyword.addValue(lk[i]); + lkKeyword.addValue(lk[i].toStdString()); } for (int i = 0; i < pck.size(); i++) { - pckKeyword.addValue(pck[i]); + pckKeyword.addValue(pck[i].toStdString()); } for (int i = 0; i < targetSpk.size(); i++) { - targetSpkKeyword.addValue(targetSpk[i]); + targetSpkKeyword.addValue(targetSpk[i].toStdString()); } for (int i = 0; i < ck.size(); i++) { - ckKeyword.addValue(ck[i]); + ckKeyword.addValue(ck[i].toStdString()); } for (int i = 0; i < ik.size(); i++) { - ikKeyword.addValue(ik[i]); + ikKeyword.addValue(ik[i].toStdString()); } for (int i = 0; i < sclk.size(); i++) { - sclkKeyword.addValue(sclk[i]); + sclkKeyword.addValue(sclk[i].toStdString()); } for (int i = 0; i < spk.size(); i++) { - spkKeyword.addValue(spk[i]); + spkKeyword.addValue(spk[i].toStdString()); } for (int i = 0; i < iak.size(); i++) { - iakKeyword.addValue(iak[i]); + iakKeyword.addValue(iak[i].toStdString()); } for (int i = 0; i < dem.size(); i++) { - demKeyword.addValue(dem[i]); + demKeyword.addValue(dem[i].toStdString()); } for (int i = 0; i < exk.size(); i++) { - exkKeyword.addValue(exk[i]); + exkKeyword.addValue(exk[i].toStdString()); } PvlGroup originalKernels = lab.findGroup("Kernels", Pvl::Traverse); @@ -410,14 +410,14 @@ namespace Isis { // Add any time padding the user specified to the spice group if (g_startPad > DBL_EPSILON) - currentKernels.addKeyword( PvlKeyword("StartPadding", toString(g_startPad), "seconds") ); + currentKernels.addKeyword( PvlKeyword("StartPadding", std::to_string(g_startPad), "seconds") ); if (g_endPad > DBL_EPSILON) - currentKernels.addKeyword( PvlKeyword("EndPadding", toString(g_endPad), "seconds") ); + currentKernels.addKeyword( PvlKeyword("EndPadding", std::to_string(g_endPad), "seconds") ); currentKernels.addKeyword( - PvlKeyword( "CameraVersion", toString( CameraFactory::CameraVersion(cube) ) ), Pvl::Replace); + PvlKeyword( "CameraVersion", std::to_string( CameraFactory::CameraVersion(cube) ) ), Pvl::Replace); // Add the modified Kernels group to the input cube labels cube.putGroup(currentKernels); @@ -431,7 +431,7 @@ namespace Isis { // If success then pretend we had the shape model keyword in there... Pvl applicationLog; applicationLog += currentKernels; - applicationLog.write(ui.GetFileName("TO") + ".print"); + applicationLog.write(ui.GetFileName("TO").toStdString() + ".print"); } catch (IException &e) { Pvl errPvl = e.toPvl(); @@ -468,7 +468,7 @@ namespace Isis { for (int i = 0; i < pckKeyword.size(); i++) bodyTable.Label()["Kernels"].addValue(pckKeyword[i]); - bodyTable.Label() += PvlKeyword( "SolarLongitude", toString( cam->solarLongitude().degrees() ) ); + bodyTable.Label() += PvlKeyword( "SolarLongitude", std::to_string( cam->solarLongitude().degrees() ) ); bodyTable.toBlob().Write(ui.GetFileName("TO") + ".bodyrot"); Table sunTable = cam->sunPosition()->Cache("SunPosition"); @@ -499,7 +499,7 @@ namespace Isis { Pvl kernelsLabels; kernelsLabels += currentKernels; kernelsLabels += cam->getStoredNaifKeywords(); - kernelsLabels.write(ui.GetFileName("TO") + ".lab"); + kernelsLabels.write(ui.GetFileName("TO").toStdString() + ".lab"); } catch (IException &) { lab = origLabels; @@ -598,7 +598,7 @@ namespace Isis { xml += " \n"; QString logFile(toFile + ".print"); - Pvl logMessage(logFile); + Pvl logMessage(logFile.toStdString()); QFile::remove(logFile); stringstream logStream; logStream << logMessage; @@ -608,7 +608,7 @@ namespace Isis { xml += " \n"; QString kernLabelsFile(toFile + ".lab"); - Pvl kernLabels(kernLabelsFile); + Pvl kernLabels(kernLabelsFile.toStdString()); QFile::remove(kernLabelsFile); stringstream labelStream; labelStream << kernLabels; diff --git a/isis/src/base/apps/spkwriter/SpkSpiceSegment.cpp b/isis/src/base/apps/spkwriter/SpkSpiceSegment.cpp index bf354ae777..ab2916c3ee 100644 --- a/isis/src/base/apps/spkwriter/SpkSpiceSegment.cpp +++ b/isis/src/base/apps/spkwriter/SpkSpiceSegment.cpp @@ -167,11 +167,11 @@ void SpkSpiceSegment::init(Cube &cube) { */ QString SpkSpiceSegment::getKeyValue(PvlObject &label, const QString &keyword) { - QString value(""); - if ( label.hasKeyword(keyword,Pvl::Traverse) ) { - value = label.findKeyword(keyword,Pvl::Traverse)[0]; + std::string value(""); + if ( label.hasKeyword(keyword.toStdString(), Pvl::Traverse) ) { + value = label.findKeyword(keyword.toStdString(), Pvl::Traverse)[0]; } - return (value); + return QString::fromStdString(value); } @@ -209,12 +209,12 @@ bool SpkSpiceSegment::getImageTimes(Pvl &lab, double &start, double &end) const _kernels.Load("LSK,SCLK"); PvlObject &cube = lab.findObject("IsisCube"); // Get the start and end time for the cube - start = UTCtoET((QString) cube.findGroup("Instrument")["StartTime"]); + start = UTCtoET(QString::fromStdString(cube.findGroup("Instrument")["StartTime"])); if(cube.findGroup("Instrument").hasKeyword("StopTime")) { - end = UTCtoET((QString) cube.findGroup("Instrument")["StopTime"]); + end = UTCtoET(QString::fromStdString(cube.findGroup("Instrument")["StopTime"])); } else { - end = UTCtoET (cube.findGroup("Instrument")["StartTime"]); + end = UTCtoET (QString::fromStdString(cube.findGroup("Instrument")["StartTime"])); } return (true); diff --git a/isis/src/base/apps/stats/stats.cpp b/isis/src/base/apps/stats/stats.cpp index 8c62c7ccee..21847cf5dc 100644 --- a/isis/src/base/apps/stats/stats.cpp +++ b/isis/src/base/apps/stats/stats.cpp @@ -64,10 +64,10 @@ namespace Isis { //write the results in the requested format. if ( ui.GetString("FORMAT") == "PVL" ) { if (append) { - statsPvl.append(outFile); + statsPvl.append(outFile.toStdString()); } else { - statsPvl.write(outFile); + statsPvl.write(outFile.toStdString()); } } else { @@ -116,19 +116,19 @@ namespace Isis { // Construct a label with the results PvlGroup results("Results"); - results += PvlKeyword("From", cube->fileName()); - results += PvlKeyword("Band", toString(cube->physicalBand(i))); + results += PvlKeyword("From", cube->fileName().toStdString()); + results += PvlKeyword("Band", std::to_string(cube->physicalBand(i))); if ( stats->ValidPixels() != 0 ) { - results += PvlKeyword("Average", toString(stats->Average())); - results += PvlKeyword("StandardDeviation", toString(stats->StandardDeviation())); - results += PvlKeyword("Variance", toString(stats->Variance())); + results += PvlKeyword("Average", std::to_string(stats->Average())); + results += PvlKeyword("StandardDeviation", std::to_string(stats->StandardDeviation())); + results += PvlKeyword("Variance", std::to_string(stats->Variance())); // These statistics only worked on a histogram - results += PvlKeyword("Median", toString(stats->Median())); - results += PvlKeyword("Mode", toString(stats->Mode())); - results += PvlKeyword("Skew", toString(stats->Skew())); - results += PvlKeyword("Minimum", toString(stats->Minimum())); - results += PvlKeyword("Maximum", toString(stats->Maximum())); - results += PvlKeyword("Sum", toString(stats->Sum())); + results += PvlKeyword("Median", std::to_string(stats->Median())); + results += PvlKeyword("Mode", std::to_string(stats->Mode())); + results += PvlKeyword("Skew", std::to_string(stats->Skew())); + results += PvlKeyword("Minimum", std::to_string(stats->Minimum())); + results += PvlKeyword("Maximum", std::to_string(stats->Maximum())); + results += PvlKeyword("Sum", std::to_string(stats->Sum())); } else { results += PvlKeyword("Average", "N/A"); @@ -141,15 +141,15 @@ namespace Isis { results += PvlKeyword("Maximum", "N/A"); results += PvlKeyword("Sum", "N/A"); } - results += PvlKeyword("TotalPixels", toString(stats->TotalPixels())); - results += PvlKeyword("ValidPixels", toString(stats->ValidPixels())); - results += PvlKeyword("OverValidMaximumPixels", toString(stats->OverRangePixels())); - results += PvlKeyword("UnderValidMinimumPixels", toString(stats->UnderRangePixels())); - results += PvlKeyword("NullPixels", toString(stats->NullPixels())); - results += PvlKeyword("LisPixels", toString(stats->LisPixels())); - results += PvlKeyword("LrsPixels", toString(stats->LrsPixels())); - results += PvlKeyword("HisPixels", toString(stats->HisPixels())); - results += PvlKeyword("HrsPixels", toString(stats->HrsPixels())); + results += PvlKeyword("TotalPixels", std::to_string(stats->TotalPixels())); + results += PvlKeyword("ValidPixels", std::to_string(stats->ValidPixels())); + results += PvlKeyword("OverValidMaximumPixels", std::to_string(stats->OverRangePixels())); + results += PvlKeyword("UnderValidMinimumPixels", std::to_string(stats->UnderRangePixels())); + results += PvlKeyword("NullPixels", std::to_string(stats->NullPixels())); + results += PvlKeyword("LisPixels", std::to_string(stats->LisPixels())); + results += PvlKeyword("LrsPixels", std::to_string(stats->LrsPixels())); + results += PvlKeyword("HisPixels", std::to_string(stats->HisPixels())); + results += PvlKeyword("HrsPixels", std::to_string(stats->HrsPixels())); statsPvl.addGroup(results); @@ -181,7 +181,7 @@ namespace Isis { for (int i = 0; i < statsPvl.groups(); i++) { for (int j = 0; j < statsPvl.group(i).keywords(); j++) { - *stream << (QString) statsPvl.group(i)[j]; + *stream << statsPvl.group(i)[j]; if ( j < statsPvl.group(i).keywords() - 1 ) { *stream << ","; } diff --git a/isis/src/base/apps/stretch/stretch_app.cpp b/isis/src/base/apps/stretch/stretch_app.cpp index 0c6a28ed89..6a53bfdf57 100644 --- a/isis/src/base/apps/stretch/stretch_app.cpp +++ b/isis/src/base/apps/stretch/stretch_app.cpp @@ -78,7 +78,7 @@ namespace Isis { p.EndProcess(); PvlKeyword dnPairs = PvlKeyword("StretchPairs"); - dnPairs.addValue(str.Text()); + dnPairs.addValue(str.Text().toStdString()); PvlGroup results = PvlGroup("Results"); results.addKeyword(dnPairs); diff --git a/isis/src/base/objs/AlphaCube/AlphaCube.cpp b/isis/src/base/objs/AlphaCube/AlphaCube.cpp index f94c64a072..f3f176112f 100644 --- a/isis/src/base/objs/AlphaCube/AlphaCube.cpp +++ b/isis/src/base/objs/AlphaCube/AlphaCube.cpp @@ -145,25 +145,25 @@ namespace Isis { *this = temp; Isis::PvlGroup &alpha = cubeObject.findGroup("AlphaCube"); - alpha["AlphaSamples"] = toString(p_alphaSamples); - alpha["AlphaLines"] = toString(p_alphaLines); - alpha["AlphaStartingSample"] = toString(p_alphaStartingSample); - alpha["AlphaStartingLine"] = toString(p_alphaStartingLine); - alpha["AlphaEndingSample"] = toString(p_alphaEndingSample); - alpha["AlphaEndingLine"] = toString(p_alphaEndingLine); - alpha["BetaSamples"] = toString(p_betaSamples); - alpha["BetaLines"] = toString(p_betaLines); + alpha["AlphaSamples"] = std::to_string(p_alphaSamples); + alpha["AlphaLines"] = std::to_string(p_alphaLines); + alpha["AlphaStartingSample"] = std::to_string(p_alphaStartingSample); + alpha["AlphaStartingLine"] = std::to_string(p_alphaStartingLine); + alpha["AlphaEndingSample"] = std::to_string(p_alphaEndingSample); + alpha["AlphaEndingLine"] = std::to_string(p_alphaEndingLine); + alpha["BetaSamples"] = std::to_string(p_betaSamples); + alpha["BetaLines"] = std::to_string(p_betaLines); } else { Isis::PvlGroup alpha("AlphaCube"); - alpha += Isis::PvlKeyword("AlphaSamples", toString(p_alphaSamples)); - alpha += Isis::PvlKeyword("AlphaLines", toString(p_alphaLines)); - alpha += Isis::PvlKeyword("AlphaStartingSample", toString(p_alphaStartingSample)); - alpha += Isis::PvlKeyword("AlphaStartingLine", toString(p_alphaStartingLine)); - alpha += Isis::PvlKeyword("AlphaEndingSample", toString(p_alphaEndingSample)); - alpha += Isis::PvlKeyword("AlphaEndingLine", toString(p_alphaEndingLine)); - alpha += Isis::PvlKeyword("BetaSamples", toString(p_betaSamples)); - alpha += Isis::PvlKeyword("BetaLines", toString(p_betaLines)); + alpha += Isis::PvlKeyword("AlphaSamples", std::to_string(p_alphaSamples)); + alpha += Isis::PvlKeyword("AlphaLines", std::to_string(p_alphaLines)); + alpha += Isis::PvlKeyword("AlphaStartingSample", std::to_string(p_alphaStartingSample)); + alpha += Isis::PvlKeyword("AlphaStartingLine", std::to_string(p_alphaStartingLine)); + alpha += Isis::PvlKeyword("AlphaEndingSample", std::to_string(p_alphaEndingSample)); + alpha += Isis::PvlKeyword("AlphaEndingLine", std::to_string(p_alphaEndingLine)); + alpha += Isis::PvlKeyword("BetaSamples", std::to_string(p_betaSamples)); + alpha += Isis::PvlKeyword("BetaLines", std::to_string(p_betaLines)); cubeObject.addGroup(alpha); } } diff --git a/isis/src/base/objs/Application/Application.cpp b/isis/src/base/objs/Application/Application.cpp index 99b011bba1..88b8abbd71 100644 --- a/isis/src/base/objs/Application/Application.cpp +++ b/isis/src/base/objs/Application/Application.cpp @@ -249,15 +249,15 @@ namespace Isis { m_connectTime.start(); //cerr << "History GUI start clock=" << p_startClock << " time=" << p_startTime << endl; } - PvlObject history(p_ui->ProgramName()); - history += PvlKeyword("IsisVersion", Version()); - history += PvlKeyword("ProgramVersion", p_ui->Version()); + PvlObject history(p_ui->ProgramName().toStdString()); + history += PvlKeyword("IsisVersion", Version().toStdString()); + history += PvlKeyword("ProgramVersion", p_ui->Version().toStdString()); QString path = QCoreApplication::applicationDirPath(); - history += PvlKeyword("ProgramPath", path); - history += PvlKeyword("ExecutionDateTime", p_datetime); - history += PvlKeyword("HostName", HostName()); - history += PvlKeyword("UserName", UserName()); - history += PvlKeyword("Description", p_ui->Brief()); + history += PvlKeyword("ProgramPath", path.toStdString()); + history += PvlKeyword("ExecutionDateTime", p_datetime.toStdString()); + history += PvlKeyword("HostName", HostName().toStdString()); + history += PvlKeyword("UserName", UserName().toStdString()); + history += PvlKeyword("Description", p_ui->Brief().toStdString()); // Add the user parameters Pvl pvl; @@ -296,8 +296,8 @@ namespace Isis { // Add this information to the log PvlGroup acct("Accounting"); - acct += PvlKeyword("ConnectTime", conTime); - acct += PvlKeyword("CpuTime", cpuTime); + acct += PvlKeyword("ConnectTime", conTime.toStdString()); + acct += PvlKeyword("CpuTime", cpuTime.toStdString()); // Not sure if these are really valuable. If deemed so then // uncomment and complete private methods (DirectIO, Pagefaults, and @@ -638,7 +638,7 @@ namespace Isis { for (int i = 0; i < errors.groups(); i++) { PvlGroup &group = errors.group(i); if (group.isNamed("Error")) { - group += PvlKeyword("Program", Application::Name()); + group += PvlKeyword("Program", Application::Name().toStdString()); } } SessionLog::TheLog().AddError(errors); @@ -746,7 +746,7 @@ namespace Isis { for (int i = 0; i < errors.groups(); i++) { PvlGroup &group = errors.group(i); if (group.isNamed("Error")) { - group += PvlKeyword("Program", Application::Name()); + group += PvlKeyword("Program", Application::Name().toStdString()); } } stringStream.str(std::string()); diff --git a/isis/src/base/objs/Application/unitTest.cpp b/isis/src/base/objs/Application/unitTest.cpp index a6778cd3a2..cad1b91105 100644 --- a/isis/src/base/objs/Application/unitTest.cpp +++ b/isis/src/base/objs/Application/unitTest.cpp @@ -33,7 +33,7 @@ void errorFormatting() { QString errorString = Isis::Application::formatError(exception); std::cout << errorString.toStdString() << std::endl; - QString &formatValue = errorPrefs["Format"][0]; + std::string &formatValue = errorPrefs["Format"][0]; formatValue = "Pvl"; errorString = Isis::Application::formatError(exception); diff --git a/isis/src/base/objs/AtmosModelFactory/AtmosModelFactory.cpp b/isis/src/base/objs/AtmosModelFactory/AtmosModelFactory.cpp index ec749757eb..28cf5cd1d6 100644 --- a/isis/src/base/objs/AtmosModelFactory/AtmosModelFactory.cpp +++ b/isis/src/base/objs/AtmosModelFactory/AtmosModelFactory.cpp @@ -49,13 +49,13 @@ namespace Isis { QString algorithm = ""; if(algo.hasKeyword("AtmName")) { - algorithm = QString(algo["AtmName"]); + algorithm = QString::fromStdString(algo["AtmName"]); } else if(algo.hasKeyword("Name")) { - algorithm = QString(algo["Name"]); + algorithm = QString::fromStdString(algo["Name"]); } else { - QString msg = "Keyword [Name] or keyword [AtmName] must "; + std::string msg = "Keyword [Name] or keyword [AtmName] must "; msg += "exist in [Group = Algorithm]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/AutoReg/AutoReg.cpp b/isis/src/base/objs/AutoReg/AutoReg.cpp index 3dc47a2cec..9072f142be 100644 --- a/isis/src/base/objs/AutoReg/AutoReg.cpp +++ b/isis/src/base/objs/AutoReg/AutoReg.cpp @@ -197,11 +197,11 @@ namespace Isis { PvlGroup &algo = pvl.findGroup("Algorithm", Pvl::Traverse); SetTolerance(algo["Tolerance"]); if(algo.hasKeyword("ChipInterpolator")) { - SetChipInterpolator((QString)algo["ChipInterpolator"]); + SetChipInterpolator(QString::fromStdString(algo["ChipInterpolator"])); } if(algo.hasKeyword("SubpixelAccuracy")) { - SetSubPixelAccuracy((QString)algo["SubpixelAccuracy"] == "True"); + SetSubPixelAccuracy(std::to_string((int)algo["SubpixelAccuracy"]) == "True"); } if(algo.hasKeyword("ReductionFactor")) { @@ -209,7 +209,7 @@ namespace Isis { } if (algo.hasKeyword("Gradient")) { - SetGradientFilterType((QString)algo["Gradient"]); + SetGradientFilterType(QString::fromStdString(algo["Gradient"])); } // Setup the pattern chip @@ -257,7 +257,7 @@ namespace Isis { } catch(IException &e) { - QString msg = "Improper format for AutoReg PVL [" + pvl.fileName() + "]"; + std::string msg = "Improper format for AutoReg PVL [" + pvl.fileName() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } return; @@ -1177,30 +1177,30 @@ namespace Isis { Pvl AutoReg::RegistrationStatistics() { Pvl pvl; PvlGroup stats("AutoRegStatistics"); - stats += Isis::PvlKeyword("Total", toString(p_totalRegistrations)); - stats += Isis::PvlKeyword("Successful", toString(p_pixelSuccesses + p_subpixelSuccesses)); - stats += Isis::PvlKeyword("Failure", toString(p_totalRegistrations - (p_pixelSuccesses + p_subpixelSuccesses))); + stats += Isis::PvlKeyword("Total", std::to_string(p_totalRegistrations)); + stats += Isis::PvlKeyword("Successful", std::to_string(p_pixelSuccesses + p_subpixelSuccesses)); + stats += Isis::PvlKeyword("Failure", std::to_string(p_totalRegistrations - (p_pixelSuccesses + p_subpixelSuccesses))); pvl.addGroup(stats); PvlGroup successes("Successes"); - successes += PvlKeyword("SuccessPixel", toString(p_pixelSuccesses)); - successes += PvlKeyword("SuccessSubPixel", toString(p_subpixelSuccesses)); + successes += PvlKeyword("SuccessPixel", std::to_string(p_pixelSuccesses)); + successes += PvlKeyword("SuccessSubPixel", std::to_string(p_subpixelSuccesses)); pvl.addGroup(successes); PvlGroup grp("PatternChipFailures"); - grp += PvlKeyword("PatternNotEnoughValidData", toString(p_patternChipNotEnoughValidDataCount)); - grp += PvlKeyword("PatternZScoreNotMet", toString(p_patternZScoreNotMetCount)); + grp += PvlKeyword("PatternNotEnoughValidData", std::to_string(p_patternChipNotEnoughValidDataCount)); + grp += PvlKeyword("PatternZScoreNotMet", std::to_string(p_patternZScoreNotMetCount)); pvl.addGroup(grp); PvlGroup fit("FitChipFailures"); - fit += PvlKeyword("FitChipNoData", toString(p_fitChipNoDataCount)); - fit += PvlKeyword("FitChipToleranceNotMet", toString(p_fitChipToleranceNotMetCount)); + fit += PvlKeyword("FitChipNoData", std::to_string(p_fitChipNoDataCount)); + fit += PvlKeyword("FitChipToleranceNotMet", std::to_string(p_fitChipToleranceNotMetCount)); pvl.addGroup(fit); PvlGroup model("SurfaceModelFailures"); - model += PvlKeyword("SurfaceModelNotEnoughValidData", toString(p_surfaceModelNotEnoughValidDataCount)); - model += PvlKeyword("SurfaceModelSolutionInvalid", toString(p_surfaceModelSolutionInvalidCount)); - model += PvlKeyword("SurfaceModelDistanceInvalid", toString(p_surfaceModelDistanceInvalidCount)); + model += PvlKeyword("SurfaceModelNotEnoughValidData", std::to_string(p_surfaceModelNotEnoughValidDataCount)); + model += PvlKeyword("SurfaceModelSolutionInvalid", std::to_string(p_surfaceModelSolutionInvalidCount)); + model += PvlKeyword("SurfaceModelDistanceInvalid", std::to_string(p_surfaceModelDistanceInvalidCount)); pvl.addGroup(model); return (AlgorithmStatistics(pvl)); @@ -1289,29 +1289,29 @@ namespace Isis { PvlGroup AutoReg::UpdatedTemplate() { PvlGroup reg("AutoRegistration"); - reg += PvlKeyword("Algorithm", AlgorithmName()); - reg += PvlKeyword("Tolerance", toString(Tolerance())); + reg += PvlKeyword("Algorithm", AlgorithmName().toStdString()); + reg += PvlKeyword("Tolerance", std::to_string(Tolerance())); reg += PvlKeyword("SubpixelAccuracy", SubPixelAccuracy() ? "True" : "False"); - reg += PvlKeyword("ReductionFactor", toString(ReductionFactor())); - reg += PvlKeyword("Gradient", GradientFilterString()); + reg += PvlKeyword("ReductionFactor", std::to_string(ReductionFactor())); + reg += PvlKeyword("Gradient", GradientFilterString().toStdString()); Chip *pattern = PatternChip(); - reg += PvlKeyword("PatternSamples", toString(pattern->Samples())); - reg += PvlKeyword("PatternLines", toString(pattern->Lines())); - reg += PvlKeyword("MinimumZScore", toString(MinimumZScore())); - reg += PvlKeyword("ValidPercent", toString(PatternValidPercent())); + reg += PvlKeyword("PatternSamples", std::to_string(pattern->Samples())); + reg += PvlKeyword("PatternLines", std::to_string(pattern->Lines())); + reg += PvlKeyword("MinimumZScore", std::to_string(MinimumZScore())); + reg += PvlKeyword("ValidPercent", std::to_string(PatternValidPercent())); // TODO Chip needs accessors to valid minimum and maximum Chip *search = SearchChip(); - reg += PvlKeyword("SearchSamples", toString(search->Samples())); - reg += PvlKeyword("SearchLines", toString(search->Lines())); - reg += PvlKeyword("SubchipValidPercent", toString(SubsearchValidPercent())); + reg += PvlKeyword("SearchSamples", std::to_string(search->Samples())); + reg += PvlKeyword("SearchLines", std::to_string(search->Lines())); + reg += PvlKeyword("SubchipValidPercent", std::to_string(SubsearchValidPercent())); // TODO Chip needs accessors to valid minimum and maximum if (SubPixelAccuracy()) { - reg += PvlKeyword("DistanceTolerance", toString(DistanceTolerance())); - reg += PvlKeyword("WindowSize", toString(WindowSize())); + reg += PvlKeyword("DistanceTolerance", std::to_string(DistanceTolerance())); + reg += PvlKeyword("WindowSize", std::to_string(WindowSize())); } return reg; diff --git a/isis/src/base/objs/AutoRegFactory/AutoRegFactory.cpp b/isis/src/base/objs/AutoRegFactory/AutoRegFactory.cpp index 43b409d8af..1840569d0a 100644 --- a/isis/src/base/objs/AutoRegFactory/AutoRegFactory.cpp +++ b/isis/src/base/objs/AutoRegFactory/AutoRegFactory.cpp @@ -45,7 +45,7 @@ namespace Isis { AutoReg *AutoRegFactory::Create(Pvl &pvl) { // Get the algorithm name to create PvlGroup &algo = pvl.findGroup("Algorithm", Pvl::Traverse); - QString algorithm = algo["Name"]; + QString algorithm = QString::fromStdString(algo["Name"]); // Open the factory plugin file Plugin p; diff --git a/isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp b/isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp index 96b50afec4..5f2f544071 100644 --- a/isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp +++ b/isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp @@ -93,10 +93,10 @@ namespace Isis { QString shapefile; if (kernels.hasKeyword("ElevationModel")) { - shapefile = (QString) kernels["ElevationModel"]; + shapefile = QString::fromStdString(kernels["ElevationModel"]); } else { // if (kernels.hasKeyword("ShapeModel")) { - shapefile = (QString) kernels["ShapeModel"]; + shapefile = QString::fromStdString(kernels["ShapeModel"]); } QScopedPointer v_shape( BulletTargetShape::load(shapefile) ); diff --git a/isis/src/base/objs/CSMCamera/CSMCamera.cpp b/isis/src/base/objs/CSMCamera/CSMCamera.cpp index 85af2e3927..4d423c81d6 100644 --- a/isis/src/base/objs/CSMCamera/CSMCamera.cpp +++ b/isis/src/base/objs/CSMCamera/CSMCamera.cpp @@ -63,9 +63,8 @@ void sanitize(std::string &input); Blob state("CSMState", "String"); cube.read(state); PvlObject &blobLabel = state.Label(); - - QString pluginName = blobLabel.findKeyword("PluginName")[0]; - QString modelName = blobLabel.findKeyword("ModelName")[0]; + QString pluginName = QString::fromStdString(blobLabel.findKeyword("PluginName")[0]); + QString modelName = QString::fromStdString(blobLabel.findKeyword("ModelName")[0]); QString stateString = QString::fromUtf8(state.getBuffer(), state.Size()); init(cube, pluginName, modelName, stateString); } diff --git a/isis/src/base/objs/Camera/Camera.cpp b/isis/src/base/objs/Camera/Camera.cpp index a771d1ba5a..571666afe3 100644 --- a/isis/src/base/objs/Camera/Camera.cpp +++ b/isis/src/base/objs/Camera/Camera.cpp @@ -55,8 +55,8 @@ namespace Isis { */ Camera::Camera(Cube &cube) : Sensor(cube) { - m_instrumentId = cube.label()->findGroup("Instrument", - PvlObject::FindOptions::Traverse).findKeyword("InstrumentId")[0]; + m_instrumentId = QString::fromStdString(cube.label()->findGroup("Instrument", + PvlObject::FindOptions::Traverse).findKeyword("InstrumentId")[0]); m_instrumentNameLong = "Unknown"; m_instrumentNameShort = "Unknown"; @@ -1206,16 +1206,16 @@ namespace Isis { PvlGroup map = pvl.findGroup("Mapping", Pvl::Traverse); if(map.hasKeyword("EquatorialRadius")) - a = Distance(toDouble(map["EquatorialRadius"][0]), Distance::Meters); + a = Distance(std::stod(map["EquatorialRadius"][0]), Distance::Meters); if(map.hasKeyword("PolarRadius")) - b = Distance(toDouble(map["PolarRadius"][0]), Distance::Meters); + b = Distance(std::stod(map["PolarRadius"][0]), Distance::Meters); // Convert to planetographic if necessary minlat = p_minlat; maxlat = p_maxlat; if(map.hasKeyword("LatitudeType")) { - QString latType = (QString) map["LatitudeType"]; + QString latType = QString::fromStdString(map["LatitudeType"]); if (latType.toUpper() == "PLANETOGRAPHIC") { if (abs(minlat) < 90.0) { // So tan doesn't fail minlat *= PI / 180.0; @@ -1236,7 +1236,7 @@ namespace Isis { maxlon = p_maxlon; bool domain360 = true; if(map.hasKeyword("LongitudeDomain")) { - QString lonDomain = (QString) map["LongitudeDomain"]; + QString lonDomain = QString::fromStdString(map["LongitudeDomain"]); if(lonDomain.toUpper() == "180") { minlon = p_minlon180; maxlon = p_maxlon180; @@ -1246,7 +1246,7 @@ namespace Isis { // Convert to the proper longitude direction if(map.hasKeyword("LongitudeDirection")) { - QString lonDirection = (QString) map["LongitudeDirection"]; + QString lonDirection = QString::fromStdString(map["LongitudeDirection"]); if(lonDirection.toUpper() == "POSITIVEWEST") { double swap = minlon; minlon = -maxlon; @@ -1311,7 +1311,7 @@ namespace Isis { maxRingLongitude = p_maxRingLongitude; bool domain360 = true; if (map.hasKeyword("RingLongitudeDomain")) { - QString ringLongitudeDomain = (QString) map["RingLongitudeDomain"]; + QString ringLongitudeDomain = QString::fromStdString(map["RingLongitudeDomain"]); if (ringLongitudeDomain == "180") { minRingLongitude = p_minRingLongitude180; maxRingLongitude = p_maxRingLongitude180; @@ -1321,7 +1321,7 @@ namespace Isis { // Convert to the proper azimuth direction if (map.hasKeyword("RingLongitudeDirection")) { - QString ringLongitudeDirection = (QString) map["RingLongitudeDirection"]; + QString ringLongitudeDirection = QString::fromStdString(map["RingLongitudeDirection"]); if (ringLongitudeDirection.toUpper() == "Clockwise") { double swap = minRingLongitude; minRingLongitude = -maxRingLongitude; @@ -1366,22 +1366,22 @@ namespace Isis { */ void Camera::BasicMapping(Pvl &pvl) { PvlGroup map("Mapping"); - map += PvlKeyword("TargetName", target()->name()); + map += PvlKeyword("TargetName", target()->name().toStdString()); std::vector radii = target()->radii(); - map += PvlKeyword("EquatorialRadius", toString(radii[0].meters()), "meters"); - map += PvlKeyword("PolarRadius", toString(radii[2].meters()), "meters"); + map += PvlKeyword("EquatorialRadius", std::to_string(radii[0].meters()), "meters"); + map += PvlKeyword("PolarRadius", std::to_string(radii[2].meters()), "meters"); map += PvlKeyword("LatitudeType", "Planetocentric"); map += PvlKeyword("LongitudeDirection", "PositiveEast"); map += PvlKeyword("LongitudeDomain", "360"); GroundRangeResolution(); - map += PvlKeyword("MinimumLatitude", toString(p_minlat)); - map += PvlKeyword("MaximumLatitude", toString(p_maxlat)); - map += PvlKeyword("MinimumLongitude", toString(p_minlon)); - map += PvlKeyword("MaximumLongitude", toString(p_maxlon)); - map += PvlKeyword("PixelResolution", toString(p_minres)); + map += PvlKeyword("MinimumLatitude", std::to_string(p_minlat)); + map += PvlKeyword("MaximumLatitude", std::to_string(p_maxlat)); + map += PvlKeyword("MinimumLongitude", std::to_string(p_minlon)); + map += PvlKeyword("MaximumLongitude", std::to_string(p_maxlon)); + map += PvlKeyword("PixelResolution", std::to_string(p_minres)); map += PvlKeyword("ProjectionName", "Sinusoidal"); pvl.addGroup(map); @@ -1402,17 +1402,17 @@ namespace Isis { } PvlGroup map("Mapping"); - map += PvlKeyword("TargetName", target()->name()); + map += PvlKeyword("TargetName", target()->name().toStdString()); map += PvlKeyword("RingLongitudeDirection", "CounterClockwise"); map += PvlKeyword("RingLongitudeDomain", "360"); ringRangeResolution(); - map += PvlKeyword("MinimumRingRadius", toString(p_minRingRadius)); - map += PvlKeyword("MaximumRingRadius", toString(p_maxRingRadius)); - map += PvlKeyword("MinimumRingLongitude", toString(p_minRingLongitude)); - map += PvlKeyword("MaximumRingLongitude", toString(p_maxRingLongitude)); - map += PvlKeyword("PixelResolution", toString(p_minres)); + map += PvlKeyword("MinimumRingRadius", std::to_string(p_minRingRadius)); + map += PvlKeyword("MaximumRingRadius", std::to_string(p_maxRingRadius)); + map += PvlKeyword("MinimumRingLongitude", std::to_string(p_minRingLongitude)); + map += PvlKeyword("MaximumRingLongitude", std::to_string(p_maxRingLongitude)); + map += PvlKeyword("PixelResolution", std::to_string(p_minres)); map += PvlKeyword("ProjectionName", "Planar"); pvl.addGroup(map); diff --git a/isis/src/base/objs/CameraFactory/CameraFactory.cpp b/isis/src/base/objs/CameraFactory/CameraFactory.cpp index e32b7a1d48..e32f1eed07 100644 --- a/isis/src/base/objs/CameraFactory/CameraFactory.cpp +++ b/isis/src/base/objs/CameraFactory/CameraFactory.cpp @@ -64,8 +64,8 @@ namespace Isis { // First get the spacecraft and instrument and combine them Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Isis::Pvl::Traverse); - QString spacecraft = (QString) inst["SpacecraftName"]; - QString name = (QString) inst["InstrumentId"]; + QString spacecraft = QString::fromStdString(inst["SpacecraftName"]); + QString name = QString::fromStdString(inst["InstrumentId"]); spacecraft = spacecraft.toUpper(); name = name.toUpper(); QString group = spacecraft + "/" + name; @@ -124,11 +124,11 @@ namespace Isis { if (m_cameraPlugin.fileName() == "") { FileName localFile("Camera.plugin"); if (localFile.fileExists()) - m_cameraPlugin.read(localFile.expanded()); + m_cameraPlugin.read(localFile.expanded().toStdString()); FileName systemFile("$ISISROOT/lib/Camera.plugin"); if (systemFile.fileExists()) - m_cameraPlugin.read(systemFile.expanded()); + m_cameraPlugin.read(systemFile.expanded().toStdString()); } // Find the CSM plugins by searching the directories identified in the Preferences. @@ -137,7 +137,7 @@ namespace Isis { Preference &p = Preference::Preferences(); PvlGroup &grp = p.findGroup("Plugins", Isis::Pvl::Traverse); for (int i = 0; i= 0; i--) { - if (m_cameraPlugin.group(i) == group) { + if (m_cameraPlugin.group(i) == group.toStdString()) { plugin = m_cameraPlugin.group(i); found = true; break; diff --git a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp index 50722247a8..12f1904726 100644 --- a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp +++ b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp @@ -350,7 +350,7 @@ namespace Isis { if (!noErrors) { for (int i = 0; i < gp->keywords(); i++) { - QString name = (*gp)[i].name(); + QString name = QString::fromStdString((*gp)[i].name()); // These three keywords have 3 values, so they must have 3 NULLs if (name == "BodyFixedCoordinate" || name == "SpacecraftPosition" || name == "SunPosition") { @@ -414,15 +414,15 @@ namespace Isis { } // Set all keywords that still have valid information - gp->findKeyword("Error").setValue(error); - gp->findKeyword("FileName").setValue(m_currentCube->fileName()); - gp->findKeyword("Sample").setValue(toString(m_camera->Sample())); - gp->findKeyword("Line").setValue(toString(m_camera->Line())); + gp->findKeyword("Error").setValue(error.toStdString()); + gp->findKeyword("FileName").setValue(m_currentCube->fileName().toStdString()); + gp->findKeyword("Sample").setValue(std::to_string(m_camera->Sample())); + gp->findKeyword("Line").setValue(std::to_string(m_camera->Line())); gp->findKeyword("EphemerisTime").setValue( - toString(m_camera->time().Et()), "seconds"); + std::to_string(m_camera->time().Et()), "seconds"); gp->findKeyword("EphemerisTime").addComment("Time"); QString utc = m_camera->time().UTC(); - gp->findKeyword("UTC").setValue(utc); + gp->findKeyword("UTC").setValue(utc.toStdString()); gp->findKeyword("SpacecraftPosition").addComment("Spacecraft Information"); gp->findKeyword("SunPosition").addComment("Sun Information"); gp->findKeyword("Phase").addComment("Illumination and Other"); @@ -441,26 +441,26 @@ namespace Isis { double ssplat, ssplon, ocentricLat, ographicLat, pe360Lon, pw360Lon; { - gp->findKeyword("FileName").setValue(m_currentCube->fileName()); - gp->findKeyword("Sample").setValue(toString(m_camera->Sample())); - gp->findKeyword("Line").setValue(toString(m_camera->Line())); - gp->findKeyword("PixelValue").setValue(PixelToString(b[0])); + gp->findKeyword("FileName").setValue(m_currentCube->fileName().toStdString()); + gp->findKeyword("Sample").setValue(std::to_string(m_camera->Sample())); + gp->findKeyword("Line").setValue(std::to_string(m_camera->Line())); + gp->findKeyword("PixelValue").setValue(PixelToString(b[0]).toStdString()); try { - gp->findKeyword("RightAscension").setValue(toString( + gp->findKeyword("RightAscension").setValue(std::to_string( m_camera->RightAscension()), "DEGREE"); } catch (IException &e) { gp->findKeyword("RightAscension").setValue("Null"); } try { - gp->findKeyword("Declination").setValue(toString( + gp->findKeyword("Declination").setValue(std::to_string( m_camera->Declination()), "DEGREE"); } catch (IException &e) { gp->findKeyword("Declination").setValue("Null"); } ocentricLat = m_camera->UniversalLatitude(); - gp->findKeyword("PlanetocentricLatitude").setValue(toString(ocentricLat), "DEGREE"); + gp->findKeyword("PlanetocentricLatitude").setValue(std::to_string(ocentricLat), "DEGREE"); // Convert lat to planetographic Distance radii[3]; @@ -468,82 +468,82 @@ namespace Isis { ographicLat = TProjection::ToPlanetographic(ocentricLat, radii[0].kilometers(), radii[2].kilometers()); - gp->findKeyword("PlanetographicLatitude").setValue(toString(ographicLat), "DEGREE"); + gp->findKeyword("PlanetographicLatitude").setValue(std::to_string(ographicLat), "DEGREE"); pe360Lon = m_camera->UniversalLongitude(); - gp->findKeyword("PositiveEast360Longitude").setValue(toString(pe360Lon), "DEGREE"); + gp->findKeyword("PositiveEast360Longitude").setValue(std::to_string(pe360Lon), "DEGREE"); //Convert lon to -180 - 180 range - gp->findKeyword("PositiveEast180Longitude").setValue(toString( + gp->findKeyword("PositiveEast180Longitude").setValue(std::to_string( TProjection::To180Domain(pe360Lon)), "DEGREE"); //Convert lon to positive west pw360Lon = TProjection::ToPositiveWest(pe360Lon, 360); - gp->findKeyword("PositiveWest360Longitude").setValue(toString(pw360Lon), "DEGREE"); + gp->findKeyword("PositiveWest360Longitude").setValue(std::to_string(pw360Lon), "DEGREE"); //Convert pwlon to -180 - 180 range gp->findKeyword("PositiveWest180Longitude").setValue( - toString( TProjection::To180Domain(pw360Lon)), "DEGREE"); + std::to_string( TProjection::To180Domain(pw360Lon)), "DEGREE"); m_camera->Coordinate(pB); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[0]), "km"); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[1]), "km"); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[2]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(std::to_string(pB[0]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(std::to_string(pB[1]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(std::to_string(pB[2]), "km"); - gp->findKeyword("LocalRadius").setValue(toString( + gp->findKeyword("LocalRadius").setValue(std::to_string( m_camera->LocalRadius().meters()), "meters"); - gp->findKeyword("SampleResolution").setValue(toString( + gp->findKeyword("SampleResolution").setValue(std::to_string( m_camera->SampleResolution()), "meters/pixel"); - gp->findKeyword("LineResolution").setValue(toString( + gp->findKeyword("LineResolution").setValue(std::to_string( m_camera->LineResolution()), "meters/pixel"); gp->findKeyword("ObliqueDetectorResolution").setValue( - toString(m_camera->ObliqueDetectorResolution()),"meters"); + std::to_string(m_camera->ObliqueDetectorResolution()),"meters"); gp->findKeyword("ObliqueLineResolution").setValue( - toString(m_camera->ObliqueLineResolution()),"meters"); + std::to_string(m_camera->ObliqueLineResolution()),"meters"); gp->findKeyword("ObliqueSampleResolution").setValue( - toString(m_camera->ObliqueSampleResolution()),"meters"); + std::to_string(m_camera->ObliqueSampleResolution()),"meters"); gp->findKeyword("ObliquePixelResolution").setValue( - toString(m_camera->ObliquePixelResolution()), "meters/pix"); + std::to_string(m_camera->ObliquePixelResolution()), "meters/pix"); //body fixed m_camera->instrumentPosition(spB); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[1]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[2]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[0]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[1]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[2]), "km"); gp->findKeyword("SpacecraftPosition").addComment("Spacecraft Information"); double spacecraftAzi = m_camera->SpacecraftAzimuth(); if (Isis::IsValidPixel(spacecraftAzi)) { - gp->findKeyword("SpacecraftAzimuth").setValue(toString(spacecraftAzi), "DEGREE"); + gp->findKeyword("SpacecraftAzimuth").setValue(std::to_string(spacecraftAzi), "DEGREE"); } else { gp->findKeyword("SpacecraftAzimuth").setValue("NULL"); } - gp->findKeyword("SlantDistance").setValue(toString( + gp->findKeyword("SlantDistance").setValue(std::to_string( m_camera->SlantDistance()), "km"); - gp->findKeyword("TargetCenterDistance").setValue(toString( + gp->findKeyword("TargetCenterDistance").setValue(std::to_string( m_camera->targetCenterDistance()), "km"); m_camera->subSpacecraftPoint(ssplat, ssplon); - gp->findKeyword("SubSpacecraftLatitude").setValue(toString(ssplat), "DEGREE"); - gp->findKeyword("SubSpacecraftLongitude").setValue(toString(ssplon), "DEGREE"); - gp->findKeyword("SpacecraftAltitude").setValue(toString( + gp->findKeyword("SubSpacecraftLatitude").setValue(std::to_string(ssplat), "DEGREE"); + gp->findKeyword("SubSpacecraftLongitude").setValue(std::to_string(ssplon), "DEGREE"); + gp->findKeyword("SpacecraftAltitude").setValue(std::to_string( m_camera->SpacecraftAltitude()), "km"); - gp->findKeyword("OffNadirAngle").setValue(toString( + gp->findKeyword("OffNadirAngle").setValue(std::to_string( m_camera->OffNadirAngle()), "DEGREE"); double subspcgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(), m_camera->UniversalLongitude(), ssplat, ssplon); gp->findKeyword("SubSpacecraftGroundAzimuth").setValue( - toString(subspcgrdaz), "DEGREE"); + std::to_string(subspcgrdaz), "DEGREE"); try { m_camera->sunPosition(sB); - gp->findKeyword("SunPosition").addValue(toString(sB[0]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[1]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[2]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[0]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[1]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[2]), "km"); gp->findKeyword("SunPosition").addComment("Sun Information"); } catch (IException &e) { @@ -556,7 +556,7 @@ namespace Isis { try { double sunAzi = m_camera->SunAzimuth(); if (Isis::IsValidPixel(sunAzi)) { - gp->findKeyword("SubSolarAzimuth").setValue(toString(sunAzi), "DEGREE"); + gp->findKeyword("SubSolarAzimuth").setValue(std::to_string(sunAzi), "DEGREE"); } else { gp->findKeyword("SubSolarAzimuth").setValue("NULL"); @@ -567,7 +567,7 @@ namespace Isis { } try { - gp->findKeyword("SolarDistance").setValue(toString( + gp->findKeyword("SolarDistance").setValue(std::to_string( m_camera->SolarDistance()), "AU"); } catch(IException &e) { @@ -576,14 +576,14 @@ namespace Isis { try { double sslat, sslon; m_camera->subSolarPoint(sslat, sslon); - gp->findKeyword("SubSolarLatitude").setValue(toString(sslat), "DEGREE"); - gp->findKeyword("SubSolarLongitude").setValue(toString(sslon), "DEGREE"); + gp->findKeyword("SubSolarLatitude").setValue(std::to_string(sslat), "DEGREE"); + gp->findKeyword("SubSolarLongitude").setValue(std::to_string(sslon), "DEGREE"); try { double subsolgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(), m_camera->UniversalLongitude(), sslat, sslon); - gp->findKeyword("SubSolarGroundAzimuth").setValue(toString(subsolgrdaz), "DEGREE"); + gp->findKeyword("SubSolarGroundAzimuth").setValue(std::to_string(subsolgrdaz), "DEGREE"); } catch(IException &e) { gp->findKeyword("SubSolarGroundAzimuth").setValue("NULL"); @@ -595,35 +595,35 @@ namespace Isis { gp->findKeyword("SubSolarGroundAzimuth").setValue("NULL"); } - gp->findKeyword("Phase").setValue(toString(m_camera->PhaseAngle()), "DEGREE"); + gp->findKeyword("Phase").setValue(std::to_string(m_camera->PhaseAngle()), "DEGREE"); gp->findKeyword("Phase").addComment("Illumination and Other"); - gp->findKeyword("Incidence").setValue(toString( + gp->findKeyword("Incidence").setValue(std::to_string( m_camera->IncidenceAngle()), "DEGREE"); - gp->findKeyword("Emission").setValue(toString( + gp->findKeyword("Emission").setValue(std::to_string( m_camera->EmissionAngle()), "DEGREE"); double northAzi = m_camera->NorthAzimuth(); if (Isis::IsValidPixel(northAzi)) { - gp->findKeyword("NorthAzimuth").setValue(toString(northAzi), "DEGREE"); + gp->findKeyword("NorthAzimuth").setValue(std::to_string(northAzi), "DEGREE"); } else { gp->findKeyword("NorthAzimuth").setValue("NULL"); } - gp->findKeyword("EphemerisTime").setValue(toString( + gp->findKeyword("EphemerisTime").setValue(std::to_string( m_camera->time().Et()), "seconds"); gp->findKeyword("EphemerisTime").addComment("Time"); utc = m_camera->time().UTC(); - gp->findKeyword("UTC").setValue(utc); + gp->findKeyword("UTC").setValue(utc.toStdString()); try { - gp->findKeyword("LocalSolarTime").setValue(toString( + gp->findKeyword("LocalSolarTime").setValue(std::to_string( m_camera->LocalSolarTime()), "hour"); } catch (IException &e) { gp->findKeyword("LocalSolarTime").setValue("Null"); } try { - gp->findKeyword("SolarLongitude").setValue(toString( + gp->findKeyword("SolarLongitude").setValue(std::to_string( m_camera->solarLongitude().degrees()), "DEGREE"); } catch (IException &e) { @@ -631,16 +631,16 @@ namespace Isis { } std::vectorlookB = m_camera->lookDirectionBodyFixed(); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[0]), "DEGREE"); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[1]), "DEGREE"); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[2]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(std::to_string(lookB[0]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(std::to_string(lookB[1]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(std::to_string(lookB[2]), "DEGREE"); gp->findKeyword("LookDirectionBodyFixed").addComment("Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems."); try { std::vectorlookJ = m_camera->lookDirectionJ2000(); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[0]), "DEGREE"); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[1]), "DEGREE"); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[2]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(std::to_string(lookJ[0]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(std::to_string(lookJ[1]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(std::to_string(lookJ[2]), "DEGREE"); } catch (IException &e) { gp->findKeyword("LookDirectionJ2000").addValue("Null"); @@ -651,9 +651,9 @@ namespace Isis { try { double lookC[3]; m_camera->LookDirection(lookC); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[0]), "DEGREE"); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[1]), "DEGREE"); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[2]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(std::to_string(lookC[0]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(std::to_string(lookC[1]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(std::to_string(lookC[2]), "DEGREE"); } catch (IException &e) { gp->findKeyword("LookDirectionCamera").addValue("Null"); diff --git a/isis/src/base/objs/CameraPointInfo/unitTest.cpp b/isis/src/base/objs/CameraPointInfo/unitTest.cpp index f67e0f9293..dd2bf33be0 100644 --- a/isis/src/base/objs/CameraPointInfo/unitTest.cpp +++ b/isis/src/base/objs/CameraPointInfo/unitTest.cpp @@ -47,13 +47,13 @@ void LowerPrecision(PvlKeyword &keyword) { if (keyword.name() != "LookDirectionCamera") { double value = toDouble(keyword[0]); value = round(value * 1000) / 1000.0; - keyword[0] = toString(value); + keyword[0] = std::to_string(value); } else { for (int i = 0; i < 3; i++) { double value = toDouble(keyword[i]); value = round(value * 10000000000) / 10000000000.0; - keyword[i] = toString(value); + keyword[i] = std::to_string(value); } } } diff --git a/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp b/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp index 2bd57e9c7d..5dd3c0b84c 100644 --- a/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp +++ b/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp @@ -281,10 +281,10 @@ namespace Isis { double value, QString unit="") const { if(IsSpecial(value)) { - return (PvlKeyword(keyname, "NULL")); + return (PvlKeyword(keyname.toStdString(), "NULL")); } else { - return (PvlKeyword(keyname, toString(value), unit)); + return (PvlKeyword(keyname.toStdString(), std::to_string(value), unit.toStdString())); } } diff --git a/isis/src/base/objs/Cube/Cube.cpp b/isis/src/base/objs/Cube/Cube.cpp index c4206bf0c1..87ab15181c 100644 --- a/isis/src/base/objs/Cube/Cube.cpp +++ b/isis/src/base/objs/Cube/Cube.cpp @@ -349,7 +349,7 @@ namespace Isis { PvlObject &obj = m_label->object(i); if (obj.isNamed("Table") || obj.isNamed("Polygon") || obj.isNamed("OriginalLabel") || obj.isNamed("History")) { - Isis::Blob t((QString)obj["Name"], obj.name()); + Isis::Blob t(QString::fromStdString(obj["Name"]), obj.name()); read(t); result->write(t); } @@ -475,14 +475,14 @@ namespace Isis { // See if we have attached or detached labels if (m_attached) { // StartByte is 1-based (why!!) so we need to do + 1 - core += PvlKeyword("StartByte", toString(m_labelBytes + 1)); + core += PvlKeyword("StartByte", std::to_string(m_labelBytes + 1)); m_labelFileName = new FileName(cubFile); m_dataFileName = new FileName(cubFile); m_labelFile = new QFile(m_labelFileName->expanded()); } else { - core += PvlKeyword("StartByte", toString(1)); - core += PvlKeyword("^Core", cubFile.name()); + core += PvlKeyword("StartByte", std::to_string(1)); + core += PvlKeyword("^Core", cubFile.name().toStdString()); m_dataFileName = new FileName(cubFile); m_dataFile = new QFile(realDataFileName().expanded()); @@ -494,25 +494,25 @@ namespace Isis { // Create the size of the core PvlGroup dims("Dimensions"); - dims += PvlKeyword("Samples", toString(m_samples)); - dims += PvlKeyword("Lines", toString(m_lines)); - dims += PvlKeyword("Bands", toString(m_bands)); + dims += PvlKeyword("Samples", std::to_string(m_samples)); + dims += PvlKeyword("Lines", std::to_string(m_lines)); + dims += PvlKeyword("Bands", std::to_string(m_bands)); core.addGroup(dims); // Create the pixel type PvlGroup ptype("Pixels"); - ptype += PvlKeyword("Type", PixelTypeName(m_pixelType)); + ptype += PvlKeyword("Type", PixelTypeName(m_pixelType).toStdString()); // And the byte ordering - ptype += PvlKeyword("ByteOrder", ByteOrderName(m_byteOrder)); - ptype += PvlKeyword("Base", toString(m_base)); - ptype += PvlKeyword("Multiplier", toString(m_multiplier)); + ptype += PvlKeyword("ByteOrder", ByteOrderName(m_byteOrder).toStdString()); + ptype += PvlKeyword("Base", std::to_string(m_base)); + ptype += PvlKeyword("Multiplier", std::to_string(m_multiplier)); core.addGroup(ptype); } else { cubFile = cubFile.addExtension("ecub"); - core += PvlKeyword("^DnFile", m_dataFileName->original()); + core += PvlKeyword("^DnFile", m_dataFileName->original().toStdString()); // m_dataFileName = new FileName(cubFile); m_dataFile = new QFile(realDataFileName().expanded()); @@ -527,12 +527,12 @@ namespace Isis { // Setup storage reserved for the label PvlObject lbl("Label"); - lbl += PvlKeyword("Bytes", toString(m_labelBytes)); + lbl += PvlKeyword("Bytes", std::to_string(m_labelBytes)); m_label->addObject(lbl); const PvlGroup &pref = Preference::Preferences().findGroup("CubeCustomization"); - bool overwrite = pref["Overwrite"][0].toUpper() == "ALLOW"; + bool overwrite = QString::fromStdString(pref["Overwrite"][0]).toUpper() == "ALLOW"; if (!overwrite && m_labelFile->exists() && m_labelFile->size()) { QString msg = "Cube file [" + m_labelFileName->original() + "] exists, " + "user preference does not allow overwrite"; @@ -652,7 +652,7 @@ namespace Isis { PvlObject &core = m_label->findObject("IsisCube").findObject("Core"); // Detached labels if (core.hasKeyword("^Core")) { - FileName temp(core["^Core"][0]); + FileName temp(QString::fromStdString(core["^Core"][0])); if (!temp.originalPath().startsWith("/")) { m_dataFileName = new FileName(m_labelFileName->path() + "/" + temp.original()); @@ -668,7 +668,7 @@ namespace Isis { } // External cube files (ecub), ecub contains all labels and SPICE blobs, history else if (core.hasKeyword("^DnFile")) { - FileName dataFileName(core["^DnFile"][0]); + FileName dataFileName(QString::fromStdString(core["^DnFile"][0])); if (dataFileName.originalPath() == ".") { m_dataFileName = new FileName(m_labelFileName->path() + "/" + dataFileName.name()); @@ -754,7 +754,7 @@ namespace Isis { QPair dataLabel = qMakePair(false, m_label); if (!m_storesDnData) { - dataLabel = qMakePair(true, new Pvl(m_dataFileName->expanded())); + dataLabel = qMakePair(true, new Pvl(m_dataFileName->expanded().toStdString())); } // Now examine the format to see which type of handler to create @@ -1025,7 +1025,7 @@ namespace Isis { else { FileName blobFileName = fileName(); blobFileName = blobFileName.removeExtension(); - blobFileName = blobFileName.addExtension(blob.Type()); + blobFileName = blobFileName.addExtension(QString::fromStdString(blob.Type())); blobFileName = blobFileName.addExtension(blob.Name()); QString blobFile(blobFileName.expanded()); ios::openmode flags = ios::in | ios::binary | ios::out | ios::trunc; @@ -1395,7 +1395,7 @@ namespace Isis { } m_label->findObject("IsisCube").findObject("Core").findKeyword("^DnFile")[0] = - dnDataFile.original(); + dnDataFile.original().toStdString(); reopen(m_labelFile->isWritable()? "rw" : "r"); } @@ -1506,7 +1506,7 @@ namespace Isis { bodyTable.Label()["Kernels"].addValue(pckKeyword[i]); bodyTable.Label() += PvlKeyword("SolarLongitude", - toString(spice.solarLongitude().degrees())); + std::to_string(spice.solarLongitude().degrees())); this->write(bodyTable); Table sunTable = spice.sunPosition()->Cache("SunPosition"); @@ -1583,7 +1583,7 @@ namespace Isis { PvlObject &core = m_label->findObject("IsisCube").findObject("Core"); - return core["^DnFile"][0]; + return QString::fromStdString(core["^DnFile"][0]); } @@ -1809,7 +1809,7 @@ namespace Isis { if (m_virtualBandList) { if ((virtualBand < 1) || (virtualBand > m_virtualBandList->size())) { - QString msg = "Out of array bounds [" + toString(virtualBand) + "]"; + std::string msg = "Out of array bounds [" + std::to_string(virtualBand) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } physicalBand = m_virtualBandList->at(virtualBand - 1); @@ -1988,8 +1988,8 @@ namespace Isis { bool Cube::deleteBlob(QString BlobName, QString BlobType) { for(int i = 0; i < m_label->objects(); i++) { PvlObject obj = m_label->object(i); - if (obj.name().compare(BlobType) == 0) { - if (obj.findKeyword("Name")[0] == BlobName) { + if (QString::fromStdString(obj.name()).compare(BlobType) == 0) { + if (obj.findKeyword("Name")[0] == BlobName.toStdString()) { m_label->deleteObject(i); return true; } @@ -2009,8 +2009,8 @@ namespace Isis { */ void Cube::deleteGroup(const QString &group) { PvlObject &isiscube = label()->findObject("IsisCube"); - if (!isiscube.hasGroup(group)) return; - isiscube.deleteGroup(group); + if (!isiscube.hasGroup(group.toStdString())) return; + isiscube.deleteGroup(group.toStdString()); } @@ -2023,7 +2023,7 @@ namespace Isis { */ PvlGroup &Cube::group(const QString &group) const { PvlObject &isiscube = label()->findObject("IsisCube"); - return isiscube.findGroup(group); + return isiscube.findGroup(group.toStdString()); } @@ -2036,7 +2036,7 @@ namespace Isis { */ bool Cube::hasGroup(const QString &group) const { const PvlObject &isiscube = label()->findObject("IsisCube"); - if (isiscube.hasGroup(group)) return true; + if (isiscube.hasGroup(group.toStdString())) return true; return false; } @@ -2052,9 +2052,9 @@ namespace Isis { bool Cube::hasBlob(const QString &name, const QString &type) { for(int o = 0; o < label()->objects(); o++) { PvlObject &obj = label()->object(o); - if (obj.isNamed(type)) { + if (obj.isNamed(type.toStdString())) { if (obj.hasKeyword("Name")) { - QString temp = (QString) obj["Name"]; + QString temp = QString::fromStdString(obj["Name"]); temp = temp.toUpper(); QString temp2 = name; temp2 = temp2.toUpper(); @@ -2127,7 +2127,7 @@ namespace Isis { } // Change the number of bands in the labels of the cube - if (m_virtualBandList && core.hasGroup("Dimensions")) core.findGroup("Dimensions")["Bands"] = toString(m_virtualBandList->size()); + if (m_virtualBandList && core.hasGroup("Dimensions")) core.findGroup("Dimensions")["Bands"] = std::to_string(m_virtualBandList->size()); } @@ -2255,20 +2255,20 @@ namespace Isis { guess = dir2.absolutePath() + "/" + guess.name(); } do { - Pvl guessLabel(guess.expanded()); + Pvl guessLabel(guess.expanded().toStdString()); PvlObject &core = guessLabel.findObject("IsisCube").findObject("Core"); if (core.hasKeyword("^DnFile")) { FileName currentGuess = guess; - guess = core["^DnFile"][0]; + guess = QString::fromStdString(core["^DnFile"][0]); if (!guess.path().startsWith("/")) { guess = currentGuess.path() + "/" + guess.original(); } } else if (core.hasKeyword("^Core")) { - result = core["^Core"][0]; + result = QString::fromStdString(core["^Core"][0]); } else { result = guess; @@ -2329,13 +2329,13 @@ namespace Isis { // Stored pixel information const PvlGroup &pixelsGroup = core.findGroup("Pixels"); - m_byteOrder = ByteOrderEnumeration(pixelsGroup["ByteOrder"]); + m_byteOrder = ByteOrderEnumeration(QString::fromStdString(pixelsGroup["ByteOrder"])); m_base = pixelsGroup["Base"]; m_multiplier = pixelsGroup["Multiplier"]; - m_pixelType = PixelTypeEnumeration(pixelsGroup["Type"]); + m_pixelType = PixelTypeEnumeration(QString::fromStdString(pixelsGroup["Type"])); // Now examine the format to see which type of handler to create - if ((QString) core["Format"] == "BandSequential") { + if ((std::string)core["Format"] == "BandSequential") { m_format = Bsq; } else { @@ -2343,12 +2343,12 @@ namespace Isis { } } else { - FileName temp(core["^DnFile"][0]); + FileName temp(QString::fromStdString(core["^DnFile"][0])); if (!temp.expanded().startsWith("/")) { temp = FileName(m_labelFileName->path() + "/" + temp.original()); } - initCoreFromLabel(Pvl(temp.toString())); + initCoreFromLabel(Pvl(temp.toString().toStdString())); } } @@ -2365,7 +2365,7 @@ namespace Isis { try { if (labelFileName.fileExists()) { - m_label = new Pvl(labelFileName.expanded()); + m_label = new Pvl(labelFileName.expanded().toStdString()); if (!m_label->objects()) { throw IException(); } @@ -2383,7 +2383,7 @@ namespace Isis { FileName tmp(labelFileName); tmp = tmp.addExtension("cub"); if (tmp.fileExists()) { - m_label = new Pvl(tmp.expanded()); + m_label = new Pvl(tmp.expanded().toStdString()); if (!m_label->objects()) { throw IException(); } @@ -2403,7 +2403,7 @@ namespace Isis { FileName tmp(labelFileName); tmp = tmp.setExtension("lbl"); if (tmp.fileExists()) { - m_label = new Pvl(tmp.expanded()); + m_label = new Pvl(tmp.expanded().toStdString()); if (!m_label->objects()) { throw IException(); } @@ -2423,7 +2423,7 @@ namespace Isis { FileName tmp(labelFileName); tmp = tmp.addExtension("ecub"); if (tmp.fileExists()) { - m_label = new Pvl(tmp.expanded()); + m_label = new Pvl(tmp.expanded().toStdString()); if (!m_label->objects()) { throw IException(); } @@ -2489,12 +2489,12 @@ namespace Isis { if (core->hasKeyword("^DnFile")) { - FileName temp((*core)["^DnFile"][0]); + FileName temp(QString::fromStdString((*core)["^DnFile"][0])); if (!temp.expanded().startsWith("/")) { temp = realDataFileName(); } - label = Pvl(temp.toString()); + label = Pvl(temp.toString().toStdString()); core = NULL; } } @@ -2526,7 +2526,7 @@ namespace Isis { } m_tempCube = new FileName(tempCube); - *m_label = Pvl(m_tempCube->toString()); + *m_label = Pvl(m_tempCube->toString().toStdString()); m_labelFile = new QFile(m_tempCube->expanded()); } @@ -2634,7 +2634,7 @@ namespace Isis { } // Set the pvl's format template - m_label->setFormatTemplate(m_formatTemplateFile->original()); + m_label->setFormatTemplate(m_formatTemplateFile->original().toStdString()); // Write them with attached data if (m_attached) { @@ -2664,7 +2664,7 @@ namespace Isis { // or detached label else { - m_label->write(m_labelFileName->expanded()); + m_label->write(m_labelFileName->expanded().toStdString()); } } } diff --git a/isis/src/base/objs/Cube/CubeIoHandler.cpp b/isis/src/base/objs/Cube/CubeIoHandler.cpp index f94d075553..1e813464a2 100644 --- a/isis/src/base/objs/Cube/CubeIoHandler.cpp +++ b/isis/src/base/objs/Cube/CubeIoHandler.cpp @@ -105,12 +105,12 @@ namespace Isis { const PvlObject &core = label.findObject("IsisCube").findObject("Core"); const PvlGroup &pixelGroup = core.findGroup("Pixels"); - QString byteOrderStr = pixelGroup.findKeyword("ByteOrder")[0]; + QString byteOrderStr = QString::fromStdString(pixelGroup.findKeyword("ByteOrder")[0]); m_byteSwapper = new EndianSwapper( byteOrderStr.toUpper()); m_base = pixelGroup.findKeyword("Base"); m_multiplier = pixelGroup.findKeyword("Multiplier"); - m_pixelType = PixelTypeEnumeration(pixelGroup.findKeyword("Type")); + m_pixelType = PixelTypeEnumeration(QString::fromStdString(pixelGroup.findKeyword("Type"))); // If the byte swapper isn't going to do anything, then get rid of it // because it's quicker to check for a NULL byte swapper member than to diff --git a/isis/src/base/objs/Cube/CubeTileHandler.cpp b/isis/src/base/objs/Cube/CubeTileHandler.cpp index d01d7d422b..0cbe2a1611 100644 --- a/isis/src/base/objs/Cube/CubeTileHandler.cpp +++ b/isis/src/base/objs/Cube/CubeTileHandler.cpp @@ -67,9 +67,9 @@ namespace Isis { PvlObject &core = labels.findObject("IsisCube").findObject("Core"); core.addKeyword(PvlKeyword("Format", "Tile"), PvlContainer::Replace); - core.addKeyword(PvlKeyword("TileSamples", toString(getSampleCountInChunk())), + core.addKeyword(PvlKeyword("TileSamples", std::to_string(getSampleCountInChunk())), PvlContainer::Replace); - core.addKeyword(PvlKeyword("TileLines", toString(getLineCountInChunk())), + core.addKeyword(PvlKeyword("TileLines", std::to_string(getLineCountInChunk())), PvlContainer::Replace); } diff --git a/isis/src/base/objs/CubeStretch/CubeStretch.cpp b/isis/src/base/objs/CubeStretch/CubeStretch.cpp index a85b6eae1b..534dcc6b7b 100644 --- a/isis/src/base/objs/CubeStretch/CubeStretch.cpp +++ b/isis/src/base/objs/CubeStretch/CubeStretch.cpp @@ -62,10 +62,10 @@ namespace Isis { CubeStretch::CubeStretch(Blob blob) : Stretch() { char *buff = blob.getBuffer(); std::string stringFromBuffer(buff, blob.Size()); - setName(blob.Label()["Name"][0]); - setType(blob.Label()["StretchType"][0]); + setName(QString::fromStdString(blob.Label()["Name"][0])); + setType(QString::fromStdString(blob.Label()["StretchType"][0])); Parse(QString::fromStdString(stringFromBuffer)); - setBandNumber(blob.Label()["BandNumber"][0].toInt()); + setBandNumber(std::stoi(blob.Label()["BandNumber"][0])); } @@ -84,9 +84,9 @@ namespace Isis { Isis::Blob CubeStretch::toBlob() const { Isis::Blob blob("CubeStretch", "Stretch"); - blob.Label()["Name"] = getName(); - blob.Label() += PvlKeyword("StretchType", getType()); - blob.Label() += PvlKeyword("BandNumber", QString::number(getBandNumber())); + blob.Label()["Name"] = getName().toStdString(); + blob.Label() += PvlKeyword("StretchType", getType().toStdString()); + blob.Label() += PvlKeyword("BandNumber", std::to_string(getBandNumber())); std::string blobString = Text().toStdString(); blob.setData(blobString.c_str(), blobString.size()); return blob; diff --git a/isis/src/base/objs/DemShape/DemShape.cpp b/isis/src/base/objs/DemShape/DemShape.cpp index 87b1b58f87..5daf917b5c 100644 --- a/isis/src/base/objs/DemShape/DemShape.cpp +++ b/isis/src/base/objs/DemShape/DemShape.cpp @@ -79,10 +79,10 @@ namespace Isis { QString demCubeFile; if (kernels.hasKeyword("ElevationModel")) { - demCubeFile = (QString) kernels["ElevationModel"]; + demCubeFile = QString::fromStdString(kernels["ElevationModel"]); } else if(kernels.hasKeyword("ShapeModel")) { - demCubeFile = (QString) kernels["ShapeModel"]; + demCubeFile = QString::fromStdString(kernels["ShapeModel"]); } m_demCube = CubeManager::Open(demCubeFile); diff --git a/isis/src/base/objs/EmbreeShapeModel/EmbreeShapeModel.cpp b/isis/src/base/objs/EmbreeShapeModel/EmbreeShapeModel.cpp index 6a7c194c80..5496d99b3e 100644 --- a/isis/src/base/objs/EmbreeShapeModel/EmbreeShapeModel.cpp +++ b/isis/src/base/objs/EmbreeShapeModel/EmbreeShapeModel.cpp @@ -80,10 +80,10 @@ namespace Isis { PvlGroup &kernels = pvl.findGroup("Kernels", Pvl::Traverse); if (kernels.hasKeyword("ElevationModel")) { - m_shapeFile = (QString) kernels["ElevationModel"]; + m_shapeFile = QString::fromStdString(kernels["ElevationModel"]); } else { // if (kernels.hasKeyword("ShapeModel")) { - m_shapeFile = (QString) kernels["ShapeModel"]; + m_shapeFile = QString::fromStdString(kernels["ShapeModel"]); } try { diff --git a/isis/src/base/objs/Enlarge/Enlarge.cpp b/isis/src/base/objs/Enlarge/Enlarge.cpp index bae8608458..b648a0051a 100644 --- a/isis/src/base/objs/Enlarge/Enlarge.cpp +++ b/isis/src/base/objs/Enlarge/Enlarge.cpp @@ -120,16 +120,16 @@ namespace Isis { // Information will be added to it if the Mapping or Instrument // groups are deleted from the output image label PvlGroup resultsGrp("Results"); - resultsGrp += PvlKeyword("InputLines", toString(iNumLines)); - resultsGrp += PvlKeyword("InputSamples", toString(iNumSamples)); - resultsGrp += PvlKeyword("StartingLine", toString((int)mdStartLine)); - resultsGrp += PvlKeyword("StartingSample", toString((int)mdStartSample)); - resultsGrp += PvlKeyword("EndingLine", toString((int)mdEndLine)); - resultsGrp += PvlKeyword("EndingSample", toString((int)mdEndSample)); - resultsGrp += PvlKeyword("LineIncrement", toString(1. / mdLineScale)); - resultsGrp += PvlKeyword("SampleIncrement", toString(1. / mdSampleScale)); - resultsGrp += PvlKeyword("OutputLines", toString(miOutputLines)); - resultsGrp += PvlKeyword("OutputSamples", toString(miOutputSamples)); + resultsGrp += PvlKeyword("InputLines", std::to_string(iNumLines)); + resultsGrp += PvlKeyword("InputSamples", std::to_string(iNumSamples)); + resultsGrp += PvlKeyword("StartingLine", std::to_string((int)mdStartLine)); + resultsGrp += PvlKeyword("StartingSample", std::to_string((int)mdStartSample)); + resultsGrp += PvlKeyword("EndingLine", std::to_string((int)mdEndLine)); + resultsGrp += PvlKeyword("EndingSample", std::to_string((int)mdEndSample)); + resultsGrp += PvlKeyword("LineIncrement", std::to_string(1. / mdLineScale)); + resultsGrp += PvlKeyword("SampleIncrement", std::to_string(1. / mdSampleScale)); + resultsGrp += PvlKeyword("OutputLines", std::to_string(miOutputLines)); + resultsGrp += PvlKeyword("OutputSamples", std::to_string(miOutputSamples)); SubArea subArea; subArea.SetSubArea(mInCube->lineCount(), mInCube->sampleCount(), (int)mdStartLine, (int)mdStartSample, diff --git a/isis/src/base/objs/Equalization/Equalization.cpp b/isis/src/base/objs/Equalization/Equalization.cpp index ae212cf1e3..ad1825d52a 100644 --- a/isis/src/base/objs/Equalization/Equalization.cpp +++ b/isis/src/base/objs/Equalization/Equalization.cpp @@ -332,19 +332,19 @@ namespace Isis { PvlObject equ("EqualizationInformation"); PvlGroup gen("General"); - gen += PvlKeyword("TotalOverlaps", toString(m_validCnt + m_invalidCnt)); - gen += PvlKeyword("ValidOverlaps", toString(m_validCnt)); - gen += PvlKeyword("InvalidOverlaps", toString(m_invalidCnt)); - gen += PvlKeyword("MinCount", toString(m_mincnt)); - gen += PvlKeyword("SamplingPercent", toString(m_samplingPercent)); + gen += PvlKeyword("TotalOverlaps", std::to_string(m_validCnt + m_invalidCnt)); + gen += PvlKeyword("ValidOverlaps", std::to_string(m_validCnt)); + gen += PvlKeyword("InvalidOverlaps", std::to_string(m_invalidCnt)); + gen += PvlKeyword("MinCount", std::to_string(m_mincnt)); + gen += PvlKeyword("SamplingPercent", std::to_string(m_samplingPercent)); gen += PvlKeyword("Weighted", (m_wtopt) ? "true" : "false"); int solType = m_sType; int lsqMethod = m_lsqMethod; - gen += PvlKeyword("SolutionType", toString(solType)); - gen += PvlKeyword("SolveMethod" , toString(lsqMethod)); + gen += PvlKeyword("SolutionType", std::to_string(solType)); + gen += PvlKeyword("SolveMethod" , std::to_string(lsqMethod)); PvlKeyword nonOverlaps("NonOverlaps"); for (int img = 0; img < m_badFiles.size(); img++) { - nonOverlaps += m_badFiles[img]; + nonOverlaps += m_badFiles[img].toStdString(); } gen += nonOverlaps; gen += PvlKeyword("HasCorrections", (m_normsSolved) ? "true" : "false"); @@ -374,30 +374,30 @@ namespace Isis { norm.addComment("BandN = (GAIN)"); break; } - norm += PvlKeyword("FileName", m_imageList[img].original()); + norm += PvlKeyword("FileName", m_imageList[img].original().toStdString()); if (m_normsSolved) { // Band by band statistics for (int band = 1; band <= m_maxBand; band++) { QString bandNum = toString(band); QString bandStr = "Band" + bandNum; - PvlKeyword bandStats(bandStr); + PvlKeyword bandStats(bandStr.toStdString()); // GAIN if (m_sType == OverlapNormalization::Both || m_sType == OverlapNormalization::Gains || m_sType == OverlapNormalization::GainsWithoutNormalization) { - bandStats += toString(m_adjustments[img]->getGain(band - 1)); + bandStats += std::to_string(m_adjustments[img]->getGain(band - 1)); } // OFFSET if (m_sType == OverlapNormalization::Both || m_sType == OverlapNormalization::Offsets) { - bandStats += toString(m_adjustments[img]->getOffset(band - 1)); + bandStats += std::to_string(m_adjustments[img]->getOffset(band - 1)); } // AVERAGE if (m_sType == OverlapNormalization::Both || m_sType == OverlapNormalization::Gains || m_sType == OverlapNormalization::Offsets) { - bandStats += toString(m_adjustments[img]->getAverage(band - 1)); + bandStats += std::to_string(m_adjustments[img]->getAverage(band - 1)); } norm += bandStats; } @@ -427,7 +427,7 @@ namespace Isis { */ void Equalization::recalculateStatistics(QString instatsFileName) { m_recalculating = true; - Pvl inStats(instatsFileName); + Pvl inStats(instatsFileName.toStdString()); fromPvl(inStats); calculateStatistics(m_samplingPercent, m_mincnt, m_wtopt, m_lsqMethod); } @@ -448,7 +448,7 @@ namespace Isis { // Check for errors with the input statistics QVector normIndices = validateInputStatistics(instatsFileName); - Pvl inStats(instatsFileName); + Pvl inStats(instatsFileName.toStdString()); PvlObject &equalInfo = inStats.findObject("EqualizationInformation"); PvlGroup &general = equalInfo.findGroup("General"); @@ -468,9 +468,9 @@ namespace Isis { // Get and store the modifiers for each band for (int band = 1; band < normalization.keywords(); band++) { - adjustment->addGain(toDouble(normalization[band][0])); - adjustment->addOffset(toDouble(normalization[band][1])); - adjustment->addAverage(toDouble(normalization[band][2])); + adjustment->addGain(std::stod(normalization[band][0])); + adjustment->addOffset(std::stod(normalization[band][1])); + adjustment->addAverage(std::stod(normalization[band][2])); } addAdjustment(adjustment); @@ -553,7 +553,7 @@ namespace Isis { // Name and band modifiers for each image for (int img = 0; img < m_imageList.size(); img++) { - results += PvlKeyword("FileName", m_imageList[img].toString()); + results += PvlKeyword("FileName", m_imageList[img].toString().toStdString()); // Band by band statistics for (int band = 1; band <= m_maxBand; band++) { @@ -562,10 +562,10 @@ namespace Isis { QString avg = toString(m_adjustments[img]->getAverage(band - 1)); QString bandNum = toString(band); QString bandStr = "Band" + bandNum; - PvlKeyword bandStats(bandStr); - bandStats += mult; - bandStats += base; - bandStats += avg; + PvlKeyword bandStats(bandStr.toStdString()); + bandStats += mult.toStdString(); + bandStats += base.toStdString(); + bandStats += avg.toStdString(); results += bandStats; } } @@ -581,7 +581,7 @@ namespace Isis { */ void Equalization::write(QString outstatsFileName) { // Write the equalization and overlap statistics to the file - m_results->write(outstatsFileName); + m_results->write(outstatsFileName.toStdString()); } @@ -815,7 +815,7 @@ namespace Isis { m_mincnt = eqGen["MinCount"]; m_wtopt = (eqGen["Weighted"][0] == "true") ? true : false; m_sType = static_cast((int)eqGen["SolutionType"]); - m_lsqMethod = static_cast(eqGen["SolveMethod"][0].toInt()); + m_lsqMethod = static_cast(std::stoi(eqGen["SolveMethod"][0])); // Unserialize previous overlap statistics PvlObject::ConstPvlObjectIterator curObj = inStats.beginObject(); @@ -825,8 +825,8 @@ namespace Isis { m_overlapStats.push_back(o); const PvlObject &oStat = *curObj; - QString fileX = oStat["File1"][0]; - QString fileY = oStat["File2"][0]; + QString fileX = QString::fromStdString(oStat["File1"][0]); + QString fileY = QString::fromStdString(oStat["File2"][0]); // Determine already calculated overlaps int x = imgNames.indexOf(fileX); @@ -956,7 +956,7 @@ namespace Isis { QVector Equalization::validateInputStatistics(QString instatsFileName) { QVector normIndices; - Pvl inStats(instatsFileName); + Pvl inStats(instatsFileName.toStdString()); PvlObject &equalInfo = inStats.findObject("EqualizationInformation"); // Make sure each file in the instats matches a file in the fromlist @@ -972,7 +972,7 @@ namespace Isis { bool foundFile = false; for (int j = 1; j < equalInfo.groups(); j++) { PvlGroup &normalization = equalInfo.group(j); - QString normFile = normalization["FileName"][0]; + QString normFile = QString::fromStdString(normalization["FileName"][0]); if (fromFile == normFile) { // Store the index in INPUT STATISTICS file corresponding to the diff --git a/isis/src/base/objs/Equirectangular/Equirectangular.cpp b/isis/src/base/objs/Equirectangular/Equirectangular.cpp index 8b949b2882..7be65898ff 100644 --- a/isis/src/base/objs/Equirectangular/Equirectangular.cpp +++ b/isis/src/base/objs/Equirectangular/Equirectangular.cpp @@ -56,7 +56,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLongitude")) { if (allowDefaults) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } else { QString message = "Cannot project using Equirectangular Cylindrical"; @@ -69,7 +69,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLatitude")) { if (allowDefaults) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(lat)); } else { QString message = "Cannot project using Equirectangular Cylindrical"; @@ -95,7 +95,7 @@ namespace Isis { mapGroup += PvlKeyword("CenterLatitudeRadius"); } - mapGroup["CenterLatitudeRadius"] = toString(m_clatRadius); + mapGroup["CenterLatitudeRadius"] = std::to_string(m_clatRadius); // Compute cos of the center latitude and make sure it is valid as // we will be dividing with it later on diff --git a/isis/src/base/objs/Equirectangular/unitTest.cpp b/isis/src/base/objs/Equirectangular/unitTest.cpp index ca8a6a1cd1..99bfb7496d 100644 --- a/isis/src/base/objs/Equirectangular/unitTest.cpp +++ b/isis/src/base/objs/Equirectangular/unitTest.cpp @@ -109,8 +109,8 @@ int main(int argc, char *argv[]) { cout << "Testing allow defaults option ... " << endl; mapGroup.deleteKeyword("CenterLongitude"); mapGroup.deleteKeyword("CenterLatitude"); - mapGroup.findKeyword("MinimumLatitude").setValue(toString(0.0)); - mapGroup.findKeyword("MinimumLongitude").setValue(toString(0.0)); + mapGroup.findKeyword("MinimumLatitude").setValue(std::to_string(0.0)); + mapGroup.findKeyword("MinimumLongitude").setValue(std::to_string(0.0)); mapGroup.findKeyword("LongitudeDirection").setValue("PositiveWest"); Equirectangular p2(lab, true); cout << lab << endl; diff --git a/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp b/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp index 52a53f0146..d50bac6fe0 100644 --- a/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp +++ b/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp @@ -84,9 +84,9 @@ namespace Isis { m_pdsByteOrder = pdsTableByteOrder.toUpper(); if (m_pdsByteOrder != "MSB" && m_pdsByteOrder != "LSB") { - QString msg = "Unable to export the Isis Table [" + m_isisTable->Name() + std::string msg = "Unable to export the Isis Table [" + m_isisTable->Name() + "] to a PDS table using the requested byte order [" - + m_pdsByteOrder + "]. Valid values are MSB or LSB."; + + m_pdsByteOrder.toStdString() + "]. Valid values are MSB or LSB."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -121,22 +121,22 @@ namespace Isis { */ PvlObject ExportPdsTable::fillMetaData() { QString pdsTableName = formatPdsTableName(); - PvlObject pdsTableLabelInfo(pdsTableName); + PvlObject pdsTableLabelInfo(pdsTableName.toStdString()); // Data Object Descriptions // NOTE: this class is currently only exporting BINARY format PDS tables. // implementation may be added later to export ASCII PDS tables. pdsTableLabelInfo.addKeyword(PvlKeyword("INTERCHANGE_FORMAT", "BINARY")); - pdsTableLabelInfo.addKeyword(PvlKeyword("ROWS", toString(m_isisTable->Records()))); - pdsTableLabelInfo.addKeyword(PvlKeyword("COLUMNS", toString(m_isisTable->RecordFields()))); - pdsTableLabelInfo.addKeyword(PvlKeyword("ROW_BYTES", toString(m_rowBytes))); - pdsTableLabelInfo.addKeyword(PvlKeyword("ROW_SUFFIX_BYTES", toString(m_outputRecordBytes - m_rowBytes))); + pdsTableLabelInfo.addKeyword(PvlKeyword("ROWS", std::to_string(m_isisTable->Records()))); + pdsTableLabelInfo.addKeyword(PvlKeyword("COLUMNS", std::to_string(m_isisTable->RecordFields()))); + pdsTableLabelInfo.addKeyword(PvlKeyword("ROW_BYTES", std::to_string(m_rowBytes))); + pdsTableLabelInfo.addKeyword(PvlKeyword("ROW_SUFFIX_BYTES", std::to_string(m_outputRecordBytes - m_rowBytes))); int startByte = 1; // PDS begins indexing at 1 for(int fieldIndex = 0; fieldIndex < m_isisTable->RecordFields(); fieldIndex++) { int columnBytes = 0; TableField field = (*m_isisTable)[0][fieldIndex]; PvlObject columnObj("COLUMN"); - columnObj.addKeyword(PvlKeyword("COLUMN_NUMBER", toString(fieldIndex + 1))); - columnObj.addKeyword(PvlKeyword("NAME", QString::fromStdString(field.name()))); + columnObj.addKeyword(PvlKeyword("COLUMN_NUMBER", std::to_string(fieldIndex + 1))); + columnObj.addKeyword(PvlKeyword("NAME", field.name())); if (field.type() == TableField::Text) { @@ -185,9 +185,9 @@ namespace Isis { "field type found for [" + field.name() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } - columnObj.addKeyword(PvlKeyword("START_BYTE", toString(startByte))); + columnObj.addKeyword(PvlKeyword("START_BYTE", std::to_string(startByte))); startByte += columnBytes; - columnObj.addKeyword(PvlKeyword("BYTES", toString(columnBytes))); + columnObj.addKeyword(PvlKeyword("BYTES", std::to_string(columnBytes))); pdsTableLabelInfo.addObject(columnObj); } return pdsTableLabelInfo; @@ -199,7 +199,7 @@ namespace Isis { * @return QString containing the formatted PDS table name. */ QString ExportPdsTable::formatPdsTableName() { - return ExportPdsTable::formatPdsTableName(m_isisTable->Name()); + return ExportPdsTable::formatPdsTableName(QString::fromStdString(m_isisTable->Name())); } /** @@ -306,7 +306,7 @@ namespace Isis { // tested since it should not be possible // unless the number of bytes reserved for // each of the types changes - QString msg = "Unable to export Isis::Table object [" + m_isisTable->Name() + std::string msg = "Unable to export Isis::Table object [" + m_isisTable->Name() + "] to PDS. Record lengths are uneven."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/FitsToJson/FitsToJson.cpp b/isis/src/base/objs/FitsToJson/FitsToJson.cpp index b50f299a6e..651ad902d6 100644 --- a/isis/src/base/objs/FitsToJson/FitsToJson.cpp +++ b/isis/src/base/objs/FitsToJson/FitsToJson.cpp @@ -58,8 +58,8 @@ namespace Isis { // Check for blank lines if (line.substr(0, 1) != " " && line.substr(0, 1) != "/") { // Name of keyword - PvlKeyword label(line.Token(" =").ToQt()); // Stop on spaces OR equal sign - if (QString::compare(label.name(), "OBJECT", Qt::CaseInsensitive) == 0) { + PvlKeyword label(line.Token(" =")); // Stop on spaces OR equal sign + if (QString::compare(QString::fromStdString(label.name()), "OBJECT", Qt::CaseInsensitive) == 0) { label.setName("TARGET"); label.addComment("NOTE: This keyword name was changed from 'OBJECT' in the original " "fit header file."); @@ -68,28 +68,28 @@ namespace Isis { line.TrimHead(" ="); line.TrimTail(" "); if (label.name() == "COMMENT" || label.name() == "HISTORY") { - label += line.ToQt(); + label += line; } else { // Check for a quoted value if (line.substr(0,1) == "'") { line.TrimHead("'"); - label += line.Token("'").TrimHead(" ").TrimTail(" ").ToQt(); + label += line.Token("'").TrimHead(" ").TrimTail(" "); line.TrimHead(" '"); } else { // Access any remaining data without the trailing comment if there is one IString value = line.Token("/"); value.TrimTail(" "); - label += value.ToQt(); + label += value; line.TrimHead(" "); } // If the line still has anything in it, treat it is as a comment. if (line.size() > 2) { line.TrimHead(" /"); - label.addComment(line.ToQt()); + label.addComment(line); if (line != line.Token("[")) { - label.setUnits(line.Token("[").Token("]").ToQt()); + label.setUnits(line.Token("[").Token("]")); } } } @@ -122,16 +122,16 @@ namespace Isis { bytesPerPixel /= 8; unsigned int axis1 = 1; - axis1 = toInt((*fitsLabel)["NAXIS1"]); + axis1 = std::stoi((*fitsLabel)["NAXIS1"]); unsigned int axis2 = 1; if (fitsLabel->hasKeyword("NAXIS2")) { - axis2 = toInt((*fitsLabel)["NAXIS2"]); + axis2 = std::stoi((*fitsLabel)["NAXIS2"]); } unsigned int axis3 = 1; if (fitsLabel->hasKeyword("NAXIS3")) { - axis3 = toInt((*fitsLabel)["NAXIS3"]); + axis3 = std::stoi((*fitsLabel)["NAXIS3"]); } jump = (int)(ceil(bytesPerPixel * axis1 * axis2 * axis3 / 2880.0) * 2880.0); diff --git a/isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp b/isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp index 7c4abe5265..94983d0c1a 100644 --- a/isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp +++ b/isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp @@ -398,8 +398,7 @@ namespace Isis { } } else { - QString msg = "PVL for GridPolygonSeeder must contain [XSpacing] in ["; - msg += pvl.fileName() + "]"; + std::string msg = "PVL for GridPolygonSeeder must contain [XSpacing] in [" + pvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -411,21 +410,20 @@ namespace Isis { } } else { - QString msg = "PVL for GridPolygonSeeder must contain [YSpacing] in ["; - msg += pvl.fileName() + "]"; + std::string msg = "PVL for GridPolygonSeeder must contain [YSpacing] in [" + pvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } p_subGrid = false; if(algo.hasKeyword("SubGrid")) { - p_subGrid = IString((QString)algo["SubGrid"]).UpCase() != "FALSE"; + p_subGrid = IString((std::string)algo["SubGrid"]).UpCase() != "FALSE"; if(invalgo.hasKeyword("SubGrid")) { invalgo.deleteKeyword("SubGrid"); } } } catch(IException &e) { - QString msg = "Improper format for PolygonSeeder PVL [" + pvl.fileName() + "]"; + std::string msg = "Improper format for PolygonSeeder PVL [" + pvl.fileName() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -440,14 +438,14 @@ namespace Isis { } PvlGroup GridPolygonSeeder::PluginParameters(QString grpName) { - PvlGroup pluginInfo(grpName); - - PvlKeyword name("Name", Algorithm()); - PvlKeyword minThickness("MinimumThickness", toString(MinimumThickness())); - PvlKeyword minArea("MinimumArea", toString(MinimumArea())); - PvlKeyword xSpac("XSpacing", toString(p_Xspacing)); - PvlKeyword ySpac("YSpacing", toString(p_Yspacing)); - PvlKeyword subGrid("SubGrid", toString(p_subGrid)); + PvlGroup pluginInfo(grpName.toStdString()); + + PvlKeyword name("Name", Algorithm().toStdString()); + PvlKeyword minThickness("MinimumThickness", std::to_string(MinimumThickness())); + PvlKeyword minArea("MinimumArea", std::to_string(MinimumArea())); + PvlKeyword xSpac("XSpacing", std::to_string(p_Xspacing)); + PvlKeyword ySpac("YSpacing", std::to_string(p_Yspacing)); + PvlKeyword subGrid("SubGrid", std::to_string(p_subGrid)); pluginInfo.addKeyword(name); pluginInfo.addKeyword(minThickness); diff --git a/isis/src/base/objs/GroundGrid/GroundGrid.cpp b/isis/src/base/objs/GroundGrid/GroundGrid.cpp index 4088741c82..4f96d7d404 100644 --- a/isis/src/base/objs/GroundGrid/GroundGrid.cpp +++ b/isis/src/base/objs/GroundGrid/GroundGrid.cpp @@ -98,7 +98,7 @@ namespace Isis { Distance::Meters); if (p_mapping->hasKeyword("MinimumLatitude")) { - p_minLat = new Latitude(toDouble((*p_mapping)["MinimumLatitude"][0]), + p_minLat = new Latitude(std::stod((*p_mapping)["MinimumLatitude"][0]), *p_mapping, Angle::Degrees, Latitude::AllowPastPole); @@ -108,7 +108,7 @@ namespace Isis { } if (p_mapping->hasKeyword("MaximumLatitude")) { - p_maxLat = new Latitude(toDouble((*p_mapping)["MaximumLatitude"][0]), + p_maxLat = new Latitude(std::stod((*p_mapping)["MaximumLatitude"][0]), *p_mapping, Angle::Degrees); } @@ -117,7 +117,7 @@ namespace Isis { } if (p_mapping->hasKeyword("MinimumLongitude")) { - p_minLon = new Longitude(toDouble((*p_mapping)["MinimumLongitude"][0]), + p_minLon = new Longitude(std::stod((*p_mapping)["MinimumLongitude"][0]), *p_mapping, Angle::Degrees); } @@ -126,7 +126,7 @@ namespace Isis { } if (p_mapping->hasKeyword("MaximumLongitude")) { - p_maxLon = new Longitude(toDouble((*p_mapping)["MaximumLongitude"][0]), + p_maxLon = new Longitude(std::stod((*p_mapping)["MaximumLongitude"][0]), *p_mapping, Angle::Degrees); } diff --git a/isis/src/base/objs/Gruen/Gruen.cpp b/isis/src/base/objs/Gruen/Gruen.cpp index 35d920a639..5f19c74b32 100644 --- a/isis/src/base/objs/Gruen/Gruen.cpp +++ b/isis/src/base/objs/Gruen/Gruen.cpp @@ -823,7 +823,7 @@ namespace Isis { */ Pvl Gruen::AlgorithmStatistics(Pvl &pvl) { PvlGroup algo("GruenFailures"); - algo += PvlKeyword("Name", AlgorithmName()); + algo += PvlKeyword("Name", AlgorithmName().toStdString()); algo += PvlKeyword("Mode", "Adaptive"); // Log errors @@ -832,7 +832,7 @@ namespace Isis { } if (m_unclassified > 0) { - algo += PvlKeyword("UnclassifiedErrors", toString(m_unclassified)); + algo += PvlKeyword("UnclassifiedErrors", std::to_string(m_unclassified)); } pvl.addGroup(algo); pvl.addGroup(StatsLog()); @@ -853,7 +853,7 @@ namespace Isis { PvlGroup Gruen::StatsLog() const { PvlGroup stats("GruenStatistics"); - stats += PvlKeyword("TotalIterations", toString(m_totalIterations)); + stats += PvlKeyword("TotalIterations", std::to_string(m_totalIterations)); stats += ValidateKey("IterationMinimum", m_iterStat.Minimum()); stats += ValidateKey("IterationAverage", m_iterStat.Average()); stats += ValidateKey("IterationMaximum", m_iterStat.Maximum()); @@ -890,7 +890,7 @@ namespace Isis { PvlGroup Gruen::ParameterLog() const { PvlGroup parms("GruenParameters"); - parms += PvlKeyword("MaximumIterations", toString(m_maxIters)); + parms += PvlKeyword("MaximumIterations", std::to_string(m_maxIters)); parms += ValidateKey("AffineScaleTolerance", m_scaleTol); parms += ValidateKey("AffineShearTolerance", m_shearTol); parms += ValidateKey("AffineTranslationTolerance", m_transTol); @@ -976,22 +976,22 @@ namespace Isis { if (m_prof.Name().isEmpty()) m_prof.setName("Gruen"); // Define internal parameters - m_maxIters = toInt(ConfKey(m_prof, "MaximumIterations", toString(30))); + m_maxIters = std::stoi(ConfKey(m_prof, "MaximumIterations", std::to_string(30))); - m_transTol = toDouble(ConfKey(m_prof, "AffineTranslationTolerance", toString(0.1))); - m_scaleTol = toDouble(ConfKey(m_prof, "AffineScaleTolerance", toString(0.3))); - m_shearTol = toDouble(ConfKey(m_prof, "AffineShearTolerance", toString(m_scaleTol))); - m_affineTol = toDouble(ConfKey(m_prof, "AffineTolerance", toString(DBL_MAX))); + m_transTol = std::stod(ConfKey(m_prof, "AffineTranslationTolerance", std::to_string(0.1))); + m_scaleTol = std::stod(ConfKey(m_prof, "AffineScaleTolerance", std::to_string(0.3))); + m_shearTol = std::stod(ConfKey(m_prof, "AffineShearTolerance", std::to_string(m_scaleTol))); + m_affineTol = std::stod(ConfKey(m_prof, "AffineTolerance", std::to_string(DBL_MAX))); - m_spiceTol = toDouble(ConfKey(m_prof, "SpiceTolerance", toString(DBL_MAX))); + m_spiceTol = std::stod(ConfKey(m_prof, "SpiceTolerance", std::to_string(DBL_MAX))); - m_shiftTol = toDouble(ConfKey(m_prof, "RadioShiftTolerance", toString(DBL_MAX))); - m_rgainMinTol = toDouble(ConfKey(m_prof, "RadioGainMinTolerance", toString(-DBL_MAX))); - m_rgainMaxTol = toDouble(ConfKey(m_prof, "RadioGainMaxTolerance", toString(DBL_MAX))); + m_shiftTol = std::stod(ConfKey(m_prof, "RadioShiftTolerance", std::to_string(DBL_MAX))); + m_rgainMinTol = std::stod(ConfKey(m_prof, "RadioGainMinTolerance", std::to_string(-DBL_MAX))); + m_rgainMaxTol = std::stod(ConfKey(m_prof, "RadioGainMaxTolerance", std::to_string(DBL_MAX))); // Set radiometric defaults - m_defGain = toDouble(ConfKey(m_prof, "DefaultRadioGain", toString(0.0))); - m_defShift = toDouble(ConfKey(m_prof, "DefaultRadioShift", toString(0.0))); + m_defGain = std::stod(ConfKey(m_prof, "DefaultRadioGain", std::to_string(0.0))); + m_defShift = std::stod(ConfKey(m_prof, "DefaultRadioShift", std::to_string(0.0))); m_callCount = 0; m_filePattern = ""; diff --git a/isis/src/base/objs/Gruen/Gruen.h b/isis/src/base/objs/Gruen/Gruen.h index 69adc61f48..42504513b0 100644 --- a/isis/src/base/objs/Gruen/Gruen.h +++ b/isis/src/base/objs/Gruen/Gruen.h @@ -171,7 +171,7 @@ namespace Isis { inline int Errno() const { return (m_gerrno); } inline BigInt Count() const { return (m_count); } inline void BumpIt() { m_count++; } - PvlKeyword LogIt() const { return (PvlKeyword(m_keyname, toString(m_count))); } + PvlKeyword LogIt() const { return (PvlKeyword(m_keyname.toStdString(), std::to_string(m_count))); } int m_gerrno; QString m_keyname; @@ -304,7 +304,7 @@ namespace Isis { if(m_prof.exists(keyname)) { return(ValidateKey(keyname, value, unit)); } - return (PvlKeyword(keyname, "Unbounded")); + return (PvlKeyword(keyname.toStdString(), "Unbounded")); }; @@ -324,10 +324,10 @@ namespace Isis { const double &value, const QString &unit = "") const { if(IsSpecial(value)) { - return (PvlKeyword(keyname, "NULL")); + return (PvlKeyword(keyname.toStdString(), "NULL")); } else { - return (PvlKeyword(keyname, toString(value), unit)); + return (PvlKeyword(keyname.toStdString(), std::to_string(value), unit.toStdString())); } } diff --git a/isis/src/base/objs/Gui/Gui.cpp b/isis/src/base/objs/Gui/Gui.cpp index dc84574b88..b3c3a9c9f2 100644 --- a/isis/src/base/objs/Gui/Gui.cpp +++ b/isis/src/base/objs/Gui/Gui.cpp @@ -101,13 +101,13 @@ namespace Isis { // However, Isis supports overriding this with a setting in IsisPreferences. // Here we check to see if this has been done and force the style if needed. if(uiPref.hasKeyword("GuiStyle")) { - QString style = uiPref["GuiStyle"]; + QString style = QString::fromStdString(uiPref["GuiStyle"]); QApplication::setStyle(style); } if (uiPref.hasKeyword("GuiFontName")) { - QString fontString = uiPref["GuiFontName"]; + QString fontString = QString::fromStdString(uiPref["GuiFontName"]); QFont font = QFont(fontString); if (uiPref.hasKeyword("GuiFontSize")) { @@ -716,7 +716,7 @@ namespace Isis { Preference &p = Preference::Preferences(); PvlGroup &grp = p.findGroup("UserInterface", Isis::Pvl::Traverse); - Isis::FileName progHist(grp["HistoryPath"][0] + "/" + ui.ProgramName() + ".par"); + Isis::FileName progHist(QString::fromStdString(grp["HistoryPath"][0]) + "/" + ui.ProgramName() + ".par"); if(!progHist.fileExists()) { p_historyEntry = -1; @@ -727,7 +727,7 @@ namespace Isis { Isis::Pvl hist; try { - hist.read(progHist.expanded()); + hist.read(progHist.expanded().toStdString()); } catch(...) { p_historyEntry = -1; @@ -761,14 +761,14 @@ namespace Isis { ResetParameters(); Isis::PvlGroup &up = hist.group(useEntry); for (int k = 0; k < up.keywords(); k++) { - QString key = up[k].name(); + QString key = QString::fromStdString(up[k].name()); QString val; // If the value has more than one element, // construct a string array of those elements if (up[k].size() > 1) { val = "("; for (int i = 0; i < up[k].size(); i++) { - QString newVal = up[k][i]; + QString newVal = QString::fromStdString(up[k][i]); if (newVal.contains(",")) { newVal = '"' + newVal + '"'; } @@ -782,7 +782,7 @@ namespace Isis { } // Else, return the value on its own else { - QString newVal = up[k]; + QString newVal = QString::fromStdString(up[k]); val = newVal; } ui.Clear(key); @@ -878,7 +878,7 @@ namespace Isis { QString command = (QString) uig["GuiHelpBrowser"] + " http://isis.astrogeology.usgs.gov >> /dev/null &"; #elif defined(__APPLE__) - QString command = "open -a" + (QString) uig["GuiHelpBrowser"] + + QString command = "open -a" + QString::fromStdString(uig["GuiHelpBrowser"]) + " http://isis.astrogeology.usgs.gov >> /dev/null &"; #endif ProgramLauncher::RunSystemCommand(command); @@ -893,7 +893,7 @@ namespace Isis { Isis::Application::GetUserInterface().ProgramName() + "/" + Isis::Application::GetUserInterface().ProgramName() + ".html"; #elif defined(__APPLE__) - QString command = "open -a" + (QString) uig["GuiHelpBrowser"] + + QString command = "open -a" + QString::fromStdString(uig["GuiHelpBrowser"]) + " http://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/" + Isis::Application::GetUserInterface().ProgramName() + "/" + Isis::Application::GetUserInterface().ProgramName() + ".html"; diff --git a/isis/src/base/objs/Hapke/Hapke.cpp b/isis/src/base/objs/Hapke/Hapke.cpp index b55864a4ce..652c9a1074 100644 --- a/isis/src/base/objs/Hapke/Hapke.cpp +++ b/isis/src/base/objs/Hapke/Hapke.cpp @@ -47,9 +47,9 @@ namespace Isis { } if(algorithm.hasKeyword("ZeroB0Standard")) { - SetPhoto0B0Standard(algorithm["ZeroB0Standard"][0]); + SetPhoto0B0Standard(QString::fromStdString(algorithm["ZeroB0Standard"][0])); } else if (algorithm.hasKeyword("ZeroB0St")) { - SetPhoto0B0Standard(algorithm["ZeroB0St"][0]); + SetPhoto0B0Standard(QString::fromStdString(algorithm["ZeroB0St"][0])); } else { SetPhoto0B0Standard("TRUE"); } diff --git a/isis/src/base/objs/IdealCamera/IdealCamera.cpp b/isis/src/base/objs/IdealCamera/IdealCamera.cpp index 7c28ee11b8..c74318e476 100644 --- a/isis/src/base/objs/IdealCamera/IdealCamera.cpp +++ b/isis/src/base/objs/IdealCamera/IdealCamera.cpp @@ -195,7 +195,7 @@ namespace Isis { } // Create correct camera type - QString type = (QString) inst["InstrumentType"]; + QString type = QString::fromStdString(inst["InstrumentType"]); if (type.toUpper() == "FRAMING") { p_framing = true; new CameraDetectorMap(this); @@ -223,8 +223,7 @@ namespace Isis { NaifStatus::CheckErrors(); } else { - QString msg = "Unknown InstrumentType [" + - (QString) inst["InstrumentType"] + "]"; + std::string msg = "Unknown InstrumentType [" + std::to_string((int)inst["InstrumentType"]) + "]"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp index a21c572849..85f2bed612 100644 --- a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp +++ b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp @@ -896,10 +896,10 @@ namespace Isis { PvlKeyword polygon("Polygon"); for (int i = 0; i < p_lonLatOverlaps.at(overlap1)->Size(); i++) { - serialNumbers += (*p_lonLatOverlaps.at(overlap1))[i]; + serialNumbers += (*p_lonLatOverlaps.at(overlap1))[i].toStdString(); if (snlist != NULL) { - filename += snlist->fileName((*p_lonLatOverlaps.at(overlap1))[i]); + filename += snlist->fileName((*p_lonLatOverlaps.at(overlap1))[i]).toStdString(); } } polygon += p_lonLatOverlaps.at(overlap1)->Polygon()->toString().c_str(); @@ -920,10 +920,10 @@ namespace Isis { PvlKeyword polygon("Polygon"); for (int i = 0; i < p_lonLatOverlaps.at(overlap2)->Size(); i++) { - serialNumbers += (*p_lonLatOverlaps.at(overlap2))[i]; + serialNumbers += (*p_lonLatOverlaps.at(overlap2))[i].toStdString(); if (snlist != NULL) { - filename += snlist->fileName((*p_lonLatOverlaps.at(overlap2))[i]); + filename += snlist->fileName((*p_lonLatOverlaps.at(overlap2))[i]).toStdString(); } } polygon += p_lonLatOverlaps.at(overlap2)->Polygon()->toString().c_str(); @@ -940,7 +940,7 @@ namespace Isis { err += PvlKeyword("Error", e.what()); if (!msg.isEmpty()) { - err += PvlKeyword("Description", msg); + err += PvlKeyword("Description", msg.toStdString()); } p_errorLog.push_back(err); @@ -971,10 +971,10 @@ namespace Isis { PvlKeyword filename("FileNames"); for (int i = 0; i < p_lonLatOverlaps.at(overlap1)->Size(); i++) { - serialNumbers += (*p_lonLatOverlaps.at(overlap1))[i]; + serialNumbers += (*p_lonLatOverlaps.at(overlap1))[i].toStdString(); if (snlist != NULL) { - filename += snlist->fileName((*p_lonLatOverlaps.at(overlap1))[i]); + filename += snlist->fileName((*p_lonLatOverlaps.at(overlap1))[i]).toStdString(); } } @@ -991,10 +991,10 @@ namespace Isis { PvlKeyword filename("FileNames"); for (int i = 0; i < p_lonLatOverlaps.at(overlap2)->Size(); i++) { - serialNumbers += (*p_lonLatOverlaps.at(overlap2))[i]; + serialNumbers += (*p_lonLatOverlaps.at(overlap2))[i].toStdString(); if (snlist != NULL) { - filename += snlist->fileName((*p_lonLatOverlaps.at(overlap2))[i]); + filename += snlist->fileName((*p_lonLatOverlaps.at(overlap2))[i]).toStdString(); } } @@ -1008,7 +1008,7 @@ namespace Isis { err += PvlKeyword("Error", exc->what()); if (!msg.isEmpty()) { - err += PvlKeyword("Description", msg); + err += PvlKeyword("Description", msg.toStdString()); } p_errorLog.push_back(err); @@ -1041,10 +1041,10 @@ namespace Isis { PvlKeyword filename("FileNames"); for (int i = 0; i < p_lonLatOverlaps.at(overlap1)->Size(); i++) { - serialNumbers += (*p_lonLatOverlaps.at(overlap1))[i]; + serialNumbers += (*p_lonLatOverlaps.at(overlap1))[i].toStdString(); if (snlist != NULL) { - filename += snlist->fileName((*p_lonLatOverlaps.at(overlap1))[i]); + filename += snlist->fileName((*p_lonLatOverlaps.at(overlap1))[i]).toStdString(); } } @@ -1061,10 +1061,10 @@ namespace Isis { PvlKeyword filename("FileNames"); for (int i = 0; i < p_lonLatOverlaps.at(overlap2)->Size(); i++) { - serialNumbers += (*p_lonLatOverlaps.at(overlap2))[i]; + serialNumbers += (*p_lonLatOverlaps.at(overlap2))[i].toStdString(); if (snlist != NULL) { - filename += snlist->fileName((*p_lonLatOverlaps.at(overlap2))[i]); + filename += snlist->fileName((*p_lonLatOverlaps.at(overlap2))[i]).toStdString(); } } @@ -1075,7 +1075,7 @@ namespace Isis { } } - err += PvlKeyword("Description", msg); + err += PvlKeyword("Description", msg.toStdString()); p_errorLog.push_back(err); diff --git a/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp b/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp index 4fdb2b59ed..ce0d95f832 100644 --- a/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp +++ b/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp @@ -318,7 +318,7 @@ namespace Isis { Table ImportPdsTable::importTable(const QString &isisTableName) { try { TableRecord record = makeRecord(m_coldesc); - Table table(isisTableName, record); + Table table(isisTableName.toStdString(), record); fillTable(table, m_coldesc, record); return (table); } @@ -387,7 +387,7 @@ namespace Isis { // Create and populate the table TableRecord record = makeRecord(ctypes); - Table table(isisTableName, record); + Table table(isisTableName.toStdString(), record); fillTable(table, ctypes, record); return (table); } @@ -439,17 +439,17 @@ namespace Isis { QString &pdsTableFile, const QString &tblname) { - Isis::Pvl label(pdsLabFile); + Isis::Pvl label(pdsLabFile.toStdString()); QString tableName = ( tblname.isEmpty() ) ? m_tableName : tblname; - if (!label.hasObject(tableName)) { + if (!label.hasObject(tableName.toStdString())) { QString msg = "The PDS file " + pdsLabFile + " does not have the required TABLE object, [" + tableName +"]. The PDS label file is probably invalid"; throw IException(IException::Unknown, msg.toStdString(), _FILEINFO_); } // Get some pertinent information from the label - PvlObject &tabObj = label.findObject(tableName); + PvlObject &tabObj = label.findObject(tableName.toStdString()); // The table description contains the actual "RECORD_BYTES" if (tabObj.hasKeyword("RECORD_BYTES")) { m_recordBytes = (int) tabObj.findKeyword("RECORD_BYTES"); @@ -468,20 +468,20 @@ namespace Isis { QString trueTableName; PvlObject *tableDetails = &tabObj; - if (label.hasKeyword("^" + tableName)) { + if (label.hasKeyword(("^" + tableName).toStdString())) { trueTableName = tableName; pdsTableFile = FileName(pdsLabFile).path() + "/" - + label["^" + tableName][0]; + + QString::fromStdString(label[("^" + tableName).toStdString()][0]); } else if (tabObj.objects() == 1) { - trueTableName = tabObj.object(0).name(); + trueTableName = QString::fromStdString(tabObj.object(0).name()); tableDetails = &tabObj.object(0); pdsTableFile = FileName(pdsLabFile).path() + "/" - + tabObj["^" + trueTableName][0]; + + QString::fromStdString(tabObj[("^" + trueTableName).toStdString()][0]); } m_trows = (int) tableDetails->findKeyword("ROWS"); int ncols = (int) tableDetails->findKeyword("COLUMNS"); - m_pdsTableType = QString(tableDetails->findKeyword("INTERCHANGE_FORMAT")); + m_pdsTableType = QString::fromStdString(tableDetails->findKeyword("INTERCHANGE_FORMAT")); if (m_pdsTableType != "ASCII" && m_pdsTableType.toUpper() != "BINARY") { QString msg = "Unable to import the PDS table [" + tableName + "] from the PDS file [" @@ -571,14 +571,14 @@ namespace Isis { ImportPdsTable::ColumnDescr ImportPdsTable::getColumnDescription(PvlObject &colobj, int nth) const { ColumnDescr cd; - cd.m_name = colobj["NAME"][0]; + cd.m_name = QString::fromStdString(colobj["NAME"][0]); cd.m_colnum = nth; // 0-based indexing, will be COLUMN_NUM - 1 if (m_pdsTableType == "ASCII") { - cd.m_dataType = getGenericType(colobj["DATA_TYPE"][0]).toUpper(); + cd.m_dataType = getGenericType(QString::fromStdString(colobj["DATA_TYPE"][0])).toUpper(); } else { - cd.m_dataType = colobj["DATA_TYPE"][0].toUpper(); + cd.m_dataType = QString::fromStdString(colobj["DATA_TYPE"][0]).toUpper(); } cd.m_startByte = ((int) colobj["START_BYTE"]) - 1; // 0-based indexing diff --git a/isis/src/base/objs/IsisAml/IsisAml.cpp b/isis/src/base/objs/IsisAml/IsisAml.cpp index cf7cf1cec1..debe3566c1 100644 --- a/isis/src/base/objs/IsisAml/IsisAml.cpp +++ b/isis/src/base/objs/IsisAml/IsisAml.cpp @@ -1274,7 +1274,7 @@ void IsisAml::CreatePVL(Isis::Pvl &pvlDef , QString guiGrpName, QString pvlObjNa Isis::PvlObject *pvlObj = NULL; if (pvlObjName != "") { - pvlObj = new Isis::PvlObject(pvlObjName); + pvlObj = new Isis::PvlObject(pvlObjName.toStdString()); } // Get Gui Group index @@ -1285,23 +1285,23 @@ void IsisAml::CreatePVL(Isis::Pvl &pvlDef , QString guiGrpName, QString pvlObjNa throw Isis::IException(Isis::IException::User, errMsg, _FILEINFO_); } - Isis::PvlGroup grp(pvlGrpName); + Isis::PvlGroup grp(pvlGrpName.toStdString()); for(int i=0; ivalues.size() > 0) { - Isis::PvlKeyword paramKeyword(param->name); + Isis::PvlKeyword paramKeyword(param->name.toStdString()); for(unsigned int value = 0; value < param->values.size(); value++) { - paramKeyword.addValue(param->values[value]); + paramKeyword.addValue(param->values[value].toStdString()); } group += paramKeyword; @@ -3116,12 +3116,12 @@ void IsisAml::CommandLine(Isis::Pvl &cont) const { // Or if it has a default value add it to the command line else if(param->defaultValues.size() > 0) { - Isis::PvlKeyword paramKeyword(param->name); + Isis::PvlKeyword paramKeyword(param->name.toStdString()); for(unsigned int value = 0; value < param->defaultValues.size(); value++) { - paramKeyword.addValue(param->defaultValues[value]); + paramKeyword.addValue(param->defaultValues[value].toStdString()); } group += paramKeyword; @@ -3152,8 +3152,8 @@ void IsisAml::CommandLine(Isis::Pvl &cont) const { for(unsigned int e2 = 0; e2 < param->listOptions[o2].exclude.size(); e2++) { const IsisParameterData *param2 = ReturnParam(param->listOptions[o2].exclude[e2]); - if(group.hasKeyword(param2->name)) { - group.deleteKeyword(param2->name); + if(group.hasKeyword(param2->name.toStdString())) { + group.deleteKeyword(param2->name.toStdString()); } } } diff --git a/isis/src/base/objs/Kernels/Kernels.cpp b/isis/src/base/objs/Kernels/Kernels.cpp index 95030a443a..c56c5ed7ea 100644 --- a/isis/src/base/objs/Kernels/Kernels.cpp +++ b/isis/src/base/objs/Kernels/Kernels.cpp @@ -90,7 +90,7 @@ namespace Isis { * @param filename Name of ISIS cube file */ Kernels::Kernels(const QString &filename) { - Pvl pvl(filename); + Pvl pvl(filename.toStdString()); Init(pvl); } @@ -907,12 +907,12 @@ namespace Isis { // Get the kernel group and load main kernels PvlGroup &kernels = pvl.findGroup("Kernels",Pvl::Traverse); // Check for the keyword - if (kernels.hasKeyword(kname)) { - PvlKeyword &kkey = kernels[kname]; + if (kernels.hasKeyword(kname.toStdString())) { + PvlKeyword &kkey = kernels[kname.toStdString()]; for (int i = 0 ; i < kkey.size() ; i++) { if (!kkey.isNull(i)) { - if (kkey[i].toLower() != "table") { - klist.push_back(examine(kkey[i], manage)); + if (QString::fromStdString(kkey[i]).toLower() != "table") { + klist.push_back((examine(QString::fromStdString(kkey[i]), manage))); } } } diff --git a/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp index aa53849327..96eb716493 100644 --- a/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp +++ b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp @@ -71,13 +71,13 @@ namespace Isis { // Attempt to translate every group in the translation table for(int i = 0; i < TranslationTable().groups(); i++) { PvlGroup &g = TranslationTable().group(i); - if(IsAuto(g.name())) { + if(IsAuto(QString::fromStdString(g.name()))) { try { - PvlContainer *con = CreateContainer(g.name(), outputLabel); - (*con) += DoTranslation(g.name()); + PvlContainer *con = CreateContainer(QString::fromStdString(g.name()), outputLabel); + (*con) += DoTranslation(QString::fromStdString(g.name())); } catch(IException &e) { - if(!IsOptional(g.name())) { + if(!IsOptional(QString::fromStdString(g.name()))) { throw e;//??? is this needed??? } } @@ -108,7 +108,7 @@ namespace Isis { // Look at every pair in the output position for(int c = 0; c < np.size(); c += 2) { // If this pair is an object - if(np[c].toUpper() == "OBJECT") { + if(QString::fromStdString(np[c]).toUpper() == "OBJECT") { // If the object doesn't exist create it if(!obj->hasObject(np[c+1])) { obj->addObject(np[c+1]); @@ -116,7 +116,7 @@ namespace Isis { obj = &(obj->findObject(np[c+1])); } // If this pair is a group - else if(np[c].toUpper() == "GROUP") { + else if(QString::fromStdString(np[c]).toUpper() == "GROUP") { // If the group doesn't exist create it if(!obj->hasGroup(np[c+1])) { obj->addGroup(np[c+1]); @@ -142,7 +142,7 @@ namespace Isis { * @TODO output units */ PvlKeyword LabelTranslationManager::DoTranslation(const QString outputName) { - PvlKeyword outputKeyword( outputName, Translate(outputName) ); + PvlKeyword outputKeyword( outputName.toStdString(), Translate(outputName).toStdString() ); return outputKeyword; } diff --git a/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp b/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp index a2542c5ba5..41263156e9 100644 --- a/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp +++ b/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp @@ -75,7 +75,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLongitude")) { if (allowDefaults) { double centerLon = (MinimumLongitude() + MaximumLongitude()) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(centerLon), "Degrees"); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(centerLon), "Degrees"); } else { QString message = "Cannot project using Lambert Azimuthal equal-area"; @@ -90,7 +90,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLatitude")) { if (allowDefaults) { double centerLat = (MinimumLatitude() + MaximumLatitude()) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(centerLat), "Degrees"); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(centerLat), "Degrees"); } else { QString message = "Cannot project using Lambert Azimuthal equal-area"; diff --git a/isis/src/base/objs/LambertAzimuthalEqualArea/unitTest.cpp b/isis/src/base/objs/LambertAzimuthalEqualArea/unitTest.cpp index cf240860b0..14eba62eb2 100644 --- a/isis/src/base/objs/LambertAzimuthalEqualArea/unitTest.cpp +++ b/isis/src/base/objs/LambertAzimuthalEqualArea/unitTest.cpp @@ -1170,7 +1170,7 @@ int main(int argc, char *argv[]) { mapGroup.findKeyword("LongitudeDirection").setValue("PositiveEast"); mapGroup.deleteKeyword("EquatorialRadius"); mapGroup += PvlKeyword("EquatorialRadius", "6378388.0"); - mapGroup.findKeyword("PolarRadius").setValue(toString(6378388.0*sqrt(1-.00672267))); + mapGroup.findKeyword("PolarRadius").setValue(std::to_string(6378388.0*sqrt(1-.00672267))); mapGroup.findKeyword("MinimumLatitude").setValue("-89.99999"); mapGroup.findKeyword("CenterLongitude").setValue("-100.0"); mapGroup.findKeyword("MinimumLongitude").setValue("-100.0"); @@ -1621,7 +1621,7 @@ int main(int argc, char *argv[]) { //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| mapGroup.deleteKeyword("EquatorialRadius"); mapGroup += PvlKeyword("EquatorialRadius", "6378206.4"); - mapGroup.findKeyword("PolarRadius").setValue(toString(6378206.4*sqrt(1-.00676866))); + mapGroup.findKeyword("PolarRadius").setValue(std::to_string(6378206.4*sqrt(1-.00676866))); mapGroup.findKeyword("CenterLatitude").setValue("40.0"); mapGroup.findKeyword("CenterLongitude").setValue("-100.0"); mapGroup.findKeyword("MinimumLatitude").setValue("-50"); @@ -2002,7 +2002,7 @@ int main(int argc, char *argv[]) { cout << "\t\t\t\t\t TESTING OTHER METHODS " << endl; cout << border << endl << endl; //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - mapGroup.findKeyword("PolarRadius").setValue(toString(p8->EquatorialRadius())); + mapGroup.findKeyword("PolarRadius").setValue(std::to_string(p8->EquatorialRadius())); TProjection *p9 = (TProjection *) ProjectionFactory::Create(lab); TProjection *s = p1; cout << "Name: " << s->Name() << endl; diff --git a/isis/src/base/objs/LambertConformal/LambertConformal.cpp b/isis/src/base/objs/LambertConformal/LambertConformal.cpp index 9b2ad36d46..0176832898 100644 --- a/isis/src/base/objs/LambertConformal/LambertConformal.cpp +++ b/isis/src/base/objs/LambertConformal/LambertConformal.cpp @@ -48,14 +48,14 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } // Compute and write the default center latitude if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(lat)); } // Get the center longitude & latitude diff --git a/isis/src/base/objs/Latitude/Latitude.cpp b/isis/src/base/objs/Latitude/Latitude.cpp index 20097b17b3..da4df2284d 100644 --- a/isis/src/base/objs/Latitude/Latitude.cpp +++ b/isis/src/base/objs/Latitude/Latitude.cpp @@ -94,17 +94,17 @@ namespace Isis { m_polarRadius = NULL; if (mapping.hasKeyword("EquatorialRadius") && mapping.hasKeyword("PolarRadius")) { - m_equatorialRadius = new Distance(toDouble(mapping["EquatorialRadius"][0]), + m_equatorialRadius = new Distance(std::stod(mapping["EquatorialRadius"][0]), Distance::Meters); - m_polarRadius = new Distance(toDouble(mapping["PolarRadius"][0]), + m_polarRadius = new Distance(std::stod(mapping["PolarRadius"][0]), Distance::Meters); } else { try { - PvlGroup radiiGrp = Target::radiiGroup(mapping["TargetName"][0]); - m_equatorialRadius = new Distance(toDouble(radiiGrp["EquatorialRadius"][0]), + PvlGroup radiiGrp = Target::radiiGroup(QString::fromStdString(mapping["TargetName"][0])); + m_equatorialRadius = new Distance(std::stod(radiiGrp["EquatorialRadius"][0]), Distance::Meters); - m_polarRadius = new Distance(toDouble(radiiGrp["PolarRadius"][0]), + m_polarRadius = new Distance(std::stod(radiiGrp["PolarRadius"][0]), Distance::Meters); } catch (IException &e) { @@ -122,7 +122,7 @@ namespace Isis { setPlanetocentric(latitude.radians(), Radians); } else { - QString msg = "Latitude type [" + mapping["LatitudeType"][0] + + std::string msg = "Latitude type [" + mapping["LatitudeType"][0] + "] is not recognized"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -154,17 +154,17 @@ namespace Isis { m_polarRadius = NULL; if (mapping.hasKeyword("EquatorialRadius") && mapping.hasKeyword("PolarRadius")) { - m_equatorialRadius = new Distance(toDouble(mapping["EquatorialRadius"][0]), + m_equatorialRadius = new Distance(std::stod(mapping["EquatorialRadius"][0]), Distance::Meters); - m_polarRadius = new Distance(toDouble(mapping["PolarRadius"][0]), + m_polarRadius = new Distance(std::stod(mapping["PolarRadius"][0]), Distance::Meters); } else { try { - PvlGroup radiiGrp = Target::radiiGroup(mapping["TargetName"][0]); - m_equatorialRadius = new Distance(toDouble(radiiGrp["EquatorialRadius"][0]), + PvlGroup radiiGrp = Target::radiiGroup(QString::fromStdString(mapping["TargetName"][0])); + m_equatorialRadius = new Distance(std::stod(radiiGrp["EquatorialRadius"][0]), Distance::Meters); - m_polarRadius = new Distance(toDouble(radiiGrp["PolarRadius"][0]), + m_polarRadius = new Distance(std::stod(radiiGrp["PolarRadius"][0]), Distance::Meters); } catch (IException &e) { @@ -182,7 +182,7 @@ namespace Isis { setPlanetocentric(latitude, latitudeUnits); } else { - QString msg = "Latitude type [" + mapping["LatitudeType"][0] + + std::string msg = "Latitude type [" + mapping["LatitudeType"][0] + "] is not recognized"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -507,17 +507,17 @@ namespace Isis { Distance equatorialRadius; Distance polarRadius; if (mapping.hasKeyword("EquatorialRadius") && mapping.hasKeyword("PolarRadius")) { - equatorialRadius = Distance(toDouble(mapping["EquatorialRadius"][0]), + equatorialRadius = Distance(std::stod(mapping["EquatorialRadius"][0]), Distance::Meters); - polarRadius = Distance(toDouble(mapping["PolarRadius"][0]), + polarRadius = Distance(std::stod(mapping["PolarRadius"][0]), Distance::Meters); } else { try { - PvlGroup radiiGrp = Target::radiiGroup(mapping["TargetName"][0]); - equatorialRadius = Distance(toDouble(radiiGrp["EquatorialRadius"][0]), + PvlGroup radiiGrp = Target::radiiGroup(QString::fromStdString(mapping["TargetName"][0])); + equatorialRadius = Distance(std::stod(radiiGrp["EquatorialRadius"][0]), Distance::Meters); - polarRadius = Distance(toDouble(radiiGrp["PolarRadius"][0]), + polarRadius = Distance(std::stod(radiiGrp["PolarRadius"][0]), Distance::Meters); } catch (IException &e) { @@ -531,7 +531,7 @@ namespace Isis { else if (mapping["LatitudeType"][0] == "Planetographic") latType = Planetographic; else { - QString msg = "Latitude type [" + mapping["LatitudeType"][0] + "] is not recognized"; + std::string msg = "Latitude type [" + mapping["LatitudeType"][0] + "] is not recognized"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp b/isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp index abe36e63c8..f6f8828529 100644 --- a/isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp +++ b/isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp @@ -161,7 +161,7 @@ namespace Isis { } } else { - QString msg = "PVL for LimitPolygonSeeder must contain [MajorAxisPoints] in ["; + std::string msg = "PVL for LimitPolygonSeeder must contain [MajorAxisPoints] in ["; msg += pvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -174,13 +174,13 @@ namespace Isis { } } else { - QString msg = "PVL for LimitPolygonSeeder must contain [MinorAxisPoints] in ["; + std::string msg = "PVL for LimitPolygonSeeder must contain [MinorAxisPoints] in ["; msg += pvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } } catch(IException &e) { - QString msg = "Improper format for PolygonSeeder PVL [" + pvl.fileName() + "]"; + std::string msg = "Improper format for PolygonSeeder PVL [" + pvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -196,13 +196,13 @@ namespace Isis { } PvlGroup LimitPolygonSeeder::PluginParameters(QString grpName) { - PvlGroup pluginInfo(grpName); + PvlGroup pluginInfo(grpName.toStdString()); - PvlKeyword name("Name", Algorithm()); - PvlKeyword minThickness("MinimumThickness", toString(MinimumThickness())); - PvlKeyword minArea("MinimumArea", toString(MinimumArea())); - PvlKeyword majAxis("MajorAxisPoints", toString(p_majorAxisPts)); - PvlKeyword minAxis("MinorAxisPoints", toString(p_minorAxisPts)); + PvlKeyword name("Name", Algorithm().toStdString()); + PvlKeyword minThickness("MinimumThickness", std::to_string(MinimumThickness())); + PvlKeyword minArea("MinimumArea", std::to_string(MinimumArea())); + PvlKeyword majAxis("MajorAxisPoints", std::to_string(p_majorAxisPts)); + PvlKeyword minAxis("MinorAxisPoints", std::to_string(p_minorAxisPts)); pluginInfo.addKeyword(name); pluginInfo.addKeyword(minThickness); diff --git a/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp b/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp index 100375ce88..025fe849c1 100644 --- a/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp +++ b/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) { cout << "true! ..................................... [ OK ]\n"; else cout << "false! .................................... [ FAILED ]\n"; - mapGroup["PolarRadius"].setValue(toString(42)); + mapGroup["PolarRadius"].setValue(std::to_string(42)); Pvl tmp1; TProjection *p2 = (TProjection *) ProjectionFactory::Create(lab); tmp1.addGroup(p2->Mapping()); diff --git a/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp b/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp index b496806331..a20a31ab09 100755 --- a/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp +++ b/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp @@ -107,7 +107,7 @@ namespace Isis { // If the format is Keyword="1,2,3,4,5" rather than Keyword = (1,2,3,4,5) if (phaseList.size() == 1) { - SetPhotoPhaseList(QString(phaseList)); + SetPhotoPhaseList(QString::fromStdString(phaseList)); return; } @@ -115,7 +115,7 @@ namespace Isis { p_photoPhaseList.clear(); for (int i=0; i< phaseList.size(); i++) { - phaseAngle = phaseList[i].toDouble(); + phaseAngle = std::stod(phaseList[i]); if (phaseAngle < 0.0 || phaseAngle > 180.0) { QString msg = "Invalid value of empirical Lunar Lambert phase angle list value [" + @@ -163,13 +163,13 @@ namespace Isis { // If the format is Keyword="1,2,3,4,5" rather than Keyword = (1,2,3,4,5) if (lstrList.size() == 1) { - SetPhotoLList(QString(lstrList)); + SetPhotoLList(QString::fromStdString(lstrList)); return; } p_photoLList.clear(); for (int i=0; i 180.0) { QString msg = "Invalid value of empirical Minnaert phase angle list value [" + @@ -162,13 +162,13 @@ namespace Isis { // If the format is Keyword="1,2,3,4,5" rather than Keyword = (1,2,3,4,5) if (kstrList.size() == 1) { - SetPhotoKList(QString(kstrList)); + SetPhotoKList(QString::fromStdString(kstrList)); return; } p_photoKList.clear(); for (int i=0; isecond.second.name().isEmpty()) { + if(!QString::fromStdString(translationIterator->second.second.name()).isEmpty()) { snGroup += translationIterator->second.second; } else { - snGroup += PvlKeyword("ObservationKeys", toString(snGroup.keywords())); + snGroup += PvlKeyword("ObservationKeys", std::to_string(snGroup.keywords())); } return snGroup; diff --git a/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp b/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp index 3a09d297bf..e9ace9ce02 100644 --- a/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp +++ b/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp @@ -83,10 +83,10 @@ namespace Isis { blob.setData((char*)orglblStr.data(), orglblStr.length()); blob.Label() += Isis::PvlKeyword("ByteOrder", "NULL"); if (Isis::IsLsb()) { - blob.Label()["ByteOrder"] = Isis::ByteOrderName(Isis::Lsb); + blob.Label()["ByteOrder"] = Isis::ByteOrderName(Isis::Lsb).toStdString(); } else { - blob.Label()["ByteOrder"] = Isis::ByteOrderName(Isis::Msb); + blob.Label()["ByteOrder"] = Isis::ByteOrderName(Isis::Msb).toStdString(); } return blob; } diff --git a/isis/src/base/objs/Orthographic/Orthographic.cpp b/isis/src/base/objs/Orthographic/Orthographic.cpp index aa4097e361..235fb5b120 100644 --- a/isis/src/base/objs/Orthographic/Orthographic.cpp +++ b/isis/src/base/objs/Orthographic/Orthographic.cpp @@ -48,7 +48,7 @@ namespace Isis { */ if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } /* @@ -57,7 +57,7 @@ namespace Isis { */ if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(lat)); } // Get the center longitude & latitude diff --git a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp index 5c6e0550ad..dbc099ca5b 100644 --- a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp +++ b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp @@ -197,29 +197,29 @@ namespace Isis { } // Add keywords for OverlapStatistics data - PvlObject o(name); - o += PvlKeyword("File1", FileNameX().name()); - o += PvlKeyword("File2", FileNameY().name()); - o += PvlKeyword("Width", toString(Samples())); - o += PvlKeyword("Height", toString(Lines())); - o += PvlKeyword("Bands", toString(Bands())); - o += PvlKeyword("SamplingPercent", toString(SampPercent())); - o += PvlKeyword("MinCount", toString(MinCount())); // Do we need this if EqInfo has this? + PvlObject o(name.toStdString()); + o += PvlKeyword("File1", FileNameX().name().toStdString()); + o += PvlKeyword("File2", FileNameY().name().toStdString()); + o += PvlKeyword("Width", std::to_string(Samples())); + o += PvlKeyword("Height", std::to_string(Lines())); + o += PvlKeyword("Bands", std::to_string(Bands())); + o += PvlKeyword("SamplingPercent", std::to_string(SampPercent())); + o += PvlKeyword("MinCount", std::to_string(MinCount())); // Do we need this if EqInfo has this? // Create group for first file of overlap PvlGroup gX("File1"); - PvlKeyword stsX("StartSample", toString(StartSampleX())); - PvlKeyword ensX("EndSample", toString(EndSampleX())); - PvlKeyword stlX("StartLine", toString(StartLineX())); - PvlKeyword enlX("EndLine", toString(EndLineX())); + PvlKeyword stsX("StartSample", std::to_string(StartSampleX())); + PvlKeyword ensX("EndSample", std::to_string(EndSampleX())); + PvlKeyword stlX("StartLine", std::to_string(StartLineX())); + PvlKeyword enlX("EndLine", std::to_string(EndLineX())); PvlKeyword avgX("Average"); PvlKeyword stdX("StandardDeviation"); PvlKeyword varX("Variance"); for (int band = 1; band <= Bands(); band++) { if (HasOverlap(band)) { - avgX += toString(GetMStats(band).X().Average()); - stdX += toString(GetMStats(band).X().StandardDeviation()); - varX += toString(GetMStats(band).X().Variance()); + avgX += std::to_string(GetMStats(band).X().Average()); + stdX += std::to_string(GetMStats(band).X().StandardDeviation()); + varX += std::to_string(GetMStats(band).X().Variance()); } } gX += stsX; @@ -232,18 +232,18 @@ namespace Isis { // Create group for second file of overlap PvlGroup gY("File2"); - PvlKeyword stsY("StartSample", toString(StartSampleY())); - PvlKeyword ensY("EndSample", toString(EndSampleY())); - PvlKeyword stlY("StartLine", toString(StartLineY())); - PvlKeyword enlY("EndLine", toString(EndLineY())); + PvlKeyword stsY("StartSample", std::to_string(StartSampleY())); + PvlKeyword ensY("EndSample", std::to_string(EndSampleY())); + PvlKeyword stlY("StartLine", std::to_string(StartLineY())); + PvlKeyword enlY("EndLine", std::to_string(EndLineY())); PvlKeyword avgY("Average"); PvlKeyword stdY("StandardDeviation"); PvlKeyword varY("Variance"); for (int band = 1; band <= Bands(); band++) { if (HasOverlap(band)) { - avgY += toString(GetMStats(band).Y().Average()); - stdY += toString(GetMStats(band).Y().StandardDeviation()); - varY += toString(GetMStats(band).Y().Variance()); + avgY += std::to_string(GetMStats(band).Y().Average()); + stdY += std::to_string(GetMStats(band).Y().StandardDeviation()); + varY += std::to_string(GetMStats(band).Y().Variance()); } } gY += stsY; @@ -297,8 +297,8 @@ namespace Isis { const PvlGroup &fileX = inStats.findGroup("File1"); const PvlGroup &fileY = inStats.findGroup("File2"); - p_xFile = inStats["File1"][0]; - p_yFile = inStats["File2"][0]; + p_xFile = QString::fromStdString(inStats["File1"][0]); + p_yFile = QString::fromStdString(inStats["File2"][0]); p_sampRange = inStats["Width"]; p_lineRange = inStats["Height"]; p_bands = inStats["Bands"]; @@ -319,7 +319,7 @@ namespace Isis { // unserialize the MStats for (int band = 1; band <= Bands(); band++) { QString name = "MultivariateStatistics" + toString(band); - const PvlObject &mStats = inStats.findObject(name); + const PvlObject &mStats = inStats.findObject(name.toStdString()); p_stats.push_back(MultivariateStatistics(mStats)); } diff --git a/isis/src/base/objs/PhotoModel/PhotoModel.cpp b/isis/src/base/objs/PhotoModel/PhotoModel.cpp index 8fada91156..3ad4f2f8a2 100644 --- a/isis/src/base/objs/PhotoModel/PhotoModel.cpp +++ b/isis/src/base/objs/PhotoModel/PhotoModel.cpp @@ -29,10 +29,10 @@ namespace Isis { // Use 'PhtName' instead of 'Name' if using the Gui combo box // for unique Pvl keyword in DefFile if(algorithm.hasKeyword("PhtName")) { - p_photoAlgorithmName = algorithm["PhtName"][0]; + p_photoAlgorithmName = QString::fromStdString(algorithm["PhtName"][0]); } else if(algorithm.hasKeyword("Name")) { - p_photoAlgorithmName = algorithm["Name"][0]; + p_photoAlgorithmName = QString::fromStdString(algorithm["Name"][0]); } else { IString msg = "Keyword [Name] or keyword [PhtName] must "; diff --git a/isis/src/base/objs/PhotoModelFactory/PhotoModelFactory.cpp b/isis/src/base/objs/PhotoModelFactory/PhotoModelFactory.cpp index e7d1c116fb..0328845a77 100644 --- a/isis/src/base/objs/PhotoModelFactory/PhotoModelFactory.cpp +++ b/isis/src/base/objs/PhotoModelFactory/PhotoModelFactory.cpp @@ -39,10 +39,10 @@ namespace Isis { QString algorithm = ""; if (algo.hasKeyword("PhtName")) { - algorithm = algo["PhtName"][0]; + algorithm = QString::fromStdString(algo["PhtName"][0]); } else if (algo.hasKeyword("Name")) { - algorithm = algo["Name"][0]; + algorithm = QString::fromStdString(algo["Name"][0]); } else { QString msg = "Keyword [Name] or keyword [PhtName] must "; diff --git a/isis/src/base/objs/Pipeline/Pipeline.cpp b/isis/src/base/objs/Pipeline/Pipeline.cpp index df1fdb5f90..1efb46ba47 100644 --- a/isis/src/base/objs/Pipeline/Pipeline.cpp +++ b/isis/src/base/objs/Pipeline/Pipeline.cpp @@ -877,7 +877,7 @@ namespace Isis { */ QString Pipeline::TemporaryFolder() { Pvl &pref = Preference::Preferences(); - return pref.findGroup("DataDirectory")["Temporary"]; + return QString::fromStdString(pref.findGroup("DataDirectory")["Temporary"]); } diff --git a/isis/src/base/objs/Planar/Planar.cpp b/isis/src/base/objs/Planar/Planar.cpp index 18ac7763db..4bd2535358 100644 --- a/isis/src/base/objs/Planar/Planar.cpp +++ b/isis/src/base/objs/Planar/Planar.cpp @@ -50,14 +50,14 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterRingLongitude"))) { double azimuth = (m_minimumRingLongitude + m_maximumRingLongitude) / 2.0; - mapGroup += PvlKeyword("CenterRingLongitude", toString(azimuth)); + mapGroup += PvlKeyword("CenterRingLongitude", std::to_string(azimuth)); } // Compute and write the default center radius if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterRingRadius"))) { double radius = (m_minimumRingRadius + m_maximumRingRadius) / 2.0; - mapGroup += PvlKeyword("CenterRingRadius", toString(radius)); + mapGroup += PvlKeyword("CenterRingRadius", std::to_string(radius)); } // Get the center longitude & radius @@ -434,11 +434,11 @@ namespace Isis { PvlGroup Planar::Mapping() { PvlGroup mapping = RingPlaneProjection::Mapping(); - mapping += PvlKeyword("CenterRingRadius", toString(m_centerRingRadius)); + mapping += PvlKeyword("CenterRingRadius", std::to_string(m_centerRingRadius)); double dir = 1.0; if (m_ringLongitudeDirection == Clockwise) dir = -1.0; double lonDegrees = m_centerRingLongitude*RAD2DEG*dir; - mapping += PvlKeyword("CenterRingLongitude", toString(lonDegrees)); + mapping += PvlKeyword("CenterRingLongitude", std::to_string(lonDegrees)); return mapping; } diff --git a/isis/src/base/objs/Plugin/Plugin.cpp b/isis/src/base/objs/Plugin/Plugin.cpp index a6e6c7197c..a5256489c9 100644 --- a/isis/src/base/objs/Plugin/Plugin.cpp +++ b/isis/src/base/objs/Plugin/Plugin.cpp @@ -38,13 +38,13 @@ namespace Isis { */ QFunctionPointer Plugin::GetPlugin(const QString &group) { // Get the library and plugin to load - PvlGroup &g = findGroup(group); - QString library = g["Library"]; + PvlGroup &g = findGroup(group.toStdString()); + QString library = QString::fromStdString(g["Library"]); QString path = "./"; Isis::FileName libraryFile(path + library); - QString pluginName = g["Routine"]; + QString pluginName = QString::fromStdString(g["Routine"]); // Open the library, resolve the routine name, and return the function // address. The function will stay in memory until the application exists diff --git a/isis/src/base/objs/PointPerspective/PointPerspective.cpp b/isis/src/base/objs/PointPerspective/PointPerspective.cpp index 75528b8af4..6fb6202f9b 100644 --- a/isis/src/base/objs/PointPerspective/PointPerspective.cpp +++ b/isis/src/base/objs/PointPerspective/PointPerspective.cpp @@ -46,14 +46,14 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } // Compute and write the default center latitude if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(lat)); } // Get the center longitude & latitude diff --git a/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp b/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp index f8aee64754..d6bb6f2963 100644 --- a/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp +++ b/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp @@ -49,7 +49,7 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } // Compute and write the default center latitude if allowed and @@ -57,10 +57,10 @@ namespace Isis { if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; if (lat > 0.0) { - mapGroup += PvlKeyword("CenterLatitude", toString(90.0)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(90.0)); } else { - mapGroup += PvlKeyword("CenterLatitude", toString(-90.0)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(-90.0)); } } diff --git a/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp b/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp index e2afcf936b..322f8bd010 100644 --- a/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp +++ b/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp @@ -97,7 +97,7 @@ namespace Isis { // Set the algorithm name errorSpot = "Name"; - p_algorithmName = (QString) algo["Name"]; + p_algorithmName = QString::fromStdString(algo["Name"]); if(invalgo.hasKeyword("Name")) invalgo.deleteKeyword("Name"); @@ -123,8 +123,8 @@ namespace Isis { invalgo.deleteKeyword("MinimumArea"); } catch(IException &e) { - QString msg = "Improper format for PolygonSeeder PVL ["; - msg += pvl.fileName() + "]. Location [" + errorSpot + "]"; + std::string msg = "Improper format for PolygonSeeder PVL ["; + msg += pvl.fileName() + "]. Location [" + errorSpot.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -146,18 +146,18 @@ namespace Isis { QString PolygonSeeder::StandardTests(const geos::geom::MultiPolygon *xymp, const geos::geom::Envelope *xyBoundBox) { if(xymp->getArea() < MinimumArea()) { - QString msg = "Polygon did not meet the minimum area of ["; - msg += toString(MinimumArea()) + "]"; - return msg; + std::string msg = "Polygon did not meet the minimum area of ["; + msg += std::to_string(MinimumArea()) + "]"; + return QString::fromStdString(msg); } double thickness = xymp->getArea() / pow(std::max(xyBoundBox->getWidth(), xyBoundBox->getHeight()), 2.0); if(thickness < MinimumThickness()) { - QString msg = "Polygon did not meet the minimum thickness ratio of ["; - msg += toString(MinimumThickness()) + "]"; - return msg; + std::string msg = "Polygon did not meet the minimum thickness ratio of ["; + msg += std::to_string(MinimumThickness()) + "]"; + return QString::fromStdString(msg); } return ""; @@ -208,11 +208,11 @@ namespace Isis { * */ PvlGroup PolygonSeeder::PluginParameters(QString grpName) { - PvlGroup pluginInfo(grpName); + PvlGroup pluginInfo(grpName.toStdString()); - PvlKeyword name("Name", p_algorithmName); - PvlKeyword minThickness("MinimumThickness", toString(p_minimumThickness)); - PvlKeyword minArea("MinimumArea", toString(p_minimumArea)); + PvlKeyword name("Name", p_algorithmName.toStdString()); + PvlKeyword minThickness("MinimumThickness", std::to_string(p_minimumThickness)); + PvlKeyword minArea("MinimumArea", std::to_string(p_minimumArea)); pluginInfo.addKeyword(name); pluginInfo.addKeyword(minThickness); diff --git a/isis/src/base/objs/PolygonSeederFactory/PolygonSeederFactory.cpp b/isis/src/base/objs/PolygonSeederFactory/PolygonSeederFactory.cpp index e649f169ed..daf0f04fb5 100644 --- a/isis/src/base/objs/PolygonSeederFactory/PolygonSeederFactory.cpp +++ b/isis/src/base/objs/PolygonSeederFactory/PolygonSeederFactory.cpp @@ -36,7 +36,7 @@ namespace Isis { PolygonSeeder *PolygonSeederFactory::Create(Pvl &pvl) { // Get the algorithm name to create PvlGroup &algo = pvl.findGroup("PolygonSeederAlgorithm", Pvl::Traverse); - QString algorithm = algo["Name"]; + QString algorithm = QString::fromStdString(algo["Name"]); // Open the factory plugin file Plugin p; diff --git a/isis/src/base/objs/Process/Process.cpp b/isis/src/base/objs/Process/Process.cpp index b004663529..c5fcff3493 100644 --- a/isis/src/base/objs/Process/Process.cpp +++ b/isis/src/base/objs/Process/Process.cpp @@ -410,7 +410,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns Isis::Pvl &inlab = *InputCubes[0]->label(); for(int i = 0; i < inlab.objects(); i++) { if(inlab.object(i).isNamed("Table")) { - Isis::Blob t((QString)inlab.object(i)["Name"], inlab.object(i).name()); + Isis::Blob t(QString::fromStdString(inlab.object(i)["Name"]), inlab.object(i).name()); InputCubes[0]->read(t); cube->write(t); } @@ -422,7 +422,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns Isis::Pvl &inlab = *InputCubes[0]->label(); for(int i = 0; i < inlab.objects(); i++) { if(inlab.object(i).isNamed("Polygon")) { - Isis::Blob t((QString)inlab.object(i)["Name"], inlab.object(i).name()); + Isis::Blob t(QString::fromStdString(inlab.object(i)["Name"]), inlab.object(i).name()); InputCubes[0]->read(t); cube->write(t); } @@ -434,7 +434,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns Isis::Pvl &inlab = *InputCubes[0]->label(); for(int i = 0; i < inlab.objects(); i++) { if(inlab.object(i).isNamed("OriginalLabel")) { - Isis::OriginalLabel ol = InputCubes[0]->readOriginalLabel(inlab.object(i)["Name"]); + Isis::OriginalLabel ol = InputCubes[0]->readOriginalLabel(QString::fromStdString(inlab.object(i)["Name"])); cube->write(ol); } } @@ -663,7 +663,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns */ void Process::PropagateLabels(const QString &cube) { // Open the Pvl file - Isis::Pvl inLabels(cube); + Isis::Pvl inLabels(cube.toStdString()); // Loop for each output cube for(int i = 0; i < (int)OutputCubes.size(); i++) { @@ -721,8 +721,8 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns const PvlObject &object = fromLabels->object(j); if (object.isNamed("Table")) { - if (tableNames.isEmpty() || tableNames.contains(object["Name"])) { - Blob table((QString) object["Name"], object.name()); + if (tableNames.isEmpty() || tableNames.contains(QString::fromStdString(object["Name"]))) { + Blob table(QString::fromStdString(object["Name"]), object.name()); fromCube->read(table); OutputCubes[i]->write(table); } @@ -788,7 +788,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns QString Process::MissionData(const QString &mission, const QString &file, bool highestVersion) { Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory"); - QString dir = dataDir[mission]; + QString dir = QString::fromStdString(dataDir[mission.toStdString()]); // See if the data directory is installed Isis::FileName installed(dir); @@ -826,7 +826,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns Isis::Pvl & inlab = *InputCubes[0]->label(); for(int i = 0; i < inlab.objects(); i++) { if(inlab.object(i).isNamed("History") && Isis::iApp != NULL) { - QString histBlobName = (QString)inlab.object(i)["Name"]; + QString histBlobName = QString::fromStdString(inlab.object(i)["Name"]); History h = InputCubes[0]->readHistory(histBlobName); h.AddEntry(); cube.write(h, histBlobName); diff --git a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp index 5be9098b62..328152285e 100644 --- a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp +++ b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp @@ -219,7 +219,7 @@ namespace Isis { sImageFile += ".img"; } FileName outFile(sImageFile); - mainPvl += PvlKeyword("^IMAGE", outFile.name()); + mainPvl += PvlKeyword("^IMAGE", outFile.name().toStdString()); } else { mainPvl += PvlKeyword("^IMAGE", "???????", "BYTES"); @@ -256,13 +256,13 @@ namespace Isis { } FileName outFile(sImageFile); PvlObject cmpObj("COMPRESSED_FILE"); - cmpObj += PvlKeyword("FILE_NAME", outFile.name()); + cmpObj += PvlKeyword("FILE_NAME", outFile.name().toStdString()); cmpObj += PvlKeyword("RECORD_TYPE", "UNDEFINED"); cmpObj += PvlKeyword("ENCODING_TYPE", "JP2"); cmpObj += PvlKeyword("ENCODING_TYPE_VERSION_NAME", "ISO/IEC15444-1:2004"); cmpObj += PvlKeyword("INTERCHANGE_FORMAT", "BINARY"); FileName infilename(InputCubes[0]->fileName()); - cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name()); + cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name().toStdString()); int storagebytes = InputCubes[0]->sampleCount() * InputCubes[0]->lineCount(); if(p_pixelType == Isis::Real) { QString msg = "JPEG2000 does not support floating point data."; @@ -271,18 +271,18 @@ namespace Isis { if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { storagebytes = storagebytes * 2; } - cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", toString(storagebytes)); + cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", std::to_string(storagebytes)); mainPvl.addObject(cmpObj); PvlObject ucmpObj("UNCOMPRESSED_FILE"); - ucmpObj += PvlKeyword("FILE_NAME", infilename.name()); + ucmpObj += PvlKeyword("FILE_NAME", infilename.name().toStdString()); ucmpObj += PvlKeyword("RECORD_TYPE", "FIXED_LENGTH"); int recordbytes = InputCubes[0]->sampleCount(); if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { recordbytes = recordbytes * 2; } - ucmpObj += PvlKeyword("RECORD_BYTES", toString(recordbytes)); - ucmpObj += PvlKeyword("FILE_RECORDS", toString(InputCubes[0]->lineCount())); - ucmpObj += PvlKeyword("^IMAGE", infilename.name()); + ucmpObj += PvlKeyword("RECORD_BYTES", std::to_string(recordbytes)); + ucmpObj += PvlKeyword("FILE_RECORDS", std::to_string(InputCubes[0]->lineCount())); + ucmpObj += PvlKeyword("^IMAGE", infilename.name().toStdString()); mainPvl.addObject(ucmpObj); } @@ -311,7 +311,7 @@ namespace Isis { sImageFile += ".img"; } FileName outFile(sImageFile); - mainPvl += PvlKeyword("^IMAGE", outFile.name()); + mainPvl += PvlKeyword("^IMAGE", outFile.name().toStdString()); } else { mainPvl += PvlKeyword("^IMAGE", "???"); @@ -347,13 +347,13 @@ namespace Isis { } FileName outFile(sImageFile); PvlObject cmpObj("COMPRESSED_FILE"); - cmpObj += PvlKeyword("FILE_NAME", outFile.name()); + cmpObj += PvlKeyword("FILE_NAME", outFile.name().toStdString()); cmpObj += PvlKeyword("RECORD_TYPE", "UNDEFINED"); cmpObj += PvlKeyword("ENCODING_TYPE", "JP2"); cmpObj += PvlKeyword("ENCODING_TYPE_VERSION_NAME", "ISO/IEC15444-1:2004"); cmpObj += PvlKeyword("INTERCHANGE_FORMAT", "BINARY"); FileName infilename(InputCubes[0]->fileName()); - cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name()); + cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name().toStdString()); int storagebytes = InputCubes[0]->sampleCount() * InputCubes[0]->lineCount(); if(p_pixelType == Isis::Real) { QString msg = "JPEG2000 does not support floating point data."; @@ -362,18 +362,18 @@ namespace Isis { if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { storagebytes = storagebytes * 2; } - cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", toString(storagebytes)); + cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", std::to_string(storagebytes)); mainPvl.addObject(cmpObj); PvlObject ucmpObj("UNCOMPRESSED_FILE"); - ucmpObj += PvlKeyword("FILE_NAME", infilename.name()); + ucmpObj += PvlKeyword("FILE_NAME", infilename.name().toStdString()); ucmpObj += PvlKeyword("RECORD_TYPE", "FIXED_LENGTH"); int recordbytes = InputCubes[0]->sampleCount(); if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { recordbytes = recordbytes * 2; } - ucmpObj += PvlKeyword("RECORD_BYTES", toString(recordbytes)); - ucmpObj += PvlKeyword("FILE_RECORDS", toString(InputCubes[0]->lineCount())); - ucmpObj += PvlKeyword("^IMAGE", infilename.name()); + ucmpObj += PvlKeyword("RECORD_BYTES", std::to_string(recordbytes)); + ucmpObj += PvlKeyword("FILE_RECORDS", std::to_string(InputCubes[0]->lineCount())); + ucmpObj += PvlKeyword("^IMAGE", infilename.name().toStdString()); mainPvl.addObject(ucmpObj); } @@ -436,68 +436,68 @@ namespace Isis { if(!m_forceBandwidth && imgObj.hasKeyword("BANDWIDTH")) imgObj.deleteKeyword("BANDWIDTH"); if(m_forceBandStorageType) imgObj += PvlKeyword("BAND_STORAGE_TYPE", "BAND_SEQUENTIAL"); - if(m_forceOffset) imgObj += PvlKeyword("OFFSET", toString(base)); - if(m_forceScalingFactor) imgObj += PvlKeyword("SCALING_FACTOR", toString(multiplier)); + if(m_forceOffset) imgObj += PvlKeyword("OFFSET", std::to_string(base)); + if(m_forceScalingFactor) imgObj += PvlKeyword("SCALING_FACTOR", std::to_string(multiplier)); // Manually set the keyword for pixel type and special pixels if(p_pixelType == Isis::UnsignedByte) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "8"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string(0xff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel8.typ"); } else if((p_pixelType == Isis::UnsignedWord) && (p_endianType == Isis::Msb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::UnsignedWord) && (p_endianType == Isis::Lsb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "LSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::SignedWord) && (p_endianType == Isis::Msb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::SignedWord) && (p_endianType == Isis::Lsb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString((BigInt)0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string((BigInt)0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "LSB_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if(p_pixelType == Isis::Real) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "32"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString((BigInt)0xffffffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string((BigInt)0xffffffff)); if(p_endianType == Isis::Msb) { if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "IEEE_REAL"); @@ -505,11 +505,11 @@ namespace Isis { else { if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "PC_REAL"); } - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString(Isis::INULL4)); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString(Isis::ILOW_REPR_SAT4)); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString(Isis::ILOW_INSTR_SAT4)); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString(Isis::IHIGH_REPR_SAT4)); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString(Isis::IHIGH_INSTR_SAT4)); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string(Isis::INULL4)); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string(Isis::ILOW_REPR_SAT4)); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string(Isis::ILOW_INSTR_SAT4)); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string(Isis::IHIGH_REPR_SAT4)); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string(Isis::IHIGH_INSTR_SAT4)); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel32.typ"); } else { @@ -580,68 +580,68 @@ namespace Isis { if(!m_forceBandwidth && imgObj.hasKeyword("BANDWIDTH")) imgObj.deleteKeyword("BANDWIDTH"); if(m_forceBandStorageType) imgObj += PvlKeyword("BAND_STORAGE_TYPE", "BAND_SEQUENTIAL"); - if(m_forceOffset) imgObj += PvlKeyword("OFFSET", toString(base)); - if(m_forceScalingFactor) imgObj += PvlKeyword("SCALING_FACTOR", toString(multiplier)); + if(m_forceOffset) imgObj += PvlKeyword("OFFSET", std::to_string(base)); + if(m_forceScalingFactor) imgObj += PvlKeyword("SCALING_FACTOR", std::to_string(multiplier)); // Manually set the keyword for pixel type and special pixels if(p_pixelType == Isis::UnsignedByte) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "8"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string(0xff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel8.typ"); } else if((p_pixelType == Isis::UnsignedWord) && (p_endianType == Isis::Msb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::UnsignedWord) && (p_endianType == Isis::Lsb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "LSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::SignedWord) && (p_endianType == Isis::Msb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::SignedWord) && (p_endianType == Isis::Lsb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString((BigInt)0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string((BigInt)0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "LSB_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if(p_pixelType == Isis::Real) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "32"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString((BigInt)0xffffffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", std::to_string((BigInt)0xffffffff)); if(p_endianType == Isis::Msb) { if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "IEEE_REAL"); @@ -649,11 +649,11 @@ namespace Isis { else { if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "PC_REAL"); } - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString(Isis::INULL4)); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString(Isis::ILOW_REPR_SAT4)); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString(Isis::ILOW_INSTR_SAT4)); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString(Isis::IHIGH_REPR_SAT4)); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString(Isis::IHIGH_INSTR_SAT4)); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", std::to_string(Isis::INULL4)); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", std::to_string(Isis::ILOW_REPR_SAT4)); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", std::to_string(Isis::ILOW_INSTR_SAT4)); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", std::to_string(Isis::IHIGH_REPR_SAT4)); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", std::to_string(Isis::IHIGH_INSTR_SAT4)); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel32.typ"); } else { @@ -698,62 +698,62 @@ namespace Isis { // Modify the radii to be km. PvlKeyword &aRadius = pdsMapObj["A_AXIS_RADIUS"]; - QString unit = aRadius.unit(); + QString unit = QString::fromStdString(aRadius.unit()); if( (unit.toUpper() == "METERS") || (unit == "") ) { //if no units, assume in meters double dValue = (double)aRadius; dValue /= 1000.0; - aRadius.setValue(toString(dValue), "KM"); + aRadius.setValue(std::to_string(dValue), "KM"); } PvlKeyword &bRadius = pdsMapObj["B_AXIS_RADIUS"]; - unit = bRadius.unit(); + unit = QString::fromStdString(bRadius.unit()); if( (unit.toUpper() == "METERS") || (unit == "") ) { double dValue = (double)bRadius; dValue /= 1000.0; - bRadius.setValue(toString(dValue), "KM"); + bRadius.setValue(std::to_string(dValue), "KM"); } PvlKeyword &cRadius = pdsMapObj["C_AXIS_RADIUS"]; - unit = cRadius.unit(); + unit = QString::fromStdString(cRadius.unit()); if( (unit.toUpper() == "METERS") || (unit == "") ) { double dValue = (double)cRadius; dValue /= 1000.0; - cRadius.setValue(toString(dValue), "KM"); + cRadius.setValue(std::to_string(dValue), "KM"); } // Modify the units on MAP_SCALE and MAP_RESOLUTION PvlKeyword &mapScale = pdsMapObj["MAP_SCALE"]; - unit = mapScale.unit(); + unit = QString::fromStdString(mapScale.unit()); //if no units, assume in meters/pixel if( (unit.toUpper() == "METERS/PIX") || (unit.toUpper() == "METERS/PIXEL") || (unit == "") ) { if(m_exportResolution == Kilometer) { double dValue = (double)mapScale; dValue /= 1000.0; - mapScale.setValue(toString(dValue), "KM/PIXEL"); + mapScale.setValue(std::to_string(dValue), "KM/PIXEL"); } else { - mapScale.setValue(toString((double)mapScale), "METERS/PIXEL"); + mapScale.setValue(std::to_string((double)mapScale), "METERS/PIXEL"); } } PvlKeyword &mapRes = pdsMapObj["MAP_RESOLUTION"]; - unit = mapRes.unit(); + unit = QString::fromStdString(mapRes.unit()); //if no units, asume in pixels/degree if( (unit.toUpper() == "PIXELS/DEGREE") || (unit == "") ) { - mapRes.setValue((QString)mapRes, "PIX/DEG"); + mapRes.setValue(mapRes, "PIX/DEG"); } // Add the EASTERNMOST AND WESTERNMOST LONGITUDE keywords PvlKeyword &isisLonDir = inputMapping.findKeyword("LongitudeDirection"); - QString lonDir = isisLonDir[0]; + QString lonDir = QString::fromStdString(isisLonDir[0]); lonDir = lonDir.toUpper(); if (inputMapping.hasKeyword("MaximumLongitude") && inputMapping.hasKeyword("MinimumLongitude")) { double maxLon = inputMapping.findKeyword("MaximumLongitude"); double minLon = inputMapping.findKeyword("MinimumLongitude"); if(lonDir == "POSITIVEEAST") { - pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", toString(maxLon)); - pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", toString(minLon)); + pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", std::to_string(maxLon)); + pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", std::to_string(minLon)); } else { - pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", toString(minLon)); - pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", toString(maxLon)); + pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", std::to_string(minLon)); + pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", std::to_string(maxLon)); } } @@ -765,12 +765,12 @@ namespace Isis { lineOffset /= (double)inputMapping.findKeyword("PixelResolution"); lineOffset *= 1.0; lineOffset -= 0.5; // Add half a line to get to the center of (1,1) - pdsMapObj += PvlKeyword("LINE_PROJECTION_OFFSET", toString(lineOffset), "PIXEL"); + pdsMapObj += PvlKeyword("LINE_PROJECTION_OFFSET", std::to_string(lineOffset), "PIXEL"); double sampleOffset = inputMapping.findKeyword("UpperLeftCornerX"); sampleOffset /= (double)inputMapping.findKeyword("PixelResolution"); sampleOffset *= -1.0; sampleOffset -= 0.5; // Add half a sample to get to the center of (1,1) - pdsMapObj += PvlKeyword("SAMPLE_PROJECTION_OFFSET", toString(sampleOffset), "PIXEL"); + pdsMapObj += PvlKeyword("SAMPLE_PROJECTION_OFFSET", std::to_string(sampleOffset), "PIXEL"); // Add units to keywords already in the IMAGE_MAP_PROJECTION object as necessary if(pdsMapObj.hasKeyword("CENTER_LATITUDE")) { @@ -889,9 +889,9 @@ namespace Isis { if(m_exportType == Stream) { if(m_pdsFileType != ProcessExportPds::JP2Image) { - (*m_label)["LABEL_RECORDS"].setValue(toString(labSize), "BYTES"); + (*m_label)["LABEL_RECORDS"].setValue(std::to_string(labSize), "BYTES"); if(!m_detachedLabel) { - (*m_label)["^IMAGE"].setValue(toString(labSize + 1), "BYTES"); + (*m_label)["^IMAGE"].setValue(std::to_string(labSize + 1), "BYTES"); } } if(m_label->format() != NULL) { @@ -910,13 +910,13 @@ namespace Isis { int labelRecords; if(m_pdsFileType != ProcessExportPds::JP2Image) { lineBytes = LineBytes(); - (*m_label)["RECORD_BYTES"].setValue(toString(lineBytes)); + (*m_label)["RECORD_BYTES"].setValue(std::to_string(lineBytes)); // The number of label records is dependent on the number of label bytes // and the lint bytes labelRecords = (int)ceil((double)labSize / (double)lineBytes); if(m_label->hasKeyword("LABEL_RECORDS")) { //LRO MRF doesn't have this keyword - (*m_label)["LABEL_RECORDS"].setValue(toString(labelRecords)); + (*m_label)["LABEL_RECORDS"].setValue(std::to_string(labelRecords)); } int totalTableRecords = 0; for (unsigned int i = 0; i < m_tableRecords.size(); i++) { @@ -925,10 +925,10 @@ namespace Isis { int imageRecords = InputCubes[0]->lineCount() * InputCubes[0]->bandCount(); int fileRecords = labelRecords + imageRecords + totalTableRecords; - (*m_label)["FILE_RECORDS"].setValue(toString(fileRecords)); + (*m_label)["FILE_RECORDS"].setValue(std::to_string(fileRecords)); if(!m_detachedLabel) { - (*m_label)["^IMAGE"].setValue(toString(labelRecords + 1)); + (*m_label)["^IMAGE"].setValue(std::to_string(labelRecords + 1)); } } if(m_label->format() != NULL) { @@ -957,7 +957,7 @@ namespace Isis { // OuputLabel() has already created the label and necessary padding, we can simply update // the CHECKSUM value to the generated checksum and re-write the entire label. pdsFileStream.seekp(0); - (*m_label)["CHECKSUM"].setValue(checksum()); + (*m_label)["CHECKSUM"].setValue(checksum().toStdString()); pdsFileStream << *m_label; } @@ -1034,10 +1034,10 @@ namespace Isis { } // for start record values, indexing begins with 1 int tableStartRecord = 1 + labelRecords + imageRecords + totalTableRecords; - mainPvl += PvlKeyword("^" + pdsTableName, toString(tableStartRecord)); + mainPvl += PvlKeyword("^" + pdsTableName.toStdString(), std::to_string(tableStartRecord)); } else { - mainPvl += PvlKeyword("^" + pdsTableName, detachedPdsTableFileName); + mainPvl += PvlKeyword("^" + pdsTableName.toStdString(), detachedPdsTableFileName.toStdString()); FileName labelFile(m_detachedPdsLabelFile); QString tableFileWithPath = labelFile.path() + "/" + detachedPdsTableFileName; diff --git a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp index 3054b70e49..d0710d82aa 100644 --- a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp +++ b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp @@ -627,13 +627,13 @@ namespace Isis { throw IException(IException::Programmer, msg, _FILEINFO_); } - QString units = center.unit(); + QString units = QString::fromStdString(center.unit()); - if (!width.unit().isEmpty() ) { + if (!QString::fromStdString(width.unit()).isEmpty() ) { if (units.isEmpty()) { - units = width.unit(); + units = QString::fromStdString(width.unit()); } - if (units.compare(width.unit(), Qt::CaseInsensitive) != 0) { + if (units.compare(QString::fromStdString(width.unit()), Qt::CaseInsensitive) != 0) { QString msg = "Unable to translate BandBin info for BinSetSpectrum. " "Unknown or unmatching units for [center_value] and [bin_width]."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -683,21 +683,21 @@ namespace Isis { QDomElement centerValue = m_domDoc->createElement("sp:center_value"); - PvlToXmlTranslationManager::setElementValue(centerValue, center[i], units); + PvlToXmlTranslationManager::setElementValue(centerValue, QString::fromStdString(center[i]), units); bin.appendChild(centerValue); QDomElement binWidth = m_domDoc->createElement("sp:bin_width"); if (width.size() == bands) { - PvlToXmlTranslationManager::setElementValue(binWidth, width[i] , units); + PvlToXmlTranslationManager::setElementValue(binWidth, QString::fromStdString(width[i]), units); } else { - PvlToXmlTranslationManager::setElementValue(binWidth, width[0] , units); + PvlToXmlTranslationManager::setElementValue(binWidth, QString::fromStdString(width[0]), units); } bin.appendChild(binWidth); QDomElement originalBinNumber = m_domDoc->createElement("sp:original_bin_number"); if (originalBand.size() > 0) { - PvlToXmlTranslationManager::setElementValue(originalBinNumber, originalBand[i]); + PvlToXmlTranslationManager::setElementValue(originalBinNumber, QString::fromStdString(originalBand[i])); bin.appendChild(originalBinNumber); } @@ -706,12 +706,12 @@ namespace Isis { bin.appendChild(filter); if (name.size() > 0) { QDomElement filterName = m_domDoc->createElement("sp:filter_name"); - PvlToXmlTranslationManager::setElementValue(filterName, name[i]); + PvlToXmlTranslationManager::setElementValue(filterName, QString::fromStdString(name[i])); filter.appendChild(filterName); } if (number.size() > 0) { QDomElement filterNumber= m_domDoc->createElement("sp:filter_number"); - PvlToXmlTranslationManager::setElementValue(filterNumber, number[i]); + PvlToXmlTranslationManager::setElementValue(filterNumber, QString::fromStdString(number[i])); filter.appendChild(filterNumber); } } @@ -770,7 +770,7 @@ namespace Isis { "Translation for PDS4 required value [last_center_value] not found."; throw IException(IException::Programmer, msg, _FILEINFO_); } - QString lastCenter = center[center.size() - 1]; + QString lastCenter = QString::fromStdString(center[center.size() - 1]); QDomElement axisBinSetElement = spectralCharElement.firstChildElement("sp:Axis_Uniformly_Sampled"); if (axisBinSetElement.isNull()) { @@ -1238,7 +1238,7 @@ namespace Isis { } PvlKeyword &isisLonDir = inputMapping.findKeyword("LongitudeDirection"); - QString lonDir = isisLonDir[0]; + QString lonDir = QString::fromStdString(isisLonDir[0]); lonDir = lonDir.toUpper(); // Add Lat/Lon range @@ -1464,7 +1464,7 @@ namespace Isis { void ProcessExportPds4::translateUnits(QDomDocument &label, QString transMapFile) { Pvl configPvl; try { - configPvl.read(transMapFile); + configPvl.read(transMapFile.toStdString()); } catch(IException &e) { QString msg = "Failed to read unit translation config file [" + transMapFile + "]."; @@ -1509,19 +1509,19 @@ namespace Isis { for (int j = 0; j < unitObject.groups(); j++) { PvlGroup unitGroup = unitObject.group(j); if (!unitGroup.hasKeyword("PDS4_Unit")) { - QString msg = "No PDS4 standard specified for for [" + unitGroup.name() + "]"; + std::string msg = "No PDS4 standard specified for for [" + unitGroup.name() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } PvlKeyword pds4Key = unitGroup["PDS4_Unit"]; // Add the PDS4 format for when the format is already correct. // This also handles case issues such as KM instead of km. - transMap.insert(pds4Key[0].toLower(), pds4Key[0]); + transMap.insert(QString::fromStdString(pds4Key[0]).toLower(), QString::fromStdString(pds4Key[0])); // If there are ISIS versions with different formats then add those. if (unitGroup.hasKeyword("ISIS_Units")) { PvlKeyword isisKey = unitGroup["ISIS_Units"]; for (int k = 0; k < isisKey.size() ; k++) { - transMap.insert(isisKey[k].toLower(), pds4Key[0]); + transMap.insert(QString::fromStdString(isisKey[k]).toLower(), QString::fromStdString(pds4Key[0])); } } } diff --git a/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp b/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp index 25c36b4686..861093c7e1 100644 --- a/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp +++ b/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp @@ -90,8 +90,8 @@ namespace Isis { // Check for blank lines if (line.substr(0, 1) != " " && line.substr(0, 1) != "/") { // Name of keyword - PvlKeyword label(line.Token(" =").ToQt()); // Stop on spaces OR equal sign - if (QString::compare(label.name(), "OBJECT", Qt::CaseInsensitive) == 0) { + PvlKeyword label(line.Token(" =")); // Stop on spaces OR equal sign + if (QString::compare(QString::fromStdString(label.name()), "OBJECT", Qt::CaseInsensitive) == 0) { label.setName("TARGET"); label.addComment("NOTE: This keyword name was changed from 'OBJECT' in the original " "fit header file."); @@ -100,13 +100,13 @@ namespace Isis { line.TrimHead(" ="); line.TrimTail(" "); if (label.name() == "COMMENT" || label.name() == "HISTORY") { - label += line.ToQt(); + label += line; } else { // Check for a quoted value if (line.substr(0,1) == "'") { line.TrimHead("'"); - label += line.Token("'").TrimHead(" ").TrimTail(" ").ToQt(); + label += line.Token("'").TrimHead(" ").TrimTail(" "); line.TrimHead(" '"); } else { @@ -114,16 +114,16 @@ namespace Isis { IString value = line.Token("/"); // Clear to end of data value.TrimTail(" "); - label += value.ToQt(); + label += value; line.TrimHead(" "); } // If the line still has anything in it, treat it is as a comment. if (line.size() > 2) { line.TrimHead(" /"); - label.addComment(line.ToQt()); + label.addComment(line); // A possible format for units, other possiblites exist. if (line != line.Token("[")) { - label.setUnits(line.Token("[").Token("]").ToQt()); + label.setUnits(line.Token("[").Token("]")); } } } @@ -162,16 +162,16 @@ namespace Isis { bytesPerPixel /= 8; unsigned int axis1 = 1; - axis1 = toInt((*fitsLabel)["NAXIS1"]); + axis1 = std::stoi((*fitsLabel)["NAXIS1"]); unsigned int axis2 = 1; if (fitsLabel->hasKeyword("NAXIS2")) { - axis2 = toInt((*fitsLabel)["NAXIS2"]); + axis2 = std::stoi((*fitsLabel)["NAXIS2"]); } unsigned int axis3 = 1; if (fitsLabel->hasKeyword("NAXIS3")) { - axis3 = toInt((*fitsLabel)["NAXIS3"]); + axis3 = std::stoi((*fitsLabel)["NAXIS3"]); } jump = (int)(ceil(bytesPerPixel * axis1 * axis2 * axis3 / 2880.0) * 2880.0); @@ -377,8 +377,8 @@ namespace Isis { // Find pixel type. NOTE: There are several unsupported possiblites Isis::PixelType type; - QString msg = ""; - switch (toInt(label["BITPIX"][0])) { + std::string msg = ""; + switch (std::stoi(label["BITPIX"][0])) { case 8: type = Isis::UnsignedByte; break; @@ -414,60 +414,60 @@ namespace Isis { // considered part of the DNs. So, use the parent class' prefix/suffix byte count to reduce // the number of samples. if (Organization() == BSQ) { - if (toInt(label["NAXIS"][0]) == 2) { - SetDimensions(toInt(label["NAXIS1"][0]) + if (std::stoi(label["NAXIS"][0]) == 2) { + SetDimensions(std::stoi(label["NAXIS1"][0]) - (DataPrefixBytes()+DataSuffixBytes())/SizeOf(type), - toInt(label["NAXIS2"][0]), 1); + std::stoi(label["NAXIS2"][0]), 1); } - else if (toInt(label["NAXIS"][0]) == 3) { - SetDimensions(toInt(label["NAXIS1"][0]) + else if (std::stoi(label["NAXIS"][0]) == 3) { + SetDimensions(std::stoi(label["NAXIS1"][0]) - (DataPrefixBytes()+DataSuffixBytes())/SizeOf(type), - toInt(label["NAXIS2"][0]), toInt(label["NAXIS3"][0])); + std::stoi(label["NAXIS2"][0]), std::stoi(label["NAXIS3"][0])); } else { - QString msg = "NAXIS count of [" + std::string msg = "NAXIS count of [" + label["NAXIS"][0] + "] is not supported for FITS imports."; throw IException(IException::User, msg, _FILEINFO_); } } else if (Organization() == BIL) { - if (toInt(label["NAXIS"][0]) == 2) { - SetDimensions(toInt(label["NAXIS1"][0]) + if (std::stoi(label["NAXIS"][0]) == 2) { + SetDimensions(std::stoi(label["NAXIS1"][0]) - (DataPrefixBytes()+DataSuffixBytes())/SizeOf(type), - 1, toInt(label["NAXIS2"][0])); + 1, std::stoi(label["NAXIS2"][0])); } - else if (toInt(label["NAXIS"][0]) == 3) { - SetDimensions(toInt(label["NAXIS1"][0]) + else if (std::stoi(label["NAXIS"][0]) == 3) { + SetDimensions(std::stoi(label["NAXIS1"][0]) - (DataPrefixBytes()+DataSuffixBytes())/SizeOf(type), - toInt(label["NAXIS3"][0]), toInt(label["NAXIS2"][0])); + std::stoi(label["NAXIS3"][0]), std::stoi(label["NAXIS2"][0])); } else { - QString msg = "NAXIS count of [" + std::string msg = "NAXIS count of [" + label["NAXIS"][0] + "] is not supported for FITS imports."; throw IException(IException::User, msg, _FILEINFO_); } } else if (Organization() == BIP) { - QString msg = "BIP (Band Interleaved by Pixel) " + std::string msg = "BIP (Band Interleaved by Pixel) " "organization is not supported for FITS imports."; throw IException(IException::User, msg, _FILEINFO_); } else { - QString msg = "Unknown organization is not supported for FITS imports."; + std::string msg = "Unknown organization is not supported for FITS imports."; throw IException(IException::User, msg, _FILEINFO_); } // Base and multiplier if (label.hasKeyword("BZERO")) { - SetBase(toDouble(label["BZERO"][0])); + SetBase(std::stod(label["BZERO"][0])); } else { SetBase(0.0); } if (label.hasKeyword("BSCALE")) { - SetMultiplier(toDouble(label["BSCALE"][0])); + SetMultiplier(std::stod(label["BSCALE"][0])); } else { SetMultiplier(1.0); diff --git a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp index ee3489b9bd..a016fc5d17 100644 --- a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp +++ b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp @@ -255,7 +255,7 @@ namespace Isis { str = pdsXlater.Translate("PixelResolution"); p_pixelResolution = toDouble(str); - str = pdsXlater.InputKeyword("PixelResolution").unit().toUpper(); + str = QString::fromStdString(pdsXlater.InputKeyword("PixelResolution").unit()).toUpper(); // Assume KM/PIXEL if the unit doesn't exist or is not METERS/PIXEL if ((str != "METERS/PIXEL") && (str != "M/PIXEL") && (str != "M/PIX")) { p_pixelResolution *= 1000.0; @@ -295,10 +295,10 @@ namespace Isis { p_sampleProjectionOffset = toDouble(str); p_upperLeftX = xmult * (p_sampleProjectionOffset + xoff) * p_pixelResolution; - p_projectionOffsetGroup.addKeyword(PvlKeyword("xOffset", QString::number(xoff))); - p_projectionOffsetGroup.addKeyword(PvlKeyword("yOffset", QString::number(yoff))); - p_projectionOffsetGroup.addKeyword(PvlKeyword("xMultiplier", QString::number(xmult))); - p_projectionOffsetGroup.addKeyword(PvlKeyword("yMultiplier", QString::number(ymult))); + p_projectionOffsetGroup.addKeyword(PvlKeyword("xOffset", std::to_string(xoff))); + p_projectionOffsetGroup.addKeyword(PvlKeyword("yOffset", std::to_string(yoff))); + p_projectionOffsetGroup.addKeyword(PvlKeyword("xMultiplier", std::to_string(xmult))); + p_projectionOffsetGroup.addKeyword(PvlKeyword("yMultiplier", std::to_string(ymult))); } @@ -356,16 +356,16 @@ namespace Isis { yoff = 0.5; // Open projectionOffsetMults file - Isis::Pvl p(p_transDir + "/" + "translations/pdsProjectionLineSampToXY.def"); + Isis::Pvl p(p_transDir.toStdString() + "/" + "translations/pdsProjectionLineSampToXY.def"); Isis::PvlObject &projDef = p.findObject("ProjectionOffsetMults", Pvl::Traverse); for(int g = 0; g < projDef.groups(); g++) { - QString key = projDef.group(g)["Keyword"]; - if (p_pdsLabel.hasKeyword(key)) { - QString value = p_pdsLabel[key]; - QString pattern = projDef.group(g)["Pattern"]; + QString key = QString::fromStdString(projDef.group(g)["Keyword"]); + if (p_pdsLabel.hasKeyword(key.toStdString())) { + QString value = QString::fromStdString(p_pdsLabel[key.toStdString()]); + QString pattern = QString::fromStdString(projDef.group(g)["Pattern"]); // If value contains pattern, then set the mults to what is in translation file and // update p_pdfChange if (value.contains(pattern)) { @@ -496,7 +496,7 @@ namespace Isis { try { str = pdsXlater.Translate("DataFilePointer"); offset = toInt(str); - units = dataFilePointer.unit(); + units = QString::fromStdString(dataFilePointer.unit()); // Successful? we have an offset, means current, p_labelFile // is the location of the data as well dataFileName = FileName(p_labelFile).name(); @@ -514,7 +514,7 @@ namespace Isis { else if (dataFilePointer.size() == 2) { dataFileName = pdsXlater.Translate("DataFilePointer", 0); offset = IString(pdsXlater.Translate("DataFilePointer", 1)).ToInteger(); - units = dataFilePointer.unit(1); + units = QString::fromStdString(dataFilePointer.unit(1)); } // Error, no value else if (dataFilePointer.size() == 0) { @@ -901,7 +901,7 @@ namespace Isis { } else { PvlKeyword pdsCoreOrg = p_pdsLabel.findKeyword(pdsXlater. - InputKeywordName("CoreOrganization"), Pvl::Traverse); + InputKeywordName("CoreOrganization").toStdString(), Pvl::Traverse); stringstream pdsCoreOrgStream; pdsCoreOrgStream << pdsCoreOrg; @@ -1152,8 +1152,8 @@ namespace Isis { } else { - QString msg = "Invalid PixelType and BitsPerPixel combination [" + str + - ", " + toString(bitsPerPixel) + "]"; + std::string msg = "Invalid PixelType and BitsPerPixel combination [" + str.toStdString() + + ", " + std::to_string(bitsPerPixel) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -1398,7 +1398,7 @@ namespace Isis { // Internalize the PDS label in the PVL that was passed in try { - pdsLabel.read(pdsLabelFile); + pdsLabel.read(pdsLabelFile.toStdString()); } catch (IException &e) { throw IException(e, IException::User, @@ -1482,9 +1482,9 @@ namespace Isis { if (inst.hasKeyword("StartTime")) { Isis::PvlKeyword &stkey = inst["StartTime"]; - QString stime = stkey[0]; + QString stime = QString::fromStdString(stkey[0]); stime = stime.remove(QRegExp("[Zz]$")); - stkey = stime; + stkey = stime.toStdString(); } } @@ -1602,46 +1602,46 @@ namespace Isis { ExtractPdsProjection(pdsXlater); Isis::PvlGroup mapGroup("Mapping"); - mapGroup += Isis::PvlKeyword("ProjectionName", p_projection); - mapGroup += Isis::PvlKeyword("TargetName", p_targetName); - mapGroup += Isis::PvlKeyword("EquatorialRadius", toString(p_equatorialRadius), "meters"); - mapGroup += Isis::PvlKeyword("PolarRadius", toString(p_polarRadius), "meters"); - mapGroup += Isis::PvlKeyword("LongitudeDirection", p_longitudeDirection); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(p_longitudeDomain)); - mapGroup += Isis::PvlKeyword("LatitudeType", p_latitudeType); + mapGroup += Isis::PvlKeyword("ProjectionName", p_projection.toStdString()); + mapGroup += Isis::PvlKeyword("TargetName", p_targetName.toStdString()); + mapGroup += Isis::PvlKeyword("EquatorialRadius", std::to_string(p_equatorialRadius), "meters"); + mapGroup += Isis::PvlKeyword("PolarRadius", std::to_string(p_polarRadius), "meters"); + mapGroup += Isis::PvlKeyword("LongitudeDirection", p_longitudeDirection.toStdString()); + mapGroup += Isis::PvlKeyword("LongitudeDomain", std::to_string(p_longitudeDomain)); + mapGroup += Isis::PvlKeyword("LatitudeType", p_latitudeType.toStdString()); if (p_minimumLatitude != Isis::NULL8) { - mapGroup += Isis::PvlKeyword("MinimumLatitude", toString(p_minimumLatitude)); + mapGroup += Isis::PvlKeyword("MinimumLatitude", std::to_string(p_minimumLatitude)); } if (p_maximumLatitude != Isis::NULL8) { - mapGroup += Isis::PvlKeyword("MaximumLatitude", toString(p_maximumLatitude)); + mapGroup += Isis::PvlKeyword("MaximumLatitude", std::to_string(p_maximumLatitude)); } if (p_minimumLongitude != Isis::NULL8) { - mapGroup += Isis::PvlKeyword("MinimumLongitude", toString(p_minimumLongitude)); + mapGroup += Isis::PvlKeyword("MinimumLongitude", std::to_string(p_minimumLongitude)); } if (p_maximumLongitude != Isis::NULL8) { - mapGroup += Isis::PvlKeyword("MaximumLongitude", toString(p_maximumLongitude)); + mapGroup += Isis::PvlKeyword("MaximumLongitude", std::to_string(p_maximumLongitude)); } // if both longitudes exist, verify they are ordered correctly if (p_minimumLongitude != Isis::NULL8 && p_maximumLongitude != Isis::NULL8) { if (p_maximumLongitude <= p_minimumLongitude) { if (p_longitudeDomain == 180) { - mapGroup["MinimumLongitude"] = toString(-180); - mapGroup["MaximumLongitude"] = toString(180); + mapGroup["MinimumLongitude"] = std::to_string(-180); + mapGroup["MaximumLongitude"] = std::to_string(180); } else { - mapGroup["MinimumLongitude"] = toString(0); - mapGroup["MaximumLongitude"] = toString(360); + mapGroup["MinimumLongitude"] = std::to_string(0); + mapGroup["MaximumLongitude"] = std::to_string(360); } } } - mapGroup += Isis::PvlKeyword("PixelResolution", toString(p_pixelResolution), "meters/pixel"); - mapGroup += Isis::PvlKeyword("Scale", toString(p_scaleFactor), "pixels/degree"); - mapGroup += Isis::PvlKeyword("UpperLeftCornerX", toString(p_upperLeftX), "meters"); - mapGroup += Isis::PvlKeyword("UpperLeftCornerY", toString(p_upperLeftY), "meters"); + mapGroup += Isis::PvlKeyword("PixelResolution", std::to_string(p_pixelResolution), "meters/pixel"); + mapGroup += Isis::PvlKeyword("Scale", std::to_string(p_scaleFactor), "pixels/degree"); + mapGroup += Isis::PvlKeyword("UpperLeftCornerX", std::to_string(p_upperLeftX), "meters"); + mapGroup += Isis::PvlKeyword("UpperLeftCornerY", std::to_string(p_upperLeftY), "meters"); if (p_rotation != 0.0) { - mapGroup += Isis::PvlKeyword("Rotation", toString(p_rotation)); + mapGroup += Isis::PvlKeyword("Rotation", std::to_string(p_rotation)); } // To handle new projections without the need to modify source code @@ -1659,17 +1659,17 @@ namespace Isis { if (lab.findGroup("Mapping").hasKeyword("CenterLongitude")) { PvlKeyword ¢erLon = lab.findGroup("Mapping")["CenterLongitude"]; if (p_longitudeDomain == 180) - centerLon = toString(TProjection::To180Domain((double)centerLon)); + centerLon = std::to_string(TProjection::To180Domain((double)centerLon)); else - centerLon = toString(TProjection::To360Domain((double)centerLon)); + centerLon = std::to_string(TProjection::To360Domain((double)centerLon)); } if (lab.findGroup("Mapping").hasKeyword("PoleLongitude")) { PvlKeyword &poleLon = lab.findGroup("Mapping")["PoleLongitude"]; if (p_longitudeDomain == 180) - poleLon = toString(TProjection::To180Domain((double)poleLon)); + poleLon = std::to_string(TProjection::To180Domain((double)poleLon)); else - poleLon = toString(TProjection::To360Domain((double)poleLon)); + poleLon = std::to_string(TProjection::To360Domain((double)poleLon)); } OutputCubes[0]->putGroup(lab.findGroup("Mapping")); diff --git a/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp b/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp index 8609f2846e..8ae5a79495 100644 --- a/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp +++ b/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp @@ -61,7 +61,7 @@ namespace Isis { SetDimensions(vLab["NS"], vLab["NL"], vLab["NB"]); - QString pixType = vLab["FORMAT"]; + QString pixType = QString::fromStdString(vLab["FORMAT"]); Isis::PixelType pixelType = None; if(pixType == "BYTE") pixelType = UnsignedByte; if(pixType == "WORD") pixelType = UnsignedWord; @@ -73,7 +73,7 @@ namespace Isis { } SetPixelType(pixelType); - QString order = vLab["INTFMT"]; + QString order = QString::fromStdString(vLab["INTFMT"]); if(order == "LOW") { SetByteOrder(Lsb); } @@ -81,7 +81,7 @@ namespace Isis { SetByteOrder(Msb); } - QString organization = vLab["ORG"]; + QString organization = QString::fromStdString(vLab["ORG"]); if(organization == "BSQ") { SetOrganization(ProcessImport::BSQ); } diff --git a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp index 398a51db47..070c8233c7 100644 --- a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp +++ b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp @@ -354,7 +354,7 @@ namespace Isis { int samples, lines, bands = 0; Pvl label; - label.read(propagationCubes[0].toString()); + label.read(propagationCubes[0].toString().toStdString()); PvlGroup mGroup = label.findGroup("Mapping", Pvl::Traverse); // All mosaicking programs use only the upper left x and y to determine where to @@ -365,10 +365,10 @@ namespace Isis { // range. If the current values for the latitude and longitude range are out of // order or equal, then we don't write them to the labels. if (slat < elat && slon < elon) { - mGroup.addKeyword(PvlKeyword("MinimumLatitude", toString(slat)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MaximumLatitude", toString(elat)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MinimumLongitude", toString(slon)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MaximumLongitude", toString(elon)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(slat)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(elat)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(slon)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(elon)), Pvl::Replace); } if (mGroup.hasKeyword("UpperLeftCornerX")) @@ -403,8 +403,8 @@ namespace Isis { if (proj == NULL) { } else if (*proj != *projNew) { - QString msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString() + - "] and [" + propagationCubes[0].toString() + "]"; + std::string msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString().toStdString() + + "] and [" + propagationCubes[0].toString().toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -443,12 +443,12 @@ namespace Isis { int samples, lines, bands = 0; Pvl label; - label.read(propagationCubes[0].toString()); + label.read(propagationCubes[0].toString().toStdString()); PvlGroup mGroup = label.findGroup("Mapping", Pvl::Traverse); - mGroup.addKeyword(PvlKeyword("MinimumRingRadius", toString(srad)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MaximumRingRadius", toString(erad)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MinimumRingLongitude", toString(saz)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MaximumRingLongitude", toString(eaz)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MinimumRingRadius", std::to_string(srad)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MaximumRingRadius", std::to_string(erad)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MinimumRingLongitude", std::to_string(saz)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MaximumRingLongitude", std::to_string(eaz)), Pvl::Replace); if (mGroup.hasKeyword("UpperLeftCornerX")) mGroup.deleteKeyword("UpperLeftCornerX"); @@ -481,8 +481,8 @@ namespace Isis { if (proj == NULL) { } else if (*proj != *projNew) { - QString msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString() + - "] and [" + propagationCubes[0].toString() + "]"; + std::string msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString().toStdString() + + "] and [" + propagationCubes[0].toString().toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -508,7 +508,7 @@ namespace Isis { double xmin, double xmax, double ymin, double ymax, double slat, double elat, double slon, double elon, int nbands, CubeAttributeOutput &oAtt, const QString &mosaicFile, bool latlonflag) { - Pvl fileLab(inputFile); + Pvl fileLab(inputFile.toStdString()); PvlGroup &mapping = fileLab.findGroup("Mapping", Pvl::Traverse); // All mosaicking programs use only the upper left x and y to determine where to @@ -519,10 +519,10 @@ namespace Isis { // range. If the current values for the latitude and longitude range are out of // order or equal, then we don't write them to the labels. if (latlonflag && slat < elat && slon < elon) { - mapping.addKeyword(PvlKeyword("MinimumLatitude", toString(slat)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MaximumLatitude", toString(elat)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MinimumLongitude", toString(slon)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MaximumLongitude", toString(elon)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(slat)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(elat)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(slon)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(elon)), Pvl::Replace); } else { if (mapping.hasKeyword("MinimumLatitude")) { @@ -610,15 +610,15 @@ namespace Isis { double xmin, double xmax, double ymin, double ymax, double srad, double erad, double saz, double eaz, int nbands, CubeAttributeOutput &oAtt, const QString &mosaicFile) { - Pvl fileLab(inputFile); + Pvl fileLab(inputFile.toStdString()); PvlGroup &mapping = fileLab.findGroup("Mapping", Pvl::Traverse); - mapping["UpperLeftCornerX"] = toString(xmin); - mapping["UpperLeftCornerY"] = toString(ymax); - mapping.addKeyword(PvlKeyword("MinimumRingRadius", toString(srad)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MaximumRingRadius", toString(erad)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MinimumRingLongitude", toString(saz)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MaximumRingLongitude", toString(eaz)), Pvl::Replace); + mapping["UpperLeftCornerX"] = std::to_string(xmin); + mapping["UpperLeftCornerY"] = std::to_string(ymax); + mapping.addKeyword(PvlKeyword("MinimumRingRadius", std::to_string(srad)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MaximumRingRadius", std::to_string(erad)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MinimumRingLongitude", std::to_string(saz)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MaximumRingLongitude", std::to_string(eaz)), Pvl::Replace); Projection *firstProj = ProjectionFactory::RingsCreateFromCube(fileLab); int samps = (int)(ceil(firstProj->ToWorldX(xmax) - firstProj->ToWorldX(xmin)) + 0.5); diff --git a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp index f4ae856355..1bfd9f30ea 100644 --- a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp +++ b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp @@ -164,9 +164,9 @@ namespace Isis { } PvlGroup imgPosition("ImageLocation"); - imgPosition += PvlKeyword("File", InputCubes[0]->fileName()); - imgPosition += PvlKeyword("StartSample", toString(m_oss)); - imgPosition += PvlKeyword("StartLine", toString(m_osl)); + imgPosition += PvlKeyword("File", InputCubes[0]->fileName().toStdString()); + imgPosition += PvlKeyword("StartSample", std::to_string(m_oss)); + imgPosition += PvlKeyword("StartLine", std::to_string(m_osl)); m_imagePositions += imgPosition; // Tests for completly off the mosaic @@ -287,7 +287,7 @@ namespace Isis { 1); // The tracking cube file name convention is "output_cube_file_name" + "_tracking.cub" - QString trackingBase = FileName(OutputCubes[0]->fileName()).removeExtension().expanded().split("/").last();//toString(); + QString trackingBase = FileName(OutputCubes[0]->fileName()).removeExtension().expanded().split("/").last(); m_trackingCube->create(FileName(OutputCubes[0]->fileName()).path() + "/" + trackingBase + "_tracking.cub"); @@ -295,7 +295,7 @@ namespace Isis { Pvl *mosaicLabel = OutputCubes[0]->label(); PvlGroup trackingFileGroup("Tracking"); PvlKeyword trackingFileName("FileName"); - trackingFileName.setValue(trackingBase + "_tracking.cub"); + trackingFileName.setValue(trackingBase.toStdString() + "_tracking.cub"); trackingFileGroup.addKeyword(trackingFileName); mosaicLabel->findObject("IsisCube").addGroup(trackingFileGroup); @@ -322,7 +322,7 @@ namespace Isis { // Confirm tracking group exists in mosaic cube to address backwards compatibility if ( OutputCubes[0]->hasGroup("Tracking") ) { QString trackingPath = FileName(OutputCubes[0]->fileName()).path(); - QString trackingFile = OutputCubes[0]->group("Tracking").findKeyword("FileName")[0]; + QString trackingFile = QString::fromStdString(OutputCubes[0]->group("Tracking").findKeyword("FileName")[0]); m_trackingCube->open(trackingPath + "/" + trackingFile, "rw"); // Initialize a TrackingTable object from current mosaic @@ -600,7 +600,7 @@ namespace Isis { Pvl *cInPvl = InputCubes[0]->label(); if (cInPvl->findGroup("Dimensions", Pvl::Traverse).hasKeyword("Bands")) { PvlKeyword &cBandKey = cInPvl->findGroup("Dimensions", Pvl::Traverse).findKeyword("Bands"); - QString sStr(cBandKey[0]); + QString sStr(QString::fromStdString(cBandKey[0])); if (toInt(sStr) < nb) { QString m = "The parameter number of input bands exceeds the actual number of bands in the " "input cube"; @@ -671,7 +671,7 @@ namespace Isis { Pvl *cInPvl = InputCubes[0]->label(); if (cInPvl->findGroup("Dimensions", Pvl::Traverse).hasKeyword("Bands")) { PvlKeyword &cBandKey = cInPvl->findGroup("Dimensions", Pvl::Traverse).findKeyword("Bands"); - QString sStr(cBandKey[0]); + QString sStr(QString::fromStdString(cBandKey[0])); if (toInt(sStr) < nb) { QString m = "The parameter number of input bands exceeds the actual number of bands in the input cube"; throw IException(IException::Programmer, m, _FILEINFO_); @@ -919,7 +919,7 @@ namespace Isis { if (result == "") { throw IException(IException::Unknown, - "Cannot convert overlay [" + toString((int)imageOverlay) + "] to a string", + "Cannot convert overlay [" + std::to_string((int)imageOverlay) + "] to a string", _FILEINFO_); } @@ -963,12 +963,12 @@ namespace Isis { PvlGroup inMosaicGrp = inLabel->findObject("IsisCube").findGroup("Kernels"); if (outMosaicGrp.hasKeyword("ShapeModel") && inMosaicGrp.hasKeyword("ShapeModel")) { PvlKeyword outShapeModelKey = outMosaicGrp.findKeyword("ShapeModel"); - QString sShapeModel = inMosaicGrp.findKeyword("ShapeModel")[0]; + QString sShapeModel = QString::fromStdString(inMosaicGrp.findKeyword("ShapeModel")[0]); int found = sShapeModel.lastIndexOf("/"); if (found != -1) { sShapeModel.remove(0, found + 1); } - if (sShapeModel == outShapeModelKey[0]) { + if (sShapeModel == QString::fromStdString(outShapeModelKey[0])) { return; } } @@ -981,7 +981,7 @@ namespace Isis { if (m_createOutputMosaic) { if (inLabel->findObject("IsisCube").hasGroup("Kernels")) { QString sShapeModel = - inLabel->findObject("IsisCube").findGroup("Kernels").findKeyword("ShapeModel")[0]; + QString::fromStdString(inLabel->findObject("IsisCube").findGroup("Kernels").findKeyword("ShapeModel")[0]); int found = sShapeModel.lastIndexOf("/"); if (found != -1){ sShapeModel.remove(0, found+1); @@ -989,7 +989,7 @@ namespace Isis { PvlObject & outIsisCubeObj = outLabel->findObject("IsisCube"); PvlGroup mosaicGrp("Mosaic"); PvlKeyword shapeModelKey("ShapeModel"); - shapeModelKey += sShapeModel; + shapeModelKey += sShapeModel.toStdString(); mosaicGrp += shapeModelKey; outIsisCubeObj += mosaicGrp; } @@ -1098,9 +1098,9 @@ namespace Isis { for (int i = 0; i < outBin.keywords(); i++) { PvlKeyword &outKey = outBin[i]; - QString sOutName = outKey.name(); - if (inBin.hasKeyword(sOutName)) { - PvlKeyword &inKey = inBin[sOutName]; + QString sOutName = QString::fromStdString(outKey.name()); + if (inBin.hasKeyword(sOutName.toStdString())) { + PvlKeyword &inKey = inBin[sOutName.toStdString()]; for (int j = osb, k = isb; j < outKey.size() && k < inKey.size(); j++, k++) { if (outKey[j] == "NA") { outKey[j] = inKey[k]; @@ -1115,10 +1115,10 @@ namespace Isis { } } else if (outKey[j] != inKey[k]) { - QString msg = "The input cube [" + inLab->fileName() + "] and the base mosaic values " + std::string msg = "The input cube [" + inLab->fileName() + "] and the base mosaic values " "of the Pvl Group [BandBin] for Keyword [" + outKey.name() + "] do not " - "match. Base mosaic value at index [" + QString::number(j) + "] = " + - outKey[j] + ". Input cube value at index [" + QString::number(k) + "] = " + "match. Base mosaic value at index [" + std::to_string(j) + "] = " + + outKey[j] + ". Input cube value at index [" + std::to_string(k) + "] = " + inKey[k] + ". **Note: use mapmos/automos MatchBandBin = false to " "override this check**"; //QString msg = "Pvl Group [BandBin] in Key[" + outKey.name() + "] In value" + inKey[k] + @@ -1128,7 +1128,7 @@ namespace Isis { } } else { - QString msg = "Pvl Group [BandBin] In Keyword[" + inBin[i].name() + "] and Out Keyword[" + + std::string msg = "Pvl Group [BandBin] In Keyword[" + inBin[i].name() + "] and Out Keyword[" + outBin[i].name() + "] does not match"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1191,7 +1191,7 @@ namespace Isis { int iTotalOutBands = OutputCubes[0]->bandCount(); isb = origIsb - 1; // reset the input starting band int iOutStartBand = iOutBands + osb; - QString sKeyName = cInKey.name(); + QString sKeyName = QString::fromStdString(cInKey.name()); bool bFilterKey = false; if (sKeyName.contains("Filter") || sKeyName.contains("Original") || @@ -1217,7 +1217,7 @@ namespace Isis { // Check for units and make sure output keyword units value is set to input // keyword units value if (cOutKey.unit() != cInKey.unit()) { - cOutKey.setUnits((QString)(cInKey.unit())); + cOutKey.setUnits((cInKey.unit())); } cOutBin += cOutKey; @@ -1302,12 +1302,12 @@ namespace Isis { //key name if (!m_bandPriorityBandNumber) { PvlKeyword cKeyName; - if (cPvlLabel.findGroup("BandBin", Pvl::Traverse).hasKeyword(m_bandPriorityKeyName)) { - cKeyName = cPvlLabel.findGroup("BandBin", Pvl::Traverse).findKeyword(m_bandPriorityKeyName); + if (cPvlLabel.findGroup("BandBin", Pvl::Traverse).hasKeyword(m_bandPriorityKeyName.toStdString())) { + cKeyName = cPvlLabel.findGroup("BandBin", Pvl::Traverse).findKeyword(m_bandPriorityKeyName.toStdString()); } int iSize = cKeyName.size(); for (int i = 0; i < iSize; i++) { - if (m_bandPriorityKeyValue.toUpper() == cKeyName[i].toUpper()) { + if (m_bandPriorityKeyValue.toUpper() == QString::fromStdString(cKeyName[i]).toUpper()) { iBandIndex = i + 1; //1 based get key value index bFound = true; break; diff --git a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp index dad28f8a3a..ca050f36f3 100644 --- a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp +++ b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp @@ -185,9 +185,9 @@ namespace Isis { for(int i = 0; i < errorPvl.groups(); i++) { PvlGroup &g = errorPvl.group(i); - QString emsg = g["Message"]; + QString emsg = QString::fromStdString(g["Message"]); int ecode = g["Code"]; - QString efile = g["File"]; + QString efile =QString::fromStdString(g["File"]); int eline = g["Line"]; errors.append( diff --git a/isis/src/base/objs/Progress/Progress.cpp b/isis/src/base/objs/Progress/Progress.cpp index 138e321cfa..955dcfe146 100644 --- a/isis/src/base/objs/Progress/Progress.cpp +++ b/isis/src/base/objs/Progress/Progress.cpp @@ -25,7 +25,7 @@ namespace Isis { bool printPercent; Isis::PvlGroup &group = Isis::Preference::Preferences().findGroup("UserInterface"); percent = group["ProgressBarPercent"]; - QString temp = (QString) group["ProgressBar"]; + QString temp = QString::fromStdString(group["ProgressBar"]); printPercent = temp.toUpper() == "ON"; // Check for an error diff --git a/isis/src/base/objs/Projection/Projection.cpp b/isis/src/base/objs/Projection/Projection.cpp index 28033eab73..49dcfb89e1 100644 --- a/isis/src/base/objs/Projection/Projection.cpp +++ b/isis/src/base/objs/Projection/Projection.cpp @@ -130,7 +130,7 @@ namespace Isis { m_sky = false; if (m_mappingGrp.hasKeyword("TargetName")) { - QString str = m_mappingGrp["TargetName"]; + QString str = QString::fromStdString(m_mappingGrp["TargetName"]); if (str.toUpper() == "SKY") m_sky = true; } @@ -1372,8 +1372,8 @@ namespace Isis { */ void Projection::SetUpperLeftCorner(const Displacement &x, const Displacement &y) { - PvlKeyword xKeyword("UpperLeftCornerX", toString(x.meters()), "meters"); - PvlKeyword yKeyword("UpperLeftCornerY", toString(y.meters()), "meters"); + PvlKeyword xKeyword("UpperLeftCornerX", std::to_string(x.meters()), "meters"); + PvlKeyword yKeyword("UpperLeftCornerY", std::to_string(y.meters()), "meters"); m_mappingGrp.addKeyword(xKeyword,Pvl::Replace); m_mappingGrp.addKeyword(yKeyword,Pvl::Replace); } diff --git a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp index 2b6bbc66df..94bb8a9934 100644 --- a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp +++ b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp @@ -57,17 +57,17 @@ namespace Isis { if (m_projPlugin.fileName() == "") { FileName localFile("Projection.plugin"); if (localFile.fileExists()) - m_projPlugin.read(localFile.expanded()); + m_projPlugin.read(localFile.expanded().toStdString()); FileName systemFile("$ISISROOT/lib/Projection.plugin"); if (systemFile.fileExists()) - m_projPlugin.read(systemFile.expanded()); + m_projPlugin.read(systemFile.expanded().toStdString()); } try { // Look for info in the mapping group Isis::PvlGroup &mapGroup = label.findGroup("Mapping", Isis::Pvl::Traverse); - QString proj = mapGroup["ProjectionName"]; + QString proj = QString::fromStdString(mapGroup["ProjectionName"]); // Now get the plugin for the projection QFunctionPointer ptr; @@ -125,17 +125,17 @@ namespace Isis { if (m_projPlugin.fileName() == "") { FileName localFile("Projection.plugin"); if (localFile.fileExists()) - m_projPlugin.read(localFile.expanded()); + m_projPlugin.read(localFile.expanded().toStdString()); FileName systemFile("$ISISROOT/lib/Projection.plugin"); if (systemFile.fileExists()) - m_projPlugin.read(systemFile.expanded()); + m_projPlugin.read(systemFile.expanded().toStdString()); } try { // Look for info in the mapping group Isis::PvlGroup &mapGroup = label.findGroup("Mapping", Isis::Pvl::Traverse); - QString proj = mapGroup["ProjectionName"]; + QString proj = QString::fromStdString(mapGroup["ProjectionName"]); // Now get the plugin for the projection QFunctionPointer ptr; @@ -212,9 +212,9 @@ namespace Isis { pixelResolution = (2.0 * Isis::PI * localRadius) / (360.0 * scale); } // Write out the scale and resolution with units and truescale latitude - mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", toString(pixelResolution), "meters/pixel"), + mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", std::to_string(pixelResolution), "meters/pixel"), Isis::Pvl::Replace); - mapGroup.addKeyword(Isis::PvlKeyword("Scale", toString(scale), "pixels/degree"), Isis::Pvl::Replace); + mapGroup.addKeyword(Isis::PvlKeyword("Scale", std::to_string(scale), "pixels/degree"), Isis::Pvl::Replace); //mapGroup.addKeyword(Isis::PvlKeyword ("TrueScaleLatitude", trueScaleLat), // Isis::Pvl::Replace); @@ -334,7 +334,7 @@ namespace Isis { else { upperLeftX = minXFlipped; } - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", toString(upperLeftX)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", std::to_string(upperLeftX)), Isis::Pvl::Replace); if (flipY) { @@ -346,7 +346,7 @@ namespace Isis { } - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", toString(upperLeftY)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", std::to_string(upperLeftY)), Isis::Pvl::Replace); // Write it in pixel units as well @@ -363,27 +363,27 @@ namespace Isis { // Make sure labels have good units mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", - (QString) mapGroup["PixelResolution"], + (std::string) mapGroup["PixelResolution"], "meters/pixel"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("Scale", - (QString) mapGroup["Scale"], + (std::string) mapGroup["Scale"], "pixels/degree"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", - (QString) mapGroup["UpperLeftCornerX"], + (std::string) mapGroup["UpperLeftCornerX"], "meters"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", - (QString) mapGroup["UpperLeftCornerY"], + (std::string) mapGroup["UpperLeftCornerY"], "meters"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("EquatorialRadius", - (QString) mapGroup["EquatorialRadius"], + (std::string) mapGroup["EquatorialRadius"], "meters"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("PolarRadius", - (QString) mapGroup["PolarRadius"], + (std::string) mapGroup["PolarRadius"], "meters"), Isis::Pvl::Replace); // Add the mapper from pixel coordinates to projection coordinates @@ -394,7 +394,7 @@ namespace Isis { Displacement(upperLeftY, Displacement::Meters)); } catch(IException &e) { - QString msg = "Unable to create projection"; + std::string msg = "Unable to create projection"; if (label.fileName() != "") msg += " from file [" + label.fileName() + "]"; IException finalError(IException::Unknown, msg, _FILEINFO_); finalError.append(errors); @@ -457,10 +457,10 @@ namespace Isis { } // Write out the scale and resolution with units and truescale radius - mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", toString(pixelResolution), + mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", std::to_string(pixelResolution), "meters/pixel"), Isis::Pvl::Replace); - mapGroup.addKeyword(Isis::PvlKeyword("Scale", toString(scale), "pixels/degree"), + mapGroup.addKeyword(Isis::PvlKeyword("Scale", std::to_string(scale), "pixels/degree"), Isis::Pvl::Replace); //mapGroup.AddKeyword(Isis::PvlKeyword ("TrueScaleRadius", trueScaleRadius), @@ -539,11 +539,11 @@ namespace Isis { // Set the upper left corner and add to the labels upperLeftX = minX; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", toString(upperLeftX)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", std::to_string(upperLeftX)), Isis::Pvl::Replace); upperLeftY = maxY; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", toString(upperLeftY)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", std::to_string(upperLeftY)), Isis::Pvl::Replace); // Write it in pixel units as well @@ -560,19 +560,19 @@ namespace Isis { // Make sure labels have good units mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", - (QString) mapGroup["PixelResolution"], + (std::string) mapGroup["PixelResolution"], "meters/pixel"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("Scale", - (QString) mapGroup["Scale"], + (std::string) mapGroup["Scale"], "pixels/degree"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", - (QString) mapGroup["UpperLeftCornerX"], + (std::string) mapGroup["UpperLeftCornerX"], "meters"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", - (QString) mapGroup["UpperLeftCornerY"], + (std::string) mapGroup["UpperLeftCornerY"], "meters"), Isis::Pvl::Replace); // Add the mapper from pixel coordinates to projection coordinates @@ -583,7 +583,7 @@ namespace Isis { Displacement(upperLeftY, Displacement::Meters)); } catch(IException &e) { - QString msg = "Unable to create projection"; + std::string msg = "Unable to create projection"; if (label.fileName() != "") msg += " from file [" + label.fileName() + "]"; IException finalError(IException::Unknown, msg, _FILEINFO_); finalError.append(errors); @@ -642,9 +642,9 @@ namespace Isis { pixelResolution = (2.0 * Isis::PI * localRadius) / (360.0 * scale); } // Write out the scale and resolution with units and truescale latitude - mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", toString(pixelResolution), "meters/pixel"), + mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", std::to_string(pixelResolution), "meters/pixel"), Isis::Pvl::Replace); - mapGroup.addKeyword(Isis::PvlKeyword("Scale", toString(scale), "pixels/degree"), Isis::Pvl::Replace); + mapGroup.addKeyword(Isis::PvlKeyword("Scale", std::to_string(scale), "pixels/degree"), Isis::Pvl::Replace); //mapGroup.AddKeyword(Isis::PvlKeyword ("TrueScaleLatitude", trueScaleLatitude), // Isis::Pvl::Replace); @@ -797,36 +797,36 @@ namespace Isis { // Set the upper left corner and add to the labels double upperLeftX = minX; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", toString(upperLeftX)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", std::to_string(upperLeftX)), Isis::Pvl::Replace); double upperLeftY = maxY; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", toString(upperLeftY)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", std::to_string(upperLeftY)), Isis::Pvl::Replace); // Make sure labels have good units mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", - (QString) mapGroup["PixelResolution"], + (std::string) mapGroup["PixelResolution"], "meters/pixel"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("Scale", - (QString) mapGroup["Scale"], + (std::string) mapGroup["Scale"], "pixels/degree"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", - (QString) mapGroup["UpperLeftCornerX"], + (std::string) mapGroup["UpperLeftCornerX"], "meters"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", - (QString) mapGroup["UpperLeftCornerY"], + (std::string) mapGroup["UpperLeftCornerY"], "meters"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("EquatorialRadius", - (QString) mapGroup["EquatorialRadius"], + (std::string) mapGroup["EquatorialRadius"], "meters"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("PolarRadius", - (QString) mapGroup["PolarRadius"], + (std::string) mapGroup["PolarRadius"], "meters"), Isis::Pvl::Replace); // Add the mapper from pixel coordinates to projection coordinates @@ -1028,19 +1028,19 @@ namespace Isis { // Make sure labels have good units mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", - (QString) mapGroup["PixelResolution"], + (std::string) mapGroup["PixelResolution"], "meters/pixel"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("Scale", - (QString) mapGroup["Scale"], + (std::string) mapGroup["Scale"], "pixels/degree"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", - (QString) mapGroup["UpperLeftCornerX"], + (std::string) mapGroup["UpperLeftCornerX"], "meters"), Isis::Pvl::Replace); mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", - (QString) mapGroup["UpperLeftCornerY"], + (std::string) mapGroup["UpperLeftCornerY"], "meters"), Isis::Pvl::Replace); // Add the mapper from pixel coordinates to projection coordinates diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp index 9d74c1806f..3a597ead54 100644 --- a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp +++ b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp @@ -42,7 +42,7 @@ namespace Isis { fstream input; // open as input from pvl file - input.open(pvl.fileName().toLatin1().data(), ios::in); + input.open(pvl.fileName(), ios::in); string output; // read first line of input and write as first output line @@ -72,7 +72,7 @@ namespace Isis { vLayout->addLayout(buttonLayout); setLayout(vLayout); - QString titleBar = "Pvl File: " + QString(pvl.fileName()) ; + QString titleBar = "Pvl File: " + QString::fromStdString(pvl.fileName()); setWindowTitle(titleBar); // Add functionality to buttons @@ -135,7 +135,7 @@ namespace Isis { // convert QString to std::string needed to open file stream QString saveFile = pvlFile; try { - pvl.write(saveFile); + pvl.write(saveFile.toStdString()); } catch(IException &e) { // report exception(s) to mesage box diff --git a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp index f34fe4585b..7e9a4f336a 100644 --- a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp +++ b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp @@ -487,7 +487,7 @@ namespace Isis { */ void PvlFlatMap::add(const QString &key, const QString &value) { - add(PvlKeyword(key, value)); + add(PvlKeyword(key.toStdString(), value.toStdString())); } @@ -498,7 +498,7 @@ namespace Isis { * @param key The PvlKeyword to add to the map. */ void PvlFlatMap::add(const PvlKeyword &key) { - insert(key.name().toLower(), key); + insert(QString::fromStdString(key.name()).toLower(), key); } @@ -513,7 +513,7 @@ namespace Isis { */ void PvlFlatMap::append(const QString &key, const QString &value) { - append(PvlKeyword(key, value)); + append(PvlKeyword(key.toStdString(), value.toStdString())); return; } @@ -527,19 +527,19 @@ namespace Isis { * @param key A PvlKeyword to append to the map. */ void PvlFlatMap::append(const PvlKeyword &key) { - if ( exists(key.name()) ) { - PvlFlatMapIterator kw = find(key.name().toLower()); + if ( exists(QString::fromStdString(key.name())) ) { + PvlFlatMapIterator kw = find(QString::fromStdString(key.name()).toLower()); // add all values to the map for (int i = 0; i < key.size(); i++) { kw.value().addValue(key[i]); } } else { - insert(key.name().toLower(), PvlKeyword(key.name(), key[0])); + insert(QString::fromStdString(key.name()).toLower(), PvlKeyword(key.name(), key[0])); // if there are more than one values in this keyword, insert the first // into the map and recursively call append to add the rest. for (int i = 1; i < key.size(); i++) { - append(key.name(), key[i]); + append(QString::fromStdString(key.name()), QString::fromStdString(key[i])); } } return; @@ -585,7 +585,7 @@ namespace Isis { throw IException(IException::Programmer, mess, _FILEINFO_); } - return (k.value()[index]); + return QString::fromStdString(k.value()[index]); } @@ -609,7 +609,7 @@ namespace Isis { return (defValue); } else { - return (k.value()[index]); + return QString::fromStdString(k.value()[index]); } } @@ -702,7 +702,7 @@ namespace Isis { QStringList PvlFlatMap::keywordValues(const PvlKeyword &keyword) { QStringList values; for (int i = 0 ; i < keyword.size() ; i++) { - values << keyword[i]; + values << QString::fromStdString(keyword[i]); } return (values); } @@ -734,8 +734,8 @@ namespace Isis { // Check constraints if specified int nconsts = constraints.excludeSize() + constraints.includeSize(); if ( nconsts > 0 ) { - bool isExcluded = constraints.isExcluded(object.name()); - bool isIncluded = constraints.isIncluded(object.name()); + bool isExcluded = constraints.isExcluded(QString::fromStdString(object.name())); + bool isIncluded = constraints.isIncluded(QString::fromStdString(object.name())); bool hasBoth = (constraints.excludeSize() > 0) && (constraints.includeSize() > 0); @@ -821,8 +821,8 @@ namespace Isis { // Check constraints if specified int nconsts = constraints.excludeSize() + constraints.includeSize(); if ( nconsts > 0 ) { - bool isExcluded = constraints.isExcluded(group.name()); - bool isIncluded = constraints.isIncluded(group.name()); + bool isExcluded = constraints.isExcluded(QString::fromStdString(group.name())); + bool isIncluded = constraints.isIncluded(QString::fromStdString(group.name())); bool hasBoth = (constraints.excludeSize() > 0) && (constraints.includeSize() > 0); // Check constraints @@ -878,7 +878,7 @@ namespace Isis { // if there are any keyword constraints, only load those PvlKeywords if ( constraints.keyListSize() > 0 ) { for (key = pvl.begin() ; key != pvl.end() ; ++key) { - if ( constraints.isKeyInList(key->name()) ) { + if ( constraints.isKeyInList(QString::fromStdString(key->name())) ) { add(*key); n++; } diff --git a/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp b/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp index 78763991e8..a57a09a725 100644 --- a/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp +++ b/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp @@ -80,36 +80,36 @@ namespace Isis { // Convert values if (keyword.size() == 1) { - jsonKeyword["Value"] = keyword[0].toStdString(); + jsonKeyword["Value"] = keyword[0]; } else if (keyword.size() > 1) { json valueList; for (int i = 0; i < keyword.size(); i++) { - valueList.push_back(keyword[i].toStdString()); + valueList.push_back(keyword[i]); } jsonKeyword["Value"] = valueList; } // Optionally convert units - if (keyword.size() == 1 && !keyword.unit(0).isEmpty()) { - jsonKeyword["Units"] = keyword.unit(0).toStdString(); + if (keyword.size() == 1 && !QString::fromStdString(keyword.unit(0)).isEmpty()) { + jsonKeyword["Units"] = keyword.unit(0); } - else if (keyword.size() > 1 && !keyword.unit(0).isEmpty()) { + else if (keyword.size() > 1 && !QString::fromStdString(keyword.unit(0)).isEmpty()) { json valueList; for (int i = 0; i < keyword.size(); i++) { - valueList.push_back(keyword.unit(i).toStdString()); + valueList.push_back(keyword.unit(i)); } jsonKeyword["Units"] = valueList; } // Optionally convert comments if (keyword.comments() == 1) { - jsonKeyword["Comment"] = keyword.comment(0).toStdString(); + jsonKeyword["Comment"] = keyword.comment(0); } else if (keyword.comments() > 1) { json commentList; for (int i = 0; i < keyword.comments(); i++) { - commentList.push_back(keyword.comment(i).toStdString()); + commentList.push_back(keyword.comment(i)); } jsonKeyword["Comment"] = commentList; } @@ -136,7 +136,7 @@ namespace Isis { // Convert keywords PvlContainer::PvlKeywordIterator keywordIt; for (keywordIt = container.begin(); keywordIt != container.end(); keywordIt++) { - string keywordName = keywordIt->name().replace("^", "ptr").replace(":", "_").toStdString(); + string keywordName = QString::fromStdString(keywordIt->name()).replace("^", "ptr").replace(":", "_").toStdString(); // Handle repeated keywords by packing them into an array if ( jsonContainer.contains(keywordName) ) { if (!jsonContainer[keywordName].is_array()) { @@ -153,12 +153,12 @@ namespace Isis { // Optionally convert comments if (container.comments() == 1) { - jsonContainer["Comment"] = container.comment(0).toStdString(); + jsonContainer["Comment"] = container.comment(0); } else if (container.comments() > 1) { json commentList; for (int i = 0; i < container.comments(); i++) { - commentList.push_back(container.comment(i).toStdString()); + commentList.push_back(container.comment(i)); } jsonContainer["Comment"] = commentList; } @@ -301,16 +301,16 @@ namespace Isis { PvlObject::PvlGroupIterator groupIt; for (groupIt = object.beginGroup(); groupIt != object.endGroup(); groupIt++) { // Handle repeated elements by packing them into an array - if ( jsonObject.contains(groupIt->name().toStdString()) ) { - if (!jsonObject[groupIt->name().toStdString()].is_array()) { + if ( jsonObject.contains(groupIt->name()) ) { + if (!jsonObject[groupIt->name()].is_array()) { json repeatedArray; - repeatedArray.push_back(jsonObject[groupIt->name().toStdString()]); - jsonObject[groupIt->name().toStdString()] = repeatedArray; + repeatedArray.push_back(jsonObject[groupIt->name()]); + jsonObject[groupIt->name()] = repeatedArray; } - jsonObject[groupIt->name().toStdString()].push_back(pvlGroupToJSON(*groupIt)); + jsonObject[groupIt->name()].push_back(pvlGroupToJSON(*groupIt)); } else { - jsonObject[groupIt->name().toStdString()] = pvlGroupToJSON(*groupIt); + jsonObject[groupIt->name()] = pvlGroupToJSON(*groupIt); } } @@ -318,16 +318,16 @@ namespace Isis { PvlObject::PvlObjectIterator objectIt; for (objectIt = object.beginObject(); objectIt != object.endObject(); objectIt++) { // Handle repeated elements by packing them into an array - if ( jsonObject.contains(objectIt->name().toStdString()) ) { - if (!jsonObject[objectIt->name().toStdString()].is_array()) { + if ( jsonObject.contains(objectIt->name()) ) { + if (!jsonObject[objectIt->name()].is_array()) { json repeatedArray; - repeatedArray.push_back(jsonObject[objectIt->name().toStdString()]); - jsonObject[objectIt->name().toStdString()] = repeatedArray; + repeatedArray.push_back(jsonObject[objectIt->name()]); + jsonObject[objectIt->name()] = repeatedArray; } - jsonObject[objectIt->name().toStdString()].push_back(pvlObjectToJSON(*objectIt)); + jsonObject[objectIt->name()].push_back(pvlObjectToJSON(*objectIt)); } else { - jsonObject[objectIt->name().toStdString()] = pvlObjectToJSON(*objectIt); + jsonObject[objectIt->name()] = pvlObjectToJSON(*objectIt); } } return jsonObject; @@ -363,7 +363,7 @@ namespace Isis { Pvl pvl; try { - pvl.read(pvlFile); + pvl.read(pvlFile.toStdString()); } catch (IException &e){ QString msg = QString("Failed to open file for PVL Input: [%1]").arg(pvlFile); diff --git a/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp b/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp index 9ff2e5a20c..1580d6477e 100644 --- a/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp +++ b/isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp @@ -111,9 +111,9 @@ namespace Isis { while((grp = InputGroup(translationGroupName, inst++)).name() != "") { if((con = GetContainer(grp)) != NULL) { - if(con->hasKeyword(InputKeywordName(translationGroupName))) { + if(con->hasKeyword(InputKeywordName(translationGroupName).toStdString())) { return PvlTranslationTable::Translate(translationGroupName, - (*con)[InputKeywordName(translationGroupName)][findex]); + QString::fromStdString((*con)[InputKeywordName(translationGroupName).toStdString()][findex])); } } } @@ -149,7 +149,7 @@ namespace Isis { while((grp = InputGroup(translationGroupName, inst++)).name() != "") { if((con = GetContainer(grp)) != NULL) { - transGroup = TranslationTable().findGroup(translationGroupName); + transGroup = TranslationTable().findGroup(translationGroupName.toStdString()); Pvl::ConstPvlKeywordIterator it = transGroup.findKeyword("InputKey", transGroup.begin(), transGroup.end()); @@ -158,12 +158,10 @@ namespace Isis { while(it != transGroup.end()) { const PvlKeyword &result = *it; if(con->hasKeyword(result[0])) { - key.setName(OutputName(translationGroupName)); + key.setName(OutputName(translationGroupName).toStdString()); for(int v = 0; v < (*con)[(result[0])].size(); v++) { - key.addValue(PvlTranslationTable::Translate(translationGroupName, - (*con)[result[0]][v]), - (*con)[result[0]].unit(v)); + key.addValue(PvlTranslationTable::Translate(translationGroupName, QString::fromStdString((*con)[result[0]][v])).toStdString(),(*con)[result[0]].unit(v)); } return key; @@ -173,8 +171,8 @@ namespace Isis { } } - return PvlKeyword(OutputName(translationGroupName), - PvlTranslationTable::Translate(translationGroupName, "")); + return PvlKeyword(OutputName(translationGroupName).toStdString(), + PvlTranslationTable::Translate(translationGroupName, "").toStdString()); } @@ -200,13 +198,13 @@ namespace Isis { // Attempt to translate every group in the translation table for(int i = 0; i < TranslationTable().groups(); i++) { PvlGroup &g = TranslationTable().group(i); - if(IsAuto(g.name())) { + if(IsAuto(QString::fromStdString(g.name()))) { try { - PvlContainer *con = CreateContainer(g.name(), outputLabel); - (*con) += DoTranslation(g.name()); + PvlContainer *con = CreateContainer(QString::fromStdString(g.name()), outputLabel); + (*con) += DoTranslation(QString::fromStdString(g.name())); } catch(IException &e) { - if(!IsOptional(g.name())) { + if(!IsOptional(QString::fromStdString(g.name()))) { throw; } } @@ -239,8 +237,8 @@ namespace Isis { if(containingGroup != NULL) { anInputGroupFound = true; - if(containingGroup->hasKeyword(InputKeywordName(translationGroupName))) { - return containingGroup->findKeyword(InputKeywordName(translationGroupName)); + if(containingGroup->hasKeyword(InputKeywordName(translationGroupName).toStdString())) { + return containingGroup->findKeyword(InputKeywordName(translationGroupName).toStdString()); } } @@ -249,8 +247,8 @@ namespace Isis { } if(anInputGroupFound) { - QString msg = "Unable to find input keyword [" + InputKeywordName(translationGroupName) + - "] for output name [" + translationGroupName + "] in file [" + TranslationTable().fileName() + "]"; + std::string msg = "Unable to find input keyword [" + InputKeywordName(translationGroupName).toStdString() + + "] for output name [" + translationGroupName.toStdString() + "] in file [" + TranslationTable().fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { @@ -259,11 +257,11 @@ namespace Isis { for(int i = 0; i < InputGroup(translationGroupName).size(); i++) { if(i > 0) container += ","; - container += InputGroup(translationGroupName)[i]; + container += QString::fromStdString(InputGroup(translationGroupName)[i]); } - QString msg = "Unable to find input group [" + container + - "] for output name [" + translationGroupName + "] in file [" + TranslationTable().fileName() + "]"; + std::string msg = "Unable to find input group [" + container.toStdString() + + "] for output name [" + translationGroupName.toStdString() + "] in file [" + TranslationTable().fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -291,7 +289,7 @@ namespace Isis { PvlKeyword grp; while((grp = InputGroup(translationGroupName, inst++)).name() != "") { if((con = GetContainer(grp)) != NULL) { - if(con->hasKeyword(InputKeywordName(translationGroupName))) return true; + if(con->hasKeyword(InputKeywordName(translationGroupName).toStdString())) return true; } } diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp index 598ff18a21..d6cbd28595 100644 --- a/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp +++ b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp @@ -223,15 +223,15 @@ namespace Isis { // Attempt to translate every group in the translation table for(int i = 0; i < TranslationTable().groups(); i++) { PvlGroup &g = TranslationTable().group(i); - if(IsAuto(g.name())) { + if(IsAuto(QString::fromStdString(g.name()))) { try { QDomElement element = outputLabel.documentElement(); - QDomElement *parentElement = createParentElements(g.name(), element); + QDomElement *parentElement = createParentElements(QString::fromStdString(g.name()), element); // deal with siblings and attributes doTranslation(g, *parentElement); } catch(IException &e) { - if(!IsOptional(g.name())) { + if(!IsOptional(QString::fromStdString(g.name()))) { throw;//??? } } diff --git a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp index def84fbd3d..3c19aecca7 100644 --- a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp +++ b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp @@ -245,20 +245,20 @@ namespace Isis { if (QString::compare((QString) key[1], tmpFValue, Qt::CaseInsensitive) == 0) { return key[0]; } - else if ((QString) key[1] == "*") { - if ((QString) key[0] == "*") { + else if ((std::string) key[1] == "*") { + if ((std::string) key[0] == "*") { return tmpFValue; } else { - return key[0]; + return QString::fromStdString(key[0]); } } it = translationGroup.findKeyword("Translation", it + 1, translationGroup.end()); } - QString msg = "Unable to find a translation value for [" + - translationGroupName + ", " + inputKeyValue + "] in file [" + + std::string msg = "Unable to find a translation value for [" + + translationGroupName.toStdString() + ", " + inputKeyValue + "] in file [" + p_trnsTbl.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -308,8 +308,8 @@ namespace Isis { // This check is to prevent backtracking to the old "value,value" way of // doing translation file input groups for the new keyword. Flag it // immediately to give a good error message. - if (result.size() == 1 && result[0].contains(",")) { - QString msg = "Keyword [InputPosition] cannot have a comma [,] in "; + if (result.size() == 1 && QString::fromStdString(result[0]).contains(",")) { + std::string msg = "Keyword [InputPosition] cannot have a comma [,] in "; msg += " the value ["; msg += result[0]; msg += "]"; @@ -361,7 +361,7 @@ namespace Isis { const PvlGroup &translationGroup = findTranslationGroup(translationGroupName); - if (translationGroup.hasKeyword("InputKey")) return translationGroup["InputKey"]; + if (translationGroup.hasKeyword("InputKey")) return QString::fromStdString(translationGroup["InputKey"]); return ""; } @@ -383,7 +383,7 @@ namespace Isis { const PvlGroup &translationGroup = findTranslationGroup(translationGroupName); - if (translationGroup.hasKeyword("InputDefault")) return translationGroup["InputDefault"]; + if (translationGroup.hasKeyword("InputDefault")) return QString::fromStdString(translationGroup["InputDefault"]); return ""; } @@ -485,8 +485,8 @@ namespace Isis { const PvlGroup &translationGroup = findTranslationGroup(translationGroupName); if (!translationGroup.hasKeyword("OutputPosition")) { - QString msg = "Unable to find translation keyword [OutputPostion] in [" + - translationGroupName + "] in file [" + p_trnsTbl.fileName() + "]"; + std::string msg = "Unable to find translation keyword [OutputPostion] in [" + + translationGroupName.toStdString() + "] in file [" + p_trnsTbl.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -513,7 +513,7 @@ namespace Isis { const PvlGroup &translationGroup = findTranslationGroup(translationGroupName); if (translationGroup.hasKeyword("OutputName")) { - return translationGroup["OutputName"]; + return QString::fromStdString(translationGroup["OutputName"]); } return ""; @@ -536,8 +536,8 @@ namespace Isis { * group in file." */ const PvlGroup &PvlTranslationTable::findTranslationGroup(const QString translationGroupName) const { - if (!p_trnsTbl.hasGroup(translationGroupName)) { - QString msg = "Unable to find translation group [" + translationGroupName + + if (!p_trnsTbl.hasGroup(translationGroupName.toStdString())) { + std::string msg = "Unable to find translation group [" + translationGroupName.toStdString() + "] in file [" + p_trnsTbl.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Reduce/Reduce.cpp b/isis/src/base/objs/Reduce/Reduce.cpp index 7c1723bd2b..2447805cb9 100644 --- a/isis/src/base/objs/Reduce/Reduce.cpp +++ b/isis/src/base/objs/Reduce/Reduce.cpp @@ -117,16 +117,16 @@ namespace Isis { // Information will be added to it if the Mapping or Instrument // groups are deleted from the output image label PvlGroup resultsGrp("Results"); - resultsGrp += PvlKeyword("InputLines", toString(miInputLines)); - resultsGrp += PvlKeyword("InputSamples", toString(miInputSamples)); - resultsGrp += PvlKeyword("StartingLine", toString(miStartLine)); - resultsGrp += PvlKeyword("StartingSample", toString(miStartSample)); - resultsGrp += PvlKeyword("EndingLine", toString(miEndLine)); - resultsGrp += PvlKeyword("EndingSample", toString(miEndSample)); - resultsGrp += PvlKeyword("LineIncrement", toString(mdLineScale)); - resultsGrp += PvlKeyword("SampleIncrement", toString(mdSampleScale)); - resultsGrp += PvlKeyword("OutputLines", toString(miOutputLines)); - resultsGrp += PvlKeyword("OutputSamples", toString(miOutputSamples)); + resultsGrp += PvlKeyword("InputLines", std::to_string(miInputLines)); + resultsGrp += PvlKeyword("InputSamples", std::to_string(miInputSamples)); + resultsGrp += PvlKeyword("StartingLine", std::to_string(miStartLine)); + resultsGrp += PvlKeyword("StartingSample", std::to_string(miStartSample)); + resultsGrp += PvlKeyword("EndingLine", std::to_string(miEndLine)); + resultsGrp += PvlKeyword("EndingSample", std::to_string(miEndSample)); + resultsGrp += PvlKeyword("LineIncrement", std::to_string(mdLineScale)); + resultsGrp += PvlKeyword("SampleIncrement", std::to_string(mdSampleScale)); + resultsGrp += PvlKeyword("OutputLines", std::to_string(miOutputLines)); + resultsGrp += PvlKeyword("OutputSamples", std::to_string(miOutputSamples)); Isis::SubArea subArea; subArea.SetSubArea(mInCube->lineCount(), mInCube->sampleCount(), miStartLine, miStartSample, diff --git a/isis/src/base/objs/ReseauDistortionMap/ReseauDistortionMap.cpp b/isis/src/base/objs/ReseauDistortionMap/ReseauDistortionMap.cpp index 86d7de55b1..f903a0ff29 100644 --- a/isis/src/base/objs/ReseauDistortionMap/ReseauDistortionMap.cpp +++ b/isis/src/base/objs/ReseauDistortionMap/ReseauDistortionMap.cpp @@ -28,7 +28,7 @@ namespace Isis { ReseauDistortionMap::ReseauDistortionMap(Camera *parent, Pvl &labels, const QString &fname) : CameraDistortionMap(parent, 1.0) { // Set up distortion coefficients - Pvl mast(fname); + Pvl mast(fname.toStdString()); PvlGroup dim = mast.findGroup("Dimensions"); p_distortedLines = dim.findKeyword("DistortedLines"); p_distortedSamps = dim.findKeyword("DistortedSamples"); @@ -44,8 +44,8 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } for(int i = 0; i < p_numRes; i++) { - p_mlines.push_back(toDouble(mline[i])); - p_msamps.push_back(toDouble(msamp[i])); + p_mlines.push_back(std::stod(mline[i])); + p_msamps.push_back(std::stod(msamp[i])); } p_pixelPitch = parent->PixelPitch(); @@ -58,8 +58,8 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } for(int i = 0; i < p_numRes; i++) { - p_rlines.push_back(toDouble(rline[i])); - p_rsamps.push_back(toDouble(rsamp[i])); + p_rlines.push_back(std::stod(rline[i])); + p_rsamps.push_back(std::stod(rsamp[i])); } if(p_mlines.size() != p_rlines.size()) { string msg = "The number of master reseaus and refined reseaus"; diff --git a/isis/src/base/objs/Resource/Resource.cpp b/isis/src/base/objs/Resource/Resource.cpp index dabef59da3..fbf2747eec 100644 --- a/isis/src/base/objs/Resource/Resource.cpp +++ b/isis/src/base/objs/Resource/Resource.cpp @@ -272,7 +272,7 @@ namespace Isis { return ( m_data->m_keys.keyword(keywordName) ); } // Return empty keyword - return (PvlKeyword(keywordName)); + return (PvlKeyword(keywordName.toStdString())); } @@ -564,7 +564,7 @@ namespace Isis { * @return PvlObject An object with all keywords in the map */ PvlObject Resource::toPvl(const QString &pvlName) const { - PvlObject object(pvlName); + PvlObject object(pvlName.toStdString()); PvlFlatMap::ConstPvlFlatMapIterator key = m_data->m_keys.begin(); while ( key != m_data->m_keys.end() ) { object.addKeyword(key.value()); diff --git a/isis/src/base/objs/RingCylindrical/RingCylindrical.cpp b/isis/src/base/objs/RingCylindrical/RingCylindrical.cpp index 1a235f0a2d..d677a92423 100644 --- a/isis/src/base/objs/RingCylindrical/RingCylindrical.cpp +++ b/isis/src/base/objs/RingCylindrical/RingCylindrical.cpp @@ -45,14 +45,14 @@ namespace Isis { // Compute the default value if allowed and needed if ((allowDefaults) && (!mapGroup.hasKeyword("CenterRingLongitude"))) { double az = (m_minimumRingLongitude + m_maximumRingLongitude) / 2.0; - mapGroup += PvlKeyword("CenterRingLongitude", toString(az)); + mapGroup += PvlKeyword("CenterRingLongitude", std::to_string(az)); } // Compute and write the default center radius if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterRingRadius"))) { double radius = (m_minimumRingRadius + m_maximumRingRadius) / 2.0; - mapGroup += PvlKeyword("CenterRingRadius", toString(radius)); + mapGroup += PvlKeyword("CenterRingRadius", std::to_string(radius)); } // Get the center ring radius and center ring longitude. @@ -274,11 +274,11 @@ namespace Isis { PvlGroup RingCylindrical::Mapping() { PvlGroup mapping = RingPlaneProjection::Mapping(); - mapping += PvlKeyword("CenterRingRadius", toString(m_centerRingRadius)); + mapping += PvlKeyword("CenterRingRadius", std::to_string(m_centerRingRadius)); double dir = 1.0; if (m_ringLongitudeDirection == Clockwise) dir = -1.0; double lonDegrees = m_centerRingLongitude*RAD2DEG*dir; - mapping += PvlKeyword("CenterRingLongitude", toString(lonDegrees)); + mapping += PvlKeyword("CenterRingLongitude", std::to_string(lonDegrees)); return mapping; } diff --git a/isis/src/base/objs/RingPlaneProjection/RingPlaneProjection.cpp b/isis/src/base/objs/RingPlaneProjection/RingPlaneProjection.cpp index 21773a4726..7e3cd14d62 100644 --- a/isis/src/base/objs/RingPlaneProjection/RingPlaneProjection.cpp +++ b/isis/src/base/objs/RingPlaneProjection/RingPlaneProjection.cpp @@ -70,10 +70,10 @@ namespace Isis { try { // Mapping group is read by the parent (Projection) // Get the RingLongitude Direction - if ((QString) m_mappingGrp["RingLongitudeDirection"] == "Clockwise") { + if ((std::string)m_mappingGrp["RingLongitudeDirection"] == "Clockwise") { m_ringLongitudeDirection = Clockwise; } - else if ((QString) m_mappingGrp["RingLongitudeDirection"] == "CounterClockwise") { + else if ((std::string)m_mappingGrp["RingLongitudeDirection"] == "CounterClockwise") { m_ringLongitudeDirection = CounterClockwise; } else { @@ -84,10 +84,10 @@ namespace Isis { } // Get the RingLongitudeDomain - if ((QString) m_mappingGrp["RingLongitudeDomain"] == "360") { + if ((std::string)m_mappingGrp["RingLongitudeDomain"] == "360") { m_ringLongitudeDomain = 360; } - else if ((QString) m_mappingGrp["RingLongitudeDomain"] == "180") { + else if ((std::string)m_mappingGrp["RingLongitudeDomain"] == "180") { m_ringLongitudeDomain = 180; } else { diff --git a/isis/src/base/objs/Robinson/Robinson.cpp b/isis/src/base/objs/Robinson/Robinson.cpp index 61e7b54a49..8837fef81e 100644 --- a/isis/src/base/objs/Robinson/Robinson.cpp +++ b/isis/src/base/objs/Robinson/Robinson.cpp @@ -93,7 +93,7 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } // Get the center longitude diff --git a/isis/src/base/objs/SerialNumber/SerialNumber.cpp b/isis/src/base/objs/SerialNumber/SerialNumber.cpp index f9ee7cd152..1eb8cc84e4 100644 --- a/isis/src/base/objs/SerialNumber/SerialNumber.cpp +++ b/isis/src/base/objs/SerialNumber/SerialNumber.cpp @@ -46,7 +46,7 @@ namespace Isis { if(def2filename) { // Try to return the filename if it exists in the label, otherwise use // "Unknown" as a last resort. - QString snTemp = label.fileName(); + QString snTemp = QString::fromStdString(label.fileName()); if(!snTemp.isEmpty()) { sn = FileName(snTemp).name(); } @@ -84,7 +84,7 @@ namespace Isis { * @return Calculated SerialNumber or FileName */ QString SerialNumber::Compose(const QString &filename, bool def2filename) { - Pvl p(filename); + Pvl p(filename.toStdString()); return Compose(p, def2filename); } @@ -149,7 +149,7 @@ namespace Isis { } PvlGroup snGroup = outLabel.findGroup("SerialNumberKeywords"); - snGroup += PvlKeyword("ObservationKeys", toString(snGroup.keywords())); + snGroup += PvlKeyword("ObservationKeys", std::to_string(snGroup.keywords())); return snGroup; } @@ -162,10 +162,10 @@ namespace Isis { * @param keys the number of strings to contatenate */ QString SerialNumber::CreateSerialNumber(PvlGroup &snGroup, int keys) { - QString sn = snGroup["Keyword1"][0]; + QString sn = QString::fromStdString(snGroup["Keyword1"][0]); for(int i = 2; i <= keys; i++) { QString keyword = QString("Keyword%1").arg(i); - sn += "/" + snGroup[keyword][0]; + sn += "/" + QString::fromStdString(snGroup[keyword.toStdString()][0]); } return sn; } diff --git a/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp b/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp index 20de495113..5898364222 100644 --- a/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp +++ b/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp @@ -119,7 +119,7 @@ namespace Isis { * does not exist. */ void SerialNumberList::add(const QString &filename, bool def2filename) { - Pvl p(Isis::FileName(filename).expanded()); + Pvl p(Isis::FileName(filename).expanded().toStdString()); PvlObject cubeObj = p.findObject("IsisCube"); try { @@ -149,7 +149,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } - target = targetGroup["TargetName"][0]; + target = QString::fromStdString(targetGroup["TargetName"][0]); target = target.toUpper(); if (m_target.isEmpty()) { m_target = target; @@ -186,8 +186,8 @@ namespace Isis { if (cubeObj.hasGroup("CsmInfo")) { PvlGroup csmGroup = cubeObj.findGroup("CsmInfo"); if (csmGroup.hasKeyword("CSMPlatformID") && csmGroup.hasKeyword("CSMInstrumentId")) { - nextpair.spacecraftName = cubeObj.findGroup("CsmInfo")["CSMPlatformID"][0]; - nextpair.instrumentId = cubeObj.findGroup("CsmInfo")["CSMInstrumentId"][0]; + nextpair.spacecraftName = QString::fromStdString(cubeObj.findGroup("CsmInfo")["CSMPlatformID"][0]); + nextpair.instrumentId = QString::fromStdString(cubeObj.findGroup("CsmInfo")["CSMInstrumentId"][0]); } } @@ -196,8 +196,8 @@ namespace Isis { else if (cubeObj.hasGroup("Instrument")) { PvlGroup instGroup = cubeObj.findGroup("Instrument"); if (instGroup.hasKeyword("SpacecraftName") && instGroup.hasKeyword("InstrumentId")) { - nextpair.spacecraftName = cubeObj.findGroup("Instrument")["SpacecraftName"][0]; - nextpair.instrumentId = cubeObj.findGroup("Instrument")["InstrumentId"][0]; + nextpair.spacecraftName = QString::fromStdString(cubeObj.findGroup("Instrument")["SpacecraftName"][0]); + nextpair.instrumentId = QString::fromStdString(cubeObj.findGroup("Instrument")["InstrumentId"][0]); } } @@ -249,7 +249,7 @@ namespace Isis { * */ void SerialNumberList::add(const QString &serialNumber, const QString &filename) { - Pvl p(Isis::FileName(filename).expanded()); + Pvl p(Isis::FileName(filename).expanded().toStdString()); PvlObject cubeObj = p.findObject("IsisCube"); try { @@ -271,7 +271,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } - target = targetGroup["TargetName"][0]; + target = QString::fromStdString(targetGroup["TargetName"][0]); target = target.toUpper(); if (m_target.isEmpty()) { m_target = target; @@ -334,8 +334,8 @@ namespace Isis { if (cubeObj.hasGroup("CsmInfo")) { PvlGroup csmGroup = cubeObj.findGroup("CsmInfo"); if (csmGroup.hasKeyword("CSMPlatformID") && csmGroup.hasKeyword("CSMInstrumentId")) { - nextpair.spacecraftName = cubeObj.findGroup("CsmInfo")["CSMPlatformID"][0]; - nextpair.instrumentId = cubeObj.findGroup("CsmInfo")["CSMInstrumentId"][0]; + nextpair.spacecraftName = QString::fromStdString(cubeObj.findGroup("CsmInfo")["CSMPlatformID"][0]); + nextpair.instrumentId = QString::fromStdString(cubeObj.findGroup("CsmInfo")["CSMInstrumentId"][0]); } } @@ -344,8 +344,8 @@ namespace Isis { else if (cubeObj.hasGroup("Instrument")) { PvlGroup instGroup = cubeObj.findGroup("Instrument"); if (instGroup.hasKeyword("SpacecraftName") && instGroup.hasKeyword("InstrumentId")) { - nextpair.spacecraftName = cubeObj.findGroup("Instrument")["SpacecraftName"][0]; - nextpair.instrumentId = cubeObj.findGroup("Instrument")["InstrumentId"][0]; + nextpair.spacecraftName = QString::fromStdString(cubeObj.findGroup("Instrument")["SpacecraftName"][0]); + nextpair.instrumentId = QString::fromStdString(cubeObj.findGroup("Instrument")["InstrumentId"][0]); } } diff --git a/isis/src/base/objs/SessionLog/SessionLog.cpp b/isis/src/base/objs/SessionLog/SessionLog.cpp index e73c3072e5..77bcdd14b9 100644 --- a/isis/src/base/objs/SessionLog/SessionLog.cpp +++ b/isis/src/base/objs/SessionLog/SessionLog.cpp @@ -15,10 +15,10 @@ namespace Isis { SessionLog::SessionLog() { // Grab the user preferences for logging Isis::PvlGroup &slog = Isis::Preference::Preferences().findGroup("SessionLog"); - p_termOutput = ((QString)slog["TerminalOutput"]).toUpper() == "ON"; - p_fileOutput = ((QString)slog["FileOutput"]).toUpper() == "ON"; - p_outputFile = (QString) slog["FileName"]; - p_access = ((QString) slog["FileAccess"]).toUpper(); + p_termOutput = QString::fromStdString(slog["TerminalOutput"]).toUpper() == "ON"; + p_fileOutput = QString::fromStdString(slog["FileOutput"]).toUpper() == "ON"; + p_outputFile = QString::fromStdString(slog["FileName"]); + p_access = (QString::fromStdString(slog["FileAccess"])).toUpper(); // Add root this->addObject(Isis::iApp->History()); @@ -58,10 +58,10 @@ namespace Isis { setTerminator("\n"); try { if(p_access == "OVERWRITE") { - this->Isis::Pvl::write(p_outputFile); + this->Isis::Pvl::write(p_outputFile.toStdString()); } else { - this->append(p_outputFile); + this->append(p_outputFile.toStdString()); } } catch(...) { diff --git a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp index 5f05b8b9d3..af7add020e 100644 --- a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp +++ b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp @@ -90,11 +90,11 @@ namespace Isis { } else if (kernelsPvlGroup.hasKeyword("ElevationModel") && !kernelsPvlGroup["ElevationModel"].isNull()) { - shapeModelFilenames = (QString) kernelsPvlGroup["ElevationModel"]; + shapeModelFilenames = QString::fromStdString(kernelsPvlGroup["ElevationModel"]); } else if (kernelsPvlGroup.hasKeyword("ShapeModel") && !kernelsPvlGroup["ShapeModel"].isNull()) { - shapeModelFilenames = (QString) kernelsPvlGroup["ShapeModel"]; + shapeModelFilenames = QString::fromStdString(kernelsPvlGroup["ShapeModel"]); } // Create shape model @@ -181,9 +181,9 @@ namespace Isis { b_model->setTolerance(tolerance); // Do this here, otherwise default behavior will ensue from here on out - kernelsPvlGroup.addKeyword(PvlKeyword("RayTraceEngine", preferred), PvlContainer::Replace); - kernelsPvlGroup.addKeyword(PvlKeyword("OnError", onerror), PvlContainer::Replace); - kernelsPvlGroup.addKeyword(PvlKeyword("Tolerance", toString(tolerance)), + kernelsPvlGroup.addKeyword(PvlKeyword("RayTraceEngine", preferred.toStdString()), PvlContainer::Replace); + kernelsPvlGroup.addKeyword(PvlKeyword("OnError", onerror.toStdString()), PvlContainer::Replace); + kernelsPvlGroup.addKeyword(PvlKeyword("Tolerance", std::to_string(tolerance)), PvlContainer::Replace); return ( b_model ); @@ -218,9 +218,9 @@ namespace Isis { embreeModel->setTolerance(tolerance); // Do this here, otherwise default behavior will ensue from here on out - kernelsPvlGroup.addKeyword(PvlKeyword("RayTraceEngine", preferred), PvlContainer::Replace); - kernelsPvlGroup.addKeyword(PvlKeyword("OnError", onerror), PvlContainer::Replace); - kernelsPvlGroup.addKeyword(PvlKeyword("Tolerance", toString(tolerance)), + kernelsPvlGroup.addKeyword(PvlKeyword("RayTraceEngine", preferred.toStdString()), PvlContainer::Replace); + kernelsPvlGroup.addKeyword(PvlKeyword("OnError", onerror.toStdString()), PvlContainer::Replace); + kernelsPvlGroup.addKeyword(PvlKeyword("Tolerance", std::to_string(tolerance)), PvlContainer::Replace); return ( embreeModel ); diff --git a/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp b/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp index 6871f9b223..f549c03f31 100644 --- a/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp +++ b/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp @@ -44,7 +44,7 @@ namespace Isis { // Compute the default value if allowed and needed if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } // Get the center longitude, convert to radians, adjust for longitude diff --git a/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp b/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp index 9e02a27856..a7cbfbb304 100644 --- a/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp +++ b/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp @@ -45,7 +45,7 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } // Get the center longitude diff --git a/isis/src/base/objs/SmtkMatcher/SmtkMatcher.cpp b/isis/src/base/objs/SmtkMatcher/SmtkMatcher.cpp index 5b1418e72c..a587382800 100644 --- a/isis/src/base/objs/SmtkMatcher/SmtkMatcher.cpp +++ b/isis/src/base/objs/SmtkMatcher/SmtkMatcher.cpp @@ -76,7 +76,7 @@ namespace Isis { * @param regdef Gruen definitions Pvl file */ void SmtkMatcher::setGruenDef(const QString ®def) { - Pvl reg(regdef); + Pvl reg(regdef.toStdString()); m_gruen = QSharedPointer (new Gruen(reg)); // Deallocation automatic return; } diff --git a/isis/src/base/objs/Spice/Spice.cpp b/isis/src/base/objs/Spice/Spice.cpp index 29b4d3641b..1596745576 100644 --- a/isis/src/base/objs/Spice/Spice.cpp +++ b/isis/src/base/objs/Spice/Spice.cpp @@ -171,14 +171,14 @@ namespace Isis { // Get the time padding first if (kernels.hasKeyword("StartPadding")) { - *m_startTimePadding = toDouble(kernels["StartPadding"][0]); + *m_startTimePadding = std::stod(kernels["StartPadding"][0]); } else { *m_startTimePadding = 0.0; } if (kernels.hasKeyword("EndPadding")) { - *m_endTimePadding = toDouble(kernels["EndPadding"][0]); + *m_endTimePadding = std::stod(kernels["EndPadding"][0]); } else { *m_endTimePadding = 0.0; @@ -206,7 +206,7 @@ namespace Isis { props["kernels"] = kernel_pvl.str(); - isd = ale::load(lab.fileName().toStdString(), props.dump(), "ale", false, false, true); + isd = ale::load(lab.fileName(), props.dump(), "ale", false, false, true); } json aleNaifKeywords = isd["naif_keywords"]; @@ -297,7 +297,7 @@ namespace Isis { QString trykey = "NaifIkCode"; if (kernels.hasKeyword("NaifFrameCode")) trykey = "NaifFrameCode"; - *m_ikCode = toInt(kernels[trykey][0]); + *m_ikCode = std::stoi(kernels[trykey.toStdString()][0]); *m_spkCode = *m_ikCode / 1000; *m_sclkCode = *m_spkCode; @@ -408,11 +408,11 @@ namespace Isis { } solarLongitude(); } - else if (kernels["TargetPosition"][0].toUpper() == "TABLE") { - Table t("SunPosition", lab.fileName(), lab); + else if (QString::fromStdString(kernels["TargetPosition"][0]).toUpper() == "TABLE") { + Table t("SunPosition", QString::fromStdString(lab.fileName()), lab); m_sunPosition->LoadCache(t); - Table t2("BodyRotation", lab.fileName(), lab); + Table t2("BodyRotation", QString::fromStdString(lab.fileName()), lab); m_bodyRotation->LoadCache(t2); if (t2.Label().hasKeyword("SolarLongitude")) { *m_solarLongitude = Longitude(t2.Label()["SolarLongitude"], @@ -437,7 +437,7 @@ namespace Isis { // 2009-03-18 Tracie Sucharski - Removed test for old keywords, any files // with the old keywords should be re-run through spiceinit. - if (kernels["InstrumentPointing"][0].toUpper() == "NADIR" && !isUsingAle()) { + if (QString::fromStdString(kernels["InstrumentPointing"][0]).toUpper() == "NADIR" && !isUsingAle()) { if (m_instrumentRotation) { delete m_instrumentRotation; m_instrumentRotation = NULL; @@ -452,8 +452,8 @@ namespace Isis { m_instrumentRotation->LoadTimeCache(); } } - else if (kernels["InstrumentPointing"][0].toUpper() == "TABLE") { - Table t("InstrumentPointing", lab.fileName(), lab); + else if (QString::fromStdString(kernels["InstrumentPointing"][0]).toUpper() == "TABLE") { + Table t("InstrumentPointing", QString::fromStdString(lab.fileName()), lab); m_instrumentRotation->LoadCache(t); } @@ -467,8 +467,8 @@ namespace Isis { if (m_usingAle) { m_instrumentPosition->LoadCache(isd["instrument_position"]); } - else if (kernels["InstrumentPosition"][0].toUpper() == "TABLE") { - Table t("InstrumentPosition", lab.fileName(), lab); + else if (QString::fromStdString(kernels["InstrumentPosition"][0]).toUpper() == "TABLE") { + Table t("InstrumentPosition", QString::fromStdString(lab.fileName()), lab); m_instrumentPosition->LoadCache(t); } NaifStatus::CheckErrors(); @@ -488,18 +488,18 @@ namespace Isis { for (int i = 0; i < key.size(); i++) { if (key[i] == "") continue; - if (key[i].toUpper() == "NULL") break; - if (key[i].toUpper() == "NADIR") break; - if (key[i].toUpper() == "TABLE" && !noTables) break; - if (key[i].toUpper() == "TABLE" && noTables) continue; - FileName file(key[i]); + if (QString::fromStdString(key[i]).toUpper() == "NULL") break; + if (QString::fromStdString(key[i]).toUpper() == "NADIR") break; + if (QString::fromStdString(key[i]).toUpper() == "TABLE" && !noTables) break; + if (QString::fromStdString(key[i]).toUpper() == "TABLE" && noTables) continue; + FileName file(QString::fromStdString(key[i])); if (!file.fileExists()) { QString msg = "Spice file does not exist [" + file.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } QString fileName = file.expanded(); furnsh_c(fileName.toLatin1().data()); - m_kernels->push_back(key[i]); + m_kernels->push_back(QString::fromStdString(key[i])); } NaifStatus::CheckErrors(); @@ -1200,27 +1200,27 @@ namespace Isis { void Spice::storeValue(QString key, int index, SpiceValueType type, QVariant value) { - if (!m_naifKeywords->hasKeyword(key)) { - m_naifKeywords->addKeyword(PvlKeyword(key)); + if (!m_naifKeywords->hasKeyword(key.toStdString())) { + m_naifKeywords->addKeyword(PvlKeyword(key.toStdString())); } - PvlKeyword &storedKey = m_naifKeywords->findKeyword(key); + PvlKeyword &storedKey = m_naifKeywords->findKeyword(key.toStdString()); while(index >= storedKey.size()) { storedKey.addValue(""); } if (type == SpiceByteCodeType) { - storedKey[index] = QString(value.toByteArray().toHex().data()); + storedKey[index] = value.toByteArray().toHex().data(); } else if (type == SpiceStringType) { - storedKey[index] = value.toString(); + storedKey[index] = value.toString().toStdString(); } else if (type == SpiceDoubleType) { - storedKey[index] = toString(value.toDouble()); + storedKey[index] = std::to_string(value.toDouble()); } else if (type == SpiceIntType) { - storedKey[index] = toString(value.toInt()); + storedKey[index] = std::to_string(value.toInt()); } else { QString msg = "Unable to store variant in labels for key [" + key + "]"; @@ -1234,21 +1234,21 @@ namespace Isis { // Read from PvlObject that is our naif keywords QVariant result; - if (m_naifKeywords->hasKeyword(key) && (!m_usingNaif || m_usingAle)) { - PvlKeyword &storedKeyword = m_naifKeywords->findKeyword(key); + if (m_naifKeywords->hasKeyword(key.toStdString()) && (!m_usingNaif || m_usingAle)) { + PvlKeyword &storedKeyword = m_naifKeywords->findKeyword(key.toStdString()); try { if (type == SpiceDoubleType) { - result = toDouble(storedKeyword[index]); + result = std::stod(storedKeyword[index]); } else if (type == SpiceStringType) { - result = storedKeyword[index]; + result = QString::fromStdString(storedKeyword[index]); } else if (type == SpiceByteCodeType || SpiceStringType) { - result = storedKeyword[index].toLatin1(); + result = QString::fromStdString(storedKeyword[index]); } else if (type == SpiceIntType) { - result = toInt(storedKeyword[index]); + result = std::stoi(storedKeyword[index]); } } catch(IException &e) { @@ -1570,9 +1570,9 @@ namespace Isis { for (int i = 0; i < key.size(); i++) { if (key[i] == "") return false; - if (key[i].toUpper() == "NULL") return false; - if (key[i].toUpper() == "NADIR") return false; - if (key[i].toUpper() == "TABLE") return false; + if (QString::fromStdString(key[i]).toUpper() == "NULL") return false; + if (QString::fromStdString(key[i]).toUpper() == "NADIR") return false; + if (QString::fromStdString(key[i]).toUpper() == "TABLE") return false; } } return true; diff --git a/isis/src/base/objs/SpicePosition/SpicePosition.cpp b/isis/src/base/objs/SpicePosition/SpicePosition.cpp index 9e09946c44..8cc774bfb4 100644 --- a/isis/src/base/objs/SpicePosition/SpicePosition.cpp +++ b/isis/src/base/objs/SpicePosition/SpicePosition.cpp @@ -436,13 +436,13 @@ namespace Isis { // Load the full cache time information from the label if available if(table.Label().hasKeyword("SpkTableStartTime")) { - p_fullCacheStartTime = toDouble(table.Label().findKeyword("SpkTableStartTime")[0]); + p_fullCacheStartTime = std::stod(table.Label().findKeyword("SpkTableStartTime")[0]); } if(table.Label().hasKeyword("SpkTableEndTime")) { - p_fullCacheEndTime = toDouble(table.Label().findKeyword("SpkTableEndTime")[0]); + p_fullCacheEndTime = std::stod(table.Label().findKeyword("SpkTableEndTime")[0]); } if(table.Label().hasKeyword("SpkTableOriginalSize")) { - p_fullCacheSize = toDouble(table.Label().findKeyword("SpkTableOriginalSize")[0]); + p_fullCacheSize = std::stod(table.Label().findKeyword("SpkTableOriginalSize")[0]); } @@ -579,7 +579,7 @@ namespace Isis { record += t; // create output table - Table table(tableName, record); + Table table(tableName.toStdString(), record); int inext = 0; @@ -619,7 +619,7 @@ namespace Isis { record += spacecraftY; record += spacecraftZ; - Table table(tableName, record); + Table table(tableName.toStdString(), record); for(int cindex = 0; cindex < p_degree + 1; cindex++) { record[0] = p_coefficients[0][cindex]; @@ -669,20 +669,20 @@ namespace Isis { tabletype = "PolyFunction"; } - table.Label() += PvlKeyword("CacheType", tabletype); + table.Label() += PvlKeyword("CacheType", tabletype.toStdString()); // Write original time coverage if(p_fullCacheStartTime != 0) { table.Label() += PvlKeyword("SpkTableStartTime"); - table.Label()["SpkTableStartTime"].addValue(toString(p_fullCacheStartTime)); + table.Label()["SpkTableStartTime"].addValue(std::to_string(p_fullCacheStartTime)); } if(p_fullCacheEndTime != 0) { table.Label() += PvlKeyword("SpkTableEndTime"); - table.Label()["SpkTableEndTime"].addValue(toString(p_fullCacheEndTime)); + table.Label()["SpkTableEndTime"].addValue(std::to_string(p_fullCacheEndTime)); } if(p_fullCacheSize != 0) { table.Label() += PvlKeyword("SpkTableOriginalSize"); - table.Label()["SpkTableOriginalSize"].addValue(toString(p_fullCacheSize)); + table.Label()["SpkTableOriginalSize"].addValue(std::to_string(p_fullCacheSize)); } } diff --git a/isis/src/base/objs/SpicePosition/unitTest.cpp b/isis/src/base/objs/SpicePosition/unitTest.cpp index e9b3964fff..df1da88721 100644 --- a/isis/src/base/objs/SpicePosition/unitTest.cpp +++ b/isis/src/base/objs/SpicePosition/unitTest.cpp @@ -216,11 +216,11 @@ int main(int argc, char *argv[]) { // Add table label table.Label() += PvlKeyword("CacheType", "HermiteSpline"); table.Label() += PvlKeyword("SpkTableStartTime"); - table.Label()["SpkTableStartTime"].addValue(toString(-69382819.360519)); + table.Label()["SpkTableStartTime"].addValue(std::to_string(-69382819.360519)); table.Label() += PvlKeyword("SpkTableEndTime"); - table.Label()["SpkTableEndTime"].addValue(toString(-69382512.160519)); + table.Label()["SpkTableEndTime"].addValue(std::to_string(-69382512.160519)); table.Label() += PvlKeyword("SpkTableOriginalSize"); - table.Label()["SpkTableOriginalSize"].addValue(toString(769)); + table.Label()["SpkTableOriginalSize"].addValue(std::to_string(769)); // Load table into the object pos4.LoadCache(table); diff --git a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp index 610532e437..8ce18325a9 100644 --- a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp +++ b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp @@ -551,7 +551,7 @@ namespace Isis { if (table.Label().hasKeyword("TimeDependentFrames")) { PvlKeyword labelTimeFrames = table.Label()["TimeDependentFrames"]; for (int i = 0; i < labelTimeFrames.size(); i++) { - p_timeFrames.push_back(toInt(labelTimeFrames[i])); + p_timeFrames.push_back(std::stoi(labelTimeFrames[i])); } } else { @@ -564,12 +564,12 @@ namespace Isis { p_constantFrames.clear(); for (int i = 0; i < labelConstantFrames.size(); i++) { - p_constantFrames.push_back(toInt(labelConstantFrames[i])); + p_constantFrames.push_back(std::stoi(labelConstantFrames[i])); } PvlKeyword labelConstantRotation = table.Label()["ConstantRotation"]; for (int i = 0; i < labelConstantRotation.size(); i++) { - p_TC.push_back(toDouble(labelConstantRotation[i])); + p_TC.push_back(std::stod(labelConstantRotation[i])); } } else { @@ -579,18 +579,18 @@ namespace Isis { // Load the full cache time information from the label if available if (table.Label().hasKeyword("CkTableStartTime")) { - p_fullCacheStartTime = toDouble(table.Label().findKeyword("CkTableStartTime")[0]); + p_fullCacheStartTime = std::stod(table.Label().findKeyword("CkTableStartTime")[0]); } if (table.Label().hasKeyword("CkTableEndTime")) { - p_fullCacheEndTime = toDouble(table.Label().findKeyword("CkTableEndTime")[0]); + p_fullCacheEndTime = std::stod(table.Label().findKeyword("CkTableEndTime")[0]); } if (table.Label().hasKeyword("CkTableOriginalSize")) { - p_fullCacheSize = toInt(table.Label().findKeyword("CkTableOriginalSize")[0]); + p_fullCacheSize = std::stoi(table.Label().findKeyword("CkTableOriginalSize")[0]); } // Load FrameTypeCode from labels if available and the planetary constants keywords if (table.Label().hasKeyword("FrameTypeCode")) { - m_frameType = (FrameType) toInt(table.Label().findKeyword("FrameTypeCode")[0]); + m_frameType = (FrameType) std::stoi(table.Label().findKeyword("FrameTypeCode")[0]); } else { m_frameType = UNKNOWN; @@ -891,7 +891,7 @@ namespace Isis { } record += t; - Table table(tableName, record); + Table table(tableName.toStdString(), record); std::vector rots = m_orientation->getRotations(); std::vector angularVelocities = m_orientation->getAngularVelocities(); @@ -941,7 +941,7 @@ namespace Isis { record += angle2; record += angle3; - Table table(tableName, record); + Table table(tableName.toStdString(), record); for (int cindex = 0; cindex < p_degree + 1; cindex++) { record[0] = p_coefficients[0][cindex]; @@ -1104,21 +1104,21 @@ namespace Isis { if (label.hasKeyword("PoleRa")) { PvlKeyword labelCoeffs = label["PoleRa"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_raPole.push_back(Angle(toDouble(labelCoeffs[i]), Angle::Degrees)); + m_raPole.push_back(Angle(std::stod(labelCoeffs[i]), Angle::Degrees)); } numLoaded += 1; } if (label.hasKeyword("PoleDec")) { PvlKeyword labelCoeffs = label["PoleDec"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_decPole.push_back(Angle(toDouble(labelCoeffs[i]), Angle::Degrees)); + m_decPole.push_back(Angle(std::stod(labelCoeffs[i]), Angle::Degrees)); } numLoaded += 1; } if (label.hasKeyword("PrimeMeridian")) { PvlKeyword labelCoeffs = label["PrimeMeridian"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_pm.push_back(Angle(toDouble(labelCoeffs[i]), Angle::Degrees)); + m_pm.push_back(Angle(std::stod(labelCoeffs[i]), Angle::Degrees)); } numLoaded += 1; } @@ -1127,31 +1127,31 @@ namespace Isis { if (label.hasKeyword("PoleRaNutPrec")) { PvlKeyword labelCoeffs = label["PoleRaNutPrec"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_raNutPrec.push_back(toDouble(labelCoeffs[i])); + m_raNutPrec.push_back(std::stod(labelCoeffs[i])); } } if (label.hasKeyword("PoleDecNutPrec")) { PvlKeyword labelCoeffs = label["PoleDecNutPrec"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_decNutPrec.push_back(toDouble(labelCoeffs[i])); + m_decNutPrec.push_back(std::stod(labelCoeffs[i])); } } if (label.hasKeyword("PmNutPrec")) { PvlKeyword labelCoeffs = label["PmNutPrec"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_pmNutPrec.push_back(toDouble(labelCoeffs[i])); + m_pmNutPrec.push_back(std::stod(labelCoeffs[i])); } } if (label.hasKeyword("SysNutPrec0")) { PvlKeyword labelCoeffs = label["SysNutPrec0"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_sysNutPrec0.push_back(Angle(toDouble(labelCoeffs[i]), Angle::Degrees)); + m_sysNutPrec0.push_back(Angle(std::stod(labelCoeffs[i]), Angle::Degrees)); } } if (label.hasKeyword("SysNutPrec1")) { PvlKeyword labelCoeffs = label["SysNutPrec1"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_sysNutPrec1.push_back(Angle(toDouble(labelCoeffs[i]), Angle::Degrees)); + m_sysNutPrec1.push_back(Angle(std::stod(labelCoeffs[i]), Angle::Degrees)); } } @@ -1174,7 +1174,7 @@ namespace Isis { table.Label() += PvlKeyword("TimeDependentFrames"); for (int i = 0; i < (int) p_timeFrames.size(); i++) { - table.Label()["TimeDependentFrames"].addValue(toString(p_timeFrames[i])); + table.Label()["TimeDependentFrames"].addValue(std::to_string(p_timeFrames[i])); } } @@ -1182,33 +1182,33 @@ namespace Isis { table.Label() += PvlKeyword("ConstantFrames"); for (int i = 0; i < (int) p_constantFrames.size(); i++) { - table.Label()["ConstantFrames"].addValue(toString(p_constantFrames[i])); + table.Label()["ConstantFrames"].addValue(std::to_string(p_constantFrames[i])); } table.Label() += PvlKeyword("ConstantRotation"); for (int i = 0; i < (int) p_TC.size(); i++) { - table.Label()["ConstantRotation"].addValue(toString(p_TC[i])); + table.Label()["ConstantRotation"].addValue(std::to_string(p_TC[i])); } } // Write original time coverage if (p_fullCacheStartTime != 0) { table.Label() += PvlKeyword("CkTableStartTime"); - table.Label()["CkTableStartTime"].addValue(toString(p_fullCacheStartTime)); + table.Label()["CkTableStartTime"].addValue(std::to_string(p_fullCacheStartTime)); } if (p_fullCacheEndTime != 0) { table.Label() += PvlKeyword("CkTableEndTime"); - table.Label()["CkTableEndTime"].addValue(toString(p_fullCacheEndTime)); + table.Label()["CkTableEndTime"].addValue(std::to_string(p_fullCacheEndTime)); } if (p_fullCacheSize != 0) { table.Label() += PvlKeyword("CkTableOriginalSize"); - table.Label()["CkTableOriginalSize"].addValue(toString(p_fullCacheSize)); + table.Label()["CkTableOriginalSize"].addValue(std::to_string(p_fullCacheSize)); } // Begin section added 06-20-2015 DAC table.Label() += PvlKeyword("FrameTypeCode"); - table.Label()["FrameTypeCode"].addValue(toString(m_frameType)); + table.Label()["FrameTypeCode"].addValue(std::to_string(m_frameType)); if (m_frameType == PCK) { // Write out all the body orientation constants @@ -1216,50 +1216,50 @@ namespace Isis { table.Label() += PvlKeyword("PoleRa"); for (int i = 0; i < (int) m_raPole.size(); i++) { - table.Label()["PoleRa"].addValue(toString(m_raPole[i].degrees())); + table.Label()["PoleRa"].addValue(std::to_string(m_raPole[i].degrees())); } // Pole right ascension, declination coefficients for a quadratic equation table.Label() += PvlKeyword("PoleDec"); for (int i = 0; i < (int) m_decPole.size(); i++) { - table.Label()["PoleDec"].addValue(toString(m_decPole[i].degrees())); + table.Label()["PoleDec"].addValue(std::to_string(m_decPole[i].degrees())); } // Prime meridian coefficients for a quadratic equation table.Label() += PvlKeyword("PrimeMeridian"); for (int i = 0; i < (int) m_pm.size(); i++) { - table.Label()["PrimeMeridian"].addValue(toString(m_pm[i].degrees())); + table.Label()["PrimeMeridian"].addValue(std::to_string(m_pm[i].degrees())); } if (m_raNutPrec.size() > 0) { // Pole right ascension nutation precision coefficients to the trig terms table.Label() += PvlKeyword("PoleRaNutPrec"); for (int i = 0; i < (int) m_raNutPrec.size(); i++) { - table.Label()["PoleRaNutPrec"].addValue(toString(m_raNutPrec[i])); + table.Label()["PoleRaNutPrec"].addValue(std::to_string(m_raNutPrec[i])); } // Pole declination nutation precision coefficients to the trig terms table.Label() += PvlKeyword("PoleDecNutPrec"); for (int i = 0; i < (int) m_decNutPrec.size(); i++) { - table.Label()["PoleDecNutPrec"].addValue(toString(m_decNutPrec[i])); + table.Label()["PoleDecNutPrec"].addValue(std::to_string(m_decNutPrec[i])); } // Prime meridian nutation precision coefficients to the trig terms table.Label() += PvlKeyword("PmNutPrec"); for (int i = 0; i < (int) m_pmNutPrec.size(); i++) { - table.Label()["PmNutPrec"].addValue(toString(m_pmNutPrec[i])); + table.Label()["PmNutPrec"].addValue(std::to_string(m_pmNutPrec[i])); } // System nutation precision constant terms of linear model of periods table.Label() += PvlKeyword("SysNutPrec0"); for (int i = 0; i < (int) m_sysNutPrec0.size(); i++) { - table.Label()["SysNutPrec0"].addValue(toString(m_sysNutPrec0[i].degrees())); + table.Label()["SysNutPrec0"].addValue(std::to_string(m_sysNutPrec0[i].degrees())); } // System nutation precision linear terms of linear model of periods table.Label() += PvlKeyword("SysNutPrec1"); for (int i = 0; i < (int) m_sysNutPrec1.size(); i++) { - table.Label()["SysNutPrec1"].addValue(toString(m_sysNutPrec1[i].degrees())); + table.Label()["SysNutPrec1"].addValue(std::to_string(m_sysNutPrec1[i].degrees())); } } } diff --git a/isis/src/base/objs/Statistics/Statistics.cpp b/isis/src/base/objs/Statistics/Statistics.cpp index 14ba41772b..8ef29b6375 100644 --- a/isis/src/base/objs/Statistics/Statistics.cpp +++ b/isis/src/base/objs/Statistics/Statistics.cpp @@ -221,7 +221,6 @@ namespace Isis { m_overRangePixels(other.m_overRangePixels), m_removedData(other.m_removedData) { } - // : m_id(new QUuid(other.m_id->toString())), //! Destroys the IsisStats object. @@ -409,8 +408,8 @@ namespace Isis { if (m_validMaximum < m_validMinimum) { // get the min and max DN values in the chosen range - QString msg = "Invalid Range: Minimum [" + toString(minimum) - + "] must be less than the Maximum [" + toString(maximum) + "]."; + std::string msg = "Invalid Range: Minimum [" + std::to_string(minimum) + + "] must be less than the Maximum [" + std::to_string(maximum) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } //??? throw exception if data has already been added??? @@ -801,8 +800,8 @@ namespace Isis { if (StandardDeviation() == 0) { if (value == Maximum()) return 0; else { - QString msg = "Undefined Z-score. Standard deviation is zero and the input value[" - + toString(value) + "] is out of range [" + toString(Maximum()) + "]."; + std::string msg = "Undefined Z-score. Standard deviation is zero and the input value[" + + std::to_string(value) + "] is out of range [" + std::to_string(Maximum()) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -848,27 +847,27 @@ namespace Isis { name = "Statistics"; } // Construct a label with the results - PvlGroup results(name); - results += PvlKeyword("Sum", toString(Sum())); - results += PvlKeyword("SumSquare", toString(SumSquare())); - results += PvlKeyword("Minimum", toString(Minimum())); - results += PvlKeyword("Maximum", toString(Maximum())); - results += PvlKeyword("ValidMinimum", toString(ValidMinimum())); - results += PvlKeyword("ValidMaximum", toString(ValidMaximum())); + PvlGroup results(name.toStdString()); + results += PvlKeyword("Sum", std::to_string(Sum())); + results += PvlKeyword("SumSquare", std::to_string(SumSquare())); + results += PvlKeyword("Minimum", std::to_string(Minimum())); + results += PvlKeyword("Maximum", std::to_string(Maximum())); + results += PvlKeyword("ValidMinimum", std::to_string(ValidMinimum())); + results += PvlKeyword("ValidMaximum", std::to_string(ValidMaximum())); if (ValidPixels() != 0) { - results += PvlKeyword("Average", toString(Average())); - results += PvlKeyword("StandardDeviation", toString(StandardDeviation())); - results += PvlKeyword("Variance", toString(Variance())); + results += PvlKeyword("Average", std::to_string(Average())); + results += PvlKeyword("StandardDeviation", std::to_string(StandardDeviation())); + results += PvlKeyword("Variance", std::to_string(Variance())); } - results += PvlKeyword("TotalPixels", toString(TotalPixels())); - results += PvlKeyword("ValidPixels", toString(ValidPixels())); - results += PvlKeyword("OverValidMaximumPixels", toString(OverRangePixels())); - results += PvlKeyword("UnderValidMinimumPixels", toString(UnderRangePixels())); - results += PvlKeyword("NullPixels", toString(NullPixels())); - results += PvlKeyword("LisPixels", toString(LisPixels())); - results += PvlKeyword("LrsPixels", toString(LrsPixels())); - results += PvlKeyword("HisPixels", toString(HisPixels())); - results += PvlKeyword("HrsPixels", toString(HrsPixels())); + results += PvlKeyword("TotalPixels", std::to_string(TotalPixels())); + results += PvlKeyword("ValidPixels", std::to_string(ValidPixels())); + results += PvlKeyword("OverValidMaximumPixels", std::to_string(OverRangePixels())); + results += PvlKeyword("UnderValidMinimumPixels", std::to_string(UnderRangePixels())); + results += PvlKeyword("NullPixels", std::to_string(NullPixels())); + results += PvlKeyword("LisPixels", std::to_string(LisPixels())); + results += PvlKeyword("LrsPixels", std::to_string(LrsPixels())); + results += PvlKeyword("HisPixels", std::to_string(HisPixels())); + results += PvlKeyword("HrsPixels", std::to_string(HrsPixels())); return results; } @@ -877,7 +876,7 @@ namespace Isis { void Statistics::save(QXmlStreamWriter &stream, const Project *project) const { // TODO: does xml stuff need project??? stream.writeStartElement("statistics"); -// stream.writeTextElement("id", m_id->toString()); +// stream.writeTextElement("id", m_id->std::to_string()); stream.writeTextElement("sum", toString(m_sum)); stream.writeTextElement("sumSquares", toString(m_sumsum)); @@ -930,7 +929,6 @@ namespace Isis { << (qint64)m_overRangePixels << (qint32)m_removedData; return stream; -// stream << m_id->toString() } diff --git a/isis/src/base/objs/Strategy/Strategy.cpp b/isis/src/base/objs/Strategy/Strategy.cpp index e5fe5cf066..736e00ae30 100644 --- a/isis/src/base/objs/Strategy/Strategy.cpp +++ b/isis/src/base/objs/Strategy/Strategy.cpp @@ -46,7 +46,7 @@ namespace Isis { */ Strategy::Strategy(const QString &name, const QString &type) : m_globals(), - m_definition(new PvlObject(name)), + m_definition(new PvlObject(name.toStdString())), m_name(name), m_type(type), m_total(0), m_applyDiscarded(false), m_debug(false), m_progress() { } @@ -200,7 +200,7 @@ namespace Isis { */ QString Strategy::description() const { if ( m_definition->hasKeyword("Description") ) { - return (m_definition->findKeyword("Description")[0]); + return QString::fromStdString(m_definition->findKeyword("Description")[0]); } else { QString descr = "Strategy::" + name() + " is running a " + type() + @@ -646,13 +646,13 @@ namespace Isis { BOOST_FOREACH ( QString key, keySources ) { if ( resourceA->exists(key) ) { PvlKeyword keyword(resourceA->keyword(key)); - keyword.setName(keyword.name().append(keySuffix.first)); + keyword.setName(keyword.name().append(keySuffix.first.toStdString())); composite->add(keyword); } if ( resourceB->exists(key) ) { PvlKeyword keyword(resourceB->keyword(key)); - keyword.setName(keyword.name().append(keySuffix.second)); + keyword.setName(keyword.name().append(keySuffix.second.toStdString())); composite->add(keyword); } } @@ -663,7 +663,7 @@ namespace Isis { PvlFlatMap::ConstPvlFlatMapIterator pkeys = rkeysA.begin(); while ( rkeysA.constEnd() != pkeys) { PvlKeyword keyword(pkeys.value()); - keyword.setName(keyword.name().append(keySuffix.first)); + keyword.setName(keyword.name().append(keySuffix.first.toStdString())); composite->add(keyword); ++pkeys; } @@ -672,7 +672,7 @@ namespace Isis { pkeys = rkeysB.begin(); while ( rkeysB.constEnd() != pkeys) { PvlKeyword keyword(pkeys.value()); - keyword.setName(keyword.name().append(keySuffix.second)); + keyword.setName(keyword.name().append(keySuffix.second.toStdString())); composite->add(keyword); ++pkeys; } @@ -1203,7 +1203,7 @@ namespace Isis { QStringList objList; PvlObject::ConstPvlObjectIterator object = source.beginObject(); while ( object != source.endObject() ) { - objList << object->name(); + objList <name()); ++object; } return (objList); diff --git a/isis/src/base/objs/Strategy/Strategy.h b/isis/src/base/objs/Strategy/Strategy.h index ea48771812..c6542f73cd 100644 --- a/isis/src/base/objs/Strategy/Strategy.h +++ b/isis/src/base/objs/Strategy/Strategy.h @@ -188,8 +188,8 @@ namespace Isis { if ( !config.isEmpty() ) { miner = factory->buildRun(config, globals); } - else if ( getDefinition().hasObject(minerName+"Miner") ) { - miner = factory->buildRun(getDefinition().findObject(minerName+"Miner"), + else if ( getDefinition().hasObject(minerName.toStdString() + "Miner") ) { + miner = factory->buildRun(getDefinition().findObject(minerName.toStdString() + "Miner"), globals); } diff --git a/isis/src/base/objs/Stretch/Stretch.cpp b/isis/src/base/objs/Stretch/Stretch.cpp index b51142c817..c72a7b9894 100644 --- a/isis/src/base/objs/Stretch/Stretch.cpp +++ b/isis/src/base/objs/Stretch/Stretch.cpp @@ -321,7 +321,7 @@ namespace Isis { * keywords from */ void Stretch::Load(QString &file, QString &grpName) { - Pvl pvl(file); + Pvl pvl(file.toStdString()); Load(pvl, grpName); } @@ -340,7 +340,7 @@ namespace Isis { * keywords from */ void Stretch::Load(Isis::Pvl &pvl, QString &grpName) { - PvlGroup grp = pvl.findGroup(grpName, Isis::PvlObject::Traverse); + PvlGroup grp = pvl.findGroup(grpName.toStdString(), Isis::PvlObject::Traverse); PvlKeyword inputs = grp.findKeyword("Input"); PvlKeyword outputs = grp.findKeyword("Output"); @@ -349,7 +349,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } for(int i = 0; i < inputs.size(); i++) { - AddPair(toDouble(inputs[i]), toDouble(outputs[i])); + AddPair(std::stod(inputs[i]), std::stod(outputs[i])); } } @@ -367,16 +367,16 @@ namespace Isis { void Stretch::Save(QString &file, QString &grpName) { Pvl p; Save(p, grpName); - p.write(file); + p.write(file.toStdString()); } void Stretch::Save(Isis::Pvl &pvl, QString &grpName) { - PvlGroup *grp = new PvlGroup(grpName); + PvlGroup *grp = new PvlGroup(grpName.toStdString()); PvlKeyword inputs("Input"); PvlKeyword outputs("Output"); for(int i = 0; i < Pairs(); i++) { - inputs.addValue(toString(Input(i))); - outputs.addValue(toString(Output(i))); + inputs.addValue(std::to_string(Input(i))); + outputs.addValue(std::to_string(Output(i))); } grp->addKeyword(inputs); grp->addKeyword(outputs); diff --git a/isis/src/base/objs/StripPolygonSeeder/StripPolygonSeeder.cpp b/isis/src/base/objs/StripPolygonSeeder/StripPolygonSeeder.cpp index eb52788b88..6e2b024f91 100644 --- a/isis/src/base/objs/StripPolygonSeeder/StripPolygonSeeder.cpp +++ b/isis/src/base/objs/StripPolygonSeeder/StripPolygonSeeder.cpp @@ -125,7 +125,7 @@ namespace Isis { } } else { - QString msg = "PVL for StripSeeder must contain [XSpacing] in ["; + std::string msg = "PVL for StripSeeder must contain [XSpacing] in ["; msg += pvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -138,13 +138,13 @@ namespace Isis { } } else { - QString msg = "PVL for StripSeeder must contain [YSpacing] in ["; + std::string msg = "PVL for StripSeeder must contain [YSpacing] in ["; msg += pvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } } catch(IException &e) { - QString msg = "Improper format for PolygonSeeder PVL [" + pvl.fileName() + "]"; + std::string msg = "Improper format for PolygonSeeder PVL [" + pvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -159,13 +159,13 @@ namespace Isis { } PvlGroup StripPolygonSeeder::PluginParameters(QString grpName) { - PvlGroup pluginInfo(grpName); + PvlGroup pluginInfo(grpName.toStdString()); - PvlKeyword name("Name", Algorithm()); - PvlKeyword minThickness("MinimumThickness", toString(MinimumThickness())); - PvlKeyword minArea("MinimumArea", toString(MinimumArea())); - PvlKeyword xSpac("XSpacing", toString(p_Xspacing)); - PvlKeyword ySpac("YSpacing", toString(p_Yspacing)); + PvlKeyword name("Name", Algorithm().toStdString()); + PvlKeyword minThickness("MinimumThickness", std::to_string(MinimumThickness())); + PvlKeyword minArea("MinimumArea", std::to_string(MinimumArea())); + PvlKeyword xSpac("XSpacing", std::to_string(p_Xspacing)); + PvlKeyword ySpac("YSpacing", std::to_string(p_Yspacing)); pluginInfo.addKeyword(name); pluginInfo.addKeyword(minThickness); diff --git a/isis/src/base/objs/SubArea/SubArea.cpp b/isis/src/base/objs/SubArea/SubArea.cpp index c081737353..2b78f43403 100644 --- a/isis/src/base/objs/SubArea/SubArea.cpp +++ b/isis/src/base/objs/SubArea/SubArea.cpp @@ -151,9 +151,9 @@ namespace Isis { if(p_sl != 1 || p_ss != 1) { proj->SetWorld(p_ss - 0.5, p_sl - 0.5); PvlGroup &mapgroup = inlabel.findObject("IsisCube").findGroup("Mapping", Pvl::Traverse); - mapgroup.addKeyword(PvlKeyword("UpperLeftCornerX", toString(proj->XCoord())), + mapgroup.addKeyword(PvlKeyword("UpperLeftCornerX", std::to_string(proj->XCoord())), Pvl::Replace); - mapgroup.addKeyword(PvlKeyword("UpperLeftCornerY", toString(proj->YCoord())), + mapgroup.addKeyword(PvlKeyword("UpperLeftCornerY", std::to_string(proj->YCoord())), Pvl::Replace); } @@ -161,14 +161,14 @@ namespace Isis { // mapping scale and resolution. if(p_linc == p_sinc && p_linc != 1.0) { PvlGroup &mapgroup = inlabel.findObject("IsisCube").findGroup("Mapping", Pvl::Traverse); - QString pixresUnit = mapgroup["PixelResolution"].unit(); - double pixres = toDouble(mapgroup["PixelResolution"][0]); - mapgroup["PixelResolution"] = toString(pixres * p_linc); - mapgroup["PixelResolution"].setUnits(pixresUnit); - QString scaleUnit = mapgroup["Scale"].unit(); + QString pixresUnit = QString::fromStdString(mapgroup["PixelResolution"].unit()); + double pixres = std::stod(mapgroup["PixelResolution"][0]); + mapgroup["PixelResolution"] = std::to_string(pixres * p_linc); + mapgroup["PixelResolution"].setUnits(pixresUnit.toStdString()); + QString scaleUnit = QString::fromStdString(mapgroup["Scale"].unit()); double scale = mapgroup["Scale"]; - mapgroup["Scale"] = toString(scale / p_linc); - mapgroup["Scale"].setUnits(scaleUnit); + mapgroup["Scale"] = std::to_string(scale / p_linc); + mapgroup["Scale"].setUnits(scaleUnit.toStdString()); } // If the outer bounds of the image are changed, then the @@ -218,10 +218,10 @@ namespace Isis { maxlon = proj->ToPositiveWest(proj->Longitude(), 180); } } - mapgroup.addKeyword(PvlKeyword("MinimumLatitude",toString(minlat)),Pvl::Replace); - mapgroup.addKeyword(PvlKeyword("MaximumLatitude",toString(maxlat)),Pvl::Replace); - mapgroup.addKeyword(PvlKeyword("MinimumLongitude",toString(minlon)),Pvl::Replace); - mapgroup.addKeyword(PvlKeyword("MaximumLongitude",toString(maxlon)),Pvl::Replace); + mapgroup.addKeyword(PvlKeyword("MinimumLatitude",std::to_string(minlat)),Pvl::Replace); + mapgroup.addKeyword(PvlKeyword("MaximumLatitude",std::to_string(maxlat)),Pvl::Replace); + mapgroup.addKeyword(PvlKeyword("MinimumLongitude",std::to_string(minlon)),Pvl::Replace); + mapgroup.addKeyword(PvlKeyword("MaximumLongitude",std::to_string(maxlon)),Pvl::Replace); } } } diff --git a/isis/src/base/objs/TProjection/TProjection.cpp b/isis/src/base/objs/TProjection/TProjection.cpp index 27ccc32e54..35a34d705a 100644 --- a/isis/src/base/objs/TProjection/TProjection.cpp +++ b/isis/src/base/objs/TProjection/TProjection.cpp @@ -122,10 +122,10 @@ namespace Isis { } // Get the LatitudeType - if ((QString) m_mappingGrp["LatitudeType"] == "Planetographic") { + if ((std::string) m_mappingGrp["LatitudeType"] == "Planetographic") { m_latitudeType = Planetographic; } - else if ((QString) m_mappingGrp["LatitudeType"] == "Planetocentric") { + else if ((std::string) m_mappingGrp["LatitudeType"] == "Planetocentric") { m_latitudeType = Planetocentric; } else { @@ -136,24 +136,24 @@ namespace Isis { } // Get the LongitudeDirection - if ((QString) m_mappingGrp["LongitudeDirection"] == "PositiveWest") { + if ((std::string) m_mappingGrp["LongitudeDirection"] == "PositiveWest") { m_longitudeDirection = PositiveWest; } - else if ((QString) m_mappingGrp["LongitudeDirection"] == "PositiveEast") { + else if ((std::string) m_mappingGrp["LongitudeDirection"] == "PositiveEast") { m_longitudeDirection = PositiveEast; } else { - QString msg = "Projection failed. Invalid value for keyword " + std::string msg = "Projection failed. Invalid value for keyword " "[LongitudeDirection] must be " "[PositiveWest or PositiveEast]"; throw IException(IException::Unknown, msg, _FILEINFO_); } // Get the LongitudeDomain - if ((QString) m_mappingGrp["LongitudeDomain"] == "360") { + if ((std::string) m_mappingGrp["LongitudeDomain"] == "360") { m_longitudeDomain = 360; } - else if ((QString) m_mappingGrp["LongitudeDomain"] == "180") { + else if ((std::string) m_mappingGrp["LongitudeDomain"] == "180") { m_longitudeDomain = 180; } else { @@ -174,33 +174,33 @@ namespace Isis { m_maximumLongitude = m_mappingGrp["MaximumLongitude"]; if ((m_minimumLatitude < -90.0) || (m_minimumLatitude > 90.0)) { - QString msg = "Projection failed. " - "[MinimumLatitude] of [" + toString(m_minimumLatitude) + std::string msg = "Projection failed. " + "[MinimumLatitude] of [" + std::to_string(m_minimumLatitude) + "] is outside the range of [-90:90]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if ((m_maximumLatitude < -90.0) || (m_maximumLatitude > 90.0)) { - QString msg = "Projection failed. " - "[MaximumLatitude] of [" + toString(m_maximumLatitude) + std::string msg = "Projection failed. " + "[MaximumLatitude] of [" + std::to_string(m_maximumLatitude) + "] is outside the range of [-90:90]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (m_minimumLatitude >= m_maximumLatitude) { - QString msg = "Projection failed. " + std::string msg = "Projection failed. " "[MinimumLatitude,MaximumLatitude] of [" - + toString(m_minimumLatitude) + "," - + toString(m_maximumLatitude) + "] are not " + + std::to_string(m_minimumLatitude) + "," + + std::to_string(m_maximumLatitude) + "] are not " + "properly ordered"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (m_minimumLongitude >= m_maximumLongitude) { - QString msg = "Projection failed. " + std::string msg = "Projection failed. " "[MinimumLongitude,MaximumLongitude] of [" - + toString(m_minimumLongitude) + "," - + toString(m_maximumLongitude) + "] are not " + + std::to_string(m_minimumLongitude) + "," + + std::to_string(m_maximumLongitude) + "] are not " + "properly ordered"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -217,10 +217,10 @@ namespace Isis { // Initialize miscellaneous protected data elements if (m_equatorialRadius < m_polarRadius) { - QString msg = "Projection failed. Invalid keyword value(s). " - "[EquatorialRadius] = " + toString(m_equatorialRadius) + std::string msg = "Projection failed. Invalid keyword value(s). " + "[EquatorialRadius] = " + std::to_string(m_equatorialRadius) + " must be greater than or equal to [PolarRadius] = " - + toString(m_polarRadius); + + std::to_string(m_polarRadius); throw IException(IException::Unknown, msg, _FILEINFO_); } else { @@ -327,7 +327,7 @@ namespace Isis { if (latitude == Null) { throw IException(IException::Unknown, "Unable to calculate local radius. The given latitude value [" - + toString(latitude) + "] is invalid.", + + std::to_string(latitude) + "] is invalid.", _FILEINFO_); } double a = m_equatorialRadius; @@ -436,7 +436,7 @@ namespace Isis { if (lat == Null || abs(lat) > 90.0) { throw IException(IException::Unknown, "Unable to convert to Planetocentric. The given latitude value [" - + toString(lat) + "] is invalid.", + + std::to_string(lat) + "] is invalid.", _FILEINFO_); } double mylat = lat; @@ -486,7 +486,7 @@ namespace Isis { if (lat == Null || fabs(lat) > 90.0) { throw IException(IException::Unknown, "Unable to convert to Planetographic. The given latitude value [" - + toString(lat) + "] is invalid.", + + std::to_string(lat) + "] is invalid.", _FILEINFO_); } double mylat = lat; @@ -549,7 +549,7 @@ namespace Isis { if (lon == Null) { throw IException(IException::Unknown, "Unable to convert to PositiveEast. The given longitude value [" - + toString(lon) + "] is invalid.", + + std::to_string(lon) + "] is invalid.", _FILEINFO_); } double mylon = lon; @@ -563,7 +563,7 @@ namespace Isis { mylon = To180Domain(mylon); } else { - QString msg = "Unable to convert longitude. Domain [" + toString(domain) + std::string msg = "Unable to convert longitude. Domain [" + std::to_string(domain) + "] is not 180 or 360."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -588,7 +588,7 @@ namespace Isis { if (lon == Null) { throw IException(IException::Unknown, "Unable to convert to PositiveWest. The given longitude value [" - + toString(lon) + "] is invalid.", + + std::to_string(lon) + "] is invalid.", _FILEINFO_); } double mylon = lon; @@ -602,7 +602,7 @@ namespace Isis { mylon = To180Domain(mylon); } else { - QString msg = "Unable to convert longitude. Domain [" + toString(domain) + std::string msg = "Unable to convert longitude. Domain [" + std::to_string(domain) + "] is not 180 or 360."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -658,7 +658,7 @@ namespace Isis { if (lon == Null) { throw IException(IException::Unknown, "Unable to convert to 180 degree domain. The given longitude value [" - + toString(lon) + "] is invalid.", + + std::to_string(lon) + "] is invalid.", _FILEINFO_); } return Isis::Longitude(lon, Angle::Degrees).force180Domain().degrees(); @@ -676,7 +676,7 @@ namespace Isis { if (lon == Null) { throw IException(IException::Unknown, "Unable to convert to 360 degree domain. The given longitude value [" - + toString(lon) + "] is invalid.", + + std::to_string(lon) + "] is invalid.", _FILEINFO_); } double result = lon; @@ -1706,8 +1706,8 @@ namespace Isis { << "Rotation"; foreach (QString keyName, keyNames) { - if (m_mappingGrp.hasKeyword(keyName)) { - mapping += m_mappingGrp[keyName]; + if (m_mappingGrp.hasKeyword(keyName.toStdString())) { + mapping += m_mappingGrp[keyName.toStdString()]; } } diff --git a/isis/src/base/objs/Target/Target.cpp b/isis/src/base/objs/Target/Target.cpp index 32689d99d1..145862dfbf 100644 --- a/isis/src/base/objs/Target/Target.cpp +++ b/isis/src/base/objs/Target/Target.cpp @@ -50,7 +50,7 @@ namespace Isis { PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); m_name = new QString; - *m_name = inst["TargetName"][0]; + *m_name = QString::fromStdString(inst["TargetName"][0]); QString trykey = "NaifIkCode"; m_systemName = new QString; @@ -62,7 +62,7 @@ namespace Isis { if (name().toUpper() == "SKY") { m_radii[0] = m_radii[1] = m_radii[2] = Distance(1000.0, Distance::Meters); m_sky = true; - int ikCode = toInt(kernels[trykey][0]); + int ikCode = std::stoi(kernels[trykey.toStdString()][0]); *m_bodyCode = ikCode / 1000; // Check for override in kernel group if (kernels.hasKeyword("NaifSpkCode")) { @@ -117,7 +117,7 @@ namespace Isis { init(); PvlGroup &inst = label.findGroup("Instrument", Pvl::Traverse); - QString targetName = inst["TargetName"][0]; + QString targetName = QString::fromStdString(inst["TargetName"][0]); setName(targetName); PvlGroup &kernels = label.findGroup("Kernels", Pvl::Traverse); @@ -313,7 +313,7 @@ namespace Isis { QString target = ""; try { if (mapping.hasKeyword("TargetName")) { - target = mapping["TargetName"][0]; + target = QString::fromStdString(mapping["TargetName"][0]); } // if target name not found in mapping group or value was empty string, try instrument group @@ -322,8 +322,8 @@ namespace Isis { if (hasInstrumentGroup) { PvlGroup inst = cubeLab.findGroup("Instrument", Pvl::Traverse); if (inst.hasKeyword("TargetName")) { - target = inst["TargetName"][0]; - mapping.addKeyword( PvlKeyword("TargetName", target), PvlContainer::Replace ); + target = QString::fromStdString(inst["TargetName"][0]); + mapping.addKeyword( PvlKeyword("TargetName", target.toStdString()), PvlContainer::Replace ); } } } @@ -368,15 +368,15 @@ namespace Isis { catch (IException &e2) { throw IException(e, IException::Unknown, e2.what(), _FILEINFO_); } - QString radiiKeyword = "BODY" + toString(int(bodyCode)) + "_RADII"; + std::string radiiKeyword = "BODY" + std::to_string(int(bodyCode)) + "_RADII"; if (naifKeywords.hasKeyword(radiiKeyword)) { PvlKeyword radii = naifKeywords.findKeyword(radiiKeyword); mapping.addKeyword( PvlKeyword("EquatorialRadius", - toString(toDouble(radii[0]) * 1000.0), "meters"), + std::to_string(std::stod(radii[0]) * 1000.0), "meters"), PvlContainer::Replace); mapping.addKeyword( PvlKeyword("PolarRadius", - toString(toDouble(radii[2]) * 1000.0), "meters"), + std::to_string(std::stod(radii[2]) * 1000.0), "meters"), PvlContainer::Replace); return mapping; } @@ -386,16 +386,16 @@ namespace Isis { if (naifKeywords.hasKeyword("BODY_FRAME_CODE")) { PvlKeyword bodyFrame = naifKeywords.findKeyword("BODY_FRAME_CODE"); - QString radiiKeyword = "BODY" + bodyFrame[0] + "_RADII"; + QString radiiKeyword = "BODY" + QString::fromStdString(bodyFrame[0]) + "_RADII"; - if (naifKeywords.hasKeyword(radiiKeyword)) { - PvlKeyword radii = naifKeywords.findKeyword(radiiKeyword); + if (naifKeywords.hasKeyword(radiiKeyword.toStdString())) { + PvlKeyword radii = naifKeywords.findKeyword(radiiKeyword.toStdString()); mapping.addKeyword( PvlKeyword("EquatorialRadius", - toString(toDouble(radii[0]) * 1000.0), + std::to_string(std::stod(radii[0]) * 1000.0), "meters"), PvlContainer::Replace); mapping.addKeyword( PvlKeyword("PolarRadius", - toString(toDouble(radii[2]) * 1000.0), + std::to_string(std::stod(radii[2]) * 1000.0), "meters"), PvlContainer::Replace); return mapping; @@ -452,7 +452,7 @@ namespace Isis { } PvlGroup radiiGroup = Target::radiiGroup(int(bodyCode)); - mapping += PvlKeyword("TargetName", target); + mapping += PvlKeyword("TargetName", target.toStdString()); mapping += radiiGroup.findKeyword("EquatorialRadius"); mapping += radiiGroup.findKeyword("PolarRadius"); cachedResults[target] = mapping; @@ -498,15 +498,15 @@ namespace Isis { NaifStatus::CheckErrors(); } catch (IException &e) { - QString msg = "Unable to find radii for target code [" + toString(bodyCode) + std::string msg = "Unable to find radii for target code [" + std::to_string(bodyCode) + "]. Target code was not found in furnished kernels."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } PvlGroup radiiGroup; - radiiGroup += PvlKeyword("EquatorialRadius", toString(radii[0] * 1000.0), "meters"); - radiiGroup += PvlKeyword("PolarRadius", toString(radii[2] * 1000.0), "meters"); + radiiGroup += PvlKeyword("EquatorialRadius", std::to_string(radii[0] * 1000.0), "meters"); + radiiGroup += PvlKeyword("PolarRadius", std::to_string(radii[2] * 1000.0), "meters"); return radiiGroup; diff --git a/isis/src/base/objs/TiffImporter/TiffImporter.cpp b/isis/src/base/objs/TiffImporter/TiffImporter.cpp index 79f90c6571..4ef531680d 100644 --- a/isis/src/base/objs/TiffImporter/TiffImporter.cpp +++ b/isis/src/base/objs/TiffImporter/TiffImporter.cpp @@ -132,7 +132,7 @@ namespace Isis { toString(coordSysType) + ".trn"); if (transFile.fileExists()) { Pvl tmp; - tmp += PvlKeyword("Code", toString(coordSysType)); + tmp += PvlKeyword("Code", std::to_string(coordSysType)); PvlToPvlTranslationManager geoTiffCodeTranslater(tmp, transFile.expanded()); geoTiffCodeTranslater.Auto(outPvl); } @@ -351,7 +351,7 @@ namespace Isis { double localRadius = proj->LocalRadius(trueScaleLat); double scale = (2.0 * Isis::PI * localRadius) / (360.0 * pixelResolution); - mapGroup += PvlKeyword("Scale", toString(scale), "pixels/degree"); + mapGroup += PvlKeyword("Scale", std::to_string(scale), "pixels/degree"); } catch (IException &e) { outPvl.findGroup("Mapping").clear(); @@ -393,19 +393,19 @@ namespace Isis { if (gdalElement.tagName() == "Item") { if (gdalElement.attribute("name", "") == "WEST_LONGITUDE") { QString westLon = gdalElement.text(); - map += PvlKeyword("MinimumLongitude", toString(Angle(westLon).degrees())); + map += PvlKeyword("MinimumLongitude", std::to_string(Angle(westLon).degrees())); } else if (gdalElement.attribute("name", "") == "EAST_LONGITUDE") { QString eastLon = gdalElement.text(); - map += PvlKeyword("MaximumLongitude", toString(Angle(eastLon).degrees())); + map += PvlKeyword("MaximumLongitude", std::to_string(Angle(eastLon).degrees())); } else if (gdalElement.attribute("name", "") == "SOUTH_LATITUDE") { QString southLat = gdalElement.text(); - map += PvlKeyword("MinimumLatitude", toString(Angle(southLat).degrees())); + map += PvlKeyword("MinimumLatitude", std::to_string(Angle(southLat).degrees())); } else if (gdalElement.attribute("name", "") == "NORTH_LATITUDE") { QString northLat = gdalElement.text(); - map += PvlKeyword("MaximumLatitude", toString(Angle(northLat).degrees())); + map += PvlKeyword("MaximumLatitude", std::to_string(Angle(northLat).degrees())); } } } @@ -451,8 +451,8 @@ namespace Isis { map.deleteKeyword("FalseNorthing"); } - map += PvlKeyword("UpperLeftCornerX", toString(x), "meters"); - map += PvlKeyword("UpperLeftCornerY", toString(y), "meters"); + map += PvlKeyword("UpperLeftCornerX", std::to_string(x), "meters"); + map += PvlKeyword("UpperLeftCornerY", std::to_string(y), "meters"); } else { QString msg = "The upper left X and Y can not be calculated. Unsupported tiepoint " @@ -485,7 +485,7 @@ namespace Isis { // The expected scales are TIFF(x, y, z) = ISIS(sample, line, 0) // Make sure the (x, y) are the same but not zero (0) for ISIS if ((scaleCount == 3) && (scales[0] > 0.0 && scales[1] > 0.0) && (scales[0] == scales[1])) { - map += PvlKeyword("PixelResolution", toString(scales[0]), "meters"); + map += PvlKeyword("PixelResolution", std::to_string(scales[0]), "meters"); } else { QString msg = "The pixel resolution could not be retrieved from the TIFF file. Unsupported " diff --git a/isis/src/base/objs/TrackingTable/TrackingTable.cpp b/isis/src/base/objs/TrackingTable/TrackingTable.cpp index 9ae5665b56..6c0570b0c7 100644 --- a/isis/src/base/objs/TrackingTable/TrackingTable.cpp +++ b/isis/src/base/objs/TrackingTable/TrackingTable.cpp @@ -89,7 +89,7 @@ namespace Isis { dummyRecord += fileNameField; dummyRecord += serialNumberField; dummyRecord += indexField; - Table table(trackingTableName, dummyRecord); + Table table(trackingTableName.toStdString(), dummyRecord); // Loop through m_fileList and add records to the table with the proper information. for (int i=0; i < m_fileList.size(); i++) { diff --git a/isis/src/base/objs/TransverseMercator/TransverseMercator.cpp b/isis/src/base/objs/TransverseMercator/TransverseMercator.cpp index 352630c330..41dad1825e 100644 --- a/isis/src/base/objs/TransverseMercator/TransverseMercator.cpp +++ b/isis/src/base/objs/TransverseMercator/TransverseMercator.cpp @@ -46,14 +46,14 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } // Compute and write the default center latitude if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(lat)); } // Get the center longitude & latitude @@ -101,7 +101,7 @@ namespace Isis { // Get the scale factor if ((allowDefaults) && (!mapGroup.hasKeyword("ScaleFactor"))) { - mapGroup += PvlKeyword("ScaleFactor", toString(1.0)); + mapGroup += PvlKeyword("ScaleFactor", std::to_string(1.0)); } m_scalefactor = mapGroup["ScaleFactor"]; } diff --git a/isis/src/base/objs/TransverseMercator/unitTest.cpp b/isis/src/base/objs/TransverseMercator/unitTest.cpp index 65aa027500..c1e34345b6 100644 --- a/isis/src/base/objs/TransverseMercator/unitTest.cpp +++ b/isis/src/base/objs/TransverseMercator/unitTest.cpp @@ -25,15 +25,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGroup += PvlKeyword("PolarRadius", toString(1.0)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(1.0)); + mapGroup += PvlKeyword("PolarRadius", std::to_string(1.0)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-70.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(70.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(-60.0)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGroup += PvlKeyword("MinimumLatitude", std::to_string(-70.0)); + mapGroup += PvlKeyword("MaximumLatitude", std::to_string(70.0)); + mapGroup += PvlKeyword("MinimumLongitude", std::to_string(-90.0)); + mapGroup += PvlKeyword("MaximumLongitude", std::to_string(-60.0)); mapGroup += PvlKeyword("ProjectionName", "TransverseMercator"); cout << "Test missing center longitude keyword ..." << endl; @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(-75.0)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(-75.0)); cout << "Test missing center latitude keyword..." << endl; try { @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLatitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(0.0)); cout << "Test missing scale factor keyword..." << endl; try { @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("ScaleFactor", toString(1.0)); + mapGroup += PvlKeyword("ScaleFactor", std::to_string(1.0)); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); @@ -130,19 +130,19 @@ int main(int argc, char *argv[]) { Pvl lab2; lab2.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup2 = lab2.findGroup("Mapping"); - mapGroup2 += PvlKeyword("EquatorialRadius", toString(6378206.4)); - mapGroup2 += PvlKeyword("PolarRadius", toString(6356583.8)); + mapGroup2 += PvlKeyword("EquatorialRadius", std::to_string(6378206.4)); + mapGroup2 += PvlKeyword("PolarRadius", std::to_string(6356583.8)); mapGroup2 += PvlKeyword("LatitudeType", "Planetographic"); mapGroup2 += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup2 += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup2 += PvlKeyword("MinimumLatitude", toString(-70.0)); - mapGroup2 += PvlKeyword("MaximumLatitude", toString(70.0)); - mapGroup2 += PvlKeyword("MinimumLongitude", toString(-90.0)); - mapGroup2 += PvlKeyword("MaximumLongitude", toString(-60.0)); + mapGroup2 += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGroup2 += PvlKeyword("MinimumLatitude", std::to_string(-70.0)); + mapGroup2 += PvlKeyword("MaximumLatitude", std::to_string(70.0)); + mapGroup2 += PvlKeyword("MinimumLongitude", std::to_string(-90.0)); + mapGroup2 += PvlKeyword("MaximumLongitude", std::to_string(-60.0)); mapGroup2 += PvlKeyword("ProjectionName", "TransverseMercator"); - mapGroup2 += PvlKeyword("CenterLongitude", toString(-75.0)); - mapGroup2 += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroup2 += PvlKeyword("ScaleFactor", toString(0.9996)); + mapGroup2 += PvlKeyword("CenterLongitude", std::to_string(-75.0)); + mapGroup2 += PvlKeyword("CenterLatitude", std::to_string(0.0)); + mapGroup2 += PvlKeyword("ScaleFactor", std::to_string(0.9996)); cout << endl; try { diff --git a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp index 457700e3b2..329d675c23 100644 --- a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp +++ b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp @@ -62,7 +62,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLongitude")) { if (allowDefaults) { // centerLongitude still 0.0 here - mapGroup += PvlKeyword("CenterLongitude", toString(centerLongitude), "Degrees"); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(centerLongitude), "Degrees"); } else { QString message = "Cannot project using upturned ellipsoid Transverse Azimuthal"; @@ -76,17 +76,17 @@ namespace Isis { } if (MinimumLongitude() < centerLongitude - 90.0) { - QString message = "MinimumLongitude [" - + toString(MinimumLongitude()) + std::string message = "MinimumLongitude [" + + std::to_string(MinimumLongitude()) + "] is invalid. Must be within -90 degrees of the CenterLongitude [" - + toString(centerLongitude) + "]."; + + std::to_string(centerLongitude) + "]."; throw IException(IException::Unknown, message, _FILEINFO_); } if (MaximumLongitude() > centerLongitude + 90.0) { - QString message = "MaximumLongitude [" - + toString(MaximumLongitude()) + std::string message = "MaximumLongitude [" + + std::to_string(MaximumLongitude()) + "] is invalid. Must be within +90 degrees of the CenterLongitude [" - + toString(centerLongitude) + "]."; + + std::to_string(centerLongitude) + "]."; throw IException(IException::Unknown, message, _FILEINFO_); } @@ -95,7 +95,7 @@ namespace Isis { init(centerLongitude); } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Unknown, message, _FILEINFO_); } } @@ -682,7 +682,7 @@ namespace Isis { */ PvlGroup UpturnedEllipsoidTransverseAzimuthal::Mapping() { PvlGroup mapping = TProjection::Mapping(); - mapping += PvlKeyword("CenterLongitude", toString(m_lambda0 * RAD2DEG)); + mapping += PvlKeyword("CenterLongitude", std::to_string(m_lambda0 * RAD2DEG)); return mapping; } @@ -723,7 +723,7 @@ namespace Isis { */ PvlGroup UpturnedEllipsoidTransverseAzimuthal::MappingLongitudes() { PvlGroup mapping = TProjection::MappingLongitudes(); - mapping += PvlKeyword("CenterLongitude", toString(m_lambda0 * RAD2DEG)); + mapping += PvlKeyword("CenterLongitude", std::to_string(m_lambda0 * RAD2DEG)); return mapping; } diff --git a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/unitTest.cpp b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/unitTest.cpp index a9ba9eb124..915a00832c 100644 --- a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/unitTest.cpp +++ b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/unitTest.cpp @@ -585,7 +585,7 @@ int main(int argc, char *argv[]) { cout << "\t\t\t TESTING OTHER METHODS" << endl; cout << border << endl << endl; //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - mapGroup.findKeyword("PolarRadius").setValue(toString(p2a->EquatorialRadius())); + mapGroup.findKeyword("PolarRadius").setValue(std::to_string(p2a->EquatorialRadius())); TProjection *p9 = (TProjection *) ProjectionFactory::Create(lab); TProjection *s = p1; cout << "Name: " << s->Name() << endl; diff --git a/isis/src/base/objs/UserInterface/UserInterface.cpp b/isis/src/base/objs/UserInterface/UserInterface.cpp index 7b87b62cce..f5c8e8d5ab 100644 --- a/isis/src/base/objs/UserInterface/UserInterface.cpp +++ b/isis/src/base/objs/UserInterface/UserInterface.cpp @@ -268,7 +268,7 @@ namespace Isis { return; // Get the current history file - Isis::FileName histFile(grp["HistoryPath"][0] + "/" + ProgramName() + ".par"); + Isis::FileName histFile(QString::fromStdString(grp["HistoryPath"][0]) + "/" + ProgramName() + ".par"); // If a save file is specified, override the default file path if (p_saveFile != "") @@ -285,7 +285,7 @@ namespace Isis { // overwriten with the new entry. try { if ( histFile.fileExists() ) { - hist.read( histFile.expanded() ); + hist.read( histFile.expanded().toStdString() ); } } catch (IException &) { @@ -295,13 +295,13 @@ namespace Isis { hist.addGroup( cmdLine.findGroup("UserParameters") ); // See if we have exceeded history length - while( hist.groups() > toInt(grp["HistoryLength"][0]) ) { + while( hist.groups() > std::stoi(grp["HistoryLength"][0]) ) { hist.deleteGroup("UserParameters"); } // Write it try { - hist.write( histFile.expanded() ); + hist.write( histFile.expanded().toStdString() ); } catch (IException &) { } @@ -550,9 +550,9 @@ namespace Isis { for(int i = 0; i < numKeywords; i++){ PvlKeyword key = group[i]; - returnVal += key.name(); + returnVal += QString::fromStdString(key.name()); returnVal += "="; - returnVal += QString(key); + returnVal += QString::fromStdString(key); returnVal += " "; } return returnVal; @@ -572,19 +572,19 @@ namespace Isis { Isis::FileName hist(file); if ( hist.fileExists() ) { try { - Isis::Pvl lab( hist.expanded() ); + Isis::Pvl lab( hist.expanded().toStdString() ); int g = lab.groups() - 1; if (g >= 0 && lab.group(g).isNamed("UserParameters") ) { Isis::PvlGroup &up = lab.group(g); QString commandline(p_progName + " "); for (int k = 0; k < up.keywords(); k++) { - QString keyword = up[k].name(); + QString keyword = QString::fromStdString(up[k].name()); vector values; for (int i = 0; i < up[k].size(); i++) { - values.push_back(up[k][i]); + values.push_back(QString::fromStdString(up[k][i])); } const IsisParameterData *paramData = ReturnParam(keyword); @@ -616,14 +616,14 @@ namespace Isis { } for (int o = lab.objects() - 1; o >= 0; o--) { - if ( lab.object(o).isNamed( ProgramName() ) ) { + if ( lab.object(o).isNamed( ProgramName().toStdString() ) ) { Isis::PvlObject &obj = lab.object(o); for (int g = obj.groups() - 1; g >= 0; g--) { Isis::PvlGroup &up = obj.group(g); if ( up.isNamed("UserParameters") ) { for (int k = 0; k < up.keywords(); k++) { - QString keyword = up[k].name(); - QString value = up[k][0]; + QString keyword = QString::fromStdString(up[k].name()); + QString value = QString::fromStdString(up[k][0]); PutAsString(keyword, value); } } @@ -692,7 +692,7 @@ namespace Isis { } else { PvlGroup &grp = p.findGroup("UserInterface", Isis::Pvl::Traverse); - histFile = grp["HistoryPath"][0] + "/" + FileName(p_progName).name() + ".par"; + histFile = QString::fromStdString(grp["HistoryPath"][0]) + "/" + FileName(p_progName).name() + ".par"; } loadHistory(histFile); @@ -702,7 +702,7 @@ namespace Isis { } else if(name == "-WEBHELP") { Isis::PvlGroup &pref = Isis::Preference::Preferences().findGroup("UserInterface"); - QString command = pref["GuiHelpBrowser"]; + QString command = QString::fromStdString(pref["GuiHelpBrowser"]); command += " $ISISROOT/docs/Application/presentation/Tabbed/"; command += FileName(p_progName).name() + "/" + FileName(p_progName).name() + ".html"; // cannot test else in unit test - don't want to open webhelp @@ -732,16 +732,16 @@ namespace Isis { for (int k = 0; k < NumGroups(); k++) { for (int j = 0; j < NumParams(k); j++) { if (ParamListSize(k, j) == 0) { - params += PvlKeyword( ParamName(k, j), ParamDefault(k, j) ); + params += PvlKeyword( ParamName(k, j).toStdString(), ParamDefault(k, j).toStdString() ); } else { - PvlKeyword key( ParamName(k, j) ); + PvlKeyword key( ParamName(k, j).toStdString() ); QString def = ParamDefault(k, j); for (int l = 0; l < ParamListSize(k, j); l++) { if (ParamListValue(k, j, l) == def) - key.addValue("*" + def); + key.addValue("*" + def.toStdString()); else - key.addValue( ParamListValue(k, j, l) ); + key.addValue( ParamListValue(k, j, l).toStdString() ); } params += key; } @@ -756,105 +756,105 @@ namespace Isis { for (int k = 0; k < NumGroups(); k++) { for (int j = 0; j < NumParams(k); j++) { if (ParamName(k, j) == key) { - param += PvlKeyword("ParameterName", key); - param += PvlKeyword( "Brief", ParamBrief(k, j) ); - param += PvlKeyword( "Type", ParamType(k, j) ); + param += PvlKeyword("ParameterName", key.toStdString()); + param += PvlKeyword( "Brief", ParamBrief(k, j).toStdString() ); + param += PvlKeyword( "Type", ParamType(k, j).toStdString() ); if (PixelType(k, j) != "") { - param += PvlKeyword( "PixelType", PixelType(k, j) ); + param += PvlKeyword( "PixelType", PixelType(k, j).toStdString() ); } if (ParamInternalDefault(k, j) != "") { - param += PvlKeyword( "InternalDefault", ParamInternalDefault(k, j) ); + param += PvlKeyword( "InternalDefault", ParamInternalDefault(k, j).toStdString() ); } else { - param += PvlKeyword( "Default", ParamDefault(k, j) ); + param += PvlKeyword( "Default", ParamDefault(k, j).toStdString() ); } if (ParamMinimum(k, j) != "") { if (ParamMinimumInclusive(k, j).toUpper() == "YES") { param += PvlKeyword( "GreaterThanOrEqual", - ParamMinimum(k, j) ); + ParamMinimum(k, j).toStdString() ); } else { param += PvlKeyword( "GreaterThan", - ParamMinimum(k, j) ); + ParamMinimum(k, j).toStdString() ); } } if (ParamMaximum(k, j) != "") { if (ParamMaximumInclusive(k, j).toUpper() == "YES") { param += PvlKeyword( "LessThanOrEqual", - ParamMaximum(k, j) ); + ParamMaximum(k, j).toStdString() ); } else { param += PvlKeyword( "LessThan", - ParamMaximum(k, j) ); + ParamMaximum(k, j).toStdString() ); } } if (ParamLessThanSize(k, j) > 0) { PvlKeyword key("LessThan"); for(int l = 0; l < ParamLessThanSize(k, j); l++) { - key.addValue( ParamLessThan(k, j, l) ); + key.addValue( ParamLessThan(k, j, l).toStdString() ); } param += key; } if (ParamLessThanOrEqualSize(k, j) > 0) { PvlKeyword key("LessThanOrEqual"); for (int l = 0; l < ParamLessThanOrEqualSize(k, j); l++) { - key.addValue( ParamLessThanOrEqual(k, j, l) ); + key.addValue( ParamLessThanOrEqual(k, j, l).toStdString() ); } param += key; } if (ParamNotEqualSize(k, j) > 0) { PvlKeyword key("NotEqual"); for (int l = 0; l < ParamNotEqualSize(k, j); l++) { - key.addValue( ParamNotEqual(k, j, l) ); + key.addValue( ParamNotEqual(k, j, l).toStdString() ); } param += key; } if (ParamGreaterThanSize(k, j) > 0) { PvlKeyword key("GreaterThan"); for (int l = 0; l < ParamGreaterThanSize(k, j); l++) { - key.addValue( ParamGreaterThan(k, j, l) ); + key.addValue( ParamGreaterThan(k, j, l).toStdString() ); } param += key; } if (ParamGreaterThanOrEqualSize(k, j) > 0) { PvlKeyword key("GreaterThanOrEqual"); for(int l = 0; l < ParamGreaterThanOrEqualSize(k, j); l++) { - key.addValue( ParamGreaterThanOrEqual(k, j, l) ); + key.addValue( ParamGreaterThanOrEqual(k, j, l).toStdString() ); } param += key; } if (ParamIncludeSize(k, j) > 0) { PvlKeyword key("Inclusions"); for (int l = 0; l < ParamIncludeSize(k, j); l++) { - key.addValue( ParamInclude(k, j, l) ); + key.addValue( ParamInclude(k, j, l).toStdString() ); } param += key; } if (ParamExcludeSize(k, j) > 0) { PvlKeyword key("Exclusions"); for (int l = 0; l < ParamExcludeSize(k, j); l++) { - key.addValue( ParamExclude(k, j, l) ); + key.addValue( ParamExclude(k, j, l).toStdString() ); } param += key; } if (ParamOdd(k, j) != "") { - param += PvlKeyword( "Odd", ParamOdd(k, j) ); + param += PvlKeyword( "Odd", ParamOdd(k, j).toStdString() ); } if (ParamListSize(k, j) != 0) { for (int l = 0; l < ParamListSize(k, j); l++) { - PvlGroup grp( ParamListValue(k, j, l) ); - grp += PvlKeyword( "Brief", ParamListBrief(k, j, l) ); + PvlGroup grp( ParamListValue(k, j, l).toStdString() ); + grp += PvlKeyword( "Brief", ParamListBrief(k, j, l).toStdString() ); if (ParamListIncludeSize(k, j, l) != 0) { PvlKeyword include("Inclusions"); for (int m = 0; m < ParamListIncludeSize(k, j, l); m++) { - include.addValue( ParamListInclude(k, j, l, m) ); + include.addValue( ParamListInclude(k, j, l, m).toStdString() ); } grp += include; } if (ParamListExcludeSize(k, j, l) != 0) { PvlKeyword exclude("Exclusions"); for (int m = 0; m < ParamListExcludeSize(k, j, l); m++) { - exclude.addValue( ParamListExclude(k, j, l, m) ); + exclude.addValue( ParamListExclude(k, j, l, m).toStdString() ); } grp += exclude; } @@ -884,7 +884,7 @@ namespace Isis { p_errList = value; if (value == "") { - QString msg = "-ERRLIST expects a file name"; + std::string msg = "-ERRLIST expects a file name"; throw IException(IException::User, msg, _FILEINFO_); } @@ -916,7 +916,7 @@ namespace Isis { } } else if (name == "-PREFERENCE") { - p.Load(value); + p.Load(value.toStdString()); p_preference = value; } else if (name == "-LOG") { @@ -925,7 +925,7 @@ namespace Isis { } else { p.findGroup("SessionLog")["FileOutput"].setValue("On"); - p.findGroup("SessionLog")["FileName"].setValue(value); + p.findGroup("SessionLog")["FileName"].setValue(value.toStdString()); } } // this only evaluates to true in unit test since this is last else if @@ -935,7 +935,7 @@ namespace Isis { // Can't have a parent id and the gui if (p_parentId > 0 && p_interactive) { - QString msg = "-GUI and -PID are incompatible arguments"; + std::string msg = "-GUI and -PID are incompatible arguments"; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -995,7 +995,7 @@ namespace Isis { // We found "=" at the beginning - did we find "appname param =value" ? else { // parameters can not start with "=" - QString msg = "Unknown parameter [" + QString(p_cmdline[curPos]) + std::string msg = "Unknown parameter [" + std::string(p_cmdline[curPos]) + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp index 476b2594f6..0da3a52cf2 100644 --- a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp +++ b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp @@ -172,7 +172,7 @@ namespace Isis { const Pvl &transTable = TranslationTable(); PvlGroup transGroup; try { - transGroup = transTable.findGroup(translationGroupName); + transGroup = transTable.findGroup(translationGroupName.toStdString()); } catch (IException &e){ QString msg = "Unable to retrieve translation group from translation table."; @@ -189,12 +189,12 @@ namespace Isis { "translation group."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } - QString inputParentName = inputPosition[inputPosition.size() - 1]; + QString inputParentName = QString::fromStdString(inputPosition[inputPosition.size() - 1]); // get input key (tag or att) QString inputKey; try { - inputKey = transGroup["InputKey"][0]; + inputKey = QString::fromStdString(transGroup["InputKey"][0]); } catch (IException &e){ QString msg = "Unable to retrieve [InputKey] keyword from " @@ -203,7 +203,7 @@ namespace Isis { } QString attributeName; if (transGroup.hasKeyword("InputKeyAttribute")) { - attributeName = transGroup["InputKeyAttribute"][0]; + attributeName = QString::fromStdString(transGroup["InputKeyAttribute"][0]); } // get dependencies @@ -242,7 +242,7 @@ namespace Isis { inputParentElement = oldInputParentElement; for (int i = 0; i < inputPosition.size(); i++) { - childName = inputPosition[i]; + childName = QString::fromStdString(inputPosition[i]); inputParentElement = inputParentElement.firstChildElement(childName); if(inputParentElement.isNull()) { break; @@ -268,9 +268,9 @@ namespace Isis { return PvlTranslationTable::Translate( translationGroupName ); } else { - QString msg = "Failed traversing input position. [" + + std::string msg = "Failed traversing input position. [" + inputPosition.name() + "] element does not have a child element named [" + - childName + "]."; + childName.toStdString() + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -377,7 +377,7 @@ namespace Isis { cout << endl << "Testing dependencies:" << endl; } for (int i = 0; i < dependencies.size(); i++) { - QStringList specification = parseSpecification(dependencies[i]); + QStringList specification = parseSpecification(QString::fromStdString(dependencies[i])); if (specification.size() != 3) { // the specification is not a dependancy return true; diff --git a/isis/src/base/objs/iTime/iTime.cpp b/isis/src/base/objs/iTime/iTime.cpp index 5a30402785..392a85bfde 100644 --- a/isis/src/base/objs/iTime/iTime.cpp +++ b/isis/src/base/objs/iTime/iTime.cpp @@ -475,7 +475,7 @@ namespace Isis { // Get the leap second kernel file open Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory"); - QString baseDir = dataDir["Base"]; + QString baseDir = QString::fromStdString(dataDir["Base"]); baseDir += "/kernels/lsk/"; FileName leapSecond(baseDir + "naif????.tls"); QString leapSecondName; diff --git a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp index fc7b5358af..6e478bd88a 100644 --- a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp +++ b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp @@ -94,7 +94,7 @@ namespace Isis{ //Adjust Table-encoded values from 8 bit back to 12 bit. PvlGroup &inst = outputLabel->findGroup("Instrument", Pvl::Traverse); double biasStripMean = inst.findKeyword("BiasStripMean"); - inst.findKeyword("BiasStripMean").setValue(toString(stretch.Map(biasStripMean))); + inst.findKeyword("BiasStripMean").setValue(std::to_string(stretch.Map(biasStripMean))); inst.findKeyword("BiasStripMean").addComment("BiasStripMean value converted back to 12 bit."); p.Progress()->SetText("Image was converted using 12-to-8 bit table. \nConverting prefix pixels back to 12 bit and saving line prefix data..."); } @@ -291,17 +291,17 @@ namespace Isis{ //Add units of measurement to keywords from translation table double exposureDuration = inst.findKeyword("ExposureDuration"); - inst.findKeyword("ExposureDuration").setValue(toString(exposureDuration), "Milliseconds"); + inst.findKeyword("ExposureDuration").setValue(std::to_string(exposureDuration), "Milliseconds"); int gainModeId = inst.findKeyword("GainModeId"); - inst.findKeyword("GainModeId").setValue(toString(gainModeId), "ElectronsPerDN"); + inst.findKeyword("GainModeId").setValue(std::to_string(gainModeId), "ElectronsPerDN"); PvlKeyword opticsTemp = inst.findKeyword("OpticsTemperature"); inst.findKeyword("OpticsTemperature").setValue(opticsTemp[0]); inst.findKeyword("OpticsTemperature").addValue(opticsTemp[1], "DegreesCelcius"); double instDataRate = inst.findKeyword("InstrumentDataRate"); - inst.findKeyword("InstrumentDataRate").setValue(toString(instDataRate), "KilobitsPerSecond"); + inst.findKeyword("InstrumentDataRate").setValue(std::to_string(instDataRate), "KilobitsPerSecond"); // initialize global variables dataConversionType = (QString) inst.findKeyword("DataConversionType"); diff --git a/isis/src/cassini/apps/vims2isis/main.cpp b/isis/src/cassini/apps/vims2isis/main.cpp index 97522b3a51..78124bab34 100644 --- a/isis/src/cassini/apps/vims2isis/main.cpp +++ b/isis/src/cassini/apps/vims2isis/main.cpp @@ -454,7 +454,7 @@ void ProcessBands(Pvl &pdsLab, Cube *vimsCube, VimsType vtype) { PvlGroup bandbin("BandBin"); PvlKeyword originalBand("OriginalBand"); for(int i = vims.mi32OrigBandStart; i <= vims.mi32OrigBinEnd; i++) { - originalBand.addValue(toString(i)); + originalBand.addValue(std::to_string(i)); } bandbin += originalBand; PvlKeyword center("Center"); diff --git a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp index e249e12574..df7ca90fa0 100644 --- a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp +++ b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp @@ -423,7 +423,7 @@ namespace Isis { } PvlKeyword originalBand("OriginalBand"); for (int i = 1; i <= numBands; i++) { - originalBand.addValue(toString(i)); + originalBand.addValue(std::to_string(i)); } bandGroup += originalBand; ocube->putGroup(bandGroup); diff --git a/isis/src/clementine/apps/clem2isis/main.cpp b/isis/src/clementine/apps/clem2isis/main.cpp index 7cc914bee5..195cf076cf 100755 --- a/isis/src/clementine/apps/clem2isis/main.cpp +++ b/isis/src/clementine/apps/clem2isis/main.cpp @@ -143,11 +143,11 @@ void translateLabels(FileName in, Cube *ocube) { //Band Bin group double center = pdsLab["CenterFilterWavelength"]; center /= 1000.0; - bBin.findKeyword("Center").setValue(toString(center), "micrometers"); + bBin.findKeyword("Center").setValue(std::to_string(center), "micrometers"); } double width = pdsLab["Bandwidth"]; width /= 1000.0; - bBin.findKeyword("Width").setValue(toString(width), "micrometers"); + bBin.findKeyword("Width").setValue(std::to_string(width), "micrometers"); ocube->putGroup(bBin); //Kernel group diff --git a/isis/src/clipper/apps/jitterfit/jitterfit.cpp b/isis/src/clipper/apps/jitterfit/jitterfit.cpp index e91ddd99dc..bfaf17d3c4 100644 --- a/isis/src/clipper/apps/jitterfit/jitterfit.cpp +++ b/isis/src/clipper/apps/jitterfit/jitterfit.cpp @@ -182,8 +182,8 @@ namespace Isis{ outputCoefficientFile << std::setprecision(14) << lineFunction->Coefficient(i) << "," << std::setprecision(14) << sampleFunction->Coefficient(i) << endl; if (i == 0) { - jitterLineCoefficients.setValue(toString(lineFunction->Coefficient(i))); - jitterSampleCoefficients.setValue(toString(sampleFunction->Coefficient(i))); + jitterLineCoefficients.setValue(std::to_string(lineFunction->Coefficient(i))); + jitterSampleCoefficients.setValue(std::to_string(sampleFunction->Coefficient(i))); } else { jitterLineCoefficients += toString(lineFunction->Coefficient(i)); diff --git a/isis/src/control/apps/autoseed/autoseed.cpp b/isis/src/control/apps/autoseed/autoseed.cpp index be60f22c51..d882e8c37f 100644 --- a/isis/src/control/apps/autoseed/autoseed.cpp +++ b/isis/src/control/apps/autoseed/autoseed.cpp @@ -60,7 +60,7 @@ namespace Isis { void autoseed(UserInterface &ui, SerialNumberList &serialNumbers, ControlNet *precnet, Pvl *log) { // Get the AutoSeed PVL internalized - Pvl seedDef(ui.GetFileName("DEFFILE")); + Pvl seedDef(ui.GetFileName("DEFFILE").toStdString()); PolygonSeeder *seeder = PolygonSeederFactory::Create(seedDef); Pvl invalidInput = seeder->InvalidInput(); @@ -137,7 +137,7 @@ namespace Isis { // Get seed domain for unit conversion, no keyword == XY SeedDomain seedDomain = XY; if (seedDef.hasKeyword("SeedDomain", Pvl::Traverse)) { - IString domain = (QString) seedDef.findKeyword("SeedDomain", Pvl::Traverse); + IString domain = QString::fromStdString(seedDef.findKeyword("SeedDomain", Pvl::Traverse)); if (unusedDefKeywords.hasKeyword("SeedDomain")) unusedDefKeywords.deleteKeyword("SeedDomain"); @@ -153,7 +153,7 @@ namespace Isis { // Grab the labels from the first filename in the SerialNumberList to get // some info - Pvl cubeLab(serialNumbers.fileName(0)); + Pvl cubeLab(serialNumbers.fileName(0).toStdString()); // Construct a Projection for converting between Lon/Lat and X/Y // This is used inside the seeding algorithms. @@ -474,8 +474,8 @@ namespace Isis { // create SeedDef group and add to print.prt PvlGroup pluginInfo = seeder->PluginParameters("SeedDefinition"); - pluginInfo.addKeyword(PvlKeyword("MaxIncidence", toString(maxIncidence))); - pluginInfo.addKeyword(PvlKeyword("MaxEmission", toString(maxEmission))); + pluginInfo.addKeyword(PvlKeyword("MaxIncidence", std::to_string(maxIncidence))); + pluginInfo.addKeyword(PvlKeyword("MaxEmission", std::to_string(maxEmission))); Application::Log(pluginInfo); // inform user of any unused (invalid) keywords found in the def file @@ -493,10 +493,10 @@ namespace Isis { } // create Results group and add to print.prt - PvlKeyword cpCountKeyword("ControlPointCount", toString(cpCount)); - PvlKeyword msCountKeyword("ControlMeasureCount", toString(msCount)); - PvlKeyword cpIgnoredCountKeyword("ControlPointsIgnored", toString(cpIgnoredCount)); - PvlKeyword cmIgnoredCountKeyword("ControlMeasuresIgnored", toString(cmIgnoredCount)); + PvlKeyword cpCountKeyword("ControlPointCount", std::to_string(cpCount)); + PvlKeyword msCountKeyword("ControlMeasureCount", std::to_string(msCount)); + PvlKeyword cpIgnoredCountKeyword("ControlPointsIgnored", std::to_string(cpIgnoredCount)); + PvlKeyword cmIgnoredCountKeyword("ControlMeasuresIgnored", std::to_string(cmIgnoredCount)); PvlGroup resultsGrp("Results"); resultsGrp.addKeyword(cpCountKeyword); diff --git a/isis/src/control/apps/cnetcheck/cnetcheck.cpp b/isis/src/control/apps/cnetcheck/cnetcheck.cpp index d36a92da58..e6870a934b 100644 --- a/isis/src/control/apps/cnetcheck/cnetcheck.cpp +++ b/isis/src/control/apps/cnetcheck/cnetcheck.cpp @@ -262,7 +262,7 @@ namespace Isis { stringstream ss(stringstream::in | stringstream::out); - results.addKeyword(PvlKeyword("Islands", toString((BigInt)islands.size()))); + results.addKeyword(PvlKeyword("Islands", std::to_string((BigInt)islands.size()))); ss << endl << "----------------------------------------" \ "----------------------------------------" << endl; if (islands.size() == 1) { @@ -279,7 +279,7 @@ namespace Isis { if (ui.GetBoolean("SINGLEMEASURE") && singleMeasureSerialNumbers.size() > 0) { results.addKeyword( - PvlKeyword("SingleMeasure", toString((BigInt)singleMeasureSerialNumbers.size()))); + PvlKeyword("SingleMeasure", std::to_string((BigInt)singleMeasureSerialNumbers.size()))); QString name(FileName(prefix + "SinglePointCubes.txt").expanded()); writeOutput(num2cube, name, @@ -297,7 +297,7 @@ namespace Isis { if (ui.GetBoolean("NOLATLON") && noLatLonSerialNumbers.size() > 0) { results.addKeyword( - PvlKeyword("NoLatLonCubes", toString((BigInt)noLatLonSerialNumbers.size()))); + PvlKeyword("NoLatLonCubes", std::to_string((BigInt)noLatLonSerialNumbers.size()))); QString name(FileName(prefix + "NoLatLon.txt").expanded()); writeOutput(num2cube, name, @@ -352,14 +352,14 @@ namespace Isis { "coverages, are listed in [" << FileName(name).name() << "]" << endl; results.addKeyword( - PvlKeyword(coverageOp, toString((BigInt) failedCoverageCheck))); + PvlKeyword(coverageOp.toStdString(), std::to_string((BigInt) failedCoverageCheck))); } } // At this point, inListNums is the list of cubes NOT included in the // ControlNet, and inListNums are their those cube's serial numbers. if (ui.GetBoolean("NOCONTROL") && !inListNums.empty()) { - results.addKeyword(PvlKeyword("NoControl", toString((BigInt)inListNums.size()))); + results.addKeyword(PvlKeyword("NoControl", std::to_string((BigInt)inListNums.size()))); QString name(FileName(prefix + "NoControl.txt").expanded()); ofstream out_stream; @@ -387,7 +387,7 @@ namespace Isis { // cube in the input list. if (ui.GetBoolean("NOCUBE") && nonListedSerialNumbers.size() > 0) { results.addKeyword( - PvlKeyword("NoCube", toString((BigInt)nonListedSerialNumbers.size()))); + PvlKeyword("NoCube", std::to_string((BigInt)nonListedSerialNumbers.size()))); QString name(FileName(prefix + "NoCube.txt").expanded()); ofstream out_stream; @@ -428,7 +428,7 @@ namespace Isis { if (singleMeasureCubes.size() > 0) { results.addKeyword( - PvlKeyword("SingleCube", toString((BigInt)singleMeasureCubes.size()))); + PvlKeyword("SingleCube", std::to_string((BigInt)singleMeasureCubes.size()))); QString name(FileName(prefix + "SingleCube.txt").expanded()); ofstream out_stream; diff --git a/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp b/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp index b5290eb6e6..6123cc1aa4 100644 --- a/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp +++ b/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp @@ -489,15 +489,15 @@ namespace Isis{ // Write out a report int pMerged = validPoints - vPoints; PvlGroup summary("Summary"); - summary += PvlKeyword("TotalCubes", toString(cube_measures_size)); - summary += PvlKeyword("TotalInputPoints", toString(all_points.size())); - summary += PvlKeyword("TotalOutputPoints", toString(oPoints)); - summary += PvlKeyword("PointsMerged", toString(pMerged)); - summary += PvlKeyword("PointsEvaluated", toString(nfound)); - summary += PvlKeyword("TotalMeasures", toString(allPoints)); - summary += PvlKeyword("MeasuresMerged", toString(nMerged)); - summary += PvlKeyword("MeasuresDeleted", toString(nRemoved)); - summary += PvlKeyword("MinimumMeasures", toString(nMinMeasures)); + summary += PvlKeyword("TotalCubes", std::to_string(cube_measures_size)); + summary += PvlKeyword("TotalInputPoints", std::to_string(all_points.size())); + summary += PvlKeyword("TotalOutputPoints", std::to_string(oPoints)); + summary += PvlKeyword("PointsMerged", std::to_string(pMerged)); + summary += PvlKeyword("PointsEvaluated", std::to_string(nfound)); + summary += PvlKeyword("TotalMeasures", std::to_string(allPoints)); + summary += PvlKeyword("MeasuresMerged", std::to_string(nMerged)); + summary += PvlKeyword("MeasuresDeleted", std::to_string(nRemoved)); + summary += PvlKeyword("MinimumMeasures", std::to_string(nMinMeasures)); Application::Log(summary); pbl.EndProcess(); diff --git a/isis/src/control/apps/cnetextract/cnetextract.cpp b/isis/src/control/apps/cnetextract/cnetextract.cpp index 74e2d9b9c4..d54922f474 100644 --- a/isis/src/control/apps/cnetextract/cnetextract.cpp +++ b/isis/src/control/apps/cnetextract/cnetextract.cpp @@ -322,10 +322,10 @@ namespace Isis { PvlGroup summary("ResultSummary"); PvlGroup results("Results"); - summary.addKeyword(PvlKeyword("InputPoints", toString(inputPoints))); - summary.addKeyword(PvlKeyword("InputMeasures", toString(inputMeasures))); - summary.addKeyword(PvlKeyword("OutputPoints", toString(outputPoints))); - summary.addKeyword(PvlKeyword("OutputMeasures", toString(outputMeasures))); + summary.addKeyword(PvlKeyword("InputPoints", std::to_string(inputPoints))); + summary.addKeyword(PvlKeyword("InputMeasures", std::to_string(inputMeasures))); + summary.addKeyword(PvlKeyword("OutputPoints", std::to_string(outputPoints))); + summary.addKeyword(PvlKeyword("OutputMeasures", std::to_string(outputMeasures))); if (outputPoints != 0) { // Write the filenames associated with outNet @@ -342,13 +342,13 @@ namespace Isis { } else { summary.addComment("The output control network file, [" - + ui.GetFileName("ONET") + + + ui.GetFileName("ONET").toStdString() + "], was not created. " "The provided filters have resulted in no points or " "measures extracted."); if (ui.WasEntered("TOLIST")) { summary.addComment("The output cube list file, [" - + ui.GetFileName("TOLIST") + + + ui.GetFileName("TOLIST").toStdString() + "], was not created. " "The provided filters have resulted in an empty" "Control Network."); @@ -357,43 +357,43 @@ namespace Isis { if(noIgnore) { - summary.addKeyword(PvlKeyword("IgnoredPoints", toString((int)ignoredPoints.size()))); - summary.addKeyword(PvlKeyword("IgnoredMeasures", toString((int)ignoredMeasures.size()))); + summary.addKeyword(PvlKeyword("IgnoredPoints", std::to_string((int)ignoredPoints.size()))); + summary.addKeyword(PvlKeyword("IgnoredMeasures", std::to_string((int)ignoredMeasures.size()))); } if(noSingleMeasure) { - summary.addKeyword(PvlKeyword("SingleMeasurePoints", toString((int)singleMeasurePoints.size()))); + summary.addKeyword(PvlKeyword("SingleMeasurePoints", std::to_string((int)singleMeasurePoints.size()))); } if(noMeasureless) { - summary.addKeyword(PvlKeyword("MeasurelessPoints", toString((int)measurelessPoints.size()))); + summary.addKeyword(PvlKeyword("MeasurelessPoints", std::to_string((int)measurelessPoints.size()))); } if(noTolerancePoints) { - summary.addKeyword(PvlKeyword("TolerancePoints", toString((int)tolerancePoints.size()))); + summary.addKeyword(PvlKeyword("TolerancePoints", std::to_string((int)tolerancePoints.size()))); } if(reference) { - summary.addKeyword(PvlKeyword("NonReferenceMeasures", toString((int)nonReferenceMeasures.size()))); + summary.addKeyword(PvlKeyword("NonReferenceMeasures", std::to_string((int)nonReferenceMeasures.size()))); } if(fixed) { - summary.addKeyword(PvlKeyword("NonFixedPoints", toString((int)nonFixedPoints.size()))); + summary.addKeyword(PvlKeyword("NonFixedPoints", std::to_string((int)nonFixedPoints.size()))); } if(cubePoints) { - summary.addKeyword(PvlKeyword("NonCubePoints", toString((int)nonCubePoints.size()))); + summary.addKeyword(PvlKeyword("NonCubePoints", std::to_string((int)nonCubePoints.size()))); } // This is commented out since this does not correspond to any filters or the // documentation of this application. I did not delete the code in case we find // that we need it later. J.Backer 2012-06-22 // // if(noMeasurePoints.size() != 0) { - // summary.addKeyword(PvlKeyword("NoCubeMeasure", toString((int)noMeasurePoints.size()))); + // summary.addKeyword(PvlKeyword("NoCubeMeasure", std::to_string((int)noMeasurePoints.size()))); // } if(cubeMeasures) { - summary.addKeyword(PvlKeyword("NonCubeMeasures", toString((int)noCubeMeasures.size()))); + summary.addKeyword(PvlKeyword("NonCubeMeasures", std::to_string((int)noCubeMeasures.size()))); } if(pointsEntered) { - summary.addKeyword(PvlKeyword("NonListedPoints", toString((int)nonListedPoints.size()))); + summary.addKeyword(PvlKeyword("NonListedPoints", std::to_string((int)nonListedPoints.size()))); } if(latLon) { - summary.addKeyword(PvlKeyword("LatLonOutOfRange", toString((int)nonLatLonPoints.size()))); - summary.addKeyword(PvlKeyword("NoLatLonPoints", toString((int)cannotGenerateLatLonPoints.size()))); + summary.addKeyword(PvlKeyword("LatLonOutOfRange", std::to_string((int)nonLatLonPoints.size()))); + summary.addKeyword(PvlKeyword("NoLatLonPoints", std::to_string((int)cannotGenerateLatLonPoints.size()))); } outProgress.CheckStatus(); @@ -777,7 +777,7 @@ namespace Isis { // Don't create file if it will be empty if (outputsn.size() == 0) { summary.addComment("The output cube list file, [" - + toList.toString() + "], was not created. " + + toList.toString().toStdString() + "], was not created. " "The provided filters have resulted in an empty" "Control Network."); return; @@ -815,7 +815,7 @@ namespace Isis { // if no points or measures are being extracted, // we will not create the filter report. if(notExtracted.size() == 0) { - results.addComment("The output report ["+ filename +"] was not created. " + results.addComment("The output report ["+ filename.toStdString() +"] was not created. " "The corresponding filter found no points/measures that " "would not be extracted."); return; @@ -832,7 +832,7 @@ namespace Isis { } out_stream.close(); - results.addKeyword(PvlKeyword("ReportCreated", filename)); + results.addKeyword(PvlKeyword("ReportCreated", filename.toStdString())); return; } diff --git a/isis/src/control/apps/cnetref/CnetRefByEmission.cpp b/isis/src/control/apps/cnetref/CnetRefByEmission.cpp index 397ff8edda..8bd35e180c 100644 --- a/isis/src/control/apps/cnetref/CnetRefByEmission.cpp +++ b/isis/src/control/apps/cnetref/CnetRefByEmission.cpp @@ -69,7 +69,7 @@ namespace Isis { // Logging PvlObject pvlPointObj("PointDetails"); - pvlPointObj += Isis::PvlKeyword("PointId", newPnt->GetId()); + pvlPointObj += Isis::PvlKeyword("PointId", newPnt->GetId().toStdString()); // Edit Lock Option bool bPntEditLock = newPnt->IsEditLocked(); @@ -117,8 +117,8 @@ namespace Isis { // Log PvlGroup pvlMeasureGrp("MeasureDetails"); - pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn); - pvlMeasureGrp += Isis::PvlKeyword("OriginalLocation", LocationString(dSample, dLine)); + pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn.toStdString()); + pvlMeasureGrp += Isis::PvlKeyword("OriginalLocation", LocationString(dSample, dLine).toStdString()); if (bMeasureLocked) pvlMeasureGrp += Isis::PvlKeyword("EditLock", "True"); @@ -196,25 +196,25 @@ namespace Isis { else { int iComment = 0; if (numMeasures == 0) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "No Measures in the Point"); } if (newPnt->IsIgnored()) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Point was originally Ignored"); } if (origPnt.GetType() == ControlPoint::Fixed) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Fixed Point"); } else if (newPnt->GetType() == ControlPoint::Constrained) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Constrained Point"); } @@ -244,28 +244,28 @@ namespace Isis { PvlGroup pvlRefChangeGrp("ReferenceChangeDetails"); if (iRefIndex >= 0) { pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", - origPnt.GetReferenceSN()); + origPnt.GetReferenceSN().toStdString()); pvlRefChangeGrp += Isis::PvlKeyword("PrevEmAngle", - toString(bestEmissionAngle[iRefIndex])); + std::to_string(bestEmissionAngle[iRefIndex])); istrTemp = toString((int)origPnt.GetMeasure(iRefIndex)->GetSample()); istrTemp += ","; istrTemp += toString((int)origPnt.GetMeasure(iRefIndex)->GetLine()); - pvlRefChangeGrp += Isis::PvlKeyword("PrevLocation", istrTemp); + pvlRefChangeGrp += Isis::PvlKeyword("PrevLocation", istrTemp.toStdString()); } else { pvlRefChangeGrp += Isis::PvlKeyword("PrevReference", "Not Set"); } pvlRefChangeGrp += Isis::PvlKeyword("NewSerialNumber", - newPnt->GetMeasure(iBestIndex)->GetCubeSerialNumber()); + newPnt->GetMeasure(iBestIndex)->GetCubeSerialNumber().toStdString()); pvlRefChangeGrp += Isis::PvlKeyword("NewLeastEmAngle", - toString(bestEmissionAngle[iBestIndex])); + std::to_string(bestEmissionAngle[iBestIndex])); istrTemp = toString((int)newPnt->GetMeasure(iBestIndex)->GetSample()); istrTemp += ","; istrTemp += toString((int)newPnt->GetMeasure(iBestIndex)->GetLine()); - pvlRefChangeGrp += Isis::PvlKeyword("NewLocation", istrTemp); + pvlRefChangeGrp += Isis::PvlKeyword("NewLocation", istrTemp.toStdString()); pvlPointObj += pvlRefChangeGrp; } @@ -278,9 +278,9 @@ namespace Isis { }// end Point // CnetRef Change Statistics - mStatisticsGrp += Isis::PvlKeyword("PointsModified", toString(iPointsModified)); - mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", toString(iRefChanged)); - mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", toString(iMeasuresModified)); + mStatisticsGrp += Isis::PvlKeyword("PointsModified", std::to_string(iPointsModified)); + mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", std::to_string(iRefChanged)); + mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", std::to_string(iMeasuresModified)); mPvlLog += mStatisticsGrp; } diff --git a/isis/src/control/apps/cnetref/CnetRefByIncidence.cpp b/isis/src/control/apps/cnetref/CnetRefByIncidence.cpp index b83ca6408f..67133a882b 100644 --- a/isis/src/control/apps/cnetref/CnetRefByIncidence.cpp +++ b/isis/src/control/apps/cnetref/CnetRefByIncidence.cpp @@ -64,7 +64,7 @@ namespace Isis { // Logging PvlObject pvlPointObj("PointDetails"); - pvlPointObj += Isis::PvlKeyword("PointId", newPnt->GetId()); + pvlPointObj += Isis::PvlKeyword("PointId", newPnt->GetId().toStdString()); // Edit Lock Option bool bPntEditLock = newPnt->IsEditLocked(); @@ -114,8 +114,8 @@ namespace Isis { // Log PvlGroup pvlMeasureGrp("MeasureDetails"); - pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn); - pvlMeasureGrp += Isis::PvlKeyword("OriginalLocation", LocationString(dSample, dLine)); + pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn.toStdString()); + pvlMeasureGrp += Isis::PvlKeyword("OriginalLocation", LocationString(dSample, dLine).toStdString()); if (bMeasureLocked) pvlMeasureGrp += Isis::PvlKeyword("EditLock", "True"); @@ -193,25 +193,25 @@ namespace Isis { else { int iComment = 0; if (numMeasures == 0) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "No Measures in the Point"); } if (newPnt->IsIgnored()) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Point was originally Ignored"); } if (origPnt.GetType() == ControlPoint::Fixed) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Fixed Point"); } else if (newPnt->GetType() == ControlPoint::Constrained) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Constrained Point"); } @@ -240,26 +240,26 @@ namespace Isis { PvlGroup pvlRefChangeGrp("ReferenceChangeDetails"); if (iRefIndex >= 0) { pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", - origPnt.GetMeasure(iRefIndex)->GetCubeSerialNumber()); - pvlRefChangeGrp += Isis::PvlKeyword("PrevIncAngle", toString(bestIncidenceAngle[iRefIndex])); + origPnt.GetMeasure(iRefIndex)->GetCubeSerialNumber().toStdString()); + pvlRefChangeGrp += Isis::PvlKeyword("PrevIncAngle", std::to_string(bestIncidenceAngle[iRefIndex])); istrTemp = toString((int)origPnt.GetMeasure(iRefIndex)->GetSample()); istrTemp += ","; istrTemp += toString((int)origPnt.GetMeasure(iRefIndex)->GetLine()); - pvlRefChangeGrp += Isis::PvlKeyword("PrevLocation", istrTemp); + pvlRefChangeGrp += Isis::PvlKeyword("PrevLocation", istrTemp.toStdString()); } else { pvlRefChangeGrp += Isis::PvlKeyword("PrevReference", "Not Set"); } pvlRefChangeGrp += Isis::PvlKeyword("NewSerialNumber", - newPnt->GetMeasure(iBestIndex)->GetCubeSerialNumber()); - pvlRefChangeGrp += Isis::PvlKeyword("NewLeastIncAngle", toString(bestIncidenceAngle[iBestIndex])); + newPnt->GetMeasure(iBestIndex)->GetCubeSerialNumber().toStdString()); + pvlRefChangeGrp += Isis::PvlKeyword("NewLeastIncAngle", std::to_string(bestIncidenceAngle[iBestIndex])); istrTemp = toString((int)newPnt->GetMeasure(iBestIndex)->GetSample()); istrTemp += ","; istrTemp += toString((int)newPnt->GetMeasure(iBestIndex)->GetLine()); - pvlRefChangeGrp += Isis::PvlKeyword("NewLocation", istrTemp); + pvlRefChangeGrp += Isis::PvlKeyword("NewLocation", istrTemp.toStdString()); pvlPointObj += pvlRefChangeGrp; } @@ -272,9 +272,9 @@ namespace Isis { }// end Point // CnetRef Change Statistics - mStatisticsGrp += Isis::PvlKeyword("PointsModified", toString(iPointsModified)); - mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", toString(iRefChanged)); - mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", toString(iMeasuresModified)); + mStatisticsGrp += Isis::PvlKeyword("PointsModified", std::to_string(iPointsModified)); + mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", std::to_string(iRefChanged)); + mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", std::to_string(iMeasuresModified)); mPvlLog += mStatisticsGrp; } diff --git a/isis/src/control/apps/cnetref/CnetRefByResolution.cpp b/isis/src/control/apps/cnetref/CnetRefByResolution.cpp index 9ae3418b07..ebc84c487c 100644 --- a/isis/src/control/apps/cnetref/CnetRefByResolution.cpp +++ b/isis/src/control/apps/cnetref/CnetRefByResolution.cpp @@ -81,7 +81,7 @@ namespace Isis { // Logging PvlObject pvlPointObj("PointDetails"); - pvlPointObj += Isis::PvlKeyword("PointId", newPnt->GetId()); + pvlPointObj += Isis::PvlKeyword("PointId", newPnt->GetId().toStdString()); // Edit Lock Option bool bPntEditLock = newPnt->IsEditLocked(); @@ -126,8 +126,8 @@ namespace Isis { // Log PvlGroup pvlMeasureGrp("MeasureDetails"); - pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn); - pvlMeasureGrp += Isis::PvlKeyword("OriginalLocation", LocationString(dSample, dLine)); + pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn.toStdString()); + pvlMeasureGrp += Isis::PvlKeyword("OriginalLocation", LocationString(dSample, dLine).toStdString()); if (bMeasureLocked) pvlMeasureGrp += Isis::PvlKeyword("EditLock", "True"); @@ -145,7 +145,7 @@ namespace Isis { pvlMeasureGrp += Isis::PvlKeyword("UnIgnored", "Failed Validation Test but not Ignored as Measure EditLock is True"); } else { - pvlMeasureGrp += Isis::PvlKeyword("Ignored", "For point [" + newPnt->GetId() + "] and measure [" + sn + + pvlMeasureGrp += Isis::PvlKeyword("Ignored", "For point [" + newPnt->GetId().toStdString() + "] and measure [" + sn.toStdString() + "], point failed to intersect body."); newMsr->SetIgnored(true); iNumIgnore++; @@ -211,25 +211,25 @@ namespace Isis { else { int iComment = 0; if (numMeasures == 0) { - QString sComment = "Comment"; - sComment += QString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "No Measures in the Point"); } if (newPnt->IsIgnored()) { - QString sComment = "Comment"; - sComment += QString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Point was originally Ignored"); } if (newPnt->GetType() == ControlPoint::Fixed) { - QString sComment = "Comment"; - sComment += QString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Fixed Point"); } else if (newPnt->GetType() == ControlPoint::Constrained) { - QString sComment = "Comment"; - sComment += QString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Constrained Point"); } @@ -258,26 +258,26 @@ namespace Isis { PvlGroup pvlRefChangeGrp("ReferenceChangeDetails"); if (iRefIndex >= 0) { pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", - origPnt.GetMeasure(iRefIndex)->GetCubeSerialNumber()); - pvlRefChangeGrp += Isis::PvlKeyword("PrevResolution", toString(mdResVector[iRefIndex])); + origPnt.GetMeasure(iRefIndex)->GetCubeSerialNumber().toStdString()); + pvlRefChangeGrp += Isis::PvlKeyword("PrevResolution", std::to_string(mdResVector[iRefIndex])); istrTemp = QString((int)origPnt.GetMeasure(iRefIndex)->GetSample()); istrTemp += ","; istrTemp += QString((int)origPnt.GetMeasure(iRefIndex)->GetLine()); - pvlRefChangeGrp += Isis::PvlKeyword("PrevLocation", istrTemp); + pvlRefChangeGrp += Isis::PvlKeyword("PrevLocation", istrTemp.toStdString()); } else { pvlRefChangeGrp += Isis::PvlKeyword("PrevReference", "Not Set"); } pvlRefChangeGrp += Isis::PvlKeyword("NewSerialNumber", - newPnt->GetMeasure(iBestIndex)->GetCubeSerialNumber()); + newPnt->GetMeasure(iBestIndex)->GetCubeSerialNumber().toStdString()); QString sKeyName = "NewHighestResolution"; if (meType == Low) { sKeyName = "NewLeastResolution"; } else if (meType == Mean) { - pvlRefChangeGrp += Isis::PvlKeyword("MeanResolution", toString(GetMeanResolution())); + pvlRefChangeGrp += Isis::PvlKeyword("MeanResolution", std::to_string(GetMeanResolution())); sKeyName = "NewResolutionNeartoMean"; } else if (meType == Nearest) { @@ -286,12 +286,12 @@ namespace Isis { else if (meType == Range) { sKeyName = "NewResolutionInRange"; } - pvlRefChangeGrp += Isis::PvlKeyword(sKeyName, toString(mdResVector[iBestIndex])); + pvlRefChangeGrp += Isis::PvlKeyword(sKeyName.toStdString(), std::to_string(mdResVector[iBestIndex])); istrTemp = QString((int)newPnt->GetMeasure(iBestIndex)->GetSample()); istrTemp += ","; istrTemp += QString((int)newPnt->GetMeasure(iBestIndex)->GetLine()); - pvlRefChangeGrp += Isis::PvlKeyword("NewLocation", istrTemp); + pvlRefChangeGrp += Isis::PvlKeyword("NewLocation", istrTemp.toStdString()); pvlPointObj += pvlRefChangeGrp; } @@ -305,9 +305,9 @@ namespace Isis { }// end Point // CnetRef Change Statistics - mStatisticsGrp += Isis::PvlKeyword("PointsModified", toString(iPointsModified)); - mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", toString(iRefChanged)); - mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", toString(iMeasuresModified)); + mStatisticsGrp += Isis::PvlKeyword("PointsModified", std::to_string(iPointsModified)); + mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", std::to_string(iRefChanged)); + mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", std::to_string(iMeasuresModified)); mPvlLog += mStatisticsGrp; } diff --git a/isis/src/control/apps/cnetstats/cnetstats.cpp b/isis/src/control/apps/cnetstats/cnetstats.cpp index 50dbb70966..cfc39e185b 100644 --- a/isis/src/control/apps/cnetstats/cnetstats.cpp +++ b/isis/src/control/apps/cnetstats/cnetstats.cpp @@ -61,7 +61,7 @@ namespace Isis{ if (ui.WasEntered("DEFFILE")) { sDefFile = ui.GetFileName("DEFFILE"); sOutFile = ui.GetFileName("FLATFILE"); - pvlDefFile = Pvl(sDefFile); + pvlDefFile = Pvl(sDefFile.toStdString()); // Log the DefFile - Cannot log Object... only by Group for (int i=0; i const PvlFlatMap &FeatureAlgorithm::variables() const { * @return PvlObject PvlObject containing a description of the algorithm */ template PvlObject FeatureAlgorithm::info(const QString &objname) const { - PvlObject data(objname); + PvlObject data(objname.toStdString()); data.addKeyword(PvlKeyword("CVVersion", CV_VERSION)); - data.addKeyword(PvlKeyword("Name", name())); - data.addKeyword(PvlKeyword("Type", type())); + data.addKeyword(PvlKeyword("Name", name().toStdString())); + data.addKeyword(PvlKeyword("Type", type().toStdString())); PvlKeyword options("Features"); if ( hasDetector() ) { options += "Detector"; } @@ -376,8 +376,8 @@ template PvlObject FeatureAlgorithm::info(const QString &objname) c if ( hasMatcher() ) { options += "Matcher"; } data.addKeyword(options); - data.addKeyword(PvlKeyword("Description", description())); - data.addKeyword(PvlKeyword("CreatedUsing", config())); + data.addKeyword(PvlKeyword("Description", description().toStdString())); + data.addKeyword(PvlKeyword("CreatedUsing", config().toStdString())); QList values = m_variables.values(); PvlGroup parameters("Parameters"); diff --git a/isis/src/control/apps/findfeatures/FeatureInventory.cpp b/isis/src/control/apps/findfeatures/FeatureInventory.cpp index 47d6ef3934..9c0d4849b0 100644 --- a/isis/src/control/apps/findfeatures/FeatureInventory.cpp +++ b/isis/src/control/apps/findfeatures/FeatureInventory.cpp @@ -165,7 +165,7 @@ namespace Isis { PvlObject FeatureInventory::info(const QStringList algorithms, const QString &name) const { - PvlObject algos(name); + PvlObject algos(name.toStdString()); BOOST_FOREACH ( QString algorithmName, algorithms ) { algos += algorithmInfo( algorithmName ); @@ -176,7 +176,7 @@ namespace Isis { PvlObject FeatureInventory::algorithmInfo(const QString algorithmName) const { - PvlObject algorithmObject(algorithmName); + PvlObject algorithmObject(algorithmName.toStdString()); QString lowerName = algorithmName.toLower().trimmed(); try { @@ -196,7 +196,7 @@ namespace Isis { } catch (IException &e) { algorithmObject.clear(); - algorithmObject += PvlKeyword( "Error", e.toString() ); + algorithmObject += PvlKeyword( "Error", e.toString().toStdString() ); } return ( algorithmObject ); @@ -211,14 +211,14 @@ namespace Isis { FeatureCreator creator = m_theFeatureCreator.value(lowerName); QStringList aliasList = m_theFeatureCreator.keys(creator); BOOST_FOREACH ( QString alias, aliasList) { - aliasKey += alias; + aliasKey += alias.toStdString(); } } else if ( m_theMatcherCreator.contains( lowerName ) ) { MatcherCreator creator = m_theMatcherCreator.value(lowerName); QStringList aliasList = m_theMatcherCreator.keys(creator); BOOST_FOREACH ( QString alias, aliasList) { - aliasKey += alias; + aliasKey += alias.toStdString(); } } else { @@ -277,9 +277,9 @@ namespace Isis { BOOST_FOREACH ( QString parm, fromConfig) { QStringList parts = parse(parm, ":"); if ( parts.size() > 0 ) { - PvlKeyword key(parts.takeFirst().trimmed()); + PvlKeyword key(parts.takeFirst().trimmed().toStdString()); BOOST_FOREACH (QString value, parts) { - key.addValue(value); + key.addValue(value.toStdString()); } parms.add(key); } diff --git a/isis/src/control/apps/findfeatures/ImageSource.cpp b/isis/src/control/apps/findfeatures/ImageSource.cpp index 2c78a7f4d0..5c7b042555 100644 --- a/isis/src/control/apps/findfeatures/ImageSource.cpp +++ b/isis/src/control/apps/findfeatures/ImageSource.cpp @@ -92,7 +92,7 @@ bool ImageSource::hasCamera() const { QString ImageSource::getTargetName() const { if ( hasProjection() ) { PvlGroup mapping = m_data->m_projection->Mapping(); - return (mapping["TargetName"][0]); + return QString::fromStdString(mapping["TargetName"][0]); } else if ( hasCamera() ) { return ( m_data->m_camera->targetName() ); diff --git a/isis/src/control/apps/findfeatures/MatchMaker.cpp b/isis/src/control/apps/findfeatures/MatchMaker.cpp index 574bd54899..a2d073653a 100644 --- a/isis/src/control/apps/findfeatures/MatchMaker.cpp +++ b/isis/src/control/apps/findfeatures/MatchMaker.cpp @@ -158,7 +158,7 @@ MatcherSolutionList MatchMaker::match(const RobustMatcherList &matchers) { logger().flush(); } - cnetinfo += PvlKeyword("SolutionSize", toString(solution.size()) ); + cnetinfo += PvlKeyword("SolutionSize", std::to_string(solution.size()) ); if ( solution.size() <= 0 ) { cnetinfo += PvlKeyword("Error", "No matches, no network!!"); return (cnetinfo); @@ -217,12 +217,12 @@ MatcherSolutionList MatchMaker::match(const RobustMatcherList &matchers) { } } - cnetinfo += PvlKeyword("ImagesMatched", toString(nImages) ); - cnetinfo += PvlKeyword("ControlPoints", toString(nPoints) ); - cnetinfo += PvlKeyword("ControlMeasures", toString(nMeasures) ); - cnetinfo += PvlKeyword("InvalidIgnoredPoints", toString(nBadPoints) ); - cnetinfo += PvlKeyword("InvalidIgnoredMeasures", toString(nBadMeasures) ); - cnetinfo += PvlKeyword("PreserveIgnoredControl", toString(preserve_ignored) ); + cnetinfo += PvlKeyword("ImagesMatched", std::to_string(nImages) ); + cnetinfo += PvlKeyword("ControlPoints", std::to_string(nPoints) ); + cnetinfo += PvlKeyword("ControlMeasures", std::to_string(nMeasures) ); + cnetinfo += PvlKeyword("InvalidIgnoredPoints", std::to_string(nBadPoints) ); + cnetinfo += PvlKeyword("InvalidIgnoredMeasures", std::to_string(nBadMeasures) ); + cnetinfo += PvlKeyword("PreserveIgnoredControl", std::to_string(preserve_ignored) ); if ( isDebug() ) { logger() << " Images Matched: " << nImages << "\n"; logger() << " ControlPoints created: " << nPoints << "\n"; @@ -234,7 +234,7 @@ MatcherSolutionList MatchMaker::match(const RobustMatcherList &matchers) { } // Report measure statistics - PvlKeyword mkey = PvlKeyword("ValidPoints", toString(pointStats.ValidPixels()) ); + PvlKeyword mkey = PvlKeyword("ValidPoints", std::to_string(pointStats.ValidPixels()) ); mkey.addComment(" -- Valid Point/Measure Statistics ---"); cnetinfo += mkey; if ( isDebug() ) { @@ -243,11 +243,11 @@ MatcherSolutionList MatchMaker::match(const RobustMatcherList &matchers) { } if ( pointStats.ValidPixels() > 0 ) { - cnetinfo += PvlKeyword("MinimumMeasures", toString(pointStats.Minimum()) ); - cnetinfo += PvlKeyword("MaximumMeasures", toString(pointStats.Maximum()) ); - cnetinfo += PvlKeyword("AverageMeasures", toString(pointStats.Average()) ); - cnetinfo += PvlKeyword("StdDevMeasures", toString(pointStats.StandardDeviation()) ); - cnetinfo += PvlKeyword("TotalMeasures", toString((int) pointStats.Sum()) ); + cnetinfo += PvlKeyword("MinimumMeasures", std::to_string(pointStats.Minimum()) ); + cnetinfo += PvlKeyword("MaximumMeasures", std::to_string(pointStats.Maximum()) ); + cnetinfo += PvlKeyword("AverageMeasures", std::to_string(pointStats.Average()) ); + cnetinfo += PvlKeyword("StdDevMeasures", std::to_string(pointStats.StandardDeviation()) ); + cnetinfo += PvlKeyword("TotalMeasures", std::to_string((int) pointStats.Sum()) ); if ( isDebug() ) { logger() << " MinimumMeasures: " << pointStats.Minimum() << "\n"; logger() << " MaximumMeasures: " << pointStats.Maximum() << "\n"; diff --git a/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp b/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp index f7a3e981b7..f7080efab4 100644 --- a/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp +++ b/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp @@ -172,7 +172,7 @@ namespace Isis { /** Return a PvlObject containing the chain of algorithm information */ PvlObject MatcherAlgorithms::info(const QString &name) const { - PvlObject data(name); + PvlObject data(name.toStdString()); data += m_detector->info("Detector"); data += m_extractor->info("Extractor"); data += m_matcher->info("Matcher"); diff --git a/isis/src/control/apps/findfeatures/RobustMatcher.cpp b/isis/src/control/apps/findfeatures/RobustMatcher.cpp index 0bc6674f2a..d33eceb101 100644 --- a/isis/src/control/apps/findfeatures/RobustMatcher.cpp +++ b/isis/src/control/apps/findfeatures/RobustMatcher.cpp @@ -1104,7 +1104,7 @@ const PvlFlatMap &RobustMatcher::parameters() const { PvlObject RobustMatcher::info(const QString &p_name) const { PvlObject description = MatcherAlgorithms::info(p_name); description.addKeyword(PvlKeyword("OpenCVVersion", CV_VERSION)); - description.addKeyword(PvlKeyword("Name", name())); + description.addKeyword(PvlKeyword("Name", name().toStdString())); // description.addKeyword(PvlKeyword("Specification", name())); PvlObject aparms("Parameters"); diff --git a/isis/src/control/apps/findfeatures/findfeatures.cpp b/isis/src/control/apps/findfeatures/findfeatures.cpp index 115c2a4a18..c76402ee62 100644 --- a/isis/src/control/apps/findfeatures/findfeatures.cpp +++ b/isis/src/control/apps/findfeatures/findfeatures.cpp @@ -72,7 +72,7 @@ using namespace std; namespace Isis { inline PvlGroup pvlmap_to_group( const PvlFlatMap &pvlmap, const QString &grpnam ) { - PvlGroup pgrp( grpnam ); + PvlGroup pgrp(grpnam.toStdString()); for ( auto pkey : pvlmap.values() ) { pgrp.addKeyword( pkey ); } @@ -84,7 +84,7 @@ namespace Isis { if ( !toname.isEmpty() ) { FileName toinfo(toname); QString fname = toinfo.expanded(); - data.write(fname); + data.write(fname.toStdString()); } else { if ( !ui.IsInteractive() ) { @@ -217,7 +217,7 @@ namespace Isis { // Check for parameters file provided by user if ( ui.WasEntered("PARAMETERS") ) { QString pfilename = ui.GetAsString("PARAMETERS"); - Pvl pfile(pfilename); + Pvl pfile(pfilename.toStdString()); PvlFlatMap parms = PvlFlatMap(pfile); parameters.merge( parms ); parameters.add("ParameterFile", pfilename); @@ -445,13 +445,13 @@ namespace Isis { // Got some matches so lets process them Statistics quality = best->qualityStatistics(); PvlGroup bestinfo("MatchSolution"); - bestinfo += PvlKeyword("Matcher", best->matcher()->name()); - bestinfo += PvlKeyword("MatchedPairs", toString(best->size())); - bestinfo += PvlKeyword("ValidPairs", toString(quality.ValidPixels())); - bestinfo += PvlKeyword("Efficiency", toString(quality.Average())); + bestinfo += PvlKeyword("Matcher", best->matcher()->name().toStdString()); + bestinfo += PvlKeyword("MatchedPairs", std::to_string(best->size())); + bestinfo += PvlKeyword("ValidPairs", std::to_string(quality.ValidPixels())); + bestinfo += PvlKeyword("Efficiency", std::to_string(quality.Average())); if ( quality.ValidPixels() > 1 ) { bestinfo += PvlKeyword("StdDevEfficiency", - toString(quality.StandardDeviation())); + std::to_string(quality.StandardDeviation())); } Application::Log(bestinfo); diff --git a/isis/src/control/apps/jigsaw/jigsaw.cpp b/isis/src/control/apps/jigsaw/jigsaw.cpp index 91d906c002..b58c17ebe4 100644 --- a/isis/src/control/apps/jigsaw/jigsaw.cpp +++ b/isis/src/control/apps/jigsaw/jigsaw.cpp @@ -287,7 +287,7 @@ namespace Isis { for (int iobj = 0; iobj < c->label()->objects(); iobj++) { PvlObject obj = c->label()->object(iobj); if (obj.name() != "Table") continue; - if (obj["Name"][0] != QString("CameraStatistics")) continue; + if (obj["Name"][0] != "CameraStatistics") continue; c->label()->deleteObject(iobj); break; } @@ -300,14 +300,14 @@ namespace Isis { c->read(csmStateBlob); std::string modelState = bundleAdjustment->modelState(i).toStdString(); csmStateBlob.setData(modelState.c_str(), modelState.size()); - csmStateBlob.Label().addComment(jigComment); + csmStateBlob.Label().addComment(jigComment.toStdString()); c->write(csmStateBlob); } else { // Write bundle adjustment values to cube Table cmatrix = bundleAdjustment->cMatrix(i); - cmatrix.Label().addComment(jigComment); + cmatrix.Label().addComment(jigComment.toStdString()); Table spvector = bundleAdjustment->spVector(i); - spvector.Label().addComment(jigComment); + spvector.Label().addComment(jigComment.toStdString()); c->write(cmatrix); c->write(spvector); } @@ -433,7 +433,7 @@ namespace Isis { if (ui.GetBoolean("SOLVETARGETBODY") == true) { PvlObject obj; ui.GetFileName("TBPARAMETERS"); - Pvl tbParPvl(FileName(ui.GetFileName("TBPARAMETERS")).expanded()); + Pvl tbParPvl(FileName(ui.GetFileName("TBPARAMETERS")).expanded().toStdString()); if (!tbParPvl.hasObject("Target")) { QString msg = "Input Target parameters file missing main Target object"; throw IException(IException::User, msg, _FILEINFO_); @@ -510,7 +510,7 @@ namespace Isis { if (ui.WasEntered("SCCONFIG")) { PvlObject obj; - Pvl scConfig(FileName(ui.GetFileName("SCCONFIG")).expanded()); + Pvl scConfig(FileName(ui.GetFileName("SCCONFIG")).expanded().toStdString()); // QMap instIDtoBOSS; if (!scConfig.hasObject("SensorParameters")) { QString msg = "Input SCCONFIG file missing SensorParameters object"; diff --git a/isis/src/control/apps/pointreg/pointreg.cpp b/isis/src/control/apps/pointreg/pointreg.cpp index 92f648d7ac..06d6042ec0 100644 --- a/isis/src/control/apps/pointreg/pointreg.cpp +++ b/isis/src/control/apps/pointreg/pointreg.cpp @@ -248,7 +248,7 @@ namespace Isis { outNet.SetUserName(Application::UserName()); // Create an AutoReg from the template file - Pvl pvl(ui.GetFileName("DEFFILE")); + Pvl pvl(ui.GetFileName("DEFFILE").toStdString()); ar = AutoRegFactory::Create(pvl); Progress progress; @@ -467,15 +467,15 @@ namespace Isis { } PvlGroup pLog("Points"); - pLog += PvlKeyword("Total", toString(outNet.GetNumPoints())); - pLog += PvlKeyword("Ignored", toString(ignored)); + pLog += PvlKeyword("Total", std::to_string(outNet.GetNumPoints())); + pLog += PvlKeyword("Ignored", std::to_string(ignored)); Application::AppendAndLog(pLog, appLog); PvlGroup mLog("Measures"); - mLog += PvlKeyword("Locked", toString(locked)); - mLog += PvlKeyword("Registered", toString(registered)); - mLog += PvlKeyword("NotIntersected", toString(notintersected)); - mLog += PvlKeyword("Unregistered", toString(unregistered)); + mLog += PvlKeyword("Locked", std::to_string(locked)); + mLog += PvlKeyword("Registered", std::to_string(registered)); + mLog += PvlKeyword("NotIntersected", std::to_string(notintersected)); + mLog += PvlKeyword("Unregistered", std::to_string(unregistered)); Application::AppendAndLog(mLog, appLog); // Log Registration Statistics @@ -835,7 +835,7 @@ namespace Isis { // Get template pvl Pvl userTemp; - userTemp.read(ui.GetFileName("DEFFILE")); + userTemp.read(ui.GetFileName("DEFFILE").toStdString()); //Write template file out to the log Isis::Application::GuiLog(userTemp); diff --git a/isis/src/control/apps/sumspice/SumFile.cpp b/isis/src/control/apps/sumspice/SumFile.cpp index 8619d3a512..3b5396e888 100644 --- a/isis/src/control/apps/sumspice/SumFile.cpp +++ b/isis/src/control/apps/sumspice/SumFile.cpp @@ -179,8 +179,8 @@ namespace Isis { // Put a comment in the record QString message = "Updated pointing with SUMFILE " + name() + " on " + iTime::CurrentLocalTime(); - PvlKeyword sumFileKeyword("SUMFILE", name()); - sumFileKeyword.addComment(message); + PvlKeyword sumFileKeyword("SUMFILE", name().toStdString()); + sumFileKeyword.addComment(message.toStdString()); table.Label().addKeyword(sumFileKeyword, PvlContainer::Replace); table.Update(rec0, 0); @@ -243,8 +243,8 @@ namespace Isis { // Put a comment in the record QString message = "Updated position with SUMFILE " + name() + " on " + iTime::CurrentLocalTime(); - PvlKeyword sumFileKeyword("SUMFILE", name()); - sumFileKeyword.addComment(message); + PvlKeyword sumFileKeyword("SUMFILE", name().toStdString()); + sumFileKeyword.addComment(message.toStdString()); table.Label().addKeyword(sumFileKeyword, PvlContainer::Replace); table.Update(rec0, 0); diff --git a/isis/src/control/apps/sumspice/SumFinder.cpp b/isis/src/control/apps/sumspice/SumFinder.cpp index a550e71e52..6242328a11 100644 --- a/isis/src/control/apps/sumspice/SumFinder.cpp +++ b/isis/src/control/apps/sumspice/SumFinder.cpp @@ -305,7 +305,7 @@ namespace Isis { startTime = centerTime - (exposureTime / 2.0 ); if ( instGrp.hasKeyword("SpacecraftClockStartCount") ) { PvlKeyword startSClock = instGrp["SpacecraftClockStartCount"]; - QString originalClock = startSClock[0]; + QString originalClock = QString::fromStdString(startSClock[0]); startTime = cube.camera()->getClockTime(originalClock) + exposureDelay; } @@ -313,7 +313,7 @@ namespace Isis { stopTime = centerTime + (exposureTime / 2.0); if ( instGrp.hasKeyword("SpacecraftClockStopCount") ) { PvlKeyword stopSClock = instGrp["SpacecraftClockStopCount"]; - QString originalClock = stopSClock[0]; + QString originalClock = QString::fromStdString(stopSClock[0]); try { stopTime = cube.camera()->getClockTime(originalClock) - stopDelay; } @@ -340,8 +340,8 @@ namespace Isis { Pvl *cubeLabels = cube.label(); PvlGroup &instGrp = cubeLabels->findGroup("Instrument", Pvl::Traverse); PvlKeyword exptime = instGrp["ExposureDuration"]; - QString units = exptime.unit(0).toLower(); - double etime = toDouble(exptime[0]); + QString units = QString::fromStdString(exptime.unit(0)).toLower(); + double etime = std::stod(exptime[0]); // Convert to seconds if indicated if ( "milliseconds" == units) etime /= 1000.0; @@ -416,10 +416,10 @@ namespace Isis { Pvl *cubeLabel = cube.label(); PvlGroup &instGrp = cubeLabel->findGroup("Instrument", Pvl::Traverse); - QString scname = instGrp["SpacecraftName"]; + QString scname = QString::fromStdString(instGrp["SpacecraftName"]); if ( scname.toLower() != "dawn" ) { return (0.0); } - QString instname = instGrp["InstrumentId"]; + QString instname = QString::fromStdString(instGrp["InstrumentId"]); if ( instname.toLower() == "fc1") { return (0.193); } if ( instname.toLower() == "fc2") { return (0.193); } @@ -499,7 +499,7 @@ namespace Isis { sumtFileKeyword.addComment("SUMFILE(s) used to update the SCLK timing " "in the instrument group (SPC)."); } - sumtFileKeyword.addValue(m_sumfile->name()); + sumtFileKeyword.addValue(m_sumfile->name().toStdString()); setKeyword(sumtFileKeyword, sumtGrp); // Compute new values for existing keywords if we got them @@ -517,7 +517,7 @@ namespace Isis { NaifStatus::CheckErrors(); sumtStartClock.addValue(origStartClock[0], origStartClock.unit()); - origStartClock.setValue(QString(newSCLK), origStartClock.unit()); + origStartClock.setValue(QString(newSCLK).toStdString(), origStartClock.unit()); setKeyword(origStartClock, instGrp); setKeyword(sumtStartClock, sumtGrp); @@ -533,7 +533,7 @@ namespace Isis { NaifStatus::CheckErrors(); sumtStopClock.addValue(origStopClock[0], origStopClock.unit()); - origStopClock.setValue(QString(newSCLK), origStopClock.unit()); + origStopClock.setValue(QString(newSCLK).toStdString(), origStopClock.unit()); setKeyword(origStopClock, instGrp); setKeyword(sumtStopClock, sumtGrp); @@ -543,7 +543,7 @@ namespace Isis { // Now check for StartTime if ( origStartTime.size() > 0 ) { sumtStartTime.addValue(origStartTime[0], origStartTime.unit()); - origStartTime.setValue(newStartClock.UTC(), origStartTime.unit()); + origStartTime.setValue(newStartClock.UTC().toStdString(), origStartTime.unit()); setKeyword(origStartTime, instGrp); setKeyword(sumtStartTime, sumtGrp); @@ -552,7 +552,7 @@ namespace Isis { // Now check for StopTime if ( origStopTime.size() > 0 ) { sumtStopTime.addValue(origStopTime[0], origStopTime.unit()); - origStopTime.setValue(newStopClock.UTC(), origStopTime.unit()); + origStopTime.setValue(newStopClock.UTC().toStdString(), origStopTime.unit()); setKeyword(origStopTime, instGrp); setKeyword(sumtStopTime, sumtGrp); @@ -634,11 +634,11 @@ namespace Isis { PvlKeyword SumFinder::findKeyword(const QString &name, const PvlContainer &keys) const { - if ( keys.hasKeyword(name) ) { - return ( keys.findKeyword(name) ); + if ( keys.hasKeyword(name.toStdString()) ) { + return ( keys.findKeyword(name.toStdString()) ); } - return (PvlKeyword(name)); + return (PvlKeyword(name.toStdString())); } @@ -650,8 +650,8 @@ namespace Isis { bool SumFinder::deleteKeyword(const QString &keyword, PvlContainer &keys) const { - if ( keys.hasKeyword(keyword) ) { - keys.deleteKeyword(keyword); + if ( keys.hasKeyword(keyword.toStdString()) ) { + keys.deleteKeyword(keyword.toStdString()); return ( true ); } diff --git a/isis/src/control/apps/sumspice/sumspice.cpp b/isis/src/control/apps/sumspice/sumspice.cpp index 023e6e5911..7093e09080 100644 --- a/isis/src/control/apps/sumspice/sumspice.cpp +++ b/isis/src/control/apps/sumspice/sumspice.cpp @@ -114,8 +114,8 @@ namespace Isis { for (int sumIndex = 1; sumIndex < sumFiles.size(); sumIndex++) { double tdiff = fabs(sumFiles[sumIndex]->et() - sumFiles[sumIndex-1]->et()); if ( qFuzzyCompare( tdiff+1.0, 0.0+1.0) ) { - PvlKeyword filePair("SumFilesWithDuplicateTimes", sumFiles[sumIndex-1]->name()); - filePair.addValue(sumFiles[sumIndex]->name()); + PvlKeyword filePair("SumFilesWithDuplicateTimes", sumFiles[sumIndex-1]->name().toStdString()); + filePair.addValue(sumFiles[sumIndex]->name().toStdString()); duplicates += filePair; } } @@ -190,7 +190,7 @@ namespace Isis { if (warnings.size() > 0) { PvlKeyword message("Unmatched"); BOOST_FOREACH ( QString mess, warnings ) { - message.addValue(mess); + message.addValue(mess.toStdString()); } PvlGroup loggrp("Warnings"); loggrp.addKeyword(message); diff --git a/isis/src/control/apps/warp/WarpTransform.cpp b/isis/src/control/apps/warp/WarpTransform.cpp index ee8b64cf4d..555042ba47 100644 --- a/isis/src/control/apps/warp/WarpTransform.cpp +++ b/isis/src/control/apps/warp/WarpTransform.cpp @@ -147,9 +147,9 @@ namespace Isis { PvlGroup WarpTransform::Residuals() { PvlGroup errs("Residuals"); for (int i = 0; i < p_lsqInputLine->Knowns(); i++) { - PvlKeyword p("POINT" + toString(i + 1)); - p += toString(p_lsqInputLine->Residual(i)); - p += toString(p_lsqInputSamp->Residual(i)); + PvlKeyword p("POINT" + std::to_string (i + 1)); + p += std::to_string (p_lsqInputLine->Residual(i)); + p += std::to_string (p_lsqInputSamp->Residual(i)); errs += p; } return errs; diff --git a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp index defc1886f5..03811cf980 100644 --- a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp +++ b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp @@ -81,11 +81,11 @@ namespace Isis { errlog = "SPARSE: "; errlog += message; - PvlGroup gp(errlog); + PvlGroup gp(errlog.toStdString()); gp += PvlKeyword("File",file); - gp += PvlKeyword("Line_Number", toString(nLineNo)); - gp += PvlKeyword("Status", toString(nStatus)); + gp += PvlKeyword("Line_Number", std::to_string(nLineNo)); + gp += PvlKeyword("Status", std::to_string(nStatus)); // Application::Log(gp); @@ -1821,9 +1821,9 @@ namespace Isis { // check for "matrix not positive definite" error if (m_cholmodCommon.status == CHOLMOD_NOT_POSDEF) { - QString msg = "Matrix NOT positive-definite: failure at column " + toString((int) m_L->minor); + std::string msg = "Matrix NOT positive-definite: failure at column " + std::to_string((int) m_L->minor); // throw IException(IException::User, msg, _FILEINFO_); - error(msg); + error(QString::fromStdString(msg)); emit(finished()); return false; } @@ -2974,7 +2974,7 @@ namespace Isis { QString BundleAdjust::modelState(int i) { Camera *imageCam = m_controlNet->Camera(i); if (imageCam->GetCameraType() != Camera::Csm) { - QString msg = "Cannot get model state for image [" + toString(i) + + std::string msg = "Cannot get model state for image [" + std::to_string(i) + "] because it is not a CSM camera model."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -3002,49 +3002,49 @@ namespace Isis { iterationNumber = "Iteration" + toString(m_iteration); } - PvlGroup summaryGroup(iterationNumber); + PvlGroup summaryGroup(iterationNumber.toStdString()); summaryGroup += PvlKeyword("Sigma0", - toString( m_bundleResults.sigma0() ) ); + std::to_string( m_bundleResults.sigma0() ) ); summaryGroup += PvlKeyword("Observations", - toString( m_bundleResults.numberObservations() ) ); + std::to_string( m_bundleResults.numberObservations() ) ); summaryGroup += PvlKeyword("Constrained_Point_Parameters", - toString( m_bundleResults.numberConstrainedPointParameters() ) ); + std::to_string( m_bundleResults.numberConstrainedPointParameters() ) ); summaryGroup += PvlKeyword("Constrained_Image_Parameters", - toString( m_bundleResults.numberConstrainedImageParameters() ) ); + std::to_string( m_bundleResults.numberConstrainedImageParameters() ) ); if (m_bundleSettings->bundleTargetBody()) { summaryGroup += PvlKeyword("Constrained_Target_Parameters", - toString( m_bundleResults.numberConstrainedTargetParameters() ) ); + std::to_string( m_bundleResults.numberConstrainedTargetParameters() ) ); } summaryGroup += PvlKeyword("Unknown_Parameters", - toString( m_bundleResults.numberUnknownParameters() ) ); + std::to_string( m_bundleResults.numberUnknownParameters() ) ); summaryGroup += PvlKeyword("Degrees_of_Freedom", - toString( m_bundleResults.degreesOfFreedom() ) ); + std::to_string( m_bundleResults.degreesOfFreedom() ) ); summaryGroup += PvlKeyword( "Rejected_Measures", - toString( m_bundleResults.numberRejectedObservations()/2) ); + std::to_string( m_bundleResults.numberRejectedObservations()/2) ); if ( m_bundleResults.numberMaximumLikelihoodModels() > m_bundleResults.maximumLikelihoodModelIndex() ) { // if maximum likelihood estimation is being used summaryGroup += PvlKeyword("Maximum_Likelihood_Tier: ", - toString( m_bundleResults.maximumLikelihoodModelIndex() ) ); + std::to_string( m_bundleResults.maximumLikelihoodModelIndex() ) ); summaryGroup += PvlKeyword("Median_of_R^2_residuals: ", - toString( m_bundleResults.maximumLikelihoodMedianR2Residuals() ) ); + std::to_string( m_bundleResults.maximumLikelihoodMedianR2Residuals() ) ); } if ( m_bundleResults.converged() ) { summaryGroup += PvlKeyword("Converged", "TRUE"); - summaryGroup += PvlKeyword("TotalElapsedTime", toString( m_bundleResults.elapsedTime() ) ); + summaryGroup += PvlKeyword("TotalElapsedTime", std::to_string( m_bundleResults.elapsedTime() ) ); if (m_bundleSettings->errorPropagation()) { summaryGroup += PvlKeyword("ErrorPropagationElapsedTime", - toString( m_bundleResults.elapsedTimeErrorProp() ) ); + std::to_string( m_bundleResults.elapsedTimeErrorProp() ) ); } } else { summaryGroup += PvlKeyword("Elapsed_Time", - toString( m_iterationTime ) ); + std::to_string( m_iterationTime ) ); } std::ostringstream ostr; diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp index 9e7cd768ce..8d3beb2bed 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp @@ -55,7 +55,7 @@ namespace Isis { initialize(); // group name must be instrument id - m_instrumentId = (QString)scParameterGroup.nameKeyword(); + m_instrumentId = QString::fromStdString(scParameterGroup.nameKeyword()); // If CKDEGREE is not specified, then a default of 2 is used if (scParameterGroup.hasKeyword("CKDEGREE")) { @@ -70,7 +70,7 @@ namespace Isis { // do we solve for No pointing, ANGLES only, ANGLES+ANGULAR VELOCITY, ANGLES+ANGULAR VELOCITY+ // ANGULAR ACCELERATION, or a higher order polynomial QString csolve = "NONE"; - csolve = (QString)scParameterGroup.findKeyword("CAMSOLVE"); + csolve = QString::fromStdString(scParameterGroup.findKeyword("CAMSOLVE")); csolve = csolve.toUpper(); if (csolve == "NONE") { m_instrumentPointingSolveOption = NoPointingFactors; @@ -95,7 +95,7 @@ namespace Isis { // If OVEREXISTING is not specified, then a default of NO is used if (scParameterGroup.hasKeyword("OVEREXISTING")) { - QString parval = (QString)scParameterGroup.findKeyword("OVEREXISTING"); + QString parval = QString::fromStdString(scParameterGroup.findKeyword("OVEREXISTING")); parval = parval.toUpper(); if (parval == "TRUE" || parval == "YES") { m_solvePointingPolynomialOverExisting = true; @@ -122,7 +122,7 @@ namespace Isis { // do we solve for No position, POSITION only, POSITION+VELOCITY, POSITION+VELOCITY+ // ACCELERATION, or a higher order polynomial QString ssolve = "NONE"; - ssolve = (QString)scParameterGroup.findKeyword("SPSOLVE"); + ssolve = QString::fromStdString(scParameterGroup.findKeyword("SPSOLVE")); ssolve = ssolve.toUpper(); if (ssolve == "NONE") { m_instrumentPositionSolveOption = NoPositionFactors; @@ -147,7 +147,7 @@ namespace Isis { // If TWIST is not specified, then a default of YES is used if (scParameterGroup.hasKeyword("TWIST")) { - QString parval = (QString)scParameterGroup.findKeyword("TWIST"); + QString parval = QString::fromStdString(scParameterGroup.findKeyword("TWIST")); parval = parval.toUpper(); if (parval == "TRUE" || parval == "YES") { // is this necessary ??? i think pvl and toString can handle it... m_solveTwist = true; @@ -162,7 +162,7 @@ namespace Isis { } // If OVERHERMITE is not specified, then a default of NO is used if (scParameterGroup.hasKeyword("OVERHERMITE")) { - QString parval = (QString)scParameterGroup.findKeyword("OVERHERMITE"); + QString parval = QString::fromStdString(scParameterGroup.findKeyword("OVERHERMITE")); parval = parval.toUpper(); if (parval == "TRUE" || parval == "YES") { m_solvePositionOverHermiteSpline = true; @@ -202,7 +202,7 @@ namespace Isis { if (scParameterGroup.hasKeyword("ADDITIONAL_CAMERA_POINTING_SIGMAS")) { PvlKeyword additionalSigmas = scParameterGroup.findKeyword("ADDITIONAL_CAMERA_POINTING_SIGMAS"); for (int i = 0; i < additionalSigmas.size(); i++ ) { - m_anglesAprioriSigma.append(toDouble(additionalSigmas[i])); + m_anglesAprioriSigma.append(std::stod(additionalSigmas[i])); } } } @@ -229,23 +229,23 @@ namespace Isis { if (scParameterGroup.hasKeyword("ADDITIONAL_SPACECRAFT_POSITION_SIGMAS")) { PvlKeyword additionalSigmas = scParameterGroup.findKeyword("ADDITIONAL_SPACECRAFT_POSITION_SIGMAS"); for (int i = 0; i < additionalSigmas.size(); i++ ) { - m_positionAprioriSigma.append(toDouble(additionalSigmas[i])); + m_positionAprioriSigma.append(std::stod(additionalSigmas[i])); } } } // CSM settings if (scParameterGroup.hasKeyword("CSMSOLVESET")) { - setCSMSolveSet(stringToCSMSolveSet(scParameterGroup.findKeyword("CSMSOLVESET"))); + setCSMSolveSet(stringToCSMSolveSet(QString::fromStdString(scParameterGroup.findKeyword("CSMSOLVESET")))); } else if (scParameterGroup.hasKeyword("CSMSOLVETYPE")) { - setCSMSolveType(stringToCSMSolveType(scParameterGroup.findKeyword("CSMSOLVETYPE"))); + setCSMSolveType(stringToCSMSolveType(QString::fromStdString(scParameterGroup.findKeyword("CSMSOLVETYPE")))); } else if (scParameterGroup.hasKeyword("CSMSOLVELIST")) { PvlKeyword csmSolveListKey = scParameterGroup.findKeyword("CSMSOLVELIST"); QStringList csmSolveList; for (int i = 0; i < csmSolveListKey.size(); i++) { - csmSolveList.append(csmSolveListKey[i]); + csmSolveList.append(QString::fromStdString(csmSolveListKey[i])); } setCSMSolveParameterList(csmSolveList); } diff --git a/isis/src/control/objs/BundleUtilities/BundleTargetBody.cpp b/isis/src/control/objs/BundleUtilities/BundleTargetBody.cpp index a575b18fcc..18b5891723 100644 --- a/isis/src/control/objs/BundleUtilities/BundleTargetBody.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleTargetBody.cpp @@ -1193,7 +1193,7 @@ namespace Isis { for (g = tbObject.beginGroup(); g != tbObject.endGroup(); ++g) { if (g->hasKeyword("Ra")) { try { - str = g->findKeyword("Ra")[0]; + str = QString::fromStdString(g->findKeyword("Ra")[0]); } catch (IException &e) { QString msg = "Ra must be given as none, position, velocity, or acceleration"; @@ -1215,7 +1215,7 @@ namespace Isis { if (g->hasKeyword("Dec")) { try { - str = g->findKeyword("Dec")[0]; + str = QString::fromStdString(g->findKeyword("Dec")[0]); } catch (IException &e) { QString msg = "Dec must be given as none, position, velocity, or acceleration"; @@ -1237,7 +1237,7 @@ namespace Isis { if (g->hasKeyword("Pm")) { try { - str = g->findKeyword("Pm")[0]; + str = QString::fromStdString(g->findKeyword("Pm")[0]); } catch (IException &e) { QString msg = "Pm must be given as none, position, velocity, or acceleration"; @@ -1259,7 +1259,7 @@ namespace Isis { if (g->hasKeyword("RadiiSolveOption")) { try { - str = g->findKeyword("RadiiSolveOption")[0]; + str = QString::fromStdString(g->findKeyword("RadiiSolveOption")[0]); } catch (IException &e) { QString msg = "RadiiSolveOption must be given as none, triaxial, or mean"; diff --git a/isis/src/control/objs/ControlMeasureLogData/ControlMeasureLogData.cpp b/isis/src/control/objs/ControlMeasureLogData/ControlMeasureLogData.cpp index d34e6dbf1e..4fd79a3a78 100644 --- a/isis/src/control/objs/ControlMeasureLogData/ControlMeasureLogData.cpp +++ b/isis/src/control/objs/ControlMeasureLogData/ControlMeasureLogData.cpp @@ -57,10 +57,10 @@ namespace Isis { ControlMeasureLogData::ControlMeasureLogData(PvlKeyword keywordRep) { Init(); - QString name = keywordRep.name(); + QString name = QString::fromStdString(keywordRep.name()); p_dataType = NameToDataType(name); if (p_dataType != InvalidNumericLogDataType) - p_numericalValue = toDouble(keywordRep[0]); + p_numericalValue = std::stod(keywordRep[0]); } /** @@ -165,7 +165,7 @@ namespace Isis { */ PvlKeyword ControlMeasureLogData::ToKeyword() const { if(IsValid()) - return PvlKeyword(DataTypeToName(p_dataType), toString(p_numericalValue)); + return PvlKeyword(DataTypeToName(p_dataType).toStdString(), std::to_string(p_numericalValue)); else return PvlKeyword(); } @@ -235,7 +235,7 @@ namespace Isis { return "Obsolete_AverageResidual"; } - QString msg = "Unknown data type [" + toString(type) + "]"; + std::string msg = "Unknown data type [" + std::to_string(type) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/control/objs/ControlNet/ControlNet.cpp b/isis/src/control/objs/ControlNet/ControlNet.cpp index b25bcf0b4b..8d0e84b544 100644 --- a/isis/src/control/objs/ControlNet/ControlNet.cpp +++ b/isis/src/control/objs/ControlNet/ControlNet.cpp @@ -320,7 +320,7 @@ namespace Isis { } try { - network.write(ptfile); + network.write(ptfile.toStdString()); } catch (IException &e) { QString msg = "Failed writing control network to file [" + ptfile + "]"; @@ -1717,12 +1717,12 @@ namespace Isis { } if (mapping.hasKeyword("TargetName")) { - p_targetName = mapping["TargetName"][0]; + p_targetName = QString::fromStdString(mapping["TargetName"][0]); } else if (label.hasObject("IsisCube") && label.findObject("IsisCube").hasGroup("Instrument") && label.findObject("IsisCube").findGroup("Instrument").hasKeyword("TargetName")) { - p_targetName = label.findObject("IsisCube").findGroup("Instrument").findKeyword("TargetName")[0]; + p_targetName = QString::fromStdString(label.findObject("IsisCube").findGroup("Instrument").findKeyword("TargetName")[0]); } else { p_targetName = ""; diff --git a/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp b/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp index eaed9a9e8c..63167c87fb 100644 --- a/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp +++ b/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp @@ -67,14 +67,14 @@ namespace Isis { if (diffFile.hasGroup("Tolerances")) { PvlGroup tolerances = diffFile.findGroup("Tolerances"); for (int i = 0; i < tolerances.keywords(); i++) - m_tolerances->insert(tolerances[i].name(), - toDouble(tolerances[i][0])); + m_tolerances->insert(QString::fromStdString(tolerances[i].name()), + std::stod(tolerances[i][0])); } if (diffFile.hasGroup("IgnoreKeys")) { PvlGroup ignoreKeys = diffFile.findGroup("IgnoreKeys"); for (int i = 0; i < ignoreKeys.keywords(); i++) - m_ignoreKeys->insert(ignoreKeys[i].name()); + m_ignoreKeys->insert(QString::fromStdString(ignoreKeys[i].name())); } } @@ -113,13 +113,13 @@ namespace Isis { for (int p = 0; p < net1NumPts; p++) { PvlObject &point = net1Obj.object(p); - pointMap[point.findKeyword("PointId")[0]].insert( + pointMap[QString::fromStdString(point.findKeyword("PointId")[0])].insert( 0, point); } for (int p = 0; p < net2NumPts; p++) { PvlObject &point = net2Obj.object(p); - pointMap[point.findKeyword("PointId")[0]].insert( + pointMap[QString::fromStdString(point.findKeyword("PointId")[0])].insert( 1, point); } @@ -131,10 +131,10 @@ namespace Isis { compare(idMap[0], idMap[1], report); } else if (idMap.contains(0)) { - addUniquePoint("PointId", idMap[0].findKeyword("PointId")[0], "N/A", report); + addUniquePoint("PointId", QString::fromStdString(idMap[0].findKeyword("PointId")[0]), "N/A", report); } else if (idMap.contains(1)) { - addUniquePoint("PointId", "N/A", idMap[1].findKeyword("PointId")[0], report); + addUniquePoint("PointId", "N/A", QString::fromStdString(idMap[1].findKeyword("PointId")[0]), report); } } @@ -155,8 +155,8 @@ namespace Isis { void ControlNetDiff::compare(PvlObject &point1Pvl, PvlObject &point2Pvl, PvlObject &report) { PvlObject pointReport("Point"); - QString id1 = point1Pvl.findKeyword("PointId")[0]; - QString id2 = point2Pvl.findKeyword("PointId")[0]; + QString id1 = QString::fromStdString(point1Pvl.findKeyword("PointId")[0]); + QString id2 = QString::fromStdString(point2Pvl.findKeyword("PointId")[0]); pointReport.addKeyword(makeKeyword("PointId", id1, id2)); int p1Measures = point1Pvl.groups(); @@ -168,13 +168,13 @@ namespace Isis { QMap< QString, QMap > measureMap; for (int m = 0; m < p1Measures; m++) { PvlGroup &measure = point1Pvl.group(m); - measureMap[measure.findKeyword("SerialNumber")[0]].insert( + measureMap[QString::fromStdString(measure.findKeyword("SerialNumber")[0])].insert( 0, measure); } for (int m = 0; m < p2Measures; m++) { PvlGroup &measure = point2Pvl.group(m); - measureMap[measure.findKeyword("SerialNumber")[0]].insert( + measureMap[QString::fromStdString(measure.findKeyword("SerialNumber")[0])].insert( 1, measure); } @@ -185,10 +185,10 @@ namespace Isis { compareGroups(idMap[0], idMap[1], pointReport); } else if (idMap.contains(0)) { - addUniqueMeasure("SerialNumber", idMap[0].findKeyword("SerialNumber")[0], "N/A", pointReport); + addUniqueMeasure("SerialNumber", QString::fromStdString(idMap[0].findKeyword("SerialNumber")[0]), "N/A", pointReport); } else if (idMap.contains(1)) { - addUniqueMeasure("SerialNumber", "N/A", idMap[1].findKeyword("SerialNumber")[0], pointReport); + addUniqueMeasure("SerialNumber", "N/A", QString::fromStdString(idMap[1].findKeyword("SerialNumber")[0]), pointReport); } } @@ -212,8 +212,8 @@ namespace Isis { void ControlNetDiff::compareGroups(PvlContainer &g1, PvlContainer &g2, PvlObject &report) { PvlGroup measureReport("Measure"); if (g1.hasKeyword("SerialNumber")) { - QString sn1 = g1.findKeyword("SerialNumber")[0]; - QString sn2 = g1.findKeyword("SerialNumber")[0]; + QString sn1 = QString::fromStdString(g1.findKeyword("SerialNumber")[0]); + QString sn2 = QString::fromStdString(g1.findKeyword("SerialNumber")[0]); measureReport.addKeyword(makeKeyword("SerialNumber", sn1, sn2)); } PvlContainer &groupReport = g1.hasKeyword("SerialNumber") ? @@ -221,9 +221,9 @@ namespace Isis { QMap< QString, QMap > keywordMap; for (int k = 0; k < g1.keywords(); k++) - keywordMap[g1[k].name()].insert(0, g1[k]); + keywordMap[QString::fromStdString(g1[k].name())].insert(0, g1[k]); for (int k = 0; k < g2.keywords(); k++) - keywordMap[g2[k].name()].insert(1, g2[k]); + keywordMap[QString::fromStdString(g2[k].name())].insert(1, g2[k]); QList keywordNames = keywordMap.keys(); for (int i = 0; i < keywordNames.size(); i++) { @@ -232,14 +232,14 @@ namespace Isis { compare(idMap[0], idMap[1], groupReport); } else if (idMap.contains(0)) { - QString name = idMap[0].name(); + QString name = QString::fromStdString(idMap[0].name()); if (!m_ignoreKeys->contains(name)) - diff(name, idMap[0][0], "N/A", groupReport); + diff(name, QString::fromStdString(idMap[0][0]), "N/A", groupReport); } else if (idMap.contains(1)) { - QString name = idMap[1].name(); + QString name = QString::fromStdString(idMap[1].name()); if (!m_ignoreKeys->contains(name)) - diff(name, "N/A", idMap[1][0], groupReport); + diff(name, "N/A", QString::fromStdString(idMap[1][0]), groupReport); } } @@ -262,11 +262,11 @@ namespace Isis { * keywords */ void ControlNetDiff::compare(PvlKeyword &k1, PvlKeyword &k2, PvlContainer &report) { - QString name = k1.name(); + QString name = QString::fromStdString(k1.name()); if (m_tolerances->contains(name)) - diff(name, toDouble(k1[0]), toDouble(k2[0]), (*m_tolerances)[name], report); + diff(name, std::stod(k1[0]), std::stod(k2[0]), (*m_tolerances)[name], report); else - diff(name, k1[0], k2[0], report); + diff(name, QString::fromStdString(k1[0]), QString::fromStdString(k2[0]), report); } @@ -281,8 +281,8 @@ namespace Isis { * the keyword with the given name */ void ControlNetDiff::diff(QString name, PvlObject &o1, PvlObject &o2, PvlContainer &report) { - QString v1 = o1[name][0]; - QString v2 = o2[name][0]; + QString v1 = QString::fromStdString(o1[name.toStdString()][0]); + QString v2 = QString::fromStdString(o2[name.toStdString()][0]); diff(name, v1, v2, report); } @@ -315,9 +315,9 @@ namespace Isis { * @return PvlKeyword Container for the two values */ PvlKeyword ControlNetDiff::makeKeyword(QString name, QString v1, QString v2) { - PvlKeyword keyword(name); - keyword.addValue(v1); - if (v1 != v2) keyword.addValue(v2); + PvlKeyword keyword(name.toStdString()); + keyword.addValue(v1.toStdString()); + if (v1 != v2) keyword.addValue(v2.toStdString()); return keyword; } @@ -354,11 +354,11 @@ namespace Isis { * @return PvlKeyword Container for the two values */ PvlKeyword ControlNetDiff::makeKeyword(QString name, double v1, double v2, double tol) { - PvlKeyword keyword(name); - keyword.addValue(toString(v1)); + PvlKeyword keyword(name.toStdString()); + keyword.addValue(std::to_string(v1)); if (fabs(v1 - v2) > tol) { - keyword.addValue(toString(v2)); - keyword.addValue(toString(tol)); + keyword.addValue(std::to_string(v2)); + keyword.addValue(std::to_string(tol)); } return keyword; } @@ -376,9 +376,9 @@ namespace Isis { void ControlNetDiff::addUniquePoint(QString label, QString v1, QString v2, PvlObject &parent) { PvlObject point("Point"); - PvlKeyword keyword(label); - keyword.addValue(v1); - keyword.addValue(v2); + PvlKeyword keyword(label.toStdString()); + keyword.addValue(v1.toStdString()); + keyword.addValue(v2.toStdString()); point.addKeyword(keyword); parent.addObject(point); @@ -398,9 +398,9 @@ namespace Isis { void ControlNetDiff::addUniqueMeasure(QString label, QString v1, QString v2, PvlObject &parent) { PvlGroup measure("Measure"); - PvlKeyword keyword(label); - keyword.addValue(v1); - keyword.addValue(v2); + PvlKeyword keyword(label.toStdString()); + keyword.addValue(v1.toStdString()); + keyword.addValue(v2.toStdString()); measure.addKeyword(keyword); parent.addGroup(measure); diff --git a/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp b/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp index dd06bb7a2c..958428daf3 100644 --- a/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp +++ b/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp @@ -259,11 +259,11 @@ namespace Isis { int iGreater = 0; if (pvlGrp.hasKeyword("LessThan")) { - iLesser = toInt(pvlGrp["LessThan"][0]); + iLesser = std::stoi(pvlGrp["LessThan"][0]); } if (pvlGrp.hasKeyword("GreaterThan")) { - iGreater = toInt(pvlGrp["GreaterThan"][0]); + iGreater = std::stoi(pvlGrp["GreaterThan"][0]); } if (iLesser < 0 || iGreater < 0 || iLesser < iGreater) { @@ -443,7 +443,7 @@ namespace Isis { * @param pbLastFilter - Flag to indicate whether this is the last filter to print the stats */ void ControlNetFilter::PointIDFilter(const PvlGroup &pvlGrp, bool pbLastFilter) { - QString sPointIDExpr = pvlGrp["Expression"][0]; + QString sPointIDExpr = QString::fromStdString(pvlGrp["Expression"][0]); QString sSeparator("*"); QStringList strTokens = sPointIDExpr.split(sSeparator, Qt::SkipEmptyParts); @@ -501,13 +501,13 @@ namespace Isis { if (pvlGrp.hasKeyword("LessThan")) { if (pvlGrp["LessThan"][0] != "") { - iLesser = toInt(pvlGrp["LessThan"][0]); + iLesser = std::stoi(pvlGrp["LessThan"][0]); } } if (pvlGrp.hasKeyword("GreaterThan")) { if (pvlGrp["GreaterThan"][0] != "") { - iGreater = toInt(pvlGrp["GreaterThan"][0]); + iGreater = std::stoi(pvlGrp["GreaterThan"][0]); } } @@ -736,7 +736,7 @@ namespace Isis { } if (pvlGrp.hasKeyword("Units")) { - sUnits = pvlGrp["Units"][0]; + sUnits = QString::fromStdString(pvlGrp["Units"][0]); } if (pbLastFilter) { @@ -1029,7 +1029,7 @@ namespace Isis { // Store the Cubenames from the PvlGroup for (int i = 0; i < pvlGrp.keywords(); i++) { - sCubeNames.push_back(pvlGrp[i][0]); + sCubeNames.push_back(QString::fromStdString(pvlGrp[i][0])); } int size = sCubeNames.size(); @@ -1173,7 +1173,7 @@ namespace Isis { void ControlNetFilter::CubeNameExpressionFilter(const PvlGroup &pvlGrp, bool pbLastFilter) { QString sCubeExpr(""); if (pvlGrp.hasKeyword("Expression")) { - sCubeExpr = QString(pvlGrp["Expression"][0]); + sCubeExpr = QString::fromStdString(pvlGrp["Expression"][0]); } QString sSeparator("*"); @@ -1242,12 +1242,12 @@ namespace Isis { int iLessPoints = VALID_MAX2, iGreaterPoints = 0; if (pvlGrp.hasKeyword("LessThan")) { if (pvlGrp["LessThan"][0] != "") { - iLessPoints = toInt(pvlGrp["LessThan"][0]); + iLessPoints = std::stoi(pvlGrp["LessThan"][0]); } } if (pvlGrp.hasKeyword("GreaterThan")) { if (pvlGrp["GreaterThan"][0] != "") { - iGreaterPoints = toInt(pvlGrp["GreaterThan"][0]); + iGreaterPoints = std::stoi(pvlGrp["GreaterThan"][0]); } } @@ -1303,7 +1303,7 @@ namespace Isis { } if (pvlGrp.hasKeyword("Units")) { - sUnits = pvlGrp["Units"][0]; + sUnits = QString::fromStdString(pvlGrp["Units"][0]); } if (dDistance <= 0) { diff --git a/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp b/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp index 4007020e50..6d96122fe5 100644 --- a/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp +++ b/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp @@ -117,94 +117,94 @@ namespace Isis { int numSN = mSerialNumList.size(); if (numSN) { - pStatsGrp += PvlKeyword("TotalImages", toString(numSN)); - pStatsGrp += PvlKeyword("ImagesInControlNet", toString(numCNetImages)); + pStatsGrp += PvlKeyword("TotalImages", std::to_string(numSN)); + pStatsGrp += PvlKeyword("ImagesInControlNet", std::to_string(numCNetImages)); } - pStatsGrp += PvlKeyword("TotalPoints", toString(mCNet->GetNumPoints())); - pStatsGrp += PvlKeyword("ValidPoints", toString(NumValidPoints())); - pStatsGrp += PvlKeyword("IgnoredPoints", toString(mCNet->GetNumPoints() - NumValidPoints())); - pStatsGrp += PvlKeyword("FixedPoints", toString(NumFixedPoints())); - pStatsGrp += PvlKeyword("ConstrainedPoints", toString(NumConstrainedPoints())); - pStatsGrp += PvlKeyword("FreePoints", toString(NumFreePoints())); - pStatsGrp += PvlKeyword("EditLockPoints", toString(mCNet->GetNumEditLockPoints())); + pStatsGrp += PvlKeyword("TotalPoints", std::to_string(mCNet->GetNumPoints())); + pStatsGrp += PvlKeyword("ValidPoints", std::to_string(NumValidPoints())); + pStatsGrp += PvlKeyword("IgnoredPoints", std::to_string(mCNet->GetNumPoints() - NumValidPoints())); + pStatsGrp += PvlKeyword("FixedPoints", std::to_string(NumFixedPoints())); + pStatsGrp += PvlKeyword("ConstrainedPoints", std::to_string(NumConstrainedPoints())); + pStatsGrp += PvlKeyword("FreePoints", std::to_string(NumFreePoints())); + pStatsGrp += PvlKeyword("EditLockPoints", std::to_string(mCNet->GetNumEditLockPoints())); - pStatsGrp += PvlKeyword("TotalMeasures", toString(NumMeasures())); - pStatsGrp += PvlKeyword("ValidMeasures", toString(NumValidMeasures())); - pStatsGrp += PvlKeyword("IgnoredMeasures", toString(NumIgnoredMeasures())); - pStatsGrp += PvlKeyword("EditLockMeasures", toString(mCNet->GetNumEditLockMeasures())); + pStatsGrp += PvlKeyword("TotalMeasures", std::to_string(NumMeasures())); + pStatsGrp += PvlKeyword("ValidMeasures", std::to_string(NumValidMeasures())); + pStatsGrp += PvlKeyword("IgnoredMeasures", std::to_string(NumIgnoredMeasures())); + pStatsGrp += PvlKeyword("EditLockMeasures", std::to_string(mCNet->GetNumEditLockMeasures())); double dValue = GetAverageResidual(); - pStatsGrp += PvlKeyword("AvgResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("AvgResidual", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMinimumResidual(); - pStatsGrp += PvlKeyword("MinResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinResidual", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMaximumResidual(); - pStatsGrp += PvlKeyword("MaxResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxResidual", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMinLineResidual(); - pStatsGrp += PvlKeyword("MinLineResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinLineResidual", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMaxLineResidual(); - pStatsGrp += PvlKeyword("MaxLineResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxLineResidual", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMinSampleResidual(); - pStatsGrp += PvlKeyword("MinSampleResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinSampleResidual", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMaxSampleResidual(); - pStatsGrp += PvlKeyword("MaxSampleResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxSampleResidual", (dValue == Null ? "Null" : std::to_string(dValue))); // Shifts - Line, Sample, Pixel dValue = GetMinLineShift(); - pStatsGrp += PvlKeyword("MinLineShift", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinLineShift", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMaxLineShift(); - pStatsGrp += PvlKeyword("MaxLineShift", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxLineShift", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMinSampleShift(); - pStatsGrp += PvlKeyword("MinSampleShift", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinSampleShift", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetMaxSampleShift(); - pStatsGrp += PvlKeyword("MaxSampleShift", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxSampleShift", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = GetAvgPixelShift(); - pStatsGrp += PvlKeyword("AvgPixelShift", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("AvgPixelShift", (dValue == Null ? "NA" : std::to_string(dValue))); dValue = GetMinPixelShift(); - pStatsGrp += PvlKeyword("MinPixelShift", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MinPixelShift", (dValue == Null ? "NA" : std::to_string(dValue))); dValue = GetMaxPixelShift(); - pStatsGrp += PvlKeyword("MaxPixelShift", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxPixelShift", (dValue == Null ? "NA" : std::to_string(dValue))); dValue = mPointDoubleStats[minGFit]; - pStatsGrp += PvlKeyword("MinGoodnessOfFit", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MinGoodnessOfFit", (dValue == Null ? "NA" : std::to_string(dValue))); dValue = mPointDoubleStats[maxGFit]; - pStatsGrp += PvlKeyword("MaxGoodnessOfFit", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxGoodnessOfFit", (dValue == Null ? "NA" : std::to_string(dValue))); dValue = mPointDoubleStats[minEccentricity]; - pStatsGrp += PvlKeyword("MinEccentricity", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MinEccentricity", (dValue == Null ? "NA" : std::to_string(dValue))); dValue = mPointDoubleStats[maxEccentricity]; - pStatsGrp += PvlKeyword("MaxEccentricity", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxEccentricity", (dValue == Null ? "NA" : std::to_string(dValue))); dValue = mPointDoubleStats[minPixelZScore]; - pStatsGrp += PvlKeyword("MinPixelZScore", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MinPixelZScore", (dValue == Null ? "NA" : std::to_string(dValue))); dValue = mPointDoubleStats[maxPixelZScore]; - pStatsGrp += PvlKeyword("MaxPixelZScore", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxPixelZScore", (dValue == Null ? "NA" : std::to_string(dValue))); // Convex Hull if (mSerialNumList.size()) { dValue = mConvexHullRatioStats.Minimum(); - pStatsGrp += PvlKeyword("MinConvexHullRatio", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinConvexHullRatio", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = mConvexHullRatioStats.Maximum(); - pStatsGrp += PvlKeyword("MaxConvexHullRatio", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxConvexHullRatio", (dValue == Null ? "Null" : std::to_string(dValue))); dValue = mConvexHullRatioStats.Average(); - pStatsGrp += PvlKeyword("AvgConvexHullRatio", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("AvgConvexHullRatio", (dValue == Null ? "Null" : std::to_string(dValue))); } } diff --git a/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp b/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp index 35466def10..c678e224c4 100644 --- a/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp +++ b/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp @@ -95,25 +95,25 @@ namespace Isis { void ControlNetValidMeasure::InitStdOptionsGroup(void) { mStdOptionsGrp = PvlGroup("StandardOptions"); - mStdOptionsGrp += Isis::PvlKeyword("MinDN", (mdMinDN == Isis::ValidMinimum ? "NA" : toString(mdMinDN))); - mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : toString(mdMaxDN))); - - mStdOptionsGrp += Isis::PvlKeyword("MinEmission", toString(mdMinEmissionAngle)); - mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", toString(mdMaxEmissionAngle)); - mStdOptionsGrp += Isis::PvlKeyword("MinIncidence", toString(mdMinIncidenceAngle)); - mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", toString(mdMaxIncidenceAngle)); - mStdOptionsGrp += Isis::PvlKeyword("MinResolution", toString(mdMinResolution)); - mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : toString(mdSampleResTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("PixelsFromEdge", toString(miPixelsFromEdge)); - mStdOptionsGrp += Isis::PvlKeyword("MetersFromEdge", toString(mdMetersFromEdge)); - - mStdOptionsGrp += Isis::PvlKeyword("SampleResidual", (mdSampleResTolerance == DBL_MAX ? "NA" : toString(mdSampleResTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("LineResidual", (mdLineResTolerance == DBL_MAX ? "NA" : toString(mdLineResTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : toString(mdResidualTolerance))); - - mStdOptionsGrp += Isis::PvlKeyword("SampleShift", (m_sampleShiftTolerance == DBL_MAX ? "NA" : toString(m_sampleShiftTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("LineShift", (m_lineShiftTolerance == DBL_MAX ? "NA" : toString(m_lineShiftTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : toString(m_pixelShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("MinDN", (mdMinDN == Isis::ValidMinimum ? "NA" : std::to_string(mdMinDN))); + mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : std::to_string(mdMaxDN))); + + mStdOptionsGrp += Isis::PvlKeyword("MinEmission", std::to_string(mdMinEmissionAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", std::to_string(mdMaxEmissionAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MinIncidence", std::to_string(mdMinIncidenceAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", std::to_string(mdMaxIncidenceAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MinResolution", std::to_string(mdMinResolution)); + mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : std::to_string(mdSampleResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("PixelsFromEdge", std::to_string(miPixelsFromEdge)); + mStdOptionsGrp += Isis::PvlKeyword("MetersFromEdge", std::to_string(mdMetersFromEdge)); + + mStdOptionsGrp += Isis::PvlKeyword("SampleResidual", (mdSampleResTolerance == DBL_MAX ? "NA" : std::to_string(mdSampleResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("LineResidual", (mdLineResTolerance == DBL_MAX ? "NA" : std::to_string(mdLineResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : std::to_string(mdResidualTolerance))); + + mStdOptionsGrp += Isis::PvlKeyword("SampleShift", (m_sampleShiftTolerance == DBL_MAX ? "NA" : std::to_string(m_sampleShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("LineShift", (m_lineShiftTolerance == DBL_MAX ? "NA" : std::to_string(m_lineShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : std::to_string(m_pixelShiftTolerance))); } /** @@ -262,9 +262,9 @@ namespace Isis { if(pMeasureGrp != NULL) { if(mbCameraRequired && (mdEmissionAngle != Null || mdIncidenceAngle != Null || mdResolution != Null)) { - *pMeasureGrp += Isis::PvlKeyword("EmissionAngle", toString(mdEmissionAngle)); - *pMeasureGrp += Isis::PvlKeyword("IncidenceAngle", toString(mdIncidenceAngle)); - *pMeasureGrp += Isis::PvlKeyword("Resolution", toString(mdResolution)); + *pMeasureGrp += Isis::PvlKeyword("EmissionAngle", std::to_string(mdEmissionAngle)); + *pMeasureGrp += Isis::PvlKeyword("IncidenceAngle", std::to_string(mdIncidenceAngle)); + *pMeasureGrp += Isis::PvlKeyword("Resolution", std::to_string(mdResolution)); } else { *pMeasureGrp += Isis::PvlKeyword("EmissionAngle", "Invalid Emission Angle"); @@ -272,15 +272,15 @@ namespace Isis { *pMeasureGrp += Isis::PvlKeyword("Resolution", "Invalid Resolution"); } if(mbValidateDN) { - *pMeasureGrp += Isis::PvlKeyword("DNValue", toString(mdDnValue)); + *pMeasureGrp += Isis::PvlKeyword("DNValue", std::to_string(mdDnValue)); } - *pMeasureGrp += Isis::PvlKeyword("SampleResidual", toString(mdSampleResidual)); - *pMeasureGrp += Isis::PvlKeyword("LineResidual", toString(mdLineResidual)); - *pMeasureGrp += Isis::PvlKeyword("ResidualMagnitude", toString(mdResidualMagnitude)); + *pMeasureGrp += Isis::PvlKeyword("SampleResidual", std::to_string(mdSampleResidual)); + *pMeasureGrp += Isis::PvlKeyword("LineResidual", std::to_string(mdLineResidual)); + *pMeasureGrp += Isis::PvlKeyword("ResidualMagnitude", std::to_string(mdResidualMagnitude)); - *pMeasureGrp += Isis::PvlKeyword("SampleShift", toString(m_sampleShift)); - *pMeasureGrp += Isis::PvlKeyword("LineShift", toString(m_lineShift)); - *pMeasureGrp += Isis::PvlKeyword("PixelShift", toString(m_pixelShift)); + *pMeasureGrp += Isis::PvlKeyword("SampleShift", std::to_string(m_sampleShift)); + *pMeasureGrp += Isis::PvlKeyword("LineShift", std::to_string(m_lineShift)); + *pMeasureGrp += Isis::PvlKeyword("PixelShift", std::to_string(m_pixelShift)); } MeasureValidationResults results; @@ -401,7 +401,7 @@ namespace Isis { else { mbValidateFromEdge = true; } - mStdOptionsGrp += Isis::PvlKeyword("PixelsFromEdge", toString(miPixelsFromEdge)); + mStdOptionsGrp += Isis::PvlKeyword("PixelsFromEdge", std::to_string(miPixelsFromEdge)); } // Parse the Meters from edge if(mPvlOpGrp.hasKeyword("MetersFromEdge")) { @@ -412,7 +412,7 @@ namespace Isis { else { mbValidateFromEdge = true; } - mStdOptionsGrp += Isis::PvlKeyword("MetersFromEdge", toString(mdMetersFromEdge)); + mStdOptionsGrp += Isis::PvlKeyword("MetersFromEdge", std::to_string(mdMetersFromEdge)); } } @@ -431,7 +431,7 @@ namespace Isis { else { mdMinResolution = 0; } - mStdOptionsGrp += Isis::PvlKeyword("MinResolution", toString(mdMinResolution)); + mStdOptionsGrp += Isis::PvlKeyword("MinResolution", std::to_string(mdMinResolution)); if(mPvlOpGrp.hasKeyword("MaxResolution")){ mdMaxResolution = mPvlOpGrp["MaxResolution"]; @@ -440,7 +440,7 @@ namespace Isis { else { mdMaxResolution = DBL_MAX; } - mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : toString(mdMaxResolution))); + mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : std::to_string(mdMaxResolution))); if(mdMinResolution < 0 || mdMaxResolution < 0) { QString msg = "Invalid Resolution value(s), Resolution must be greater than zero"; @@ -469,7 +469,7 @@ namespace Isis { else { mdMinDN = Isis::ValidMinimum; } - mStdOptionsGrp += Isis::PvlKeyword("MinDN", (mdMinDN == Isis::ValidMinimum ? "NA" : toString(mdMinDN))); + mStdOptionsGrp += Isis::PvlKeyword("MinDN", (mdMinDN == Isis::ValidMinimum ? "NA" : std::to_string(mdMinDN))); if(mPvlOpGrp.hasKeyword("MaxDN")) { mdMaxDN = mPvlOpGrp["MaxDN"]; @@ -478,7 +478,7 @@ namespace Isis { else { mdMaxDN = Isis::ValidMaximum; } - mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : toString(mdMaxDN))); + mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : std::to_string(mdMaxDN))); if(mdMaxDN < mdMinDN) { QString msg = "MinDN must be less than MaxDN"; @@ -503,7 +503,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } } - mStdOptionsGrp += Isis::PvlKeyword("MinEmission", toString(mdMinEmissionAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MinEmission", std::to_string(mdMinEmissionAngle)); if(mPvlOpGrp.hasKeyword("MaxEmission")) { mdMaxEmissionAngle = mPvlOpGrp["MaxEmission"]; @@ -513,7 +513,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } } - mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", toString(mdMaxEmissionAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", std::to_string(mdMaxEmissionAngle)); if(mdMaxEmissionAngle < mdMinEmissionAngle) { QString msg = "Min EmissionAngle must be less than Max EmissionAngle"; @@ -539,7 +539,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } } - mStdOptionsGrp += Isis::PvlKeyword("MinIncidence", toString(mdMinIncidenceAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MinIncidence", std::to_string(mdMinIncidenceAngle)); if(mPvlOpGrp.hasKeyword("MaxIncidence")) { mdMaxIncidenceAngle = mPvlOpGrp["MaxIncidence"]; @@ -549,7 +549,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } } - mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", toString(mdMaxIncidenceAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", std::to_string(mdMaxIncidenceAngle)); if(mdMaxIncidenceAngle < mdMinIncidenceAngle) { QString msg = "Min IncidenceAngle must be less than Max IncidenceAngle"; @@ -573,7 +573,7 @@ namespace Isis { } bRes = true; } - mStdOptionsGrp += Isis::PvlKeyword("SampleResidual", (mdSampleResTolerance == DBL_MAX ? "NA" : toString(mdSampleResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("SampleResidual", (mdSampleResTolerance == DBL_MAX ? "NA" : std::to_string(mdSampleResTolerance))); if(mPvlOpGrp.hasKeyword("LineResidual")) { mdLineResTolerance = mPvlOpGrp["LineResidual"]; @@ -583,7 +583,7 @@ namespace Isis { } bRes = true; } - mStdOptionsGrp += Isis::PvlKeyword("LineResidual", (mdLineResTolerance == DBL_MAX ? "NA" : toString(mdLineResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("LineResidual", (mdLineResTolerance == DBL_MAX ? "NA" : std::to_string(mdLineResTolerance))); if(mPvlOpGrp.hasKeyword("ResidualMagnitude")) { mdResidualTolerance = mPvlOpGrp["ResidualMagnitude"]; @@ -593,7 +593,7 @@ namespace Isis { } bResMag = true; } - mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : toString(mdResidualTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : std::to_string(mdResidualTolerance))); if(bRes && bResMag) { QString msg = "Cannot have both Sample/Line Residuals and Residual Magnitude."; @@ -618,7 +618,7 @@ namespace Isis { } hasSampleLineShift = true; } - mStdOptionsGrp += Isis::PvlKeyword("SampleShift", (m_sampleShiftTolerance == DBL_MAX ? "NA" : toString(m_sampleShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("SampleShift", (m_sampleShiftTolerance == DBL_MAX ? "NA" : std::to_string(m_sampleShiftTolerance))); if (mPvlOpGrp.hasKeyword("LineShift")) { m_lineShiftTolerance = mPvlOpGrp["LineShift"]; @@ -629,7 +629,7 @@ namespace Isis { } hasSampleLineShift = true; } - mStdOptionsGrp += Isis::PvlKeyword("LineShift", (m_lineShiftTolerance == DBL_MAX ? "NA" : toString(m_lineShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("LineShift", (m_lineShiftTolerance == DBL_MAX ? "NA" : std::to_string(m_lineShiftTolerance))); bool hasPixelShift = false; if (mPvlOpGrp.hasKeyword("PixelShift")) { @@ -641,7 +641,7 @@ namespace Isis { } hasPixelShift = true; } - mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : toString(m_pixelShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : std::to_string(m_pixelShiftTolerance))); if (hasSampleLineShift && hasPixelShift) { QString msg = "Cannot have both Sample/Line Shift and Pixel Shift"; diff --git a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp index 4e24c2d119..470ec4aff2 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp @@ -206,12 +206,12 @@ namespace Isis { pvl.addObject(PvlObject("ControlNetwork")); PvlObject &network = pvl.findObject("ControlNetwork"); - network += PvlKeyword("NetworkId", m_header.networkID); - network += PvlKeyword("TargetName", m_header.targetName); - network += PvlKeyword("UserName", m_header.userName); - network += PvlKeyword("Created", m_header.created); - network += PvlKeyword("LastModified", m_header.lastModified); - network += PvlKeyword("Description", m_header.description); + network += PvlKeyword("NetworkId", m_header.networkID.toStdString()); + network += PvlKeyword("TargetName", m_header.targetName.toStdString()); + network += PvlKeyword("UserName", m_header.userName.toStdString()); + network += PvlKeyword("Created", m_header.created.toStdString()); + network += PvlKeyword("LastModified", m_header.lastModified.toStdString()); + network += PvlKeyword("Description", m_header.description.toStdString()); // This is the Pvl version we're converting to network += PvlKeyword("Version", "5"); @@ -232,18 +232,18 @@ namespace Isis { } if ( controlPoint->GetId().isEmpty() ) { - QString msg = "Unable to write control net to PVL file. " + std::string msg = "Unable to write control net to PVL file. " "Invalid control point has no point ID value."; throw IException(IException::Unknown, msg, _FILEINFO_); } else { - pvlPoint += PvlKeyword("PointId", controlPoint->GetId()); + pvlPoint += PvlKeyword("PointId", controlPoint->GetId().toStdString()); } if ( QString::compare(controlPoint->GetChooserName(), "Null", Qt::CaseInsensitive) != 0 ) { - pvlPoint += PvlKeyword("ChooserName", controlPoint->GetChooserName()); + pvlPoint += PvlKeyword("ChooserName", controlPoint->GetChooserName().toStdString()); } if ( QString::compare(controlPoint->GetDateTime(), "Null", Qt::CaseInsensitive) != 0 ) { - pvlPoint += PvlKeyword("DateTime", controlPoint->GetDateTime()); + pvlPoint += PvlKeyword("DateTime", controlPoint->GetDateTime().toStdString()); } if ( controlPoint->IsEditLocked() ) { pvlPoint += PvlKeyword("EditLock", "True"); @@ -274,7 +274,7 @@ namespace Isis { if ( controlPoint->HasAprioriSurfacePointSourceFile() ) { pvlPoint += PvlKeyword("AprioriXYZSourceFile", - controlPoint->GetAprioriSurfacePointSourceFile()); + controlPoint->GetAprioriSurfacePointSourceFile().toStdString()); } switch ( controlPoint->GetAprioriRadiusSource() ) { @@ -299,25 +299,25 @@ namespace Isis { if ( controlPoint->HasAprioriRadiusSourceFile() ) { pvlPoint += PvlKeyword("AprioriRadiusSourceFile", - controlPoint->GetAprioriRadiusSourceFile()); + controlPoint->GetAprioriRadiusSourceFile().toStdString()); } // add surface point x/y/z, convert to lat,lon,radius and output as comment SurfacePoint aprioriSurfacePoint = controlPoint->GetAprioriSurfacePoint(); if ( aprioriSurfacePoint.Valid() ) { - PvlKeyword aprioriX("AprioriX", toString(aprioriSurfacePoint.GetX().meters()), "meters"); - PvlKeyword aprioriY("AprioriY", toString(aprioriSurfacePoint.GetY().meters()), "meters"); - PvlKeyword aprioriZ("AprioriZ", toString(aprioriSurfacePoint.GetZ().meters()), "meters"); + PvlKeyword aprioriX("AprioriX", std::to_string(aprioriSurfacePoint.GetX().meters()), "meters"); + PvlKeyword aprioriY("AprioriY", std::to_string(aprioriSurfacePoint.GetY().meters()), "meters"); + PvlKeyword aprioriZ("AprioriZ", std::to_string(aprioriSurfacePoint.GetZ().meters()), "meters"); aprioriX.addComment("AprioriLatitude = " - + toString(aprioriSurfacePoint.GetLatitude().degrees()) + + std::to_string(aprioriSurfacePoint.GetLatitude().degrees()) + " "); aprioriY.addComment("AprioriLongitude = " - + toString(aprioriSurfacePoint.GetLongitude().degrees()) + + std::to_string(aprioriSurfacePoint.GetLongitude().degrees()) + " "); aprioriZ.addComment("AprioriRadius = " - + toString(aprioriSurfacePoint.GetLocalRadius().meters()) + + std::to_string(aprioriSurfacePoint.GetLocalRadius().meters()) + " "); pvlPoint += aprioriX; @@ -331,12 +331,12 @@ namespace Isis { // Matrix units are meters squared PvlKeyword matrix("AprioriCovarianceMatrix"); - matrix += toString(aprioriCovarianceMatrix(0, 0)); - matrix += toString(aprioriCovarianceMatrix(0, 1)); - matrix += toString(aprioriCovarianceMatrix(0, 2)); - matrix += toString(aprioriCovarianceMatrix(1, 1)); - matrix += toString(aprioriCovarianceMatrix(1, 2)); - matrix += toString(aprioriCovarianceMatrix(2, 2)); + matrix += std::to_string(aprioriCovarianceMatrix(0, 0)); + matrix += std::to_string(aprioriCovarianceMatrix(0, 1)); + matrix += std::to_string(aprioriCovarianceMatrix(0, 2)); + matrix += std::to_string(aprioriCovarianceMatrix(1, 1)); + matrix += std::to_string(aprioriCovarianceMatrix(1, 2)); + matrix += std::to_string(aprioriCovarianceMatrix(2, 2)); // *** TODO *** What do we do in the case of bundled in rectangular coordinates? // For now we do nothing. @@ -351,7 +351,7 @@ namespace Isis { + " AprioriRadiusSigma = " + toString(aprioriSurfacePoint.GetLocalRadiusSigma().meters()) + " "; - matrix.addComment(sigmas); + matrix.addComment(sigmas.toStdString()); } // If the covariance matrix has a value, add it to the PVL point. @@ -385,20 +385,20 @@ namespace Isis { SurfacePoint adjustedSurfacePoint = controlPoint->GetAdjustedSurfacePoint(); if ( adjustedSurfacePoint.Valid() ) { PvlKeyword adjustedX("AdjustedX", - toString(adjustedSurfacePoint.GetX().meters()), "meters"); + std::to_string(adjustedSurfacePoint.GetX().meters()), "meters"); PvlKeyword adjustedY("AdjustedY", - toString(adjustedSurfacePoint.GetY().meters()), "meters"); + std::to_string(adjustedSurfacePoint.GetY().meters()), "meters"); PvlKeyword adjustedZ("AdjustedZ", - toString(adjustedSurfacePoint.GetZ().meters()), "meters"); + std::to_string(adjustedSurfacePoint.GetZ().meters()), "meters"); adjustedX.addComment("AdjustedLatitude = " - + toString(adjustedSurfacePoint.GetLatitude().degrees()) + + std::to_string(adjustedSurfacePoint.GetLatitude().degrees()) + " "); adjustedY.addComment("AdjustedLongitude = " - + toString(adjustedSurfacePoint.GetLongitude().degrees()) + + std::to_string(adjustedSurfacePoint.GetLongitude().degrees()) + " "); adjustedZ.addComment("AdjustedRadius = " - + toString(adjustedSurfacePoint.GetLocalRadius().meters()) + + std::to_string(adjustedSurfacePoint.GetLocalRadius().meters()) + " "); pvlPoint += adjustedX; @@ -411,12 +411,12 @@ namespace Isis { if ( adjustedCovarianceMatrix.size1() > 0 ) { PvlKeyword matrix("AdjustedCovarianceMatrix"); - matrix += toString(adjustedCovarianceMatrix(0, 0)); - matrix += toString(adjustedCovarianceMatrix(0, 1)); - matrix += toString(adjustedCovarianceMatrix(0, 2)); - matrix += toString(adjustedCovarianceMatrix(1, 1)); - matrix += toString(adjustedCovarianceMatrix(1, 2)); - matrix += toString(adjustedCovarianceMatrix(2, 2)); + matrix += std::to_string(adjustedCovarianceMatrix(0, 0)); + matrix += std::to_string(adjustedCovarianceMatrix(0, 1)); + matrix += std::to_string(adjustedCovarianceMatrix(0, 2)); + matrix += std::to_string(adjustedCovarianceMatrix(1, 1)); + matrix += std::to_string(adjustedCovarianceMatrix(1, 2)); + matrix += std::to_string(adjustedCovarianceMatrix(2, 2)); if ( adjustedSurfacePoint.GetLatSigmaDistance().meters() != Isis::Null && adjustedSurfacePoint.GetLonSigmaDistance().meters() != Isis::Null @@ -430,7 +430,7 @@ namespace Isis { + toString(adjustedSurfacePoint.GetLocalRadiusSigma().meters()) + " "; - matrix.addComment(sigmas); + matrix.addComment(sigmas.toStdString()); } // If the covariance matrix has a value, add it to the PVL point. if ( adjustedCovarianceMatrix(0, 0) != 0.0 @@ -448,7 +448,7 @@ namespace Isis { for (int j = 0; j < controlPoint->GetNumMeasures(); j++) { PvlGroup pvlMeasure("ControlMeasure"); const ControlMeasure &controlMeasure = *controlPoint->GetMeasure(j); - pvlMeasure += PvlKeyword("SerialNumber", controlMeasure.GetCubeSerialNumber()); + pvlMeasure += PvlKeyword("SerialNumber", controlMeasure.GetCubeSerialNumber().toStdString()); switch ( controlMeasure.GetType() ) { case ControlMeasure::Candidate: @@ -466,10 +466,10 @@ namespace Isis { } if (QString::compare(controlMeasure.GetChooserName(), "Null", Qt::CaseInsensitive) != 0) { - pvlMeasure += PvlKeyword("ChooserName", controlMeasure.GetChooserName()); + pvlMeasure += PvlKeyword("ChooserName", controlMeasure.GetChooserName().toStdString()); } if (QString::compare(controlMeasure.GetDateTime(), "Null", Qt::CaseInsensitive) != 0) { - pvlMeasure += PvlKeyword("DateTime", controlMeasure.GetDateTime()); + pvlMeasure += PvlKeyword("DateTime", controlMeasure.GetDateTime().toStdString()); } if ( controlMeasure.IsEditLocked() ) { pvlMeasure += PvlKeyword("EditLock", "True"); @@ -480,50 +480,50 @@ namespace Isis { } if ( controlMeasure.GetSample() != Isis::Null) { - pvlMeasure += PvlKeyword("Sample", toString(controlMeasure.GetSample())); + pvlMeasure += PvlKeyword("Sample", std::to_string(controlMeasure.GetSample())); } if ( controlMeasure.GetLine() != Isis::Null ) { - pvlMeasure += PvlKeyword("Line", toString(controlMeasure.GetLine())); + pvlMeasure += PvlKeyword("Line", std::to_string(controlMeasure.GetLine())); } if ( controlMeasure.GetDiameter() != Isis::Null && controlMeasure.GetDiameter() != 0. ) { - pvlMeasure += PvlKeyword("Diameter", toString(controlMeasure.GetDiameter())); + pvlMeasure += PvlKeyword("Diameter", std::to_string(controlMeasure.GetDiameter())); } if ( controlMeasure.GetAprioriSample() != Isis::Null ) { - pvlMeasure += PvlKeyword("AprioriSample", toString(controlMeasure.GetAprioriSample())); + pvlMeasure += PvlKeyword("AprioriSample", std::to_string(controlMeasure.GetAprioriSample())); } if ( controlMeasure.GetAprioriLine() != Isis::Null ) { - pvlMeasure += PvlKeyword("AprioriLine", toString(controlMeasure.GetAprioriLine())); + pvlMeasure += PvlKeyword("AprioriLine", std::to_string(controlMeasure.GetAprioriLine())); } if ( controlMeasure.GetSampleSigma() != Isis::Null ) { - pvlMeasure += PvlKeyword("SampleSigma", toString(controlMeasure.GetSampleSigma()), + pvlMeasure += PvlKeyword("SampleSigma", std::to_string(controlMeasure.GetSampleSigma()), "pixels"); } if ( controlMeasure.GetLineSigma() != Isis::Null ) { - pvlMeasure += PvlKeyword("LineSigma", toString(controlMeasure.GetLineSigma()), + pvlMeasure += PvlKeyword("LineSigma", std::to_string(controlMeasure.GetLineSigma()), "pixels"); } if ( controlMeasure.GetSampleResidual() != Isis::Null ) { pvlMeasure += PvlKeyword("SampleResidual", - toString(controlMeasure.GetSampleResidual()), + std::to_string(controlMeasure.GetSampleResidual()), "pixels"); } if ( controlMeasure.GetLineResidual() != Isis::Null ) { - pvlMeasure += PvlKeyword("LineResidual", toString(controlMeasure.GetLineResidual()), + pvlMeasure += PvlKeyword("LineResidual", std::to_string(controlMeasure.GetLineResidual()), "pixels"); } if ( controlMeasure.IsRejected() ) { - pvlMeasure += PvlKeyword("JigsawRejected", toString(controlMeasure.IsRejected())); + pvlMeasure += PvlKeyword("JigsawRejected", std::to_string(controlMeasure.IsRejected())); } foreach (ControlMeasureLogData log, controlMeasure.GetLogDataEntries()) { @@ -553,7 +553,7 @@ namespace Isis { void ControlNetVersioner::read(const FileName netFile, Progress *progress) { try { - const Pvl &network(netFile.expanded()); + const Pvl &network(netFile.expanded().toStdString()); if ( network.hasObject("ProtoBuffer") ) { readProtobuf(network, netFile, progress); @@ -562,12 +562,12 @@ namespace Isis { readPvl(network, progress); } else { - QString msg = "Could not determine the control network file type"; + std::string msg = "Could not determine the control network file type"; throw IException(IException::Io, msg, _FILEINFO_); } } catch (IException &e) { - QString msg = "Reading the control network [" + netFile.name() + std::string msg = "Reading the control network [" + netFile.name().toStdString() + "] failed"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -587,7 +587,7 @@ namespace Isis { int version = 1; if ( controlNetwork.hasKeyword("Version") ) { - version = toInt(controlNetwork["Version"][0]); + version = std::stoi(controlNetwork["Version"][0]); } switch ( version ) { @@ -607,7 +607,7 @@ namespace Isis { readPvlV0005(controlNetwork, progress); break; default: - QString msg = "The Pvl file version [" + toString(version) + std::string msg = "The Pvl file version [" + std::to_string(version) + "] is not supported"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -625,16 +625,16 @@ namespace Isis { ControlNetHeaderV0001 header; try { - header.networkID = network.findKeyword("NetworkId")[0]; - header.targetName = network.findKeyword("TargetName")[0]; - header.created = network.findKeyword("Created")[0]; - header.lastModified = network.findKeyword("LastModified")[0]; - header.description = network.findKeyword("Description")[0]; - header.userName = network.findKeyword("UserName")[0]; + header.networkID = QString::fromStdString(network.findKeyword("NetworkId")[0]); + header.targetName = QString::fromStdString(network.findKeyword("TargetName")[0]); + header.created = QString::fromStdString(network.findKeyword("Created")[0]); + header.lastModified = QString::fromStdString(network.findKeyword("LastModified")[0]); + header.description = QString::fromStdString(network.findKeyword("Description")[0]); + header.userName = QString::fromStdString(network.findKeyword("UserName")[0]); createHeader(header); } catch (IException &e) { - QString msg = "Missing required header information."; + std::string msg = "Missing required header information."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -659,8 +659,8 @@ namespace Isis { } catch (IException &e) { - QString msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + std::string msg = "Failed to initialize control point at index [" + + std::to_string(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -677,16 +677,16 @@ namespace Isis { // initialize the header try { ControlNetHeaderV0002 header; - header.networkID = network.findKeyword("NetworkId")[0]; - header.targetName = network.findKeyword("TargetName")[0]; - header.created = network.findKeyword("Created")[0]; - header.lastModified = network.findKeyword("LastModified")[0]; - header.description = network.findKeyword("Description")[0]; - header.userName = network.findKeyword("UserName")[0]; + header.networkID = QString::fromStdString(network.findKeyword("NetworkId")[0]); + header.targetName = QString::fromStdString(network.findKeyword("TargetName")[0]); + header.created = QString::fromStdString(network.findKeyword("Created")[0]); + header.lastModified = QString::fromStdString(network.findKeyword("LastModified")[0]); + header.description = QString::fromStdString(network.findKeyword("Description")[0]); + header.userName = QString::fromStdString(network.findKeyword("UserName")[0]); createHeader(header); } catch (IException &e) { - QString msg = "Missing required header information."; + std::string msg = "Missing required header information."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -710,8 +710,8 @@ namespace Isis { } catch (IException &e) { - QString msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + std::string msg = "Failed to initialize control point at index [" + + std::to_string(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -728,16 +728,16 @@ namespace Isis { // initialize the header try { ControlNetHeaderV0003 header; - header.networkID = network.findKeyword("NetworkId")[0]; - header.targetName = network.findKeyword("TargetName")[0]; - header.created = network.findKeyword("Created")[0]; - header.lastModified = network.findKeyword("LastModified")[0]; - header.description = network.findKeyword("Description")[0]; - header.userName = network.findKeyword("UserName")[0]; + header.networkID = QString::fromStdString(network.findKeyword("NetworkId")[0]); + header.targetName = QString::fromStdString(network.findKeyword("TargetName")[0]); + header.created = QString::fromStdString(network.findKeyword("Created")[0]); + header.lastModified = QString::fromStdString(network.findKeyword("LastModified")[0]); + header.description = QString::fromStdString(network.findKeyword("Description")[0]); + header.userName = QString::fromStdString(network.findKeyword("UserName")[0]); createHeader(header); } catch (IException &e) { - QString msg = "Missing required header information."; + std::string msg = "Missing required header information."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -760,8 +760,8 @@ namespace Isis { } catch (IException &e) { - QString msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + std::string msg = "Failed to initialize control point at index [" + + std::to_string(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -778,16 +778,16 @@ namespace Isis { // initialize the header try { ControlNetHeaderV0004 header; - header.networkID = network.findKeyword("NetworkId")[0]; - header.targetName = network.findKeyword("TargetName")[0]; - header.created = network.findKeyword("Created")[0]; - header.lastModified = network.findKeyword("LastModified")[0]; - header.description = network.findKeyword("Description")[0]; - header.userName = network.findKeyword("UserName")[0]; + header.networkID = QString::fromStdString(network.findKeyword("NetworkId")[0]); + header.targetName = QString::fromStdString(network.findKeyword("TargetName")[0]); + header.created = QString::fromStdString(network.findKeyword("Created")[0]); + header.lastModified = QString::fromStdString(network.findKeyword("LastModified")[0]); + header.description = QString::fromStdString(network.findKeyword("Description")[0]); + header.userName = QString::fromStdString(network.findKeyword("UserName")[0]); createHeader(header); } catch (IException &e) { - QString msg = "Missing required header information."; + std::string msg = "Missing required header information."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -809,8 +809,8 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + std::string msg = "Failed to initialize control point at index [" + + std::to_string(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -827,16 +827,16 @@ namespace Isis { // initialize the header try { ControlNetHeaderV0005 header; - header.networkID = network.findKeyword("NetworkId")[0]; - header.targetName = network.findKeyword("TargetName")[0]; - header.created = network.findKeyword("Created")[0]; - header.lastModified = network.findKeyword("LastModified")[0]; - header.description = network.findKeyword("Description")[0]; - header.userName = network.findKeyword("UserName")[0]; + header.networkID = QString::fromStdString(network.findKeyword("NetworkId")[0]); + header.targetName = QString::fromStdString(network.findKeyword("TargetName")[0]); + header.created = QString::fromStdString(network.findKeyword("Created")[0]); + header.lastModified = QString::fromStdString(network.findKeyword("LastModified")[0]); + header.description = QString::fromStdString(network.findKeyword("Description")[0]); + header.userName = QString::fromStdString(network.findKeyword("UserName")[0]); createHeader(header); } catch (IException &e) { - QString msg = "Missing required header information."; + std::string msg = "Missing required header information."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -858,8 +858,8 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + std::string msg = "Failed to initialize control point at index [" + + std::to_string(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -883,7 +883,7 @@ namespace Isis { const PvlGroup &netInfo = protoBuf.findGroup("ControlNetworkInfo"); if ( netInfo.hasKeyword("Version") ) { - version = toInt(netInfo["Version"][0]); + version = std::stoi(netInfo["Version"][0]); } switch ( version ) { case 1: @@ -896,7 +896,7 @@ namespace Isis { readProtobufV0005(header, netFile, progress); break; default: - QString msg = "The Protobuf file version [" + toString(version) + std::string msg = "The Protobuf file version [" + std::to_string(version) + "] is not supported"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -922,7 +922,7 @@ namespace Isis { fstream input(netFile.expanded().toLatin1().data(), ios::in | ios::binary); if ( !input.is_open() ) { - QString msg = "Failed to open protobuf file [" + netFile.name() + "]."; + std::string msg = "Failed to open protobuf file [" + netFile.name().toStdString() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -937,16 +937,16 @@ namespace Isis { ControlNetFileProtoV0001 protoNet; try { if ( !protoNet.ParseFromCodedStream(&codedInStream) ) { - QString msg = "Failed to read input PB file [" + netFile.name() + "]."; + std::string msg = "Failed to read input PB file [" + netFile.name().toStdString() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } } catch (IException &e) { - QString msg = "Cannot parse binary protobuf file"; + std::string msg = "Cannot parse binary protobuf file"; throw IException(e, IException::User, msg, _FILEINFO_); } catch (...) { - QString msg = "Cannot parse binary PB file"; + std::string msg = "Cannot parse binary PB file"; throw IException(IException::User, msg, _FILEINFO_); } @@ -966,12 +966,12 @@ namespace Isis { ControlNetLogDataProtoV0001 protoLogData; try { if ( !protoLogData.ParseFromCodedStream(&codedLogInStream) ) { - QString msg = "Failed to read log data in protobuf file [" + netFile.name() + "]."; + std::string msg = "Failed to read log data in protobuf file [" + netFile.name().toStdString() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } } catch (...) { - QString msg = "Cannot parse binary protobuf file's log data"; + std::string msg = "Cannot parse binary protobuf file's log data"; throw IException(IException::User, msg, _FILEINFO_); } @@ -992,7 +992,7 @@ namespace Isis { createHeader(header); } catch (IException &e) { - QString msg = "Failed to parse the header from the protobuf control network file."; + std::string msg = "Failed to parse the header from the protobuf control network file."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -1018,8 +1018,8 @@ namespace Isis { } catch (IException &e) { - QString msg = "Failed to convert version 1 protobuf control point at index [" - + toString(i) + "] into a ControlPoint."; + std::string msg = "Failed to convert version 1 protobuf control point at index [" + + std::to_string(i) + "] into a ControlPoint."; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -1046,7 +1046,7 @@ namespace Isis { fstream input(netFile.expanded().toLatin1().data(), ios::in | ios::binary); if ( !input.is_open() ) { - QString msg = "Failed to open control network file" + netFile.name(); + std::string msg = "Failed to open control network file" + netFile.name().toStdString(); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1061,15 +1061,15 @@ namespace Isis { headerCodedInStream.SetTotalBytesLimit(1024 * 1024 * 512); CodedInputStream::Limit oldLimit = headerCodedInStream.PushLimit(headerLength); if ( !protoHeader.ParseFromCodedStream(&headerCodedInStream) ) { - QString msg = "Failed to parse protobuf header from input control net file [" - + netFile.name() + "]"; + std::string msg = "Failed to parse protobuf header from input control net file [" + + netFile.name().toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } headerCodedInStream.PopLimit(oldLimit); filePos += headerLength; } catch (...) { - QString msg = "An error occured while reading the protobuf control network header."; + std::string msg = "An error occured while reading the protobuf control network header."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1090,7 +1090,7 @@ namespace Isis { createHeader(header); } catch (IException &e) { - QString msg = "Missing required header information."; + std::string msg = "Missing required header information."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -1120,8 +1120,8 @@ namespace Isis { pointCodedInStream.PopLimit(oldPointLimit); } catch (...) { - QString msg = "Failed to read protobuf version 2 control point at index [" - + toString(pointIndex) + "]."; + std::string msg = "Failed to read protobuf version 2 control point at index [" + + std::to_string(pointIndex) + "]."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1135,8 +1135,8 @@ namespace Isis { } catch (IException &e) { - QString msg = "Failed to convert protobuf version 2 control point at index [" - + toString(pointIndex) + "] into a ControlPoint."; + std::string msg = "Failed to convert protobuf version 2 control point at index [" + + std::to_string(pointIndex) + "] into a ControlPoint."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -1165,7 +1165,7 @@ namespace Isis { fstream input(netFile.expanded().toLatin1().data(), ios::in | ios::binary); if ( !input.is_open() ) { - QString msg = "Failed to open control network file" + netFile.name(); + std::string msg = "Failed to open control network file" + netFile.name().toStdString(); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1185,8 +1185,8 @@ namespace Isis { CodedInputStream::Limit oldLimit = headerCodedInStream.PushLimit(headerLength); if ( !protoHeader.ParseFromCodedStream(&headerCodedInStream) ) { - QString msg = "Failed to parse protobuf header from input control net file [" - + netFile.name() + "]"; + std::string msg = "Failed to parse protobuf header from input control net file [" + + netFile.name().toStdString()+ "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1195,7 +1195,7 @@ namespace Isis { filePos += headerLength; } catch (...) { - QString msg = "An error occured while reading the protobuf control network header."; + std::string msg = "An error occured while reading the protobuf control network header."; throw IException(IException::Io, msg, _FILEINFO_); } // initialize the header from the protobuf header @@ -1215,7 +1215,7 @@ namespace Isis { createHeader(header); } catch (IException &e) { - QString msg = "Missing required header information."; + std::string msg = "Missing required header information."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -1269,8 +1269,8 @@ namespace Isis { pointCodedInStream.PopLimit(oldPointLimit); } catch (...) { - QString msg = "Failed to read protobuf version 2 control point at index [" - + toString(pointIndex) + "]."; + std::string msg = "Failed to read protobuf version 2 control point at index [" + + std::to_string(pointIndex) + "]."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1284,8 +1284,8 @@ namespace Isis { } catch (IException &e) { - QString msg = "Failed to convert protobuf version 2 control point at index [" - + toString(pointIndex) + "] into a ControlPoint."; + std::string msg = "Failed to convert protobuf version 2 control point at index [" + + std::to_string(pointIndex) + "] into a ControlPoint."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -1366,8 +1366,8 @@ namespace Isis { pointType = ControlPoint::Fixed; break; default: - QString msg = "Unable to create ControlPoint [" + toString(protoPoint.id().c_str()) - + "] from file. Type enumeration [" + toString((int)(protoPoint.type())) + std::string msg = "Unable to create ControlPoint [" + protoPoint.id() + + "] from file. Type enumeration [" + std::to_string((int)(protoPoint.type())) + "] is invalid."; throw IException(IException::Programmer, msg, _FILEINFO_); break; @@ -1405,7 +1405,7 @@ namespace Isis { break; default: - QString msg = "Unknown control point apriori radius source."; + std::string msg = "Unknown control point apriori radius source."; throw IException(IException::User, msg, _FILEINFO_); break; } @@ -1445,7 +1445,7 @@ namespace Isis { break; default: - QString msg = "Unknown control point aprioir surface point source."; + std::string msg = "Unknown control point aprioir surface point source."; throw IException(IException::User, msg, _FILEINFO_); break; } @@ -1566,7 +1566,7 @@ namespace Isis { measureType = ControlMeasure::RegisteredSubPixel; break; default: - QString msg = "Unknown control measure type."; + std::string msg = "Unknown control measure type."; throw IException(IException::User, msg, _FILEINFO_); break; } @@ -1697,27 +1697,27 @@ namespace Isis { PvlObject protoCore("Core"); protoCore.addKeyword(PvlKeyword("HeaderStartByte", - toString((BigInt) startCoreHeaderPos))); - protoCore.addKeyword(PvlKeyword("HeaderBytes", toString((BigInt) coreHeaderSize))); + std::to_string(((BigInt) startCoreHeaderPos)))); + protoCore.addKeyword(PvlKeyword("HeaderBytes", std::to_string(((BigInt) coreHeaderSize)))); BigInt pointsStartByte = (BigInt) (startCoreHeaderPos + coreHeaderSize); - protoCore.addKeyword(PvlKeyword("PointsStartByte", toString(pointsStartByte))); + protoCore.addKeyword(PvlKeyword("PointsStartByte", std::to_string((pointsStartByte)))); protoCore.addKeyword(PvlKeyword("PointsBytes", - toString(pointByteTotal))); + std::to_string(pointByteTotal))); protoObj.addObject(protoCore); PvlGroup netInfo("ControlNetworkInfo"); netInfo.addComment("This group is for informational purposes only"); - netInfo += PvlKeyword("NetworkId", protobufHeader.networkid().c_str()); - netInfo += PvlKeyword("TargetName", protobufHeader.targetname().c_str()); - netInfo += PvlKeyword("UserName", protobufHeader.username().c_str()); - netInfo += PvlKeyword("Created", protobufHeader.created().c_str()); - netInfo += PvlKeyword("LastModified", protobufHeader.lastmodified().c_str()); - netInfo += PvlKeyword("Description", protobufHeader.description().c_str()); - netInfo += PvlKeyword("NumberOfPoints", toString(numPoints)); - netInfo += PvlKeyword("NumberOfMeasures", toString(numMeasures)); + netInfo += PvlKeyword("NetworkId", protobufHeader.networkid()); + netInfo += PvlKeyword("TargetName", protobufHeader.targetname()); + netInfo += PvlKeyword("UserName", protobufHeader.username()); + netInfo += PvlKeyword("Created", protobufHeader.created()); + netInfo += PvlKeyword("LastModified", protobufHeader.lastmodified()); + netInfo += PvlKeyword("Description", protobufHeader.description()); + netInfo += PvlKeyword("NumberOfPoints", std::to_string(numPoints)); + netInfo += PvlKeyword("NumberOfMeasures", std::to_string(numMeasures)); netInfo += PvlKeyword("Version", "5"); protoObj.addGroup(netInfo); @@ -1730,7 +1730,7 @@ namespace Isis { } catch (...) { - QString msg = "Can't write control net file"; + std::string msg = "Can't write control net file"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -1754,7 +1754,7 @@ namespace Isis { // Write out the header if ( !protobufHeader.SerializeToOstream(output) ) { - QString msg = "Failed to write output control network file."; + std::string msg = "Failed to write output control network file."; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -1777,7 +1777,7 @@ namespace Isis { ControlPoint *controlPoint = m_points.takeFirst(); if ( controlPoint->GetId().isEmpty() ) { - QString msg = "Unbable to write first point of control net. " + std::string msg = "Unbable to write first point of control net. " "Invalid control point has no point ID value."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp index 77ff48adb1..ca12db9fdb 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp @@ -87,9 +87,9 @@ namespace Isis { && pointObject.hasKeyword("Longitude") && pointObject.hasKeyword("Radius") ) { SurfacePoint adjustedPoint( - Latitude(toDouble(pointObject["Latitude"][0]), Angle::Degrees), - Longitude(toDouble(pointObject["Longitude"][0]), Angle::Degrees), - Distance(toDouble(pointObject["Radius"][0]), Distance::Meters)); + Latitude(std::stod(pointObject["Latitude"][0]), Angle::Degrees), + Longitude(std::stod(pointObject["Longitude"][0]), Angle::Degrees), + Distance(std::stod(pointObject["Radius"][0]), Distance::Meters)); m_pointData->set_adjustedx( adjustedPoint.GetX().meters() ); m_pointData->set_adjustedy( adjustedPoint.GetY().meters() ); @@ -98,9 +98,9 @@ namespace Isis { else if ( pointObject.hasKeyword("X") && pointObject.hasKeyword("Y") && pointObject.hasKeyword("Z") ) { - m_pointData->set_adjustedx( toDouble(pointObject["X"][0]) ); - m_pointData->set_adjustedy( toDouble(pointObject["Y"][0]) ); - m_pointData->set_adjustedz( toDouble(pointObject["Z"][0]) ); + m_pointData->set_adjustedx( std::stod(pointObject["X"][0]) ); + m_pointData->set_adjustedy( std::stod(pointObject["Y"][0]) ); + m_pointData->set_adjustedz( std::stod(pointObject["Z"][0]) ); } // copy over the apriori surface point @@ -108,9 +108,9 @@ namespace Isis { && pointObject.hasKeyword("AprioriLongitude") && pointObject.hasKeyword("AprioriRadius") ) { SurfacePoint aprioriPoint( - Latitude(toDouble(pointObject["AprioriLatitude"][0]), Angle::Degrees), - Longitude(toDouble(pointObject["AprioriLongitude"][0]), Angle::Degrees), - Distance(toDouble(pointObject["AprioriRadius"][0]), Distance::Meters)); + Latitude(std::stod(pointObject["AprioriLatitude"][0]), Angle::Degrees), + Longitude(std::stod(pointObject["AprioriLongitude"][0]), Angle::Degrees), + Distance(std::stod(pointObject["AprioriRadius"][0]), Distance::Meters)); m_pointData->set_apriorix( aprioriPoint.GetX().meters() ); m_pointData->set_aprioriy( aprioriPoint.GetY().meters() ); @@ -119,9 +119,9 @@ namespace Isis { else if ( pointObject.hasKeyword("AprioriX") && pointObject.hasKeyword("AprioriY") && pointObject.hasKeyword("AprioriZ") ) { - m_pointData->set_apriorix( toDouble(pointObject["AprioriX"][0]) ); - m_pointData->set_aprioriy( toDouble(pointObject["AprioriY"][0]) ); - m_pointData->set_aprioriz( toDouble(pointObject["AprioriZ"][0]) ); + m_pointData->set_apriorix( std::stod(pointObject["AprioriX"][0]) ); + m_pointData->set_aprioriy( std::stod(pointObject["AprioriY"][0]) ); + m_pointData->set_aprioriz( std::stod(pointObject["AprioriZ"][0]) ); } // If the apriori values are missing, copy them from the adjusted. else if ( m_pointData->has_adjustedx() @@ -141,12 +141,12 @@ namespace Isis { m_pointData->set_type(ControlNetFileProtoV0001_PBControlPoint::Tie); } else { - QString msg = "Invalid ControlPoint type [" + pointObject["PointType"][0] + "]."; + std::string msg = "Invalid ControlPoint type [" + pointObject["PointType"][0] + "]."; throw IException(IException::User, msg, _FILEINFO_); } if (pointObject.hasKeyword("AprioriXYZSource")) { - QString source = pointObject["AprioriXYZSource"][0]; + QString source = QString::fromStdString(pointObject["AprioriXYZSource"][0]); if (source == "None") { m_pointData->set_apriorisurfpointsource(ControlNetFileProtoV0001_PBControlPoint::None); @@ -176,7 +176,7 @@ namespace Isis { } if (pointObject.hasKeyword("AprioriLatLonSource")) { - QString source = pointObject["AprioriLatLonSource"][0]; + QString source = QString::fromStdString(pointObject["AprioriLatLonSource"][0]); if (source == "None") { m_pointData->set_apriorisurfpointsource(ControlNetFileProtoV0001_PBControlPoint::None); @@ -206,7 +206,7 @@ namespace Isis { } if (pointObject.hasKeyword("AprioriRadiusSource")) { - QString source = pointObject["AprioriRadiusSource"][0]; + QString source = QString::fromStdString(pointObject["AprioriRadiusSource"][0]); if (source == "None") { m_pointData->set_aprioriradiussource(ControlNetFileProtoV0001_PBControlPoint::None); @@ -242,12 +242,12 @@ namespace Isis { if ( pointObject.hasKeyword("AprioriCovarianceMatrix") ) { PvlKeyword &matrix = pointObject["AprioriCovarianceMatrix"]; - m_pointData->add_aprioricovar(toDouble(matrix[0])); - m_pointData->add_aprioricovar(toDouble(matrix[1])); - m_pointData->add_aprioricovar(toDouble(matrix[2])); - m_pointData->add_aprioricovar(toDouble(matrix[3])); - m_pointData->add_aprioricovar(toDouble(matrix[4])); - m_pointData->add_aprioricovar(toDouble(matrix[5])); + m_pointData->add_aprioricovar(std::stod(matrix[0])); + m_pointData->add_aprioricovar(std::stod(matrix[1])); + m_pointData->add_aprioricovar(std::stod(matrix[2])); + m_pointData->add_aprioricovar(std::stod(matrix[3])); + m_pointData->add_aprioricovar(std::stod(matrix[4])); + m_pointData->add_aprioricovar(std::stod(matrix[5])); m_pointData->set_latitudeconstrained(true); m_pointData->set_longitudeconstrained(true); @@ -262,25 +262,25 @@ namespace Isis { double sigmaRad = 10000.0; if ( pointObject.hasKeyword("AprioriSigmaLatitude") ) { - if (toDouble(pointObject["AprioriSigmaLatitude"][0]) > 0 - && toDouble(pointObject["AprioriSigmaLatitude"][0]) < sigmaLat) { - sigmaLat = toDouble(pointObject["AprioriSigmaLatitude"][0]); + if (std::stod(pointObject["AprioriSigmaLatitude"][0]) > 0 + && std::stod(pointObject["AprioriSigmaLatitude"][0]) < sigmaLat) { + sigmaLat = std::stod(pointObject["AprioriSigmaLatitude"][0]); } m_pointData->set_latitudeconstrained(true); } if ( pointObject.hasKeyword("AprioriSigmaLongitude") ) { - if (toDouble(pointObject["AprioriSigmaLongitude"][0]) > 0 - && toDouble(pointObject["AprioriSigmaLongitude"][0]) < sigmaLon) { - sigmaLon = toDouble(pointObject["AprioriSigmaLongitude"][0]); + if (std::stod(pointObject["AprioriSigmaLongitude"][0]) > 0 + && std::stod(pointObject["AprioriSigmaLongitude"][0]) < sigmaLon) { + sigmaLon = std::stod(pointObject["AprioriSigmaLongitude"][0]); } m_pointData->set_longitudeconstrained(true); } if ( pointObject.hasKeyword("AprioriSigmaRadius") ) { - if (toDouble(pointObject["AprioriSigmaRadius"][0]) > 0 - && toDouble(pointObject["AprioriSigmaRadius"][0]) < sigmaRad) { - sigmaRad = toDouble(pointObject["AprioriSigmaRadius"][0]); + if (std::stod(pointObject["AprioriSigmaRadius"][0]) > 0 + && std::stod(pointObject["AprioriSigmaRadius"][0]) < sigmaRad) { + sigmaRad = std::stod(pointObject["AprioriSigmaRadius"][0]); } m_pointData->set_radiusconstrained(true); } @@ -304,12 +304,12 @@ namespace Isis { if ( pointObject.hasKeyword("ApostCovarianceMatrix") ) { PvlKeyword &matrix = pointObject["ApostCovarianceMatrix"]; - m_pointData->add_adjustedcovar(toDouble(matrix[0])); - m_pointData->add_adjustedcovar(toDouble(matrix[1])); - m_pointData->add_adjustedcovar(toDouble(matrix[2])); - m_pointData->add_adjustedcovar(toDouble(matrix[3])); - m_pointData->add_adjustedcovar(toDouble(matrix[4])); - m_pointData->add_adjustedcovar(toDouble(matrix[5])); + m_pointData->add_adjustedcovar(std::stod(matrix[0])); + m_pointData->add_adjustedcovar(std::stod(matrix[1])); + m_pointData->add_adjustedcovar(std::stod(matrix[2])); + m_pointData->add_adjustedcovar(std::stod(matrix[3])); + m_pointData->add_adjustedcovar(std::stod(matrix[4])); + m_pointData->add_adjustedcovar(std::stod(matrix[5])); m_pointData->set_latitudeconstrained(true); m_pointData->set_longitudeconstrained(true); @@ -324,23 +324,23 @@ namespace Isis { double sigmaRad = 10000.0; if ( pointObject.hasKeyword("AdjustedSigmaLatitude") ) { - if (toDouble(pointObject["AdjustedSigmaLatitude"][0]) > 0 - && toDouble(pointObject["AdjustedSigmaLatitude"][0]) < sigmaLat) { - sigmaLat = toDouble(pointObject["AdjustedSigmaLatitude"][0]); + if (std::stod(pointObject["AdjustedSigmaLatitude"][0]) > 0 + && std::stod(pointObject["AdjustedSigmaLatitude"][0]) < sigmaLat) { + sigmaLat = std::stod(pointObject["AdjustedSigmaLatitude"][0]); } } if ( pointObject.hasKeyword("AdjustedSigmaLongitude") ) { - if (toDouble(pointObject["AdjustedSigmaLongitude"][0]) > 0 - && toDouble(pointObject["AdjustedSigmaLongitude"][0]) < sigmaLon) { - sigmaLon = toDouble(pointObject["AdjustedSigmaLongitude"][0]); + if (std::stod(pointObject["AdjustedSigmaLongitude"][0]) > 0 + && std::stod(pointObject["AdjustedSigmaLongitude"][0]) < sigmaLon) { + sigmaLon = std::stod(pointObject["AdjustedSigmaLongitude"][0]); } } if ( pointObject.hasKeyword("AdjustedSigmaRadius") ) { - if (toDouble(pointObject["AdjustedSigmaRadius"][0]) > 0 - && toDouble(pointObject["AdjustedSigmaRadius"][0]) < sigmaRad) { - sigmaRad = toDouble(pointObject["AdjustedSigmaRadius"][0]); + if (std::stod(pointObject["AdjustedSigmaRadius"][0]) > 0 + && std::stod(pointObject["AdjustedSigmaRadius"][0]) < sigmaRad) { + sigmaRad = std::stod(pointObject["AdjustedSigmaRadius"][0]); } } @@ -395,7 +395,7 @@ namespace Isis { // in this case set it to 0 and ignore the measure double value; try { - value = toDouble(group["Sample"][0]); + value = std::stod(group["Sample"][0]); } catch (...) { value = 0; @@ -409,7 +409,7 @@ namespace Isis { // in this case set it to 0 and ignore the measure double value; try { - value = toDouble(group["Line"][0]); + value = std::stod(group["Line"][0]); } catch (...) { value = 0; @@ -422,30 +422,30 @@ namespace Isis { // Some old networks use ErrorSample and ErrorLine, // others use SampleResidual and LineResidual so check for both if (group.hasKeyword("ErrorSample")) { - double value = toDouble(group["ErrorSample"][0]); + double value = std::stod(group["ErrorSample"][0]); measure.mutable_measurement()->set_sampleresidual(value); group.deleteKeyword("ErrorSample"); } if (group.hasKeyword("ErrorLine")) { - double value = toDouble(group["ErrorLine"][0]); + double value = std::stod(group["ErrorLine"][0]); measure.mutable_measurement()->set_lineresidual(value); group.deleteKeyword("ErrorLine"); } if (group.hasKeyword("SampleResidual")) { - double value = toDouble(group["SampleResidual"][0]); + double value = std::stod(group["SampleResidual"][0]); measure.mutable_measurement()->set_sampleresidual(value); group.deleteKeyword("SampleResidual"); } if (group.hasKeyword("LineResidual")) { - double value = toDouble(group["LineResidual"][0]); + double value = std::stod(group["LineResidual"][0]); measure.mutable_measurement()->set_lineresidual(value); group.deleteKeyword("LineResidual"); } if (group.hasKeyword("Reference")) { - if (group["Reference"][0].toLower() == "true") { + if (QString::fromStdString(group["Reference"][0]).toLower() == "true") { m_pointData->set_referenceindex(groupIndex); } group.deleteKeyword("Reference"); @@ -453,7 +453,7 @@ namespace Isis { // Copy the measure type if (group.hasKeyword("MeasureType")) { - QString type = group["MeasureType"][0].toLower(); + QString type = QString::fromStdString(group["MeasureType"][0]).toLower(); if (type == "estimated" || type == "unmeasured" || type == "candidate") { @@ -494,7 +494,7 @@ namespace Isis { for (int keyIndex = 0; keyIndex < group.keywords(); keyIndex++) { PvlKeyword dataKeyword = group[keyIndex]; - QString name = dataKeyword.name(); + QString name = QString::fromStdString(dataKeyword.name()); int dataType = 0; double value = 0.0; @@ -528,10 +528,10 @@ namespace Isis { } try { - value = toDouble(dataKeyword[0]); + value = std::stod(dataKeyword[0]); } catch (IException &e) { - QString msg = "Invalid control measure log data value [" + dataKeyword[0] + "]"; + std::string msg = "Invalid control measure log data value [" + dataKeyword[0] + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -547,7 +547,7 @@ namespace Isis { } if (!m_pointData->IsInitialized()) { - QString msg = "There is missing required information in the control " + std::string msg = "There is missing required information in the control " "points or measures"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -596,12 +596,12 @@ namespace Isis { QSharedPointer point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(bool)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); value = value.toLower(); if (value == "true" || value == "yes") { @@ -629,12 +629,12 @@ namespace Isis { QSharedPointer point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(double)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - double value = toDouble(container[keyName][0]); - container.deleteKeyword(keyName); + double value = std::stod(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value); } @@ -658,12 +658,12 @@ namespace Isis { QSharedPointer point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(const std::string&)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value.toLatin1().data()); } @@ -687,12 +687,12 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure &measure, void (ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure::*setter)(bool)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); value = value.toLower(); if (value == "true" || value == "yes") { @@ -720,14 +720,14 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure &measure, void (ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure::*setter)(double)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } double value = Isis::Null; - if ( container.hasKeyword(keyName) ) { - value = toDouble(container[keyName][0]); - container.deleteKeyword(keyName); + if ( container.hasKeyword(keyName.toStdString()) ) { + value = std::stod(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); } @@ -755,13 +755,14 @@ namespace Isis { void (ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure::*setter) (const std::string &)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + + container.deleteKeyword(keyName.toStdString()); (measure.*setter)(value.toLatin1().data()); } } diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp index d78e5c5de5..2268a4e882 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp @@ -87,12 +87,12 @@ namespace Isis { m_pointData->set_type(ControlNetFileProtoV0001_PBControlPoint::Tie); } else { - QString msg = "Invalid ControlPoint type [" + pointObject["PointType"][0] + "]."; + std::string msg = "Invalid ControlPoint type [" + pointObject["PointType"][0] + "]."; throw IException(IException::User, msg, _FILEINFO_); } if (pointObject.hasKeyword("AprioriXYZSource")) { - QString source = pointObject["AprioriXYZSource"][0]; + QString source = QString::fromStdString(pointObject["AprioriXYZSource"][0]); if (source == "None") { m_pointData->set_apriorisurfpointsource(ControlNetFileProtoV0001_PBControlPoint::None); @@ -122,7 +122,7 @@ namespace Isis { } if (pointObject.hasKeyword("AprioriRadiusSource")) { - QString source = pointObject["AprioriRadiusSource"][0]; + QString source = QString::fromStdString(pointObject["AprioriRadiusSource"][0]); if (source == "None") { m_pointData->set_aprioriradiussource(ControlNetFileProtoV0001_PBControlPoint::None); @@ -154,23 +154,23 @@ namespace Isis { if (pointObject.hasKeyword("AprioriCovarianceMatrix")) { PvlKeyword &matrix = pointObject["AprioriCovarianceMatrix"]; - m_pointData->add_aprioricovar(toDouble(matrix[0])); - m_pointData->add_aprioricovar(toDouble(matrix[1])); - m_pointData->add_aprioricovar(toDouble(matrix[2])); - m_pointData->add_aprioricovar(toDouble(matrix[3])); - m_pointData->add_aprioricovar(toDouble(matrix[4])); - m_pointData->add_aprioricovar(toDouble(matrix[5])); + m_pointData->add_aprioricovar(std::stod(matrix[0])); + m_pointData->add_aprioricovar(std::stod(matrix[1])); + m_pointData->add_aprioricovar(std::stod(matrix[2])); + m_pointData->add_aprioricovar(std::stod(matrix[3])); + m_pointData->add_aprioricovar(std::stod(matrix[4])); + m_pointData->add_aprioricovar(std::stod(matrix[5])); } if (pointObject.hasKeyword("AdjustedCovarianceMatrix")) { PvlKeyword &matrix = pointObject["AdjustedCovarianceMatrix"]; - m_pointData->add_adjustedcovar(toDouble(matrix[0])); - m_pointData->add_adjustedcovar(toDouble(matrix[1])); - m_pointData->add_adjustedcovar(toDouble(matrix[2])); - m_pointData->add_adjustedcovar(toDouble(matrix[3])); - m_pointData->add_adjustedcovar(toDouble(matrix[4])); - m_pointData->add_adjustedcovar(toDouble(matrix[5])); + m_pointData->add_adjustedcovar(std::stod(matrix[0])); + m_pointData->add_adjustedcovar(std::stod(matrix[1])); + m_pointData->add_adjustedcovar(std::stod(matrix[2])); + m_pointData->add_adjustedcovar(std::stod(matrix[3])); + m_pointData->add_adjustedcovar(std::stod(matrix[4])); + m_pointData->add_adjustedcovar(std::stod(matrix[5])); } // Process Measures @@ -205,33 +205,33 @@ namespace Isis { // The sample, line, sample residual, and line residual are nested in another structure // inside the measure, so they cannot be copied with the conenience methods. if (group.hasKeyword("Sample")) { - double value = toDouble(group["Sample"][0]); + double value = std::stod(group["Sample"][0]); measure.mutable_measurement()->set_sample(value); group.deleteKeyword("Sample"); } if (group.hasKeyword("Line")) { - double value = toDouble(group["Line"][0]); + double value = std::stod(group["Line"][0]); measure.mutable_measurement()->set_line(value); group.deleteKeyword("Line"); } if (group.hasKeyword("SampleResidual")) { - double value = toDouble(group["SampleResidual"][0]); + double value = std::stod(group["SampleResidual"][0]); measure.mutable_measurement()->set_sampleresidual(value); group.deleteKeyword("SampleResidual"); } if (group.hasKeyword("LineResidual")) { - double value = toDouble(group["LineResidual"][0]); + double value = std::stod(group["LineResidual"][0]); measure.mutable_measurement()->set_lineresidual(value); group.deleteKeyword("LineResidual"); } if (group.hasKeyword("Reference")) { - if (group["Reference"][0].toLower() == "true") { + if (QString::fromStdString(group["Reference"][0]).toLower() == "true") { m_pointData->set_referenceindex(groupIndex); } group.deleteKeyword("Reference"); } - QString type = group["MeasureType"][0].toLower(); + QString type = QString::fromStdString(group["MeasureType"][0]).toLower(); if (type == "candidate") { measure.set_type(ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure::Candidate); } @@ -268,7 +268,7 @@ namespace Isis { for (int keyIndex = 0; keyIndex < group.keywords(); keyIndex++) { PvlKeyword dataKeyword = group[keyIndex]; - QString name = dataKeyword.name(); + QString name = QString::fromStdString(dataKeyword.name()); int dataType = 0; double value = 0.0; @@ -302,10 +302,10 @@ namespace Isis { } try { - value = toDouble(dataKeyword[0]); + value = std::stod(dataKeyword[0]); } catch (IException &e) { - QString msg = "Invalid control measure log data value [" + dataKeyword[0] + "]"; + std::string msg = "Invalid control measure log data value [" + dataKeyword[0] + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -385,12 +385,12 @@ namespace Isis { QSharedPointer point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(bool)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); value = value.toLower(); if (value == "true" || value == "yes") { @@ -418,12 +418,12 @@ namespace Isis { QSharedPointer point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(double)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - double value = toDouble(container[keyName][0]); - container.deleteKeyword(keyName); + double value = std::stod(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value); } @@ -447,12 +447,12 @@ namespace Isis { QSharedPointer point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(const std::string&)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value.toLatin1().data()); } @@ -476,12 +476,12 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure &measure, void (ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure::*setter)(bool)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); value = value.toLower(); if (value == "true" || value == "yes") { @@ -509,12 +509,12 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure &measure, void (ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure::*setter)(double)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - double value = toDouble(container[keyName][0]); - container.deleteKeyword(keyName); + double value = std::stod(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (measure.*setter)(value); } @@ -539,12 +539,12 @@ namespace Isis { void (ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure::*setter) (const std::string &)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (measure.*setter)(value.toLatin1().data()); } } diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp index cfc28a21a8..9013c005ca 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp @@ -95,12 +95,12 @@ namespace Isis { m_pointData->set_type(ControlPointFileEntryV0002::Free); } else { - QString msg = "Invalid ControlPoint type [" + pointObject["PointType"][0] + "]."; + std::string msg = "Invalid ControlPoint type [" + pointObject["PointType"][0] + "]."; throw IException(IException::User, msg, _FILEINFO_); } if (pointObject.hasKeyword("AprioriXYZSource")) { - QString source = pointObject["AprioriXYZSource"][0]; + QString source = QString::fromStdString(pointObject["AprioriXYZSource"][0]); if (source == "None") { m_pointData->set_apriorisurfpointsource(ControlPointFileEntryV0002::None); @@ -127,7 +127,7 @@ namespace Isis { } if (pointObject.hasKeyword("AprioriRadiusSource")) { - QString source = pointObject["AprioriRadiusSource"][0]; + QString source = QString::fromStdString(pointObject["AprioriRadiusSource"][0]); if (source == "None") { m_pointData->set_aprioriradiussource(ControlPointFileEntryV0002::None); @@ -157,23 +157,23 @@ namespace Isis { if (pointObject.hasKeyword("AprioriCovarianceMatrix")) { PvlKeyword &matrix = pointObject["AprioriCovarianceMatrix"]; - m_pointData->add_aprioricovar(toDouble(matrix[0])); - m_pointData->add_aprioricovar(toDouble(matrix[1])); - m_pointData->add_aprioricovar(toDouble(matrix[2])); - m_pointData->add_aprioricovar(toDouble(matrix[3])); - m_pointData->add_aprioricovar(toDouble(matrix[4])); - m_pointData->add_aprioricovar(toDouble(matrix[5])); + m_pointData->add_aprioricovar(std::stod(matrix[0])); + m_pointData->add_aprioricovar(std::stod(matrix[1])); + m_pointData->add_aprioricovar(std::stod(matrix[2])); + m_pointData->add_aprioricovar(std::stod(matrix[3])); + m_pointData->add_aprioricovar(std::stod(matrix[4])); + m_pointData->add_aprioricovar(std::stod(matrix[5])); } if (pointObject.hasKeyword("AdjustedCovarianceMatrix")) { PvlKeyword &matrix = pointObject["AdjustedCovarianceMatrix"]; - m_pointData->add_adjustedcovar(toDouble(matrix[0])); - m_pointData->add_adjustedcovar(toDouble(matrix[1])); - m_pointData->add_adjustedcovar(toDouble(matrix[2])); - m_pointData->add_adjustedcovar(toDouble(matrix[3])); - m_pointData->add_adjustedcovar(toDouble(matrix[4])); - m_pointData->add_adjustedcovar(toDouble(matrix[5])); + m_pointData->add_adjustedcovar(std::stod(matrix[0])); + m_pointData->add_adjustedcovar(std::stod(matrix[1])); + m_pointData->add_adjustedcovar(std::stod(matrix[2])); + m_pointData->add_adjustedcovar(std::stod(matrix[3])); + m_pointData->add_adjustedcovar(std::stod(matrix[4])); + m_pointData->add_adjustedcovar(std::stod(matrix[5])); } // Process Measures @@ -214,13 +214,13 @@ namespace Isis { measure, &ControlPointFileEntryV0002_Measure::set_linesigma); if (group.hasKeyword("Reference")) { - if (group["Reference"][0].toLower() == "true") { + if (QString::fromStdString(group["Reference"][0]).toLower() == "true") { m_pointData->set_referenceindex(groupIndex); } group.deleteKeyword("Reference"); } - QString type = group["MeasureType"][0].toLower(); + QString type = QString::fromStdString(group["MeasureType"][0]).toLower(); if (type == "candidate") { measure.set_type(ControlPointFileEntryV0002_Measure::Candidate); } @@ -243,7 +243,7 @@ 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 [" + std::string msg = "Unhandled or duplicate keywords in control measure [" + group[key].name() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -586,12 +586,12 @@ namespace Isis { QSharedPointer point, void (ControlPointFileEntryV0002::*setter)(bool)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); value = value.toLower(); if (value == "true" || value == "yes") { @@ -619,12 +619,12 @@ namespace Isis { QSharedPointer point, void (ControlPointFileEntryV0002::*setter)(double)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - double value = toDouble(container[keyName][0]); - container.deleteKeyword(keyName); + double value = std::stod(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value); } @@ -648,12 +648,12 @@ namespace Isis { QSharedPointer point, void (ControlPointFileEntryV0002::*setter)(const std::string&)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value.toLatin1().data()); } @@ -677,12 +677,12 @@ namespace Isis { ControlPointFileEntryV0002_Measure &measure, void (ControlPointFileEntryV0002_Measure::*setter)(bool)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); value = value.toLower(); if (value == "true" || value == "yes") { @@ -710,12 +710,12 @@ namespace Isis { ControlPointFileEntryV0002_Measure &measure, void (ControlPointFileEntryV0002_Measure::*setter)(double)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - double value = toDouble(container[keyName][0]); - container.deleteKeyword(keyName); + double value = std::stod(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (measure.*setter)(value); } @@ -740,12 +740,12 @@ namespace Isis { void (ControlPointFileEntryV0002_Measure::*setter) (const std::string &)) { - if (!container.hasKeyword(keyName)) { + if (!container.hasKeyword(keyName.toStdString())) { return; } - QString value = container[keyName][0]; - container.deleteKeyword(keyName); + QString value = QString::fromStdString(container[keyName.toStdString()][0]); + container.deleteKeyword(keyName.toStdString()); (measure.*setter)(value.toLatin1().data()); } } diff --git a/isis/src/control/objs/ControlPointList/ControlPointList.cpp b/isis/src/control/objs/ControlPointList/ControlPointList.cpp index 0a1517b380..77041f7de3 100644 --- a/isis/src/control/objs/ControlPointList/ControlPointList.cpp +++ b/isis/src/control/objs/ControlPointList/ControlPointList.cpp @@ -136,9 +136,9 @@ namespace Isis { } } - pcPvlLog += Isis::PvlKeyword("TotalPoints", toString(size)); - pcPvlLog += Isis::PvlKeyword("ValidPoints", toString(size - iNotFound)); - pcPvlLog += Isis::PvlKeyword("InvalidPoints", toString(iNotFound)); - pcPvlLog += Isis::PvlKeyword("InvalidPointIds", sPointsNotFound); + pcPvlLog += Isis::PvlKeyword("TotalPoints", std::to_string(size)); + pcPvlLog += Isis::PvlKeyword("ValidPoints", std::to_string(size - iNotFound)); + pcPvlLog += Isis::PvlKeyword("InvalidPoints", std::to_string(iNotFound)); + pcPvlLog += Isis::PvlKeyword("InvalidPointIds", sPointsNotFound.toStdString()); } } diff --git a/isis/src/control/objs/CorrelationMatrix/CorrelationMatrix.cpp b/isis/src/control/objs/CorrelationMatrix/CorrelationMatrix.cpp index c32a20243b..b4e54225ec 100644 --- a/isis/src/control/objs/CorrelationMatrix/CorrelationMatrix.cpp +++ b/isis/src/control/objs/CorrelationMatrix/CorrelationMatrix.cpp @@ -80,7 +80,7 @@ namespace Isis { try { m_covarianceFileName = - new FileName(storedMatrixData.findKeyword("CovarianceMatrixFileName")[0]); + new FileName(QString::fromStdString(storedMatrixData.findKeyword("CovarianceMatrixFileName")[0])); } catch (IException &e) { QString msg = "Could not find the Covariance Matrix .dat file name."; @@ -88,7 +88,7 @@ namespace Isis { } try { - QString corrFileName = storedMatrixData.findKeyword("CorrelationMatrixFileName")[0]; + QString corrFileName = QString::fromStdString(storedMatrixData.findKeyword("CorrelationMatrixFileName")[0]); if (corrFileName == "NULL") { m_correlationFileName = new FileName; } @@ -105,8 +105,8 @@ namespace Isis { PvlObject::PvlKeywordIterator imgsIt = storedMatrixData.findGroup("ImagesAndParameters").begin(); while ( imgsIt != storedMatrixData.findGroup("ImagesAndParameters").end() ) { - QStringList params = (*imgsIt)[0].split(","); - m_imagesAndParameters->insert(imgsIt->name(), params); + QStringList params = QString::fromStdString((*imgsIt)[0]).split(","); + m_imagesAndParameters->insert(QString::fromStdString(imgsIt->name()), params); imgsIt++; } } @@ -476,14 +476,14 @@ namespace Isis { PvlObject CorrelationMatrix::pvlObject() { PvlObject corrMatInfo("CorrelationMatrixData"); - corrMatInfo += PvlKeyword( "CovarianceMatrixFileName", m_covarianceFileName->expanded() ); - corrMatInfo += PvlKeyword( "CorrelationMatrixFileName", m_correlationFileName->expanded() ); + corrMatInfo += PvlKeyword( "CovarianceMatrixFileName", m_covarianceFileName->expanded().toStdString() ); + corrMatInfo += PvlKeyword( "CorrelationMatrixFileName", m_correlationFileName->expanded().toStdString() ); PvlGroup imgsAndParams("ImagesAndParameters"); QMapIterator imgParamIt(*m_imagesAndParameters); while ( imgParamIt.hasNext() ) { imgParamIt.next(); - imgsAndParams += PvlKeyword( imgParamIt.key(), imgParamIt.value().join(",") ); + imgsAndParams += PvlKeyword( imgParamIt.key().toStdString(), imgParamIt.value().join(",").toStdString() ); } corrMatInfo += imgsAndParams; diff --git a/isis/src/control/objs/InterestOperator/InterestOperator.cpp b/isis/src/control/objs/InterestOperator/InterestOperator.cpp index 59b68b42d7..d39697380a 100644 --- a/isis/src/control/objs/InterestOperator/InterestOperator.cpp +++ b/isis/src/control/objs/InterestOperator/InterestOperator.cpp @@ -97,23 +97,23 @@ namespace Isis { mOperatorGrp += Isis::PvlKeyword(op["Name"]); p_samples = op["Samples"]; - mOperatorGrp += Isis::PvlKeyword("Samples", toString(p_samples)); + mOperatorGrp += Isis::PvlKeyword("Samples", std::to_string(p_samples)); p_lines = op["Lines"]; - mOperatorGrp += Isis::PvlKeyword("Lines", toString(p_lines)); + mOperatorGrp += Isis::PvlKeyword("Lines", std::to_string(p_lines)); p_deltaLine = op["DeltaLine"]; - mOperatorGrp += Isis::PvlKeyword("DeltaLine", toString(p_deltaLine)); + mOperatorGrp += Isis::PvlKeyword("DeltaLine", std::to_string(p_deltaLine)); p_deltaSamp = op["DeltaSamp"]; - mOperatorGrp += Isis::PvlKeyword("DeltaSamp", toString(p_deltaSamp)); + mOperatorGrp += Isis::PvlKeyword("DeltaSamp", std::to_string(p_deltaSamp)); p_minimumInterest = op["MinimumInterest"]; - mOperatorGrp += Isis::PvlKeyword("MinimumInterest", toString(p_minimumInterest)); + mOperatorGrp += Isis::PvlKeyword("MinimumInterest", std::to_string(p_minimumInterest)); } catch (IException &e) { - QString msg = "Improper format for InterestOperator PVL [" + pPvl.fileName() + "]"; + std::string msg = "Improper format for InterestOperator PVL [" + pPvl.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -298,9 +298,9 @@ namespace Isis { // Log PvlGroup pvlMeasureGrp("MeasureDetails"); - pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn); + pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn.toStdString()); pvlMeasureGrp += Isis::PvlKeyword("OriginalLocation", - LocationString(newMeasure->GetSample(), newMeasure->GetLine())); + LocationString(newMeasure->GetSample(), newMeasure->GetLine()).toStdString()); if (bMeasureLocked) { pvlMeasureGrp += Isis::PvlKeyword("EditLock", "True"); @@ -387,7 +387,7 @@ namespace Isis { // Logging PvlObject pvlPointObj("PointDetails"); - pvlPointObj += Isis::PvlKeyword("PointId", newPnt->GetId()); + pvlPointObj += Isis::PvlKeyword("PointId", newPnt->GetId().toStdString()); // Get number of measures locked and check if Reference // Measure is locked @@ -462,9 +462,9 @@ namespace Isis { // Log PvlGroup pvlMeasureGrp("MeasureDetails"); - pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn); + pvlMeasureGrp += Isis::PvlKeyword("SerialNum", sn.toStdString()); pvlMeasureGrp += Isis::PvlKeyword("OriginalLocation", LocationString(newMeasure->GetSample(), - newMeasure->GetLine())); + newMeasure->GetLine()).toStdString()); // Initialize the UGM of this cube with the reference lat/lon if (!newMeasure->IsIgnored() && iBestMeasureIndex >= 0 && @@ -496,9 +496,9 @@ namespace Isis { pvlMeasureGrp += Isis::PvlKeyword("NewLocation", LocationString(mtInterestResults[measure].mdBestSample, - mtInterestResults[measure].mdBestLine)); - pvlMeasureGrp += Isis::PvlKeyword("DeltaSample", toString(mtInterestResults[measure].miDeltaSample)); - pvlMeasureGrp += Isis::PvlKeyword("DeltaLine", toString(mtInterestResults[measure].miDeltaLine)); + mtInterestResults[measure].mdBestLine).toStdString()); + pvlMeasureGrp += Isis::PvlKeyword("DeltaSample", std::to_string(mtInterestResults[measure].miDeltaSample)); + pvlMeasureGrp += Isis::PvlKeyword("DeltaLine", std::to_string(mtInterestResults[measure].miDeltaLine)); pvlMeasureGrp += Isis::PvlKeyword("Reference", "true"); } else { @@ -514,12 +514,12 @@ namespace Isis { ValidStandardOptions(newMeasure, measureCube); if (!results.isValid()) { iNumIgnore++; - pvlMeasureGrp += Isis::PvlKeyword("Ignored", "Failed Validation Test-" + results.toString()); + pvlMeasureGrp += Isis::PvlKeyword("Ignored", "Failed Validation Test-" + results.toString().toStdString()); newMeasure->SetIgnored(true); } - pvlMeasureGrp += Isis::PvlKeyword("NewLocation", LocationString(dSample, dLine)); - pvlMeasureGrp += Isis::PvlKeyword("DeltaSample", toString((int)abs((int)dSample - (int)origSample))); - pvlMeasureGrp += Isis::PvlKeyword("DeltaLine", toString((int)abs((int)dLine - (int)origLine))); + pvlMeasureGrp += Isis::PvlKeyword("NewLocation", LocationString(dSample, dLine).toStdString()); + pvlMeasureGrp += Isis::PvlKeyword("DeltaSample", std::to_string((int)abs((int)dSample - (int)origSample))); + pvlMeasureGrp += Isis::PvlKeyword("DeltaLine", std::to_string((int)abs((int)dLine - (int)origLine))); pvlMeasureGrp += Isis::PvlKeyword("Reference", "false"); } } @@ -543,11 +543,11 @@ namespace Isis { iMeasuresModified ++; } - pvlMeasureGrp += Isis::PvlKeyword("BestInterest", toString(mtInterestResults[measure].mdInterest)); - pvlMeasureGrp += Isis::PvlKeyword("EmissionAngle", toString(mtInterestResults[measure].mdEmission)); - pvlMeasureGrp += Isis::PvlKeyword("IncidenceAngle", toString(mtInterestResults[measure].mdIncidence)); - pvlMeasureGrp += Isis::PvlKeyword("Resolution", toString(mtInterestResults[measure].mdResolution)); - pvlMeasureGrp += Isis::PvlKeyword("DNValue", toString(mtInterestResults[measure].mdDn)); + pvlMeasureGrp += Isis::PvlKeyword("BestInterest", std::to_string(mtInterestResults[measure].mdInterest)); + pvlMeasureGrp += Isis::PvlKeyword("EmissionAngle", std::to_string(mtInterestResults[measure].mdEmission)); + pvlMeasureGrp += Isis::PvlKeyword("IncidenceAngle", std::to_string(mtInterestResults[measure].mdIncidence)); + pvlMeasureGrp += Isis::PvlKeyword("Resolution", std::to_string(mtInterestResults[measure].mdResolution)); + pvlMeasureGrp += Isis::PvlKeyword("DNValue", std::to_string(mtInterestResults[measure].mdDn)); pvlPointObj += pvlMeasureGrp; } // Measures Loop @@ -567,18 +567,18 @@ namespace Isis { iRefChanged ++; PvlGroup pvlRefChangeGrp("ReferenceChangeDetails"); if (iOrigRefIndex >= 0) { - pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", mtInterestResults[iOrigRefIndex].msSerialNum); - pvlRefChangeGrp += Isis::PvlKeyword("PrevBestInterest", toString(mtInterestResults[iOrigRefIndex].mdInterest)); + pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", mtInterestResults[iOrigRefIndex].msSerialNum.toStdString()); + pvlRefChangeGrp += Isis::PvlKeyword("PrevBestInterest", std::to_string(mtInterestResults[iOrigRefIndex].mdInterest)); pvlRefChangeGrp += Isis::PvlKeyword("PrevLocation", LocationString(mtInterestResults[iOrigRefIndex].mdOrigSample, - mtInterestResults[iOrigRefIndex].mdOrigLine)); + mtInterestResults[iOrigRefIndex].mdOrigLine).toStdString()); } else { pvlRefChangeGrp += Isis::PvlKeyword("PrevReference", "Not Set"); } - pvlRefChangeGrp += Isis::PvlKeyword("NewSerialNumber", mtInterestResults[iBestMeasureIndex].msSerialNum); - pvlRefChangeGrp += Isis::PvlKeyword("NewBestInterest", toString(mtInterestResults[iBestMeasureIndex].mdInterest)); + pvlRefChangeGrp += Isis::PvlKeyword("NewSerialNumber", mtInterestResults[iBestMeasureIndex].msSerialNum.toStdString()); + pvlRefChangeGrp += Isis::PvlKeyword("NewBestInterest", std::to_string(mtInterestResults[iBestMeasureIndex].mdInterest)); pvlRefChangeGrp += Isis::PvlKeyword("NewLocation", LocationString(mtInterestResults[iBestMeasureIndex].mdBestSample, - mtInterestResults[iBestMeasureIndex].mdBestLine)); + mtInterestResults[iBestMeasureIndex].mdBestLine).toStdString()); // Log info, if Point not locked, apriori source == Reference and a new reference if (newPnt->GetAprioriSurfacePointSource() == ControlPoint::SurfacePointSource::Reference) { @@ -598,25 +598,25 @@ namespace Isis { int iComment = 0; if (numMeasures == 0) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "No Measures in the Point"); } if (newPnt->IsIgnored()) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Point was originally Ignored"); } if (newPnt->GetType() == ControlPoint::Fixed) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Fixed Point"); } else if (newPnt->GetType() == ControlPoint::Constrained) { - QString sComment = "Comment"; - sComment += toString(++iComment); + std::string sComment = "Comment"; + sComment += std::to_string(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Constrained Point"); } @@ -639,9 +639,9 @@ namespace Isis { } // Point loop // CnetRef Change Statistics - mStatisticsGrp += Isis::PvlKeyword("PointsModified", toString(iPointsModified)); - mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", toString(iRefChanged)); - mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", toString(iMeasuresModified)); + mStatisticsGrp += Isis::PvlKeyword("PointsModified", std::to_string(iPointsModified)); + mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", std::to_string(iRefChanged)); + mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", std::to_string(iMeasuresModified)); mPvlLog += mStatisticsGrp; } diff --git a/isis/src/control/objs/InterestOperator/InterestOperator.h b/isis/src/control/objs/InterestOperator/InterestOperator.h index f2b18a1f8a..bd85def91f 100644 --- a/isis/src/control/objs/InterestOperator/InterestOperator.h +++ b/isis/src/control/objs/InterestOperator/InterestOperator.h @@ -121,7 +121,7 @@ namespace Isis { void SetPatternReduction(std::vector samples, std::vector lines); //! Return name of the matching operator - inline QString operatorName() const { + inline std::string operatorName() const { return mOperatorGrp["Name"]; }; diff --git a/isis/src/control/objs/InterestOperatorFactory/InterestOperatorFactory.cpp b/isis/src/control/objs/InterestOperatorFactory/InterestOperatorFactory.cpp index ffa872601c..394cdc23ff 100644 --- a/isis/src/control/objs/InterestOperatorFactory/InterestOperatorFactory.cpp +++ b/isis/src/control/objs/InterestOperatorFactory/InterestOperatorFactory.cpp @@ -38,7 +38,7 @@ namespace Isis { InterestOperator *InterestOperatorFactory::Create(Pvl &pPvl) { // Get the algorithm name to create PvlGroup &op = pPvl.findGroup("Operator", Pvl::Traverse); - QString operatorName = op["Name"]; + QString operatorName = QString::fromStdString(op["Name"]); // Open the factory plugin file Plugin p; diff --git a/isis/src/core/include/Blob.h b/isis/src/core/include/Blob.h index 9b31c085be..e87a79c665 100644 --- a/isis/src/core/include/Blob.h +++ b/isis/src/core/include/Blob.h @@ -52,8 +52,8 @@ namespace Isis { */ class Blob { public: - Blob(const QString &name, const QString &type); - Blob(const QString &name, const QString &type, + Blob(const QString &name, const std::string &type); + Blob(const QString &name, const std::string &type, const QString &file); Blob(const Blob &other); Blob() = default; @@ -61,7 +61,7 @@ namespace Isis { virtual ~Blob(); - QString Type() const; + std::string Type() const; QString Name() const; int Size() const; PvlObject &Label(); @@ -95,7 +95,7 @@ namespace Isis { char *p_buffer; //!< Buffer blob data is stored in BigInt p_startByte; //!< Byte blob data starts at in buffer int p_nbytes; //!< Size of blob data (in bytes) - QString p_type; //!< Type of data stored in the buffer + std::string p_type; //!< Type of data stored in the buffer QString p_detached; //!< Used for reading detached blobs QString p_labelFile; //!< The file containing the labels }; diff --git a/isis/src/core/include/Preference.h b/isis/src/core/include/Preference.h index 81e05291d7..8b6f7e92df 100644 --- a/isis/src/core/include/Preference.h +++ b/isis/src/core/include/Preference.h @@ -60,7 +60,7 @@ namespace Isis { class Preference : public Pvl { public: - void Load(const QString &file); + void Load(const std::string &file); /** * Tests whether or not a file is a unitTest diff --git a/isis/src/core/include/Pvl.h b/isis/src/core/include/Pvl.h index d634ac5a6d..bd1fb5be45 100644 --- a/isis/src/core/include/Pvl.h +++ b/isis/src/core/include/Pvl.h @@ -119,7 +119,7 @@ namespace Isis { class Pvl : public Isis::PvlObject { public: Pvl(); - Pvl(const QString &file); + Pvl(const std::string &file); Pvl(const Pvl &other); friend std::istream &operator>>(std::istream &is, Pvl &pvl); @@ -130,10 +130,10 @@ namespace Isis { if(m_internalTemplate) delete m_formatTemplate; }; - void read(const QString &file); + void read(const std::string &file); - void write(const QString &file); - void append(const QString &file); + void write(const std::string &file); + void append(const std::string &file); /** * Sets the terminator used to signify the end of the PVL @@ -141,7 +141,7 @@ namespace Isis { * * @param term The user-defined terminator */ - void setTerminator(const QString &term) { + void setTerminator(const std::string &term) { m_terminator = term; }; /** @@ -150,12 +150,12 @@ namespace Isis { * * @return The terminator used by the Pvl object. */ - QString terminator() const { + std::string terminator() const { return m_terminator; }; void setFormatTemplate(Isis::Pvl &temp); - void setFormatTemplate(const QString &filename); + void setFormatTemplate(const std::string &filename); const Pvl &operator=(const Pvl &other); @@ -165,7 +165,7 @@ namespace Isis { private: void init(); bool m_internalTemplate; - QString m_terminator; /**::iterator PvlKeywordIterator; @@ -161,11 +161,11 @@ namespace Isis { typedef QList::const_iterator ConstPvlKeywordIterator; - PvlKeywordIterator findKeyword(const QString &name, + PvlKeywordIterator findKeyword(const std::string &name, PvlKeywordIterator beg, PvlKeywordIterator end); - ConstPvlKeywordIterator findKeyword(const QString &name, + ConstPvlKeywordIterator findKeyword(const std::string &name, ConstPvlKeywordIterator beg, ConstPvlKeywordIterator end) const; @@ -204,7 +204,7 @@ namespace Isis { return m_keywords.end(); }; - void deleteKeyword(const QString &name); + void deleteKeyword(const std::string &name); void deleteKeyword(const int index); bool cleanDuplicateKeywords(); @@ -214,7 +214,7 @@ namespace Isis { * deleteKeyword() method. * @param name The name of the keyword to remove. */ - void operator-= (const QString &name) { + void operator-= (const std::string &name) { deleteKeyword(name); }; /** @@ -230,7 +230,7 @@ namespace Isis { * was not initialized using a file, this string is empty. * @return The filename. */ - QString fileName() const { + std::string fileName() const { return m_filename; }; @@ -263,11 +263,11 @@ namespace Isis { inline int comments() const { return m_name.comments(); }; - QString comment(const int index) const { + std::string comment(const int index) const { return m_name.comment(index); } - void addComment(const QString &comment) { + void addComment(const std::string &comment) { m_name.addComment(comment); } @@ -281,7 +281,7 @@ namespace Isis { const PvlContainer &operator=(const PvlContainer &other); protected: - QString m_filename; /** #include +#include #include "Pvl.h" @@ -35,10 +36,13 @@ namespace Isis { * @param type The string to be converted. * @return The corresponding KeywordType enum. */ - inline KeywordType toKeywordType(const QString type) { + inline KeywordType toKeywordType(const std::string type) { - QString t(type); - t = t.remove(QRegExp("[\\w_-\"'")).toUpper(); + std::string t(type); + std::regex e("[\\w_-\"'"); + t = std::regex_replace(t, e, ""); + + std::transform(t.begin(), t.end(), t.begin(), ::toupper); if(t == "STRING") return StringKeyword; else if(t == "BOOL") return BoolKeyword; @@ -110,11 +114,11 @@ namespace Isis { public: PvlFormat(); - PvlFormat(const QString &file); + PvlFormat(const std::string &file); PvlFormat(Pvl &keymap); virtual ~PvlFormat() {}; - void add(const QString &file); + void add(const std::string &file); void add(Pvl &keymap); /** @@ -139,12 +143,12 @@ namespace Isis { return m_charLimit; }; - virtual QString formatValue(const PvlKeyword &keyword, + virtual std::string formatValue(const PvlKeyword &keyword, int valueIndex = 0); - virtual QString formatName(const PvlKeyword &keyword); - virtual QString formatEnd(const QString name, + virtual std::string formatName(const PvlKeyword &keyword); + virtual std::string formatEnd(const std::string name, const PvlKeyword &keyword); - virtual QString formatEOL() { + virtual std::string formatEOL() { return "\n"; } @@ -153,10 +157,10 @@ namespace Isis { protected: - virtual QString addQuotes(const QString value); + virtual std::string addQuotes(const std::string value); bool isSingleUnit(const PvlKeyword &keyword); - QString m_keywordMapFile; + std::string m_keywordMapFile; Pvl m_keywordMap; //! Maximum number of characters on a single line of a keyword value. diff --git a/isis/src/core/include/PvlFormatPds.h b/isis/src/core/include/PvlFormatPds.h index 4a78b8348f..005ea32f58 100644 --- a/isis/src/core/include/PvlFormatPds.h +++ b/isis/src/core/include/PvlFormatPds.h @@ -47,30 +47,30 @@ namespace Isis { public: PvlFormatPds(); - PvlFormatPds(const QString &file); + PvlFormatPds(const std::string &file); PvlFormatPds(Pvl &keymap); virtual ~PvlFormatPds() {}; - virtual QString formatValue(const PvlKeyword &keyword, + virtual std::string formatValue(const PvlKeyword &keyword, int valueIndex = 0); - virtual QString formatName(const PvlKeyword &keyword); - virtual QString formatEnd(const QString name, + virtual std::string formatName(const PvlKeyword &keyword); + virtual std::string formatEnd(const std::string name, const PvlKeyword &keyword); - virtual QString formatEOL() { + virtual std::string formatEOL() { return "\015\012"; } protected: - virtual QString addQuotes(const QString value); + virtual std::string addQuotes(const std::string value); - QString formatString(const PvlKeyword &keyword, int num); - QString formatInteger(const PvlKeyword &keyword, int num, int bytes); - QString formatReal(const PvlKeyword &keyword, int num, int precision); - QString formatEnum(const PvlKeyword &keyword, int num); - QString formatBinary(const PvlKeyword &keyword, int num, int bytes); - QString formatHex(const PvlKeyword &keyword, int num, int bytes); - QString formatBool(const PvlKeyword &keyword, int num); - QString formatUnknown(const PvlKeyword &keyword, int num); + std::string formatString(const PvlKeyword &keyword, int num); + std::string formatInteger(const PvlKeyword &keyword, int num, int bytes); + std::string formatReal(const PvlKeyword &keyword, int num, int precision); + std::string formatEnum(const PvlKeyword &keyword, int num); + std::string formatBinary(const PvlKeyword &keyword, int num, int bytes); + std::string formatHex(const PvlKeyword &keyword, int num, int bytes); + std::string formatBool(const PvlKeyword &keyword, int num); + std::string formatUnknown(const PvlKeyword &keyword, int num); private: void init(); diff --git a/isis/src/core/include/PvlGroup.h b/isis/src/core/include/PvlGroup.h index 77de6b1915..0ff4f34536 100644 --- a/isis/src/core/include/PvlGroup.h +++ b/isis/src/core/include/PvlGroup.h @@ -41,7 +41,7 @@ namespace Isis { class PvlGroup : public Isis::PvlContainer { public: PvlGroup(); - PvlGroup(const QString &name); + PvlGroup(const std::string &name); PvlGroup(const PvlGroup &other); //! Validate a Group comparing with the Template Group diff --git a/isis/src/core/include/PvlKeyword.h b/isis/src/core/include/PvlKeyword.h index ba9800c6a1..65aa5b36de 100644 --- a/isis/src/core/include/PvlKeyword.h +++ b/isis/src/core/include/PvlKeyword.h @@ -10,7 +10,6 @@ find files of those names at the top level of this repository. **/ #include #include -#include #include #include @@ -87,20 +86,20 @@ namespace Isis { class PvlKeyword { public: PvlKeyword(); - PvlKeyword(QString name); - PvlKeyword(QString name, QString value, - QString unit = ""); + PvlKeyword(std::string name); + PvlKeyword(std::string name, std::string value, + std::string unit = ""); PvlKeyword(const PvlKeyword &other); ~PvlKeyword(); - void setName(QString name); + void setName(std::string name); /** * Returns the keyword name. * * @return The name of the keyword. */ - QString name() const { + std::string name() const { if(m_name) return m_name; else @@ -112,22 +111,22 @@ namespace Isis { * @param name The name of the keyword to compare with this one. * @return True if the names are equal, false if not. */ - bool isNamed(QString name) const { + bool isNamed(std::string name) const { return stringEqual(name, this->name()); }; - void setValue(QString value, QString unit = ""); - void setJsonValue(nlohmann::json jsonobj, QString unit = ""); + void setValue(std::string value, std::string unit = ""); + void setJsonValue(nlohmann::json jsonobj, std::string unit = ""); - void setUnits(QString units); - void setUnits(QString value, QString units); + void setUnits(std::string units); + void setUnits(std::string value, std::string units); - PvlKeyword &operator=(QString value); + PvlKeyword &operator=(std::string value); - void addValue(QString value, QString unit = ""); - void addJsonValue(nlohmann::json jsonobj, QString unit = ""); + void addValue(std::string value, std::string unit = ""); + void addJsonValue(nlohmann::json jsonobj, std::string unit = ""); - PvlKeyword &operator+=(QString value); + PvlKeyword &operator+=(std::string value); //! Returns the number of values stored in this keyword int size() const { @@ -142,33 +141,33 @@ namespace Isis { //! Returns the first value in this keyword converted to a double operator double() const { - return toDouble(operator[](0)); + return std::stod(operator[](0)); }; //! Returns the first value in this keyword converted to an integer operator int() const { - return toInt(operator[](0)); + return std::stoi(operator[](0)); }; //! Returns the first value in this keyword converted to a BigInt operator Isis::BigInt() const { - return toBigInt(operator[](0)); + return std::stoll(operator[](0)); }; - operator QString() const; + operator std::string() const; - const QString &operator[](int index) const; - QString &operator[](int index); - QString unit(const int index = 0) const; + const std::string &operator[](int index) const; + std::string &operator[](int index); + std::string unit(const int index = 0) const; - void addComment(QString comment); - void addCommentWrapped(QString comment); + void addComment(std::string comment); + void addCommentWrapped(std::string comment); - void addComments(const std::vector &comments); + void addComments(const std::vector &comments); //! Returns the number of lines of comments associated with this keyword int comments() const { return (m_comments ? m_comments->size() : 0); }; - QString comment(const int index) const; + std::string comment(const int index) const; void clearComment(); /** @@ -192,7 +191,7 @@ namespace Isis { return !(*this == key); }; - bool isEquivalent(QString string1, int index = 0) const; + bool isEquivalent(std::string string1, int index = 0) const; /** * The width of the longest keyword name (for formatting) @@ -227,34 +226,34 @@ namespace Isis { void setFormat(PvlFormat *formatter); PvlFormat *format(); - static bool stringEqual(const QString &string1, - const QString &string2); + static bool stringEqual(const std::string &string1, + const std::string &string2); - static QString readLine(std::istream &is, bool insideComment); + static std::string readLine(std::istream &is, bool insideComment); - static bool readCleanKeyword(QString keyword, - std::vector< QString > &keywordComments, - QString &keywordName, - std::vector< std::pair > + static bool readCleanKeyword(std::string keyword, + std::vector< std::string > &keywordComments, + std::string &keywordName, + std::vector< std::pair > &keywordValues); - static QString readValue(QString &keyword, bool "eProblem); - static QString readValue(QString &keyword, bool "eProblem, + static std::string readValue(std::string &keyword, bool "eProblem); + static std::string readValue(std::string &keyword, bool "eProblem, const std::vector< std::pair > & otherDelimiters); const PvlKeyword &operator=(const PvlKeyword &other); //! Validate Keyword for type and required values - void validateKeyword(PvlKeyword & pvlKwrd, QString psValueType="", PvlKeyword* pvlKwrdRange=NULL); + void validateKeyword(PvlKeyword & pvlKwrd, std::string psValueType="", PvlKeyword* pvlKwrdRange=NULL); protected: - QString reform(const QString &value) const; - QString toPvl(const QString &value) const; - QString toIPvl(const QString &value) const; + std::string reform(const std::string &value) const; + std::string toPvl(const std::string &value) const; + std::string toIPvl(const std::string &value) const; std::ostream &writeWithWrap(std::ostream &os, - const QString &textToWrite, + const std::string &textToWrite, int startColumn, PvlFormat &format) const; @@ -273,13 +272,13 @@ namespace Isis { * of the time we have one value per keyword so that is what we're * allocating by default with this variable. */ - QVarLengthArray m_values; + QVarLengthArray m_values; //! The units for the values. - std::vector *m_units; + std::vector *m_units; //! The comments for the keyword. - std::vector *m_comments; + std::vector *m_comments; void init(); diff --git a/isis/src/core/include/PvlObject.h b/isis/src/core/include/PvlObject.h index bdcc5f2d5b..f58a286be3 100644 --- a/isis/src/core/include/PvlObject.h +++ b/isis/src/core/include/PvlObject.h @@ -61,9 +61,9 @@ namespace Isis { class PvlObject : public Isis::PvlContainer { public: PvlObject(); - PvlObject(const QString &name); + PvlObject(const std::string &name); PvlObject(const PvlObject &other); - PvlObject(const QString &name, const nlohmann::json &jsonobj); + PvlObject(const std::string &name, const nlohmann::json &jsonobj); friend std::ostream &operator<<(std::ostream &os, Isis::PvlObject &object); friend std::istream &operator>>(std::istream &is, PvlObject &result); @@ -126,7 +126,7 @@ namespace Isis { * @param beg The lower index * @param end The higher index */ - PvlGroupIterator findGroup(const QString &name, + PvlGroupIterator findGroup(const std::string &name, PvlGroupIterator beg, PvlGroupIterator end) { Isis::PvlGroup temp(name); @@ -140,7 +140,7 @@ namespace Isis { * @param beg The lower index * @param end The higher index */ - ConstPvlGroupIterator findGroup(const QString &name, + ConstPvlGroupIterator findGroup(const std::string &name, ConstPvlGroupIterator beg, ConstPvlGroupIterator end) const { Isis::PvlGroup temp(name); @@ -164,20 +164,20 @@ namespace Isis { using PvlContainer::findKeyword; - PvlKeyword &findKeyword(const QString &kname, + PvlKeyword &findKeyword(const std::string &kname, FindOptions opts); using PvlContainer::hasKeyword; - bool hasKeyword(const QString &kname, + bool hasKeyword(const std::string &kname, FindOptions opts) const; - Isis::PvlGroup &findGroup(const QString &name, + Isis::PvlGroup &findGroup(const std::string &name, FindOptions opts = None); - const Isis::PvlGroup &findGroup(const QString &name, + const Isis::PvlGroup &findGroup(const std::string &name, FindOptions opts = None) const; /** * Add a group to the object. @@ -196,7 +196,7 @@ namespace Isis { addObject(obj); } - void deleteGroup(const QString &name); + void deleteGroup(const std::string &name); void deleteGroup(const int index); @@ -207,7 +207,7 @@ namespace Isis { * @param name The name of the group to look for. * @return True if the object has the group, false if not. */ - bool hasGroup(const QString &name) const { + bool hasGroup(const std::string &name) const { if(findGroup(name, beginGroup(), endGroup()) == endGroup()) return false; return true; } @@ -271,7 +271,7 @@ namespace Isis { * @param end The higher index. * @return The index of the object. */ - PvlObjectIterator findObject(const QString &name, + PvlObjectIterator findObject(const std::string &name, PvlObjectIterator beg, PvlObjectIterator end) { PvlObject temp(name); @@ -286,7 +286,7 @@ namespace Isis { * @param end The higher index. * @return The index of the object. */ - ConstPvlObjectIterator findObject(const QString &name, + ConstPvlObjectIterator findObject(const std::string &name, ConstPvlObjectIterator beg, ConstPvlObjectIterator end) const { PvlObject temp(name); @@ -294,10 +294,10 @@ namespace Isis { } - PvlObject &findObject(const QString &name, + PvlObject &findObject(const std::string &name, FindOptions opts = None); - const PvlObject &findObject(const QString &name, + const PvlObject &findObject(const std::string &name, FindOptions opts = None) const; /** @@ -309,7 +309,7 @@ namespace Isis { m_objects[m_objects.size()-1].setFileName(fileName()); } - void deleteObject(const QString &name); + void deleteObject(const std::string &name); void deleteObject(const int index); @@ -320,7 +320,7 @@ namespace Isis { * @return True if the current PvlObject has the specified object, false * if it does not. */ - bool hasObject(const QString &name) const { + bool hasObject(const std::string &name) const { if(findObject(name, beginObject(), endObject()) == endObject()) return false; return true; } diff --git a/isis/src/core/include/Table.h b/isis/src/core/include/Table.h index 794b0d863d..7696d8134e 100644 --- a/isis/src/core/include/Table.h +++ b/isis/src/core/include/Table.h @@ -73,10 +73,10 @@ namespace Isis { // Constructors and Destructors Table(); Table(Blob &blob); - Table(const QString &tableName, TableRecord &rec); - Table(const QString &tableName);// Only use this constructor for reading in an existing table - Table(const QString &tableName, const QString &file); - Table(const QString &tableName, const QString &file, + Table(const std::string &tableName, TableRecord &rec); + Table(const std::string &tableName);// Only use this constructor for reading in an existing table + Table(const std::string &tableName, const QString &file); + Table(const std::string &tableName, const QString &file, const Pvl &fileHeader); Table(const Table &other); Table(const QString &tableName, const std::string &tableString, const char &fieldDelimiter); @@ -87,7 +87,7 @@ namespace Isis { void Write(const QString &file); - QString Name() const; + std::string Name() const; PvlObject &Label(); void SetAssociation(const Table::Association assoc); @@ -132,7 +132,7 @@ namespace Isis { Association p_assoc; //!< Association Type of the table bool p_swap; //!< Only used for reading - QString p_name; //!< The name of the Table + std::string p_name; //!< The name of the Table PvlObject p_label; //!< The label for storing additional information }; }; diff --git a/isis/src/core/src/Blob.cpp b/isis/src/core/src/Blob.cpp index 8f1c99098d..f184e43d54 100644 --- a/isis/src/core/src/Blob.cpp +++ b/isis/src/core/src/Blob.cpp @@ -25,7 +25,7 @@ namespace Isis { * @param name The blob name * @param type The blob type */ - Blob::Blob(const QString &name, const QString &type) { + Blob::Blob(const QString &name, const std::string &type) { p_blobName = name; p_buffer = NULL; p_labelFile = ""; @@ -33,7 +33,7 @@ namespace Isis { p_type = type; p_blobPvl.setName(p_type); - p_blobPvl += PvlKeyword("Name", p_blobName); + p_blobPvl += PvlKeyword("Name", p_blobName.toStdString()); p_blobPvl += PvlKeyword("StartByte", "0"); p_blobPvl += PvlKeyword("Bytes", "0"); } @@ -46,7 +46,7 @@ namespace Isis { * @param type The blob type * @param file The filename to read from. */ - Blob::Blob(const QString &name, const QString &type, + Blob::Blob(const QString &name, const std::string &type, const QString &file) { p_blobName = name; p_buffer = NULL; @@ -121,7 +121,7 @@ namespace Isis { * * @return @b string Type of Blob. */ - QString Blob::Type() const { + std::string Blob::Type() const { return p_type; } @@ -172,9 +172,9 @@ namespace Isis { for (int o = 0; o < pvl.objects(); o++) { const PvlObject &obj = pvl.object(o); if (obj.isNamed(p_type)) { - QString curName = obj["Name"]; - curName = curName.toUpper(); - if (blobName == curName) { + std::string curName = obj["Name"]; + std::transform(curName.begin(), curName.end(), curName.begin(), ::toupper); + if (blobName.toStdString() == curName) { // If there are keywords supplied, check that those match, too! if (!keywords.empty()){ bool keywordFound = true; @@ -214,13 +214,13 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Invalid " + p_type + " label format"; + std::string msg = "Invalid " + p_type + " label format"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } // Did we find it? if (!found) { - QString msg = "Unable to find " + p_type + " [" + p_blobName + "]"; + std::string msg = "Unable to find " + p_type + " [" + p_blobName.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -234,12 +234,12 @@ namespace Isis { if (p_labelFile != "") { path = FileName(p_labelFile).path() + "/"; } - p_detached = path + (QString) p_blobPvl["^"+p_type]; + p_detached = path + QString::fromStdString((std::string) p_blobPvl["^"+p_type]); p_blobPvl.deleteKeyword("^" + p_type); } } catch (IException &e) { - QString msg = "Invalid " + p_type + " label format"; + std::string msg = "Invalid " + p_type + " label format"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -254,7 +254,7 @@ namespace Isis { */ void Blob::Read(const QString &file, const std::vector keywords) { // Expand the filename - QString temp(FileName(file).expanded()); + std::string temp(FileName(file).expanded().toStdString()); // Get the pvl Pvl pvl; @@ -262,7 +262,7 @@ namespace Isis { pvl.read(temp); } catch (IException &e) { - QString msg = "Invalid " + p_type + " label format"; + std::string msg = "Invalid " + p_type + " label format"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } Read(file, pvl, keywords); @@ -294,8 +294,8 @@ namespace Isis { } catch (IException &e) { istm.close(); - QString msg = "Unable to open " + p_type + " [" + p_blobName + - "] in file [" + temp + "]"; + std::string msg = "Unable to open " + p_type + " [" + p_blobName.toStdString() + + "] in file [" + temp.toStdString() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -328,7 +328,7 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Unable to read " + p_type + " [" + p_blobName + "]"; + std::string msg = "Unable to read " + p_type + " [" + p_blobName.toStdString() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -356,14 +356,14 @@ namespace Isis { streampos sbyte = p_startByte - 1; stream.seekg(sbyte, std::ios::beg); if (!stream.good()) { - QString msg = "Error preparing to read data from " + p_type + - " [" + p_blobName + "]"; + std::string msg = "Error preparing to read data from " + p_type + + " [" + p_blobName.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } stream.read(p_buffer, p_nbytes); if (!stream.good()) { - QString msg = "Error reading data from " + p_type + " [" + p_blobName + "]"; + std::string msg = "Error reading data from " + p_type + " [" + p_blobName.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -425,9 +425,9 @@ namespace Isis { os.seekp(0, std::ios::end); BigInt nbytes = (BigInt) os.tellp() + (BigInt) 64; p_startByte = nbytes + 1 + 1; // 1-based; - pvl.findObject(p_type)["StartByte"] = toString(p_startByte); - pvl.findObject(p_type)["Bytes"] = toString(p_nbytes); - pvl.write(file); + pvl.findObject(p_type)["StartByte"] = std::to_string(p_startByte); + pvl.findObject(p_type)["Bytes"] = std::to_string(p_nbytes); + pvl.write(file.toStdString()); // Prepare and write the binary data fstream stream; @@ -442,8 +442,8 @@ namespace Isis { stream.seekp(sbyte, std::ios::beg); if (!stream.good()) { stream.close(); - QString msg = "Error preparing to write data to " + - p_type + " [" + p_blobName + "]"; + std::string msg = "Error preparing to write data to " + + p_type + " [" + p_blobName.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -451,7 +451,7 @@ namespace Isis { stream.close(); } catch (IException &e) { - QString msg = "Unable to create " + p_type + " file [" + file + "]"; + std::string msg = "Unable to create " + p_type + " file [" + file.toStdString() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -479,12 +479,12 @@ namespace Isis { // Handle detached blobs if (detachedFileName != "") { - p_blobPvl += PvlKeyword("^" + p_type, detachedFileName); + p_blobPvl += PvlKeyword("^" + p_type, detachedFileName.toStdString()); } - p_blobPvl["StartByte"] = toString((BigInt)sbyte); - p_blobPvl["Bytes"] = toString(p_nbytes); + p_blobPvl["StartByte"] = std::to_string((BigInt)sbyte); + p_blobPvl["Bytes"] = std::to_string(p_nbytes); // See if the blob is already in the file @@ -494,7 +494,7 @@ namespace Isis { for (int i = 0; i < pvl.objects(); i++) { if (pvl.object(i).name() == p_blobPvl.name()) { PvlObject &obj = pvl.object(i); - if ((QString)obj["Name"] == (QString)p_blobPvl["Name"]) { + if ((std::string)obj["Name"] == (std::string)p_blobPvl["Name"]) { found = true; BigInt oldSbyte = obj["StartByte"]; @@ -564,7 +564,7 @@ namespace Isis { void Blob::WriteData(std::fstream &stream) { stream.write(p_buffer, p_nbytes); if (!stream.good()) { - QString msg = "Error writing data to " + p_type + " [" + p_blobName + "]"; + std::string msg = "Error writing data to " + p_type + " [" + p_blobName.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } diff --git a/isis/src/core/src/FileName.cpp b/isis/src/core/src/FileName.cpp index c678a15572..895566d50c 100644 --- a/isis/src/core/src/FileName.cpp +++ b/isis/src/core/src/FileName.cpp @@ -843,9 +843,7 @@ namespace Isis { int varSearchStartPos = 0; int varStartPos = -1; - if(Preference::Preferences().hasGroup("DataDirectory")) { - PvlGroup &testing = Preference::Preferences().findGroup("DataDirectory"); - } + // Loop while there are any "$" at the current position or after // Some "$" might be skipped if no translation can be found while((varStartPos = expandedStr.indexOf("$", varSearchStartPos)) != -1) { @@ -868,8 +866,8 @@ namespace Isis { // Find the corresponding Isis Preference if one exists if(Preference::Preferences().hasGroup("DataDirectory")) { PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - if(dataDir.hasKeyword(varName)) { - varValue = ((QString)dataDir[varName.toStdString().c_str()][0]); + if(dataDir.hasKeyword(varName.toStdString())) { + varValue = QString::fromStdString(dataDir[varName.toStdString()][0]); } } diff --git a/isis/src/core/src/IException.cpp b/isis/src/core/src/IException.cpp index 1b10e12d6f..a69da19e97 100644 --- a/isis/src/core/src/IException.cpp +++ b/isis/src/core/src/IException.cpp @@ -489,11 +489,11 @@ namespace Isis { if (exception.m_errorType != Unknown) { errGroup += PvlKeyword("Class", - errorTypeToString(exception.m_errorType)); + errorTypeToString(exception.m_errorType).toStdString()); exceptionIsBlank = false; } - errGroup += PvlKeyword("Code", Isis::toString(exception.m_errorType)); + errGroup += PvlKeyword("Code", to_string(exception.m_errorType)); if (exception.m_message) { exceptionIsBlank = false; @@ -501,15 +501,15 @@ namespace Isis { if (message.size() && message[message.size() - 1] == '.') message = message.mid(0, message.size() - 1); - errGroup += PvlKeyword("Message", message); + errGroup += PvlKeyword("Message", message.toStdString()); } if (exception.m_fileName) { exceptionIsBlank = false; - errGroup += PvlKeyword("File", *exception.m_fileName); + errGroup += PvlKeyword("File", exception.m_fileName->toStdString()); if (exception.m_lineNumber != -1) - errGroup += PvlKeyword("Line", Isis::toString(exception.m_lineNumber)); + errGroup += PvlKeyword("Line", std::to_string(exception.m_lineNumber)); } if (!exceptionIsBlank) diff --git a/isis/src/core/src/Preference.cpp b/isis/src/core/src/Preference.cpp index fc54817062..0ee12fac1c 100644 --- a/isis/src/core/src/Preference.cpp +++ b/isis/src/core/src/Preference.cpp @@ -25,18 +25,17 @@ namespace Isis { atexit(Shutdown); } - void Preference::Load(const QString &file) { + void Preference::Load(const std::string &file) { // Read the input PVL preference file Isis::Pvl pvl; - if(Isis::FileName(file).fileExists()) { + if(Isis::FileName(QString::fromStdString(file)).fileExists()) { pvl.read(file); } else { // Throw an exception if the preference file isn't found - throw IException(IException::User, - QString("The preference file %1 was not found or does not exist").arg(file), - _FILEINFO_); + std::string msg = "The preference file " + file + " was not found or does not exist"; + throw IException(IException::User, msg, _FILEINFO_); } @@ -129,8 +128,9 @@ namespace Isis { try { PvlGroup &errorFacility = this->findGroup("ErrorFacility"); if (errorFacility.hasKeyword("Format")) { - QString format = errorFacility["Format"][0]; - usePvlFormat = (format.toUpper() == "PVL"); + std::string format = errorFacility["Format"][0]; + std::transform(format.begin(), format.end(), format.begin(), ::toupper); + usePvlFormat = (format == "PVL"); } } catch (IException &e) { @@ -145,8 +145,9 @@ namespace Isis { if (this->hasGroup("ErrorFacility")) { PvlGroup &errorFacility = this->findGroup("ErrorFacility"); if (errorFacility.hasKeyword("FileLine")) { - QString fileLine = errorFacility["FileLine"][0]; - reportFileLine = (fileLine.toUpper() == "ON"); + std::string fileLine = errorFacility["FileLine"][0]; + std::transform(fileLine.begin(), fileLine.end(), fileLine.begin(), ::toupper); + reportFileLine = (fileLine == "ON"); } } diff --git a/isis/src/core/src/Pvl.cpp b/isis/src/core/src/Pvl.cpp index 1e80eb6d44..6749d9cec3 100644 --- a/isis/src/core/src/Pvl.cpp +++ b/isis/src/core/src/Pvl.cpp @@ -30,7 +30,7 @@ namespace Isis { * * @param file The file containing the pvl formatted information */ - Pvl::Pvl(const QString &file) : Isis::PvlObject("Root") { + Pvl::Pvl(const std::string &file) : Isis::PvlObject("Root") { init(); read(file); } @@ -86,14 +86,14 @@ namespace Isis { * * @throws Isis::iException::Io */ - void Pvl::read(const QString &file) { + void Pvl::read(const std::string &file) { // Expand the filename - Isis::FileName temp(file); - m_filename = temp.expanded(); + Isis::FileName temp(QString::fromStdString(file)); + m_filename = temp.expanded().toStdString(); // Open the file ifstream istm; - istm.open(m_filename.toLatin1().data(), std::ios::in); + istm.open(m_filename, std::ios::in); if(!istm) { QString message = Message::FileOpen(temp.expanded()); throw IException(IException::Io, message, _FILEINFO_); @@ -126,9 +126,9 @@ namespace Isis { * * @throws Isis::iException::Io */ - void Pvl::write(const QString &file) { + void Pvl::write(const std::string &file) { // Expand the filename - Isis::FileName temp(file); + Isis::FileName temp(QString::fromStdString(file)); // Set up a Formatter bool removeFormatter = false; @@ -180,9 +180,9 @@ namespace Isis { * * @throws Isis::iException::Io */ - void Pvl::append(const QString &file) { + void Pvl::append(const std::string &file) { // Set up for opening and writing - Isis::FileName temp(file); + Isis::FileName temp(QString::fromStdString(file)); // Set up a Formatter bool removeFormatter = false; @@ -230,7 +230,7 @@ namespace Isis { } - void Pvl::setFormatTemplate(const QString &file) { + void Pvl::setFormatTemplate(const std::string &file) { if(m_internalTemplate) delete m_formatTemplate; m_internalTemplate = true; m_formatTemplate = new Isis::Pvl(file); @@ -262,13 +262,13 @@ namespace Isis { Isis::Pvl newTemp; for(int i = 0; i < outTemplate.keywords(); i++) { if(outTemplate[i].isNamed("Isis:PvlTemplate:File")) { - QString filename = outTemplate[i]; - Isis::FileName file(filename); + std::string filename = outTemplate[i]; + Isis::FileName file(QString::fromStdString(filename)); if(!file.fileExists()) { - QString message = "Could not open the template file [" + filename + "]"; + std::string message = "Could not open the template file [" + filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } - Isis::Pvl include(file.expanded()); + Isis::Pvl include(file.expanded().toStdString()); for(int j = 0; j < include.keywords(); j++) { if(!newTemp.hasKeyword(include[j].name())) @@ -425,7 +425,7 @@ namespace Isis { if(readKeyword == errorKeywords[errorKey]) { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "Unexpected ["; + std::string msg = "Unexpected ["; msg += readKeyword.name(); msg += "] in PVL Object [ROOT]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -535,7 +535,7 @@ namespace Isis { for(int i=0; i 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -77,10 +77,10 @@ namespace Isis { * @return The PvlKeyword object. * @throws IException The keyword doesn't exist. */ - const Isis::PvlKeyword &PvlContainer::findKeyword(const QString &name) const { + const Isis::PvlKeyword &PvlContainer::findKeyword(const std::string &name) const { ConstPvlKeywordIterator key = findKeyword(name, begin(), end()); if(key == end()) { - QString msg = "PVL Keyword [" + name + "] does not exist in [" + + std::string msg = "PVL Keyword [" + name + "] does not exist in [" + type() + " = " + this->name() + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -94,10 +94,10 @@ namespace Isis { * @param name The name of the keyword to remove. * @throws iException::Pvl Keyword doesn't exist. */ - void PvlContainer::deleteKeyword(const QString &name) { + void PvlContainer::deleteKeyword(const std::string &name) { PvlKeywordIterator key = findKeyword(name, begin(), end()); if(key == end()) { - QString msg = "PVL Keyword [" + name + "] does not exist in [" + + std::string msg = "PVL Keyword [" + name + "] does not exist in [" + type() + " = " + this->name() + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -114,7 +114,7 @@ namespace Isis { */ void PvlContainer::deleteKeyword(const int index) { if(index >= (int)m_keywords.size() || index < 0) { - QString msg = "The specified index is out of bounds in PVL [" + + std::string msg = "The specified index is out of bounds in PVL [" + type() + " = " + name() + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -156,7 +156,7 @@ namespace Isis { * @param name The name of the keyword to check for. * @return True if the keyword exists, false if it doesn't. */ - bool PvlContainer::hasKeyword(const QString &name) const { + bool PvlContainer::hasKeyword(const std::string &name) const { ConstPvlKeywordIterator key = findKeyword(name, begin(), end()); if(key == end()) return false; return true; @@ -260,13 +260,13 @@ namespace Isis { // Include files take precedence over all other objects and groups for(int i = 0; i < outTemplate.keywords(); i++) { if(outTemplate[i].isNamed("Isis:PvlTemplate:File")) { - QString filename = outTemplate[i]; - Isis::FileName file(filename); + std::string filename = outTemplate[i]; + Isis::FileName file(QString::fromStdString(filename)); if(!file.fileExists()) { - QString message = "Could not open the template file [" + filename + "]"; + std::string message = "Could not open the template file [" + filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } - Isis::Pvl include(file.expanded()); + Isis::Pvl include(file.expanded().toStdString()); for(int j = 0; j < include.keywords(); j++) { if(!newTemp.hasKeyword(include[j].name())) @@ -348,7 +348,7 @@ namespace Isis { * @param end The ending iterator. * @return The keyword index. */ - PvlContainer::PvlKeywordIterator PvlContainer::findKeyword(const QString &name, + PvlContainer::PvlKeywordIterator PvlContainer::findKeyword(const std::string &name, PvlContainer::PvlKeywordIterator beg, PvlContainer::PvlKeywordIterator end) { PvlKeyword temp(name); @@ -363,7 +363,7 @@ namespace Isis { * @param end The ending iterator. * @return The keyword index. */ - PvlContainer::ConstPvlKeywordIterator PvlContainer::findKeyword(const QString &name, + PvlContainer::ConstPvlKeywordIterator PvlContainer::findKeyword(const std::string &name, PvlContainer::ConstPvlKeywordIterator beg, PvlContainer::ConstPvlKeywordIterator end) const { PvlKeyword temp(name); @@ -397,23 +397,24 @@ namespace Isis { int iTmplKeySize = keywords(); for(int i=0; i=0; j--) { PvlKeyword & pvlKwrd = pPvlCont[j]; - QString sKeyName = pvlKwrd.name(); + std::string sKeyName = pvlKwrd.name(); if(sTmplKeyName == sKeyName) { pPvlTmplKwrd.validateKeyword(pvlKwrd, sValueType); pPvlCont.deleteKeyword(pvlKwrd.name()); diff --git a/isis/src/core/src/PvlFormat.cpp b/isis/src/core/src/PvlFormat.cpp index 96e9141df9..b0bff749d5 100644 --- a/isis/src/core/src/PvlFormat.cpp +++ b/isis/src/core/src/PvlFormat.cpp @@ -12,6 +12,7 @@ find files of those names at the top level of this repository. **/ #include "Pvl.h" #include "PvlFormat.h" + using namespace std; namespace Isis { @@ -30,9 +31,9 @@ namespace Isis { * used for output of PvlKeywords in Normal Isis format. * * @param file A file name with keyword=type. Where KEYWORD is the name of a - * keyword in this PvlKeyword and TYPE is one of [QString | integer | float ] + * keyword in this PvlKeyword and TYPE is one of [std::string | integer | float ] */ - PvlFormat::PvlFormat(const QString &file) { + PvlFormat::PvlFormat(const std::string &file) { init(); add(file); } @@ -40,10 +41,10 @@ namespace Isis { /* * Constructs a PvlFormat using the specified pre populated Pvl map of keyword - * name (QString) vs keyword type (KeywordType). + * name (std::string) vs keyword type (KeywordType). * * @param keywordType A Pvl with keyword=type. Where keyword is the name of a - * keyword in a PvlKeyword and type is one of [QString | integer | float ] + * keyword in a PvlKeyword and type is one of [std::string | integer | float ] */ PvlFormat::PvlFormat(Pvl &keywordType) { init(); @@ -61,10 +62,10 @@ namespace Isis { /* * Add the contents of a file to the keyword type mapping. The file should - * contain KEYWORD=TYPE (one per line), where TYPE is one of the QStrings + * contain KEYWORD=TYPE (one per line), where TYPE is one of the std::strings * KeywordType can convert. */ - void PvlFormat::add(const QString &file) { + void PvlFormat::add(const std::string &file) { m_keywordMapFile = file; // Open the file and internalize it into the Pvl map @@ -73,7 +74,7 @@ namespace Isis { add(pvl); } catch(IException &e) { - QString msg; + std::string msg; msg += "Unable to open or read keyword to type mapping file ["; msg += file + "]"; throw IException(e, IException::Programmer, msg, _FILEINFO_); @@ -83,14 +84,16 @@ namespace Isis { /* * Add the contents of a Pvl to the keyword type mapping. The pvl should - * contain KEYWORD=TYPE, where TYPE is one of the QStrings KeywordType can + * contain KEYWORD=TYPE, where TYPE is one of the std::strings KeywordType can * convert. */ void PvlFormat::add(Pvl &pvl) { for(int i = 0; i < pvl.keywords(); ++i) { PvlKeyword &key = pvl[i]; - QString name = key.name().toUpper(); - QString type = key[0].toUpper(); + std::string name = key.name(); + std::transform(name.begin(), name.end(), name.begin(), ::toupper); + std::string type = key[0]; + std::transform(type.begin(), type.end(), type.begin(), ::toupper); PvlKeyword newKey(name, type); for(int j = 1; j < key.size(); ++j) newKey.addValue(key[j]); // Make sure we don't duplicate Keys @@ -108,7 +111,8 @@ namespace Isis { * @param keyword The PvlKeyword to have its type returned */ KeywordType PvlFormat::type(const PvlKeyword &keyword) { - QString name = keyword.name().toUpper(); + std::string name = keyword.name(); + std::transform(name.begin(), name.end(), name.begin(), ::toupper); if(m_keywordMap.hasKeyword(name)) { PvlKeyword &key = m_keywordMap.findKeyword(name); return toKeywordType(key[0]); @@ -126,11 +130,12 @@ namespace Isis { * available in keyword map return -1. */ int PvlFormat::accuracy(const PvlKeyword &keyword) { - QString name = keyword.name().toUpper(); + std::string name = keyword.name(); + std::transform(name.begin(), name.end(), name.begin(), ::toupper); if(m_keywordMap.hasKeyword(name)) { PvlKeyword &key = m_keywordMap.findKeyword(name); if(key.size() > 1) { - return toInt(key[1]); + return std::stoi(key[1]); } } return -1; @@ -143,9 +148,9 @@ namespace Isis { * @param keyword The PvlKeyword to be formatted * @param num Use the ith value of the keyword */ - QString PvlFormat::formatValue(const PvlKeyword &keyword, int num) { + std::string PvlFormat::formatValue(const PvlKeyword &keyword, int num) { - QString val; + std::string val; val.clear(); // Find out if the units are the same for all values @@ -156,7 +161,7 @@ namespace Isis { return "Null"; } - // Create a Null value if the requested index is an empty QString + // Create a Null value if the requested index is an empty std::string if(keyword[num].size() == 0) { val += "Null"; } @@ -200,7 +205,7 @@ namespace Isis { * * @param keyword The PvlContainer being closed. */ - QString PvlFormat::formatName(const PvlKeyword &keyword) { + std::string PvlFormat::formatName(const PvlKeyword &keyword) { return keyword.name(); } @@ -211,7 +216,7 @@ namespace Isis { * @param name The text used to signify the end of a container * @param keyword The PvlContainer being closed. */ - QString PvlFormat::formatEnd(const QString name, + std::string PvlFormat::formatEnd(const std::string name, const PvlKeyword &keyword) { return "End_" + formatName(keyword); } @@ -223,8 +228,8 @@ namespace Isis { * * @param value The PvlKeyword value to be quoted if necessary. */ - QString PvlFormat::addQuotes(const QString value) { - QString val = value; + std::string PvlFormat::addQuotes(const std::string value) { + std::string val = value; bool needQuotes = false; @@ -238,10 +243,10 @@ namespace Isis { // Find closing int closePos = -1; if (val[pos] == '(') { - closePos = val.indexOf(')'); + closePos = val.find(')'); } if (val[pos] == '{') { - closePos = val.indexOf('}'); + closePos = val.find('}'); } // If no closing paren or brace or If closing paren/brace not at end of value diff --git a/isis/src/core/src/PvlFormatPds.cpp b/isis/src/core/src/PvlFormatPds.cpp index e08207d9ea..fdf4bed7b5 100644 --- a/isis/src/core/src/PvlFormatPds.cpp +++ b/isis/src/core/src/PvlFormatPds.cpp @@ -36,14 +36,14 @@ namespace Isis { * @param file A file name with keyword=type. Where KEYWORD is the name of a * keyword and TYPE is one of [string | integer | float | ...] */ - PvlFormatPds::PvlFormatPds(const QString &file) : PvlFormat(file) { + PvlFormatPds::PvlFormatPds(const std::string &file) : PvlFormat(file) { init(); } /* * Constructs a PvlFormatPds using the specified pre populated map of keyword name - * (QString) vs keyword type (KeywordType). + * (std::string) vs keyword type (KeywordType). * * @param keywordType A map with keyword, type. Where keyword is the name of a * keyword in a PvlKeyword and type is one of [string | integer | float ] @@ -64,12 +64,14 @@ namespace Isis { * @param keyword The PvlKeyword to be formatted * @param num Use the ith value of the keyword */ - QString PvlFormatPds::formatValue(const PvlKeyword &keyword, int num) { + std::string PvlFormatPds::formatValue(const PvlKeyword &keyword, int num) { - QString name = keyword.name().toUpper(); + std::string name = keyword.name(); + std::transform(name.begin(), name.end(), name.begin(), ::toupper); if(name == "OBJECT" || (name == "GROUP")) { - QString val = (QString)keyword; - return val.toUpper(); + std::string val = (std::string)keyword; + std::transform(val.begin(), val.end(), val.begin(), ::toupper); + return val; } // Find out what type this keyword is @@ -124,9 +126,9 @@ namespace Isis { * the if portion of the code already * adds quotes automatically */ - QString PvlFormatPds::formatString(const PvlKeyword &keyword, int num) { + std::string PvlFormatPds::formatString(const PvlKeyword &keyword, int num) { - QString val; + std::string val; bool singleUnit = false; // Create a Null value if the value index is greater than the number of values @@ -135,7 +137,8 @@ namespace Isis { } // Handle PDS special values "N/A" "NULL" "UNK" - QString tmp = keyword[num][0].toUpper(); + std::string tmp = std::to_string(keyword[num][0]); + std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper); if((tmp == "N/A") || (tmp == "NULL") || (tmp == "UNK")) { val += "\"" + tmp + "\""; } @@ -152,7 +155,7 @@ namespace Isis { // Add the units to this value if((!singleUnit) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // For now PDS units are case sensitive, so we should not UpCase them // unit.UpCase(); val += " <" + unit + ">"; @@ -170,7 +173,7 @@ namespace Isis { // Add the units to the end if all values have the same units if((singleUnit) && (num == keyword.size() - 1) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // For now PDS units are case sensitive, so we should not UpCase them // unit.UpCase(); val += " <" + unit + ">"; @@ -186,10 +189,10 @@ namespace Isis { * @param keyword The PvlKeyword to be formatted * @param num Use the ith value of the keyword */ - QString PvlFormatPds::formatReal(const PvlKeyword &keyword, int num, + std::string PvlFormatPds::formatReal(const PvlKeyword &keyword, int num, int places) { - QString val; + std::string val; val.clear(); bool singleUnit = false; @@ -204,13 +207,14 @@ namespace Isis { } // Handle PDS special values "N/A" "NULL" "UNK" - QString tmp = keyword[num].toUpper(); + std::string tmp = keyword[num]; + std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper); if((tmp == "N/A") || (tmp == "NULL") || (tmp == "UNK")) { val += "\"" + tmp + "\""; } else if(places >= 0) { stringstream out; - out << setiosflags(ios::fixed) << setprecision(places) << toDouble((QString)keyword[num]); + out << setiosflags(ios::fixed) << setprecision(places) << std::stod(keyword[num]); val += out.str().c_str(); } else { @@ -219,7 +223,7 @@ namespace Isis { // Add the units to this value if((!singleUnit) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -236,7 +240,7 @@ namespace Isis { // Add the units to the end if all values have the same units if((singleUnit) && (num == keyword.size() - 1) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -251,9 +255,9 @@ namespace Isis { * @param keyword The PvlKeyword to be formatted * @param num Use the ith value of the keyword */ - QString PvlFormatPds::formatEnum(const PvlKeyword &keyword, int num) { + std::string PvlFormatPds::formatEnum(const PvlKeyword &keyword, int num) { - QString val; + std::string val; val.clear(); bool singleUnit = false; @@ -268,7 +272,8 @@ namespace Isis { } // Handle PDS special values "N/A" "NULL" "UNK" - QString tmp = keyword[num].toUpper(); + std::string tmp = keyword[num]; + std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper); if((tmp == "N/A") || (tmp == "NULL") || (tmp == "UNK")) { val += "\"" + tmp + "\""; } @@ -278,7 +283,7 @@ namespace Isis { // Add the units to this value if((!singleUnit) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -295,7 +300,7 @@ namespace Isis { // Add the units to the end if all values have the same units if((singleUnit) && (num == keyword.size() - 1) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -315,9 +320,9 @@ namespace Isis { * the if portion of the code already * adds quotes automatically */ - QString PvlFormatPds::formatUnknown(const PvlKeyword &keyword, int num) { + std::string PvlFormatPds::formatUnknown(const PvlKeyword &keyword, int num) { - QString val; + std::string val; val.clear(); bool singleUnit = false; @@ -327,7 +332,8 @@ namespace Isis { } // Handle PDS special values "N/A" "NULL" "UNK" - QString tmp = keyword[num].toUpper(); + std::string tmp = keyword[num]; + std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper); if((tmp == "N/A") || (tmp == "NULL") || (tmp == "UNK")) { val += "\"" + tmp + "\""; } @@ -344,7 +350,7 @@ namespace Isis { // Add the units to this value if((!singleUnit) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -361,7 +367,7 @@ namespace Isis { // Add the units to the end if all values have the same units if((singleUnit) && (num == keyword.size() - 1) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -376,9 +382,9 @@ namespace Isis { * @param keyword The PvlKeyword to be formatted * @param num Use the ith value of the keyword */ - QString PvlFormatPds::formatInteger(const PvlKeyword &keyword, int num, int bytes) { + std::string PvlFormatPds::formatInteger(const PvlKeyword &keyword, int num, int bytes) { - QString val; + std::string val; val.clear(); bool singleUnit = false; @@ -393,7 +399,8 @@ namespace Isis { } // Handle PDS special values "N/A" "NULL" "UNK" - QString tmp = keyword[num].toUpper(); + std::string tmp = keyword[num]; + std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper); if((tmp == "N/A") || (tmp == "NULL") || (tmp == "UNK")) { val += "\"" + tmp + "\""; } @@ -403,7 +410,7 @@ namespace Isis { // Add the units to this value if((!singleUnit) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -420,7 +427,7 @@ namespace Isis { // Add the units to the end if all values have the same units if((singleUnit) && (num == keyword.size() - 1) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -435,9 +442,9 @@ namespace Isis { * @param keyword The PvlKeyword to be formatted * @param num Use the ith value of the keyword */ - QString PvlFormatPds::formatBinary(const PvlKeyword &keyword, int num, int bits) { + std::string PvlFormatPds::formatBinary(const PvlKeyword &keyword, int num, int bits) { - QString val; + std::string val; val.clear(); bool singleUnit = false; @@ -453,13 +460,14 @@ namespace Isis { } // Handle PDS special values "N/A" "NULL" "UNK" - QString tmp = keyword[num].toUpper(); + std::string tmp = keyword[num]; + std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper); if((tmp == "N/A") || (tmp == "NULL") || (tmp == "UNK")) { val += "\"" + tmp + "\""; } else { tmp.clear(); - BigInt value = toBigInt((QString)keyword[num]); + BigInt value = std::stoll(keyword[num]); string binDig = "01"; do { tmp = binDig[value % 2] + tmp; @@ -474,7 +482,7 @@ namespace Isis { // Add the units to this value if((!singleUnit) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -491,7 +499,7 @@ namespace Isis { // Add the units to the end if all values have the same units if((singleUnit) && (num == keyword.size() - 1) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -506,11 +514,9 @@ namespace Isis { * @param keyword The PvlKeyword to be formatted * @param num Use the ith value of the keyword */ + std::string PvlFormatPds::formatHex(const PvlKeyword &keyword, int num, int bytes) { - - QString PvlFormatPds::formatHex(const PvlKeyword &keyword, int num, int bytes) { - - QString val; + std::string val; val.clear(); bool singleUnit = false; @@ -525,29 +531,31 @@ namespace Isis { } // Handle PDS special values "N/A" "NULL" "UNK" - QString tmp = keyword[num].toUpper(); + std::string tmp = keyword[num]; + std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper); if((tmp == "N/A") || (tmp == "NULL") || (tmp == "UNK")) { val += "\"" + tmp + "\""; } else { stringstream ss; if(bytes == 2) { - ss << hex << (unsigned short int)toInt((QString)keyword[num]); + ss << hex << (unsigned short) std::stoul(keyword[num]); } else if(bytes == 4) { - ss << hex << (unsigned int)toInt((QString)keyword[num]); + ss << hex << (unsigned int)std::stoul(keyword[num]); } else { - ss << hex << toBigInt((QString)keyword[num]); + ss << hex << std::stoll(keyword[num]); } - QString h = ss.str().c_str(); - h = h.toUpper(); + std::string h = ss.str().c_str(); + std::transform(h.begin(), h.end(), h.begin(), ::toupper); + val += "16#" + h + "#"; } // Add the units to this value if((!singleUnit) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -564,7 +572,7 @@ namespace Isis { // Add the units to the end if all values have the same units if((singleUnit) && (num == keyword.size() - 1) && (keyword.unit(num).size() > 0)) { - QString unit = keyword.unit(num); + std::string unit = keyword.unit(num); // unit.UpCase(); val += " <" + unit + ">"; } @@ -579,9 +587,9 @@ namespace Isis { * @param keyword The PvlKeyword to be formatted * @param num Use the ith value of the keyword */ - QString PvlFormatPds::formatBool(const PvlKeyword &keyword, int num) { + std::string PvlFormatPds::formatBool(const PvlKeyword &keyword, int num) { - QString val; + std::string val; val.clear(); // Create a Null value if the value index is greater than the number of values @@ -595,8 +603,8 @@ namespace Isis { } // Handle PDS special values "N/A" "NULL" "UNK" - QString tmp = keyword[num]; - tmp = tmp.toUpper(); + std::string tmp = keyword[num]; + std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper); if((tmp == "N/A") || (tmp == "NULL") || (tmp == "UNK")) { val += "\"" + tmp + "\""; } @@ -617,18 +625,16 @@ namespace Isis { } - - /* * Format the name of this container * * @param keyword The keyword (i.e., the Object or Group) */ - QString PvlFormatPds::formatName(const PvlKeyword &keyword) { - QString text = keyword.name(); - text = text.toUpper(); + std::string PvlFormatPds::formatName(const PvlKeyword &keyword) { + std::string text = keyword.name(); + std::transform(text.begin(), text.end(), text.begin(), ::toupper); return text; - }; + } /* @@ -637,14 +643,15 @@ namespace Isis { * @param name A string representing the end text. * @param keyword The keyword (i.e., the Object or Group) that is ending */ - QString PvlFormatPds::formatEnd(const QString name, + std::string PvlFormatPds::formatEnd(const std::string name, const PvlKeyword &keyword) { - QString left = name.toUpper(); + std::string left = name; + std::transform(left.begin(), left.end(), left.begin(), ::toupper); left += " = "; - QString right = (QString)keyword; - right = right.toUpper(); + std::string right = (std::string)keyword; + std::transform(right.begin(), right.end(), right.begin(), ::toupper); return left + right; - }; + } /* @@ -657,14 +664,14 @@ namespace Isis { * the first character of the * string is " or ' */ - QString PvlFormatPds::addQuotes(const QString value) { + std::string PvlFormatPds::addQuotes(const std::string value) { - QString val = value; + std::string val = value; bool quoteValue = true; bool singleQuoteValue = false; - if(val.contains(" ")) { - if(val.contains("\"")) { + if (val.find(" ") != std::string::npos) { + if(val.find("\"") != std::string::npos) { singleQuoteValue = true; quoteValue = false; } diff --git a/isis/src/core/src/PvlGroup.cpp b/isis/src/core/src/PvlGroup.cpp index 09d2321e70..ff16d081f8 100644 --- a/isis/src/core/src/PvlGroup.cpp +++ b/isis/src/core/src/PvlGroup.cpp @@ -19,7 +19,7 @@ namespace Isis { * Creates a PvlGroup object with a name. * @param name The group name. */ - PvlGroup::PvlGroup(const QString &name) : + PvlGroup::PvlGroup(const std::string &name) : Isis::PvlContainer("Group", name) { } @@ -56,7 +56,7 @@ namespace Isis { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "Expected PVL keyword named [Group], found keyword named ["; + std::string msg = "Expected PVL keyword named [Group], found keyword named ["; msg += readKeyword.name(); msg += "] when reading PVL"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -72,7 +72,7 @@ namespace Isis { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "Expected a single value for group name, found [("; + std::string msg = "Expected a single value for group name, found [("; for(int i = 0; i < readKeyword.size(); i++) { if(i != 0) msg += ", "; @@ -105,7 +105,7 @@ namespace Isis { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "Unexpected ["; + std::string msg = "Unexpected ["; msg += readKeyword.name(); msg += "] in Group ["; msg += result.name(); @@ -129,7 +129,7 @@ namespace Isis { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "Group [" + result.name(); + std::string msg = "Group [" + result.name(); msg += "] EndGroup not found before end of file when reading PVL"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -208,7 +208,7 @@ namespace Isis { { // Group cannot be empty - needs to have a keyword if(pPvlGrp.keywords() <= 0) { - QString sErrMsg = "Group \"" + pPvlGrp.name() + "\" has no Keywords\n"; + std::string sErrMsg = "Group \"" + pPvlGrp.name() + "\" has no Keywords\n"; throw IException(IException::User, sErrMsg, _FILEINFO_); } diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index 7e77b97e01..ee63488edb 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -5,9 +5,6 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ -#include -#include -#include #include "PvlKeyword.h" #include "IException.h" #include "Message.h" @@ -31,7 +28,7 @@ namespace Isis { * * @param name The keyword name */ - PvlKeyword::PvlKeyword(QString name) { + PvlKeyword::PvlKeyword(std::string name) { init(); setName(name); } @@ -45,8 +42,8 @@ namespace Isis { * @param value The keyword values. * @param unit The units the values are given in. */ - PvlKeyword::PvlKeyword(QString name, QString value, - QString unit) { + PvlKeyword::PvlKeyword(std::string name, std::string value, + std::string unit) { init(); setName(name); addValue(value, unit); @@ -119,10 +116,15 @@ namespace Isis { * * @param name The new keyword name. */ - void PvlKeyword::setName(QString name) { - QString final = name.trimmed(); - if (final.contains(QRegExp("\\s"))) { - QString msg = "[" + name + "] is invalid. Keyword name cannot "; + void PvlKeyword::setName(std::string name) { + std::string final = name; + final.erase(0, final.find_first_not_of(" \n\r\t")); + final.erase(final.find_last_not_of(" \n\r\t")+1); + + std::smatch sm; + std::regex re("\\s"); + if (std::regex_search(final, sm, re)) { + std::string msg = "[" + name + "] is invalid. Keyword name cannot "; msg += "contain whitespace."; throw IException(IException::User, msg, _FILEINFO_); } @@ -133,9 +135,8 @@ namespace Isis { } if (final != "") { - QByteArray finalAscii = final.toLatin1(); - m_name = new char[finalAscii.size() + 1]; - strncpy(m_name, finalAscii.data(), final.size() + 1); + m_name = new char[final.size() + 1]; + strncpy(m_name, final.c_str(), final.size() + 1); } } @@ -145,7 +146,7 @@ namespace Isis { * If no current value exists, this method sets the given value * to the PvlKeyword. Otherwise, it clears any existing values * and resets to the value given using addValue(). Defaults to - * unit = "" (empty QString). + * unit = "" (empty std::string). * * @param value New value to be assigned. * @param unit Units of measurement corresponding to the value. @@ -154,7 +155,7 @@ namespace Isis { * @see operator= * @see operator+= */ - void PvlKeyword::setValue(QString value, QString unit) { + void PvlKeyword::setValue(std::string value, std::string unit) { clear(); addValue(value, unit); } @@ -165,15 +166,14 @@ namespace Isis { * If no current value exists, this method sets the given json value * to the PvlKeyword. Otherwise, it clears any existing values * and resets to the value given using addJsonValue(). Defaults to - * unit = "" (empty QString). + * unit = "" (empty std::string). * * @param jsonobj New jsobobj to be parsed and assigned. * @param unit Units of measurement corresponding to the value. * * @see addJsonValue() */ - void PvlKeyword::setJsonValue(json jsonobj, QString unit) - { + void PvlKeyword::setJsonValue(json jsonobj, std::string unit) { clear(); addJsonValue(jsonobj, unit); } @@ -183,9 +183,9 @@ namespace Isis { * * @param units New units to be assigned. */ - void PvlKeyword::setUnits(QString units) { + void PvlKeyword::setUnits(std::string units) { if (!m_units) { - m_units = new std::vector(); + m_units = new std::vector(); } m_units->clear(); @@ -204,7 +204,7 @@ namespace Isis { * * @throws Isis::iException::Programmer - Given value must exist */ - void PvlKeyword::setUnits(QString value, QString units) { + void PvlKeyword::setUnits(std::string value, std::string units) { bool found = false; int i = -1; @@ -216,7 +216,7 @@ namespace Isis { if (found) { if (!m_units) { - m_units = new std::vector(m_values.size()); + m_units = new std::vector(m_values.size()); } else { m_units->resize(m_values.size()); @@ -237,7 +237,7 @@ namespace Isis { * * Overwrites the '=' operator to add a new value using addValue(). Like * setValue(), this method clears any previously existing values and resets to - * the given value with unit = "" (empty QString). + * the given value with unit = "" (empty std::string). * * @param value The value to be added. * @return PvlKeyword& Reference to PvlKeyword object. @@ -246,7 +246,7 @@ namespace Isis { * @see setValue() * @see operator+= */ - PvlKeyword &PvlKeyword::operator=(QString value) { + PvlKeyword &PvlKeyword::operator=(std::string value) { clear(); addValue(value); return *this; @@ -258,7 +258,7 @@ namespace Isis { * If no current value exists, this method sets the given value. * Otherwise, it retains any current values and adds the value * given to the array of values for this PvlKeyword object. - * Defaults to unit = "" (empty QString). + * Defaults to unit = "" (empty std::string). * * @param value New value to be assigned. * @param unit Units of measurement corresponding to the value. @@ -267,12 +267,12 @@ namespace Isis { * @see operator= * @see operator+= */ - void PvlKeyword::addValue(QString value, QString unit) { + void PvlKeyword::addValue(std::string value, std::string unit) { m_values.append(value); if (unit != "") { if (!m_units) { - m_units = new std::vector(m_values.size()); + m_units = new std::vector(m_values.size()); } else { m_units->resize(m_values.size()); @@ -292,7 +292,7 @@ namespace Isis { * If no current value exists, this method sets the given json value. * Otherwise, it retains any current values and adds the json value * given to the array of values for this PvlKeyword object using addValue. - * Defaults to unit = "" (empty QString). + * Defaults to unit = "" (empty std::string). * * @param jsonobj New jsonobj to be parsed and assigned. * @param unit Units of measurement corresponding to the value. @@ -302,27 +302,27 @@ namespace Isis { * * @throws Isis::iException::Unknown - jsonobj cannot be an array of values */ - void PvlKeyword::addJsonValue(json jsonobj, QString unit) { - QString value; + void PvlKeyword::addJsonValue(json jsonobj, std::string unit) { + std::string value; if (jsonobj.is_array()) { - QString msg = "Unable to convert " + name() + " with nested json array value into PvlKeyword"; + std::string msg = "Unable to convert " + name() + " with nested json array value into PvlKeyword"; throw IException(IException::Unknown, msg, _FILEINFO_); } else if (jsonobj.is_number()) { - value = QString::number(jsonobj.get(), 'g', 16); + value = jsonobj.get(), 'g', 16; } else if (jsonobj.is_boolean()) { - value = QString(jsonobj.get() ? "true" : "false"); + value = std::string(jsonobj.get() ? "true" : "false"); } else if (jsonobj.is_null()) { - value = QString("Null"); + value = std::string("Null"); } else { - value = QString::fromStdString(jsonobj); + value = jsonobj; } addValue(value, unit); } @@ -332,7 +332,7 @@ namespace Isis { * * Overwrites the '+=' operators to add a new value. Like * addValue(), this method keeps any previously existing values - * and adds the new value with unit = "" (empty QString) to the + * and adds the new value with unit = "" (empty std::string) to the * array of values for this PvlKeyword object. * * @param value The new value. @@ -342,7 +342,7 @@ namespace Isis { * @see setValue() * @see operator= */ - PvlKeyword &PvlKeyword::operator+=(QString value) { + PvlKeyword &PvlKeyword::operator+=(std::string value) { addValue(value); return *this; } @@ -358,7 +358,7 @@ namespace Isis { } - PvlKeyword::operator QString() const { + PvlKeyword::operator std::string() const { return operator[](0); } @@ -375,7 +375,7 @@ namespace Isis { * * @see const operator[] */ - QString &PvlKeyword::operator[](int index) { + std::string &PvlKeyword::operator[](int index) { if (index < 0 || index >= (int)m_values.size()) { std::string msg = (Message::ArraySubscriptNotInRange(index)) + "for Keyword [" + m_name + "]"; @@ -397,7 +397,7 @@ namespace Isis { * * @see operator[] */ - const QString &PvlKeyword::operator[](int index) const { + const std::string &PvlKeyword::operator[](int index) const { if (index < 0 || index >= (int)m_values.size()) { std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); @@ -411,10 +411,10 @@ namespace Isis { * index = 0. * * @param index The index of the unit. - * @return QString The unit at the index. + * @return std::string The unit at the index. * @throws iException ArraySubscriptNotInRange (index) Index out of bounds. */ - QString PvlKeyword::unit(int index) const { + std::string PvlKeyword::unit(int index) const { if (!m_units) return ""; if (index < 0 || index >= (int)m_units->size()) { @@ -433,9 +433,9 @@ namespace Isis { * @see addComments() * @see clearComment() */ - void PvlKeyword::addComment(QString comment) { + void PvlKeyword::addComment(std::string comment) { if (!m_comments) { - m_comments = new std::vector(); + m_comments = new std::vector(); } if (comment.size() == 0) { @@ -467,7 +467,7 @@ namespace Isis { * @see addComments() * @see clearComment() */ - void PvlKeyword::addCommentWrapped(QString comment) { + void PvlKeyword::addCommentWrapped(std::string comment) { IString cmt = comment; IString token = cmt.Token(" "); while(cmt != "") { @@ -495,10 +495,10 @@ namespace Isis { /** * Return a comment at the specified index. * @param index The index of the comment. - * @return QString The comment at the index. + * @return std::string The comment at the index. * @throws iException ArraySubscriptNotInRange (index) Index out of bounds. */ - QString PvlKeyword::comment(int index) const { + std::string PvlKeyword::comment(int index) const { if (!m_comments) return ""; if (index < 0 || index >= (int)m_comments->size()) { @@ -506,16 +506,16 @@ namespace Isis { throw IException(IException::Programmer, msg, _FILEINFO_); } return (*m_comments)[index]; - }; + } /** * Checks if the value needs to be converted to PVL or iPVL and returns it in * the correct format. * @param value The value to be converted. - * @return QString The value in its proper format (iPVL or + * @return std::string The value in its proper format (iPVL or * PVL). */ - QString PvlKeyword::reform(const QString &value) const { + std::string PvlKeyword::reform(const std::string &value) const { #if 0 static bool firstTime = true; static bool iPVL = true; @@ -524,7 +524,7 @@ namespace Isis { Isis::PvlGroup &g = Isis::Preference::Preferences().findGroup( "UserInterface", Isis::Pvl::Traverse); - Isis::IString s = (QString) g["PvlFormat"]; + Isis::IString s = (std::string) g["PvlFormat"]; s.UpCase(); if (s == "PVL") iPVL = false; } @@ -537,25 +537,29 @@ namespace Isis { /** * Converts a value to iPVL format. * @param value The value to be converted. - * @return QString The value in iPVL format. + * @return std::string The value in iPVL format. */ - QString PvlKeyword::toIPvl(const QString &value) const { - QString out; + std::string PvlKeyword::toIPvl(const std::string &value) const { + std::string out; bool upcase = true; bool lastlower = true; for (int i = 0; i < value.size(); i++) { - if ((lastlower) && (value[i].isUpper())) upcase = true; + if ((lastlower) && isupper(value[i])) upcase = true; if (value[i] == '_') { upcase = true; } else if (upcase) { - out += value[i].toUpper(); + std::string valueUpper = std::to_string(value[i]); + std::transform(valueUpper.begin(), valueUpper.end(), valueUpper.begin(), ::toupper); + out += valueUpper; lastlower = false; upcase = false; } else { - out += value[i].toLower(); - if (value[i].isLower()) lastlower = true; + std::string valLower(m_values[i]); + std::transform(valLower.begin(), valLower.end(), valLower.begin(), ::tolower); + out += valLower; + if (islower(value[i])) lastlower = true; upcase = false; } } @@ -565,37 +569,39 @@ namespace Isis { /** * Converts a value to PVL format. * @param value The value to be converted. - * @return QString The value in PVL format. + * @return std::string The value in PVL format. */ - QString PvlKeyword::toPvl(const QString &value) const { - QString out; + std::string PvlKeyword::toPvl(const std::string &value) const { + std::string out; bool lastlower = false; for (int i = 0; i < value.size(); i++) { - if ((lastlower) && (value[i].isUpper())) out += "_"; + if ((lastlower) && isupper(value[i])) out += "_"; if (value[i] == '_') { out += "_"; lastlower = false; } else { - out += value[i].toUpper(); - if (value[i].isLower()) lastlower = true; + std::string valueUpper = std::to_string(value[i]); + std::transform(valueUpper.begin(), valueUpper.end(), valueUpper.begin(), ::toupper); + out += valueUpper; + if (islower(value[i])) lastlower = true; } } return out; } /** - * Checks to see if two QStrings are equal. Each is converted to uppercase + * Checks to see if two std::strings are equal. Each is converted to uppercase * and removed of underscores and whitespaces. - * @param QString1 The first QString - * @param QString2 The second QString + * @param std::string1 The first std::string + * @param std::string2 The second std::string * @return bool True or false, depending on whether - * the QString values are equal. + * the std::string values are equal. */ - bool PvlKeyword::stringEqual(const QString &QString1, - const QString &QString2) { - Isis::IString s1(QString1); - Isis::IString s2(QString2); + bool PvlKeyword::stringEqual(const std::string &string1, + const std::string &string2) { + Isis::IString s1(string1); + Isis::IString s2(string2); s1.ConvertWhiteSpace(); s2.ConvertWhiteSpace(); @@ -612,20 +618,20 @@ namespace Isis { /** * Checks to see if a value with a specified index is equivalent to another - * QString. - * @param QString1 The QString to compare the value to. + * std::string. + * @param string1 The std::string to compare the value to. * @param index The index of the existing value. - * @return bool True if the two QStrings are equivalent, + * @return bool True if the two std::strings are equivalent, * false if they're not. * @throws iException ArraySubscriptNotInRange (index) Index out of bounds. */ - bool PvlKeyword::isEquivalent(QString QString1, int index) const { + bool PvlKeyword::isEquivalent(std::string string1, int index) const { if (index < 0 || index >= (int)m_values.size()) { std::string msg = Message::ArraySubscriptNotInRange(index); throw IException(IException::Programmer, msg, _FILEINFO_); } - return stringEqual(m_values[index], QString1); + return stringEqual(m_values[index], string1); } /** @@ -648,7 +654,7 @@ namespace Isis { if (j < (int) seq[i].size() - 1) temp += ", "; } temp += ")"; - this->operator+=(QString::fromStdString(temp)); + this->operator+=(temp); } return *this; @@ -669,7 +675,7 @@ namespace Isis { * @see operator<< */ ostream &PvlKeyword::writeWithWrap(std::ostream &os, - const QString &textToWrite, + const std::string &textToWrite, int startColumn, PvlFormat &format) const { @@ -686,18 +692,18 @@ namespace Isis { standards are referenced in separate sections. 12.5.3.1 Implementation of String Values - A text QString read in from a label is reassembled into a QString of characters. - The way in which the QString is broken into lines in a label does not affect the - format of the QString after it has been reassembled. The following rules are used - when reading text QStrings: If a format effector or a sequence of - format effectors is encountered within a text QString, + A text std::string read in from a label is reassembled into a std::string of characters. + The way in which the std::string is broken into lines in a label does not affect the + format of the std::string after it has been reassembled. The following rules are used + when reading text std::strings: If a format effector or a sequence of + format effectors is encountered within a text std::string, the effector (or sequence of effectors) is replaced by a single space character, unless the last character is a hyphen (dash) character. Any spacing characters at the end of the line are removed and any spacing characters at the beginning of the following line are removed. This - allows a text QString in a label to appear with the left and right - margins set at arbitrary points without changing the QString value. For - example, the following two QStrings are the same: "To be or + allows a text std::string in a label to appear with the left and right + margins set at arbitrary points without changing the std::string value. For + example, the following two std::strings are the same: "To be or not to be" and "To be or not to be" @@ -705,38 +711,38 @@ namespace Isis { (dash) character, the hyphen is removed with any spacing characters at the beginning of the following line. This follows the standard convention in English of using a hyphen to break a word across lines. - For example, the following two QStrings are the same: + For example, the following two std::strings are the same: "The planet Jupiter is very big" and "The planet Jupi- ter is very big" Control codes, other than the horizontal tabulation character and - format effectors, appearing within a text QString are removed. + format effectors, appearing within a text std::string are removed. */ /* We will be adding a condition for human-readable purposes: - If a quoted QString of text does not fit on the current line, + If a quoted std::string of text does not fit on the current line, but will fit on the next line, use the next line. */ // Position set - QString remainingText = textToWrite; + std::string remainingText = textToWrite; int spaceForText = format.charLimit() - 1 - format.formatEOL().length() - startColumn; // indexOf quote positions to better determine which line to put the - // QString on. Data structure: vector< startPos, endPos > where + // std::string on. Data structure: vector< startPos, endPos > where // remainingText[startPos] and remainingText[endPos] must both be quotes. vector< pair > quotedAreas; int quoteStart = -1; // if its an array, indent subsequent lines 1 more - if (textToWrite.count() > 0 && (textToWrite[0] == '(' || textToWrite[0] == '"')) { + if (textToWrite.size() > 0 && (textToWrite[0] == '(' || textToWrite[0] == '"')) { startColumn ++; } /* Standard 12.3.3.1 -> - A quoted text QString may not contain the quotation mark, which is reserved - to be the text QString delimiter. + A quoted text std::string may not contain the quotation mark, which is reserved + to be the text std::string delimiter. So we don't have to worry about escaped quotes. */ @@ -749,14 +755,14 @@ namespace Isis { // clean up any EOL characters, they mustn't interfere, remove sections of // multiple spaces (make them into one), and indexOf quoted areas for (int pos = 0; pos < remainingText.size(); pos++) { - // remove \r and \n from QString + // remove \r and \n from std::string if (remainingText[pos] == '\n' || remainingText[pos] == '\r') { if (pos != remainingText.size() - 1) { - remainingText = remainingText.mid(0, pos) + - remainingText.mid(pos + 1); + remainingText = remainingText.substr(0, pos) + + remainingText.substr(pos + 1); } else { - remainingText = remainingText.mid(0, pos); + remainingText = remainingText.substr(0, pos); } } @@ -765,8 +771,8 @@ namespace Isis { while(pos > 0 && remainingText[pos-1] == ' ' && remainingText[pos] == ' ') { - remainingText = remainingText.mid(0, pos) + - remainingText.mid(pos + 1); + remainingText = remainingText.substr(0, pos) + + remainingText.substr(pos + 1); } } @@ -810,18 +816,18 @@ namespace Isis { int printedSoFar = 0; // while we have something to write, keep going - while(!remainingText.isEmpty()) { + while(!remainingText.empty()) { // search backwards for the last space or comma *in the limit* (80 chars) int lastSpacePosition = charsLeft; // if everything fits into our remaining space, consider the last - // spot in the QString to be printed still the split position. + // spot in the std::string to be printed still the split position. if (lastSpacePosition >= (int)remainingText.length()) { lastSpacePosition = remainingText.length(); } else { // Everything does not fit; use good space for mediocre splits (inside - // quoted QStrings), and excellent space for good splits (between array + // quoted std::strings), and excellent space for good splits (between array // values for example) int goodSpace = -1; int excellentSpace = -1; @@ -881,37 +887,37 @@ namespace Isis { // we found a space or comma in our limit, write to that chatacter // and repeat the loop if (lastSpacePosition >= 0) { - os << remainingText.mid(0, lastSpacePosition); + os << remainingText.substr(0, lastSpacePosition); - remainingText = remainingText.mid(lastSpacePosition); + remainingText = remainingText.substr(lastSpacePosition); printedSoFar += lastSpacePosition; } // we failed to indexOf a space or a comma in our limit, // use a hyphen (-) else { // Make sure we don't break on "//" since Isis thinks that is a comment - if (remainingText.mid(charsLeft-1, 2) == "//") { - os << remainingText.mid(0, charsLeft - 2); + if (remainingText.substr(charsLeft-1, 2) == "//") { + os << remainingText.substr(0, charsLeft - 2); os << "-"; - remainingText = remainingText.mid(charsLeft - 2); + remainingText = remainingText.substr(charsLeft - 2); printedSoFar += charsLeft - 2; } else { - os << remainingText.mid(0, charsLeft - 1); + os << remainingText.substr(0, charsLeft - 1); os << "-"; - remainingText = remainingText.mid(charsLeft - 1); + remainingText = remainingText.substr(charsLeft - 1); printedSoFar += charsLeft - 1; } } // we wrote as much as possible, do a newline and repeat - if (!remainingText.isEmpty()) { + if (!remainingText.empty()) { os << format.formatEOL(); writeSpaces(os, startColumn); // dont allow spaces to begin the next line inside what we're printing if (remainingText[0] == ' ') { - remainingText = remainingText.mid(1); + remainingText = remainingText.substr(1); printedSoFar += 1; } } @@ -968,8 +974,8 @@ namespace Isis { */ std::istream &operator>>(std::istream &is, PvlKeyword &result) { result = PvlKeyword(); - QString line; - QString keywordString; + std::string line; + std::string keywordString; bool keywordDone = false; bool multiLineComment = false; @@ -983,8 +989,8 @@ namespace Isis { // We read an empty line (failed to read next non-empty line) // and didnt complete our keyword, essentially we hit the implicit // keyword named "End" - if (line.isEmpty() && !is.good()) { - if (keywordString.isEmpty() || + if (line.empty() && !is.good()) { + if (keywordString.empty() || keywordString[keywordString.size()-1] == '\n') { line = "End"; @@ -1010,8 +1016,10 @@ namespace Isis { if (line[1] == '*') { multiLineComment = true; - keywordString += line.mid(0, 2); - line = line.mid(2).trimmed(); + keywordString += line.substr(0, 2); + line = line.substr(2); + line.erase(0, line.find_first_not_of(" \n\r\t")); + line.erase(line.find_last_not_of(" \n\r\t")+1); } } } @@ -1019,20 +1027,20 @@ namespace Isis { if (multiLineComment) { comment = true; - if (line.contains("/*")) { - IString msg = "Error when reading a pvl: Cannot have ['/*'] inside a " + if (line.find("/*") != std::string::npos) { + std::string msg = "Error when reading a pvl: Cannot have ['/*'] inside a " "multi-line comment"; throw IException(IException::Unknown, msg, _FILEINFO_); } - if (line.contains("*/")) { + if (line.find("*/") != std::string::npos) { multiLineComment = false; - line = line.mid(0, line.indexOf("*/")).trimmed() + " */"; + line = line.substr(0, line.find("*/")) + " */"; } } - if (line.isEmpty()) { + if (line.empty()) { continue; } // comment line @@ -1041,12 +1049,12 @@ namespace Isis { continue; } // first line of keyword data - else if (keywordString.isEmpty()) { + else if (keywordString.empty()) { keywordString = line; } // concatenation else if (!comment && keywordString[keywordString.size()-1] == '-') { - keywordString = keywordString.mid(0, keywordString.size() - 1) + line; + keywordString = keywordString.substr(0, keywordString.size() - 1) + line; } // Non-commented and non-concatenation -> put in the space else { @@ -1057,9 +1065,9 @@ namespace Isis { continue; } - std::vector keywordComments; - QString keywordName; - std::vector< std::pair > keywordValues; + std::vector keywordComments; + std::string keywordName; + std::vector< std::pair > keywordValues; bool attemptedRead = false; @@ -1077,7 +1085,7 @@ namespace Isis { is.seekg(beforeLine, ios::beg); - QString msg = "Unable to read PVL keyword ["; + std::string msg = "Unable to read PVL keyword ["; msg += keywordString; msg += "]"; @@ -1112,13 +1120,13 @@ namespace Isis { if (error) { // skip comments - while(keywordString.contains('\n')) { - keywordString = keywordString.mid(keywordString.indexOf('\n') + 1); + if (keywordString.find('\n') != std::string::npos) { + keywordString = keywordString.substr(keywordString.find('\n') + 1); } - QString msg; + std::string msg; - if (keywordString.isEmpty() && !multiLineComment) { + if (keywordString.empty() && !multiLineComment) { msg = "PVL input contains no Pvl Keywords"; } else if (multiLineComment) { @@ -1134,12 +1142,12 @@ namespace Isis { if (!keywordDone) { // skip comments - while(keywordString.contains('\n')) - keywordString = keywordString.mid(keywordString.indexOf('\n') + 1); - - QString msg; + while (keywordString.find('\n') != std::string::npos) { + keywordString = keywordString.substr(keywordString.find('\n') + 1); + } + std::string msg; - if (keywordString.isEmpty()) { + if (keywordString.empty()) { msg = "Error reading PVL keyword"; } else { @@ -1159,7 +1167,7 @@ namespace Isis { * * @param comments Comments to associate with this keyword */ - void PvlKeyword::addComments(const std::vector &comments) { + void PvlKeyword::addComments(const std::vector &comments) { for (unsigned int i = 0; i < comments.size(); i++) { addComment(comments[i]); } @@ -1172,7 +1180,7 @@ namespace Isis { * keyword (if valid) and its status. * * @param keyword Pvl "#COMMENT\n//COMMENT\nKeyword = (Value1,Value2,...)" - * QString + * std::string * @param keywordComments Output: Lines of data that are comments * @param keywordName Output: Name of keyword * @param keywordValues Output: vector< pair > @@ -1180,10 +1188,10 @@ namespace Isis { * @return bool false if it is invalid but could become valid given more data, * true if it is a valid keyword and successful */ - bool PvlKeyword::readCleanKeyword(QString keyword, - std::vector &keywordComments, - QString &keywordName, - std::vector< std::pair > &keywordValues) { + bool PvlKeyword::readCleanKeyword(std::string keyword, + std::vector &keywordComments, + std::string &keywordName, + std::vector< std::pair > &keywordValues) { // Reset outputs keywordComments.clear(); keywordName = ""; @@ -1193,13 +1201,13 @@ namespace Isis { bool explicitIncomplete = false; // Possible (known) comment starts in pvl - QString comments[] = { + std::string comments[] = { "#", "//" }; // Need more data if nothing is here! - if (keyword.isEmpty()) return 0; + if (keyword.empty()) return 0; /* Step 1: Read Comments @@ -1218,32 +1226,32 @@ namespace Isis { */ // While we have newlines, we have comments - while(keyword.contains("\n")) { + while (keyword.find('\n') != std::string::npos) { // Make sure we strip data every loop of comment types; otherwise we // have no comment and need to error out. bool noneStripped = true; // Check every comment type now and make sure this line (it isn't the last // line since a newline exists) starts in a comment - QString keywordStart = keyword.mid(0, 2); + std::string keywordStart = keyword.substr(0, 2); // Handle multi-line comments if (keywordStart == "/*") { noneStripped = false; bool inComment = true; - while(inComment && keyword.contains("*/")) { + while (inComment && keyword.find("*/") != std::string::npos) { // Correct the */ to make sure it has a \n after it, // without this we risk an infinite loop - int closePos = keyword.indexOf("*/\n"); + int closePos = keyword.find("*/\n"); if (closePos == -1) { - closePos = keyword.indexOf("*/") + 2; - keyword = keyword.mid(0, closePos) + "\n" + - keyword.mid(closePos); + closePos = keyword.find("*/") + 2; + keyword = keyword.substr(0, closePos) + "\n" + + keyword.substr(closePos); } - QString comment = keyword.mid(0, keyword.indexOf("\n")).trimmed(); + std::string comment = keyword.substr(0, keyword.find("\n")); // Set these to true if too small, false if not (they need if // cant currently fit). @@ -1254,51 +1262,53 @@ namespace Isis { bool needsEnd = (commentEndPos < 0); bool needsEndSpace = comment.size() < 3; - // Needs are currently set based on QString size, apply real logic + // Needs are currently set based on std::string size, apply real logic // to test for character sequences (try to convert them from false // to true). if (!needsStart) { - needsStart = (comment.mid(0, 2) != "/*"); + needsStart = (comment.substr(0, 2) != "/*"); } if (!needsEnd) { - needsEnd = (comment.mid(commentEndPos, 2) != "*/"); + needsEnd = (comment.substr(commentEndPos, 2) != "*/"); } if (!needsStartSpace) { - needsStartSpace = (comment.mid(0, 3) != "/* "); + needsStartSpace = (comment.substr(0, 3) != "/* "); } if (!needsEndSpace) { - needsEndSpace = (comment.mid(commentEndPos - 1, 3) != " */"); + needsEndSpace = (comment.substr(commentEndPos - 1, 3) != " */"); } if (needsStart) { comment = "/* " + comment; } else if (needsStartSpace) { - comment = "/* " + comment.mid(2); + comment = "/* " + comment.substr(2); } if (needsEnd) { comment = comment + " */"; } else if (needsEndSpace) { - comment = comment.mid(0, comment.size() - 2) + " */";; + comment = comment.substr(0, comment.size() - 2) + " */";; } inComment = needsEnd; keywordComments.push_back(comment); - if (keyword.contains("\n")) { - keyword = keyword.mid(keyword.indexOf("\n") + 1).trimmed(); + if (keyword.find("\n") != std::string::npos) { + keyword = keyword.substr(keyword.find("\n") + 1); + keyword.erase(0, keyword.find_first_not_of(" \n\r\t")); + keyword.erase(keyword.find_last_not_of(" \n\r\t") + 1); } // Check for another comment start if (!inComment) { if (keyword.size() >= 2) - keywordStart = keyword.mid(0, 2); + keywordStart = keyword.substr(0, 2); inComment = (keywordStart == "/*"); } @@ -1308,7 +1318,7 @@ namespace Isis { // Find longest int longest = 0; for (unsigned int index = 0; index < keywordComments.size(); index++) { - QString comment = keywordComments[index]; + std::string comment = keywordComments[index]; if (comment.size() > longest) longest = comment.size(); @@ -1316,11 +1326,11 @@ namespace Isis { // Now make all the sizes match longest for (unsigned int index = 0; index < keywordComments.size(); index++) { - QString comment = keywordComments[index]; + std::string comment = keywordComments[index]; while(comment.size() < longest) { // This adds a space to the end of the comment - comment = comment.mid(0, comment.size() - 2) + " */"; + comment = comment.substr(0, comment.size() - 2) + " */"; } keywordComments[index] = comment; @@ -1330,36 +1340,45 @@ namespace Isis { // Search for single line comments for (unsigned int commentType = 0; - commentType < sizeof(comments) / sizeof(QString); + commentType < sizeof(comments) / sizeof(std::string); commentType++) { - if (keywordStart.startsWith(comments[commentType])) { + if (keywordStart.rfind(comments[commentType], 0) == 0) { // Found a comment start; strip this line out and store it as a // comment! - QString comment = keyword.mid(0, keyword.indexOf("\n")); - keywordComments.push_back(comment.trimmed()); + std::string comment = keyword.substr(0, keyword.find("\n")); + comment.erase(0, comment.find_first_not_of(" \n\r\t")); + comment.erase(comment.find_last_not_of(" \n\r\t") + 1); + keywordComments.push_back(comment); noneStripped = false; - - if (keyword.contains("\n")) { - keyword = keyword.mid(keyword.indexOf("\n") + 1).trimmed(); + if (keyword.find("\n") != std::string::npos) { + keyword = keyword.substr(keyword.find("\n") + 1); + keyword.erase(0, keyword.find_first_not_of(" \n\r\t")); + keyword.erase(keyword.find_last_not_of(" \n\r\t") + 1); } } } // Does it look like Name=Value/*comm // mment*/ ? - if (noneStripped && keyword.contains("/*") && - keyword.contains("*/")) { - QString firstPart = keyword.mid(0, keyword.indexOf("\n")); - QString lastPart = keyword.mid(keyword.indexOf("\n") + 1); - - keyword = firstPart.trimmed() + " " + lastPart.trimmed(); + if (noneStripped && keyword.find("/*") != std::string::npos && + keyword.find("*/") != std::string::npos) { + std::string firstPart = keyword.substr(0, keyword.find("\n")); + std::string lastPart = keyword.substr(keyword.find("\n") + 1); + + firstPart.erase(0, firstPart.find_first_not_of(" \n\r\t")); + firstPart.erase(firstPart.find_last_not_of(" \n\r\t") + 1); + + lastPart.erase(0, lastPart.find_first_not_of(" \n\r\t")); + lastPart.erase(lastPart.find_last_not_of(" \n\r\t") + 1); + + keyword = firstPart + " " + lastPart; noneStripped = false; } if (noneStripped) { - QString msg = "Expected a comment in PVL but found ["; + std::string msg = "Expected a comment in PVL but found ["; msg += keyword; msg += "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -1367,7 +1386,7 @@ namespace Isis { } // Do we have a keyword at all? - if (keyword.isEmpty()) { + if (keyword.empty()) { return false; // need more data } @@ -1386,7 +1405,7 @@ namespace Isis { // we have taken the name; if nothing remains then it is value-less // and we are done. - if (keyword.isEmpty()) { + if (keyword.empty()) { /* Step 3.1 @@ -1418,16 +1437,18 @@ namespace Isis { // if we don't have an equal, then we have a problem - an invalid symbol. // Our possible remaining formats both are KEYWORD = ... if (keyword[0] != '=') { - QString msg = "Expected an assignment [=] when reading PVL, but found ["; + std::string msg = "Expected an assignment [=] when reading PVL, but found ["; msg += keyword[0]; msg += "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } - keyword = keyword.mid(1).trimmed(); + keyword = keyword.substr(1); + keyword.erase(0, keyword.find_first_not_of(" \n\r\t")); + keyword.erase(keyword.find_last_not_of(" \n\r\t") + 1); - if (keyword.isEmpty()) { + if (keyword.empty()) { return false; } @@ -1452,27 +1473,29 @@ namespace Isis { // strip '(' - onetime, this makes every element in the array the same // (except the last) - keyword = keyword.mid(1).trimmed(); + keyword = keyword.substr(1); + keyword.erase(0, keyword.find_first_not_of(" \n\r\t")); + keyword.erase(keyword.find_last_not_of(" \n\r\t") + 1); // handle empty arrays: KEYWORD = () - if (!keyword.isEmpty() && keyword[0] == closingParen) { + if (!keyword.empty() && keyword[0] == closingParen) { closedProperly = true; } // Each iteration of this loop should consume 1 value in the array, // including the comma, i.e. we should start out with: // 'VALUE,VALUE,...)' until we hit ')' (our exit condition) - while(!keyword.isEmpty() && keyword[0] != closingParen) { + while(!keyword.empty() && keyword[0] != closingParen) { // foundComma delimits the end of this element in the array (remains // false for last value which has no comma at the end) bool foundComma = false; // keyword should be of the format: VALUE ,....) // Read VALUE from it - QString nextItem = readValue(keyword, explicitIncomplete, extraDelims); + std::string nextItem = readValue(keyword, explicitIncomplete, extraDelims); - if (!keyword.isEmpty() && keyword[0] == wrongClosingParen) { + if (!keyword.empty() && keyword[0] == wrongClosingParen) { - QString msg = "Incorrect array close when reading PVL; expected ["; + std::string msg = "Incorrect array close when reading PVL; expected ["; msg += closingParen; msg += "] but found ["; msg += wrongClosingParen; @@ -1483,32 +1506,34 @@ namespace Isis { } // This contains - pair keywordValue; + pair keywordValue; // Store VALUE keywordValue.first = nextItem; // Now there's 2 possibilities: units or no units -> // if we have units, read them - if (!keyword.isEmpty() && keyword[0] == '<') { - QString unitsValue = readValue(keyword, explicitIncomplete); + if (!keyword.empty() && keyword[0] == '<') { + std::string unitsValue = readValue(keyword, explicitIncomplete); keywordValue.second = unitsValue; } // Now we should* have a comma, strip it - if (!keyword.isEmpty() && keyword[0] == ',') { + if (!keyword.empty() && keyword[0] == ',') { foundComma = true; - keyword = keyword.mid(1).trimmed(); + keyword = keyword.substr(1); + keyword.erase(0, keyword.find_first_not_of(" \n\r\t")); + keyword.erase(keyword.find_last_not_of(" \n\r\t") + 1); } - // No comma and nothing more in QString - we found + // No comma and nothing more in std::string - we found // KEYWORD = (VALUE,VALUE\0 // we need more information to finish this keyword - if (!foundComma && keyword.isEmpty()) { + if (!foundComma && keyword.empty()) { return false; // could become valid later } - bool foundCloseParen = (!keyword.isEmpty() && keyword[0] == closingParen); + bool foundCloseParen = (!keyword.empty() && keyword[0] == closingParen); if (foundCloseParen) { closedProperly = true; @@ -1518,7 +1543,7 @@ namespace Isis { // keyword = (VALUE,VALUE,) // which is unrecoverable if (foundComma && foundCloseParen) { - QString msg = "Unexpected close of keyword-value array when reading " + std::string msg = "Unexpected close of keyword-value array when reading " "PVL"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -1529,7 +1554,7 @@ namespace Isis { if (explicitIncomplete) return false; // We have (VALUE VALUE - QString msg = "Found extra data after ["; + std::string msg = "Found extra data after ["; msg += nextItem; msg += "] in array when reading PVL"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -1544,16 +1569,18 @@ namespace Isis { } // Trim off the closing paren - if (!keyword.isEmpty()) { - keyword = keyword.mid(1).trimmed(); + if (!keyword.empty()) { + keyword = keyword.substr(1); + keyword.erase(0, keyword.find_first_not_of(" \n\r\t")); + keyword.erase(keyword.find_last_not_of(" \n\r\t") + 1); } // Read units here if they exist and apply them // case: (A,B,C) - if (!keyword.isEmpty() && keyword[0] == '<') { - QString units = readValue(keyword, explicitIncomplete); + if (!keyword.empty() && keyword[0] == '<') { + std::string units = readValue(keyword, explicitIncomplete); for (unsigned int val = 0; val < keywordValues.size(); val++) { - if (keywordValues[val].second.isEmpty()) { + if (keywordValues[val].second.empty()) { keywordValues[val].second = units; } } @@ -1568,10 +1595,10 @@ namespace Isis { We need to read the single value/unit in the keywordValues array. */ - pair keywordValue; + pair keywordValue; keywordValue.first = readValue(keyword, explicitIncomplete); - if (!keyword.isEmpty() && keyword[0] == '<') { + if (!keyword.empty() && keyword[0] == '<') { keywordValue.second = readValue(keyword, explicitIncomplete); } @@ -1589,15 +1616,15 @@ namespace Isis { /* See if we have a comment at the end of the keyword... */ - if (!keyword.isEmpty()) { + if (!keyword.empty()) { // if the data left is a comment, we can handle it probably if (keyword[0] == '#' || ((keyword.size() > 1 && keyword[0] == '/') && (keyword[1] == '/' || keyword[1] == '*'))) { keywordComments.push_back(keyword); - if (keyword.size() > 1 && keyword.mid(0, 2) == "/*") { - if (keyword.mid(keyword.size() - 2, 2) != "*/") + if (keyword.size() > 1 && keyword.substr(0, 2) == "/*") { + if (keyword.substr(keyword.size() - 2, 2) != "*/") return false; // need more comment data } @@ -1606,9 +1633,9 @@ namespace Isis { } // check for extraneous data in the keyword ... ,2,3 - QRegularExpression regex("^,"); - QRegularExpressionMatch match = regex.match(keyword); - if (!keyword.isEmpty() && match.hasMatch()) { + std::regex regex("^,"); + std::smatch match; + if (!keyword.empty() && std::regex_match(keyword, match, regex)) { keywordValues.at(0).first += keyword; keyword = ""; } @@ -1616,8 +1643,8 @@ namespace Isis { /* If more data remains, it is unrecognized. */ - if (!keyword.isEmpty()) { - QString msg = "Keyword has extraneous data ["; + if (!keyword.empty()) { + std::string msg = "Keyword has extraneous data ["; msg += keyword; msg += "] at the end"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -1628,16 +1655,16 @@ namespace Isis { } - QString PvlKeyword::readValue(QString &keyword, bool "eProblem) { + std::string PvlKeyword::readValue(std::string &keyword, bool "eProblem) { std::vector< std::pair > otherDelims; return readValue(keyword, quoteProblem, otherDelims); } /** - * This method looks for a data element in the QString. A data element is a - * quoted QString, a units value, or one value of an array (not including - * units). As an example, each value in the following QString is quoted: + * This method looks for a data element in the std::string. A data element is a + * quoted std::string, a units value, or one value of an array (not including + * units). As an example, each value in the following std::string is quoted: * * 'VALUE' '=' ('VALUE','VALUE', 'VALUE' '') * @@ -1646,20 +1673,21 @@ namespace Isis { * * @param keyword Input/Output: The keyword to get the next value from * (DESTRUCTIVE) - * @param quoteProblem Output: The QString has an unclosed quote character + * @param quoteProblem Output: The std::string has an unclosed quote character * - * @return QString The stripped out token. + * @return std::string The stripped out token. */ - QString PvlKeyword::readValue(QString &keyword, bool "eProblem, + std::string PvlKeyword::readValue(std::string &keyword, bool "eProblem, const std::vector< std::pair > & otherDelimiters) { - QString value = ""; + std::string value = ""; - // This method ignores spaces except as delimiters; let's trim the QString + // This method ignores spaces except as delimiters; let's trim the std::string // to start - keyword = keyword.trimmed(); + keyword.erase(0, keyword.find_first_not_of(" \n\r\t")); + keyword.erase(keyword.find_last_not_of(" \n\r\t") + 1); - if (keyword.isEmpty()) { + if (keyword.empty()) { return ""; } @@ -1668,7 +1696,7 @@ namespace Isis { // PVLs. However, "HELLO WORLD" has an explicit (not implied) double quote. // We do consider <> as quotes. bool impliedQuote = true; - QChar quoteEnd = ' '; + char quoteEnd = ' '; bool keepQuotes = false; if (keyword[0] == '\'' || keyword[0] == '"') { @@ -1718,34 +1746,35 @@ namespace Isis { } } - QString startQuote; + std::string startQuote; // non-implied delimeters need the opening delimiter ignored. Remember // startQuote in case of error later on we can reconstruct the original - // QString. + // std::string. if (!impliedQuote) { startQuote += keyword[0]; - keyword = keyword.mid(1); + keyword = keyword.substr(1); } // Do we have a known quote end? - int quoteEndPos = keyword.indexOf(quoteEnd); + int quoteEndPos = keyword.find(quoteEnd); if (quoteEndPos != -1) { - value = keyword.mid(0, quoteEndPos); + value = keyword.substr(0, quoteEndPos); // Trim keyword 1 past end delimiter (if end delimiter is last, this - // results in empty QString). If the close delimiter is ')' or ',' then + // results in empty std::string). If the close delimiter is ')' or ',' then // leave it be however, since we need to preserve that to denote this was // an end of a valuein array keyword. if (!impliedQuote) { - keyword = keyword.mid(quoteEndPos + 1); + keyword = keyword.substr(quoteEndPos + 1); } else { - keyword = keyword.mid(quoteEndPos); + keyword = keyword.substr(quoteEndPos); } // Make sure we dont have padding - keyword = keyword.trimmed(); + keyword.erase(0, keyword.find_first_not_of(" \n\r\t")); + keyword.erase(keyword.find_last_not_of(" \n\r\t") + 1); if (keepQuotes) { value = startQuote + value + quoteEnd; @@ -1756,7 +1785,7 @@ namespace Isis { // implied quotes terminate at end of keyword; otherwise we have a problem // (which is this condition) else if (!impliedQuote) { - // restore the original QString + // restore the original std::string keyword = startQuote + keyword; quoteProblem = true; @@ -1783,12 +1812,12 @@ namespace Isis { * * @param is The stream to read from * - * @return QString The first encountered line of data + * @return std::string The first encountered line of data */ - QString PvlKeyword::readLine(std::istream &is, bool insideComment) { - QString lineOfData; + std::string PvlKeyword::readLine(std::istream &is, bool insideComment) { + std::string lineOfData; - while(is.good() && lineOfData.isEmpty()) { + while(is.good() && lineOfData.empty()) { // read until \n (works for both \r\n and \n) or */ while(is.good() && @@ -1822,7 +1851,8 @@ namespace Isis { } // Trim off non-visible characters from this line of data - lineOfData = lineOfData.trimmed(); + lineOfData.erase(0, lineOfData.find_first_not_of(" \n\r\t")); + lineOfData.erase(lineOfData.find_last_not_of(" \n\r\t") + 1); // read up to next non-whitespace in input stream while(is.good() && @@ -1868,7 +1898,7 @@ namespace Isis { os << " "; ++startColumn; } - QString keyname = tempFormat->formatName(keyword); + std::string keyname = tempFormat->formatName(keyword); os << keyname; startColumn += keyname.length(); @@ -1886,7 +1916,7 @@ namespace Isis { } // Loop and write each array value - QString stringToWrite; + std::string stringToWrite; for (int i = 0; i < keyword.size(); i ++) { stringToWrite += tempFormat->formatValue(keyword, i); } @@ -1924,7 +1954,7 @@ namespace Isis { } if (other.m_units) { - m_units = new std::vector(*other.m_units); + m_units = new std::vector(*other.m_units); } if (m_comments) { @@ -1933,7 +1963,7 @@ namespace Isis { } if (other.m_comments) { - m_comments = new std::vector(*other.m_comments); + m_comments = new std::vector(*other.m_comments); } m_width = other.m_width; @@ -1955,30 +1985,31 @@ namespace Isis { * @param psValueType - Value Type (positive / negative) for numbers * @param pvlKwrdValue - Template Keyword __Value or __Range to validate keyword's value */ - void PvlKeyword::validateKeyword(PvlKeyword & pvlKwrd, QString psValueType, PvlKeyword* pvlKwrdValue) + void PvlKeyword::validateKeyword(PvlKeyword & pvlKwrd, std::string psValueType, PvlKeyword* pvlKwrdValue) { int iSize = pvlKwrd.size(); - QString sType = m_values[0].toLower(); + std::string sType(m_values[0]); + std::transform(sType.begin(), sType.end(), sType.begin(), ::tolower); // Value type if (psValueType.length()) { - psValueType = psValueType.toLower(); + std::transform(psValueType.begin(), psValueType.end(), psValueType.begin(), ::tolower); } double dRangeMin=0, dRangeMax=0; bool bRange = false; bool bValue = false; if (pvlKwrdValue != NULL) { - QString sValueName = pvlKwrdValue->name(); + std::string sValueName = pvlKwrdValue->name(); // Check for Range - if (sValueName.contains("__Range")) { - dRangeMin = toDouble((*pvlKwrdValue)[0]); - dRangeMax = toDouble((*pvlKwrdValue)[1]); + if (sValueName.find("__Range") != std::string::npos) { + dRangeMin = std::stod((*pvlKwrdValue)[0]); + dRangeMax = std::stod((*pvlKwrdValue)[1]); bRange = true; } - else if (sValueName.contains("__Value")) { + else if (sValueName.find("__Value") != std::string::npos) { bValue = true; } } @@ -1986,36 +2017,37 @@ namespace Isis { // Type integer if (sType == "integer") { for (int i=0; i dRangeMax)) { - QString sErrMsg = "\"" +pvlKwrd.name() +"\" is not in the specified Range"; + std::string sErrMsg = "\"" +pvlKwrd.name() +"\" is not in the specified Range"; throw IException(IException::User, sErrMsg, _FILEINFO_); } if (bValue) { bool bFound = false; for (int j=0; jsize(); j++) { - if (iValue == toInt((*pvlKwrdValue)[j])) { + if (iValue == std::stoi((*pvlKwrdValue)[j])) { bFound = true; break; } } if (!bFound) { - QString sErrMsg = "\"" +pvlKwrd.name() +"\" has value not in the accepted list"; + std::string sErrMsg = "\"" +pvlKwrd.name() +"\" has value not in the accepted list"; throw IException(IException::User, sErrMsg, _FILEINFO_); } } // Type is specified (positive / negative) if (psValueType.length()) { if ((psValueType == "positive" && iValue < 0) || (psValueType == "negative" && iValue >= 0) ) { - QString sErrMsg = "\"" +pvlKwrd.name() +"\" has invalid value"; + std::string sErrMsg = "\"" +pvlKwrd.name() +"\" has invalid value"; throw IException(IException::User, sErrMsg, _FILEINFO_); } } @@ -2027,30 +2059,31 @@ namespace Isis { // Type double if (sType == "double") { for (int i=0; i dRangeMax)) { - QString sErrMsg = "\"" +pvlKwrd.name() +"\" is not in the specified Range"; + std::string sErrMsg = "\"" +pvlKwrd.name() +"\" is not in the specified Range"; throw IException(IException::User, sErrMsg, _FILEINFO_); } if (bValue) { bool bFound = false; for (int j=0; jsize(); j++) { - if (dValue == toDouble((*pvlKwrdValue)[j])) { + if (dValue == std::stod((*pvlKwrdValue)[j])) { bFound = true; break; } } if (!bFound) { - QString sErrMsg = "\"" +pvlKwrd.name() +"\" has value not in the accepted list"; + std::string sErrMsg = "\"" +pvlKwrd.name() +"\" has value not in the accepted list"; throw IException(IException::User, sErrMsg, _FILEINFO_); } } // Type is specified (positive / negative) if (psValueType.length()) { if ((psValueType == "positive" && dValue < 0) || (psValueType == "negative" && dValue >= 0) ) { - QString sErrMsg = "\"" +pvlKwrd.name() +"\" has invalid value"; + std::string sErrMsg = "\"" +pvlKwrd.name() +"\" has invalid value"; throw IException(IException::User, sErrMsg, _FILEINFO_); } } @@ -2062,9 +2095,10 @@ namespace Isis { // Type boolean if (sType == "boolean") { for (int i=0; isize(); i++) { - if (sValue == (*pvlKwrdValue)[i].toLower()) { + std::string kwrdValue = (*pvlKwrdValue)[i]; + std::transform(kwrdValue.begin(), kwrdValue.end(), kwrdValue.begin(), ::tolower); + if (sValue == kwrdValue) { bValFound = true; break; } } if (!bValFound) { - QString sErrMsg = "Wrong Type of value in the Keyword \"" + name() + "\" \n"; + std::string sErrMsg = "Wrong Type of value in the Keyword \"" + name() + "\" \n"; throw IException(IException::User, sErrMsg, _FILEINFO_); } } diff --git a/isis/src/core/src/PvlObject.cpp b/isis/src/core/src/PvlObject.cpp index fbc7c798d9..18916e8d9e 100644 --- a/isis/src/core/src/PvlObject.cpp +++ b/isis/src/core/src/PvlObject.cpp @@ -32,7 +32,7 @@ namespace Isis { * * @param name The name of the PvlObject. */ - PvlObject::PvlObject(const QString &name) : + PvlObject::PvlObject(const std::string &name) : Isis::PvlContainer("Object", name) { } @@ -57,19 +57,19 @@ namespace Isis { * @param name The name of the PvlObject. * @param json Json object to convert to PVL */ - PvlObject::PvlObject(const QString &name, const json &jsonobj) : + PvlObject::PvlObject(const std::string &name, const json &jsonobj) : PvlContainer("Object", name) { for(auto it = jsonobj.begin(); it != jsonobj.end(); it++) { PvlKeyword keyword; - keyword.setName(QString::fromStdString(it.key())); + keyword.setName(std::string(it.key())); if (it.value().is_array()) { for(auto ar = it.value().begin(); ar!=it.value().end(); ar++) { try { keyword.addJsonValue(*ar); } catch (IException &e) { - QString msg = "While attempting to parse " + name + " the following occured"; + std::string msg = "While attempting to parse " + name + " the following occured"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -91,7 +91,7 @@ namespace Isis { * * @throws IException */ - Isis::PvlGroup &PvlObject::findGroup(const QString &name, + Isis::PvlGroup &PvlObject::findGroup(const std::string &name, PvlObject::FindOptions opts) { vector searchList; searchList.push_back(this); @@ -110,7 +110,7 @@ namespace Isis { searchList.erase(searchList.begin()); } - QString msg = "Unable to find PVL group [" + name + "]"; + std::string msg = "Unable to find PVL group [" + name + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -126,7 +126,7 @@ namespace Isis { * * @throws IException */ - const Isis::PvlGroup &PvlObject::findGroup(const QString &name, + const Isis::PvlGroup &PvlObject::findGroup(const std::string &name, PvlObject::FindOptions opts) const { vector searchList; searchList.push_back(this); @@ -145,7 +145,7 @@ namespace Isis { searchList.erase(searchList.begin()); } - QString msg = "Unable to find PVL group [" + name + "]"; + std::string msg = "Unable to find PVL group [" + name + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -166,7 +166,7 @@ namespace Isis { * * @throws IException */ - PvlKeyword &PvlObject::findKeyword(const QString &kname, + PvlKeyword &PvlObject::findKeyword(const std::string &kname, FindOptions opts) { // Call the parent's version if they don't want to dig deeper @@ -207,7 +207,7 @@ namespace Isis { } // No where else to look for the Keyword so throw an error - QString msg = "Unable to find PVL keyword [" + kname + "]"; + std::string msg = "Unable to find PVL keyword [" + kname + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -225,7 +225,7 @@ namespace Isis { * * @return True if the Keyword exists False otherwise. */ - bool PvlObject::hasKeyword(const QString &kname, + bool PvlObject::hasKeyword(const std::string &kname, FindOptions opts) const { // Call the parent's version if they don't want to dig deeper @@ -279,7 +279,7 @@ namespace Isis { * * @throws IException */ - PvlObject &PvlObject::findObject(const QString &name, + PvlObject &PvlObject::findObject(const std::string &name, PvlObject::FindOptions opts) { vector searchList; searchList.push_back(this); @@ -298,7 +298,7 @@ namespace Isis { searchList.erase(searchList.begin()); } - QString msg = "Unable to find PVL object [" + name + "]"; + std::string msg = "Unable to find PVL object [" + name + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -314,7 +314,7 @@ namespace Isis { * * @throws IException */ - const PvlObject &PvlObject::findObject(const QString &name, + const PvlObject &PvlObject::findObject(const std::string &name, FindOptions opts) const { vector searchList; searchList.push_back(this); @@ -338,7 +338,7 @@ namespace Isis { searchList.erase(searchList.begin()); } - QString msg = "Unable to find PVL object [" + name + "]"; + std::string msg = "Unable to find PVL object [" + name + "]"; if(m_filename.size() > 0) { msg += " in file [" + m_filename + "]"; @@ -355,10 +355,10 @@ namespace Isis { * * @throws IException */ - void PvlObject::deleteObject(const QString &name) { + void PvlObject::deleteObject(const std::string &name) { PvlObjectIterator key = findObject(name, beginObject(), endObject()); if(key == endObject()) { - QString msg = "Unable to find PVL object [" + name + "] in " + type() + + std::string msg = "Unable to find PVL object [" + name + "] in " + type() + " [" + this->name() + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -377,7 +377,7 @@ namespace Isis { */ void PvlObject::deleteObject(const int index) { if(index >= (int)m_objects.size() || index < 0) { - QString msg = "The specified index is out of bounds in PVL " + type() + + std::string msg = "The specified index is out of bounds in PVL " + type() + " [" + name() + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -397,10 +397,10 @@ namespace Isis { * * @throws IException */ - void PvlObject::deleteGroup(const QString &name) { + void PvlObject::deleteGroup(const std::string &name) { PvlGroupIterator key = findGroup(name, beginGroup(), endGroup()); if(key == endGroup()) { - QString msg = "Unable to find PVL group [" + name + "] in " + type() + + std::string msg = "Unable to find PVL group [" + name + "] in " + type() + " [" + this->name() + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -419,7 +419,7 @@ namespace Isis { */ void PvlObject::deleteGroup(const int index) { if(index >= (int)m_groups.size() || index < 0) { - QString msg = "The specified index is out of bounds in PVL " + type() + + std::string msg = "The specified index is out of bounds in PVL " + type() + " [" + name() + "]"; if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -536,15 +536,15 @@ namespace Isis { // Include files take precedence to all other objects and groups for(int i = 0; i < outTemplate.keywords(); i++) { if(outTemplate[i].isNamed("Isis:PvlTemplate:File")) { - QString filename = outTemplate[i]; - Isis::FileName file(filename); + std::string filename = outTemplate[i]; + Isis::FileName file(QString::fromStdString(filename)); if(!file.fileExists()) { - QString message = "Could not open the following PVL template file: "; + std::string message = "Could not open the following PVL template file: "; message += filename; throw IException(IException::Io, message, _FILEINFO_); } - Isis::Pvl include(file.expanded()); + Isis::Pvl include(file.expanded().toStdString()); for(int j = 0; j < include.keywords(); j++) { if(!newTemp.hasKeyword(include[j].name())) @@ -713,7 +713,7 @@ namespace Isis { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "Expected PVL keyword named [Object], found keyword named ["; + std::string msg = "Expected PVL keyword named [Object], found keyword named ["; msg += readKeyword.name(); msg += "]"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -725,7 +725,7 @@ namespace Isis { else { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "Expected a single value for PVL object name, found [("; + std::string msg = "Expected a single value for PVL object name, found [("; for(int i = 0; i < readKeyword.size(); i++) { if(i != 0) msg += ", "; @@ -756,7 +756,7 @@ namespace Isis { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "Unexpected ["; + std::string msg = "Unexpected ["; msg += readKeyword.name(); msg += "] in PVL Object ["; msg += result.name(); @@ -800,7 +800,7 @@ namespace Isis { is.seekg(beforeKeywordPos, ios::beg); - QString msg = "PVL Object [" + result.name(); + std::string msg = "PVL Object [" + result.name(); msg += "] EndObject not found before end of file"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -838,7 +838,7 @@ namespace Isis { for(int i=0; ioperator+=(key[i].toStdString()); + this->operator+=(key[i]); } return *this; } @@ -42,7 +42,7 @@ namespace Isis { PvlKeyword &key = pvl["temp"]; std::vector temp; for(int i = 0; i < key.size(); i++) { - temp.push_back(key[i].toStdString()); + temp.push_back(key[i]); } p_sequence.push_back(temp); return *this; diff --git a/isis/src/core/src/Table.cpp b/isis/src/core/src/Table.cpp index b93bed9798..533b7423ff 100644 --- a/isis/src/core/src/Table.cpp +++ b/isis/src/core/src/Table.cpp @@ -41,7 +41,7 @@ namespace Isis { * @param tableName Name of the Table to be read * @param rec Name of the TableRecord to be read into the Table */ - Table::Table(const QString &tableName, Isis::TableRecord &rec) { + Table::Table(const std::string &tableName, Isis::TableRecord &rec) { p_name = tableName; p_assoc = Table::None; p_label += Isis::PvlKeyword("Records", 0); @@ -65,7 +65,7 @@ namespace Isis { * * @param tableName Name of the Table to be read */ - Table::Table(const QString &tableName) { + Table::Table(const std::string &tableName) { p_name = tableName; p_assoc = Table::None; } @@ -85,8 +85,8 @@ namespace Isis { * * @see Blob::Read() */ - Table::Table(const QString &tableName, const QString &file) { - Blob blob(tableName, "Table", file); + Table::Table(const std::string &tableName, const QString &file) { + Blob blob(QString::fromStdString(tableName), "Table", file); initFromBlob(blob); } @@ -106,8 +106,8 @@ namespace Isis { * * @see Blob::Read() */ - Table::Table(const QString &tableName, const QString &file, const Pvl &fileHeader) { - Blob blob(tableName, "Table"); + Table::Table(const std::string &tableName, const QString &file, const Pvl &fileHeader) { + Blob blob(QString::fromStdString(tableName), "Table"); blob.Read(file, fileHeader); initFromBlob(blob); } @@ -221,15 +221,15 @@ namespace Isis { p_assoc = Table::None; if (p_label.hasKeyword("Association")) { - QString temp = (QString) p_label["Association"]; - temp = temp.toUpper(); + std::string temp = (std::string) p_label["Association"]; + std::transform(temp.begin(), temp.end(), temp.begin(), ::toupper); if (temp == "SAMPLES") p_assoc = Table::Samples; if (temp == "LINES") p_assoc = Table::Lines; if (temp == "BANDS") p_assoc = Table::Bands; } // Determine if we need to swap stuff when we read the data - Isis::ByteOrder bo = Isis::ByteOrderEnumeration(p_label["ByteOrder"]); + Isis::ByteOrder bo = Isis::ByteOrderEnumeration(QString::fromStdString(p_label["ByteOrder"])); p_swap = false; if (Isis::IsLsb() && (bo == Isis::Msb)) p_swap = true; if (Isis::IsMsb() && (bo == Isis::Lsb)) p_swap = true; @@ -300,9 +300,9 @@ namespace Isis { /** * The Table's name * - * @return @b QString the name of the Table + * @return @b std::string the name of the Table */ - QString Table::Name() const { + std::string Table::Name() const { return p_name; } @@ -419,10 +419,10 @@ namespace Isis { } if (RecordSize() != rec.RecordSize()) { - QString msg = "Unable to add the given record with size = [" - + Isis::toString(rec.RecordSize()) + " bytes] to to Isis Table [" + std::string msg = "Unable to add the given record with size = [" + + std::to_string(rec.RecordSize()) + " bytes] to to Isis Table [" + p_name + "] with record size = [" - + Isis::toString(RecordSize()) + " bytes]. Record sizes must match."; + + std::to_string(RecordSize()) + " bytes]. Record sizes must match."; throw IException(IException::Unknown, msg, _FILEINFO_); } char *newbuf = new char[RecordSize()]; @@ -470,18 +470,18 @@ namespace Isis { * @return @b Blob The Blob contaning the Table's data */ Blob Table::toBlob() const { - Blob tableBlob(Name(), "Table"); + Blob tableBlob(QString::fromStdString(Name()), "Table"); PvlObject &blobLabel = tableBlob.Label(); // Label setup - blobLabel += PvlKeyword("Records", Isis::toString(Records())); + blobLabel += PvlKeyword("Records", std::to_string(Records())); int nbytes = Records() * RecordSize(); if (Isis::IsLsb()) { - blobLabel+= PvlKeyword("ByteOrder", Isis::ByteOrderName(Isis::Lsb)); + blobLabel+= PvlKeyword("ByteOrder", Isis::ByteOrderName(Isis::Lsb).toStdString()); } else { - blobLabel+= PvlKeyword("ByteOrder", Isis::ByteOrderName(Isis::Msb)); + blobLabel+= PvlKeyword("ByteOrder", Isis::ByteOrderName(Isis::Msb).toStdString()); } if (p_assoc == Samples) { diff --git a/isis/src/core/src/TableField.cpp b/isis/src/core/src/TableField.cpp index 9fdb31d424..ff0f473ead 100644 --- a/isis/src/core/src/TableField.cpp +++ b/isis/src/core/src/TableField.cpp @@ -57,25 +57,25 @@ namespace Isis { * @throws IException::Programmer - Invalid field type */ TableField::TableField(PvlGroup &field) { - QString name = (QString)field["Name"]; - m_name = name.toStdString(); + std::string name = (std::string)field["Name"]; + m_name = name; m_size = (int) field["Size"]; - if ((QString) field["Type"] == "Integer") { + if ((std::string) field["Type"] == "Integer") { m_type = TableField::Integer; m_bytes = 4 * m_size; m_ivalues.resize(m_size); } - else if ((QString) field["Type"] == "Double") { + else if ((std::string) field["Type"] == "Double") { m_type = TableField::Double; m_bytes = 8 * m_size; m_dvalues.resize(m_size); } - else if ((QString) field["Type"] == "Text") { + else if ((std::string) field["Type"] == "Text") { m_type = TableField::Text; m_bytes = 1 * m_size; m_svalue.resize(m_size); } - else if ((QString) field["Type"] == "Real") { + else if ((std::string) field["Type"] == "Real") { m_type = TableField::Real; m_bytes = 4 * m_size; m_rvalues.resize(m_size); @@ -589,7 +589,7 @@ namespace Isis { */ PvlGroup TableField::pvlGroup() { PvlGroup group("Field"); - group += PvlKeyword("Name", QString::fromStdString(m_name)); + group += PvlKeyword("Name", m_name); if (m_type == TableField::Double) { group += PvlKeyword("Type", "Double"); } @@ -602,7 +602,7 @@ namespace Isis { else if (m_type == TableField::Real) { group += PvlKeyword("Type", "Real"); } - group += PvlKeyword("Size", QString::number(m_size)); + group += PvlKeyword("Size", std::to_string(m_size)); return group; } diff --git a/isis/src/core/tests/Fixtures.h b/isis/src/core/tests/Fixtures.h index 2a0bfcc758..430d5edd64 100644 --- a/isis/src/core/tests/Fixtures.h +++ b/isis/src/core/tests/Fixtures.h @@ -18,7 +18,7 @@ class RawPvlKeywords : public ::testing::Test { void TearDown() override; - std::vector keywordsToTry; + std::vector keywordsToTry; std::vector results; std::vector valid; }; diff --git a/isis/src/core/tests/PvlKeywordTests.cpp b/isis/src/core/tests/PvlKeywordTests.cpp index 764d224e5c..defd542989 100644 --- a/isis/src/core/tests/PvlKeywordTests.cpp +++ b/isis/src/core/tests/PvlKeywordTests.cpp @@ -4,8 +4,6 @@ #include "Fixtures.h" -#include - #include #include @@ -27,11 +25,11 @@ void comparePvlKeywords(PvlKeyword pvlKeyword1, PvlKeyword pvlKeyword2); TEST_F(RawPvlKeywords, ReadKeywords) { int results_idx = 0; - for (unsigned int key = 0; key < sizeof(keywordsToTry) / sizeof(QString); key++) + for (unsigned int key = 0; key < sizeof(keywordsToTry) / sizeof(std::string); key++) { - vector keywordComments; - QString keywordName; - vector> keywordValues; + vector keywordComments; + std::string keywordName; + vector> keywordValues; bool result = false; @@ -76,14 +74,14 @@ TEST_F(RawPvlKeywords, ReadKeywords) TEST_F(RawPvlKeywords, StreamReadKeywords) { int results_idx = 0; - for (unsigned int key = 0; key < sizeof(keywordsToTry) / sizeof(QString); key++) + for (unsigned int key = 0; key < sizeof(keywordsToTry) / sizeof(std::string); key++) { stringstream stream; PvlKeyword keyword; bool result = false; try { - stream.write(keywordsToTry[key].toLatin1().data(), keywordsToTry[key].size()); + stream.write(keywordsToTry[key].c_str(), keywordsToTry[key].size()); stream >> keyword; result = true; } @@ -129,7 +127,7 @@ TEST(PvlKeyword, CheckParsing) { comparePvlKeywords(keyZ, keyZRead); - Isis::PvlKeyword keyU("ARRAY_TEST", toString(5.87), "lightyears"); + Isis::PvlKeyword keyU("ARRAY_TEST", std::to_string(5.87), "lightyears"); keyU.addValue("5465.6", "lightyears"); keyU.addValue("574.6", "lightyears"); @@ -171,18 +169,18 @@ TEST(PvlKeyword, CheckParsing) { comparePvlKeywords(pvlKeyB, keyBRead); Isis::PvlKeyword keyW("UGHHHHHHHHHHHH"); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); - keyW += toString(59999.0); + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; + keyW += "59999.0"; PvlKeyword keyWRead; stringstream streamW; @@ -204,10 +202,10 @@ TEST(PvlKeyword, WrappingComment) { Isis::PvlKeyword key("KEY"); key += "5"; - key += QString(""); + key += std::string(""); key.addValue("3.3", "feet"); key.addValue("Hello World!"); - QString str = "Hello World! This is a really really long comment that needs to" + std::string str = "Hello World! This is a really really long comment that needs to" " be wrapped onto several different lines to make the PVL file " "look really pretty!"; key.addCommentWrapped(str); @@ -228,11 +226,11 @@ TEST(PvlKeyword, IndexSetValue) Isis::PvlKeyword key("KEY"); key += "5"; - key += QString(""); + key += std::string(""); key.addValue("3.3", "feet"); key.addValue("Hello World!"); - key[1] = toString(88); + key[1] = std::to_string(88); EXPECT_EQ(key[1], "88"); } @@ -269,16 +267,16 @@ TEST(PvlKeyword, SetUnitsMultiple) { EXPECT_EQ(k.unit(1), "TeraFathoms"); } -TEST(PvlKeyword, QStringCast) { +TEST(PvlKeyword, StringCast) { PvlKeyword cast("cast", "I'm being casted"); - EXPECT_EQ((QString)cast, "I'm being casted"); + EXPECT_EQ((std::string)cast, "I'm being casted"); } TEST(PvlKeyword, IntCast) { - PvlKeyword cast("cast", "I'm being casted"); + PvlKeyword cast("cast", "2"); - EXPECT_EQ((QString)cast, "I'm being casted"); + EXPECT_EQ((int)cast, 2); } TEST(PvlKeyword, BigIntCast) { @@ -330,7 +328,7 @@ TEST(PvlKeyword, KeywordValidationNull) TEST(PvlKeyword, KeywordValidationFail) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlKwrd("KeyName", toString(3.5)); + PvlKeyword pvlKwrd("KeyName", std::to_string(3.5)); pvlTmplKwrd.validateKeyword(pvlKwrd); } catch(Isis::IException &e) { @@ -341,7 +339,7 @@ TEST(PvlKeyword, KeywordValidationFail) { TEST(PvlKeyword, KeywordValidationPositive) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlKwrd("KeyName", toString(-3)); + PvlKeyword pvlKwrd("KeyName", std::to_string(-3)); pvlTmplKwrd.validateKeyword(pvlKwrd, "positive"); } catch(Isis::IException &e) { @@ -352,9 +350,9 @@ TEST(PvlKeyword, KeywordValidationPositive) { TEST(PvlKeyword, KeywordValidationRange) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlTmplKwrdRange("KeyName__Range", toString(0)); - pvlTmplKwrdRange.addValue(toString(10)); - PvlKeyword pvlKwrd("KeyName", toString(11)); + PvlKeyword pvlTmplKwrdRange("KeyName__Range", std::to_string(0)); + pvlTmplKwrdRange.addValue(std::to_string(10)); + PvlKeyword pvlKwrd("KeyName", std::to_string(11)); pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdRange); } catch(Isis::IException &e) { diff --git a/isis/src/core/tests/TableTests.cpp b/isis/src/core/tests/TableTests.cpp index 9901f1e4ab..58cab5832e 100644 --- a/isis/src/core/tests/TableTests.cpp +++ b/isis/src/core/tests/TableTests.cpp @@ -165,7 +165,7 @@ TEST(TableTests, ToFromBlob) { rec[3] = -0.55; t += rec; - QString comment = "test comment"; + std::string comment = "test comment"; t.Label().addComment(comment); Blob tableBlob = t.toBlob(); diff --git a/isis/src/core/tests/unitTests/IException/unitTest.cpp b/isis/src/core/tests/unitTests/IException/unitTest.cpp index b08b76a149..19eedb893e 100644 --- a/isis/src/core/tests/unitTests/IException/unitTest.cpp +++ b/isis/src/core/tests/unitTests/IException/unitTest.cpp @@ -143,7 +143,7 @@ int main(void) { cerr << "Test Preference 'FileLine'\n"; { - QString &fileLineValue = errorPrefs["FileLine"][0]; + std::string &fileLineValue = errorPrefs["FileLine"][0]; fileLineValue = "On"; @@ -168,7 +168,7 @@ int main(void) { cerr << "Test Preference 'Format'\n"; { - QString &formatValue = errorPrefs["Format"][0]; + std::string &formatValue = errorPrefs["Format"][0]; formatValue = "Standard"; diff --git a/isis/src/core/tests/unitTests/Preference/unitTest.cpp b/isis/src/core/tests/unitTests/Preference/unitTest.cpp index e1130ef576..95d6cbc8ca 100644 --- a/isis/src/core/tests/unitTests/Preference/unitTest.cpp +++ b/isis/src/core/tests/unitTests/Preference/unitTest.cpp @@ -52,7 +52,7 @@ int main() { // if (p2.hasGroup("Junk")) { if(Isis::Preference::Preferences(false).hasGroup("Junk")) { Isis::PvlGroup &g = Isis::Preference::Preferences(false).findGroup("Junk"); - cout << "Value of Vegetable is : " << (QString) g["Vegetable"] << endl; + cout << "Value of Vegetable is : " << (std::string) g["Vegetable"] << endl; } remove("tmpSystem"); diff --git a/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp b/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp index 175428b6fa..8edce50875 100644 --- a/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlContainer/unitTest.cpp @@ -17,7 +17,7 @@ using namespace std; int main() { Preference::Preferences(true); - PvlKeyword dog("DOG", toString(5.2), "meters"); + PvlKeyword dog("DOG", std::to_string(5.2), "meters"); PvlKeyword cat("CATTLE"); cat = "Meow"; cat.addComment("Cats shed"); @@ -52,7 +52,7 @@ int main() { cout << endl << "Test reallocation ..." << endl; PvlKeyword * ptr1 = &ani["DOG"]; for (int i = 0; i < 250; i++) - ani += PvlKeyword("Test_keyword", toString(i)); + ani += PvlKeyword("Test_keyword", std::to_string(i)); PvlKeyword * ptr2 = &ani["DOG"]; if (ptr1 == ptr2) diff --git a/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp b/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp index cf78a78eb4..4840e96154 100644 --- a/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp @@ -46,7 +46,7 @@ int main() { } { PvlKeyword key("fkey2", "rEaL"); - key.addValue(toString(2)); + key.addValue(std::to_string(2)); out << key << endl; } { @@ -55,7 +55,7 @@ int main() { } { PvlKeyword key("fkey0", "real"); - key.addValue(toString(0)); + key.addValue(std::to_string(0)); out << key << endl; } { @@ -72,22 +72,22 @@ int main() { } { PvlKeyword key("hkey2", "hEX"); - key.addValue(toString(2)); + key.addValue(std::to_string(2)); out << key << endl; } { PvlKeyword key("hkey4", "hEX"); - key.addValue(toString(4)); + key.addValue(std::to_string(4)); out << key << endl; } { PvlKeyword key("binkey", "binary"); - key.addValue(toString(7)); + key.addValue(std::to_string(7)); out << key << endl; } { PvlKeyword key("binkey16", "binary"); - key.addValue(toString(16)); + key.addValue(std::to_string(16)); out << key << endl; } { @@ -96,7 +96,7 @@ int main() { } { PvlKeyword key("dblkeyarray", "rEaL"); - key.addValue(toString(2)); + key.addValue(std::to_string(2)); out << key << endl; } { @@ -110,7 +110,7 @@ int main() { out.close(); - pdsFormatter = new PvlFormatPds(pdsFile); + pdsFormatter = new PvlFormatPds(pdsFile.toStdString()); QFile::remove(pdsFile); } @@ -165,51 +165,51 @@ int main() { } { - PvlKeyword key("myfloat", toString(-12345.67e+89), "degrees"); + PvlKeyword key("myfloat", std::to_string(-12345.67e+89), "degrees"); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("fkey", toString(-12345.6789)); + PvlKeyword key("fkey", std::to_string(-12345.6789)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("fkey0", toString(-9876.543)); + PvlKeyword key("fkey0", std::to_string(-9876.543)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("fkey0", toString(-9876.543e-99)); + PvlKeyword key("fkey0", std::to_string(-9876.543e-99)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("fkey2", toString(0.123456)); + PvlKeyword key("fkey2", std::to_string(0.123456)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("fkey2", toString(0.123456), "goofys"); - key.addValue(toString(987.123), "goofys"); + PvlKeyword key("fkey2", std::to_string(0.123456), "goofys"); + key.addValue(std::to_string(987.123), "goofys"); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("fkey2", toString(0.123456), "goofys"); - key.addValue(toString(987.123)); + PvlKeyword key("fkey2", std::to_string(0.123456), "goofys"); + key.addValue(std::to_string(987.123)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); @@ -230,42 +230,42 @@ int main() { } { - PvlKeyword key("hkey0", toString((BigInt)0x123456789abcdeffLL)); + PvlKeyword key("hkey0", std::to_string((BigInt)0x123456789abcdeffLL)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("hkey2", toString(0x7a8b)); + PvlKeyword key("hkey2", std::to_string(0x7a8b)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("hkey4", toString(0x1a2b3c4d)); + PvlKeyword key("hkey4", std::to_string(0x1a2b3c4d)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("binkey", toString(0xA)); + PvlKeyword key("binkey", std::to_string(0xA)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("binkey16", toString(0xffff)); + PvlKeyword key("binkey16", std::to_string(0xffff)); cout << key << endl; key.setFormat(pdsFormatter); cout << key << pdsFormatter->formatEOL(); } { - PvlKeyword key("intkeyarray", toString(1)); + PvlKeyword key("intkeyarray", std::to_string(1)); key.addValue("NULL"); key.addValue("3"); key.addValue("NULL"); @@ -275,7 +275,7 @@ int main() { } { - PvlKeyword key("intkeyarray", toString(1), "m"); + PvlKeyword key("intkeyarray", std::to_string(1), "m"); key.addValue("NULL", "m"); key.addValue("3", "m"); key.addValue("N/A"); @@ -286,7 +286,7 @@ int main() { } { - PvlKeyword key("dblkeyarray", toString(1.01)); + PvlKeyword key("dblkeyarray", std::to_string(1.01)); key.addValue("NULL"); key.addValue("3.4"); key.addValue("UNK"); @@ -304,8 +304,8 @@ int main() { grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - grp += PvlKeyword("myint", toString(12345)); - grp += PvlKeyword("myfloat", toString(12345.67e+89)); + grp += PvlKeyword("myint", std::to_string(12345)); + grp += PvlKeyword("myfloat", std::to_string(12345.67e+89)); grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); cout << "=============================== Before" << endl; cout << grp << endl; @@ -323,8 +323,8 @@ int main() { grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - grp += PvlKeyword("myint", toString(12345)); - grp += PvlKeyword("myfloat", toString(12345.67e+89)); + grp += PvlKeyword("myint", std::to_string(12345)); + grp += PvlKeyword("myfloat", std::to_string(12345.67e+89)); grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); PvlObject obj("Object1"); obj.addGroup(grp); @@ -335,8 +335,8 @@ int main() { obj2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set obj2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes obj2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - obj2 += PvlKeyword("myint", toString(12345)); - obj2 += PvlKeyword("myfloat", toString(12345.67e+89)); + obj2 += PvlKeyword("myint", std::to_string(12345)); + obj2 += PvlKeyword("myfloat", std::to_string(12345.67e+89)); obj2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); obj.addObject(obj2); @@ -345,8 +345,8 @@ int main() { obj += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set obj += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes obj += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - obj += PvlKeyword("myint", toString(12345)); - obj += PvlKeyword("myfloat", toString(12345.67e+89)); + obj += PvlKeyword("myint", std::to_string(12345)); + obj += PvlKeyword("myfloat", std::to_string(12345.67e+89)); obj += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); @@ -370,8 +370,8 @@ int main() { grp += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set grp += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes grp += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - grp += PvlKeyword("myint", toString(12345)); - grp += PvlKeyword("myfloat", toString(12345.67e+89)); + grp += PvlKeyword("myint", std::to_string(12345)); + grp += PvlKeyword("myfloat", std::to_string(12345.67e+89)); grp += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); obj.addGroup(grp); @@ -381,10 +381,10 @@ int main() { obj2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set obj2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes obj2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - obj2 += PvlKeyword("myint", toString(12345)); - obj2 += PvlKeyword("myfloat", toString(12345.67e+89)); + obj2 += PvlKeyword("myint", std::to_string(12345)); + obj2 += PvlKeyword("myfloat", std::to_string(12345.67e+89)); obj2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - obj2 += PvlKeyword("binkey16", toString(0x01f0)); + obj2 += PvlKeyword("binkey16", std::to_string(0x01f0)); obj.addObject(obj2); obj += PvlKeyword("skey", "stringval"); @@ -392,8 +392,8 @@ int main() { obj += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set obj += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes obj += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - obj += PvlKeyword("myint", toString(12345)); - obj += PvlKeyword("myfloat", toString(12345.67e+89)); + obj += PvlKeyword("myint", std::to_string(12345)); + obj += PvlKeyword("myfloat", std::to_string(12345.67e+89)); obj += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); pvl += PvlKeyword("skey", "stringval"); @@ -401,8 +401,8 @@ int main() { pvl += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set pvl += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes pvl += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - pvl += PvlKeyword("myint", toString(12345)); - pvl += PvlKeyword("myfloat", toString(12345.67e+89)); + pvl += PvlKeyword("myint", std::to_string(12345)); + pvl += PvlKeyword("myfloat", std::to_string(12345.67e+89)); pvl += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); pvl.addObject(obj); @@ -413,28 +413,28 @@ int main() { grp2 += PvlKeyword("sNULLstring", "NULL"); // should add quotes after format set grp2 += PvlKeyword("sUNKquote", "\"UNK\""); // should not add more quotes grp2 += PvlKeyword("sNAsingle", "\'N/A\'"); // should not add more quotes - grp2 += PvlKeyword("myint", toString(12345)); - grp2 += PvlKeyword("myfloat", toString(12345.67e+89)); + grp2 += PvlKeyword("myint", std::to_string(12345)); + grp2 += PvlKeyword("myfloat", std::to_string(12345.67e+89)); grp2 += PvlKeyword("myarray", "(12345,\"a short string\",1.234)"); - grp2 += PvlKeyword("binkey16", toString(0x8001)); + grp2 += PvlKeyword("binkey16", std::to_string(0x8001)); grp2 += PvlKeyword("wrapword", "The quick brown fox jumped over the lazy duck. " "Repunzel Repunzel let down your hair. The little toy dog is covered with dust," " but sturdy and staunch he stands; and the little toy soldier is red with rust."); - PvlKeyword key(PvlKeyword("array", toString(12345))); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); - key.addValue(toString(67890)); - key.addValue(toString(12345)); + PvlKeyword key(PvlKeyword("array", std::to_string(12345))); + key.addValue(std::to_string(67890)); + key.addValue(std::to_string(12345)); + key.addValue(std::to_string(67890)); + key.addValue(std::to_string(12345)); + key.addValue(std::to_string(67890)); + key.addValue(std::to_string(12345)); + key.addValue(std::to_string(67890)); + key.addValue(std::to_string(12345)); + key.addValue(std::to_string(67890)); + key.addValue(std::to_string(12345)); + key.addValue(std::to_string(67890)); + key.addValue(std::to_string(12345)); + key.addValue(std::to_string(67890)); + key.addValue(std::to_string(12345)); grp2 += key; pvl.addGroup(grp2); diff --git a/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp b/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp index 710b18a5f6..2481d12a04 100644 --- a/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlGroup/unitTest.cpp @@ -16,7 +16,7 @@ using namespace Isis; int main() { Isis::Preference::Preferences(true); - Isis::PvlKeyword dog("DOG", toString(5.2), "meters"); + Isis::PvlKeyword dog("DOG", std::to_string(5.2), "meters"); Isis::PvlKeyword cat("CATTLE"); cat = "Meow"; cat.addComment("Cats shed"); @@ -118,7 +118,7 @@ int main() { // PvlGroup to be Validated PvlGroup pvlGrp("Point_errormagnitude"); - PvlKeyword pvlKwrd("LessThan", toString(2.5)); + PvlKeyword pvlKwrd("LessThan", std::to_string(2.5)); try { pvlTmplGrp.validateGroup(pvlGrp); @@ -132,19 +132,19 @@ int main() { // Test Repeated values try { pvlKwrd.clear(); - PvlKeyword pvlKwrd("LessThan", toString(2.5)); + PvlKeyword pvlKwrd("LessThan", std::to_string(2.5)); pvlGrp += pvlKwrd; pvlKwrd.clear(); - pvlKwrd = PvlKeyword("GreaterThan", toString(3.5)); + pvlKwrd = PvlKeyword("GreaterThan", std::to_string(3.5)); pvlGrp += pvlKwrd; pvlKwrd.clear(); - pvlKwrd = PvlKeyword("GreaterThan", toString(4.4545)); + pvlKwrd = PvlKeyword("GreaterThan", std::to_string(4.4545)); pvlGrp += pvlKwrd; pvlKwrd.clear(); - pvlKwrd = PvlKeyword("GreaterThan", toString(100.8988095)); + pvlKwrd = PvlKeyword("GreaterThan", std::to_string(100.8988095)); pvlGrp += pvlKwrd; pvlTmplGrp.validateGroup(pvlGrp); @@ -159,11 +159,11 @@ int main() { // Test for unvalidated elements try { pvlKwrd.clear(); - PvlKeyword pvlKwrd("Less123Than", toString(2.5)); + PvlKeyword pvlKwrd("Less123Than", std::to_string(2.5)); pvlGrp += pvlKwrd; pvlKwrd.clear(); - pvlKwrd = PvlKeyword("GreaterThan", toString(3.5)); + pvlKwrd = PvlKeyword("GreaterThan", std::to_string(3.5)); pvlGrp += pvlKwrd; pvlTmplGrp.validateGroup(pvlGrp); diff --git a/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp b/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp index c78302ff4c..2f8856389e 100644 --- a/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlSequence/unitTest.cpp @@ -6,8 +6,6 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include -#include - #include "PvlKeyword.h" #include "PvlSequence.h" #include "Preference.h" @@ -18,8 +16,8 @@ int main(void) { Preference::Preferences(true); PvlKeyword key("Key"); - key += QString("(xyzzy,plover)"); - key += QString("(2,b,|,^,2,b)"); + key += std::string("(xyzzy,plover)"); + key += std::string("(2,b,|,^,2,b)"); PvlSequence seq; seq = key; diff --git a/isis/src/core/tests/unitTests/TableField/unitTest.cpp b/isis/src/core/tests/unitTests/TableField/unitTest.cpp index 0167700390..3f2ba89b19 100644 --- a/isis/src/core/tests/unitTests/TableField/unitTest.cpp +++ b/isis/src/core/tests/unitTests/TableField/unitTest.cpp @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) { group1 += PvlKeyword("name", "Test"); group1 += PvlKeyword("type", "Integer"); - group1 += PvlKeyword("size", toString(20)); + group1 += PvlKeyword("size", std::to_string(20)); TableField intVectorField20(group1); g = intVectorField20.pvlGroup(); @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) { group2 += PvlKeyword("name", "Test"); group2 += PvlKeyword("type", "Double"); - group2 += PvlKeyword("size", toString(20)); + group2 += PvlKeyword("size", std::to_string(20)); TableField dblVectorField20(group2); g = dblVectorField20.pvlGroup(); @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) { group3 += PvlKeyword("name", "Test"); group3 += PvlKeyword("type", "Text"); - group3 += PvlKeyword("size", toString(20)); + group3 += PvlKeyword("size", std::to_string(20)); TableField textField20(group3); g = textField20.pvlGroup(); @@ -183,7 +183,7 @@ int main(int argc, char *argv[]) { group4 += PvlKeyword("name", "Test"); group4 += PvlKeyword("type", "Real"); - group4 += PvlKeyword("size", toString(20)); + group4 += PvlKeyword("size", std::to_string(20)); TableField realVectorField20(group4); g = realVectorField20.pvlGroup(); @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) { group5 += PvlKeyword("name", "Test"); group5 += PvlKeyword("type", "BLAH"); - group5 += PvlKeyword("size", toString(20)); + group5 += PvlKeyword("size", std::to_string(20)); TableField unknownTypeField(group5); g = unknownTypeField.pvlGroup(); @@ -213,7 +213,7 @@ int main(int argc, char *argv[]) { group6 += PvlKeyword("name", "Test"); group6 += PvlKeyword("type", "Integer"); - group6 += PvlKeyword("size", toString(-7.3)); + group6 += PvlKeyword("size", std::to_string(-7.3)); TableField invalidSizeField(group6); g = invalidSizeField.pvlGroup(); diff --git a/isis/src/database/objs/DatabaseFactory/DatabaseFactory.cpp b/isis/src/database/objs/DatabaseFactory/DatabaseFactory.cpp index f7d37d1578..c281577bd4 100644 --- a/isis/src/database/objs/DatabaseFactory/DatabaseFactory.cpp +++ b/isis/src/database/objs/DatabaseFactory/DatabaseFactory.cpp @@ -488,11 +488,11 @@ namespace Isis { if(userPref.hasGroup("Database")) { PvlGroup &dbgroup = userPref.findGroup("Database"); if(dbgroup.hasKeyword("AccessConfig")) { - addAccessProfile(dbgroup["AccessConfig"]); + addAccessProfile(QString::fromStdString(dbgroup["AccessConfig"])); } // Get default profile name for later use if(dbgroup.hasKeyword("DefaultProfile")) - _defProfName = (QString) dbgroup["DefaultProfile"]; + _defProfName = QString::fromStdString(dbgroup["DefaultProfile"]); } return; } diff --git a/isis/src/database/objs/DbAccess/DbAccess.cpp b/isis/src/database/objs/DbAccess/DbAccess.cpp index dfa24d58ab..7152d9e55b 100644 --- a/isis/src/database/objs/DbAccess/DbAccess.cpp +++ b/isis/src/database/objs/DbAccess/DbAccess.cpp @@ -140,7 +140,7 @@ namespace Isis { * @param filename Name of Pvl file to open. */ void DbAccess::load(const QString &filename) { - Pvl pvl(filename); + Pvl pvl(filename.toStdString()); PvlObject db = pvl.findObject("Database"); load(db); } diff --git a/isis/src/database/objs/DbProfile/DbProfile.cpp b/isis/src/database/objs/DbProfile/DbProfile.cpp index 49870faec9..04b25f8791 100644 --- a/isis/src/database/objs/DbProfile/DbProfile.cpp +++ b/isis/src/database/objs/DbProfile/DbProfile.cpp @@ -81,10 +81,10 @@ namespace Isis { */ void DbProfile::add(const QString &key, const QString &value) { if(_keys.exists(key)) { - _keys.get(key).addValue(value); + _keys.get(key).addValue(value.toStdString()); } else { - _keys.add(key, PvlKeyword(key, value)); + _keys.add(key, PvlKeyword(key.toStdString(), value.toStdString())); } } @@ -101,7 +101,7 @@ namespace Isis { * @param value Value to add to the keyword */ void DbProfile::replace(const QString &key, const QString &value) { - _keys.add(key, PvlKeyword(key, value)); + _keys.add(key, PvlKeyword(key.toStdString(), value.toStdString())); } @@ -145,7 +145,7 @@ namespace Isis { */ QString DbProfile::value(const QString &key, int nth) const { try { - return (_keys.get(key)[nth]); + return QString::fromStdString(_keys.get(key)[nth]); } catch(IException &ie) { ostringstream mess; diff --git a/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp b/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp index 42d7aa56a8..f824b7c727 100644 --- a/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp +++ b/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp @@ -494,7 +494,7 @@ namespace Isis { // Create constant rotation frames PvlKeyword cf("ConstantFrames", toString(virZeroId)); - cf.addValue(toString(virZeroId)); + cf.addValue(std::to_string(virZeroId)); quats.Label() += cf; SpiceDouble identity[3][3]; @@ -504,7 +504,7 @@ namespace Isis { PvlKeyword crot("ConstantRotation"); for (int i = 0 ; i < 3 ; i++) { for (int j = 0 ; j < 3 ; j++) { - crot.addValue(toString(identity[i][j])); + crot.addValue(std::to_string(identity[i][j])); } } diff --git a/isis/src/galileo/apps/gllnims2isis/main.cpp b/isis/src/galileo/apps/gllnims2isis/main.cpp index 9ed97f0a49..a35772f40d 100644 --- a/isis/src/galileo/apps/gllnims2isis/main.cpp +++ b/isis/src/galileo/apps/gllnims2isis/main.cpp @@ -387,7 +387,7 @@ PvlGroup originalMappingGroup = qube.findGroup("IMAGE_MAP_PROJECTION", Pvl::Trav } else { if (mappingGroup.hasKeyword("CenterLatitude")) { - mappingGroup["CenterLatitude"].setValue(toString(centerLatitude), + mappingGroup["CenterLatitude"].setValue(std::to_string(centerLatitude), "degrees"); } else { @@ -400,7 +400,7 @@ PvlGroup originalMappingGroup = qube.findGroup("IMAGE_MAP_PROJECTION", Pvl::Trav "degrees"); } else { - mappingGroup["CenterLongitude"].setValue(toString(centerLongitude), + mappingGroup["CenterLongitude"].setValue(std::to_string(centerLongitude), "degrees"); } mappingGroup["LongitudeDomain"].setUnits("degrees"); diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index 09d8bfe6e0..e06b4f5210 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -195,7 +195,7 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube) { //change exposure duration to seconds double expDur = inst.findKeyword("exposureDuration"); double expDurOut = expDur / 1000.0; - inst.findKeyword("exposureDuration").setValue(toString(expDurOut), "seconds"); + inst.findKeyword("exposureDuration").setValue(std::to_string(expDurOut), "seconds"); inst.addKeyword(PvlKeyword("FrameDuration", (QString) pdsLabel["frameDuration"], "seconds")); diff --git a/isis/src/hayabusa/apps/amicacal/main.cpp b/isis/src/hayabusa/apps/amicacal/main.cpp index 0b235a623f..5be4cee0b2 100644 --- a/isis/src/hayabusa/apps/amicacal/main.cpp +++ b/isis/src/hayabusa/apps/amicacal/main.cpp @@ -377,15 +377,15 @@ void IsisMain() { // Parameters PvlKeyword key("Bias_Bn"); - key.addValue(toString(g_b0, 8)); - key.addValue(toString(g_b1, 8)); - key.addValue(toString(g_b2, 8)); + key.addValue(std::to_string(g_b0, 8)); + key.addValue(std::to_string(g_b1, 8)); + key.addValue(std::to_string(g_b2, 8)); calibrationLog.addKeyword(key); calibrationLog.addKeyword(PvlKeyword("Bias", toString(g_bias, 16), "DN")); key = PvlKeyword("Linearity_Ln"); - key.addValue(toString(g_L0, 8)); - key.addValue(toString(g_L1, 8)); + key.addValue(std::to_string(g_L0, 8)); + key.addValue(std::to_string(g_L1, 8)); calibrationLog.addKeyword(key); calibrationLog.addKeyword(PvlKeyword("Linearity_Gamma", toString(g_gamma, 16))); @@ -461,21 +461,21 @@ void IsisMain() { // Add PSF parameter to the calibration reporting key = PvlKeyword("PSF_KernelSize"); - key.addValue(toString(g_size)); - key.addValue(toString(g_size)); + key.addValue(std::to_string(g_size)); + key.addValue(std::to_string(g_size)); calibrationLog.addKeyword(key); calibrationLog.addKeyword(PvlKeyword("PSF_Focused", toString(g_alpha, 6))); key = PvlKeyword("PSF_Sigma"); for (int i = 0 ; i < g_N ; i++ ) { - key.addValue(toString(g_sigma[i])); + key.addValue(std::to_string(g_sigma[i])); } calibrationLog.addKeyword(key); key = PvlKeyword("PSF_Diffuse"); for (int i = 0 ; i < g_N ; i++ ) { - key.addValue(toString(g_A[i])); + key.addValue(std::to_string(g_A[i])); } } diff --git a/isis/src/hayabusa2/apps/hyb2onccal/main.cpp b/isis/src/hayabusa2/apps/hyb2onccal/main.cpp index 1fe9c9a901..70d3ae08b1 100644 --- a/isis/src/hayabusa2/apps/hyb2onccal/main.cpp +++ b/isis/src/hayabusa2/apps/hyb2onccal/main.cpp @@ -304,9 +304,9 @@ void IsisMain() { // Parameters PvlKeyword key("Bias_Bn"); - key.addValue(toString(g_b0, 8)); - key.addValue(toString(g_b1, 8)); - key.addValue(toString(g_b2, 8)); + key.addValue(std::to_string(g_b0, 8)); + key.addValue(std::to_string(g_b1, 8)); + key.addValue(std::to_string(g_b2, 8)); calibrationLog.addKeyword(key); calibrationLog.addKeyword(PvlKeyword("Bias", toString(g_bias, 16), "DN")); diff --git a/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp b/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp index c63f0ec681..6fc55f6fd6 100644 --- a/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp +++ b/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp @@ -257,14 +257,14 @@ namespace Isis { for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; units.addValue(p.units); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); + phostd.addValue(std::to_string(p.phoStd)); + bbc.addValue(std::to_string(p.wavelength)); + bbct.addValue(std::to_string(p.tolerance)); + bbn.addValue(std::to_string(p.band)); for (unsigned int j = 0; j < aTermKeywords.size(); j++) - aTermKeywords[j].addValue(toString(p.aTerms[j])); + aTermKeywords[j].addValue(std::to_string(p.aTerms[j])); for (unsigned int j = 0; j < bTermKeywords.size(); j++) - bTermKeywords[j].addValue(toString(p.bTerms[j])); + bTermKeywords[j].addValue(std::to_string(p.bTerms[j])); } pvl += units; diff --git a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp index 4c0f611698..1b5112d5a1 100644 --- a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp +++ b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp @@ -781,12 +781,12 @@ namespace Isis { if (g_iof) { calgrp += PvlKeyword("RadiometricType", "IOF"); for (unsigned int i=0; i< g_iofResponsivity.size(); i++) - vals.addValue(toString(g_iofResponsivity[i])); + vals.addValue(std::to_string(g_iofResponsivity[i])); } else { calgrp += PvlKeyword("RadiometricType", "AbsoluteRadiance", "W/m2/sr/um"); for (unsigned int i=0; i< g_radianceResponsivity.size(); i++) - vals.addValue(toString(g_radianceResponsivity[i])); + vals.addValue(std::to_string(g_radianceResponsivity[i])); } calgrp += vals; calgrp += PvlKeyword("SolarDistance", toString(g_solarDistance)); diff --git a/isis/src/lro/apps/lrowacpho/Exponential.cpp b/isis/src/lro/apps/lrowacpho/Exponential.cpp index e6fa2fafa9..168a532afa 100644 --- a/isis/src/lro/apps/lrowacpho/Exponential.cpp +++ b/isis/src/lro/apps/lrowacpho/Exponential.cpp @@ -135,14 +135,14 @@ namespace Isis { for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; units.addValue(p.units); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); + phostd.addValue(std::to_string(p.phoStd)); + bbc.addValue(std::to_string(p.wavelength)); + bbct.addValue(std::to_string(p.tolerance)); + bbn.addValue(std::to_string(p.band)); for (unsigned int j = 0; j < aTermKeywords.size(); j++) - aTermKeywords[j].addValue(toString(p.aTerms[j])); + aTermKeywords[j].addValue(std::to_string(p.aTerms[j])); for (unsigned int j = 0; j < bTermKeywords.size(); j++) - bTermKeywords[j].addValue(toString(p.bTerms[j])); + bTermKeywords[j].addValue(std::to_string(p.bTerms[j])); } pvl += units; pvl += phostd; diff --git a/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp b/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp index e79260e75f..635f3daed4 100644 --- a/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp +++ b/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp @@ -140,14 +140,14 @@ namespace Isis { for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; units.addValue(p.units); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); + phostd.addValue(std::to_string(p.phoStd)); + bbc.addValue(std::to_string(p.wavelength)); + bbct.addValue(std::to_string(p.tolerance)); + bbn.addValue(std::to_string(p.band)); for (unsigned int j = 0; j < aTermKeywords.size(); j++) - aTermKeywords[j].addValue(toString(p.aTerms[j])); + aTermKeywords[j].addValue(std::to_string(p.aTerms[j])); for (unsigned int j = 0; j < bTermKeywords.size(); j++) - bTermKeywords[j].addValue(toString(p.bTerms[j])); + bTermKeywords[j].addValue(std::to_string(p.bTerms[j])); } pvl += units; pvl += phostd; diff --git a/isis/src/lro/apps/lrowacpho/Hillier.cpp b/isis/src/lro/apps/lrowacpho/Hillier.cpp index fc0246474d..5204b2a519 100644 --- a/isis/src/lro/apps/lrowacpho/Hillier.cpp +++ b/isis/src/lro/apps/lrowacpho/Hillier.cpp @@ -132,17 +132,17 @@ namespace Isis { for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; units.addValue(p.units); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); - b0.addValue(toString(p.b0)); - b1.addValue(toString(p.b1)); - a0.addValue(toString(p.a0)); - a1.addValue(toString(p.a1)); - a2.addValue(toString(p.a2)); - a3.addValue(toString(p.a3)); - a4.addValue(toString(p.a4)); + phostd.addValue(std::to_string(p.phoStd)); + bbc.addValue(std::to_string(p.wavelength)); + bbct.addValue(std::to_string(p.tolerance)); + bbn.addValue(std::to_string(p.band)); + b0.addValue(std::to_string(p.b0)); + b1.addValue(std::to_string(p.b1)); + a0.addValue(std::to_string(p.a0)); + a1.addValue(std::to_string(p.a1)); + a2.addValue(std::to_string(p.a2)); + a3.addValue(std::to_string(p.a3)); + a4.addValue(std::to_string(p.a4)); } pvl += units; pvl += phostd; diff --git a/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp b/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp index b3494d24d4..626976ed09 100644 --- a/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp +++ b/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp @@ -75,14 +75,14 @@ namespace Isis { // Get the start time from labels Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockPrerollCount"]; + std::string stime = inst["SpacecraftClockPrerollCount"]; SpiceDouble etStart; if(stime != "NULL") { etStart = getClockTime(stime).Et(); } else { - etStart = iTime((QString)inst["PrerollTime"]).Et(); + etStart = iTime(QString::fromStdString(inst["PrerollTime"])).Et(); } // Get other info from labels diff --git a/isis/src/messenger/apps/mdiscal/main.cpp b/isis/src/messenger/apps/mdiscal/main.cpp index 778b9bcdd3..64ac87e86f 100644 --- a/isis/src/messenger/apps/mdiscal/main.cpp +++ b/isis/src/messenger/apps/mdiscal/main.cpp @@ -425,7 +425,7 @@ void IsisMain() { calibrationLog.addKeyword(PvlKeyword("SmearCompFile", smearfile)); PvlKeyword rspKey("Response", toString(rsp[0])); for (unsigned int i = 1; i < rsp.size(); i++) { - rspKey.addValue(toString(rsp[i])); + rspKey.addValue(std::to_string(rsp[i])); } calibrationLog.addKeyword(rspKey); calibrationLog.addKeyword(PvlKeyword("SmearComponent", toString(g_smearComponent))); diff --git a/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp b/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp index b2e4446326..41bede31c3 100644 --- a/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp +++ b/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp @@ -33,7 +33,7 @@ namespace Isis { * @param furnish Do we load the kernels we find? */ SpiceManager::SpiceManager(const QString &filename, bool furnish) { - Pvl pvl(filename); + Pvl pvl(filename.toStdString()); Load(pvl, furnish); } diff --git a/isis/src/mro/apps/hidtmgen/hidtmgen.cpp b/isis/src/mro/apps/hidtmgen/hidtmgen.cpp index 9cc31e54e0..015582cee0 100644 --- a/isis/src/mro/apps/hidtmgen/hidtmgen.cpp +++ b/isis/src/mro/apps/hidtmgen/hidtmgen.cpp @@ -513,11 +513,11 @@ namespace Isis{ TProjection *proj = (TProjection *) ProjectionFactory::CreateFromCube(*inCube); double newRadius = proj->LocalRadius((double)mappingObject["CENTER_LATITUDE"]); newRadius /= 1000; - mappingObject.findKeyword("A_AXIS_RADIUS").setValue(toString(newRadius)); + mappingObject.findKeyword("A_AXIS_RADIUS").setValue(std::to_string(newRadius)); mappingObject.findKeyword("A_AXIS_RADIUS").setUnits("KM"); - mappingObject.findKeyword("B_AXIS_RADIUS").setValue(toString(newRadius)); + mappingObject.findKeyword("B_AXIS_RADIUS").setValue(std::to_string(newRadius)); mappingObject.findKeyword("B_AXIS_RADIUS").setUnits("KM"); - mappingObject.findKeyword("C_AXIS_RADIUS").setValue(toString(newRadius)); + mappingObject.findKeyword("C_AXIS_RADIUS").setValue(std::to_string(newRadius)); mappingObject.findKeyword("C_AXIS_RADIUS").setUnits("KM"); } diff --git a/isis/src/mro/apps/hirdrgen/main.cpp b/isis/src/mro/apps/hirdrgen/main.cpp index d68228f47c..ceefe75141 100644 --- a/isis/src/mro/apps/hirdrgen/main.cpp +++ b/isis/src/mro/apps/hirdrgen/main.cpp @@ -306,9 +306,9 @@ void IsisMain() { TProjection *proj = (TProjection *) ProjectionFactory::CreateFromCube(*icube2); PvlGroup &mapping = icube2->label()->findGroup("MAPPING", Pvl::Traverse); double radius = proj->LocalRadius((double)mapping["CenterLatitude"]) / 1000.0; - mapObject["A_AXIS_RADIUS"].setValue(toString(radius), "KM"); - mapObject["B_AXIS_RADIUS"].setValue(toString(radius), "KM"); - mapObject["C_AXIS_RADIUS"].setValue(toString(radius), "KM"); + mapObject["A_AXIS_RADIUS"].setValue(std::to_string(radius), "KM"); + mapObject["B_AXIS_RADIUS"].setValue(std::to_string(radius), "KM"); + mapObject["C_AXIS_RADIUS"].setValue(std::to_string(radius), "KM"); } projName = mapObject["MAP_PROJECTION_TYPE"][0]; diff --git a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp index 060b6a21b5..02f766a470 100644 --- a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp +++ b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp @@ -201,7 +201,7 @@ namespace Isis { // The original band is the original ISIS cube band number upon ingestion PvlKeyword originalBand("OriginalBand"); for(int i = 1; i <= numBands; i++) { - originalBand.addValue(toString(i)); + originalBand.addValue(std::to_string(i)); } bandBin += originalBand; diff --git a/isis/src/qisis/objs/BandSpinBox/BandSpinBox.cpp b/isis/src/qisis/objs/BandSpinBox/BandSpinBox.cpp index d0ee3422cd..1c4a4fa6c9 100644 --- a/isis/src/qisis/objs/BandSpinBox/BandSpinBox.cpp +++ b/isis/src/qisis/objs/BandSpinBox/BandSpinBox.cpp @@ -64,9 +64,9 @@ namespace Isis { list.clear(); if(bandBin[i].size() == p_bands) { for(int j = 0; j < bandBin[i].size(); j++) { - list.push_back(QString(bandBin[i][j])); + list.push_back(QString::fromStdString((bandBin[i][j]))); } - QString bandBinName = bandBin[i].name(); + QString bandBinName = QString::fromStdString(bandBin[i].name()); p_map[bandBinName] = list; } } diff --git a/isis/src/qisis/objs/BandTool/BandTool.cpp b/isis/src/qisis/objs/BandTool/BandTool.cpp index 0f1ac78b32..0b924e2a72 100644 --- a/isis/src/qisis/objs/BandTool/BandTool.cpp +++ b/isis/src/qisis/objs/BandTool/BandTool.cpp @@ -231,10 +231,10 @@ namespace Isis { p_blueDisplay->setVisible(true); for(int i = 0; i < bandBin.keywords(); i++) { - if(bandBin[i].name() == p_comboBox->currentText()) { + if(bandBin[i].name() == p_comboBox->currentText().toStdString()) { p_lineEditValueList.clear(); for(int j = 0; j < bandBin[i].size(); j++) { - p_lineEditValueList.push_back(QString(bandBin[i][j])); + p_lineEditValueList.push_back(QString::fromStdString((bandBin[i][j]))); } } } @@ -291,7 +291,7 @@ namespace Isis { for(int i = 0; i < bandBin.keywords(); i++) { //only add band bin keywords have a size that equals the number of bands if(bandBin[i].size() == p_bands) { - QString bandBinName = bandBin[i].name(); + QString bandBinName = QString::fromStdString(bandBin[i].name()); p_comboBox->addItem(QString(bandBinName)); } diff --git a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp index c662600947..a238a3c681 100644 --- a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp +++ b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp @@ -541,7 +541,7 @@ namespace Isis { // Create constant rotation frames PvlKeyword cf("ConstantFrames", toString(virZeroId)); - cf.addValue(toString(virZeroId)); + cf.addValue(std::to_string(virZeroId)); quats.Label() += cf; SpiceDouble identity[3][3]; @@ -551,7 +551,7 @@ namespace Isis { PvlKeyword crot("ConstantRotation"); for (int i = 0 ; i < 3 ; i++) { for (int j = 0 ; j < 3 ; j++) { - crot.addValue(toString(identity[i][j])); + crot.addValue(std::to_string(identity[i][j])); } } From f949307f004613ba93b4b58d1ac985881971d8a7 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Fri, 27 Oct 2023 13:04:52 -0700 Subject: [PATCH 52/95] more pvl updates --- isis/src/apollo/apps/apollo2isis/main.cpp | 24 +- isis/src/apollo/apps/apollocal/apollocal.cpp | 7 +- .../apollo/apps/apollofindrx/apollofindrx.cpp | 50 ++-- .../apollopanstitcher/apollopanstitcher.cpp | 2 +- .../apollo/apps/apolloremrx/apolloremrx.cpp | 14 +- .../apollo/apps/apollowarp/WarpTransform.cpp | 6 +- isis/src/apollo/apps/apollowarp/main.cpp | 16 +- .../ApolloMetricCamera/ApolloMetricCamera.cpp | 2 +- .../objs/ApolloMetricCamera/unitTest.cpp | 2 +- .../ApolloPanoramicCamera.cpp | 8 +- .../ApolloPanoramicDetectorMap.cpp | 2 +- isis/src/base/apps/appjit/main.cpp | 6 +- isis/src/base/apps/autoregtemplate/main.cpp | 64 ++--- isis/src/base/apps/bit2bit/main.cpp | 32 +-- isis/src/base/apps/cam2map/main.cpp | 8 +- isis/src/base/apps/camtrim/main.cpp | 2 +- isis/src/base/apps/cathist/main.cpp | 6 +- isis/src/base/apps/catlab/main.cpp | 6 +- isis/src/base/apps/catoriglab/main.cpp | 6 +- isis/src/base/apps/center/main.cpp | 8 +- isis/src/base/apps/copylabel/main.cpp | 24 +- isis/src/base/apps/cubeavg/main.cpp | 18 +- isis/src/base/apps/cubediff/main.cpp | 6 +- isis/src/base/apps/cubefunc/main.cpp | 2 +- isis/src/base/apps/cubenorm/main.cpp | 20 +- isis/src/base/apps/desmile/main.cpp | 2 +- isis/src/base/apps/dsk2isis/main.cpp | 2 +- isis/src/base/apps/editlab/main.cpp | 30 +-- isis/src/base/apps/errors/main.cpp | 8 +- isis/src/base/apps/findrx/main.cpp | 34 +-- isis/src/base/apps/footprintmerge/main.cpp | 12 +- isis/src/base/apps/getkey/main.cpp | 28 +-- isis/src/base/apps/interestcube/main.cpp | 4 +- isis/src/base/apps/isis2fits/main.cpp | 10 +- isis/src/base/apps/isis2raw/main.cpp | 14 +- isis/src/base/apps/kernfilter/main.cpp | 4 +- isis/src/base/apps/lineeq/main.cpp | 6 +- isis/src/base/apps/makeflat/main.cpp | 26 +- isis/src/base/apps/map2map/main.cpp | 32 +-- isis/src/base/apps/mapgrid/main.cpp | 10 +- isis/src/base/apps/maplab/main.cpp | 18 +- isis/src/base/apps/mappt/main.cpp | 2 +- isis/src/base/apps/mapsize/main.cpp | 22 +- isis/src/base/apps/mask/main.cpp | 4 +- isis/src/base/apps/nocam2map/main.cpp | 16 +- isis/src/base/apps/noisefilter/main.cpp | 10 +- isis/src/base/apps/pad/main.cpp | 16 +- isis/src/base/apps/percent/main.cpp | 6 +- isis/src/base/apps/phoempglobal/main.cpp | 6 +- isis/src/base/apps/phoemplocal/main.cpp | 24 +- isis/src/base/apps/phohillier/main.cpp | 2 +- isis/src/base/apps/photemplate/main.cpp | 16 +- isis/src/base/apps/photomet/main.cpp | 6 +- isis/src/base/apps/remrx/main.cpp | 26 +- isis/src/base/apps/ringsmappt/main.cpp | 32 +-- isis/src/base/apps/ringspt/main.cpp | 12 +- isis/src/base/apps/shadowtau/main.cpp | 34 +-- isis/src/base/apps/skyrange/main.cpp | 32 +-- isis/src/base/apps/slpmap/main.cpp | 4 +- isis/src/base/apps/smtk/main.cpp | 22 +- isis/src/base/apps/specpix/main.cpp | 12 +- isis/src/base/apps/table2cube/main.cpp | 2 +- isis/src/base/apps/tabledump/main.cpp | 6 +- isis/src/base/apps/tonematch/main.cpp | 6 +- isis/src/base/apps/trackextract/main.cpp | 2 +- .../base/objs/BulletShapeModel/unitTest.cpp | 4 +- isis/src/base/objs/Camera/unitTest.cpp | 8 +- .../base/objs/CameraPointInfo/unitTest.cpp | 4 +- .../base/objs/CameraStatistics/unitTest.cpp | 2 +- isis/src/base/objs/DemShape/unitTest.cpp | 4 +- .../base/objs/EmbreeShapeModel/unitTest.cpp | 4 +- isis/src/base/objs/Equalization/unitTest.cpp | 4 +- .../base/objs/Equirectangular/unitTest.cpp | 20 +- .../src/base/objs/ExportPdsTable/unitTest.cpp | 16 +- isis/src/base/objs/FramingCamera/unitTest.cpp | 2 +- .../base/objs/GridPolygonSeeder/unitTest.cpp | 22 +- isis/src/base/objs/Gruen/unitTest.cpp | 16 +- isis/src/base/objs/Hapke/unitTest.cpp | 60 ++--- .../base/objs/LimitPolygonSeeder/unitTest.cpp | 8 +- .../objs/LunarAzimuthalEqualArea/unitTest.cpp | 16 +- .../objs/LunarLambertEmpirical/unitTest.cpp | 6 +- .../base/objs/MinnaertEmpirical/unitTest.cpp | 6 +- isis/src/base/objs/Mollweide/unitTest.cpp | 16 +- .../base/objs/ObliqueCylindrical/unitTest.cpp | 18 +- .../base/objs/ObservationNumber/unitTest.cpp | 2 +- isis/src/base/objs/Orthographic/unitTest.cpp | 8 +- isis/src/base/objs/Planar/unitTest.cpp | 6 +- .../base/objs/PointPerspective/unitTest.cpp | 40 ++-- .../base/objs/PolarStereographic/unitTest.cpp | 20 +- .../base/objs/ProcessExportPds4/unitTest.cpp | 4 +- .../base/objs/ProcessMapMosaic/unitTest.cpp | 8 +- isis/src/base/objs/ProcessMosaic/unitTest.cpp | 8 +- isis/src/base/objs/Projection/unitTest.cpp | 36 +-- .../ProjectionFactory/ProjectionFactory.cpp | 16 +- .../base/objs/ProjectionFactory/unitTest.cpp | 124 +++++----- .../PvlToXmlTranslationManager.cpp | 46 ++-- .../PvlTranslationTable.cpp | 26 +- .../base/objs/RingCylindrical/unitTest.cpp | 6 +- isis/src/base/objs/Sensor/unitTest.cpp | 30 +-- isis/src/base/objs/SerialNumber/unitTest.cpp | 2 +- isis/src/base/objs/SessionLog/unitTest.cpp | 6 +- .../base/objs/ShapeModelFactory/unitTest.cpp | 34 +-- .../base/objs/SimpleCylindrical/unitTest.cpp | 16 +- isis/src/base/objs/Sinusoidal/unitTest.cpp | 16 +- isis/src/base/objs/Spice/unitTest.cpp | 20 +- isis/src/base/objs/Strategy/unitTest.cpp | 2 +- .../base/objs/StripPolygonSeeder/unitTest.cpp | 24 +- isis/src/base/objs/SubArea/unitTest.cpp | 222 +++++++++--------- isis/src/base/objs/Target/unitTest.cpp | 44 ++-- isis/src/cassini/apps/ciss2isis/ciss2isis.cpp | 44 ++-- isis/src/cassini/apps/cisscal/DarkCurrent.cpp | 2 +- isis/src/cassini/apps/cisscal/main.cpp | 50 ++-- isis/src/cassini/apps/vims2isis/main.cpp | 12 +- isis/src/cassini/apps/vimscal/main.cpp | 40 ++-- .../cassini/objs/CissLabels/CissLabels.cpp | 32 +-- .../cassini/objs/IssNACamera/IssNACamera.cpp | 10 +- .../cassini/objs/IssWACamera/IssWACamera.cpp | 4 +- .../cassini/objs/VimsCamera/VimsCamera.cpp | 26 +- .../cassini/objs/VimsCamera/VimsGroundMap.cpp | 12 +- .../cassini/objs/VimsCamera/VimsSkyMap.cpp | 12 +- .../apps/chan1m32isis/chan1m32isis.cpp | 42 ++-- .../Chandrayaan1M3Camera.cpp | 2 +- isis/src/clementine/apps/clem2isis/main.cpp | 26 +- .../src/clementine/apps/clemhirescal/main.cpp | 2 +- isis/src/clementine/apps/clemnircal/main.cpp | 44 ++-- .../src/clementine/apps/clemuvviscal/main.cpp | 52 ++-- .../objs/HiresCamera/HiresCamera.cpp | 4 +- .../clementine/objs/LwirCamera/LwirCamera.cpp | 4 +- .../clementine/objs/NirCamera/NirCamera.cpp | 4 +- .../objs/UvvisCamera/UvvisCamera.cpp | 2 +- isis/src/clipper/apps/eis2isis/eis2isis.cpp | 26 +- isis/src/clipper/apps/jitterfit/jitterfit.cpp | 10 +- .../ClipperNacRollingShutterCamera.cpp | 8 +- .../ClipperWacFcCamera/ClipperWacFcCamera.cpp | 2 +- isis/src/control/apps/cnet2dem/main.cpp | 6 +- isis/src/control/apps/cnet2mat/main.cpp | 6 +- isis/src/control/apps/cnetadd/main.cpp | 10 +- isis/src/control/apps/cnetedit/main.cpp | 2 +- isis/src/control/apps/cnetmerge/main.cpp | 18 +- isis/src/control/apps/cnetnewradii/main.cpp | 14 +- isis/src/control/apps/cnetref/main.cpp | 8 +- isis/src/control/apps/coreg/main.cpp | 20 +- isis/src/control/apps/deltack/main.cpp | 32 +-- isis/src/control/apps/fplanemap/main.cpp | 16 +- isis/src/control/apps/mat2cnet/main.cpp | 6 +- isis/src/control/apps/seedgrid/main.cpp | 24 +- .../objs/ControlMeasureLogData/unitTest.cpp | 2 +- .../control/objs/ControlNetDiff/unitTest.cpp | 2 +- .../objs/ControlNetFilter/unitTest.cpp | 34 +-- .../objs/ControlNetValidMeasure/unitTest.cpp | 148 ++++++------ .../objs/InterestOperator/unitTest.cpp | 22 +- .../src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp | 20 +- isis/src/dawn/apps/dawnvir2isis/main.cpp | 12 +- .../dawn/objs/DawnFcCamera/DawnFcCamera.cpp | 2 +- .../dawn/objs/DawnVirCamera/DawnVirCamera.cpp | 22 +- isis/src/dev/apps/camdev/camdev.cpp | 14 +- isis/src/dev/apps/camdev/main.cpp | 14 +- isis/src/dev/apps/camtest/main.cpp | 14 +- isis/src/dev/apps/m3loc2net/main.cpp | 2 +- isis/src/galileo/apps/gllnims2isis/main.cpp | 6 +- isis/src/galileo/apps/gllssi2isis/main.cpp | 2 +- isis/src/galileo/apps/gllssical/gllssical.cpp | 24 +- isis/src/hayabusa/apps/amica2isis/main.cpp | 2 +- isis/src/hayabusa/apps/amicacal/main.cpp | 20 +- .../apps/cneteditor/CnetEditorWindow.cpp | 2 +- isis/src/qisis/apps/qnet/main.cpp | 2 +- isis/src/qisis/apps/qtie/QtieTool.cpp | 16 +- isis/src/qisis/apps/qview/main.cpp | 2 +- .../ControlMeasureEditWidget.cpp | 4 +- .../ControlPointEdit/ControlPointEdit.cpp | 4 +- .../ControlPointEditWidget.cpp | 6 +- .../qisis/objs/CubeViewport/CubeViewport.cpp | 46 ++-- .../objs/Directory/ImportImagesWorkOrder.cpp | 8 +- .../DisplayProperties/DisplayProperties.cpp | 6 +- .../FeatureNomenclatureTool.cpp | 2 +- isis/src/qisis/objs/FileTool/FileTool.cpp | 26 +- isis/src/qisis/objs/HelpTool/HelpTool.cpp | 2 +- isis/src/qisis/objs/Image/Image.cpp | 14 +- .../ImageFileListWidget.cpp | 18 +- .../objs/JigsawRunWidget/JigsawRunWidget.cpp | 6 +- isis/src/qisis/objs/MatchTool/MatchTool.cpp | 4 +- .../MosaicMainWindow/MosaicController.cpp | 16 +- .../objs/MosaicSceneWidget/MosaicAreaTool.cpp | 18 +- .../MosaicControlNetTool.cpp | 22 +- .../objs/MosaicSceneWidget/MosaicFindTool.cpp | 14 +- .../objs/MosaicSceneWidget/MosaicGridTool.cpp | 52 ++-- .../MosaicSceneWidget/MosaicSceneWidget.cpp | 36 +-- .../ProjectionConfigDialog.cpp | 2 +- .../QIsisApplication/QIsisApplication.cpp | 2 +- isis/src/qisis/objs/QnetTools/QnetTool.cpp | 10 +- isis/src/qisis/objs/Shape/Shape.cpp | 36 +-- .../SpectralPlotTool/SpectralPlotTool.cpp | 2 +- .../SpectralPlotTool/SpectralPlotWindow.cpp | 8 +- isis/src/qisis/objs/StereoTool/StereoTool.cpp | 6 +- .../qisis/objs/StretchTool/StretchTool.cpp | 14 +- isis/src/rosetta/apps/rososiris2isis/main.cpp | 14 +- isis/src/rosetta/apps/rosvirtis2isis/main.cpp | 6 +- .../socet/apps/socetframesettings/main.cpp | 26 +- .../socetlinescankeywords.cpp | 16 +- isis/src/system/apps/blobdump/main.cpp | 8 +- isis/src/system/apps/csspckgen/main.cpp | 14 +- isis/src/system/apps/dempack/main.cpp | 14 +- .../apps/isisdataeval/IsisDataModel.cpp | 26 +- .../system/apps/isisdataeval/isisdataeval.cpp | 42 ++-- .../system/apps/kerneldbgen/SpiceDbGen.cpp | 26 +- .../system/apps/kerneldbgen/kerneldbgen.cpp | 47 ++-- isis/src/system/apps/messckgen/main.cpp | 30 +-- isis/src/system/apps/messspkgen/main.cpp | 10 +- .../apps/prtloganalyzer/ProgramAnalyzer.cpp | 64 ++--- .../apps/prtloganalyzer/ProgramAnalyzer.h | 4 +- isis/src/system/apps/prtloganalyzer/main.cpp | 2 +- isis/src/system/objs/KernelDb/KernelDb.cpp | 56 ++--- .../apps/tgocassis2isis/tgocassis2isis.cpp | 6 +- isis/src/viking/apps/vik2isis/main.cpp | 8 +- isis/src/viking/apps/vikcal/vikcal.cpp | 28 +-- 215 files changed, 1870 insertions(+), 1882 deletions(-) diff --git a/isis/src/apollo/apps/apollo2isis/main.cpp b/isis/src/apollo/apps/apollo2isis/main.cpp index a051c66b0d..3f3668f902 100644 --- a/isis/src/apollo/apps/apollo2isis/main.cpp +++ b/isis/src/apollo/apps/apollo2isis/main.cpp @@ -60,7 +60,7 @@ void IsisMain() { apollo = new Apollo(filename); - utcTime = (QString)pdsLabel["START_TIME"]; + utcTime = QString::fromStdString(pdsLabel["START_TIME"]); // Setup the output cube attributes for a 16-bit unsigned tiff Isis::CubeAttributeOutput cao; @@ -231,9 +231,9 @@ void TranslateApolloLabels (IString filename, Cube *opack) { PvlGroup kern("Kernels"); PvlGroup codeGroup("Code"); - inst += PvlKeyword("SpacecraftName", apollo->SpacecraftName()); - inst += PvlKeyword("InstrumentId", apollo->InstrumentId()); - inst += PvlKeyword("TargetName", apollo->TargetName()); + inst += PvlKeyword("SpacecraftName", apollo->SpacecraftName().toStdString()); + inst += PvlKeyword("InstrumentId", apollo->InstrumentId().toStdString()); + inst += PvlKeyword("TargetName", apollo->TargetName().toStdString()); if ( !IsValidCode() ){ PvlGroup error("ERROR"); @@ -249,12 +249,12 @@ void TranslateApolloLabels (IString filename, Cube *opack) { Application::Log(error); } else { - codeGroup += PvlKeyword("StartTime", FrameTime()); + codeGroup += PvlKeyword("StartTime", FrameTime().toStdString()); codeGroup += PvlKeyword("SpacecraftAltitude", std::to_string(Altitude()),"meters"); if (apollo->IsMetric()){ codeGroup += PvlKeyword("ExposureDuration", std::to_string(ShutterInterval()), "milliseconds"); - codeGroup += PvlKeyword("ForwardMotionCompensation", FMC()); + codeGroup += PvlKeyword("ForwardMotionCompensation", FMC().toStdString()); } for (int i=0; i<4; i++) { @@ -272,20 +272,20 @@ void TranslateApolloLabels (IString filename, Cube *opack) { bandBin += PvlKeyword("FilterName", "CLEAR"); bandBin += PvlKeyword("FilterId", "1"); - kern += PvlKeyword("NaifFrameCode", apollo->NaifFrameCode()); + kern += PvlKeyword("NaifFrameCode", apollo->NaifFrameCode().toStdString()); // Set up the nominal reseaus group Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory"); Process p; PvlTranslationTable tTable("$ISISROOT/appdata/translations/MissionName2DataDir.trn"); - QString missionDir = dataDir[tTable.Translate("MissionName", apollo->SpacecraftName())][0]; - Pvl resTemplate(missionDir + "/reseaus/" + apollo->InstrumentId() + "_NOMINAL.pvl"); + QString missionDir = dataDir[tTable.Translate("MissionName", QString::fromStdString(apollo->SpacecraftName()))][0]; + Pvl resTemplate(missionDir.toStdString() + "/reseaus/" + apollo->InstrumentId().toStdString() + "_NOMINAL.pvl"); PvlGroup *reseaus = &resTemplate.findGroup("Reseaus"); // Update reseau locations based on refined code location for (int i=0; i<(reseaus->findKeyword("Type")).size(); i++) { - double x = toDouble(reseaus->findKeyword("Sample")[i]) + sampleTranslation + 2278, - y = toDouble(reseaus->findKeyword("Line")[i]) + lineTranslation - 20231; + double x = std::stod(reseaus->findKeyword("Sample")[i]) + sampleTranslation + 2278, + y = std::stod(reseaus->findKeyword("Line")[i]) + lineTranslation - 20231; if (apollo->IsApollo17()) { x += 50; @@ -297,7 +297,7 @@ void TranslateApolloLabels (IString filename, Cube *opack) { reseaus->findKeyword("Line")[i] = std::to_string( sin(rotation)*(x-sampleTranslation) + cos(rotation)*(y-lineTranslation) + lineTranslation); } - inst += PvlKeyword("StartTime", utcTime); + inst += PvlKeyword("StartTime", utcTime.toStdString()); opack->putGroup(inst); opack->putGroup(bandBin); diff --git a/isis/src/apollo/apps/apollocal/apollocal.cpp b/isis/src/apollo/apps/apollocal/apollocal.cpp index 3b35001072..d658efc821 100644 --- a/isis/src/apollo/apps/apollocal/apollocal.cpp +++ b/isis/src/apollo/apps/apollocal/apollocal.cpp @@ -39,10 +39,11 @@ namespace Isis { PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); PvlTranslationTable tTable("$ISISROOT/appdata/translations/MissionName2DataDir.trn"); - QString missionDir = dataDir[tTable.Translate("MissionName", - (inCube->group("Instrument")).findKeyword("SpacecraftName")[0])][0]; + QString missionDir = QString::fromStdString( + dataDir[tTable.Translate("MissionName", QString::fromStdString( + (inCube->group("Instrument")).findKeyword("SpacecraftName")[0])).toStdString()][0]); QString camera = - (inCube->group("Instrument")).findKeyword("InstrumentId")[0]; + QString::fromStdString((inCube->group("Instrument")).findKeyword("InstrumentId")[0]); CubeAttributeInput cai; p.SetInputCube(missionDir + "/calibration/" + camera + "_flatfield.cub", cai); diff --git a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp b/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp index 3b517ad17c..c55fc84006 100644 --- a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp +++ b/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp @@ -54,8 +54,8 @@ namespace Isis { MAX_DISPY = ui.GetInteger("DELTAY"); PvlGroup &reseaus = cube->label()->findGroup("Reseaus",Pvl::Traverse); - QString mission = (cube->label()->findGroup("Instrument",Pvl::Traverse))["SpacecraftName"]; - QString instrument = (cube->label()->findGroup("Instrument",Pvl::Traverse))["InstrumentId"]; + QString mission = QString::fromStdString((cube->label()->findGroup("Instrument",Pvl::Traverse))["SpacecraftName"]); + QString instrument = QString::fromStdString((cube->label()->findGroup("Instrument",Pvl::Traverse))["InstrumentId"]); Apollo apollo(mission, instrument); if (mission.mid(0,6) != "APOLLO") { std::string msg = "This application is for use with Apollo spacecrafts only."; @@ -65,21 +65,21 @@ namespace Isis { // If the Keyword sizes don't match up, throw errors. int nres = reseaus["Line"].size(); if (nres != reseaus["Sample"].size()) { - QString msg = "Sample size incorrect [Sample size " + - toString(reseaus["Sample"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + std::string msg = "Sample size incorrect [Sample size " + + std::to_string(reseaus["Sample"].size()) + " != " + " Line size " + + std::to_string(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (nres != reseaus["Type"].size()) { - QString msg = "Type size incorrect [Type size " + - toString(reseaus["Type"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + std::string msg = "Type size incorrect [Type size " + + std::to_string(reseaus["Type"].size()) + " != " + " Line size " + + std::to_string(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (nres != reseaus["Valid"].size()) { - QString msg = "Valid size incorrect [Valid size " + - toString(reseaus["Valid"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + std::string msg = "Valid size incorrect [Valid size " + + std::to_string(reseaus["Valid"].size()) + " != " + " Line size " + + std::to_string(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -106,8 +106,8 @@ namespace Isis { int validReseaus = 0; // for (int res=0; res 0 && reseaus["Valid"][res-1] == "1") dy = currentLine - patternSize/2 - dl + bestLine-1 - toDouble(reseaus["Line"][res]); - if (res/dim > 0 && reseaus["Valid"][res - dim] == "1") dx = currentSample - patternSize/2 - ds + bestSample-1 - toDouble(reseaus["Sample"][res]); - double horizontalShift = currentSample - patternSize/2 - ds + bestSample-1 - toDouble(reseaus["Sample"][res]) - dx, - verticalShift = currentLine - patternSize/2 - dl + bestLine-1 - toDouble(reseaus["Line"][res]) - dy; + if (res%dim > 0 && reseaus["Valid"][res-1] == "1") dy = currentLine - patternSize/2 - dl + bestLine-1 - std::stod(reseaus["Line"][res]); + if (res/dim > 0 && reseaus["Valid"][res - dim] == "1") dx = currentSample - patternSize/2 - ds + bestSample-1 - std::stod(reseaus["Sample"][res]); + double horizontalShift = currentSample - patternSize/2 - ds + bestSample-1 - std::stod(reseaus["Sample"][res]) - dx, + verticalShift = currentLine - patternSize/2 - dl + bestLine-1 - std::stod(reseaus["Line"][res]) - dy; for (int i=res; i xy; xy.push_back(res%(int)sqrt(nres)); xy.push_back(res/(int)sqrt(nres)); - sampFunc.AddKnown(xy, toDouble(reseaus["Sample"][res])); - lineFunc.AddKnown(xy, toDouble(reseaus["Line"][res])); + sampFunc.AddKnown(xy, std::stod(reseaus["Sample"][res])); + lineFunc.AddKnown(xy, std::stod(reseaus["Line"][res])); ds = (int)(MIN_DISP+ abs(dx) + abs(horizontalShift)); dl = (int)(MIN_DISP + abs(dy) + abs(verticalShift)); @@ -150,12 +150,12 @@ namespace Isis { // for invalid reseaus, refine the estimated locations for (int res=0; res xy; xy.push_back(res%(int)sqrt(nres)); xy.push_back(res/(int)sqrt(nres)); - reseaus["Sample"][res] = toString(sampFunc.Evaluate(xy)); - reseaus["Line"][res] = toString(lineFunc.Evaluate(xy)); + reseaus["Sample"][res] = std::to_string(sampFunc.Evaluate(xy)); + reseaus["Line"][res] = std::to_string(lineFunc.Evaluate(xy)); } } @@ -170,7 +170,7 @@ namespace Isis { if (cube->label()->hasObject("History")) { // Record apollofindrx history to the cube - QString histName = (QString)cube->label()->findObject("History")["Name"]; + QString histName = QString::fromStdString(cube->label()->findObject("History")["Name"]); // create a History Blob with value found in the History PvlObject's Name keyword // read cube's History PvlObject data into the History Blob History hist = cube->readHistory(histName); diff --git a/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp b/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp index 4a4ad3a414..e18d7ae669 100644 --- a/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp +++ b/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp @@ -167,7 +167,7 @@ namespace Isis { //parameters for maximum correlation autoregestration // see: ///usgs/pkgs/isis3nightly2011-09-21/isis/doc/documents/patternSMatch/patternSMatch.html#DistanceTolerance FileName fiducialPvl("$ISISROOT/appdata/templates/apollo/PanFiducialFinder.def"); - pvl.read(fiducialPvl.expanded()); //read in the autoreg parameters + pvl.read(fiducialPvl.expanded().toStdString()); //read in the autoreg parameters AutoReg *arS = AutoRegFactory::Create(pvl); *arS->PatternChip() = patternS; //patternS chip is constant diff --git a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp b/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp index 6d85ef4574..88aa836e1f 100644 --- a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp +++ b/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp @@ -47,8 +47,8 @@ namespace Isis { PvlKeyword &status = info->group("RESEAUS")["STATUS"]; QString in = info->fileName(); - QString spacecraft = (info->group("Instrument")["SpacecraftName"]); - QString instrument = (info->group("Instrument")["InstrumentId"]); + QString spacecraft = QString::fromStdString(info->group("Instrument")["SpacecraftName"]); + QString instrument = QString::fromStdString(info->group("Instrument")["InstrumentId"]); if (spacecraft.mid(0,6) != "APOLLO") { std::string msg = "This application is for use with Apollo spacecrafts only. "; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -56,12 +56,12 @@ namespace Isis { Apollo apollo(spacecraft, instrument); // Check reseau status and make sure it is not nominal or removed - if ((QString)status == "Nominal") { + if ((std::string)status == "Nominal") { QString msg = "Input file [" + in + "] appears to have nominal reseau status. You must run findrx first."; throw IException(IException::User,msg, _FILEINFO_); } - if ((QString)status == "Removed") { + if ((std::string)status == "Removed") { QString msg = "Input file [" + in + "] appears to already have reseaus removed."; throw IException(IException::User,msg, _FILEINFO_); @@ -99,9 +99,9 @@ namespace Isis { Brick brick(dim,dim,1,cube.pixelType()); int width = ui.GetInteger("WIDTH"); for (int res=0; resKnowns(); i++) { - PvlKeyword p("POINT"+toString(i+1)); - p += toString(p_lsqInputLine->Residual(i)); - p += toString(p_lsqInputSamp->Residual(i)); + PvlKeyword p("POINT"+std::to_string(i+1)); + p += std::to_string(p_lsqInputLine->Residual(i)); + p += std::to_string(p_lsqInputSamp->Residual(i)); errs += p; } return errs; diff --git a/isis/src/apollo/apps/apollowarp/main.cpp b/isis/src/apollo/apps/apollowarp/main.cpp index 25bd0fe8c9..7a0471a49c 100644 --- a/isis/src/apollo/apps/apollowarp/main.cpp +++ b/isis/src/apollo/apps/apollowarp/main.cpp @@ -27,12 +27,12 @@ void IsisMain() { // Check to see if it is an Apollo image and if the reseaus have been refined // (note: a status of 'Removed' implies it is also 'Refined') PvlGroup &reseaus = ipacket->group("Reseaus"); - QString mission = (ipacket->group("Instrument"))["SpacecraftName"]; + QString mission = QString::fromStdString(ipacket->group("Instrument")["SpacecraftName"]); if (mission.mid(0,6) != "APOLLO") { std::string msg = "This application is for use with Apollo spacecrafts only. "; throw IException(IException::Unknown, msg, _FILEINFO_); } - if ((QString)reseaus["Status"] != "Refined" && (QString)reseaus["Status"] != "Removed") { + if ((std::string)reseaus["Status"] != "Refined" && (std::string)reseaus["Status"] != "Removed") { std::string msg = "This application can only be run after findapollorx."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -43,14 +43,14 @@ void IsisMain() { vector inputLine,inputSample,outputLine,outputSample; // Setup the parameters for the transform for (int i=0; ifindGroup("Instrument", Pvl::Traverse); - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); // approximate 1 tenth of a second since Apollo did not diff --git a/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicCamera.cpp b/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicCamera.cpp index cc41d6b203..3b03eead2b 100644 --- a/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicCamera.cpp +++ b/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicCamera.cpp @@ -82,13 +82,13 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = (QString)inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); SpiceDouble etStart; str2et_c(stime.toLatin1().data(), &etStart); - stime = (QString) inst["StopTime"]; + stime = QString::fromStdString(inst["StopTime"]); SpiceDouble etStop; str2et_c(stime.toLatin1().data(), &etStop); - iTime isisTime( (QString) inst["StartTime"]); + iTime isisTime( QString::fromStdString(inst["StartTime"])); // Get other info from labels // line exposure duration, sec/mm @@ -135,7 +135,7 @@ namespace Isis { new LineScanCameraSkyMap(this); PvlGroup &instP = lab.findGroup("Kernels", Pvl::Traverse); - m_CkFrameId = toInt(instP["NaifFrameCode"][0]); + m_CkFrameId = std::stoi(instP["NaifFrameCode"][0]); m_CkFrameId = -int(-m_CkFrameId/1000)*1000; LoadCache(); diff --git a/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicDetectorMap.cpp b/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicDetectorMap.cpp index 01fddfbb1d..5ea699871b 100644 --- a/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicDetectorMap.cpp +++ b/isis/src/apollo/objs/ApolloPanoramicCamera/ApolloPanoramicDetectorMap.cpp @@ -98,7 +98,7 @@ namespace Isis { //read the fidicial measurements from the attached table in the camera labels to define a // series of affine transformation between image (aka encoder aka machine) coordinates // and fiducial coordinates - Table tableFid("Fiducial Measurement", m_lab->fileName()); + Table tableFid("Fiducial Measurement", QString::fromStdString(m_lab->fileName())); nrec = tableFid.Records(); //get the number of records found in the cube blobs diff --git a/isis/src/base/apps/appjit/main.cpp b/isis/src/base/apps/appjit/main.cpp index 8d3f8db4f6..e077bd0164 100644 --- a/isis/src/base/apps/appjit/main.cpp +++ b/isis/src/base/apps/appjit/main.cpp @@ -104,7 +104,7 @@ void IsisMain() { // Pull out the pointing cache as a table and write it Table cmatrix = crot.Cache("InstrumentPointing"); // cmatrix.Label().addComment("Corrected using appjit and" + ui.GetFileName("JITTERFILE")); - cmatrix.Label() += PvlKeyword("Description", "Corrected using appjit and" + ui.GetFileName("JITTERFILE")); + cmatrix.Label() += PvlKeyword("Description", "Corrected using appjit and" + ui.GetFileName("JITTERFILE").toStdString()); cmatrix.Label() += PvlKeyword("Kernels"); PvlKeyword ckKeyword = crot.InstrumentPointingValue(); @@ -127,7 +127,7 @@ void IsisMain() { cube.putGroup(kernels); cube.close(); - gp += PvlKeyword("StatusMaster", ui.GetCubeName("MASTER") + ": camera pointing updated"); + gp += PvlKeyword("StatusMaster", ui.GetCubeName("MASTER").toStdString() + ": camera pointing updated"); // Apply the dejittered pointing to the rest of the files step2 = true; @@ -160,7 +160,7 @@ void IsisMain() { } cube.putGroup(kernels); cube.close(); - gp += PvlKeyword("Status" + toString(ifile), list[ifile].toString() + ": camera pointing updated"); + gp += PvlKeyword("Status" + std::to_string(ifile), list[ifile].toString().toStdString() + ": camera pointing updated"); } } Application::Log(gp); diff --git a/isis/src/base/apps/autoregtemplate/main.cpp b/isis/src/base/apps/autoregtemplate/main.cpp index 4ce21f69c6..33e718c761 100644 --- a/isis/src/base/apps/autoregtemplate/main.cpp +++ b/isis/src/base/apps/autoregtemplate/main.cpp @@ -19,9 +19,9 @@ void IsisMain() { // Make sure the entered algorithm name is valid QString algoName = ui.GetString("ALGORITHM"); - if(!algos.hasGroup(algoName)) { + if(!algos.hasGroup(algoName.toStdString())) { // Give the user a list of possible algorithms - QString msg = "Invalid value for [ALGORITHM] entered [" + algoName + "]. " + std::string msg = "Invalid value for [ALGORITHM] entered [" + algoName.toStdString() + "]. " + "Must be one of ["; for(int i = 0; i < algos.groups(); i++) { @@ -37,20 +37,20 @@ void IsisMain() { // Make algorithm group PvlGroup algorithm("Algorithm"); - algorithm += PvlKeyword("Name", algoName); + algorithm += PvlKeyword("Name", algoName.toStdString()); // Set the tolerance double tol = ui.GetDouble("TOLERANCE"); - algorithm += PvlKeyword("Tolerance", toString(tol)); + algorithm += PvlKeyword("Tolerance", std::to_string(tol)); // Set the reduction factor if the user entered it if(ui.WasEntered("REDUCTIONFACTOR")) { int reduction = ui.GetInteger("REDUCTIONFACTOR"); - algorithm += PvlKeyword("ReductionFactor", toString(reduction)); + algorithm += PvlKeyword("ReductionFactor", std::to_string(reduction)); if(reduction < 1) { - QString msg = "Invalid value for [REDUCTIONFACTOR] entered [" - + toString(reduction) + "]. Must be greater than or equal to 1 (Default = 1)"; + std::string msg = "Invalid value for [REDUCTIONFACTOR] entered [" + + std::to_string(reduction) + "]. Must be greater than or equal to 1 (Default = 1)"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -64,7 +64,7 @@ void IsisMain() { paramToInterpMap["BILINEARTYPE"] = "BiLinearType"; paramToInterpMap["CUBICCONVOLUTIONTYPE"] = "CubicConvolutionType"; - algorithm += PvlKeyword("ChipInterpolator", paramToInterpMap[ui.GetString("INTERP")]); + algorithm += PvlKeyword("ChipInterpolator", paramToInterpMap[ui.GetString("INTERP")].toStdString()); // Add algorithm group to the autoreg object autoreg.addGroup(algorithm); @@ -95,52 +95,52 @@ void IsisMain() { // Set up the pattern chip group PvlGroup patternChip("PatternChip"); - patternChip += PvlKeyword("Samples", toString(psamp)); - patternChip += PvlKeyword("Lines", toString(pline)); + patternChip += PvlKeyword("Samples", std::to_string(psamp)); + patternChip += PvlKeyword("Lines", std::to_string(pline)); if(ui.WasEntered("PMIN")) { - patternChip += PvlKeyword("ValidMinimum", toString(ui.GetInteger("PMIN"))); + patternChip += PvlKeyword("ValidMinimum", std::to_string(ui.GetInteger("PMIN"))); } if(ui.WasEntered("PMAX")) { - patternChip += PvlKeyword("ValidMaximum", toString(ui.GetInteger("PMAX"))); + patternChip += PvlKeyword("ValidMaximum", std::to_string(ui.GetInteger("PMAX"))); } if(ui.WasEntered("MINIMUMZSCORE")) { double minimum = ui.GetDouble("MINIMUMZSCORE"); - patternChip += PvlKeyword("MinimumZScore", toString(minimum)); + patternChip += PvlKeyword("MinimumZScore", std::to_string(minimum)); if(minimum <= 0.0) { - QString msg = "Invalid value for [MINIMUMZSCORE] entered [" - + toString(minimum) + "]. Must be greater than 0.0 (Default = 1.0)"; + std::string msg = "Invalid value for [MINIMUMZSCORE] entered [" + + std::to_string(minimum) + "]. Must be greater than 0.0 (Default = 1.0)"; throw IException(IException::User, msg, _FILEINFO_); } } if(ui.WasEntered("PVALIDPERCENT")) { double percent = ui.GetDouble("PVALIDPERCENT"); if((percent <= 0.0) || (percent > 100.0)) { - QString msg = "Invalid value for [PVALIDPERCENT] entered [" - + toString(percent) + "]. Must be greater than 0.0 and less than or equal to 100.0 (Default = 50.0)"; + std::string msg = "Invalid value for [PVALIDPERCENT] entered [" + + std::to_string(percent) + "]. Must be greater than 0.0 and less than or equal to 100.0 (Default = 50.0)"; throw IException(IException::User, msg, _FILEINFO_); } - patternChip += PvlKeyword("ValidPercent", toString(percent)); + patternChip += PvlKeyword("ValidPercent", std::to_string(percent)); } // Set up the search chip group PvlGroup searchChip("SearchChip"); - searchChip += PvlKeyword("Samples", toString(ssamp)); - searchChip += PvlKeyword("Lines", toString(sline)); + searchChip += PvlKeyword("Samples", std::to_string(ssamp)); + searchChip += PvlKeyword("Lines", std::to_string(sline)); if(ui.WasEntered("SMIN")) { - searchChip += PvlKeyword("ValidMinimum", toString(ui.GetInteger("SMIN"))); + searchChip += PvlKeyword("ValidMinimum", std::to_string(ui.GetInteger("SMIN"))); } if(ui.WasEntered("SMAX")) { - searchChip += PvlKeyword("ValidMaximum", toString(ui.GetInteger("SMAX"))); + searchChip += PvlKeyword("ValidMaximum", std::to_string(ui.GetInteger("SMAX"))); } if(ui.WasEntered("SSUBCHIPVALIDPERCENT")) { double percent = ui.GetDouble("SSUBCHIPVALIDPERCENT"); if((percent <= 0.0) || (percent > 100.0)) { - QString msg = "Invalid value for [SSUBCHIPVALIDPERCENT] entered [" - + toString(percent) + "]. Must be greater than 0.0 and less than or equal to 100.0 (Default = 50.0)"; + std::string msg = "Invalid value for [SSUBCHIPVALIDPERCENT] entered [" + + std::to_string(percent) + "]. Must be greater than 0.0 and less than or equal to 100.0 (Default = 50.0)"; throw IException(IException::User, msg, _FILEINFO_); } - searchChip += PvlKeyword("SubchipValidPercent", toString(percent)); + searchChip += PvlKeyword("SubchipValidPercent", std::to_string(percent)); } // Add groups to the autoreg object @@ -152,21 +152,21 @@ void IsisMain() { PvlGroup surfaceModel("SurfaceModel"); double distanceTol = ui.GetDouble("DISTANCETOLERANCE"); - surfaceModel += PvlKeyword("DistanceTolerance", toString(distanceTol)); + surfaceModel += PvlKeyword("DistanceTolerance", std::to_string(distanceTol)); if(distanceTol <= 0.0) { - QString msg = "Invalid value for [DISTANCETOLERANCE] entered [" - + toString(distanceTol) + "]. Must be greater than 0.0 (Default = 1.5)"; + std::string msg = "Invalid value for [DISTANCETOLERANCE] entered [" + + std::to_string(distanceTol) + "]. Must be greater than 0.0 (Default = 1.5)"; throw IException(IException::User, msg, _FILEINFO_); } int winSize = ui.GetInteger("WINDOWSIZE"); - surfaceModel += PvlKeyword("WindowSize", toString(winSize)); + surfaceModel += PvlKeyword("WindowSize", std::to_string(winSize)); // Make sure the window size is odd if(winSize % 2 == 0) { - QString msg = "Invalid value for [WINDOWSIZE] entered [" - + toString(winSize) + "]. Must be an odd number (Default = 5)"; + std::string msg = "Invalid value for [WINDOWSIZE] entered [" + + std::to_string(winSize) + "]. Must be an odd number (Default = 5)"; throw IException(IException::User, msg, _FILEINFO_); } autoreg.addGroup(surfaceModel); @@ -177,7 +177,7 @@ void IsisMain() { // Write the autoreg group pvl to the output file QString output = ui.GetFileName("TOPVL"); - p.write(output); + p.write(output.toStdString()); Isis::Application::GuiLog(p); } diff --git a/isis/src/base/apps/bit2bit/main.cpp b/isis/src/base/apps/bit2bit/main.cpp index ed0a81cca8..24afb8a76c 100644 --- a/isis/src/base/apps/bit2bit/main.cpp +++ b/isis/src/base/apps/bit2bit/main.cpp @@ -99,16 +99,16 @@ void IsisMain(){ //!Write bit2bit summary to print.prt logfile PvlGroup results("bit2bit_Results"); - results += PvlKeyword ("INPUT_LRS",toString(iLrs)); - results += PvlKeyword ("INPUT_HRS",toString(iHrs)); - results += PvlKeyword ("INPUT_NULL",toString(iNull)); - results += PvlKeyword ("INPUT_INVALID_PERCENT",toString(invalid_pi)); - results += PvlKeyword ("OUTPUT_MIN",toString(validMin)); - results += PvlKeyword ("OUTPUT_MAX",toString(validMax)); - results += PvlKeyword ("OUTPUT_LRS",toString(oLrs)); - results += PvlKeyword ("OUTPUT_HRS",toString(oHrs)); - results += PvlKeyword ("OUTPUT_NULL",toString(oNull)); - results += PvlKeyword ("OUTPUT_INVALID_PERCENT",toString(invalid_po)); + results += PvlKeyword ("INPUT_LRS",std::to_string(iLrs)); + results += PvlKeyword ("INPUT_HRS",std::to_string(iHrs)); + results += PvlKeyword ("INPUT_NULL",std::to_string(iNull)); + results += PvlKeyword ("INPUT_INVALID_PERCENT",std::to_string(invalid_pi)); + results += PvlKeyword ("OUTPUT_MIN",std::to_string(validMin)); + results += PvlKeyword ("OUTPUT_MAX",std::to_string(validMax)); + results += PvlKeyword ("OUTPUT_LRS",std::to_string(oLrs)); + results += PvlKeyword ("OUTPUT_HRS",std::to_string(oHrs)); + results += PvlKeyword ("OUTPUT_NULL",std::to_string(oNull)); + results += PvlKeyword ("OUTPUT_INVALID_PERCENT",std::to_string(invalid_po)); Application::Log(results); delete histptr; @@ -135,12 +135,12 @@ void IsisMain(){ //!Write bit2bit summary to print.prt logfile PvlGroup results("bit2bit_Results"); - results += PvlKeyword ("INPUT_LRS",toString(iLrs)); - results += PvlKeyword ("INPUT_HRS",toString(iHrs)); - results += PvlKeyword ("INPUT_NULL",toString(iNull)); - results += PvlKeyword ("INPUT_INVALID_PERCENT",toString(invalid_pi)); - results += PvlKeyword ("OUTPUT_MIN",toString(validMin)); - results += PvlKeyword ("OUTPUT_MAX",toString(validMax)); + results += PvlKeyword ("INPUT_LRS",std::to_string(iLrs)); + results += PvlKeyword ("INPUT_HRS",std::to_string(iHrs)); + results += PvlKeyword ("INPUT_NULL",std::to_string(iNull)); + results += PvlKeyword ("INPUT_INVALID_PERCENT",std::to_string(invalid_pi)); + results += PvlKeyword ("OUTPUT_MIN",std::to_string(validMin)); + results += PvlKeyword ("OUTPUT_MAX",std::to_string(validMax)); Application::Log(results); delete histptr; diff --git a/isis/src/base/apps/cam2map/main.cpp b/isis/src/base/apps/cam2map/main.cpp index 46dc392d7b..43e1f5d649 100644 --- a/isis/src/base/apps/cam2map/main.cpp +++ b/isis/src/base/apps/cam2map/main.cpp @@ -44,7 +44,7 @@ void printMap() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); //Write map file out to the log @@ -57,7 +57,7 @@ void loadMapRes() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Set resolution @@ -105,7 +105,7 @@ void loadMapRange() { // Get map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Set ground range keywords that are found in mapfile @@ -149,7 +149,7 @@ void loadCameraRange() { // Get the map projection file provided by the user Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); // Open the input cube, get the camera object, and the cam map projection Cube c; diff --git a/isis/src/base/apps/camtrim/main.cpp b/isis/src/base/apps/camtrim/main.cpp index 95f7621999..6ced34aa62 100644 --- a/isis/src/base/apps/camtrim/main.cpp +++ b/isis/src/base/apps/camtrim/main.cpp @@ -52,7 +52,7 @@ void IsisMain() { // lat/lons the user wants if(ui.WasEntered("MAP")) { Pvl lab; - lab.read(ui.GetFileName("MAP")); + lab.read(ui.GetFileName("MAP").toStdString()); proj = (TProjection *) ProjectionFactory::Create(lab); // add mapping to print.prt diff --git a/isis/src/base/apps/cathist/main.cpp b/isis/src/base/apps/cathist/main.cpp index 4280d3ad27..03ba4af8af 100644 --- a/isis/src/base/apps/cathist/main.cpp +++ b/isis/src/base/apps/cathist/main.cpp @@ -37,10 +37,10 @@ void IsisMain() { } else if (ui.WasEntered("TO")) { if (append) { - pvl.append(tofile.expanded()); + pvl.append(tofile.expanded().toStdString()); } else { - pvl.write(tofile.expanded()); + pvl.write(tofile.expanded().toStdString()); } } else { @@ -60,7 +60,7 @@ void IsisMain() { } } for(int i = 0; i < pvl.objects(); ++i) { - QString all = pvl.object(i).name() + " "; + QString all = QString::fromStdString(pvl.object(i).name()) + " "; PvlGroup user = pvl.object(i).findGroup("UserParameters"); for(int j = 0; j < user.keywords(); ++j) { ostringstream os; diff --git a/isis/src/base/apps/catlab/main.cpp b/isis/src/base/apps/catlab/main.cpp index f48d3a0525..1a78ef13fb 100644 --- a/isis/src/base/apps/catlab/main.cpp +++ b/isis/src/base/apps/catlab/main.cpp @@ -17,15 +17,15 @@ void IsisMain() { QString file = ui.GetCubeName("FROM"); // Extract label from file - Pvl label(file); + Pvl label(file.toStdString()); // Output to file if entered if(ui.WasEntered("TO")) { if (ui.GetBoolean("APPEND")) { - label.append(FileName(ui.GetFileName("TO")).expanded()); + label.append(FileName(ui.GetFileName("TO")).expanded().toStdString()); } else { - label.write(FileName(ui.GetFileName("TO")).expanded()); + label.write(FileName(ui.GetFileName("TO")).expanded().toStdString()); } } diff --git a/isis/src/base/apps/catoriglab/main.cpp b/isis/src/base/apps/catoriglab/main.cpp index 6702a19274..b4ba454d45 100644 --- a/isis/src/base/apps/catoriglab/main.cpp +++ b/isis/src/base/apps/catoriglab/main.cpp @@ -22,7 +22,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); QString file = ui.GetCubeName("FROM"); - Pvl fromLabel(file); + Pvl fromLabel(file.toStdString()); if ( fromLabel.hasObject("OriginalLabel") ) { OriginalLabel origLab(file); Pvl pvl = origLab.ReturnLabels(); @@ -31,10 +31,10 @@ void IsisMain() { } else if (ui.WasEntered("TO")) { if (ui.GetBoolean("APPEND")) { - pvl.append(FileName(ui.GetFileName("TO")).expanded()); + pvl.append(FileName(ui.GetFileName("TO")).expanded().toStdString()); } else { - pvl.write(FileName(ui.GetFileName("TO")).expanded()); + pvl.write(FileName(ui.GetFileName("TO")).expanded().toStdString()); } } else { diff --git a/isis/src/base/apps/center/main.cpp b/isis/src/base/apps/center/main.cpp index 389c92cf3c..353d42b87b 100644 --- a/isis/src/base/apps/center/main.cpp +++ b/isis/src/base/apps/center/main.cpp @@ -52,10 +52,10 @@ void IsisMain() { if (sumall.ValidPixels() > 0) { csamp = sumX / sumall.Sum(); cline = sumY / sumall.Sum(); - results += PvlKeyword("CentroidLine", toString(cline)); - results += PvlKeyword("CentroidSample", toString(csamp)); - results += PvlKeyword("LineOffset", toString(lMiddle - cline)); - results += PvlKeyword("SampleOffset", toString(sMiddle - csamp)); + results += PvlKeyword("CentroidLine", std::to_string(cline)); + results += PvlKeyword("CentroidSample", std::to_string(csamp)); + results += PvlKeyword("LineOffset", std::to_string(lMiddle - cline)); + results += PvlKeyword("SampleOffset", std::to_string(sMiddle - csamp)); } else { PvlKeyword badl = PvlKeyword("CentroidLine", "Null"); diff --git a/isis/src/base/apps/copylabel/main.cpp b/isis/src/base/apps/copylabel/main.cpp index edaf5437f1..b22fe4f5a7 100644 --- a/isis/src/base/apps/copylabel/main.cpp +++ b/isis/src/base/apps/copylabel/main.cpp @@ -31,7 +31,7 @@ void IsisMain() { Pvl * source = NULL; QString sourceFileName = ui.GetCubeName("Source"); mergeTo = inOut.label(); - source = new Pvl(sourceFileName); + source = new Pvl(sourceFileName.toStdString()); // We have 3 possible running options, those are // We received labels as SOURCE @@ -190,7 +190,7 @@ void IsisMain() { foreach (grp, list) { if (grp.size() != 0) { bool success = copyGroup(source, mergeTo, grp); - results += PvlKeyword(grp, success ? "true" : "false"); + results += PvlKeyword(grp.toStdString(), success ? "true" : "false"); } } } @@ -203,7 +203,7 @@ void IsisMain() { foreach (obj, list) { if (obj.size() != 0) { bool success = copyObject(source, mergeTo, obj); - results += PvlKeyword(obj, success ? "true" : "false"); + results += PvlKeyword(obj.toStdString(), success ? "true" : "false"); } } } @@ -224,10 +224,10 @@ void IsisMain() { } bool success = copyBlob(&sourceCube, &inOut, brk[1], brk[0], sourceFileName); - results += PvlKeyword(blob, success ? "true" : "false"); + results += PvlKeyword(blob.toStdString(), success ? "true" : "false"); } else { - results += PvlKeyword(blob, "false"); + results += PvlKeyword(blob.toStdString(), "false"); } } } @@ -257,10 +257,10 @@ void IsisMain() { bool copyGroup(Pvl * source, Pvl * mergeTo, QString name) { try { // The call we're looking to get an exception on is the one just below. - PvlGroup & toCopy = source->findGroup(name, Pvl::Traverse); + PvlGroup & toCopy = source->findGroup(name.toStdString(), Pvl::Traverse); PvlObject & isiscube = mergeTo->findObject("IsisCube"); - if (isiscube.hasGroup(name)) - isiscube.deleteGroup(name); + if (isiscube.hasGroup(name.toStdString())) + isiscube.deleteGroup(name.toStdString()); isiscube.addGroup(toCopy); return true; } @@ -277,9 +277,9 @@ bool copyObject(Pvl *source, Pvl *mergeTo, QString name) try { // The call we're looking to get an exception on is the one just below. - PvlObject &toCopy = source->findObject(name, Pvl::Traverse); - if (mergeTo->hasObject(name)) - mergeTo->deleteGroup(name); + PvlObject &toCopy = source->findObject(name.toStdString(), Pvl::Traverse); + if (mergeTo->hasObject(name.toStdString())) + mergeTo->deleteGroup(name.toStdString()); mergeTo->addObject(toCopy); return true; } @@ -291,7 +291,7 @@ bool copyObject(Pvl *source, Pvl *mergeTo, QString name) bool copyBlob(Cube * from, Cube * to, QString name, QString type, QString fname) { try { - Blob blob(name, type, fname); + Blob blob(name, type.toStdString(), fname); from->read(blob); to->write(blob); return true; diff --git a/isis/src/base/apps/cubeavg/main.cpp b/isis/src/base/apps/cubeavg/main.cpp index 709ec41a33..301df4d8cd 100644 --- a/isis/src/base/apps/cubeavg/main.cpp +++ b/isis/src/base/apps/cubeavg/main.cpp @@ -40,9 +40,9 @@ void IsisMain() { std::vector widths; widths.resize(icube->bandCount()); for(int i = 0; i < pvlCenter.size(); i++) { - centers[i] = toDouble(pvlCenter[i]); + centers[i] = std::stod(pvlCenter[i]); if(hasWidth) - widths[i] = toDouble((*pvlWidth)[i]); + widths[i] = std::stod((*pvlWidth)[i]); else widths[i] = 0.0; } @@ -73,22 +73,22 @@ void IsisMain() { PvlKeyword pvlCenter; if(pvlg.hasKeyword("Center")) { pvlCenter = pvlg.findKeyword("Center"); - Units = pvlCenter.unit(); + Units = QString::fromStdString(pvlCenter.unit()); pvlg.deleteKeyword("Center"); } pvlCenter = PvlKeyword("Center"); - pvlCenter.setValue(ui.GetAsString("CENTER"), Units); + pvlCenter.setValue(ui.GetAsString("CENTER").toStdString(), Units.toStdString()); pvlg.addKeyword(pvlCenter); PvlKeyword pvlWidth; if(pvlg.hasKeyword("Width")) { pvlWidth = pvlg.findKeyword("Width"); - Units = pvlWidth.unit(); + Units = QString::fromStdString(pvlWidth.unit()); pvlg.deleteKeyword("Width"); } pvlWidth = PvlKeyword("Width"); - pvlWidth.setValue(ui.GetAsString("WIDTH"), Units); + pvlWidth.setValue(ui.GetAsString("WIDTH").toStdString(), Units.toStdString()); pvlg.addKeyword(pvlWidth); //Destroys the old and adds the new BandBin Group if(ocube->hasGroup("BandBin")) { @@ -133,7 +133,7 @@ void compute(vector centers, vector widths, Cube *ocube) { PvlGroup &pvlg = ocube->group("BandBin"); PvlKeyword &pvlCenter = pvlg.findKeyword("Center"); - QString centerUnit = pvlCenter.unit(); + QString centerUnit = QString::fromStdString(pvlCenter.unit()); bool hasWidth = pvlg.hasKeyword("Width"); double large = centers[0] + widths[0] / 2; double small = centers[0] - widths[0] / 2; @@ -145,14 +145,14 @@ void compute(vector centers, vector widths, small = (double)centers[i] - (double)widths[i] / 2.0; } } - pvlCenter.setValue(std::to_string((large - small) / 2 + small), centerUnit); + pvlCenter.setValue(std::to_string((large - small) / 2 + small), centerUnit.toStdString()); if(hasWidth) { PvlKeyword &pvlWidth = pvlg.findKeyword("Width"); pvlWidth.setValue(std::to_string(large - small), pvlWidth.unit()); } else { PvlKeyword pvlWidth = PvlKeyword("Width"); - pvlWidth.setValue(std::to_string(large - small), centerUnit); + pvlWidth.setValue(std::to_string(large - small), centerUnit.toStdString()); pvlg.addKeyword(pvlWidth); } diff --git a/isis/src/base/apps/cubediff/main.cpp b/isis/src/base/apps/cubediff/main.cpp index c4da886ed4..ee0cef4b40 100644 --- a/isis/src/base/apps/cubediff/main.cpp +++ b/isis/src/base/apps/cubediff/main.cpp @@ -118,7 +118,7 @@ void IsisMain() { if(ui.WasEntered("TO")) { Pvl lab; lab.addGroup(results); - lab.write(ui.GetFileName("TO", "txt")); + lab.write(ui.GetFileName("TO", "txt").toStdString()); } if(doTable) { QString filename = FileName(ui.GetFileName("TO", "txt")).expanded(); @@ -278,7 +278,7 @@ void diffTable(std::ofstream &target, int precision) { for(unsigned int i = 0; i < samps.size(); i++) { Column currCol; //Prepare and add the first file's column - currCol.SetName(QString("File1_") + std::to_string(samps[i])); + currCol.SetName(QString::fromStdString("File1_" + std::to_string(samps[i]))); if((int)(colWidth + precision + 1) < (int)currCol.Name().length()) { currCol.SetWidth(currCol.Name().length() + 1); } @@ -290,7 +290,7 @@ void diffTable(std::ofstream &target, int precision) { cols.push_back(currCol); //Prepare and add the second file's column - currCol.SetName(QString("File2_") + std::to_string(samps[i])); + currCol.SetName(QString::fromStdString("File2_" + std::to_string(samps[i]))); cols.push_back(currCol); } diff --git a/isis/src/base/apps/cubefunc/main.cpp b/isis/src/base/apps/cubefunc/main.cpp index 4602f488e1..ca5d2cfd7b 100644 --- a/isis/src/base/apps/cubefunc/main.cpp +++ b/isis/src/base/apps/cubefunc/main.cpp @@ -74,7 +74,7 @@ void IsisMain() { if(bad != 0) { PvlGroup results("Results"); QString message = "Invalid input pixels converted to Isis NULL values"; - results += PvlKeyword("Error", message); + results += PvlKeyword("Error", message.toStdString()); results += PvlKeyword("Count", std::to_string(bad)); Application::Log(results); } diff --git a/isis/src/base/apps/cubenorm/main.cpp b/isis/src/base/apps/cubenorm/main.cpp index 635766ece5..2f9aa10749 100644 --- a/isis/src/base/apps/cubenorm/main.cpp +++ b/isis/src/base/apps/cubenorm/main.cpp @@ -240,7 +240,7 @@ void pvlOut(const QString &StatFile) { Pvl t; t.addGroup(results); - t.write(StatFile); + t.write(StatFile.toStdString()); } //******************************************************** @@ -298,27 +298,27 @@ void tableOut(const QString &StatFile) { //******************************************************* void PVLIn(const Isis::FileName &filename) { Pvl pvlFileIn; - pvlFileIn.read(filename.name()); + pvlFileIn.read(filename.name().toStdString()); PvlGroup results = pvlFileIn.findGroup("Results"); PvlObject::PvlKeywordIterator itr = results.begin(); while(itr != results.end()) { StaticStats newStat; - band.push_back(toInt((*itr)[0])); + band.push_back(std::stoi((*itr)[0])); itr++; - element.push_back(toInt((*itr)[0])); + element.push_back(std::stoi((*itr)[0])); itr++; - newStat.setValidPixels(toInt((*itr)[0])); + newStat.setValidPixels(std::stoi((*itr)[0])); itr++; - newStat.setMean(toDouble((*itr)[0])); + newStat.setMean(std::stod((*itr)[0])); itr++; - median.push_back(toDouble((*itr)[0])); + median.push_back(std::stod((*itr)[0])); itr++; - newStat.setStandardDeviation(toDouble((*itr)[0])); + newStat.setStandardDeviation(std::stod((*itr)[0])); itr++; - newStat.setMinimum(toDouble((*itr)[0])); + newStat.setMinimum(std::stod((*itr)[0])); itr++; - newStat.setMaximum(toDouble((*itr)[0])); + newStat.setMaximum(std::stod((*itr)[0])); itr++; st.push_back(newStat); diff --git a/isis/src/base/apps/desmile/main.cpp b/isis/src/base/apps/desmile/main.cpp index af295501cd..02bb863006 100644 --- a/isis/src/base/apps/desmile/main.cpp +++ b/isis/src/base/apps/desmile/main.cpp @@ -98,7 +98,7 @@ void IsisMain() { // Record apollofindrx history to the cube // create a History Blob with value found in the History PvlObject's Name keyword - QString histName = (QString)inCube->label()->findObject("History")["Name"]; + QString histName = QString::fromStdString(inCube->label()->findObject("History")["Name"]); // read cube's History PvlObject data into the History Object History histBlob = inCube->readHistory(histName); histBlob.AddEntry(); diff --git a/isis/src/base/apps/dsk2isis/main.cpp b/isis/src/base/apps/dsk2isis/main.cpp index e897fa8488..ba650d0c2c 100755 --- a/isis/src/base/apps/dsk2isis/main.cpp +++ b/isis/src/base/apps/dsk2isis/main.cpp @@ -45,7 +45,7 @@ void IsisMain() { //Get the map projection file provided by the user Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); // Create the ISIS map projection int ns, nl; diff --git a/isis/src/base/apps/editlab/main.cpp b/isis/src/base/apps/editlab/main.cpp index 68d4f9f595..7634c9fd8d 100644 --- a/isis/src/base/apps/editlab/main.cpp +++ b/isis/src/base/apps/editlab/main.cpp @@ -17,7 +17,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); // Extract label from file - Pvl *label = new Pvl(ui.GetFileName("FROM")); + Pvl *label = new Pvl(ui.GetFileName("FROM").toStdString()); PvlObject *pvl = label; QString option = ui.GetString("OPTION"); @@ -32,7 +32,7 @@ void IsisMain() { // Add Template File if(option == "ADDTEMP") { QString tempfile = ui.GetFileName("TEMPFILE"); - Pvl tempobj(tempfile); + Pvl tempobj(tempfile.toStdString()); for(int i = 0; i < tempobj.groups(); ++i) { pvl->addGroup(tempobj.group(i)); } @@ -43,35 +43,35 @@ void IsisMain() { // Add Group if(option == "ADDG") { - PvlGroup g(grpname); + PvlGroup g(grpname.toStdString()); if(ui.WasEntered("COMMENT")) - g.addComment(ui.GetString("COMMENT")); + g.addComment(ui.GetString("COMMENT").toStdString()); pvl->addGroup(g); } // Delete Group else if(option == "DELG") { - pvl->deleteGroup(grpname); + pvl->deleteGroup(grpname.toStdString()); } else { QString key = ui.GetString("KEYWORD"); - PvlGroup &grp = pvl->findGroup(grpname, PvlObject::Traverse); + PvlGroup &grp = pvl->findGroup(grpname.toStdString(), PvlObject::Traverse); // Add Keyword if(option == "ADDKEY") { - PvlKeyword keywrd(key); + PvlKeyword keywrd(key.toStdString()); grp.addKeyword(modifyKeyword(ui, keywrd)); } // Delete Keyword else if(option == "DELKEY") { - grp.deleteKeyword(key); + grp.deleteKeyword(key.toStdString()); } // Modify Keyword else if(option == "MODKEY") { - modifyKeyword(ui, grp.findKeyword(key)); + modifyKeyword(ui, grp.findKeyword(key.toStdString())); } // Set Keyword @@ -80,7 +80,7 @@ void IsisMain() { PvlKeyword *first = NULL; // Clean duplicate keywords of ONLY the provided keyword for(int i = 0; i < grp.keywords(); i++) { - if(grp[i].isNamed(key)) { + if(grp[i].isNamed(key.toStdString())) { if(not first) first = &grp[i]; else @@ -90,7 +90,7 @@ void IsisMain() { modifyKeyword(ui, *first); } else { - PvlKeyword keywrd(key); + PvlKeyword keywrd(key.toStdString()); grp.addKeyword(modifyKeyword(ui, keywrd)); } } @@ -110,7 +110,7 @@ void IsisMain() { cube = NULL; } else { - label->write(ui.GetFileName("FROM")); + label->write(ui.GetFileName("FROM").toStdString()); } delete label; @@ -128,10 +128,10 @@ void IsisMain() { */ PvlKeyword &modifyKeyword(UserInterface &ui, PvlKeyword &keyword) { if(ui.WasEntered("UNITS")) - keyword.setValue(ui.GetString("VALUE"), ui.GetString("UNITS")); + keyword.setValue(ui.GetString("VALUE").toStdString(), ui.GetString("UNITS").toStdString()); else - keyword.setValue(ui.GetString("VALUE")); + keyword.setValue(ui.GetString("VALUE").toStdString()); if(ui.WasEntered("COMMENT")) - keyword.addComment(ui.GetString("COMMENT")); + keyword.addComment(ui.GetString("COMMENT").toStdString()); return keyword; } diff --git a/isis/src/base/apps/errors/main.cpp b/isis/src/base/apps/errors/main.cpp index 90c451f754..7dbcdee4a2 100644 --- a/isis/src/base/apps/errors/main.cpp +++ b/isis/src/base/apps/errors/main.cpp @@ -9,7 +9,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); bool append = ui.GetBoolean("APPEND"); - Pvl input(ui.GetFileName("FROM")); + Pvl input(ui.GetFileName("FROM").toStdString()); Pvl output; // Check to see if output file exists @@ -29,14 +29,14 @@ void IsisMain() { numErrors++; } } - PvlKeyword errors("TotalErrors", toString(numErrors)); + PvlKeyword errors("TotalErrors", std::to_string(numErrors)); output.addKeyword(errors); // write output to file if(!append) { - output.write(outFile.expanded()); + output.write(outFile.expanded().toStdString()); } else { - output.append(outFile.expanded()); + output.append(outFile.expanded().toStdString()); } cout << errors << endl; } diff --git a/isis/src/base/apps/findrx/main.cpp b/isis/src/base/apps/findrx/main.cpp index 4b62cb1cf6..8d9db0a77a 100644 --- a/isis/src/base/apps/findrx/main.cpp +++ b/isis/src/base/apps/findrx/main.cpp @@ -24,7 +24,7 @@ void IsisMain() { Pvl *regdef; // If regdef was supplied by the user, use it. else, use the template. if (ui.WasEntered("REGDEF")) { - regdef = new Pvl(ui.GetFileName("REGDEF")); + regdef = new Pvl(ui.GetFileName("REGDEF").toStdString()); } else { regdef = new Pvl("$ISISROOT/appdata/templates/autoreg/findrx.def"); @@ -34,28 +34,28 @@ void IsisMain() { // If the Keyword sizes don't match up, throw errors. int nres = reseaus["Line"].size(); if (nres != reseaus["Sample"].size()) { - QString msg = "Sample size incorrect [Sample size " + - toString(reseaus["Sample"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + std::string msg = "Sample size incorrect [Sample size " + + std::to_string(reseaus["Sample"].size()) + " != " + " Line size " + + std::to_string(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (nres != reseaus["Type"].size()) { - QString msg = "Type size incorrect [Type size " + - toString(reseaus["Type"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + std::string msg = "Type size incorrect [Type size " + + std::to_string(reseaus["Type"].size()) + " != " + " Line size " + + std::to_string(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (nres != reseaus["Valid"].size()) { - QString msg = "Valid size incorrect [Valid size " + - toString(reseaus["Valid"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + std::string msg = "Valid size incorrect [Valid size " + + std::to_string(reseaus["Valid"].size()) + " != " + " Line size " + + std::to_string(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } // Auto Registration AutoReg *ar = AutoRegFactory::Create(*regdef); Cube pattern; - pattern.open(reseaus["Template"][0], "r"); + pattern.open(QString::fromStdString(reseaus["Template"][0]), "r"); ar->PatternChip()->TackCube(5.0, 5.0); // Display the progress...10% 20% etc. @@ -77,10 +77,10 @@ void IsisMain() { // And the loop... for (int res = 0; res < nres; ++res) { // Output chips - ar->SearchChip()->TackCube(toDouble(reseaus["Sample"][res]), toDouble(reseaus["Line"][res])); + ar->SearchChip()->TackCube(std::stod(reseaus["Sample"][res]), std::stod(reseaus["Line"][res])); ar->SearchChip()->Load(*cube); ar->PatternChip()->Load(pattern, 0, 1.0, res + 1); - int type = toInt(reseaus["Type"][res]); + int type = std::stoi(reseaus["Type"][res]); // If the reseaus is in the center (type 5) use full percent value if (type == 5) { ar->SetPatternValidPercent(patternValidPercent); @@ -100,8 +100,8 @@ void IsisMain() { ar->Register(); if (ar->Success()) { - reseaus["Sample"][res] = toString(ar->CubeSample()); - reseaus["Line"][res] = toString(ar->CubeLine()); + reseaus["Sample"][res] = std::to_string(ar->CubeSample()); + reseaus["Line"][res] = std::to_string(ar->CubeLine()); reseaus["Valid"][res] = "1"; } else { @@ -110,8 +110,8 @@ void IsisMain() { // And if the reseaus are to be marked...mark em if (white != NULL) { - double line = toDouble(reseaus["Line"][res]); - double sample = toDouble(reseaus["Sample"][res]); + double line = std::stod(reseaus["Line"][res]); + double sample = std::stod(reseaus["Sample"][res]); white->SetBasePosition(int(sample), int(line), 1); cube->write(*white); } diff --git a/isis/src/base/apps/footprintmerge/main.cpp b/isis/src/base/apps/footprintmerge/main.cpp index 7a395d71ca..8db6ef5624 100644 --- a/isis/src/base/apps/footprintmerge/main.cpp +++ b/isis/src/base/apps/footprintmerge/main.cpp @@ -129,7 +129,7 @@ void IsisMain() { // Brief if(mode == "BRIEF") { PvlGroup results("Results"); - results += PvlKeyword("NumberOfIslands", toString((int)islandPolys.size())); + results += PvlKeyword("NumberOfIslands", std::to_string((int)islandPolys.size())); Application::Log(results); } else if(mode == "FULL") { @@ -138,11 +138,11 @@ void IsisMain() { for(unsigned int p = 0; p < islandPolys.size(); p++) { int numFiles = islands[p].size(); QString isle = "FootprintIsland_" + toString((int)p + 1); - PvlGroup island(isle); - island += PvlKeyword("NumberFiles", toString(numFiles)); + PvlGroup island(isle.toStdString()); + island += PvlKeyword("NumberFiles", std::to_string(numFiles)); PvlKeyword files("Files"); for(int f = 0; f < numFiles; f++) { - files.addValue(islands[p][f]); + files.addValue(islands[p][f].toStdString()); } island.addKeyword(files); results.addGroup(island); @@ -150,10 +150,10 @@ void IsisMain() { Pvl temp; temp.addObject(results); if(FileName(out).fileExists()) { - temp.append(out); + temp.append(out.toStdString()); } else { - temp.write(out); + temp.write(out.toStdString()); } } diff --git a/isis/src/base/apps/getkey/main.cpp b/isis/src/base/apps/getkey/main.cpp index 2a793c98f3..257a994337 100644 --- a/isis/src/base/apps/getkey/main.cpp +++ b/isis/src/base/apps/getkey/main.cpp @@ -35,7 +35,7 @@ void IsisMain() { // Open the file ... it must be a label-type file Pvl lab; - lab.read(labelFile); + lab.read(labelFile.toStdString()); bool recursive = ui.GetBoolean("RECURSIVE"); // Set up the requested object @@ -45,17 +45,17 @@ void IsisMain() { // Get the keyword from the entered group if(ui.WasEntered("GRPNAME")) { - PvlObject object = lab.findObject(obj, Pvl::Traverse); + PvlObject object = lab.findObject(obj.toStdString(), Pvl::Traverse); QString grp = ui.GetString("GRPNAME"); - key = object.findGroup(grp, Pvl::Traverse)[ui.GetString("KEYWORD")]; + key = object.findGroup(grp.toStdString(), Pvl::Traverse)[ui.GetString("KEYWORD").toStdString()]; } // Find the keyword in the object else { if(recursive) { - key = lab.findObject(obj, Pvl::Traverse).findKeyword(ui.GetString("KEYWORD"), Pvl::Traverse); + key = lab.findObject(obj.toStdString(), Pvl::Traverse).findKeyword(ui.GetString("KEYWORD").toStdString(), Pvl::Traverse); } else { - key = lab.findObject(obj, Pvl::Traverse)[ui.GetString("KEYWORD")]; + key = lab.findObject(obj.toStdString(), Pvl::Traverse)[ui.GetString("KEYWORD").toStdString()]; } } } @@ -63,16 +63,16 @@ void IsisMain() { // Set up the requested group else if(ui.WasEntered("GRPNAME")) { QString grp = ui.GetString("GRPNAME"); - key = lab.findGroup(grp, Pvl::Traverse)[ui.GetString("KEYWORD")]; + key = lab.findGroup(grp.toStdString(), Pvl::Traverse)[ui.GetString("KEYWORD").toStdString()]; } // Find the keyword in the label, outside of any object or group else { if(recursive) { - key = lab.findKeyword(ui.GetString("KEYWORD"), Pvl::Traverse); + key = lab.findKeyword(ui.GetString("KEYWORD").toStdString(), Pvl::Traverse); } else { - key = lab[ui.GetString("KEYWORD")]; + key = lab[ui.GetString("KEYWORD").toStdString()]; } } @@ -87,7 +87,7 @@ void IsisMain() { throw IException(IException::User, msg, _FILEINFO_); } // Get the keyword value - else value = key[i-1]; + else value = QString::fromStdString(key[i-1]); } else { @@ -96,7 +96,7 @@ void IsisMain() { QStringList values; for (int i = 0; i < key.size(); i++) { - QString thisValue = key[i]; + QString thisValue = QString::fromStdString(key[i]); if (thisValue.contains (" ")) thisValue = "\"" + thisValue + "\""; @@ -107,15 +107,15 @@ void IsisMain() { value = values.join( ", "); } // Just get the keyword value since it isnt a list - else value = (QString)key; + else value = QString::fromStdString(key); } if(ui.GetBoolean("UPPER")) value = value.toUpper(); // Construct a label with the results PvlGroup results("Results"); - results += PvlKeyword("From", labelFile); - results += PvlKeyword(ui.GetString("KEYWORD"), value); + results += PvlKeyword("From", labelFile.toStdString()); + results += PvlKeyword(ui.GetString("KEYWORD").toStdString(), value.toStdString()); if(ui.IsInteractive()) { Application::GuiLog(results); } @@ -131,7 +131,7 @@ void helperButtonLog() { UserInterface &ui = Application::GetUserInterface(); QString file(ui.GetCubeName("FROM")); Pvl p; - p.read(file); + p.read(file.toStdString()); Application::GuiLog(p); } //...........end of helper function LogMap ........ diff --git a/isis/src/base/apps/interestcube/main.cpp b/isis/src/base/apps/interestcube/main.cpp index 166afca4de..4498e317ad 100644 --- a/isis/src/base/apps/interestcube/main.cpp +++ b/isis/src/base/apps/interestcube/main.cpp @@ -35,7 +35,7 @@ void IsisMain() { // Basic settings p.SetInputCube("FROM"); p.SetOutputCube("TO"); - Pvl pvl = Pvl(ui.GetFileName("PVL")); + Pvl pvl = Pvl(ui.GetFileName("PVL").toStdString()); cube.open(ui.GetCubeName("FROM")); @@ -53,7 +53,7 @@ void IsisMain() { } catch(IException &e) { cube.close(); - QString msg = "Improper format for InterestOperator PVL [" + pvl.fileName() + "]"; + std::string msg = "Improper format for InterestOperator PVL [" + pvl.fileName() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/isis2fits/main.cpp b/isis/src/base/apps/isis2fits/main.cpp index 9377f3e8f2..9d0c5db0c8 100644 --- a/isis/src/base/apps/isis2fits/main.cpp +++ b/isis/src/base/apps/isis2fits/main.cpp @@ -57,8 +57,8 @@ void IsisMain() { // determine core base and multiplier, set up the stretch PvlGroup pix = icube->label()->findObject("IsisCube").findObject("Core").findGroup("Pixels"); - double scale = toDouble(pix["Multiplier"][0]); - double base = toDouble(pix["Base"][0]); + double scale = std::stod(pix["Multiplier"][0]); + double base = std::stod(pix["Base"][0]); if (ui.GetString("STRETCH") != "NONE" && bitpix != "-32") { if (ui.GetString("STRETCH") == "LINEAR") { @@ -123,7 +123,7 @@ void IsisMain() { if (icube->hasGroup("mapping")) { map = icube->group("mapping"); - msg = (QString)map["targetname"]; + msg = QString::fromStdString(map["targetname"]); } // If we have sky we want it if (msg == "Sky") { @@ -243,11 +243,11 @@ QString FitsKeyword(QString key, bool isValue, QString value, QString unit) { QString WritePvl(QString fitsKey, QString group, QString key, Cube *icube, bool isString) { if (icube->hasGroup(group)) { PvlGroup theGroup = icube->group(group); - QString name = (QString)theGroup[key]; + QString name = QString::fromStdString(theGroup[key.toStdString()]); if (isString) { name = "'" + name + "'"; } - QString unit = theGroup[key].unit(); + QString unit = QString::fromStdString(theGroup[key.toStdString()].unit()); return FitsKeyword(fitsKey, true, name, unit); } return NULL; diff --git a/isis/src/base/apps/isis2raw/main.cpp b/isis/src/base/apps/isis2raw/main.cpp index 06ac54df0e..113e6f7bd3 100644 --- a/isis/src/base/apps/isis2raw/main.cpp +++ b/isis/src/base/apps/isis2raw/main.cpp @@ -105,13 +105,13 @@ void IsisMain() { // Records what output values were used, then sends it to the print.prt file // as well as the terminal. PvlGroup results("DNs Used"); - results += PvlKeyword("Null", toString(p.OutputNull())); - results += PvlKeyword("LRS", toString(p.OutputLrs())); - results += PvlKeyword("LIS", toString(p.OutputLis())); - results += PvlKeyword("HIS", toString(p.OutputHis())); - results += PvlKeyword("HRS", toString(p.OutputHrs())); - results += PvlKeyword("ValidMin", toString(min)); - results += PvlKeyword("ValidMax", toString(max)); + results += PvlKeyword("Null", std::to_string(p.OutputNull())); + results += PvlKeyword("LRS", std::to_string(p.OutputLrs())); + results += PvlKeyword("LIS", std::to_string(p.OutputLis())); + results += PvlKeyword("HIS", std::to_string(p.OutputHis())); + results += PvlKeyword("HRS", std::to_string(p.OutputHrs())); + results += PvlKeyword("ValidMin", std::to_string(min)); + results += PvlKeyword("ValidMax", std::to_string(max)); Application::Log(results); return; diff --git a/isis/src/base/apps/kernfilter/main.cpp b/isis/src/base/apps/kernfilter/main.cpp index f76e19ddfc..44b1020bfa 100644 --- a/isis/src/base/apps/kernfilter/main.cpp +++ b/isis/src/base/apps/kernfilter/main.cpp @@ -20,7 +20,7 @@ void IsisMain() { // Get information from the input kernel UserInterface &ui = Application::GetUserInterface(); - Pvl pvl(ui.GetFileName("KERNEL")); + Pvl pvl(ui.GetFileName("KERNEL").toStdString()); // Access the Kernel group section of the input file const PvlGroup &kern = pvl.findGroup("KERNEL"); @@ -56,7 +56,7 @@ void IsisMain() { // Iterate through the input kernel's data values to fill the coefs array for(int i = 0 ; i < kern["data"].size() ; i ++) { - coefs.push_back(toDouble(kern["data"][i])); + coefs.push_back(std::stod(kern["data"][i])); } // Weight for multiplication of resultant immidately before completion diff --git a/isis/src/base/apps/lineeq/main.cpp b/isis/src/base/apps/lineeq/main.cpp index bf0e8b8e83..4c6c3e428c 100644 --- a/isis/src/base/apps/lineeq/main.cpp +++ b/isis/src/base/apps/lineeq/main.cpp @@ -45,14 +45,14 @@ void IsisMain() { } PvlGroup data("lineeq"); - data += PvlKeyword("BoxcarSize", toString(boxcarSize), "lines"); - data += PvlKeyword("OutputCsv", toString((int)ui.GetBoolean("AVERAGES"))); + data += PvlKeyword("BoxcarSize", std::to_string(boxcarSize), "lines"); + data += PvlKeyword("OutputCsv", std::to_string((int)ui.GetBoolean("AVERAGES"))); TextFile *csvOutput = NULL; if(ui.GetBoolean("AVERAGES")) { csvOutput = new TextFile(ui.GetFileName("CSV"), "overwrite", ""); csvOutput->PutLine("Average,SmoothedAvg"); - data += PvlKeyword("CsvFile", ui.GetFileName("CSV")); + data += PvlKeyword("CsvFile", ui.GetFileName("CSV").toStdString()); } Application::Log(data); diff --git a/isis/src/base/apps/makeflat/main.cpp b/isis/src/base/apps/makeflat/main.cpp index 7d074ea2b6..2cef581129 100644 --- a/isis/src/base/apps/makeflat/main.cpp +++ b/isis/src/base/apps/makeflat/main.cpp @@ -374,7 +374,7 @@ void IsisMain() { ocube = new Cube(); ocube->setDimensions(numOutputSamples, tempFileLength, 2); PvlGroup &prefs = Preference::Preferences().findGroup("DataDirectory", Pvl::Traverse); - QString outTmpName = (QString)prefs["Temporary"][0] + "/"; + QString outTmpName = QString::fromStdString(prefs["Temporary"][0]) + "/"; outTmpName += FileName(ui.GetCubeName("TO")).baseName() + ".tmp.cub"; ocube->create(outTmpName); oLineMgr = new LineManager(*ocube); @@ -395,14 +395,14 @@ void IsisMain() { } PvlObject currFile("Exclusions"); - currFile += PvlKeyword("FileName", inList[currImage].toString()); - currFile += PvlKeyword("Tolerance", toString(maxStdev)); + currFile += PvlKeyword("FileName", inList[currImage].toString().toStdString()); + currFile += PvlKeyword("Tolerance", std::to_string(maxStdev)); if(cameraType == LineScan) { - currFile += PvlKeyword("FrameLines", toString(numFrameLines)); + currFile += PvlKeyword("FrameLines", std::to_string(numFrameLines)); } else if(cameraType == PushFrame) { - currFile += PvlKeyword("FrameletLines", toString(numFrameLines)); + currFile += PvlKeyword("FrameletLines", std::to_string(numFrameLines)); } excludedDetails.push_back(currFile); @@ -496,7 +496,7 @@ void IsisMain() { PvlGroup excludedFiles("ExcludedFiles"); for(currImage = 0; currImage < inList.size(); currImage++) { if(Excluded(currImage)) { - excludedFiles += PvlKeyword("File", inList[currImage].original()); + excludedFiles += PvlKeyword("File", inList[currImage].original().toStdString()); } } @@ -513,7 +513,7 @@ void IsisMain() { excludeFile.addObject(excludedDetails[i]); } - excludeFile.write(FileName(ui.GetFileName("EXCLUDE")).expanded()); + excludeFile.write(FileName(ui.GetFileName("EXCLUDE")).expanded().toStdString()); } remove(outTmpName.toLatin1().data()); @@ -663,11 +663,11 @@ void CreateTemporaryData(Buffer &in) { // Record the exclusion PvlGroup currExclusion("ExcludedLines"); - currExclusion += PvlKeyword("FrameStartLine", toString(in.Line())); - currExclusion += PvlKeyword("ValidPixels", toString(inputFrameStats.ValidPixels())); + currExclusion += PvlKeyword("FrameStartLine", std::to_string(in.Line())); + currExclusion += PvlKeyword("ValidPixels", std::to_string(inputFrameStats.ValidPixels())); if(!IsSpecial(inputFrameStats.StandardDeviation())) - currExclusion += PvlKeyword("StandardDeviation", toString(inputFrameStats.StandardDeviation())); + currExclusion += PvlKeyword("StandardDeviation", std::to_string(inputFrameStats.StandardDeviation())); else currExclusion += PvlKeyword("StandardDeviation", "N/A"); @@ -711,12 +711,12 @@ void CreateTemporaryData(Buffer &in) { if(excluded && ((in.Line() - 1) % numFrameLines == 0)) { PvlGroup currExclusion("ExcludedFramelet"); - currExclusion += PvlKeyword("FrameletStartLine", toString(in.Line())); - currExclusion += PvlKeyword("FrameletNumber", toString((in.Line() - 1) / numFrameLines)); + currExclusion += PvlKeyword("FrameletStartLine", std::to_string(in.Line())); + currExclusion += PvlKeyword("FrameletNumber", std::to_string((in.Line() - 1) / numFrameLines)); if(!IsSpecial(stdev)) { currExclusion += PvlKeyword("StandardDeviation", - toString(stdev)); + std::to_string(stdev)); } else { currExclusion += PvlKeyword("StandardDeviation", diff --git a/isis/src/base/apps/map2map/main.cpp b/isis/src/base/apps/map2map/main.cpp index 9ff25dc762..8fcef4c674 100644 --- a/isis/src/base/apps/map2map/main.cpp +++ b/isis/src/base/apps/map2map/main.cpp @@ -29,7 +29,7 @@ UserInterface &ui = Application::GetUserInterface(); // Get mapping group from map file Pvl userMap; -userMap.read(ui.GetFileName("MAP")); +userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); //Write map file out to the log @@ -43,7 +43,7 @@ UserInterface &ui = Application::GetUserInterface(); Pvl userMap; try { -userMap.read(ui.GetFileName("MAP")); +userMap.read(ui.GetFileName("MAP").toStdString()); } catch(IException &e) { } @@ -52,7 +52,7 @@ catch(IException &e) { Pvl fromMap; try { -fromMap.read(ui.GetCubeName("FROM")); +fromMap.read(ui.GetCubeName("FROM").toStdString()); } catch(IException &e) { } @@ -78,7 +78,7 @@ catch(IException &e) { // Longitude conversions first if(userMapping.hasKeyword("LongitudeDirection")) { -if(((QString)userMapping["LongitudeDirection"]).compare(fromMapping["LongitudeDirection"]) != 0) { +if((QString::fromStdString(userMapping["LongitudeDirection"])).compare(QString::fromStdString(fromMapping["LongitudeDirection"])) != 0) { double minLon = fromMapping["MinimumLongitude"]; double maxLon = fromMapping["MaximumLongitude"]; int domain = fromMapping["LongitudeDomain"]; @@ -87,36 +87,36 @@ if(((QString)userMapping["LongitudeDirection"]).compare(fromMapping["LongitudeDi domain = userMapping["LongitudeDomain"]; } - if((QString)userMapping["LongitudeDirection"] == "PositiveEast") { - fromMapping["MaximumLongitude"] = toString(TProjection::ToPositiveEast(minLon, domain)); - fromMapping["MinimumLongitude"] = toString(TProjection::ToPositiveEast(maxLon, domain)); + if(QString::fromStdString(userMapping["LongitudeDirection"]) == "PositiveEast") { + fromMapping["MaximumLongitude"] = std::to_string(TProjection::ToPositiveEast(minLon, domain)); + fromMapping["MinimumLongitude"] = std::to_string(TProjection::ToPositiveEast(maxLon, domain)); } - else if((QString)userMapping["LongitudeDirection"] == "PositiveWest") { - fromMapping["MaximumLongitude"] = toString(TProjection::ToPositiveWest(minLon, domain)); - fromMapping["MinimumLongitude"] = toString(TProjection::ToPositiveWest(maxLon, domain)); + else if(QString::fromStdString(userMapping["LongitudeDirection"]) == "PositiveWest") { + fromMapping["MaximumLongitude"] = std::to_string(TProjection::ToPositiveWest(minLon, domain)); + fromMapping["MinimumLongitude"] = std::to_string(TProjection::ToPositiveWest(maxLon, domain)); } } } // Latitude conversions now if(userMapping.hasKeyword("LatitudeType")) { // user set a new domain? -if(((QString)userMapping["LatitudeType"]).compare(fromMapping["LatitudeType"]) != 0) { // new lat type different? - if(((QString)userMapping["LatitudeType"]).compare("Planetographic") == 0) { - fromMapping["MinimumLatitude"] = toString(TProjection::ToPlanetographic( +if((QString::fromStdString(userMapping["LatitudeType"])).compare(QString::fromStdString(fromMapping["LatitudeType"])) != 0) { // new lat type different? + if((QString::fromStdString(userMapping["LatitudeType"])).compare("Planetographic") == 0) { + fromMapping["MinimumLatitude"] = std::to_string(TProjection::ToPlanetographic( (double)fromMapping["MinimumLatitude"], (double)fromMapping["EquatorialRadius"], (double)fromMapping["PolarRadius"])); - fromMapping["MaximumLatitude"] = toString(TProjection::ToPlanetographic( + fromMapping["MaximumLatitude"] = std::to_string(TProjection::ToPlanetographic( (double)fromMapping["MaximumLatitude"], (double)fromMapping["EquatorialRadius"], (double)fromMapping["PolarRadius"])); } else { - fromMapping["MinimumLatitude"] = toString(TProjection::ToPlanetocentric( + fromMapping["MinimumLatitude"] = std::to_string(TProjection::ToPlanetocentric( (double)fromMapping["MinimumLatitude"], (double)fromMapping["EquatorialRadius"], (double)fromMapping["PolarRadius"])); - fromMapping["MaximumLatitude"] = toString(TProjection::ToPlanetocentric( + fromMapping["MaximumLatitude"] = std::to_string(TProjection::ToPlanetocentric( (double)fromMapping["MaximumLatitude"], (double)fromMapping["EquatorialRadius"], (double)fromMapping["PolarRadius"])); diff --git a/isis/src/base/apps/mapgrid/main.cpp b/isis/src/base/apps/mapgrid/main.cpp index 196daf3e51..04110b9d59 100644 --- a/isis/src/base/apps/mapgrid/main.cpp +++ b/isis/src/base/apps/mapgrid/main.cpp @@ -33,7 +33,7 @@ void IsisMain() { // Get mapfile, add values for range and create projection QString mapFile = ui.GetFileName("MAPFILE"); - Pvl p(mapFile); + Pvl p(mapFile.toStdString()); PvlGroup &mapping = p.findGroup("Mapping", Pvl::Traverse); if(mapping.hasKeyword("MinimumLatitude")) { @@ -52,10 +52,10 @@ void IsisMain() { mapping.deleteKeyword("MaximumLongitude"); } - mapping += PvlKeyword("MinimumLatitude", toString(latStart)); - mapping += PvlKeyword("MaximumLatitude", toString(latEnd)); - mapping += PvlKeyword("MinimumLongitude", toString(lonStart)); - mapping += PvlKeyword("MaximumLongitude", toString(lonEnd)); + mapping += PvlKeyword("MinimumLatitude", std::to_string(latStart)); + mapping += PvlKeyword("MaximumLatitude", std::to_string(latEnd)); + mapping += PvlKeyword("MinimumLongitude", std::to_string(lonStart)); + mapping += PvlKeyword("MaximumLongitude", std::to_string(lonEnd)); TProjection *proj; try { diff --git a/isis/src/base/apps/maplab/main.cpp b/isis/src/base/apps/maplab/main.cpp index b786c93c57..c3d19d88ab 100644 --- a/isis/src/base/apps/maplab/main.cpp +++ b/isis/src/base/apps/maplab/main.cpp @@ -21,24 +21,24 @@ void IsisMain() { //Get the map projection file provided by the user Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &mapGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Error checking to ensure the map projection file provided contains // information pertaining to a target, body radius, and longitude direction if(!mapGrp.hasKeyword("TargetName")) { - QString msg = "The given MAP [" + userMap.name() + + std::string msg = "The given MAP [" + userMap.name() + "] does not have the TargetName keyword."; throw IException(IException::User, msg, _FILEINFO_); } else if(!mapGrp.hasKeyword("EquatorialRadius") || !mapGrp.hasKeyword("PolarRadius")) { - QString msg = "The given MAP [" + userMap.name() + + std::string msg = "The given MAP [" + userMap.name() + "] does not have the EquatorialRadius and PolarRadius keywords."; throw IException(IException::User, msg, _FILEINFO_); } else if(!mapGrp.hasKeyword("LongitudeDomain")) { - QString msg = "The given MAP [" + userMap.name() + + std::string msg = "The given MAP [" + userMap.name() + "] does not have the LongitudeDomain keyword."; throw IException(IException::User, msg, _FILEINFO_); } @@ -78,7 +78,7 @@ void IsisMain() { res = (2.0 * Isis::PI * localRadius) / (360.0 * scale); } else { - QString msg = "The given MAP[" + userMap.name() + + std::string msg = "The given MAP[" + userMap.name() + "] does not have the PixelResolution or Scale keywords."; throw IException(IException::User, msg, _FILEINFO_); } @@ -90,14 +90,14 @@ void IsisMain() { y = y + res * (line - 0.5); //add origen values to Mapping Group - mapGrp.addKeyword(PvlKeyword("UpperLeftCornerX", toString(x), "meters"), Pvl::Replace); - mapGrp.addKeyword(PvlKeyword("UpperLeftCornerY", toString(y), "meters"), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("UpperLeftCornerX", std::to_string(x), "meters"), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("UpperLeftCornerY", std::to_string(y), "meters"), Pvl::Replace); if(!mapGrp.hasKeyword("PixelResolution")) { - mapGrp.addKeyword(PvlKeyword("PixelResolution", toString(res), "meters")); + mapGrp.addKeyword(PvlKeyword("PixelResolution", std::to_string(res), "meters")); } if(!mapGrp.hasKeyword("Scale")) { - mapGrp.addKeyword(PvlKeyword("Scale", toString(scale), "pixels/degree")); + mapGrp.addKeyword(PvlKeyword("Scale", std::to_string(scale), "pixels/degree")); } diff --git a/isis/src/base/apps/mappt/main.cpp b/isis/src/base/apps/mappt/main.cpp index 5ac22865f8..4b42eec149 100644 --- a/isis/src/base/apps/mappt/main.cpp +++ b/isis/src/base/apps/mappt/main.cpp @@ -32,7 +32,7 @@ void PrintMap() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); //Write map file out to the log diff --git a/isis/src/base/apps/mapsize/main.cpp b/isis/src/base/apps/mapsize/main.cpp index c541deeeb1..36ae0376c9 100644 --- a/isis/src/base/apps/mapsize/main.cpp +++ b/isis/src/base/apps/mapsize/main.cpp @@ -12,7 +12,7 @@ void IsisMain() { // Get the output map projection file and create an output projection object UserInterface &ui = Application::GetUserInterface(); Pvl lab; - lab.read(ui.GetFileName("MAP")); + lab.read(ui.GetFileName("MAP").toStdString()); int samples, lines; Projection *outmap = ProjectionFactory::CreateForCube(lab, samples, lines); @@ -44,15 +44,15 @@ void IsisMain() { // Create a label and log it PvlGroup results("Results"); - results += PvlKeyword("Map", ui.GetFileName("MAP")); - results += PvlKeyword("Scale", toString(scale)); - results += PvlKeyword("Width", toString(width), "inches"); - results += PvlKeyword("Height", toString(height), "inches"); - results += PvlKeyword("Samples", toString(samples)); - results += PvlKeyword("Lines", toString(lines)); - results += PvlKeyword("RealSize", toString(((Isis::BigInt)lines * samples * 4) / 1024.0), "KB"); - results += PvlKeyword("SignedWordSize", toString(((Isis::BigInt)lines * samples * 2) / 1024.0), "KB"); - results += PvlKeyword("UnsignedByteSize", toString(((Isis::BigInt)lines * samples) / 1024.0), "KB"); + results += PvlKeyword("Map", ui.GetFileName("MAP").toStdString()); + results += PvlKeyword("Scale", std::to_string(scale)); + results += PvlKeyword("Width", std::to_string(width), "inches"); + results += PvlKeyword("Height", std::to_string(height), "inches"); + results += PvlKeyword("Samples", std::to_string(samples)); + results += PvlKeyword("Lines", std::to_string(lines)); + results += PvlKeyword("RealSize", std::to_string(((Isis::BigInt)lines * samples * 4) / 1024.0), "KB"); + results += PvlKeyword("SignedWordSize", std::to_string(((Isis::BigInt)lines * samples * 2) / 1024.0), "KB"); + results += PvlKeyword("UnsignedByteSize", std::to_string(((Isis::BigInt)lines * samples) / 1024.0), "KB"); Application::Log(results); // Write the output file if requested @@ -60,7 +60,7 @@ void IsisMain() { Pvl temp; temp.addGroup(results); temp.addGroup(lab.findGroup("Mapping", Pvl::Traverse)); - temp.write(ui.GetFileName("TO", "txt")); + temp.write(ui.GetFileName("TO", "txt").toStdString()); } Application::Log(lab.findGroup("Mapping", Pvl::Traverse)); diff --git a/isis/src/base/apps/mask/main.cpp b/isis/src/base/apps/mask/main.cpp index bd5043eb2d..f614ee0f55 100644 --- a/isis/src/base/apps/mask/main.cpp +++ b/isis/src/base/apps/mask/main.cpp @@ -74,10 +74,10 @@ void IsisMain() { PvlGroup results("Results"); if(g_masked == true) { - results += PvlKeyword("PixelsMasked", toString(g_pixelsMasked)); + results += PvlKeyword("PixelsMasked", std::to_string(g_pixelsMasked)); } else { - PvlKeyword pm("PixelsMasked", toString(g_pixelsMasked)); + PvlKeyword pm("PixelsMasked", std::to_string(g_pixelsMasked)); pm.addComment( "No pixels were masked for this image"); results += pm; } diff --git a/isis/src/base/apps/nocam2map/main.cpp b/isis/src/base/apps/nocam2map/main.cpp index 101ce05064..a975a6b05b 100644 --- a/isis/src/base/apps/nocam2map/main.cpp +++ b/isis/src/base/apps/nocam2map/main.cpp @@ -108,7 +108,7 @@ void PrintMap() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); //Write map file out to the log @@ -121,7 +121,7 @@ void LoadMapRes() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Set resolution @@ -151,7 +151,7 @@ void ComputeInputRange() { UserInterface &ui = Application::GetUserInterface(); Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); Statistics *latStats = latCub->statistics(); @@ -167,7 +167,7 @@ void ComputeInputRange() { TProjection::To180Domain(lonStats->Maximum()); if (userGrp.hasKeyword("LatitudeType")) { - bool isOcentric = ((QString)userGrp.findKeyword("LatitudeType")) == "Planetocentric"; + bool isOcentric = ((std::string)userGrp.findKeyword("LatitudeType")) == "Planetocentric"; double equRadius; double polRadius; @@ -188,8 +188,8 @@ void ComputeInputRange() { //Else read the target name from the input cube else { Pvl fromFile; - fromFile.read(ui.GetCubeName("FROM")); - target = (QString)fromFile.findKeyword("TargetName", Pvl::Traverse); + fromFile.read(ui.GetCubeName("FROM").toStdString()); + target = QString::fromStdString(fromFile.findKeyword("TargetName", Pvl::Traverse)); } PvlGroup radii = Target::radiiGroup(target); @@ -212,7 +212,7 @@ void ComputeInputRange() { } if (userGrp.hasKeyword("LongitudeDirection")) { - bool isPosEast = ((QString)userGrp.findKeyword("LongitudeDirection")) == "PositiveEast"; + bool isPosEast = ((std::string)userGrp.findKeyword("LongitudeDirection")) == "PositiveEast"; if (isPosEast) { if (ui.GetString("LONDIR") != "POSITIVEEAST") { @@ -263,7 +263,7 @@ void LoadMapRange() { // Get map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Set ground range keywords that are found in mapfile diff --git a/isis/src/base/apps/noisefilter/main.cpp b/isis/src/base/apps/noisefilter/main.cpp index bd722e41d4..2d04d82ad0 100644 --- a/isis/src/base/apps/noisefilter/main.cpp +++ b/isis/src/base/apps/noisefilter/main.cpp @@ -63,15 +63,15 @@ void IsisMain() { // Generate a results group and log it PvlGroup results("Results"); - results += PvlKeyword("DarkPixelsReplaced", toString(darkPixelsReplaced)); - results += PvlKeyword("BrightPixelsReplaced", toString(brightPixelsReplaced)); - results += PvlKeyword("SpecialPixelsReplaced", toString(specialPixelsReplaced)); + results += PvlKeyword("DarkPixelsReplaced", std::to_string(darkPixelsReplaced)); + results += PvlKeyword("BrightPixelsReplaced", std::to_string(brightPixelsReplaced)); + results += PvlKeyword("SpecialPixelsReplaced", std::to_string(specialPixelsReplaced)); int pixelsReplaced = darkPixelsReplaced + brightPixelsReplaced + specialPixelsReplaced; - results += PvlKeyword("TotalPixelsReplaced", toString(pixelsReplaced)); + results += PvlKeyword("TotalPixelsReplaced", std::to_string(pixelsReplaced)); double pct = ((double)pixelsReplaced / ((double)icube->sampleCount() * (double)icube->lineCount())) * 100.; pct = (int)(pct * 10.0) / 10.0; - results += PvlKeyword("PercentChanged", toString(pct)); + results += PvlKeyword("PercentChanged", std::to_string(pct)); Application::Log(results); p.EndProcess(); } diff --git a/isis/src/base/apps/pad/main.cpp b/isis/src/base/apps/pad/main.cpp index 3ffd41eea6..f2e013f731 100644 --- a/isis/src/base/apps/pad/main.cpp +++ b/isis/src/base/apps/pad/main.cpp @@ -49,14 +49,14 @@ void IsisMain() { // Construct a label with the results PvlGroup results("Results"); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("LeftPad", toString(leftPad)); - results += PvlKeyword("RightPad", toString(rightPad)); - results += PvlKeyword("TopPad", toString(topPad)); - results += PvlKeyword("BottomPad", toString(bottomPad)); - results += PvlKeyword("OutputLines", toString(nl)); - results += PvlKeyword("OutputSamples", toString(ns)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("LeftPad", std::to_string(leftPad)); + results += PvlKeyword("RightPad", std::to_string(rightPad)); + results += PvlKeyword("TopPad", std::to_string(topPad)); + results += PvlKeyword("BottomPad", std::to_string(bottomPad)); + results += PvlKeyword("OutputLines", std::to_string(nl)); + results += PvlKeyword("OutputSamples", std::to_string(ns)); // Update the Mapping, Instrument, and AlphaCube groups in the // output cube label diff --git a/isis/src/base/apps/percent/main.cpp b/isis/src/base/apps/percent/main.cpp index 378c2713b4..96f36d8265 100644 --- a/isis/src/base/apps/percent/main.cpp +++ b/isis/src/base/apps/percent/main.cpp @@ -34,8 +34,8 @@ void IsisMain() { // Obtain the Histogram and the value at the percentage Histogram *hist = icube->histogram(); double value = hist->Percent(percentage); - kwPercent += toString(percentage); - kwValue += toString(value); + kwPercent += std::to_string(percentage); + kwValue += std::to_string(value); } results += kwPercent; results += kwValue; @@ -46,6 +46,6 @@ void IsisMain() { if(ui.WasEntered("TO")) { Pvl temp; temp.addGroup(results); - temp.write(ui.GetFileName("TO", "txt")); + temp.write(ui.GetFileName("TO", "txt").toStdString()); } } diff --git a/isis/src/base/apps/phoempglobal/main.cpp b/isis/src/base/apps/phoempglobal/main.cpp index 5db5486337..9a518d691b 100644 --- a/isis/src/base/apps/phoempglobal/main.cpp +++ b/isis/src/base/apps/phoempglobal/main.cpp @@ -117,7 +117,7 @@ void IsisMain() { empPvl.addObject(PvlObject("PhotometricModel")); empPvl.findObject("PhotometricModel").addGroup(PvlGroup("Algorithm")); empPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("PhtName", sEmpirical), Pvl::Replace); + addKeyword(PvlKeyword("PhtName", sEmpirical.toStdString()), Pvl::Replace); PhotoModel *empModel = PhotoModelFactory::Create(empPvl); // Order of approximation in atmospheric scatter model @@ -276,12 +276,12 @@ void IsisMain() { if (ui.WasEntered("NOTE")) { PvlGroup note("Note"); note.addComment("NOTE DESCRIBING THE FOLLOWING PHOTOMETRIC MODEL"); - note += PvlKeyword("NOTE", ui.GetString("NOTE")); + note += PvlKeyword("NOTE", ui.GetString("NOTE").toStdString()); photoObj += note; } photoObj += photoGrp; mainPvl.addObject(photoObj); - mainPvl.write(sOutfile); + mainPvl.write(sOutfile.toStdString()); } for (int r=0; r photom = unique_ptr (new Hillier(par, *icube)); pho = photom.get(); diff --git a/isis/src/base/apps/photemplate/main.cpp b/isis/src/base/apps/photemplate/main.cpp index ea61fd4c60..cff704b62b 100644 --- a/isis/src/base/apps/photemplate/main.cpp +++ b/isis/src/base/apps/photemplate/main.cpp @@ -255,9 +255,9 @@ void LoadPvl() { PvlObject::PvlGroupIterator atmGrp = atmObj.beginGroup(); bool wasFound = false; if (atmGrp->hasKeyword("ATMNAME")) { - atmVal = (QString)atmGrp->findKeyword("ATMNAME"); + atmVal = QString::fromStdString(atmGrp->findKeyword("ATMNAME")); } else if (atmGrp->hasKeyword("NAME")) { - atmVal = (QString)atmGrp->findKeyword("NAME"); + atmVal = QString::fromStdString(atmGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid atmospheric model so you must specify one "; message += "- the [Atmname] keyword is missing in your [Algorithm] group"; @@ -271,9 +271,9 @@ void LoadPvl() { while (atmGrp != atmObj.endGroup()) { if (atmGrp->hasKeyword("ATMNAME") || atmGrp->hasKeyword("NAME")) { if (atmGrp->hasKeyword("ATMNAME")) { - atmVal = (QString)atmGrp->findKeyword("ATMNAME"); + atmVal = QString::fromStdString(atmGrp->findKeyword("ATMNAME")); } else if (atmGrp->hasKeyword("NAME")) { - atmVal = (QString)atmGrp->findKeyword("NAME"); + atmVal = QString::fromStdString(atmGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid atmospheric model so you must specify one "; message += "- the [Atmname] keyword is missing in your [Algorithm] group"; @@ -324,7 +324,7 @@ void LoadPvl() { ui.PutAsString("WHA", os.str().c_str()); } if (atmGrp->hasKeyword("NULNEG")) { - QString nulneg = (QString)atmGrp->findKeyword("NULNEG"); + QString nulneg = QString::fromStdString(atmGrp->findKeyword("NULNEG")); if (nulneg.compare("YES")) { ui.PutString("NULNEG", "YES"); } else if (nulneg.compare("NO")) { @@ -380,7 +380,7 @@ void IsisMain() { if (ui.WasEntered("FROMPVL")) { QString input = ui.GetFileName("FROMPVL"); - p.read(input); + p.read(input.toStdString()); } //Check to make sure that a model was specified @@ -416,9 +416,9 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { if (pvlObj.hasGroup("Algorithm")) { PvlObject::PvlGroupIterator pvlGrp = pvlObj.beginGroup(); if (pvlGrp->hasKeyword("PHTNAME")) { - phtVal = (QString)pvlGrp->findKeyword("PHTNAME"); + phtVal = QString::fromStdString(pvlGrp->findKeyword("PHTNAME")); } else if (pvlGrp->hasKeyword("NAME")) { - phtVal = (QString)pvlGrp->findKeyword("NAME"); + phtVal = QString::fromStdString(pvlGrp->findKeyword("NAME")); } else { phtVal = "NONE"; } diff --git a/isis/src/base/apps/photomet/main.cpp b/isis/src/base/apps/photomet/main.cpp index faa889473d..82c5fe1224 100644 --- a/isis/src/base/apps/photomet/main.cpp +++ b/isis/src/base/apps/photomet/main.cpp @@ -37,7 +37,7 @@ void PrintPvl() { // Write file out to log QString inFile(ui.GetFileName("FROMPVL")); Pvl inPvl; - inPvl.read(ui.GetFileName("FROMPVL")); + inPvl.read(ui.GetFileName("FROMPVL").toStdString()); QString OQString = "***** Output of [" + inFile + "] *****"; Application::GuiLog(OQString); Application::GuiLog(inPvl); @@ -49,7 +49,7 @@ void LoadPvl() { UserInterface &ui = Application::GetUserInterface(); QString inFile(ui.GetFileName("FROMPVL")); Pvl inPvl; - inPvl.read(inFile); + inPvl.read(inFile.toStdString()); QString phtName = ui.GetAsString("PHTNAME"); phtName = phtName.toUpper(); QString atmName = ui.GetAsString("ATMNAME"); @@ -586,4 +586,4 @@ void LoadPvl() { } } } -} \ No newline at end of file +} diff --git a/isis/src/base/apps/remrx/main.cpp b/isis/src/base/apps/remrx/main.cpp index d5385f72e7..2c73c82a8a 100644 --- a/isis/src/base/apps/remrx/main.cpp +++ b/isis/src/base/apps/remrx/main.cpp @@ -30,12 +30,12 @@ void IsisMain() { QString in = ui.GetCubeName("FROM"); // Check reseau status and make sure it is not nominal or removed - if((QString)status == "Nominal") { + if(((std::string)status == "Nominal")) { QString msg = "Input file [" + in + "] appears to have nominal reseau status. You must run findrx first."; throw IException(IException::User, msg, _FILEINFO_); } - if((QString)status == "Removed") { + if((std::string)status == "Removed") { QString msg = "Input file [" + in + "] appears to already have reseaus removed."; throw IException(IException::User, msg, _FILEINFO_); @@ -73,9 +73,9 @@ void IsisMain() { Brick brick(sdim, ldim, 1, cube.pixelType()); for(int res = 0; res < numres; res++) { - if((resvalid == 0 || toInt(valid[res]) == 1) && toInt(type[res]) != 0) { - int baseSamp = (int)(toDouble(samps[res]) + 0.5) - (sdim / 2); - int baseLine = (int)(toDouble(lines[res]) + 0.5) - (ldim / 2); + if((resvalid == 0 || std::stoi(valid[res]) == 1) && std::stoi(type[res]) != 0) { + int baseSamp = (int)(std::stod(samps[res]) + 0.5) - (sdim / 2); + int baseLine = (int)(std::stod(lines[res]) + 0.5) - (ldim / 2); brick.SetBasePosition(baseSamp, baseLine, 1); cube.read(brick); if(action == "NULL") { @@ -99,7 +99,7 @@ void IsisMain() { double sdev = stats.StandardDeviation(); // Top Edge Reseau - if(toInt(type[res]) == 2) { + if(std::stoi(type[res]) == 2) { int l1 = 0; int l2 = ldim - 1; for(int s = 0; s < sdim; s++) { @@ -107,7 +107,7 @@ void IsisMain() { } } // Left Edge Reseau - else if(toInt(type[res]) == 4) { + else if(std::stoi(type[res]) == 4) { int s1 = 0; int s2 = sdim - 1; for(int l = 0; l < ldim; l++) { @@ -115,7 +115,7 @@ void IsisMain() { } } // Right Edge Reseau - else if(toInt(type[res]) == 6) { + else if(std::stoi(type[res]) == 6) { int s1 = 0; int s2 = sdim - 1; for(int l = 0; l < ldim; l++) { @@ -123,7 +123,7 @@ void IsisMain() { } } // Bottom Edge Reseau - else if(toInt(type[res]) == 8) { + else if(std::stoi(type[res]) == 8) { int l1 = 0; int l2 = ldim - 1; for(int s = 0; s < sdim; s++) { @@ -159,14 +159,14 @@ void IsisMain() { for(int l = 0; l < ldim; l++) { int c = l * sdim; //count // Top Edge Reseau - if(toInt(type[res]) == 2 && l < (ldim / 2)) continue; + if(std::stoi(type[res]) == 2 && l < (ldim / 2)) continue; // Bottom Edge Reseau - if(toInt(type[res]) == 8 && l > (ldim / 2 + 1)) continue; + if(std::stoi(type[res]) == 8 && l > (ldim / 2 + 1)) continue; for(int s = 0; s < sdim; s++, c++) { // Left Edge Reseau - if(toInt(type[res]) == 4 && s < (sdim / 2)) continue; + if(std::stoi(type[res]) == 4 && s < (sdim / 2)) continue; // Right Edge Reseau - if(toInt(type[res]) == 6 && s > (sdim / 2 + 1)) continue; + if(std::stoi(type[res]) == 6 && s > (sdim / 2 + 1)) continue; double sum = 0.0; int gline1 = 0; int gline2 = ldim - 1; diff --git a/isis/src/base/apps/ringsmappt/main.cpp b/isis/src/base/apps/ringsmappt/main.cpp index ed1e4b28bc..31683040ca 100644 --- a/isis/src/base/apps/ringsmappt/main.cpp +++ b/isis/src/base/apps/ringsmappt/main.cpp @@ -77,7 +77,7 @@ void IsisMain() { // Load it up into a new projection Pvl mapPvl; - mapPvl.read(mapFile.expanded()); + mapPvl.read(mapFile.expanded().toStdString()); RingPlaneProjection *altmap = (RingPlaneProjection *) ProjectionFactory::CreateFromCube(mapPvl); // Set lat and lon in its system @@ -130,31 +130,31 @@ void IsisMain() { if(proj->IsGood()) { PvlGroup results("Results"); results += PvlKeyword("Filename", - FileName(ui.GetCubeName("FROM")).expanded()); - results += PvlKeyword("Sample", toString(proj->WorldX())); - results += PvlKeyword("Line", toString(proj->WorldY())); - results += PvlKeyword("PixelValue", PixelToString(b[0])); - results += PvlKeyword("X", toString(proj->XCoord())); - results += PvlKeyword("Y", toString(proj->YCoord())); + FileName(ui.GetCubeName("FROM")).expanded().toStdString()); + results += PvlKeyword("Sample", std::to_string(proj->WorldX())); + results += PvlKeyword("Line", std::to_string(proj->WorldY())); + results += PvlKeyword("PixelValue", PixelToString(b[0]).toStdString()); + results += PvlKeyword("X", std::to_string(proj->XCoord())); + results += PvlKeyword("Y", std::to_string(proj->YCoord())); // Put together all the keywords for different coordinate systems. PvlKeyword ringRad = - PvlKeyword("RingRadius", toString(proj->UniversalRingRadius())); + PvlKeyword("RingRadius", std::to_string(proj->UniversalRingRadius())); PvlKeyword cC360 = - PvlKeyword("CounterClockwise360RingLongitude", toString(proj->UniversalRingLongitude())); + PvlKeyword("CounterClockwise360RingLongitude", std::to_string(proj->UniversalRingLongitude())); PvlKeyword c360 = PvlKeyword("Clockwise360RingLongitude", - toString(proj->ToClockwise(proj->UniversalRingLongitude(), 360))); + std::to_string(proj->ToClockwise(proj->UniversalRingLongitude(), 360))); PvlKeyword cC180 = PvlKeyword("CounterClockwise180RingLongitude", - toString(proj->To180Domain(proj->UniversalRingLongitude()))); + std::to_string(proj->To180Domain(proj->UniversalRingLongitude()))); PvlKeyword c180 = PvlKeyword("Clockwise180RingLongitude", - toString(proj->To180Domain(proj->ToCounterClockwise( + std::to_string(proj->To180Domain(proj->ToCounterClockwise( proj->UniversalRingLongitude(), 360)))); // Input map coordinate system location @@ -198,10 +198,10 @@ void IsisMain() { Pvl temp; temp.addGroup(results); if(append) { - temp.append(outFile); + temp.append(outFile.toStdString()); } else { - temp.write(outFile); + temp.write(outFile.toStdString()); } } @@ -233,7 +233,7 @@ void IsisMain() { } for(int i = 0; i < results.keywords(); i++) { - os << (QString)results[i]; + os << results[i]; if(i < results.keywords() - 1) { os << ","; @@ -259,7 +259,7 @@ void PrintMap() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); //Write map file out to the log diff --git a/isis/src/base/apps/ringspt/main.cpp b/isis/src/base/apps/ringspt/main.cpp index 716701b8ab..f21f6aa60b 100644 --- a/isis/src/base/apps/ringspt/main.cpp +++ b/isis/src/base/apps/ringspt/main.cpp @@ -72,10 +72,10 @@ void IsisMain() { temp.setTerminator(""); temp.addGroup((*point)); if(append) { - temp.append(outFile); + temp.append(outFile.toStdString()); } else { - temp.write(outFile); + temp.write(outFile.toStdString()); } } @@ -115,12 +115,12 @@ void IsisMain() { for(int i = 0; i < (*point).keywords(); i++) { if((*point)[i].size() == 3) { - os << (QString)(*point)[i][0] << "," - << (QString)(*point)[i][1] << "," - << (QString)(*point)[i][2]; + os << (*point)[i][0] << "," + << (*point)[i][1] << "," + << (*point)[i][2]; } else { - os << (QString)(*point)[i]; + os << (*point)[i]; } if(i < (*point).keywords() - 1) { diff --git a/isis/src/base/apps/shadowtau/main.cpp b/isis/src/base/apps/shadowtau/main.cpp index f712cd1bc4..bc429208fd 100644 --- a/isis/src/base/apps/shadowtau/main.cpp +++ b/isis/src/base/apps/shadowtau/main.cpp @@ -87,51 +87,51 @@ void IsisMain() { photoPvl.addObject(PvlObject("PhotometricModel")); photoPvl.findObject("PhotometricModel").addGroup(PvlGroup("Algorithm")); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("PHTNAME",sPhotoFunc),Pvl::Replace); + addKeyword(PvlKeyword("PHTNAME",sPhotoFunc.toStdString()),Pvl::Replace); if (sPhotoFunc == "HAPKEHEN" || sPhotoFunc == "HAPKELEG") { // Single Particle Phase Function HENYEY-GREENSTEIN if (ui.WasEntered("WH")) { QString keyval = ui.GetString("WH"); double wh = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("WH",toString(wh)),Pvl::Replace); + addKeyword(PvlKeyword("WH",std::to_string(wh)),Pvl::Replace); } if (ui.WasEntered("HH")) { QString keyval = ui.GetString("HH"); double hh = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HH",toString(hh)),Pvl::Replace); + addKeyword(PvlKeyword("HH",std::to_string(hh)),Pvl::Replace); } if (ui.WasEntered("B0")) { QString keyval = ui.GetString("B0"); double b0 = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("B0",toString(b0)),Pvl::Replace); + addKeyword(PvlKeyword("B0",std::to_string(b0)),Pvl::Replace); } if (ui.WasEntered("THETA")) { QString keyval = ui.GetString("THETA"); double theta = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("THETA",toString(theta)),Pvl::Replace); + addKeyword(PvlKeyword("THETA",std::to_string(theta)),Pvl::Replace); } if (ui.WasEntered("ZEROB0STANDARD")) { QString keyval = ui.GetString("ZEROB0STANDARD"); keyval = keyval.toUpper(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("ZEROB0STANDARD",keyval),Pvl::Replace); + addKeyword(PvlKeyword("ZEROB0STANDARD",keyval.toStdString()),Pvl::Replace); } if (sPhotoFunc == "HAPKEHEN") { if (ui.WasEntered("HG1")) { QString keyval = ui.GetString("HG1"); double hg1 = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HG1",toString(hg1)),Pvl::Replace); + addKeyword(PvlKeyword("HG1",std::to_string(hg1)),Pvl::Replace); } if (ui.WasEntered("HG2")) { QString keyval = ui.GetString("HG2"); double hg2 = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HG2",toString(hg2)),Pvl::Replace); + addKeyword(PvlKeyword("HG2",std::to_string(hg2)),Pvl::Replace); } } else { @@ -139,13 +139,13 @@ void IsisMain() { QString keyval = ui.GetString("BH"); double bh = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("BH",toString(bh)),Pvl::Replace); + addKeyword(PvlKeyword("BH",std::to_string(bh)),Pvl::Replace); } if (ui.WasEntered("CH")) { QString keyval = ui.GetString("CH"); double ch = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("CH",toString(ch)),Pvl::Replace); + addKeyword(PvlKeyword("CH",std::to_string(ch)),Pvl::Replace); } } } @@ -154,7 +154,7 @@ void IsisMain() { QString keyval = ui.GetString("L"); double l = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("L",toString(l)),Pvl::Replace); + addKeyword(PvlKeyword("L",std::to_string(l)),Pvl::Replace); } } else if (sPhotoFunc == "MINNAERT") { @@ -162,7 +162,7 @@ void IsisMain() { QString keyval = ui.GetString("K"); double k = toDouble(keyval); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("K",toString(k)),Pvl::Replace); + addKeyword(PvlKeyword("K",std::to_string(k)),Pvl::Replace); } } @@ -187,19 +187,19 @@ void IsisMain() { asmPvl.addObject(PvlObject("AtmosphericModel")); asmPvl.findObject("AtmosphericModel").addGroup(PvlGroup("Algorithm")); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("ATMNAME",sAsmType),Pvl::Replace); + addKeyword(PvlKeyword("ATMNAME",sAsmType.toStdString()),Pvl::Replace); if (ui.WasEntered("WHA")) { QString keyval = ui.GetString("WHA"); double wha = toDouble(keyval); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("WHA",toString(wha)),Pvl::Replace); + addKeyword(PvlKeyword("WHA",std::to_string(wha)),Pvl::Replace); } if (ui.WasEntered("HNORM")) { QString keyval = ui.GetString("HNORM"); double hnorm = toDouble(keyval); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HNORM",toString(hnorm)),Pvl::Replace); + addKeyword(PvlKeyword("HNORM",std::to_string(hnorm)),Pvl::Replace); } if (sAsmType=="ANISOTROPIC1" || sAsmType=="ANISOTROPIC2" ){ @@ -207,7 +207,7 @@ void IsisMain() { QString keyval = ui.GetString("BHA"); double bha = toDouble(keyval); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("BHA",toString(bha)),Pvl::Replace); + addKeyword(PvlKeyword("BHA",std::to_string(bha)),Pvl::Replace); } } else if (sAsmType=="HAPKEATM1" || sAsmType=="HAPKEATM2" ) { @@ -215,7 +215,7 @@ void IsisMain() { QString keyval = ui.GetString("HGA"); double hga = toDouble(keyval); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HGA",toString(hga)),Pvl::Replace); + addKeyword(PvlKeyword("HGA",std::to_string(hga)),Pvl::Replace); } } diff --git a/isis/src/base/apps/skyrange/main.cpp b/isis/src/base/apps/skyrange/main.cpp index b70b4b7b89..48ce2627d4 100644 --- a/isis/src/base/apps/skyrange/main.cpp +++ b/isis/src/base/apps/skyrange/main.cpp @@ -29,25 +29,25 @@ void IsisMain() { // Setup and log results PvlGroup results("Range"); - results += PvlKeyword("MinimumRightAscension", toString(minRa), "degrees"); - results += PvlKeyword("MaximumRightAscension", toString(maxRa), "degrees"); - results += PvlKeyword("MinimumDeclination", toString(minDec), "degrees"); - results += PvlKeyword("MaximumDeclination", toString(maxDec), "degrees"); - results += PvlKeyword("MinimumRightAscension", Projection::ToHMS(minRa), "hms"); - results += PvlKeyword("MaximumRightAscension", Projection::ToHMS(maxRa), "hms"); - results += PvlKeyword("MinimumDeclination", Projection::ToDMS(minDec), "dms"); - results += PvlKeyword("MaximumDeclination", Projection::ToDMS(maxDec), "dms"); - results += PvlKeyword("Resolution", toString(res), "degrees/pixel"); + results += PvlKeyword("MinimumRightAscension", std::to_string(minRa), "degrees"); + results += PvlKeyword("MaximumRightAscension", std::to_string(maxRa), "degrees"); + results += PvlKeyword("MinimumDeclination", std::to_string(minDec), "degrees"); + results += PvlKeyword("MaximumDeclination", std::to_string(maxDec), "degrees"); + results += PvlKeyword("MinimumRightAscension", Projection::ToHMS(minRa).toStdString(), "hms"); + results += PvlKeyword("MaximumRightAscension", Projection::ToHMS(maxRa).toStdString(), "hms"); + results += PvlKeyword("MinimumDeclination", Projection::ToDMS(minDec).toStdString(), "dms"); + results += PvlKeyword("MaximumDeclination", Projection::ToDMS(maxDec).toStdString(), "dms"); + results += PvlKeyword("Resolution", std::to_string(res), "degrees/pixel"); Application::Log(results); // Setup and log orientation PvlGroup orient("Orientation"); - orient += PvlKeyword("CenterSample", toString(icube->sampleCount() / 2.0)); - orient += PvlKeyword("CenterLine", toString(icube->lineCount() / 2.0)); - orient += PvlKeyword("CenterRightAscension", toString(centerRa), "degrees"); - orient += PvlKeyword("CenterDeclination", toString(centerDec), "degrees"); - orient += PvlKeyword("CelestialNorthClockAngle", toString(rot), "degrees"); - orient += PvlKeyword("Resolution", toString(res), "degrees/pixel"); + orient += PvlKeyword("CenterSample", std::to_string(icube->sampleCount() / 2.0)); + orient += PvlKeyword("CenterLine", std::to_string(icube->lineCount() / 2.0)); + orient += PvlKeyword("CenterRightAscension", std::to_string(centerRa), "degrees"); + orient += PvlKeyword("CenterDeclination", std::to_string(centerDec), "degrees"); + orient += PvlKeyword("CelestialNorthClockAngle", std::to_string(rot), "degrees"); + orient += PvlKeyword("Resolution", std::to_string(res), "degrees/pixel"); Application::Log(orient); // Write the output file if requested @@ -56,7 +56,7 @@ void IsisMain() { Pvl temp; temp.addGroup(results); temp.addGroup(orient); - temp.write(ui.GetFileName("TO", "txt")); + temp.write(ui.GetFileName("TO", "txt").toStdString()); } p.EndProcess(); diff --git a/isis/src/base/apps/slpmap/main.cpp b/isis/src/base/apps/slpmap/main.cpp index adf5b0eb6d..5dc6693968 100644 --- a/isis/src/base/apps/slpmap/main.cpp +++ b/isis/src/base/apps/slpmap/main.cpp @@ -76,7 +76,7 @@ void IsisMain() { g_groundMap = 0; if(g_outputType == Aspect) { p.StartProcess(createAspectCube); - bbGroup.addKeyword( PvlKeyword( "Name", "Aspect", ui.GetString("UNITS").toLower() ) ); + bbGroup.addKeyword( PvlKeyword( "Name", "Aspect", ui.GetString("UNITS").toLower().toStdString() ) ); } else { if (ui.GetString("PIXRES") == "AUTOMATIC") { @@ -100,7 +100,7 @@ void IsisMain() { bbGroup.addKeyword( PvlKeyword("Name", "Slope", "percent") ); } else { - bbGroup.addKeyword( PvlKeyword( "Name", "Slope", ui.GetString("UNITS").toLower() ) ); + bbGroup.addKeyword( PvlKeyword( "Name", "Slope", ui.GetString("UNITS").toLower().toStdString() ) ); } } diff --git a/isis/src/base/apps/smtk/main.cpp b/isis/src/base/apps/smtk/main.cpp index 98dda432e0..5eb35176ff 100644 --- a/isis/src/base/apps/smtk/main.cpp +++ b/isis/src/base/apps/smtk/main.cpp @@ -449,10 +449,10 @@ void IsisMain() { // Report Stereo separation angles PvlGroup stresultsPvl("StereoSeparationAngle"); - stresultsPvl += PvlKeyword("Minimum", toString(stAng.Minimum()), "deg"); - stresultsPvl += PvlKeyword("Average", toString(stAng.Average()), "deg"); - stresultsPvl += PvlKeyword("Maximum", toString(stAng.Maximum()), "deg"); - stresultsPvl += PvlKeyword("StandardDeviation", toString(stAng.StandardDeviation()), "deg"); + stresultsPvl += PvlKeyword("Minimum", std::to_string(stAng.Minimum()), "deg"); + stresultsPvl += PvlKeyword("Average", std::to_string(stAng.Average()), "deg"); + stresultsPvl += PvlKeyword("Maximum", std::to_string(stAng.Maximum()), "deg"); + stresultsPvl += PvlKeyword("StandardDeviation", std::to_string(stAng.StandardDeviation()), "deg"); Application::Log(stresultsPvl); // Update the label with BandBin keywords @@ -481,17 +481,17 @@ void IsisMain() { // Create output data PvlGroup totalPointsPvl("Totals"); - totalPointsPvl += PvlKeyword("AttemptedPoints", toString(numAttemptedInitialPoints)); - totalPointsPvl += PvlKeyword("InitialSuccesses", toString(numOrigPoints)); - totalPointsPvl += PvlKeyword("GrowSuccesses", toString(passpix2)); - totalPointsPvl += PvlKeyword("ResultingPoints", toString(bmf.size())); + totalPointsPvl += PvlKeyword("AttemptedPoints", std::to_string(numAttemptedInitialPoints)); + totalPointsPvl += PvlKeyword("InitialSuccesses", std::to_string(numOrigPoints)); + totalPointsPvl += PvlKeyword("GrowSuccesses", std::to_string(passpix2)); + totalPointsPvl += PvlKeyword("ResultingPoints", std::to_string(bmf.size())); Application::Log(totalPointsPvl); Pvl arPvl = matcher.RegistrationStatistics(); PvlGroup smtkresultsPvl("SmtkResults"); - smtkresultsPvl += PvlKeyword("SpiceOffImage", toString(matcher.OffImageErrorCount())); - smtkresultsPvl += PvlKeyword("SpiceDistanceError", toString(matcher.SpiceErrorCount())); + smtkresultsPvl += PvlKeyword("SpiceOffImage", std::to_string(matcher.OffImageErrorCount())); + smtkresultsPvl += PvlKeyword("SpiceDistanceError", std::to_string(matcher.SpiceErrorCount())); arPvl.addGroup(smtkresultsPvl); for (int i = 0; i < arPvl.groups(); i++) { @@ -513,7 +513,7 @@ void helperButtonLog () { UserInterface &ui = Application::GetUserInterface(); QString file(ui.GetFileName("REGDEF")); Pvl p; - p.read(file); + p.read(file.toStdString()); Application::GuiLog(p); } //...........end of helper function ........ diff --git a/isis/src/base/apps/specpix/main.cpp b/isis/src/base/apps/specpix/main.cpp index 95e50068b8..1405042fe5 100644 --- a/isis/src/base/apps/specpix/main.cpp +++ b/isis/src/base/apps/specpix/main.cpp @@ -98,14 +98,14 @@ void IsisMain() { // Print out number of values changed PvlGroup results("Results"); results.addComment("The number and type of pixels created"); - results += PvlKeyword("Null", toString(nnull)); - results += PvlKeyword("Lrs", toString(nlrs)); - results += PvlKeyword("Lis", toString(nlis)); - results += PvlKeyword("Hrs", toString(nhrs)); - results += PvlKeyword("His", toString(nhis)); + results += PvlKeyword("Null", std::to_string(nnull)); + results += PvlKeyword("Lrs", std::to_string(nlrs)); + results += PvlKeyword("Lis", std::to_string(nlis)); + results += PvlKeyword("Hrs", std::to_string(nhrs)); + results += PvlKeyword("His", std::to_string(nhis)); //tjw: int total -> BigInt total BigInt total = nnull + nlrs + nhrs + nlis + nhis; - results += PvlKeyword("Total", toString(total)); + results += PvlKeyword("Total", std::to_string(total)); Application::Log(results); diff --git a/isis/src/base/apps/table2cube/main.cpp b/isis/src/base/apps/table2cube/main.cpp index e1316ed6a4..c3bb6776b9 100644 --- a/isis/src/base/apps/table2cube/main.cpp +++ b/isis/src/base/apps/table2cube/main.cpp @@ -23,7 +23,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); // Get Parameters - g_table = new Table(ui.GetString("TABLENAME"), ui.GetFileName("FROM")); + g_table = new Table(ui.GetString("TABLENAME").toStdString(), ui.GetFileName("FROM")); g_field = ui.GetString("FIELD"); g_startRecord = ui.GetInteger("STARTREC"); diff --git a/isis/src/base/apps/tabledump/main.cpp b/isis/src/base/apps/tabledump/main.cpp index adeae6572c..276fa1b5c7 100644 --- a/isis/src/base/apps/tabledump/main.cpp +++ b/isis/src/base/apps/tabledump/main.cpp @@ -27,7 +27,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); FileName file = ui.GetCubeName("FROM"); QString tableName = ui.GetString("NAME"); - Table table(tableName, file.expanded()); + Table table(tableName.toStdString(), file.expanded()); // Set the character to separate the entries QString delimit; @@ -147,7 +147,7 @@ void helperButtonGetTableList() { UserInterface &ui = Application::GetUserInterface(); QString currentFile = ui.GetCubeName("FROM"); - const Pvl label(FileName(currentFile).expanded()); + const Pvl label(FileName(currentFile).expanded().toStdString()); // Check to see if the "FILE" parameter has changed since last press if (currentFile != g_previousFile) { @@ -173,7 +173,7 @@ void helperButtonGetTableList() { } // When we find a table, fetch its name to stick in the "NAME" parameter else if (label.object(g_pos).name() == "Table") { - list = label.object(g_pos)["Name"][0]; + list = QString::fromStdString(label.object(g_pos)["Name"][0]); match = true; g_pos++; } diff --git a/isis/src/base/apps/tonematch/main.cpp b/isis/src/base/apps/tonematch/main.cpp index 1fb423b594..b87f67735c 100644 --- a/isis/src/base/apps/tonematch/main.cpp +++ b/isis/src/base/apps/tonematch/main.cpp @@ -62,8 +62,8 @@ void IsisMain() { PvlGroup results("Results"); QString stringNum = ""; - results += PvlKeyword( "Offset", stringNum.setNum(base) ); - results += PvlKeyword( "Gain", stringNum.setNum(mult) ); + results += PvlKeyword( "Offset", stringNum.setNum(base).toStdString() ); + results += PvlKeyword( "Gain", stringNum.setNum(mult).toStdString() ); Pvl fileOutput; fileOutput += results; oStats.SetMincount( ui.GetInteger("MINCOUNT") ); @@ -71,7 +71,7 @@ void IsisMain() { Application::Log(results); if (ui.WasEntered("OUTSTATS")) { - fileOutput.write(ui.GetFileName("OUTSTATS")); + fileOutput.write(ui.GetFileName("OUTSTATS").toStdString()); } // Apply the correction diff --git a/isis/src/base/apps/trackextract/main.cpp b/isis/src/base/apps/trackextract/main.cpp index b68044049e..1993739e12 100644 --- a/isis/src/base/apps/trackextract/main.cpp +++ b/isis/src/base/apps/trackextract/main.cpp @@ -179,7 +179,7 @@ void createMosaicCube(QString inputName, QString outputName, QVector ba PvlGroup trackingGroup = PvlGroup("Tracking"); PvlKeyword trackingName = PvlKeyword("Filename"); FileName cubeName = FileName(outputName); - trackingName.setValue(cubeName.baseName() + "_tracking.cub"); //Strip off path and add _tracking + trackingName.setValue(cubeName.baseName().toStdString() + "_tracking.cub"); //Strip off path and add _tracking trackingGroup.addKeyword(trackingName); mosaicCube.putGroup(trackingGroup); diff --git a/isis/src/base/objs/BulletShapeModel/unitTest.cpp b/isis/src/base/objs/BulletShapeModel/unitTest.cpp index 5116679ae6..98c1d27e78 100644 --- a/isis/src/base/objs/BulletShapeModel/unitTest.cpp +++ b/isis/src/base/objs/BulletShapeModel/unitTest.cpp @@ -74,9 +74,9 @@ int main(int argc, char *argv[]) { qDebug() << ""; qDebug() << ""; qDebug() << "Using: " << itokawaCubeFile; - Pvl itokawaLabel(itokawaCubeFile); + Pvl itokawaLabel(itokawaCubeFile.toStdString()); PvlObject &itokawaCubeLabel = itokawaLabel.findObject("IsisCube"); - itokawaCubeLabel.findGroup("Kernels").findKeyword("ShapeModel").setValue(itokawaDskFile); + itokawaCubeLabel.findGroup("Kernels").findKeyword("ShapeModel").setValue(itokawaDskFile.toStdString()); BulletShapeModel itokawaModel( itokawaTarget, itokawaLabel ); itokawaModel.setTolerance(0.001); outputModelStatus(itokawaModel); diff --git a/isis/src/base/objs/Camera/unitTest.cpp b/isis/src/base/objs/Camera/unitTest.cpp index 469fb8ba6d..ba987c4df9 100644 --- a/isis/src/base/objs/Camera/unitTest.cpp +++ b/isis/src/base/objs/Camera/unitTest.cpp @@ -231,7 +231,7 @@ int main() { pixRes2 *= 10000000; pixRes2 = round(pixRes2); pixRes2 /= 10000000; - pvl.findGroup("Mapping")["PixelResolution"] = toString(pixRes2); + pvl.findGroup("Mapping")["PixelResolution"] = std::to_string(pixRes2); cout << "BasicMapping PVL: " << endl << pvl << endl << endl; cout << "FocalLength: " << c->FocalLength() << endl; @@ -327,19 +327,19 @@ int main() { minLat *= 100; minLat = round(minLat); minLat /= 100; - camMap.findGroup("Mapping")["MinimumLatitude"] = toString(minLat); + camMap.findGroup("Mapping")["MinimumLatitude"] = std::to_string(minLat); double pixRes = camMap.findGroup("Mapping")["PixelResolution"]; pixRes *= 100; pixRes = round(pixRes); pixRes /= 100; - camMap.findGroup("Mapping")["PixelResolution"] = toString(pixRes); + camMap.findGroup("Mapping")["PixelResolution"] = std::to_string(pixRes); double minLon = camMap.findGroup("Mapping")["MinimumLongitude"]; minLon *= 100000000000.0; minLon = round(minLon); minLon /= 100000000000.0; - camMap.findGroup("Mapping")["MinimumLongitude"] = toString(minLon); + camMap.findGroup("Mapping")["MinimumLongitude"] = std::to_string(minLon); cout << camMap << endl; diff --git a/isis/src/base/objs/CameraPointInfo/unitTest.cpp b/isis/src/base/objs/CameraPointInfo/unitTest.cpp index dd2bf33be0..71b48055f4 100644 --- a/isis/src/base/objs/CameraPointInfo/unitTest.cpp +++ b/isis/src/base/objs/CameraPointInfo/unitTest.cpp @@ -45,13 +45,13 @@ int main() { void LowerPrecision(PvlKeyword &keyword) { if (keyword.name() != "LookDirectionCamera") { - double value = toDouble(keyword[0]); + double value = std::stod(keyword[0]); value = round(value * 1000) / 1000.0; keyword[0] = std::to_string(value); } else { for (int i = 0; i < 3; i++) { - double value = toDouble(keyword[i]); + double value = std::stod(keyword[i]); value = round(value * 10000000000) / 10000000000.0; keyword[i] = std::to_string(value); } diff --git a/isis/src/base/objs/CameraStatistics/unitTest.cpp b/isis/src/base/objs/CameraStatistics/unitTest.cpp index ca45302695..6b59690589 100644 --- a/isis/src/base/objs/CameraStatistics/unitTest.cpp +++ b/isis/src/base/objs/CameraStatistics/unitTest.cpp @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) { for (int j = 0; j < group.keywords(); j++) { PvlKeyword &keyword = group[j]; - cout << " " << keyword.name() << " = " << toDouble(keyword[0]) << endl; + cout << " " << keyword.name() << " = " << std::stod(keyword[0]) << endl; } cout << endl; diff --git a/isis/src/base/objs/DemShape/unitTest.cpp b/isis/src/base/objs/DemShape/unitTest.cpp index 7e40ade076..2e0b892dac 100644 --- a/isis/src/base/objs/DemShape/unitTest.cpp +++ b/isis/src/base/objs/DemShape/unitTest.cpp @@ -191,9 +191,9 @@ int main() { Pvl elPvl; PvlGroup kernels = pvl.findGroup("Kernels", Pvl::Traverse); QString demCubeFile; - demCubeFile = (QString) kernels["ShapeModel"]; + demCubeFile = QString::fromStdString(kernels["ShapeModel"]); kernels.deleteKeyword("ShapeModel"); - PvlKeyword shapeKey("ElevationModel", demCubeFile); + PvlKeyword shapeKey("ElevationModel", demCubeFile.toStdString()); kernels.addKeyword(shapeKey); elPvl.addGroup(kernels); DemShape elShape (&targ, elPvl); diff --git a/isis/src/base/objs/EmbreeShapeModel/unitTest.cpp b/isis/src/base/objs/EmbreeShapeModel/unitTest.cpp index c70ef81aa5..6ef0490b1e 100644 --- a/isis/src/base/objs/EmbreeShapeModel/unitTest.cpp +++ b/isis/src/base/objs/EmbreeShapeModel/unitTest.cpp @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) { qDebug() << ""; Pvl testLabel; PvlGroup testKernels("Kernels"); - testKernels += PvlKeyword("ShapeModel", dskfile); + testKernels += PvlKeyword("ShapeModel", dskfile.toStdString()); testLabel += testKernels; EmbreeShapeModel itokawaPvlModel(itokawaTarget, testLabel, manager); outputModelStatus(itokawaPvlModel); @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) { qDebug() << ""; Pvl elevationLabel; PvlGroup elevationKernels("Kernels"); - elevationKernels += PvlKeyword("ElevationModel", dskfile); + elevationKernels += PvlKeyword("ElevationModel", dskfile.toStdString()); elevationLabel += elevationKernels; EmbreeShapeModel itokawaElevationModel(itokawaTarget, elevationLabel, manager); outputModelStatus(itokawaElevationModel); diff --git a/isis/src/base/objs/Equalization/unitTest.cpp b/isis/src/base/objs/Equalization/unitTest.cpp index f6c2dbea3a..384627078d 100644 --- a/isis/src/base/objs/Equalization/unitTest.cpp +++ b/isis/src/base/objs/Equalization/unitTest.cpp @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) { results = equalizer.getResults(); cout << "Results:" << endl; for (int i = 0; i < results["NonOverlaps"].size(); i++) { - results["NonOverlaps"][i].replace(QRegularExpression("(\\/[\\w\\-\\. ]*)+\\/odyssey"), "odyssey"); + QString::fromStdString(results["NonOverlaps"][i]).replace(QRegularExpression("(\\/[\\w\\-\\. ]*)+\\/odyssey"), "odyssey"); } cout << results << endl; @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) { cout << "Results:" << endl; for (int i = 0; i < results.keywords(); i++) { if (results[i].isNamed("FileName")) { - results[i].setValue(QString(results[i]).replace(QRegularExpression("(\\/[\\w\\-\\. ]*)+\\/odyssey"), "odyssey")); + results[i].setValue(QString::fromStdString(results[i]).replace(QRegularExpression("(\\/[\\w\\-\\. ]*)+\\/odyssey"), "odyssey").toStdString()); } } cout << results << endl; diff --git a/isis/src/base/objs/Equirectangular/unitTest.cpp b/isis/src/base/objs/Equirectangular/unitTest.cpp index 99bfb7496d..112cb7b8c6 100644 --- a/isis/src/base/objs/Equirectangular/unitTest.cpp +++ b/isis/src/base/objs/Equirectangular/unitTest.cpp @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGroup += PvlKeyword("PolarRadius", toString(1.0)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(1.0)); + mapGroup += PvlKeyword("PolarRadius", std::to_string(1.0)); mapGroup += PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(180.0)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGroup += PvlKeyword("MinimumLatitude", std::to_string(-90.0)); + mapGroup += PvlKeyword("MaximumLatitude", std::to_string(90.0)); + mapGroup += PvlKeyword("MinimumLongitude", std::to_string(-180.0)); + mapGroup += PvlKeyword("MaximumLongitude", std::to_string(180.0)); mapGroup += PvlKeyword("ProjectionName", "Equirectangular"); cout << "Test missing center longitude keyword ..." << endl; @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(-90.0)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(-90.0)); cout << "Test missing center latitude keyword ..." << endl; try { @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLatitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(0.0)); Projection &proj = *ProjectionFactory::Create(lab); TProjection *p = (TProjection *) &proj; @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) { cout << endl; std::cout << "Check Invalid Latitude" << std::endl; - mapGroup.addKeyword(PvlKeyword("CenterLatitude", toString(90.0)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("CenterLatitude", std::to_string(90.0)), Pvl::Replace); std::cout << mapGroup << std::endl; try { Equirectangular p2(lab); diff --git a/isis/src/base/objs/ExportPdsTable/unitTest.cpp b/isis/src/base/objs/ExportPdsTable/unitTest.cpp index b2fda6e4e1..d808be97b1 100644 --- a/isis/src/base/objs/ExportPdsTable/unitTest.cpp +++ b/isis/src/base/objs/ExportPdsTable/unitTest.cpp @@ -56,9 +56,9 @@ int main(int argc, char *argv[]) { FileName lsbLabelFile("$temporary/lsbPdsTable.lbl"); ofstream outputLsbLabel((lsbLabelFile.expanded()).toLatin1().data()); outputLsbLabel << PvlKeyword("RECORD_TYPE", "FIXED_LENGTH") << endl; - outputLsbLabel << PvlKeyword("RECORD_BYTES", toString(tableRecBytes)) << endl; - QString tableName = ExportPdsTable::formatPdsTableName(table.Name()); - outputLsbLabel << PvlKeyword("^" + tableName, "lsbPdsTable.dat") << endl; + outputLsbLabel << PvlKeyword("RECORD_BYTES", std::to_string(tableRecBytes)) << endl; + QString tableName = ExportPdsTable::formatPdsTableName(QString::fromStdString(table.Name())); + outputLsbLabel << PvlKeyword("^" + tableName.toStdString(), "lsbPdsTable.dat") << endl; outputLsbLabel << endl; // Add table object to label keywords outputLsbLabel << metadata; @@ -76,10 +76,10 @@ int main(int argc, char *argv[]) { cout << reimportedLsbTable[0][2].name() << "\t"; cout << reimportedLsbTable[0][3].name() << "\n"; for (int i = 0; i < reimportedLsbTable.Records(); i++) { - cout << toString((double) reimportedLsbTable[i][0]) << "\t\t\t"; - cout << toString((int) reimportedLsbTable[i][1]) << "\t\t\t\t"; + cout << std::to_string((double) reimportedLsbTable[i][0]) << "\t\t\t"; + cout << std::to_string((int) reimportedLsbTable[i][1]) << "\t\t\t\t"; cout << (std::string) reimportedLsbTable[i][2] << "\t\t\t"; - cout << toString((float) reimportedLsbTable[i][3]) << "\n"; + cout << std::to_string((float) reimportedLsbTable[i][3]) << "\n"; } // remove files and reset buffer QFile::remove((lsbLabelFile.expanded())); @@ -98,8 +98,8 @@ int main(int argc, char *argv[]) { FileName msbLabelFile("$temporary/msbPdsTable.lbl"); ofstream outputMsbLabel((msbLabelFile.expanded()).toLatin1().data()); outputMsbLabel << PvlKeyword("RECORD_TYPE", "FIXED_LENGTH") << endl; - outputMsbLabel << PvlKeyword("RECORD_BYTES", toString(tableRecBytes)) << endl; - outputMsbLabel << PvlKeyword("^" + tableName, "msbPdsTable.dat") << endl; + outputMsbLabel << PvlKeyword("RECORD_BYTES", std::to_string(tableRecBytes)) << endl; + outputMsbLabel << PvlKeyword("^" + tableName.toStdString(), "msbPdsTable.dat") << endl; outputMsbLabel << endl; // Add table object to label keywords outputMsbLabel << metadata; diff --git a/isis/src/base/objs/FramingCamera/unitTest.cpp b/isis/src/base/objs/FramingCamera/unitTest.cpp index 0f586ddb2e..e3bfefc4f4 100644 --- a/isis/src/base/objs/FramingCamera/unitTest.cpp +++ b/isis/src/base/objs/FramingCamera/unitTest.cpp @@ -83,7 +83,7 @@ int main() { // test ShutterOpenCloseTimes() method PvlGroup inst = cube.label()->findGroup("Instrument", Pvl::Traverse); - QString startTime = inst["StartTime"]; + QString startTime = QString::fromStdString(inst["StartTime"]); double eTime = 0.0; utc2et_c(startTime.toLatin1().data(), &eTime); double expoDur = ((double) inst["ExposureDuration"])/1000; // in seconds diff --git a/isis/src/base/objs/GridPolygonSeeder/unitTest.cpp b/isis/src/base/objs/GridPolygonSeeder/unitTest.cpp index ebe7db51c2..55bcddd478 100644 --- a/isis/src/base/objs/GridPolygonSeeder/unitTest.cpp +++ b/isis/src/base/objs/GridPolygonSeeder/unitTest.cpp @@ -39,14 +39,14 @@ int main() { if(!alg.hasKeyword("Name")) { cout << "Test without subgrid" << endl; alg += PvlKeyword("Name", "Grid"); - alg += PvlKeyword("MinimumThickness", toString(0.3)); - alg += PvlKeyword("MinimumArea", toString(10)); - alg += PvlKeyword("XSpacing", toString(1500)); - alg += PvlKeyword("YSpacing", toString(1500)); + alg += PvlKeyword("MinimumThickness", std::to_string(0.3)); + alg += PvlKeyword("MinimumArea", std::to_string(10)); + alg += PvlKeyword("XSpacing", std::to_string(1500)); + alg += PvlKeyword("YSpacing", std::to_string(1500)); } else { cout << "Test with subgrid" << endl; - alg += PvlKeyword("SubGrid", toString(true)); + alg += PvlKeyword("SubGrid", std::to_string(true)); } PvlObject o("AutoSeed"); @@ -93,9 +93,9 @@ int main() { mapGroup += Isis::PvlKeyword("PolarRadius", radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); - mapGroup += Isis::PvlKeyword("CenterLatitude", toString(0)); - mapGroup += Isis::PvlKeyword("CenterLongitude", toString(0)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", std::to_string(360)); + mapGroup += Isis::PvlKeyword("CenterLatitude", std::to_string(0)); + mapGroup += Isis::PvlKeyword("CenterLongitude", std::to_string(0)); mapGroup += Isis::PvlKeyword("ProjectionName", "Sinusoidal"); TProjection *proj = (TProjection *) Isis::ProjectionFactory::Create(maplab); @@ -155,9 +155,9 @@ int main() { mapGroup += Isis::PvlKeyword("PolarRadius", radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); - mapGroup += Isis::PvlKeyword("CenterLatitude", toString(0)); - mapGroup += Isis::PvlKeyword("CenterLongitude", toString(0)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", std::to_string(360)); + mapGroup += Isis::PvlKeyword("CenterLatitude", std::to_string(0)); + mapGroup += Isis::PvlKeyword("CenterLongitude", std::to_string(0)); mapGroup += Isis::PvlKeyword("ProjectionName", "Sinusoidal"); TProjection *proj = (TProjection *) Isis::ProjectionFactory::Create(maplab); diff --git a/isis/src/base/objs/Gruen/unitTest.cpp b/isis/src/base/objs/Gruen/unitTest.cpp index 89a7bd8899..c2dcc6c53a 100644 --- a/isis/src/base/objs/Gruen/unitTest.cpp +++ b/isis/src/base/objs/Gruen/unitTest.cpp @@ -23,18 +23,18 @@ int main() { try { PvlGroup alg("Algorithm"); alg += PvlKeyword("Name", "Gruen"); - alg += PvlKeyword("Tolerance", toString(100.0)); - alg += PvlKeyword("AffineTranslationTolerance", toString(0.15)); - alg += PvlKeyword("AffineScaleTolerance", toString(0.3)); - alg += PvlKeyword("MaximumIterations", toString(30)); + alg += PvlKeyword("Tolerance", std::to_string(100.0)); + alg += PvlKeyword("AffineTranslationTolerance", std::to_string(0.15)); + alg += PvlKeyword("AffineScaleTolerance", std::to_string(0.3)); + alg += PvlKeyword("MaximumIterations", std::to_string(30)); PvlGroup pchip("PatternChip"); - pchip += PvlKeyword("Samples", toString(19)); - pchip += PvlKeyword("Lines", toString(19)); + pchip += PvlKeyword("Samples", std::to_string(19)); + pchip += PvlKeyword("Lines", std::to_string(19)); PvlGroup schip("SearchChip"); - schip += PvlKeyword("Samples", toString(25)); - schip += PvlKeyword("Lines", toString(25)); + schip += PvlKeyword("Samples", std::to_string(25)); + schip += PvlKeyword("Lines", std::to_string(25)); PvlObject o("AutoRegistration"); o.addGroup(alg); diff --git a/isis/src/base/objs/Hapke/unitTest.cpp b/isis/src/base/objs/Hapke/unitTest.cpp index 16282d055f..829a51cb95 100644 --- a/isis/src/base/objs/Hapke/unitTest.cpp +++ b/isis/src/base/objs/Hapke/unitTest.cpp @@ -52,12 +52,12 @@ int main() { PvlGroup algp2("Algorithm"); algp2 += PvlKeyword("Name", "HapkeHen"); - algp2 += PvlKeyword("Wh", toString(0.52)); - algp2 += PvlKeyword("B0", toString(1.0)); - algp2 += PvlKeyword("Hh", toString(1.0)); - algp2 += PvlKeyword("Theta", toString(30.0)); - algp2 += PvlKeyword("Hg1", toString(0.213)); - algp2 += PvlKeyword("Hg2", toString(1.0)); + algp2 += PvlKeyword("Wh", std::to_string(0.52)); + algp2 += PvlKeyword("B0", std::to_string(1.0)); + algp2 += PvlKeyword("Hh", std::to_string(1.0)); + algp2 += PvlKeyword("Theta", std::to_string(30.0)); + algp2 += PvlKeyword("Hg1", std::to_string(0.213)); + algp2 += PvlKeyword("Hg2", std::to_string(1.0)); algp2 += PvlKeyword("ZeroB0St", "TRUE"); PvlObject op2("PhotometricModel"); @@ -88,12 +88,12 @@ int main() { PvlGroup algp3("Algorithm"); algp3 += PvlKeyword("Name", "HapkeHen"); - algp3 += PvlKeyword("Wh", toString(0.52)); - algp3 += PvlKeyword("B0", toString(1.0)); - algp3 += PvlKeyword("Hh", toString(1.0)); - algp3 += PvlKeyword("Theta", toString(30.0)); - algp3 += PvlKeyword("Hg1", toString(0.213)); - algp3 += PvlKeyword("Hg2", toString(1.0)); + algp3 += PvlKeyword("Wh", std::to_string(0.52)); + algp3 += PvlKeyword("B0", std::to_string(1.0)); + algp3 += PvlKeyword("Hh", std::to_string(1.0)); + algp3 += PvlKeyword("Theta", std::to_string(30.0)); + algp3 += PvlKeyword("Hg1", std::to_string(0.213)); + algp3 += PvlKeyword("Hg2", std::to_string(1.0)); algp3 += PvlKeyword("ZeroB0St", "YES"); PvlObject op3("PhotometricModel"); @@ -127,12 +127,12 @@ int main() { PvlGroup algp4("Algorithm"); algp4 += PvlKeyword("Name", "HapkeLeg"); - algp4 += PvlKeyword("Wh", toString(0.52)); - algp4 += PvlKeyword("B0", toString(1.0)); - algp4 += PvlKeyword("Hh", toString(1.0)); - algp4 += PvlKeyword("Bh", toString(0.0)); - algp4 += PvlKeyword("Ch", toString(0.0)); - algp4 += PvlKeyword("Theta", toString(30.0)); + algp4 += PvlKeyword("Wh", std::to_string(0.52)); + algp4 += PvlKeyword("B0", std::to_string(1.0)); + algp4 += PvlKeyword("Hh", std::to_string(1.0)); + algp4 += PvlKeyword("Bh", std::to_string(0.0)); + algp4 += PvlKeyword("Ch", std::to_string(0.0)); + algp4 += PvlKeyword("Theta", std::to_string(30.0)); algp4 += PvlKeyword("ZeroB0Standard", "FALSE"); PvlObject op4("PhotometricModel"); @@ -163,12 +163,12 @@ int main() { PvlGroup algp5("Algorithm"); algp5 += PvlKeyword("Name", "HapkeLeg"); - algp5 += PvlKeyword("Wh", toString(0.52)); - algp5 += PvlKeyword("B0", toString(1.0)); - algp5 += PvlKeyword("Hh", toString(1.0)); - algp5 += PvlKeyword("Bh", toString(0.0)); - algp5 += PvlKeyword("Ch", toString(0.0)); - algp5 += PvlKeyword("Theta", toString(30.0)); + algp5 += PvlKeyword("Wh", std::to_string(0.52)); + algp5 += PvlKeyword("B0", std::to_string(1.0)); + algp5 += PvlKeyword("Hh", std::to_string(1.0)); + algp5 += PvlKeyword("Bh", std::to_string(0.0)); + algp5 += PvlKeyword("Ch", std::to_string(0.0)); + algp5 += PvlKeyword("Theta", std::to_string(30.0)); algp5 += PvlKeyword("ZeroB0Standard", "NO"); PvlObject op5("PhotometricModel"); @@ -199,12 +199,12 @@ int main() { PvlGroup algp6("Algorithm"); algp6 += PvlKeyword("Name", "HapkeLeg"); - algp6 += PvlKeyword("Wh", toString(0.52)); - algp6 += PvlKeyword("B0", toString(1.0)); - algp6 += PvlKeyword("Hh", toString(1.0)); - algp6 += PvlKeyword("Bh", toString(0.0)); - algp6 += PvlKeyword("Ch", toString(0.0)); - algp6 += PvlKeyword("Theta", toString(30.0)); + algp6 += PvlKeyword("Wh", std::to_string(0.52)); + algp6 += PvlKeyword("B0", std::to_string(1.0)); + algp6 += PvlKeyword("Hh", std::to_string(1.0)); + algp6 += PvlKeyword("Bh", std::to_string(0.0)); + algp6 += PvlKeyword("Ch", std::to_string(0.0)); + algp6 += PvlKeyword("Theta", std::to_string(30.0)); algp6 += PvlKeyword("ZeroB0Standard", "MAYBE"); PvlObject op6("PhotometricModel"); diff --git a/isis/src/base/objs/LimitPolygonSeeder/unitTest.cpp b/isis/src/base/objs/LimitPolygonSeeder/unitTest.cpp index b985de54ac..f439359eb2 100644 --- a/isis/src/base/objs/LimitPolygonSeeder/unitTest.cpp +++ b/isis/src/base/objs/LimitPolygonSeeder/unitTest.cpp @@ -81,8 +81,8 @@ int main() { Isis::Pvl maplab; maplab.addGroup(Isis::PvlGroup("Mapping")); Isis::PvlGroup &mapGroup = maplab.findGroup("Mapping"); - mapGroup += Isis::PvlKeyword("EquatorialRadius", (QString)radii["EquatorialRadius"]); - mapGroup += Isis::PvlKeyword("PolarRadius", (QString)radii["PolarRadius"]); + mapGroup += Isis::PvlKeyword("EquatorialRadius", (std::string)radii["EquatorialRadius"]); + mapGroup += Isis::PvlKeyword("PolarRadius", (std::string)radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); mapGroup += Isis::PvlKeyword("LongitudeDomain", "360"); @@ -143,8 +143,8 @@ int main() { Isis::Pvl maplab; maplab.addGroup(Isis::PvlGroup("Mapping")); Isis::PvlGroup &mapGroup = maplab.findGroup("Mapping"); - mapGroup += Isis::PvlKeyword("EquatorialRadius", (QString)radii["EquatorialRadius"]); - mapGroup += Isis::PvlKeyword("PolarRadius", (QString)radii["PolarRadius"]); + mapGroup += Isis::PvlKeyword("EquatorialRadius", (std::string)radii["EquatorialRadius"]); + mapGroup += Isis::PvlKeyword("PolarRadius", (std::string)radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); mapGroup += Isis::PvlKeyword("LongitudeDomain", "360"); diff --git a/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp b/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp index 025fe849c1..b56bf79fde 100644 --- a/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp +++ b/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp @@ -27,16 +27,16 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(6378206.4)); - mapGroup += PvlKeyword("PolarRadius", toString(6378206.4)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(6378206.4)); + mapGroup += PvlKeyword("PolarRadius", std::to_string(6378206.4)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-30.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(-15.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-30.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(-15.0)); - mapGroup += PvlKeyword("MaximumLibration", toString(1)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGroup += PvlKeyword("MinimumLatitude", std::to_string(-30.0)); + mapGroup += PvlKeyword("MaximumLatitude", std::to_string(-15.0)); + mapGroup += PvlKeyword("MinimumLongitude", std::to_string(-30.0)); + mapGroup += PvlKeyword("MaximumLongitude", std::to_string(-15.0)); + mapGroup += PvlKeyword("MaximumLibration", std::to_string(1)); mapGroup += PvlKeyword("ProjectionName", "LunarAzimuthalEqualArea"); diff --git a/isis/src/base/objs/LunarLambertEmpirical/unitTest.cpp b/isis/src/base/objs/LunarLambertEmpirical/unitTest.cpp index adffef33a4..9d91f9f4be 100755 --- a/isis/src/base/objs/LunarLambertEmpirical/unitTest.cpp +++ b/isis/src/base/objs/LunarLambertEmpirical/unitTest.cpp @@ -81,9 +81,9 @@ int main() { PvlKeyword phaseCurveList("PhaseCurveList"); for (int i=0; i < 15; i++) { - phaseList += QString::number(i*10); - lList += QString::number(i*0.1); - phaseCurveList += QString::number(i*0.3); + phaseList += std::to_string(i*10); + lList += std::to_string(i*0.1); + phaseCurveList += std::to_string(i*0.3); } algOtherFormat += phaseList; diff --git a/isis/src/base/objs/MinnaertEmpirical/unitTest.cpp b/isis/src/base/objs/MinnaertEmpirical/unitTest.cpp index ac469bb13a..3b2d834f1b 100755 --- a/isis/src/base/objs/MinnaertEmpirical/unitTest.cpp +++ b/isis/src/base/objs/MinnaertEmpirical/unitTest.cpp @@ -81,9 +81,9 @@ int main() { PvlKeyword phaseCurveList("PhaseCurveList"); for (int i=0; i < 15; i++) { - phaseList += QString::number(i*10); - kList += QString::number(i*0.1); - phaseCurveList += QString::number(i*0.3); + phaseList += std::to_string(i*10); + kList += std::to_string(i*0.1); + phaseCurveList += std::to_string(i*0.3); } algOtherFormat += phaseList; diff --git a/isis/src/base/objs/Mollweide/unitTest.cpp b/isis/src/base/objs/Mollweide/unitTest.cpp index f10f22cd49..e6e2b4a985 100644 --- a/isis/src/base/objs/Mollweide/unitTest.cpp +++ b/isis/src/base/objs/Mollweide/unitTest.cpp @@ -27,15 +27,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(0.7071067811865475)); - mapGroup += PvlKeyword("PolarRadius", toString(0.7071067811865475)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(0.7071067811865475)); + mapGroup += PvlKeyword("PolarRadius", std::to_string(0.7071067811865475)); mapGroup += PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(180.0)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGroup += PvlKeyword("MinimumLatitude", std::to_string(-90.0)); + mapGroup += PvlKeyword("MaximumLatitude", std::to_string(90.0)); + mapGroup += PvlKeyword("MinimumLongitude", std::to_string(-180.0)); + mapGroup += PvlKeyword("MaximumLongitude", std::to_string(180.0)); mapGroup += PvlKeyword("ProjectionName", "Mollweide"); @@ -50,7 +50,7 @@ try { cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(0.0)); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); diff --git a/isis/src/base/objs/ObliqueCylindrical/unitTest.cpp b/isis/src/base/objs/ObliqueCylindrical/unitTest.cpp index 44e99816f8..08fcc3d256 100644 --- a/isis/src/base/objs/ObliqueCylindrical/unitTest.cpp +++ b/isis/src/base/objs/ObliqueCylindrical/unitTest.cpp @@ -76,15 +76,15 @@ int main(int argc, char *argv[]) { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); cout << "Test X,Y,Z Axis Vector Calculations ... " << endl; - cout << "Map Group Data (X[0]): " << toDouble(mapGrp["XAxisVector"][0]) << endl; - cout << "Map Group Data (X[1]): " << toDouble(mapGrp["XAxisVector"][1]) << endl; - cout << "Map Group Data (X[2]): " << toDouble(mapGrp["XAxisVector"][2]) << endl; - cout << "Map Group Data (Y[0]): " << toDouble(mapGrp["YAxisVector"][0]) << endl; - cout << "Map Group Data (Y[1]): " << toDouble(mapGrp["YAxisVector"][1]) << endl; - cout << "Map Group Data (Y[2]): " << toDouble(mapGrp["YAxisVector"][2]) << endl; - cout << "Map Group Data (Z[0]): " << toDouble(mapGrp["ZAxisVector"][0]) << endl; - cout << "Map Group Data (Z[1]): " << toDouble(mapGrp["ZAxisVector"][1]) << endl; - cout << "Map Group Data (Z[2]): " << toDouble(mapGrp["ZAxisVector"][2]) << endl; + cout << "Map Group Data (X[0]): " << std::stod(mapGrp["XAxisVector"][0]) << endl; + cout << "Map Group Data (X[1]): " << std::stod(mapGrp["XAxisVector"][1]) << endl; + cout << "Map Group Data (X[2]): " << std::stod(mapGrp["XAxisVector"][2]) << endl; + cout << "Map Group Data (Y[0]): " << std::stod(mapGrp["YAxisVector"][0]) << endl; + cout << "Map Group Data (Y[1]): " << std::stod(mapGrp["YAxisVector"][1]) << endl; + cout << "Map Group Data (Y[2]): " << std::stod(mapGrp["YAxisVector"][2]) << endl; + cout << "Map Group Data (Z[0]): " << std::stod(mapGrp["ZAxisVector"][0]) << endl; + cout << "Map Group Data (Z[1]): " << std::stod(mapGrp["ZAxisVector"][1]) << endl; + cout << "Map Group Data (Z[2]): " << std::stod(mapGrp["ZAxisVector"][2]) << endl; cout << endl; const double X = -2646.237039, Y = -537.814519; diff --git a/isis/src/base/objs/ObservationNumber/unitTest.cpp b/isis/src/base/objs/ObservationNumber/unitTest.cpp index 252cfbd6ad..b50c63f487 100644 --- a/isis/src/base/objs/ObservationNumber/unitTest.cpp +++ b/isis/src/base/objs/ObservationNumber/unitTest.cpp @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) { Preference::Preferences(true); FileName file("$ISISTESTDATA/isis/src/lo/unitTestData/3133_h1.cub"); - Pvl p1(file.expanded()); + Pvl p1(file.expanded().toStdString()); cout << ObservationNumber::Compose(p1) << endl; diff --git a/isis/src/base/objs/Orthographic/unitTest.cpp b/isis/src/base/objs/Orthographic/unitTest.cpp index 4ac8800c19..8b59b7e8ca 100644 --- a/isis/src/base/objs/Orthographic/unitTest.cpp +++ b/isis/src/base/objs/Orthographic/unitTest.cpp @@ -167,10 +167,10 @@ int main(int argc, char *argv[]) { QList lon; foreach (lon, lonInfo) { try { - mapGroup.findKeyword("MinimumLongitude").setValue(lon[0]); - mapGroup.findKeyword("MaximumLongitude").setValue(lon[1]); - mapGroup.findKeyword("CenterLongitude").setValue(lon[2]); - mapGroup.findKeyword("LongitudeDomain").setValue(lon[3]); + mapGroup.findKeyword("MinimumLongitude").setValue(lon[0].toStdString()); + mapGroup.findKeyword("MaximumLongitude").setValue(lon[1].toStdString()); + mapGroup.findKeyword("CenterLongitude").setValue(lon[2].toStdString()); + mapGroup.findKeyword("LongitudeDomain").setValue(lon[3].toStdString()); r = Orthographic(lab); r.XYRange(minX, maxX, minY, maxY); cout << "Lon Range: [" << r.MinimumLongitude() << ", " diff --git a/isis/src/base/objs/Planar/unitTest.cpp b/isis/src/base/objs/Planar/unitTest.cpp index 1fe10b1b9a..2e9fc672ec 100644 --- a/isis/src/base/objs/Planar/unitTest.cpp +++ b/isis/src/base/objs/Planar/unitTest.cpp @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) { cout << "Projection 1 parameters..." << endl; cout << "Projection version = " << p->Version() << endl; cout << " Projection name = " << p->Name() << endl; - cout << " Target name = " << (QString) mapGroup["TargetName"] << endl; + cout << " Target name = " << (std::string) mapGroup["TargetName"] << endl; cout << " RingLongitude direction = " << p->RingLongitudeDirectionString() << endl; cout << " RingLongitude domain = " << p->RingLongitudeDomainString() << endl; cout << " Minimum ring radius = " << p->MinimumRingRadius() << endl; @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) { // Projection 3 test cout << "Projection 3 parameters..." << endl; cout << " Projection name = " << p3.Name() << endl; - cout << " Target name = " << (QString) mapGroup["TargetName"] << endl; + cout << " Target name = " << (std::string) mapGroup["TargetName"] << endl; cout << " RingLongitude direction = " << p3.RingLongitudeDirectionString() << endl; cout << " RingLongitude domain = " << p3.RingLongitudeDomainString() << endl; cout << " Minimum ring radius = " << p3.MinimumRingRadius() << endl; @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) { Planar p4(lab, true); cout << "Projection 4 parameters...No range" << endl; cout << " Projection name = " << p4.Name() << endl; - cout << " Target name = " << (QString) mapGroup["TargetName"] << endl; + cout << " Target name = " << (std::string) mapGroup["TargetName"] << endl; cout << " RingLongitude direction = " << p4.RingLongitudeDirectionString() << endl; cout << " RingLongitude domain = " << p4.RingLongitudeDomainString() << endl; cout << " Center ring radius = " << p4.CenterRingRadius() << endl; diff --git a/isis/src/base/objs/PointPerspective/unitTest.cpp b/isis/src/base/objs/PointPerspective/unitTest.cpp index 13074ac14c..87e8079d12 100644 --- a/isis/src/base/objs/PointPerspective/unitTest.cpp +++ b/isis/src/base/objs/PointPerspective/unitTest.cpp @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGroup += PvlKeyword("PolarRadius", toString(1.0)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(1.0)); + mapGroup += PvlKeyword("PolarRadius", std::to_string(1.0)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(0.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(80.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(0.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(80.0)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGroup += PvlKeyword("MinimumLatitude", std::to_string(0.0)); + mapGroup += PvlKeyword("MaximumLatitude", std::to_string(80.0)); + mapGroup += PvlKeyword("MinimumLongitude", std::to_string(0.0)); + mapGroup += PvlKeyword("MaximumLongitude", std::to_string(80.0)); mapGroup += PvlKeyword("ProjectionName", "PointPerspective"); cout << "Test missing center longitude keyword ..." << endl; @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(0.0)); cout << "Test missing center latitude keyword..." << endl; try { @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLatitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(0.0)); cout << "Test missing distance keyword..." << endl; try { @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("Distance", toString(.00562)); + mapGroup += PvlKeyword("Distance", std::to_string(.00562)); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); @@ -168,18 +168,18 @@ int main(int argc, char *argv[]) { Pvl lab1; lab1.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab1.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(6371000)); - mapGroup+= PvlKeyword("PolarRadius",toString(6371000)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(6371000)); + mapGroup+= PvlKeyword("PolarRadius",std::to_string(6371000)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(180.0)); - mapGroup += PvlKeyword("CenterLongitude", toString(-77.0)); - mapGroup += PvlKeyword("CenterLatitude", toString(39.0)); - mapGroup += PvlKeyword("Distance", toString(500000)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGroup += PvlKeyword("MinimumLatitude", std::to_string(-90.0)); + mapGroup += PvlKeyword("MaximumLatitude", std::to_string(90.0)); + mapGroup += PvlKeyword("MinimumLongitude", std::to_string(-180.0)); + mapGroup += PvlKeyword("MaximumLongitude", std::to_string(180.0)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(-77.0)); + mapGroup += PvlKeyword("CenterLatitude", std::to_string(39.0)); + mapGroup += PvlKeyword("Distance", std::to_string(500000)); mapGroup += PvlKeyword("ProjectionName", "PointPerspective"); TProjection *p1 = (TProjection *) ProjectionFactory::Create(lab1); diff --git a/isis/src/base/objs/PolarStereographic/unitTest.cpp b/isis/src/base/objs/PolarStereographic/unitTest.cpp index 3cebff961e..056f5b64b7 100644 --- a/isis/src/base/objs/PolarStereographic/unitTest.cpp +++ b/isis/src/base/objs/PolarStereographic/unitTest.cpp @@ -24,15 +24,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mg = lab.findGroup("Mapping"); - mg += PvlKeyword("EquatorialRadius", toString(6378388.0)); - mg += PvlKeyword("PolarRadius", toString(6356911.9)); + mg += PvlKeyword("EquatorialRadius", std::to_string(6378388.0)); + mg += PvlKeyword("PolarRadius", std::to_string(6356911.9)); mg += PvlKeyword("LatitudeType", "Planetographic"); mg += PvlKeyword("LongitudeDirection", "PositiveEast"); - mg += PvlKeyword("LongitudeDomain", toString(180)); - mg += PvlKeyword("MinimumLatitude", toString(-90.0)); - mg += PvlKeyword("MaximumLatitude", toString(0.0)); - mg += PvlKeyword("MinimumLongitude", toString(-180.0)); - mg += PvlKeyword("MaximumLongitude", toString(180.0)); + mg += PvlKeyword("LongitudeDomain", std::to_string(180)); + mg += PvlKeyword("MinimumLatitude", std::to_string(-90.0)); + mg += PvlKeyword("MaximumLatitude", std::to_string(0.0)); + mg += PvlKeyword("MinimumLongitude", std::to_string(-180.0)); + mg += PvlKeyword("MaximumLongitude", std::to_string(180.0)); mg += PvlKeyword("ProjectionName", "PolarStereographic"); @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) { e.print(); } cout << endl; - mg += PvlKeyword("CenterLongitude", toString(-100.0)); + mg += PvlKeyword("CenterLongitude", std::to_string(-100.0)); cout << "Test missing center latitude keyword ..." << endl; try { @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) { } cout << endl; cout << "Test invalid center latitude keyword ..." << endl; - mg += PvlKeyword("CenterLatitude", toString(0.0)); + mg += PvlKeyword("CenterLatitude", std::to_string(0.0)); try { PolarStereographic p(lab); } @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) { e.print(); } cout << endl; - mg.addKeyword(PvlKeyword("CenterLatitude", toString(-71.0)), PvlGroup::Replace); + mg.addKeyword(PvlKeyword("CenterLatitude", std::to_string(-71.0)), PvlGroup::Replace); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); diff --git a/isis/src/base/objs/ProcessExportPds4/unitTest.cpp b/isis/src/base/objs/ProcessExportPds4/unitTest.cpp index cfc583d9c9..7c2227f996 100644 --- a/isis/src/base/objs/ProcessExportPds4/unitTest.cpp +++ b/isis/src/base/objs/ProcessExportPds4/unitTest.cpp @@ -199,7 +199,7 @@ void IsisMain() { e.print(); } - QString cassisTarget = instGroup["targetName"]; + QString cassisTarget = QString::fromStdString(instGroup["targetName"]); try { std::cout << "Test a missing target" << std::endl; ProcessExportPds4 testProcess; @@ -213,7 +213,7 @@ void IsisMain() { cout << endl; cout << endl; } - instGroup.addKeyword( PvlKeyword("targetName", cassisTarget) ); + instGroup.addKeyword( PvlKeyword("targetName", cassisTarget.toStdString()) ); } catch(Isis::IException &e) { e.print(); diff --git a/isis/src/base/objs/ProcessMapMosaic/unitTest.cpp b/isis/src/base/objs/ProcessMapMosaic/unitTest.cpp index 403007334a..ff5fe05bc3 100644 --- a/isis/src/base/objs/ProcessMapMosaic/unitTest.cpp +++ b/isis/src/base/objs/ProcessMapMosaic/unitTest.cpp @@ -113,10 +113,10 @@ void IsisMain() { inCube.open(inputFile); PvlGroup mapGroup = inCube.label()->findGroup("Mapping", Pvl::Traverse); - mapGroup.addKeyword(PvlKeyword("MinimumLatitude", toString(-4.9)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MaximumLatitude", toString(-4.7)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MinimumLongitude", toString(30.7)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MaximumLongitude", toString(31)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(-4.9)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(-4.7)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(30.7)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(31)), Pvl::Replace); inCube.close(); CubeAttributeOutput oAtt2( FileName("./unitTest3.cub") ); diff --git a/isis/src/base/objs/ProcessMosaic/unitTest.cpp b/isis/src/base/objs/ProcessMosaic/unitTest.cpp index ff89827f9c..e0cb79463c 100644 --- a/isis/src/base/objs/ProcessMosaic/unitTest.cpp +++ b/isis/src/base/objs/ProcessMosaic/unitTest.cpp @@ -349,10 +349,10 @@ void IsisMain() { qDebug() << "********* Test imagePositions() ********"; for (int i = 0; i <= m11.imagePositions().groups() - 1; i++) { - qDebug() << "Name: " << m11.imagePositions().group(i).name(); - qDebug() << "File: " << FileName(m11.imagePositions().group(i).findKeyword("File")[0]).name(); - qDebug() << "StartSample: " << m11.imagePositions().group(i).findKeyword("StartSample")[0]; - qDebug() << "StartLine: " << m11.imagePositions().group(i).findKeyword("StartLine")[0]; + qDebug() << "Name: " << QString::fromStdString(m11.imagePositions().group(i).name()); + qDebug() << "File: " << FileName(QString::fromStdString(m11.imagePositions().group(i).findKeyword("File")[0])).name(); + qDebug() << "StartSample: " << QString::fromStdString(m11.imagePositions().group(i).findKeyword("StartSample")[0]); + qDebug() << "StartLine: " << QString::fromStdString(m11.imagePositions().group(i).findKeyword("StartLine")[0]); } qDebug() << "***********************************************************************************"; diff --git a/isis/src/base/objs/Projection/unitTest.cpp b/isis/src/base/objs/Projection/unitTest.cpp index cd173c28fc..4687a0b254 100644 --- a/isis/src/base/objs/Projection/unitTest.cpp +++ b/isis/src/base/objs/Projection/unitTest.cpp @@ -40,26 +40,26 @@ class MyProjectionType : public Projection { // Get the LatitudeType - if ((QString) m_mappingGrp["LatitudeType"] == "Planetographic") { + if ((std::string) m_mappingGrp["LatitudeType"] == "Planetographic") { m_latitudeType = Planetographic; } - else if ((QString) m_mappingGrp["LatitudeType"] == "Planetocentric") { + else if ((std::string) m_mappingGrp["LatitudeType"] == "Planetocentric") { m_latitudeType = Planetocentric; } // Get the LongitudeDirection - if ((QString) m_mappingGrp["LongitudeDirection"] == "PositiveWest") { + if ((std::string) m_mappingGrp["LongitudeDirection"] == "PositiveWest") { m_longitudeDirection = PositiveWest; } - else if ((QString) m_mappingGrp["LongitudeDirection"] == "PositiveEast") { + else if ((std::string) m_mappingGrp["LongitudeDirection"] == "PositiveEast") { m_longitudeDirection = PositiveEast; } // Get the LongitudeDomain - if ((QString) m_mappingGrp["LongitudeDomain"] == "360") { + if ((std::string) m_mappingGrp["LongitudeDomain"] == "360") { m_longitudeDomain = 360; } - else if ((QString) m_mappingGrp["LongitudeDomain"] == "180") { + else if ((std::string) m_mappingGrp["LongitudeDomain"] == "180") { m_longitudeDomain = 180; } @@ -460,7 +460,7 @@ int main(int argc, char *argv[]) { cout << endl; cout << "Test == operator with pixel resolutions not matching, but names do" << endl; - mg += PvlKeyword("PixelResolution", toString(2.0)); + mg += PvlKeyword("PixelResolution", std::to_string(2.0)); MyProjection pMy3(lab); pMy3.SetWorldMapper(new MyMapper()); cout << "Projection 1 resolution = " << p.Resolution() << endl; @@ -529,18 +529,18 @@ int main(int argc, char *argv[]) { Isis::PvlGroup &latTestGroup = latRangeTest.findGroup("Mapping"); latTestGroup += Isis::PvlKeyword("TargetName", "Moon"); latTestGroup += Isis::PvlKeyword("ProjectionName", "PolarStereographic"); - latTestGroup += Isis::PvlKeyword("EquatorialRadius", toString(1737400.0)); - latTestGroup += Isis::PvlKeyword("PolarRadius", toString(1737400.0)); + latTestGroup += Isis::PvlKeyword("EquatorialRadius", std::to_string(1737400.0)); + latTestGroup += Isis::PvlKeyword("PolarRadius", std::to_string(1737400.0)); latTestGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); latTestGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - latTestGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); - latTestGroup += Isis::PvlKeyword("Scale", toString(5.0)); - latTestGroup += Isis::PvlKeyword("MinimumLatitude", toString(-90.0)); - latTestGroup += Isis::PvlKeyword("MaximumLatitude", toString(-45.0)); - latTestGroup += Isis::PvlKeyword("MinimumLongitude", toString(0.0)); - latTestGroup += Isis::PvlKeyword("MaximumLongitude", toString(360.0)); - latTestGroup += Isis::PvlKeyword("CenterLatitude", toString(-90.0)); - latTestGroup += Isis::PvlKeyword("CenterLongitude", toString(0.0)); + latTestGroup += Isis::PvlKeyword("LongitudeDomain", std::to_string(360)); + latTestGroup += Isis::PvlKeyword("Scale", std::to_string(5.0)); + latTestGroup += Isis::PvlKeyword("MinimumLatitude", std::to_string(-90.0)); + latTestGroup += Isis::PvlKeyword("MaximumLatitude", std::to_string(-45.0)); + latTestGroup += Isis::PvlKeyword("MinimumLongitude", std::to_string(0.0)); + latTestGroup += Isis::PvlKeyword("MaximumLongitude", std::to_string(360.0)); + latTestGroup += Isis::PvlKeyword("CenterLatitude", std::to_string(-90.0)); + latTestGroup += Isis::PvlKeyword("CenterLongitude", std::to_string(0.0)); Isis::Projection &latTestProjection = *Isis::ProjectionFactory::Create(latRangeTest); cout << "PolarStereographic Projection Specifications" << endl; @@ -654,7 +654,7 @@ int main(int argc, char *argv[]) { cout << endl; cout << "Rotation Tests" << endl; - mg += PvlKeyword("Rotation", toString(90.0)); + mg += PvlKeyword("Rotation", std::to_string(90.0)); mg["LongitudeDirection"] = "PositiveEast"; mg.deleteKeyword("EquatorialRadius"); mg.deleteKeyword("PolarRadius"); diff --git a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp index 94bb8a9934..24c0cf2b2f 100644 --- a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp +++ b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp @@ -837,7 +837,7 @@ namespace Isis { Displacement(upperLeftY, Displacement::Meters)); } catch(IException &e) { - QString msg = "Unable to create projection"; + std::string msg = "Unable to create projection"; if (label.fileName() != "") msg += " from file [" + label.fileName() + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -895,9 +895,9 @@ namespace Isis { pixelResolution = (2.0 * Isis::PI * localRadius) / (360.0 * scale); } // Write out the scale and resolution with units and truescale radius - mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", toString(pixelResolution), + mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", std::to_string(pixelResolution), "meters/pixel"), Isis::Pvl::Replace); - mapGroup.addKeyword(Isis::PvlKeyword("Scale", toString(scale), "pixels/degree"), + mapGroup.addKeyword(Isis::PvlKeyword("Scale", std::to_string(scale), "pixels/degree"), Isis::Pvl::Replace); // Initialize the rest of the projection @@ -1019,11 +1019,11 @@ namespace Isis { // Set the upper left corner and add to the labels double upperLeftX = minX; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", toString(upperLeftX)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", std::to_string(upperLeftX)), Isis::Pvl::Replace); double upperLeftY = maxY; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", toString(upperLeftY)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", std::to_string(upperLeftY)), Isis::Pvl::Replace); // Make sure labels have good units @@ -1051,7 +1051,7 @@ namespace Isis { Displacement(upperLeftY, Displacement::Meters)); } catch(IException &e) { - QString msg = "Unable to create projection"; + std::string msg = "Unable to create projection"; if (label.fileName() != "") msg += " from file [" + label.fileName() + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -1114,7 +1114,7 @@ namespace Isis { Displacement(upperLeftY, Displacement::Meters)); } catch (IException &e) { - QString msg = "Unable to initialize cube projection"; + std::string msg = "Unable to initialize cube projection"; if (label.fileName() != "") msg += " from file [" + label.fileName() + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -1153,7 +1153,7 @@ namespace Isis { Displacement(upperLeftY, Displacement::Meters)); } catch (IException &e) { - QString msg = "Unable to initialize cube projection"; + std::string msg = "Unable to initialize cube projection"; if (label.fileName() != "") msg += " from file [" + label.fileName() + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProjectionFactory/unitTest.cpp b/isis/src/base/objs/ProjectionFactory/unitTest.cpp index 68a575bd9e..33042c6fa6 100644 --- a/isis/src/base/objs/ProjectionFactory/unitTest.cpp +++ b/isis/src/base/objs/ProjectionFactory/unitTest.cpp @@ -29,29 +29,29 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(3396190.0)); - mapGroup += PvlKeyword("PolarRadius", toString(3376200.0)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(3396190.0)); + mapGroup += PvlKeyword("PolarRadius", std::to_string(3376200.0)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(360)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(360)); mapGroup += PvlKeyword("ProjectionName", "SimpleCylindrical"); - mapGroup += PvlKeyword("CenterLongitude", toString(220.0)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(220.0)); cout << "Test for missing pixel resolution ... " << endl; doit(lab); doit2(lab); - mapGroup += PvlKeyword("PixelResolution", toString(2000.0)); + mapGroup += PvlKeyword("PixelResolution", std::to_string(2000.0)); cout << "Test for missing upper left X ... " << endl; doit(lab); - mapGroup += PvlKeyword("UpperLeftCornerX", toString(-18000.0)); + mapGroup += PvlKeyword("UpperLeftCornerX", std::to_string(-18000.0)); cout << "Test for missing upper left Y ... " << endl; doit(lab); - mapGroup += PvlKeyword("UpperLeftCornerY", toString(2062000.0)); + mapGroup += PvlKeyword("UpperLeftCornerY", std::to_string(2062000.0)); cout << "Testing conversion from image to ground ... " << endl; TProjection *proj = (TProjection *) ProjectionFactory::CreateFromCube(lab); @@ -70,10 +70,10 @@ int main(int argc, char *argv[]) { cout << "Testing missing ground range on create method ... " << endl; doit2(lab); - mapGroup += PvlKeyword("MinimumLatitude", toString(10.8920539924144)); - mapGroup += PvlKeyword("MaximumLatitude", toString(34.7603960060206)); - mapGroup += PvlKeyword("MinimumLongitude", toString(219.72432466275)); - mapGroup += PvlKeyword("MaximumLongitude", toString(236.186050244411)); + mapGroup += PvlKeyword("MinimumLatitude", std::to_string(10.8920539924144)); + mapGroup += PvlKeyword("MaximumLatitude", std::to_string(34.7603960060206)); + mapGroup += PvlKeyword("MinimumLongitude", std::to_string(219.72432466275)); + mapGroup += PvlKeyword("MaximumLongitude", std::to_string(236.186050244411)); mapGroup.deleteKeyword("UpperLeftCornerX"); mapGroup.deleteKeyword("UpperLeftCornerY"); @@ -87,15 +87,15 @@ int main(int argc, char *argv[]) { cout << endl; cout << "Testing create method with existing cube labels" << endl; - mapGroup.addKeyword(PvlKeyword("UpperLeftCornerX", toString(-16000.0)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("UpperLeftCornerY", toString(2060000.0)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("UpperLeftCornerX", std::to_string(-16000.0)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("UpperLeftCornerY", std::to_string(2060000.0)), Pvl::Replace); Pvl lab2; PvlObject icube("IsisCube"); PvlObject core("Core"); PvlGroup dims("Dimensions"); - dims += PvlKeyword("Lines", toString(400)); - dims += PvlKeyword("Samples", toString(600)); + dims += PvlKeyword("Lines", std::to_string(400)); + dims += PvlKeyword("Samples", std::to_string(600)); core.addGroup(dims); icube.addObject(core); icube.addGroup(mapGroup); @@ -121,18 +121,18 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(3396190.0)); - mapGroup += PvlKeyword("PolarRadius", toString(3376200.0)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(3396190.0)); + mapGroup += PvlKeyword("PolarRadius", std::to_string(3376200.0)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(360)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(360)); mapGroup += PvlKeyword("ProjectionName", "UnsupportedProjection"); - mapGroup += PvlKeyword("CenterLongitude", toString(220.0)); - mapGroup += PvlKeyword("PixelResolution", toString(2000.0)); - mapGroup += PvlKeyword("UpperLeftCornerX", toString(-18000.0)); - mapGroup += PvlKeyword("UpperLeftCornerY", toString(2062000.0)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(220.0)); + mapGroup += PvlKeyword("PixelResolution", std::to_string(2000.0)); + mapGroup += PvlKeyword("UpperLeftCornerX", std::to_string(-18000.0)); + mapGroup += PvlKeyword("UpperLeftCornerY", std::to_string(2062000.0)); TProjection *proj = (TProjection *) ProjectionFactory::Create(lab); proj->SetWorld(245.0, 355.0); @@ -152,18 +152,18 @@ int main(int argc, char *argv[]) { southMap.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroupSouth = southMap.findGroup("Mapping"); mapGroupSouth += PvlKeyword("ProjectionName", "Equirectangular"); - mapGroupSouth += PvlKeyword("CenterLongitude", toString(0.0)); - mapGroupSouth += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroupSouth += PvlKeyword("EquatorialRadius", toString(13400.0)); - mapGroupSouth += PvlKeyword("PolarRadius", toString(9200.0)); + mapGroupSouth += PvlKeyword("CenterLongitude", std::to_string(0.0)); + mapGroupSouth += PvlKeyword("CenterLatitude", std::to_string(0.0)); + mapGroupSouth += PvlKeyword("EquatorialRadius", std::to_string(13400.0)); + mapGroupSouth += PvlKeyword("PolarRadius", std::to_string(9200.0)); mapGroupSouth += PvlKeyword("LatitudeType", "Planetocentric"); mapGroupSouth += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroupSouth += PvlKeyword("LongitudeDomain", toString(360)); - mapGroupSouth += PvlKeyword("MinimumLatitude", toString(-60.0)); - mapGroupSouth += PvlKeyword("MaximumLatitude", toString(0.0)); - mapGroupSouth += PvlKeyword("MinimumLongitude", toString(0.0)); - mapGroupSouth += PvlKeyword("MaximumLongitude", toString(360.0)); - mapGroupSouth += PvlKeyword("PixelResolution", toString(10.0)); + mapGroupSouth += PvlKeyword("LongitudeDomain", std::to_string(360)); + mapGroupSouth += PvlKeyword("MinimumLatitude", std::to_string(-60.0)); + mapGroupSouth += PvlKeyword("MaximumLatitude", std::to_string(0.0)); + mapGroupSouth += PvlKeyword("MinimumLongitude", std::to_string(0.0)); + mapGroupSouth += PvlKeyword("MaximumLongitude", std::to_string(360.0)); + mapGroupSouth += PvlKeyword("PixelResolution", std::to_string(10.0)); Pvl northMap; @@ -171,18 +171,18 @@ int main(int argc, char *argv[]) { northMap.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroupNorth = northMap.findGroup("Mapping"); mapGroupNorth += PvlKeyword("ProjectionName", "Equirectangular"); - mapGroupNorth += PvlKeyword("CenterLongitude", toString(0.0)); - mapGroupNorth += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroupNorth += PvlKeyword("EquatorialRadius", toString(13400.0)); - mapGroupNorth += PvlKeyword("PolarRadius", toString(9200.0)); + mapGroupNorth += PvlKeyword("CenterLongitude", std::to_string(0.0)); + mapGroupNorth += PvlKeyword("CenterLatitude", std::to_string(0.0)); + mapGroupNorth += PvlKeyword("EquatorialRadius", std::to_string(13400.0)); + mapGroupNorth += PvlKeyword("PolarRadius", std::to_string(9200.0)); mapGroupNorth += PvlKeyword("LatitudeType", "Planetocentric"); mapGroupNorth += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroupNorth += PvlKeyword("LongitudeDomain", toString(360)); - mapGroupNorth += PvlKeyword("MinimumLatitude", toString(0.0)); - mapGroupNorth += PvlKeyword("MaximumLatitude", toString(60.0)); - mapGroupNorth += PvlKeyword("MinimumLongitude", toString(0.0)); - mapGroupNorth += PvlKeyword("MaximumLongitude", toString(360.0)); - mapGroupNorth += PvlKeyword("PixelResolution", toString(10.0)); + mapGroupNorth += PvlKeyword("LongitudeDomain", std::to_string(360)); + mapGroupNorth += PvlKeyword("MinimumLatitude", std::to_string(0.0)); + mapGroupNorth += PvlKeyword("MaximumLatitude", std::to_string(60.0)); + mapGroupNorth += PvlKeyword("MinimumLongitude", std::to_string(0.0)); + mapGroupNorth += PvlKeyword("MaximumLongitude", std::to_string(360.0)); + mapGroupNorth += PvlKeyword("PixelResolution", std::to_string(10.0)); TProjection *projNorth = (TProjection *) ProjectionFactory::CreateForCube(southMap, @@ -222,18 +222,18 @@ int main(int argc, char *argv[]) { eastMap.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroupEast = eastMap.findGroup("Mapping"); mapGroupEast += PvlKeyword("ProjectionName", "Equirectangular"); - mapGroupEast += PvlKeyword("CenterLongitude", toString(0.0)); - mapGroupEast += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroupEast += PvlKeyword("EquatorialRadius", toString(13400.0)); - mapGroupEast += PvlKeyword("PolarRadius", toString(9200.0)); + mapGroupEast += PvlKeyword("CenterLongitude", std::to_string(0.0)); + mapGroupEast += PvlKeyword("CenterLatitude", std::to_string(0.0)); + mapGroupEast += PvlKeyword("EquatorialRadius", std::to_string(13400.0)); + mapGroupEast += PvlKeyword("PolarRadius", std::to_string(9200.0)); mapGroupEast += PvlKeyword("LatitudeType", "Planetocentric"); mapGroupEast += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroupEast += PvlKeyword("LongitudeDomain", toString(360)); - mapGroupEast += PvlKeyword("MinimumLatitude", toString(0.0)); - mapGroupEast += PvlKeyword("MaximumLatitude", toString(60.0)); - mapGroupEast += PvlKeyword("MinimumLongitude", toString(0.0)); - mapGroupEast += PvlKeyword("MaximumLongitude", toString(90.0)); - mapGroupEast += PvlKeyword("PixelResolution", toString(10.0)); + mapGroupEast += PvlKeyword("LongitudeDomain", std::to_string(360)); + mapGroupEast += PvlKeyword("MinimumLatitude", std::to_string(0.0)); + mapGroupEast += PvlKeyword("MaximumLatitude", std::to_string(60.0)); + mapGroupEast += PvlKeyword("MinimumLongitude", std::to_string(0.0)); + mapGroupEast += PvlKeyword("MaximumLongitude", std::to_string(90.0)); + mapGroupEast += PvlKeyword("PixelResolution", std::to_string(10.0)); Pvl westMap; @@ -241,18 +241,18 @@ int main(int argc, char *argv[]) { westMap.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroupWest = westMap.findGroup("Mapping"); mapGroupWest += PvlKeyword("ProjectionName", "Equirectangular"); - mapGroupWest += PvlKeyword("CenterLongitude", toString(0.0)); - mapGroupWest += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroupWest += PvlKeyword("EquatorialRadius", toString(13400.0)); - mapGroupWest += PvlKeyword("PolarRadius", toString(9200.0)); + mapGroupWest += PvlKeyword("CenterLongitude", std::to_string(0.0)); + mapGroupWest += PvlKeyword("CenterLatitude", std::to_string(0.0)); + mapGroupWest += PvlKeyword("EquatorialRadius", std::to_string(13400.0)); + mapGroupWest += PvlKeyword("PolarRadius", std::to_string(9200.0)); mapGroupWest += PvlKeyword("LatitudeType", "Planetocentric"); mapGroupWest += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroupWest += PvlKeyword("LongitudeDomain", toString(360)); - mapGroupWest += PvlKeyword("MinimumLatitude", toString(0.0)); - mapGroupWest += PvlKeyword("MaximumLatitude", toString(60.0)); - mapGroupWest += PvlKeyword("MinimumLongitude", toString(-90.0)); - mapGroupWest += PvlKeyword("MaximumLongitude", toString(0.0)); - mapGroupWest += PvlKeyword("PixelResolution", toString(10.0)); + mapGroupWest += PvlKeyword("LongitudeDomain", std::to_string(360)); + mapGroupWest += PvlKeyword("MinimumLatitude", std::to_string(0.0)); + mapGroupWest += PvlKeyword("MaximumLatitude", std::to_string(60.0)); + mapGroupWest += PvlKeyword("MinimumLongitude", std::to_string(-90.0)); + mapGroupWest += PvlKeyword("MaximumLongitude", std::to_string(0.0)); + mapGroupWest += PvlKeyword("PixelResolution", std::to_string(10.0)); TProjection *projEast = (TProjection *) ProjectionFactory::CreateForCube(eastMap, diff --git a/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp index d6cbd28595..b2fce9a6cd 100644 --- a/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp +++ b/isis/src/base/objs/PvlToXmlTranslationManager/PvlToXmlTranslationManager.cpp @@ -109,9 +109,9 @@ namespace Isis { while((grp = InputGroup(transGroupName, inst++)).name() != "") { if((con = GetContainer(grp)) != NULL) { - if(con->hasKeyword(InputKeywordName(transGroupName))) { + if(con->hasKeyword(InputKeywordName(transGroupName).toStdString())) { return PvlTranslationTable::Translate( - transGroupName, (*con)[InputKeywordName(transGroupName)][inputIndex]); + transGroupName, QString::fromStdString((*con)[InputKeywordName(transGroupName).toStdString()][inputIndex])); } } } @@ -134,25 +134,25 @@ namespace Isis { QDomElement &parentElement) { int inst = 0; - QString transGroupName = transGroup.name(); + QString transGroupName = QString::fromStdString(transGroup.name()); PvlKeyword grp = InputGroup(transGroupName, inst); while (grp.name() != "") { const PvlContainer *con = GetContainer(grp); if (con != NULL) { - if (con->hasKeyword(InputKeywordName(transGroupName))) { + if (con->hasKeyword(InputKeywordName(transGroupName).toStdString())) { QStringList outputName = parseSpecification(OutputName(transGroupName)); // Get the InputKey from the input label. - PvlKeyword inputKeyword = (*con)[InputKeywordName(transGroupName)]; + PvlKeyword inputKeyword = (*con)[InputKeywordName(transGroupName).toStdString()]; // Translate input keyword value and set the qdomelement // NOTE: We are assuming this is a single valued keyword since // xml does not allow multiple values - QString untranslatedValue = inputKeyword[0]; + QString untranslatedValue = QString::fromStdString(inputKeyword[0]); QString translatedValue = PvlTranslationTable::Translate(transGroupName, untranslatedValue); - QString units = inputKeyword.unit(); + QString units = QString::fromStdString(inputKeyword.unit()); if (outputName.size() == 2 && outputName[0] == "att") { parentElement.setAttribute(outputName[1], translatedValue); if (transGroup.hasKeyword("OutputAttributes")) { @@ -262,8 +262,8 @@ namespace Isis { if(containingGroup != NULL) { anInputGroupFound = true; - if(containingGroup->hasKeyword(InputKeywordName(transGroupName))) { - return containingGroup->findKeyword(InputKeywordName(transGroupName)); + if(containingGroup->hasKeyword(InputKeywordName(transGroupName).toStdString())) { + return containingGroup->findKeyword(InputKeywordName(transGroupName).toStdString()); } } @@ -272,8 +272,8 @@ namespace Isis { } if(anInputGroupFound) { - QString msg = "Unable to find input keyword [" + InputKeywordName(transGroupName) + - "] for output name [" + transGroupName + "] in file [" + + std::string msg = "Unable to find input keyword [" + InputKeywordName(transGroupName).toStdString() + + "] for output name [" + transGroupName.toStdString() + "] in file [" + TranslationTable().fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -283,11 +283,11 @@ namespace Isis { for(int i = 0; i < InputGroup(transGroupName).size(); i++) { if(i > 0) container += ","; - container += InputGroup(transGroupName)[i]; + container += QString::fromStdString(InputGroup(transGroupName)[i]); } - QString msg = "Unable to find input group [" + container + "] for output name [" + - transGroupName + "] in file [" + TranslationTable().fileName() + "]"; + std::string msg = "Unable to find input group [" + container.toStdString() + "] for output name [" + + transGroupName.toStdString() + "] in file [" + TranslationTable().fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -311,7 +311,7 @@ namespace Isis { PvlKeyword grp; while((grp = InputGroup(transGroupName, inst++)).name() != "") { if((con = GetContainer(grp)) != NULL) { - if(con->hasKeyword(InputKeywordName(transGroupName))) return true; + if(con->hasKeyword(InputKeywordName(transGroupName).toStdString())) return true; } } @@ -386,7 +386,7 @@ namespace Isis { int i = 0; // Check if the root node (e.g. Product_Observational) exits in the OutputPosition values // If so, skip over that OutputPosition value so we don't add it as a child of itself - if (containers.size() > 0 && currentElement->tagName() == containers[0]) { + if (containers.size() > 0 && currentElement->tagName().toStdString() == containers[0]) { i = 1; } @@ -395,7 +395,7 @@ namespace Isis { // Parse current value in the OuputPosition // (i.e. parse into string tokens using "@" and ":" as delimiters) - QStringList specifications = parseSpecification(containers[i]); + QStringList specifications = parseSpecification(QString::fromStdString(containers[i])); bool addNewElement = false; // After parsing, if the first token is "new", then add a new child element @@ -411,14 +411,14 @@ namespace Isis { } // If the current element does not have a direct child with the name at containers[i] - else if (currentElement->namedItem(containers[i]).isNull()) { + else if (currentElement->namedItem(QString::fromStdString(containers[i])).isNull()) { QDomElement childElement = xmlRootElement.ownerDocument().createElement(specifications[0]); *currentElement = currentElement->appendChild(childElement).toElement(); } // Otherwise, if we are not requesting a container with @new, grab the child container else { - *currentElement = currentElement->firstChildElement(containers[i]); + *currentElement = currentElement->firstChildElement(QString::fromStdString(containers[i])); } i++; } @@ -441,10 +441,10 @@ namespace Isis { for (int i = 0; i < outputSiblings.size(); i++) { QStringList parsedSibling; parsedSibling.reserve(5); - parsedSibling = parseSpecification(outputSiblings[i]); + parsedSibling = parseSpecification(QString::fromStdString(outputSiblings[i])); if (parsedSibling.size() != 2) { // If the sibling does not have a tag name AND a tag value - QString msg = "Malformed OutputSibling [" + outputSiblings[i] + "]. OutputSiblings must" + + std::string msg = "Malformed OutputSibling [" + outputSiblings[i] + "]. OutputSiblings must" + " be in the form of tag|value"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -473,10 +473,10 @@ namespace Isis { QStringList parsedAttribute; for (int i = 0; i < outputAttributes.size(); i++) { - parsedAttribute = parseSpecification(outputAttributes[i]); + parsedAttribute = parseSpecification(QString::fromStdString(outputAttributes[i])); if (parsedAttribute.size() != 2) { - QString msg = "Malformed output attribute [" + outputAttributes[i] + + std::string msg = "Malformed output attribute [" + outputAttributes[i] + "]. OutputAttributes must be in the form of att@attribute_name|value"; throw IException(IException::Programmer,msg ,_FILEINFO_); } diff --git a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp index 3c19aecca7..c8ca94cafb 100644 --- a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp +++ b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp @@ -82,7 +82,7 @@ namespace Isis { * @param transFile The name of the translation file to be added. */ void PvlTranslationTable::AddTable(const QString &transFile) { - p_trnsTbl.read(FileName(transFile).expanded()); + p_trnsTbl.read(FileName(transFile).expanded().toStdString()); } @@ -110,7 +110,7 @@ namespace Isis { PvlGroup currGroup = p_trnsTbl.group(i); if (!currGroup.hasKeyword("InputKey")) { - QString message = "Unable to find InputKey for group [" + std::string message = "Unable to find InputKey for group [" + currGroup.name() + "] in file [" + p_trnsTbl.fileName() + "]"; throw IException(IException::User, message, _FILEINFO_); @@ -128,7 +128,7 @@ namespace Isis { key++) { // If this is the right keyword (names match) then test sizes - if (currKey.name() == validKeywordSizes[key].first) { + if (currKey.name() == validKeywordSizes[key].first.toStdString()) { // if -1 then test that size() > 0 if (validKeywordSizes[key].second == -1) { @@ -150,17 +150,17 @@ namespace Isis { // if we had an error report it if (!validKeyword) { if (!keywordSizeMismatch) { - QString message = "Keyword [" + currKey.name(); + std::string message = "Keyword [" + currKey.name(); message += "] is not a valid keyword."; message += " Error in file [" + p_trnsTbl.fileName() + "]" ; throw IException(IException::User, message, _FILEINFO_); } else { - QString message = "Keyword [" + currKey.name(); + std::string message = "Keyword [" + currKey.name(); message += "] does not have the correct number of elements."; message += " Error in file [" + p_trnsTbl.fileName() + "]" ; - + throw IException(IException::User, message, _FILEINFO_); } @@ -222,12 +222,12 @@ namespace Isis { QString tmpFValue = inputKeyValue; if (tmpFValue.isEmpty()) { if (translationGroup.hasKeyword("InputDefault")) { - tmpFValue = (QString) translationGroup["InputDefault"]; + tmpFValue = QString::fromStdString(translationGroup["InputDefault"]); } else { - QString msg = "No value or default value to translate for "; + std::string msg = "No value or default value to translate for "; msg += "translation group ["; - msg += translationGroupName; + msg += translationGroupName.toStdString(); msg += "] in file [" + p_trnsTbl.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -242,8 +242,8 @@ namespace Isis { 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) { - return key[0]; + if (QString::compare(QString::fromStdString(key[1]), tmpFValue, Qt::CaseInsensitive) == 0) { + return QString::fromStdString(key[0]); } else if ((std::string) key[1] == "*") { if ((std::string) key[0] == "*") { @@ -258,7 +258,7 @@ namespace Isis { } std::string msg = "Unable to find a translation value for [" + - translationGroupName.toStdString() + ", " + inputKeyValue + "] in file [" + + translationGroupName.toStdString() + ", " + inputKeyValue.toStdString() + "] in file [" + p_trnsTbl.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -542,7 +542,7 @@ namespace Isis { throw IException(IException::Programmer, msg, _FILEINFO_); } - return p_trnsTbl.findGroup(translationGroupName); + return p_trnsTbl.findGroup(translationGroupName.toStdString()); } } // end namespace isis diff --git a/isis/src/base/objs/RingCylindrical/unitTest.cpp b/isis/src/base/objs/RingCylindrical/unitTest.cpp index c11d4648b5..95b89d5790 100644 --- a/isis/src/base/objs/RingCylindrical/unitTest.cpp +++ b/isis/src/base/objs/RingCylindrical/unitTest.cpp @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) { cout << "Is equatorial cylindrical? = " << p->IsEquatorialCylindrical() << endl; cout << "Projection version = " << p->Version() << endl; cout << " Projection name = " << p->Name() << endl; - cout << " Target name = " << (QString) mapGrp["TargetName"] << endl; + cout << " Target name = " << (std::string) mapGrp["TargetName"] << endl; cout << " Ring Longitude direction = " << p->RingLongitudeDirectionString() << endl; cout << " Ring Longitude domain = " << p->RingLongitudeDomainString() << endl; cout << " Minimum ring radius = " << p->MinimumRingRadius() << endl; @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) { // Projection 3 test cout << "Projection 3 parameters..." << endl; cout << " Projection name = " << p3.Name() << endl; - cout << " Target name = " << (QString) mapGrp["TargetName"] << endl; + cout << " Target name = " << (std::string) mapGrp["TargetName"] << endl; cout << " Ring Longitude direction = " << p3.RingLongitudeDirectionString() << endl; cout << " Ring Longitude domain = " << p3.RingLongitudeDomainString() << endl; cout << " Minimum ring radius = " << p3.MinimumRingRadius() << endl; @@ -238,7 +238,7 @@ int main(int argc, char *argv[]) { RingCylindrical p4(lab, true); cout << "Projection 4 parameters...No range" << endl; cout << " Projection name = " << p4.Name() << endl; - cout << " Target name = " << (QString) mapGrp["TargetName"] << endl; + cout << " Target name = " << (std::string) mapGrp["TargetName"] << endl; cout << " Ring Longitude direction = " << p4.RingLongitudeDirectionString() << endl; cout << " Ring Longitude domain = " << p4.RingLongitudeDomainString() << endl; cout << " Center ring radius = " << p4.CenterRingRadius() << endl; diff --git a/isis/src/base/objs/Sensor/unitTest.cpp b/isis/src/base/objs/Sensor/unitTest.cpp index 73c3e03a02..301e6648d9 100644 --- a/isis/src/base/objs/Sensor/unitTest.cpp +++ b/isis/src/base/objs/Sensor/unitTest.cpp @@ -65,15 +65,15 @@ int main(int argc, char *argv[]) { QString dir = f.expanded() + "/"; kern += PvlKeyword("NaifFrameCode", "-94031"); - kern += PvlKeyword("LeapSecond", dir + "naif0007.tls"); - kern += PvlKeyword("SpacecraftClock", dir + "MGS_SCLKSCET.00045.tsc"); - kern += PvlKeyword("TargetPosition", dir + "de405.bsp"); - kern += PvlKeyword("TargetAttitudeShape", dir + "pck00006.tpc"); - kern += PvlKeyword("Instrument", dir + "mocSensorUnitTest.ti"); -// kern += PvlKeyword("InstrumentAddendum",dir+"mocAddendum.ti"); + kern += PvlKeyword("LeapSecond", dir.toStdString() + "naif0007.tls"); + kern += PvlKeyword("SpacecraftClock", dir.toStdString() + "MGS_SCLKSCET.00045.tsc"); + kern += PvlKeyword("TargetPosition", dir.toStdString() + "de405.bsp"); + kern += PvlKeyword("TargetAttitudeShape", dir.toStdString() + "pck00006.tpc"); + kern += PvlKeyword("Instrument", dir.toStdString() + "mocSensorUnitTest.ti"); +// kern += PvlKeyword("InstrumentAddendum",dir.toStdString()+"mocAddendum.ti"); kern += PvlKeyword("InstrumentAddendum", ""); - kern += PvlKeyword("InstrumentPosition", dir + "moc.bsp"); - kern += PvlKeyword("InstrumentPointing", dir + "moc.bc"); + kern += PvlKeyword("InstrumentPosition", dir.toStdString() + "moc.bsp"); + kern += PvlKeyword("InstrumentPointing", dir.toStdString() + "moc.bc"); kern += PvlKeyword("Frame", ""); lab.addGroup(kern); @@ -199,15 +199,15 @@ int main(int argc, char *argv[]) { kern.clear(); kern += PvlKeyword("NaifFrameCode", "-94031"); - kern += PvlKeyword("LeapSecond", dir + "naif0007.tls"); + kern += PvlKeyword("LeapSecond", dir.toStdString() + "naif0007.tls"); kern += PvlKeyword("SpacecraftClock", - dir + "MGS_SCLKSCET.00045.tsc"); - kern += PvlKeyword("TargetPosition", dir + "de405.bsp"); - kern += PvlKeyword("TargetAttitudeShape", dir + "pck00006.tpc"); - kern += PvlKeyword("Instrument", dir + "mocSensorUnitTest.ti"); + dir.toStdString() + "MGS_SCLKSCET.00045.tsc"); + kern += PvlKeyword("TargetPosition", dir.toStdString() + "de405.bsp"); + kern += PvlKeyword("TargetAttitudeShape", dir.toStdString() + "pck00006.tpc"); + kern += PvlKeyword("Instrument", dir.toStdString() + "mocSensorUnitTest.ti"); kern += PvlKeyword("InstrumentAddendum", ""); - kern += PvlKeyword("InstrumentPosition", dir + "moc.bsp"); - kern += PvlKeyword("InstrumentPointing", dir + "moc.bc"); + kern += PvlKeyword("InstrumentPosition", dir.toStdString() + "moc.bsp"); + kern += PvlKeyword("InstrumentPointing", dir.toStdString() + "moc.bc"); kern += PvlKeyword("Frame", ""); kern += PvlKeyword("ShapeModel", "$ISISDATA/base/dems/molaMarsPlanetaryRadius0004.cub"); diff --git a/isis/src/base/objs/SerialNumber/unitTest.cpp b/isis/src/base/objs/SerialNumber/unitTest.cpp index f273eb8eee..387c510635 100644 --- a/isis/src/base/objs/SerialNumber/unitTest.cpp +++ b/isis/src/base/objs/SerialNumber/unitTest.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { cout << SerialNumber::Compose(cube, true) << endl; FileName file("$ISISTESTDATA/isis/src/lo/unitTestData/3133_h1.cub"); - Pvl p1(file.expanded()); + Pvl p1(file.expanded().toStdString()); cout << SerialNumber::Compose(p1) << endl; diff --git a/isis/src/base/objs/SessionLog/unitTest.cpp b/isis/src/base/objs/SessionLog/unitTest.cpp index b10541d00c..19b54f99eb 100644 --- a/isis/src/base/objs/SessionLog/unitTest.cpp +++ b/isis/src/base/objs/SessionLog/unitTest.cpp @@ -23,17 +23,17 @@ int main(int argc, char *argv[]) { try { PvlGroup results("Results");; results.addComment("// This is an example of the results group"); - results += PvlKeyword("Average", toString(13.5), "Meters"); + results += PvlKeyword("Average", std::to_string(13.5), "Meters"); results[0].addComment("// Average size of a rock"); Pvl error; PvlGroup temp("Error"); temp += PvlKeyword("Program", "ratio"); temp += PvlKeyword("Class", "I/O ERROR"); - temp += PvlKeyword("Status", toString(-1)); + temp += PvlKeyword("Status", std::to_string(-1)); temp += PvlKeyword("Message", "Unable to open file"); temp += PvlKeyword("File", "unitTest.cpp"); - temp += PvlKeyword("Line", toString(501)); + temp += PvlKeyword("Line", std::to_string(501)); error.addGroup(temp); char **s_argv; s_argv = new char*[10]; diff --git a/isis/src/base/objs/ShapeModelFactory/unitTest.cpp b/isis/src/base/objs/ShapeModelFactory/unitTest.cpp index ecd10fdeb5..66c00e8f69 100644 --- a/isis/src/base/objs/ShapeModelFactory/unitTest.cpp +++ b/isis/src/base/objs/ShapeModelFactory/unitTest.cpp @@ -65,24 +65,24 @@ int main() { QString dir = f.expanded() + "/"; QString dir2 = f2.expanded() + "/"; QString dir3 = f3.expanded() + "/"; - kern1 += PvlKeyword("NaifFrameCode", toString(-94031)); - kern1 += PvlKeyword("LeapSecond", dir + "naif0007.tls"); - kern1 += PvlKeyword("SpacecraftClock", dir + "MGS_SCLKSCET.00045.tsc"); - kern1 += PvlKeyword("TargetPosition", dir + "de405.bsp"); - kern1 += PvlKeyword("TargetAttitudeShape", dir + "pck00006.tpc"); - kern1 += PvlKeyword("Instrument", dir + "mocSpiceUnitTest.ti"); - kern1 += PvlKeyword("InstrumentAddendum", dir + "mocAddendum.ti"); - kern1 += PvlKeyword("InstrumentPosition", dir + "moc.bsp"); - kern1 += PvlKeyword("InstrumentPointing", dir + "moc.bc"); + kern1 += PvlKeyword("NaifFrameCode", std::to_string(-94031)); + kern1 += PvlKeyword("LeapSecond", dir.toStdString() + "naif0007.tls"); + kern1 += PvlKeyword("SpacecraftClock", dir.toStdString() + "MGS_SCLKSCET.00045.tsc"); + kern1 += PvlKeyword("TargetPosition", dir.toStdString() + "de405.bsp"); + kern1 += PvlKeyword("TargetAttitudeShape", dir.toStdString() + "pck00006.tpc"); + kern1 += PvlKeyword("Instrument", dir.toStdString() + "mocSpiceUnitTest.ti"); + kern1 += PvlKeyword("InstrumentAddendum", dir.toStdString() + "mocAddendum.ti"); + kern1 += PvlKeyword("InstrumentPosition", dir.toStdString() + "moc.bsp"); + kern1 += PvlKeyword("InstrumentPointing", dir.toStdString() + "moc.bc"); kern1 += PvlKeyword("Frame", ""); - kern1 += PvlKeyword("NaifBodyCode", toString(499)); + kern1 += PvlKeyword("NaifBodyCode", std::to_string(499)); // Time Setup double startTime = -69382819.0; double endTime = -69382512.0; double slope = (endTime - startTime) / (10 - 1); - kern1 += PvlKeyword("StartPadding", toString(slope)); - kern1 += PvlKeyword("EndPadding", toString(slope)); + kern1 += PvlKeyword("StartPadding", std::to_string(slope)); + kern1 += PvlKeyword("EndPadding", std::to_string(slope)); Pvl lab1; lab1.addGroup(inst1); @@ -91,7 +91,7 @@ int main() { // Test ShapeModel keyword cout << endl << " Testing ShapeModel keyword (EquatorialCylindrical DEM)..." << endl; PvlGroup kern2 = kern1; - kern2 += PvlKeyword("ShapeModel", dir2 + "molaMarsPlanetaryRadius0005.cub"); + kern2 += PvlKeyword("ShapeModel", dir2.toStdString() + "molaMarsPlanetaryRadius0005.cub"); Pvl lab2; lab2.addGroup(inst2); lab2.addGroup(kern2); @@ -103,7 +103,7 @@ int main() { // Test ElevationModel keyword with value cout << endl << " Testing ElevationModel keyword (EquatorialCylindrical DEM)..." << endl; PvlGroup kern3 = kern1; - kern3 += PvlKeyword("ElevationModel", dir2 + "molaMarsPlanetaryRadius0005.cub"); + kern3 += PvlKeyword("ElevationModel", dir2.toStdString() + "molaMarsPlanetaryRadius0005.cub"); Pvl lab3; lab3.addGroup(inst2); lab3.addGroup(kern3); @@ -139,7 +139,7 @@ int main() { // Test ShapeModel dem that's not Equatorial Cylindrical cout << endl << " Testing DEM not equatorial cylindrical" << endl; PvlGroup kern6 = kern1; - kern6 += PvlKeyword("ShapeModel", dir3 + "ab102402.lev2.cub"); + kern6 += PvlKeyword("ShapeModel", dir3.toStdString() + "ab102402.lev2.cub"); Pvl lab6; lab6.addGroup(inst2); lab6.addGroup(kern6); @@ -153,7 +153,7 @@ int main() { PvlGroup kern7 = kern1; FileName f7("$ISISTESTDATA/isis/src/base/unitTestData"); QString dir7 = f7.expanded() + "/"; - kern7 += PvlKeyword("ShapeModel", dir7 + "hay_a_amica_5_itokawashape_v1_0_64q.bds"); + kern7 += PvlKeyword("ShapeModel", dir7.toStdString() + "hay_a_amica_5_itokawashape_v1_0_64q.bds"); Pvl lab7; lab7.addGroup(inst2); lab7.addGroup(kern7); @@ -270,7 +270,7 @@ int main() { // Test ShapeModel that's not a valid Isis map projection cout << endl << " Testing Isis cube file for dem that is not map projected" << endl; PvlGroup kernError = kern1; - kernError += PvlKeyword("ShapeModel", dir3 + "ab102401.cub"); + kernError += PvlKeyword("ShapeModel", dir3.toStdString() + "ab102401.cub"); Pvl labError; labError.addGroup(inst2); labError.addGroup(kernError); diff --git a/isis/src/base/objs/SimpleCylindrical/unitTest.cpp b/isis/src/base/objs/SimpleCylindrical/unitTest.cpp index 4fa8bd8520..1173b972dc 100644 --- a/isis/src/base/objs/SimpleCylindrical/unitTest.cpp +++ b/isis/src/base/objs/SimpleCylindrical/unitTest.cpp @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGrp = lab.findGroup("Mapping"); - mapGrp += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGrp += PvlKeyword("PolarRadius", toString(1.0)); + mapGrp += PvlKeyword("EquatorialRadius", std::to_string(1.0)); + mapGrp += PvlKeyword("PolarRadius", std::to_string(1.0)); mapGrp += PvlKeyword("LatitudeType", "Planetocentric"); mapGrp += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGrp += PvlKeyword("LongitudeDomain", toString(180)); - mapGrp += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGrp += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGrp += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGrp += PvlKeyword("MaximumLongitude", toString(180.0)); + mapGrp += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGrp += PvlKeyword("MinimumLatitude", std::to_string(-90.0)); + mapGrp += PvlKeyword("MaximumLatitude", std::to_string(90.0)); + mapGrp += PvlKeyword("MinimumLongitude", std::to_string(-180.0)); + mapGrp += PvlKeyword("MaximumLongitude", std::to_string(180.0)); mapGrp += PvlKeyword("ProjectionName", "SimpleCylindrical"); cout << "Test missing center longitude keyword ..." << endl; @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) { cout << endl; try { - mapGrp += PvlKeyword("CenterLongitude", toString(-90.0)); + mapGrp += PvlKeyword("CenterLongitude", std::to_string(-90.0)); TProjection *p = (TProjection *) ProjectionFactory::Create(lab); cout << "Test SetGround method ... " << endl; diff --git a/isis/src/base/objs/Sinusoidal/unitTest.cpp b/isis/src/base/objs/Sinusoidal/unitTest.cpp index f529638d37..4a9c8c04c5 100644 --- a/isis/src/base/objs/Sinusoidal/unitTest.cpp +++ b/isis/src/base/objs/Sinusoidal/unitTest.cpp @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGroup += PvlKeyword("PolarRadius", toString(1.0)); + mapGroup += PvlKeyword("EquatorialRadius", std::to_string(1.0)); + mapGroup += PvlKeyword("PolarRadius", std::to_string(1.0)); mapGroup += PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(180.0)); + mapGroup += PvlKeyword("LongitudeDomain", std::to_string(180)); + mapGroup += PvlKeyword("MinimumLatitude", std::to_string(-90.0)); + mapGroup += PvlKeyword("MaximumLatitude", std::to_string(90.0)); + mapGroup += PvlKeyword("MinimumLongitude", std::to_string(-180.0)); + mapGroup += PvlKeyword("MaximumLongitude", std::to_string(180.0)); mapGroup += PvlKeyword("ProjectionName", "Sinusoidal"); cout << "Test missing center longitude keyword ..." << endl; @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(-90.0)); + mapGroup += PvlKeyword("CenterLongitude", std::to_string(-90.0)); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); diff --git a/isis/src/base/objs/Spice/unitTest.cpp b/isis/src/base/objs/Spice/unitTest.cpp index cd1a053597..4a7c809934 100644 --- a/isis/src/base/objs/Spice/unitTest.cpp +++ b/isis/src/base/objs/Spice/unitTest.cpp @@ -106,14 +106,14 @@ int main(int argc, char *argv[]) { FileName f("$ISISTESTDATA/isis/src/base/unitTestData/kernels"); QString dir = f.expanded() + "/"; kernelsGroup += PvlKeyword("NaifFrameCode", "-94031"); - kernelsGroup += PvlKeyword("LeapSecond", dir + "naif0007.tls"); - kernelsGroup += PvlKeyword("SpacecraftClock", dir + "MGS_SCLKSCET.00045.tsc"); - kernelsGroup += PvlKeyword("TargetPosition", dir + "de405.bsp"); - kernelsGroup += PvlKeyword("TargetAttitudeShape", dir + "pck00006.tpc"); - kernelsGroup += PvlKeyword("Instrument", dir + "mocSpiceUnitTest.ti"); - kernelsGroup += PvlKeyword("InstrumentAddendum", dir + "mocAddendum.ti"); - kernelsGroup += PvlKeyword("InstrumentPosition", dir + "moc.bsp"); - kernelsGroup += PvlKeyword("InstrumentPointing", dir + "moc.bc"); + kernelsGroup += PvlKeyword("LeapSecond", dir.toStdString() + "naif0007.tls"); + kernelsGroup += PvlKeyword("SpacecraftClock", dir.toStdString() + "MGS_SCLKSCET.00045.tsc"); + kernelsGroup += PvlKeyword("TargetPosition", dir.toStdString() + "de405.bsp"); + kernelsGroup += PvlKeyword("TargetAttitudeShape", dir.toStdString() + "pck00006.tpc"); + kernelsGroup += PvlKeyword("Instrument", dir.toStdString() + "mocSpiceUnitTest.ti"); + kernelsGroup += PvlKeyword("InstrumentAddendum", dir.toStdString() + "mocAddendum.ti"); + kernelsGroup += PvlKeyword("InstrumentPosition", dir.toStdString() + "moc.bsp"); + kernelsGroup += PvlKeyword("InstrumentPointing", dir.toStdString() + "moc.bc"); kernelsGroup += PvlKeyword("Frame", ""); // Time Setup @@ -121,8 +121,8 @@ int main(int argc, char *argv[]) { double endTime = -69382512.0; double slope = (endTime - startTime) / (10 - 1); - kernelsGroup += PvlKeyword("StartPadding", toString(slope)); - kernelsGroup += PvlKeyword("EndPadding", toString(slope)); + kernelsGroup += PvlKeyword("StartPadding", std::to_string(slope)); + kernelsGroup += PvlKeyword("EndPadding", std::to_string(slope)); Pvl &lab = *dummyCube.label(); PvlObject &isisCubeObj = lab.findObject("IsisCube"); diff --git a/isis/src/base/objs/Strategy/unitTest.cpp b/isis/src/base/objs/Strategy/unitTest.cpp index 82c30da81c..ad03fc6edd 100644 --- a/isis/src/base/objs/Strategy/unitTest.cpp +++ b/isis/src/base/objs/Strategy/unitTest.cpp @@ -371,7 +371,7 @@ void IsisMain() { qDebug() << Qt::endl; PvlObject o = dstrat4.getDefinitionA(); - qDebug() << o.name() << Qt::endl; + qDebug() << QString::fromStdString(o.name()) << Qt::endl; qDebug() << Qt::endl; qDebug() << Qt::endl; diff --git a/isis/src/base/objs/StripPolygonSeeder/unitTest.cpp b/isis/src/base/objs/StripPolygonSeeder/unitTest.cpp index e6165f4d98..5f7e33614f 100644 --- a/isis/src/base/objs/StripPolygonSeeder/unitTest.cpp +++ b/isis/src/base/objs/StripPolygonSeeder/unitTest.cpp @@ -38,10 +38,10 @@ int main() { if(!alg.hasKeyword("Name")) { cout << "Test without subgrid" << endl; alg += PvlKeyword("Name", "Strip"); - alg += PvlKeyword("MinimumThickness", toString(0.3)); - alg += PvlKeyword("MinimumArea", toString(10)); - alg += PvlKeyword("XSpacing", toString(1500)); - alg += PvlKeyword("YSpacing", toString(1500)); + alg += PvlKeyword("MinimumThickness", std::to_string(0.3)); + alg += PvlKeyword("MinimumArea", std::to_string(10)); + alg += PvlKeyword("XSpacing", std::to_string(1500)); + alg += PvlKeyword("YSpacing", std::to_string(1500)); } PvlObject o("AutoSeed"); @@ -81,11 +81,11 @@ int main() { Isis::Pvl maplab; maplab.addGroup(Isis::PvlGroup("Mapping")); Isis::PvlGroup &mapGroup = maplab.findGroup("Mapping"); - mapGroup += Isis::PvlKeyword("EquatorialRadius", (QString)radii["EquatorialRadius"]); - mapGroup += Isis::PvlKeyword("PolarRadius", (QString)radii["PolarRadius"]); + mapGroup += Isis::PvlKeyword("EquatorialRadius", (std::string)radii["EquatorialRadius"]); + mapGroup += Isis::PvlKeyword("PolarRadius", (std::string)radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", std::to_string(360)); mapGroup += Isis::PvlKeyword("CenterLatitude", "0"); mapGroup += Isis::PvlKeyword("CenterLongitude", "0"); mapGroup += Isis::PvlKeyword("ProjectionName", "Sinusoidal"); @@ -157,13 +157,13 @@ int main() { Isis::Pvl maplab; maplab.addGroup(Isis::PvlGroup("Mapping")); Isis::PvlGroup &mapGroup = maplab.findGroup("Mapping"); - mapGroup += Isis::PvlKeyword("EquatorialRadius", (QString)radii["EquatorialRadius"]); - mapGroup += Isis::PvlKeyword("PolarRadius", (QString)radii["PolarRadius"]); + mapGroup += Isis::PvlKeyword("EquatorialRadius", (std::string)radii["EquatorialRadius"]); + mapGroup += Isis::PvlKeyword("PolarRadius", (std::string)radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); - mapGroup += Isis::PvlKeyword("CenterLatitude", toString(0)); - mapGroup += Isis::PvlKeyword("CenterLongitude", toString(0)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", std::to_string(360)); + mapGroup += Isis::PvlKeyword("CenterLatitude", std::to_string(0)); + mapGroup += Isis::PvlKeyword("CenterLongitude", std::to_string(0)); mapGroup += Isis::PvlKeyword("ProjectionName", "Sinusoidal"); TProjection *proj = (TProjection *) Isis::ProjectionFactory::Create(maplab); diff --git a/isis/src/base/objs/SubArea/unitTest.cpp b/isis/src/base/objs/SubArea/unitTest.cpp index 8dff615cb6..02f243b3cc 100644 --- a/isis/src/base/objs/SubArea/unitTest.cpp +++ b/isis/src/base/objs/SubArea/unitTest.cpp @@ -47,16 +47,16 @@ void IsisMain() { Cube *onomapcube = p1.SetOutputCube("TO", ons, onl, 1); PvlGroup results("Results"); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); SubArea s; s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); @@ -82,7 +82,7 @@ void IsisMain() { cout << "Output cube label: " << endl << endl; QString file = ui.GetCubeName("TO"); - Pvl label(file); + Pvl label(file.toStdString()); cout << label.findObject("IsisCube").findObject("Core").findGroup("Dimensions") << endl << endl; if(label.findObject("IsisCube").hasGroup("Instrument")) { cout << label.findObject("IsisCube").findGroup("Instrument") << endl << endl; @@ -107,16 +107,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); onomapcube = p2.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&inomapcube, onomapcube, results); @@ -153,16 +153,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); onomapcube = p3.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&inomapcube, onomapcube, results); @@ -203,16 +203,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); onomapcube = p4.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&inomapcube, onomapcube, results); @@ -249,16 +249,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); onomapcube = p5.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&inomapcube, onomapcube, results); @@ -306,16 +306,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); Cube *omapcube = p6.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -363,16 +363,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p7.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -409,16 +409,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p8.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -459,16 +459,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p9.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -505,16 +505,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p10.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -562,16 +562,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p11.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", std::to_string(inl)); + results += PvlKeyword("InputSamples", std::to_string(ins)); + results += PvlKeyword("StartingLine", std::to_string(sl)); + results += PvlKeyword("StartingSample", std::to_string(ss)); + results += PvlKeyword("EndingLine", std::to_string(el)); + results += PvlKeyword("EndingSample", std::to_string(es)); + results += PvlKeyword("LineIncrement", std::to_string(linc)); + results += PvlKeyword("SampleIncrement", std::to_string(sinc)); + results += PvlKeyword("OutputLines", std::to_string(onl)); + results += PvlKeyword("OutputSamples", std::to_string(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&smapcube, omapcube, results); diff --git a/isis/src/base/objs/Target/unitTest.cpp b/isis/src/base/objs/Target/unitTest.cpp index 8e285b7207..0675dbeec2 100644 --- a/isis/src/base/objs/Target/unitTest.cpp +++ b/isis/src/base/objs/Target/unitTest.cpp @@ -50,40 +50,40 @@ int main(int argc, char *argv[]) { FileName f2("$base/dems"); QString dir = f.expanded() + "/"; QString dir2 = f2.expanded() + "/"; - kern1 += PvlKeyword("NaifFrameCode", toString(-94031)); - kern1 += PvlKeyword("LeapSecond", dir + "naif0007.tls"); - kern1 += PvlKeyword("SpacecraftClock", dir + "MGS_SCLKSCET.00045.tsc"); - kern1 += PvlKeyword("TargetPosition", dir + "de405.bsp"); - kern1 += PvlKeyword("TargetAttitudeShape", dir + "pck00006.tpc"); - kern1 += PvlKeyword("Instrument", dir + "mocSpiceUnitTest.ti"); - kern1 += PvlKeyword("InstrumentAddendum", dir + "mocAddendum.ti"); - kern1 += PvlKeyword("InstrumentPosition", dir + "moc.bsp"); - kern1 += PvlKeyword("InstrumentPointing", dir + "moc.bc"); + kern1 += PvlKeyword("NaifFrameCode", std::to_string(-94031)); + kern1 += PvlKeyword("LeapSecond", dir.toStdString() + "naif0007.tls"); + kern1 += PvlKeyword("SpacecraftClock", dir.toStdString() + "MGS_SCLKSCET.00045.tsc"); + kern1 += PvlKeyword("TargetPosition", dir.toStdString() + "de405.bsp"); + kern1 += PvlKeyword("TargetAttitudeShape", dir.toStdString() + "pck00006.tpc"); + kern1 += PvlKeyword("Instrument", dir.toStdString() + "mocSpiceUnitTest.ti"); + kern1 += PvlKeyword("InstrumentAddendum", dir.toStdString() + "mocAddendum.ti"); + kern1 += PvlKeyword("InstrumentPosition", dir.toStdString() + "moc.bsp"); + kern1 += PvlKeyword("InstrumentPointing", dir.toStdString() + "moc.bc"); kern1 += PvlKeyword("Frame", ""); PvlGroup kern2("Kernels"); - kern2 += PvlKeyword("NaifIkCode", toString(-94031)); - kern2 += PvlKeyword("LeapSecond", dir + "naif0007.tls"); - kern2 += PvlKeyword("SpacecraftClock", dir + "MGS_SCLKSCET.00045.tsc"); - kern2 += PvlKeyword("TargetPosition", dir + "de405.bsp"); - kern2 += PvlKeyword("TargetAttitudeShape", dir + "pck00006.tpc"); - kern2 += PvlKeyword("Instrument", dir + "mocSpiceUnitTest.ti"); - kern2 += PvlKeyword("InstrumentAddendum", dir + "mocAddendum.ti"); - kern2 += PvlKeyword("InstrumentPosition", dir + "moc.bsp"); - kern2 += PvlKeyword("InstrumentPointing", dir + "moc.bc"); + kern2 += PvlKeyword("NaifIkCode", std::to_string(-94031)); + kern2 += PvlKeyword("LeapSecond", dir.toStdString() + "naif0007.tls"); + kern2 += PvlKeyword("SpacecraftClock", dir.toStdString() + "MGS_SCLKSCET.00045.tsc"); + kern2 += PvlKeyword("TargetPosition", dir.toStdString() + "de405.bsp"); + kern2 += PvlKeyword("TargetAttitudeShape", dir.toStdString() + "pck00006.tpc"); + kern2 += PvlKeyword("Instrument", dir.toStdString() + "mocSpiceUnitTest.ti"); + kern2 += PvlKeyword("InstrumentAddendum", dir.toStdString() + "mocAddendum.ti"); + kern2 += PvlKeyword("InstrumentPosition", dir.toStdString() + "moc.bsp"); + kern2 += PvlKeyword("InstrumentPointing", dir.toStdString() + "moc.bc"); kern2 += PvlKeyword("Frame", ""); - kern2 += PvlKeyword("NaifBodyCode", toString(499)); + kern2 += PvlKeyword("NaifBodyCode", std::to_string(499)); PvlGroup kern3 = kern2; - kern3 += PvlKeyword("ShapeModel", dir2 + "molaMarsPlanetaryRadius0005.cub"); + kern3 += PvlKeyword("ShapeModel", dir2.toStdString() + "molaMarsPlanetaryRadius0005.cub"); // Time Setup double startTime = -69382819.0; double endTime = -69382512.0; double slope = (endTime - startTime) / (10 - 1); - kern1 += PvlKeyword("StartPadding", toString(slope)); - kern1 += PvlKeyword("EndPadding", toString(slope)); + kern1 += PvlKeyword("StartPadding", std::to_string(slope)); + kern1 += PvlKeyword("EndPadding", std::to_string(slope)); Pvl lab1; lab1.addGroup(inst1); diff --git a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp index 6e478bd88a..7833753421 100644 --- a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp +++ b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp @@ -120,7 +120,7 @@ namespace Isis{ int roo = *(header + 50 + vicarLabelBytes) / 32 % 2; //**** THIS MAY NEED TO BE CHANGED, // SEE BOTTOM OF THIS FILE FOR IN DEPTH COMMENTS ON READOUTORDER PvlGroup &inst = ocube->label()->findGroup("Instrument", Pvl::Traverse); - inst.addKeyword(PvlKeyword("ReadoutOrder", toString(roo))); + inst.addKeyword(PvlKeyword("ReadoutOrder", std::to_string(roo))); p.EndProcess(); // PROCESS 2 : Do 8 bit to 12 bit conversion for image ==============================================// @@ -209,7 +209,7 @@ namespace Isis{ void CreateStretchPairs() { // Set up the strech for the 8 to 12 bit conversion from file PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - QString missionDir = (QString) dataDir["Cassini"]; + QString missionDir = QString::fromStdString(dataDir["Cassini"]); FileName *lutFile = new FileName(missionDir + "/calibration/lut/lut.tab"); CisscalFile *stretchPairs = new CisscalFile(lutFile->expanded()); // Create the stretch pairs @@ -276,7 +276,7 @@ namespace Isis{ FileName transFile(dir + "/CassiniIss.trn"); // Get the translation manager ready - Pvl inputLabel(labelFile.expanded()); + Pvl inputLabel(labelFile.expanded().toStdString()); PvlToPvlTranslationManager labelXlater(inputLabel, transFile.expanded()); // Pvl outputLabels; @@ -285,9 +285,9 @@ namespace Isis{ //Add needed keywords that are not in translation table to cube's instrument group PvlGroup &inst = outputLabel->findGroup("Instrument", Pvl::Traverse); - QString scc = inputLabel.findKeyword("SPACECRAFT_CLOCK_CNT_PARTITION"); - scc += "/" + (QString) inputLabel.findKeyword("SPACECRAFT_CLOCK_START_COUNT"); - inst.addKeyword(PvlKeyword("SpacecraftClockCount", scc)); + QString scc = QString::fromStdString(inputLabel.findKeyword("SPACECRAFT_CLOCK_CNT_PARTITION")); + scc += "/" + QString::fromStdString(inputLabel.findKeyword("SPACECRAFT_CLOCK_START_COUNT")); + inst.addKeyword(PvlKeyword("SpacecraftClockCount", scc.toStdString())); //Add units of measurement to keywords from translation table double exposureDuration = inst.findKeyword("ExposureDuration"); @@ -304,10 +304,10 @@ namespace Isis{ inst.findKeyword("InstrumentDataRate").setValue(std::to_string(instDataRate), "KilobitsPerSecond"); // initialize global variables - dataConversionType = (QString) inst.findKeyword("DataConversionType"); + dataConversionType = QString::fromStdString(inst.findKeyword("DataConversionType")); sumMode = inst.findKeyword("SummingMode"); - compressionType = (QString) inst.findKeyword("CompressionType"); - IString fsw((QString) inst.findKeyword("FlightSoftwareVersionId")); + compressionType = QString::fromStdString(inst.findKeyword("CompressionType")); + IString fsw(QString::fromStdString(inst.findKeyword("FlightSoftwareVersionId"))); if(fsw == "Unknown") { flightSoftware = 0.0; } @@ -316,24 +316,24 @@ namespace Isis{ } // Remove the trailing 'Z' in some pds labels - QString sUpdateTime = inst.findKeyword("StartTime")[0]; + QString sUpdateTime = QString::fromStdString(inst.findKeyword("StartTime")[0]); sUpdateTime.remove(QRegExp("[Zz]")); - inst.findKeyword("StartTime").setValue(sUpdateTime); + inst.findKeyword("StartTime").setValue(sUpdateTime.toStdString()); - sUpdateTime = inst.findKeyword("StopTime")[0]; + sUpdateTime = QString::fromStdString(inst.findKeyword("StopTime")[0]); sUpdateTime.remove(QRegExp("[Zz]")); - inst.findKeyword("StopTime").setValue(sUpdateTime); + inst.findKeyword("StopTime").setValue(sUpdateTime.toStdString()); - sUpdateTime = inst.findKeyword("ImageTime")[0]; + sUpdateTime = QString::fromStdString(inst.findKeyword("ImageTime")[0]); sUpdateTime.remove(QRegExp("[Zz]")); - inst.findKeyword("ImageTime").setValue(sUpdateTime); + inst.findKeyword("ImageTime").setValue(sUpdateTime.toStdString()); // create BandBin group - QString filter = inputLabel.findKeyword("FilterName")[0] + "/" + - inputLabel.findKeyword("FilterName")[1]; + QString filter = QString::fromStdString(inputLabel.findKeyword("FilterName")[0]) + "/" + + QString::fromStdString(inputLabel.findKeyword("FilterName")[1]); - QString instrumentID = inst.findKeyword("InstrumentId"); + QString instrumentID = QString::fromStdString(inst.findKeyword("InstrumentId")); QString cameraAngleDefs; if(instrumentID.at(3) == 'N') { cameraAngleDefs = dir + "/CassiniIssNarrowAngle.def"; @@ -361,16 +361,16 @@ namespace Isis{ } } PvlGroup bandBin("BandBin"); - bandBin += PvlKeyword("FilterName", filter); + bandBin += PvlKeyword("FilterName", filter.toStdString()); bandBin += PvlKeyword("OriginalBand", "1"); if(foundfilter) { - bandBin += PvlKeyword("Center", toString(center)); - bandBin += PvlKeyword("Width", toString(width)); + bandBin += PvlKeyword("Center", std::to_string(center)); + bandBin += PvlKeyword("Width", std::to_string(width)); } else { PvlGroup msgGrp("Warnings"); - msgGrp += PvlKeyword("CameraAngleLookup", "Failed! No Camera information for filter combination: " + filter); + msgGrp += PvlKeyword("CameraAngleLookup", "Failed! No Camera information for filter combination: " + filter.toStdString()); Application::Log(msgGrp); bandBin += PvlKeyword("Center", "None found for filter combination."); bandBin += PvlKeyword("Width", "None found for filter combination."); diff --git a/isis/src/cassini/apps/cisscal/DarkCurrent.cpp b/isis/src/cassini/apps/cisscal/DarkCurrent.cpp index adc7cb109d..f5fe56182a 100644 --- a/isis/src/cassini/apps/cisscal/DarkCurrent.cpp +++ b/isis/src/cassini/apps/cisscal/DarkCurrent.cpp @@ -1027,7 +1027,7 @@ namespace Isis { void DarkCurrent::FindDarkFiles() { // Get the directory where the CISS darkcurrent directory is PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - QString missionDir = (QString) dataDir["Cassini"]; + QString missionDir = QString::fromStdString(dataDir["Cassini"]); QString darkDir(missionDir + "/calibration/darkcurrent/"); QString instrumentId(""); diff --git a/isis/src/cassini/apps/cisscal/main.cpp b/isis/src/cassini/apps/cisscal/main.cpp index 9b7c072084..5eb4a3b849 100644 --- a/isis/src/cassini/apps/cisscal/main.cpp +++ b/isis/src/cassini/apps/cisscal/main.cpp @@ -184,7 +184,7 @@ void IsisMain() { + bitweightFile.expanded() + "*** not found.", _FILEINFO_); } else { - gbl::calgrp += PvlKeyword("BitweightFile", bitweightFile.original()); + gbl::calgrp += PvlKeyword("BitweightFile", bitweightFile.original().toStdString()); gbl::CreateBitweightStretch(bitweightFile); firstpass.Progress()->SetText("Computing bitweight correction..."); firstpass.StartProcess(gbl::BitweightCorrect); @@ -203,9 +203,9 @@ void IsisMain() { gbl::dark_DN = dark.ComputeDarkDN(); gbl::calgrp += PvlKeyword("DarkSubtractionPerformed", "Yes"); gbl::calgrp.findKeyword("DarkSubtractionPerformed").addComment("Dark Current Subtraction Parameters"); - gbl::calgrp += PvlKeyword("DarkParameterFile", dark.DarkParameterFile().original()); + gbl::calgrp += PvlKeyword("DarkParameterFile", dark.DarkParameterFile().original().toStdString()); if(gbl::cissLab->NarrowAngle()) { - gbl::calgrp += PvlKeyword("BiasDistortionTable", dark.BiasDistortionTable().original()); + gbl::calgrp += PvlKeyword("BiasDistortionTable", dark.BiasDistortionTable().original().toStdString()); } else { gbl::calgrp += PvlKeyword("BiasDistortionTable", "ISSWA: No bias distortion table used"); @@ -647,7 +647,7 @@ void gbl::ComputeBias() { gbl::bias.resize(1); gbl::bias[0] = gbl::cissLab->BiasStripMean(); } - gbl::calgrp += PvlKeyword("NumberOfOverclocks", toString(gbl::numberOfOverclocks)); + gbl::calgrp += PvlKeyword("NumberOfOverclocks", std::to_string(gbl::numberOfOverclocks)); return; } @@ -792,7 +792,7 @@ void gbl::Linearize() { } gbl::calgrp += PvlKeyword("LinearityCorrectionPerformed", "Yes"); gbl::calgrp.findKeyword("LinearityCorrectionPerformed").addComment("Linearity Correction Parameters"); - gbl::calgrp += PvlKeyword("LinearityCorrectionTable", linearLUT.original()); + gbl::calgrp += PvlKeyword("LinearityCorrectionTable", linearLUT.original().toStdString()); TextFile *pairs = new TextFile(linearLUT.original()); for(int i = 0; i < pairs->LineCount(); i++) { @@ -912,7 +912,7 @@ void gbl::FindDustRingParameters() { "Unable to calibrate image. DustRingFile2 ***" + gbl::dustFile2.expanded() + "*** not found.", _FILEINFO_); } - gbl::calgrp += PvlKeyword("DustRingFile2", gbl::dustFile2.original()); + gbl::calgrp += PvlKeyword("DustRingFile2", gbl::dustFile2.original().toStdString()); } // No Mottling correction for images before sclk=1444733393: (i.e., 2003-286T10:28:04) @@ -957,7 +957,7 @@ void gbl::FindDustRingParameters() { "Unable to calibrate image. EffectiveWavelengthFile ***" + effectiveWavelength.expanded() + "*** not found.", _FILEINFO_); } - gbl::calgrp += PvlKeyword("EffectiveWavelengthFile", effectiveWavelength.original()); + gbl::calgrp += PvlKeyword("EffectiveWavelengthFile", effectiveWavelength.original().toStdString()); CisscalFile *effwlDB = new CisscalFile(effectiveWavelength.original()); QString col1, col2, col3, col4, col5; double effwl; @@ -982,7 +982,7 @@ void gbl::FindDustRingParameters() { } else { effwl = toDouble(col5); - gbl::calgrp += PvlKeyword("EffectiveWavelength", toString(effwl)); + gbl::calgrp += PvlKeyword("EffectiveWavelength", std::to_string(effwl)); gbl::strengthFactor = 1.30280 - 0.000717552 * effwl; } break; @@ -1067,7 +1067,7 @@ void gbl::FindDustRingParameters() { } } } - gbl::calgrp += PvlKeyword("StrengthFactor", toString(gbl::strengthFactor)); + gbl::calgrp += PvlKeyword("StrengthFactor", std::to_string(gbl::strengthFactor)); return; } @@ -1180,7 +1180,7 @@ FileName gbl::FindFlatFile() { col8 = "flat" + col8.mid(5, (j - 5) + 1); flatFile = (gbl::GetCalibrationDirectory("slope/flat") + col8 + gbl::cissLab->InstrumentModeId() + ".cub"); - gbl::calgrp += PvlKeyword("FlatFile", flatFile.original()); + gbl::calgrp += PvlKeyword("FlatFile", flatFile.original().toStdString()); if(!flatFile.fileExists()) { // flat file not found, stop calibration throw IException(IException::Io, "Unable to calibrate image. FlatFile ***" @@ -1259,7 +1259,7 @@ void gbl::DNtoElectrons() { _FILEINFO_); } } - gbl::calgrp += PvlKeyword("TrueGain", toString(gbl::trueGain)); + gbl::calgrp += PvlKeyword("TrueGain", std::to_string(gbl::trueGain)); return; } @@ -1306,7 +1306,7 @@ void gbl::FindShutterOffset() { "Unable to calibrate image. ShutterOffsetFile ***" + shutterOffsetFile.expanded() + "*** not found.", _FILEINFO_); } - gbl::calgrp += PvlKeyword("ShutterOffsetFile", shutterOffsetFile.original()); + gbl::calgrp += PvlKeyword("ShutterOffsetFile", shutterOffsetFile.original().toStdString()); Cube offsetCube; offsetCube.open(shutterOffsetFile.original()); gbl::offset = new Brick(gbl::incube->sampleCount(), 1, 1, offsetCube.pixelType()); @@ -1364,9 +1364,9 @@ void gbl::DivideByAreaPixel() { // it was expressed in IDL as the following: // [gbl::sumFactor = (gbl::incube->sampleCount()/1024.0)*(gbl::incube->lineCount()/1024.0);] gbl::sumFactor = 1 / pow(gbl::cissLab->SummingMode(), 2.0); - gbl::calgrp += PvlKeyword("SolidAngle", toString(gbl::solidAngle)); - gbl::calgrp += PvlKeyword("OpticsArea", toString(gbl::opticsArea)); - gbl::calgrp += PvlKeyword("SumFactor", toString(gbl::sumFactor)); + gbl::calgrp += PvlKeyword("SolidAngle", std::to_string(gbl::solidAngle)); + gbl::calgrp += PvlKeyword("OpticsArea", std::to_string(gbl::opticsArea)); + gbl::calgrp += PvlKeyword("SumFactor", std::to_string(gbl::sumFactor)); return; } @@ -1434,7 +1434,7 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { } gbl::calgrp += PvlKeyword("DividedByEfficiency", "Yes"); - gbl::calgrp += PvlKeyword("EfficiencyFactorMethod", fluxunits); + gbl::calgrp += PvlKeyword("EfficiencyFactorMethod", fluxunits.toStdString()); vector lambda; // lambda will contain all wavelength vectors used //--- 1) CREATE LINEAR APPROXIMATION FROM SYSTEM TRANSMISSION FILE ---------- @@ -1450,7 +1450,7 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { + transfile.expanded() + "*** not found.", _FILEINFO_); } // read in system transmission to find transmitted wavelength and flux - gbl::calgrp += PvlKeyword("TransmissionFile", transfile.original()); + gbl::calgrp += PvlKeyword("TransmissionFile", transfile.original().toStdString()); CisscalFile *trans = new CisscalFile(transfile.original()); vector wavelengthT, transmittedFlux; double x, y; @@ -1494,7 +1494,7 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { + qecorrfile.expanded() + "*** not found.", _FILEINFO_); } // read qe file to find qe wavelength and correction - gbl::calgrp += PvlKeyword("QuantumEfficiencyFile", qecorrfile.original()); + gbl::calgrp += PvlKeyword("QuantumEfficiencyFile", qecorrfile.original().toStdString()); CisscalFile *qeCorr = new CisscalFile(qecorrfile.original()); vector wavelengthQE, qecorrection; for(int i = 0; i < qeCorr->LineCount(); i++) { @@ -1578,7 +1578,7 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { "Unable to calibrate image using I/F. SpectralFile ***" + specfile.expanded() + "*** not found.", _FILEINFO_); } - gbl::calgrp += PvlKeyword("SpectralFile", specfile.original()); + gbl::calgrp += PvlKeyword("SpectralFile", specfile.original().toStdString()); // get distance from sun (AU): double angstromsToNm = 10.0; @@ -1605,7 +1605,7 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { "Unable to calibrate image using I/F. Solar Distance calculated is less than or equal to 0.", _FILEINFO_); } - gbl::calgrp += PvlKeyword("SolarDistance", toString(distFromSun)); + gbl::calgrp += PvlKeyword("SolarDistance", std::to_string(distFromSun)); // read spectral file to find wavelength and flux CisscalFile *spectral = new CisscalFile(specfile.original()); @@ -1673,8 +1673,8 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { spline2.AddData(lambda, fluxproduct2); gbl::efficiencyFactor = spline1.BoolesRule(spline1.DomainMinimum(), spline1.DomainMaximum()); double efficiency = spline2.BoolesRule(spline2.DomainMinimum(), spline2.DomainMaximum()); - gbl::calgrp += PvlKeyword("EfficiencyFactor", toString(gbl::efficiencyFactor), units); - gbl::calgrp += PvlKeyword("TotalEfficiency", toString(efficiency)); + gbl::calgrp += PvlKeyword("EfficiencyFactor", gbl::efficiencyFactor, units); + gbl::calgrp += PvlKeyword("TotalEfficiency", efficiency); // Cannot divide by 0.0 if(gbl::efficiencyFactor == 0) { @@ -1739,7 +1739,7 @@ void gbl::FindCorrectionFactors() { gbl::calgrp += PvlKeyword("CorrectionFactorPerformed", "Yes"); gbl::calgrp.findKeyword("CorrectionFactorPerformed").addComment("Correction Factor Parameters"); - gbl::calgrp += PvlKeyword("CorrectionFactorFile", correctionFactorFile.original()); + gbl::calgrp += PvlKeyword("CorrectionFactorFile", correctionFactorFile.original().toStdString()); CisscalFile *corrFact = new CisscalFile(correctionFactorFile.original()); gbl::correctionFactor = 0.0; QString col1, col2, col3, col4; @@ -1787,7 +1787,7 @@ void gbl::FindCorrectionFactors() { gbl::calgrp.findKeyword("CorrectionFactorPerformed").addComment("Correction Factor Parameters"); } - gbl::calgrp += PvlKeyword("CorrectionFactor", toString(gbl::correctionFactor)); + gbl::calgrp += PvlKeyword("CorrectionFactor", std::to_string(gbl::correctionFactor)); return; } @@ -1840,7 +1840,7 @@ void gbl::FindSensitivityCorrection() { gbl::calgrp += PvlKeyword("SensitivityCorrectionPerformed", "Yes"); gbl::calgrp.findKeyword("SensitivityCorrectionPerformed").addComment("Sensitivity vs Time Correction Parameters"); gbl::sensCorrection = true; - gbl::calgrp += PvlKeyword("SensVsTimeCorr", toString(gbl::sensVsTimeCorr)); + gbl::calgrp += PvlKeyword("SensVsTimeCorr", std::to_string(gbl::sensVsTimeCorr)); } diff --git a/isis/src/cassini/apps/vims2isis/main.cpp b/isis/src/cassini/apps/vims2isis/main.cpp index 78124bab34..8391c7a7bf 100644 --- a/isis/src/cassini/apps/vims2isis/main.cpp +++ b/isis/src/cassini/apps/vims2isis/main.cpp @@ -502,14 +502,14 @@ void TranslateVimsLabels(Pvl &pdsLab, Cube *vimscube, VimsType vType) { //trim start and stop time QString strTime = inst.findKeyword("StartTime")[0]; inst.findKeyword("StartTime").setValue(strTime.remove("Z")); - strTime = (QString)qube["StopTime"]; - inst.findKeyword("StopTime").setValue(strTime.remove("Z")); + strTime = QString::fromStdString(qube["StopTime"]); + inst.findKeyword("StopTime").setValue((strTime).remove("Z").toStdString()); if(vType == IR) { - inst += PvlKeyword("SamplingMode", (QString)qube["SamplingModeId"][0]); + inst += PvlKeyword("SamplingMode", qube["SamplingModeId"][0]); } else { - inst += PvlKeyword("SamplingMode", (QString)qube["SamplingModeId"][1]); + inst += PvlKeyword("SamplingMode", qube["SamplingModeId"][1]); } if(vType == VIS) { inst += PvlKeyword("Channel", "VIS"); @@ -524,10 +524,10 @@ void TranslateVimsLabels(Pvl &pdsLab, Cube *vimscube, VimsType vType) { inst += expDuration; if(vType == IR) { - inst += PvlKeyword("GainMode", (QString)qube["GainModeId"][0]); + inst += PvlKeyword("GainMode", qube["GainModeId"][0]); } else { - inst += PvlKeyword("GainMode", (QString)qube["GainModeId"][1]); + inst += PvlKeyword("GainMode", qube["GainModeId"][1]); } vimscube->putGroup(inst); diff --git a/isis/src/cassini/apps/vimscal/main.cpp b/isis/src/cassini/apps/vimscal/main.cpp index 0edf6f49b5..80cd3da352 100644 --- a/isis/src/cassini/apps/vimscal/main.cpp +++ b/isis/src/cassini/apps/vimscal/main.cpp @@ -142,7 +142,7 @@ void IsisMain() { try { - timeString = QString(inst["StartTime"]); + timeString = QString::fromStdString(inst["StartTime"]); } catch(IException &e) { @@ -414,7 +414,7 @@ void calculateSolarRemove(Cube *icube, ProcessByLine *p) { solarFileName = solarFileName.highestVersion(); calibInfo += PvlKeyword("SolarColorFile", - solarFileName.originalPath() + "/" + solarFileName.name()); + solarFileName.originalPath() + "/" + solarFileName.name().toStdString()); p->SetInputCube(createCroppedFile(icube, solarFileName.expanded()), iatt); } @@ -431,26 +431,26 @@ void loadCalibrationValues() { calibFile = calibFile.highestVersion(); //Pvl configFile; - g_configFile.read(calibFile.expanded()); + g_configFile.read(calibFile.expanded().toStdString()); PvlGroup &multipliers = g_configFile.findGroup("CalibrationMultipliers"); - calVersion = (QString)multipliers["version"]; + calVersion = QString::fromStdString(multipliers["version"]); - g_solar = multipliers["solar"][0].toDouble(); + g_solar = std::stod(multipliers["solar"][0]); - g_ir = multipliers["IR"][0].toDouble(); + g_ir = std::stod(multipliers["IR"][0]); - g_vis = multipliers["VIS"][0].toDouble(); + g_vis = std::stod(multipliers["VIS"][0]); - g_wavecal = multipliers["wave-cal"][0].toDouble(); + g_wavecal = std::stod(multipliers["wave-cal"][0]); - calibInfo += PvlKeyword("CalibrationVersion", calVersion); - calibInfo += PvlKeyword("SolarMultiplier",QString::number(g_solar,'f',2)); - calibInfo += PvlKeyword("IR_Multiplier",QString::number(g_ir,'f',2)); - calibInfo += PvlKeyword("VIS_Multiplier",QString::number(g_vis,'f',2)); - calibInfo += PvlKeyword("Wave-CalMultiplier",QString::number(g_wavecal,'f',2)); + calibInfo += PvlKeyword("CalibrationVersion", calVersion.toStdString()); + calibInfo += PvlKeyword("SolarMultiplier",QString::number(g_solar,'f',2).toStdString()); + calibInfo += PvlKeyword("IR_Multiplier",QString::number(g_ir,'f',2).toStdString()); + calibInfo += PvlKeyword("VIS_Multiplier",QString::number(g_vis,'f',2).toStdString()); + calibInfo += PvlKeyword("Wave-CalMultiplier",QString::number(g_wavecal,'f',2).toStdString()); } @@ -488,11 +488,11 @@ void updateWavelengths(Cube *icube) { averageBandwidthCube.open(averageBandwidthFileName.expanded()); calibInfo += PvlKeyword("BandwidthFile", - bandwidthFileName.originalPath() + "/" + bandwidthFileName.name()); + bandwidthFileName.originalPath().toStdString() + "/" + bandwidthFileName.name().toStdString()); calibInfo += PvlKeyword("AverageBandwidthFile", - averageBandwidthFileName.originalPath() + "/" - + averageBandwidthFileName.name()); + averageBandwidthFileName.originalPath().toStdString() + "/" + + averageBandwidthFileName.name().toStdString()); LineManager bandwidthMgr(bandwidthCube); LineManager averageBandwidthMgr(averageBandwidthCube); @@ -541,12 +541,12 @@ void updateWavelengths(Cube *icube) { PvlKeyword ¢erBand = bandBin.findKeyword("Center"); - centerBand.setValue(bandbinCenterString); + centerBand.setValue(bandbinCenterString.toStdString()); PvlKeyword averageBand("MissionAverage"); - averageBand.setValue(averageBandbinString); + averageBand.setValue(averageBandbinString.toStdString()); bandBin.addKeyword(averageBand); - centerBand.setValue(bandbinCenterString); + centerBand.setValue(bandbinCenterString.toStdString()); } @@ -571,7 +571,7 @@ void calculateSpecificEnergy(Cube *icube) { } if(g_visBool) { - coefficient /= toDouble(inst["ExposureDuration"][1]) / 1000.0; + coefficient /= std::stod(inst["ExposureDuration"][1]) / 1000.0; } else { diff --git a/isis/src/cassini/objs/CissLabels/CissLabels.cpp b/isis/src/cassini/objs/CissLabels/CissLabels.cpp index 4503676f7b..58fc993fe3 100644 --- a/isis/src/cassini/objs/CissLabels/CissLabels.cpp +++ b/isis/src/cassini/objs/CissLabels/CissLabels.cpp @@ -31,7 +31,7 @@ namespace Isis { * @param file Name of Cassini ISS file */ CissLabels::CissLabels(const QString &file) { - Pvl lab(file); + Pvl lab(file.toStdString()); Init(lab); } @@ -65,33 +65,33 @@ namespace Isis { void CissLabels::ReadLabels(Pvl &lab) { // Get values out of the instrument group PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - p_ABflag = (QString) inst["AntiBloomingStateFlag"]; //valid values: On, Off, Unknown + p_ABflag = QString::fromStdString(inst["AntiBloomingStateFlag"]); //valid values: On, Off, Unknown p_biasStripMean = (double) inst["BiasStripMean"]; //valid values: real numbers - p_compressionRatio = (QString) inst["CompressionRatio"]; //valid values: NotCompressed or real number - p_compressionType = (QString) inst["CompressionType"]; //valid values: Lossy, Lossless, NotCompressed - p_dataConversionType = (QString) inst["DataConversionType"]; //valid values: 12Bit, 8LSB, Table - p_delayedReadoutFlag = (QString) inst["DelayedReadoutFlag"]; //valid values: Yes, No, Unknown + p_compressionRatio = QString::fromStdString(inst["CompressionRatio"]); //valid values: NotCompressed or real number + p_compressionType = QString::fromStdString(inst["CompressionType"]); //valid values: Lossy, Lossless, NotCompressed + p_dataConversionType = QString::fromStdString(inst["DataConversionType"]); //valid values: 12Bit, 8LSB, Table + p_delayedReadoutFlag = QString::fromStdString( inst["DelayedReadoutFlag"]); //valid values: Yes, No, Unknown p_exposureDuration = (double) inst["ExposureDuration"]; //valid values: real numbers - p_flightSoftwareVersion = (QString) inst["FlightSoftwareVersionId"]; //valid values: Unknown, 1.2, 1.3, 1.4 + p_flightSoftwareVersion = QString::fromStdString( inst["FlightSoftwareVersionId"]); //valid values: Unknown, 1.2, 1.3, 1.4 p_gainModeId = (int) inst["GainModeId"]; //valid values: 12, 29, 95, 215 p_gainState = (int) inst["GainState"]; //valid values: 0, 1, 2, 3 p_instrumentDataRate = (double) inst["InstrumentDataRate"]; //valid values: 60.9, 121.9, 182.8, 243.7, 304.6, 365.6, -999.0 - p_instrumentModeId = (QString) inst["InstrumentModeId"]; //valid values: Full, Sum2, Sum4 - p_instrumentId = (QString) inst["InstrumentId"]; //valid values: ISSNA, ISSWA - p_readoutCycleIndex = (QString) inst["ReadoutCycleIndex"]; //valid values: Unknown or integers 0-15 + p_instrumentModeId = QString::fromStdString( inst["InstrumentModeId"]); //valid values: Full, Sum2, Sum4 + p_instrumentId = QString::fromStdString( inst["InstrumentId"]); //valid values: ISSNA, ISSWA + p_readoutCycleIndex = QString::fromStdString( inst["ReadoutCycleIndex"]); //valid values: Unknown or integers 0-15 p_readoutOrder = (int) inst["ReadoutOrder"]; //valid values: 0 or 1 - p_shutterModeId = (QString) inst["ShutterModeId"]; //valid values: BothSim, NacOnly, WacOnly - p_shutterStateId = (QString) inst["ShutterStateId"]; //valid values: Enabled or Disabled + p_shutterModeId = QString::fromStdString( inst["ShutterModeId"]); //valid values: BothSim, NacOnly, WacOnly + p_shutterStateId = QString::fromStdString( inst["ShutterStateId"]); //valid values: Enabled or Disabled p_summingMode = (int) inst["SummingMode"]; //valid values: 1, 2, 4 - p_frontOpticsTemp = toDouble(inst["OpticsTemperature"][0]); //valid values: real numbers - p_imageTime = (QString) inst["ImageTime"]; - p_targetName = (QString) inst["TargetName"]; //valid values: may change overtime, any subject of a Cassini image + p_frontOpticsTemp = std::stod(inst["OpticsTemperature"][0]); //valid values: real numbers + p_imageTime = QString::fromStdString( inst["ImageTime"]); + p_targetName = QString::fromStdString( inst["TargetName"]); //valid values: may change overtime, any subject of a Cassini image // Get values out of the archive group PvlGroup &arch = lab.findGroup("Archive", Pvl::Traverse); p_imageNumber = (double) arch["ImageNumber"]; // Get values out of the bandbin group PvlGroup &bandbin = lab.findGroup("BandBin", Pvl::Traverse); - IString filter = (QString) bandbin["FilterName"]; + IString filter = QString::fromStdString( bandbin["FilterName"]); p_filter.push_back(filter.Token("/").ToQt()); p_filter.push_back(filter.ToQt()); } diff --git a/isis/src/cassini/objs/IssNACamera/IssNACamera.cpp b/isis/src/cassini/objs/IssNACamera/IssNACamera.cpp index 7e0419b62f..ab053a6d9f 100644 --- a/isis/src/cassini/objs/IssNACamera/IssNACamera.cpp +++ b/isis/src/cassini/objs/IssNACamera/IssNACamera.cpp @@ -46,7 +46,7 @@ namespace Isis { try { PvlGroup bandBin = lab.findGroup("BandBin", Pvl::Traverse); QString key = QString("INS%1_%2_FOCAL_LENGTH"). - arg(naifIkCode()).arg(bandBin["FilterName"][0]); + arg(naifIkCode()).arg(QString::fromStdString(bandBin["FilterName"][0])); key = key.replace("/", "_"); focalLength = getDouble(key); } @@ -58,9 +58,9 @@ namespace Isis { catch (IException &secondException) { PvlGroup bandBin = lab.findGroup("BandBin", Pvl::Traverse); IException finalError(IException::Unknown, - QString("Unable to find a focal length for the requested Cassini ISS NA " - "filter combination [%1] or the default focal length") - .arg(bandBin["FilterName"][0]), + "Unable to find a focal length for the requested Cassini ISS NA " + "filter combination [%1] or the default focal length" + + bandBin["FilterName"][0], _FILEINFO_); finalError.append(firstException); finalError.append(secondException); @@ -77,7 +77,7 @@ namespace Isis { // Get the start time in et PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); - double et = iTime((QString)inst["StartTime"]).Et(); + double et = iTime(QString::fromStdString(inst["StartTime"])).Et(); // divide exposure duration keyword value by 1000 to convert to seconds double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0; diff --git a/isis/src/cassini/objs/IssWACamera/IssWACamera.cpp b/isis/src/cassini/objs/IssWACamera/IssWACamera.cpp index 2f488ca43f..5dfc04d3c5 100644 --- a/isis/src/cassini/objs/IssWACamera/IssWACamera.cpp +++ b/isis/src/cassini/objs/IssWACamera/IssWACamera.cpp @@ -41,7 +41,7 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse); // Get the camera characteristics - QString key = "INS" + toString(naifIkCode()) + "_" + bandBin["FilterName"][0] + "_FOCAL_LENGTH"; + QString key = "INS" + toString(naifIkCode()) + "_" + QString::fromStdString(bandBin["FilterName"][0]) + "_FOCAL_LENGTH"; key = key.replace("/", "_"); double focalLength = Spice::getDouble(key); @@ -53,7 +53,7 @@ namespace Isis { // Get the start time in et PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); - double et = iTime((QString)inst["StartTime"]).Et(); + double et = iTime(QString::fromStdString(inst["StartTime"])).Et(); // divide exposure duration keyword value by 1000 to convert to seconds double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0; diff --git a/isis/src/cassini/objs/VimsCamera/VimsCamera.cpp b/isis/src/cassini/objs/VimsCamera/VimsCamera.cpp index 77591550f9..206d713b26 100644 --- a/isis/src/cassini/objs/VimsCamera/VimsCamera.cpp +++ b/isis/src/cassini/objs/VimsCamera/VimsCamera.cpp @@ -60,7 +60,7 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString channel = (QString) inst ["Channel"]; + QString channel = QString::fromStdString(inst ["Channel"]); // Vims pixel pitch is not always square, but ISISdoes not have the ability to store // more than a single value for pixel pitch. Member variables for pixelPitch x and y @@ -69,23 +69,23 @@ namespace Isis { //LoadFrameMounting ("CASSINI_SC_COORD","CASSINI_VIMS_V"); SetFocalLength(143.0); - if (QString((QString)inst["SamplingMode"]).toUpper() == "NORMAL") { + if (QString(QString::fromStdString(inst["SamplingMode"])).toUpper() == "NORMAL") { SetPixelPitch(3 * .024); // Should this .506? According to 2002 paper ground calibration shows .506 +/- .003 mrad m_pixelPitchX = 0.024 * 3; m_pixelPitchY = 0.024 * 3; } - else if (QString((QString)inst["SamplingMode"]).toUpper() == "HI-RES") { + else if (QString::fromStdString(inst["SamplingMode"]).toUpper() == "HI-RES") { SetPixelPitch(.024); m_pixelPitchX = 0.024; m_pixelPitchY = 0.024; } - else if (QString((QString)inst["SamplingMode"]).toUpper() == "UNDER") { - QString msg = "Isis cannot process images with a SamplingMode = \"UNDER\" (or NYQUIST)"; + else if (QString::fromStdString(inst["SamplingMode"]).toUpper() == "UNDER") { + std::string msg = "Isis cannot process images with a SamplingMode = \"UNDER\" (or NYQUIST)"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { - QString msg = "Unknown SamplingMode [" + (QString) inst["SamplingMode"] + "]"; + std::string msg = "Unknown SamplingMode [" + (std::string)inst["SamplingMode"] + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -94,31 +94,31 @@ namespace Isis { SetFocalLength(426.0); SetPixelPitch(.2); - if (QString((QString)inst["SamplingMode"]).toUpper() == "NORMAL") { + if ((QString::fromStdString(inst["SamplingMode"])).toUpper() == "NORMAL") { m_pixelPitchX = 0.2; m_pixelPitchY = 0.2; } - else if (QString((QString)inst["SamplingMode"]).toUpper() == "HI-RES") { + else if ((QString::fromStdString(inst["SamplingMode"])).toUpper() == "HI-RES") { m_pixelPitchX = 0.103; m_pixelPitchY = 0.2; } - else if (QString((QString)inst["SamplingMode"]).toUpper() == "UNDER") { - QString msg = "Isis cannot process images with a SamplingMode = \"UNDER\" (or NYQUIST)"; + else if ((QString::fromStdString(inst["SamplingMode"])).toUpper() == "UNDER") { + std::string msg = "Isis cannot process images with a SamplingMode = \"UNDER\" (or NYQUIST)"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { - QString msg = "Unknown SamplingMode [" + (QString) inst["SamplingMode"] + "]"; + std::string msg = "Unknown SamplingMode [" + (std::string)inst["SamplingMode"] + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } // Get the start time in et - QString stime = inst ["NativeStartTime"][0]; + QString stime = QString::fromStdString(inst ["NativeStartTime"][0]); QString intTime = stime.split(".").first(); stime = stime.split(".").last(); // Get the end time in et - QString etime = (QString) inst ["NativeStopTime"]; + QString etime = QString::fromStdString(inst ["NativeStopTime"]); intTime = etime.split(".").first(); etime = etime.split(".").last(); diff --git a/isis/src/cassini/objs/VimsCamera/VimsGroundMap.cpp b/isis/src/cassini/objs/VimsCamera/VimsGroundMap.cpp index eef598c496..6f6883c83b 100644 --- a/isis/src/cassini/objs/VimsCamera/VimsGroundMap.cpp +++ b/isis/src/cassini/objs/VimsCamera/VimsGroundMap.cpp @@ -118,9 +118,9 @@ namespace Isis { PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); // Vis or IR - p_channel = (QString) inst ["Channel"]; + p_channel = QString::fromStdString(inst ["Channel"]); // Get the start time in et - QString stime = (QString) inst ["NativeStartTime"]; + QString stime = QString::fromStdString(inst ["NativeStartTime"]); QString intTime = stime.split(".").first(); stime = stime.split(".").last(); @@ -130,12 +130,12 @@ namespace Isis { // Because of inaccuracy with the 15 Mhz clock, the IR exposure and // interline delay need to be adjusted. //---------------------------------------------------------------------- - p_irExp = (toDouble(inst ["ExposureDuration"][0]) * 1.01725) / 1000.; - p_visExp = (toDouble(inst ["ExposureDuration"][1])) / 1000.; - p_interlineDelay = (toDouble(inst ["InterlineDelayDuration"]) * 1.01725) / 1000.; + p_irExp = (std::stod(inst ["ExposureDuration"][0]) * 1.01725) / 1000.; + p_visExp = (std::stod(inst ["ExposureDuration"][1])) / 1000.; + p_interlineDelay = (std::stod(inst ["InterlineDelayDuration"]) * 1.01725) / 1000.; // Get summation mode - QString sampMode = QString((QString)inst ["SamplingMode"]).toUpper(); + QString sampMode = QString::fromStdString(inst ["SamplingMode"]).toUpper(); // Get sample/line offsets int sampOffset = inst ["XOffset"]; diff --git a/isis/src/cassini/objs/VimsCamera/VimsSkyMap.cpp b/isis/src/cassini/objs/VimsCamera/VimsSkyMap.cpp index 45d306b2ba..2ca3d249be 100644 --- a/isis/src/cassini/objs/VimsCamera/VimsSkyMap.cpp +++ b/isis/src/cassini/objs/VimsCamera/VimsSkyMap.cpp @@ -59,9 +59,9 @@ namespace Isis { PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); // Vis or IR - p_channel = (QString) inst ["Channel"]; + p_channel = QString::fromStdString(inst ["Channel"]); // Get the start time in et - QString stime = (QString) inst ["NativeStartTime"]; + QString stime = QString::fromStdString(inst ["NativeStartTime"]); QString intTime = stime.split(".").first(); stime = stime.split(".").last(); @@ -72,12 +72,12 @@ namespace Isis { // Because of inaccuracy with the 15 Mhz clock, the IR exposure and // interline delay need to be adjusted. //---------------------------------------------------------------------- - p_irExp = (toDouble(inst ["ExposureDuration"][0]) * 1.01725) / 1000.; - p_visExp = toDouble(inst ["ExposureDuration"][1]) / 1000.; - p_interlineDelay = (toDouble(inst ["InterlineDelayDuration"]) * 1.01725) / 1000.; + p_irExp = (std::stod(inst ["ExposureDuration"][0]) * 1.01725) / 1000.; + p_visExp = std::stod(inst ["ExposureDuration"][1]) / 1000.; + p_interlineDelay = (std::stod(inst ["InterlineDelayDuration"]) * 1.01725) / 1000.; // Get summation mode - QString sampMode = QString((QString)inst ["SamplingMode"]).toUpper(); + QString sampMode = QString::fromStdString(inst ["SamplingMode"]).toUpper(); // Get sample/line offsets int sampOffset = inst ["XOffset"]; diff --git a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp index df7ca90fa0..c930937f09 100644 --- a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp +++ b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp @@ -85,10 +85,10 @@ namespace Isis { FileName in = ui.GetFileName("FROM"); - Pvl pdsLabel(in.expanded()); + Pvl pdsLabel(in.expanded().toStdString()); if (fileType == (ProcessImportPds::L0 | ProcessImportPds::Rdn)) { // Is this a L0 or L1B product? - if ((QString) pdsLabel["PRODUCT_TYPE"] == "RAW_IMAGE") { + if ((std::string) pdsLabel["PRODUCT_TYPE"] == "RAW_IMAGE") { fileType = ProcessImportPds::L0; } else { @@ -121,8 +121,8 @@ namespace Isis { // west side of image // 4. Ascending yaw / Reverse orbit limb - Lines/times are reversed so northernmost image // line first, - QString yawDirection = (QString) pdsLabel["CH1:SPACECRAFT_YAW_DIRECTION"]; - QString limbDirection = (QString) pdsLabel["CH1:ORBIT_LIMB_DIRECTION"]; + QString yawDirection = QString::fromStdString(pdsLabel["CH1:SPACECRAFT_YAW_DIRECTION"]); + QString limbDirection = QString::fromStdString(pdsLabel["CH1:ORBIT_LIMB_DIRECTION"]); samplesNeedFlipped = ( ((yawDirection == "REVERSE") && (limbDirection == "DESCENDING")) || ((yawDirection == "FORWARD") && (limbDirection == "ASCENDING")) ); linesNeedFlipped = (limbDirection == "ASCENDING"); @@ -143,7 +143,7 @@ namespace Isis { if (g_utcTable->Records() >= 1) { - QString instMode = (QString) pdsLabel["INSTRUMENT_MODE_ID"]; + QString instMode = QString::fromStdString(pdsLabel["INSTRUMENT_MODE_ID"]); // Initialize to the value for a GLOBAL mode observation g_expectedLineRate = 0.10176; if (instMode == "TARGET") { @@ -207,11 +207,11 @@ namespace Isis { } else { importPds.StartProcess(writeCubeWithDroppedLines); - g_results += PvlKeyword("LinesFlipped", toString(linesNeedFlipped)); - g_results += PvlKeyword("SamplesFlipped", toString(samplesNeedFlipped)); - g_results += PvlKeyword("LinesAdded", toString(g_totalLinesAdded)); - g_results += PvlKeyword("OutputLines", toString(outputLines)); - g_results += PvlKeyword("CalculatedOutputLines", toString(calcOutputLines)); + g_results += PvlKeyword("LinesFlipped", std::to_string(linesNeedFlipped)); + g_results += PvlKeyword("SamplesFlipped", std::to_string(samplesNeedFlipped)); + g_results += PvlKeyword("LinesAdded", std::to_string(g_totalLinesAdded)); + g_results += PvlKeyword("OutputLines", std::to_string(outputLines)); + g_results += PvlKeyword("CalculatedOutputLines", std::to_string(calcOutputLines)); } delete g_oBuff; @@ -392,17 +392,17 @@ namespace Isis { lastEt = firstEt + (g_expectedLineRate / 2.0); } - inst.findKeyword("StartTime").setValue(firstEt.UTC()); + inst.findKeyword("StartTime").setValue(firstEt.UTC().toStdString()); SpiceChar startClockString[100]; sce2s_c (sclkCode, firstEt.Et(), 100, startClockString); QString startClock(startClockString); - inst.findKeyword("SpacecraftClockStartCount").setValue(startClock); + inst.findKeyword("SpacecraftClockStartCount").setValue(startClock.toStdString()); - inst.findKeyword("StopTime").setValue(lastEt.UTC()); + inst.findKeyword("StopTime").setValue(lastEt.UTC().toStdString()); SpiceChar stopClockString[100]; sce2s_c (sclkCode, lastEt.Et(), 100, stopClockString); QString stopClock(stopClockString); - inst.findKeyword("SpacecraftClockStopCount").setValue(stopClock); + inst.findKeyword("SpacecraftClockStopCount").setValue(stopClock.toStdString()); } ocube->putGroup(inst); @@ -410,12 +410,12 @@ namespace Isis { if (fileType == ProcessImportPds::L0 || fileType == ProcessImportPds::Rdn) { // Setup the band bin group QString bandFile = "$chandrayaan1/bandBin/bandBin.pvl"; - Pvl bandBinTemplate(bandFile); + Pvl bandBinTemplate(bandFile.toStdString()); PvlObject modeObject = bandBinTemplate.findObject(pdsLabel["INSTRUMENT_MODE_ID"]); PvlGroup bandGroup = modeObject.findGroup("BandBin"); // Add OriginalBand int numBands; - if ((QString)pdsLabel["INSTRUMENT_MODE_ID"] == "TARGET") { + if ((std::string)pdsLabel["INSTRUMENT_MODE_ID"] == "TARGET") { numBands = 256; } else { @@ -433,14 +433,14 @@ namespace Isis { PvlGroup calib("RadiometricCalibration"); PvlKeyword solar = pdsLabel["SOLAR_DISTANCE"]; calib += PvlKeyword("Units", "W/m2/um/sr"); - calib += PvlKeyword("SolarDistance", toString((double)solar), solar.unit()); - calib += PvlKeyword("DetectorTemperature", toString((double)pdsLabel["DETECTOR_TEMPERATURE"])); + calib += PvlKeyword("SolarDistance", std::to_string((double)solar), solar.unit()); + calib += PvlKeyword("DetectorTemperature", std::to_string((double)pdsLabel["DETECTOR_TEMPERATURE"])); calib += PvlKeyword("SpectralCalibrationFileName", - (QString)pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); + pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); calib += PvlKeyword("RadGainFactorFileName", - (QString)pdsLabel["CH1:RAD_GAIN_FACTOR_FILE_NAME"]); + pdsLabel["CH1:RAD_GAIN_FACTOR_FILE_NAME"]); calib += PvlKeyword("GlobalBandpassFileName", - (QString)pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); + pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); ocube->putGroup(calib); } } diff --git a/isis/src/chandrayaan1/objs/Chandrayaan1M3Camera/Chandrayaan1M3Camera.cpp b/isis/src/chandrayaan1/objs/Chandrayaan1M3Camera/Chandrayaan1M3Camera.cpp index e82256bc46..d625a450c2 100644 --- a/isis/src/chandrayaan1/objs/Chandrayaan1M3Camera/Chandrayaan1M3Camera.cpp +++ b/isis/src/chandrayaan1/objs/Chandrayaan1M3Camera/Chandrayaan1M3Camera.cpp @@ -48,7 +48,7 @@ namespace Isis { // Get the start time from labels Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString((std::string)inst["SpacecraftClockStartCount"]); double etStart = getClockTime(stime).Et(); // Get other info from labels diff --git a/isis/src/clementine/apps/clem2isis/main.cpp b/isis/src/clementine/apps/clem2isis/main.cpp index 195cf076cf..dd027253f9 100755 --- a/isis/src/clementine/apps/clem2isis/main.cpp +++ b/isis/src/clementine/apps/clem2isis/main.cpp @@ -40,10 +40,10 @@ void IsisMain() { // Make sure it is a Clementine EDR bool projected; try { - Pvl lab(in.expanded()); + Pvl lab(in.expanded().toStdString()); projected = lab.hasObject("IMAGE_MAP_PROJECTION"); QString id; - id = (QString)lab["DATA_SET_ID"]; + id = QString::fromStdString(lab["DATA_SET_ID"]); id = id.simplified().trimmed(); if (!id.contains("CLEM")) { QString msg = "Invalid DATA_SET_ID [" + id + "]"; @@ -110,7 +110,7 @@ void translateLabels(FileName in, Cube *ocube) { QString transDir = "$ISISROOT/appdata/translations/"; FileName transFile(transDir + "Clementine.trn"); - Pvl pdsLab(in.expanded()); + Pvl pdsLab(in.expanded().toStdString()); PvlToPvlTranslationManager labelXlater(pdsLab, transFile.expanded()); // Pvl outputLabels; @@ -121,24 +121,24 @@ void translateLabels(FileName in, Cube *ocube) { PvlGroup inst = outputLabel->findGroup("Instrument", Pvl::Traverse); PvlKeyword &startTime = inst.findKeyword("StartTime"); - startTime.setValue(startTime[0].mid(0, startTime[0].size() - 1)); + startTime.setValue(startTime[0].substr(0, startTime[0].size() - 1)); // Old PDS labels used keyword INSTRUMENT_COMPRESSION_TYPE & PDS Labels now use ENCODING_TYPE if (pdsLab.findObject("Image").hasKeyword("InstrumentCompressionType")) { - inst += PvlKeyword("EncodingFormat", (QString) pdsLab.findObject("Image")["InstrumentCompressionType"]); + inst += PvlKeyword("EncodingFormat", pdsLab.findObject("Image")["InstrumentCompressionType"]); } else { - inst += PvlKeyword("EncodingFormat", (QString) pdsLab.findObject("Image")["EncodingType"]); + inst += PvlKeyword("EncodingFormat", pdsLab.findObject("Image")["EncodingType"]); } - if (((QString)inst["InstrumentId"]) == "HIRES") { - inst += PvlKeyword("MCPGainModeID", (QString)pdsLab["MCP_Gain_Mode_ID"], ""); + if (((std::string)inst["InstrumentId"]) == "HIRES") { + inst += PvlKeyword("MCPGainModeID", pdsLab["MCP_Gain_Mode_ID"], ""); } ocube->putGroup(inst); PvlGroup bBin = outputLabel->findGroup("BandBin", Pvl::Traverse); - QString filter = pdsLab["FilterName"]; + QString filter = QString::fromStdString(pdsLab["FilterName"]); if (filter != "F") { //Band Bin group double center = pdsLab["CenterFilterWavelength"]; @@ -152,10 +152,10 @@ void translateLabels(FileName in, Cube *ocube) { //Kernel group PvlGroup kern("Kernels"); - if (((QString)inst["InstrumentId"]) == "HIRES") { + if (((std::string)inst["InstrumentId"]) == "HIRES") { kern += PvlKeyword("NaifFrameCode", "-40001"); } - if (((QString)inst["InstrumentId"]) == "UVVIS") { + if (((std::string)inst["InstrumentId"]) == "UVVIS") { // JAA & VS ... modified to support variable focal length and optical // distortion for UVVIS if (filter == "A") { @@ -177,10 +177,10 @@ void translateLabels(FileName in, Cube *ocube) { kern += PvlKeyword("NaifFrameCode", "-40026"); } } - if (((QString)inst["InstrumentId"]) == "NIR") { + if (((std::string)inst["InstrumentId"]) == "NIR") { kern += PvlKeyword("NaifFrameCode", "-40003"); } - if (((QString)inst["InstrumentId"]) == "LWIR") { + if (((std::string)inst["InstrumentId"]) == "LWIR") { kern += PvlKeyword("NaifFrameCode", "-40004"); } ocube->putGroup(kern); diff --git a/isis/src/clementine/apps/clemhirescal/main.cpp b/isis/src/clementine/apps/clemhirescal/main.cpp index ecdbec6306..85a59de443 100644 --- a/isis/src/clementine/apps/clemhirescal/main.cpp +++ b/isis/src/clementine/apps/clemhirescal/main.cpp @@ -33,7 +33,7 @@ void IsisMain() { // Check for filter type of A-D Pvl *label = input->label(); - QString wave = (QString)label->findGroup("BandBin", Pvl::Traverse)["FilterName"]; + QString wave = QString::fromStdString(label->findGroup("BandBin", Pvl::Traverse)["FilterName"]); if((wave != "A") && (wave != "B") && (wave != "C") && (wave != "D")) { QString message = "Invalid FilterName [" + wave + "], can only handle A-D filters"; throw IException(IException::Unknown, message, _FILEINFO_); diff --git a/isis/src/clementine/apps/clemnircal/main.cpp b/isis/src/clementine/apps/clemnircal/main.cpp index 1ca06312f1..c86fba9fb6 100644 --- a/isis/src/clementine/apps/clemnircal/main.cpp +++ b/isis/src/clementine/apps/clemnircal/main.cpp @@ -55,14 +55,14 @@ void IsisMain() { Cube *ocube = p.SetOutputCube("TO"); Cube *ffcube, *ofcube, *afcube, *dccube, *biascube, *bpcube; - QString filter = (QString)(icube->group("BandBin"))["FilterName"]; + QString filter = QString::fromStdString((icube->group("BandBin"))["FilterName"]); filter = filter.toLower(); - QString productID = (QString)(icube->group("Archive"))["ProductID"]; + QString productID = QString::fromStdString((icube->group("Archive"))["ProductID"]); QString orbit = productID.mid(productID.indexOf('.') + 1, productID.length() - 1); // If hemisphere code greater than 'I' set to 'n' else set to 's' char hemisphereCode = (productID[productID.indexOf('.')-1] > 'I') ? 'n' : 's'; - QString compressionType = (QString)(icube->group("Instrument"))["EncodingFormat"]; + QString compressionType = QString::fromStdString((icube->group("Instrument"))["EncodingFormat"]); offsetModeID = (icube->group("Instrument"))["OffsetModeID"]; int gainModeID = (icube->group("Instrument"))["GainModeID"]; QString gainModeIDStr = toString(gainModeID); @@ -123,18 +123,18 @@ void IsisMain() { QString gainFactorDef = "$clementine1/calibration/nir/"; gainFactorDef += "clemnircal.def"; - Pvl gainFactorData(gainFactorDef); + Pvl gainFactorData(gainFactorDef.toStdString()); QString group = "GainModeID"; group += toString(gainModeID); - if(!gainFactorData.hasGroup(group)) { + if(!gainFactorData.hasGroup(group.toStdString())) { QString err = "The Gain Factor for Gain Mode ID ["; err += toString(gainModeID); err += "] could not be found in clemnircal.def"; throw IException(IException::Programmer, err, _FILEINFO_); } - gainFactor = (gainFactorData.findGroup(group))["GAIN"]; + gainFactor = (gainFactorData.findGroup(group.toStdString()))["GAIN"]; if(abs(gainFactor) < DBL_EPSILON) { QString err = "The Gain Factor for Gain Mode ID ["; @@ -239,26 +239,26 @@ void IsisMain() { // Add the radiometry group PvlGroup calgrp("Radiometry"); - calgrp += PvlKeyword("FlatFieldFile", ffcube->fileName()); - calgrp += PvlKeyword("OrbitFlatFieldFile", ofcube->fileName()); - calgrp += PvlKeyword("AdditiveFile", afcube->fileName()); - calgrp += PvlKeyword("DarkCurrentFile", dccube->fileName()); - calgrp += PvlKeyword("BiasFile", biascube->fileName()); - calgrp += PvlKeyword("BadPixelFile", bpcube->fileName()); + calgrp += PvlKeyword("FlatFieldFile", ffcube->fileName().toStdString()); + calgrp += PvlKeyword("OrbitFlatFieldFile", ofcube->fileName().toStdString()); + calgrp += PvlKeyword("AdditiveFile", afcube->fileName().toStdString()); + calgrp += PvlKeyword("DarkCurrentFile", dccube->fileName().toStdString()); + calgrp += PvlKeyword("BiasFile", biascube->fileName().toStdString()); + calgrp += PvlKeyword("BadPixelFile", bpcube->fileName().toStdString()); //Table files - calgrp += PvlKeyword("ThermalCorrectionTable", thermTbl); - calgrp += PvlKeyword("AdditiveFileTable", afFileTableLoc); + calgrp += PvlKeyword("ThermalCorrectionTable", thermTbl.toStdString()); + calgrp += PvlKeyword("AdditiveFileTable", afFileTableLoc.toStdString()); - calgrp += PvlKeyword("DigitalOffset", toString(digitalOffset)); - calgrp += PvlKeyword("GlobalBias", toString(globalBias)); - calgrp += PvlKeyword("GlobalDarkCoefficient", toString(globalDarkCoefficient)); - calgrp += PvlKeyword("V", toString(vConstant)); + calgrp += PvlKeyword("DigitalOffset", std::to_string(digitalOffset)); + calgrp += PvlKeyword("GlobalBias", std::to_string(globalBias)); + calgrp += PvlKeyword("GlobalDarkCoefficient", std::to_string(globalDarkCoefficient)); + calgrp += PvlKeyword("V", std::to_string(vConstant)); //Calculated in processing routine - calgrp += PvlKeyword("GainFactor", toString(gainFactor)); - calgrp += PvlKeyword("AbsoluteCoefficient", toString(absoluteCoefficient)); - calgrp += PvlKeyword("CryoNorm", toString(cryonorm)); - calgrp += PvlKeyword("OptimalExposureDuration", toString(optimalExposureDuration)); + calgrp += PvlKeyword("GainFactor", std::to_string(gainFactor)); + calgrp += PvlKeyword("AbsoluteCoefficient", std::to_string(absoluteCoefficient)); + calgrp += PvlKeyword("CryoNorm", std::to_string(cryonorm)); + calgrp += PvlKeyword("OptimalExposureDuration", std::to_string(optimalExposureDuration)); ocube->putGroup(calgrp); p.EndProcess(); diff --git a/isis/src/clementine/apps/clemuvviscal/main.cpp b/isis/src/clementine/apps/clemuvviscal/main.cpp index 232d42cdca..46475a009b 100644 --- a/isis/src/clementine/apps/clemuvviscal/main.cpp +++ b/isis/src/clementine/apps/clemuvviscal/main.cpp @@ -66,7 +66,7 @@ void IsisMain() { dccube = p.SetInputCube(dcfileloc, cubeAtt); } - QString filter = (QString)(icube->group("BandBin"))["FilterName"]; + QString filter = QString::fromStdString((icube->group("BandBin"))["FilterName"]); filter = filter.toLower(); Cube *ffcube; @@ -94,9 +94,9 @@ void IsisMain() { Cube *ocube = p.SetOutputCube("TO"); - avgFF = uvvisDef.findGroup("Filter" + filter.toUpper())["AVGFF"]; - cr = uvvisDef.findGroup("Filter" + filter.toUpper())["CO"]; - gain = uvvisDef.findGroup(QString("GainModeID") + QString(icube->group("Instrument")["GainModeID"][0]))["GAIN"]; + avgFF = uvvisDef.findGroup("Filter" + filter.toUpper().toStdString())["AVGFF"]; + cr = uvvisDef.findGroup("Filter" + filter.toUpper().toStdString())["CO"]; + gain = uvvisDef.findGroup("GainModeID" + icube->group("Instrument")["GainModeID"][0])["GAIN"]; useDcconst = ui.WasEntered("DCCONST"); if(useDcconst) { @@ -110,7 +110,7 @@ void IsisMain() { exposureDuration = icube->group("Instrument")["ExposureDuration"]; offsetModeID = icube->group("Instrument")["OffsetModeID"]; - if(((QString)icube->group("Instrument")["FocalPlaneTemperature"]).compare("UNK") == 0) { + if((QString::fromStdString(icube->group("Instrument")["FocalPlaneTemperature"])).compare("UNK") == 0) { //if FocalPlaneTemp is unknown set it to zero focalPlaneTemp = 0.0; } @@ -131,8 +131,8 @@ void IsisMain() { if(ui.GetBoolean("TCOR") || abs(focalPlaneTemp) <= DBL_EPSILON) { // Temperature correction requires the use of the mission phase // (PRELAUNCH, EARTH, LUNAR) and the product ID. - QString productID = (QString)(icube->group("Archive")["ProductID"]); - QChar missionPhase = ((QString)((icube->group("Archive"))["MissionPhase"])).at(0); + QString productID = QString::fromStdString((icube->group("Archive")["ProductID"])); + QChar missionPhase = (QString::fromStdString(((icube->group("Archive"))["MissionPhase"]))).at(0); QString n1subQString(productID.mid(productID.indexOf('.') + 1, productID.length() - 1)); QString n2subQString(productID.mid(4, productID.indexOf('.') - 5)); int n1 = toInt(n1subQString); @@ -169,31 +169,31 @@ void IsisMain() { // Add the radiometry group PvlGroup calgrp("Radiometry"); - calgrp += PvlKeyword("FlatFieldFile", ffcube->fileName()); + calgrp += PvlKeyword("FlatFieldFile", ffcube->fileName().toStdString()); if(ui.GetString("DARKCURRENT").compare("DCFILE") == 0) { - calgrp += PvlKeyword("DarkCurrentFile", dccube->fileName()); + calgrp += PvlKeyword("DarkCurrentFile", dccube->fileName().toStdString()); } else { - calgrp += PvlKeyword("DarkCurrentConstant", toString(dcconst)); + calgrp += PvlKeyword("DarkCurrentConstant", std::to_string(dcconst)); } - calgrp += PvlKeyword("CorrectedFocalPlaneTemp", toString(focalPlaneTemp)); - calgrp += PvlKeyword("C1", toString(avgFF)); - calgrp += PvlKeyword("C2", toString(C2)); - calgrp += PvlKeyword("C3", toString(C3)); - calgrp += PvlKeyword("C4", toString(C4)); - calgrp += PvlKeyword("C5", toString(C5)); - calgrp += PvlKeyword("CR", toString(cr)); - calgrp += PvlKeyword("FrameTransferTimePerRow", toString(cr)); - calgrp += PvlKeyword("Gain", toString(gain)); - calgrp += PvlKeyword("CorrectedExposureDuration", toString(correctedExposureDuration)); - calgrp += PvlKeyword("ConvertToRadiance", toString(conv)); - - calgrp += PvlKeyword("ACO", toString(ACO)); - calgrp += PvlKeyword("BCO", toString(BCO)); - calgrp += PvlKeyword("CCO", toString(CCO)); - calgrp += PvlKeyword("DCO", toString(DCO)); + calgrp += PvlKeyword("CorrectedFocalPlaneTemp", std::to_string(focalPlaneTemp)); + calgrp += PvlKeyword("C1", std::to_string(avgFF)); + calgrp += PvlKeyword("C2", std::to_string(C2)); + calgrp += PvlKeyword("C3", std::to_string(C3)); + calgrp += PvlKeyword("C4", std::to_string(C4)); + calgrp += PvlKeyword("C5", std::to_string(C5)); + calgrp += PvlKeyword("CR", std::to_string(cr)); + calgrp += PvlKeyword("FrameTransferTimePerRow", std::to_string(cr)); + calgrp += PvlKeyword("Gain", std::to_string(gain)); + calgrp += PvlKeyword("CorrectedExposureDuration", std::to_string(correctedExposureDuration)); + calgrp += PvlKeyword("ConvertToRadiance", std::to_string(conv)); + + calgrp += PvlKeyword("ACO", std::to_string(ACO)); + calgrp += PvlKeyword("BCO", std::to_string(BCO)); + calgrp += PvlKeyword("CCO", std::to_string(CCO)); + calgrp += PvlKeyword("DCO", std::to_string(DCO)); ocube->putGroup(calgrp); p.EndProcess(); diff --git a/isis/src/clementine/objs/HiresCamera/HiresCamera.cpp b/isis/src/clementine/objs/HiresCamera/HiresCamera.cpp index 75cdfaf3a6..c25bd88d71 100644 --- a/isis/src/clementine/objs/HiresCamera/HiresCamera.cpp +++ b/isis/src/clementine/objs/HiresCamera/HiresCamera.cpp @@ -43,7 +43,7 @@ namespace Isis { NaifStatus::CheckErrors(); Pvl &lab = *cube.label(); // Get the camera characteristics - QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["FilterName"]; + QString filter = QString::fromStdString(lab.findGroup("BandBin", Pvl::Traverse)["FilterName"]); filter = filter.toUpper(); SetFocalLength(); @@ -53,7 +53,7 @@ namespace Isis { PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); // set variables startTime and exposureDuration - double time = iTime((QString)inst["StartTime"]).Et(); + double time = iTime(QString::fromStdString(inst["StartTime"])).Et(); // divide exposure duration keyword value by 1000 to convert to seconds double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0; diff --git a/isis/src/clementine/objs/LwirCamera/LwirCamera.cpp b/isis/src/clementine/objs/LwirCamera/LwirCamera.cpp index 4a302ca216..e40b8fd6be 100644 --- a/isis/src/clementine/objs/LwirCamera/LwirCamera.cpp +++ b/isis/src/clementine/objs/LwirCamera/LwirCamera.cpp @@ -45,7 +45,7 @@ namespace Isis { // Get the camera characteristics Pvl &lab = *cube.label(); - QString filter = (lab.findGroup("BandBin", Pvl::Traverse))["FilterName"]; + QString filter = QString::fromStdString((lab.findGroup("BandBin", Pvl::Traverse))["FilterName"]); filter = filter.toUpper(); @@ -56,7 +56,7 @@ namespace Isis { PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); // set variables startTime and exposureDuration - double time = iTime((QString)inst["StartTime"]).Et(); + double time = iTime(QString::fromStdString(inst["StartTime"])).Et(); // divide exposure duration keyword value by 1000 to convert to seconds double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0; diff --git a/isis/src/clementine/objs/NirCamera/NirCamera.cpp b/isis/src/clementine/objs/NirCamera/NirCamera.cpp index dd04a3bb3c..a23ccd3eed 100644 --- a/isis/src/clementine/objs/NirCamera/NirCamera.cpp +++ b/isis/src/clementine/objs/NirCamera/NirCamera.cpp @@ -44,7 +44,7 @@ namespace Isis { // Get the camera characteristics Pvl &lab = *cube.label(); - QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["FilterName"]; + QString filter = QString::fromStdString((lab.findGroup("BandBin", Pvl::Traverse))["FilterName"]); filter = filter.toUpper(); @@ -73,7 +73,7 @@ namespace Isis { PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); // set variables startTime and exposureDuration - double et = iTime((QString)inst["StartTime"]).Et(); + double et = iTime(QString::fromStdString(inst["StartTime"])).Et(); // divide exposure duration keyword value by 1000 to convert to seconds double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0; diff --git a/isis/src/clementine/objs/UvvisCamera/UvvisCamera.cpp b/isis/src/clementine/objs/UvvisCamera/UvvisCamera.cpp index 7c7f73e1ea..0730377625 100755 --- a/isis/src/clementine/objs/UvvisCamera/UvvisCamera.cpp +++ b/isis/src/clementine/objs/UvvisCamera/UvvisCamera.cpp @@ -47,7 +47,7 @@ namespace Isis { PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); // set variables startTime and exposureDuration - double time = iTime((QString)inst["StartTime"]).Et(); + double time = iTime(QString::fromStdString(inst["StartTime"])).Et(); // divide exposure duration keyword value by 1000 to convert to seconds double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0; diff --git a/isis/src/clipper/apps/eis2isis/eis2isis.cpp b/isis/src/clipper/apps/eis2isis/eis2isis.cpp index 03a2554db5..95eb47d418 100644 --- a/isis/src/clipper/apps/eis2isis/eis2isis.cpp +++ b/isis/src/clipper/apps/eis2isis/eis2isis.cpp @@ -84,23 +84,23 @@ namespace Isis { // Remove trailing "Z" from StartTime for ISIS label PvlKeyword *startTime = &outputLabel->findGroup("Instrument", Pvl::Traverse)["StartTime"]; - QString startTimeString = startTime[0]; + QString startTimeString = QString::fromStdString(startTime[0]); if (startTimeString.endsWith("Z", Qt::CaseInsensitive)) { startTimeString.chop(1); - startTime->setValue(startTimeString); + startTime->setValue(startTimeString.toStdString()); } PvlKeyword *instrumentName = &outputLabel->findGroup("Instrument", Pvl::Traverse)["InstrumentId"]; - QString instrumentNameString = instrumentName[0]; + QString instrumentNameString = QString::fromStdString(instrumentName[0]); PvlGroup kerns("Kernels"); if (instrumentNameString == "EIS-NAC-RS") { // This ID will need to be updated. It is temporarily used for testing but is NOT the actual // NAC ID. - kerns += PvlKeyword("NaifFrameCode", toString(-159101)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-159101)); } else if (instrumentNameString == "EIS-WAC-FC") { - kerns += PvlKeyword("NaifFrameCode", toString(-159102)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-159102)); } else { QString msg = "Input file [" + xmlFileName.expanded() + "] has an invalid " + @@ -229,14 +229,14 @@ namespace Isis { // Set a default value for the JitterSampleCoefficients and the JitterLineCoefficient keywords in the Instrument group. // These values are overwritten with a call to the jitterfit application. - PvlKeyword jitterLineCoefficients = PvlKeyword("JitterLineCoefficients", (toString(0.0))); - jitterLineCoefficients += toString(0.0); - jitterLineCoefficients += toString(0.0); + PvlKeyword jitterLineCoefficients = PvlKeyword("JitterLineCoefficients", (std::to_string(0.0))); + jitterLineCoefficients += std::to_string(0.0); + jitterLineCoefficients += std::to_string(0.0); outputLabel->findGroup("Instrument", PvlObject::Traverse).addKeyword(jitterLineCoefficients); - PvlKeyword jitterSampleCoefficients = PvlKeyword("JitterSampleCoefficients", (toString(0.0))); - jitterSampleCoefficients += toString(0.0); - jitterSampleCoefficients += toString(0.0); + PvlKeyword jitterSampleCoefficients = PvlKeyword("JitterSampleCoefficients", (std::to_string(0.0))); + jitterSampleCoefficients += std::to_string(0.0); + jitterSampleCoefficients += std::to_string(0.0); outputLabel->findGroup("Instrument", PvlObject::Traverse).addKeyword(jitterSampleCoefficients); @@ -353,7 +353,7 @@ namespace Isis { record += lineField; record += timeField; - Table table(tableName, record); + Table table(tableName.toStdString(), record); QVector > tvector; @@ -414,7 +414,7 @@ namespace Isis { record += lineField; record += timeField; - Table table(tableName, record); + Table table(tableName.toStdString(), record); // Grab the values from the csv and put them into the table row-by-row for (int i = 0; i < csv.rows(); i++) { diff --git a/isis/src/clipper/apps/jitterfit/jitterfit.cpp b/isis/src/clipper/apps/jitterfit/jitterfit.cpp index bfaf17d3c4..beb64abd46 100644 --- a/isis/src/clipper/apps/jitterfit/jitterfit.cpp +++ b/isis/src/clipper/apps/jitterfit/jitterfit.cpp @@ -44,7 +44,7 @@ namespace Isis{ checkCube.open(ui.GetCubeName("FROM2"), "r"); Pvl defFile; - defFile.read(ui.GetFileName("DEFFILE")); + defFile.read(ui.GetFileName("DEFFILE").toStdString()); AutoReg *ar = AutoRegFactory::Create(defFile); double scale = ui.GetDouble("SCALE"); @@ -64,8 +64,8 @@ namespace Isis{ } // ???? Question: Why use a file name here? Can't Table/blob read from an open Cube? - Table mainReadouts(QString("Normalized Main Readout Line Times"), jitterCube.fileName()); - Table checklineReadouts(QString("Normalized Checkline Readout Line Times"), checkCube.fileName()); + Table mainReadouts("Normalized Main Readout Line Times", jitterCube.fileName()); + Table checklineReadouts("Normalized Checkline Readout Line Times", checkCube.fileName()); // Register each check line to the area near the corresponding main image line using the // registration definition file @@ -186,8 +186,8 @@ namespace Isis{ jitterSampleCoefficients.setValue(std::to_string(sampleFunction->Coefficient(i))); } else { - jitterLineCoefficients += toString(lineFunction->Coefficient(i)); - jitterSampleCoefficients += toString(sampleFunction->Coefficient(i)); + jitterLineCoefficients += std::to_string(lineFunction->Coefficient(i)); + jitterSampleCoefficients += std::to_string(sampleFunction->Coefficient(i)); } } diff --git a/isis/src/clipper/objs/ClipperNacRollingShutterCamera/ClipperNacRollingShutterCamera.cpp b/isis/src/clipper/objs/ClipperNacRollingShutterCamera/ClipperNacRollingShutterCamera.cpp index 6b24e2e1d4..2fa75354d0 100644 --- a/isis/src/clipper/objs/ClipperNacRollingShutterCamera/ClipperNacRollingShutterCamera.cpp +++ b/isis/src/clipper/objs/ClipperNacRollingShutterCamera/ClipperNacRollingShutterCamera.cpp @@ -48,7 +48,7 @@ namespace Isis { PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); // Set up start time and exposure duration - QString startTime = inst["StartTime"]; + QString startTime = QString::fromStdString(inst["StartTime"]); iTime etStart(startTime); // Use to calculate center time when exposure duration is available @@ -67,15 +67,15 @@ namespace Isis { && cube.hasTable("Normalized Main Readout Line Times")) { PvlKeyword sampleCoefficients = inst.findKeyword("JitterSampleCoefficients"); for (int i = 0; i < sampleCoefficients.size(); i++) { - sampleCoeffs.push_back(sampleCoefficients[i].toDouble()); + sampleCoeffs.push_back(std::stod(sampleCoefficients[i])); } PvlKeyword lineCoefficients = inst.findKeyword("JitterLineCoefficients"); for (int i = 0; i < lineCoefficients.size(); i++) { - lineCoeffs.push_back(lineCoefficients[i].toDouble()); + lineCoeffs.push_back(std::stod(lineCoefficients[i])); } - Table normalizedReadoutTimes("Normalized Main Readout Line Times", lab.fileName(), lab); + Table normalizedReadoutTimes("Normalized Main Readout Line Times", QString::fromStdString(lab.fileName()), lab); for (int i = 0; i < normalizedReadoutTimes.Records(); i++) { TableRecord record = normalizedReadoutTimes[i]; diff --git a/isis/src/clipper/objs/ClipperWacFcCamera/ClipperWacFcCamera.cpp b/isis/src/clipper/objs/ClipperWacFcCamera/ClipperWacFcCamera.cpp index 7f99cd1f2f..cb12062bd5 100644 --- a/isis/src/clipper/objs/ClipperWacFcCamera/ClipperWacFcCamera.cpp +++ b/isis/src/clipper/objs/ClipperWacFcCamera/ClipperWacFcCamera.cpp @@ -59,7 +59,7 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString startTime = inst["StartTime"]; + QString startTime = QString::fromStdString(inst["StartTime"]); iTime etStart(startTime); // double exposureDuration = (double)inst["ExposureDuration"] / 1000.0; diff --git a/isis/src/control/apps/cnet2dem/main.cpp b/isis/src/control/apps/cnet2dem/main.cpp index 94e994b008..6f0b79fd58 100644 --- a/isis/src/control/apps/cnet2dem/main.cpp +++ b/isis/src/control/apps/cnet2dem/main.cpp @@ -205,7 +205,7 @@ void IsisMain() { std::cout << "\nCreating output DEM to determine 3-D normalization...\n"; //Get the map projection file provided by the user Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); // PvlGroup &mapGrp = userMap.FindGroup("Mapping", Pvl::Traverse); int csamps, clines; @@ -380,8 +380,8 @@ void IsisMain() { PvlKeyword fname("Name"); PvlKeyword cnumber("Number"); for (int i = 0 ; i < functors.size() ; i++) { - fname.addValue(functors[i]->name()); - cnumber.addValue(QString::number(i+1)); + fname.addValue(functors[i]->name().toStdString()); + cnumber.addValue(std::to_string(i+1)); } // Create the BandBin group diff --git a/isis/src/control/apps/cnet2mat/main.cpp b/isis/src/control/apps/cnet2mat/main.cpp index 49bb72cbf5..48d350ddd5 100644 --- a/isis/src/control/apps/cnet2mat/main.cpp +++ b/isis/src/control/apps/cnet2mat/main.cpp @@ -41,14 +41,14 @@ void IsisMain() { SerialNumberList snl(ui.GetFileName("LIST3")); for (int f = 0; f < list2.size(); f++) { QString currFile(list2[f].toString()); - Pvl lab(currFile); + Pvl lab(currFile.toStdString()); PvlObject qube(lab.findObject("QUBE")); QString fsc; if(qube.hasKeyword("IMAGE_NUMBER")) { - fsc = qube.findKeyword("IMAGE_NUMBER")[0]; + fsc = QString::fromStdString(qube.findKeyword("IMAGE_NUMBER")[0]); } else if(qube.hasKeyword("IMAGE_ID")) { - fsc = qube.findKeyword("IMAGE_ID")[0]; + fsc = QString::fromStdString(qube.findKeyword("IMAGE_ID")[0]); } else { QString msg = "Unable to find keyword [\"IMAGE_NUMBER\" or \"IMAGE_ID\"] in file ["; diff --git a/isis/src/control/apps/cnetadd/main.cpp b/isis/src/control/apps/cnetadd/main.cpp index 294169273a..550a11a836 100644 --- a/isis/src/control/apps/cnetadd/main.cpp +++ b/isis/src/control/apps/cnetadd/main.cpp @@ -82,7 +82,7 @@ void IsisMain() { bool checkMeasureValidity = ui.WasEntered("DEFFILE"); QScopedPointer validator; if (checkMeasureValidity) { - Pvl deffile(ui.GetFileName("DEFFILE")); + Pvl deffile(ui.GetFileName("DEFFILE").toStdString()); validator.reset(new ControlNetValidMeasure(deffile)); } @@ -104,7 +104,7 @@ void IsisMain() { // Check for duplicate SNs accross the lists if (fromSerials->hasSerialNumber(addSerials.serialNumber(i))) { - duplicates.addValue(addSerials.fileName(i)); + duplicates.addValue(addSerials.fileName(i).toStdString()); } // Check for duplicate SNs within the addlist @@ -259,7 +259,7 @@ void IsisMain() { if (log) { PvlKeyword &logKeyword = (imageAdded) ? added : omitted; - logKeyword.addValue(addList[img].baseName()); + logKeyword.addValue(addList[img].baseName().toStdString()); } progress.CheckStatus(); @@ -269,7 +269,7 @@ void IsisMain() { // Add the list of modified points to the output log file QList modifiedPointsList = g_modifications.keys(); for (int i = 0; i < modifiedPointsList.size(); i++) - pointsModified += modifiedPointsList[i]; + pointsModified += modifiedPointsList[i].toStdString(); results.addKeyword(added); results.addKeyword(omitted); @@ -278,7 +278,7 @@ void IsisMain() { results.addKeyword(duplicates); } - results.write(logFile.expanded()); + results.write(logFile.expanded().toStdString()); } // List the modified points diff --git a/isis/src/control/apps/cnetedit/main.cpp b/isis/src/control/apps/cnetedit/main.cpp index 0eab06ab54..b8b7fd5b4b 100644 --- a/isis/src/control/apps/cnetedit/main.cpp +++ b/isis/src/control/apps/cnetedit/main.cpp @@ -44,7 +44,7 @@ void PrintTemp() { // Get template PVL Pvl userTemp; - userTemp.read(ui.GetFileName("DEFFILE")); + userTemp.read(ui.GetFileName("DEFFILE").toStdString()); // Write template file out to the log Isis::Application::GuiLog(userTemp); diff --git a/isis/src/control/apps/cnetmerge/main.cpp b/isis/src/control/apps/cnetmerge/main.cpp index 5679d4cced..9c45bc157f 100644 --- a/isis/src/control/apps/cnetmerge/main.cpp +++ b/isis/src/control/apps/cnetmerge/main.cpp @@ -156,7 +156,7 @@ void IsisMain() { if (report) { Pvl outPvl; outPvl.addObject(conflictLog); - outPvl.write(logName); + outPvl.write(logName.toStdString()); } // Writes out the final Control Net @@ -185,10 +185,10 @@ ControlNet * mergeNetworks(FileList &filelist, PvlObject &conflictLog, if (report) { PvlObject duplicate("Duplicate"); - duplicate.addKeyword(PvlKeyword("PointId", point->GetId())); + duplicate.addKeyword(PvlKeyword("PointId", point->GetId().toStdString())); duplicate.addKeyword(PvlKeyword( - "SourceNetwork", pointSources[point->GetId()])); - duplicate.addKeyword(PvlKeyword("AddNetwork", cnetName.name())); + "SourceNetwork", pointSources[point->GetId()].toStdString())); + duplicate.addKeyword(PvlKeyword("AddNetwork", cnetName.name().toStdString())); errors.addObject(duplicate); } else { @@ -210,7 +210,7 @@ ControlNet * mergeNetworks(FileList &filelist, PvlObject &conflictLog, if (hasDuplicates && report) { Pvl outPvl; outPvl.addObject(errors); - outPvl.write(logName); + outPvl.write(logName.toStdString()); QString msg = "Networks contained duplicate points. See log file [" + FileName(logName).name() + "] for details. " @@ -478,7 +478,7 @@ void addMeasure(ControlPoint *basePoint, ControlPoint *newPoint, PvlObject createNetworkLog(ControlNet &cnet) { PvlObject cnetLog("Network"); - PvlKeyword networkId("NetworkId", cnet.GetNetworkId()); + PvlKeyword networkId("NetworkId", cnet.GetNetworkId().toStdString()); cnetLog.addKeyword(networkId); return cnetLog; } @@ -486,7 +486,7 @@ PvlObject createNetworkLog(ControlNet &cnet) { PvlObject createPointLog(ControlPoint *point) { PvlObject pointLog("Point"); - PvlKeyword pointId("PointId", point->GetId()); + PvlKeyword pointId("PointId", point->GetId().toStdString()); pointLog.addKeyword(pointId); return pointLog; } @@ -502,7 +502,7 @@ void reportConflict(PvlObject &pointLog, QString conflict) { // Add a point conflict message to the point log if we're reporting these // conflicts to a log file if (report) { - PvlKeyword resolution("Resolution", conflict); + PvlKeyword resolution("Resolution", conflict.toStdString()); pointLog.addKeyword(resolution); } } @@ -512,7 +512,7 @@ void reportConflict(PvlGroup &measureLog, QString sn, QString conflict) { // Add a measure conflict message to the measure log if we're reporting these // conflicts to a log file if (report) { - PvlKeyword resolution(sn, conflict); + PvlKeyword resolution(sn.toStdString(), conflict.toStdString()); measureLog.addKeyword(resolution); } } diff --git a/isis/src/control/apps/cnetnewradii/main.cpp b/isis/src/control/apps/cnetnewradii/main.cpp index 72fc4d450a..dfb3e39466 100644 --- a/isis/src/control/apps/cnetnewradii/main.cpp +++ b/isis/src/control/apps/cnetnewradii/main.cpp @@ -161,11 +161,11 @@ void IsisMain() { // Write results to Logs // Summary group is created with the counts of successes and failures PvlGroup summaryGroup = PvlGroup("Summary"); - summaryGroup.addKeyword(PvlKeyword("Successes", toString(numSuccesses))); - summaryGroup.addKeyword(PvlKeyword("Failures", toString(numFailures))); + summaryGroup.addKeyword(PvlKeyword("Successes", std::to_string(numSuccesses))); + summaryGroup.addKeyword(PvlKeyword("Failures", std::to_string(numFailures))); summaryGroup.addKeyword(PvlKeyword("NumberFixedConstrainedPoints", - toString(numConstrainedFixed))); - summaryGroup.addKeyword(PvlKeyword("NumberEditLockedPoints", toString(numLocked))); + std::to_string(numConstrainedFixed))); + summaryGroup.addKeyword(PvlKeyword("NumberEditLockedPoints", std::to_string(numLocked))); bool errorlog; FileName errorlogFile; @@ -194,14 +194,14 @@ void IsisMain() { if (numFailures > 0) { // if there are any failures, add comment to the summary log to alert user summaryGroup.addComment("Unable to calculate radius for all points. Point" - " IDs for failures contained in [" + errorlogFile.name() + "]."); + " IDs for failures contained in [" + errorlogFile.name().toStdString() + "]."); PvlGroup failGroup = PvlGroup("Failures"); failGroup.addComment("A point fails if we are unable to set universal " "ground or if the radius calculated is a special pixel value."); - failGroup.addKeyword(PvlKeyword("PointIDs", failedIDs)); + failGroup.addKeyword(PvlKeyword("PointIDs", failedIDs.toStdString())); results.addGroup(failGroup); } - results.write(errorlogFile.expanded()); + results.write(errorlogFile.expanded().toStdString()); } // Write summary to application log Application::Log(summaryGroup); diff --git a/isis/src/control/apps/cnetref/main.cpp b/isis/src/control/apps/cnetref/main.cpp index 5c40ebcab1..c3d0671777 100644 --- a/isis/src/control/apps/cnetref/main.cpp +++ b/isis/src/control/apps/cnetref/main.cpp @@ -54,7 +54,7 @@ void IsisMain() { Pvl pvlTemplate, pvlResults; if (ui.WasEntered("DEFFILE")) { bDefFile = true; - pvlDefFile = new Pvl(ui.GetFileName("DEFFILE")); + pvlDefFile = new Pvl(ui.GetFileName("DEFFILE").toStdString()); // Log the DefFile Application::Log(pvlDefFile->group(0)); @@ -164,7 +164,7 @@ void IsisMain() { if (bLogFile) { Pvl pvlLog = interestOp->GetLogPvl(); pvlLog += opGroup; - pvlLog.write(sLogFile); + pvlLog.write(sLogFile.toStdString()); } Application::Log(interestOp->GetStdOptions()); Application::Log(interestOp->GetStatistics()); @@ -182,7 +182,7 @@ void IsisMain() { if (cnetValidMeas) { Pvl pvlLog = cnetValidMeas->GetLogPvl(); if (bLogFile) { - pvlLog.write(sLogFile); + pvlLog.write(sLogFile.toStdString()); } Application::Log(cnetValidMeas->GetStdOptions()); Application::Log(cnetValidMeas->GetStatistics()); @@ -244,7 +244,7 @@ void ViewDefFile() { // Get template PVL Pvl defFile; - defFile.read(ui.GetFileName("DEFFILE")); + defFile.read(ui.GetFileName("DEFFILE").toStdString()); // Write deffile file out to the log Isis::Application::GuiLog(defFile); diff --git a/isis/src/control/apps/coreg/main.cpp b/isis/src/control/apps/coreg/main.cpp index 2cd0bedae7..f7dcf5da47 100644 --- a/isis/src/control/apps/coreg/main.cpp +++ b/isis/src/control/apps/coreg/main.cpp @@ -98,7 +98,7 @@ void IsisMain() { // We need to get a user definition of how to auto correlate around each // of the control points. Pvl regdef; - regdef.read(ui.GetFileName("DEFFILE")); + regdef.read(ui.GetFileName("DEFFILE").toStdString()); AutoReg *ar = AutoRegFactory::Create(regdef); // We want to create a grid of control points that is N rows by M columns. @@ -201,14 +201,14 @@ void IsisMain() { double lMax = (int)(lStats.Maximum() * 100.0) / 100.0; double lDev = (int)(lStats.StandardDeviation() * 100.0) / 100.0; - results += PvlKeyword("SampleMinimum", toString(sMin)); - results += PvlKeyword("SampleAverage", toString(sTrans)); - results += PvlKeyword("SampleMaximum", toString(sMax)); - results += PvlKeyword("SampleStandardDeviation", toString(sDev)); - results += PvlKeyword("LineMinimum", toString(lMin)); - results += PvlKeyword("LineAverage", toString(lTrans)); - results += PvlKeyword("LineMaximum", toString(lMax)); - results += PvlKeyword("LineStandardDeviation", toString(lDev)); + results += PvlKeyword("SampleMinimum", std::to_string(sMin)); + results += PvlKeyword("SampleAverage", std::to_string(sTrans)); + results += PvlKeyword("SampleMaximum", std::to_string(sMax)); + results += PvlKeyword("SampleStandardDeviation", std::to_string(sDev)); + results += PvlKeyword("LineMinimum", std::to_string(lMin)); + results += PvlKeyword("LineAverage", std::to_string(lTrans)); + results += PvlKeyword("LineMaximum", std::to_string(lMax)); + results += PvlKeyword("LineStandardDeviation", std::to_string(lDev)); Application::Log(results); Pvl arPvl = ar->RegistrationStatistics(); @@ -289,7 +289,7 @@ void helperButtonLog() { UserInterface &ui = Application::GetUserInterface(); QString file(ui.GetFileName("DEFFILE")); Pvl p; - p.read(file); + p.read(file.toStdString()); Application::GuiLog(p); } //...........end of helper function ........ diff --git a/isis/src/control/apps/deltack/main.cpp b/isis/src/control/apps/deltack/main.cpp index 3aaa8cd2f5..ae50d8f730 100644 --- a/isis/src/control/apps/deltack/main.cpp +++ b/isis/src/control/apps/deltack/main.cpp @@ -88,14 +88,14 @@ void IsisMain() { // Execute the requested method //---------------------------------------------------------------------------------- PvlGroup results("DeltackResults"); - results += PvlKeyword("Method", method); + results += PvlKeyword("Method", method.toStdString()); if ( "direct" == method ) { Camera *v_cam = c.camera(); // Map the latitude/longitude to a line/sample of the desired update // cout << "Input Lat, Lon = " << lat1.degrees() << "," << lon1.degrees() << "\n"; - results += PvlKeyword("Lat1", toString(lat1.degrees()), "degrees"); - results += PvlKeyword("Lon1", toString(lon1.degrees()), "degrees"); + results += PvlKeyword("Lat1", std::to_string(lat1.degrees()), "degrees"); + results += PvlKeyword("Lon1", std::to_string(lon1.degrees()), "degrees"); if ( !v_cam->SetUniversalGround(lat1.degrees(), lon1.degrees()) ) { QString mess = "Geometry coordinate does not map into image at location (" + QString::number(lat1.degrees()) + "," + QString::number(lon1.degrees()) + ")"; @@ -104,15 +104,15 @@ void IsisMain() { // Get the surface coordinate in body fixed // cout << "Sample, Line = " << v_cam->Sample() << "," << v_cam->Line() << "\n"; - results += PvlKeyword("Lat1Lon1Sample", toString(v_cam->Sample())); - results += PvlKeyword("Lat1Lon1Line", toString(v_cam->Line())); + results += PvlKeyword("Lat1Lon1Sample", std::to_string(v_cam->Sample())); + results += PvlKeyword("Lat1Lon1Line", std::to_string(v_cam->Line())); double pt2[3]; v_cam->Coordinate(pt2); // Retrieve the current geometry of a point to use as reference for the update - results += PvlKeyword("Samp1", toString(samp1)); - results += PvlKeyword("Line1", toString(line1)); + results += PvlKeyword("Samp1", std::to_string(samp1)); + results += PvlKeyword("Line1", std::to_string(line1)); if ( !v_cam->SetImage(samp1, line1) ) { // Ignore the SetImage() error as long as the coordinate is a valid // image coordinate. @@ -130,8 +130,8 @@ void IsisMain() { results += PvlKeyword("Samp1Line1Lon"); } else { - results += PvlKeyword("Samp1Line1Lat", toString(v_cam->GetLatitude().degrees()), "degrees"); - results += PvlKeyword("Samp1Line1Lon", toString(v_cam->GetLongitude().degrees()), "degrees"); + results += PvlKeyword("Samp1Line1Lat", std::to_string(v_cam->GetLatitude().degrees()), "degrees"); + results += PvlKeyword("Samp1Line1Lon", std::to_string(v_cam->GetLongitude().degrees()), "degrees"); } // Get vector to surface from S/C and S/C position in body-fixed. @@ -155,7 +155,7 @@ void IsisMain() { // Compute angle difference of update double j2kAngle = vsep_c(&ldir1[0], &ldir2[0]); - results += PvlKeyword("AdjustedAngle", toString(j2kAngle * dpr_c()), "degrees"); + results += PvlKeyword("AdjustedAngle", std::to_string(j2kAngle * dpr_c()), "degrees"); // Compute rotation of vectors SpiceDouble R[3][3]; @@ -185,7 +185,7 @@ void IsisMain() { // Get the line cache and apply rotation using that cache. Then refit // to polynomials - Table lcache = v_cam->instrumentRotation()->LineCache(o_cmat.Name()); + Table lcache = v_cam->instrumentRotation()->LineCache(QString::fromStdString(o_cmat.Name())); ApplyRotation(R, lcache); v_cam->instrumentRotation()->LoadCache(lcache); v_cam->instrumentRotation()->SetPolynomial(); @@ -193,9 +193,9 @@ void IsisMain() { } // Write out a description in the spice table - results += PvlKeyword("RecordsUpdated", toString(o_cmat.Records())); + results += PvlKeyword("RecordsUpdated", std::to_string(o_cmat.Records())); QString deltackComment = "deltackDirectAdjusted = " + Isis::iTime::CurrentLocalTime(); - o_cmat.Label().addComment(deltackComment); + o_cmat.Label().addComment(deltackComment.toStdString()); // Write out the updated pointing dataset c.write(o_cmat); @@ -280,7 +280,7 @@ void IsisMain() { // Write out a description in the spice table QString deltackComment = "deltackAdjusted = " + Isis::iTime::CurrentLocalTime(); - cmatrix.Label().addComment(deltackComment); + cmatrix.Label().addComment(deltackComment.toStdString()); //PvlKeyword description("Description"); //description = "Camera pointing updated via deltack application"; //cmatrix.Label().findObject("Table",Pvl::Traverse).addKeyword(description); @@ -330,8 +330,8 @@ Distance GetRadius(QString filename, Latitude lat, Longitude lon) { sensor->SetGround(SurfacePoint(lat, lon, sensor->LocalRadius(lat, lon))); Distance radius = sensor->LocalRadius(); if (!radius.isValid()) { - QString msg = "Could not determine radius from DEM at lat/lon ["; - msg += toString(lat.degrees()) + "," + toString(lon.degrees()) + "]"; + std::string msg = "Could not determine radius from DEM at lat/lon ["; + msg += std::to_string(lat.degrees()) + "," + std::to_string(lon.degrees()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } return radius; diff --git a/isis/src/control/apps/fplanemap/main.cpp b/isis/src/control/apps/fplanemap/main.cpp index 9d9c26c213..4c310dabaf 100644 --- a/isis/src/control/apps/fplanemap/main.cpp +++ b/isis/src/control/apps/fplanemap/main.cpp @@ -150,14 +150,14 @@ void IsisMain() { } PvlGroup results("Results"); - results += PvlKeyword("PixelPitch", toString(pp), "millimeters"); - results += PvlKeyword("TotalPoints", toString(cn.GetNumPoints())); - results += PvlKeyword("ValidPoints", toString((BigInt) coords.size())); - results += PvlKeyword("InvalidPoints", toString(badPoint)); - if (checkForNulls) results += PvlKeyword("NullDNs", toString(nulls)); - results += PvlKeyword("OldPointNotInImage", toString(oldNotInImage)); - results += PvlKeyword("NewPointNotInImage", toString(newNotInImage)); - results += PvlKeyword("ToleranceExceeded", toString(badTol)); + results += PvlKeyword("PixelPitch", std::to_string(pp), "millimeters"); + results += PvlKeyword("TotalPoints", std::to_string(cn.GetNumPoints())); + results += PvlKeyword("ValidPoints", std::to_string((BigInt) coords.size())); + results += PvlKeyword("InvalidPoints", std::to_string(badPoint)); + if (checkForNulls) results += PvlKeyword("NullDNs", std::to_string(nulls)); + results += PvlKeyword("OldPointNotInImage", std::to_string(oldNotInImage)); + results += PvlKeyword("NewPointNotInImage", std::to_string(newNotInImage)); + results += PvlKeyword("ToleranceExceeded", std::to_string(badTol)); // Log it Application::Log(results); diff --git a/isis/src/control/apps/mat2cnet/main.cpp b/isis/src/control/apps/mat2cnet/main.cpp index f02861c96a..da42ab7af6 100644 --- a/isis/src/control/apps/mat2cnet/main.cpp +++ b/isis/src/control/apps/mat2cnet/main.cpp @@ -70,7 +70,7 @@ void IsisMain() { for (int f = 0; f < list2.size(); f++) { progress.CheckStatus(); QString currFile(list2[f].toString()); - Pvl lab(currFile); + Pvl lab(currFile.toStdString()); PvlObject qube(lab.findObject("QUBE")); IString fsc; @@ -469,7 +469,7 @@ void IsisMain() { // Write results to Logs // Summary group is created with the counts of RAND PPP only points PvlGroup summaryGroup = PvlGroup("Summary"); - summaryGroup.addKeyword(PvlKeyword("RandOnlyPoints", toString(numRandOnly))); + summaryGroup.addKeyword(PvlKeyword("RandOnlyPoints", std::to_string(numRandOnly))); bool log; FileName logFile; @@ -501,7 +501,7 @@ void IsisMain() { summaryGroup.addComment("Some Point IDs in the RAND PPP file have no " "measures in the MATCH file."); summaryGroup.addComment("These Point IDs are contained " - "in [" + logFile.name() + "]."); + "in [" + logFile.name().toStdString() + "]."); TextFile outlog(logFile.expanded(), "overwrite", randOnlyIDs); } else { diff --git a/isis/src/control/apps/seedgrid/main.cpp b/isis/src/control/apps/seedgrid/main.cpp index 88cb7e1082..5f4ac9684f 100644 --- a/isis/src/control/apps/seedgrid/main.cpp +++ b/isis/src/control/apps/seedgrid/main.cpp @@ -42,7 +42,7 @@ void IsisMain() { // get the pvl containing a mapping group Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &mapGroup = userMap.findGroup("Mapping", Pvl::Traverse); QString target; @@ -50,7 +50,7 @@ void IsisMain() { target = ui.GetString("TARGET"); } else if (mapGroup.hasKeyword("TargetName")) { - target = mapGroup.findKeyword("TargetName")[0]; + target = QString::fromStdString(mapGroup.findKeyword("TargetName")[0]); ui.PutAsString("TARGET", target); } else { @@ -59,7 +59,7 @@ void IsisMain() { "projection file [MAP]."; throw IException(IException::User, msg, _FILEINFO_); } - mapGroup.addKeyword(PvlKeyword("TargetName", target), PvlContainer::Replace); + mapGroup.addKeyword(PvlKeyword("TargetName", target.toStdString()), PvlContainer::Replace); // Use the target name to create the control net to store the points in. ControlNet cnet; @@ -79,7 +79,7 @@ void IsisMain() { throw IException(e, IException::Unknown, msg, _FILEINFO_); } } - double equatorialRadius = toDouble(mapGroup.findKeyword("EquatorialRadius")[0]); + double equatorialRadius = std::stod(mapGroup.findKeyword("EquatorialRadius")[0]); QString networkId; if (ui.WasEntered("NETWORKID")) { @@ -102,7 +102,7 @@ void IsisMain() { checkLatitude(minLat, maxLat); int lonDomain = (mapGroup.hasKeyword("LongitudeDomain") ? - toInt(mapGroup.findKeyword("LongitudeDomain")[0]) : + std::stoi(mapGroup.findKeyword("LongitudeDomain")[0]) : 360); checkLongitude(minLon, maxLon, lonDomain); @@ -120,10 +120,10 @@ void IsisMain() { mapGroup += PvlKeyword("CenterLongitude", "0.0"); } - mapGroup.addKeyword(PvlKeyword("MinimumLatitude", toString(minLat)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MaximumLatitude", toString(maxLat)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MinimumLongitude", toString(minLon)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MaximumLongitude", toString(maxLon)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(minLat)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(maxLat)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(minLon)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(maxLon)), Pvl::Replace); // create the projection from the editted map TProjection *proj = (TProjection *) ProjectionFactory::Create(userMap); @@ -228,8 +228,8 @@ void IsisMain() { } PvlGroup results("Results"); - results += PvlKeyword("EquatorialRadius", toString(equatorialRadius)); - results += PvlKeyword("NumberControlPoints", toString(cnet.GetNumPoints())); + results += PvlKeyword("EquatorialRadius", std::to_string(equatorialRadius)); + results += PvlKeyword("NumberControlPoints", std::to_string(cnet.GetNumPoints())); Application::Log(results); cnet.Write(ui.GetFileName("ONET")); @@ -290,7 +290,7 @@ void printMap() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); //Write map file out to the log diff --git a/isis/src/control/objs/ControlMeasureLogData/unitTest.cpp b/isis/src/control/objs/ControlMeasureLogData/unitTest.cpp index fcde04ae2b..36fafecd7d 100644 --- a/isis/src/control/objs/ControlMeasureLogData/unitTest.cpp +++ b/isis/src/control/objs/ControlMeasureLogData/unitTest.cpp @@ -42,7 +42,7 @@ int main() { cout << "Testing PvlKeyword constructor..." << endl; { - ControlMeasureLogData logData(PvlKeyword("GoodnessOfFit", toString(3.14159))); + ControlMeasureLogData logData(PvlKeyword("GoodnessOfFit", std::to_string(3.14159))); cout << "Valid? " << logData.IsValid() << "\n" << "Type? " << logData.GetDataType() << "\n" diff --git a/isis/src/control/objs/ControlNetDiff/unitTest.cpp b/isis/src/control/objs/ControlNetDiff/unitTest.cpp index 7ba38927b5..393e194da0 100644 --- a/isis/src/control/objs/ControlNetDiff/unitTest.cpp +++ b/isis/src/control/objs/ControlNetDiff/unitTest.cpp @@ -42,7 +42,7 @@ int main() { cout << results << endl; cout << "\n\nTesting differences with tolerances...\n\n"; - Pvl diffFile(FileName("cnet.diff").expanded()); + Pvl diffFile(FileName("cnet.diff").expanded().toStdString()); diff.addTolerances(diffFile); results = diff.compare(f1, f2); cout << results << endl; diff --git a/isis/src/control/objs/ControlNetFilter/unitTest.cpp b/isis/src/control/objs/ControlNetFilter/unitTest.cpp index 1f8567345f..d0a62d35ac 100644 --- a/isis/src/control/objs/ControlNetFilter/unitTest.cpp +++ b/isis/src/control/objs/ControlNetFilter/unitTest.cpp @@ -48,7 +48,7 @@ void IsisMain() { // Point ResidualMagnitude Filter cout << "****************** Point_ResidualMagnitude Filter ******************" << endl; filterGrp = PvlGroup("Point_ResidualMagnitude"); - keyword = PvlKeyword("LessThan", toString(1)); + keyword = PvlKeyword("LessThan", std::to_string(1)); filterGrp += keyword; cnetFilter->PointResMagnitudeFilter(filterGrp, false); cout << filterGrp << endl; @@ -82,7 +82,7 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_NumMeasuresEditLock"); - keyword = PvlKeyword("LessThan", toString(1)); + keyword = PvlKeyword("LessThan", std::to_string(1)); filterGrp += keyword; cnetFilter->PointNumMeasuresEditLockFilter(filterGrp, false); cout << filterGrp << endl; @@ -99,9 +99,9 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_PixelShift"); - keyword = PvlKeyword("LessThan", toString(10)); + keyword = PvlKeyword("LessThan", std::to_string(10)); filterGrp += keyword; - keyword = PvlKeyword("GreaterThan", toString(1)); + keyword = PvlKeyword("GreaterThan", std::to_string(1)); filterGrp += keyword; cnetFilter->PointPixelShiftFilter(filterGrp, false); cout << filterGrp << endl; @@ -135,9 +135,9 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_NumMeasures"); - keyword = PvlKeyword("GreaterThan", toString(2)); + keyword = PvlKeyword("GreaterThan", std::to_string(2)); filterGrp += keyword; - keyword = PvlKeyword("LessThan", toString(2)); + keyword = PvlKeyword("LessThan", std::to_string(2)); filterGrp += keyword; cnetFilter->PointMeasuresFilter(filterGrp, false); cout << filterGrp << endl; @@ -173,16 +173,16 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_LatLon"); - PvlKeyword keyword1("MinLat", toString(-100)); + PvlKeyword keyword1("MinLat", std::to_string(-100)); filterGrp += keyword1; - PvlKeyword keyword2("MaxLat", toString(100)); + PvlKeyword keyword2("MaxLat", std::to_string(100)); filterGrp += keyword2; - PvlKeyword keyword3("MinLon", toString(0)); + PvlKeyword keyword3("MinLon", std::to_string(0)); filterGrp += keyword3; - PvlKeyword keyword4("MaxLon", toString(238)); + PvlKeyword keyword4("MaxLon", std::to_string(238)); filterGrp += keyword4; cnetFilter->PointLatLonFilter(filterGrp, false); @@ -200,7 +200,7 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_Distance"); - keyword = PvlKeyword("MaxDistance", toString(50000)); + keyword = PvlKeyword("MaxDistance", std::to_string(50000)); filterGrp += keyword; keyword = PvlKeyword("Units", "meters"); filterGrp += keyword; @@ -237,7 +237,7 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_GoodnessOfFit"); - keyword = PvlKeyword("LessThan", toString(0.5)); + keyword = PvlKeyword("LessThan", std::to_string(0.5)); filterGrp += keyword; cnetFilter->PointGoodnessOfFitFilter(filterGrp, false); cout << filterGrp << endl; @@ -295,9 +295,9 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Cube_NumPoints"); - keyword = PvlKeyword("GreaterThan", toString(10)); + keyword = PvlKeyword("GreaterThan", std::to_string(10)); filterGrp += keyword; - keyword = PvlKeyword("LessThan", toString(20)); + keyword = PvlKeyword("LessThan", std::to_string(20)); filterGrp += keyword; cnetFilter->CubeNumPointsFilter(filterGrp, false); cout << filterGrp << endl; @@ -314,7 +314,7 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Cube_Distance"); - keyword = PvlKeyword("MaxDistance", toString(100000)); + keyword = PvlKeyword("MaxDistance", std::to_string(100000)); filterGrp += keyword; keyword = PvlKeyword("Units=", "meters"); filterGrp += keyword; @@ -333,9 +333,9 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Cube_ConvexHullRatio"); - keyword = PvlKeyword("GreaterThan", toString(0.2)); + keyword = PvlKeyword("GreaterThan", std::to_string(0.2)); filterGrp += keyword; - keyword = PvlKeyword("LessThan", toString(0.3)); + keyword = PvlKeyword("LessThan", std::to_string(0.3)); filterGrp += keyword; cnetFilter->CubeConvexHullFilter(filterGrp, false); cout << filterGrp << endl; diff --git a/isis/src/control/objs/ControlNetValidMeasure/unitTest.cpp b/isis/src/control/objs/ControlNetValidMeasure/unitTest.cpp index 0ba64dcd43..c0f5620757 100644 --- a/isis/src/control/objs/ControlNetValidMeasure/unitTest.cpp +++ b/isis/src/control/objs/ControlNetValidMeasure/unitTest.cpp @@ -20,17 +20,17 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "StandardDeviation"); - op += PvlKeyword("DeltaLine", toString(100)); - op += PvlKeyword("DeltaSamp", toString(100)); - op += PvlKeyword("Samples", toString(15)); - op += PvlKeyword("Lines", toString(15)); - op += PvlKeyword("MinimumInterest", toString(0.01)); - op += PvlKeyword("MinDN", toString(1.0)); - op += PvlKeyword("MaxDN", toString(-1.0)); - op += PvlKeyword("MinEmission", toString(15.0)); - op += PvlKeyword("MaxEmission", toString(25.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); + op += PvlKeyword("DeltaLine", std::to_string(100)); + op += PvlKeyword("DeltaSamp", std::to_string(100)); + op += PvlKeyword("Samples", std::to_string(15)); + op += PvlKeyword("Lines", std::to_string(15)); + op += PvlKeyword("MinimumInterest", std::to_string(0.01)); + op += PvlKeyword("MinDN", std::to_string(1.0)); + op += PvlKeyword("MaxDN", std::to_string(-1.0)); + op += PvlKeyword("MinEmission", std::to_string(15.0)); + op += PvlKeyword("MaxEmission", std::to_string(25.0)); + op += PvlKeyword("MinIncidence", std::to_string(0.0)); + op += PvlKeyword("MaxIncidence", std::to_string(135.0)); pvlLog += op; @@ -45,12 +45,12 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(25.0)); - op += PvlKeyword("MaxEmission", toString(15.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); + op += PvlKeyword("MinDN", std::to_string(-1.0)); + op += PvlKeyword("MaxDN", std::to_string(1.0)); + op += PvlKeyword("MinEmission", std::to_string(25.0)); + op += PvlKeyword("MaxEmission", std::to_string(15.0)); + op += PvlKeyword("MinIncidence", std::to_string(0.0)); + op += PvlKeyword("MaxIncidence", std::to_string(135.0)); pvlLog += op; @@ -65,17 +65,17 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "StandardDeviation"); - op += PvlKeyword("DeltaLine", toString(100)); - op += PvlKeyword("DeltaSamp", toString(100)); - op += PvlKeyword("Samples", toString(15)); - op += PvlKeyword("Lines", toString(15)); - op += PvlKeyword("MinimumInterest", toString(0.01)); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(150.0)); + op += PvlKeyword("DeltaLine", std::to_string(100)); + op += PvlKeyword("DeltaSamp", std::to_string(100)); + op += PvlKeyword("Samples", std::to_string(15)); + op += PvlKeyword("Lines", std::to_string(15)); + op += PvlKeyword("MinimumInterest", std::to_string(0.01)); + op += PvlKeyword("MinDN", std::to_string(-1.0)); + op += PvlKeyword("MaxDN", std::to_string(1.0)); + op += PvlKeyword("MinEmission", std::to_string(0.0)); + op += PvlKeyword("MaxEmission", std::to_string(135.0)); + op += PvlKeyword("MinIncidence", std::to_string(0.0)); + op += PvlKeyword("MaxIncidence", std::to_string(150.0)); pvlLog += op; @@ -90,14 +90,14 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); - op += PvlKeyword("MinResolution", toString(100.0)); - op += PvlKeyword("MaxResolution", toString(-1.0)); + op += PvlKeyword("MinDN", std::to_string(-1.0)); + op += PvlKeyword("MaxDN", std::to_string(1.0)); + op += PvlKeyword("MinEmission", std::to_string(0.0)); + op += PvlKeyword("MaxEmission", std::to_string(135.0)); + op += PvlKeyword("MinIncidence", std::to_string(0.0)); + op += PvlKeyword("MaxIncidence", std::to_string(135.0)); + op += PvlKeyword("MinResolution", std::to_string(100.0)); + op += PvlKeyword("MaxResolution", std::to_string(-1.0)); pvlLog += op; @@ -112,19 +112,19 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); - op += PvlKeyword("MinResolution", toString(100.0)); - op += PvlKeyword("MaxResolution", toString(500.0)); - op += PvlKeyword("SampleResidual", toString(5.0)); - op += PvlKeyword("LineResidual", toString(5.0)); - op += PvlKeyword("ResidualMagnitude", toString(10.0)); - op += PvlKeyword("SampleShift", toString(5.0)); - op += PvlKeyword("LineShift", toString(5.0)); + op += PvlKeyword("MinDN", std::to_string(-1.0)); + op += PvlKeyword("MaxDN", std::to_string(1.0)); + op += PvlKeyword("MinEmission", std::to_string(0.0)); + op += PvlKeyword("MaxEmission", std::to_string(135.0)); + op += PvlKeyword("MinIncidence", std::to_string(0.0)); + op += PvlKeyword("MaxIncidence", std::to_string(135.0)); + op += PvlKeyword("MinResolution", std::to_string(100.0)); + op += PvlKeyword("MaxResolution", std::to_string(500.0)); + op += PvlKeyword("SampleResidual", std::to_string(5.0)); + op += PvlKeyword("LineResidual", std::to_string(5.0)); + op += PvlKeyword("ResidualMagnitude", std::to_string(10.0)); + op += PvlKeyword("SampleShift", std::to_string(5.0)); + op += PvlKeyword("LineShift", std::to_string(5.0)); pvlLog += op; @@ -139,19 +139,19 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); - op += PvlKeyword("MinResolution", toString(100.0)); - op += PvlKeyword("MaxResolution", toString(500.0)); - op += PvlKeyword("SampleResidual", toString(5.0)); - op += PvlKeyword("LineResidual", toString(5.0)); - op += PvlKeyword("SampleShift", toString(5.0)); - op += PvlKeyword("LineShift", toString(5.0)); - op += PvlKeyword("PixelShift", toString(10.0)); + op += PvlKeyword("MinDN", std::to_string(-1.0)); + op += PvlKeyword("MaxDN", std::to_string(1.0)); + op += PvlKeyword("MinEmission", std::to_string(0.0)); + op += PvlKeyword("MaxEmission", std::to_string(135.0)); + op += PvlKeyword("MinIncidence", std::to_string(0.0)); + op += PvlKeyword("MaxIncidence", std::to_string(135.0)); + op += PvlKeyword("MinResolution", std::to_string(100.0)); + op += PvlKeyword("MaxResolution", std::to_string(500.0)); + op += PvlKeyword("SampleResidual", std::to_string(5.0)); + op += PvlKeyword("LineResidual", std::to_string(5.0)); + op += PvlKeyword("SampleShift", std::to_string(5.0)); + op += PvlKeyword("LineShift", std::to_string(5.0)); + op += PvlKeyword("PixelShift", std::to_string(10.0)); pvlLog += op; @@ -166,18 +166,18 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); - op += PvlKeyword("MinResolution", toString(100.0)); - op += PvlKeyword("MaxResolution", toString(500.0)); - op += PvlKeyword("SampleResidual", toString(5.0)); - op += PvlKeyword("LineResidual", toString(5.0)); - op += PvlKeyword("SampleShift", toString(5.0)); - op += PvlKeyword("LineShift", toString(5.0)); + op += PvlKeyword("MinDN", std::to_string(-1.0)); + op += PvlKeyword("MaxDN", std::to_string(1.0)); + op += PvlKeyword("MinEmission", std::to_string(0.0)); + op += PvlKeyword("MaxEmission", std::to_string(135.0)); + op += PvlKeyword("MinIncidence", std::to_string(0.0)); + op += PvlKeyword("MaxIncidence", std::to_string(135.0)); + op += PvlKeyword("MinResolution", std::to_string(100.0)); + op += PvlKeyword("MaxResolution", std::to_string(500.0)); + op += PvlKeyword("SampleResidual", std::to_string(5.0)); + op += PvlKeyword("LineResidual", std::to_string(5.0)); + op += PvlKeyword("SampleShift", std::to_string(5.0)); + op += PvlKeyword("LineShift", std::to_string(5.0)); pvlLog += op; diff --git a/isis/src/control/objs/InterestOperator/unitTest.cpp b/isis/src/control/objs/InterestOperator/unitTest.cpp index 0d6c39e2d4..bbef242713 100644 --- a/isis/src/control/objs/InterestOperator/unitTest.cpp +++ b/isis/src/control/objs/InterestOperator/unitTest.cpp @@ -26,19 +26,19 @@ int main() { try { PvlGroup op("Operator"); op += PvlKeyword("Name", "StandardDeviation"); - op += PvlKeyword("DeltaLine", toString(100)); - op += PvlKeyword("DeltaSamp", toString(100)); - op += PvlKeyword("Samples", toString(15)); - op += PvlKeyword("Lines", toString(15)); - op += PvlKeyword("MinimumInterest", toString(0.01)); + op += PvlKeyword("DeltaLine", std::to_string(100)); + op += PvlKeyword("DeltaSamp", std::to_string(100)); + op += PvlKeyword("Samples", std::to_string(15)); + op += PvlKeyword("Lines", std::to_string(15)); + op += PvlKeyword("MinimumInterest", std::to_string(0.01)); PvlGroup opv("ValidMeasure"); - opv += PvlKeyword("MinDN", toString(0.0)); - opv += PvlKeyword("MaxDN", toString(1.0)); - opv += PvlKeyword("MinEmission", toString(15.0)); - opv += PvlKeyword("MaxEmission", toString(25.0)); - opv += PvlKeyword("MinIncidence", toString(0.0)); - opv += PvlKeyword("MaxIncidence", toString(135.0)); + opv += PvlKeyword("MinDN", std::to_string(0.0)); + opv += PvlKeyword("MaxDN", std::to_string(1.0)); + opv += PvlKeyword("MinEmission", std::to_string(15.0)); + opv += PvlKeyword("MaxEmission", std::to_string(25.0)); + opv += PvlKeyword("MinIncidence", std::to_string(0.0)); + opv += PvlKeyword("MaxIncidence", std::to_string(135.0)); //op += PvlKeyword("MinResolution", 100); //op += PvlKeyword("MaxResolution", 300); diff --git a/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp b/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp index 9b86d9d136..71f132f3bf 100644 --- a/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp +++ b/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp @@ -31,9 +31,9 @@ namespace Isis { QString missid; try { - Pvl lab(inFile.expanded()); - instid = (QString) lab.findKeyword("INSTRUMENT_ID"); - missid = (QString) lab.findKeyword("MISSION_ID"); + Pvl lab(inFile.expanded().toStdString()); + instid = QString::fromStdString(lab.findKeyword("INSTRUMENT_ID")); + missid = QString::fromStdString(lab.findKeyword("MISSION_ID")); } catch(IException &e) { QString msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + @@ -63,7 +63,7 @@ namespace Isis { p.SetOutputCube(tmpFile.expanded(), outatt); p.SaveFileHeader(); - Pvl labelPvl(inFile.expanded()); + Pvl labelPvl(inFile.expanded().toStdString()); p.StartProcess(); p.EndProcess(); @@ -97,7 +97,7 @@ namespace Isis { // Update target if user specifies it if (!target.isEmpty()) { PvlGroup &igrp = outLabel.findGroup("Instrument",Pvl::Traverse); - igrp["TargetName"] = target; + igrp["TargetName"] = target.toStdString(); } // Write the BandBin, Archive, and Instrument groups @@ -158,17 +158,17 @@ namespace Isis { "FilterNumber. The FilterNumber must fall in the range 1 to 8."; throw IException(IException::Io, msg, _FILEINFO_); } - bbGrp.addKeyword(PvlKeyword("Center", toString(center))); - bbGrp.addKeyword(PvlKeyword("Width", toString(width))); - bbGrp.addKeyword(PvlKeyword("FilterName", filtname)); + bbGrp.addKeyword(PvlKeyword("Center", std::to_string(center))); + bbGrp.addKeyword(PvlKeyword("Width", std::to_string(width))); + bbGrp.addKeyword(PvlKeyword("FilterName", filtname.toStdString())); outcube->putGroup(bbGrp); PvlGroup kerns("Kernels"); if(instid == "FC1") { - kerns += PvlKeyword("NaifFrameCode", toString(-203110-filtno)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-203110-filtno)); } else if(instid == "FC2") { - kerns += PvlKeyword("NaifFrameCode", toString(-203120-filtno)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-203120-filtno)); } else { QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + diff --git a/isis/src/dawn/apps/dawnvir2isis/main.cpp b/isis/src/dawn/apps/dawnvir2isis/main.cpp index 74487cd4f3..94df0e895e 100644 --- a/isis/src/dawn/apps/dawnvir2isis/main.cpp +++ b/isis/src/dawn/apps/dawnvir2isis/main.cpp @@ -57,9 +57,9 @@ void IsisMain () QString missid; try { - Pvl lab(inFile.expanded()); - instid = (QString) lab.findKeyword ("CHANNEL_ID"); - missid = (QString) lab.findKeyword ("INSTRUMENT_HOST_ID"); + Pvl lab(inFile.expanded().toStdString()); + instid = QString::fromStdString(lab.findKeyword ("CHANNEL_ID")); + missid = QString::fromStdString(lab.findKeyword ("INSTRUMENT_HOST_ID")); } catch (IException &e) { QString msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + @@ -87,7 +87,7 @@ void IsisMain () Cube *outcube = p.SetOutputCube ("TO"); // p.SaveFileHeader(); - Pvl labelPvl (inFile.expanded()); + Pvl labelPvl (inFile.expanded().toStdString()); p.StartProcess (); @@ -115,7 +115,7 @@ void IsisMain () // Update target if user specifies it if (!target.isEmpty()) { PvlGroup &igrp = outLabel.findGroup("Instrument",Pvl::Traverse); - igrp["TargetName"] = target; + igrp["TargetName"] = target.toStdString(); } // Write the BandBin, Archive, and Instrument groups @@ -145,7 +145,7 @@ void IsisMain () hktable.setType("MirrorCos", "DOUBLE"); Table hktab = hktable.importTable("ScetTimeClock,ShutterStatus,MirrorSin,MirrorCos", "VIRHouseKeeping"); - hktab.Label().addKeyword(PvlKeyword("SourceFile", hkLabel)); + hktab.Label().addKeyword(PvlKeyword("SourceFile", hkLabel.toStdString())); outcube->write(hktab); } catch (IException &e) { diff --git a/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp b/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp index a1a7f02404..082e8b15d3 100644 --- a/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp +++ b/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp @@ -119,7 +119,7 @@ namespace Isis { // needs to be obtained. Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); double et = getClockTime(stime).Et(); et += 193.0 / 1000.0; double exposureDuration = (double)inst["ExposureDuration"] / 1000.0; diff --git a/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp b/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp index f824b7c727..8cc91ff903 100644 --- a/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp +++ b/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp @@ -58,9 +58,9 @@ namespace Isis { // Get the start time from labels PvlGroup &inst = lab.findGroup("Instrument", Isis::Pvl::Traverse); - QString channelId = inst["ChannelId"]; + QString channelId = QString::fromStdString(inst["ChannelId"]); - QString instMode = inst["InstrumentModeId"]; + QString instMode = QString::fromStdString(inst["InstrumentModeId"]); m_slitMode = instMode[14].toLatin1(); // "F" for full slit, Q for quarter slit // Check for presence of articulation kernel @@ -88,13 +88,13 @@ namespace Isis { // Get other info from labels PvlKeyword &frameParam = inst["FrameParameter"]; - m_exposureTime = toDouble(frameParam[0]); - m_summing = toDouble(frameParam[1]); - m_scanRate = toDouble(frameParam[2]); + m_exposureTime = std::stod(frameParam[0]); + m_summing = std::stod(frameParam[1]); + m_scanRate = std::stod(frameParam[2]); // Setup detector map // Get the line scan rates/times - readHouseKeeping(lab.fileName(), m_scanRate); + readHouseKeeping(QString::fromStdString(lab.fileName()), m_scanRate); new VariableLineScanCameraDetectorMap(this, m_lineRates); DetectorMap()->SetDetectorSampleSumming(m_summing); @@ -480,20 +480,20 @@ namespace Isis { } // Add some necessary keywords - quats.Label() += PvlKeyword("CkTableStartTime", toString(startTime())); - quats.Label() += PvlKeyword("CkTableEndTime", toString(endTime())); - quats.Label() += PvlKeyword("CkTableOriginalSize", toString(quats.Records())); + quats.Label() += PvlKeyword("CkTableStartTime", std::to_string(startTime())); + quats.Label() += PvlKeyword("CkTableEndTime", std::to_string(endTime())); + quats.Label() += PvlKeyword("CkTableOriginalSize", std::to_string(quats.Records())); // Create the time dependant frames keyword int virZeroId = getInteger("FRAME_" + virZero); - PvlKeyword tdf("TimeDependentFrames", toString(virZeroId)); // DAWN_VIR_{ID}_ZERO + PvlKeyword tdf("TimeDependentFrames", std::to_string(virZeroId)); // DAWN_VIR_{ID}_ZERO tdf.addValue("-203200"); // DAWN_VIR tdf.addValue("-203000"); // DAWN_SPACECRAFT tdf.addValue("1"); // J2000 quats.Label() += tdf; // Create constant rotation frames - PvlKeyword cf("ConstantFrames", toString(virZeroId)); + PvlKeyword cf("ConstantFrames", std::to_string(virZeroId)); cf.addValue(std::to_string(virZeroId)); quats.Label() += cf; diff --git a/isis/src/dev/apps/camdev/camdev.cpp b/isis/src/dev/apps/camdev/camdev.cpp index d9aac2856b..e8eb610648 100644 --- a/isis/src/dev/apps/camdev/camdev.cpp +++ b/isis/src/dev/apps/camdev/camdev.cpp @@ -280,16 +280,16 @@ namespace Isis { if ( dn && icube->hasGroup("BandBin") ) { PvlGroup &mybb = icube->group("BandBin"); if ( mybb.hasKeyword("Name") ) { - bname = mybb["Name"][0]; + bname = QString::fromStdString(mybb["Name"][0]); } else if ( mybb.hasKeyword("FilterName") ) { - bname = mybb["FilterName"][0]; + bname = QString::fromStdString(mybb["FilterName"][0]); } } // Create a bandbin group for the output label PvlKeyword name("Name"); - if (dn) name += bname; + if (dn) name += bname.toStdString(); if (ra) name += "Right Ascension"; if (declination) name += "Declination"; if (planetocentricLatitude) name += "Planetocentric Latitude"; @@ -702,9 +702,9 @@ namespace Isis { template PvlKeyword makeKey(const QString &name, const int &nvals, const T &value) { - PvlKeyword key(name); + PvlKeyword key(name.toStdString()); for (int i = 0 ; i < nvals ; i++) { - key += value; + key += value.toStdString(); } return (key); } @@ -755,8 +755,8 @@ namespace Isis { const QString &default_value) { QString defVal(default_value); - if ( bb.hasKeyword(keyname) ) { - defVal = bb[keyname][0]; + if ( bb.hasKeyword(keyname.toStdString()) ) { + defVal = QString::fromStdString(bb[keyname.toStdString()][0]); } bb.addKeyword(makeKey(keyname, nvals, defVal), PvlContainer::Replace); diff --git a/isis/src/dev/apps/camdev/main.cpp b/isis/src/dev/apps/camdev/main.cpp index 82422f56a0..805f4dd3ff 100644 --- a/isis/src/dev/apps/camdev/main.cpp +++ b/isis/src/dev/apps/camdev/main.cpp @@ -275,16 +275,16 @@ void IsisMain() { if ( dn && icube->hasGroup("BandBin") ) { PvlGroup &mybb = icube->group("BandBin"); if ( mybb.hasKeyword("Name") ) { - bname = mybb["Name"][0]; + bname = QString::fromStdString(mybb["Name"][0]); } else if ( mybb.hasKeyword("FilterName") ) { - bname = mybb["FilterName"][0]; + bname = QString::fromStdString(mybb["FilterName"][0]); } } // Create a bandbin group for the output label PvlKeyword name("Name"); - if (dn) name += bname; + if (dn) name += bname.toStdString(); if (ra) name += "Right Ascension"; if (declination) name += "Declination"; if (planetocentricLatitude) name += "Planetocentric Latitude"; @@ -706,9 +706,9 @@ void camdev(Buffer &out) { template PvlKeyword makeKey(const QString &name, const int &nvals, const T &value) { - PvlKeyword key(name); + PvlKeyword key(name.toStdString()); for (int i = 0 ; i < nvals ; i++) { - key += value; + key += value.toStdString(); } return (key); } @@ -759,8 +759,8 @@ void UpdateBandKey(const QString &keyname, PvlGroup &bb, const int &nvals, const QString &default_value) { QString defVal(default_value); - if ( bb.hasKeyword(keyname) ) { - defVal = bb[keyname][0]; + if ( bb.hasKeyword(keyname.toStdString()) ) { + defVal = QString::fromStdString(bb[keyname.toStdString()][0]); } bb.addKeyword(makeKey(keyname, nvals, defVal), PvlContainer::Replace); diff --git a/isis/src/dev/apps/camtest/main.cpp b/isis/src/dev/apps/camtest/main.cpp index 0bc50fb784..7ea236e62c 100644 --- a/isis/src/dev/apps/camtest/main.cpp +++ b/isis/src/dev/apps/camtest/main.cpp @@ -92,14 +92,14 @@ void IsisMain() { // Collect results PvlGroup results = PvlGroup("CamTestResults"); - results += PvlKeyword("FailedConversionsToLatLong", toString(resultsStats.LrsPixels())); - results += PvlKeyword("FailedConversionsToSampleLine", toString(resultsStats.HrsPixels())); - results += PvlKeyword("SuccessfulConversions", toString(resultsStats.ValidPixels())); + results += PvlKeyword("FailedConversionsToLatLong", std::to_string(resultsStats.LrsPixels())); + results += PvlKeyword("FailedConversionsToSampleLine", std::to_string(resultsStats.HrsPixels())); + results += PvlKeyword("SuccessfulConversions", std::to_string(resultsStats.ValidPixels())); if (outFormat == Err) { - results += PvlKeyword("Average", toString(resultsStats.Average())); - results += PvlKeyword("StandardDeviation", toString(resultsStats.StandardDeviation())); - results += PvlKeyword("Minimum", toString(resultsStats.Minimum())); - results += PvlKeyword("Maximum", toString(resultsStats.Maximum())); + results += PvlKeyword("Average", std::to_string(resultsStats.Average())); + results += PvlKeyword("StandardDeviation", std::to_string(resultsStats.StandardDeviation())); + results += PvlKeyword("Minimum", std::to_string(resultsStats.Minimum())); + results += PvlKeyword("Maximum", std::to_string(resultsStats.Maximum())); } // Log output results diff --git a/isis/src/dev/apps/m3loc2net/main.cpp b/isis/src/dev/apps/m3loc2net/main.cpp index aacdae786b..7afba01c40 100644 --- a/isis/src/dev/apps/m3loc2net/main.cpp +++ b/isis/src/dev/apps/m3loc2net/main.cpp @@ -51,7 +51,7 @@ void IsisMain() { if (inputCube.label()->hasKeyword("TargetName", PvlObject::Traverse)) { PvlGroup inst = inputCube.label()->findGroup("Instrument", PvlObject::Traverse); - QString targetName = inst["TargetName"]; + QString targetName = QString::fromStdString(inst["TargetName"]); cnet.SetTarget(targetName); } else { diff --git a/isis/src/galileo/apps/gllnims2isis/main.cpp b/isis/src/galileo/apps/gllnims2isis/main.cpp index a35772f40d..2e1b7e77ea 100644 --- a/isis/src/galileo/apps/gllnims2isis/main.cpp +++ b/isis/src/galileo/apps/gllnims2isis/main.cpp @@ -368,8 +368,8 @@ PvlGroup originalMappingGroup = qube.findGroup("IMAGE_MAP_PROJECTION", Pvl::Trav double lineOffset = -(double)(importPds.Lines()+1) / 2; double sampleOffset = -(double)(importPds.Samples()+1) / 2; double resolution = mappingGroup["PixelResolution"][0].toDouble(); - mappingGroup["UpperLeftCornerY"] = toString(-lineOffset * resolution); - mappingGroup["UpperLeftCornerX"] = toString(sampleOffset * resolution); + mappingGroup["UpperLeftCornerY"] = std::to_string(-lineOffset * resolution); + mappingGroup["UpperLeftCornerX"] = std::to_string(sampleOffset * resolution); if (originalMappingGroup["COORDINATE_SYSTEM_NAME"][0] == "PLANETOCENTRIC") { mappingGroup["LatitudeType"] = "Planetocentric"; } @@ -391,7 +391,7 @@ PvlGroup originalMappingGroup = qube.findGroup("IMAGE_MAP_PROJECTION", Pvl::Trav "degrees"); } else { - PvlKeyword clat("CenterLatitude", toString(centerLatitude), "degrees" ); + PvlKeyword clat("CenterLatitude", std::to_string(centerLatitude), "degrees" ); mappingGroup.addKeyword(clat); } } diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index e06b4f5210..b419c70981 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -208,7 +208,7 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube) { summingMode = 2; } - inst.addKeyword(PvlKeyword("Summing", toString(summingMode))); + inst.addKeyword(PvlKeyword("Summing", std::to_string(summingMode))); inst.addKeyword(PvlKeyword("FrameModeId", frameModeId)); // Create the Band bin Group diff --git a/isis/src/galileo/apps/gllssical/gllssical.cpp b/isis/src/galileo/apps/gllssical/gllssical.cpp index 6de05b1cbd..87da720557 100644 --- a/isis/src/galileo/apps/gllssical/gllssical.cpp +++ b/isis/src/galileo/apps/gllssical/gllssical.cpp @@ -126,23 +126,23 @@ namespace Isis { gainFileName.name())); calibrationLog.addKeyword(PvlKeyword("ShutterFile", shutterFileName.originalPath() + "/" + shutterFileName.name())); - calibrationLog.addKeyword(PvlKeyword("ScaleFactor", toString(scaleFactor))); + calibrationLog.addKeyword(PvlKeyword("ScaleFactor", std::to_string(scaleFactor))); calibrationLog.addKeyword(PvlKeyword("OutputUnits", iof ? "I/F" : "Radiance")); if (iof) { - calibrationLog.addKeyword(PvlKeyword("S1", toString(s1), "I/F per Ft-Lambert")); - calibrationLog.addKeyword(PvlKeyword("RSUN", toString(rsun), "(Planet-Sun range)/5.2 A.U.")); - calibrationLog.addKeyword(PvlKeyword("Scale", toString(scaleFactor), "I/F units per DN")); - calibrationLog.addKeyword(PvlKeyword("GC", toString(cubeConversion), "Cube gain conversion")); - calibrationLog.addKeyword(PvlKeyword("GG", toString(gainConversion), "Gain file gain conversion")); - calibrationLog.addKeyword(PvlKeyword("IOF-SCALE0", toString(scaleFactor0), "(S1/Scale)*(GC/GG)/RSUN**2")); + calibrationLog.addKeyword(PvlKeyword("S1", std::to_string(s1), "I/F per Ft-Lambert")); + calibrationLog.addKeyword(PvlKeyword("RSUN", std::to_string(rsun), "(Planet-Sun range)/5.2 A.U.")); + calibrationLog.addKeyword(PvlKeyword("Scale", std::to_string(scaleFactor), "I/F units per DN")); + calibrationLog.addKeyword(PvlKeyword("GC", std::to_string(cubeConversion), "Cube gain conversion")); + calibrationLog.addKeyword(PvlKeyword("GG", std::to_string(gainConversion), "Gain file gain conversion")); + calibrationLog.addKeyword(PvlKeyword("IOF-SCALE0", std::to_string(scaleFactor0), "(S1/Scale)*(GC/GG)/RSUN**2")); } else { - calibrationLog.addKeyword(PvlKeyword("S2", toString(s2), "Nanowatts per Ft-Lambert")); - calibrationLog.addKeyword(PvlKeyword("Scale", toString(scaleFactor), + calibrationLog.addKeyword(PvlKeyword("S2", std::to_string(s2), "Nanowatts per Ft-Lambert")); + calibrationLog.addKeyword(PvlKeyword("Scale", std::to_string(scaleFactor), "Nanowatts/cm**2/steradian/nanometer/DN")); - calibrationLog.addKeyword(PvlKeyword("GC", toString(cubeConversion), "Cube gain conversion")); - calibrationLog.addKeyword(PvlKeyword("GG", toString(gainConversion), "Gain file gain conversion")); - calibrationLog.addKeyword(PvlKeyword("Radiance-SCALE0", toString(scaleFactor0), "(S2/Scale)*(GC/GG)")); + calibrationLog.addKeyword(PvlKeyword("GC", std::to_string(cubeConversion), "Cube gain conversion")); + calibrationLog.addKeyword(PvlKeyword("GG", std::to_string(gainConversion), "Gain file gain conversion")); + calibrationLog.addKeyword(PvlKeyword("Radiance-SCALE0", std::to_string(scaleFactor0), "(S2/Scale)*(GC/GG)")); } ocube->putGroup(calibrationLog); diff --git a/isis/src/hayabusa/apps/amica2isis/main.cpp b/isis/src/hayabusa/apps/amica2isis/main.cpp index 16cb76ce3b..8ce0a881d5 100644 --- a/isis/src/hayabusa/apps/amica2isis/main.cpp +++ b/isis/src/hayabusa/apps/amica2isis/main.cpp @@ -132,7 +132,7 @@ void IsisMain () // Create YearDoy keyword in Archive group iTime stime(outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0]); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", std::to_string(stime.Year()*1000 + stime.DayOfYear())); outLabel.findGroup("Archive", Pvl::Traverse).addKeyword(yeardoy); diff --git a/isis/src/hayabusa/apps/amicacal/main.cpp b/isis/src/hayabusa/apps/amicacal/main.cpp index 5be4cee0b2..bd9b4e514b 100644 --- a/isis/src/hayabusa/apps/amicacal/main.cpp +++ b/isis/src/hayabusa/apps/amicacal/main.cpp @@ -373,7 +373,7 @@ void IsisMain() { calibrationLog.addKeyword(PvlKeyword("CalibrationFile", calfile)); calibrationLog.addKeyword(PvlKeyword("FlatFieldFile", flatfile.originalPath() + "/" + flatfile.name())); - calibrationLog.addKeyword(PvlKeyword("CompressionFactor", toString(g_compfactor, 2))); + calibrationLog.addKeyword(PvlKeyword("CompressionFactor", std::to_string(g_compfactor, 2))); // Parameters PvlKeyword key("Bias_Bn"); @@ -381,22 +381,22 @@ void IsisMain() { key.addValue(std::to_string(g_b1, 8)); key.addValue(std::to_string(g_b2, 8)); calibrationLog.addKeyword(key); - calibrationLog.addKeyword(PvlKeyword("Bias", toString(g_bias, 16), "DN")); + calibrationLog.addKeyword(PvlKeyword("Bias", std::to_string(g_bias, 16), "DN")); key = PvlKeyword("Linearity_Ln"); key.addValue(std::to_string(g_L0, 8)); key.addValue(std::to_string(g_L1, 8)); calibrationLog.addKeyword(key); - calibrationLog.addKeyword(PvlKeyword("Linearity_Gamma", toString(g_gamma, 16))); + calibrationLog.addKeyword(PvlKeyword("Linearity_Gamma", std::to_string(g_gamma, 16))); - calibrationLog.addKeyword(PvlKeyword("Smear_tvct", toString(g_tvct, 16))); + calibrationLog.addKeyword(PvlKeyword("Smear_tvct", std::to_string(g_tvct, 16))); calibrationLog.addKeyword(PvlKeyword("CalibrationUnits", g_iofCorrection)); - calibrationLog.addKeyword(PvlKeyword("RadianceStandard", toString(g_radStd, 16))); - calibrationLog.addKeyword(PvlKeyword("RadianceScaleFactor", toString(g_iofScale, 16))); - calibrationLog.addKeyword(PvlKeyword("SolarDistance", toString(g_solarDist, 16), "AU")); - calibrationLog.addKeyword(PvlKeyword("SolarFlux", toString(g_solarFlux, 16))); - calibrationLog.addKeyword(PvlKeyword("IOFFactor", toString(g_calibrationScale, 16))); + calibrationLog.addKeyword(PvlKeyword("RadianceStandard", std::to_string(g_radStd, 16))); + calibrationLog.addKeyword(PvlKeyword("RadianceScaleFactor", std::to_string(g_iofScale, 16))); + calibrationLog.addKeyword(PvlKeyword("SolarDistance", std::to_string(g_solarDist, 16), "AU")); + calibrationLog.addKeyword(PvlKeyword("SolarFlux", std::to_string(g_solarFlux, 16))); + calibrationLog.addKeyword(PvlKeyword("IOFFactor", std::to_string(g_calibrationScale, 16))); calibrationLog.addKeyword(PvlKeyword("Units", g_units)); #if 0 @@ -465,7 +465,7 @@ void IsisMain() { key.addValue(std::to_string(g_size)); calibrationLog.addKeyword(key); - calibrationLog.addKeyword(PvlKeyword("PSF_Focused", toString(g_alpha, 6))); + calibrationLog.addKeyword(PvlKeyword("PSF_Focused", std::to_string(g_alpha, 6))); key = PvlKeyword("PSF_Sigma"); for (int i = 0 ; i < g_N ; i++ ) { diff --git a/isis/src/qisis/apps/cneteditor/CnetEditorWindow.cpp b/isis/src/qisis/apps/cneteditor/CnetEditorWindow.cpp index 35aa2ba07b..80baee688e 100644 --- a/isis/src/qisis/apps/cneteditor/CnetEditorWindow.cpp +++ b/isis/src/qisis/apps/cneteditor/CnetEditorWindow.cpp @@ -726,7 +726,7 @@ namespace Isis { editorWidget->connectionFilterWidget()); setFileState(HasFile, *curFile); - saveAsPvl = !Pvl(*curFile).hasObject("ProtoBuffer"); + saveAsPvl = !Pvl(curFile->toStdString()).hasObject("ProtoBuffer"); } diff --git a/isis/src/qisis/apps/qnet/main.cpp b/isis/src/qisis/apps/qnet/main.cpp index 7fd9c541d8..8e83b4233e 100644 --- a/isis/src/qisis/apps/qnet/main.cpp +++ b/isis/src/qisis/apps/qnet/main.cpp @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) { PvlGroup &uiPref = Preference::Preferences().findGroup( "UserInterface"); if (uiPref.hasKeyword("GuiStyle")) { - QString style = uiPref["GuiStyle"]; + QString style = QString::fromStdString(uiPref["GuiStyle"]); QApplication::setStyle((QString) style); } diff --git a/isis/src/qisis/apps/qtie/QtieTool.cpp b/isis/src/qisis/apps/qtie/QtieTool.cpp index be50eef1ff..2810b42e81 100644 --- a/isis/src/qisis/apps/qtie/QtieTool.cpp +++ b/isis/src/qisis/apps/qtie/QtieTool.cpp @@ -920,16 +920,16 @@ namespace Isis { p_matchCube->write(*cmatrix); History h = p_matchCube->readHistory(); PvlObject history("qtie"); - history += PvlKeyword("IsisVersion", Application::Version()); + history += PvlKeyword("IsisVersion", Application::Version().toStdString()); QString path = QCoreApplication::applicationDirPath(); - history += PvlKeyword("ProgramPath", path); + history += PvlKeyword("ProgramPath", path.toStdString()); history += PvlKeyword("ExecutionDateTime", - Application::DateTime()); - history += PvlKeyword("HostName", Application::HostName()); - history += PvlKeyword("UserName", Application::UserName()); + Application::DateTime().toStdString()); + history += PvlKeyword("HostName", Application::HostName().toStdString()); + history += PvlKeyword("UserName", Application::UserName().toStdString()); PvlGroup results("Results"); results += PvlKeyword("CameraAnglesUpdated", "True"); - results += PvlKeyword("BaseMap", p_baseCube->fileName()); + results += PvlKeyword("BaseMap", p_baseCube->fileName().toStdString()); history += results; h.AddEntry(history); @@ -974,12 +974,12 @@ namespace Isis { void QtieTool::viewTemplateFile() { try { // Get the template file from the ControlPointEditor object - Pvl templatePvl(p_pointEditor->templateFileName()); + Pvl templatePvl(p_pointEditor->templateFileName().toStdString()); // Create registration dialog window using PvlEditDialog class // to view and/or edit the template PvlEditDialog registrationDialog(templatePvl); registrationDialog.setWindowTitle("View or Edit Template File: " - + (templatePvl.fileName())); + + QString::fromStdString(templatePvl.fileName())); registrationDialog.resize(550, 360); registrationDialog.exec(); } diff --git a/isis/src/qisis/apps/qview/main.cpp b/isis/src/qisis/apps/qview/main.cpp index 69f06fe013..06e2ad31bd 100644 --- a/isis/src/qisis/apps/qview/main.cpp +++ b/isis/src/qisis/apps/qview/main.cpp @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) { PvlGroup &uiPref = Preference::Preferences().findGroup( "UserInterface"); if (uiPref.hasKeyword("GuiStyle")) { - QString style = uiPref["GuiStyle"]; + QString style = QString::fromStdString(uiPref["GuiStyle"]); QApplication::setStyle((QString) style); } diff --git a/isis/src/qisis/objs/ControlMeasureEditWidget/ControlMeasureEditWidget.cpp b/isis/src/qisis/objs/ControlMeasureEditWidget/ControlMeasureEditWidget.cpp index c9329dfd8c..be9eb8a6dd 100644 --- a/isis/src/qisis/objs/ControlMeasureEditWidget/ControlMeasureEditWidget.cpp +++ b/isis/src/qisis/objs/ControlMeasureEditWidget/ControlMeasureEditWidget.cpp @@ -1043,7 +1043,7 @@ namespace Isis { // if the auto registration factory has not been initialized, do it here if (m_autoRegFact == NULL) { try { - Pvl pvl(m_templateFileName); + Pvl pvl(m_templateFileName.toStdString()); m_autoRegFact = AutoRegFactory::Create(pvl); } catch (IException &e) { @@ -1631,7 +1631,7 @@ namespace Isis { m_templateFileName = fn; // Create PVL object with this file - Pvl pvl(fn); + Pvl pvl(fn.toStdString()); // try to register file reg = AutoRegFactory::Create(pvl); diff --git a/isis/src/qisis/objs/ControlPointEdit/ControlPointEdit.cpp b/isis/src/qisis/objs/ControlPointEdit/ControlPointEdit.cpp index c3c3758c1b..c40a474b8d 100644 --- a/isis/src/qisis/objs/ControlPointEdit/ControlPointEdit.cpp +++ b/isis/src/qisis/objs/ControlPointEdit/ControlPointEdit.cpp @@ -943,7 +943,7 @@ namespace Isis { // if the auto registration factory has not been initialized, do it here if (p_autoRegFact == NULL) { try { - Pvl pvl(p_templateFileName); + Pvl pvl(p_templateFileName.toStdString()); p_autoRegFact = AutoRegFactory::Create(pvl); } catch (IException &e) { @@ -1513,7 +1513,7 @@ namespace Isis { p_templateFileName = fn; // Create PVL object with this file - Pvl pvl(fn); + Pvl pvl(fn.toStdString()); // try to register file reg = AutoRegFactory::Create(pvl); diff --git a/isis/src/qisis/objs/ControlPointEditWidget/ControlPointEditWidget.cpp b/isis/src/qisis/objs/ControlPointEditWidget/ControlPointEditWidget.cpp index 11889de62a..00fc323d39 100644 --- a/isis/src/qisis/objs/ControlPointEditWidget/ControlPointEditWidget.cpp +++ b/isis/src/qisis/objs/ControlPointEditWidget/ControlPointEditWidget.cpp @@ -975,7 +975,7 @@ namespace Isis { QString referenceFileName = m_serialNumberList->fileName(referenceSN); QScopedPointer referenceCube(new Cube(referenceFileName, "r")); PvlGroup kernels = referenceCube->group("Kernels"); - QString shapeFile = kernels["ShapeModel"]; + QString shapeFile = QString::fromStdString(kernels["ShapeModel"]); // If the reference measure has a shape model cube then set that as the radius // This will NOT WORK for shape model files (not the default of Null or Ellipsoid) @@ -2920,12 +2920,12 @@ namespace Isis { try{ // Get the template file from the ControlPointEditWidget object - Pvl templatePvl(m_measureEditor->templateFileName()); + Pvl templatePvl(m_measureEditor->templateFileName().toStdString()); // Create registration dialog window using PvlEditDialog class // to view and/or edit the template PvlEditDialog registrationDialog(templatePvl); registrationDialog.setWindowTitle("View or Edit Template File: " - + templatePvl.fileName()); + + QString::fromStdString(templatePvl.fileName())); registrationDialog.resize(550,360); registrationDialog.exec(); } diff --git a/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp b/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp index c3c9fa3ad4..49a46f450f 100644 --- a/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp +++ b/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp @@ -1372,18 +1372,18 @@ namespace Isis { { // Get Cube Info PvlObject whatsThisObj = PvlObject("WhatsThis"); - whatsThisObj += PvlKeyword("Cube", p_cube->fileName()); + whatsThisObj += PvlKeyword("Cube", p_cube->fileName().toStdString()); PvlGroup cubeGrp("CubeDimensions"); - cubeGrp += PvlKeyword("Samples", toString(p_cube->sampleCount())); - cubeGrp += PvlKeyword("Lines", toString(p_cube->lineCount())); - cubeGrp += PvlKeyword("Bands", toString(p_cube->bandCount())); + cubeGrp += PvlKeyword("Samples", std::to_string(p_cube->sampleCount())); + cubeGrp += PvlKeyword("Lines", std::to_string(p_cube->lineCount())); + cubeGrp += PvlKeyword("Bands", std::to_string(p_cube->bandCount())); whatsThisObj += cubeGrp; // Get Viewport Info PvlGroup viewportGrp("ViewportDimensions"); - viewportGrp += PvlKeyword("Samples", toString(viewport()->width())); - viewportGrp += PvlKeyword("Lines", toString(viewport()->height())); + viewportGrp += PvlKeyword("Samples", std::to_string(viewport()->width())); + viewportGrp += PvlKeyword("Lines", std::to_string(viewport()->height())); whatsThisObj += viewportGrp; // Get Cube area Info @@ -1403,14 +1403,14 @@ namespace Isis { bandGrp += PvlKeyword("Color", "RGB"); - virtualKey = toString(iRedBand); - virtualKey += toString(iGreenBand); - virtualKey += toString(iBlueBand); + virtualKey = std::to_string(iRedBand); + virtualKey += std::to_string(iGreenBand); + virtualKey += std::to_string(iBlueBand); bandGrp += virtualKey; - physicalKey = toString(p_cube->physicalBand(iRedBand)); - physicalKey += toString(p_cube->physicalBand(iGreenBand)); - physicalKey += toString(p_cube->physicalBand(iBlueBand)); + physicalKey = std::to_string(p_cube->physicalBand(iRedBand)); + physicalKey += std::to_string(p_cube->physicalBand(iGreenBand)); + physicalKey += std::to_string(p_cube->physicalBand(iBlueBand)); bandGrp += physicalKey; if(iFilterSize) { @@ -1442,8 +1442,8 @@ namespace Isis { bandGrp += PvlKeyword("Color", "Gray"); - bandGrp += PvlKeyword("Virtual", toString(iGrayBand)); - bandGrp += PvlKeyword("Physical", toString(p_cube->physicalBand(iGrayBand))); + bandGrp += PvlKeyword("Virtual", std::to_string(iGrayBand)); + bandGrp += PvlKeyword("Physical", std::to_string(p_cube->physicalBand(iGrayBand))); if(iFilterSize && iGrayBand <= iFilterSize) { bandGrp += PvlKeyword("FilterName", filterName[iGrayBand-1]); @@ -1453,10 +1453,10 @@ namespace Isis { //start, end line and sample double sl, ss, es, el; getCubeArea(ss, es, sl, el); - cubeAreaPvl += PvlKeyword("StartSample", toString(int(ss + 0.5))); - cubeAreaPvl += PvlKeyword("EndSample", toString(int(es + 0.5))); - cubeAreaPvl += PvlKeyword("StartLine", toString(int(sl + 0.5))); - cubeAreaPvl += PvlKeyword("EndLine", toString(int(el + 0.5))); + cubeAreaPvl += PvlKeyword("StartSample", std::to_string(int(ss + 0.5))); + cubeAreaPvl += PvlKeyword("EndSample", std::to_string(int(es + 0.5))); + cubeAreaPvl += PvlKeyword("StartLine", std::to_string(int(sl + 0.5))); + cubeAreaPvl += PvlKeyword("EndLine", std::to_string(int(el + 0.5))); cubeAreaPvl += bandGrp; whatsThisObj += cubeAreaPvl; pWhatsThisPvl += whatsThisObj; @@ -1545,7 +1545,7 @@ namespace Isis { if(iFilterSize) { sBandInfo += "
FilterName = "; if(iRedBand <= iFilterSize) { - sBandInfo += QString(filterNameKey[iRedBand-1]); + sBandInfo += QString::fromStdString(filterNameKey[iRedBand-1]); } else { sBandInfo += "None"; @@ -1553,7 +1553,7 @@ namespace Isis { sBandInfo += ", "; if(iGreenBand <= iFilterSize) { - sBandInfo += QString(filterNameKey[iGreenBand-1]); + sBandInfo += QString::fromStdString(filterNameKey[iGreenBand-1]); } else { sBandInfo += "None"; @@ -1561,7 +1561,7 @@ namespace Isis { sBandInfo += ", "; if(iBlueBand <= iFilterSize) { - sBandInfo += QString(filterNameKey[iBlueBand-1]); + sBandInfo += QString::fromStdString(filterNameKey[iBlueBand-1]); } else { sBandInfo += "None"; @@ -1576,7 +1576,7 @@ namespace Isis { sBandInfo += "Physical = " + QString::number(p_cube->physicalBand(iGrayBand)); if(iFilterSize && iGrayBand <= iFilterSize) { - sBandInfo += "
FilterName = " + QString(filterNameKey[iGrayBand-1]); + sBandInfo += "
FilterName = " + QString::fromStdString(filterNameKey[iGrayBand-1]); } } @@ -2375,7 +2375,7 @@ namespace Isis { PvlGroup trackingGroup = p_cube->group("Tracking"); //Because the tracking group does not have a path, get the path from the main cube FileName cubeName(p_cube->fileName()); - QString trackingCubeName = trackingGroup.findKeyword("Filename")[0]; + QString trackingCubeName = QString::fromStdString(trackingGroup.findKeyword("Filename")[0]); FileName trackingCubeFileName(cubeName.path() + "/" + trackingCubeName); Cube *trackingCube = new Cube(trackingCubeFileName); p_trackingCube = trackingCube; diff --git a/isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp b/isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp index d1982e59df..9b0d3551f4 100644 --- a/isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp @@ -534,10 +534,10 @@ namespace Isis { // Confirm that the target body and the gui camera do not exist before creating and // and adding them for each image. Since a target may be covered by many cameras and a // camera may cover many targets, have to get tricky with the checking. - QString instrumentId = cube->label()->findGroup("Instrument", - PvlObject::FindOptions::Traverse).findKeyword("InstrumentId")[0]; - QString targetName = cube->label()->findGroup("Instrument", - PvlObject::FindOptions::Traverse).findKeyword("TargetName")[0]; + QString instrumentId = QString::fromStdString(cube->label()->findGroup("Instrument", + PvlObject::FindOptions::Traverse).findKeyword("InstrumentId")[0]); + QString targetName = QString::fromStdString(cube->label()->findGroup("Instrument", + PvlObject::FindOptions::Traverse).findKeyword("TargetName")[0]); if (!project()->hasTarget(targetName)) { Camera *camera = cube->camera(); Target *target = camera->target(); diff --git a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp index 42124041b9..9b851c0647 100644 --- a/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp +++ b/isis/src/qisis/objs/DisplayProperties/DisplayProperties.cpp @@ -45,7 +45,7 @@ namespace Isis { void DisplayProperties::fromPvl(const PvlObject &pvl) { setDisplayName(((IString)pvl["DisplayName"][0]).ToQt()); - QByteArray hexValues(pvl["Values"][0].toLatin1()); + QByteArray hexValues(QString::fromStdString(pvl["Values"][0]).toLatin1()); QDataStream valuesStream(QByteArray::fromHex(hexValues)); valuesStream >> *m_propertyValues; } @@ -58,7 +58,7 @@ namespace Isis { */ PvlObject DisplayProperties::toPvl() const { PvlObject output("DisplayProperties"); - output += PvlKeyword("DisplayName", displayName()); + output += PvlKeyword("DisplayName", displayName().toStdString()); QBuffer dataBuffer; dataBuffer.open(QIODevice::ReadWrite); @@ -67,7 +67,7 @@ namespace Isis { propsStream << *m_propertyValues; dataBuffer.seek(0); - output += PvlKeyword("Values", QString(dataBuffer.data().toHex())); + output += PvlKeyword("Values", std::string(dataBuffer.data().toHex())); return output; } diff --git a/isis/src/qisis/objs/FeatureNomenclatureTool/FeatureNomenclatureTool.cpp b/isis/src/qisis/objs/FeatureNomenclatureTool/FeatureNomenclatureTool.cpp index 3cf32d574a..2acecbe2b2 100644 --- a/isis/src/qisis/objs/FeatureNomenclatureTool/FeatureNomenclatureTool.cpp +++ b/isis/src/qisis/objs/FeatureNomenclatureTool/FeatureNomenclatureTool.cpp @@ -747,7 +747,7 @@ namespace Isis { PvlGroup mappingGrp = vp->projection()->Mapping(); if (mappingGrp.hasKeyword("TargetName")) - target = mappingGrp["TargetName"][0]; + target = QString::fromStdString(mappingGrp["TargetName"][0]); } Latitude minLat; diff --git a/isis/src/qisis/objs/FileTool/FileTool.cpp b/isis/src/qisis/objs/FileTool/FileTool.cpp index 214013ed26..b0dc941c6f 100644 --- a/isis/src/qisis/objs/FileTool/FileTool.cpp +++ b/isis/src/qisis/objs/FileTool/FileTool.cpp @@ -617,7 +617,7 @@ namespace Isis { Pvl &inlab = *icube->label(); for(int i = 0; i < inlab.objects(); i++) { if (inlab.object(i).isNamed("Table")) { - Blob t((QString)inlab.object(i)["Name"], inlab.object(i).name()); + Blob t(QString::fromStdString(inlab.object(i)["Name"]), inlab.object(i).name()); icube->read(t); ocube->write(t); } @@ -627,7 +627,7 @@ namespace Isis { inlab = *icube->label(); for(int i = 0; i < inlab.objects(); i++) { if (inlab.object(i).isNamed("Polygon")) { - Blob t((QString)inlab.object(i)["Name"], inlab.object(i).name()); + Blob t(QString::fromStdString(inlab.object(i)["Name"]), inlab.object(i).name()); icube->read(t); ocube->write(t); } @@ -705,16 +705,16 @@ namespace Isis { int iNumBands = pInCube->bandCount(); PvlGroup results("Results"); - results += PvlKeyword("InputLines", toString(pInCube->lineCount())); - results += PvlKeyword("InputSamples", toString(pInCube->sampleCount())); - results += PvlKeyword("StartingLine", toString(dStartLine)); - results += PvlKeyword("StartingSample", toString(dStartSample)); - results += PvlKeyword("EndingLine", toString(dEndLine)); - results += PvlKeyword("EndingSample", toString(dEndSample)); - results += PvlKeyword("LineIncrement", toString(1)); - results += PvlKeyword("SampleIncrement", toString(1)); - results += PvlKeyword("OutputLines", toString(pNumLines)); - results += PvlKeyword("OutputSamples", toString(pNumSamples)); + results += PvlKeyword("InputLines", std::to_string(pInCube->lineCount())); + results += PvlKeyword("InputSamples", std::to_string(pInCube->sampleCount())); + results += PvlKeyword("StartingLine", std::to_string(dStartLine)); + results += PvlKeyword("StartingSample", std::to_string(dStartSample)); + results += PvlKeyword("EndingLine", std::to_string(dEndLine)); + results += PvlKeyword("EndingSample", std::to_string(dEndSample)); + results += PvlKeyword("LineIncrement", std::to_string(1)); + results += PvlKeyword("SampleIncrement", std::to_string(1)); + results += PvlKeyword("OutputLines", std::to_string(pNumLines)); + results += PvlKeyword("OutputSamples", std::to_string(pNumSamples)); SubArea subArea; subArea.SetSubArea(pInCube->lineCount(), pInCube->sampleCount(), dStartLine, dStartSample, dEndLine, dEndSample, 1.0, 1.0); @@ -769,7 +769,7 @@ namespace Isis { Pvl whatsThisPvl; cubeViewport()->getAllWhatsThisInfo(whatsThisPvl); - whatsThisPvl.write(output); + whatsThisPvl.write(output.toStdString()); } diff --git a/isis/src/qisis/objs/HelpTool/HelpTool.cpp b/isis/src/qisis/objs/HelpTool/HelpTool.cpp index fc29bd2e66..3764984de4 100644 --- a/isis/src/qisis/objs/HelpTool/HelpTool.cpp +++ b/isis/src/qisis/objs/HelpTool/HelpTool.cpp @@ -68,7 +68,7 @@ namespace Isis { QApplication::applicationName() + "/" + QApplication::applicationName() + ".html"; #elif defined(__APPLE__) - QString command = "open -a" + (QString) uig["GuiHelpBrowser"] + + QString command = "open -a" + QString::fromStdString(uig["GuiHelpBrowser"]) + " http://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/" + QApplication::applicationName() + "/" + QApplication::applicationName() + ".html"; diff --git a/isis/src/qisis/objs/Image/Image.cpp b/isis/src/qisis/objs/Image/Image.cpp index e2fd0ee9d2..fedfd7ff64 100644 --- a/isis/src/qisis/objs/Image/Image.cpp +++ b/isis/src/qisis/objs/Image/Image.cpp @@ -178,7 +178,7 @@ namespace Isis { displayProperties()->fromPvl(pvl.findObject("DisplayProperties")); if (pvl.hasKeyword("ID")) { - QByteArray hexValues(pvl["ID"][0].toLatin1()); + QByteArray hexValues(QString::fromStdString(pvl["ID"][0]).toLatin1()); QDataStream valuesStream(QByteArray::fromHex(hexValues)); valuesStream >> *m_id; } @@ -201,7 +201,7 @@ namespace Isis { PvlObject Image::toPvl() const { PvlObject output("Image"); - output += PvlKeyword("FileName", m_fileName); + output += PvlKeyword("FileName", m_fileName.toStdString()); // Do m_id QBuffer dataBuffer; @@ -212,7 +212,7 @@ namespace Isis { dataBuffer.seek(0); - output += PvlKeyword("ID", QString(dataBuffer.data().toHex())); + output += PvlKeyword("ID", std::string(dataBuffer.data().toHex())); output += displayProperties()->toPvl(); @@ -235,7 +235,7 @@ namespace Isis { if (!result && m_cube) { Blob example = ImagePolygon().toBlob(); - QString blobType = example.Type(); + QString blobType = QString::fromStdString(example.Type()); QString blobName = example.Name(); Pvl &labels = *m_cube->label(); @@ -243,7 +243,7 @@ namespace Isis { for (int i = 0; i < labels.objects(); i++) { PvlObject &obj = labels.object(i); - if (obj.isNamed(blobType) && obj.hasKeyword("Name") && obj["Name"][0] == blobName) + if (obj.isNamed(blobType.toStdString()) && obj.hasKeyword("Name") && QString::fromStdString(obj["Name"][0]) == blobName) result = true; } } @@ -773,10 +773,10 @@ namespace Isis { PvlGroup instGroup = obj.findGroup("Instrument"); if (instGroup.hasKeyword("SpacecraftName")) - m_spacecraftName = obj.findGroup("Instrument")["SpacecraftName"][0]; + m_spacecraftName = QString::fromStdString(obj.findGroup("Instrument")["SpacecraftName"][0]); if (instGroup.hasKeyword("InstrumentId")) - m_instrumentId = obj.findGroup("Instrument")["InstrumentId"][0]; + m_instrumentId = QString::fromStdString(obj.findGroup("Instrument")["InstrumentId"][0]); } } catch (IException &) { diff --git a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp index 6de2e9eb77..c268a2641e 100644 --- a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp +++ b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp @@ -124,8 +124,8 @@ namespace Isis { IString key = ImageTreeWidgetItem::treeColumnToString(col) + "Visible"; key = key.Convert(" ", '_'); - if (pvl.hasKeyword(key.ToQt())) { - bool visible = toBool(pvl[key.ToQt()][0]); + if (pvl.hasKeyword(key)) { + bool visible = toBool(QString::fromStdString(pvl[key][0])); if (visible) { m_tree->showColumn(col); @@ -156,7 +156,7 @@ namespace Isis { for (int cubeGrp = 0; cubeGrp < pvl.objects(); cubeGrp ++) { PvlObject &cubes = pvl.object(cubeGrp); - QTreeWidgetItem *newCubeGrp = m_tree->addGroup("", cubes.name()); + QTreeWidgetItem *newCubeGrp = m_tree->addGroup("", QString::fromStdString(cubes.name())); if (cubes.hasKeyword("Expanded")) { bool expanded = (cubes["Expanded"][0] != "No"); @@ -189,17 +189,17 @@ namespace Isis { key = key.Convert(" ", '_'); bool visible = !m_tree->isColumnHidden(col); - output += PvlKeyword(key.ToQt(), toString((int)visible)); + output += PvlKeyword(key, std::to_string((int)visible)); col = (ImageTreeWidgetItem::TreeColumn)(col + 1); } - output += PvlKeyword("SortColumn", toString(m_tree->sortColumn())); + output += PvlKeyword("SortColumn", std::to_string(m_tree->sortColumn())); // Now store groups and the cubes that are in those groups for (int i = 0; i < m_tree->topLevelItemCount(); i++) { QTreeWidgetItem *group = m_tree->topLevelItem(i); PvlObject cubeGroup( - group->text(ImageTreeWidgetItem::NameColumn)); + group->text(ImageTreeWidgetItem::NameColumn).toStdString()); cubeGroup += PvlKeyword("Expanded", group->isExpanded() ? "Yes" : "No"); for (int j = 0; j < group->childCount(); j++) { @@ -208,7 +208,7 @@ namespace Isis { if (item->type() == QTreeWidgetItem::UserType) { ImageTreeWidgetItem *cubeItem = (ImageTreeWidgetItem *)item; - cubeGroup += PvlKeyword("Image", cubeItem->image()->id()); + cubeGroup += PvlKeyword("Image", cubeItem->image()->id().toStdString()); } } @@ -535,7 +535,7 @@ namespace Isis { PvlKeyword &key = obj[fileKeyIndex]; if (key.isNamed("Image")) { - if (key[0] == id) { + if (key[0] == id.toStdString()) { result = ImageTreeWidget::ImagePosition(objIndex, imageKeyOffset); } else { @@ -633,7 +633,7 @@ namespace Isis { // stream.writeEndElement(); // // stream.writeStartElement("position"); -// //qDebug()<<"ImageFileListWidget::save Position = "<label()->objects(); iobj++) { PvlObject obj = ecub->label()->object(iobj); if (obj.name() != "Table") continue; - if (obj["Name"][0] != QString("CameraStatistics")) continue; + if (obj["Name"][0] != "CameraStatistics") continue; ecub->label()->deleteObject(iobj); break; } @@ -359,8 +359,8 @@ namespace Isis { QString bundleTimestamp = "Jigged = " + m_bundleSolutionInfo->runTime(); Table cMatrix = m_bundleAdjust->cMatrix(i); Table spVector = m_bundleAdjust->spVector(i); - cMatrix.Label().addComment(bundleTimestamp); - spVector.Label().addComment(bundleTimestamp); + cMatrix.Label().addComment(bundleTimestamp.toStdString()); + spVector.Label().addComment(bundleTimestamp.toStdString()); ecub->write(cMatrix); ecub->write(spVector); // The ecub is now adjusted, add this to our list of adjusted images diff --git a/isis/src/qisis/objs/MatchTool/MatchTool.cpp b/isis/src/qisis/objs/MatchTool/MatchTool.cpp index a436e4a1b2..864887cab3 100644 --- a/isis/src/qisis/objs/MatchTool/MatchTool.cpp +++ b/isis/src/qisis/objs/MatchTool/MatchTool.cpp @@ -2882,12 +2882,12 @@ namespace Isis { void MatchTool::viewTemplateFile() { try{ // Get the template file from the ControlPointEditor object - Pvl templatePvl(m_pointEditor->templateFileName()); + Pvl templatePvl(m_pointEditor->templateFileName().toStdString()); // Create registration dialog window using PvlEditDialog class // to view and/or edit the template PvlEditDialog registrationDialog(templatePvl); registrationDialog.setWindowTitle("View or Edit Template File: " - + templatePvl.fileName()); + + QString::fromStdString(templatePvl.fileName())); registrationDialog.resize(550,360); registrationDialog.exec(); } diff --git a/isis/src/qisis/objs/MosaicMainWindow/MosaicController.cpp b/isis/src/qisis/objs/MosaicMainWindow/MosaicController.cpp index c2e78dbddd..90313e1db4 100644 --- a/isis/src/qisis/objs/MosaicMainWindow/MosaicController.cpp +++ b/isis/src/qisis/objs/MosaicMainWindow/MosaicController.cpp @@ -124,7 +124,7 @@ namespace Isis { projFile += m_fileList->toPvl(); projFile += m_scene->toPvl(); - projFile.write(projFileName); + projFile.write(projFileName.toStdString()); } @@ -234,7 +234,7 @@ namespace Isis { void MosaicController::readProject(QString filename) { try { - Pvl projectPvl(filename); + Pvl projectPvl(filename.toStdString()); // Convert versions <= isis3.4.1 to newer if (projectPvl.hasObject("Cubes")) { @@ -312,19 +312,19 @@ namespace Isis { QDataStream idStream(&idDataBuffer); QUuid newId = QUuid::createUuid(); - QString fileName = image["FileName"][0]; + QString fileName = QString::fromStdString(image["FileName"][0]); idStream << newId; idDataBuffer.seek(0); QString idHex; - image += PvlKeyword("ID", QString(idDataBuffer.data().toHex())); + image += PvlKeyword("ID", std::string(idDataBuffer.data().toHex())); PvlKeyword oldDisplayPropsValues = image["Values"]; image.deleteKeyword("Values"); PvlObject displayProps("DisplayProperties"); - displayProps += PvlKeyword("DisplayName", FileName(fileName).name()); + displayProps += PvlKeyword("DisplayName", FileName(fileName).name().toStdString()); // Convert display properties over enum OldDispProps { @@ -339,7 +339,7 @@ namespace Isis { }; QMap oldProps; - QByteArray oldHexValues(oldDisplayPropsValues[0].toLatin1()); + QByteArray oldHexValues(QString::fromStdString(oldDisplayPropsValues[0]).toLatin1()); QDataStream oldValuesStream(QByteArray::fromHex(oldHexValues)); oldValuesStream >> oldProps; @@ -385,7 +385,7 @@ namespace Isis { if (key.isNamed("Cube")) { key.setName("Image"); - key[0] = imageFileToNewId[key[0]]; + key[0] = imageFileToNewId[QString::fromStdString(key[0])].toStdString(); } } } @@ -400,7 +400,7 @@ namespace Isis { PvlKeyword &key = zOrdering[i]; if (key.isNamed("ZValue")) { - key[0] = imageFileToNewId[key[0]]; + key[0] = imageFileToNewId[QString::fromStdString(key[0])].toStdString(); } } } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicAreaTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicAreaTool.cpp index 7078c86a0a..adc0c6d23f 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicAreaTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicAreaTool.cpp @@ -290,13 +290,13 @@ namespace Isis { PvlObject MosaicAreaTool::toPvl() const { - PvlObject obj(projectPvlObjectName()); + PvlObject obj(projectPvlObjectName().toStdString()); if(m_box) { - obj += PvlKeyword("Latitude", m_latLineEdit->text()); - obj += PvlKeyword("Longitude", m_lonLineEdit->text()); - obj += PvlKeyword("Area", m_areaLineEdit->text()); - obj += PvlKeyword("Visible", toString((int)(m_box != NULL))); + obj += PvlKeyword("Latitude", m_latLineEdit->text().toStdString()); + obj += PvlKeyword("Longitude", m_lonLineEdit->text().toStdString()); + obj += PvlKeyword("Area", m_areaLineEdit->text().toStdString()); + obj += PvlKeyword("Visible", std::to_string((int)(m_box != NULL))); } return obj; @@ -306,15 +306,15 @@ namespace Isis { void MosaicAreaTool::fromPvl(const PvlObject &obj) { if(obj.hasKeyword("Visible")) { if(obj.hasKeyword("Latitude") && obj["Latitude"][0] != "Null") - m_latLineEdit->setText(obj["Latitude"][0]); + m_latLineEdit->setText(QString::fromStdString(obj["Latitude"][0])); if(obj.hasKeyword("Longitude") && obj["Longitude"][0] != "Null") - m_lonLineEdit->setText(obj["Longitude"][0]); + m_lonLineEdit->setText(QString::fromStdString(obj["Longitude"][0])); if(obj.hasKeyword("Area") && obj["Area"][0] != "Null") - m_areaLineEdit->setText(obj["Area"][0]); + m_areaLineEdit->setText(QString::fromStdString(obj["Area"][0])); - if(toBool(obj["Visible"][0]) != false) { + if(toBool(QString::fromStdString(obj["Visible"][0])) != false) { userChangedBox(); } } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp index 716902940b..7b7aa3093e 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp @@ -160,20 +160,20 @@ namespace Isis { PvlObject MosaicControlNetTool::toPvl() const { - PvlObject obj(projectPvlObjectName()); + PvlObject obj(projectPvlObjectName().toStdString()); - obj += PvlKeyword("FileName", m_controlNetFile); + obj += PvlKeyword("FileName", m_controlNetFile.toStdString()); obj += PvlKeyword("Visible", - Isis::toString((int)(m_controlNetGraphics && m_controlNetGraphics->isVisible()))); - obj += PvlKeyword("Movement", toString(m_movementArrowColorSource)); + std::to_string((int)(m_controlNetGraphics && m_controlNetGraphics->isVisible()))); + obj += PvlKeyword("Movement", std::to_string(m_movementArrowColorSource)); if (maxMovementColorMeasureCount() != -1) { - obj += PvlKeyword("MovementColorMaxMeasureCount", Isis::toString(m_measureCount)); + obj += PvlKeyword("MovementColorMaxMeasureCount", std::to_string(m_measureCount)); } if (maxMovementColorResidualMagnitude() != Null) { obj += PvlKeyword("MovementColorMaxResidualMagnitude", - Isis::toString(m_residualMagnitude)); + std::to_string(m_residualMagnitude)); } return obj; @@ -181,26 +181,26 @@ namespace Isis { void MosaicControlNetTool::fromPvl(const PvlObject &obj) { - m_controlNetFile = obj["FileName"][0]; + m_controlNetFile = QString::fromStdString(obj["FileName"][0]); if (m_controlNetFile == "Null") m_controlNetFile = ""; if (obj.hasKeyword("Movement")) { - m_movementArrowColorSource = fromMovementColorSourceString(obj["Movement"]); + m_movementArrowColorSource = fromMovementColorSourceString(QString::fromStdString(obj["Movement"])); } if (obj.hasKeyword("MovementColorMaxMeasureCount")) { - m_measureCount = toInt(obj["MovementColorMaxMeasureCount"][0]); + m_measureCount = std::stoi(obj["MovementColorMaxMeasureCount"][0]); } if (obj.hasKeyword("MovementColorMaxResidualMagnitude")) { - m_residualMagnitude = toDouble(obj["MovementColorMaxResidualMagnitude"][0]); + m_residualMagnitude = std::stod(obj["MovementColorMaxResidualMagnitude"][0]); } loadNetwork(); if (m_controlNetGraphics && m_displayControlNetButton) { - m_displayControlNetButton->setChecked( toBool(obj["Visible"][0]) ); + m_displayControlNetButton->setChecked( toBool(QString::fromStdString(obj["Visible"][0])) ); displayControlNet(); } } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp index 11dcc9a76c..b78638c927 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp @@ -168,20 +168,20 @@ namespace Isis { PvlObject MosaicFindTool::toPvl() const { - PvlObject obj(projectPvlObjectName()); + PvlObject obj(projectPvlObjectName().toStdString()); - obj += PvlKeyword("Latitude", p_latLineEdit->text()); - obj += PvlKeyword("Longitude", p_lonLineEdit->text()); - obj += PvlKeyword("Visible", toString((int)(p_findSpot != NULL))); + obj += PvlKeyword("Latitude", p_latLineEdit->text().toStdString()); + obj += PvlKeyword("Longitude", p_lonLineEdit->text().toStdString()); + obj += PvlKeyword("Visible", std::to_string((int)(p_findSpot != NULL))); return obj; } void MosaicFindTool::fromPvl(const PvlObject &obj) { - p_latLineEdit->setText(obj["Latitude"][0]); - p_lonLineEdit->setText(obj["Longitude"][0]); - if(toBool(obj["Visible"][0])) { + p_latLineEdit->setText(QString::fromStdString(obj["Latitude"][0])); + p_lonLineEdit->setText(QString::fromStdString(obj["Longitude"][0])); + if(toBool(QString::fromStdString(obj["Visible"][0]))) { getUserGroundPoint(); } } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp index ede6d55718..b3a8f04fd8 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp @@ -568,52 +568,52 @@ namespace Isis { tproj->PolarRadius(), Distance::Meters); if (obj["BaseLatitude"][0] != "Null") - m_baseLat = Latitude(toDouble(obj["BaseLatitude"][0]), equatorialRadius, polarRadius, + m_baseLat = Latitude(std::stod(obj["BaseLatitude"][0]), equatorialRadius, polarRadius, Latitude::Planetocentric, Angle::Degrees); if (obj["BaseLongitude"][0] != "Null") - m_baseLon = Longitude(toDouble(obj["BaseLongitude"][0]), Angle::Degrees); + m_baseLon = Longitude(std::stod(obj["BaseLongitude"][0]), Angle::Degrees); if (obj["LatitudeIncrement"][0] != "Null") - m_latInc = Angle(toDouble(obj["LatitudeIncrement"][0]), Angle::Degrees); + m_latInc = Angle(std::stod(obj["LatitudeIncrement"][0]), Angle::Degrees); if (obj["LongitudeIncrement"][0] != "Null") - m_lonInc = Angle(toDouble(obj["LongitudeIncrement"][0]), Angle::Degrees); + m_lonInc = Angle(std::stod(obj["LongitudeIncrement"][0]), Angle::Degrees); if (obj.hasKeyword("LatitudeExtentType")) { if (obj["LatitudeExtentType"][0] != "Null") - m_latExtents = (GridExtentSource)toInt(obj["LatitudeExtentType"][0]); + m_latExtents = (GridExtentSource)std::stoi(obj["LatitudeExtentType"][0]); } if (obj.hasKeyword("MinimumLatitude")) { if (obj["MinimumLatitude"][0] != "Null") - m_minLat = Latitude(toDouble(obj["MinimumLatitude"][0]), equatorialRadius, polarRadius, + m_minLat = Latitude(std::stod(obj["MinimumLatitude"][0]), equatorialRadius, polarRadius, Latitude::Planetocentric, Angle::Degrees); } if (obj.hasKeyword("MaximumLatitude")) { if (obj["MaximumLatitude"][0] != "Null") - m_maxLat = Latitude(toDouble(obj["MaximumLatitude"][0]), equatorialRadius, polarRadius, + m_maxLat = Latitude(std::stod(obj["MaximumLatitude"][0]), equatorialRadius, polarRadius, Latitude::Planetocentric, Angle::Degrees); } if (obj.hasKeyword("LongitudeExtentType")) { if (obj["LongitudeExtentType"][0] != "Null") - m_lonExtents = (GridExtentSource)toInt(obj["LongitudeExtentType"][0]); + m_lonExtents = (GridExtentSource)std::stoi(obj["LongitudeExtentType"][0]); } if (obj.hasKeyword("MinimumLongitude")) { if (obj["MinimumLongitude"][0] != "Null") - m_minLon = Longitude(toDouble(obj["MinimumLongitude"][0]), Angle::Degrees); + m_minLon = Longitude(std::stod(obj["MinimumLongitude"][0]), Angle::Degrees); } if (obj.hasKeyword("MaximumLongitude")) { if (obj["MaximumLongitude"][0] != "Null") - m_maxLon = Longitude(toDouble(obj["MaximumLongitude"][0]), Angle::Degrees); + m_maxLon = Longitude(std::stod(obj["MaximumLongitude"][0]), Angle::Degrees); } if (obj["Density"][0] != "Null") - m_density = toDouble(obj["Density"][0]); + m_density = std::stod(obj["Density"][0]); if (obj.hasKeyword("CheckTheBoxes")) { @@ -622,7 +622,7 @@ namespace Isis { } } - if(toBool(obj["Visible"][0])) { + if(toBool(QString::fromStdString(obj["Visible"][0]))) { drawGrid(); } } @@ -645,26 +645,26 @@ namespace Isis { * @return the pvl object */ PvlObject MosaicGridTool::toPvl() const { - PvlObject obj(projectPvlObjectName()); + PvlObject obj(projectPvlObjectName().toStdString()); - obj += PvlKeyword("ShouldCheckBoxes", toString((int)m_shouldCheckBoxes)); + obj += PvlKeyword("ShouldCheckBoxes", std::to_string((int)m_shouldCheckBoxes)); - obj += PvlKeyword("BaseLatitude", toString(m_baseLat.degrees())); - obj += PvlKeyword("BaseLongitude", toString(m_baseLon.degrees())); + obj += PvlKeyword("BaseLatitude", std::to_string(m_baseLat.degrees())); + obj += PvlKeyword("BaseLongitude", std::to_string(m_baseLon.degrees())); - obj += PvlKeyword("LatitudeIncrement", toString(m_latInc.degrees())); - obj += PvlKeyword("LongitudeIncrement", toString(m_lonInc.degrees())); + obj += PvlKeyword("LatitudeIncrement", std::to_string(m_latInc.degrees())); + obj += PvlKeyword("LongitudeIncrement", std::to_string(m_lonInc.degrees())); - obj += PvlKeyword("LatitudeExtentType", toString(m_latExtents)); - obj += PvlKeyword("MaximumLatitude", toString(m_maxLat.degrees())); - obj += PvlKeyword("MinimumLongitude", toString(m_minLon.degrees())); + obj += PvlKeyword("LatitudeExtentType", std::to_string(m_latExtents)); + obj += PvlKeyword("MaximumLatitude", std::to_string(m_maxLat.degrees())); + obj += PvlKeyword("MinimumLongitude", std::to_string(m_minLon.degrees())); - obj += PvlKeyword("LongitudeExtentType", toString(m_lonExtents)); - obj += PvlKeyword("MinimumLatitude", toString(m_minLat.degrees())); - obj += PvlKeyword("MaximumLongitude", toString(m_maxLon.degrees())); + obj += PvlKeyword("LongitudeExtentType", std::to_string(m_lonExtents)); + obj += PvlKeyword("MinimumLatitude", std::to_string(m_minLat.degrees())); + obj += PvlKeyword("MaximumLongitude", std::to_string(m_maxLon.degrees())); - obj += PvlKeyword("Density", toString(m_density)); - obj += PvlKeyword("Visible", toString((int)(m_gridItem != NULL))); + obj += PvlKeyword("Density", std::to_string(m_density)); + obj += PvlKeyword("Visible", std::to_string((int)(m_gridItem != NULL))); return obj; } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp index 58d845fd0a..9bad00d71f 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp @@ -289,7 +289,7 @@ namespace Isis { if (m_mapButton) { PvlKeyword projectionKeyword = mapping.findKeyword("ProjectionName"); - QString projName = projectionKeyword[0]; + QString projName = QString::fromStdString(projectionKeyword[0]); m_mapButton->setText(tr("View/Edit %1 Projection").arg(projName)); } @@ -356,10 +356,10 @@ namespace Isis { Distance radii[3]; cam->radii(radii); - mappingGrp += PvlKeyword("TargetName", cam->target()->name()); - mappingGrp += PvlKeyword("EquatorialRadius", toString(radii[0].meters()), + mappingGrp += PvlKeyword("TargetName", cam->target()->name().toStdString()); + mappingGrp += PvlKeyword("EquatorialRadius", std::to_string(radii[0].meters()), "meters"); - mappingGrp += PvlKeyword("PolarRadius", toString(radii[2].meters()), + mappingGrp += PvlKeyword("PolarRadius", std::to_string(radii[2].meters()), "meters"); } @@ -390,7 +390,7 @@ namespace Isis { if (m_projection) { PvlKeyword projectionKeyword = m_projection->Mapping().findKeyword("ProjectionName"); - QString projName = projectionKeyword[0]; + QString projName = QString::fromStdString(projectionKeyword[0]); m_mapButton->setText(projName); } @@ -533,10 +533,10 @@ namespace Isis { PvlObject mosaicScenePosition("SceneVisiblePosition"); mosaicScenePosition += PvlKeyword("ViewTransform", - QString(dataBuffer.data().toHex())); + std::string(dataBuffer.data().toHex())); PvlKeyword scrollPos("ScrollPosition"); - scrollPos += toString(getView()->horizontalScrollBar()->value()); - scrollPos += toString(getView()->verticalScrollBar()->value()); + scrollPos += std::to_string(getView()->horizontalScrollBar()->value()); + scrollPos += std::to_string(getView()->verticalScrollBar()->value()); mosaicScenePosition += scrollPos; output += mosaicScenePosition; @@ -545,7 +545,7 @@ namespace Isis { foreach(tool, *m_tools) { if (tool->projectPvlObjectName() != "") { PvlObject toolObj = tool->toPvl(); - toolObj.setName(tool->projectPvlObjectName()); + toolObj.setName(tool->projectPvlObjectName().toStdString()); output += toolObj; } } @@ -553,8 +553,8 @@ namespace Isis { PvlObject zOrders("ZOrdering"); foreach(MosaicSceneItem * mosaicSceneItem, *m_mosaicSceneItems) { PvlKeyword zValue("ZValue"); - zValue += mosaicSceneItem->image()->id(); - zValue += toString(mosaicSceneItem->zValue()); + zValue += mosaicSceneItem->image()->id().toStdString(); + zValue += std::to_string(mosaicSceneItem->zValue()); zOrders += zValue; } @@ -582,9 +582,9 @@ namespace Isis { MosaicTool *tool; foreach(tool, *m_tools) { if (tool->projectPvlObjectName() != "") { - if (project.hasObject(tool->projectPvlObjectName())) { + if (project.hasObject(tool->projectPvlObjectName().toStdString())) { const PvlObject &toolSettings( - project.findObject(tool->projectPvlObjectName())); + project.findObject(tool->projectPvlObjectName().toStdString())); tool->fromPvl(toolSettings); } } @@ -601,7 +601,7 @@ namespace Isis { zOrderIndex ++) { const PvlKeyword &zOrder = zOrders[zOrderIndex]; - (*m_projectImageZOrders)[zOrder[0]] = toDouble(zOrder[1]); + (*m_projectImageZOrders)[QString::fromStdString(zOrder[0])] = std::stod(zOrder[1]); } } @@ -651,7 +651,7 @@ namespace Isis { QString projectPvlObjectName = tool->projectPvlObjectName(); if (projectPvlObjectName != "") { PvlObject toolObj = tool->toPvl(); - toolObj.setName(projectPvlObjectName); + toolObj.setName(projectPvlObjectName.toStdString()); stream.writeStartElement("toolData"); stream.writeAttribute("objectName", projectPvlObjectName); @@ -1370,15 +1370,15 @@ namespace Isis { if (m_projectViewTransform) { PvlObject &positionInfo = *m_projectViewTransform; - QByteArray hexValues(positionInfo["ViewTransform"][0].toLatin1()); + QByteArray hexValues(QString::fromStdString(positionInfo["ViewTransform"][0]).toLatin1()); QDataStream transformStream(QByteArray::fromHex(hexValues)); QTransform viewTransform; transformStream >> viewTransform; getView()->setTransform(viewTransform); - QPoint projectScrollPos(toInt(positionInfo["ScrollPosition"][0]), - toInt(positionInfo["ScrollPosition"][1])); + QPoint projectScrollPos(std::stoi(positionInfo["ScrollPosition"][0]), + std::stoi(positionInfo["ScrollPosition"][1])); getView()->horizontalScrollBar()->setValue(projectScrollPos.x()); getView()->verticalScrollBar()->setValue(projectScrollPos.y()); diff --git a/isis/src/qisis/objs/MosaicSceneWidget/ProjectionConfigDialog.cpp b/isis/src/qisis/objs/MosaicSceneWidget/ProjectionConfigDialog.cpp index d2d6e466c1..57388ead17 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/ProjectionConfigDialog.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/ProjectionConfigDialog.cpp @@ -282,7 +282,7 @@ namespace Isis { bool success = false; try { - Pvl mapFilePvl(mapFile); + Pvl mapFilePvl(mapFile.toStdString()); PvlGroup &mapping = mapFilePvl.findGroup("Mapping", PvlObject::Traverse); Pvl trimmedMapFilePvl; diff --git a/isis/src/qisis/objs/QIsisApplication/QIsisApplication.cpp b/isis/src/qisis/objs/QIsisApplication/QIsisApplication.cpp index 3fc1af0f65..bfdea6f6e6 100644 --- a/isis/src/qisis/objs/QIsisApplication/QIsisApplication.cpp +++ b/isis/src/qisis/objs/QIsisApplication/QIsisApplication.cpp @@ -41,7 +41,7 @@ namespace Isis { FileName preferenceFile(argv[nextIndex]); QString filePath = preferenceFile.expanded(); Preference::Preferences().clear(); - Preference::Preferences().Load(filePath); + Preference::Preferences().Load(filePath.toStdString()); } else { QMessageBox::warning(NULL, "Warning", "Preference flag set but no preference file given."); diff --git a/isis/src/qisis/objs/QnetTools/QnetTool.cpp b/isis/src/qisis/objs/QnetTools/QnetTool.cpp index bf6bb38f2b..5939afecd1 100644 --- a/isis/src/qisis/objs/QnetTools/QnetTool.cpp +++ b/isis/src/qisis/objs/QnetTools/QnetTool.cpp @@ -3463,12 +3463,12 @@ namespace Isis { void QnetTool::viewTemplateFile() { try{ // Get the template file from the ControlPointEditor object - Pvl templatePvl(m_pointEditor->templateFileName()); + Pvl templatePvl(m_pointEditor->templateFileName().toStdString()); // Create registration dialog window using PvlEditDialog class // to view and/or edit the template PvlEditDialog registrationDialog(templatePvl); registrationDialog.setWindowTitle("View or Edit Template File: " - + templatePvl.fileName()); + + QString::fromStdString(templatePvl.fileName())); registrationDialog.resize(550,360); registrationDialog.exec(); } @@ -3784,7 +3784,7 @@ namespace Isis { m_groundSurfacePointSource = ControlPoint::SurfacePointSource::Reference; if (!m_demOpen) { PvlGroup kernels = m_groundCube->group("Kernels"); - QString shapeFile = kernels ["ShapeModel"]; + QString shapeFile = QString::fromStdString(kernels["ShapeModel"]); if (shapeFile.contains("dem")) { m_groundRadiusSource = ControlPoint::RadiusSource::DEM; m_radiusSourceFile = shapeFile; @@ -3792,7 +3792,7 @@ namespace Isis { else { m_groundRadiusSource = ControlPoint::RadiusSource::Ellipsoid; // Find pck file from Kernels group - m_radiusSourceFile = (QString) kernels["TargetAttitudeShape"]; + m_radiusSourceFile = QString::fromStdString(kernels["TargetAttitudeShape"]); } } } @@ -3862,7 +3862,7 @@ namespace Isis { QString referenceFileName = m_serialNumberList->fileName(referenceSN); QScopedPointer referenceCube(new Cube(referenceFileName, "r")); PvlGroup kernels = referenceCube->group("Kernels"); - QString shapeFile = kernels["ShapeModel"]; + QString shapeFile = QString::fromStdString(kernels["ShapeModel"]); // If the reference measure has a shape model cube then set that as the radius // This will NOT WORK for shape model files (not the default of Null or Ellipsoid) diff --git a/isis/src/qisis/objs/Shape/Shape.cpp b/isis/src/qisis/objs/Shape/Shape.cpp index 7042dd84cf..9a318d9dba 100644 --- a/isis/src/qisis/objs/Shape/Shape.cpp +++ b/isis/src/qisis/objs/Shape/Shape.cpp @@ -139,7 +139,7 @@ namespace Isis { PvlGroup kernels = cube()->group("Kernels"); if (kernels.hasKeyword("ShapeModel")) { - QString shapeFile = kernels["ShapeModel"]; + QString shapeFile = QString::fromStdString(kernels["ShapeModel"]); if (shapeFile.contains("dem")) { m_radiusSource = ControlPoint::RadiusSource::DEM; } @@ -229,7 +229,7 @@ namespace Isis { displayProperties()->fromPvl(pvl.findObject("DisplayProperties")); if (pvl.hasKeyword("ID")) { - QByteArray hexValues(pvl["ID"][0].toLatin1()); + QByteArray hexValues(QString::fromStdString(pvl["ID"][0]).toLatin1()); QDataStream valuesStream(QByteArray::fromHex(hexValues)); valuesStream >> *m_id; } @@ -252,7 +252,7 @@ namespace Isis { PvlObject Shape::toPvl() const { PvlObject output("Shape"); - output += PvlKeyword("FileName", m_fileName); + output += PvlKeyword("FileName", m_fileName.toStdString()); // Do m_id QBuffer dataBuffer; @@ -263,7 +263,7 @@ namespace Isis { dataBuffer.seek(0); - output += PvlKeyword("ID", QString(dataBuffer.data().toHex())); + output += PvlKeyword("ID", std::string(dataBuffer.data().toHex())); output += displayProperties()->toPvl(); @@ -284,7 +284,7 @@ namespace Isis { if (!result && m_cube) { Blob example = ImagePolygon().toBlob(); - QString blobType = example.Type(); + QString blobType = QString::fromStdString(example.Type()); QString blobName = example.Name(); Pvl &labels = *m_cube->label(); @@ -292,7 +292,7 @@ namespace Isis { for (int i = 0; i < labels.objects(); i++) { PvlObject &obj = labels.object(i); - if (obj.isNamed(blobType) && obj.hasKeyword("Name") && obj["Name"][0] == blobName) + if (obj.isNamed(blobType.toStdString()) && obj.hasKeyword("Name") && QString::fromStdString(obj["Name"][0]) == blobName) result = true; } } @@ -714,10 +714,10 @@ namespace Isis { PvlGroup instGroup = obj.findGroup("Instrument"); if (instGroup.hasKeyword("SpacecraftName")) - m_spacecraftName = obj.findGroup("Instrument")["SpacecraftName"][0]; + m_spacecraftName = QString::fromStdString(obj.findGroup("Instrument")["SpacecraftName"][0]); if (instGroup.hasKeyword("InstrumentId")) - m_instrumentId = obj.findGroup("Instrument")["InstrumentId"][0]; + m_instrumentId = QString::fromStdString(obj.findGroup("Instrument")["InstrumentId"][0]); } } catch (IException &e) { @@ -737,43 +737,43 @@ namespace Isis { PvlGroup instGroup = obj.findGroup("Instrument"); if (instGroup.hasKeyword("SpacecraftName")) - m_spacecraftName = obj.findGroup("Instrument")["SpacecraftName"][0]; + m_spacecraftName = QString::fromStdString(obj.findGroup("Instrument")["SpacecraftName"][0]); if (instGroup.hasKeyword("InstrumentId")) - m_instrumentId = obj.findGroup("Instrument")["InstrumentId"][0]; + m_instrumentId = QString::fromStdString(obj.findGroup("Instrument")["InstrumentId"][0]); } if (obj.hasGroup("Mapping")) { PvlGroup mapGroup = obj.findGroup("Mapping"); if (mapGroup.hasKeyword("TargetName")) - m_targetName = obj.findGroup("Mapping")["TargetName"][0]; + m_targetName = QString::fromStdString(obj.findGroup("Mapping")["TargetName"][0]); if (mapGroup.hasKeyword("ProjectionName")) - m_projectionName = obj.findGroup("Mapping")["ProjectionName"][0]; + m_projectionName = QString::fromStdString(obj.findGroup("Mapping")["ProjectionName"][0]); if (mapGroup.hasKeyword("CenterLongitude")) - m_centerLongitude = Longitude(toDouble(obj.findGroup("Mapping")["CenterLongitude"][0]), + m_centerLongitude = Longitude(std::stod(obj.findGroup("Mapping")["CenterLongitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("CenterLatitude")) - m_centerLatitude = Latitude(toDouble(obj.findGroup("Mapping")["CenterLatitude"][0]), + m_centerLatitude = Latitude(std::stod(obj.findGroup("Mapping")["CenterLatitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("MinimumLatitude")) - m_minimumLatitude = Latitude(toDouble(obj.findGroup("Mapping")["MinimumLatitude"][0]), + m_minimumLatitude = Latitude(std::stod(obj.findGroup("Mapping")["MinimumLatitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("MaximumLatitude")) - m_maximumLatitude = Latitude(toDouble(obj.findGroup("Mapping")["MaximumLatitude"][0]), + m_maximumLatitude = Latitude(std::stod(obj.findGroup("Mapping")["MaximumLatitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("MinimumLongitude")) - m_minimumLongitude = Longitude(toDouble(obj.findGroup("Mapping")["MinimumLongitude"][0]), + m_minimumLongitude = Longitude(std::stod(obj.findGroup("Mapping")["MinimumLongitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("MaximumLongitude")) - m_maximumLongitude = Longitude(toDouble(obj.findGroup("Mapping")["MaximumLongitude"][0]), + m_maximumLongitude = Longitude(std::stod(obj.findGroup("Mapping")["MaximumLongitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("PixelResolution")) diff --git a/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotTool.cpp b/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotTool.cpp index ffb4b7593c..580e53a756 100644 --- a/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotTool.cpp +++ b/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotTool.cpp @@ -669,7 +669,7 @@ namespace Isis { if (bandBin.hasKeyword("Center")) { PvlKeyword &wavelength = bandBin.findKeyword("Center"); if (wavelength.size() > (band - 1)) { - labels.push_back(toDouble(wavelength[band-1])); + labels.push_back(std::stod(wavelength[band-1])); } } } diff --git a/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotWindow.cpp b/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotWindow.cpp index 51a191e396..a96c3071c7 100644 --- a/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotWindow.cpp +++ b/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotWindow.cpp @@ -121,7 +121,7 @@ namespace Isis { /*This is were we need to set the x value to the band number.*/ if (grayBand > 0) { if (xAxisUnits() == PlotCurve::Wavelength) { - m_grayBandLine->setXValue(toDouble(wavelengths[grayBand-1])); + m_grayBandLine->setXValue(std::stod(wavelengths[grayBand-1])); } else { m_grayBandLine->setXValue(grayBand); @@ -136,7 +136,7 @@ namespace Isis { if (redBand > 0) { if (xAxisUnits() == PlotCurve::Wavelength) { - m_redBandLine->setXValue(toDouble(wavelengths[redBand-1])); + m_redBandLine->setXValue(std::stod(wavelengths[redBand-1])); } else { m_redBandLine->setXValue(redBand); @@ -150,7 +150,7 @@ namespace Isis { } if (greenBand > 0) { if (xAxisUnits() == PlotCurve::Wavelength) { - m_greenBandLine->setXValue(toDouble(wavelengths[greenBand-1])); + m_greenBandLine->setXValue(std::stod(wavelengths[greenBand-1])); } else { m_greenBandLine->setXValue(greenBand); @@ -165,7 +165,7 @@ namespace Isis { if (blueBand > 0) { if (xAxisUnits() == PlotCurve::Wavelength) { - m_blueBandLine->setXValue(toDouble(wavelengths[blueBand-1])); + m_blueBandLine->setXValue(std::stod(wavelengths[blueBand-1])); } else { m_blueBandLine->setXValue(blueBand); diff --git a/isis/src/qisis/objs/StereoTool/StereoTool.cpp b/isis/src/qisis/objs/StereoTool/StereoTool.cpp index 0cc9cfaad1..6b9cfefe18 100644 --- a/isis/src/qisis/objs/StereoTool/StereoTool.cpp +++ b/isis/src/qisis/objs/StereoTool/StereoTool.cpp @@ -1558,12 +1558,12 @@ namespace Isis { void StereoTool::viewTemplateFile() { try { // Get the template file from the ControlPointEditor object - Pvl templatePvl( m_pointEditor->templateFileName() ); + Pvl templatePvl( m_pointEditor->templateFileName().toStdString() ); // Create registration dialog window using PvlEditDialog class // to view and/or edit the template PvlEditDialog registrationDialog(templatePvl); registrationDialog.setWindowTitle( "View or Edit Template File: " - + templatePvl.fileName() ); + + QString::fromStdString(templatePvl.fileName()) ); registrationDialog.resize(550, 360); registrationDialog.exec(); } @@ -1741,7 +1741,7 @@ namespace Isis { double elevation = 0.; double elevationError = 0.; - Pvl regDef = m_pointEditor->templateFileName(); + Pvl regDef = m_pointEditor->templateFileName().toStdString(); AutoReg *ar = AutoRegFactory::Create(regDef); int failureCount = 0; diff --git a/isis/src/qisis/objs/StretchTool/StretchTool.cpp b/isis/src/qisis/objs/StretchTool/StretchTool.cpp index b747cdd878..6b0472665f 100644 --- a/isis/src/qisis/objs/StretchTool/StretchTool.cpp +++ b/isis/src/qisis/objs/StretchTool/StretchTool.cpp @@ -444,7 +444,7 @@ namespace Isis { PvlKeyword tempKeyword = objIter->findKeyword("Name"); int bandNumber = int(objIter->findKeyword("BandNumber")); if (cvp->grayBand() == bandNumber) { - QString tempName = tempKeyword[0]; + QString tempName = QString::fromStdString(tempKeyword[0]); namelist.append(tempName); } } @@ -463,7 +463,7 @@ namespace Isis { int bandNumber = int(objIter->findKeyword("BandNumber")); if (bandNumber == redBandNumber || bandNumber == greenBandNumber || bandNumber == blueBandNumber) { - QString tempName = tempKeyword[0]; + QString tempName = QString::fromStdString(tempKeyword[0]); if (tempNameMap.contains(tempName)) { tempNameMap[tempName].append(bandNumber); } @@ -511,13 +511,13 @@ namespace Isis { } else { std::vector keywordValueRed; - keywordValueRed.push_back(PvlKeyword("BandNumber", QString::number(cvp->redBand()))); + keywordValueRed.push_back(PvlKeyword("BandNumber", std::to_string(cvp->redBand()))); std::vector keywordValueGreen; - keywordValueGreen.push_back(PvlKeyword("BandNumber", QString::number(cvp->greenBand()))); + keywordValueGreen.push_back(PvlKeyword("BandNumber", std::to_string(cvp->greenBand()))); std::vector keywordValueBlue; - keywordValueBlue.push_back(PvlKeyword("BandNumber", QString::number(cvp->blueBand()))); + keywordValueBlue.push_back(PvlKeyword("BandNumber", std::to_string(cvp->blueBand()))); CubeStretch redStretch = icube->readCubeStretch(stretchName, keywordValueRed); CubeStretch greenStretch = icube->readCubeStretch(stretchName, keywordValueGreen); @@ -562,7 +562,7 @@ namespace Isis { PvlKeyword tempKeyword = objIter->findKeyword("Name"); int bandNumber = int(objIter->findKeyword("BandNumber")); if (cvp->grayBand() == bandNumber) { - QString tempName = tempKeyword[0]; + QString tempName = QString::fromStdString(tempKeyword[0]); namelist.append(tempName); } } @@ -626,7 +626,7 @@ namespace Isis { for (objIter=lab->beginObject(); objIterendObject(); objIter++) { if (objIter->name() == "Stretch") { PvlKeyword tempKeyword = objIter->findKeyword("Name"); - QString tempName = tempKeyword[0]; + QString tempName = QString::fromStdString(tempKeyword[0]); namelist.append(tempName); } } diff --git a/isis/src/rosetta/apps/rososiris2isis/main.cpp b/isis/src/rosetta/apps/rososiris2isis/main.cpp index 380a10da7f..4283648473 100644 --- a/isis/src/rosetta/apps/rososiris2isis/main.cpp +++ b/isis/src/rosetta/apps/rososiris2isis/main.cpp @@ -138,21 +138,21 @@ void IsisMain() { throw IException(e, IException::Io, msg, _FILEINFO_); } } - // bandBin += PvlKeyword("FilterId", toString(filterId)); + // bandBin += PvlKeyword("FilterId", std::to_string(filterId)); bbGrp.addKeyword(PvlKeyword("FilterOneName", filterNames[0])); - bbGrp.addKeyword(PvlKeyword("FilterOneCenter", toString(filterCenters[0]), "nanometers")); - bbGrp.addKeyword(PvlKeyword("FilterOneWidth", toString(filterWidths[0]), "nanometers")); + bbGrp.addKeyword(PvlKeyword("FilterOneCenter", std::to_string(filterCenters[0]), "nanometers")); + bbGrp.addKeyword(PvlKeyword("FilterOneWidth", std::to_string(filterWidths[0]), "nanometers")); bbGrp.addKeyword(PvlKeyword("FilterTwoName", filterNames[1])); - bbGrp.addKeyword(PvlKeyword("FilterTwoCenter", toString(filterCenters[1]), "nanometers")); - bbGrp.addKeyword(PvlKeyword("FilterTwoWidth", toString(filterWidths[1]), "nanometers")); + bbGrp.addKeyword(PvlKeyword("FilterTwoCenter", std::to_string(filterCenters[1]), "nanometers")); + bbGrp.addKeyword(PvlKeyword("FilterTwoWidth", std::to_string(filterWidths[1]), "nanometers")); outcube->putGroup(bbGrp); PvlGroup kerns("Kernels"); if (instId.compare("OSINAC", Qt::CaseInsensitive) == 0) { - kerns += PvlKeyword("NaifFrameCode", toString(-226111)); //should I add [-filtno] directly after the number? That's what Dawn did + kerns += PvlKeyword("NaifFrameCode", std::to_string(-226111)); //should I add [-filtno] directly after the number? That's what Dawn did } else if (instId.compare("OSIWAC", Qt::CaseInsensitive) == 0) { - kerns += PvlKeyword("NaifFrameCode", toString(-226112)); //should I add [-filtno] directly after the number? That's what Dawn did + kerns += PvlKeyword("NaifFrameCode", std::to_string(-226112)); //should I add [-filtno] directly after the number? That's what Dawn did } else { QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + diff --git a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp index 3694f706fd..bd415a9660 100644 --- a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp +++ b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp @@ -451,13 +451,13 @@ void IsisMain () // VIRTIS_H is also supported. PvlGroup kerns("Kernels"); if (channelid == "VIRTIS_M_IR") { - kerns += PvlKeyword("NaifFrameCode", toString(-226213)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-226213)); } else if (channelid == "VIRTIS_M_VIS") { - kerns += PvlKeyword("NaifFrameCode", toString(-226211)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-226211)); } else if (channelid == "VIRTIS_H") { - kerns += PvlKeyword("NaifFrameCode", toString(-226220)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-226220)); } else { QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + diff --git a/isis/src/socet/apps/socetframesettings/main.cpp b/isis/src/socet/apps/socetframesettings/main.cpp index e0e8b069b8..6e4454fb87 100644 --- a/isis/src/socet/apps/socetframesettings/main.cpp +++ b/isis/src/socet/apps/socetframesettings/main.cpp @@ -74,7 +74,7 @@ void IsisMain() { // Make sure the image contains the SPICE blobs/tables PvlGroup test = cube.label()->findGroup("Kernels", Pvl::Traverse); - QString instrumentPointing = (QString) test["InstrumentPointing"]; + QString instrumentPointing = QString::fromStdString(test["InstrumentPointing"]); if (instrumentPointing != "Table") { QString msg = QString("Input image [%1] does not contain needed SPICE blobs. Please run " "spiceinit on the image with attach=yes.").arg(from); @@ -93,14 +93,14 @@ void IsisMain() { // Get required keywords from instrument and band groups PvlGroup inst = cube.label()->findGroup("Instrument", Pvl::Traverse); - QString instrumentId = (QString) inst["InstrumentId"]; - QString spacecraftName = (QString) inst["SpacecraftName"]; + QString instrumentId = QString::fromStdString(inst["InstrumentId"]); + QString spacecraftName = QString::fromStdString(inst["SpacecraftName"]); // Compensate for noproj altering cube labels if (instrumentId == "IdealCamera") { PvlGroup orig = cube.label()->findGroup("OriginalInstrument", Pvl::Traverse); - instrumentId = (QString) orig["InstrumentId"]; - spacecraftName = (QString) orig["SpacecraftName"]; + instrumentId = QString::fromStdString(orig["InstrumentId"]); + spacecraftName = QString::fromStdString(orig["SpacecraftName"]); } // Get sensor position and orientation (opk) angles @@ -162,7 +162,7 @@ void IsisMain() { else if (spacecraftName == "Galileo Orbiter") { //Check if this image was aquired with the cover on or off iTime removeCoverDate("1994/04/01 00:00:00"); - iTime imageDate((QString) inst["StartTime"]); + iTime imageDate(QString::fromStdString(inst["StartTime"])); if (imageDate < removeCoverDate) { socetCamFile += "Galileo_SSI_Cover.cam"; @@ -174,7 +174,7 @@ void IsisMain() { else if (spacecraftName == "Cassini-Huygens") { // Get the image filter and replace "/" with "_" PvlGroup bandBin = cube.label()->findGroup("BandBin", Pvl::Traverse); - QString filter = (QString) bandBin["FilterName"]; + QString filter = QString::fromStdString(bandBin["FilterName"]); filter.replace("/", "_"); socetCamFile += "Cassini_ISSNA_"; @@ -387,15 +387,15 @@ void IsisMain() { PvlObject naifKeywordsObject = cube.label()->findObject("NaifKeywords"); if (instrumentId == "MDIS-NAC") { ikCode = "236820"; - swapObserverTarget = (QString) naifKeywordsObject["INS-236820_SWAP_OBSERVER_TARGET"]; - lightTimeCorrection = (QString) naifKeywordsObject["INS-236820_LIGHTTIME_CORRECTION"]; - ltSurfaceCorrect = (QString) naifKeywordsObject["INS-236820_LT_SURFACE_CORRECT"]; + swapObserverTarget = QString::fromStdString(naifKeywordsObject["INS-236820_SWAP_OBSERVER_TARGET"]); + lightTimeCorrection = QString::fromStdString(naifKeywordsObject["INS-236820_LIGHTTIME_CORRECTION"]); + ltSurfaceCorrect = QString::fromStdString(naifKeywordsObject["INS-236820_LT_SURFACE_CORRECT"]); } else { ikCode = "236800"; - swapObserverTarget = (QString) naifKeywordsObject["INS-236800_SWAP_OBSERVER_TARGET"]; - lightTimeCorrection = (QString) naifKeywordsObject["INS-236800_LIGHTTIME_CORRECTION"]; - ltSurfaceCorrect = (QString) naifKeywordsObject["INS-236800_LT_SURFACE_CORRECT"]; + swapObserverTarget = QString::fromStdString(naifKeywordsObject["INS-236800_SWAP_OBSERVER_TARGET"]); + lightTimeCorrection = QString::fromStdString(naifKeywordsObject["INS-236800_LIGHTTIME_CORRECTION"]); + ltSurfaceCorrect = QString::fromStdString(naifKeywordsObject["INS-236800_LT_SURFACE_CORRECT"]); } toStrm << "\nSENSOR_TYPE FrameOffAxis" << endl; diff --git a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp index 560fc0e16d..2ca9ce5508 100644 --- a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp +++ b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp @@ -73,7 +73,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // Make sure the image contains the InstrumentPointing (aka CK) blob/table PvlGroup test = input->label()->findGroup("Kernels", Pvl::Traverse); - QString InstrumentPointing = (QString) test["InstrumentPointing"]; + QString InstrumentPointing = QString::fromStdString(test["InstrumentPointing"]); if (InstrumentPointing != "Table") { QString msg = "Input image does not contain needed SPICE blobs...run spiceinit with attach=yes."; throw IException(IException::User, msg, _FILEINFO_); @@ -89,7 +89,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // Get required keywords from instrument and band groups PvlGroup inst =input->label()->findGroup("Instrument", Pvl::Traverse); - QString instrumentId = (QString) inst["InstrumentId"]; + QString instrumentId = QString::fromStdString(inst["InstrumentId"]); bool isMocNA = false; //TO DO: UNCOMMENT THIS LINES ONCE MOC IS WORKING IN SS @@ -117,7 +117,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { //TO DO: DELETE THIS LINE ONCE MOC IS WORKING IN SS if (instrumentId == "IdealCamera") { PvlGroup orig = input->label()->findGroup("OriginalInstrument", Pvl::Traverse); - QString origInstrumentId = (QString) orig["InstrumentId"]; + QString origInstrumentId = QString::fromStdString(orig["InstrumentId"]); if (origInstrumentId == "HIRISE") { isHiRise = true; } @@ -380,14 +380,14 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { QList< QList > ephemRates; PvlGroup kernels = input->label()->findGroup("Kernels", Pvl::Traverse); - QString InstrumentPosition = (QString) kernels["InstrumentPosition"]; + QString InstrumentPosition = QString::fromStdString(kernels["InstrumentPosition"]); int numEphem = 0; // number of ephemeris points double dtEphem = 0.0; // delta time of ephemeris points, seconds if (InstrumentPosition == "Table") { // Labels contain SPK blob // set up Ephem pts/rates number and spacing - Table tablePosition("InstrumentPosition", cubeHeader->fileName()); + Table tablePosition("InstrumentPosition", QString::fromStdString(cubeHeader->fileName())); numEphem = tablePosition.Records(); // increase the number of ephem nodes by 20%. This is somewhat random but @@ -549,7 +549,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // quarternions //set up quaternions number and spacing - Table tablePointing("InstrumentPointing", cubeHeader->fileName()); + Table tablePointing("InstrumentPointing", QString::fromStdString(cubeHeader->fileName())); //number of quaternions int numQuaternions = tablePointing.Records(); @@ -692,8 +692,8 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { Distance targetRadii[3]; if (input->label()->hasGroup("Mapping")) { PvlGroup &mappingGroup = input->label()->findGroup("Mapping"); - targetRadii[0].setMeters(toDouble(mappingGroup["EquatorialRadius"][0])); - targetRadii[2].setMeters(toDouble(mappingGroup["PolarRadius"][0])); + targetRadii[0].setMeters(std::stod(mappingGroup["EquatorialRadius"][0])); + targetRadii[2].setMeters(std::stod(mappingGroup["PolarRadius"][0])); } else { try { diff --git a/isis/src/system/apps/blobdump/main.cpp b/isis/src/system/apps/blobdump/main.cpp index 90a1657c62..b8e27c2ebb 100644 --- a/isis/src/system/apps/blobdump/main.cpp +++ b/isis/src/system/apps/blobdump/main.cpp @@ -37,7 +37,7 @@ void IsisMain() { FileName file = ui.GetCubeName("FROM"); QString blobname = ui.GetString("NAME"); QString blobtype = ui.GetString("TYPE"); - Blob blob(blobname, blobtype, file.expanded()); + Blob blob(blobname, blobtype.toStdString(), file.expanded()); FileName outfname = ui.GetFileName("TO"); blob.Write(outfname.expanded()); } @@ -49,7 +49,7 @@ void helperButtonGetBlobList() { UserInterface &ui = Application::GetUserInterface(); QString currentFile = ui.GetCubeName("FROM"); - const Pvl label(FileName(currentFile).expanded()); + const Pvl label(FileName(currentFile).expanded().toStdString()); // Check to see if the "FILE" parameter has changed since last press if(currentFile != previousFile) { @@ -81,8 +81,8 @@ void helperButtonGetBlobList() { label.object(pos).hasKeyword("Name") && label.object(pos).hasKeyword("StartByte") && label.object(pos).hasKeyword("Bytes")) { - name = label.object(pos)["Name"][0]; - type = label.object(pos).name(); + name = QString::fromStdString(label.object(pos)["Name"][0]); + type = QString::fromStdString(label.object(pos).name()); match = true; pos++; } diff --git a/isis/src/system/apps/csspckgen/main.cpp b/isis/src/system/apps/csspckgen/main.cpp index 695453d44e..9f8ddf26cb 100644 --- a/isis/src/system/apps/csspckgen/main.cpp +++ b/isis/src/system/apps/csspckgen/main.cpp @@ -31,19 +31,19 @@ void IsisMain() { } // Read PCK DB file into a PVL and search the PVL for the main object - Pvl db(inputName.expanded()); + Pvl db(inputName.expanded().toStdString()); PvlObject &main = db.findObject("TargetAttitudeShape"); // Add a timestamp for when this file was created PvlObject latestMain("TargetAttitudeShape"); - latestMain += PvlKeyword("RunTime", iTime::CurrentLocalTime()); + latestMain += PvlKeyword("RunTime", iTime::CurrentLocalTime().toStdString()); // Add our dependencies, only the Leapsecond Kernel PvlGroup dependencies("Dependencies"); FileName lskName("$base/kernels/lsk/naif????.tls"); lskName = lskName.highestVersion(); QString lskString = lskName.originalPath() + "/" + lskName.name(); - dependencies += PvlKeyword("LeapsecondKernel", lskString); + dependencies += PvlKeyword("LeapsecondKernel", lskString.toStdString()); latestMain += dependencies; for (int g = 0; g < main.groups(); g++) { @@ -59,7 +59,7 @@ void IsisMain() { for (int k = 0; k < group.keywords(); k++) { PvlKeyword &keyword = group[k]; if (keyword.isNamed("File")) { - FileName pckName(keyword[0]); + FileName pckName(QString::fromStdString(keyword[0])); if (pckName.isDateVersioned()) { pckName = pckName.highestVersion(); QString latestPck = pckName.originalPath() + "/" + pckName.name(); @@ -67,7 +67,7 @@ void IsisMain() { // Replace the date-versioned filename with the direct path to the // latest PCK PvlKeyword &latestKeyword = latestGroup[k]; - latestKeyword[0] = latestPck; + latestKeyword[0] = latestPck.toStdString(); hasDateVersioning = true; } @@ -83,7 +83,7 @@ void IsisMain() { // Add comment specifying that this PCK is hardcoded for legacy support QString comment = "This PCK is hardcoded to support versions of " "Isis prior to v3.3.2"; - latestGroup.addComment(comment); + latestGroup.addComment(comment.toStdString()); // Add the direct path to the DB file to support older versions of Isis // that do not support date-versioned filenames @@ -106,5 +106,5 @@ void IsisMain() { // Write the updated PVL as the new PCK DB file Pvl latestDb; latestDb.addObject(latestMain); - latestDb.write(outputName.expanded()); + latestDb.write(outputName.expanded().toStdString()); } diff --git a/isis/src/system/apps/dempack/main.cpp b/isis/src/system/apps/dempack/main.cpp index e299d3a969..2aa4f5eb87 100644 --- a/isis/src/system/apps/dempack/main.cpp +++ b/isis/src/system/apps/dempack/main.cpp @@ -42,7 +42,7 @@ void IsisMain() { dbFileName = FileName(demFile).highestVersion(); } - Pvl dems(dbFileName.expanded()); + Pvl dems(dbFileName.expanded().toStdString()); PvlObject &demObject = dems.findObject("Dem"); QMap< QString, QList > demMap; @@ -55,14 +55,14 @@ void IsisMain() { // The third element in the Match keyword describes the DEM target (e.g. // Mars) - QString target = match[2]; + QString target = QString::fromStdString(match[2]); // The first element of the File keyword gives the "mission" associated // with the keyword (currently, always "base"). The second element gives // the path from "base" to the actual DEM cube. - QString mission = file[0]; - QString area = "$" + file[0]; - QString pattern = file[1]; + QString mission = QString::fromStdString(file[0]); + QString area = "$" + QString::fromStdString(file[0]); + QString pattern = QString::fromStdString(file[1]); // Some DEMs are hardcoded, but others are versioned. FileName demFileName(area + "/" + pattern); @@ -75,8 +75,8 @@ void IsisMain() { // If the mission name maps to a data area in the Isis Preferences file, // then replace the variable $MISSION with the path to that area - if (dataDir.hasKeyword(mission)) { - area = (QString) dataDir[mission]; + if (dataDir.hasKeyword(mission.toStdString())) { + area = QString::fromStdString(dataDir[mission.toStdString()]); } } diff --git a/isis/src/system/apps/isisdataeval/IsisDataModel.cpp b/isis/src/system/apps/isisdataeval/IsisDataModel.cpp index 42297b09be..18945dae14 100644 --- a/isis/src/system/apps/isisdataeval/IsisDataModel.cpp +++ b/isis/src/system/apps/isisdataeval/IsisDataModel.cpp @@ -173,17 +173,17 @@ namespace Isis { bool isGoodToGo( doVersioning ); try { if ( key.size() == 2 ) { - dbfile = fname = "$" + key[0] + "/" + key[1]; // In case the translation fails... - dbfile = prefdata[key[0]][0] + "/" + key[1]; + dbfile = fname = "$" + QString::fromStdString(key[0]) + "/" + QString::fromStdString(key[1]); // In case the translation fails... + dbfile = QString::fromStdString(prefdata[key[0]][0]) + "/" + QString::fromStdString(key[1]); } else if ( key.size() == 1 ) { - dbfile = fname = key[0]; + dbfile = fname = QString::fromStdString(key[0]); } else { // Ill-formed string, prepare a return string QString bad; for ( int v = 0 ; v < key.size() ; v++) { - bad += "[" + key[v] + "]"; + bad += "[" + QString::fromStdString(key[v]) + "]"; } // If its an empty PvlKeyword... @@ -393,13 +393,13 @@ namespace Isis { else if ( key.isNamed("Time") ) { if ( dbselection.hasTime() == false ) { // Set first time coverage - s_starttime = iTime( key[0] ); - s_stoptime = iTime( key[1] ); + s_starttime = iTime(QString::fromStdString(key[0])); + s_stoptime = iTime(QString::fromStdString(key[1])); } else { // Test limits of current span - iTime start_time_t( key[0] ); - iTime stop_time_t( key[1] ); + iTime start_time_t(QString::fromStdString(key[0])); + iTime stop_time_t(QString::fromStdString(key[1])); if ( start_time_t < s_starttime ) s_starttime = start_time_t; if ( stop_time_t > s_stoptime ) s_stoptime = stop_time_t; @@ -410,11 +410,11 @@ namespace Isis { } else if ( key.isNamed( "Match") ) { // Add a match keyword - dbselection.addMatch( DBMatch( key[0], key[1], key[2] ) ); + dbselection.addMatch( DBMatch(QString::fromStdString(key[0]),QString::fromStdString(key[1]),QString::fromStdString(key[2]))); } else if ( key.isNamed( "Type" ) ) { // Update the type which will be "Reconstructed", "Smithed", etc... - dbselection.setType( key[0] ); + dbselection.setType(QString::fromStdString(key[0])); } } @@ -515,7 +515,7 @@ namespace Isis { } // Got a kerneldb file - Pvl db( dbfile.expanded() ); + Pvl db( dbfile.expanded().toStdString() ); // Check if there are any specs in the file if ( db.objects() < 1 ) { @@ -523,11 +523,11 @@ namespace Isis { } PvlObject &inst = db.object(0); // Get first object of .db or .conf - DBKernelDb dbkernel( dbfile, inst.name() ); + DBKernelDb dbkernel( dbfile, QString::fromStdString(inst.name()) ); // Check for a Runtime keyword if ( inst.hasKeyword("Runtime") ) { - dbkernel.setRuntime( iTime( inst["Runtime"][0] ) ); + dbkernel.setRuntime(iTime(QString::fromStdString(inst["Runtime"][0]))); } // Set up the data dir translation for the files diff --git a/isis/src/system/apps/isisdataeval/isisdataeval.cpp b/isis/src/system/apps/isisdataeval/isisdataeval.cpp index 4503fa3c92..44175c5901 100644 --- a/isis/src/system/apps/isisdataeval/isisdataeval.cpp +++ b/isis/src/system/apps/isisdataeval/isisdataeval.cpp @@ -107,7 +107,7 @@ namespace Isis { // Load any preferences file if requested. Note this is the same as adding // adding a "-pref=PREFERENCES" except this logs the preferences file used. if ( ui.WasEntered( "PREFERENCES" ) ) { - Preference::Preferences().Load( ui.GetAsString( "PREFERENCES" ) ); + Preference::Preferences().Load( ui.GetAsString( "PREFERENCES" ).toStdString() ); } // Get a reference to the DataDirectory group for translations @@ -137,7 +137,7 @@ namespace Isis { // Now reset ISISDATA if requested by user if ( ui.WasEntered( "ISISDATA" ) ) { isisdata = ui.GetAsString("ISISDATA"); - PvlKeyword iroot( "ISISDATA", isisdata.expanded() ); + PvlKeyword iroot( "ISISDATA", isisdata.expanded().toStdString() ); prefdir.addKeyword( iroot, PvlContainer::Replace ); std::cout << "ISISDATA = " << isisdata.expanded() << std::endl; std::cout << "ISISDATA reset by user!" << std::endl; @@ -180,19 +180,19 @@ namespace Isis { // Generate the result log std::cout << std::endl; PvlGroup results("Results"); - results.addKeyword( PvlKeyword( "ISISDATA", isisdata.expanded() ) ); - results.addKeyword( PvlKeyword( "DATADIR", datadir ) ); - results.addKeyword( PvlKeyword( "EmptyKernelDBs", toString( inventory_counts.m_empty ) ) ); - results.addKeyword( PvlKeyword( "MissingKernelDBs", toString( inventory_counts.m_missing ) ) ); - results.addKeyword( PvlKeyword( "SymlinkKernelFiles", toString( inventory_counts.m_symlinks ) ) ); - results.addKeyword( PvlKeyword( "ExternalKernelFiles", toString( inventory_counts.m_externals ) ) ); - results.addKeyword( PvlKeyword( "ErrorKernelFiles", toString( inventory_counts.m_errors ) ) ); - results.addKeyword( PvlKeyword( "TotalDBConfigFiles", toString( t_configs ), "conf" ) ); - results.addKeyword( PvlKeyword( "TotalKernelDBFiles", toString( t_kerneldbs ), "db" ) ); - results.addKeyword( PvlKeyword( "TotalDirectories", toString( t_dirs ) ) ); - results.addKeyword( PvlKeyword( "TotalDataFiles", toString( t_files ) ) ); - results.addKeyword( PvlKeyword( "TotalInstallSize", toString( t_install_size ), "bytes" ) ); - results.addKeyword( PvlKeyword( "TotalVolumeSize", toString( t_volume_size ), "GB" ) ); + results.addKeyword( PvlKeyword( "ISISDATA", isisdata.expanded().toStdString() ) ); + results.addKeyword( PvlKeyword( "DATADIR", datadir.toStdString() ) ); + results.addKeyword( PvlKeyword( "EmptyKernelDBs", std::to_string( inventory_counts.m_empty ) ) ); + results.addKeyword( PvlKeyword( "MissingKernelDBs", std::to_string( inventory_counts.m_missing ) ) ); + results.addKeyword( PvlKeyword( "SymlinkKernelFiles", std::to_string( inventory_counts.m_symlinks ) ) ); + results.addKeyword( PvlKeyword( "ExternalKernelFiles", std::to_string( inventory_counts.m_externals ) ) ); + results.addKeyword( PvlKeyword( "ErrorKernelFiles", std::to_string( inventory_counts.m_errors ) ) ); + results.addKeyword( PvlKeyword( "TotalDBConfigFiles", std::to_string( t_configs ), "conf" ) ); + results.addKeyword( PvlKeyword( "TotalKernelDBFiles", std::to_string( t_kerneldbs ), "db" ) ); + results.addKeyword( PvlKeyword( "TotalDirectories", std::to_string( t_dirs ) ) ); + results.addKeyword( PvlKeyword( "TotalDataFiles", std::to_string( t_files ) ) ); + results.addKeyword( PvlKeyword( "TotalInstallSize", std::to_string( t_install_size ), "bytes" ) ); + results.addKeyword( PvlKeyword( "TotalVolumeSize", std::to_string( t_volume_size ), "GB" ) ); // If users wants kernel issues reported, write it out here if ( ui.WasEntered( "TOISSUES" ) ) { @@ -390,18 +390,18 @@ namespace Isis { } // Report results - results.addKeyword( PvlKeyword( "MissingInInventory", toString( error_counts_t.m_missing ) ) ); - results.addKeyword( PvlKeyword( "SymlinkInInventory", toString( error_counts_t.m_symlinks ) ) ); - results.addKeyword( PvlKeyword( "ExternalToInventory", toString( error_counts_t.m_externals ) ) ); - results.addKeyword( PvlKeyword( "ErrorInInventory", toString( error_counts_t.m_errors ) ) ); + results.addKeyword( PvlKeyword( "MissingInInventory", std::to_string( error_counts_t.m_missing ) ) ); + results.addKeyword( PvlKeyword( "SymlinkInInventory", std::to_string( error_counts_t.m_symlinks ) ) ); + results.addKeyword( PvlKeyword( "ExternalToInventory", std::to_string( error_counts_t.m_externals ) ) ); + results.addKeyword( PvlKeyword( "ErrorInInventory", std::to_string( error_counts_t.m_errors ) ) ); if ( needHash ) { QByteArray v_hash_data = volume_hash.result(); QString volume_hash_str = QString::fromUtf8( v_hash_data.toHex() ); BigInt hbsize = HashBufferSizeBytes; - results.addKeyword( PvlKeyword( "HashBufferSize", toString(hbsize), "bytes" ) ); - results.addKeyword( PvlKeyword( "TotalVolumeHash", volume_hash_str, hashtype ) ); + results.addKeyword( PvlKeyword( "HashBufferSize", std::to_string(hbsize), "bytes" ) ); + results.addKeyword( PvlKeyword( "TotalVolumeHash", volume_hash_str.toStdString(), hashtype.toStdString() ) ); } // All done... diff --git a/isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp b/isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp index 3a8ca2071b..ea754c0499 100644 --- a/isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp +++ b/isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp @@ -77,7 +77,7 @@ PvlObject SpiceDbGen::Direct(QString quality, QString location, for (int fileNum = 0 ; fileNum < files.size() ; fileNum++) { FileName currFile((QString) location + "/" + files[fileNum]); PvlGroup selection = AddSelection(currFile, startOffset, endOffset); - selection += PvlKeyword("Type", quality); + selection += PvlKeyword("Type", quality.toStdString()); result.addGroup(selection); } } @@ -90,12 +90,12 @@ PvlObject SpiceDbGen::Direct(QString quality, QString location, if (grp->name() == "No coverage" || grp->name() == "Null") { result.deleteGroup(grp->name()); } - else if (grp->name() == p_type) { + else if (grp->name() == p_type.toStdString()) { grp->setName("Selection"); grp++; } else { - QString message = "A kernel of type [" + grp->name() + "] has been found in a directory for type [" + p_type + "]" ; + std::string message = "A kernel of type [" + grp->name() + "] has been found in a directory for type [" + p_type.toStdString() + "]" ; throw IException(IException::Programmer, message, _FILEINFO_); break; } @@ -144,7 +144,7 @@ PvlObject SpiceDbGen::Direct(QString quality, FileList fileList, for (int fileNum = 0 ; fileNum < fileList.size() ; fileNum++) { FileName currFile = fileList[fileNum]; PvlGroup selection = AddSelection(currFile, startOffset, endOffset); - selection += PvlKeyword("Type", quality); + selection += PvlKeyword("Type", quality.toStdString()); result.addGroup(selection); } @@ -156,12 +156,12 @@ PvlObject SpiceDbGen::Direct(QString quality, FileList fileList, if (grp->name() == "No coverage" || grp->name() == "Null") { result.deleteGroup(grp->name()); } - else if (grp->name() == p_type) { + else if (grp->name() == p_type.toStdString()) { grp->setName("Selection"); grp++; } else { - QString message = "A kernel of type [" + grp->name() + "] has been found in a directory for type [" + p_type + "]" ; + std::string message = "A kernel of type [" + grp->name() + "] has been found in a directory for type [" + p_type.toStdString() + "]" ; throw IException(IException::Programmer, message, _FILEINFO_); break; } @@ -331,17 +331,17 @@ PvlGroup SpiceDbGen::AddSelection(FileName fileIn, double startOffset, double en // add instrument and timing offsets only if timing offsets found in comments if (!startoffset.isEmpty() || !endoffset.isEmpty()) { - result += PvlKeyword("Instrument", instrument); + result += PvlKeyword("Instrument", instrument.toStdString()); if(!startoffset.isEmpty()){ - result += PvlKeyword("StartOffset", startoffset); + result += PvlKeyword("StartOffset", startoffset.toStdString()); } if(!endoffset.isEmpty()){ - result += PvlKeyword("EndOffset", endoffset); + result += PvlKeyword("EndOffset", endoffset.toStdString()); } } QString outFile = fileIn.originalPath(); - result += PvlKeyword("File", outFile + "/" + fileIn.name()); + result += PvlKeyword("File", outFile.toStdString() + "/" + fileIn.name().toStdString()); NaifStatus::CheckErrors(); @@ -356,7 +356,7 @@ PvlGroup SpiceDbGen::FormatIntervals(SpiceCell &coverage, QString type, double startOffset, double endOffset) { NaifStatus::CheckErrors(); - PvlGroup result(type); + PvlGroup result(type.toStdString()); SpiceChar begStr[35], endStr[35]; //Get the number of intervals in the object. int niv = card_c(&coverage) / 2; @@ -371,8 +371,8 @@ PvlGroup SpiceDbGen::FormatIntervals(SpiceCell &coverage, QString type, timout_c(begin, calForm, 35, begStr); timout_c(end, calForm, 35, endStr); - result += PvlKeyword("Time", "(\"" + (QString)begStr + - "\", \"" + (QString)endStr + "\")"); + result += PvlKeyword("Time", "(\"" + (std::string)begStr + + "\", \"" + (std::string)endStr + "\")"); } NaifStatus::CheckErrors(); diff --git a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp index bd36ace03d..2251a1b72c 100644 --- a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp +++ b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp @@ -43,7 +43,7 @@ namespace Isis { else if (ui.GetString("TYPE") == "SPK") { kernelType = "SpacecraftPosition"; } - PvlObject selections(kernelType); + PvlObject selections(kernelType.toStdString()); // Specify whether to use SPICE segments (made up of SPICE intervals) // or SPICE intervals for the SPICE database. Naif referes to this as "coverage level" @@ -56,7 +56,7 @@ namespace Isis { } sdg.setCoverageLevel(coverageLevel); - selections += PvlKeyword("RunTime", iTime::CurrentLocalTime()); + selections += PvlKeyword("RunTime", iTime::CurrentLocalTime().toStdString()); selections.addGroup(dependency); /* Removed because Nadir is not done using this*/ @@ -168,7 +168,7 @@ namespace Isis { Pvl writer; writer.addObject(selections); - writer.write(to.expanded()); + writer.write(to.expanded().toStdString()); } @@ -213,7 +213,7 @@ namespace Isis { // Try to get kernel file names out of db, if a db was specified instead of an actual kernel if (kernelFileName.extension() == "db") { - Pvl kernelDbPvl(kernelFileName.expanded()); + Pvl kernelDbPvl(kernelFileName.expanded().toStdString()); if (kernelDbPvl.objects() == 1) { PvlObject &primaryObject = kernelDbPvl.object(0); @@ -221,14 +221,14 @@ namespace Isis { if (primaryObject.groups() == 1) { PvlGroup &primaryGroup = primaryObject.group(0); - if (primaryGroup.name().toLower() == "selection") { + if (QString::fromStdString(primaryGroup.name()).toLower() == "selection") { if (primaryGroup.keywords() == 1) { PvlKeyword &key = primaryGroup[0]; if (key.isNamed("File")) { if (key.size() == 2) { - kernelFileName = safeHighestVersion(QString("$%1/%2").arg(key[0]).arg(key[1])); + kernelFileName = safeHighestVersion(QString("$%1/%2").arg(QString::fromStdString(key[0])).arg(QString::fromStdString(key[1]))); } else { throw IException(IException::Unknown, @@ -241,41 +241,28 @@ namespace Isis { } else { throw IException(IException::Unknown, - QObject::tr("Expected Pvl Group [%1] in the first Pvl Object " - "[%2] in the DB file [%3] to have a single keyword " - "named File, but the keyword was named [%4] " - "instead") - .arg(primaryGroup.name()).arg(primaryObject.name()) - .arg(kernelFileName.original()).arg(key.name()), + "Expected Pvl Group " + primaryGroup.name() + " in the first Pvl Object " + " " + primaryObject.name() + " in the DB file " + kernelFileName.original().toStdString() + " to have a single keyword " + "named File, but the keyword was named " + key.name() + "instead", _FILEINFO_); } } else { - throw IException(IException::Unknown, - QObject::tr("Expected Pvl Group [%1] in the first Pvl Object [%2] " - "in the DB file [%3] to have a single keyword (named " - "File), but found [%4] keywords") - .arg(primaryGroup.name()).arg(primaryObject.name()) - .arg(kernelFileName.original()).arg(primaryGroup.keywords()), + throw IException(IException::Unknown, "Expected Pvl Group " + primaryGroup.name() + " in the first Pvl Object " + primaryObject.name() + " " + "in the DB file " + kernelFileName.original().toStdString() + " to have a single keyword (named " + "File), but found " + std::to_string(primaryGroup.keywords()) + " keywords", _FILEINFO_); } } else { - throw IException(IException::Unknown, - QObject::tr("Expected Pvl Group in the first Pvl Object [%1] in " - "the DB file [%2] to be named Selection but found [%3]") - .arg(primaryObject.name()).arg(kernelFileName.original()) - .arg(primaryGroup.name()), + throw IException(IException::Unknown, "Expected Pvl Group in the first Pvl Object " + primaryObject.name() + " in " + "the DB file " + kernelFileName.original().toStdString() + " to be named Selection but found " + primaryGroup.name(), _FILEINFO_); } } else { - throw IException(IException::Unknown, - QObject::tr("Expected one Pvl Group in the first Pvl Object [%1] in " - "the DB file [%2] but found [%3]") - .arg(primaryObject.name()).arg(kernelFileName.original()) - .arg(primaryObject.groups()), - _FILEINFO_); + throw IException(IException::Unknown,"Expected one Pvl Group in the first Pvl Object " + primaryObject.name() + " in " + "the DB file " + kernelFileName.original().toStdString() + " but found " + std::to_string(primaryObject.groups()), _FILEINFO_); } } else { @@ -288,7 +275,7 @@ namespace Isis { } results.append(kernelFileName); - dependencyGroup += PvlKeyword(kernelTypeName, kernelFileName.original()); + dependencyGroup += PvlKeyword(kernelTypeName.toStdString(), (kernelFileName.original().toStdString())); } } diff --git a/isis/src/system/apps/messckgen/main.cpp b/isis/src/system/apps/messckgen/main.cpp index d18148a582..175c7db821 100644 --- a/isis/src/system/apps/messckgen/main.cpp +++ b/isis/src/system/apps/messckgen/main.cpp @@ -62,7 +62,7 @@ void IsisMain() { QString pivotString("$messenger/kernels/ck/pivot_kernels.????.db"); pivotFileName = FileName(pivotString).highestVersion(); } - Pvl pivot(pivotFileName.expanded()); + Pvl pivot(pivotFileName.expanded().toStdString()); // Fetch the atthist file FileName atthistFileName; @@ -74,7 +74,7 @@ void IsisMain() { QString atthistString("$messenger/kernels/ck/atthist_kernels.????.db"); atthistFileName = FileName(atthistString).highestVersion(); } - Pvl atthist(atthistFileName.expanded()); + Pvl atthist(atthistFileName.expanded().toStdString()); // Open the input file from the GUI or find the latest version of the DB file FileName dbFileName; @@ -85,7 +85,7 @@ void IsisMain() { QString dbString("$messenger/kernels/ck/kernels.????.db"); dbFileName = FileName(dbString).highestVersion(); } - Pvl kernelDb(dbFileName.expanded()); + Pvl kernelDb(dbFileName.expanded().toStdString()); PvlObject &pointing = kernelDb.findObject("SpacecraftPointing"); PvlObject &pivotPointing = pivot.findObject("SpacecraftPointing"); @@ -118,7 +118,7 @@ void IsisMain() { // We're looking for the group with a comment that says MAPPING, // signifying the beginning of the section we wish to update for (int j = 0; j < ckGroup.comments(); j++) { - QString comment = ckGroup.comment(j); + QString comment = QString::fromStdString(ckGroup.comment(j)); if (comment.contains("MAPPING")) { foundMapping = true; updatePointing(ckGroup, pivotPointing, atthistPointing); @@ -132,7 +132,7 @@ void IsisMain() { for (int k = pivotSelection.keywords() - 1; k >= 0; k--) { PvlKeyword &keyword = pivotSelection[k]; if (keyword.isNamed("Time")) { - pivotEndRaw = keyword[1]; + pivotEndRaw = QString::fromStdString(keyword[1]); break; } } @@ -143,7 +143,7 @@ void IsisMain() { QString pivotEnd = pivotEndRaw; PvlKeyword &time = ckGroup.findKeyword("Time"); - QString currentStartRaw = time[0]; + QString currentStartRaw = QString::fromStdString(time[0]); currentStartRaw.remove(QRegExp(" TDB$")); QString currentStart = currentStartRaw; @@ -154,7 +154,7 @@ void IsisMain() { // See if a week has passed from the start time to the pivot end time iTime pivotEndTime(pivotEnd); - time[1] = newEnd; + time[1] = newEnd.toStdString(); PvlGroup *currentGroup = &ckGroup; @@ -189,8 +189,8 @@ void IsisMain() { // If the current day's file isn't already present in the group, // then go ahead and add it - if ((*itr)[0] != bcFileName) { - PvlKeyword bcKeyword("File", bcFileName); + if ((*itr)[0] != bcFileName.toStdString()) { + PvlKeyword bcKeyword("File", bcFileName.toStdString()); itr = currentGroup->addKeyword(bcKeyword, itr); } itr++; @@ -213,10 +213,10 @@ void IsisMain() { weekFromStart += 7 * 24 * 3600; PvlKeyword ¤tTime = currentGroup->findKeyword("Time"); - currentTime[1] = newEndTime; + currentTime[1] = newEndTime.toStdString(); PvlKeyword latestTime(currentTime); - latestTime[0] = newEndTime; - latestTime[1] = newEnd; + latestTime[0] = newEndTime.toStdString(); + latestTime[1] = newEnd.toStdString(); PvlGroup *latestGroup = new PvlGroup("Selection"); latestGroup->addKeyword(latestTime); @@ -252,7 +252,7 @@ void IsisMain() { } // Write the updated PVL as the new CK DB file - kernelDb.write(outDBfile.expanded()); + kernelDb.write(outDBfile.expanded().toStdString()); } @@ -300,7 +300,7 @@ PvlGroup* insertGroup(PvlObject &object, PvlGroup &group, int index) { PvlGroup ¤tGroup = object.group(i); bool foundMapping = false; for (int j = 0; j < currentGroup.comments(); j++) { - QString comment = currentGroup.comment(j); + QString comment = QString::fromStdString(currentGroup.comment(j)); mappingComments.append(comment); if (comment.contains("MAPPING")) @@ -326,7 +326,7 @@ PvlGroup* insertGroup(PvlObject &object, PvlGroup &group, int index) { // Add all the mapping comments PvlGroup ¤tGroup = object.group(index); for (int i = 0; i < mappingComments.size(); i++) - currentGroup.addComment(mappingComments[i]); + currentGroup.addComment(mappingComments[i].toStdString()); // Return the location of the new group return ¤tGroup; diff --git a/isis/src/system/apps/messspkgen/main.cpp b/isis/src/system/apps/messspkgen/main.cpp index 38ee973838..7ec1cf5f51 100644 --- a/isis/src/system/apps/messspkgen/main.cpp +++ b/isis/src/system/apps/messspkgen/main.cpp @@ -39,7 +39,7 @@ void IsisMain() { QString dbString("$messenger/kernels/spk/kernels.????.db"); dbFileName = FileName(dbString).highestVersion(); } - Pvl kernelDb(dbFileName.expanded()); + Pvl kernelDb(dbFileName.expanded().toStdString()); // Get our main objects PvlObject &position = kernelDb.findObject("SpacecraftPosition"); @@ -48,8 +48,8 @@ void IsisMain() { // cutoff PvlGroup &reconstructed = position.findGroup("Selection"); PvlKeyword &time = reconstructed[reconstructed.keywords() - 3]; - QString reconstructedEnd = time[1]; - time[1] = convertUtcToTdb(ui.GetString("TIME")); + QString reconstructedEnd = QString::fromStdString(time[1]); + time[1] = convertUtcToTdb(ui.GetString("TIME")).toStdString(); // Get the predicted group from the previous file, set the start time to the // orbit cutoff and the end to whatever the reconstructed end was before @@ -57,7 +57,7 @@ void IsisMain() { PvlKeyword predictedTime("Time"); predictedTime += time[1]; - predictedTime += reconstructedEnd; + predictedTime += reconstructedEnd.toStdString(); predicted.addKeyword(predictedTime); PvlKeyword predictedFile("File"); @@ -80,7 +80,7 @@ void IsisMain() { } // Write the updated PVL as the new SPK DB file - kernelDb.write(outDBfile.expanded()); + kernelDb.write(outDBfile.expanded().toStdString()); } diff --git a/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.cpp b/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.cpp index e2a7836c2f..2a0faa1d14 100644 --- a/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.cpp +++ b/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.cpp @@ -146,7 +146,7 @@ void ProgramAnalyzer::include(const QString &name) { * @param logfile An ISIS print.prt file */ void ProgramAnalyzer::add(const QString &logfile) { - Pvl plog(logfile); + Pvl plog(logfile.toStdString()); for(int i = 0; i < plog.objects(); i++) { add(plog.object(i)); } @@ -164,7 +164,7 @@ void ProgramAnalyzer::add(const QString &logfile) { */ void ProgramAnalyzer::add(PvlObject &program) { _count++; - QString prog(program.name()); + QString prog(QString::fromStdString(program.name())); if ( _excludes.exists(prog) ) { _excludes.get(prog)++; return; @@ -200,18 +200,18 @@ void ProgramAnalyzer::add(PvlObject &program) { * @return PvlGroup Pvl group containing program numbers/counts */ PvlGroup ProgramAnalyzer::review(const QString &name) const { - PvlGroup pvl(name); - - pvl += PvlKeyword("Programs", toString(size())); - pvl += PvlKeyword("Unique", toString(Programs())); - pvl += PvlKeyword("Included", toString(LimitTotals(_includes))); - pvl += PvlKeyword("Excluded", toString(LimitTotals(_excludes))); - pvl += PvlKeyword("Valid", toString(valid())); - pvl += PvlKeyword("Errors", toString(errors())); - pvl += PvlKeyword("ZeroTime", toString(zerotime())); - pvl += PvlKeyword("NoData", toString(nodata())); - pvl += PvlKeyword("BadData", toString(baddata())); - pvl += PvlKeyword("Total", toString(count())); + PvlGroup pvl(name.toStdString()); + + pvl += PvlKeyword("Programs", std::to_string(size())); + pvl += PvlKeyword("Unique", std::to_string(Programs())); + pvl += PvlKeyword("Included", std::to_string(LimitTotals(_includes))); + pvl += PvlKeyword("Excluded", std::to_string(LimitTotals(_excludes))); + pvl += PvlKeyword("Valid", std::to_string(valid())); + pvl += PvlKeyword("Errors", std::to_string(errors())); + pvl += PvlKeyword("ZeroTime", std::to_string(zerotime())); + pvl += PvlKeyword("NoData", std::to_string(nodata())); + pvl += PvlKeyword("BadData", std::to_string(baddata())); + pvl += PvlKeyword("Total", std::to_string(count())); return (pvl); } @@ -361,7 +361,7 @@ QString ProgramAnalyzer::getKey(PvlObject &obj, const QString &key, QString value(""); if ( !grp.isEmpty() ) { - PvlGroup &g = obj.findGroup(grp); + PvlGroup &g = obj.findGroup(grp.toStdString()); value = findKey(g, key); } else { @@ -488,23 +488,23 @@ bool ProgramAnalyzer::analyze(const ProgramAnalyzer::ProgramData &data) { */ PvlGroup ProgramAnalyzer::toPvl(const RunTimeStats &stats, const QString &name) const { - PvlGroup pvl((name.isEmpty() ? stats.pname : name)); - - pvl += PvlKeyword("Hits", toString(stats.contime.TotalPixels())); - pvl += PvlKeyword("ConnectTimeMinimum", DblToStr(stats.contime.Minimum(), 2)); - pvl += PvlKeyword("ConnectTimeMaximum", DblToStr(stats.contime.Maximum(), 2)); - pvl += PvlKeyword("ConnectTimeAverage", DblToStr(stats.contime.Average(), 2)); - pvl += PvlKeyword("ConnectTimeStdDev", DblToStr(stats.contime.StandardDeviation(), 4)); - - pvl += PvlKeyword("CpuTimeMinimum", DblToStr(stats.cputime.Minimum(), 2)); - pvl += PvlKeyword("CpuTimeMaximum", DblToStr(stats.cputime.Maximum(), 2)); - pvl += PvlKeyword("CpuTimeAverage", DblToStr(stats.cputime.Average(), 2)); - pvl += PvlKeyword("CpuTimeStdDev", DblToStr(stats.cputime.StandardDeviation(), 4)); - - pvl += PvlKeyword("IOTimeMinimum", DblToStr(stats.iotime.Minimum(), 2)); - pvl += PvlKeyword("IOTimeMaximum", DblToStr(stats.iotime.Maximum(), 2)); - pvl += PvlKeyword("IOTimeAverage", DblToStr(stats.iotime.Average(), 2)); - pvl += PvlKeyword("IOTimeStdDev", DblToStr(stats.iotime.StandardDeviation(), 4)); + PvlGroup pvl((name.isEmpty() ? stats.pname.toStdString() : name.toStdString())); + + pvl += PvlKeyword("Hits", std::to_string(stats.contime.TotalPixels())); + pvl += PvlKeyword("ConnectTimeMinimum", DblToStr(stats.contime.Minimum(), 2).toStdString()); + pvl += PvlKeyword("ConnectTimeMaximum", DblToStr(stats.contime.Maximum(), 2).toStdString()); + pvl += PvlKeyword("ConnectTimeAverage", DblToStr(stats.contime.Average(), 2).toStdString()); + pvl += PvlKeyword("ConnectTimeStdDev", DblToStr(stats.contime.StandardDeviation(), 4).toStdString()); + + pvl += PvlKeyword("CpuTimeMinimum", DblToStr(stats.cputime.Minimum(), 2).toStdString()); + pvl += PvlKeyword("CpuTimeMaximum", DblToStr(stats.cputime.Maximum(), 2).toStdString()); + pvl += PvlKeyword("CpuTimeAverage", DblToStr(stats.cputime.Average(), 2).toStdString()); + pvl += PvlKeyword("CpuTimeStdDev", DblToStr(stats.cputime.StandardDeviation(), 4).toStdString()); + + pvl += PvlKeyword("IOTimeMinimum", DblToStr(stats.iotime.Minimum(), 2).toStdString()); + pvl += PvlKeyword("IOTimeMaximum", DblToStr(stats.iotime.Maximum(), 2).toStdString()); + pvl += PvlKeyword("IOTimeAverage", DblToStr(stats.iotime.Average(), 2).toStdString()); + pvl += PvlKeyword("IOTimeStdDev", DblToStr(stats.iotime.StandardDeviation(), 4).toStdString()); return (pvl); } diff --git a/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.h b/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.h index 827577054f..6b48760e72 100644 --- a/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.h +++ b/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.h @@ -130,8 +130,8 @@ namespace Isis { /** Find a string in a PvlContainer */ QString findKey(PvlContainer &kset, const QString &key) const { QString value(""); - if ( kset.hasKeyword(key) ) { - value = kset[key][0]; + if ( kset.hasKeyword(key.toStdString()) ) { + value = QString::fromStdString(kset[key.toStdString()][0]); } return (value); } diff --git a/isis/src/system/apps/prtloganalyzer/main.cpp b/isis/src/system/apps/prtloganalyzer/main.cpp index 92615580f0..0528f4e574 100644 --- a/isis/src/system/apps/prtloganalyzer/main.cpp +++ b/isis/src/system/apps/prtloganalyzer/main.cpp @@ -65,7 +65,7 @@ void IsisMain() { for (int i = 0 ; i < analyzer.Programs() ; i++) { temp.addGroup(analyzer.summarize(i)); } - temp.write(ui.GetFileName("SUMMARY")); + temp.write(ui.GetFileName("SUMMARY").toStdString()); } // Write the output file if requested of CSV formatted data diff --git a/isis/src/system/objs/KernelDb/KernelDb.cpp b/isis/src/system/objs/KernelDb/KernelDb.cpp index 6e50743860..6c1065c7b9 100644 --- a/isis/src/system/objs/KernelDb/KernelDb.cpp +++ b/isis/src/system/objs/KernelDb/KernelDb.cpp @@ -74,7 +74,7 @@ namespace Isis { * @see KernelDb(int) */ KernelDb::KernelDb(const QString &dbName, const unsigned int allowedKernelTypes) : - m_kernelData(dbName) { + m_kernelData(dbName.toStdString()) { m_filename = dbName; m_allowedKernelTypes = allowedKernelTypes; m_kernelDbFiles.clear(); @@ -376,7 +376,7 @@ namespace Isis { } // Make sure the entry has been loaded into memory - if (!m_kernelData.hasObject(entry)) { + if (!m_kernelData.hasObject(entry.toStdString())) { priority_queue emptyKernelQueue; emptyKernelQueue.push(Kernel()); queues.push_back(emptyKernelQueue); @@ -388,19 +388,19 @@ namespace Isis { iTime end; if (cube.hasGroup("Instrument")) { - start = (QString) cube.findGroup("Instrument")["StartTime"]; + start = QString::fromStdString(cube.findGroup("Instrument")["StartTime"]); if (cube.findGroup("Instrument").hasKeyword("StopTime")) { - end = ((QString) cube.findGroup("Instrument")["StopTime"]); + end = QString::fromStdString(cube.findGroup("Instrument")["StopTime"]); } else { - end = ((QString) cube.findGroup("Instrument")["StartTime"]); + end = QString::fromStdString(cube.findGroup("Instrument")["StartTime"]); } } // Loop through the objects to look for all matches to the entry value for (int i = 0; i < m_kernelData.objects(); i++) { - if (m_kernelData.object(i).isNamed(entry)) { + if (m_kernelData.object(i).isNamed(entry.toStdString())) { priority_queue filesFound; PvlObject &obj = m_kernelData.object(i); @@ -416,7 +416,7 @@ namespace Isis { // Make sure the type is allowed if (grp.hasKeyword("Type")) { - type = (QString) grp["Type"]; + type = QString::fromStdString(grp["Type"]); if (!(Kernel::typeEnum(type) & m_allowedKernelTypes)) { // will return 1 for each bit that has 1 in both type and allowed and // return 0 for all other bits @@ -475,8 +475,8 @@ namespace Isis { if (!key.isNamed("Time")) continue; - iTime timeRangeStart((QString)key[0]); - iTime timeRangeEnd((QString)key[1]); + iTime timeRangeStart(QString::fromStdString(key[0])); + iTime timeRangeEnd(QString::fromStdString(key[1])); bool thisEndMatches = matches(lab, endTimeGrp, timeRangeEnd, cameraVersion); @@ -592,7 +592,7 @@ namespace Isis { endOffset = (double) grp["EndOffset"] + 0.001; } if (grp.hasKeyword("Instrument")){ - instrument = (QString) grp["Instrument"]; + instrument = QString::fromStdString(grp["Instrument"]); } // First, the time search. Loop through the keywords, if the name isn't @@ -604,8 +604,8 @@ namespace Isis { if (key.isNamed("Time")) { // Pull the selections start and end time out - iTime kernelStart = (QString) key[0]; - iTime kernelEnd = (QString) key[1]; + iTime kernelStart = QString::fromStdString(key[0]); + iTime kernelEnd = QString::fromStdString(key[1]); // If the kernel times inside of the requested times we // set the matchTime to be true. @@ -616,7 +616,7 @@ namespace Isis { // the instrument id in the label then the timing is always invalid if (!instrument.isEmpty()) { const PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString instId = (QString) inst.findKeyword("InstrumentId"); + QString instId = QString::fromStdString(inst.findKeyword("InstrumentId")); if (instId.compare(instrument) != 0) { matchTime = false; } @@ -625,11 +625,11 @@ namespace Isis { else if (key.isNamed("Match")) { try { - QString matchGroup = key[0]; - QString matchKey = key[1]; - QString matchValue = key[2]; + QString matchGroup = QString::fromStdString(key[0]); + QString matchKey = QString::fromStdString(key[1]); + QString matchValue = QString::fromStdString(key[2]); - QString cubeValue = cube.findGroup(matchGroup)[matchKey]; + QString cubeValue = QString::fromStdString(cube.findGroup(matchGroup.toStdString())[matchKey.toStdString()]); cubeValue = cubeValue.simplified().trimmed().toUpper(); matchValue = matchValue.simplified().trimmed().toUpper(); @@ -732,10 +732,10 @@ namespace Isis { // Get the base DataDirectory PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - QString baseDir = dataDir["Base"]; + QString baseDir = QString::fromStdString(dataDir["Base"]); // Get the mission DataDirectory - QString missionDir = dataDir[mission]; + QString missionDir = QString::fromStdString(dataDir[mission.toStdString()]); // Load the leapsecond DB loadKernelDbFiles(dataDir, baseDir + "/kernels/lsk", lab); @@ -818,7 +818,7 @@ namespace Isis { m_kernelDbFiles.append(kernelDb.highestVersion()); } else { // else, read in the appropriate database files from the config file - PvlObject inst = Pvl(configFile.expanded()).findObject("Instrument"); + PvlObject inst = Pvl(configFile.expanded().toStdString()).findObject("Instrument"); bool foundMatch = false; // loop through each group until we find a match for (int groupIndex = 0; groupIndex < inst.groups(); groupIndex++) { @@ -832,8 +832,8 @@ namespace Isis { for (int keyIndex = 0; keyIndex < grp.keywords(); keyIndex++) { PvlKeyword keyword = grp[keyIndex]; if (keyword.isNamed("File")) { - QString dir = dataDir[keyword[0]]; - FileName kernelDb( dir + "/" + keyword[1]); + QString dir = QString::fromStdString(dataDir[keyword[0]]); + FileName kernelDb( dir + "/" + QString::fromStdString(keyword[1])); m_kernelDbFiles.append(kernelDb.highestVersion()); } } @@ -866,7 +866,7 @@ namespace Isis { // read each of the database files appended to the list into m_kernelData foreach (FileName kernelDbFile, m_kernelDbFiles) { try { - m_kernelData.read(kernelDbFile.expanded()); + m_kernelData.read(kernelDbFile.expanded().toStdString()); } catch (IException &e) { QString msg = "Unable to read kernel database file [" @@ -908,8 +908,8 @@ namespace Isis { // indicates an ISIS preference in the DataDirectory section // and a filename if (kfile.size() == 2) { - QString pref = kfile[0]; - QString version = kfile[1]; + QString pref = QString::fromStdString(kfile[0]); + QString version = QString::fromStdString(kfile[1]); FileName filename("$" + pref + "/" + version); if (filename.isVersioned()) filename = filename.highestVersion(); @@ -917,15 +917,15 @@ namespace Isis { } // One value in "File" indicates a full file spec else if (kfile.size() == 1) { - FileName filename(kfile[0]); + FileName filename(QString::fromStdString(kfile[0])); if (filename.isVersioned()) filename = filename.highestVersion(); files.push_back(filename.originalPath() + "/" + filename.name()); } else { - QString msg = "Invalid File keyword value in [Group = "; + std::string msg = "Invalid File keyword value in [Group = "; msg += grp.name() + "] in database file ["; - msg += m_filename + "]"; + msg += m_filename.toStdString() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp index 71a8de1c85..b2a8c9bf39 100644 --- a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp +++ b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp @@ -400,7 +400,7 @@ namespace Isis { PvlKeyword summingMode("SummingMode", sumMode); outputLabel->findGroup("Instrument", Pvl::Traverse).addKeyword(summingMode); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", std::to_string(stime.Year()*1000 + stime.DayOfYear())); archive.addKeyword(yeardoy); // Set units on optional archived keywords @@ -444,7 +444,7 @@ namespace Isis { int spacecraftCode = -143400; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", std::to_string(spacecraftCode)); if (filter.compare("PAN", Qt::CaseInsensitive) == 0) { spacecraftCode = -143421; @@ -466,7 +466,7 @@ namespace Isis { } // Add Kernel to BandBin Group - bandBin.addKeyword(PvlKeyword("NaifIkCode", toString(spacecraftCode))); + bandBin.addKeyword(PvlKeyword("NaifIkCode", std::to_string(spacecraftCode))); } else { QString msg = "Unrecognized Spacecraft name [" diff --git a/isis/src/viking/apps/vik2isis/main.cpp b/isis/src/viking/apps/vik2isis/main.cpp index eaa369ca11..2cce677b48 100644 --- a/isis/src/viking/apps/vik2isis/main.cpp +++ b/isis/src/viking/apps/vik2isis/main.cpp @@ -176,9 +176,9 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { filterCenter = 0.590000; filterWidth = 0.150000; } - bandBin += PvlKeyword("FilterId", toString(filterId)); - bandBin += PvlKeyword("Center", toString(filterCenter), "micrometers"); - bandBin += PvlKeyword("Width", toString(filterWidth), "micrometers"); + bandBin += PvlKeyword("FilterId", std::to_string(filterId)); + bandBin += PvlKeyword("Center", std::to_string(filterCenter), "micrometers"); + bandBin += PvlKeyword("Width", std::to_string(filterWidth), "micrometers"); ocube->putGroup(bandBin); // Setup the kernel group @@ -208,7 +208,7 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { // Set up the nominal reseaus group PvlGroup res("Reseaus"); - Pvl nomRes("$viking" + toString(spn) + "/reseaus/nominal.pvl"); + Pvl nomRes("$viking" + std::to_string(spn) + "/reseaus/nominal.pvl"); PvlKeyword samps, lines, type, valid; lines = PvlKeyword("Line"); samps = PvlKeyword("Sample"); diff --git a/isis/src/viking/apps/vikcal/vikcal.cpp b/isis/src/viking/apps/vikcal/vikcal.cpp index 96298bb8d9..7e83b8e525 100644 --- a/isis/src/viking/apps/vikcal/vikcal.cpp +++ b/isis/src/viking/apps/vikcal/vikcal.cpp @@ -77,24 +77,24 @@ namespace Isis { calgrp.addComment("DI(l,s) = (1.0/(exp*w1))*G(l,s)*(gain*DR(l,s)+DC(l,s)+offt+offc)"); calgrp.addComment("with w1 = w0*((dist0*dist0) / (dist1*dist1))"); calgrp.addComment("and offt(l,s) = A*l + B*l*l + C*s + D*l*s + E"); - calgrp += PvlKeyword("offc", toString(calParam->Offset())); - calgrp += PvlKeyword("exp", toString(calParam->Exposure())); - calgrp += PvlKeyword("gain", toString(calParam->Gain())); + calgrp += PvlKeyword("offc", std::to_string(calParam->Offset())); + calgrp += PvlKeyword("exp", std::to_string(calParam->Exposure())); + calgrp += PvlKeyword("gain", std::to_string(calParam->Gain())); calgrp += PvlKeyword("DR", in); calgrp += PvlKeyword("DC", calParam->OffsetFile()); calgrp += PvlKeyword("G", calParam->GainFile()); - calgrp += PvlKeyword("w0", toString(calParam->Omega0())); - calgrp += PvlKeyword("w1", toString(calParam->Omega1())); - calgrp += PvlKeyword("dist0", toString(calParam->Distance())); - calgrp += PvlKeyword("dist1", toString(calParam->Dist1())); - calgrp += PvlKeyword("1.0/exp*w1", toString(1.0 / (calParam->Exposure() * calParam->Omega1()))); - - calgrp += PvlKeyword("Acoeff", toString(calParam->Acoeff())); - calgrp += PvlKeyword("Bcoeff", toString(calParam->Bcoeff())); - calgrp += PvlKeyword("Ccoeff", toString(calParam->Ccoeff())); - calgrp += PvlKeyword("Dcoeff", toString(calParam->Dcoeff())); - calgrp += PvlKeyword("Ecoeff", toString(calParam->Ecoeff())); + calgrp += PvlKeyword("w0", std::to_string(calParam->Omega0())); + calgrp += PvlKeyword("w1", std::to_string(calParam->Omega1())); + calgrp += PvlKeyword("dist0", std::to_string(calParam->Distance())); + calgrp += PvlKeyword("dist1", std::to_string(calParam->Dist1())); + calgrp += PvlKeyword("1.0/exp*w1", std::to_string(1.0 / (calParam->Exposure() * calParam->Omega1()))); + + calgrp += PvlKeyword("Acoeff", std::to_string(calParam->Acoeff())); + calgrp += PvlKeyword("Bcoeff", std::to_string(calParam->Bcoeff())); + calgrp += PvlKeyword("Ccoeff", std::to_string(calParam->Ccoeff())); + calgrp += PvlKeyword("Dcoeff", std::to_string(calParam->Dcoeff())); + calgrp += PvlKeyword("Ecoeff", std::to_string(calParam->Ecoeff())); ocube->putGroup(calgrp); From 06c471b48cc742320695bbedf5b45854045118d5 Mon Sep 17 00:00:00 2001 From: Amy Stamile Date: Mon, 30 Oct 2023 07:59:37 -0700 Subject: [PATCH 53/95] more PVL updates --- isis/src/apollo/apps/apollo2isis/main.cpp | 2 +- isis/src/apollo/apps/apollopaninit/main.cpp | 40 +++++----- isis/src/cassini/apps/cisscal/main.cpp | 12 +-- isis/src/cassini/apps/vims2isis/main.cpp | 26 +++---- .../src/cassini/objs/IssNACamera/unitTest.cpp | 2 +- .../src/cassini/objs/IssWACamera/unitTest.cpp | 2 +- .../clementine/objs/NirCamera/unitTest.cpp | 2 +- isis/src/galileo/apps/gllnims2isis/main.cpp | 34 ++++----- isis/src/galileo/apps/gllssi2isis/main.cpp | 25 +++--- isis/src/galileo/apps/gllssical/gllssical.cpp | 72 +++++++++--------- isis/src/galileo/objs/SsiCamera/SsiCamera.cpp | 4 +- .../apps/amica2isis/AmicaImportFits.cpp | 26 +++---- isis/src/hayabusa/apps/amica2isis/main.cpp | 16 ++-- isis/src/hayabusa/apps/amicacal/main.cpp | 76 +++++++++---------- .../apps/nirs2isis/NirsImportFits.cpp | 28 +++---- isis/src/hayabusa/apps/nirs2isis/main.cpp | 16 ++-- .../HayabusaAmicaCamera.cpp | 4 +- .../HayabusaNirsCamera/HayabusaNirsCamera.cpp | 4 +- isis/src/hayabusa2/apps/hyb2onccal/main.cpp | 62 +++++++-------- .../objs/Hyb2OncCamera/Hyb2OncCamera.cpp | 2 +- isis/src/juno/apps/junocam2isis/main.cpp | 30 ++++---- isis/src/juno/objs/JunoCamera/JunoCamera.cpp | 4 +- .../apps/kaguyami2isis/kaguyami2isis.cpp | 32 ++++---- .../apps/kaguyatc2isis/kaguyatc2isis.cpp | 14 ++-- .../src/kaguya/apps/mimap2isis/mimap2isis.cpp | 8 +- .../objs/KaguyaMiCamera/KaguyaMiCamera.cpp | 2 +- .../objs/KaguyaTcCamera/KaguyaTcCamera.cpp | 4 +- isis/src/lo/apps/lo2isis/lo2isis.cpp | 20 ++--- isis/src/lo/apps/lopdsgen/main.cpp | 28 +++---- .../LoCameraFiducialMap.cpp | 8 +- .../src/lo/objs/LoHighCamera/LoHighCamera.cpp | 6 +- .../lo/objs/LoMediumCamera/LoMediumCamera.cpp | 6 +- isis/src/lro/apps/lronac2isis/lronac2isis.cpp | 16 ++-- isis/src/lro/apps/lronac2pds/lronac2pds.cpp | 38 +++++----- isis/src/lro/apps/lronaccal/lronaccal.cpp | 36 ++++----- isis/src/lro/apps/lronacpho/lronacpho.cpp | 2 +- isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp | 38 +++++----- isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp | 50 ++++++------ isis/src/lro/apps/lrowaccal/lrowaccal.cpp | 46 +++++------ .../LroNarrowAngleCamera.cpp | 2 +- .../LroWideAngleCamera/LroWideAngleCamera.cpp | 34 ++++----- isis/src/lro/objs/MiniRF/MiniRF.cpp | 4 +- 42 files changed, 441 insertions(+), 442 deletions(-) diff --git a/isis/src/apollo/apps/apollo2isis/main.cpp b/isis/src/apollo/apps/apollo2isis/main.cpp index 3f3668f902..97798aa00b 100644 --- a/isis/src/apollo/apps/apollo2isis/main.cpp +++ b/isis/src/apollo/apps/apollo2isis/main.cpp @@ -278,7 +278,7 @@ void TranslateApolloLabels (IString filename, Cube *opack) { Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory"); Process p; PvlTranslationTable tTable("$ISISROOT/appdata/translations/MissionName2DataDir.trn"); - QString missionDir = dataDir[tTable.Translate("MissionName", QString::fromStdString(apollo->SpacecraftName()))][0]; + QString missionDir = QString::fromStdString(dataDir[tTable.Translate("MissionName", apollo->SpacecraftName()).toStdString()][0]); Pvl resTemplate(missionDir.toStdString() + "/reseaus/" + apollo->InstrumentId().toStdString() + "_NOMINAL.pvl"); PvlGroup *reseaus = &resTemplate.findGroup("Reseaus"); diff --git a/isis/src/apollo/apps/apollopaninit/main.cpp b/isis/src/apollo/apps/apollopaninit/main.cpp index 47e93836bb..d8c76dbc13 100644 --- a/isis/src/apollo/apps/apollopaninit/main.cpp +++ b/isis/src/apollo/apps/apollopaninit/main.cpp @@ -132,19 +132,19 @@ void IsisMain() { //four that are the same for every panaramic mission keyword.setName("SpacecraftName"); - keyword.setValue(mission); + keyword.setValue(mission.toStdString()); inst_pvlG.addKeyword(keyword); keyword.setName("InstrumentName"); - keyword.setValue(transTable.Translate("InstrumentName","whatever")); + keyword.setValue(transTable.Translate("InstrumentName","whatever").toStdString()); inst_pvlG.addKeyword(keyword); keyword.setName("InstrumentId"); - keyword.setValue(transTable.Translate("InstrumentId","whatever")); + keyword.setValue(transTable.Translate("InstrumentId","whatever").toStdString()); inst_pvlG.addKeyword(keyword); keyword.setName("TargetName"); - keyword.setValue(transTable.Translate("TargetName","whatever")); + keyword.setValue(transTable.Translate("TargetName","whatever").toStdString()); inst_pvlG.addKeyword(keyword); //three that need to be calculated from input values @@ -171,17 +171,17 @@ void IsisMain() { isisTime = time0; keyword.setName("StartTime"); - keyword.setValue(iStrTEMP=isisTime.UTC()); + keyword.setValue(isisTime.UTC().toStdString()); inst_pvlG.addKeyword(keyword); isisTime = time1; keyword.setName("StopTime"); - keyword.setValue(iStrTEMP=isisTime.UTC()); + keyword.setValue(isisTime.UTC().toStdString()); inst_pvlG.addKeyword(keyword); keyword.setName("LineExposureDuration"); //converted led to msec/mm--negative sign to account for the anti-parallel time and line axes - keyword.setValue(iStrTEMP=std::to_string(-led),"sec/mm"); + keyword.setValue(std::to_string(-led),"sec/mm"); inst_pvlG.addKeyword(keyword); panCube.putGroup(inst_pvlG); @@ -195,23 +195,23 @@ void IsisMain() { kernels_pvlG.addKeyword(keyword); keyword.setName("LeapSecond"); - keyword.setValue( transTable.Translate("LeapSecond","File1") ); + keyword.setValue( transTable.Translate("LeapSecond","File1").toStdString() ); kernels_pvlG.addKeyword(keyword); keyword.setName("TargetAttitudeShape"); - keyword.setValue( transTable.Translate("TargetAttitudeShape", "File1") ); - keyword.addValue( transTable.Translate("TargetAttitudeShape", "File2") ); - keyword.addValue( transTable.Translate("TargetAttitudeShape", "File3") ); + keyword.setValue( transTable.Translate("TargetAttitudeShape", "File1").toStdString() ); + keyword.addValue( transTable.Translate("TargetAttitudeShape", "File2").toStdString() ); + keyword.addValue( transTable.Translate("TargetAttitudeShape", "File3").toStdString() ); kernels_pvlG.addKeyword(keyword); keyword.setName("TargetPosition"); keyword.setValue("Table"); - keyword.addValue( transTable.Translate("TargetPosition", "File1") ); - keyword.addValue( transTable.Translate("TargetPosition", "File2") ); + keyword.addValue( transTable.Translate("TargetPosition", "File1").toStdString() ); + keyword.addValue( transTable.Translate("TargetPosition", "File2").toStdString() ); kernels_pvlG.addKeyword(keyword); keyword.setName("ShapeModel"); - keyword.setValue( transTable.Translate("ShapeModel", "File1") ); + keyword.setValue( transTable.Translate("ShapeModel", "File1").toStdString() ); kernels_pvlG.addKeyword(keyword); keyword.setName("InstrumentPointing"); @@ -223,7 +223,7 @@ void IsisMain() { kernels_pvlG.addKeyword(keyword); keyword.setName("InstrumentAddendum"); - keyword.setValue( transTable.Translate("InstrumentAddendum",mission)); + keyword.setValue( transTable.Translate("InstrumentAddendum", mission).toStdString()); kernels_pvlG.addKeyword(keyword); panCube.putGroup(kernels_pvlG); @@ -630,7 +630,7 @@ void IsisMain() { //parameters for maximum correlation autoregestration // see: file:///usgs/pkgs/isis3nightly2011-09-21/isis/doc/documents/patternSMatch/patternSMatch.html#DistanceTolerance FileName fiducialPvl("$ISISROOT/appdata/templates/apollo/PanFiducialFinder.def"); - pvl.read(fiducialPvl.expanded()); //read in the autoreg parameters + pvl.read(fiducialPvl.expanded().toStdString()); //read in the autoreg parameters AutoReg *arS = AutoRegFactory::Create(pvl); *arS->PatternChip() = patternS; //patternS chip is constant @@ -797,12 +797,12 @@ void Load_Kernel(Isis::PvlKeyword &key) { for(int i = 0; i < key.size(); i++) { if(key[i] == "") continue; - if(QString(key[i]).toUpper() == "NULL") break; - if(QString(key[i]).toUpper() == "NADIR") break; + if(QString::fromStdString(key[i]).toUpper() == "NULL") break; + if(QString::fromStdString(key[i]).toUpper() == "NADIR") break; //Table was left as the first value of these keywords because one is about to be attached, // still though it needs to be skipped in this loop - if(QString(key[i]).toUpper() == "TABLE") continue; - Isis::FileName file(key[i]); + if(QString::fromStdString(key[i]).toUpper() == "TABLE") continue; + Isis::FileName file(QString::fromStdString(key[i])); if(!file.fileExists()) { QString msg = "Spice file does not exist [" + file.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); diff --git a/isis/src/cassini/apps/cisscal/main.cpp b/isis/src/cassini/apps/cisscal/main.cpp index 5eb4a3b849..945e712e3a 100644 --- a/isis/src/cassini/apps/cisscal/main.cpp +++ b/isis/src/cassini/apps/cisscal/main.cpp @@ -902,7 +902,7 @@ void gbl::FindDustRingParameters() { + gbl::dustFile.expanded() + "*** not found.", _FILEINFO_); } } - gbl::calgrp += PvlKeyword("DustRingFile", gbl::dustFile.original()); + gbl::calgrp += PvlKeyword("DustRingFile", gbl::dustFile.original().toStdString()); // if anti-blooming correction is off correct ring at sample=887, line=388 if (!gbl::cissLab->AntibloomingOn()) { gbl::dustFile2 = (gbl::GetCalibrationDirectory("dustring") + "nac_dustring_aboff" @@ -936,7 +936,7 @@ void gbl::FindDustRingParameters() { } gbl::mottleCorrection = true; gbl::calgrp += PvlKeyword("MottleCorrectionPerformed", "Yes"); - gbl::calgrp += PvlKeyword("MottleFile", gbl::mottleFile.original()); + gbl::calgrp += PvlKeyword("MottleFile", gbl::mottleFile.original().toStdString()); // determine strength factor, need effective wavelength of filter vector filterIndex(2); @@ -1107,7 +1107,7 @@ FileName gbl::FindFlatFile() { } gbl::calgrp += PvlKeyword("FlatfieldCorrectionPerformed", "Yes"); gbl::calgrp.findKeyword("FlatfieldCorrectionPerformed").addComment("Flatfield Correction Parameters"); - gbl::calgrp += PvlKeyword("SlopeDataBase", slopeDatabaseName.original()); + gbl::calgrp += PvlKeyword("SlopeDataBase", slopeDatabaseName.original().toStdString()); gbl::flatCorrection = true; // Find the best-match flat file @@ -1673,8 +1673,8 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { spline2.AddData(lambda, fluxproduct2); gbl::efficiencyFactor = spline1.BoolesRule(spline1.DomainMinimum(), spline1.DomainMaximum()); double efficiency = spline2.BoolesRule(spline2.DomainMinimum(), spline2.DomainMaximum()); - gbl::calgrp += PvlKeyword("EfficiencyFactor", gbl::efficiencyFactor, units); - gbl::calgrp += PvlKeyword("TotalEfficiency", efficiency); + gbl::calgrp += PvlKeyword("EfficiencyFactor", std::to_string(gbl::efficiencyFactor), units.toStdString()); + gbl::calgrp += PvlKeyword("TotalEfficiency", std::to_string(efficiency)); // Cannot divide by 0.0 if(gbl::efficiencyFactor == 0) { @@ -1859,6 +1859,6 @@ void gbl::FindSensitivityCorrection() { QString gbl::GetCalibrationDirectory(QString calibrationType) { // Get the directory where the CISS calibration directories are. PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - QString missionDir = (QString) dataDir["Cassini"]; + QString missionDir = QString::fromStdString(dataDir["Cassini"]); return missionDir + "/calibration/" + calibrationType + "/"; } diff --git a/isis/src/cassini/apps/vims2isis/main.cpp b/isis/src/cassini/apps/vims2isis/main.cpp index 8391c7a7bf..7a2f69d102 100644 --- a/isis/src/cassini/apps/vims2isis/main.cpp +++ b/isis/src/cassini/apps/vims2isis/main.cpp @@ -51,7 +51,7 @@ void IsisMain() { FileName in = ui.GetFileName("FROM"); FileName outIr = ui.GetCubeName("IR"); FileName outVis = ui.GetCubeName("VIS"); - Pvl lab(in.expanded()); + Pvl lab(in.expanded().toStdString()); //Checks if in file is rdr if(lab.hasObject("IMAGE_MAP_PROJECTION")) { @@ -64,7 +64,7 @@ void IsisMain() { try { PvlObject qube(lab.findObject("QUBE")); QString id; - id = (QString)qube["INSTRUMENT_ID"]; + id = QString::fromStdString(qube["INSTRUMENT_ID"]); id = id.simplified().trimmed(); if(id != "VIMS") { QString msg = "Invalid INSTRUMENT_ID [" + id + "]"; @@ -79,10 +79,10 @@ void IsisMain() { } FileName tempname(in.baseName() + ".bsq.cub"); - Pvl pdsLab(in.expanded()); + Pvl pdsLab(in.expanded().toStdString()); // It's VIMS, let's figure out if it has the suffix data or not - if(toInt(lab.findObject("QUBE")["SUFFIX_ITEMS"][0]) == 0) { + if(std::stoi(lab.findObject("QUBE")["SUFFIX_ITEMS"][0]) == 0) { // No suffix data, we can use processimportpds ProcessImportPds p; @@ -164,7 +164,7 @@ void IsisMain() { * @param outFile FileName of the output file */ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outFile) { - Pvl pdsLabel(inFileName); + Pvl pdsLabel(inFileName.toStdString()); Isis::FileName transFile("$ISISROOT/appdata/translations/pdsQube.trn"); Isis::PvlToPvlTranslationManager pdsXlater(pdsLabel, transFile.expanded()); @@ -339,10 +339,10 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF out.SetBasePosition(1, line + 1, band + 1); outCube.write(out); - if(toInt(suffixItems[0]) != 0) { + if(std::stoi(suffixItems[0]) != 0) { pos = fin.tellg(); - char *sideplaneData = new char[4*toInt(suffixItems[0])]; - fin.read(sideplaneData, 4 * toInt(suffixItems[0])); + char *sideplaneData = new char[4*std::stoi(suffixItems[0])]; + fin.read(sideplaneData, 4 * std::stoi(suffixItems[0])); int suffixData = (int)swapper.Int((int *)sideplaneData); record[0] = line + 1; record[1] = band + 1; @@ -382,7 +382,7 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF } } // End band loop - int backplaneSize = toInt(suffixItems[1]) * (4 * (ns + toInt(suffixItems[0]))); + int backplaneSize = std::stoi(suffixItems[1]) * (4 * (ns + std::stoi(suffixItems[0]))); fin.seekg(backplaneSize, ios_base::cur); // Check the last io @@ -460,7 +460,7 @@ void ProcessBands(Pvl &pdsLab, Cube *vimsCube, VimsType vtype) { PvlKeyword center("Center"); PvlGroup bbin(qube.findGroup("BandBin")); for(int i = vims.mi32BandCenterStart; i < vims.mi32BandCenterEnd; i++) { - center += (QString) bbin["BandBinCenter"][i]; + center += bbin["BandBinCenter"][i]; } bandbin += center; @@ -468,7 +468,7 @@ void ProcessBands(Pvl &pdsLab, Cube *vimsCube, VimsType vtype) { //Create the Kernels Group PvlGroup kern("Kernels"); - kern += PvlKeyword("NaifFrameCode", toString(vims.mi32NaifFrameCode)); + kern += PvlKeyword("NaifFrameCode", std::to_string(vims.mi32NaifFrameCode)); vimsCube->putGroup(kern); } @@ -500,8 +500,8 @@ void TranslateVimsLabels(Pvl &pdsLab, Cube *vimscube, VimsType vType) { PvlGroup &inst = outputLabel.findGroup("Instrument", Pvl::Traverse); //trim start and stop time - QString strTime = inst.findKeyword("StartTime")[0]; - inst.findKeyword("StartTime").setValue(strTime.remove("Z")); + QString strTime = QString::fromStdString(inst.findKeyword("StartTime")[0]); + inst.findKeyword("StartTime").setValue(strTime.remove("Z").toStdString()); strTime = QString::fromStdString(qube["StopTime"]); inst.findKeyword("StopTime").setValue((strTime).remove("Z").toStdString()); diff --git a/isis/src/cassini/objs/IssNACamera/unitTest.cpp b/isis/src/cassini/objs/IssNACamera/unitTest.cpp index d6a500c947..d2a29d855f 100644 --- a/isis/src/cassini/objs/IssNACamera/unitTest.cpp +++ b/isis/src/cassini/objs/IssNACamera/unitTest.cpp @@ -53,7 +53,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/cassini/objs/IssWACamera/unitTest.cpp b/isis/src/cassini/objs/IssWACamera/unitTest.cpp index 4d31f0649c..4b81f9a351 100644 --- a/isis/src/cassini/objs/IssWACamera/unitTest.cpp +++ b/isis/src/cassini/objs/IssWACamera/unitTest.cpp @@ -51,7 +51,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/clementine/objs/NirCamera/unitTest.cpp b/isis/src/clementine/objs/NirCamera/unitTest.cpp index 1f85ad0bda..bd63945684 100644 --- a/isis/src/clementine/objs/NirCamera/unitTest.cpp +++ b/isis/src/clementine/objs/NirCamera/unitTest.cpp @@ -51,7 +51,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/galileo/apps/gllnims2isis/main.cpp b/isis/src/galileo/apps/gllnims2isis/main.cpp index 2e1b7e77ea..43165054d3 100644 --- a/isis/src/galileo/apps/gllnims2isis/main.cpp +++ b/isis/src/galileo/apps/gllnims2isis/main.cpp @@ -152,7 +152,7 @@ void importQubs(QString coreParamName, QString suffixParamName) { const PvlObject &qube = pdsLabel->findObject("Qube"); - QString dataSetId(qube["DATA_SET_ID"]); + QString dataSetId(QString::fromStdString(qube["DATA_SET_ID"])); //Verify that we have a NIMS cube QRegExp galileoRx("GO-[A-Z]-NIMS*"); @@ -172,11 +172,11 @@ void importQubs(QString coreParamName, QString suffixParamName) { } //Determine the dimensions and pixel type of the core/suffix bands - QString g_coreItemBytesStr(qube["CORE_ITEM_BYTES"][0]); - QString g_suffixItemBytesStr(qube["SUFFIX_BYTES"][0]); + QString g_coreItemBytesStr(QString::fromStdString(qube["CORE_ITEM_BYTES"][0])); + QString g_suffixItemBytesStr(QString::fromStdString(qube["SUFFIX_BYTES"][0])); - QString backPlanesStr(qube["SUFFIX_ITEMS"][2]); - QString corePlanesStr(qube["CORE_ITEMS"][2]); + QString backPlanesStr(QString::fromStdString(qube["SUFFIX_ITEMS"][2])); + QString corePlanesStr(QString::fromStdString(qube["CORE_ITEMS"][2])); g_coreItemBytes = g_coreItemBytesStr.toInt(); g_suffixItemBytes = g_suffixItemBytesStr.toInt(); @@ -549,29 +549,29 @@ void ProcessBands(Pvl &pdsLab, Cube *nimsCube, ProcessImportPds &importPds) { vector base(g_suffixBands); for(int i = 0; i < g_suffixBands; i++) { - suffixNames+= (QString)qube["BAND_SUFFIX_NAME"][i]; + suffixNames+= (std::string)qube["BAND_SUFFIX_NAME"][i]; if(qube.hasKeyword("BAND_SUFFIX_UNIT")) - suffixUnits+= (QString)qube["BAND_SUFFIX_UNIT"][i]; + suffixUnits+= (std::string)qube["BAND_SUFFIX_UNIT"][i]; if (qube.hasKeyword("BAND_BIN_CENTER") ) - suffixCenters += (QString)qube["BAND_BIN_CENTER"][i]; + suffixCenters += (std::string)qube["BAND_BIN_CENTER"][i]; if (qube.hasKeyword("BAND_BIN_ORIGINAL_BAND") ) - suffixOriginalBands += (QString)qube["BAND_BIN_ORIGINAL_BAND"][i]; + suffixOriginalBands += (std::string)qube["BAND_BIN_ORIGINAL_BAND"][i]; if (qube.hasKeyword("BAND_BIN_GRATING_POSITION") ) - suffixGratingPositions += (QString)qube["BAND_BIN_GRATING_POSITION"][i]; + suffixGratingPositions += (std::string)qube["BAND_BIN_GRATING_POSITION"][i]; if (qube.hasKeyword("BAND_BIN_DETECTOR") ) - suffixDetectors += (QString)qube["BAND_BIN_DETECTOR"][i]; + suffixDetectors += (std::string)qube["BAND_BIN_DETECTOR"][i]; if (qube.hasKeyword("BAND_BIN_SOLAR_FLUX") ) - suffixSolarFluxes += (QString)qube["BAND_BIN_SOLAR_FLUX"][i]; + suffixSolarFluxes += (std::string)qube["BAND_BIN_SOLAR_FLUX"][i]; if (qube.hasKeyword("BAND_BIN_SENSITIVITY") ) - suffixSensitivities += (QString)qube["BAND_BIN_SENSITIVITY"][i]; + suffixSensitivities += (std::string)qube["BAND_BIN_SENSITIVITY"][i]; } bandBin += suffixNames; @@ -584,14 +584,14 @@ void ProcessBands(Pvl &pdsLab, Cube *nimsCube, ProcessImportPds &importPds) { bandBin += suffixSolarFluxes; if(qube.hasKeyword("BAND_SUFFIX_NOTE")) - bandBin += (QString)qube["BAND_SUFFIX_NOTE"]; + bandBin += (std::string)qube["BAND_SUFFIX_NOTE"]; if(qube.hasKeyword("STD_DEV_SELECTED_BAND_NUMBER")) - bandBin += (QString)qube["STD_DEV_SELECTED_BAND_NUMBER"]; + bandBin += (std::string)qube["STD_DEV_SELECTED_BAND_NUMBER"]; for(int i = 0; i < g_suffixBands; i++) { - multStr = (QString)qube["BAND_SUFFIX_MULTIPLIER"]; - baseStr = (QString)qube["BAND_SUFFIX_BASE"]; + multStr = QString::fromStdString(qube["BAND_SUFFIX_MULTIPLIER"]); + baseStr = QString::fromStdString(qube["BAND_SUFFIX_BASE"]); multi[i]=multStr.toDouble(); base[i] = baseStr.toDouble(); } diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index b419c70981..96efa43fc5 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -47,7 +47,7 @@ void IsisMain() { fixPvl(inFile.toString()); // Make sure it is a Galileo SSI image - Pvl lab(inFile.expanded()); + Pvl lab(inFile.expanded().toStdString()); //Checks if in file is rdr if(lab.hasObject("IMAGE_MAP_PROJECTION")) { @@ -59,7 +59,7 @@ void IsisMain() { // data set id value must contain "SSI-2-REDR-V1.0" or "SSI-2-REDR-V1.1" (valid SSI image) // or "SSI-4-REDR-V1.0" or "SSI-4-REDR-V1.1"(reconstructed from garbled SSI image) QString dataSetId; - dataSetId = (QString)lab["DATA_SET_ID"]; + dataSetId = QString::fromStdString(lab["DATA_SET_ID"]); if(!dataSetId.contains("SSI-2-REDR-V1.0") && !dataSetId.contains("SSI-2-REDR-V1.1") && !dataSetId.contains("SSI-4-REDR-V1.0") && !dataSetId.contains("SSI-4-REDR-V1.1") ) { @@ -117,7 +117,7 @@ void IsisMain() { p.StartProcess(translateData); translateLabels(pdsLabel, summedOutput); - OriginalLabel ol(Pvl(inFile.expanded())); + OriginalLabel ol(Pvl(inFile.expanded().toStdString())); summedOutput->write(ol); summedOutput->close(); delete summedOutput; @@ -184,20 +184,19 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube) { PvlGroup &arch = outputLabel->findGroup("Archive", Pvl::Traverse); PvlGroup &inst = outputLabel->findGroup("Instrument", Pvl::Traverse); arch.addKeyword(PvlKeyword("DataType", "RADIANCE")); - QString CTC = (QString) arch.findKeyword("ObservationId"); + QString CTC = QString::fromStdString(arch.findKeyword("ObservationId")); QString CTCout = CTC.mid(0, 2); - arch.addKeyword(PvlKeyword("CalTargetCode", CTCout)); + arch.addKeyword(PvlKeyword("CalTargetCode", CTCout.toStdString())); // Add to the Instrument Group - QString itest = (QString) inst.findKeyword("StartTime"); + QString itest = QString::fromStdString(inst.findKeyword("StartTime")); itest.remove("Z"); - inst.findKeyword("StartTime").setValue(itest); + inst.findKeyword("StartTime").setValue(itest.toStdString()); //change exposure duration to seconds double expDur = inst.findKeyword("exposureDuration"); double expDurOut = expDur / 1000.0; inst.findKeyword("exposureDuration").setValue(std::to_string(expDurOut), "seconds"); - inst.addKeyword(PvlKeyword("FrameDuration", - (QString) pdsLabel["frameDuration"], "seconds")); + inst.addKeyword(PvlKeyword("FrameDuration", pdsLabel["frameDuration"], "seconds")); //Calculate the Frame_Rate_Id keyword QString frameModeId = "FULL"; @@ -209,11 +208,11 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube) { } inst.addKeyword(PvlKeyword("Summing", std::to_string(summingMode))); - inst.addKeyword(PvlKeyword("FrameModeId", frameModeId)); + inst.addKeyword(PvlKeyword("FrameModeId", frameModeId.toStdString())); // Create the Band bin Group PvlGroup &bandBin = outputLabel->findGroup("BandBin", Pvl::Traverse); - QString filterName = pdsLabel["FILTER_NAME"]; + QString filterName = QString::fromStdString(pdsLabel["FILTER_NAME"]); QString waveLength = ""; QString width = ""; if(filterName == "CLEAR") { @@ -248,8 +247,8 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube) { waveLength = "0.986"; width = ".04"; } - bandBin.addKeyword(PvlKeyword("Center", waveLength, "micrometers")); - bandBin.addKeyword(PvlKeyword("Width", width, "micrometers")); + bandBin.addKeyword(PvlKeyword("Center", waveLength.toStdString(), "micrometers")); + bandBin.addKeyword(PvlKeyword("Width", width.toStdString(), "micrometers")); //create the kernel group PvlGroup kern("Kernels"); diff --git a/isis/src/galileo/apps/gllssical/gllssical.cpp b/isis/src/galileo/apps/gllssical/gllssical.cpp index 87da720557..aea990ff7c 100644 --- a/isis/src/galileo/apps/gllssical/gllssical.cpp +++ b/isis/src/galileo/apps/gllssical/gllssical.cpp @@ -82,7 +82,7 @@ namespace Isis { Isis::CubeAttributeInput inAtt1; FileName darkFileName = FindDarkFile(icube); Cube *darkcube = p.SetInputCube(darkFileName.expanded(), inAtt1); - dcScaleFactor = toDouble(darkcube->group("Instrument")["PicScale"][0]); + dcScaleFactor = std::stod(darkcube->group("Instrument")["PicScale"][0]); Isis::CubeAttributeInput inAtt2; FileName gainFileName = FindGainFile(icube); @@ -107,7 +107,7 @@ namespace Isis { calculateScaleFactor0(icube, gaincube); - exposureDuration = toDouble(icube->group("Instrument")["ExposureDuration"][0]) * 1000; + exposureDuration = std::stod(icube->group("Instrument")["ExposureDuration"][0]) * 1000; if(darkcube->pixelType() == Isis::UnsignedByte) { eightBitDarkCube = true; @@ -117,15 +117,15 @@ namespace Isis { } p.StartProcess(Calibrate); PvlGroup calibrationLog("RadiometricCalibration"); - calibrationLog.addKeyword(PvlKeyword("From", ui.GetCubeName("FROM"))); + calibrationLog.addKeyword(PvlKeyword("From", ui.GetCubeName("FROM").toStdString())); FileName shutterFileName = FindShutterFile(icube); - calibrationLog.addKeyword(PvlKeyword("DarkCurrentFile", darkFileName.originalPath() + "/" + - darkFileName.name())); - calibrationLog.addKeyword(PvlKeyword("GainFile", gainFileName.originalPath() + "/" + - gainFileName.name())); - calibrationLog.addKeyword(PvlKeyword("ShutterFile", shutterFileName.originalPath() + "/" + - shutterFileName.name())); + calibrationLog.addKeyword(PvlKeyword("DarkCurrentFile", darkFileName.originalPath().toStdString() + "/" + + darkFileName.name().toStdString())); + calibrationLog.addKeyword(PvlKeyword("GainFile", gainFileName.originalPath().toStdString() + "/" + + gainFileName.name().toStdString())); + calibrationLog.addKeyword(PvlKeyword("ShutterFile", shutterFileName.originalPath().toStdString() + "/" + + shutterFileName.name().toStdString())); calibrationLog.addKeyword(PvlKeyword("ScaleFactor", std::to_string(scaleFactor))); calibrationLog.addKeyword(PvlKeyword("OutputUnits", iof ? "I/F" : "Radiance")); if (iof) { @@ -235,11 +235,11 @@ namespace Isis { * 4 = 60 2/3 * 5 = 15 1/6 */ - if((int)(toDouble(icube->group("Instrument")["FrameDuration"][0])) == 2) frameRateId = 1; - if((int)(toDouble(icube->group("Instrument")["FrameDuration"][0])) == 8) frameRateId = 2; - if((int)(toDouble(icube->group("Instrument")["FrameDuration"][0])) == 30) frameRateId = 3; - if((int)(toDouble(icube->group("Instrument")["FrameDuration"][0])) == 60) frameRateId = 4; - if((int)(toDouble(icube->group("Instrument")["FrameDuration"][0])) == 15) frameRateId = 5; + if((int)(std::stod(icube->group("Instrument")["FrameDuration"][0])) == 2) frameRateId = 1; + if((int)(std::stod(icube->group("Instrument")["FrameDuration"][0])) == 8) frameRateId = 2; + if((int)(std::stod(icube->group("Instrument")["FrameDuration"][0])) == 30) frameRateId = 3; + if((int)(std::stod(icube->group("Instrument")["FrameDuration"][0])) == 60) frameRateId = 4; + if((int)(std::stod(icube->group("Instrument")["FrameDuration"][0])) == 15) frameRateId = 5; int exposureTypeId = (icube->group("Instrument")["ExposureType"][0] == "NORMAL") ? 0 : 1; @@ -282,8 +282,8 @@ namespace Isis { int minImageNum = toInt(tokens.takeFirst()); int maxImageNum = toInt(tokens.takeFirst()); - int imageNumber = (int)(toDouble(icube->group("Instrument")["SpacecraftClockStartCount"]) * 100 + 0.5); - QString telemetry = icube->group("Instrument")["TelemetryFormat"][0]; + int imageNumber = (int)(std::stod(icube->group("Instrument")["SpacecraftClockStartCount"]) * 100 + 0.5); + QString telemetry = QString::fromStdString(icube->group("Instrument")["TelemetryFormat"][0]); if(imageNumber > 99757701 && imageNumber < 159999999) { if((telemetry == "AI8" && (gainState == "1" || gainState == "2")) || (telemetry == "IM4" && (gainState == "3" || gainState == "4"))) { @@ -328,7 +328,7 @@ namespace Isis { * Filter codes * 0=clear,1=green,2=red,3=violet,4=7560,5=9680,6=7270,7=8890 */ - QString filter = icube->group("BandBin")["FilterNumber"][0]; + QString filter = QString::fromStdString(icube->group("BandBin")["FilterNumber"][0]); if(filter != tokens.takeFirst()) { continue; } @@ -355,13 +355,13 @@ namespace Isis { FileName weightFile(file); weightFile = weightFile.highestVersion(); - Pvl weightTables(weightFile.expanded()); + Pvl weightTables(weightFile.expanded().toStdString()); QString group = QString("FrameMode") + icube->group("Instrument")["FrameModeId"][0].at(0); - PvlGroup &frameGrp = weightTables.findGroup(group); + PvlGroup &frameGrp = weightTables.findGroup(group.toStdString()); QString keyword = QString("GainState") + ((getGainModeID(icube) < 3) ? QString("12") : QString("34")); - for(int i = 0; i < frameGrp[keyword].size(); i++) { - weight.push_back(toDouble(frameGrp[keyword][i])); + for(int i = 0; i < frameGrp[keyword.toStdString()].size(); i++) { + weight.push_back(std::stod(frameGrp[keyword.toStdString()][i])); } return weightFile; @@ -376,16 +376,16 @@ namespace Isis { * 3 = 40,000 * 4 = 10,000 */ - if((int)toDouble(icube->group("Instrument")["GainModeId"][0]) == 4E5) { + if((int)std::stod(icube->group("Instrument")["GainModeId"][0]) == 4E5) { gainModeId = 1; } - else if((int)toDouble(icube->group("Instrument")["GainModeId"][0]) == 1E5) { + else if((int)std::stod(icube->group("Instrument")["GainModeId"][0]) == 1E5) { gainModeId = 2; } - else if((int)toDouble(icube->group("Instrument")["GainModeId"][0]) == 4E4) { + else if((int)std::stod(icube->group("Instrument")["GainModeId"][0]) == 4E4) { gainModeId = 3; } - else if((int)toDouble(icube->group("Instrument")["GainModeId"][0]) == 1E4) { + else if((int)std::stod(icube->group("Instrument")["GainModeId"][0]) == 1E4) { gainModeId = 4; } else { @@ -414,7 +414,7 @@ namespace Isis { * if output units are in radiance. */ void calculateScaleFactor0(Cube *icube, Cube *gaincube) { - Pvl conversionFactors(GetScaleFactorFile().expanded()); + Pvl conversionFactors(GetScaleFactorFile().expanded().toStdString()); PvlKeyword fltToRef, fltToRad; for(int grp = 0; grp < conversionFactors.groups(); grp++) { @@ -422,7 +422,7 @@ namespace Isis { // Match target name if(currGrp.hasKeyword("TargetName")) { - if(!icube->group("Archive")["CalTargetCode"][0].startsWith(currGrp["TargetName"][0])) { + if(!QString::fromStdString(icube->group("Archive")["CalTargetCode"][0]).startsWith(QString::fromStdString(currGrp["TargetName"][0]))) { continue; } } @@ -431,7 +431,7 @@ namespace Isis { if(currGrp.hasKeyword("MinimumTargetName")) { try { if((int)currGrp["MinimumTargetName"] > - (int)toInt(icube->group("Archive")["CalTargetCode"][0].mid(0, 2))) { + (int)std::stoi(icube->group("Archive")["CalTargetCode"][0].substr(0, 2))) { continue; } } @@ -444,20 +444,20 @@ namespace Isis { fltToRad = currGrp["FloatToRad"]; } - int filterNumber = toInt(icube->group("BandBin")["FilterNumber"][0]); + int filterNumber = std::stoi(icube->group("BandBin")["FilterNumber"][0]); if(fltToRef.size() == 0) { throw IException(IException::Unknown, "Unable to find matching reflectance and radiance values for target [" + icube->group("Instrument")["TargetName"][0] + "] in [" + - GetScaleFactorFile().expanded() + "]", + GetScaleFactorFile().expanded().toStdString() + "]", _FILEINFO_); } - s1 = toDouble(fltToRef[filterNumber]); - s2 = toDouble(fltToRad[filterNumber]); - cubeConversion = toDouble( conversionFactors["GainRatios"][getGainModeID(icube)-1]); - gainConversion = toDouble(conversionFactors["GainRatios"][getGainModeID(gaincube)-1]); + s1 = std::stod(fltToRef[filterNumber]); + s2 = std::stod(fltToRad[filterNumber]); + cubeConversion = std::stod( conversionFactors["GainRatios"][getGainModeID(icube)-1]); + gainConversion = std::stod(conversionFactors["GainRatios"][getGainModeID(gaincube)-1]); if (iof) { try { @@ -474,11 +474,11 @@ namespace Isis { // try original fallback for previously spiceinited data try { Pvl *label = icube->label(); - QString startTime = label->findGroup("Instrument",Pvl::Traverse)["SpacecraftClockStartCount"][0]; + QString startTime = QString::fromStdString(label->findGroup("Instrument",Pvl::Traverse)["SpacecraftClockStartCount"][0]); Spice spicegll(*icube); spicegll.instrumentPosition()->SetAberrationCorrection("LT+S"); - Isis::FileName sclk(label->findGroup("Kernels",Pvl::Traverse)["SpacecraftClock"][0]); + Isis::FileName sclk(QString::fromStdString(label->findGroup("Kernels",Pvl::Traverse)["SpacecraftClock"][0])); QString sclkName(sclk.expanded()); NaifStatus::CheckErrors(); diff --git a/isis/src/galileo/objs/SsiCamera/SsiCamera.cpp b/isis/src/galileo/objs/SsiCamera/SsiCamera.cpp index 0bca4d9f81..337c1b10cc 100644 --- a/isis/src/galileo/objs/SsiCamera/SsiCamera.cpp +++ b/isis/src/galileo/objs/SsiCamera/SsiCamera.cpp @@ -47,7 +47,7 @@ namespace Isis { Pvl &lab = *cube.label(); iTime removeCoverDate("1994/04/01 00:00:00"); - iTime imageDate(lab.findKeyword("StartTime", PvlObject::Traverse)[0]); + iTime imageDate(QString::fromStdString(lab.findKeyword("StartTime", PvlObject::Traverse)[0])); /* * Change the Focal Length and K1 constant based on whether or not the protective cover is on * See "The Direction of the North Pole and the Control Network of Asteroid 951 Gaspra" Icarus 107, 18-22 (1994) @@ -68,7 +68,7 @@ namespace Isis { // Get the start time in et PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); - double et = iTime((QString)inst["StartTime"]).Et(); + double et = iTime(QString::fromStdString(inst["StartTime"])).Et(); //?????????? NEED THESE?????? // exposure duration keyword value is measured in seconds diff --git a/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp b/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp index 1f8fa66c56..e6ce4ab085 100644 --- a/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp +++ b/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp @@ -129,19 +129,19 @@ namespace Isis { m_label = parseLabel(input, fitsLabelName); // Get data dimensions - int naxis = toInt(m_label["NAXIS"][0]); + int naxis = std::stoi(m_label["NAXIS"][0]); if (naxis == 2) { - m_samples = toInt(m_label["NAXIS1"][0]); - m_lines = toInt(m_label["NAXIS2"][0]); + m_samples = std::stoi(m_label["NAXIS1"][0]); + m_lines = std::stoi(m_label["NAXIS2"][0]); m_bands = 1; } else if (naxis == 3) { - m_samples = toInt(m_label["NAXIS1"][0]); - m_lines = toInt(m_label["NAXIS2"][0]); - m_bands = toInt(m_label["NAXIS3"][0]); + m_samples = std::stoi(m_label["NAXIS1"][0]); + m_lines = std::stoi(m_label["NAXIS2"][0]); + m_bands = std::stoi(m_label["NAXIS3"][0]); } else { - QString msg = "NAXIS count of [" + m_label["NAXIS"][0] + + std::string msg = "NAXIS count of [" + m_label["NAXIS"][0] + "] is not supported at this time"; throw IException(IException::User, msg, _FILEINFO_); } @@ -179,7 +179,7 @@ namespace Isis { char reading[81]; IString line = ""; unsigned int place = 0; - PvlGroup labels(fitLabelName); + PvlGroup labels(fitLabelName.toStdString()); // Load first line input.seekg(0); @@ -193,26 +193,26 @@ namespace Isis { // Check for blank lines if(line.substr(0, 1) != " " && line.substr(0, 1) != "/") { // Name of keyword - PvlKeyword label(line.Token(" =").ToQt()); + PvlKeyword label(line.Token(" =")); // Remove up to beginning of data line.TrimHead(" ='"); line.TrimTail(" "); if(label.name() == "COMMENT" || label.name() == "HISTORY") { - label += line.ToQt(); + label += line; } else { // Access the data without the comment if there is one IString value = line.Token("/"); // Clear to end of data, including single quotes value.TrimTail(" '"); - label += value.ToQt(); + label += value; line.TrimHead(" "); // If the remaining line QString has anything, it is comments. if(line.size() > 0) { - label.addComment(line.ToQt()); + label.addComment(line); // A possible format for units, other possiblites exist. if(line != line.Token("[")) { - label.setUnits(line.Token("[").Token("]").ToQt()); + label.setUnits(line.Token("[").Token("]")); } } } diff --git a/isis/src/hayabusa/apps/amica2isis/main.cpp b/isis/src/hayabusa/apps/amica2isis/main.cpp index 8ce0a881d5..37769e2534 100644 --- a/isis/src/hayabusa/apps/amica2isis/main.cpp +++ b/isis/src/hayabusa/apps/amica2isis/main.cpp @@ -36,7 +36,7 @@ void IsisMain () p.SetPdsFile (inFile.expanded(), "", label); // Add FITS header - QString fitsImage = inFile.path() + "/" + (QString) label.findKeyword("^IMAGE"); + QString fitsImage = inFile.path() + "/" + QString::fromStdString(label.findKeyword("^IMAGE")); FileName fitsFile(fitsImage); AmicaImportFits fits(fitsFile, "FitsLabel"); label.addGroup(fits.label()); @@ -44,8 +44,8 @@ void IsisMain () QString instid; QString missid; try { - instid = (QString) label.findKeyword ("INSTRUMENT_ID", PvlObject::Traverse); - missid = (QString) label.findKeyword ("INSTRUMENT_HOST_NAME", PvlObject::Traverse); + instid = QString::fromStdString(label.findKeyword ("INSTRUMENT_ID", PvlObject::Traverse)); + missid = QString::fromStdString(label.findKeyword ("INSTRUMENT_HOST_NAME", PvlObject::Traverse)); } catch (IException &e) { QString msg = "Unable to read [INSTRUMENT_ID] or [INSTRUMENT_HOST_NAME] " @@ -131,7 +131,7 @@ void IsisMain () kernelsXlater.Auto(outLabel); // Create YearDoy keyword in Archive group - iTime stime(outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0]); + iTime stime(QString::fromStdString(outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0])); PvlKeyword yeardoy("YearDoy", std::to_string(stime.Year()*1000 + stime.DayOfYear())); outLabel.findGroup("Archive", Pvl::Traverse).addKeyword(yeardoy); @@ -139,18 +139,18 @@ void IsisMain () // Update target if user specifies it if (!target.isEmpty()) { PvlGroup &igrp = outLabel.findGroup("Instrument",Pvl::Traverse); - igrp["TargetName"] = target; + igrp["TargetName"] = target.toStdString(); } QString units = ""; if (outLabel.findGroup("BandBin", Pvl::Traverse).hasKeyword("Unit")) { - units = outLabel.findGroup("BandBin", Pvl::Traverse).findKeyword("Unit")[0].toLower(); + units = QString::fromStdString(outLabel.findGroup("BandBin", Pvl::Traverse).findKeyword("Unit")[0]).toLower(); } else { units = "nanometers"; } - outLabel.findGroup("BandBin", Pvl::Traverse).findKeyword("Center").setUnits(units); - outLabel.findGroup("BandBin", Pvl::Traverse).findKeyword("Width").setUnits(units); + outLabel.findGroup("BandBin", Pvl::Traverse).findKeyword("Center").setUnits(units.toStdString()); + outLabel.findGroup("BandBin", Pvl::Traverse).findKeyword("Width").setUnits(units.toStdString()); // Write the BandBin, Archive, and Instrument groups // to the output cube label diff --git a/isis/src/hayabusa/apps/amicacal/main.cpp b/isis/src/hayabusa/apps/amicacal/main.cpp index bd9b4e514b..fceade5a80 100644 --- a/isis/src/hayabusa/apps/amicacal/main.cpp +++ b/isis/src/hayabusa/apps/amicacal/main.cpp @@ -171,7 +171,7 @@ void IsisMain() { PvlGroup &bandbin = inputCube->group("BandBin"); PvlGroup &archive = inputCube->group("Archive"); - QString filter = bandbin["Name"]; + QString filter = QString::fromStdString(bandbin["Name"]); g_filter=filter; binning = inst["Binning"]; @@ -211,7 +211,7 @@ void IsisMain() { } - QString startTime = inst["SpacecraftClockStartCount"]; + QString startTime = QString::fromStdString(inst["SpacecraftClockStartCount"]); g_startTime = startTime; binning = inst["Binning"]; @@ -223,12 +223,12 @@ void IsisMain() { nsubImages = archive["SubImageCount"]; // If > 1, some correction is // not needed/performed - QString compmode = archive["OutputMode"]; + QString compmode = QString::fromStdString(archive["OutputMode"]); g_compfactor = ( "lossy" == compmode.toLower() ) ? 16.0 : 1.0; // I/F values - QString target = inst["TargetName"]; + QString target = QString::fromStdString(inst["TargetName"]); g_target = target; // Determine if we need to subsample the flat field should pixel binning @@ -367,37 +367,37 @@ void IsisMain() { // Log calibration activity performed so far PvlGroup calibrationLog("RadiometricCalibration"); - calibrationLog.addKeyword(PvlKeyword("SoftwareName", amicacalProgram)); - calibrationLog.addKeyword(PvlKeyword("SoftwareVersion", amicacalVersion)); - calibrationLog.addKeyword(PvlKeyword("ProcessDate", amicacalRuntime)); - calibrationLog.addKeyword(PvlKeyword("CalibrationFile", calfile)); - calibrationLog.addKeyword(PvlKeyword("FlatFieldFile", flatfile.originalPath() - + "/" + flatfile.name())); - calibrationLog.addKeyword(PvlKeyword("CompressionFactor", std::to_string(g_compfactor, 2))); + calibrationLog.addKeyword(PvlKeyword("SoftwareName", amicacalProgram.toStdString())); + calibrationLog.addKeyword(PvlKeyword("SoftwareVersion", amicacalVersion.toStdString())); + calibrationLog.addKeyword(PvlKeyword("ProcessDate", amicacalRuntime.toStdString())); + calibrationLog.addKeyword(PvlKeyword("CalibrationFile", calfile.toStdString())); + calibrationLog.addKeyword(PvlKeyword("FlatFieldFile", flatfile.originalPath().toStdString() + + "/" + flatfile.name().toStdString())); + calibrationLog.addKeyword(PvlKeyword("CompressionFactor", toString(g_compfactor, 2).toStdString())); // Parameters PvlKeyword key("Bias_Bn"); - key.addValue(std::to_string(g_b0, 8)); - key.addValue(std::to_string(g_b1, 8)); - key.addValue(std::to_string(g_b2, 8)); + key.addValue(toString(g_b0, 8).toStdString()); + key.addValue(toString(g_b1, 8).toStdString()); + key.addValue(toString(g_b2, 8).toStdString()); calibrationLog.addKeyword(key); - calibrationLog.addKeyword(PvlKeyword("Bias", std::to_string(g_bias, 16), "DN")); + calibrationLog.addKeyword(PvlKeyword("Bias", toString(g_bias, 16).toStdString(), "DN")); key = PvlKeyword("Linearity_Ln"); - key.addValue(std::to_string(g_L0, 8)); - key.addValue(std::to_string(g_L1, 8)); + key.addValue(toString(g_L0, 8).toStdString()); + key.addValue(toString(g_L1, 8).toStdString()); calibrationLog.addKeyword(key); - calibrationLog.addKeyword(PvlKeyword("Linearity_Gamma", std::to_string(g_gamma, 16))); + calibrationLog.addKeyword(PvlKeyword("Linearity_Gamma", toString(g_gamma, 16).toStdString())); - calibrationLog.addKeyword(PvlKeyword("Smear_tvct", std::to_string(g_tvct, 16))); + calibrationLog.addKeyword(PvlKeyword("Smear_tvct", toString(g_tvct, 16).toStdString())); - calibrationLog.addKeyword(PvlKeyword("CalibrationUnits", g_iofCorrection)); - calibrationLog.addKeyword(PvlKeyword("RadianceStandard", std::to_string(g_radStd, 16))); - calibrationLog.addKeyword(PvlKeyword("RadianceScaleFactor", std::to_string(g_iofScale, 16))); - calibrationLog.addKeyword(PvlKeyword("SolarDistance", std::to_string(g_solarDist, 16), "AU")); - calibrationLog.addKeyword(PvlKeyword("SolarFlux", std::to_string(g_solarFlux, 16))); - calibrationLog.addKeyword(PvlKeyword("IOFFactor", std::to_string(g_calibrationScale, 16))); - calibrationLog.addKeyword(PvlKeyword("Units", g_units)); + calibrationLog.addKeyword(PvlKeyword("CalibrationUnits", g_iofCorrection.toStdString())); + calibrationLog.addKeyword(PvlKeyword("RadianceStandard", toString(g_radStd, 16).toStdString())); + calibrationLog.addKeyword(PvlKeyword("RadianceScaleFactor", toString(g_iofScale, 16).toStdString())); + calibrationLog.addKeyword(PvlKeyword("SolarDistance", toString(g_solarDist, 16).toStdString(), "AU")); + calibrationLog.addKeyword(PvlKeyword("SolarFlux", toString(g_solarFlux, 16).toStdString())); + calibrationLog.addKeyword(PvlKeyword("IOFFactor", toString(g_calibrationScale, 16).toStdString())); + calibrationLog.addKeyword(PvlKeyword("Units", g_units.toStdString())); #if 0 // PSF correction is currently not working and has been removed as an option. @@ -609,7 +609,7 @@ QString loadCalibrationVariables(const QString &config, Cube *iCube) { if ( config.contains("?") ) calibFile = calibFile.highestVersion(); // Pvl configFile; - g_configFile.read(calibFile.expanded()); + g_configFile.read(calibFile.expanded().toStdString()); // Load the groups PvlGroup &biasGroup = g_configFile.findGroup("Bias"); @@ -629,8 +629,8 @@ QString loadCalibrationVariables(const QString &config, Cube *iCube) { // Load the hot pixels into a vector for (int i = 0; i< hotPixelsGroup.keywords(); i++ ){ - int samp(hotPixelsGroup[i][0].toInt()); - int line (hotPixelsGroup[i][1].toInt()); + int samp(std::stoi(hotPixelsGroup[i][0])); + int line (std::stoi(hotPixelsGroup[i][1])); hotPixelVector.append( Pixel(alpha->BetaSample(samp), alpha->BetaLine(line), 1, 0)); } @@ -639,23 +639,23 @@ QString loadCalibrationVariables(const QString &config, Cube *iCube) { g_gamma = linearityGroup["Gamma"]; g_gamma = 1.0 - g_gamma; - g_L0 = linearityGroup["L"][0].toDouble(); - g_L1 = linearityGroup["L"][1].toDouble(); + g_L0 = std::stod(linearityGroup["L"][0]); + g_L1 = std::stod(linearityGroup["L"][1]); // Load Smear Removal Variables g_tvct = smearGroup["tvct"]; // Load DarkCurrent variables - g_d0 = darkCurrentGroup["D"][0].toDouble(); - g_d1 = darkCurrentGroup["D"][1].toDouble(); + g_d0 = std::stod(darkCurrentGroup["D"][0]); + g_d1 = std::stod(darkCurrentGroup["D"][1]); // Load Bias variables - g_b0 = biasGroup["B"][0].toDouble(); - g_b1 = biasGroup["B"][1].toDouble(); - g_b2 = biasGroup["B"][2].toDouble(); + g_b0 = std::stod(biasGroup["B"][0]); + g_b1 = std::stod(biasGroup["B"][1]); + g_b2 = std::stod(biasGroup["B"][2]); - g_launchTimeStr = QString(biasGroup["launchTime"]); + g_launchTimeStr = QString::fromStdString(biasGroup["launchTime"]); g_launchTime = g_launchTimeStr; // Compute BIAS correction factor (it's a constant so do it once!) @@ -719,7 +719,7 @@ QString loadCalibrationVariables(const QString &config, Cube *iCube) { g_solarFlux = solarFluxGroup["v"]; g_radStd = radGroup["iof_standard"]; - g_iofScale = radGroup[g_filter]; + g_iofScale = radGroup[g_filter.toStdString()]; return ( calibFile.original() ); } diff --git a/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp b/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp index 4db082cf87..d2eac693de 100644 --- a/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp +++ b/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp @@ -129,19 +129,19 @@ namespace Isis { m_label = parseLabel(input, fitsLabelName); // Get data dimensions - int naxis = toInt(m_label["NAXIS"][0]); + int naxis = std::stoi(m_label["NAXIS"][0]); if (naxis == 2) { - m_samples = toInt(m_label["NAXIS1"][0]); - m_lines = toInt(m_label["NAXIS2"][0]); + m_samples = std::stoi(m_label["NAXIS1"][0]); + m_lines = std::stoi(m_label["NAXIS2"][0]); m_bands = 1; } else if (naxis == 3) { - m_samples = toInt(m_label["NAXIS1"][0]); - m_lines = toInt(m_label["NAXIS2"][0]); - m_bands = toInt(m_label["NAXIS3"][0]); + m_samples = std::stoi(m_label["NAXIS1"][0]); + m_lines = std::stoi(m_label["NAXIS2"][0]); + m_bands = std::stoi(m_label["NAXIS3"][0]); } else { - QString msg = "NAXIS count of [" + m_label["NAXIS"][0] + + std::string msg = "NAXIS count of [" + m_label["NAXIS"][0] + "] is not supported at this time"; throw IException(IException::User, msg, _FILEINFO_); } @@ -179,7 +179,7 @@ namespace Isis { char reading[81]; IString line = ""; unsigned int place = 0; - PvlObject labels(fitLabelName); + PvlObject labels(fitLabelName.toStdString()); // Load first line input.seekg(0); @@ -193,18 +193,18 @@ namespace Isis { // Check for blank lines if (line.substr(0, 1) != " " && line.substr(0, 1) != "/") { // Name of keyword - PvlKeyword label(line.Token(" =").ToQt()); // Stop on spaces OR equal sign + PvlKeyword label(line.Token(" =")); // Stop on spaces OR equal sign // Remove up to beginning of data line.TrimHead(" ="); line.TrimTail(" "); if (label.name() == "COMMENT" || label.name() == "HISTORY") { - label += line.ToQt(); + label += line; } else { // Check for a quoted value if (line.substr(0,1) == "'") { line.TrimHead("'"); - label += line.Token("'").TrimHead(" ").TrimTail(" ").ToQt(); + label += line.Token("'").TrimHead(" ").TrimTail(" "); line.TrimHead(" '"); } else { @@ -212,16 +212,16 @@ namespace Isis { IString value = line.Token("/"); // Clear to end of data value.TrimTail(" "); - label += value.ToQt(); + label += value; line.TrimHead(" "); } // If the line still has anything in it, treat it is as a comment. if (line.size() > 0) { line.TrimHead(" /"); - label.addComment(line.ToQt()); + label.addComment(line); // A possible format for units, other possiblites exist. if (line != line.Token("[")) { - label.setUnits(line.Token("[").Token("]").ToQt()); + label.setUnits(line.Token("[").Token("]")); } } } diff --git a/isis/src/hayabusa/apps/nirs2isis/main.cpp b/isis/src/hayabusa/apps/nirs2isis/main.cpp index c27747d652..cc4cc92b4d 100644 --- a/isis/src/hayabusa/apps/nirs2isis/main.cpp +++ b/isis/src/hayabusa/apps/nirs2isis/main.cpp @@ -40,7 +40,7 @@ void IsisMain() { Pvl label; processPDS.SetPdsFile (detachedLabel.expanded(), "", label); - QString fitsImage = detachedLabel.path() + "/" + (QString) label.findKeyword("^COMBINED_SPECTRUM"); + QString fitsImage = detachedLabel.path() + "/" + QString::fromStdString(label.findKeyword("^COMBINED_SPECTRUM")); FileName fitsFile(fitsImage); NirsImportFits fits(fitsFile, "FitsLabel"); label += fits.label(); @@ -49,9 +49,9 @@ void IsisMain() { QString axis1Length; QString axis2Length; try { - axisCount = (QString) label.findKeyword ("NAXIS", PvlObject::Traverse); - axis1Length = (QString) label.findKeyword ("NAXIS1", PvlObject::Traverse); - axis2Length = (QString) label.findKeyword ("NAXIS2", PvlObject::Traverse); + axisCount = QString::fromStdString(label.findKeyword ("NAXIS", PvlObject::Traverse)); + axis1Length = QString::fromStdString(label.findKeyword ("NAXIS1", PvlObject::Traverse)); + axis2Length = QString::fromStdString(label.findKeyword ("NAXIS2", PvlObject::Traverse)); } catch (IException &e) { QString msg = "Unable to read [NAXIS], [NAXIS1] or [NAXIS2] " @@ -156,16 +156,16 @@ void IsisMain() { PvlKeyword filterNumber("FilterNumber"); PvlKeyword center("Center"); for (int channelNumber = 1; channelNumber <= 64; channelNumber++) { - filterNumber += toString( channelNumber ); - center += toString( 2.27144 - 0.02356 * (65 - channelNumber) ); + filterNumber += std::to_string( channelNumber ); + center += std::to_string( 2.27144 - 0.02356 * (65 - channelNumber) ); } newLabel.findGroup("BandBin", Pvl::Traverse).addKeyword(filterNumber); newLabel.findGroup("BandBin", Pvl::Traverse).addKeyword(center); newLabel.findGroup("BandBin", Pvl::Traverse).findKeyword("Width").setUnits("micrometers"); // Create YearDoy keyword in Archive group - iTime stime(newLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0]); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + iTime stime(QString::fromStdString(newLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0])); + PvlKeyword yeardoy("YearDoy", std::to_string(stime.Year()*1000 + stime.DayOfYear())); newLabel.findGroup("Archive", Pvl::Traverse).addKeyword(yeardoy); // Add the instrument, band bin, archive, mission data, and kernels diff --git a/isis/src/hayabusa/objs/HayabusaAmicaCamera/HayabusaAmicaCamera.cpp b/isis/src/hayabusa/objs/HayabusaAmicaCamera/HayabusaAmicaCamera.cpp index ad25cfacda..cbca56b377 100644 --- a/isis/src/hayabusa/objs/HayabusaAmicaCamera/HayabusaAmicaCamera.cpp +++ b/isis/src/hayabusa/objs/HayabusaAmicaCamera/HayabusaAmicaCamera.cpp @@ -38,7 +38,7 @@ namespace Isis { NaifStatus::CheckErrors(); Pvl &lab = *cube.label(); // Get the camera characteristics - QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["Name"]; + QString filter = QString::fromStdString((lab.findGroup("BandBin", Pvl::Traverse))["Name"]); filter = filter.toUpper(); SetFocalLength(); // Retrives from IK stored in units of meters @@ -51,7 +51,7 @@ namespace Isis { PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); // set variables startTime and exposureDuration - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); iTime etStart = getClockTime(stime); double exposureDuration = ((double) inst["ExposureDuration"]); diff --git a/isis/src/hayabusa/objs/HayabusaNirsCamera/HayabusaNirsCamera.cpp b/isis/src/hayabusa/objs/HayabusaNirsCamera/HayabusaNirsCamera.cpp index aff2b188c2..7059d4ce04 100644 --- a/isis/src/hayabusa/objs/HayabusaNirsCamera/HayabusaNirsCamera.cpp +++ b/isis/src/hayabusa/objs/HayabusaNirsCamera/HayabusaNirsCamera.cpp @@ -47,8 +47,8 @@ namespace Isis { PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); // get the start and stop times - QString startTime = inst["SpacecraftClockStartCount"]; - QString stopTime = inst["SpacecraftClockStopCount"]; + QString startTime = QString::fromStdString(inst["SpacecraftClockStartCount"]); + QString stopTime = QString::fromStdString(inst["SpacecraftClockStopCount"]); iTime etStart = getClockTime(startTime); iTime etStop = getClockTime(stopTime); diff --git a/isis/src/hayabusa2/apps/hyb2onccal/main.cpp b/isis/src/hayabusa2/apps/hyb2onccal/main.cpp index 70d3ae08b1..154358e957 100644 --- a/isis/src/hayabusa2/apps/hyb2onccal/main.cpp +++ b/isis/src/hayabusa2/apps/hyb2onccal/main.cpp @@ -131,7 +131,7 @@ void IsisMain() { PvlGroup &inst = icube->group("Instrument"); PvlGroup &bandbin = icube->group("BandBin"); - QString filter = bandbin["FilterName"]; + QString filter = QString::fromStdString(bandbin["FilterName"]); g_filter = filter; @@ -156,11 +156,11 @@ void IsisMain() { throw IException(e, IException::Io,msg, _FILEINFO_); } - QString instrumentId = inst["InstrumentId"]; + QString instrumentId = QString::fromStdString(inst["InstrumentId"]); QString oncCCDTemperature = "ONC"; try { oncCCDTemperature += instrumentId.section('-',1,1) + "CCDTemperature"; - g_temp = inst[oncCCDTemperature]; + g_temp = inst[oncCCDTemperature.toStdString()]; } catch(IException &e) { QString msg = "Unable to read [" + oncCCDTemperature + "] keyword in the Instrument group " @@ -169,17 +169,17 @@ void IsisMain() { } - QString startTime = inst["SpacecraftClockStartCount"]; + QString startTime = QString::fromStdString(inst["SpacecraftClockStartCount"]); g_startTime = startTime; nsubImages = inst["SubImageCount"]; // If > 1, some correction is not needed/performed - QString compmode = inst["Compression"]; + QString compmode = QString::fromStdString(inst["Compression"]); // TODO: verify that the compression factor/scale is actually 16 for compressed Hayabusa2 images. g_compfactor = ( "lossy" == compmode.toLower() ) ? 16.0 : 1.0; - QString target = inst["TargetName"]; + QString target = QString::fromStdString(inst["TargetName"]); g_target = target; @@ -294,31 +294,31 @@ void IsisMain() { // Log calibration activity performed so far PvlGroup calibrationLog("RadiometricCalibration"); - calibrationLog.addKeyword(PvlKeyword("SoftwareName", hyb2cal_program)); - calibrationLog.addKeyword(PvlKeyword("SoftwareVersion", hyb2cal_version)); - calibrationLog.addKeyword(PvlKeyword("ProcessDate", hyb2cal_runtime)); - calibrationLog.addKeyword(PvlKeyword("CalibrationFile", calfile)); - calibrationLog.addKeyword(PvlKeyword("FlatFieldFile", flatfile.originalPath() - + "/" + flatfile.name())); - calibrationLog.addKeyword(PvlKeyword("CompressionFactor", toString(g_compfactor, 2))); + calibrationLog.addKeyword(PvlKeyword("SoftwareName", hyb2cal_program.toStdString())); + calibrationLog.addKeyword(PvlKeyword("SoftwareVersion", hyb2cal_version.toStdString())); + calibrationLog.addKeyword(PvlKeyword("ProcessDate", hyb2cal_runtime.toStdString())); + calibrationLog.addKeyword(PvlKeyword("CalibrationFile", calfile.toStdString())); + calibrationLog.addKeyword(PvlKeyword("FlatFieldFile", flatfile.originalPath().toStdString() + + "/" + flatfile.name().toStdString())); + calibrationLog.addKeyword(PvlKeyword("CompressionFactor", toString(g_compfactor, 2).toStdString())); // Parameters PvlKeyword key("Bias_Bn"); - key.addValue(std::to_string(g_b0, 8)); - key.addValue(std::to_string(g_b1, 8)); - key.addValue(std::to_string(g_b2, 8)); + key.addValue(toString(g_b0, 8).toStdString()); + key.addValue(toString(g_b1, 8).toStdString()); + key.addValue(toString(g_b2, 8).toStdString()); calibrationLog.addKeyword(key); - calibrationLog.addKeyword(PvlKeyword("Bias", toString(g_bias, 16), "DN")); + calibrationLog.addKeyword(PvlKeyword("Bias", toString(g_bias, 16).toStdString(), "DN")); // calibrationLog.addKeyword(PvlKeyword("Smear_Tvct", toString(g_Tvct, 16))); - calibrationLog.addKeyword(PvlKeyword("CalibrationUnits", g_iofCorrection)); - calibrationLog.addKeyword(PvlKeyword("RadianceStandard", toString(g_v_standard, 16))); - calibrationLog.addKeyword(PvlKeyword("RadianceScaleFactor", toString(g_iofScale, 16))); - calibrationLog.addKeyword(PvlKeyword("SolarDistance", toString(g_solarDist, 16), "AU")); - calibrationLog.addKeyword(PvlKeyword("SolarFlux", toString(g_solarFlux, 16))); - calibrationLog.addKeyword(PvlKeyword("IOFFactor", toString(g_iof, 16))); - calibrationLog.addKeyword(PvlKeyword("Units", g_units)); + calibrationLog.addKeyword(PvlKeyword("CalibrationUnits", g_iofCorrection.toStdString())); + calibrationLog.addKeyword(PvlKeyword("RadianceStandard", toString(g_v_standard, 16).toStdString())); + calibrationLog.addKeyword(PvlKeyword("RadianceScaleFactor", toString(g_iofScale, 16).toStdString())); + calibrationLog.addKeyword(PvlKeyword("SolarDistance", toString(g_solarDist, 16).toStdString(), "AU")); + calibrationLog.addKeyword(PvlKeyword("SolarFlux", toString(g_solarFlux, 16).toStdString())); + calibrationLog.addKeyword(PvlKeyword("IOFFactor", toString(g_iof, 16).toStdString())); + calibrationLog.addKeyword(PvlKeyword("Units", g_units.toStdString())); // Write Calibration group to output file ocube->putGroup(calibrationLog); @@ -360,7 +360,7 @@ QString loadCalibrationVariables(const QString &config) { if ( config.contains("?") ) calibFile = calibFile.highestVersion(); // Pvl configFile; - g_configFile.read(calibFile.expanded()); + g_configFile.read(calibFile.expanded().toStdString()); // Load the groups PvlGroup &Bias = g_configFile.findGroup("Bias"); @@ -373,20 +373,20 @@ QString loadCalibrationVariables(const QString &config) { // g_Tvct = Smear["Tvct"]; // Load DarkCurrent variables - g_d0 = DarkCurrent["D"][0].toDouble(); - g_d1 = DarkCurrent["D"][1].toDouble(); + g_d0 = std::stod(DarkCurrent["D"][0]); + g_d1 = std::stod(DarkCurrent["D"][1]); // Load Bias variables - g_b0 = Bias["B"][0].toDouble(); - g_b1 = Bias["B"][1].toDouble(); - g_b2 = Bias["B"][2].toDouble(); + g_b0 = std::stod(Bias["B"][0]); + g_b1 = std::stod(Bias["B"][1]); + g_b2 = std::stod(Bias["B"][2]); // Compute BIAS correction factor (it's a constant so do it once!) g_bias = g_b0 + g_b1 * g_AEtemperature + g_b2 * (g_AEtemperature * g_AEtemperature); std::cout << "bias: " << g_bias << std::endl; // Load the Solar Flux for the specific filter - g_solarFlux = solar[g_filter.toLower()]; + g_solarFlux = solar[g_filter.toLower().toStdString()]; // radiance = g_v_standard * g_iofScale // iof = radiance * pi *dist_au^2 diff --git a/isis/src/hayabusa2/objs/Hyb2OncCamera/Hyb2OncCamera.cpp b/isis/src/hayabusa2/objs/Hyb2OncCamera/Hyb2OncCamera.cpp index e390a89d18..e9af02857e 100644 --- a/isis/src/hayabusa2/objs/Hyb2OncCamera/Hyb2OncCamera.cpp +++ b/isis/src/hayabusa2/objs/Hyb2OncCamera/Hyb2OncCamera.cpp @@ -66,7 +66,7 @@ namespace Isis { PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); // set variables startTime and exposureDuration - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); iTime etStart = getClockTime(stime); double exposureDuration = ((double) inst["ExposureDuration"]); diff --git a/isis/src/juno/apps/junocam2isis/main.cpp b/isis/src/juno/apps/junocam2isis/main.cpp index 23f9cfacc0..e674e0d352 100644 --- a/isis/src/juno/apps/junocam2isis/main.cpp +++ b/isis/src/juno/apps/junocam2isis/main.cpp @@ -161,14 +161,14 @@ void IsisMain() { // Update the labels Pvl *fullFrameLabel = g_outputCubes[i]->label(); fullFrameLabel->findGroup("Instrument", PvlObject::Traverse) - .addKeyword(PvlKeyword("FrameNumber", toString(i+1))); + .addKeyword(PvlKeyword("FrameNumber", std::to_string(i+1))); PvlGroup &bandBin = fullFrameLabel->findGroup("BandBin", PvlObject::Traverse); bandBin.addKeyword(PvlKeyword("FilterName", "FULLCCD"), PvlObject::Replace); // Add filter-specific code to band bin Group - bandBin.addKeyword(PvlKeyword("NaifIkCode", toString(spacecraftCode))); + bandBin.addKeyword(PvlKeyword("NaifIkCode", std::to_string(spacecraftCode))); importPds.WriteHistory(*g_outputCubes[i]); g_outputCubes[i]->write(origLabels); @@ -182,7 +182,7 @@ void IsisMain() { int numSubimages = importPds.Lines() / g_frameletLines; int frameletsPerFilter = numSubimages / g_filterList.size(); outputLabel.findGroup("Instrument", PvlObject::Traverse) - .addKeyword(PvlKeyword("NumberFramelets", toString(frameletsPerFilter))); + .addKeyword(PvlKeyword("NumberFramelets", std::to_string(frameletsPerFilter))); // get output file name and remove cube extension, if entered FileName outputFileName(ui.GetCubeName("TO")); @@ -255,12 +255,12 @@ void IsisMain() { int frameNumber = (i / g_filterList.size()) + 1; Pvl *frameletLabel = g_outputCubes[i]->label(); frameletLabel->findGroup("Instrument", PvlObject::Traverse) - .addKeyword(PvlKeyword("FrameNumber", toString(frameNumber))); + .addKeyword(PvlKeyword("FrameNumber", std::to_string(frameNumber))); int filterIndex = i % g_filterList.size(); QString filterName = g_filterList[filterIndex]; PvlGroup &bandBin = frameletLabel->findGroup("BandBin", PvlObject::Traverse); - bandBin.addKeyword(PvlKeyword("FilterName", filterName), + bandBin.addKeyword(PvlKeyword("FilterName", filterName.toStdString()), PvlObject::Replace); if (filterName.compare("BLUE", Qt::CaseInsensitive) == 0) { @@ -276,7 +276,7 @@ void IsisMain() { spacecraftCode = -61504; } // Add filter-specific code to band bin Group - bandBin.addKeyword(PvlKeyword("NaifIkCode", toString(spacecraftCode))); + bandBin.addKeyword(PvlKeyword("NaifIkCode", std::to_string(spacecraftCode))); importPds.WriteHistory(*g_outputCubes[i]); g_outputCubes[i]->write(origLabels); @@ -310,8 +310,8 @@ void translateLabel(Pvl &inputLabel, Pvl &outputLabel) { "i.e. start time for FrameNumber 1."); inst["SpacecraftClockStartCount"].addComment("Start count for the entire observation, " "i.e. start count for FrameNumber 1."); - QString instId = (QString) inst.findKeyword("InstrumentId"); - QString spcName = (QString) inst.findKeyword("SpacecraftName"); + QString instId = QString::fromStdString(inst.findKeyword("InstrumentId")); + QString spcName = QString::fromStdString(inst.findKeyword("SpacecraftName")); if (spcName.compare("JUNO", Qt::CaseInsensitive) != 0 || instId.compare("JNC", Qt::CaseInsensitive) != 0) { @@ -328,10 +328,10 @@ void translateLabel(Pvl &inputLabel, Pvl &outputLabel) { PvlToPvlTranslationManager bandBinXlater(inputLabel, bandBinTransFile.expanded()); bandBinXlater.Auto(outputLabel); PvlGroup &bandBin = outputLabel.findGroup("BandBin", PvlObject::Traverse); - QString filter = (QString) bandBin.findKeyword("FilterName"); + QString filter = QString::fromStdString(bandBin.findKeyword("FilterName")); // COMPUTE FRAMELET SIZE - QString summingKey = outputLabel.findKeyword("SummingMode", PvlObject::Traverse)[0]; + QString summingKey = QString::fromStdString(outputLabel.findKeyword("SummingMode", PvlObject::Traverse)[0]); if (summingKey.compare("1") != 0 && summingKey.compare("2") != 0) { QString msg = "Invalid summing mode [" + summingKey + "], expected [1] or [2]."; @@ -344,7 +344,7 @@ void translateLabel(Pvl &inputLabel, Pvl &outputLabel) { g_filterList.clear(); PvlKeyword filterKey = outputLabel.findKeyword("FilterName", PvlObject::Traverse); for (int i = 0; i < filterKey.size(); i++) { - g_filterList.append(filterKey[i]); + g_filterList.append(QString::fromStdString(filterKey[i])); } // Translate the Archive group @@ -352,21 +352,21 @@ void translateLabel(Pvl &inputLabel, Pvl &outputLabel) { PvlToPvlTranslationManager archiveXlater(inputLabel, archiveTransFile.expanded()); archiveXlater.Auto(outputLabel); PvlGroup &archive = outputLabel.findGroup("Archive", PvlObject::Traverse); - iTime startTime(inst["StartTime"][0]); - PvlKeyword yeardoy("YearDoy", toString(startTime.Year()*1000 + startTime.DayOfYear())); + iTime startTime(QString::fromStdString(inst["StartTime"][0])); + PvlKeyword yeardoy("YearDoy", std::to_string(startTime.Year()*1000 + startTime.DayOfYear())); archive.addKeyword(yeardoy); UserInterface &ui = Application::GetUserInterface(); // NOTE - This needs to be the complete base name of the output filter file, not as it // is here, which is just the base name of the input file. It should be moved the place // where the file is created with the full label in it. - PvlKeyword sourceProductId("SourceProductId", FileName(ui.GetFileName("FROM")).baseName()); + PvlKeyword sourceProductId("SourceProductId", FileName(ui.GetFileName("FROM")).baseName().toStdString()); archive.addKeyword(sourceProductId); // Setup the kernel group PvlGroup kern("Kernels"); int spacecraftCode = -61500; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", std::to_string(spacecraftCode)); outputLabel.findObject("IsisCube").addGroup(kern); } diff --git a/isis/src/juno/objs/JunoCamera/JunoCamera.cpp b/isis/src/juno/objs/JunoCamera/JunoCamera.cpp index 7e70f33054..23d858f71f 100644 --- a/isis/src/juno/objs/JunoCamera/JunoCamera.cpp +++ b/isis/src/juno/objs/JunoCamera/JunoCamera.cpp @@ -74,7 +74,7 @@ namespace Isis { // Set starting filter location on the detector const PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse); - QString filterIkCode = bandBin.findKeyword("NaifIkCode")[0]; + QString filterIkCode = QString::fromStdString(bandBin.findKeyword("NaifIkCode")[0]); detMap->SetStartingDetectorLine(getDouble("INS" + filterIkCode + "_FILTER_OFFSET")); // Set up distortion map, keeping z-direction positive JunoDistortion map defaults to z+ @@ -86,7 +86,7 @@ namespace Isis { new CameraSkyMap(this); // Set time based on clock count, frame number, exposure duration, and interframe delay - QString startClockCount = inst["SpacecraftClockStartCount"]; + QString startClockCount = QString::fromStdString(inst["SpacecraftClockStartCount"]); double observationStartEt = getClockTime(startClockCount).Et(); // in seconds double frameNumber = (double) inst["FrameNumber"]; double interFrameDelay = (double) inst["InterFrameDelay"]; // in seconds diff --git a/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp b/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp index 498b04b43d..fc174f937c 100644 --- a/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp +++ b/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp @@ -31,7 +31,7 @@ namespace Isis { FileName inFile = ui.GetFileName("FROM"); QString id; - Pvl lab(inFile.expanded()); + Pvl lab(inFile.expanded().toStdString()); if (lab.hasObject("IMAGE_MAP_PROJECTION")) { QString msg = "Unsupported projected file [" + inFile.expanded() + "]"; @@ -39,7 +39,7 @@ namespace Isis { } try { - id = (QString) lab.findKeyword("DATA_SET_ID"); + id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); } catch(IException &e) { QString msg = "Unable to read [DATA_SET_ID] from input file [" + @@ -74,7 +74,7 @@ namespace Isis { // Get the directory where the Kaguya MI translation tables are. QString transDir = "$ISISROOT/appdata/translations/"; - Pvl inputLabel(inFile.expanded()); + Pvl inputLabel(inFile.expanded().toStdString()); Pvl *outputLabel = outcube->label(); FileName transFile; @@ -92,20 +92,20 @@ namespace Isis { QString timeString; //StartTime PvlKeyword &startTimeKeyword=instGroup["StartTime"]; - timeString = startTimeKeyword[0]; - startTimeKeyword.setValue( timeString.mid(0,timeString.lastIndexOf("Z")) ); + timeString = QString::fromStdString(startTimeKeyword[0]); + startTimeKeyword.setValue( timeString.mid(0,timeString.lastIndexOf("Z")).toStdString() ); //StartTimeRaw PvlKeyword &startTimeRawKeyword=instGroup["StartTimeRaw"]; - timeString = startTimeRawKeyword[0]; - startTimeRawKeyword.setValue( timeString.mid(0,timeString.lastIndexOf("Z")) ); + timeString = QString::fromStdString(startTimeRawKeyword[0]); + startTimeRawKeyword.setValue( timeString.mid(0,timeString.lastIndexOf("Z")).toStdString() ); //StopTime PvlKeyword &stopTimeKeyword=instGroup["StopTime"]; - timeString = stopTimeKeyword[0]; - stopTimeKeyword.setValue( timeString.mid(0,timeString.lastIndexOf("Z")) ); + timeString = QString::fromStdString(stopTimeKeyword[0]); + stopTimeKeyword.setValue( timeString.mid(0,timeString.lastIndexOf("Z")).toStdString() ); //StopTimeRaw PvlKeyword &stopTimeRawKeyword=instGroup["StopTimeRaw"]; - timeString = stopTimeRawKeyword[0]; - stopTimeRawKeyword.setValue( timeString.mid(0,timeString.lastIndexOf("Z")) ); + timeString = QString::fromStdString(stopTimeRawKeyword[0]); + stopTimeRawKeyword.setValue( timeString.mid(0,timeString.lastIndexOf("Z")).toStdString() ); // Translate the BandBin group @@ -115,18 +115,18 @@ namespace Isis { //Set up the Kernels group PvlGroup kern("Kernels"); - QString baseBand = lab.findKeyword("BASE_BAND")[0]; + QString baseBand = QString::fromStdString(lab.findKeyword("BASE_BAND")[0]); if (lab.findKeyword("INSTRUMENT_ID")[0] == "MI-VIS") { if (baseBand.contains("MV")) { - kern += PvlKeyword("NaifFrameCode", toString(-13133) + baseBand[2]); + kern += PvlKeyword("NaifFrameCode", (toString(-13133) + baseBand[2]).toStdString()); } - kern += PvlKeyword("NaifCkCode", toString(-131330)); + kern += PvlKeyword("NaifCkCode", std::to_string(-131330)); } else if (lab.findKeyword("INSTRUMENT_ID")[0] == "MI-NIR") { if (baseBand.contains("MN")) { - kern += PvlKeyword("NaifFrameCode", toString(-13134) + baseBand[2]); + kern += PvlKeyword("NaifFrameCode", (toString(-13134) + baseBand[2]).toStdString()); } - kern += PvlKeyword("NaifCkCode", toString(-131340)); + kern += PvlKeyword("NaifCkCode", std::to_string(-131340)); } //At the time of this writing there was no expectation that Kaguya ever did any binning diff --git a/isis/src/kaguya/apps/kaguyatc2isis/kaguyatc2isis.cpp b/isis/src/kaguya/apps/kaguyatc2isis/kaguyatc2isis.cpp index d90d4c1de3..b1c10ade54 100644 --- a/isis/src/kaguya/apps/kaguyatc2isis/kaguyatc2isis.cpp +++ b/isis/src/kaguya/apps/kaguyatc2isis/kaguyatc2isis.cpp @@ -23,11 +23,11 @@ namespace Isis { ProcessImportPds importPds; FileName inFile = ui.GetFileName("FROM"); QString labelFile = inFile.expanded(); - Pvl label(labelFile); + Pvl label(labelFile.toStdString()); QString dataFile = ""; if ( inFile.extension().toLower() == "lbl" ) { - dataFile = inFile.path() + "/" + (QString) label.findKeyword("FILE_NAME"); + dataFile = inFile.path() + "/" + QString::fromStdString(label.findKeyword("FILE_NAME")); } else { dataFile = labelFile; @@ -35,7 +35,7 @@ namespace Isis { QString id = ""; try { - id = (QString) label.findKeyword("DATA_SET_ID"); + id = QString::fromStdString(label.findKeyword("DATA_SET_ID")); } catch(IException &e) { QString msg = "Unable to read [DATA_SET_ID] from label file [" @@ -125,19 +125,19 @@ namespace Isis { if (inst.hasKeyword("StartTime")) { // Remove trailing "Z" from keyword PvlKeyword &startTime = inst["StartTime"]; - QString startTimeString = startTime[0]; + QString startTimeString = QString::fromStdString(startTime[0]); if (QString::compare(startTimeString.at(startTimeString.size() - 1), "Z", Qt::CaseInsensitive) == 0){ startTimeString = startTimeString.left(startTimeString.length() - 1); - startTime.setValue(startTimeString); + startTime.setValue(startTimeString.toStdString()); } } if (inst.hasKeyword("StopTime")) { // Remove trailing "Z" from keyword PvlKeyword &stopTime = inst["StopTime"]; - QString stopTimeString = stopTime[0]; + QString stopTimeString = QString::fromStdString(stopTime[0]); if (QString::compare(stopTimeString.at(stopTimeString.size() - 1), "Z", Qt::CaseInsensitive) == 0){ stopTimeString = stopTimeString.left(stopTimeString.length() - 1); - stopTime.setValue(stopTimeString); + stopTime.setValue(stopTimeString.toStdString()); } } outcube->putGroup(otherLabels.findGroup("Instrument")); diff --git a/isis/src/kaguya/apps/mimap2isis/mimap2isis.cpp b/isis/src/kaguya/apps/mimap2isis/mimap2isis.cpp index 4b21d9fb93..875fbd7d27 100644 --- a/isis/src/kaguya/apps/mimap2isis/mimap2isis.cpp +++ b/isis/src/kaguya/apps/mimap2isis/mimap2isis.cpp @@ -22,18 +22,18 @@ namespace Isis { Pvl label; QString labelFile = ui.GetFileName("FROM"); - label.read(labelFile); + label.read(labelFile.toStdString()); // The Kaguya MI MAP files have an incorrect SAMPLE_PROJECTION_OFFSET // keyword value in their labels. The following code creates a temporary // detached PDS label with the correct (negated) keyword value. PvlObject obj = label.findObject("IMAGE_MAP_PROJECTION"); - double soff = toDouble(obj.findKeyword("SAMPLE_PROJECTION_OFFSET")[0]); + double soff = std::stod(obj.findKeyword("SAMPLE_PROJECTION_OFFSET")[0]); soff = -soff; - label.findObject("IMAGE_MAP_PROJECTION").addKeyword(PvlKeyword("SAMPLE_PROJECTION_OFFSET",toString(soff)),Pvl::Replace); + label.findObject("IMAGE_MAP_PROJECTION").addKeyword(PvlKeyword("SAMPLE_PROJECTION_OFFSET",std::to_string(soff)),Pvl::Replace); FileName tempFileName = FileName::createTempFile("TEMPORARYlabel.pvl").name(); QString fn(tempFileName.expanded()); - label.write(fn); + label.write(fn.toStdString()); QString imageFile(""); QString datafile = labelFile; diff --git a/isis/src/kaguya/objs/KaguyaMiCamera/KaguyaMiCamera.cpp b/isis/src/kaguya/objs/KaguyaMiCamera/KaguyaMiCamera.cpp index ffd0e28e1e..eafb6d3e8b 100644 --- a/isis/src/kaguya/objs/KaguyaMiCamera/KaguyaMiCamera.cpp +++ b/isis/src/kaguya/objs/KaguyaMiCamera/KaguyaMiCamera.cpp @@ -67,7 +67,7 @@ namespace Isis { // Get the start time from labels Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = (QString)inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); SpiceDouble etStart=0; if(stime != "NULL") { diff --git a/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp b/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp index 8aa594bf04..5c8384ec23 100644 --- a/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp +++ b/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp @@ -45,7 +45,7 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); - QString clockCount = inst["SpacecraftClockStartCount"]; + QString clockCount = QString::fromStdString(inst["SpacecraftClockStartCount"]); double time = getClockTime(clockCount, -1, true).Et(); // Setup detector map @@ -55,7 +55,7 @@ namespace Isis { LineScanCameraDetectorMap *detectorMap = new LineScanCameraDetectorMap(this, time, lineRate); // Detetermine what to set the starting detector sample to, based on swath mode - QString swathMode = inst["SwathModeId"]; + QString swathMode = QString::fromStdString(inst["SwathModeId"]); double startingDetectorSample = 1; if (swathMode.compare("FULL") == 0) { diff --git a/isis/src/lo/apps/lo2isis/lo2isis.cpp b/isis/src/lo/apps/lo2isis/lo2isis.cpp index 76e85244cc..64551d6254 100644 --- a/isis/src/lo/apps/lo2isis/lo2isis.cpp +++ b/isis/src/lo/apps/lo2isis/lo2isis.cpp @@ -26,7 +26,7 @@ namespace Isis{ FileName in = ui.GetCubeName("FROM"); //Checks if in file is rdr - label = in.expanded(); + label = in.expanded().toStdString(); if(label.hasObject("IMAGE_MAP_PROJECTION")) { QString msg = "[" + in.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; @@ -48,14 +48,14 @@ namespace Isis{ // Transfer the instrument group to the output cube QString transDir = "$ISISROOT/appdata/translations/"; - Pvl inputLabel(labelFile.expanded()); + Pvl inputLabel(labelFile.expanded().toStdString()); FileName transFile; FileName bandBinTransFile; bool hasFiducial = false; // Check to see if file is PDS if(inputLabel.hasKeyword("PDS_VERSION_ID", Pvl::None)) { - QString pdsVersion = inputLabel.findKeyword("PDS_VERSION_ID", Pvl::None)[0]; + QString pdsVersion = QString::fromStdString(inputLabel.findKeyword("PDS_VERSION_ID", Pvl::None)[0]); if(pdsVersion == "PDS3") { if(inputLabel.hasKeyword("LO:FIDUCIAL_ID", Pvl::Traverse)) { @@ -105,11 +105,11 @@ namespace Isis{ //Creates FiducialCoordinateMicron with the proper units if(!inputLabel.hasKeyword("LO:BORESIGHT_SAMPLE", Pvl::Traverse)) { - QString fcm = (QString) inst.findKeyword("FiducialCoordinateMicron"); + QString fcm = QString::fromStdString(inst.findKeyword("FiducialCoordinateMicron")); QString fcmUnits = fcm; fcmUnits.remove(QRegExp("^[0-9.]*")); fcm.remove(QRegExp("[a-zA-Z]*$")); - inst.findKeyword("FiducialCoordinateMicron").setValue(fcm, fcmUnits); + inst.findKeyword("FiducialCoordinateMicron").setValue(fcm.toStdString(), fcmUnits.toStdString()); } // High Resolution & Fiducial Medium Case @@ -143,8 +143,8 @@ namespace Isis{ //What needs to be done if it contains Boresight info } - QString instrumentID = inst.findKeyword("InstrumentId"); - QString spacecraftName = inst.findKeyword("SpacecraftName"); + QString instrumentID = QString::fromStdString(inst.findKeyword("InstrumentId")); + QString spacecraftName = QString::fromStdString(inst.findKeyword("SpacecraftName")); //Determines the NaifFrameCode PvlGroup kerns("Kernels"); @@ -167,14 +167,14 @@ namespace Isis{ } //Create subframe and frame keywords - QString imgNumber = (QString) inst.findKeyword("ImageNumber"); + QString imgNumber = QString::fromStdString(inst.findKeyword("ImageNumber")); int subFrame = toInt(imgNumber.mid(5)); - inst.addKeyword(PvlKeyword("SubFrame", toString(subFrame))); + inst.addKeyword(PvlKeyword("SubFrame", std::to_string(subFrame))); //ImageNumber is auto translated, and no longer needed inst.deleteKeyword("ImageNumber"); - kerns += PvlKeyword("NaifFrameCode", frameCode); + kerns += PvlKeyword("NaifFrameCode", frameCode.toStdString()); outputLabel->findObject("IsisCube").addGroup(kerns); return; diff --git a/isis/src/lo/apps/lopdsgen/main.cpp b/isis/src/lo/apps/lopdsgen/main.cpp index d09f348953..4ce1c703ca 100644 --- a/isis/src/lo/apps/lopdsgen/main.cpp +++ b/isis/src/lo/apps/lopdsgen/main.cpp @@ -81,7 +81,7 @@ void IsisMain() { FileName outFileNoExt(ui.GetFileName("TO")); outFileNoExt = outFileNoExt.removeExtension(); QString productID(outFileNoExt.baseName()); - PvlKeyword productId("PRODUCT_ID", productID.toUpper()); + PvlKeyword productId("PRODUCT_ID", productID.toUpper().toStdString()); pdsLabel.addKeyword(productId); // Translate the keywords from the original labels that go in this label @@ -109,15 +109,15 @@ void IsisMain() { PvlKeyword &scanDensityRange = ingestion.findKeyword("SCAN_DENSITY_RANGE"); // Change the units of SCAN_RESOLUTION from "um" to "" - QString scanResolutionStr = scanResolution[0]; + QString scanResolutionStr = QString::fromStdString(scanResolution[0]); int umPos = scanResolutionStr.indexOf("um"); QString resolution = scanResolutionStr.mid(0, umPos); - scanResolution[0] = resolution; + scanResolution[0] = resolution.toStdString(); scanResolution.setUnits("micron"); scanResolution.setName("LO:FILMSTRIP_SCAN_RESOLUTION"); // Break keyword SCAN_DENSITY_RANGE into two different parts - QString scanDensityRangeStr = scanDensityRange[0]; + QString scanDensityRangeStr = QString::fromStdString(scanDensityRange[0]); int toPos = scanDensityRangeStr.indexOf("_TO_"); QString range1 = scanDensityRangeStr.mid(0, toPos); QString range2 = scanDensityRangeStr.mid(toPos + 4); @@ -139,10 +139,10 @@ void IsisMain() { PvlKeyword &outputMicron = qube.findKeyword("OUTPUT_MICRON"); // Change the units of OUTPUT_MICRON from "um" to "" - QString outputMicronStr = outputMicron[0]; + QString outputMicronStr = QString::fromStdString(outputMicron[0]); umPos = outputMicronStr.indexOf("um"); resolution = outputMicronStr.mid(0, umPos); - outputMicron[0] = resolution; + outputMicron[0] = resolution.toStdString(); outputMicron.setUnits("micron"); outputMicron.setName("LO:FILMSTRIP_SCAN_PROCESSING_RES"); @@ -151,8 +151,8 @@ void IsisMain() { // Calculate statistics on the cube to be processed and place // its MINIMUM and MAXIMUM into the output label p.CalculateStatistics(); - pdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("MINIMUM", toString(p.CubeStatistics(0)->Minimum())), Pvl::Replace); - pdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("MAXIMUM", toString(p.CubeStatistics(0)->Maximum())), Pvl::Replace); + pdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("MINIMUM", std::to_string(p.CubeStatistics(0)->Minimum())), Pvl::Replace); + pdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("MAXIMUM", std::to_string(p.CubeStatistics(0)->Maximum())), Pvl::Replace); } else { FileName inputFile(ui.GetCubeName("FROM")); @@ -188,10 +188,10 @@ void IsisMain() { // Change the units of FIDCUAIL_COORDINATE_MICRON from "um" to "" PvlKeyword &coordMicron = iCube->label()->findKeyword( "FiducialCoordinateMicron", Pvl::Traverse); - QString coordMicronStr = coordMicron[0]; + QString coordMicronStr = QString::fromStdString(coordMicron[0]); int umPos = coordMicronStr.indexOf("um"); QString coord = coordMicronStr.mid(0, umPos); - coordMicron[0] = coord; + coordMicron[0] = coord.toStdString(); coordMicron.setUnits("micron"); coordMicron.setName("LO:FIDUCIAL_COORDINATE_MICRON"); @@ -216,22 +216,22 @@ void IsisMain() { strftime(timestr, 80, "%Y-%m-%dT%H:%M:%S", tmbuf); QString dateTime = (QString) timestr; iTime tmpDateTime(dateTime); - pdsLabel += PvlKeyword("PRODUCT_CREATION_TIME", tmpDateTime.UTC()); + pdsLabel += PvlKeyword("PRODUCT_CREATION_TIME", tmpDateTime.UTC().toStdString()); if(ui.WasEntered("NOTE")) { - pdsLabel.addKeyword(PvlKeyword("NOTE", ui.GetString("NOTE")), Pvl::Replace); + pdsLabel.addKeyword(PvlKeyword("NOTE", ui.GetString("NOTE").toStdString()), Pvl::Replace); } // Add a keyword type (i.e., QString, bool, int...) file to the PDS label Pvl PvlFormatPds *formatter = new PvlFormatPds(); formatter->setCharLimit(128); - formatter->add(transDir + "LoExportFormatter.typ"); + formatter->add(transDir.toStdString() + "LoExportFormatter.typ"); pdsLabel.setFormat(formatter); // Add an output format template (group, object, & keyword output order) to // the PDS PVL QString formatDir = "$ISISROOT/appdata/translations/"; - pdsLabel.setFormatTemplate(formatDir + "LoExportTemplate.pft"); + pdsLabel.setFormatTemplate(formatDir.toStdString() + "LoExportTemplate.pft"); // Write labels to output file FileName outFile(ui.GetFileName("TO", "img")); diff --git a/isis/src/lo/objs/LoCameraFiducialMap/LoCameraFiducialMap.cpp b/isis/src/lo/objs/LoCameraFiducialMap/LoCameraFiducialMap.cpp index d75987f28a..ed771ce6c9 100644 --- a/isis/src/lo/objs/LoCameraFiducialMap/LoCameraFiducialMap.cpp +++ b/isis/src/lo/objs/LoCameraFiducialMap/LoCameraFiducialMap.cpp @@ -61,10 +61,10 @@ namespace Isis { PvlKeyword &fYs = inst["FiducialYCoordinates"]; for(int i = 0; i < fSamps.size(); i++) { - p_fidSamples.push_back(toDouble(fSamps[i])); - p_fidLines.push_back(toDouble(fLines[i])); - p_fidXCoords.push_back(toDouble(fXs[i])); - p_fidYCoords.push_back(toDouble(fYs[i])); + p_fidSamples.push_back(std::stod(fSamps[i])); + p_fidLines.push_back(std::stod(fLines[i])); + p_fidXCoords.push_back(std::stod(fXs[i])); + p_fidYCoords.push_back(std::stod(fYs[i])); } } catch(IException &e) { diff --git a/isis/src/lo/objs/LoHighCamera/LoHighCamera.cpp b/isis/src/lo/objs/LoHighCamera/LoHighCamera.cpp index 1e7bd943b0..bbdd92f399 100644 --- a/isis/src/lo/objs/LoHighCamera/LoHighCamera.cpp +++ b/isis/src/lo/objs/LoHighCamera/LoHighCamera.cpp @@ -66,8 +66,8 @@ namespace Isis { // Get the Instrument label information needed to define the camera for this frame Pvl &lab = *cube.label(); PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); - QString spacecraft = (QString)inst["SpacecraftName"]; - QString instId = (QString)inst["InstrumentId"]; + QString spacecraft = QString::fromStdString(inst["SpacecraftName"]); + QString instId = QString::fromStdString(inst["InstrumentId"]); // Turn off the aberration corrections for the instrument position object instrumentPosition()->SetAberrationCorrection("NONE"); @@ -77,7 +77,7 @@ namespace Isis { SetPixelPitch(); // Get the start time in et - double time = iTime((QString)inst["StartTime"]).Et(); + double time = iTime(QString::fromStdString(inst["StartTime"])).Et(); // Setup focal plane map LoCameraFiducialMap fid(inst, naifIkCode()); diff --git a/isis/src/lo/objs/LoMediumCamera/LoMediumCamera.cpp b/isis/src/lo/objs/LoMediumCamera/LoMediumCamera.cpp index 87c022a611..8ad41dd2f7 100644 --- a/isis/src/lo/objs/LoMediumCamera/LoMediumCamera.cpp +++ b/isis/src/lo/objs/LoMediumCamera/LoMediumCamera.cpp @@ -68,8 +68,8 @@ namespace Isis { // Get the Instrument label information needed to define the camera for this frame Pvl &lab = *cube.label(); PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); - QString spacecraft = inst["SpacecraftName"]; - QString instId = inst["InstrumentId"]; + QString spacecraft = QString::fromStdString(inst["SpacecraftName"]); + QString instId = QString::fromStdString(inst["InstrumentId"]); LoMediumCamera::FocalPlaneMapType type; if(inst.hasKeyword("FiducialSamples")) { @@ -92,7 +92,7 @@ namespace Isis { SetPixelPitch(); // Get the start time in et - double time = iTime((QString)inst["StartTime"]).Et(); + double time = iTime(QString::fromStdString(inst["StartTime"])).Et(); // Setup focal plane map if(type == Fiducial) { diff --git a/isis/src/lro/apps/lronac2isis/lronac2isis.cpp b/isis/src/lro/apps/lronac2isis/lronac2isis.cpp index d24d3ba0a8..5a63e7df71 100644 --- a/isis/src/lro/apps/lronac2isis/lronac2isis.cpp +++ b/isis/src/lro/apps/lronac2isis/lronac2isis.cpp @@ -44,9 +44,9 @@ namespace Isis { FileName inFile = ui.GetFileName("FROM"); QString id; try { - Pvl lab(inFile.expanded()); + Pvl lab(inFile.expanded().toStdString()); if(lab.hasKeyword("DATA_SET_ID")) - id = (QString) lab.findKeyword("DATA_SET_ID"); + id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); else { QString msg = "Unable to read [DATA_SET_ID] from input file [" + inFile.expanded() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -70,12 +70,12 @@ namespace Isis { } for(int i = 0; i < xtermKeyword.size(); i++) { - g_xterm.push_back(toDouble(xtermKeyword[i])); - g_mterm.push_back(toDouble(mtermKeyword[i])); - g_bterm.push_back(toDouble(btermKeyword[i])); + g_xterm.push_back(std::stod(xtermKeyword[i])); + g_mterm.push_back(std::stod(mtermKeyword[i])); + g_bterm.push_back(std::stod(btermKeyword[i])); } - double versionId = toDouble(lab.findKeyword("PRODUCT_VERSION_ID")[0].remove(QRegExp("^v"))); + double versionId = std::stod(QString::fromStdString(lab.findKeyword("PRODUCT_VERSION_ID")[0]).remove(QRegExp("^v"))); if(lab.findKeyword("FRAME_ID")[0] == "RIGHT" && versionId < 1.30) g_flip = true; else @@ -193,7 +193,7 @@ namespace Isis { //Pvl to store the labels Pvl outLabel; //Set up the directory where the translations are - Pvl labelPvl(labelFile.expanded()); + Pvl labelPvl(labelFile.expanded().toStdString()); //Translate the Instrument group FileName transFile("$ISISROOT/appdata/translations/LroNacInstrument.trn"); @@ -210,7 +210,7 @@ namespace Isis { PvlToPvlTranslationManager bandBinXlater(labelPvl, transFile.expanded()); bandBinXlater.Auto(outLabel); - Pvl lab(labelFile.expanded()); + Pvl lab(labelFile.expanded().toStdString()); //Set up the Kernels group PvlGroup kern("Kernels"); diff --git a/isis/src/lro/apps/lronac2pds/lronac2pds.cpp b/isis/src/lro/apps/lronac2pds/lronac2pds.cpp index cc9eb2c1e6..d19064f987 100644 --- a/isis/src/lro/apps/lronac2pds/lronac2pds.cpp +++ b/isis/src/lro/apps/lronac2pds/lronac2pds.cpp @@ -201,18 +201,18 @@ namespace Isis { // Update the "IMAGE" Object PvlObject &imageObject = labelPvl.findObject("IMAGE"); imageObject.clear(); - imageObject += PvlKeyword("LINES", toString(cube->lineCount())); - imageObject += PvlKeyword("LINE_SAMPLES", toString(cube->sampleCount())); + imageObject += PvlKeyword("LINES", std::to_string(cube->lineCount())); + imageObject += PvlKeyword("LINE_SAMPLES", std::to_string(cube->sampleCount())); if (g_isIof) { - imageObject += PvlKeyword("SAMPLE_BITS", toString(16)); + imageObject += PvlKeyword("SAMPLE_BITS", std::to_string(16)); imageObject += PvlKeyword("SAMPLE_TYPE", "LSB_INTEGER"); - imageObject += PvlKeyword("SCALING_FACTOR", toString(1.0 / SCALING_FACTOR)); - imageObject += PvlKeyword("VALID_MINIMUM", toString(Isis::VALID_MIN2)); - imageObject += PvlKeyword("NULL", toString(Isis::NULL2)); - imageObject += PvlKeyword("LOW_REPR_SATURATION", toString(Isis::LOW_REPR_SAT2)); - imageObject += PvlKeyword("LOW_INSTR_SATURATION", toString(Isis::LOW_INSTR_SAT2)); - imageObject += PvlKeyword("HIGH_INSTR_SATURATION", toString(Isis::HIGH_INSTR_SAT2)); - imageObject += PvlKeyword("HIGH_REPR_SATURATION", toString(Isis::HIGH_REPR_SAT2)); + imageObject += PvlKeyword("SCALING_FACTOR", std::to_string(1.0 / SCALING_FACTOR)); + imageObject += PvlKeyword("VALID_MINIMUM", std::to_string(Isis::VALID_MIN2)); + imageObject += PvlKeyword("NULL", std::to_string(Isis::NULL2)); + imageObject += PvlKeyword("LOW_REPR_SATURATION", std::to_string(Isis::LOW_REPR_SAT2)); + imageObject += PvlKeyword("LOW_INSTR_SATURATION", std::to_string(Isis::LOW_INSTR_SAT2)); + imageObject += PvlKeyword("HIGH_INSTR_SATURATION", std::to_string(Isis::HIGH_INSTR_SAT2)); + imageObject += PvlKeyword("HIGH_REPR_SATURATION", std::to_string(Isis::HIGH_REPR_SAT2)); imageObject += PvlKeyword("UNIT", "Scaled I/F"); } else { @@ -226,20 +226,20 @@ namespace Isis { imageObject += PvlKeyword("HIGH_REPR_SATURATION", "16#FF7FFFFF#"); imageObject += PvlKeyword("UNIT", "W / (m**2 micrometer sr)"); } - imageObject += PvlKeyword("MD5_CHECKSUM", g_md5Checksum); + imageObject += PvlKeyword("MD5_CHECKSUM", g_md5Checksum.toStdString()); stream << labelPvl; int recordBytes = cube->sampleCount(); int labelRecords = (int) ((stream.str().length()) / recordBytes) + 1; - labelPvl["RECORD_BYTES"] = toString(recordBytes); + labelPvl["RECORD_BYTES"] = std::to_string(recordBytes); if (g_isIof) - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 2 + labelRecords)); + labelPvl["FILE_RECORDS"] = std::to_string((int) (cube->lineCount() * 2 + labelRecords)); else - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords)); - labelPvl["LABEL_RECORDS"] = toString(labelRecords); - labelPvl["^IMAGE"] = toString((int) (labelRecords + 1)); + labelPvl["FILE_RECORDS"] = std::to_string((int) (cube->lineCount() * 4 + labelRecords)); + labelPvl["LABEL_RECORDS"] = std::to_string(labelRecords); + labelPvl["^IMAGE"] = std::to_string((int) (labelRecords + 1)); stream.str(std::string()); @@ -251,9 +251,9 @@ namespace Isis { while ((int)pdsLabel.length() + 2 > (int)(labelRecords * recordBytes)) { labelRecords++; // Refresh the label content - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords)); - labelPvl["LABEL_RECORDS"] = toString(labelRecords); - labelPvl["^IMAGE"] = toString((int) (labelRecords + 1)); + labelPvl["FILE_RECORDS"] = std::to_string((int) (cube->lineCount() * 4 + labelRecords)); + labelPvl["LABEL_RECORDS"] = std::to_string(labelRecords); + labelPvl["^IMAGE"] = std::to_string((int) (labelRecords + 1)); stream.str(std::string()); stream << labelPvl; pdsLabel = stream.str().c_str(); diff --git a/isis/src/lro/apps/lronaccal/lronaccal.cpp b/isis/src/lro/apps/lronaccal/lronaccal.cpp index 95aaa47245..ffc479b179 100644 --- a/isis/src/lro/apps/lronaccal/lronaccal.cpp +++ b/isis/src/lro/apps/lronaccal/lronaccal.cpp @@ -123,11 +123,11 @@ namespace Isis { g_radiometric = ui.GetBoolean("RADIOMETRIC"); g_iof = (ui.GetString("RADIOMETRICTYPE") == "IOF"); - Isis::Pvl lab(ui.GetCubeName("FROM")); + Isis::Pvl lab(ui.GetCubeName("FROM").toStdString()); Isis::PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); // Check if it is a NAC image - QString instId = (QString) inst["InstrumentId"]; + QString instId = QString::fromStdString(inst["InstrumentId"]); instId = instId.toUpper(); if(instId != "NACL" && instId != "NACR") { QString msg = "This is not a NAC image. lrocnaccal requires a NAC image."; @@ -179,7 +179,7 @@ namespace Isis { QString msg = maskedFile + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } - Pvl maskedPvl(maskedFileName.expanded()); + Pvl maskedPvl(maskedFileName.expanded().toStdString()); PvlKeyword maskedPixels; int cutoff; if(g_summed) { @@ -192,10 +192,10 @@ namespace Isis { } for(int i = 0; i < maskedPixels.size(); i++) - if((g_isLeftNac && toInt(maskedPixels[i]) < cutoff) || (!g_isLeftNac && toInt(maskedPixels[i]) > cutoff)) - g_maskedPixelsLeft.push_back(toInt(maskedPixels[i])); + if((g_isLeftNac && std::stoi(maskedPixels[i]) < cutoff) || (!g_isLeftNac && std::stoi(maskedPixels[i]) > cutoff)) + g_maskedPixelsLeft.push_back(std::stoi(maskedPixels[i])); else - g_maskedPixelsRight.push_back(toInt(maskedPixels[i])); + g_maskedPixelsRight.push_back(std::stoi(maskedPixels[i])); } vector darkFiles; @@ -228,7 +228,7 @@ namespace Isis { } else { QString darkFile; - g_imgTime = iTime(inst["StartTime"][0]).Et(); + g_imgTime = iTime(QString::fromStdString(inst["StartTime"][0])).Et(); GetCalibrationDirectory("nac_darks", darkFile); darkFile = darkFile + instId + "_AverageDarks_*T"; @@ -303,10 +303,10 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } - Pvl radPvl(radFileName.expanded()); + Pvl radPvl(radFileName.expanded().toStdString()); if(g_iof) { - iTime startTime((QString) inst["StartTime"]); + iTime startTime(QString::fromStdString(inst["StartTime"])); try { Camera *cam; @@ -363,9 +363,9 @@ namespace Isis { if(g_masked) { PvlKeyword darkColumns("DarkColumns"); for(unsigned int i = 0; i < g_maskedPixelsLeft.size(); i++) - darkColumns += toString(g_maskedPixelsLeft[i]); + darkColumns += std::to_string(g_maskedPixelsLeft[i]); for(unsigned int i = 0; i < g_maskedPixelsRight.size(); i++) - darkColumns += toString(g_maskedPixelsRight[i]); + darkColumns += std::to_string(g_maskedPixelsRight[i]); calgrp += darkColumns; } @@ -385,8 +385,8 @@ namespace Isis { } if(g_nonlinear) { - calgrp += PvlKeyword("NonlinearOffset", offsetFile); - calgrp += PvlKeyword("LinearizationCoefficients", coefficientFile); + calgrp += PvlKeyword("NonlinearOffset", offsetFile.toStdString()); + calgrp += PvlKeyword("LinearizationCoefficients", coefficientFile.toStdString()); } if(g_flatfield) @@ -395,18 +395,18 @@ namespace Isis { if(g_iof) { calgrp += PvlKeyword("RadiometricType", "IOF"); if(g_isLeftNac) - calgrp += PvlKeyword("ResponsivityValue", toString(g_iofLeft)); + calgrp += PvlKeyword("ResponsivityValue", std::to_string(g_iofLeft)); else - calgrp += PvlKeyword("ResponsivityValue", toString(g_iofRight)); + calgrp += PvlKeyword("ResponsivityValue", std::to_string(g_iofRight)); } else { calgrp += PvlKeyword("RadiometricType", "AbsoluteRadiance"); if(g_isLeftNac) - calgrp += PvlKeyword("ResponsivityValue", toString(g_radianceLeft)); + calgrp += PvlKeyword("ResponsivityValue", std::to_string(g_radianceLeft)); else - calgrp += PvlKeyword("ResponsivityValue", toString(g_radianceRight)); + calgrp += PvlKeyword("ResponsivityValue", std::to_string(g_radianceRight)); } - calgrp += PvlKeyword("SolarDistance", toString(g_solarDistance)); + calgrp += PvlKeyword("SolarDistance", std::to_string(g_solarDistance)); } oCube->putGroup(calgrp); diff --git a/isis/src/lro/apps/lronacpho/lronacpho.cpp b/isis/src/lro/apps/lronacpho/lronacpho.cpp index ae0fae026b..9c9bed1048 100644 --- a/isis/src/lro/apps/lronacpho/lronacpho.cpp +++ b/isis/src/lro/apps/lronacpho/lronacpho.cpp @@ -103,7 +103,7 @@ namespace Isis{ throw IException(IException::User, msg, _FILEINFO_); } - Pvl params(algoFileName.expanded()); + Pvl params(algoFileName.expanded().toStdString()); algoName = PhotometricFunction::algorithmName(params); algoName = algoName.toUpper(); diff --git a/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp b/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp index 5168728ba5..c5260b75db 100644 --- a/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp +++ b/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp @@ -85,7 +85,7 @@ namespace Isis { } } - QString instModeId = pdsLab["INSTRUMENT_MODE_ID"]; + QString instModeId = QString::fromStdString(pdsLab["INSTRUMENT_MODE_ID"]); // this will be used to convert num input lines to num output lines, // only changed for when both uv and vis exist (varying summing) @@ -222,7 +222,7 @@ namespace Isis { OriginalLabel origLabel(pdsLab); int numFramelets = padding.size(); - PvlKeyword numFrameletsKeyword("NumFramelets", toString(numFramelets)); + PvlKeyword numFrameletsKeyword("NumFramelets", std::to_string(numFramelets)); if(uveven) { for(int grp = 0; grp < isis3UvEvenLab.groups(); grp++) { @@ -495,10 +495,10 @@ namespace Isis { // color offset doesn't apply to BW mode (single band cubes) if(colorOffset && viseven && viseven->bandCount() == 1) { - genericInstrument.push_back(PvlKeyword("ColorOffset", QString::number(0))); + genericInstrument.push_back(PvlKeyword("ColorOffset", std::to_string(0))); } else { - genericInstrument.push_back(PvlKeyword("ColorOffset", toString(colorOffset))); + genericInstrument.push_back(PvlKeyword("ColorOffset", std::to_string(colorOffset))); } genericInstrument.push_back(PvlKeyword("Decompanded", (ui.GetBoolean("UNLUT") ? "Yes" : "No"))); @@ -520,16 +520,16 @@ namespace Isis { // add labels unique to particular files if(viseven) { visEvenInst.addKeyword(PvlKeyword("Framelets", "Even")); - visEvenInst.addKeyword(PvlKeyword("NumFramelets", toString(viseven->lineCount() / 14))); + visEvenInst.addKeyword(PvlKeyword("NumFramelets", std::to_string(viseven->lineCount() / 14))); visEvenInst.addKeyword(PvlKeyword("InstrumentId", "WAC-VIS"), Pvl::Replace); - visEvenInst.addKeyword(PvlKeyword("InstrumentModeId", (QString) pdsLab["INSTRUMENT_MODE_ID"])); + visEvenInst.addKeyword(PvlKeyword("InstrumentModeId", pdsLab["INSTRUMENT_MODE_ID"])); } if(visodd) { visOddInst.addKeyword(PvlKeyword("Framelets", "Odd")); - visOddInst.addKeyword(PvlKeyword("NumFramelets", toString(visodd->lineCount() / 14))); + visOddInst.addKeyword(PvlKeyword("NumFramelets", std::to_string(visodd->lineCount() / 14))); visOddInst.addKeyword(PvlKeyword("InstrumentId", "WAC-VIS"), Pvl::Replace); - visOddInst.addKeyword(PvlKeyword("InstrumentModeId", (QString) pdsLab["INSTRUMENT_MODE_ID"])); + visOddInst.addKeyword(PvlKeyword("InstrumentModeId", pdsLab["INSTRUMENT_MODE_ID"])); } // **TEMPORARY. This should be done by a translation table. @@ -549,7 +549,7 @@ namespace Isis { } else { for(int i = 0; i < pdsLab["FILTER_NUMBER"].size(); i++) { - if(toInt(pdsLab["FILTER_NUMBER"][i]) > 2) { + if(std::stoi(pdsLab["FILTER_NUMBER"][i]) > 2) { visWavelength += pdsLab["CENTER_FILTER_WAVELENGTH"][i]; visFilterNum += pdsLab["FILTER_NUMBER"][i]; @@ -577,16 +577,16 @@ namespace Isis { if(uveven) { uvEvenInst.addKeyword(PvlKeyword("Framelets", "Even")); - uvEvenInst.addKeyword(PvlKeyword("NumFramelets", toString(uveven->lineCount() / 4))); + uvEvenInst.addKeyword(PvlKeyword("NumFramelets", std::to_string(uveven->lineCount() / 4))); uvEvenInst.addKeyword(PvlKeyword("InstrumentId", "WAC-UV"), Pvl::Replace); - uvEvenInst.addKeyword(PvlKeyword("InstrumentModeId", (QString) pdsLab["INSTRUMENT_MODE_ID"])); + uvEvenInst.addKeyword(PvlKeyword("InstrumentModeId", pdsLab["INSTRUMENT_MODE_ID"])); } if(uvodd) { uvOddInst.addKeyword(PvlKeyword("Framelets", "Odd")); - uvOddInst.addKeyword(PvlKeyword("NumFramelets", toString(uvodd->lineCount() / 4))); + uvOddInst.addKeyword(PvlKeyword("NumFramelets", std::to_string(uvodd->lineCount() / 4))); uvOddInst.addKeyword(PvlKeyword("InstrumentId", "WAC-UV"), Pvl::Replace); - uvOddInst.addKeyword(PvlKeyword("InstrumentModeId", (QString) pdsLab["INSTRUMENT_MODE_ID"])); + uvOddInst.addKeyword(PvlKeyword("InstrumentModeId", pdsLab["INSTRUMENT_MODE_ID"])); } // Translate the BandBin group @@ -742,10 +742,10 @@ namespace Isis { bool found = false; bool match = false; for(int j = 0; !found && j < (int) filters.size(); j++) { - if(toInt(pdsLab["FILTER_NUMBER"][i]) == filters[j].first) { + if(std::stoi(pdsLab["FILTER_NUMBER"][i]) == filters[j].first) { found = true; - match = (pdsLab["CENTER_FILTER_WAVELENGTH"][i] == filters[j].second); + match = (pdsLab["CENTER_FILTER_WAVELENGTH"][i] == filters[j].second.toStdString()); } } @@ -778,7 +778,7 @@ namespace Isis { PvlKeyword &orbitNumber = pdsLab["ORBIT_NUMBER"]; QRegExp integerRegex("[0-9]+"); - if(orbitNumber.size() != 1 || !integerRegex.exactMatch(orbitNumber[0])) { + if(orbitNumber.size() != 1 || !integerRegex.exactMatch(QString::fromStdString(orbitNumber[0]))) { QString msg = "The value of keyword [ORBIT_NUMBER] is not valid"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -797,7 +797,7 @@ namespace Isis { }; for(unsigned int i = 0; i < sizeof(numericKeywords) / sizeof(QString); i++) { - if(pdsLab[numericKeywords[i]].size() != 1 || !numberRegex.exactMatch(pdsLab[numericKeywords[i]][0])) { + if(pdsLab[numericKeywords[i].toStdString()].size() != 1 || !numberRegex.exactMatch(QString::fromStdString(pdsLab[numericKeywords[i].toStdString()][0]))) { QString msg = "The value of keyword ["; msg += numericKeywords[i]; msg += "] is not valid"; @@ -813,7 +813,7 @@ namespace Isis { }; for(unsigned int i = 0; i < sizeof(timeKeywords) / sizeof(QString); i++) { - if(pdsLab[timeKeywords[i]].size() != 1 || !timeRegex.exactMatch(pdsLab[timeKeywords[i]][0])) { + if(pdsLab[timeKeywords[i].toStdString()].size() != 1 || !timeRegex.exactMatch(QString::fromStdString(pdsLab[timeKeywords[i].toStdString()][0]))) { QString msg = "The value of keyword ["; msg += timeKeywords[i]; msg += "] is not valid"; @@ -829,7 +829,7 @@ namespace Isis { }; for(unsigned int i = 0; i < sizeof(clockKeywords) / sizeof(QString); i++) { - if(pdsLab[clockKeywords[i]].size() != 1 || !clockRegex.exactMatch(pdsLab[clockKeywords[i]][0])) { + if(pdsLab[clockKeywords[i].toStdString()].size() != 1 || !clockRegex.exactMatch(QString::fromStdString(pdsLab[clockKeywords[i].toStdString()][0]))) { QString msg = "The value of keyword ["; msg += clockKeywords[i]; msg += "] is not valid"; diff --git a/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp b/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp index 5fe5436b8e..56ab24a26f 100644 --- a/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp +++ b/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp @@ -87,12 +87,12 @@ namespace Isis { for (int i = 0; i < list.size(); i++) { Pvl tempPvl; - tempPvl.read(list[i].toString()); + tempPvl.read(list[i].toString().toStdString()); OriginalLabel origLab(list[i].toString()); pdsLab = origLab.ReturnLabels(); - QString prodId = pdsLab["PRODUCT_ID"][0]; + QString prodId = QString::fromStdString(pdsLab["PRODUCT_ID"][0]); if (productId == "") productId = prodId; @@ -103,9 +103,9 @@ namespace Isis { } Isis::PvlGroup &inst = tempPvl.findGroup("Instrument", Pvl::Traverse); - QString instId = (QString) inst["InstrumentId"]; - QString framelets = (QString) inst["Framelets"]; - QString numFrames = inst["NumFramelets"]; + QString instId = QString::fromStdString(inst["InstrumentId"]); + QString framelets = QString::fromStdString(inst["Framelets"]); + QString numFrames = QString::fromStdString(inst["NumFramelets"]); if (instId != "WAC-VIS" && instId != "WAC-UV") { QString msg = "This program is intended for use on LROC WAC images only. ["; @@ -113,12 +113,12 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } - QString instModeId = (QString) inst["InstrumentModeId"]; + QString instModeId = QString::fromStdString(inst["InstrumentModeId"]); if (instrumentModeId == "") instrumentModeId = instModeId; if (numFramelets == 0) numFramelets = toInt(numFrames); - g_isIoF = tempPvl.findGroup("Radiometry", Pvl::Traverse).findKeyword("RadiometricType")[0].toUpper() == "IOF"; + g_isIoF = QString::fromStdString(tempPvl.findGroup("Radiometry", Pvl::Traverse).findKeyword("RadiometricType")[0]).toUpper() == "IOF"; if (instId == "WAC-VIS" && framelets == "Even") { viseven = new Cube(); @@ -390,37 +390,37 @@ namespace Isis { QString unit = ""; if (labelPvl[outLabel[i].name()].unit() != "") { hasUnit = true; - unit = labelPvl[outLabel[i].name()].unit(); + unit = QString::fromStdString(labelPvl[outLabel[i].name()].unit()); } bool hasComment = false; QString comment = ""; if (labelPvl[outLabel[i].name()].comments() > 0) { hasComment = true; - comment = labelPvl[outLabel[i].name()].comment(0); + comment = QString::fromStdString(labelPvl[outLabel[i].name()].comment(0)); } labelPvl[outLabel[i].name()] = outLabel[i]; if (hasUnit) - labelPvl[outLabel[i].name()].setUnits(unit); + labelPvl[outLabel[i].name()].setUnits(unit.toStdString()); if (hasComment) - labelPvl[outLabel[i].name()].addComment(comment); + labelPvl[outLabel[i].name()].addComment(comment.toStdString()); } //Update the product ID - QString prod_id = labelPvl["PRODUCT_ID"][0]; + QString prod_id = QString::fromStdString(labelPvl["PRODUCT_ID"][0]); labelPvl["PRODUCT_ID"][0].replace((prod_id.length()-1), 1, "C"); // Update the product creation time - labelPvl["PRODUCT_CREATION_TIME"].setValue(iTime::CurrentGMT()); + labelPvl["PRODUCT_CREATION_TIME"].setValue(iTime::CurrentGMT().toStdString()); - labelPvl["PRODUCT_VERSION_ID"].setValue(g_productVersionId); + labelPvl["PRODUCT_VERSION_ID"].setValue(g_productVersionId.toStdString()); // Update the "IMAGE" Object PvlObject &imageObject = labelPvl.findObject("IMAGE"); imageObject.clear(); - imageObject += PvlKeyword("LINES", toString(cube->lineCount())); - imageObject += PvlKeyword("LINE_SAMPLES", toString(cube->sampleCount())); - imageObject += PvlKeyword("SAMPLE_BITS", toString(32)); + imageObject += PvlKeyword("LINES", std::to_string(cube->lineCount())); + imageObject += PvlKeyword("LINE_SAMPLES", std::to_string(cube->sampleCount())); + imageObject += PvlKeyword("SAMPLE_BITS", std::to_string(32)); imageObject += PvlKeyword("SAMPLE_TYPE", "PC_REAL"); imageObject += PvlKeyword("VALID_MINIMUM", "16#FF7FFFFA#"); imageObject += PvlKeyword("NULL", "16#FF7FFFFB#"); @@ -432,17 +432,17 @@ namespace Isis { imageObject += PvlKeyword("UNIT", "\"I/F\""); else imageObject += PvlKeyword("UNIT", "W / (m**2 micrometer sr)"); - imageObject += PvlKeyword("MD5_CHECKSUM", g_md5Checksum); + imageObject += PvlKeyword("MD5_CHECKSUM", g_md5Checksum.toStdString()); stream << labelPvl; int recordBytes = cube->sampleCount(); int labelRecords = (int) ((stream.str().length()) / recordBytes) + 1; - labelPvl["RECORD_BYTES"] = toString(recordBytes); - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords)); - labelPvl["LABEL_RECORDS"] = toString(labelRecords); - labelPvl["^IMAGE"] = toString((int) (labelRecords + 1)); + labelPvl["RECORD_BYTES"] = std::to_string(recordBytes); + labelPvl["FILE_RECORDS"] = std::to_string((int) (cube->lineCount() * 4 + labelRecords)); + labelPvl["LABEL_RECORDS"] = std::to_string(labelRecords); + labelPvl["^IMAGE"] = std::to_string((int) (labelRecords + 1)); stream.str(std::string()); @@ -455,9 +455,9 @@ namespace Isis { while ((int)pdsLabel.length() + 2 > (int)(labelRecords * recordBytes)) { labelRecords++; // Refresh the label content - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords)); - labelPvl["LABEL_RECORDS"] = toString(labelRecords); - labelPvl["^IMAGE"] = toString((int) (labelRecords + 1)); + labelPvl["FILE_RECORDS"] = std::to_string((int) (cube->lineCount() * 4 + labelRecords)); + labelPvl["LABEL_RECORDS"] = std::to_string(labelRecords); + labelPvl["^IMAGE"] = std::to_string((int) (labelRecords + 1)); stream.str(std::string()); stream << labelPvl; pdsLabel = stream.str().c_str(); diff --git a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp index 1b5112d5a1..1641dd7b4f 100644 --- a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp +++ b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp @@ -521,7 +521,7 @@ namespace Isis { auto GetCalibrationDirectory = [](QString calibrationType) -> QString { // Get the directory where the CISS calibration directories are. PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - QString missionDir = (QString) dataDir["LRO"]; + QString missionDir = QString::fromStdString(dataDir["LRO"]); if(calibrationType != "") { calibrationType += "/"; } @@ -538,7 +538,7 @@ namespace Isis { // Make sure it is a WAC cube Isis::PvlGroup &inst = icube->label()->findGroup("Instrument", Pvl::Traverse); - QString instId = (QString) inst["InstrumentId"]; + QString instId = QString::fromStdString(inst["InstrumentId"]); instId = instId.toUpper(); if (instId != "WAC-VIS" && instId != "WAC-UV") { QString msg = "This program is intended for use on LROC WAC images only. ["; @@ -558,12 +558,12 @@ namespace Isis { } // Determine the dark/flat files to use - QString offset = (QString) inst["BackgroundOffset"]; - QString mode = (QString) inst["Mode"]; - QString instModeId = (QString) inst["InstrumentModeId"]; + QString offset = QString::fromStdString(inst["BackgroundOffset"]); + QString mode = QString::fromStdString(inst["Mode"]); + QString instModeId = QString::fromStdString(inst["InstrumentModeId"]); instModeId = instModeId.toUpper(); - if (instModeId == "COLOR" && (QString) inst["InstrumentId"] == "WAC-UV") + if (instModeId == "COLOR" && QString::fromStdString(inst["InstrumentId"]) == "WAC-UV") instModeId = "UV"; else if (instModeId == "VIS") instModeId = "COLOR"; @@ -579,8 +579,8 @@ namespace Isis { } Isis::PvlGroup &bandBin = icube->label()->findGroup("BandBin", Pvl::Traverse); - QString filter = (QString) bandBin["Center"][0]; - QString filterNum = (QString) bandBin["FilterNumber"][0]; + QString filter = QString::fromStdString(bandBin["Center"][0]); + QString filterNum = QString::fromStdString(bandBin["FilterNumber"][0]); //We have to pay special attention incase we are passed a //single band image that has been "exploded" from a multiband wac if (instModeId == "COLOR" && g_bands.size() == 1) @@ -592,7 +592,7 @@ namespace Isis { if (darkFiles.size() == 0 || darkFiles[0] =="Default" || darkFiles[0].length() == 0) { darkFiles.resize(2); double temp = (double) inst["MiddleTemperatureFpa"]; - double time = iTime(inst["StartTime"][0]).Et(); + double time = iTime(QString::fromStdString(inst["StartTime"][0])).Et(); QString darkFile = GetCalibrationDirectory("wac_darks") + "WAC_" + instModeId; if (instModeId == "BW") darkFile += "_" + filter + "_Mode" + mode; @@ -647,25 +647,25 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } - Pvl radPvl(radFileName.expanded()); + Pvl radPvl(radFileName.expanded().toStdString()); if (g_iof) { responsivity = radPvl["IOF"]; for (int i = 0; i < bands.size(); i++) { - g_iofResponsivity.push_back(toDouble(responsivity[toInt(bands[i]) - 1])); + g_iofResponsivity.push_back(std::stod(responsivity[std::stoi(bands[i]) - 1])); } try { Camera *cam = NULL; cam = icube->camera(); - iTime startTime((QString) inst["StartTime"]); + iTime startTime(QString::fromStdString(inst["StartTime"])); cam->setTime(startTime); g_solarDistance = cam->sunToBodyDist() / KM_PER_AU; } catch(IException &e) { try { - iTime startTime((QString) inst["StartTime"]); + iTime startTime(QString::fromStdString(inst["StartTime"])); double etStart = startTime.Et(); // Get the distance between the Moon and the Sun at the given time in // Astronomical Units (AU) @@ -704,7 +704,7 @@ namespace Isis { else { responsivity = radPvl["Radiance"]; for (int i = 0; i < bands.size(); i++) - g_radianceResponsivity.push_back(toDouble(responsivity[toInt(bands[i]) - 1])); + g_radianceResponsivity.push_back(std::stod(responsivity[std::stoi(bands[i]) - 1])); } } @@ -735,11 +735,11 @@ namespace Isis { } Isis::PvlKeyword &bands = icube->label()->findGroup("BandBin", Pvl::Traverse).findKeyword("FilterNumber"); - Pvl tempPvl(tempFileName.expanded()); - temperaturePvl.addValue(tempFileName.expanded()); + Pvl tempPvl(tempFileName.expanded().toStdString()); + temperaturePvl.addValue(tempFileName.expanded().toStdString()); for (int b = 0; b < bands.size(); b++){ - g_TempratureConstants[g_bands[b]][0]=toDouble(tempPvl[bands[b]][0]); - g_TempratureConstants[g_bands[b]][1]=toDouble(tempPvl[bands[b]][1]); + g_TempratureConstants[g_bands[b]][0]=std::stod(tempPvl[bands[b]][0]); + g_TempratureConstants[g_bands[b]][1]=std::stod(tempPvl[bands[b]][1]); } } @@ -769,13 +769,13 @@ namespace Isis { } if (g_dark) { PvlKeyword darks("DarkFiles"); - darks.addValue(darkFiles[0]); + darks.addValue(QString::fromStdString(darkFiles[0])); if (darkFiles.size() > 1) - darks.addValue(darkFiles[1]); + darks.addValue(QString::fromStdString(darkFiles[1])); calgrp += darks; } if (g_flatfield) - calgrp += PvlKeyword("FlatFile", flatFile); + calgrp += PvlKeyword("FlatFile", flatFile.toStdString()); if (g_radiometric) { PvlKeyword vals("ResponsivityValues"); if (g_iof) { @@ -789,10 +789,10 @@ namespace Isis { vals.addValue(std::to_string(g_radianceResponsivity[i])); } calgrp += vals; - calgrp += PvlKeyword("SolarDistance", toString(g_solarDistance)); + calgrp += PvlKeyword("SolarDistance", std::to_string(g_solarDistance)); } if (g_specpix) - calgrp += PvlKeyword("SpecialPixelsFile", specpixFile); + calgrp += PvlKeyword("SpecialPixelsFile", specpixFile.toStdString()); ocube->putGroup(calgrp); delete g_darkCube1; diff --git a/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp b/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp index 626976ed09..0e37a53de0 100644 --- a/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp +++ b/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp @@ -79,7 +79,7 @@ namespace Isis { SpiceDouble etStart; if(stime != "NULL") { - etStart = getClockTime(stime).Et(); + etStart = getClockTime(QString::fromStdString(stime)).Et(); } else { etStart = iTime(QString::fromStdString(inst["PrerollTime"])).Et(); diff --git a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp index 8a672a7dc2..ee0b19c4ac 100644 --- a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp +++ b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp @@ -56,16 +56,16 @@ namespace Isis { // Get the ephemeris time from the labels double et; PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); et = getClockTime(stime).Et(); - p_exposureDur = toDouble(inst["ExposureDuration"]); + p_exposureDur = std::stod(inst["ExposureDuration"]); // TODO: Changed et - exposure to et + exposure. // Think about if this is correct p_etStart = et + ((p_exposureDur / 1000.0) / 2.0); // Compute the framelet size and number of framelets - QString instId = inst["InstrumentId"][0].toUpper(); + QString instId = QString::fromStdString(inst["InstrumentId"][0]).toUpper(); int frameletSize = 14; int sumMode = 1; @@ -108,7 +108,7 @@ namespace Isis { } // Is the data flipped? - bool dataflipped = (inst["DataFlipped"][0].toUpper() == "YES"); + bool dataflipped = (QString::fromStdString(inst["DataFlipped"][0]).toUpper() == "YES"); // Now create detector offsets QString instCode = "INS" + QString::number(naifIkCode()); @@ -148,15 +148,15 @@ namespace Isis { // Now map the actual filters that exist in cube to camera components or // storage vectors for later band selection (see SetBand(vband)) for (int i = 0; i < filtNames.size(); i++) { - if (!filterToDetectorOffset.exists(filtNames[i].toInt())) { - QString msg = "Unrecognized filter name [" + filtNames[i] + "]"; + if (!filterToDetectorOffset.exists(std::stoi(filtNames[i]))) { + std::string msg = "Unrecognized filter name [" + filtNames[i] + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } - p_detectorStartLines.push_back(filterToDetectorOffset.get(filtNames[i].toInt())); - p_frameletOffsets.push_back(filterToFrameletOffset.get(filtNames[i].toInt())); + p_detectorStartLines.push_back(filterToDetectorOffset.get(std::stoi(filtNames[i]))); + p_frameletOffsets.push_back(filterToFrameletOffset.get(std::stoi(filtNames[i]))); - QString kBase = "INS" + QString::number(filterIKCode.get(filtNames[i].toInt())); + QString kBase = "INS" + QString::number(filterIKCode.get(std::stoi(filtNames[i]))); p_focalLength.push_back(getDouble(kBase+"_FOCAL_LENGTH")); p_boreSightSample.push_back(getDouble(kBase+"_BORESIGHT_SAMPLE")); p_boreSightLine.push_back(getDouble(kBase+"_BORESIGHT_LINE")); @@ -175,11 +175,11 @@ namespace Isis { dmap->SetFrameletsGeometricallyFlipped(false); // get instrument-specific sample offset - QString instModeId = inst["InstrumentModeId"][0].toUpper(); + QString instModeId = QString::fromStdString(inst["InstrumentModeId"][0]).toUpper(); // For BW mode, add the mode (0,1 (non-polar) or 2,3 (polar)) used to // acquire image if (instModeId == "BW") { - instModeId += inst["Mode"][0]; + instModeId += QString::fromStdString(inst["Mode"][0]); // There are no offsets for BW mode.. there can only be 1 filter // and there must be 1 filter. p_frameletOffsets[0] = 0; @@ -194,12 +194,12 @@ namespace Isis { LroWideAngleCameraDistortionMap *distort = new LroWideAngleCameraDistortionMap(this, naifIkCode()); for ( int i = 0 ; i < filtNames.size() ; i++ ) { - fplane->addFilter(filterIKCode.get(filtNames[i].toInt())); - distort->addFilter(filterIKCode.get(filtNames[i].toInt())); + fplane->addFilter(filterIKCode.get(std::stoi(filtNames[i]))); + distort->addFilter(filterIKCode.get(std::stoi(filtNames[i]))); } // Setup the ground and sky map - bool evenFramelets = (inst["Framelets"][0].toUpper() == "EVEN"); + bool evenFramelets = (QString::fromStdString(inst["Framelets"][0]).toUpper() == "EVEN"); new PushFrameCameraGroundMap(this, evenFramelets); new CameraSkyMap(this); @@ -300,14 +300,14 @@ namespace Isis { if (nvals <= 0) { PvlObject NaifKeywords = getStoredNaifKeywords(); - if (!NaifKeywords.hasKeyword(key)){ + if (!NaifKeywords.hasKeyword(key.toStdString())){ QString mess = "Kernel pool keyword " + key + " not found!"; throw IException(IException::Programmer, mess, _FILEINFO_); } - PvlKeyword kw = NaifKeywords[key]; + PvlKeyword kw = NaifKeywords[key.toStdString()]; IntParameterList parms; for (int i = 0; i Date: Thu, 19 Oct 2023 12:39:17 -0700 Subject: [PATCH 54/95] Remove qt deps (#5313) * Added history comment. * Initial move to core * Removed Pvl cmakelists * Removed more cmakelists.txt * Add subdirectory * Fully modularized core * Fully modularized core * replaced PvlEditDialog that was accidentally removed in prev commit * Initial constants unit gtest * Fixed pvl core test config (#4349) * Fixed pvl core test config * Changed cmake_source to project_source for submodule * Fixed pvl core test config * Changed cmake_source to project_source for submodule * First working swig wrappers * Rebased off of pvl_core * Moved old ISIS unitTests into core (#4351) * First pass at old unitTests * re-removed old files * Slim down and unittest port * installing IsisPreferences * Fixed tests in a full build * Finished swig wrapper with some syntax sugar for ease of use in python (#4352) * Initial core deployment (#4355) * Updated preference files (#4354) * Reset main build and created core recipe Forgot meta.yaml Change where the build is pulling from Fixed qt requirement in core recipe Removed complier definition Turn swig build on * Changed pvl recipe url to point to usgsastro * Fixed typo * Removed a chunk of files that made it through the rebase (#4523) * Add Blob to core from base (#4525) * Fixed tests * Remove Blob from base * Pvl core Docs (#4536) * Small doc string changes * Fixed more doc strings and updated RTD configs * Added core docs * Removed path setup from config * Added subprocess import * Added back os import * Added breathe to env file * Maybe fix? * Added doxyfile * Trying doxygen change * Blob Swig Wrapper (#4613) * Moved wrapper under one package * Add pvl construction from reading a string, give access to blob internals * Updated meta.yaml to build isisio rather than isispvl * Post rebase fixes * Fixed app logging for all call able apps * Moved table reading/writing into core * Fixed missing license identifiers, and leftover merge conflict from rebase * Exposed error formatting and file line reporting flags on preference class * Updates IException to use the exposed Preference flags * Application handles adding program name to error * Removed unnecessary includes to classes outside of core * Removed tempFixtures include in core tests * Updates sources and includes for building * Moves necessary fixtures into core * Enforce that core unit tests use the test preferences * Removed commented Application::Name all * Initial round of test fixes * Fixed last 3 failing gtests * Fixed AppendAndLog function uses * Updated IException test truth data * Caught another missused AppendAndLog call * Fixed last failing gtest * Fixed output from getsn * Moved Endian into core * Remove additional 'm' extension for python 3.10 * Set version to 0.0.1 and clamped qt bellow 5.15 * Initial changes for isis pvl python interface * Fixed missed conflict in rebase * Removed prints causing test failures * QPair -> std::pair * removed QT from ArraySubscriptNotInRange * removed QT from Message::Keyword* * Updated MissingDelimiter.cpp and deps * Updated MemoryAllocFailed * compiling updates * PvlSequence updated * Updated table, tablefield, and tablerecord --------- Co-authored-by: Austin Sanders Co-authored-by: Austin Sanders Co-authored-by: Jesse Mapel Co-authored-by: acpaquette Co-authored-by: Stuart Sides --- isis/src/base/apps/camstats/camstats.cpp | 2 +- isis/src/core/src/PvlKeyword.cpp | 2 +- isis/src/core/src/PvlSequence.cpp | 4 ++-- isis/src/core/src/TableField.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/isis/src/base/apps/camstats/camstats.cpp b/isis/src/base/apps/camstats/camstats.cpp index 8123bffac7..d285c72fd8 100644 --- a/isis/src/base/apps/camstats/camstats.cpp +++ b/isis/src/base/apps/camstats/camstats.cpp @@ -192,7 +192,7 @@ namespace Isis { PvlGroup &group = statsPvl.group(i); int entry = 0; - record[entry] = group.name(); + record[entry] = group.name().toStdString(); entry++; for (int j = 0; j < group.keywords(); j++) { record[entry] = std::stod(group[j][0]); diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index ee63488edb..404a97c775 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -654,7 +654,7 @@ namespace Isis { if (j < (int) seq[i].size() - 1) temp += ", "; } temp += ")"; - this->operator+=(temp); + this->operator+=(QString::fromStdString(temp)); } return *this; diff --git a/isis/src/core/src/PvlSequence.cpp b/isis/src/core/src/PvlSequence.cpp index 83bb386a4c..7ecb55a4c9 100644 --- a/isis/src/core/src/PvlSequence.cpp +++ b/isis/src/core/src/PvlSequence.cpp @@ -22,7 +22,7 @@ namespace Isis { */ PvlSequence &PvlSequence::operator=(PvlKeyword &key) { for(int i = 0; i < key.size(); i++) { - this->operator+=(key[i]); + this->operator+=(key[i].toStdString()); } return *this; } @@ -42,7 +42,7 @@ namespace Isis { PvlKeyword &key = pvl["temp"]; std::vector temp; for(int i = 0; i < key.size(); i++) { - temp.push_back(key[i]); + temp.push_back(key[i].toStdString()); } p_sequence.push_back(temp); return *this; diff --git a/isis/src/core/src/TableField.cpp b/isis/src/core/src/TableField.cpp index ff0f473ead..6da42cf8a8 100644 --- a/isis/src/core/src/TableField.cpp +++ b/isis/src/core/src/TableField.cpp @@ -589,7 +589,7 @@ namespace Isis { */ PvlGroup TableField::pvlGroup() { PvlGroup group("Field"); - group += PvlKeyword("Name", m_name); + group += PvlKeyword("Name", QString::fromStdString(m_name)); if (m_type == TableField::Double) { group += PvlKeyword("Type", "Double"); } From 8c4d685a2cced3663ac79209724e32ca617be9c0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 16 Aug 2024 14:07:58 -0700 Subject: [PATCH 55/95] pvl remove qt changes --- isis/src/base/apps/camstats/camstats.cpp | 2 +- isis/src/base/apps/csminit/csminit.cpp | 2 +- isis/src/base/apps/maptemplate/main.cpp | 102 +++++++++--------- isis/src/base/apps/noproj/noproj.cpp | 4 +- isis/src/base/apps/photemplate/main.cpp | 42 ++++---- isis/src/base/apps/pvldiff/main.cpp | 58 +++++----- isis/src/base/apps/ringscam2map/main.cpp | 56 +++++----- isis/src/base/apps/skymap/main.cpp | 50 ++++----- isis/src/base/apps/skypt/skypt.cpp | 22 ++-- .../objs/CameraPointInfo/CameraPointInfo.cpp | 30 +++--- isis/src/base/objs/Spice/Spice.cpp | 2 +- isis/src/base/objs/Target/Target.cpp | 4 +- isis/src/cassini/apps/ciss2isis/ciss2isis.cpp | 4 +- isis/src/cassini/apps/vimscal/main.cpp | 20 ++-- .../clementine/objs/HiresCamera/unitTest.cpp | 2 +- .../clementine/objs/LwirCamera/unitTest.cpp | 2 +- .../clementine/objs/UvvisCamera/unitTest.cpp | 2 +- isis/src/control/apps/cnetdiff/cnetdiff.cpp | 44 ++++---- isis/src/control/apps/cnetedit/cnetedit.cpp | 20 ++-- isis/src/core/src/PvlKeyword.cpp | 2 +- isis/src/core/src/PvlSequence.cpp | 4 +- isis/src/core/src/TableField.cpp | 2 +- isis/src/dawn/objs/DawnFcCamera/unitTest.cpp | 2 +- isis/src/dev/apps/camcoeffs/main.cpp | 40 +++---- isis/src/galileo/objs/SsiCamera/unitTest.cpp | 2 +- isis/src/hayabusa/apps/hyb1pds4gen/main.cpp | 4 +- .../objs/HayabusaAmicaCamera/unitTest.cpp | 2 +- .../apps/hyb2onc2isis/hyb2onc2isis.cpp | 14 +-- .../hayabusa2/objs/Hyb2OncCamera/unitTest.cpp | 2 +- isis/src/juno/objs/JunoCamera/unitTest.cpp | 4 +- isis/src/kaguya/apps/kaguyasp2ascii/main.cpp | 90 ++++++++-------- isis/src/kaguya/apps/kaguyasp2isis/main.cpp | 72 ++++++------- isis/src/lo/objs/LoHighCamera/unitTest.cpp | 2 +- isis/src/lo/objs/LoMediumCamera/unitTest.cpp | 2 +- isis/src/lro/apps/lromakeflat/main.cpp | 18 ++-- isis/src/lro/apps/lronac2isis/lronac2isis.cpp | 2 +- isis/src/lro/apps/lronac2pds/lronac2pds.cpp | 16 +-- isis/src/lro/apps/lronaccal/lronaccal.cpp | 8 +- isis/src/lro/apps/lronacecho/main.cpp | 4 +- isis/src/lro/apps/lronacpho/LROCEmpirical.cpp | 20 ++-- isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp | 4 +- isis/src/lro/apps/lrowaccal/lrowaccal.cpp | 4 +- isis/src/lro/apps/lrowacpho/Exponential.cpp | 18 ++-- .../lro/apps/lrowacpho/HapkeExponential.cpp | 18 ++-- isis/src/lro/apps/lrowacpho/Hillier.cpp | 14 +-- isis/src/lro/apps/lrowacpho/main.cpp | 2 +- isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp | 34 +++--- isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp | 24 ++--- .../lro/apps/lrowacphomap/lrowacphomap.cpp | 2 +- isis/src/lro/apps/mrf2isis/main.cpp | 14 +-- isis/src/lro/apps/mrf2pds/main.cpp | 28 ++--- .../PhotometricFunction.cpp | 2 +- isis/src/mariner/apps/mar102isis/main.cpp | 46 ++++---- isis/src/mariner/apps/mar10cal/main.cpp | 20 ++-- isis/src/mariner/apps/mar10clean/main.cpp | 2 +- isis/src/mariner/apps/mar10nonoise/main.cpp | 2 +- isis/src/mariner/apps/mar10restore/main.cpp | 2 +- .../objs/Mariner10Camera/Mariner10Camera.cpp | 8 +- .../mariner/objs/Mariner10Camera/unitTest.cpp | 2 +- isis/src/mer/apps/mer2isis/main.cpp | 12 +-- isis/src/mer/apps/mical/MiCalibration.cpp | 22 ++-- isis/src/mer/apps/mical/main.cpp | 38 +++---- isis/src/messenger/apps/mdis2isis/main.cpp | 44 ++++---- isis/src/messenger/apps/mdiscal/main.cpp | 76 ++++++------- isis/src/messenger/apps/mdisddr/main.cpp | 48 ++++----- .../messenger/apps/mdisedrinfo/MdisEdrKeys.h | 16 +-- .../apps/mdisedrinfo/MdisGeometry.cpp | 34 +++--- .../apps/mdisedrinfo/SpiceManager.cpp | 12 +-- isis/src/messenger/apps/mdisedrinfo/main.cpp | 2 +- .../messenger/objs/MdisCamera/MdisCamera.cpp | 2 +- .../messenger/objs/MdisCamera/unitTest.cpp | 2 +- isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp | 14 +-- .../MexHrscSrcCamera/MexHrscSrcCamera.cpp | 2 +- isis/src/mgs/apps/moc2isis/main.cpp | 82 +++++++------- isis/src/mgs/apps/moccal/moccal.cpp | 28 ++--- isis/src/mgs/apps/mocnoise50/main.cpp | 14 +-- isis/src/mgs/apps/mocproc/main.cpp | 8 +- isis/src/mgs/objs/MocLabels/MocLabels.cpp | 16 +-- .../MocNarrowAngleCamera.cpp | 2 +- .../MocWideAngleCamera/MocWideAngleCamera.cpp | 2 +- isis/src/mro/apps/crism2isis/crism2isis.cpp | 16 +-- isis/src/mro/apps/ctxcal/ctxcal.cpp | 10 +- isis/src/mro/apps/ctxevenodd/main.cpp | 4 +- isis/src/mro/apps/hi2isis/hi2isis.cpp | 92 ++++++++-------- isis/src/mro/apps/hical/hical.cpp | 14 +-- isis/src/mro/apps/hicalbeta/main.cpp | 14 +-- isis/src/mro/apps/hicalproc/main.cpp | 12 +-- isis/src/mro/apps/hiccdstitch/main.cpp | 32 +++--- isis/src/mro/apps/hicolormos/hicolormos.cpp | 46 ++++---- isis/src/mro/apps/hicrop/hicrop.cpp | 30 +++--- isis/src/mro/apps/hicubeit/hicubeit.cpp | 58 +++++----- isis/src/mro/apps/hicubenorm/hicubenorm.cpp | 46 ++++---- isis/src/mro/apps/hideal2pds/main.cpp | 80 +++++++------- isis/src/mro/apps/hidtmgen/hidtmgen.cpp | 40 +++---- isis/src/mro/apps/hifurrows/main.cpp | 2 +- isis/src/mro/apps/hijitreg/HiJitCube.cpp | 10 +- isis/src/mro/apps/hijitreg/main.cpp | 10 +- isis/src/mro/apps/hijitter/main.cpp | 4 +- isis/src/mro/apps/himos/himos.cpp | 64 +++++------ isis/src/mro/apps/hinoise/main.cpp | 8 +- isis/src/mro/apps/hirdr2isis/main.cpp | 4 +- isis/src/mro/apps/hirdrgen/main.cpp | 42 ++++---- isis/src/mro/apps/hisharpen/main.cpp | 4 +- isis/src/mro/apps/histat/main.cpp | 28 ++--- isis/src/mro/apps/histitch/main.cpp | 36 +++---- isis/src/mro/apps/marci2isis/marci2isis.cpp | 58 +++++----- isis/src/mro/apps/marcical/marcical.cpp | 42 ++++---- isis/src/mro/apps/marciflip/marciflip.cpp | 2 +- isis/src/mro/apps/mroctx2isis/main.cpp | 20 ++-- isis/src/mro/objs/CTXCamera/CTXCamera.cpp | 2 +- isis/src/mro/objs/CrismCamera/CrismCamera.cpp | 6 +- isis/src/mro/objs/HiCal/HiCalConf.cpp | 20 ++-- isis/src/mro/objs/HiCal/HiCalTypes.h | 4 +- isis/src/mro/objs/HiCal/HiCalUtil.h | 2 +- isis/src/mro/objs/HiCal/ZeroReverse.h | 2 +- .../mro/objs/HiriseCamera/HiriseCamera.cpp | 2 +- isis/src/mro/objs/MarciCamera/MarciCamera.cpp | 12 +-- isis/src/near/apps/msi2isis/msi2isis.cpp | 16 +-- .../objs/NewHorizonsLorriCamera/unitTest.cpp | 2 +- .../NewHorizonsMvicFrameCamera/unitTest.cpp | 2 +- .../src/tgo/objs/TgoCassisCamera/unitTest.cpp | 2 +- .../src/viking/objs/VikingCamera/unitTest.cpp | 2 +- .../voyager/objs/VoyagerCamera/unitTest.cpp | 2 +- isis/tests/OsirisRexOCamsCameraTests.cpp | 4 +- isis/tests/OsirisRexTagCamsCameraTests.cpp | 4 +- isis/tests/UnitTestOsirisRexTagCams.cpp | 2 +- 126 files changed, 1208 insertions(+), 1208 deletions(-) diff --git a/isis/src/base/apps/camstats/camstats.cpp b/isis/src/base/apps/camstats/camstats.cpp index d285c72fd8..8123bffac7 100644 --- a/isis/src/base/apps/camstats/camstats.cpp +++ b/isis/src/base/apps/camstats/camstats.cpp @@ -192,7 +192,7 @@ namespace Isis { PvlGroup &group = statsPvl.group(i); int entry = 0; - record[entry] = group.name().toStdString(); + record[entry] = group.name(); entry++; for (int j = 0; j < group.keywords(); j++) { record[entry] = std::stod(group[j][0]); diff --git a/isis/src/base/apps/csminit/csminit.cpp b/isis/src/base/apps/csminit/csminit.cpp index 78e6c9a05c..78b8c25c00 100644 --- a/isis/src/base/apps/csminit/csminit.cpp +++ b/isis/src/base/apps/csminit/csminit.cpp @@ -119,7 +119,7 @@ namespace Isis { std::string message = "No loaded model could be created from the ISD [" + isdFilePath.toStdString() + "]." "Loaded plugin & model names:\n"; for (const csm::Plugin * plugin : csm::Plugin::getList()) { - std:string currentPluginName = plugin->getPluginName(); + std::string currentPluginName = plugin->getPluginName(); for (size_t modelIndex = 0; modelIndex < plugin->getNumModels(); modelIndex++) { std::string modelName = plugin->getModelName(modelIndex); message += "Plugin [" + currentPluginName + "], Model [" + modelName + "]\n"; diff --git a/isis/src/base/apps/maptemplate/main.cpp b/isis/src/base/apps/maptemplate/main.cpp index 98fb338dba..29b0f8344c 100644 --- a/isis/src/base/apps/maptemplate/main.cpp +++ b/isis/src/base/apps/maptemplate/main.cpp @@ -70,7 +70,7 @@ void IsisMain() { } Pvl p; p.addGroup(mapping); - p.write(output); + p.write(output.toStdString()); } // Helper function to output map file to log. @@ -78,7 +78,7 @@ void helperButtonLogMap() { UserInterface &ui = Application::GetUserInterface(); QString mapFile(ui.GetFileName("MAP")); Pvl p; - p.read(mapFile); + p.read(mapFile.toStdString()); PvlGroup t = p.findGroup("mapping", Pvl::Traverse); QString OQString = "***** Output of [" + mapFile + "] *****"; Application::GuiLog(OQString); @@ -91,7 +91,7 @@ void helperButtonLoadMap() { UserInterface &ui = Application::GetUserInterface(); QString mapFile(ui.GetFileName("MAP")); Pvl p; - p.read(mapFile); + p.read(mapFile.toStdString()); PvlGroup t = p.findGroup("mapping", Pvl::Traverse); // Projection Stuff ui.Clear("CLON"); @@ -105,7 +105,7 @@ void helperButtonLoadMap() { ui.Clear("DIST"); if(t.hasKeyword("ProjectionName")) { - QString projIn = (QString)t["ProjectionName"]; + QString projIn = QString::fromStdString(t["ProjectionName"]); projIn = projIn.toUpper(); ui.Clear("PROJECTION"); ui.PutAsString("PROJECTION", projIn); @@ -171,28 +171,28 @@ void helperButtonLoadMap() { QString use = "USER"; ui.Clear("TARGOPT"); ui.PutAsString("TARGOPT", use); - QString tNameIn = t["TargetName"]; + QString tNameIn = QString::fromStdString(t["TargetName"]); ui.Clear("TARGETNAME"); ui.PutAsString("TARGETNAME", tNameIn); - QString LTIn = (QString)t["LatitudeType"]; + QString LTIn = QString::fromStdString(t["LatitudeType"]); LTIn = LTIn.toUpper(); ui.Clear("LATTYPE"); ui.PutAsString("LATTYPE", LTIn); - QString LDIn = (QString)t["LongitudeDirection"]; + QString LDIn = QString::fromStdString(t["LongitudeDirection"]); LDIn = LDIn.toUpper(); ui.Clear("LONDIR"); ui.PutAsString("LONDIR", LDIn); - QString LDomIn = t["LongitudeDomain"]; + QString LDomIn = QString::fromStdString(t["LongitudeDomain"]); ui.Clear("LONDOM"); ui.PutAsString("LONDOM", LDomIn); - QString EQIn = t["EquatorialRadius"]; + QString EQIn = QString::fromStdString(t["EquatorialRadius"]); ui.Clear("EQRADIUS"); ui.PutAsString("EQRADIUS", EQIn); - QString PRIn = t["PolarRadius"]; + QString PRIn = QString::fromStdString(t["PolarRadius"]); ui.Clear("POLRADIUS"); ui.PutAsString("POLRADIUS", PRIn); } @@ -249,7 +249,7 @@ void helperButtonLogTargDef() { UserInterface &ui = Application::GetUserInterface(); QString targetFile(ui.GetFileName("FILE")); Pvl p; - p.read(targetFile); + p.read(targetFile.toStdString()); PvlGroup t = p.findGroup("mapping", Pvl::Traverse); QString OQString = "***** Output of [" + targetFile + "] *****"; Application::GuiLog(OQString); @@ -264,41 +264,41 @@ void helperButtonLoadTargDef() { // test if targdef was entered Pvl p; - p.read(targetFile); + p.read(targetFile.toStdString()); PvlGroup t = p.findGroup("mapping", Pvl::Traverse); // Load the targdef values into the GUI QString tOpt = "USER"; ui.Clear("TARGOPT"); ui.PutAsString("TARGOPT", tOpt); if(t.hasKeyword("TargetName")) { - QString tNameIn = t["TargetName"]; + QString tNameIn = QString::fromStdString(t["TargetName"]); ui.Clear("TARGETNAME"); ui.PutAsString("TARGETNAME", tNameIn); } if(t.hasKeyword("LatitudeType")) { - QString LTIn = (QString)t["LatitudeType"]; + QString LTIn = QString::fromStdString(t["LatitudeType"]); LTIn = LTIn.toUpper(); ui.Clear("LATTYPE"); ui.PutAsString("LATTYPE", LTIn); } if(t.hasKeyword("LongitudeDirection")) { - QString LDIn = (QString)t["LongitudeDirection"]; + QString LDIn = QString::fromStdString(t["LongitudeDirection"]); LDIn = LDIn.toUpper(); ui.Clear("LONDIR"); ui.PutAsString("LONDIR", LDIn); } if(t.hasKeyword("LongitudeDomain")) { - QString LDomIn = t["LongitudeDomain"]; + QString LDomIn = QString::fromStdString(t["LongitudeDomain"]); ui.Clear("LONDOM"); ui.PutAsString("LONDOM", LDomIn); } if(t.hasKeyword("EquatorialRadius")) { - QString EQIn = t["EquatorialRadius"]; + QString EQIn = QString::fromStdString(t["EquatorialRadius"]); ui.Clear("EQRADIUS"); ui.PutAsString("EQRADIUS", EQIn); } if(t.hasKeyword("PolarRadius")) { - QString PRIn = t["PolarRadius"]; + QString PRIn = QString::fromStdString(t["PolarRadius"]); ui.Clear("POLRADIUS"); ui.PutAsString("POLRADIUS", PRIn); } @@ -388,42 +388,42 @@ void addProject(PvlGroup &mapping) { projLUT ["ROBINSON"] = "Robinson"; // Add Projection keywords to the mappping PVL - mapping += PvlKeyword("ProjectionName", projLUT[projName]); + mapping += PvlKeyword("ProjectionName", projLUT[projName].toStdString()); if(ui.WasEntered("CLON")) { double clonOut = ui.GetDouble("CLON"); - mapping += PvlKeyword("CenterLongitude", toString(clonOut)); + mapping += PvlKeyword("CenterLongitude", std::to_string(clonOut)); } if(ui.WasEntered("CLAT")) { double clatOut = ui.GetDouble("CLAT"); - mapping += PvlKeyword("CenterLatitude", toString(clatOut)); + mapping += PvlKeyword("CenterLatitude", std::to_string(clatOut)); } if(ui.WasEntered("SCALEFACTOR")) { double scaleFactorOut = ui.GetDouble("SCALEFACTOR"); - mapping += PvlKeyword("ScaleFactor", toString(scaleFactorOut)); + mapping += PvlKeyword("ScaleFactor", std::to_string(scaleFactorOut)); } if(ui.WasEntered("PAR1")) { double par1 = ui.GetDouble("PAR1"); - mapping += PvlKeyword("FirstStandardParallel", toString(par1)); + mapping += PvlKeyword("FirstStandardParallel", std::to_string(par1)); } if(ui.WasEntered("PAR2")) { double par2 = ui.GetDouble("PAR2"); - mapping += PvlKeyword("SecondStandardParallel", toString(par2)); + mapping += PvlKeyword("SecondStandardParallel", std::to_string(par2)); } if(ui.WasEntered("PLAT")) { double plat = ui.GetDouble("PLAT"); - mapping += PvlKeyword("PoleLatitude", toString(plat)); + mapping += PvlKeyword("PoleLatitude", std::to_string(plat)); } if(ui.WasEntered("PLON")) { double plon = ui.GetDouble("PLON"); - mapping += PvlKeyword("PoleLongitude", toString(plon)); + mapping += PvlKeyword("PoleLongitude", std::to_string(plon)); } if(ui.WasEntered("PROT")) { double prot = ui.GetDouble("PROT"); - mapping += PvlKeyword("PoleRotation", toString(prot)); + mapping += PvlKeyword("PoleRotation", std::to_string(prot)); } if(ui.WasEntered("DIST")) { double dist = ui.GetDouble("DIST"); - mapping += PvlKeyword("Distance", toString(dist)); + mapping += PvlKeyword("Distance", std::to_string(dist)); } } @@ -433,7 +433,7 @@ void addTarget(PvlGroup &mapping) { if(ui.GetString("TARGOPT") == "SELECT") { QString targetFile(ui.GetFileName("FILE")); Pvl p; - p.read(targetFile); + p.read(targetFile.toStdString()); PvlGroup t = p.findGroup("mapping"); if(t.hasKeyword("TargetName")) { mapping += t["TargetName"]; @@ -456,7 +456,7 @@ void addTarget(PvlGroup &mapping) { else if(ui.GetString("TARGOPT") == "USER") { QString targetName = ui.GetString("TARGETNAME"); - mapping += PvlKeyword("TargetName", targetName); + mapping += PvlKeyword("TargetName", targetName.toStdString()); PvlGroup radii; // if either radius value was not entered, then we will attempt to get it from the target name @@ -473,14 +473,14 @@ void addTarget(PvlGroup &mapping) { } if(ui.WasEntered("EQRADIUS")) { - mapping += PvlKeyword("EquatorialRadius", ui.GetAsString("EQRADIUS"), "meters"); + mapping += PvlKeyword("EquatorialRadius", ui.GetAsString("EQRADIUS").toStdString(), "meters"); } else { mapping += radii.findKeyword("EquatorialRadius"); // already formatted in meters } if(ui.WasEntered("POLRADIUS")) { - mapping += PvlKeyword("PolarRadius", ui.GetAsString("POLRADIUS"), "meters"); + mapping += PvlKeyword("PolarRadius", ui.GetAsString("POLRADIUS").toStdString(), "meters"); } else { mapping += radii.findKeyword("PolarRadius"); // already formatted in meters @@ -501,7 +501,7 @@ void addTarget(PvlGroup &mapping) { mapping += PvlKeyword("LongitudeDirection", "PositiveWest"); } - mapping += PvlKeyword("LongitudeDomain", ui.GetString("LONDOM")); + mapping += PvlKeyword("LongitudeDomain", ui.GetString("LONDOM").toStdString()); } } @@ -511,13 +511,13 @@ void addRange(PvlGroup &mapping) { // Use the values that have been entered in the GUI if(ui.GetString("RNGOPT") == "USER") { double minLat = ui.GetDouble("MINLAT"); - mapping += PvlKeyword("MinimumLatitude", toString(minLat)); + mapping += PvlKeyword("MinimumLatitude", std::to_string(minLat)); double maxLat = ui.GetDouble("MAXLAT"); - mapping += PvlKeyword("MaximumLatitude", toString(maxLat)); + mapping += PvlKeyword("MaximumLatitude", std::to_string(maxLat)); double minLon = ui.GetDouble("MINLON"); - mapping += PvlKeyword("MinimumLongitude", toString(minLon)); + mapping += PvlKeyword("MinimumLongitude", std::to_string(minLon)); double maxLon = ui.GetDouble("MAXLON"); - mapping += PvlKeyword("MaximumLongitude", toString(maxLon)); + mapping += PvlKeyword("MaximumLongitude", std::to_string(maxLon)); } else if(ui.GetString("RNGOPT") == "CALC") { // calculate range values using function calcRange and fromlist @@ -527,10 +527,10 @@ void addRange(PvlGroup &mapping) { double maxLon; // Call calcRange to calculate min and max ground range values calcRange(minLat, maxLat, minLon, maxLon); - mapping += PvlKeyword("MinimumLatitude", toString(minLat)); - mapping += PvlKeyword("MaximumLatitude", toString(maxLat)); - mapping += PvlKeyword("MinimumLongitude", toString(minLon)); - mapping += PvlKeyword("MaximumLongitude", toString(maxLon)); + mapping += PvlKeyword("MinimumLatitude", std::to_string(minLat)); + mapping += PvlKeyword("MaximumLatitude", std::to_string(maxLat)); + mapping += PvlKeyword("MinimumLongitude", std::to_string(minLon)); + mapping += PvlKeyword("MaximumLongitude", std::to_string(maxLon)); } } @@ -540,16 +540,16 @@ void addResolution(PvlGroup &mapping) { UserInterface &ui = Application::GetUserInterface(); if(ui.GetString("RESOPT") == "PPD") { double res = ui.GetDouble("RESOLUTION"); - mapping += PvlKeyword("Scale", toString(res), "pixels/degree"); + mapping += PvlKeyword("Scale", std::to_string(res), "pixels/degree"); } else if(ui.GetString("RESOPT") == "MPP") { double res = ui.GetDouble("RESOLUTION"); - mapping += PvlKeyword("PixelResolution", toString(res), "meters/pixel"); + mapping += PvlKeyword("PixelResolution", std::to_string(res), "meters/pixel"); } else if(ui.GetString("RESOPT") == "CALC") { // run the function to calculate the resolution double Res = calcResolution(); - mapping += PvlKeyword("PixelResolution", toString(Res), "meters/pixel"); + mapping += PvlKeyword("PixelResolution", std::to_string(Res), "meters/pixel"); } } @@ -567,7 +567,7 @@ void calcRange(double &minLat, double &maxLat, Pvl userMap; PvlGroup userGrp("Mapping"); if(ui.GetString("TARGOPT") == "SELECT") { - userMap.read(ui.GetFileName("FILE")); + userMap.read(ui.GetFileName("FILE").toStdString()); } else if(ui.GetString("TARGOPT") == "USER") { QString targetName = ui.GetString("TARGETNAME"); @@ -577,9 +577,9 @@ void calcRange(double &minLat, double &maxLat, if ( !ui.WasEntered("EQRADIUS") || !ui.WasEntered("POLRADIUS") ) { try { // this ensures that we look for the target radii of the TARGET specified by the user - radii += PvlKeyword("TargetName", targetName); + radii += PvlKeyword("TargetName", targetName.toStdString()); // this group will contain TargetName, EquatorialRadius, and PolarRadius - Pvl cubeLab(flist[0].expanded()); + Pvl cubeLab(flist[0].expanded().toStdString()); radii = Target::radiiGroup(cubeLab, radii); } catch (IException &e) { @@ -589,18 +589,18 @@ void calcRange(double &minLat, double &maxLat, } } - userGrp += PvlKeyword("TargetName", targetName); + userGrp += PvlKeyword("TargetName", targetName.toStdString()); // if radii were entered in GUI then set radii to entered value if(ui.WasEntered("EQRADIUS")) { - userGrp += PvlKeyword("EquatorialRadius", ui.GetAsString("EQRADIUS"), "Meters"); + userGrp += PvlKeyword("EquatorialRadius", ui.GetAsString("EQRADIUS").toStdString(), "Meters"); } else { userGrp += radii.findKeyword("EquatorialRadius"); } if(ui.WasEntered("POLRADIUS")) { - userGrp += PvlKeyword("PolarRadius", ui.GetAsString("POLRADIUS"), "Meters"); + userGrp += PvlKeyword("PolarRadius", ui.GetAsString("POLRADIUS").toStdString(), "Meters"); } else { userGrp += radii.findKeyword("PolarRadius"); @@ -621,7 +621,7 @@ void calcRange(double &minLat, double &maxLat, userGrp += PvlKeyword("LongitudeDirection", "PositiveWest"); } - userGrp += PvlKeyword("LongitudeDomain", ui.GetString("LONDOM")); + userGrp += PvlKeyword("LongitudeDomain", ui.GetString("LONDOM").toStdString()); userMap.addGroup(userGrp); } diff --git a/isis/src/base/apps/noproj/noproj.cpp b/isis/src/base/apps/noproj/noproj.cpp index d7bf37c750..baad947e85 100644 --- a/isis/src/base/apps/noproj/noproj.cpp +++ b/isis/src/base/apps/noproj/noproj.cpp @@ -437,9 +437,9 @@ namespace Isis { // Check this object for a detached file spec QStringList detfiles; - QString dfilename = "^" + object.name(); + std::string dfilename = "^" + object.name(); if ( object.hasKeyword(dfilename) ) { - QString detname = object[dfilename]; + QString detname = QString::fromStdString(object[dfilename]); detfiles.append(detname); } diff --git a/isis/src/base/apps/photemplate/main.cpp b/isis/src/base/apps/photemplate/main.cpp index cff704b62b..7e98fef6d5 100644 --- a/isis/src/base/apps/photemplate/main.cpp +++ b/isis/src/base/apps/photemplate/main.cpp @@ -31,7 +31,7 @@ void PrintPvl() { // Write file out to log QString inFile(ui.GetFileName("FROMPVL")); Pvl inPvl; - inPvl.read(ui.GetFileName("FROMPVL")); + inPvl.read(ui.GetFileName("FROMPVL").toStdString()); QString OQString = "***** Output of [" + inFile + "] *****"; Application::GuiLog(OQString); Application::GuiLog(inPvl); @@ -46,7 +46,7 @@ void LoadKeyValue(const PvlKeyword & key, QString & val){ if (i > 0) { val += ", "; } - val += key[i]; + val += QString::fromStdString(key[i]); } } @@ -56,11 +56,11 @@ void OutputKeyValue(PvlKeyword & key, QString val){ key.clear(); int found = val.indexOf(","); while(found != -1) { - key += toString(toDouble(val.mid(0, found))); + key += std::to_string(toDouble(val.mid(0, found))); val = val.mid(found+1); found = val.indexOf(","); } - key += toString(toDouble(val)); + key += std::to_string(toDouble(val)); } // Helper function to load the input pvl file into the GUI @@ -70,7 +70,7 @@ void LoadPvl() { UserInterface &ui = Application::GetUserInterface(); QString inFile(ui.GetFileName("FROMPVL")); Pvl inPvl; - inPvl.read(inFile); + inPvl.read(inFile.toStdString()); QString phtName = ui.GetAsString("PHTNAME"); phtName = phtName.toUpper(); QString atmName = ui.GetAsString("ATMNAME"); @@ -88,9 +88,9 @@ void LoadPvl() { PvlObject::PvlGroupIterator phtGrp = phtObj.beginGroup(); bool wasFound = false; if (phtGrp->hasKeyword("PHTNAME")) { - phtVal = (QString)phtGrp->findKeyword("PHTNAME"); + phtVal = QString::fromStdString(phtGrp->findKeyword("PHTNAME")); } else if (phtGrp->hasKeyword("NAME")) { - phtVal = (QString)phtGrp->findKeyword("NAME"); + phtVal = QString::fromStdString(phtGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid photometric model so you must specify one "; message += "- the [Phtname] keyword is missing in your [Algorithm] group"; @@ -104,9 +104,9 @@ void LoadPvl() { while (phtGrp != phtObj.endGroup()) { if (phtGrp->hasKeyword("PHTNAME") || phtGrp->hasKeyword("NAME")) { if (phtGrp->hasKeyword("PHTNAME")) { - phtVal = (QString)phtGrp->findKeyword("PHTNAME"); + phtVal = QString::fromStdString(phtGrp->findKeyword("PHTNAME")); } else if (phtGrp->hasKeyword("NAME")) { - phtVal = (QString)phtGrp->findKeyword("NAME"); + phtVal = QString::fromStdString(phtGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid photometric model so you must specify one "; message += "- the [Phtname] keyword is missing in your [Algorithm] group"; @@ -160,7 +160,7 @@ void LoadPvl() { ui.PutAsString("B0", keyVal); } if (phtGrp->hasKeyword("ZEROB0STANDARD")) { - QString zerob0 = (QString)phtGrp->findKeyword("ZEROB0STANDARD"); + QString zerob0 = QString::fromStdString(phtGrp->findKeyword("ZEROB0STANDARD")); QString izerob0 = zerob0; izerob0 = izerob0.toUpper(); if (izerob0 == "TRUE") { @@ -398,7 +398,7 @@ void IsisMain() { addAtmosModel(p, op); } - op.write(output); + op.write(output.toStdString()); } //Function to add photometric model to the PVL @@ -430,9 +430,9 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { while (pvlGrp != pvlObj.endGroup()) { if (pvlGrp->hasKeyword("PHTNAME") || pvlGrp->hasKeyword("NAME")) { if (pvlGrp->hasKeyword("PHTNAME")) { - phtVal = (QString)pvlGrp->findKeyword("PHTNAME"); + phtVal = QString::fromStdString(pvlGrp->findKeyword("PHTNAME")); } else if (pvlGrp->hasKeyword("NAME")) { - phtVal = (QString)pvlGrp->findKeyword("NAME"); + phtVal = QString::fromStdString(pvlGrp->findKeyword("NAME")); } else { phtVal = "NONE"; } @@ -452,13 +452,13 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { outPvl.addObject(PvlObject("PhotometricModel")); outPvl.findObject("PhotometricModel").addGroup(PvlGroup("Algorithm")); outPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("PHTNAME",phtName),Pvl::Replace); + addKeyword(PvlKeyword("PHTNAME",phtName.toStdString()),Pvl::Replace); } } else { outPvl.addObject(PvlObject("PhotometricModel")); outPvl.findObject("PhotometricModel").addGroup(PvlGroup("Algorithm")); outPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("PHTNAME",phtName),Pvl::Replace); + addKeyword(PvlKeyword("PHTNAME",phtName.toStdString()),Pvl::Replace); } //Get the photometric model and any parameters specific to that @@ -726,9 +726,9 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { if (pvlObj.hasGroup("Algorithm")) { PvlObject::PvlGroupIterator pvlGrp = pvlObj.beginGroup(); if (pvlGrp->hasKeyword("ATMNAME")) { - atmVal = (QString)pvlGrp->findKeyword("ATMNAME"); + atmVal = QString::fromStdString(pvlGrp->findKeyword("ATMNAME")); } else if (pvlGrp->hasKeyword("NAME")) { - atmVal = (QString)pvlGrp->findKeyword("NAME"); + atmVal = QString::fromStdString(pvlGrp->findKeyword("NAME")); } else { atmVal = "NONE"; } @@ -740,9 +740,9 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { while (pvlGrp != pvlObj.endGroup()) { if (pvlGrp->hasKeyword("ATMNAME") || pvlGrp->hasKeyword("NAME")) { if (pvlGrp->hasKeyword("ATMNAME")) { - atmVal = (QString)pvlGrp->findKeyword("ATMNAME"); + atmVal = QString::fromStdString(pvlGrp->findKeyword("ATMNAME")); } else if (pvlGrp->hasKeyword("NAME")) { - atmVal = (QString)pvlGrp->findKeyword("NAME"); + atmVal = QString::fromStdString(pvlGrp->findKeyword("NAME")); } else { atmVal = "NONE"; } @@ -762,13 +762,13 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { outPvl.addObject(PvlObject("AtmosphericModel")); outPvl.findObject("AtmosphericModel").addGroup(PvlGroup("Algorithm")); outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("ATMNAME",atmName),Pvl::Replace); + addKeyword(PvlKeyword("ATMNAME",atmName.toStdString()),Pvl::Replace); } } else { outPvl.addObject(PvlObject("AtmosphericModel")); outPvl.findObject("AtmosphericModel").addGroup(PvlGroup("Algorithm")); outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("ATMNAME",atmName),Pvl::Replace); + addKeyword(PvlKeyword("ATMNAME",atmName.toStdString()),Pvl::Replace); } //Get the atmospheric model and any parameters specific to that diff --git a/isis/src/base/apps/pvldiff/main.cpp b/isis/src/base/apps/pvldiff/main.cpp index 126472f227..292c924f18 100644 --- a/isis/src/base/apps/pvldiff/main.cpp +++ b/isis/src/base/apps/pvldiff/main.cpp @@ -32,11 +32,11 @@ void IsisMain() { differenceReason = ""; filesMatch = true; - Pvl file1(ui.GetFileName("FROM")); - Pvl file2(ui.GetFileName("FROM2")); + Pvl file1(ui.GetFileName("FROM").toStdString()); + Pvl file2(ui.GetFileName("FROM2").toStdString()); if ( ui.WasEntered("DIFF") ) { - Pvl diffFile(ui.GetFileName("DIFF")); + Pvl diffFile(ui.GetFileName("DIFF").toStdString()); if ( diffFile.hasGroup("Tolerances") ) { tolerances = diffFile.findGroup("Tolerances"); @@ -59,7 +59,7 @@ void IsisMain() { } else { differences += PvlKeyword("Compare", "Different"); - differences += PvlKeyword("Reason", differenceReason); + differences += PvlKeyword("Reason", differenceReason.toStdString()); } Application::Log(differences); @@ -67,21 +67,21 @@ void IsisMain() { if ( ui.WasEntered("TO") ) { Pvl out; out.addGroup(differences); - out.write(ui.GetFileName("TO")); + out.write(ui.GetFileName("TO").toStdString()); } differenceReason = ""; } void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { - if ( pvl1.name().compare(pvl2.name()) != 0 ) { + if ( QString::fromStdString(pvl1.name()).compare(QString::fromStdString(pvl2.name())) != 0 ) { filesMatch = false; - differenceReason = "Keyword '" + pvl1.name() + "' does not match keyword '" + pvl2.name() + "'"; + differenceReason = "Keyword '" + QString::fromStdString(pvl1.name()) + "' does not match keyword '" + QString::fromStdString(pvl2.name()) + "'"; } if ( pvl1.size() != pvl2.size() ) { filesMatch = false; - differenceReason = "Keyword '" + pvl1.name() + "' size does not match."; + differenceReason = "Keyword '" + QString::fromStdString(pvl1.name()) + "' size does not match."; return; } @@ -91,7 +91,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { tolerances[pvl1.name()].size() > 1 && pvl1.size() != tolerances[pvl1.name()].size() ) { - QString msg = "Size of keyword '" + pvl1.name() + "' does not match with "; + QString msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of tolerances in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); @@ -101,7 +101,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { ignoreKeys[pvl1.name()].size() > 1 && pvl1.size() != ignoreKeys[pvl1.name()].size() ) { - QString msg = "Size of keyword '" + pvl1.name() + "' does not match with "; + QString msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of ignore keys in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); @@ -111,18 +111,18 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { ignoreFilePaths[pvl1.name()].size() > 1 && pvl1.size() != ignoreFilePaths[pvl1.name()].size() ) { - QString msg = "Size of keyword '" + pvl1.name() + "' does not match with "; + QString msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of filepath ignores in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); } for (int i = 0; i < pvl1.size() && filesMatch; i++) { - QString val1 = pvl1[i]; - QString val2 = pvl2[i]; + QString val1 = QString::fromStdString(pvl1[i]); + QString val2 = QString::fromStdString(pvl2[i]); - QString unit1 = pvl1.unit(i); - QString unit2 = pvl2.unit(i); + QString unit1 = QString::fromStdString(pvl1.unit(i)); + QString unit2 = QString::fromStdString(pvl2.unit(i)); int ignoreIndex = 0; if ( ignoreKeys.hasKeyword(pvl1.name()) && ignoreKeys[pvl1.name()].size() > 1 ) { @@ -145,7 +145,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { if ( unit1.toLower() != unit2.toLower() ) { filesMatch = false; - differenceReason = "Keyword '" + pvl1.name() + "': units do not match."; + differenceReason = "Keyword '" + QString::fromStdString(pvl1.name()) + "': units do not match."; return; } @@ -153,7 +153,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { double difference = abs(toDouble(val1) - toDouble(val2)); if ( tolerances.hasKeyword(pvl1.name()) ) { - tolerance = toDouble( + tolerance = std::stod( (tolerances[pvl1.name()].size() == 1) ? tolerances[pvl1.name()][0] : tolerances[pvl1.name()][i]); } @@ -161,11 +161,11 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { if ( difference > tolerance ) { filesMatch = false; if ( pvl1.size() == 1 ) { - differenceReason = "Keyword '" + pvl1.name() + "': difference is " + + differenceReason = "Keyword '" + QString::fromStdString(pvl1.name()) + "': difference is " + toString(difference); } else { - differenceReason = "Keyword '" + pvl1.name() + "' at index " + + differenceReason = "Keyword '" + QString::fromStdString(pvl1.name()) + "' at index " + toString(i) + ": difference is " + toString(difference); } differenceReason += " (tolerance is " + toString(tolerance) + ")"; @@ -175,7 +175,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { catch (IException &) { if ( val1.toLower() != val2.toLower() ) { filesMatch = false; - differenceReason = "Keyword '" + pvl1.name() + "': values do not " + differenceReason = "Keyword '" + QString::fromStdString(pvl1.name()) + "': values do not " "match."; } } @@ -186,25 +186,25 @@ void compareObjects(PvlObject &pvl1, PvlObject &pvl2) { removeIngoredKeys(pvl1, pvl2); - if ( pvl1.name().compare(pvl2.name()) != 0 ) { + if ( QString::fromStdString(pvl1.name()).compare(QString::fromStdString(pvl2.name())) != 0 ) { filesMatch = false; - differenceReason = "Object " + pvl1.name() + " does not match " + - pvl2.name(); + differenceReason = "Object " + QString::fromStdString(pvl1.name()) + " does not match " + + QString::fromStdString(pvl2.name()); } if ( pvl1.keywords() != pvl2.keywords() ) { filesMatch = false; - differenceReason = "Object " + pvl1.name() + " has varying keyword counts."; + differenceReason = "Object " + QString::fromStdString(pvl1.name()) + " has varying keyword counts."; } if ( pvl1.groups() != pvl2.groups() ) { filesMatch = false; - differenceReason = "Object " + pvl1.name() + " has varying group counts."; + differenceReason = "Object " + QString::fromStdString(pvl1.name()) + " has varying group counts."; } if ( pvl1.objects() != pvl2.objects()) { filesMatch = false; - differenceReason = "Object " + pvl1.name() + " has varying object counts."; + differenceReason = "Object " + QString::fromStdString(pvl1.name()) + " has varying object counts."; } if (!filesMatch) { @@ -223,8 +223,8 @@ void compareObjects(PvlObject &pvl1, PvlObject &pvl2) { compareGroups(pvl1.group(group), pvl2.group(group)); } - if ( !filesMatch && pvl1.name().compare("Root") != 0 ) { - differenceReason = "Object " + pvl1.name() + ": " + differenceReason; + if ( !filesMatch && QString::fromStdString(pvl1.name()).compare("Root") != 0 ) { + differenceReason = "Object " + QString::fromStdString(pvl1.name()) + ": " + differenceReason; } } @@ -254,6 +254,6 @@ void compareGroups(PvlGroup &pvl1, PvlGroup &pvl2) { } if (!filesMatch) { - differenceReason = "Group " + pvl1.name() + ": " + differenceReason; + differenceReason = "Group " + QString::fromStdString(pvl1.name()) + ": " + differenceReason; } } diff --git a/isis/src/base/apps/ringscam2map/main.cpp b/isis/src/base/apps/ringscam2map/main.cpp index fcd876ac00..4c98360b69 100644 --- a/isis/src/base/apps/ringscam2map/main.cpp +++ b/isis/src/base/apps/ringscam2map/main.cpp @@ -45,7 +45,7 @@ void IsisMain() { // Get the map projection file provided by the user UserInterface &ui = Application::GetUserInterface(); Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Open the input cube and get the camera @@ -67,10 +67,10 @@ void IsisMain() { // Make the target info match the user mapfile double minrad, maxrad, minaz, maxaz; incam->ringRange(minrad, maxrad, minaz, maxaz, userMap); - camGrp.addKeyword(PvlKeyword("MinimumRingRadius", toString(minrad)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MaximumRingRadius", toString(maxrad)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MinimumRingLongitude", toString(minaz)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MaximumRingLongitude", toString(maxaz)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MinimumRingRadius", std::to_string(minrad)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MaximumRingRadius", std::to_string(maxrad)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MinimumRingLongitude", std::to_string(minaz)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MaximumRingLongitude", std::to_string(maxaz)), Pvl::Replace); // We want to delete the keywords we just added if the user wants the range // out of the mapfile, otherwise they will replace any keywords not in the @@ -101,22 +101,22 @@ void IsisMain() { // If the user decided to enter a ground range then override if(ui.WasEntered("MINRINGLON")) { userGrp.addKeyword(PvlKeyword("MinimumRingLongitude", - toString(ui.GetDouble("MINRINGLON"))), Pvl::Replace); + std::to_string(ui.GetDouble("MINRINGLON"))), Pvl::Replace); } if(ui.WasEntered("MAXRINGLON")) { userGrp.addKeyword(PvlKeyword("MaximumRingLongitude", - toString(ui.GetDouble("MAXRINGLON"))), Pvl::Replace); + std::to_string(ui.GetDouble("MAXRINGLON"))), Pvl::Replace); } if(ui.WasEntered("MINRINGRAD")) { userGrp.addKeyword(PvlKeyword("MinimumRingRadius", - toString(ui.GetDouble("MINRINGRAD"))), Pvl::Replace); + std::to_string(ui.GetDouble("MINRINGRAD"))), Pvl::Replace); } if(ui.WasEntered("MAXRINGRAD")) { userGrp.addKeyword(PvlKeyword("MaximumRingRadius", - toString(ui.GetDouble("MAXRINGRAD"))), Pvl::Replace); + std::to_string(ui.GetDouble("MAXRINGRAD"))), Pvl::Replace); } // If they want the res. from the mapfile, delete it from the camera so @@ -146,7 +146,7 @@ void IsisMain() { if (!ui.GetBoolean("MATCHMAP")) { if(ui.GetString("PIXRES") == "MPP") { userGrp.addKeyword(PvlKeyword("PixelResolution", - toString(ui.GetDouble("RESOLUTION"))), + std::to_string(ui.GetDouble("RESOLUTION"))), Pvl::Replace); if(userGrp.hasKeyword("Scale")) { userGrp.deleteKeyword("Scale"); @@ -154,7 +154,7 @@ void IsisMain() { } else if(ui.GetString("PIXRES") == "PPD") { userGrp.addKeyword(PvlKeyword("Scale", - toString(ui.GetDouble("RESOLUTION"))), + std::to_string(ui.GetDouble("RESOLUTION"))), Pvl::Replace); if(userGrp.hasKeyword("PixelResolution")) { userGrp.deleteKeyword("PixelResolution"); @@ -196,16 +196,16 @@ void IsisMain() { double minrad, maxrad, minaz, maxaz; incam->ringRange(minrad, maxrad, minaz, maxaz, userMap); if(!ui.WasEntered("MINRINGRAD")) { - userGrp.addKeyword(PvlKeyword("MinimumRingRadius", toString(minrad)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumRingRadius", std::to_string(minrad)), Pvl::Replace); } if(!ui.WasEntered("MAXRINGRAD")) { - userGrp.addKeyword(PvlKeyword("MaximumRingRadius", toString(maxrad)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumRingRadius", std::to_string(maxrad)), Pvl::Replace); } if(!ui.WasEntered("MINRINGLON")) { - userGrp.addKeyword(PvlKeyword("MinimumRingLongitude", toString(minaz)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumRingLongitude", std::to_string(minaz)), Pvl::Replace); } if(!ui.WasEntered("MAXRINGLON")) { - userGrp.addKeyword(PvlKeyword("MaximumRingLongitude", toString(maxaz)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumRingLongitude", std::to_string(maxaz)), Pvl::Replace); } } else if(ui.GetString("RINGLONSEAM") == "ERROR") { @@ -281,14 +281,14 @@ void IsisMain() { // Create an alpha cube group for the output cube if(!ocube->hasGroup("AlphaCube")) { PvlGroup alpha("AlphaCube"); - alpha += PvlKeyword("AlphaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("AlphaLines", toString(icube->lineCount())); - alpha += PvlKeyword("AlphaStartingSample", toString(0.5)); - alpha += PvlKeyword("AlphaStartingLine", toString(0.5)); - alpha += PvlKeyword("AlphaEndingSample", toString(icube->sampleCount() + 0.5)); - alpha += PvlKeyword("AlphaEndingLine", toString(icube->lineCount() + 0.5)); - alpha += PvlKeyword("BetaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("BetaLines", toString(icube->lineCount())); + alpha += PvlKeyword("AlphaSamples", std::to_string(icube->sampleCount())); + alpha += PvlKeyword("AlphaLines", std::to_string(icube->lineCount())); + alpha += PvlKeyword("AlphaStartingSample", std::to_string(0.5)); + alpha += PvlKeyword("AlphaStartingLine", std::to_string(0.5)); + alpha += PvlKeyword("AlphaEndingSample", std::to_string(icube->sampleCount() + 0.5)); + alpha += PvlKeyword("AlphaEndingLine", std::to_string(icube->lineCount() + 0.5)); + alpha += PvlKeyword("BetaSamples", std::to_string(icube->sampleCount())); + alpha += PvlKeyword("BetaLines", std::to_string(icube->lineCount())); ocube->putGroup(alpha); } @@ -387,7 +387,7 @@ void IsisMain() { startLine -= offset; } - if (((QString)instGrp["Framelets"]).toUpper() == "EVEN") { + if ((QString::fromStdString(instGrp["Framelets"])).toUpper() == "EVEN") { startLine += frameSize; } @@ -558,7 +558,7 @@ void PrintMap() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); @@ -572,7 +572,7 @@ void LoadMapRes() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Set resolution @@ -620,7 +620,7 @@ void LoadMapRange() { // Get map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Set ground range keywords that are found in mapfile @@ -664,7 +664,7 @@ void LoadCameraRange() { // Get the map projection file provided by the user Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); // Open the input cube, get the camera object, and the cam map projection Cube c; diff --git a/isis/src/base/apps/skymap/main.cpp b/isis/src/base/apps/skymap/main.cpp index edd52a1abd..c300d05665 100644 --- a/isis/src/base/apps/skymap/main.cpp +++ b/isis/src/base/apps/skymap/main.cpp @@ -71,7 +71,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Open the input cube, get the camera object, and the cam map projection @@ -85,8 +85,8 @@ void IsisMain() { // Add the default mapping info to the user entered mapping group userGrp.addKeyword(PvlKeyword("TargetName", "Sky"), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("EquatorialRadius", toString(1.0)), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("PolarRadius", toString(1.0)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("EquatorialRadius", std::to_string(1.0)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("PolarRadius", std::to_string(1.0)), Pvl::Replace); userGrp.addKeyword(PvlKeyword("LatitudeType", "Planetocentric"), Pvl::Replace); if (!userGrp.hasKeyword("LongitudeDirection")) { userGrp.addKeyword(PvlKeyword("LongitudeDirection", "PositiveWest"), Pvl::Replace); @@ -100,36 +100,36 @@ void IsisMain() { // Get the default ra/dec range double minRa, maxRa, minDec, maxDec; incam->RaDecRange(minRa, maxRa, minDec, maxDec); - userGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minRa)), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxRa)), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minDec)), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxDec)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(minRa)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(maxRa)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(minDec)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(maxDec)), Pvl::Replace); incam->SetImage(icube->sampleCount() / 2.0, icube->lineCount() / 2.0); double centerRa = incam->RightAscension(); - userGrp.addKeyword(PvlKeyword("CenterLongitude", toString(centerRa)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("CenterLongitude", std::to_string(centerRa)), Pvl::Replace); } if(ui.GetString("DEFAULTSCALE") == "CAMERA") { double res = incam->RaDecResolution(); - userGrp.addKeyword(PvlKeyword("Scale", toString(1.0 / res)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("Scale", std::to_string(1.0 / res)), Pvl::Replace); } // Override computed range with the users request if(ui.WasEntered("SRA")) { - userGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(ui.GetDouble("SRA"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLongitude", std::to_string(ui.GetDouble("SRA"))), Pvl::Replace); } if(ui.WasEntered("ERA")) { - userGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(ui.GetDouble("ERA"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLongitude", std::to_string(ui.GetDouble("ERA"))), Pvl::Replace); } if(ui.WasEntered("SDEC")) { - userGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(ui.GetDouble("SDEC"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLatitude", std::to_string(ui.GetDouble("SDEC"))), Pvl::Replace); } if(ui.WasEntered("EDEC")) { - userGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(ui.GetDouble("EDEC"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLatitude", std::to_string(ui.GetDouble("EDEC"))), Pvl::Replace); } // Get the resolution from the user if they decided to enter it if(ui.GetString("DEFAULTSCALE") == "USER") { - userGrp.addKeyword(PvlKeyword("Scale", toString(ui.GetDouble("SCALE"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("Scale", std::to_string(ui.GetDouble("SCALE"))), Pvl::Replace); } // Create the projection @@ -183,14 +183,14 @@ void IsisMain() { // Create an alpha cube group for the output cube if(!ocube->hasGroup("AlphaCube")) { PvlGroup alpha("AlphaCube"); - alpha += PvlKeyword("AlphaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("AlphaLines", toString(icube->lineCount())); - alpha += PvlKeyword("AlphaStartingSample", toString(0.5)); - alpha += PvlKeyword("AlphaStartingLine", toString(0.5)); - alpha += PvlKeyword("AlphaEndingSample", toString(icube->sampleCount() + 0.5)); - alpha += PvlKeyword("AlphaEndingLine", toString(icube->lineCount() + 0.5)); - alpha += PvlKeyword("BetaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("BetaLines", toString(icube->lineCount())); + alpha += PvlKeyword("AlphaSamples", std::to_string(icube->sampleCount())); + alpha += PvlKeyword("AlphaLines", std::to_string(icube->lineCount())); + alpha += PvlKeyword("AlphaStartingSample", std::to_string(0.5)); + alpha += PvlKeyword("AlphaStartingLine", std::to_string(0.5)); + alpha += PvlKeyword("AlphaEndingSample", std::to_string(icube->sampleCount() + 0.5)); + alpha += PvlKeyword("AlphaEndingLine", std::to_string(icube->lineCount() + 0.5)); + alpha += PvlKeyword("BetaSamples", std::to_string(icube->sampleCount())); + alpha += PvlKeyword("BetaLines", std::to_string(icube->lineCount())); ocube->putGroup(alpha); } @@ -279,7 +279,7 @@ void PrintMap() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); //Write map file out to the log @@ -292,7 +292,7 @@ void LoadMapRes() { // Get mapping group from map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Set resolution @@ -332,7 +332,7 @@ void LoadMapRange() { // Get map file Pvl userMap; - userMap.read(ui.GetFileName("MAP")); + userMap.read(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); // Set ground range keywords that are found in mapfile diff --git a/isis/src/base/apps/skypt/skypt.cpp b/isis/src/base/apps/skypt/skypt.cpp index 3d8ca330d5..513b624aba 100644 --- a/isis/src/base/apps/skypt/skypt.cpp +++ b/isis/src/base/apps/skypt/skypt.cpp @@ -75,14 +75,14 @@ namespace Isis{ // Create group with sky position PvlGroup sp("SkyPoint"); { - sp += PvlKeyword("Filename", FileName(channel).expanded()); - sp += PvlKeyword("Sample", toString(cam->Sample())); - sp += PvlKeyword("Line", toString(cam->Line())); - sp += PvlKeyword("RightAscension", toString(cam->RightAscension())); - sp += PvlKeyword("Declination", toString(cam->Declination())); - sp += PvlKeyword("EphemerisTime", toString(cam->time().Et())); - sp += PvlKeyword("PixelValue", PixelToString(b[0])); - sp += PvlKeyword("CelestialNorthClockAngle", toString(rot), "degrees"); + sp += PvlKeyword("Filename", FileName(channel).expanded().toStdString()); + sp += PvlKeyword("Sample", std::to_string(cam->Sample())); + sp += PvlKeyword("Line", std::to_string(cam->Line())); + sp += PvlKeyword("RightAscension", std::to_string(cam->RightAscension())); + sp += PvlKeyword("Declination", std::to_string(cam->Declination())); + sp += PvlKeyword("EphemerisTime", std::to_string(cam->time().Et())); + sp += PvlKeyword("PixelValue", PixelToString(b[0]).toStdString()); + sp += PvlKeyword("CelestialNorthClockAngle", std::to_string(rot), "degrees"); } //Write the group to the screen @@ -101,10 +101,10 @@ namespace Isis{ temp.setTerminator(""); temp.addGroup(sp); if (append) { - temp.append(ui.GetAsString("TO")); + temp.append(ui.GetAsString("TO").toStdString()); } else { - temp.write(ui.GetAsString("TO")); + temp.write(ui.GetAsString("TO").toStdString()); } } @@ -135,7 +135,7 @@ namespace Isis{ } for(int i = 0; i < sp.keywords(); i++) { - os << (QString)sp[i]; + os << sp[i]; if (i < sp.keywords() - 1) { os << ","; } diff --git a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp index 12f1904726..336871d409 100644 --- a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp +++ b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp @@ -366,15 +366,15 @@ namespace Isis { double spB[3], sB[3]; m_camera->instrumentPosition(spB); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[1]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[2]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[0]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[1]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(std::to_string(spB[2]), "km"); try { m_camera->sunPosition(sB); - gp->findKeyword("SunPosition").addValue(toString(sB[0]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[1]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[2]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[0]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[1]), "km"); + gp->findKeyword("SunPosition").addValue(std::to_string(sB[2]), "km"); } catch (IException &e) { gp->findKeyword("SunPosition").addValue("Null"); @@ -383,15 +383,15 @@ namespace Isis { } std::vectorlookB = m_camera->lookDirectionBodyFixed(); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[0]), "DEGREE"); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[1]), "DEGREE"); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[2]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(std::to_string(lookB[0]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(std::to_string(lookB[1]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(std::to_string(lookB[2]), "DEGREE"); try { std::vectorlookJ = m_camera->lookDirectionJ2000(); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[0]), "DEGREE"); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[1]), "DEGREE"); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[2]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(std::to_string(lookJ[0]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(std::to_string(lookJ[1]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(std::to_string(lookJ[2]), "DEGREE"); } catch (IException &e) { gp->findKeyword("LookDirectionJ2000").addValue("Null"); @@ -402,9 +402,9 @@ namespace Isis { try { double lookC[3]; m_camera->LookDirection(lookC); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[0]), "DEGREE"); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[1]), "DEGREE"); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[2]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(std::to_string(lookC[0]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(std::to_string(lookC[1]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(std::to_string(lookC[2]), "DEGREE"); } catch (IException &e) { gp->findKeyword("LookDirectionCamera").addValue("Null"); diff --git a/isis/src/base/objs/Spice/Spice.cpp b/isis/src/base/objs/Spice/Spice.cpp index 1596745576..0b5359bbcc 100644 --- a/isis/src/base/objs/Spice/Spice.cpp +++ b/isis/src/base/objs/Spice/Spice.cpp @@ -200,7 +200,7 @@ namespace Isis { kernel_pvl << kernels; json props; - if (kernels["InstrumentPointing"][0].toUpper() == "NADIR") { + if (QString::fromStdString(kernels["InstrumentPointing"][0]).toUpper() == "NADIR") { props["nadir"] = true; } diff --git a/isis/src/base/objs/Target/Target.cpp b/isis/src/base/objs/Target/Target.cpp index 145862dfbf..0fb2a94b97 100644 --- a/isis/src/base/objs/Target/Target.cpp +++ b/isis/src/base/objs/Target/Target.cpp @@ -122,7 +122,7 @@ namespace Isis { PvlGroup &kernels = label.findGroup("Kernels", Pvl::Traverse); - QString trykey = "NaifIkCode"; + std::string trykey = "NaifIkCode"; m_systemName = new QString; @@ -133,7 +133,7 @@ namespace Isis { if (name().toUpper() == "SKY" && kernels.hasKeyword(trykey)) { m_radii[0] = m_radii[1] = m_radii[2] = Distance(1000.0, Distance::Meters); m_sky = true; - int ikCode = toInt(kernels[trykey][0]); + int ikCode = std::stoi(kernels[trykey][0]); *m_bodyCode = ikCode / 1000; // Check for override in kernel group if (kernels.hasKeyword("NaifSpkCode")) { diff --git a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp index 7833753421..70d286b20c 100644 --- a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp +++ b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp @@ -99,11 +99,11 @@ namespace Isis{ p.Progress()->SetText("Image was converted using 12-to-8 bit table. \nConverting prefix pixels back to 12 bit and saving line prefix data..."); } - Pvl inputLabel(in.expanded()); + Pvl inputLabel(in.expanded().toStdString()); if (inputLabel.hasKeyword("VALID_MAXIMUM")) { PvlKeyword labelValidMax = inputLabel.findKeyword("VALID_MAXIMUM"); if (labelValidMax[1] != "UNK") { - validMax = toInt(labelValidMax[1]); + validMax = std::stoi(labelValidMax[1]); } } diff --git a/isis/src/cassini/apps/vimscal/main.cpp b/isis/src/cassini/apps/vimscal/main.cpp index 80cd3da352..9edcef5ada 100644 --- a/isis/src/cassini/apps/vimscal/main.cpp +++ b/isis/src/cassini/apps/vimscal/main.cpp @@ -414,7 +414,7 @@ void calculateSolarRemove(Cube *icube, ProcessByLine *p) { solarFileName = solarFileName.highestVersion(); calibInfo += PvlKeyword("SolarColorFile", - solarFileName.originalPath() + "/" + solarFileName.name().toStdString()); + solarFileName.originalPath().toStdString() + "/" + solarFileName.name().toStdString()); p->SetInputCube(createCroppedFile(icube, solarFileName.expanded()), iatt); } @@ -608,7 +608,7 @@ void calculateSpecificEnergy(Cube *icube) { */ //USGS - coefficient /= (toDouble(inst["ExposureDuration"][0]) * 1.01725) / 1000.0 - 0.004; + coefficient /= (std::stod(inst["ExposureDuration"][0]) * 1.01725) / 1000.0 - 0.004; //University of Arizona @@ -654,13 +654,13 @@ void calculateSpecificEnergy(Cube *icube) { waveCalCube.open(waveCalFileName.expanded()); calibInfo += PvlKeyword("SpecificEnergyFile", - specEnergyFileName.originalPath() + "/" + specEnergyFileName.name()); + specEnergyFileName.originalPath().toStdString() + "/" + specEnergyFileName.name().toStdString()); if (g_visBool) { calibInfo += PvlKeyword("VisPerfFile", - visPerfFileName.originalPath() + "/" + visPerfFileName.name()); + visPerfFileName.originalPath().toStdString() + "/" + visPerfFileName.name().toStdString()); } calibInfo += PvlKeyword("WavelengthCalibrationFile", - waveCalFileName.originalPath() + "/" + waveCalFileName.name()); + waveCalFileName.originalPath().toStdString() + "/" + waveCalFileName.name().toStdString()); LineManager specEnergyMgr(specEnergyCube); LineManager visPerfMgr(specEnergyCube); @@ -765,7 +765,7 @@ void calculateVisDarkCurrent(Cube *icube) { FileName calFileName(calFile); calFileName = calFileName.highestVersion(); - calibInfo += PvlKeyword("DarkCurrentFile", calFileName.originalPath() + "/" + calFileName.name()); + calibInfo += PvlKeyword("DarkCurrentFile", calFileName.originalPath().toStdString() + "/" + calFileName.name().toStdString()); calFile = calFileName.expanded(); @@ -773,7 +773,7 @@ void calculateVisDarkCurrent(Cube *icube) { FILE *calFilePtr = fopen(calFile.toLatin1().data(), "r"); - double visExposure = toDouble(inst["ExposureDuration"][1]); + double visExposure = std::stod(inst["ExposureDuration"][1]); int sampleOffset, lineOffset; GetOffsets(*icube->label(), sampleOffset, lineOffset); @@ -1036,8 +1036,8 @@ if (!vis) { FileName calibrationFileName(calFile); calibrationFileName = calibrationFileName.highestVersion(); - calibInfo += PvlKeyword("FlatFile", calibrationFileName.originalPath() + - "/" + calibrationFileName.name()); + calibInfo += PvlKeyword("FlatFile", calibrationFileName.originalPath().toStdString() + + "/" + calibrationFileName.name().toStdString()); CubeAttributeInput iatt; p->SetInputCube(createCroppedFile(icube, calibrationFileName.expanded(), true), iatt); @@ -1094,7 +1094,7 @@ void GetOffsets(const Pvl &lab, int &finalSampOffset, int &finalLineOffset) { finalSampOffset = sampOffset; finalLineOffset = lineOffset; - QString samplingMode = QString(inst["SamplingMode"]).toUpper(); + QString samplingMode = QString::fromStdString(inst["SamplingMode"]).toUpper(); if(vis) { if(samplingMode == "NORMAL") { finalSampOffset = sampOffset - 1; diff --git a/isis/src/clementine/objs/HiresCamera/unitTest.cpp b/isis/src/clementine/objs/HiresCamera/unitTest.cpp index a41cf3ba17..cd1d45f44b 100644 --- a/isis/src/clementine/objs/HiresCamera/unitTest.cpp +++ b/isis/src/clementine/objs/HiresCamera/unitTest.cpp @@ -51,7 +51,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/clementine/objs/LwirCamera/unitTest.cpp b/isis/src/clementine/objs/LwirCamera/unitTest.cpp index 972b229d05..6496b25d8b 100644 --- a/isis/src/clementine/objs/LwirCamera/unitTest.cpp +++ b/isis/src/clementine/objs/LwirCamera/unitTest.cpp @@ -51,7 +51,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/clementine/objs/UvvisCamera/unitTest.cpp b/isis/src/clementine/objs/UvvisCamera/unitTest.cpp index 742319f655..c356d42bf1 100644 --- a/isis/src/clementine/objs/UvvisCamera/unitTest.cpp +++ b/isis/src/clementine/objs/UvvisCamera/unitTest.cpp @@ -56,7 +56,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/control/apps/cnetdiff/cnetdiff.cpp b/isis/src/control/apps/cnetdiff/cnetdiff.cpp index cdc7b9b7d4..eedc49f165 100644 --- a/isis/src/control/apps/cnetdiff/cnetdiff.cpp +++ b/isis/src/control/apps/cnetdiff/cnetdiff.cpp @@ -48,7 +48,7 @@ namespace Isis { ControlNet cnet2 = ControlNet(ui.GetFileName("FROM2")); if(ui.WasEntered("DIFF")) { - Pvl diffFile(ui.GetFileName("DIFF")); + Pvl diffFile(ui.GetFileName("DIFF").toStdString()); return cnetdiff(cnet1, cnet2, ui, &diffFile); } @@ -104,12 +104,12 @@ namespace Isis { } else { differences += PvlKeyword("Compare", "Different"); - differences += PvlKeyword("Reason", differenceReason); + differences += PvlKeyword("Reason", differenceReason.toStdString()); } Application::AppendAndLog(differences, &log); - if (ui.WasEntered("TO")) log.write(ui.GetFileName("TO")); + if (ui.WasEntered("TO")) log.write(ui.GetFileName("TO").toStdString()); differenceReason = ""; @@ -125,7 +125,7 @@ namespace Isis { } Pvl out = differencer.compare(fileName1, fileName2); - if (ui.WasEntered("TO")) out.write(ui.GetFileName("TO")); + if (ui.WasEntered("TO")) out.write(ui.GetFileName("TO").toStdString()); PvlGroup results("Results"); @@ -169,8 +169,8 @@ namespace Isis { return; } - QString id1 = net1Obj["NetworkId"][0]; - QString id2 = net2Obj["NetworkId"][0]; + QString id1 = QString::fromStdString(net1Obj["NetworkId"][0]); + QString id2 = QString::fromStdString(net2Obj["NetworkId"][0]); if (id1 != id2) { differenceReason = "The network IDs [" + @@ -180,8 +180,8 @@ namespace Isis { return; } - QString target1 = net1Obj["TargetName"][0]; - QString target2 = net2Obj["TargetName"][0]; + QString target1 = QString::fromStdString(net1Obj["TargetName"][0]); + QString target2 = QString::fromStdString(net2Obj["TargetName"][0]); if (target1 != target2) { differenceReason = "The TargetName values [" + @@ -237,12 +237,12 @@ namespace Isis { if(!filesMatch) { differenceReason = "Control Measure for Cube [" + - measure1["SerialNumber"][0] + "] " + differenceReason; + QString::fromStdString(measure1["SerialNumber"][0]) + "] " + differenceReason; } } if (!filesMatch) { - differenceReason = "Control Point [" + point1Pvl["PointId"][0] + + differenceReason = "Control Point [" + QString::fromStdString(point1Pvl["PointId"][0]) + "] " + differenceReason; } } @@ -303,14 +303,14 @@ namespace Isis { if (pvl1.size() != pvl2.size()) { filesMatch = false; - differenceReason = "Value '" + pvl1.name() + "' array size does not match."; + differenceReason = "Value '" + QString::fromStdString(pvl1.name()) + "' array size does not match."; return; } if (tolerances.hasKeyword(pvl1.name()) && tolerances[pvl1.name()].size() > 1 && pvl1.size() != tolerances[pvl1.name()].size()) { - QString msg = "Size of value '" + pvl1.name() + "' does not match with "; + QString msg = "Size of value '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of tolerances in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); } @@ -318,16 +318,16 @@ namespace Isis { if (ignorekeys.hasKeyword(pvl1.name()) && ignorekeys[pvl1.name()].size() > 1 && pvl1.size() != ignorekeys[pvl1.name()].size()) { - QString msg = "Size of value '" + pvl1.name() + "' does not match with "; + QString msg = "Size of value '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of ignore keys in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); } for(int i = 0; i < pvl1.size() && filesMatch; i++) { - QString val1 = pvl1[i]; - QString val2 = pvl2[i]; - QString unit1 = pvl1.unit(i); - QString unit2 = pvl2.unit(i); + QString val1 = QString::fromStdString(pvl1[i]); + QString val2 = QString::fromStdString(pvl2[i]); + QString unit1 = QString::fromStdString(pvl1.unit(i)); + QString unit2 = QString::fromStdString(pvl2.unit(i)); int ignoreIndex = 0; if (ignorekeys.hasKeyword(pvl1.name()) && ignorekeys[pvl1.name()].size() > 1) { @@ -340,7 +340,7 @@ namespace Isis { if (unit1.toLower() != unit2.toLower()) { filesMatch = false; - differenceReason = "Value '" + pvl1.name() + "': units do not match."; + differenceReason = "Value '" + QString::fromStdString(pvl1.name()) + "': units do not match."; return; } @@ -348,18 +348,18 @@ namespace Isis { double difference = abs(toDouble(val1) - toDouble(val2)); if (tolerances.hasKeyword(pvl1.name())) { - tolerance = toDouble((tolerances[pvl1.name()].size() == 1) ? + tolerance = std::stod((tolerances[pvl1.name()].size() == 1) ? tolerances[pvl1.name()][0] : tolerances[pvl1.name()][i]); } if (difference > tolerance) { filesMatch = false; if (pvl1.size() == 1) { - differenceReason = "Value [" + pvl1.name() + "] difference is " + + differenceReason = "Value [" + QString::fromStdString(pvl1.name()) + "] difference is " + toString(difference); } else { - differenceReason = "Value [" + pvl1.name() + "] at index " + + differenceReason = "Value [" + QString::fromStdString(pvl1.name()) + "] at index " + toString(i) + ": difference is " + toString(difference); } differenceReason += " (values are [" + val1 + "] and [" + @@ -370,7 +370,7 @@ namespace Isis { catch(IException &e) { if (val1.toLower() != val2.toLower()) { filesMatch = false; - differenceReason = "Value '" + pvl1.name() + "': values do not match."; + differenceReason = "Value '" + QString::fromStdString(pvl1.name()) + "': values do not match."; } } } diff --git a/isis/src/control/apps/cnetedit/cnetedit.cpp b/isis/src/control/apps/cnetedit/cnetedit.cpp index ab7314004d..ca3170b450 100644 --- a/isis/src/control/apps/cnetedit/cnetedit.cpp +++ b/isis/src/control/apps/cnetedit/cnetedit.cpp @@ -164,7 +164,7 @@ namespace Isis { cneteditValidator = nullptr; // Open DefFile and validate its' keywords and value type - defFile = new Pvl(ui.GetFileName("DEFFILE")); + defFile = new Pvl(ui.GetFileName("DEFFILE").toStdString()); // create cube serial number validation list snValidationList = new SerialNumberList(ui.GetFileName("FROMLIST")); @@ -331,7 +331,7 @@ namespace Isis { cneteditValidator = NULL; // First validate DefFile's keywords and value type - Pvl defFile(ui.GetFileName("DEFFILE")); + Pvl defFile(ui.GetFileName("DEFFILE").toStdString()); Pvl pvlTemplate("$ISISROOT/appdata/templates/cnet_validmeasure/validmeasure.def"); Pvl pvlResults; pvlTemplate.validatePvl(defFile, pvlResults); @@ -370,8 +370,8 @@ namespace Isis { if (keepLog) { Pvl outputLog; - outputLog.addKeyword(PvlKeyword("PointsDeleted", toString(numPointsDeleted))); - outputLog.addKeyword(PvlKeyword("MeasuresDeleted", toString(numMeasuresDeleted))); + outputLog.addKeyword(PvlKeyword("PointsDeleted", std::to_string(numPointsDeleted))); + outputLog.addKeyword(PvlKeyword("MeasuresDeleted", std::to_string(numMeasuresDeleted))); PvlObject lockedLog = createLog( "EditLocked", editLockedPoints, editLockedMeasures); @@ -388,7 +388,7 @@ namespace Isis { // Write the log QString logFileName = ui.GetFileName("LOG"); - outputLog.write(logFileName); + outputLog.write(logFileName.toStdString()); // Delete the structures keeping track of the ignored points and measures delete ignoredPoints; @@ -1055,7 +1055,7 @@ namespace Isis { if (keepLog) { // Make the keyword label the measure Serial Number, and the cause into the // value - PvlKeyword measureMessage(PvlKeyword(serial, cause)); + PvlKeyword measureMessage(PvlKeyword(serial.toStdString(), cause.toStdString())); // Using a map to make accessing by Point ID a O(1) to O(lg n) operation if (measuresLog->contains(pointId)) { @@ -1067,7 +1067,7 @@ namespace Isis { else { // Else there is no group for the Point ID of the measure being ignored, // so make a new group, add the measure, and insert it into the map - PvlGroup pointGroup(pointId); + PvlGroup pointGroup(pointId.toStdString()); pointGroup.addKeyword(measureMessage); (*measuresLog)[pointId] = pointGroup; } @@ -1084,12 +1084,12 @@ namespace Isis { * @return PvlObject Points log */ PvlObject createLog(QString label, QMap *pointsMap) { - PvlObject pointsLog(label); + PvlObject pointsLog(label.toStdString()); QList pointIds = pointsMap->keys(); for (int i = 0; i < pointIds.size(); i++) { QString pointId = pointIds.at(i); - pointsLog.addKeyword(PvlKeyword(pointId, (*pointsMap)[pointId])); + pointsLog.addKeyword(PvlKeyword(pointId.toStdString(), (*pointsMap)[pointId].toStdString())); } return pointsLog; @@ -1108,7 +1108,7 @@ namespace Isis { PvlObject createLog(QString label, QMap *pointsMap, QMap *measuresMap) { - PvlObject editLog(label); + PvlObject editLog(label.toStdString()); PvlObject pointsLog = createLog("Points", pointsMap); editLog.addObject(pointsLog); diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index 404a97c775..ee63488edb 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -654,7 +654,7 @@ namespace Isis { if (j < (int) seq[i].size() - 1) temp += ", "; } temp += ")"; - this->operator+=(QString::fromStdString(temp)); + this->operator+=(temp); } return *this; diff --git a/isis/src/core/src/PvlSequence.cpp b/isis/src/core/src/PvlSequence.cpp index 7ecb55a4c9..83bb386a4c 100644 --- a/isis/src/core/src/PvlSequence.cpp +++ b/isis/src/core/src/PvlSequence.cpp @@ -22,7 +22,7 @@ namespace Isis { */ PvlSequence &PvlSequence::operator=(PvlKeyword &key) { for(int i = 0; i < key.size(); i++) { - this->operator+=(key[i].toStdString()); + this->operator+=(key[i]); } return *this; } @@ -42,7 +42,7 @@ namespace Isis { PvlKeyword &key = pvl["temp"]; std::vector temp; for(int i = 0; i < key.size(); i++) { - temp.push_back(key[i].toStdString()); + temp.push_back(key[i]); } p_sequence.push_back(temp); return *this; diff --git a/isis/src/core/src/TableField.cpp b/isis/src/core/src/TableField.cpp index 6da42cf8a8..ff0f473ead 100644 --- a/isis/src/core/src/TableField.cpp +++ b/isis/src/core/src/TableField.cpp @@ -589,7 +589,7 @@ namespace Isis { */ PvlGroup TableField::pvlGroup() { PvlGroup group("Field"); - group += PvlKeyword("Name", QString::fromStdString(m_name)); + group += PvlKeyword("Name", m_name); if (m_type == TableField::Double) { group += PvlKeyword("Type", "Double"); } diff --git a/isis/src/dawn/objs/DawnFcCamera/unitTest.cpp b/isis/src/dawn/objs/DawnFcCamera/unitTest.cpp index 192b3cb705..fbe4553130 100644 --- a/isis/src/dawn/objs/DawnFcCamera/unitTest.cpp +++ b/isis/src/dawn/objs/DawnFcCamera/unitTest.cpp @@ -58,7 +58,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/dev/apps/camcoeffs/main.cpp b/isis/src/dev/apps/camcoeffs/main.cpp index 5354d67ea5..04afb1d955 100644 --- a/isis/src/dev/apps/camcoeffs/main.cpp +++ b/isis/src/dev/apps/camcoeffs/main.cpp @@ -160,22 +160,22 @@ void IsisMain() { PvlGroup res("Results"); if(ui.WasEntered("IAKCODE")) { - PvlKeyword naifFormatX("INS" + ui.GetString("IAKCODE") + "_TRANSX"); - naifFormatX += toString(eq1[0]); - naifFormatX += toString(eq1[1]); - naifFormatX += toString(eq1[2]); - PvlKeyword naifFormatY("INS" + ui.GetString("IAKCODE") + "_TRANSY"); - naifFormatY += toString(eq2[0]); - naifFormatY += toString(eq2[1]); - naifFormatY += toString(eq2[2]); - PvlKeyword naifFormatS("INS" + ui.GetString("IAKCODE") + "_ITRANSS"); - naifFormatS += toString(res1[0]); - naifFormatS += toString(res1[1]); - naifFormatS += toString(res1[2]); - PvlKeyword naifFormatL("INS" + ui.GetString("IAKCODE") + "_ITRANSL"); - naifFormatL += toString(res2[0]); - naifFormatL += toString(res2[1]); - naifFormatL += toString(res2[2]); + PvlKeyword naifFormatX("INS" + ui.GetString("IAKCODE").toStdString() + "_TRANSX"); + naifFormatX += std::to_string(eq1[0]); + naifFormatX += std::to_string(eq1[1]); + naifFormatX += std::to_string(eq1[2]); + PvlKeyword naifFormatY("INS" + ui.GetString("IAKCODE").toStdString() + "_TRANSY"); + naifFormatY += std::to_string(eq2[0]); + naifFormatY += std::to_string(eq2[1]); + naifFormatY += std::to_string(eq2[2]); + PvlKeyword naifFormatS("INS" + ui.GetString("IAKCODE").toStdString() + "_ITRANSS"); + naifFormatS += std::to_string(res1[0]); + naifFormatS += std::to_string(res1[1]); + naifFormatS += std::to_string(res1[2]); + PvlKeyword naifFormatL("INS" + ui.GetString("IAKCODE").toStdString() + "_ITRANSL"); + naifFormatL += std::to_string(res2[0]); + naifFormatL += std::to_string(res2[1]); + naifFormatL += std::to_string(res2[2]); res += naifFormatX; res += naifFormatY; @@ -183,10 +183,10 @@ void IsisMain() { res += naifFormatL; } else { - res += PvlKeyword("EquationX", inEquationX); - res += PvlKeyword("EquationY", inEquationY); - res += PvlKeyword("EquationS", outEquationS); - res += PvlKeyword("EquationL", outEquationL); + res += PvlKeyword("EquationX", inEquationX.toStdString()); + res += PvlKeyword("EquationY", inEquationY.toStdString()); + res += PvlKeyword("EquationS", outEquationS.toStdString()); + res += PvlKeyword("EquationL", outEquationL.toStdString()); } Application::Log(res); diff --git a/isis/src/galileo/objs/SsiCamera/unitTest.cpp b/isis/src/galileo/objs/SsiCamera/unitTest.cpp index f68d45e6bc..621a9c4de9 100644 --- a/isis/src/galileo/objs/SsiCamera/unitTest.cpp +++ b/isis/src/galileo/objs/SsiCamera/unitTest.cpp @@ -53,7 +53,7 @@ int main(void) { const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/hayabusa/apps/hyb1pds4gen/main.cpp b/isis/src/hayabusa/apps/hyb1pds4gen/main.cpp index 571d013a63..ba8ebe9a3b 100644 --- a/isis/src/hayabusa/apps/hyb1pds4gen/main.cpp +++ b/isis/src/hayabusa/apps/hyb1pds4gen/main.cpp @@ -41,7 +41,7 @@ void IsisMain() { QString translationFile = "$ISISROOT/appdata/translations/"; PvlGroup instGroup = inputLabel->findObject("IsisCube").findGroup("Instrument"); - if (instGroup["InstrumentId"][0].compare("NIRS", Qt::CaseInsensitive) == 0) { + if (QString::fromStdString(instGroup["InstrumentId"][0]).compare("NIRS", Qt::CaseInsensitive) == 0) { process.setImageType(ProcessExportPds4::BinSetSpectrum); QDomDocument &pdsLabel = process.StandardPds4Label(); @@ -134,7 +134,7 @@ void generateCSVOutput(Pvl &inputCubeLabel) { FileName csvOutput = imgOutput.removeExtension().setExtension("csv"); PvlGroup instGroup = inputCubeLabel.findObject("IsisCube").findGroup("Instrument"); - if (instGroup["InstrumentId"][0].compare("amica", Qt::CaseInsensitive) == 0) { + if (QString::fromStdString(instGroup["InstrumentId"][0]).compare("amica", Qt::CaseInsensitive) == 0) { if (inputCubeLabel.findObject("IsisCube").hasGroup("RadiometricCalibration")) { outFile.open(csvOutput.expanded().toLatin1().data(), std::ios::out); PvlGroup radiometricGroup = inputCubeLabel.findObject("IsisCube").findGroup("RadiometricCalibration"); diff --git a/isis/src/hayabusa/objs/HayabusaAmicaCamera/unitTest.cpp b/isis/src/hayabusa/objs/HayabusaAmicaCamera/unitTest.cpp index 5f0f9ebc2e..b86085a86c 100644 --- a/isis/src/hayabusa/objs/HayabusaAmicaCamera/unitTest.cpp +++ b/isis/src/hayabusa/objs/HayabusaAmicaCamera/unitTest.cpp @@ -90,7 +90,7 @@ void testCamera(Cube &c, double knownLat, double knownLon) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp b/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp index dbedb8d32a..b456cd863b 100644 --- a/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp +++ b/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp @@ -55,8 +55,8 @@ namespace Isis { QString instid; QString missid; try { - instid = fitsLabel.findGroup("FitsLabels").findKeyword("INSTRUME")[0]; - missid = fitsLabel.findGroup("FitsLabels").findKeyword ("SPCECRFT")[0]; + instid = QString::fromStdString(fitsLabel.findGroup("FitsLabels").findKeyword("INSTRUME")[0]); + missid = QString::fromStdString(fitsLabel.findGroup("FitsLabels").findKeyword ("SPCECRFT")[0]); } catch (IException &e) { QString msg = "Unable to read instrument ID, [INSTRUME], or spacecraft ID, [SPCECRFT], " @@ -86,7 +86,7 @@ namespace Isis { PvlGroup &instGrp = outputLabel.findGroup("Instrument",Pvl::Traverse); QString target; if (ui.WasEntered("TARGET")) { - instGrp["TargetName"] = ui.GetString("TARGET"); + instGrp["TargetName"] = ui.GetString("TARGET").toStdString(); } instGrp["ExposureDuration"].setUnits("seconds"); outputCube->putGroup(instGrp); @@ -107,12 +107,12 @@ namespace Isis { PvlToPvlTranslationManager archiveXlater (fitsLabel, transFile.expanded()); archiveXlater.Auto(outputLabel); PvlGroup &archGrp = outputLabel.findGroup("Archive", Pvl::Traverse); - QString source = archGrp.findKeyword("SourceProductId")[0]; - archGrp["SourceProductId"].setValue(FileName(source).baseName()); + QString source = QString::fromStdString(archGrp.findKeyword("SourceProductId")[0]); + archGrp["SourceProductId"].setValue(FileName(source).baseName().toStdString()); // Create YearDoy keyword in Archive group - iTime stime(outputLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0]); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + iTime stime(QString::fromStdString(outputLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0])); + PvlKeyword yeardoy("YearDoy", std::to_string(stime.Year()*1000 + stime.DayOfYear())); archGrp.addKeyword(yeardoy); outputCube->putGroup(archGrp); diff --git a/isis/src/hayabusa2/objs/Hyb2OncCamera/unitTest.cpp b/isis/src/hayabusa2/objs/Hyb2OncCamera/unitTest.cpp index f167ec883b..174af817e9 100644 --- a/isis/src/hayabusa2/objs/Hyb2OncCamera/unitTest.cpp +++ b/isis/src/hayabusa2/objs/Hyb2OncCamera/unitTest.cpp @@ -98,7 +98,7 @@ void testCamera(Cube &c, double knownLat, double knownLon) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/juno/objs/JunoCamera/unitTest.cpp b/isis/src/juno/objs/JunoCamera/unitTest.cpp index ca93b9227d..aa768b5662 100644 --- a/isis/src/juno/objs/JunoCamera/unitTest.cpp +++ b/isis/src/juno/objs/JunoCamera/unitTest.cpp @@ -61,8 +61,8 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); - double exposureDuration = toDouble( inst["ExposureDuration"][0] ); - QString stime = inst["StartTime"]; + double exposureDuration = std::stod( inst["ExposureDuration"][0] ); + QString stime = QString::fromStdString(inst["StartTime"]); double et; str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp b/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp index def372984d..18c6700646 100644 --- a/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp +++ b/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp @@ -27,8 +27,8 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); QString inFile = ui.GetFileName("FROM"); - Pvl lab(inFile); - QString dataFile = lab.findKeyword("FILE_NAME")[0]; + Pvl lab(inFile.toStdString()); + QString dataFile = QString::fromStdString(lab.findKeyword("FILE_NAME")[0]); // Detached labels use format keyword = "dataFile" value int keywordIndex = 1; @@ -80,27 +80,27 @@ void IsisMain() { int qaptr = 0; if (lab.hasKeyword("^SP_SPECTRUM_WAV")) { - wavptr = toInt(lab.findKeyword("^SP_SPECTRUM_WAV")[keywordIndex]) - 1; + wavptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_WAV")[keywordIndex]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_RAW")) { - rawptr = toInt(lab.findKeyword("^SP_SPECTRUM_RAW")[keywordIndex]) - 1; + rawptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_RAW")[keywordIndex]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_RAD")) { - radptr = toInt(lab.findKeyword("^SP_SPECTRUM_RAD")[keywordIndex]) - 1; + radptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_RAD")[keywordIndex]) - 1; } //older-format file without calibrated NIR2 data if (lab.hasKeyword("^SP_SPECTRUM_REF")) { - refptr1 = toInt(lab.findKeyword("^SP_SPECTRUM_REF")[keywordIndex]) - 1; + refptr1 = std::stoi(lab.findKeyword("^SP_SPECTRUM_REF")[keywordIndex]) - 1; } //newer-format file with calibrated NIR2 data and 2 different Reflectances if (lab.hasKeyword("^SP_SPECTRUM_REF1")) { - refptr1 = toInt(lab.findKeyword("^SP_SPECTRUM_REF1")[keywordIndex]) - 1; + refptr1 = std::stoi(lab.findKeyword("^SP_SPECTRUM_REF1")[keywordIndex]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_REF2")) { - refptr2 = toInt(lab.findKeyword("^SP_SPECTRUM_REF2")[keywordIndex]) - 1; + refptr2 = std::stoi(lab.findKeyword("^SP_SPECTRUM_REF2")[keywordIndex]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_QA")) { - qaptr = toInt(lab.findKeyword("^SP_SPECTRUM_QA")[keywordIndex]) - 1; + qaptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_QA")[keywordIndex]) - 1; } FILE *spcptr; @@ -128,10 +128,10 @@ void IsisMain() { } PvlObject wavobj = lab.findObject("SP_SPECTRUM_WAV"); - int wavlines = toInt(wavobj.findKeyword("LINES")[0]); - int wavsamps = toInt(wavobj.findKeyword("LINE_SAMPLES")[0]); - QString wavtype = wavobj.findKeyword("SAMPLE_TYPE"); - int wavbits = toInt(wavobj.findKeyword("SAMPLE_BITS")[0]); + int wavlines = std::stoi(wavobj.findKeyword("LINES")[0]); + int wavsamps = std::stoi(wavobj.findKeyword("LINE_SAMPLES")[0]); + QString wavtype = QString::fromStdString(wavobj.findKeyword("SAMPLE_TYPE")); + int wavbits = std::stoi(wavobj.findKeyword("SAMPLE_BITS")[0]); if (wavlines != 1 || wavsamps != 296 || wavtype != "MSB_UNSIGNED_INTEGER" || wavbits != 16) { QString msg = "Wavelength data in input file does not meet the following "; @@ -139,13 +139,13 @@ void IsisMain() { msg += "BitType: 16"; throw IException(IException::User, msg, _FILEINFO_); } - QString keyval = wavobj.findKeyword("SCALING_FACTOR")[0]; + QString keyval = QString::fromStdString(wavobj.findKeyword("SCALING_FACTOR")[0]); bool ok; double wavscale = keyval.toDouble(&ok); if (!ok) { wavscale = 1.0; } - keyval = wavobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(wavobj.findKeyword("OFFSET")[0]); double wavoffset = keyval.toDouble(&ok); if (!ok) { wavoffset = 0.0; @@ -167,10 +167,10 @@ void IsisMain() { } PvlObject rawobj = lab.findObject("SP_SPECTRUM_RAW"); - int rawlines = toInt(rawobj.findKeyword("LINES")[0]); - int rawsamps = toInt(rawobj.findKeyword("LINE_SAMPLES")[0]); - QString rawtype = rawobj.findKeyword("SAMPLE_TYPE"); - int rawbits = toInt(rawobj.findKeyword("SAMPLE_BITS")[0]); + int rawlines = std::stoi(rawobj.findKeyword("LINES")[0]); + int rawsamps = std::stoi(rawobj.findKeyword("LINE_SAMPLES")[0]); + QString rawtype = QString::fromStdString(rawobj.findKeyword("SAMPLE_TYPE")); + int rawbits = std::stoi(rawobj.findKeyword("SAMPLE_BITS")[0]); if (rawsamps != 296 || rawtype != "MSB_UNSIGNED_INTEGER" || rawbits != 16) { QString msg = "Raw data in input file does not meet the following "; @@ -178,12 +178,12 @@ void IsisMain() { msg += "BitType: 16"; throw IException(IException::User, msg, _FILEINFO_); } - keyval = rawobj.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(rawobj.findKeyword("SCALING_FACTOR")[0]); double rawscale = keyval.toDouble(&ok); if (!ok) { rawscale = 1.0; } - keyval = rawobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(rawobj.findKeyword("OFFSET")[0]); double rawoffset = keyval.toDouble(&ok); if (!ok) { rawoffset = 0.0; @@ -205,10 +205,10 @@ void IsisMain() { } PvlObject qaobj = lab.findObject("SP_SPECTRUM_QA"); - int qalines = toInt(qaobj.findKeyword("LINES")[0]); - int qasamps = toInt(qaobj.findKeyword("LINE_SAMPLES")[0]); - QString qatype = qaobj.findKeyword("SAMPLE_TYPE"); - int qabits = toInt(qaobj.findKeyword("SAMPLE_BITS")[0]); + int qalines = std::stoi(qaobj.findKeyword("LINES")[0]); + int qasamps = std::stoi(qaobj.findKeyword("LINE_SAMPLES")[0]); + QString qatype = QString::fromStdString(qaobj.findKeyword("SAMPLE_TYPE")); + int qabits = std::stoi(qaobj.findKeyword("SAMPLE_BITS")[0]); if (qalines != rawlines || qasamps != 296 || qatype != "MSB_UNSIGNED_INTEGER" || qabits != 16) { QString msg = "Quality Assessment data in input file does not meet the "; @@ -216,12 +216,12 @@ void IsisMain() { msg += "BitType=16"; throw IException(IException::User, msg, _FILEINFO_); } - keyval = qaobj.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(qaobj.findKeyword("SCALING_FACTOR")[0]); double qascale = keyval.toDouble(&ok); if (!ok) { qascale = 1.0; } - keyval = qaobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(qaobj.findKeyword("OFFSET")[0]); double qaoffset = keyval.toDouble(&ok); if (!ok) { qaoffset = 0.0; @@ -243,10 +243,10 @@ void IsisMain() { } PvlObject radobj = lab.findObject("SP_SPECTRUM_RAD"); - int radlines = toInt(radobj.findKeyword("LINES")[0]); - int radsamps = toInt(radobj.findKeyword("LINE_SAMPLES")[0]); - QString radtype = radobj.findKeyword("SAMPLE_TYPE"); - int radbits = toInt(radobj.findKeyword("SAMPLE_BITS")[0]); + int radlines = std::stoi(radobj.findKeyword("LINES")[0]); + int radsamps = std::stoi(radobj.findKeyword("LINE_SAMPLES")[0]); + QString radtype = QString::fromStdString(radobj.findKeyword("SAMPLE_TYPE")); + int radbits = std::stoi(radobj.findKeyword("SAMPLE_BITS")[0]); if (radlines != qalines || radsamps != 296 || radtype != "MSB_UNSIGNED_INTEGER" || radbits != 16) { QString msg = "Radiance data in input file does not meet the following "; @@ -254,12 +254,12 @@ void IsisMain() { msg += "BitType=16"; throw IException(IException::User, msg, _FILEINFO_); } - keyval = radobj.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(radobj.findKeyword("SCALING_FACTOR")[0]); double radscale = keyval.toDouble(&ok); if (!ok) { radscale = 1.0; } - keyval = radobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(radobj.findKeyword("OFFSET")[0]); double radoffset = keyval.toDouble(&ok); if (!ok) { radoffset = 0.0; @@ -291,10 +291,10 @@ void IsisMain() { refobj2 = lab.findObject("SP_SPECTRUM_REF2"); } - int reflines = toInt(refobj.findKeyword("LINES")[0]); - int refsamps = toInt(refobj.findKeyword("LINE_SAMPLES")[0]); - QString reftype = refobj.findKeyword("SAMPLE_TYPE"); - int refbits = toInt(refobj.findKeyword("SAMPLE_BITS")[0]); + int reflines = std::stoi(refobj.findKeyword("LINES")[0]); + int refsamps = std::stoi(refobj.findKeyword("LINE_SAMPLES")[0]); + QString reftype = QString::fromStdString(refobj.findKeyword("SAMPLE_TYPE")); + int refbits = std::stoi(refobj.findKeyword("SAMPLE_BITS")[0]); if (reflines != radlines || refsamps != 296 || reftype != "MSB_UNSIGNED_INTEGER" || refbits != 16) { QString msg = "Reflectance data in input file does not meet the following "; @@ -302,12 +302,12 @@ void IsisMain() { msg += "BitType=16"; throw IException(IException::User, msg, _FILEINFO_); } - keyval = refobj.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(refobj.findKeyword("SCALING_FACTOR")[0]); double refscale = keyval.toDouble(&ok); if (!ok) { refscale = 1.0; } - keyval = refobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(refobj.findKeyword("OFFSET")[0]); double refoffset = keyval.toDouble(&ok); if (!ok) { refoffset = 0.0; @@ -332,10 +332,10 @@ void IsisMain() { //import reflectance 2 if it exists double *ref2 = NULL; if (lab.hasKeyword("^SP_SPECTRUM_REF2")) { - int reflines2 = toInt(refobj2.findKeyword("LINES")[0]); - int refsamps2 = toInt(refobj2.findKeyword("LINE_SAMPLES")[0]); - QString reftype2 = refobj2.findKeyword("SAMPLE_TYPE"); - int refbits2 = toInt(refobj2.findKeyword("SAMPLE_BITS")[0]); + int reflines2 = std::stoi(refobj2.findKeyword("LINES")[0]); + int refsamps2 = std::stoi(refobj2.findKeyword("LINE_SAMPLES")[0]); + QString reftype2 = QString::fromStdString(refobj2.findKeyword("SAMPLE_TYPE")); + int refbits2 = std::stoi(refobj2.findKeyword("SAMPLE_BITS")[0]); if (reflines2 != radlines || refsamps2 != 296 || reftype2 != "MSB_UNSIGNED_INTEGER" || refbits2 != 16) { QString msg = "Reflectance #2 data in input file does not meet the following "; @@ -344,12 +344,12 @@ void IsisMain() { throw IException(IException::User, msg, _FILEINFO_); } - keyval = refobj2.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(refobj2.findKeyword("SCALING_FACTOR")[0]); double refscale2 = keyval.toDouble(&ok); if (!ok) { refscale2 = 1.0; } - keyval = refobj2.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(refobj2.findKeyword("OFFSET")[0]); double refoffset2 = keyval.toDouble(&ok); if (!ok) { refoffset2 = 0.0; diff --git a/isis/src/kaguya/apps/kaguyasp2isis/main.cpp b/isis/src/kaguya/apps/kaguyasp2isis/main.cpp index 1db52986fa..119815fd4f 100644 --- a/isis/src/kaguya/apps/kaguyasp2isis/main.cpp +++ b/isis/src/kaguya/apps/kaguyasp2isis/main.cpp @@ -26,7 +26,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); FileName inFile = ui.GetFileName("FROM"); - Pvl lab(inFile.expanded()); + Pvl lab(inFile.expanded().toStdString()); ofstream os; QString outFile = FileName(ui.GetFileName("TO")).expanded(); @@ -58,19 +58,19 @@ void IsisMain() { int qaptr = 0; if (lab.hasKeyword("^SP_SPECTRUM_WAV")) { - wavptr = toInt(lab.findKeyword("^SP_SPECTRUM_WAV")[0]) - 1; + wavptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_WAV")[0]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_RAW")) { - rawptr = toInt(lab.findKeyword("^SP_SPECTRUM_RAW")[0]) - 1; + rawptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_RAW")[0]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_RAD")) { - radptr = toInt(lab.findKeyword("^SP_SPECTRUM_RAD")[0]) - 1; + radptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_RAD")[0]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_REF")) { - refptr = toInt(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1; + refptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_QA")) { - qaptr = toInt(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1; + qaptr = std::stoi(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1; } FILE *spcptr; @@ -97,10 +97,10 @@ void IsisMain() { } PvlObject wavobj = lab.findObject("SP_SPECTRUM_WAV"); - int wavlines = toInt(wavobj.findKeyword("LINES")[0]); - int wavsamps = toInt(wavobj.findKeyword("LINE_SAMPLES")[0]); - QString wavtype = wavobj.findKeyword("SAMPLE_TYPE"); - int wavbits = toInt(wavobj.findKeyword("SAMPLE_BITS")[0]); + int wavlines = std::stoi(wavobj.findKeyword("LINES")[0]); + int wavsamps = std::stoi(wavobj.findKeyword("LINE_SAMPLES")[0]); + QString wavtype = QString::fromStdString(wavobj.findKeyword("SAMPLE_TYPE")); + int wavbits = std::stoi(wavobj.findKeyword("SAMPLE_BITS")[0]); if (wavlines != 1 || wavsamps != 296 || wavtype != "MSB_UNSIGNED_INTEGER" || wavbits != 16) { QString msg = "Wavelength data in input file does not meet the following "; @@ -108,13 +108,13 @@ void IsisMain() { msg += "BitType: 16"; throw IException(IException::User, msg, _FILEINFO_); } - QString keyval = wavobj.findKeyword("SCALING_FACTOR")[0]; + QString keyval = QString::fromStdString(wavobj.findKeyword("SCALING_FACTOR")[0]); bool ok; double wavscale = keyval.toDouble(&ok); if (!ok) { wavscale = 1.0; } - keyval = wavobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(wavobj.findKeyword("OFFSET")[0]); double wavoffset = keyval.toDouble(&ok); if (!ok) { wavoffset = 0.0; @@ -136,10 +136,10 @@ void IsisMain() { } PvlObject rawobj = lab.findObject("SP_SPECTRUM_RAW"); - int rawlines = toInt(rawobj.findKeyword("LINES")[0]); - int rawsamps = toInt(rawobj.findKeyword("LINE_SAMPLES")[0]); - QString rawtype = rawobj.findKeyword("SAMPLE_TYPE"); - int rawbits = toInt(rawobj.findKeyword("SAMPLE_BITS")[0]); + int rawlines = std::stoi(rawobj.findKeyword("LINES")[0]); + int rawsamps = std::stoi(rawobj.findKeyword("LINE_SAMPLES")[0]); + QString rawtype = QString::fromStdString(rawobj.findKeyword("SAMPLE_TYPE")); + int rawbits = std::stoi(rawobj.findKeyword("SAMPLE_BITS")[0]); if (rawsamps != 296 || rawtype != "MSB_UNSIGNED_INTEGER" || rawbits != 16) { QString msg = "Raw data in input file does not meet the following "; @@ -147,12 +147,12 @@ void IsisMain() { msg += "BitType: 16"; throw IException(IException::User, msg, _FILEINFO_); } - keyval = rawobj.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(rawobj.findKeyword("SCALING_FACTOR")[0]); double rawscale = keyval.toDouble(&ok); if (!ok) { rawscale = 1.0; } - keyval = rawobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(rawobj.findKeyword("OFFSET")[0]); double rawoffset = keyval.toDouble(&ok); if (!ok) { rawoffset = 0.0; @@ -174,10 +174,10 @@ void IsisMain() { } PvlObject qaobj = lab.findObject("SP_SPECTRUM_QA"); - int qalines = toInt(qaobj.findKeyword("LINES")[0]); - int qasamps = toInt(qaobj.findKeyword("LINE_SAMPLES")[0]); - QString qatype = qaobj.findKeyword("SAMPLE_TYPE"); - int qabits = toInt(qaobj.findKeyword("SAMPLE_BITS")[0]); + int qalines = std::stoi(qaobj.findKeyword("LINES")[0]); + int qasamps = std::stoi(qaobj.findKeyword("LINE_SAMPLES")[0]); + QString qatype = QString::fromStdString(qaobj.findKeyword("SAMPLE_TYPE")); + int qabits = std::stoi(qaobj.findKeyword("SAMPLE_BITS")[0]); if (qalines != rawlines || qasamps != 296 || qatype != "MSB_UNSIGNED_INTEGER" || qabits != 16) { QString msg = "Quality Assessment data in input file does not meet the "; @@ -185,12 +185,12 @@ void IsisMain() { msg += "BitType=16"; throw IException(IException::User, msg, _FILEINFO_); } - keyval = qaobj.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(qaobj.findKeyword("SCALING_FACTOR")[0]); double qascale = keyval.toDouble(&ok); if (!ok) { qascale = 1.0; } - keyval = qaobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(qaobj.findKeyword("OFFSET")[0]); double qaoffset = keyval.toDouble(&ok); if (!ok) { qaoffset = 0.0; @@ -212,10 +212,10 @@ void IsisMain() { } PvlObject radobj = lab.findObject("SP_SPECTRUM_RAD"); - int radlines = toInt(radobj.findKeyword("LINES")[0]); - int radsamps = toInt(radobj.findKeyword("LINE_SAMPLES")[0]); - QString radtype = radobj.findKeyword("SAMPLE_TYPE"); - int radbits = toInt(radobj.findKeyword("SAMPLE_BITS")[0]); + int radlines = std::stoi(radobj.findKeyword("LINES")[0]); + int radsamps = std::stoi(radobj.findKeyword("LINE_SAMPLES")[0]); + QString radtype = QString::fromStdString(radobj.findKeyword("SAMPLE_TYPE")); + int radbits = std::stoi(radobj.findKeyword("SAMPLE_BITS")[0]); if (radlines != qalines || radsamps != 296 || radtype != "MSB_UNSIGNED_INTEGER" || radbits != 16) { QString msg = "Radiance data in input file does not meet the following "; @@ -223,12 +223,12 @@ void IsisMain() { msg += "BitType=16"; throw IException(IException::User, msg, _FILEINFO_); } - keyval = radobj.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(radobj.findKeyword("SCALING_FACTOR")[0]); double radscale = keyval.toDouble(&ok); if (!ok) { radscale = 1.0; } - keyval = radobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(radobj.findKeyword("OFFSET")[0]); double radoffset = keyval.toDouble(&ok); if (!ok) { radoffset = 0.0; @@ -250,10 +250,10 @@ void IsisMain() { } PvlObject refobj = lab.findObject("SP_SPECTRUM_REF"); - int reflines = toInt(refobj.findKeyword("LINES")[0]); - int refsamps = toInt(refobj.findKeyword("LINE_SAMPLES")[0]); - QString reftype = refobj.findKeyword("SAMPLE_TYPE"); - int refbits = toInt(refobj.findKeyword("SAMPLE_BITS")[0]); + int reflines = std::stoi(refobj.findKeyword("LINES")[0]); + int refsamps = std::stoi(refobj.findKeyword("LINE_SAMPLES")[0]); + QString reftype = QString::fromStdString(refobj.findKeyword("SAMPLE_TYPE")); + int refbits = std::stoi(refobj.findKeyword("SAMPLE_BITS")[0]); if (reflines != radlines || refsamps != 296 || reftype != "MSB_UNSIGNED_INTEGER" || refbits != 16) { QString msg = "Reflectance data in input file does not meet the following "; @@ -261,12 +261,12 @@ void IsisMain() { msg += "BitType=16"; throw IException(IException::User, msg, _FILEINFO_); } - keyval = refobj.findKeyword("SCALING_FACTOR")[0]; + keyval = QString::fromStdString(refobj.findKeyword("SCALING_FACTOR")[0]); double refscale = keyval.toDouble(&ok); if (!ok) { refscale = 1.0; } - keyval = refobj.findKeyword("OFFSET")[0]; + keyval = QString::fromStdString(refobj.findKeyword("OFFSET")[0]); double refoffset = keyval.toDouble(&ok); if (!ok) { refoffset = 0.0; diff --git a/isis/src/lo/objs/LoHighCamera/unitTest.cpp b/isis/src/lo/objs/LoHighCamera/unitTest.cpp index 69bf3f3f67..f11d77e886 100644 --- a/isis/src/lo/objs/LoHighCamera/unitTest.cpp +++ b/isis/src/lo/objs/LoHighCamera/unitTest.cpp @@ -72,7 +72,7 @@ int main(void) { const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); // approximate 1 tenth of a second since Lunar Orbiter did not provide double exposureDuration = .1; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/lo/objs/LoMediumCamera/unitTest.cpp b/isis/src/lo/objs/LoMediumCamera/unitTest.cpp index 4a63f87785..f7297d2c95 100644 --- a/isis/src/lo/objs/LoMediumCamera/unitTest.cpp +++ b/isis/src/lo/objs/LoMediumCamera/unitTest.cpp @@ -72,7 +72,7 @@ int main(void) { const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); // approximate 1 tenth of a second since Lunar Orbiter did not provide double exposureDuration = .1; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/lro/apps/lromakeflat/main.cpp b/isis/src/lro/apps/lromakeflat/main.cpp index ff24a6c09a..f793c046e0 100644 --- a/isis/src/lro/apps/lromakeflat/main.cpp +++ b/isis/src/lro/apps/lromakeflat/main.cpp @@ -290,7 +290,7 @@ void IsisMain() { for(unsigned int i = 0; i < g_excludedDetails.size(); i++) { excludeFile.addObject(g_excludedDetails[i]); } - excludeFile.write(FileName(ui.GetFileName("EXCLUDE")).expanded()); + excludeFile.write(FileName(ui.GetFileName("EXCLUDE")).expanded().toStdString()); } } // end of main @@ -360,9 +360,9 @@ void getCubeListNormalization(Matrix2d &matrix, int cubeWidth, int frameHeight, int frame = cubeLine/frameLineCount; double normalizationAverage = hist.Average(); matrix[listIndex][frame] = normalizationAverage; - normResults += PvlKeyword("FileName", g_list[listIndex].toString()); - normResults += PvlKeyword("Frame", toString(frame)); - normResults += PvlKeyword("Frame_MeanAverage", toString(normalizationAverage)); + normResults += PvlKeyword("FileName", g_list[listIndex].toString().toStdString()); + normResults += PvlKeyword("Frame", std::to_string(frame)); + normResults += PvlKeyword("Frame_MeanAverage", std::to_string(normalizationAverage)); Application::Log(normResults); } tmp.close(); @@ -474,8 +474,8 @@ void exclude(int listIndex, string reason) { g_excludedCubes.insert(pair(listIndex, reason)); PvlObject exclusion("Excluded_Items"); PvlGroup excludedFiles("Excluded_Files"); - excludedFiles += PvlKeyword("FileName", g_list[listIndex].toString()); - excludedFiles += PvlKeyword("Reason", QString::fromStdString(reason)); + excludedFiles += PvlKeyword("FileName", g_list[listIndex].toString().toStdString()); + excludedFiles += PvlKeyword("Reason", reason); Application::Log(excludedFiles); exclusion.addGroup(excludedFiles); g_excludedDetails.push_back(exclusion); @@ -503,9 +503,9 @@ void exclude(int listIndex, int frame, string reason){ g_excludedFrames.insert(pair < pair < int, int > , string > (pair(listIndex, frame), reason)); PvlObject exclusion("Excluded_Items"); PvlGroup excludedFiles("Excluded_Frames"); - excludedFiles += PvlKeyword("Frame_from_cube", g_list[listIndex].toString()); - excludedFiles += PvlKeyword("Frame_number", toString(frame)); - excludedFiles += PvlKeyword("Exclusion_reason", QString::fromStdString(reason)); + excludedFiles += PvlKeyword("Frame_from_cube", g_list[listIndex].toString().toStdString()); + excludedFiles += PvlKeyword("Frame_number", std::to_string(frame)); + excludedFiles += PvlKeyword("Exclusion_reason", reason); Application::Log(excludedFiles); exclusion.addGroup(excludedFiles); g_excludedDetails.push_back(exclusion); diff --git a/isis/src/lro/apps/lronac2isis/lronac2isis.cpp b/isis/src/lro/apps/lronac2isis/lronac2isis.cpp index 5a63e7df71..f92caacd82 100644 --- a/isis/src/lro/apps/lronac2isis/lronac2isis.cpp +++ b/isis/src/lro/apps/lronac2isis/lronac2isis.cpp @@ -75,7 +75,7 @@ namespace Isis { g_bterm.push_back(std::stod(btermKeyword[i])); } - double versionId = std::stod(QString::fromStdString(lab.findKeyword("PRODUCT_VERSION_ID")[0]).remove(QRegExp("^v"))); + double versionId = toDouble(QString::fromStdString(lab.findKeyword("PRODUCT_VERSION_ID")[0]).remove(QRegExp("^v"))); if(lab.findKeyword("FRAME_ID")[0] == "RIGHT" && versionId < 1.30) g_flip = true; else diff --git a/isis/src/lro/apps/lronac2pds/lronac2pds.cpp b/isis/src/lro/apps/lronac2pds/lronac2pds.cpp index d19064f987..4b892e6a53 100644 --- a/isis/src/lro/apps/lronac2pds/lronac2pds.cpp +++ b/isis/src/lro/apps/lronac2pds/lronac2pds.cpp @@ -50,7 +50,7 @@ namespace Isis { CubeAttributeInput &att = ui.GetInputAttribute("FROM"); Cube *inCube = p.SetInputCube(ui.GetCubeName("FROM"), att); - g_isIof = inCube->label()->findGroup("Radiometry", Pvl::Traverse).findKeyword("RadiometricType")[0].toUpper() == "IOF"; + g_isIof = QString::fromStdString(inCube->label()->findGroup("Radiometry", Pvl::Traverse).findKeyword("RadiometricType")[0]).toUpper() == "IOF"; FileName scaledCube("$TEMPORARY/" + FileName(ui.GetCubeName("FROM")).name()); scaledCube.addExtension("cub"); @@ -172,31 +172,31 @@ namespace Isis { QString unit = ""; if (labelPvl[outLabel[i].name()].unit() != "") { hasUnit = true; - unit = labelPvl[outLabel[i].name()].unit(); + unit = QString::fromStdString(labelPvl[outLabel[i].name()].unit()); } bool hasComment = false; QString comment = ""; if (labelPvl[outLabel[i].name()].comments() > 0) { hasComment = true; - comment = labelPvl[outLabel[i].name()].comment(0); + comment = QString::fromStdString(labelPvl[outLabel[i].name()].comment(0)); } labelPvl[outLabel[i].name()] = outLabel[i]; if (hasUnit) - labelPvl[outLabel[i].name()].setUnits(unit); + labelPvl[outLabel[i].name()].setUnits(unit.toStdString()); if (hasComment) - labelPvl[outLabel[i].name()].addComment(comment); + labelPvl[outLabel[i].name()].addComment(comment.toStdString()); } //Update the product ID //we switch the last char in the id from edr->cdr - QString prod_id = labelPvl["PRODUCT_ID"][0]; + QString prod_id = QString::fromStdString(labelPvl["PRODUCT_ID"][0]); labelPvl["PRODUCT_ID"][0].replace((prod_id.length()-1), 1, "C"); // Update the product creation time - labelPvl["PRODUCT_CREATION_TIME"].setValue(iTime::CurrentGMT()); + labelPvl["PRODUCT_CREATION_TIME"].setValue(iTime::CurrentGMT().toStdString()); - labelPvl["PRODUCT_VERSION_ID"].setValue(g_productVersionId); + labelPvl["PRODUCT_VERSION_ID"].setValue(g_productVersionId.toStdString()); // Update the "IMAGE" Object PvlObject &imageObject = labelPvl.findObject("IMAGE"); diff --git a/isis/src/lro/apps/lronaccal/lronaccal.cpp b/isis/src/lro/apps/lronaccal/lronaccal.cpp index ffc479b179..ce15f2f18f 100644 --- a/isis/src/lro/apps/lronaccal/lronaccal.cpp +++ b/isis/src/lro/apps/lronaccal/lronaccal.cpp @@ -371,12 +371,12 @@ namespace Isis { if(g_dark){ PvlKeyword darks("DarkFiles"); - darks.addValue(darkFiles[0]); + darks.addValue(darkFiles[0].toStdString()); if(g_nearestDark) calgrp += PvlKeyword("DarkFileType", "NearestDarkFile"); else if (g_nearestDarkPair){ calgrp += PvlKeyword("DarkFileType", "NearestDarkFilePair"); - darks.addValue(darkFiles[1]); + darks.addValue(darkFiles[1].toStdString()); } else calgrp += PvlKeyword("DarkFileType", "CustomDarkFile"); @@ -390,7 +390,7 @@ namespace Isis { } if(g_flatfield) - calgrp += PvlKeyword("FlatFile", flatFile); + calgrp += PvlKeyword("FlatFile", flatFile.toStdString()); if(g_radiometric) { if(g_iof) { calgrp += PvlKeyword("RadiometricType", "IOF"); @@ -686,7 +686,7 @@ namespace Isis { */ void GetCalibrationDirectory(QString calibrationType, QString &calibrationDirectory) { PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - QString missionDir = (QString) dataDir["LRO"]; + QString missionDir = QString::fromStdString(dataDir["LRO"]); if(calibrationType != "") calibrationType += "/"; diff --git a/isis/src/lro/apps/lronacecho/main.cpp b/isis/src/lro/apps/lronacecho/main.cpp index 9e58cd6718..9ef40faade 100644 --- a/isis/src/lro/apps/lronacecho/main.cpp +++ b/isis/src/lro/apps/lronacecho/main.cpp @@ -36,11 +36,11 @@ void IsisMain() { g_delta = ui.GetDouble("DELTA"); g_halfDelta = g_delta/2.0; - Pvl lab(ui.GetCubeName("FROM")); + Pvl lab(ui.GetCubeName("FROM").toStdString()); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); // Check if it is a NAC image - QString instId = inst["InstrumentId"]; + QString instId = QString::fromStdString(inst["InstrumentId"]); if (instId != "NACL" && instId != "NACR") { string msg = "This is not a NAC image. lrocnacecho requires a NAC image."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp b/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp index 6fc55f6fd6..b5b25b87f4 100644 --- a/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp +++ b/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp @@ -82,7 +82,7 @@ namespace Isis { while (algo != phoObj.endGroup()) { - if (algo->name().toLower() == "algorithm") { + if (QString::fromStdString(algo->name()).toLower() == "algorithm") { m_profiles.push_back(DbProfile(phoProf, DbProfile(*algo))); } ++algo; @@ -93,7 +93,7 @@ namespace Isis { QString errs(""); for (int i = 0; i < cube.bandCount(); i++) { - Parameters parms = findParameters(toDouble(center[i])); + Parameters parms = findParameters(std::stod(center[i])); if (parms.IsValid()) { parms.band = i + 1; parms.phoStd = photometry(parms, m_iRef, m_eRef, m_gRef); @@ -110,7 +110,7 @@ namespace Isis { // Check for errors and throw them all at the same time if (!errs.isEmpty()) { - errs += " --> Errors in the input PVL file [" + pvl.fileName() + "]"; + errs += " --> Errors in the input PVL file [" + QString::fromStdString(pvl.fileName()) + "]"; throw IException(IException::User, errs, _FILEINFO_); } @@ -236,10 +236,10 @@ namespace Isis { } pvl += PvlKeyword("Algorithm", "LROC_Empirical"); - pvl += PvlKeyword("AlgorithmVersion", toString(m_bandpho[0].algoVersion), "" ); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("AlgorithmVersion", std::to_string(m_bandpho[0].algoVersion), "" ); + pvl += PvlKeyword("IncRef", std::to_string(m_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", std::to_string(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", std::to_string(m_gRef), "degrees"); PvlKeyword units("FunctionUnits"); PvlKeyword phostd("PhotometricStandard"); @@ -250,13 +250,13 @@ namespace Isis { std::vector aTermKeywords; std::vector bTermKeywords; for (unsigned int i = 0; i < m_bandpho[0].aTerms.size(); i++) - aTermKeywords.push_back(PvlKeyword("A" + toString((int) i))); + aTermKeywords.push_back(PvlKeyword("A" + std::to_string((int) i))); for (unsigned int i = 0; i < m_bandpho[0].bTerms.size(); i++) - bTermKeywords.push_back(PvlKeyword("B" + toString((int) i))); + bTermKeywords.push_back(PvlKeyword("B" + std::to_string((int) i))); for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; - units.addValue(p.units); + units.addValue(p.units.toStdString()); phostd.addValue(std::to_string(p.phoStd)); bbc.addValue(std::to_string(p.wavelength)); bbct.addValue(std::to_string(p.tolerance)); diff --git a/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp b/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp index c5260b75db..2236984c48 100644 --- a/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp +++ b/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp @@ -596,7 +596,7 @@ namespace Isis { PvlKeyword uvBandwidth("Width"); for(int i = 0; i < pdsLab["FILTER_NUMBER"].size(); i++) { - if(toInt(pdsLab["FILTER_NUMBER"][i]) <= 2) { + if(std::stoi(pdsLab["FILTER_NUMBER"][i]) <= 2) { uvWavelength += pdsLab["CENTER_FILTER_WAVELENGTH"][i]; uvFilterNum += pdsLab["FILTER_NUMBER"][i]; @@ -766,7 +766,7 @@ namespace Isis { }; for(unsigned int i = 0; i < sizeof(QString) / sizeof(invalidKeywords); i++) { - if(pdsLab.hasKeyword(invalidKeywords[i])) { + if(pdsLab.hasKeyword(invalidKeywords[i].toStdString())) { QString msg = "Keyword ["; msg += invalidKeywords[i]; msg += "] must not exist"; diff --git a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp index 1641dd7b4f..8b42663446 100644 --- a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp +++ b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp @@ -769,9 +769,9 @@ namespace Isis { } if (g_dark) { PvlKeyword darks("DarkFiles"); - darks.addValue(QString::fromStdString(darkFiles[0])); + darks.addValue(darkFiles[0].toStdString()); if (darkFiles.size() > 1) - darks.addValue(QString::fromStdString(darkFiles[1])); + darks.addValue(darkFiles[1].toStdString()); calgrp += darks; } if (g_flatfield) diff --git a/isis/src/lro/apps/lrowacpho/Exponential.cpp b/isis/src/lro/apps/lrowacpho/Exponential.cpp index 168a532afa..8f8d27e4ab 100644 --- a/isis/src/lro/apps/lrowacpho/Exponential.cpp +++ b/isis/src/lro/apps/lrowacpho/Exponential.cpp @@ -116,9 +116,9 @@ namespace Isis { pvl.addComment(" F(phase) = A0*exp(B0*phase) + A1*exp(B1*phase) + ... + An*exp(Bn*phase)"); pvl += PvlKeyword("Algorithm", "Exponential"); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("IncRef", std::to_string(m_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", std::to_string(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", std::to_string(m_gRef), "degrees"); PvlKeyword units("ExponentialUnits"); PvlKeyword phostd("PhotometricStandard"); PvlKeyword bbc("BandBinCenter"); @@ -128,13 +128,13 @@ namespace Isis { std::vector < PvlKeyword > aTermKeywords; std::vector < PvlKeyword > bTermKeywords; for (unsigned int i = 0; i < m_bandpho[0].aTerms.size(); i++) - aTermKeywords.push_back(PvlKeyword("A" + toString((int) i))); + aTermKeywords.push_back(PvlKeyword("A" + std::to_string((int) i))); for (unsigned int i = 0; i < m_bandpho[0].bTerms.size(); i++) - bTermKeywords.push_back(PvlKeyword("B" + toString((int) i))); + bTermKeywords.push_back(PvlKeyword("B" + std::to_string((int) i))); for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; - units.addValue(p.units); + units.addValue(p.units.toStdString()); phostd.addValue(std::to_string(p.phoStd)); bbc.addValue(std::to_string(p.wavelength)); bbct.addValue(std::to_string(p.tolerance)); @@ -258,7 +258,7 @@ namespace Isis { DbProfile phoProf = DbProfile(phoObj); PvlObject::PvlGroupIterator algo = phoObj.beginGroup(); while (algo != phoObj.endGroup()) { - if (algo->name().toLower() == "algorithm") { + if (QString::fromStdString(algo->name()).toLower() == "algorithm") { m_profiles.push_back(DbProfile(phoProf, DbProfile(*algo))); } ++algo; @@ -268,7 +268,7 @@ namespace Isis { PvlKeyword center = label->findGroup("BandBin", Pvl::Traverse)["Center"]; QString errs(""); for (int i = 0; i < cube.bandCount(); i++) { - Parameters parms = findParameters(toDouble(center[i])); + Parameters parms = findParameters(std::stod(center[i])); if (parms.IsValid()) { parms.band = i + 1; //_camera->SetBand(i + 1); @@ -286,7 +286,7 @@ namespace Isis { // Check for errors and throw them all at the same time if (!errs.isEmpty()) { - errs += " --> Errors in the input PVL file \"" + pvl.fileName() + "\""; + errs += " --> Errors in the input PVL file \"" + QString::fromStdString(pvl.fileName()) + "\""; throw IException(IException::User, errs, _FILEINFO_); } diff --git a/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp b/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp index 635f3daed4..274c3ff395 100644 --- a/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp +++ b/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp @@ -121,9 +121,9 @@ namespace Isis { pvl.addComment(" F(mu,mu0,phase) = A1*exp(B1*phase) + A2*( mu0 + mu )exp(B2*phase) + A3*( mu0 + mu ) + A4"); pvl += PvlKeyword("Algorithm", "HapkeExponential"); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("IncRef", std::to_string(m_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", std::to_string(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", std::to_string(m_gRef), "degrees"); PvlKeyword units("HapkeExponentialUnits"); PvlKeyword phostd("PhotometricStandard"); PvlKeyword bbc("BandBinCenter"); @@ -133,13 +133,13 @@ namespace Isis { std::vector aTermKeywords; std::vector bTermKeywords; for (unsigned int i = 0; i < m_bandpho[0].aTerms.size(); i++) - aTermKeywords.push_back(PvlKeyword("A" + toString((int) i+1))); + aTermKeywords.push_back(PvlKeyword("A" + std::to_string((int) i+1))); for (unsigned int i = 0; i < m_bandpho[0].bTerms.size(); i++) - bTermKeywords.push_back(PvlKeyword("B" + toString((int) i+1))); + bTermKeywords.push_back(PvlKeyword("B" + std::to_string((int) i+1))); for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; - units.addValue(p.units); + units.addValue(p.units.toStdString()); phostd.addValue(std::to_string(p.phoStd)); bbc.addValue(std::to_string(p.wavelength)); bbct.addValue(std::to_string(p.tolerance)); @@ -261,7 +261,7 @@ namespace Isis { DbProfile phoProf = DbProfile(phoObj); PvlObject::PvlGroupIterator algo = phoObj.beginGroup(); while (algo != phoObj.endGroup()) { - if (algo->name().toLower() == "algorithm") { + if (QString::fromStdString(algo->name()).toLower() == "algorithm") { m_profiles.push_back(DbProfile(phoProf, DbProfile(*algo))); } ++algo; @@ -271,7 +271,7 @@ namespace Isis { PvlKeyword center = label->findGroup("BandBin", Pvl::Traverse)["Center"]; QString errs(""); for (int i = 0; i < cube.bandCount(); i++) { - Parameters parms = findParameters(toDouble(center[i])); + Parameters parms = findParameters(std::stod(center[i])); if (parms.IsValid()) { parms.band = i + 1; //_camera->SetBand(i + 1); @@ -289,7 +289,7 @@ namespace Isis { // Check for errors and throw them all at the same time if (!errs.isEmpty()) { - errs += " --> Errors in the input PVL file \"" + pvl.fileName() + "\""; + errs += " --> Errors in the input PVL file \"" + QString::fromStdString(pvl.fileName()) + "\""; throw IException(IException::User, errs, _FILEINFO_); } diff --git a/isis/src/lro/apps/lrowacpho/Hillier.cpp b/isis/src/lro/apps/lrowacpho/Hillier.cpp index 5204b2a519..3b65a16f82 100644 --- a/isis/src/lro/apps/lrowacpho/Hillier.cpp +++ b/isis/src/lro/apps/lrowacpho/Hillier.cpp @@ -114,9 +114,9 @@ namespace Isis { pvl.addComment(" F(phase) = B0*exp(-B1*phase) + A0 + A1*phase + A2*phase^2 + A3*phase^3 + A4*phase^4"); pvl += PvlKeyword("Algorithm", "Hillier"); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("IncRef", std::to_string(m_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", std::to_string(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", std::to_string(m_gRef), "degrees"); PvlKeyword units("HillierUnits"); PvlKeyword phostd("PhotometricStandard"); PvlKeyword bbc("BandBinCenter"); @@ -131,7 +131,7 @@ namespace Isis { PvlKeyword a4("A4"); for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; - units.addValue(p.units); + units.addValue(p.units.toStdString()); phostd.addValue(std::to_string(p.phoStd)); bbc.addValue(std::to_string(p.wavelength)); bbct.addValue(std::to_string(p.tolerance)); @@ -257,7 +257,7 @@ namespace Isis { DbProfile phoProf = DbProfile(phoObj); PvlObject::PvlGroupIterator algo = phoObj.beginGroup(); while (algo != phoObj.endGroup()) { - if (algo->name().toLower() == "algorithm") { + if (QString::fromStdString(algo->name()).toLower() == "algorithm") { m_profiles.push_back(DbProfile(phoProf, DbProfile(*algo))); } ++algo; @@ -267,7 +267,7 @@ namespace Isis { PvlKeyword center = label->findGroup("BandBin", Pvl::Traverse)["Center"]; QString errs(""); for (int i = 0; i < cube.bandCount(); i++) { - Parameters parms = findParameters(toDouble(center[i])); + Parameters parms = findParameters(std::stod(center[i])); if (parms.IsValid()) { parms.band = i + 1; //_camera->SetBand(i + 1); @@ -285,7 +285,7 @@ namespace Isis { // Check for errors and throw them all at the same time if (!errs.isEmpty()) { - errs += " --> Errors in the input PVL file \"" + pvl.fileName() + "\""; + errs += " --> Errors in the input PVL file \"" + QString::fromStdString(pvl.fileName()) + "\""; throw IException(IException::User, errs, _FILEINFO_); } diff --git a/isis/src/lro/apps/lrowacpho/main.cpp b/isis/src/lro/apps/lrowacpho/main.cpp index fcadea1170..56fdd3dca4 100644 --- a/isis/src/lro/apps/lrowacpho/main.cpp +++ b/isis/src/lro/apps/lrowacpho/main.cpp @@ -73,7 +73,7 @@ void IsisMain () { } // Get the name of the parameter file - Pvl par(ui.GetFileName("PHOPAR")); + Pvl par(ui.GetFileName("PHOPAR").toStdString()); IString algoName = PhotometricFunction::algorithmName(par); algoName.UpCase(); diff --git a/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp b/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp index 86386233d3..05f701229d 100644 --- a/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp +++ b/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp @@ -65,10 +65,10 @@ namespace Isis { m_currentMapIndex = 0; PvlObject phoModel = pvl.findObject("PhotometricModel"); - m_iRef = phoModel.findKeyword("Incref")[0].toDouble(); // Incidence refernce angle - m_eRef = phoModel.findKeyword("EmiRef")[0].toDouble(); // Emission reference angle - m_gRef = phoModel.findKeyword("Pharef")[0].toDouble(); // Phase reference angle - if (QString(phoModel.findKeyword("Units")[0]).toUpper() == "DEGREES") { + m_iRef = std::stod(phoModel.findKeyword("Incref")[0]); // Incidence refernce angle + m_eRef = std::stod(phoModel.findKeyword("EmiRef")[0]); // Emission reference angle + m_gRef = std::stod(phoModel.findKeyword("Pharef")[0]); // Phase reference angle + if (QString::fromStdString(phoModel.findKeyword("Units")[0]).toUpper() == "DEGREES") { m_isDegrees = true; } else { @@ -85,7 +85,7 @@ namespace Isis { PvlGroup paramGroup = phoModel.group(i); HapkeLRO::Parameters parms; - parms.bandBinCenter = paramGroup.findKeyword("BandBinCenter")[0].toDouble(); + parms.bandBinCenter = std::stod(paramGroup.findKeyword("BandBinCenter")[0]); for (int j = 0; j < center.size(); j++) { if (center[j] == paramGroup.findKeyword("BandBinCenter")[0]) { parms.band = j + 1; @@ -94,8 +94,8 @@ namespace Isis { PvlKeyword bands = paramGroup.findKeyword("Bands"); for (int j = 0; j < bands.size(); j++) { - parms.mapBands.push_back(bands[j].toInt() - 1); - parms.names.push_back(QString(paramBandNames[bands[j].toInt() - 1]).toUpper()); + parms.mapBands.push_back(std::stoi(bands[j]) - 1); + parms.names.push_back(QString::fromStdString(paramBandNames[std::stoi(bands[j]) - 1]).toUpper()); parms.values.push_back(0.0); } @@ -111,7 +111,7 @@ namespace Isis { m_hfunc = "HG"; if (phoModel.hasKeyword("Hfunc")) { - m_hfunc = phoModel.findKeyword("Hfunc")[0].toUpper(); + m_hfunc = QString::fromStdString(phoModel.findKeyword("Hfunc")[0]).toUpper(); } if (m_hfunc != "HG") { @@ -321,17 +321,17 @@ namespace Isis { * @param pvl Output PVL container write keywords */ void HapkeLRO::report(PvlContainer &pvl) { - pvl.addComment(QString("IoF/LS = w/4 * (p(g) + H(mu0,w)*H(mu,w)-1) * (1+Bc0*Bc(g,h))")); - pvl.addComment(QString(" where:")); - pvl.addComment(QString(" p(g) = (1-xi^2)/(1-2*xi*cos(g) + xi^2)^(3/2)")); - pvl.addComment(QString(" H(x,w) = (1+2*x)/(1+2*x*sqrt(1-w))")); - pvl.addComment(QString(" Bc(g,h) = (1 + (1-exp(-tan(g/2)/h))/(tan(g/2)/h))/(2*(1+tan(g/2)/h)^2)")); + pvl.addComment("IoF/LS = w/4 * (p(g) + H(mu0,w)*H(mu,w)-1) * (1+Bc0*Bc(g,h))"); + pvl.addComment(" where:"); + pvl.addComment(" p(g) = (1-xi^2)/(1-2*xi*cos(g) + xi^2)^(3/2)"); + pvl.addComment(" H(x,w) = (1+2*x)/(1+2*x*sqrt(1-w))"); + pvl.addComment(" Bc(g,h) = (1 + (1-exp(-tan(g/2)/h))/(tan(g/2)/h))/(2*(1+tan(g/2)/h)^2)"); pvl += PvlKeyword("Algorithm", "HapkeLRO"); - pvl += PvlKeyword("ParameterMapCube", m_paramMap->fileName()); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmiRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("ParameterMapCube", m_paramMap->fileName().toStdString()); + pvl += PvlKeyword("IncRef", std::to_string(m_iRef), "degrees"); + pvl += PvlKeyword("EmiRef", std::to_string(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", std::to_string(m_gRef), "degrees"); PvlKeyword units("Units"); if (m_isDegrees) { diff --git a/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp b/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp index 2cb022a056..7511d2af00 100644 --- a/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp +++ b/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp @@ -57,11 +57,11 @@ namespace Isis { m_currentMapIndex = 0; PvlObject phoModel = pvl.findObject("PhotometricModel"); - m_iRef = phoModel.findKeyword("Incref")[0].toDouble(); // Incidence refernce angle - m_eRef = phoModel.findKeyword("EmiRef")[0].toDouble(); // Emission reference angle - m_gRef = phoModel.findKeyword("Pharef")[0].toDouble(); // Phase reference angle + m_iRef = std::stod(phoModel.findKeyword("Incref")[0]); // Incidence refernce angle + m_eRef = std::stod(phoModel.findKeyword("EmiRef")[0]); // Emission reference angle + m_gRef = std::stod(phoModel.findKeyword("Pharef")[0]); // Phase reference angle - if (QString(phoModel.findKeyword("Units")[0]).toUpper() == "DEGREES") { + if (QString::fromStdString(phoModel.findKeyword("Units")[0]).toUpper() == "DEGREES") { m_isDegrees = true; } else { @@ -78,7 +78,7 @@ namespace Isis { PvlGroup paramGroup = phoModel.group(i); HapkeLROC::Parameters parms; - parms.bandBinCenter = paramGroup.findKeyword("BandBinCenter")[0].toDouble(); + parms.bandBinCenter = std::stod(paramGroup.findKeyword("BandBinCenter")[0]); for (int j = 0; j < center.size(); j++) { if (center[j] == paramGroup.findKeyword("BandBinCenter")[0]) { parms.band = j + 1; @@ -87,8 +87,8 @@ namespace Isis { PvlKeyword bands = paramGroup.findKeyword("Bands"); for (int j = 0; j < bands.size(); j++) { - parms.mapBands.push_back(bands[j].toInt() - 1); - parms.names.push_back(QString(paramBandNames[bands[j].toInt() - 1]).toUpper()); + parms.mapBands.push_back(std::stoi(bands[j]) - 1); + parms.names.push_back(QString::fromStdString(paramBandNames[std::stoi(bands[j]) - 1]).toUpper()); parms.values.push_back(0.0); } @@ -109,7 +109,7 @@ namespace Isis { m_hfunc = "HG"; if (phoModel.hasKeyword("Hfunc")) { - m_hfunc = phoModel.findKeyword("Hfunc")[0].toUpper(); + m_hfunc = QString::fromStdString(phoModel.findKeyword("Hfunc")[0]).toUpper(); } if (m_hfunc != "HG") { @@ -615,10 +615,10 @@ namespace Isis { */ void HapkeLROC::report(PvlContainer &pvl) { pvl += PvlKeyword("Algorithm", "HapkeLROC"); - pvl += PvlKeyword("ParameterMapCube", m_paramMap->fileName()); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmiRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("ParameterMapCube", m_paramMap->fileName().toStdString()); + pvl += PvlKeyword("IncRef", std::to_string(m_iRef), "degrees"); + pvl += PvlKeyword("EmiRef", std::to_string(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", std::to_string(m_gRef), "degrees"); PvlKeyword units("Units"); if (m_isDegrees) { diff --git a/isis/src/lro/apps/lrowacphomap/lrowacphomap.cpp b/isis/src/lro/apps/lrowacphomap/lrowacphomap.cpp index 93e0632839..45c7159d33 100644 --- a/isis/src/lro/apps/lrowacphomap/lrowacphomap.cpp +++ b/isis/src/lro/apps/lrowacphomap/lrowacphomap.cpp @@ -135,7 +135,7 @@ namespace Isis { QString msg = algoFileName.expanded() + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } - Pvl par(algoFileName.expanded()); + Pvl par(algoFileName.expanded().toStdString()); QString parCubeFile = ui.GetCubeName("PHOPARCUBE"); FileName parCubeFileName(parCubeFile); diff --git a/isis/src/lro/apps/mrf2isis/main.cpp b/isis/src/lro/apps/mrf2isis/main.cpp index 057cab1e54..fcc01eef72 100644 --- a/isis/src/lro/apps/mrf2isis/main.cpp +++ b/isis/src/lro/apps/mrf2isis/main.cpp @@ -27,10 +27,10 @@ void IsisMain() { QString labelFile = ui.GetFileName("FROM"); FileName inFile = ui.GetFileName("FROM"); QString id; - Pvl lab(inFile.expanded()); + Pvl lab(inFile.expanded().toStdString()); try { - id = (QString) lab.findKeyword("DATA_SET_ID"); + id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); } catch(IException &e) { QString msg = "Unable to read [DATA_SET_ID] from input file [" + @@ -56,7 +56,7 @@ void IsisMain() { Cube *outcube = p.SetOutputCube("TO"); QString bandorder; - bandorder = (QString) lab.findObject("IMAGE").findKeyword("BAND_STORAGE_TYPE"); + bandorder = QString::fromStdString(lab.findObject("IMAGE").findKeyword("BAND_STORAGE_TYPE")); bandorder = bandorder.toUpper(); if(bandorder == "BAND_SEQUENTIAL") { p.SetOrganization(Isis::ProcessImport::BSQ); @@ -140,7 +140,7 @@ void IsisMain() { // be done manually, because the frequency information was not // put in the PDS labels. if(!(instGrp.hasKeyword("Frequency"))) { - QString instmodeid = instGrp["InstrumentModeId"]; + QString instmodeid = QString::fromStdString(instGrp["InstrumentModeId"]); double frequency; if(instmodeid.startsWith("BASELINE_S") || instmodeid.startsWith("ZOOM_S")) { @@ -149,15 +149,15 @@ void IsisMain() { else { // BASELINE_X or ZOOM_X frequency = 7140000000.0; } - instGrp.addKeyword(PvlKeyword("Frequency", toString(frequency))); + instGrp.addKeyword(PvlKeyword("Frequency", std::to_string(frequency))); outcube->putGroup(instGrp); } PvlGroup kerns("Kernels"); if(id.startsWith("CHAN1") || id.startsWith("CH1")) { - kerns += PvlKeyword("NaifFrameCode", toString(-86001)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-86001)); } else { // LRO - kerns += PvlKeyword("NaifFrameCode", toString(-85700)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-85700)); } outcube->putGroup(kerns); } diff --git a/isis/src/lro/apps/mrf2pds/main.cpp b/isis/src/lro/apps/mrf2pds/main.cpp index 67947ec97d..187f1908f3 100644 --- a/isis/src/lro/apps/mrf2pds/main.cpp +++ b/isis/src/lro/apps/mrf2pds/main.cpp @@ -98,7 +98,7 @@ void IsisMain() { if(cInLabel->findObject("IsisCube").findGroup("Instrument").hasKeyword("MissionName")) { PvlKeyword &cKeyMissionName = cInLabel->findObject("IsisCube").findGroup("Instrument").findKeyword("MissionName"); - int sFound = cKeyMissionName[0].indexOf("CHANDRAYAAN"); + int sFound = QString::fromStdString(cKeyMissionName[0]).indexOf("CHANDRAYAAN"); if(sFound != -1) { cCubeLabel2 = PvlToPvlTranslationManager(cOrigLabel, "$ISISROOT/appdata/translations/Chandrayaan1MrfExportOrigLabel.trn"); cCubeLabel2.Auto(pdsLabel); @@ -176,7 +176,7 @@ void IsisMain() { * @param pcPdsLbl - Output Pds PVL */ void GetUserLabel(QString psUserLbl, Pvl &pcPdsLbl, bool pbLevel2) { - Pvl cUsrPvl(psUserLbl); + Pvl cUsrPvl(psUserLbl.toStdString()); /*if (pbLevel2 && (cUsrPvl.hasKeyword("SPACECRAFT_CLOCK_START_COUNT") || @@ -241,7 +241,7 @@ void GetSourceProductID(QString psSrcListFile, QString psSrcType, Pvl &pcPdsLbl) if(psSrcType == "LIST") { SerialNumberList cSnl = psSrcListFile; for(int i = 0; i < cSnl.size(); i++) { - cKeySrcPrdId += cSnl.serialNumber(i); + cKeySrcPrdId += cSnl.serialNumber(i).toStdString(); } } // ID's - add directly to the PvlKeyword @@ -327,7 +327,7 @@ void FixLabel(Pvl &pcPdsLbl, bool &pbLevel2) { PvlKeyword cKeySoftware("SOFTWARE_NAME", "ISIS3"); pcPdsLbl += cKeySoftware; - PvlKeyword cKeySoftwareVersion("SOFTWARE_VERSION_ID", Application::Version()); + PvlKeyword cKeySoftwareVersion("SOFTWARE_VERSION_ID", Application::Version().toStdString()); pcPdsLbl += cKeySoftwareVersion; // Specific to IMAGE Object @@ -339,11 +339,11 @@ void FixLabel(Pvl &pcPdsLbl, bool &pbLevel2) { // Update SAMPLE_TYPE from "IEEE_" to "PC_" if(cImageObject.hasKeyword("SAMPLE_TYPE")) { PvlKeyword &cSampleType = cImageObject.findKeyword("SAMPLE_TYPE"); - QString sVal = cSampleType[0]; + QString sVal = QString::fromStdString(cSampleType[0]); int iFound = sVal.indexOf('_'); if(iFound >= 0) { sVal.replace(0, iFound, "PC"); - cSampleType.setValue(sVal); + cSampleType.setValue(sVal.toStdString()); } } @@ -396,13 +396,13 @@ void FixLabel(Pvl &pcPdsLbl, bool &pbLevel2) { PvlKeyword cKeyRefLon("REFERENCE_LONGITUDE"); QString iStr = toString(dLon, 6); iStr += " "; - cKeyRefLon.setValue(iStr); + cKeyRefLon.setValue(iStr.toStdString()); cProjectionObject.addKeyword(cKeyRefLon); PvlKeyword cKeyRefLat("REFERENCE_LATITUDE"); iStr = toString(dLat, 6); iStr += " "; - cKeyRefLat.setValue(iStr); + cKeyRefLat.setValue(iStr.toStdString()); cProjectionObject.addKeyword(cKeyRefLat); } else { // Level3 Projection object @@ -433,31 +433,31 @@ void FixLabel(Pvl &pcPdsLbl, bool &pbLevel2) { if(cProjectionObject.hasKeyword("LINE_PROJECTION_OFFSET")) { PvlKeyword &cLineProjOffset = cProjectionObject.findKeyword("LINE_PROJECTION_OFFSET"); - QString sVal = cLineProjOffset[0]; + QString sVal = QString::fromStdString(cLineProjOffset[0]); int iFound = sVal.indexOf('<'); if(iFound >= 0) { sVal.remove(iFound, 1); - cLineProjOffset.setValue(sVal); + cLineProjOffset.setValue(sVal.toStdString()); } } if(cProjectionObject.hasKeyword("SAMPLE_PROJECTION_OFFSET")) { PvlKeyword &cSampleProjOffset = cProjectionObject.findKeyword("SAMPLE_PROJECTION_OFFSET"); - QString sVal = cSampleProjOffset[0]; + QString sVal = QString::fromStdString(cSampleProjOffset[0]); int iFound = sVal.indexOf('<'); if(iFound >= 0) { sVal.remove(iFound, 1); - cSampleProjOffset.setValue(sVal); + cSampleProjOffset.setValue(sVal.toStdString()); } } if(cProjectionObject.hasKeyword("MAP_SCALE")) { PvlKeyword &cMapScale = cProjectionObject.findKeyword("MAP_SCALE"); - QString sVal = cMapScale[0]; + QString sVal = QString::fromStdString(cMapScale[0]); int iFound = sVal.indexOf("EL"); if(iFound >= 0) { sVal.remove(iFound, 2); - cMapScale.setValue(sVal); + cMapScale.setValue(sVal.toStdString()); } } } diff --git a/isis/src/lro/objs/PhotometricFunction/PhotometricFunction.cpp b/isis/src/lro/objs/PhotometricFunction/PhotometricFunction.cpp index c90dd5c83e..f9236e6685 100644 --- a/isis/src/lro/objs/PhotometricFunction/PhotometricFunction.cpp +++ b/isis/src/lro/objs/PhotometricFunction/PhotometricFunction.cpp @@ -62,7 +62,7 @@ namespace Isis { * @return @b QString The algorithm name from the PVL object. */ QString PhotometricFunction::algorithmName( const PvlObject &pvl ) { - return pvl.findObject("PhotometricModel").findGroup("Algorithm", Pvl::Traverse).findKeyword("Name")[0]; + return QString::fromStdString(pvl.findObject("PhotometricModel").findGroup("Algorithm", Pvl::Traverse).findKeyword("Name")[0]); } diff --git a/isis/src/mariner/apps/mar102isis/main.cpp b/isis/src/mariner/apps/mar102isis/main.cpp index 28fa3b415b..1cf65be8a6 100644 --- a/isis/src/mariner/apps/mar102isis/main.cpp +++ b/isis/src/mariner/apps/mar102isis/main.cpp @@ -40,7 +40,7 @@ void IsisMain() { // Determine whether input is a raw Mariner 10 image or an Isis 2 cube bool isRaw = false; FileName inputFile = ui.GetFileName("FROM"); - Pvl label(inputFile.expanded()); + Pvl label(inputFile.expanded().toStdString()); // If the PVL created from the input labels is empty, then input is raw if(label.groups() + label.objects() + label.keywords() == 0) { @@ -179,7 +179,7 @@ void UpdateLabels(Cube *cube, const QString &labels) { // Create the instrument group PvlGroup inst("Instrument"); inst += PvlKeyword("SpacecraftName", "Mariner_10"); - inst += PvlKeyword("InstrumentId", "M10_VIDICON_" + ccamera); + inst += PvlKeyword("InstrumentId", "M10_VIDICON_" + ccamera.toStdString()); // Get the date int days = toInt(day); @@ -199,19 +199,19 @@ void UpdateLabels(Cube *cube, const QString &labels) { int year = toInt(yr); year += 1900; QString fullGMT = toString(year) + ":" + day + ":" + time; - archive += PvlKeyword("GMT", fullGMT); - archive += PvlKeyword("ImageNumber", fds); + archive += PvlKeyword("GMT", fullGMT.toStdString()); + archive += PvlKeyword("ImageNumber", fds.toStdString()); // Create the band bin group PvlGroup bandBin("BandBin"); QString filter = filterName; filter = filter.replace(")", ""); - bandBin += PvlKeyword("FilterName", filter); + bandBin += PvlKeyword("FilterName", filter.toStdString()); QString number = filterNum; - bandBin += PvlKeyword("FilterNumber", number); + bandBin += PvlKeyword("FilterNumber", number.toStdString()); bandBin += PvlKeyword("OriginalBand", "1"); QString center = toString(filterCenter); - bandBin += PvlKeyword("Center", center); + bandBin += PvlKeyword("Center", center.toStdString()); bandBin.findKeyword("Center").setUnits("micrometers"); // Dates taken from ASU Mariner website - http://ser.ses.asu.edu/M10/TXT/encounters.html and @@ -249,11 +249,11 @@ void UpdateLabels(Cube *cube, const QString &labels) { } // Place start time and exposure duration in intrument group - inst += PvlKeyword("StartTime", fullTime); - inst += PvlKeyword("ExposureDuration", exposure, "milliseconds"); + inst += PvlKeyword("StartTime", fullTime.toStdString()); + inst += PvlKeyword("ExposureDuration", exposure.toStdString(), "milliseconds"); // Open nominal positions pvl named by QString encounter - Pvl nomRx(target); + Pvl nomRx(target.toStdString()); // Allocate all keywords within reseaus groups well as the group its self PvlGroup rx("Reseaus"); @@ -273,7 +273,7 @@ void UpdateLabels(Cube *cube, const QString &labels) { // Camera dependent information QString camera = ""; - if(QString("M10_VIDICON_A") == inst["InstrumentId"][0]) { + if(QString("M10_VIDICON_A") == QString::fromStdString(inst["InstrumentId"][0])) { templ = "$mariner10/reseaus/mar10a.template.cub"; naif += "-76110"; camera = "M10_VIDICON_A_RESEAUS"; @@ -288,7 +288,7 @@ void UpdateLabels(Cube *cube, const QString &labels) { kernels += naif; // Find the correct PvlKeyword corresponding to the camera for nominal positions - PvlKeyword resnom = nomRx[camera]; + PvlKeyword resnom = nomRx[camera.toStdString()]; // This loop goes through the PvlKeyword resnom which contains data // in the format: line, sample, type, on each line. There are 111 reseaus for @@ -322,7 +322,7 @@ void UpdateLabels(Cube *cube, const QString &labels) { cubeLabels->findObject("IsisCube").addGroup(rx); PvlObject original("OriginalLabel"); - original += PvlKeyword("Label", labels); + original += PvlKeyword("Label", labels.toStdString()); Pvl olabel; olabel.addObject(original); OriginalLabel ol(olabel); @@ -333,7 +333,7 @@ void UpdateLabels(Cube *cube, const QString &labels) { void TranslateIsis2Labels(FileName &labelFile, Cube *oCube) { // Transfer the instrument group to the output cube QString transDir = "$ISISROOT/appdata/translations/"; - Pvl inputLabel(labelFile.expanded()); + Pvl inputLabel(labelFile.expanded().toStdString()); FileName transFile; transFile = transDir + "Mariner10isis2.trn"; @@ -350,20 +350,20 @@ void TranslateIsis2Labels(FileName &labelFile, Cube *oCube) { instrumentId.setValue("M10_VIDICON_" + instrumentId[0]); PvlKeyword &targetName = inst.findKeyword("TargetName"); - QString targetTail(targetName[0].mid(1)); + QString targetTail(QString::fromStdString(targetName[0]).mid(1)); targetTail = targetTail.toLower(); - targetName.setValue(targetName[0].at(0) + targetTail); + targetName.setValue((QString::fromStdString(targetName[0]).at(0) + targetTail).toStdString()); PvlKeyword &startTime = inst.findKeyword("StartTime"); - startTime.setValue(startTime[0].mid(0, startTime[0].size() - 1)); + startTime.setValue(QString::fromStdString(startTime[0]).mid(0, QString::fromStdString(startTime[0]).size() - 1).toStdString()); PvlGroup &archive = outputLabel->findGroup("Archive", Pvl::Traverse); PvlKeyword &imgNo = archive.findKeyword("ImageNumber"); - QString ino = imgNo[0]; + QString ino = QString::fromStdString(imgNo[0]); ino = ino.trimmed(); - imgNo.setValue(ino); + imgNo.setValue(ino.toStdString()); - iTime time(startTime[0]); + iTime time(QString::fromStdString(startTime[0])); if(time < iTime("1974-2-3T12:00:00")) { archive += PvlKeyword("Encounter", "Moon"); } @@ -383,7 +383,7 @@ void TranslateIsis2Labels(FileName &labelFile, Cube *oCube) { inst.findKeyword("ExposureDuration").setUnits("milliseconds"); PvlGroup &bBin = outputLabel->findGroup("BandBin", Pvl::Traverse); - QString filter = inputLabel.findObject("QUBE")["FILTER_NAME"]; + QString filter = QString::fromStdString(inputLabel.findObject("QUBE")["FILTER_NAME"]); if(filter != "F") { //Band Bin group bBin.findKeyword("Center").setUnits("micrometers"); @@ -396,12 +396,12 @@ void TranslateIsis2Labels(FileName &labelFile, Cube *oCube) { PvlKeyword &valid = reseaus.findKeyword("Valid"); for(int i = 0; i < valid.size(); i++) { - valid[i] = valid[i].mid(0, 1); + valid[i] = (QString::fromStdString(valid[i]).mid(0, 1)).toStdString(); } // Camera dependent information QString camera = ""; - if(QString("M10_VIDICON_A") == inst["InstrumentId"][0]) { + if(QString("M10_VIDICON_A") == QString::fromStdString(inst["InstrumentId"][0])) { templ = "$mariner10/reseaus/mar10a.template.cub"; kernels.findKeyword("NaifFrameCode").setValue("-76110"); camera = "M10_VIDICON_A_RESEAUS"; diff --git a/isis/src/mariner/apps/mar10cal/main.cpp b/isis/src/mariner/apps/mar10cal/main.cpp index 054c96be3a..9bfb3efd15 100644 --- a/isis/src/mariner/apps/mar10cal/main.cpp +++ b/isis/src/mariner/apps/mar10cal/main.cpp @@ -42,10 +42,10 @@ void IsisMain() { // Setup the input and make sure it is a mariner10 file UserInterface & ui = Application::GetUserInterface(); - Isis::Pvl lab(ui.GetCubeName("FROM")); + Isis::Pvl lab(ui.GetCubeName("FROM").toStdString()); Isis::PvlGroup & inst = lab.findGroup("Instrument", Pvl::Traverse); - QString mission = inst["SpacecraftName"]; + QString mission = QString::fromStdString(inst["SpacecraftName"]); if (mission != "Mariner_10") { string msg = "This is not a Mariner 10 image. Mar10cal requires a Mariner 10 image."; throw IException(IException::User, msg, _FILEINFO_); @@ -61,15 +61,15 @@ void IsisMain() { } // Get label parameters we will need for calibration equation - QString instId = inst["InstrumentId"]; + QString instId = QString::fromStdString(inst["InstrumentId"]); QString camera = instId.mid(instId.size()-1); - QString filter = (QString)(icube->group("BandBin"))["FilterName"]; + QString filter = QString::fromStdString(icube->group("BandBin")["FilterName"]); filter = filter.toUpper().mid(0,3); - QString target = inst["TargetName"]; + QString target = QString::fromStdString(inst["TargetName"]); - iTime startTime((QString) inst["StartTime"]); + iTime startTime(QString::fromStdString(inst["StartTime"])); double exposure = inst["ExposureDuration"]; double exposureOffset = 0.0; @@ -164,12 +164,12 @@ void IsisMain() { // Add the radiometry group PvlGroup calgrp("Radiometry"); - calgrp += PvlKeyword("DarkCurrentCube", dcCube->fileName()); + calgrp += PvlKeyword("DarkCurrentCube", dcCube->fileName().toStdString()); if (useBlem) { - calgrp += PvlKeyword("BlemishRemovalCube", blemCube->fileName()); + calgrp += PvlKeyword("BlemishRemovalCube", blemCube->fileName().toStdString()); } - calgrp += PvlKeyword("CoefficientCube", coCube.fileName()); - calgrp += PvlKeyword("AbsoluteCoefficient", toString(absCoef)); + calgrp += PvlKeyword("CoefficientCube", coCube.fileName().toStdString()); + calgrp += PvlKeyword("AbsoluteCoefficient", std::to_string(absCoef)); ocube->putGroup(calgrp); diff --git a/isis/src/mariner/apps/mar10clean/main.cpp b/isis/src/mariner/apps/mar10clean/main.cpp index d4646b8928..09f6db3c2a 100644 --- a/isis/src/mariner/apps/mar10clean/main.cpp +++ b/isis/src/mariner/apps/mar10clean/main.cpp @@ -24,7 +24,7 @@ void IsisMain() { Cube iCube; iCube.open(ui.GetCubeName("FROM")); Pvl * labels = iCube.label(); - if ("Mariner_10" != (QString)labels->findKeyword("SpacecraftName", Pvl::Traverse)) { + if ("Mariner_10" != QString::fromStdString(labels->findKeyword("SpacecraftName", Pvl::Traverse))) { QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Mariner10 cube"; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/mariner/apps/mar10nonoise/main.cpp b/isis/src/mariner/apps/mar10nonoise/main.cpp index 9e58ecb020..0714a4e71d 100644 --- a/isis/src/mariner/apps/mar10nonoise/main.cpp +++ b/isis/src/mariner/apps/mar10nonoise/main.cpp @@ -23,7 +23,7 @@ void IsisMain() { Cube iCube; iCube.open(ui.GetCubeName("FROM")); Pvl * labels = iCube.label(); - if ("Mariner_10" != (QString)labels->findKeyword("SpacecraftName", Pvl::Traverse)) { + if ("Mariner_10" != QString::fromStdString(labels->findKeyword("SpacecraftName", Pvl::Traverse))) { QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Mariner10 cube"; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/mariner/apps/mar10restore/main.cpp b/isis/src/mariner/apps/mar10restore/main.cpp index 22440e9392..b430002046 100644 --- a/isis/src/mariner/apps/mar10restore/main.cpp +++ b/isis/src/mariner/apps/mar10restore/main.cpp @@ -27,7 +27,7 @@ void IsisMain() { // Check that it is a Mariner10 cube. Pvl * labels = cube.label(); - if ("Mariner_10" != (QString)labels->findKeyword("SpacecraftName", Pvl::Traverse)) { + if ("Mariner_10" != QString::fromStdString(labels->findKeyword("SpacecraftName", Pvl::Traverse))) { QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Mariner10 cube"; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/mariner/objs/Mariner10Camera/Mariner10Camera.cpp b/isis/src/mariner/objs/Mariner10Camera/Mariner10Camera.cpp index 5dbf4e458a..c2c6bca68d 100644 --- a/isis/src/mariner/objs/Mariner10Camera/Mariner10Camera.cpp +++ b/isis/src/mariner/objs/Mariner10Camera/Mariner10Camera.cpp @@ -59,10 +59,10 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); // Get utc start time - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); iTime startTime; - startTime.setUtc((QString)inst["StartTime"]); + startTime.setUtc(QString::fromStdString(inst["StartTime"])); setTime(startTime); // Setup detector map @@ -80,8 +80,8 @@ namespace Isis { // Setup distortion map which is dependent on encounter, use start time // MOON: 1973-11-08T03:16:26.350 - QString spacecraft = (QString)inst["SpacecraftName"]; - QString instId = (QString)inst["InstrumentId"]; + QString spacecraft = QString::fromStdString(inst["SpacecraftName"]); + QString instId = QString::fromStdString(inst["InstrumentId"]); QString cam; if(instId == "M10_VIDICON_A") { cam = "a"; diff --git a/isis/src/mariner/objs/Mariner10Camera/unitTest.cpp b/isis/src/mariner/objs/Mariner10Camera/unitTest.cpp index 7422c365cd..0d5964c5ec 100644 --- a/isis/src/mariner/objs/Mariner10Camera/unitTest.cpp +++ b/isis/src/mariner/objs/Mariner10Camera/unitTest.cpp @@ -81,7 +81,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/mer/apps/mer2isis/main.cpp b/isis/src/mer/apps/mer2isis/main.cpp index 648a951999..0740a6663e 100644 --- a/isis/src/mer/apps/mer2isis/main.cpp +++ b/isis/src/mer/apps/mer2isis/main.cpp @@ -27,7 +27,7 @@ void IsisMain() { FileName input = FileName(ui.GetFileName("FROM")); //Checks if in file is rdr - Pvl lab(input.expanded()); + Pvl lab(input.expanded().toStdString()); if(lab.hasObject("IMAGE_MAP_PROJECTION")) { QString msg = "[" + input.name() + "] has already been projected."; msg += " Use pds2isis."; @@ -64,7 +64,7 @@ void TranslateMerEdrLabels(FileName &labelFile, Cube *ocube) { QString transDir = "$ISISROOT/appdata/translations/"; // Get a filename for the MESSENGER EDR label - Pvl labelPvl(labelFile.expanded()); + Pvl labelPvl(labelFile.expanded().toStdString()); FileName transFile; // Translate the Archive group @@ -115,11 +115,11 @@ void MiFixLab(PvlGroup &instGroup) { //Code to remove "Z" from the StartTime and StopTime keywords //StartTime code - QString Newstarttime = (QString)instGroup.findKeyword("StartTime"); + QString Newstarttime = QString::fromStdString(instGroup.findKeyword("StartTime")); Newstarttime.remove("Z"); - instGroup.findKeyword("StartTime").setValue(Newstarttime); + instGroup.findKeyword("StartTime").setValue(Newstarttime.toStdString()); //StopTime code - QString Newstoptime = (QString)instGroup.findKeyword("StopTime"); + QString Newstoptime = QString::fromStdString(instGroup.findKeyword("StopTime")); Newstoptime.remove("Z"); - instGroup.findKeyword("StopTime").setValue(Newstoptime); + instGroup.findKeyword("StopTime").setValue(Newstoptime.toStdString()); } diff --git a/isis/src/mer/apps/mical/MiCalibration.cpp b/isis/src/mer/apps/mical/MiCalibration.cpp index a777f8239d..20df697ec0 100644 --- a/isis/src/mer/apps/mical/MiCalibration.cpp +++ b/isis/src/mer/apps/mical/MiCalibration.cpp @@ -36,12 +36,12 @@ namespace Isis { image.label()->findGroup("Instrument", Pvl::Traverse); p_exposureDuration = labelgrp["ExposureDuration"]; p_instrumentSerialNumber = labelgrp["InstrumentSerialNumber"]; - p_CCDTemperature = toDouble(labelgrp["InstrumentTemperature"][6]); - p_PCBTemperature = toDouble(labelgrp["InstrumentTemperature"][7]); + p_CCDTemperature = std::stod(labelgrp["InstrumentTemperature"][6]); + p_PCBTemperature = std::stod(labelgrp["InstrumentTemperature"][7]); p_OffsetModeId = labelgrp["OffsetModeID"]; - p_shuttereffectcorrectionflag = (QString)labelgrp["ShutterEffectCorrectionFlag"]; - p_filterName = (QString)labelgrp["FilterName"]; - p_startTime = (QString)labelgrp["StartTime"]; + p_shuttereffectcorrectionflag = QString::fromStdString(labelgrp["ShutterEffectCorrectionFlag"]); + p_filterName = QString::fromStdString(labelgrp["FilterName"]); + p_startTime = QString::fromStdString(labelgrp["StartTime"]); } /** * Get values from the calibration kernel @@ -53,7 +53,7 @@ namespace Isis { */ void MiCalibration::ReadKernel(Pvl &kernel) { QString rover = "MI_" + toString(p_instrumentSerialNumber); - PvlGroup kernelgrp = kernel.findGroup(rover, Pvl::Traverse); + PvlGroup kernelgrp = kernel.findGroup(rover.toStdString(), Pvl::Traverse); p_DELCCDTa = kernelgrp["DELCCDTa"]; p_DELCCDTb = kernelgrp["DELCCDTb"]; p_RPVOFFa = kernelgrp["RPVOFFa"]; @@ -70,11 +70,11 @@ namespace Isis { p_ACTAREAb = kernelgrp["ACTAREAb"]; p_temperatureOffset = kernelgrp["TemperatureOffset"]; p_transfertime = kernelgrp["TransferTime"]; - p_ReferencePixelImage = (QString)kernelgrp["ReferencePixelImage"]; - p_ZeroExposureImage = (QString)kernelgrp["ZeroExposureImage"]; - p_ActiveAreaImage = (QString)kernelgrp["ActiveAreaImage"]; - p_FlatImageOpen = (QString)kernelgrp["FlatImageOpen"]; - p_FlatImageClosed = (QString)kernelgrp["FlatImageClosed"]; + p_ReferencePixelImage = QString::fromStdString(kernelgrp["ReferencePixelImage"]); + p_ZeroExposureImage = QString::fromStdString(kernelgrp["ZeroExposureImage"]); + p_ActiveAreaImage = QString::fromStdString(kernelgrp["ActiveAreaImage"]); + p_FlatImageOpen = QString::fromStdString(kernelgrp["FlatImageOpen"]); + p_FlatImageClosed = QString::fromStdString(kernelgrp["FlatImageClosed"]); } /** * Get the CCD temperature and output a corrected diff --git a/isis/src/mer/apps/mical/main.cpp b/isis/src/mer/apps/mical/main.cpp index 1f9a8de608..9767d94c98 100644 --- a/isis/src/mer/apps/mical/main.cpp +++ b/isis/src/mer/apps/mical/main.cpp @@ -77,10 +77,10 @@ void IsisMain() { calKernelFile = p.MissionData("mer", "calibration/mical.ker.???", true); cout << "use the system kernel" << endl; } - Pvl calKernel(calKernelFile); + Pvl calKernel(calKernelFile.toStdString()); // gbl::mi = new Mer::MiCalibration(*(pack->GetCube()), calKernel); gbl::mi = new Mer::MiCalibration(*(pack), calKernel); - calgrp += PvlKeyword("CalibrationKernel", calKernelFile); + calgrp += PvlKeyword("CalibrationKernel", calKernelFile.toStdString()); // See if User entered a temperature and call setTemperature functions @@ -143,13 +143,13 @@ void IsisMain() { gbl::ReferencePixelValue = stat.Average(); calgrp += PvlKeyword("ReferencePixelValueSource", "ERPImage"); - calgrp += PvlKeyword("ReferencePixelValueImage", ui.GetCubeName("REFPIXIMAGE")); - calgrp += PvlKeyword("ReferencePixelValue", toString(gbl::ReferencePixelValue)); + calgrp += PvlKeyword("ReferencePixelValueImage", ui.GetCubeName("REFPIXIMAGE").toStdString()); + calgrp += PvlKeyword("ReferencePixelValue", std::to_string(gbl::ReferencePixelValue)); } else { gbl::ReferencePixelValue = gbl::mi->ReferencePixelModel(); calgrp += PvlKeyword("ReferencePixelValueSource", "ERPModel"); - calgrp += PvlKeyword("ReferenceModel", toString(gbl::ReferencePixelValue)); + calgrp += PvlKeyword("ReferenceModel", std::to_string(gbl::ReferencePixelValue)); } // if user wants NO zero exposure or if shutter effect correction is true // set the user value to zero and set label output to reflect no correction @@ -159,19 +159,19 @@ void IsisMain() { calgrp += PvlKeyword("ZeroExposureImage", "NoCorrection"); } else { - calgrp += PvlKeyword("ZeroExposureValue", toString(gbl::mi->ZeroExposureValue())); - calgrp += PvlKeyword("ZeroExposureImage", gbl::mi->ZeroExposureImage()); + calgrp += PvlKeyword("ZeroExposureValue", std::to_string(gbl::mi->ZeroExposureValue())); + calgrp += PvlKeyword("ZeroExposureImage", gbl::mi->ZeroExposureImage().toStdString()); } // If user wants NO active area set user value to zero and set the label // output values to reflect no correction. if(!ui.GetBoolean("AACORRECTION")) { gbl::useActiveAreaValue = 0; - calgrp += PvlKeyword("ActiveAreaValue", QString::number(0)); + calgrp += PvlKeyword("ActiveAreaValue", "0"); calgrp += PvlKeyword("ActiveAreaImage", "NoCorrection"); } else { - calgrp += PvlKeyword("ActiveAreaValue", toString(gbl::mi->ActiveAreaValue())); - calgrp += PvlKeyword("ActiveAreaImage", gbl::mi->ActiveAreaImage()); + calgrp += PvlKeyword("ActiveAreaValue", std::to_string(gbl::mi->ActiveAreaValue())); + calgrp += PvlKeyword("ActiveAreaImage", gbl::mi->ActiveAreaImage().toStdString()); } @@ -187,7 +187,7 @@ void IsisMain() { if(ui.WasEntered("FLATFIELD")) { p.SetInputCube(ui.GetCubeName("FLATFIELD"), att); if(stagestop == "FLAT" || stagestop == "IOF") { - calgrp += PvlKeyword("FlatFieldImage", gbl::mi->FlatImageOpen()); + calgrp += PvlKeyword("FlatFieldImage", gbl::mi->FlatImageOpen().toStdString()); } } else { @@ -195,13 +195,13 @@ void IsisMain() { if(gbl::mi->FilterName() == "MI_OPEN") { p.SetInputCube(gbl::mi->FlatImageOpen(), att); if(stagestop == "FLAT" || stagestop == "IOF") { - calgrp += PvlKeyword("FlatFieldImage", gbl::mi->FlatImageOpen()); + calgrp += PvlKeyword("FlatFieldImage", gbl::mi->FlatImageOpen().toStdString()); } } else if(gbl::mi->FilterName() == "MI_CLOSED") { p.SetInputCube(gbl::mi->FlatImageClosed(), att); if(stagestop == "FLAT" || stagestop == "IOF") { - calgrp += PvlKeyword("FlatFieldImage", gbl::mi->FlatImageClosed()); + calgrp += PvlKeyword("FlatFieldImage", gbl::mi->FlatImageClosed().toStdString()); } } } @@ -211,14 +211,14 @@ void IsisMain() { double fullModel = gbl::mi->ReferencePixelModel() + gbl::mi->ZeroExposureValue() + gbl::mi->ActiveAreaValue(); - calgrp += PvlKeyword("DarkCurrentFullModel", toString(fullModel)); + calgrp += PvlKeyword("DarkCurrentFullModel", std::to_string(fullModel)); //Add temperature values to the radiometry group - calgrp += PvlKeyword("CCDTemperture", toString(gbl::mi->CCDTemperatureCorrect())); - calgrp += PvlKeyword("PCBTemperature", toString(gbl::mi->PCBTemperature())); + calgrp += PvlKeyword("CCDTemperture", std::to_string(gbl::mi->CCDTemperatureCorrect())); + calgrp += PvlKeyword("PCBTemperature", std::to_string(gbl::mi->PCBTemperature())); if(stagestop == "IOF") { - calgrp += PvlKeyword("OmegaNaught", toString(gbl::mi->OmegaNaught())); - calgrp += PvlKeyword("SunAU", toString(gbl::sunAU)); + calgrp += PvlKeyword("OmegaNaught", std::to_string(gbl::mi->OmegaNaught())); + calgrp += PvlKeyword("SunAU", std::to_string(gbl::sunAU)); } //write Radiometry group to the output cube. @@ -323,7 +323,7 @@ void helperButtonLogCalKernel() { } Pvl p; - p.read(calKernelFile); + p.read(calKernelFile.toStdString()); QString OQString = "********** Output of [" + calKernelFile + "] *********"; Application::GuiLog(OQString); Application::GuiLog(p); diff --git a/isis/src/messenger/apps/mdis2isis/main.cpp b/isis/src/messenger/apps/mdis2isis/main.cpp index f08b34a1a7..a0e5c0bf23 100644 --- a/isis/src/messenger/apps/mdis2isis/main.cpp +++ b/isis/src/messenger/apps/mdis2isis/main.cpp @@ -78,13 +78,13 @@ void IsisMain() { FileName inFile = ui.GetFileName("FROM"); IString id; bool projected; - Pvl lab(inFile.expanded()); + Pvl lab(inFile.expanded().toStdString()); try { needsUnlut = (int) lab.findKeyword("MESS:COMP12_8"); // Check for NAC imager if((int) lab.findKeyword("MESS:IMAGER") == 1) validMaxDn = NACValidMaximum; - id = (QString) lab.findKeyword("MISSION_NAME"); + id = QString::fromStdString(lab.findKeyword("MISSION_NAME")); projected = lab.hasObject("IMAGE_MAP_PROJECTION"); } catch(IException &e) { @@ -117,11 +117,11 @@ void IsisMain() { // Perform PDS/EDR source keyword translations to ISIS label keywords p.SetPdsFile(inFile.expanded(), "", pdsLabel); Pvl outLabel = TranslateMdisEdrLabels(inFile, target); - PvlKeyword sourceId("SourceProductId", '"' + inFile.baseName() + '"'); + PvlKeyword sourceId("SourceProductId", '"' + inFile.baseName().toStdString() + '"'); // Create YearDoy keyword in Archive group - iTime stime(outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0]); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + iTime stime( QString::fromStdString(outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0])); + PvlKeyword yeardoy("YearDoy", std::to_string(stime.Year()*1000 + stime.DayOfYear())); (void) outLabel.findGroup("Archive", Pvl::Traverse).addKeyword(yeardoy); if(ui.GetBoolean("UNLUT") == false || !needsUnlut) { @@ -133,7 +133,7 @@ void IsisMain() { // Write the Instrument, BandBin, Archive, and Kernels groups to the output // cube label PvlGroup &group = outLabel.findGroup("Instrument", Pvl::Traverse); - group.addKeyword(PvlKeyword("Unlutted", toString((int)!needsUnlut))); + group.addKeyword(PvlKeyword("Unlutted", std::to_string((int)!needsUnlut))); outCube->putGroup(group); outCube->putGroup(outLabel.findGroup("BandBin", Pvl::Traverse)); @@ -162,12 +162,12 @@ void IsisMain() { outCube->create(ui.GetCubeName("TO")); PvlGroup &group = outLabel.findGroup("Instrument", Pvl::Traverse); - group.addKeyword(PvlKeyword("Unlutted", toString((int)true))); - group.addKeyword(PvlKeyword("LutInversionTable", lutfile)); + group.addKeyword(PvlKeyword("Unlutted", std::to_string((int)true))); + group.addKeyword(PvlKeyword("LutInversionTable", lutfile.toStdString())); outCube->label()->findObject("IsisCube").addGroup(group); group = outLabel.findGroup("Archive", Pvl::Traverse); - sourceId.addValue('"' + lutid + '"'); + sourceId.addValue('"' + lutid.toStdString() + '"'); group.addKeyword(sourceId); outCube->label()->findObject("IsisCube").addGroup(group); @@ -176,7 +176,7 @@ void IsisMain() { p.StartProcess(UnlutData); - OriginalLabel ol(Pvl(inFile.expanded())); + OriginalLabel ol(Pvl(inFile.expanded().toStdString())); outCube->write(ol); outCube->close(); delete outCube; @@ -193,7 +193,7 @@ Pvl TranslateMdisEdrLabels(FileName &labelFile, const QString &target) { QString transDir = "$ISISROOT/appdata/translations/"; // Get a filename for the MESSENGER EDR label - Pvl labelPvl(labelFile.expanded()); + Pvl labelPvl(labelFile.expanded().toStdString()); // Translate the Instrument group FileName transFile(transDir + "MessengerMdisInstrument.trn"); @@ -214,30 +214,30 @@ Pvl TranslateMdisEdrLabels(FileName &labelFile, const QString &target) { PvlGroup kerns("Kernels"); PvlGroup &bandbin(outLabel.findGroup("BandBin", Pvl::Traverse)); PvlGroup &instGrp(outLabel.findGroup("Instrument", Pvl::Traverse)); - QString instId = instGrp["InstrumentId"]; + QString instId = QString::fromStdString(instGrp["InstrumentId"]); QString naifCode; // Establish Filter specific keywords CreateFilterSpecs(instId, (int) instGrp["FilterWheelPosition"], bandbin, naifCode); - kerns += PvlKeyword("NaifIkCode", naifCode); + kerns += PvlKeyword("NaifIkCode", naifCode.toStdString()); outLabel.addGroup(kerns); // If the user specifed the target explicitly or it doesn't exist, create // something so the camera will always work if(instGrp.findKeyword("TargetName").isNull() || (!target.isEmpty())) { if(!target.isEmpty()) { - instGrp["TargetName"] = QString(target); + instGrp["TargetName"] = target.toStdString(); } else { - instGrp["TargetName"] = QString("Sky"); + instGrp["TargetName"] = "Sky"; } } // Compute the gimble pivot angle and write to the label double pivotCounter = (double) instGrp["PivotPosition"]; double pivotAngle = pivotCounter / ((double)(2 << 15)) * 180.0; - instGrp += PvlKeyword("PivotAngle", toString(pivotAngle), "Degrees"); + instGrp += PvlKeyword("PivotAngle", std::to_string(pivotAngle), "Degrees"); return outLabel; } @@ -297,14 +297,14 @@ int CreateFilterSpecs(const QString &instId, int filter_code, // Set up WAC calibration file FileName calibFile("$messenger/calibration/mdisCalibration????.trn"); calibFile = calibFile.highestVersion(); - Pvl config(calibFile.expanded()); + Pvl config(calibFile.expanded().toStdString()); PvlGroup &confgrp = config.findGroup("FilterWheel"); int tolerance = confgrp["EncoderTolerance"]; naifCode = "-236800"; for(int filterTry = 1; filterTry <= 12 ; filterTry++) { - int idealPosition = confgrp[QString("EncoderPosition") + toString(filterTry)]; + int idealPosition = confgrp["EncoderPosition" + std::to_string(filterTry)]; if((filter_code <= (idealPosition + tolerance)) && (filter_code >= (idealPosition - tolerance))) { int fno = filterTry - 1; @@ -324,10 +324,10 @@ int CreateFilterSpecs(const QString &instId, int filter_code, } if(!name.isEmpty()) { - bandbin.addKeyword(PvlKeyword("Number", toString(filter)), PvlContainer::Replace); - bandbin.addKeyword(PvlKeyword("Name", name), PvlContainer::Replace); - bandbin.addKeyword(PvlKeyword("Center", center, "NM"), PvlContainer::Replace); - bandbin.addKeyword(PvlKeyword("Width", width, "NM"), PvlContainer::Replace); + bandbin.addKeyword(PvlKeyword("Number", std::to_string(filter)), PvlContainer::Replace); + bandbin.addKeyword(PvlKeyword("Name", name.toStdString()), PvlContainer::Replace); + bandbin.addKeyword(PvlKeyword("Center", center.toStdString(), "NM"), PvlContainer::Replace); + bandbin.addKeyword(PvlKeyword("Width", width.toStdString(), "NM"), PvlContainer::Replace); } else { // If we reach here, we cannot validate the number - set it to unknown diff --git a/isis/src/messenger/apps/mdiscal/main.cpp b/isis/src/messenger/apps/mdiscal/main.cpp index 64ac87e86f..eb591dff97 100644 --- a/isis/src/messenger/apps/mdiscal/main.cpp +++ b/isis/src/messenger/apps/mdiscal/main.cpp @@ -100,7 +100,7 @@ void IsisMain() { ProcessByLine p; FileName calibFile("$messenger/calibration/mdisCalibration????.trn"); calibFile = calibFile.highestVersion(); - g_configFile.read(calibFile.expanded()); + g_configFile.read(calibFile.expanded().toStdString()); // Initialize variables g_calibrationValues.clear(); @@ -117,7 +117,7 @@ void IsisMain() { Cube *icube = p.SetInputCube("FROM"); PvlGroup &inst = icube->group("Instrument"); - g_isNarrowAngleCamera = ((QString)inst["InstrumentId"] == "MDIS-NAC"); + g_isNarrowAngleCamera = (QString::fromStdString(inst["InstrumentId"]) == "MDIS-NAC"); g_exposureDuration = inst["ExposureDuration"]; g_exposureDuration /= 1000.0; // convert from milliseconds to seconds @@ -304,7 +304,7 @@ void IsisMain() { smearfile); // Get s/c clock count - QString startTime = inst["SpacecraftClockCount"]; + QString startTime = QString::fromStdString(inst["SpacecraftClockCount"]); // Retrieve empirical correction parameter QString empiricalCorrectionFile = ""; @@ -333,8 +333,8 @@ void IsisMain() { QString solirrfile = ""; if (applyIOF) { PvlGroup& inst = icube->group("Instrument"); - QString target = inst["TargetName"]; - QString startTime = inst["SpacecraftClockCount"]; + QString target = QString::fromStdString(inst["TargetName"]); + QString startTime = QString::fromStdString(inst["SpacecraftClockCount"]); if (sunDistanceAU(startTime, target, g_solarDist, icube)) { vector sol = loadSolarIrr(g_isNarrowAngleCamera, g_isBinnedData, g_filterNumber + 1, solirrfile); @@ -396,47 +396,47 @@ void IsisMain() { // Log calibration activity PvlGroup calibrationLog("RadiometricCalibration"); - calibrationLog.addKeyword(PvlKeyword("SoftwareName", mdiscalProgram)); - calibrationLog.addKeyword(PvlKeyword("SoftwareVersion", mdiscalVersion)); - calibrationLog.addKeyword(PvlKeyword("ProcessDate", mdiscalRuntime)); - calibrationLog.addKeyword(PvlKeyword("DarkCurrentModel", darkCurr)); + calibrationLog.addKeyword(PvlKeyword("SoftwareName", mdiscalProgram.toStdString())); + calibrationLog.addKeyword(PvlKeyword("SoftwareVersion", mdiscalVersion.toStdString())); + calibrationLog.addKeyword(PvlKeyword("ProcessDate", mdiscalRuntime.toStdString())); + calibrationLog.addKeyword(PvlKeyword("DarkCurrentModel", darkCurr.toStdString())); if (g_darkCurrentMode == DarkCurrentLinear) { QString equation = "Y = " + toString(g_calibrationValues[0]) + QString(" + ") + toString(g_calibrationValues[1]) + QString("x"); - calibrationLog.addKeyword(PvlKeyword("DarkCurrentEquation", (QString)equation)); + calibrationLog.addKeyword(PvlKeyword("DarkCurrentEquation", equation.toStdString())); } else if (g_darkCurrentMode == DarkCurrentModel) { - calibrationLog.addKeyword(PvlKeyword("DarkCurrentFile", darkCurrentFile)); + calibrationLog.addKeyword(PvlKeyword("DarkCurrentFile", darkCurrentFile.toStdString())); } - calibrationLog.addKeyword(PvlKeyword("BinnedImage", toString((int)g_isBinnedData))); - calibrationLog.addKeyword(PvlKeyword("FilterNumber", toString(g_filterNumber + 1))); + calibrationLog.addKeyword(PvlKeyword("BinnedImage", std::to_string((int)g_isBinnedData))); + calibrationLog.addKeyword(PvlKeyword("FilterNumber", std::to_string(g_filterNumber + 1))); if (g_applyFlatfield) { calibrationLog.addKeyword(PvlKeyword("FlatFieldFile", - flatfield.originalPath() + "/" + flatfield.name())); + flatfield.originalPath().toStdString() + "/" + flatfield.name().toStdString())); } else { calibrationLog.addKeyword(PvlKeyword("FlatFieldFile", "N/A")); } calibrationLog.addKeyword(PvlKeyword("CalibrationFile", - calibFile.originalPath() + "/" + calibFile.name())); - calibrationLog.addKeyword(PvlKeyword("ResponsivityFile", respfile)); - calibrationLog.addKeyword(PvlKeyword("SmearCompFile", smearfile)); - PvlKeyword rspKey("Response", toString(rsp[0])); + calibFile.originalPath().toStdString() + "/" + calibFile.name().toStdString())); + calibrationLog.addKeyword(PvlKeyword("ResponsivityFile", respfile.toStdString())); + calibrationLog.addKeyword(PvlKeyword("SmearCompFile", smearfile.toStdString())); + PvlKeyword rspKey("Response", std::to_string(rsp[0])); for (unsigned int i = 1; i < rsp.size(); i++) { rspKey.addValue(std::to_string(rsp[i])); } calibrationLog.addKeyword(rspKey); - calibrationLog.addKeyword(PvlKeyword("SmearComponent", toString(g_smearComponent))); + calibrationLog.addKeyword(PvlKeyword("SmearComponent", std::to_string(g_smearComponent))); QString calibType; if (applyIOF && validIOF) { calibrationLog.addKeyword(PvlKeyword("Units", "I over F")); - calibrationLog.addKeyword(PvlKeyword("SolarDistance", toString(g_solarDist), "AU")); - calibrationLog.addKeyword(PvlKeyword("SolarIrrFile", solirrfile)); - calibrationLog.addKeyword(PvlKeyword("FilterIrradianceFactor", toString(g_Ff))); - calibrationLog.addKeyword(PvlKeyword("IOFFactor", toString(g_iof))); + calibrationLog.addKeyword(PvlKeyword("SolarDistance", std::to_string(g_solarDist), "AU")); + calibrationLog.addKeyword(PvlKeyword("SolarIrrFile", solirrfile.toStdString())); + calibrationLog.addKeyword(PvlKeyword("FilterIrradianceFactor", std::to_string(g_Ff))); + calibrationLog.addKeyword(PvlKeyword("IOFFactor", std::to_string(g_iof))); calibType = "IF"; } else if (g_applyRadiometric) { @@ -448,52 +448,52 @@ void IsisMain() { calibType = "DN"; } - calibrationLog.addKeyword(PvlKeyword("EmpiricalCorrectionFile", empiricalCorrectionFile)); - calibrationLog.addKeyword(PvlKeyword("EmpiricalCorrectionDate", empiricalCorrectionDate)); - calibrationLog.addKeyword(PvlKeyword("EmpiricalCorrectionFactor", empiricalCorrectionFactor)); + calibrationLog.addKeyword(PvlKeyword("EmpiricalCorrectionFile", empiricalCorrectionFile.toStdString())); + calibrationLog.addKeyword(PvlKeyword("EmpiricalCorrectionDate", empiricalCorrectionDate.toStdString())); + calibrationLog.addKeyword(PvlKeyword("EmpiricalCorrectionFactor", empiricalCorrectionFactor.toStdString())); - calibrationLog.addKeyword(PvlKeyword("DarkStripColumns", toString(g_nDarkColumns)), + calibrationLog.addKeyword(PvlKeyword("DarkStripColumns", std::to_string(g_nDarkColumns)), Pvl::Replace); - calibrationLog.addKeyword(PvlKeyword("ValidDarkColumns", toString(g_nValidDark)), + calibrationLog.addKeyword(PvlKeyword("ValidDarkColumns", std::to_string(g_nValidDark)), Pvl::Replace); if (g_darkStrip.TotalPixels() > 0) { double avgDark = (g_darkStrip.ValidPixels() > 0) ? g_darkStrip.Average() : 0.0; - calibrationLog.addKeyword(PvlKeyword("DarkStripMean", toString(avgDark)), + calibrationLog.addKeyword(PvlKeyword("DarkStripMean", std::to_string(avgDark)), Pvl::Replace); } // Report nulled sample count - calibrationLog.addKeyword(PvlKeyword("LeftSamplesNulled", toString(g_nSampsToNull))); + calibrationLog.addKeyword(PvlKeyword("LeftSamplesNulled", std::to_string(g_nSampsToNull))); // Handle updates of ProductId and SourceProduct Id keywords PvlGroup& archive = ocube->group("Archive"); PvlKeyword key = archive["ProductId"]; - QString orgProdId = key[0]; + QString orgProdId = QString::fromStdString(key[0]); QString newProdId = orgProdId + "_" + calibType + "_" + toString(cdrVersion); newProdId[0] = 'C'; - key.setValue(quote(newProdId)); + key.setValue(quote(newProdId).toStdString()); archive.addKeyword(key, Pvl::Replace); // Now SourceProductId if (archive.hasKeyword("SourceProductId")) { key = archive["SourceProductId"]; for (int i = 0; i < key.size(); i++) { - key[i] = quote(key[i]); + key[i] = quote( QString::fromStdString(key[i])).toStdString(); } } else { - key = PvlKeyword("SourceProductId", quote(orgProdId)); + key = PvlKeyword("SourceProductId", quote(orgProdId).toStdString()); } if (!darkCurrentFile.isEmpty()) { - key.addValue(quote(FileName(darkCurrentFile).baseName())); + key.addValue(quote(FileName(darkCurrentFile).baseName()).toStdString()); } - key.addValue(quote(flatfield.baseName())); - key.addValue(quote(FileName(respfile).baseName())); + key.addValue(quote(flatfield.baseName()).toStdString()); + key.addValue(quote(FileName(respfile).baseName()).toStdString()); // key.addValue(quote(FileName(smearfile).baseName())); if (validIOF) { - key.addValue(quote(FileName(solirrfile).baseName())); + key.addValue(quote(FileName(solirrfile).baseName()).toStdString()); } archive.addKeyword(key, Pvl::Replace); diff --git a/isis/src/messenger/apps/mdisddr/main.cpp b/isis/src/messenger/apps/mdisddr/main.cpp index 217541df93..6edbf93ef4 100644 --- a/isis/src/messenger/apps/mdisddr/main.cpp +++ b/isis/src/messenger/apps/mdisddr/main.cpp @@ -53,10 +53,10 @@ inline void validateUnit(PvlKeyword &key, const QString &kunit) { for (int i = 0; i < temp.size(); i++) { try { // If this works, check unit, otherwise an exception is thrown - (void) toDouble(temp[i]); - QString unit = temp.unit(i); + (void) std::stod(temp[i]); + QString unit = QString::fromStdString(temp.unit(i)); if (unit.isEmpty()) unit = kunit; - key.addValue(temp[i], unit); + key.addValue(temp[i], unit.toStdString()); } catch (...) { key.addValue(temp[i]); @@ -66,8 +66,8 @@ inline void validateUnit(PvlKeyword &key, const QString &kunit) { } inline void fixUnit(PvlObject &obj, const QString &key, const QString &unit) { - if (obj.hasKeyword(key, PvlObject::Traverse)) { - validateUnit(obj.findKeyword(key, PvlObject::Traverse), unit); + if (obj.hasKeyword(key.toStdString(), PvlObject::Traverse)) { + validateUnit(obj.findKeyword(key.toStdString(), PvlObject::Traverse), unit); } return; } @@ -76,7 +76,7 @@ inline void fixQuotes(PvlContainer &kcont, const QString &value = "N/A") { PvlContainer::PvlKeywordIterator kiter; for (kiter = kcont.begin(); kiter != kcont.end(); ++kiter) { for (int nv = 0; nv < kiter->size(); nv++) { - if ((*kiter)[nv] == value)(*kiter)[nv] = quote((*kiter)[nv]); + if (QString::fromStdString((*kiter)[nv]) == value) QString::fromStdString((*kiter)[nv]) = quote(QString::fromStdString((*kiter)[nv])); } } } @@ -141,7 +141,7 @@ void IsisMain() { // Wrap a try clause so that if anything goes wrong below, we can remove // the phocube file. try { - Pvl phoLabel(pfile); + Pvl phoLabel(pfile.toStdString()); BandMap bandmap; PvlKeyword bn = phoLabel.findGroup("BandBin", Pvl::Traverse)["Name"]; for (int i = 0; i < bn.size(); i++) { @@ -214,14 +214,14 @@ void IsisMain() { QString lnote = "2007-12-20, S. Murchie (JHU/APL); " "2008-01-02, S. Murchie (JHU/APL); " "2008-01-11, J. Ward (GEO)"; - pdsLabel += PvlKeyword("LABEL_REVISION_NOTE", lnote); - pdsLabel += PvlKeyword("SPACECRAFT_NAME", quote("MESSENGER")); + pdsLabel += PvlKeyword("LABEL_REVISION_NOTE", lnote.toStdString()); + pdsLabel += PvlKeyword("SPACECRAFT_NAME", quote("MESSENGER").toStdString()); // Fix bad keywords // data set id PvlKeyword &dataSetIdKeyword = pdsLabel.findKeyword("DATA_SET_ID", Pvl::Traverse); - dataSetIdKeyword.setValue(dataSetID); + dataSetIdKeyword.setValue(dataSetID.toStdString()); // product set id QString prodid(input.baseName()); @@ -229,14 +229,14 @@ void IsisMain() { Pvl::Traverse); if ((productIdKeyword.size() == 0) || ((productIdKeyword.size() > 0) && (productIdKeyword[0] == "N/A"))) { - productIdKeyword.setValue(prodid); + productIdKeyword.setValue(prodid.toStdString()); } else { - QString pid = productIdKeyword[0]; + QString pid = QString::fromStdString(productIdKeyword[0]); pid[0] = 'D'; pid.remove(QRegExp("_.*")); pid.append("_DE_0"); - productIdKeyword.setValue(pid); + productIdKeyword.setValue(pid.toStdString()); prodid = pid; } // Now we have enough to establish output file name @@ -248,23 +248,23 @@ void IsisMain() { // product creation time PvlKeyword &productCreationTimeKeyword = pdsLabel.findKeyword("PRODUCT_CREATION_TIME", Pvl::Traverse); - productCreationTimeKeyword.setValue(mdisddrRuntime); + productCreationTimeKeyword.setValue(mdisddrRuntime.toStdString()); // software name PvlKeyword &softwareNameKeyword = pdsLabel.findKeyword("SOFTWARE_NAME", Pvl::Traverse); - softwareNameKeyword.setValue(mdisddrProgram); + softwareNameKeyword.setValue(mdisddrProgram.toStdString()); // software version id PvlKeyword &softwareVersionIdKeyword = pdsLabel.findKeyword("SOFTWARE_VERSION_ID", Pvl::Traverse); - softwareVersionIdKeyword.setValue(quote(mdisddrVersion)); + softwareVersionIdKeyword.setValue(quote(mdisddrVersion).toStdString()); // filter number PvlKeyword &filterNumberKeyword = pdsLabel.findKeyword("FILTER_NUMBER", Pvl::Traverse); if ((filterNumberKeyword.size() > 0)) { - filterNumberKeyword.setValue(quote(filterNumberKeyword[0])); + filterNumberKeyword.setValue(quote(QString::fromStdString(filterNumberKeyword[0])).toStdString()); } @@ -272,22 +272,22 @@ void IsisMain() { // data quality id PvlKeyword &dataQualityIdKeyword = pdsLabel.findKeyword("DATA_QUALITY_ID", Pvl::Traverse); - dataQualityIdKeyword.setValue(quote(dataQualityIdKeyword)); + dataQualityIdKeyword.setValue(quote(QString::fromStdString(dataQualityIdKeyword)).toStdString()); // sequence name PvlKeyword &sequenceNameKeyword = pdsLabel.findKeyword("SEQUENCE_NAME", Pvl::Traverse); - sequenceNameKeyword.setValue(quote(sequenceNameKeyword)); + sequenceNameKeyword.setValue(quote(QString::fromStdString(sequenceNameKeyword)).toStdString()); // spacecraft clock start count PvlKeyword &startCountKeyword = pdsLabel.findKeyword("SPACECRAFT_CLOCK_START_COUNT", Pvl::Traverse); - startCountKeyword.setValue(quote(startCountKeyword)); + startCountKeyword.setValue(quote(QString::fromStdString(startCountKeyword)).toStdString()); // spacecraft clock stop count PvlKeyword &stopCountKeyword = pdsLabel.findKeyword("SPACECRAFT_CLOCK_STOP_COUNT", Pvl::Traverse); - stopCountKeyword.setValue(quote(stopCountKeyword)); + stopCountKeyword.setValue(quote(QString::fromStdString(stopCountKeyword)).toStdString()); // source product id // For DDRs, the SOURCE_PRODUCT_ID is made up of SPICE kernels. I need to go get em. @@ -298,7 +298,7 @@ void IsisMain() { sourceProductIdKeyword.clear(); for (int i = 0; i < kfiles.size(); i++) { FileName kfile(kfiles[i]); - sourceProductIdKeyword.addValue(quote(kfile.name())); + sourceProductIdKeyword.addValue(quote(kfile.name()).toStdString()); } // Enforce parentheses for scalars if (sourceProductIdKeyword.size() == 1) @@ -352,8 +352,8 @@ void IsisMain() { for (int i = 1; i <= 5; i++) { QString n(toString(i)); QString group = "SUBFRAME" + n + "_PARAMETERS"; - if (pdsLabel.hasGroup(group)) { - PvlGroup &grp = pdsLabel.findGroup(group); + if (pdsLabel.hasGroup(group.toStdString())) { + PvlGroup &grp = pdsLabel.findGroup(group.toStdString()); validateUnit(grp.findKeyword("RETICLE_POINT_LATITUDE"), "DEG"); validateUnit(grp.findKeyword("RETICLE_POINT_LONGITUDE"), "DEG"); } diff --git a/isis/src/messenger/apps/mdisedrinfo/MdisEdrKeys.h b/isis/src/messenger/apps/mdisedrinfo/MdisEdrKeys.h index 3c3d48a653..a07102e979 100644 --- a/isis/src/messenger/apps/mdisedrinfo/MdisEdrKeys.h +++ b/isis/src/messenger/apps/mdisedrinfo/MdisEdrKeys.h @@ -66,7 +66,7 @@ namespace Isis { * @param edrfile File containing the PDS EDR label */ MdisEdrKeys(const QString &edrfile) { - _edrLabel = Pvl(edrfile); + _edrLabel = Pvl(edrfile.toStdString()); LoadKeys(_edrLabel, _keys); } @@ -208,15 +208,15 @@ namespace Isis { out << loopSep << "NULL"; } else if(key.size() == 1) { - out << loopSep << key[0] << formatUnit(key.unit(0)); + out << loopSep << key[0] << formatUnit(QString::fromStdString(key.unit(0))); } else { out << loopSep << "("; QString vsep(""); for(int iv = 0 ; iv < key.size() ; iv++) { out << vsep << key[iv]; - if(key[iv] != NAstr) { - out << formatUnit(key.unit(iv)); + if(QString::fromStdString(key[iv]) != NAstr) { + out << formatUnit(QString::fromStdString(key.unit(iv))); } vsep = ","; } @@ -262,9 +262,9 @@ namespace Isis { if(!prefix.isEmpty()) prekey += "/"; PvlContainer::PvlKeywordIterator keyIter = p.begin(); for(; keyIter != p.end() ; ++keyIter) { - QString keyname = prefix + keyIter->name(); + QString keyname = prefix + QString::fromStdString(keyIter->name()); PvlKeyword key = *keyIter; - key.setName(keyname); + key.setName(keyname.toStdString()); keys.add(keyname, key); } return; @@ -305,11 +305,11 @@ namespace Isis { // all SUBFRAME[12345]_PARAMETERS since they are unsupported. PvlObject::PvlObjectIterator objIter = obj.beginObject(); for(; objIter != obj.endObject() ; ++objIter) { - QString objname(objIter->name()); + QString objname(QString::fromStdString(objIter->name())); objname = objname.toUpper(); int gotSubframe = objname.indexOf("SUBFRAME"); if(gotSubframe != -1) { - LoadKeys(*objIter, keys, objIter->name()); + LoadKeys(*objIter, keys, QString::fromStdString(objIter->name())); } else { LoadKeys(*objIter, keys); diff --git a/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp b/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp index 4d565e1906..6bb23636e2 100644 --- a/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp +++ b/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp @@ -99,7 +99,7 @@ namespace Isis { PvlKeyword &target = label.findKeyword("TargetName", PvlObject::Traverse); try { - Target::lookupNaifBodyCode(target); + Target::lookupNaifBodyCode(QString::fromStdString(target)); return (true); } catch (...) { @@ -242,7 +242,7 @@ namespace Isis { Pvl geom; // Set initial keywords - geom += PvlKeyword("FILENAME", filename); + geom += PvlKeyword("FILENAME", filename.toStdString()); geom += format("SOURCE_PRODUCT_ID", _spice.getList(true)); // Invoke routines to compute associated keys @@ -652,13 +652,13 @@ namespace Isis { else { // It does exist, extract coordinates from original image label QString n = Isis::toString(frameno); - sample = (double) _orglabel.findKeyword("MESS:SUBF_X" + n, + sample = (double) _orglabel.findKeyword("MESS:SUBF_X" + n.toStdString(), PvlObject::Traverse); - line = (double) _orglabel.findKeyword("MESS:SUBF_Y" + n, + line = (double) _orglabel.findKeyword("MESS:SUBF_Y" + n.toStdString(), PvlObject::Traverse); - width = (double) _orglabel.findKeyword("MESS:SUBF_DX" + n, + width = (double) _orglabel.findKeyword("MESS:SUBF_DX" + n.toStdString(), PvlObject::Traverse); - height = (double) _orglabel.findKeyword("MESS:SUBF_DY" + n, + height = (double) _orglabel.findKeyword("MESS:SUBF_DY" + n.toStdString(), PvlObject::Traverse); } @@ -1061,10 +1061,10 @@ namespace Isis { PvlKeyword MdisGeometry::format(const QString &name, const double &value, const QString &unit) const { if (IsSpecial(value)) { - return (PvlKeyword(name, _NullDefault)); + return (PvlKeyword(name.toStdString(), _NullDefault.toStdString())); } else { - return (PvlKeyword(name, DoubleToString(value), unit)); + return (PvlKeyword(name.toStdString(), DoubleToString(value).toStdString(), unit.toStdString())); } } @@ -1089,13 +1089,13 @@ namespace Isis { PvlKeyword MdisGeometry::format(const QString &name, const std::vector &values, const QString &unit) const { - PvlKeyword key(name); + PvlKeyword key(name.toStdString()); for (unsigned int i = 0 ; i < values.size() ; i++) { if (IsSpecial(values[i])) { - key.addValue(_NullDefault); + key.addValue(_NullDefault.toStdString()); } else { - key.addValue(DoubleToString(values[i]), unit); + key.addValue(DoubleToString(values[i]).toStdString(), unit.toStdString()); } } return (key); @@ -1119,13 +1119,13 @@ namespace Isis { PvlKeyword MdisGeometry::format(const QString &name, const std::vector &values, const QString &unit) const { - PvlKeyword key(name); + PvlKeyword key(name.toStdString()); for (unsigned int i = 0 ; i < values.size() ; i++) { if (values[i].empty()) { - key.addValue(_NullDefault); + key.addValue(_NullDefault.toStdString()); } else { - key.addValue(values[i].c_str(), unit); + key.addValue(values[i].c_str(), unit.toStdString()); } } return (key); @@ -1149,13 +1149,13 @@ namespace Isis { PvlKeyword MdisGeometry::format(const QString &name, const std::vector &values, const QString &unit) const { - PvlKeyword key(name); + PvlKeyword key(name.toStdString()); for (unsigned int i = 0 ; i < values.size() ; i++) { if (values[i].isEmpty()) { - key.addValue(_NullDefault); + key.addValue(_NullDefault.toStdString()); } else { - key.addValue(values[i], unit); + key.addValue(values[i].toStdString(), unit.toStdString()); } } return (key); diff --git a/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp b/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp index 41bede31c3..9107c21130 100644 --- a/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp +++ b/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp @@ -135,7 +135,7 @@ namespace Isis { } // Add a specific kernel to the list - PvlKeyword kernel("Kernels", kfile); + PvlKeyword kernel("Kernels", kfile.toStdString()); loadKernel(kernel); return; } @@ -210,14 +210,14 @@ namespace Isis { if(IString(key[i]).UpCase() == "NULL") continue; if(IString(key[i]).UpCase() == "NADIR") continue; if(IString(key[i]).UpCase() == "TABLE") continue; - Isis::FileName file(key[i]); + Isis::FileName file(QString::fromStdString(key[i])); if(!file.fileExists()) { QString msg = "Spice file does not exist [" + file.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } QString fileName(file.expanded()); if(_furnish) furnsh_c(fileName.toLatin1().data()); - addKernelName((QString)key[i]); + addKernelName(QString::fromStdString(key[i])); } NaifStatus::CheckErrors(); } @@ -235,15 +235,15 @@ namespace Isis { */ void SpiceManager::loadKernelFromTable(PvlKeyword &key, const QString &tblname, Pvl &pvl) { - if(key[0].toUpper() != "TABLE") { + if(QString::fromStdString(key[0]).toUpper() != "TABLE") { loadKernel(key); } else { PvlObject::PvlObjectIterator objIter; for(objIter = pvl.beginObject() ; objIter != pvl.endObject() ; ++objIter) { - if(objIter->name().toUpper() == "TABLE") { + if(QString::fromStdString(objIter->name()).toUpper() == "TABLE") { if(objIter->hasKeyword("Name")) { - if(objIter->findKeyword("Name")[0].toUpper() == tblname.toUpper()) { + if(QString::fromStdString(objIter->findKeyword("Name")[0]).toUpper() == tblname.toUpper()) { loadKernel(objIter->findKeyword("Kernels")); return; } diff --git a/isis/src/messenger/apps/mdisedrinfo/main.cpp b/isis/src/messenger/apps/mdisedrinfo/main.cpp index 7eeed96b73..16724d1b84 100644 --- a/isis/src/messenger/apps/mdisedrinfo/main.cpp +++ b/isis/src/messenger/apps/mdisedrinfo/main.cpp @@ -162,7 +162,7 @@ void IsisMain() { if(!pvl.isEmpty()) { Pvl pout; pout.addGroup(mdiskeys); - pout.write(pvl); + pout.write(pvl.toStdString()); } // Log the results to the log/terminal/gui diff --git a/isis/src/messenger/objs/MdisCamera/MdisCamera.cpp b/isis/src/messenger/objs/MdisCamera/MdisCamera.cpp index ab321222b7..c64e987d53 100644 --- a/isis/src/messenger/objs/MdisCamera/MdisCamera.cpp +++ b/isis/src/messenger/objs/MdisCamera/MdisCamera.cpp @@ -139,7 +139,7 @@ namespace Isis { // !!NOTE: The ephemeris time MUST be set prior to creating the // cache (CreateCache) because the kernels are all unloaded // after the cache is done and this operation will fail!! - QString stime = inst["SpacecraftClockCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockCount"]); double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;// divide by 1000 to convert to seconds iTime etStart = getClockTime(stime); diff --git a/isis/src/messenger/objs/MdisCamera/unitTest.cpp b/isis/src/messenger/objs/MdisCamera/unitTest.cpp index 140552d7c4..f4a73854a5 100644 --- a/isis/src/messenger/objs/MdisCamera/unitTest.cpp +++ b/isis/src/messenger/objs/MdisCamera/unitTest.cpp @@ -56,7 +56,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp b/isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp index 7f0a2b9b16..841c4d9d67 100644 --- a/isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp +++ b/isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp @@ -40,7 +40,7 @@ namespace Isis{ // Decide if the file is an HRSC image or something else if (label["INSTRUMENT_ID"][0] != "HRSC") { IString msg = "File [" + ui.GetFileName("FROM") + "] with [INSTRUMENT_ID = " + - label["INSTRUMENT_ID"][0] + + QString::fromStdString(label["INSTRUMENT_ID"][0]) + "] does not appear to be a Mars Express HRSC image. " + "Consider using pds2isis to import the image."; throw IException(IException::User, msg, _FILEINFO_); @@ -65,13 +65,13 @@ namespace Isis{ else { QString msg = "File [" + ui.GetFileName("FROM"); msg += "] does not appear to be a Mars Express stereo or SRC file. Label keyword [DETECTOR_ID = "; - msg += label["DETECTOR_ID"][0] + "] is not recognized."; + msg += QString::fromStdString(label["DETECTOR_ID"][0]) + "] is not recognized."; throw IException(IException::User, msg, _FILEINFO_); } if ((int)label["PROCESSING_LEVEL_ID"] >= 4) { QString msg = "File [" + ui.GetFileName("FROM"); - msg += "] has keyword [PROCESSING_LEVEL_ID = " + label["PROCESSING_LEVEL_ID"][0] + "]"; + msg += "] has keyword [PROCESSING_LEVEL_ID = " + QString::fromStdString(label["PROCESSING_LEVEL_ID"][0]) + "]"; msg += " and can not be read by this program."; throw IException(IException::User, msg, _FILEINFO_); } @@ -311,13 +311,13 @@ namespace Isis{ instrumentXlater.Auto(outLabel); // Remove 'Z' from times - QString startTime = outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0]; + QString startTime = QString::fromStdString(outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0]); startTime = startTime.mid(0, startTime.size() - 1); - outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"] = startTime; + outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"] = startTime.toStdString(); - QString stopTime = outLabel.findGroup("Instrument", Pvl::Traverse)["StopTime"][0]; + QString stopTime = QString::fromStdString(outLabel.findGroup("Instrument", Pvl::Traverse)["StopTime"][0]); stopTime = stopTime.mid(0, stopTime.size() - 1); - outLabel.findGroup("Instrument", Pvl::Traverse)["StopTime"] = stopTime; + outLabel.findGroup("Instrument", Pvl::Traverse)["StopTime"] = stopTime.toStdString(); // Translate the BandBin group transFile = transDir + "MexHrscBandBin.trn"; diff --git a/isis/src/mex/objs/MexHrscSrcCamera/MexHrscSrcCamera.cpp b/isis/src/mex/objs/MexHrscSrcCamera/MexHrscSrcCamera.cpp index 3ab3b3d54f..1aa0ed2f96 100644 --- a/isis/src/mex/objs/MexHrscSrcCamera/MexHrscSrcCamera.cpp +++ b/isis/src/mex/objs/MexHrscSrcCamera/MexHrscSrcCamera.cpp @@ -77,7 +77,7 @@ namespace Isis { PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); iTime startTime; - startTime.setUtc((QString)inst["StartTime"]); + startTime.setUtc(QString::fromStdString(inst["StartTime"])); setTime(startTime); // Internalize all the NAIF SPICE information into memory. diff --git a/isis/src/mgs/apps/moc2isis/main.cpp b/isis/src/mgs/apps/moc2isis/main.cpp index 9472a087f3..a2fdf431ae 100644 --- a/isis/src/mgs/apps/moc2isis/main.cpp +++ b/isis/src/mgs/apps/moc2isis/main.cpp @@ -36,8 +36,8 @@ void IsisMain() { bool compressed = false; bool projected; try { - Pvl lab(in.expanded()); - id = (QString) lab["DATA_SET_ID"]; + Pvl lab(in.expanded().toStdString()); + id = QString::fromStdString(lab["DATA_SET_ID"]); if(lab.findObject("IMAGE").hasKeyword("ENCODING_TYPE")) compressed = true; projected = lab.hasObject("IMAGE_MAP_PROJECTION"); } @@ -107,95 +107,95 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { FileName transFile(transDir + "MgsMocInstrument.trn"); // Get the translation manager ready - Pvl labelPvl(labelFile.expanded()); + Pvl labelPvl(labelFile.expanded().toStdString()); PvlToPvlTranslationManager instrumentXlater(labelPvl, transFile.expanded()); PvlGroup inst("Instrument"); if(instrumentXlater.InputHasKeyword("SpacecraftName")) { QString str = instrumentXlater.Translate("SpacecraftName"); - inst += PvlKeyword("SpacecraftName", str); + inst += PvlKeyword("SpacecraftName", str.toStdString()); } if(instrumentXlater.InputHasKeyword("InstrumentId")) { QString str = instrumentXlater.Translate("InstrumentId"); - inst += PvlKeyword("InstrumentId", str); + inst += PvlKeyword("InstrumentId", str.toStdString()); } if(instrumentXlater.InputHasKeyword("TargetName")) { QString str = instrumentXlater.Translate("TargetName"); - inst += PvlKeyword("TargetName", str); + inst += PvlKeyword("TargetName", str.toStdString()); } if(instrumentXlater.InputHasKeyword("StartTime")) { QString str = instrumentXlater.Translate("StartTime"); - inst += PvlKeyword("StartTime", str); + inst += PvlKeyword("StartTime", str.toStdString()); // isisLab.addKeyword ("StartTime", str+"Z"); startTime = str; } if(instrumentXlater.InputHasKeyword("StopTime")) { QString str = instrumentXlater.Translate("StopTime"); - inst += PvlKeyword("StopTime", str); + inst += PvlKeyword("StopTime", str.toStdString()); // isisLab.addKeyword ("StopTime", str+"Z"); } if(instrumentXlater.InputHasKeyword("CrosstrackSumming")) { QString str = instrumentXlater.Translate("CrosstrackSumming"); - inst += PvlKeyword("CrosstrackSumming", str); + inst += PvlKeyword("CrosstrackSumming", str.toStdString()); } if(instrumentXlater.InputHasKeyword("DowntrackSumming")) { QString str = instrumentXlater.Translate("DowntrackSumming"); - inst += PvlKeyword("DowntrackSumming", str); + inst += PvlKeyword("DowntrackSumming", str.toStdString()); } if(instrumentXlater.InputHasKeyword("FocalPlaneTemperature")) { QString str = instrumentXlater.Translate("FocalPlaneTemperature"); - inst += PvlKeyword("FocalPlaneTemperature", str); + inst += PvlKeyword("FocalPlaneTemperature", str.toStdString()); } if(instrumentXlater.InputHasKeyword("GainModeId")) { QString str = instrumentXlater.Translate("GainModeId"); - inst += PvlKeyword("GainModeId", str); + inst += PvlKeyword("GainModeId", str.toStdString()); } if(instrumentXlater.InputHasKeyword("LineExposureDuration")) { QString str = instrumentXlater.Translate("LineExposureDuration"); - inst += PvlKeyword("LineExposureDuration", str, "milliseconds"); + inst += PvlKeyword("LineExposureDuration", str.toStdString(), "milliseconds"); } if(instrumentXlater.InputHasKeyword("MissionPhaseName")) { QString str = instrumentXlater.Translate("MissionPhaseName"); - inst += PvlKeyword("MissionPhaseName", str); + inst += PvlKeyword("MissionPhaseName", str.toStdString()); } if(instrumentXlater.InputHasKeyword("OffsetModeId")) { QString str = instrumentXlater.Translate("OffsetModeId"); - inst += PvlKeyword("OffsetModeId", str); + inst += PvlKeyword("OffsetModeId", str.toStdString()); } if(instrumentXlater.InputHasKeyword("SpacecraftClockCount")) { QString str = instrumentXlater.Translate("SpacecraftClockCount"); - inst += PvlKeyword("SpacecraftClockCount", str); + inst += PvlKeyword("SpacecraftClockCount", str.toStdString()); clockCount = str; } if(instrumentXlater.InputHasKeyword("RationaleDesc")) { QString str = instrumentXlater.Translate("RationaleDesc"); - inst += PvlKeyword("RationaleDesc", str); + inst += PvlKeyword("RationaleDesc", str.toStdString()); } if(instrumentXlater.InputHasKeyword("OrbitNumber")) { QString str = instrumentXlater.Translate("OrbitNumber"); - inst += PvlKeyword("OrbitNumber", str); + inst += PvlKeyword("OrbitNumber", str.toStdString()); } if(instrumentXlater.InputHasKeyword("FirstLineSample")) { QString str = instrumentXlater.Translate("FirstLineSample"); int num = toInt(str); num++; - inst += PvlKeyword("FirstLineSample", toString(num)); + inst += PvlKeyword("FirstLineSample", std::to_string(num)); } // Add the instrument specific info to the output file @@ -211,38 +211,38 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { if(archiveXlater.InputHasKeyword("DataSetId")) { QString str = archiveXlater.Translate("DataSetId"); - arch += PvlKeyword("DataSetId", str); + arch += PvlKeyword("DataSetId", str.toStdString()); } if(archiveXlater.InputHasKeyword("ProductId")) { QString str = archiveXlater.Translate("ProductId"); - arch += PvlKeyword("ProductId", str); + arch += PvlKeyword("ProductId", str.toStdString()); productId = str; } if(archiveXlater.InputHasKeyword("ProducerId")) { QString str = archiveXlater.Translate("ProducerId"); - arch += PvlKeyword("ProducerId", str); + arch += PvlKeyword("ProducerId", str.toStdString()); } if(archiveXlater.InputHasKeyword("ProductCreationTime")) { QString str = archiveXlater.Translate("ProductCreationTime"); - arch += PvlKeyword("ProductCreationTime", str); + arch += PvlKeyword("ProductCreationTime", str.toStdString()); } if(archiveXlater.InputHasKeyword("SoftwareName")) { QString str = archiveXlater.Translate("SoftwareName"); - arch += PvlKeyword("SoftwareName", str); + arch += PvlKeyword("SoftwareName", str.toStdString()); } if(archiveXlater.InputHasKeyword("UploadId")) { QString str = archiveXlater.Translate("UploadId"); - arch += PvlKeyword("UploadId", str); + arch += PvlKeyword("UploadId", str.toStdString()); } if(archiveXlater.InputHasKeyword("DataQualityDesc")) { QString str = archiveXlater.Translate("DataQualityDesc"); - arch += PvlKeyword("DataQualityDesc", str); + arch += PvlKeyword("DataQualityDesc", str.toStdString()); } // New labels (not in the PDS file) @@ -260,15 +260,15 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { imageNumber += productId.mid(4); - arch += PvlKeyword("ImageNumber", imageNumber); + arch += PvlKeyword("ImageNumber", imageNumber.toStdString()); } // The ImageKeyId is made up of the: // First five digits of the SpacecraftClockCount followed by the // Last five dights of the ProductId if(clockCount.length() > 0 && productId.length() > 0) { - arch += PvlKeyword("ImageKeyId", clockCount.mid(0, 5) + - productId.mid(4)); + arch += PvlKeyword("ImageKeyId", clockCount.mid(0, 5).toStdString() + + productId.mid(4).toStdString()); } // Add the archive info to the output file @@ -287,17 +287,17 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { QString str = bandBinXlater.Translate("FilterName").toUpper(); if(str == "BLUE") { - bandBin += PvlKeyword("FilterName", str); - bandBin += PvlKeyword("OriginalBand", toString(1)); - bandBin += PvlKeyword("Center", toString(0.4346), "micrometers"); - bandBin += PvlKeyword("Width", toString(0.050), "micrometers"); + bandBin += PvlKeyword("FilterName", str.toStdString()); + bandBin += PvlKeyword("OriginalBand", std::to_string(1)); + bandBin += PvlKeyword("Center", std::to_string(0.4346), "micrometers"); + bandBin += PvlKeyword("Width", std::to_string(0.050), "micrometers"); frameCode = "-94033"; } else if(str == "RED") { - bandBin += PvlKeyword("FilterName", str); - bandBin += PvlKeyword("OriginalBand", toString(1)); - bandBin += PvlKeyword("Center", toString(0.6134), "micrometers"); - bandBin += PvlKeyword("Width", toString(0.050), "micrometers"); + bandBin += PvlKeyword("FilterName", str.toStdString()); + bandBin += PvlKeyword("OriginalBand", std::to_string(1)); + bandBin += PvlKeyword("Center", std::to_string(0.6134), "micrometers"); + bandBin += PvlKeyword("Width", std::to_string(0.050), "micrometers"); frameCode = "-94032"; } else { @@ -306,9 +306,9 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { } else { bandBin += PvlKeyword("FilterName", "BROAD_BAND"); - bandBin += PvlKeyword("OriginalBand", toString(1)); - bandBin += PvlKeyword("Center", toString(0.700), "micrometers"); - bandBin += PvlKeyword("Width", toString(0.400), "micrometers"); + bandBin += PvlKeyword("OriginalBand", std::to_string(1)); + bandBin += PvlKeyword("Center", std::to_string(0.700), "micrometers"); + bandBin += PvlKeyword("Width", std::to_string(0.400), "micrometers"); frameCode = "-94031"; } @@ -317,6 +317,6 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { // Create the Kernel Group PvlGroup kerns("Kernels"); - kerns += PvlKeyword("NaifFrameCode", frameCode); + kerns += PvlKeyword("NaifFrameCode", frameCode.toStdString()); ocube->putGroup(kerns); } diff --git a/isis/src/mgs/apps/moccal/moccal.cpp b/isis/src/mgs/apps/moccal/moccal.cpp index 49838cfe3b..4d69ad0b83 100644 --- a/isis/src/mgs/apps/moccal/moccal.cpp +++ b/isis/src/mgs/apps/moccal/moccal.cpp @@ -91,7 +91,7 @@ namespace Isis { else { calKernelFile = p.MissionData("mgs", "/calibration/moccal.ker.???", true); } - Pvl calKernel(calKernelFile); + Pvl calKernel(calKernelFile.toStdString()); // Point to the right group of camera parameters QString camera; @@ -107,7 +107,7 @@ namespace Isis { else { camera = "NarrowAngleA"; } - PvlGroup &calCamera = calKernel.findGroup(camera); + PvlGroup &calCamera = calKernel.findGroup(camera.toStdString()); // Get the camera specific calibration parameters from the kernel file // and load detector coefficients (gain/offsets at each pixel) @@ -115,7 +115,7 @@ namespace Isis { gbl::dc = calCamera["DC"]; gbl::g = calCamera["G"]; gbl::w0 = calCamera["W0"]; - QString coefFile = calCamera["CoefFile"]; + QString coefFile = QString::fromStdString(calCamera["CoefFile"]); gbl::LoadCoefficients(coefFile, icube->sampleCount()); #if 0 @@ -176,22 +176,22 @@ namespace Isis { // Add the radiometry group PvlGroup calgrp("Radiometry"); - calgrp += PvlKeyword("CalibrationKernel", calKernelFile); - calgrp += PvlKeyword("CoefficientFile", coefFile); + calgrp += PvlKeyword("CalibrationKernel", calKernelFile.toStdString()); + calgrp += PvlKeyword("CoefficientFile", coefFile.toStdString()); - calgrp += PvlKeyword("a", toString(gbl::a)); + calgrp += PvlKeyword("a", std::to_string(gbl::a)); calgrp["a"].addComment("Radiometric equation in moccal"); calgrp["a"].addComment("r = (pixel - z + off) / a - g / ex - dc"); - calgrp += PvlKeyword("off", toString(gbl::off)); - calgrp += PvlKeyword("ex", toString(gbl::ex)); - calgrp += PvlKeyword("z", toString(gbl::z)); - calgrp += PvlKeyword("dc", toString(gbl::dc)); - calgrp += PvlKeyword("g", toString(gbl::g)); + calgrp += PvlKeyword("off", std::to_string(gbl::off)); + calgrp += PvlKeyword("ex", std::to_string(gbl::ex)); + calgrp += PvlKeyword("z", std::to_string(gbl::z)); + calgrp += PvlKeyword("dc", std::to_string(gbl::dc)); + calgrp += PvlKeyword("g", std::to_string(gbl::g)); - calgrp += PvlKeyword("w0", toString(gbl::w0)); + calgrp += PvlKeyword("w0", std::to_string(gbl::w0)); calgrp["w0"].addComment("Reflectance = r * iof, where iof = (s * s) / w0"); - calgrp += PvlKeyword("s", toString(sunAU)); - calgrp += PvlKeyword("iof", toString(gbl::iof)); + calgrp += PvlKeyword("s", std::to_string(sunAU)); + calgrp += PvlKeyword("iof", std::to_string(gbl::iof)); ocube->putGroup(calgrp); diff --git a/isis/src/mgs/apps/mocnoise50/main.cpp b/isis/src/mgs/apps/mocnoise50/main.cpp index f9b79161b3..6efee3fcc0 100644 --- a/isis/src/mgs/apps/mocnoise50/main.cpp +++ b/isis/src/mgs/apps/mocnoise50/main.cpp @@ -142,11 +142,11 @@ void IsisMain() { p.SetOutputCube("TO"); PvlGroup results("Results"); - results += PvlKeyword("DeltaSample", toString(gbl::delta)); - results += PvlKeyword("StartingSample", toString(gbl::ssFirst)); - results += PvlKeyword("Coefficient1", toString(gbl::avg1)); - results += PvlKeyword("Coefficient2", toString(gbl::avg2)); - results += PvlKeyword("Coefficient3", toString(gbl::avg3)); + results += PvlKeyword("DeltaSample", std::to_string(gbl::delta)); + results += PvlKeyword("StartingSample", std::to_string(gbl::ssFirst)); + results += PvlKeyword("Coefficient1", std::to_string(gbl::avg1)); + results += PvlKeyword("Coefficient2", std::to_string(gbl::avg2)); + results += PvlKeyword("Coefficient3", std::to_string(gbl::avg3)); // If less than 50% of the lines do not agree on a delta then // we will assume no noise so just make a copy @@ -155,7 +155,7 @@ void IsisMain() { p.StartProcess(gbl::Copy); results += PvlKeyword("NoiseRemoved", "No"); QString reason = "Less than 50% of the lines agreed on a delta sample"; - results += PvlKeyword("Reason", reason); + results += PvlKeyword("Reason", reason.toStdString()); } // If less than 50% of the lines do not agree on a first same then @@ -165,7 +165,7 @@ void IsisMain() { p.StartProcess(gbl::Copy); results += PvlKeyword("NoiseRemoved", "No"); QString reason = "Less than 50% of the lines agreed on a starting sample"; - results += PvlKeyword("Reason", reason); + results += PvlKeyword("Reason", reason.toStdString()); } // Remove that noise diff --git a/isis/src/mgs/apps/mocproc/main.cpp b/isis/src/mgs/apps/mocproc/main.cpp index 3f9b3836dd..4a852310aa 100644 --- a/isis/src/mgs/apps/mocproc/main.cpp +++ b/isis/src/mgs/apps/mocproc/main.cpp @@ -65,19 +65,19 @@ void IsisMain() { p.Application("mocevenodd").SetInputParameter("FROM", true); p.Application("mocevenodd").SetOutputParameter("TO", "evenodd"); - Pvl inputPvl(FileName(ui.GetFileName("FROM")).expanded()); + Pvl inputPvl(FileName(ui.GetFileName("FROM")).expanded().toStdString()); int summingMode = 0; bool isNarrowAngle = false; if(inputPvl.hasKeyword("CROSSTRACK_SUMMING")) { summingMode = inputPvl["CROSSTRACK_SUMMING"]; - isNarrowAngle = ((QString)inputPvl["INSTRUMENT_ID"] == "MOC-NA"); + isNarrowAngle = (QString::fromStdString(inputPvl["INSTRUMENT_ID"]) == "MOC-NA"); } else { PvlGroup &inst = inputPvl.findGroup("Instrument", Pvl::Traverse); summingMode = inst["CrosstrackSumming"]; - isNarrowAngle = ((QString)inst["InstrumentId"] == "MOC-NA"); + isNarrowAngle = (QString::fromStdString(inst["InstrumentId"]) == "MOC-NA"); } if(summingMode != 1) { @@ -101,7 +101,7 @@ void IsisMain() { p.Application("cam2map").AddConstParameter("PIXRES", "MPP"); } else if(ui.WasEntered("MAP")) { - Pvl mapPvl(FileName(ui.GetFileName("MAP")).expanded()); + Pvl mapPvl(FileName(ui.GetFileName("MAP")).expanded().toStdString()); if(mapPvl.findGroup("Mapping", Pvl::Traverse).hasKeyword("PixelResolution")) { p.Application("cam2map").AddConstParameter("PIXRES", "MAP"); } diff --git a/isis/src/mgs/objs/MocLabels/MocLabels.cpp b/isis/src/mgs/objs/MocLabels/MocLabels.cpp index e07862ddea..ba8bead661 100644 --- a/isis/src/mgs/objs/MocLabels/MocLabels.cpp +++ b/isis/src/mgs/objs/MocLabels/MocLabels.cpp @@ -66,31 +66,31 @@ namespace Isis { // Get stuff out of the instrument group Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - p_instrumentId = (QString) inst["InstrumentId"]; + p_instrumentId = QString::fromStdString(inst["InstrumentId"]); p_startingSample = inst["FirstLineSample"]; p_crosstrackSumming = inst["CrosstrackSumming"]; p_downtrackSumming = inst["DowntrackSumming"]; p_exposureDuration = inst["LineExposureDuration"]; p_focalPlaneTemp = inst["FocalPlaneTemperature"]; - p_clockCount = (QString) inst["SpacecraftClockCount"]; + p_clockCount = QString::fromStdString(inst["SpacecraftClockCount"]); p_orbitNumber = 0; if(inst.hasKeyword("OrbitNumber")) { p_orbitNumber = inst["OrbitNumber"]; } - p_gainModeId = (QString) inst["GainModeId"]; + p_gainModeId = QString::fromStdString(inst["GainModeId"]); p_offsetModeId = inst["OffsetModeId"]; - p_startTime = (QString) inst["StartTime"]; + p_startTime = QString::fromStdString(inst["StartTime"]); // Get stuff out of the archive group p_dataQuality = "Unknown"; PvlGroup &arch = lab.findGroup("Archive", Pvl::Traverse); if(arch.hasKeyword("DataQualityDesc")) { - p_dataQuality = (QString) arch["DataQualityDesc"]; + p_dataQuality = QString::fromStdString(arch["DataQualityDesc"]); } // Get Stuff out of the band bind group PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse); - p_filter = (QString) bandBin["FilterName"]; + p_filter = QString::fromStdString(bandBin["FilterName"]); // Get the number of samples in the initial cube as it may have been // cropped or projected @@ -100,8 +100,8 @@ namespace Isis { // Get the two kernels for time computations PvlGroup &kerns = lab.findGroup("Kernels", Pvl::Traverse); - p_lsk = FileName(kerns["LeapSecond"][0]); - p_sclk = FileName(kerns["SpacecraftClock"][0]); + p_lsk = FileName( QString::fromStdString(kerns["LeapSecond"][0])); + p_sclk = FileName( QString::fromStdString(kerns["SpacecraftClock"][0])); } /** diff --git a/isis/src/mgs/objs/MocNarrowAngleCamera/MocNarrowAngleCamera.cpp b/isis/src/mgs/objs/MocNarrowAngleCamera/MocNarrowAngleCamera.cpp index 1b3abdeb57..d4682dd05b 100644 --- a/isis/src/mgs/objs/MocNarrowAngleCamera/MocNarrowAngleCamera.cpp +++ b/isis/src/mgs/objs/MocNarrowAngleCamera/MocNarrowAngleCamera.cpp @@ -46,7 +46,7 @@ namespace Isis { // Get the start time from labels Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockCount"]); double etStart = getClockTime(stime).Et(); // Get other info from labels diff --git a/isis/src/mgs/objs/MocWideAngleCamera/MocWideAngleCamera.cpp b/isis/src/mgs/objs/MocWideAngleCamera/MocWideAngleCamera.cpp index 2767625054..613a040587 100644 --- a/isis/src/mgs/objs/MocWideAngleCamera/MocWideAngleCamera.cpp +++ b/isis/src/mgs/objs/MocWideAngleCamera/MocWideAngleCamera.cpp @@ -63,7 +63,7 @@ namespace Isis { // Get the start time from labels PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockCount"]); double etStart = getClockTime(stime).Et(); // Setup detector map diff --git a/isis/src/mro/apps/crism2isis/crism2isis.cpp b/isis/src/mro/apps/crism2isis/crism2isis.cpp index 00d2176790..891cfb9e69 100644 --- a/isis/src/mro/apps/crism2isis/crism2isis.cpp +++ b/isis/src/mro/apps/crism2isis/crism2isis.cpp @@ -33,12 +33,12 @@ namespace Isis{ Pvl outLabel; - Pvl labelPvl(inFile.expanded()); + Pvl labelPvl(inFile.expanded().toStdString()); QString prodType; if (labelPvl.hasKeyword("PRODUCT_TYPE")) { - prodType = (QString)labelPvl.findKeyword("PRODUCT_TYPE"); + prodType = QString::fromStdString(labelPvl.findKeyword("PRODUCT_TYPE")); } else { QString msg = "Unsupported CRISM file type, supported types are: DDR, MRDR, and TRDR"; @@ -48,7 +48,7 @@ namespace Isis{ if (prodType.toUpper() == "MAP_PROJECTED_MULTISPECTRAL_RDR") { QString prodId; if (labelPvl.hasKeyword("PRODUCT_ID")) { - prodId = (QString)labelPvl.findKeyword("PRODUCT_ID"); + prodId = QString::fromStdString(labelPvl.findKeyword("PRODUCT_ID")); prodId = prodId.mid(prodId.indexOf("_") + 1, prodId.indexOf("_")); } else { @@ -65,7 +65,7 @@ namespace Isis{ PvlGroup bandBin = PvlGroup("BandBin"); PvlKeyword origBand = PvlKeyword("OriginalBand"); PvlKeyword widths = PvlKeyword("Width"); - QString tablePath = (QString)labelPvl.findKeyword("MRO:WAVELENGTH_FILE_NAME"); + QString tablePath = QString::fromStdString(labelPvl.findKeyword("MRO:WAVELENGTH_FILE_NAME")); tablePath = tablePath.toLower(); FileName tableFile(inFile.path() + "/" + tablePath); //Check if the wavelength file exists @@ -85,8 +85,8 @@ namespace Isis{ st = st.simplified().trimmed(); QStringList cols = st.split(","); - origBand += toString(band); - widths += cols[2]; + origBand += std::to_string(band); + widths += cols[2].toStdString(); band++; } delete fin; @@ -111,7 +111,7 @@ namespace Isis{ PvlKeyword bandName = PvlKeyword("BandName"); PvlKeyword bandNames = labelPvl.findObject("IMAGE").findKeyword("BAND_NAME"); for (int i = 0; i < bandNames.size(); i++) { - origBand += toString(i + 1); + origBand += std::to_string(i + 1); bandName += bandNames[i]; } bandBin.addKeyword(origBand); @@ -139,7 +139,7 @@ namespace Isis{ PvlKeyword bandName = PvlKeyword("BandName"); PvlKeyword bandNames = labelPvl.findObject("FILE").findObject("IMAGE").findKeyword("BAND_NAME"); for (int i = 0; i < bandNames.size(); i++) { - origBand += toString(i + 1); + origBand += std::to_string(i + 1); bandName += bandNames[i]; } bandBin.addKeyword(origBand); diff --git a/isis/src/mro/apps/ctxcal/ctxcal.cpp b/isis/src/mro/apps/ctxcal/ctxcal.cpp index 6969f691cc..f854129823 100644 --- a/isis/src/mro/apps/ctxcal/ctxcal.cpp +++ b/isis/src/mro/apps/ctxcal/ctxcal.cpp @@ -45,11 +45,11 @@ namespace Isis { // We will be processing by line ProcessByLine p; - Isis::Pvl lab(icube->fileName()); + Isis::Pvl lab(icube->fileName().toStdString()); Isis::PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString instId = inst["InstrumentId"]; + QString instId = QString::fromStdString(inst["InstrumentId"]); if(instId != "CTX") { QString msg = "This is not a CTX image. Ctxcal requires a CTX image."; throw IException(IException::User, msg, _FILEINFO_); @@ -92,7 +92,7 @@ namespace Isis { } // Get label parameters we will need for calibration equation - iTime startTime((QString) inst["StartTime"]); + iTime startTime(QString::fromStdString(inst["StartTime"])); double etStart = startTime.Et(); // Read exposure and convert to milliseconds @@ -209,8 +209,8 @@ namespace Isis { // Add the radiometry group PvlGroup calgrp("Radiometry"); - calgrp += PvlKeyword("FlatFile", flatFile.fileName()); - calgrp += PvlKeyword("iof", toString(iof)); + calgrp += PvlKeyword("FlatFile", flatFile.fileName().toStdString()); + calgrp += PvlKeyword("iof", std::to_string(iof)); ocube->putGroup(calgrp); diff --git a/isis/src/mro/apps/ctxevenodd/main.cpp b/isis/src/mro/apps/ctxevenodd/main.cpp index 623b022047..b42538afca 100644 --- a/isis/src/mro/apps/ctxevenodd/main.cpp +++ b/isis/src/mro/apps/ctxevenodd/main.cpp @@ -41,11 +41,11 @@ void IsisMain() { // Make sure we have a ctx cube and it has SpatialSumming of 1 UserInterface &ui = Application::GetUserInterface(); - Isis::Pvl lab(ui.GetCubeName("FROM")); + Isis::Pvl lab(ui.GetCubeName("FROM").toStdString()); Isis::PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString instId = inst["InstrumentId"]; + QString instId = QString::fromStdString(inst["InstrumentId"]); if(instId != "CTX") { QString msg = "This is not a CTX image. Ctxcevenodd requires a CTX image."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/mro/apps/hi2isis/hi2isis.cpp b/isis/src/mro/apps/hi2isis/hi2isis.cpp index 462002d1c9..9c14209287 100644 --- a/isis/src/mro/apps/hi2isis/hi2isis.cpp +++ b/isis/src/mro/apps/hi2isis/hi2isis.cpp @@ -78,8 +78,8 @@ namespace Isis { QString id; bool projected; try { - Pvl lab(inFile.expanded()); - id = (QString) lab.findKeyword("DATA_SET_ID"); + Pvl lab(inFile.expanded().toStdString()); + id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); projected = lab.hasObject("IMAGE_MAP_PROJECTION"); } catch(IException &e) { @@ -185,49 +185,49 @@ namespace Isis { // Log the results of the image conversion PvlGroup results("Results"); - results += PvlKeyword("From", inFile.expanded()); - - results += PvlKeyword("CalibrationBufferGaps", toString(gapCount[0])); - results += PvlKeyword("CalibrationBufferLIS", toString(lisCount[0])); - results += PvlKeyword("CalibrationBufferHIS", toString(hisCount[0])); - results += PvlKeyword("CalibrationBufferPossibleGaps", toString(suspectGapCount[0])); - results += PvlKeyword("CalibrationBufferInvalid", toString(invalidCount[0])); - results += PvlKeyword("CalibrationBufferValid", toString(validCount[0])); - - results += PvlKeyword("CalibrationImageGaps", toString(gapCount[1])); - results += PvlKeyword("CalibrationImageLIS", toString(lisCount[1])); - results += PvlKeyword("CalibrationImageHIS", toString(hisCount[1])); - results += PvlKeyword("CalibrationImagePossibleGaps", toString(suspectGapCount[1])); - results += PvlKeyword("CalibrationImageInvalid", toString(invalidCount[1])); - results += PvlKeyword("CalibrationImageValid", toString(validCount[1])); - - results += PvlKeyword("CalibrationDarkGaps", toString(gapCount[2])); - results += PvlKeyword("CalibrationDarkLIS", toString(lisCount[2])); - results += PvlKeyword("CalibrationDarkHIS", toString(hisCount[2])); - results += PvlKeyword("CalibrationDarkPossibleGaps", toString(suspectGapCount[2])); - results += PvlKeyword("CalibrationDarkInvalid", toString(invalidCount[2])); - results += PvlKeyword("CalibrationDarkValid", toString(validCount[2])); - - results += PvlKeyword("ObservationBufferGaps", toString(gapCount[3])); - results += PvlKeyword("ObservationBufferLIS", toString(lisCount[3])); - results += PvlKeyword("ObservationBufferHIS", toString(hisCount[3])); - results += PvlKeyword("ObservationBufferPossibleGaps", toString(suspectGapCount[3])); - results += PvlKeyword("ObservationBufferInvalid", toString(invalidCount[3])); - results += PvlKeyword("ObservationBufferValid", toString(validCount[3])); - - results += PvlKeyword("ObservationImageGaps", toString(gapCount[4])); - results += PvlKeyword("ObservationImageLIS", toString(lisCount[4])); - results += PvlKeyword("ObservationImageHIS", toString(hisCount[4])); - results += PvlKeyword("ObservationImagePossibleGaps", toString(suspectGapCount[4])); - results += PvlKeyword("ObservationImageInvalid", toString(invalidCount[4])); - results += PvlKeyword("ObservationImageValid", toString(validCount[4])); - - results += PvlKeyword("ObservationDarkGaps", toString(gapCount[5])); - results += PvlKeyword("ObservationDarkLIS", toString(lisCount[5])); - results += PvlKeyword("ObservationDarkHIS", toString(hisCount[5])); - results += PvlKeyword("ObservationDarkPossibleGaps", toString(suspectGapCount[5])); - results += PvlKeyword("ObservationDarkInvalid", toString(invalidCount[5])); - results += PvlKeyword("ObservationDarkValid", toString(validCount[5])); + results += PvlKeyword("From", inFile.expanded().toStdString()); + + results += PvlKeyword("CalibrationBufferGaps", std::to_string(gapCount[0])); + results += PvlKeyword("CalibrationBufferLIS", std::to_string(lisCount[0])); + results += PvlKeyword("CalibrationBufferHIS", std::to_string(hisCount[0])); + results += PvlKeyword("CalibrationBufferPossibleGaps", std::to_string(suspectGapCount[0])); + results += PvlKeyword("CalibrationBufferInvalid", std::to_string(invalidCount[0])); + results += PvlKeyword("CalibrationBufferValid", std::to_string(validCount[0])); + + results += PvlKeyword("CalibrationImageGaps", std::to_string(gapCount[1])); + results += PvlKeyword("CalibrationImageLIS", std::to_string(lisCount[1])); + results += PvlKeyword("CalibrationImageHIS", std::to_string(hisCount[1])); + results += PvlKeyword("CalibrationImagePossibleGaps", std::to_string(suspectGapCount[1])); + results += PvlKeyword("CalibrationImageInvalid", std::to_string(invalidCount[1])); + results += PvlKeyword("CalibrationImageValid", std::to_string(validCount[1])); + + results += PvlKeyword("CalibrationDarkGaps", std::to_string(gapCount[2])); + results += PvlKeyword("CalibrationDarkLIS", std::to_string(lisCount[2])); + results += PvlKeyword("CalibrationDarkHIS", std::to_string(hisCount[2])); + results += PvlKeyword("CalibrationDarkPossibleGaps", std::to_string(suspectGapCount[2])); + results += PvlKeyword("CalibrationDarkInvalid", std::to_string(invalidCount[2])); + results += PvlKeyword("CalibrationDarkValid", std::to_string(validCount[2])); + + results += PvlKeyword("ObservationBufferGaps", std::to_string(gapCount[3])); + results += PvlKeyword("ObservationBufferLIS", std::to_string(lisCount[3])); + results += PvlKeyword("ObservationBufferHIS", std::to_string(hisCount[3])); + results += PvlKeyword("ObservationBufferPossibleGaps", std::to_string(suspectGapCount[3])); + results += PvlKeyword("ObservationBufferInvalid", std::to_string(invalidCount[3])); + results += PvlKeyword("ObservationBufferValid", std::to_string(validCount[3])); + + results += PvlKeyword("ObservationImageGaps", std::to_string(gapCount[4])); + results += PvlKeyword("ObservationImageLIS", std::to_string(lisCount[4])); + results += PvlKeyword("ObservationImageHIS", std::to_string(hisCount[4])); + results += PvlKeyword("ObservationImagePossibleGaps", std::to_string(suspectGapCount[4])); + results += PvlKeyword("ObservationImageInvalid", std::to_string(invalidCount[4])); + results += PvlKeyword("ObservationImageValid", std::to_string(validCount[4])); + + results += PvlKeyword("ObservationDarkGaps", std::to_string(gapCount[5])); + results += PvlKeyword("ObservationDarkLIS", std::to_string(lisCount[5])); + results += PvlKeyword("ObservationDarkHIS", std::to_string(hisCount[5])); + results += PvlKeyword("ObservationDarkPossibleGaps", std::to_string(suspectGapCount[5])); + results += PvlKeyword("ObservationDarkInvalid", std::to_string(invalidCount[5])); + results += PvlKeyword("ObservationDarkValid", std::to_string(validCount[5])); // Write the results to the log Application::Log(results); @@ -460,7 +460,7 @@ namespace Isis { QString transDir = "$ISISROOT/appdata/translations/"; // Get a filename for the HiRISE EDR label - Pvl labelPvl(labelFile.expanded()); + Pvl labelPvl(labelFile.expanded().toStdString()); // Translate the Instrument group FileName transFile(transDir + "MroHiriseInstrument.trn"); diff --git a/isis/src/mro/apps/hical/hical.cpp b/isis/src/mro/apps/hical/hical.cpp index 2e6444a947..b451d98373 100644 --- a/isis/src/mro/apps/hical/hical.cpp +++ b/isis/src/mro/apps/hical/hical.cpp @@ -502,18 +502,18 @@ namespace Isis { // Ensure the RadiometricCalibration group is out there const QString rcalGroup("RadiometricCalibration"); if (!ocube->hasGroup(rcalGroup)) { - PvlGroup temp(rcalGroup); + PvlGroup temp(rcalGroup.toStdString()); ocube->putGroup(temp); } PvlGroup &rcal = ocube->group(rcalGroup); - rcal += PvlKeyword("Program", hical_program); - rcal += PvlKeyword("RunTime", hical_runtime); - rcal += PvlKeyword("Version",hical_version); - rcal += PvlKeyword("Revision",hical_revision); + rcal += PvlKeyword("Program", hical_program.toStdString()); + rcal += PvlKeyword("RunTime", hical_runtime.toStdString()); + rcal += PvlKeyword("Version",hical_version.toStdString()); + rcal += PvlKeyword("Revision",hical_revision.toStdString()); - PvlKeyword key("Conf", conf_file); - key.addCommentWrapped("/* " + hical_program + " application equation */"); + PvlKeyword key("Conf", conf_file.toStdString()); + key.addCommentWrapped("/* " + hical_program.toStdString() + " application equation */"); key.addComment("/* hdn = idn - ZeroBufferFit(ZeroBufferSmooth) */"); key.addComment("/* - ZeroReverse - (ZeroDark OR ZeroDarkRate) */"); key.addComment("/* odn = hdn / GainLineDrift * GainNonLinearity */"); diff --git a/isis/src/mro/apps/hicalbeta/main.cpp b/isis/src/mro/apps/hicalbeta/main.cpp index c42f554309..2fcca59de4 100644 --- a/isis/src/mro/apps/hicalbeta/main.cpp +++ b/isis/src/mro/apps/hicalbeta/main.cpp @@ -442,18 +442,18 @@ void IsisMain(){ // Ensure the RadiometricCalibration group is out there const QString rcalGroup("RadiometricCalibration"); if (!ocube->hasGroup(rcalGroup)) { - PvlGroup temp(rcalGroup); + PvlGroup temp(rcalGroup.toStdString()); ocube->putGroup(temp); } PvlGroup &rcal = ocube->group(rcalGroup); - rcal += PvlKeyword("Program", hical_program); - rcal += PvlKeyword("RunTime", hical_runtime); - rcal += PvlKeyword("Version",hical_version); - rcal += PvlKeyword("Revision",hical_revision); + rcal += PvlKeyword("Program", hical_program.toStdString()); + rcal += PvlKeyword("RunTime", hical_runtime.toStdString()); + rcal += PvlKeyword("Version",hical_version.toStdString()); + rcal += PvlKeyword("Revision",hical_revision.toStdString()); - PvlKeyword key("Conf", conf_file); - key.addCommentWrapped("/* " + hical_program + " application equation */"); + PvlKeyword key("Conf", conf_file.toStdString()); + key.addCommentWrapped("/* " + hical_program.toStdString() + " application equation */"); key.addComment("/* hdn = idn - ZeroBufferFit(ZeroBufferSmooth) */"); key.addComment("/* - ZeroReverse - ZeroDark */"); key.addComment("/* odn = hdn / GainLineDrift * GainNonLinearity */"); diff --git a/isis/src/mro/apps/hicalproc/main.cpp b/isis/src/mro/apps/hicalproc/main.cpp index c55e218e47..23cc05c46b 100644 --- a/isis/src/mro/apps/hicalproc/main.cpp +++ b/isis/src/mro/apps/hicalproc/main.cpp @@ -55,13 +55,13 @@ void IsisMain() { if (bIngestion) { int sDotPos = outFile.indexOf('.'); QString sIngestedFile = outFile.mid(0, sDotPos); - cubeLabel = Pvl(sIngestedFile + ".lev2.cub"); + cubeLabel = Pvl(sIngestedFile.toStdString() + ".lev2.cub"); } else { - cubeLabel = Pvl(inFile); + cubeLabel = Pvl(inFile.toStdString()); } // Get the Summing from the label - int iSumming = toInt(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("Summing")[0]); + int iSumming = std::stoi(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("Summing")[0]); Pipeline p1("hicalproc1"); p1.SetInputFile("FROM"); @@ -456,7 +456,7 @@ void GetCCD_Channel_Coefficients(Pvl & pCubeLabel) } else { PvlKeyword binKey = instrGrp.findKeyword("Summing"); - iSumming = toInt(binKey[0]); + iSumming = std::stoi(binKey[0]); if (iSumming != 1 && iSumming != 2 && iSumming != 4) { QString sMsg = "Invalid Summing value in input file, must be 1,2,or 4"; throw IException(IException::User, sMsg, _FILEINFO_); @@ -470,7 +470,7 @@ void GetCCD_Channel_Coefficients(Pvl & pCubeLabel) } else { PvlKeyword ccdKey = instrGrp.findKeyword("CcdId"); - sCcd = ccdKey[0]; + sCcd = QString::fromStdString(ccdKey[0]); } // Channel Keyword @@ -480,7 +480,7 @@ void GetCCD_Channel_Coefficients(Pvl & pCubeLabel) } else { PvlKeyword channelKey = instrGrp.findKeyword("ChannelNumber"); - iChannel = toInt(channelKey[0]); + iChannel = std::stoi(channelKey[0]); } // Get the coefficient file name diff --git a/isis/src/mro/apps/hiccdstitch/main.cpp b/isis/src/mro/apps/hiccdstitch/main.cpp index e94684f116..459e51dc1e 100644 --- a/isis/src/mro/apps/hiccdstitch/main.cpp +++ b/isis/src/mro/apps/hiccdstitch/main.cpp @@ -148,7 +148,7 @@ void IsisMain() { // Open the shift definitions file Pvl shiftdef; - shiftdef.read(ui.GetFileName("SHIFTDEF")); + shiftdef.read(ui.GetFileName("SHIFTDEF").toStdString()); PvlObject &stitch = shiftdef.findObject("Hiccdstitch", Pvl::Traverse); @@ -167,11 +167,11 @@ void IsisMain() { PvlGroup arch = cube->label()->findGroup("Archive", Pvl::Traverse); if(first) { - obsId = (QString) arch["ObservationId"]; + obsId = QString::fromStdString(arch["ObservationId"]); first = false; } else { - if(obsId != (QString) arch["ObservationId"]) { + if(obsId != QString::fromStdString(arch["ObservationId"])) { QString msg = "Input file " + list[i].toString() + " has a different ObservationId"; throw IException(IException::User, msg, _FILEINFO_); @@ -234,8 +234,8 @@ void IsisMain() { toString(CCDinfo.tdi); QString ccdId = ccdNames[ccd]; - if(stitch.hasObject(ccdId)) { - PvlObject &ccddef = stitch.findObject(ccdId, Pvl::Traverse); + if(stitch.hasObject(ccdId.toStdString())) { + PvlObject &ccddef = stitch.findObject(ccdId.toStdString(), Pvl::Traverse); if(ccddef.hasKeyword("MosaicOrder")) { CCDinfo.mosOrder = (int) ccddef["MosaicOrder"]; } @@ -246,8 +246,8 @@ void IsisMain() { CCDinfo.fpline = yoffset[ccd] + (int) ccddef["LineOffset"]; } // See if there is a binning group - if(ccddef.hasGroup(sumTdi)) { - PvlGroup &sumGroup = ccddef.findGroup(sumTdi); + if(ccddef.hasGroup(sumTdi.toStdString())) { + PvlGroup &sumGroup = ccddef.findGroup(sumTdi.toStdString()); if(sumGroup.hasKeyword("SampleOffset")) { CCDinfo.fpsamp = xoffset[ccd] + (int) sumGroup["SampleOffset"]; } @@ -374,17 +374,17 @@ void IsisMain() { // Write ccd order to results for(CCDindex = 0; CCDindex < CCDlist.size(); CCDindex++) { - PvlGroup ccdGroup(CCDlist[CCDindex].ccdName); + PvlGroup ccdGroup(CCDlist[CCDindex].ccdName.toStdString()); - ccdGroup += PvlKeyword("File", CCDlist[CCDindex].filename); - ccdGroup += PvlKeyword("FocalPlaneSample", toString(CCDlist[CCDindex].fpsamp)); - ccdGroup += PvlKeyword("FocalPlaneLine", toString(CCDlist[CCDindex].fpline)); - ccdGroup += PvlKeyword("ImageSample", toString(CCDlist[CCDindex].outss)); - ccdGroup += PvlKeyword("ImageLine", toString(CCDlist[CCDindex].outsl)); + ccdGroup += PvlKeyword("File", CCDlist[CCDindex].filename.toStdString()); + ccdGroup += PvlKeyword("FocalPlaneSample", std::to_string(CCDlist[CCDindex].fpsamp)); + ccdGroup += PvlKeyword("FocalPlaneLine", std::to_string(CCDlist[CCDindex].fpline)); + ccdGroup += PvlKeyword("ImageSample", std::to_string(CCDlist[CCDindex].outss)); + ccdGroup += PvlKeyword("ImageLine", std::to_string(CCDlist[CCDindex].outsl)); int ccd = CCDlist[CCDindex].ccdNumber; - ccdGroup += PvlKeyword("SampleOffset", toString(CCDlist[CCDindex].fpsamp - xoffset[ccd])); - ccdGroup += PvlKeyword("LineOffset", toString(CCDlist[CCDindex].fpline - yoffset[ccd])); + ccdGroup += PvlKeyword("SampleOffset", std::to_string(CCDlist[CCDindex].fpsamp - xoffset[ccd])); + ccdGroup += PvlKeyword("LineOffset", std::to_string(CCDlist[CCDindex].fpline - yoffset[ccd])); results.addGroup(ccdGroup); } @@ -528,7 +528,7 @@ void helperButtonLog() { UserInterface &ui = Application::GetUserInterface(); QString file(ui.GetFileName("SHIFTDEF")); Pvl p; - p.read(file); + p.read(file.toStdString()); Application::GuiLog(p); } //...........end of helper function ........ diff --git a/isis/src/mro/apps/hicolormos/hicolormos.cpp b/isis/src/mro/apps/hicolormos/hicolormos.cpp index 35befc41a5..f69a456fd7 100644 --- a/isis/src/mro/apps/hicolormos/hicolormos.cpp +++ b/isis/src/mro/apps/hicolormos/hicolormos.cpp @@ -52,7 +52,7 @@ void hicolormos(Cube *from1, Cube* from2, UserInterface &ui) { PvlGroup from1Mosaic = from1lab.findGroup("Mosaic", Pvl::Traverse); // Make the procuct ID (from1 archive group) - QString ProdId = from1lab.findGroup("Archive", Pvl::Traverse)["ObservationId"]; + QString ProdId = QString::fromStdString(from1lab.findGroup("Archive", Pvl::Traverse)["ObservationId"]); ProdId += "_COLOR"; // Prep for second image if we have one @@ -64,8 +64,8 @@ void hicolormos(Cube *from1, Cube* from2, UserInterface &ui) { tf.PutLine(from2->fileName() + "\n"); // Test the observation ID between from1 and from2 - if((QString)from1lab.findGroup("Archive", Pvl::Traverse)["ObservationId"] != - (QString)from2lab.findGroup("Archive", Pvl::Traverse)["ObservationId"]) { + if(QString::fromStdString(from1lab.findGroup("Archive", Pvl::Traverse)["ObservationId"]) != + QString::fromStdString(from2lab.findGroup("Archive", Pvl::Traverse)["ObservationId"])) { QString msg = "Images not from the same observation"; throw IException(IException::User, msg, _FILEINFO_); } @@ -212,16 +212,16 @@ void hicolormos(Cube *from1, Cube* from2, UserInterface &ui) { } //work on the times (from mosaic group) - QString startTime = from1Mosaic["StartTime"]; - QString stopTime = from1Mosaic["StopTime"]; - QString startClk = from1Mosaic["SpacecraftClockStartCount"]; - QString stopClk = from1Mosaic["SpacecraftClockStopCount"]; + QString startTime = QString::fromStdString(from1Mosaic["StartTime"]); + QString stopTime = QString::fromStdString(from1Mosaic["StopTime"]); + QString startClk = QString::fromStdString(from1Mosaic["SpacecraftClockStartCount"]); + QString stopClk = QString::fromStdString(from1Mosaic["SpacecraftClockStopCount"]); if(from2) { - if((QString)from2Mosaic["StartTime"] < startTime) startTime = (QString)from2Mosaic["StartTime"]; - if((QString)from2Mosaic["StopTime"] > stopTime) stopTime = (QString)from2Mosaic["StopTime"]; - if((QString)from2Mosaic["SpacecraftClockStartCount"] < startClk) startClk = (QString)from2Mosaic["SpacecraftClockStartCount"]; - if((QString)from2Mosaic["SpacecraftClockStopCount"] < stopClk) stopClk = (QString)from2Mosaic["SpacecraftClockStopCount"]; + if(QString::fromStdString(from2Mosaic["StartTime"]) < startTime) startTime = QString::fromStdString(from2Mosaic["StartTime"]); + if(QString::fromStdString(from2Mosaic["StopTime"]) > stopTime) stopTime = QString::fromStdString(from2Mosaic["StopTime"]); + if(QString::fromStdString(from2Mosaic["SpacecraftClockStartCount"]) < startClk) startClk = QString::fromStdString(from2Mosaic["SpacecraftClockStartCount"]); + if(QString::fromStdString(from2Mosaic["SpacecraftClockStopCount"]) < stopClk) stopClk = QString::fromStdString(from2Mosaic["SpacecraftClockStopCount"]); } // Get TDI and summing array @@ -252,19 +252,19 @@ void hicolormos(Cube *from1, Cube* from2, UserInterface &ui) { ProgramLauncher::RunIsisProgram("automos", parameters); PvlGroup mos("Mosaic"); - mos += PvlKeyword("ProductId ", ProdId); + mos += PvlKeyword("ProductId ", ProdId.toStdString()); mos += sourceProductId; - mos += PvlKeyword("StartTime ", startTime); - mos += PvlKeyword("SpacecraftClockStartCount ", startClk); - mos += PvlKeyword("StopTime ", stopTime); - mos += PvlKeyword("SpacecraftClockStopCount ", stopClk); - mos += PvlKeyword("IncidenceAngle ", toString(Cincid), "DEG"); - mos += PvlKeyword("EmissionAngle ", toString(Cemiss), "DEG"); - mos += PvlKeyword("PhaseAngle ", toString(Cphase), "DEG"); - mos += PvlKeyword("LocalTime ", toString(ClocalSolTime), "LOCALDAY/24"); - mos += PvlKeyword("SolarLongitude ", toString(CsolarLong), "DEG"); - mos += PvlKeyword("SubSolarAzimuth ", toString(CsunAzimuth), "DEG"); - mos += PvlKeyword("NorthAzimuth ", toString(CnorthAzimuth), "DEG"); + mos += PvlKeyword("StartTime ", startTime.toStdString()); + mos += PvlKeyword("SpacecraftClockStartCount ", startClk.toStdString()); + mos += PvlKeyword("StopTime ", stopTime.toStdString()); + mos += PvlKeyword("SpacecraftClockStopCount ", stopClk.toStdString()); + mos += PvlKeyword("IncidenceAngle ", std::to_string(Cincid), "DEG"); + mos += PvlKeyword("EmissionAngle ", std::to_string(Cemiss), "DEG"); + mos += PvlKeyword("PhaseAngle ", std::to_string(Cphase), "DEG"); + mos += PvlKeyword("LocalTime ", std::to_string(ClocalSolTime), "LOCALDAY/24"); + mos += PvlKeyword("SolarLongitude ", std::to_string(CsolarLong), "DEG"); + mos += PvlKeyword("SubSolarAzimuth ", std::to_string(CsunAzimuth), "DEG"); + mos += PvlKeyword("NorthAzimuth ", std::to_string(CnorthAzimuth), "DEG"); mos += cpmmTdiFlag; mos += cpmmSummingFlag; mos += specialProcessingFlag; diff --git a/isis/src/mro/apps/hicrop/hicrop.cpp b/isis/src/mro/apps/hicrop/hicrop.cpp index f6bd38efce..2515a3e4f1 100644 --- a/isis/src/mro/apps/hicrop/hicrop.cpp +++ b/isis/src/mro/apps/hicrop/hicrop.cpp @@ -118,14 +118,14 @@ namespace Isis { // actual start time of the input cube Pvl &inLabels = *g_cube->label(); PvlGroup &inputInst = inLabels.findObject("IsisCube").findGroup("Instrument"); - QString instId = (inputInst["InstrumentId"]); + QString instId = QString::fromStdString(inputInst["InstrumentId"]); if (instId.toUpper() != "HIRISE") { IString msg = "Input cube has invalid InstrumentId = [" + instId + "]. " "A HiRise image is required."; throw IException(IException::Io, msg, _FILEINFO_); } double tdiMode = inputInst["Tdi"]; //Original Instrument - QString labelStartClockCount = inputInst["SpacecraftClockStartCount"]; + QString labelStartClockCount = QString::fromStdString(inputInst["SpacecraftClockStartCount"]); double binMode = inputInst["Summing"]; double deltaLineTimerCount = inputInst["DeltaLineTimerCount"]; @@ -343,10 +343,10 @@ namespace Isis { Pvl &outLabels = *ocube->label(); // Change the start/end times and spacecraft start/stop counts in the labels PvlGroup &outputInst = outLabels.findObject("IsisCube").findGroup("Instrument"); - outputInst["StartTime"][0] = cropStartTime.UTC(); //??? use actual or adjusted like clock counts ??? - outputInst["StopTime"][0] = cropStopTime.UTC(); // adjustedCropStopTime ??? - outputInst["SpacecraftClockStartCount"][0] = adjustedCropStartClockCount; - outputInst["SpacecraftClockStopCount"][0] = adjustedCropStopClockCount; + outputInst["StartTime"][0] = cropStartTime.UTC().toStdString(); //??? use actual or adjusted like clock counts ??? + outputInst["StopTime"][0] = cropStopTime.UTC().toStdString(); // adjustedCropStopTime ??? + outputInst["SpacecraftClockStartCount"][0] = adjustedCropStartClockCount.toStdString(); + outputInst["SpacecraftClockStopCount"][0] = adjustedCropStopClockCount.toStdString(); // Create a buffer for reading the input cube // Crop the input cube @@ -355,15 +355,15 @@ namespace Isis { // Construct a label with the results PvlGroup results("Results"); - results += PvlKeyword("InputLines", toString(inputLineCount)); - results += PvlKeyword("NumberOfLinesCropped", toString(inputLineCount-g_cropLineCount)); - results += PvlKeyword("OututStartingLine", toString(g_cropStartLine)); - results += PvlKeyword("OututEndingLine", toString(g_cropEndLine)); - results += PvlKeyword("OututLineCount", toString(g_cropLineCount)); - results += PvlKeyword("OututStartTime", cropStartTime.UTC()); - results += PvlKeyword("OututStopTime", cropStopTime.UTC()); //??? adjustedCropStopTime - results += PvlKeyword("OututStartClock", adjustedCropStartClockCount); - results += PvlKeyword("OututStopClock", adjustedCropStopClockCount); + results += PvlKeyword("InputLines", std::to_string(inputLineCount)); + results += PvlKeyword("NumberOfLinesCropped", std::to_string(inputLineCount-g_cropLineCount)); + results += PvlKeyword("OututStartingLine", std::to_string(g_cropStartLine)); + results += PvlKeyword("OututEndingLine", std::to_string(g_cropEndLine)); + results += PvlKeyword("OututLineCount", std::to_string(g_cropLineCount)); + results += PvlKeyword("OututStartTime", cropStartTime.UTC().toStdString()); + results += PvlKeyword("OututStopTime", cropStopTime.UTC().toStdString()); //??? adjustedCropStopTime + results += PvlKeyword("OututStartClock", adjustedCropStartClockCount.toStdString()); + results += PvlKeyword("OututStopClock", adjustedCropStopClockCount.toStdString()); // Cleanup p.EndProcess(); diff --git a/isis/src/mro/apps/hicubeit/hicubeit.cpp b/isis/src/mro/apps/hicubeit/hicubeit.cpp index 1f49444899..c0fafffc37 100644 --- a/isis/src/mro/apps/hicubeit/hicubeit.cpp +++ b/isis/src/mro/apps/hicubeit/hicubeit.cpp @@ -39,9 +39,9 @@ namespace Isis { remove(tempFile.expanded().toLatin1().data()); // Get the instrument group from each file - Pvl redLab(redFile); - Pvl irLab(irFile); - Pvl bgLab(bgFile); + Pvl redLab(redFile.toStdString()); + Pvl irLab(irFile.toStdString()); + Pvl bgLab(bgFile.toStdString()); PvlGroup redInst = redLab.findGroup("Instrument", Pvl::Traverse); PvlGroup irInst = irLab.findGroup("Instrument", Pvl::Traverse); @@ -70,17 +70,17 @@ namespace Isis { // Concatenate all the source products into one keyword PvlKeyword sourceProductId("SourceProductId"); - sourceProductId += (QString)bgInst["StitchedProductIds"][0]; + sourceProductId += bgInst["StitchedProductIds"][0]; if(bgInst["StitchedProductIds"].size() > 1) { - sourceProductId += (QString)bgInst["StitchedProductIds"][1]; + sourceProductId += bgInst["StitchedProductIds"][1]; } - sourceProductId += (QString)redInst["StitchedProductIds"][0]; + sourceProductId += redInst["StitchedProductIds"][0]; if(redInst["StitchedProductIds"].size() > 1) { - sourceProductId += (QString)redInst["StitchedProductIds"][1]; + sourceProductId += redInst["StitchedProductIds"][1]; } - sourceProductId += (QString)irInst["StitchedProductIds"][0]; + sourceProductId += irInst["StitchedProductIds"][0]; if(irInst["StitchedProductIds"].size() > 1) { - sourceProductId += (QString)irInst["StitchedProductIds"][1]; + sourceProductId += irInst["StitchedProductIds"][1]; } // Get min start and max stop time @@ -89,31 +89,31 @@ namespace Isis { PvlKeyword startClk = redInst["SpacecraftClockStartCount"]; PvlKeyword stopClk = redInst["SpacecraftClockStopCount"]; - if((QString) irInst["StartTime"] < (QString)startTime) { + if((std::string) irInst["StartTime"] < (std::string)startTime) { startTime = irInst["StartTime"]; } - if((QString) bgInst["StartTime"] < (QString)startTime) { + if((std::string) bgInst["StartTime"] < (std::string)startTime) { startTime = bgInst["StartTime"]; } - if((QString) irInst["StopTime"] > (QString)stopTime) { + if((std::string) irInst["StopTime"] > (std::string)stopTime) { stopTime = irInst["StopTime"]; } - if((QString) bgInst["StopTime"] > (QString)stopTime) { + if((std::string) bgInst["StopTime"] > (std::string)stopTime) { stopTime = bgInst["StopTime"]; } - if((QString) irInst["SpacecraftClockStartCount"] < (QString)startClk) { + if((std::string) irInst["SpacecraftClockStartCount"] < (std::string)startClk) { startClk = irInst["SpacecraftClockStartCount"]; } - if((QString) bgInst["SpacecraftClockStartCount"] < (QString)startClk) { + if((std::string) bgInst["SpacecraftClockStartCount"] < (std::string)startClk) { startClk = bgInst["SpacecraftClockStartCount"]; } - if((QString) irInst["SpacecraftClockStopCount"] > (QString)stopClk) { + if((std::string) irInst["SpacecraftClockStopCount"] > (std::string)stopClk) { stopClk = irInst["SpacecraftClockStopCount"]; } - if((QString) bgInst["SpacecraftClockStopCount"] > (QString)stopClk) { + if((std::string) bgInst["SpacecraftClockStopCount"] > (std::string)stopClk) { stopClk = bgInst["SpacecraftClockStopCount"]; } @@ -128,42 +128,42 @@ namespace Isis { PvlKeyword cpmmTdiFlag("cpmmTdiFlag"); for(int i = 0; i < 14; i++) { - cpmmTdiFlag += (QString) ""; + cpmmTdiFlag += ""; } - cpmmTdiFlag[(int)redInst["CpmmNumber"]] = (QString) redGrp["MRO:TDI"]; - cpmmTdiFlag[(int)irInst["CpmmNumber"]] = (QString) irGrp["MRO:TDI"]; - cpmmTdiFlag[(int)bgInst["CpmmNumber"]] = (QString) bgGrp["MRO:TDI"]; + cpmmTdiFlag[(int)redInst["CpmmNumber"]] = (std::string) redGrp["MRO:TDI"]; + cpmmTdiFlag[(int)irInst["CpmmNumber"]] = (std::string) irGrp["MRO:TDI"]; + cpmmTdiFlag[(int)bgInst["CpmmNumber"]] = (std::string) bgGrp["MRO:TDI"]; // Concatenate all summing modes into one keyword PvlKeyword cpmmSummingFlag("cpmmSummingFlag"); for(int i = 0; i < 14; i++) { - cpmmSummingFlag += (QString) ""; + cpmmSummingFlag += ""; } - cpmmSummingFlag[(int)redInst["CpmmNumber"]] = (QString) redGrp["MRO:BINNING"]; - cpmmSummingFlag[(int)irInst["CpmmNumber"]] = (QString) irGrp["MRO:BINNING"]; - cpmmSummingFlag[(int)bgInst["CpmmNumber"]] = (QString) bgGrp["MRO:BINNING"]; + cpmmSummingFlag[(int)redInst["CpmmNumber"]] = (std::string) redGrp["MRO:BINNING"]; + cpmmSummingFlag[(int)irInst["CpmmNumber"]] = (std::string) irGrp["MRO:BINNING"]; + cpmmSummingFlag[(int)bgInst["CpmmNumber"]] = (std::string) bgGrp["MRO:BINNING"]; //Concatenate all the Special_Processing_Flag into one keyword PvlKeyword specialProcessingFlag("SpecialProcessingFlag"); for(int i = 0; i < 14; i++) { - specialProcessingFlag += (QString) ""; + specialProcessingFlag += ""; } //keyword Special_Processing_Flag may not be present so need to test // if not present set to NOMINAL if(redInst.hasKeyword("Special_Processing_Flag")) { - specialProcessingFlag[redInst["CpmmNumber"]] = (QString) redInst["Special_Processing_Flag"]; + specialProcessingFlag[redInst["CpmmNumber"]] = (std::string) redInst["Special_Processing_Flag"]; } else { specialProcessingFlag[redInst["CpmmNumber"]] = "NOMINAL"; } if(irInst.hasKeyword("Special_Processing_Flag")) { - specialProcessingFlag[irInst["CpmmNumber"]] = (QString) irInst["Special_Processing_Flag"]; + specialProcessingFlag[irInst["CpmmNumber"]] = (std::string) irInst["Special_Processing_Flag"]; } else { specialProcessingFlag[irInst["CpmmNumber"]] = "NOMINAL"; } if(bgInst.hasKeyword("Special_Processing_Flag")) { - specialProcessingFlag[bgInst["CpmmNumber"]] = (QString) bgInst["Special_Processing_Flag"]; + specialProcessingFlag[bgInst["CpmmNumber"]] = (std::string) bgInst["Special_Processing_Flag"]; } else { specialProcessingFlag[bgInst["CpmmNumber"]] = "NOMINAL"; diff --git a/isis/src/mro/apps/hicubenorm/hicubenorm.cpp b/isis/src/mro/apps/hicubenorm/hicubenorm.cpp index e09a16b8a7..1fe7b1b210 100644 --- a/isis/src/mro/apps/hicubenorm/hicubenorm.cpp +++ b/isis/src/mro/apps/hicubenorm/hicubenorm.cpp @@ -254,28 +254,28 @@ namespace Isis { void pvlOut(const QString &StatFile) { PvlGroup results("Results"); for(unsigned int i = 0; i < band.size(); i++) { - results += PvlKeyword("Band", toString(band[i])); - results += PvlKeyword("RowCol", toString(element[i])); - results += PvlKeyword("ValidPixels", toString(validpixels[i])); + results += PvlKeyword("Band", std::to_string(band[i])); + results += PvlKeyword("RowCol", std::to_string(element[i])); + results += PvlKeyword("ValidPixels", std::to_string(validpixels[i])); if(validpixels[i] > 0) { - results += PvlKeyword("Mean", toString(average[i])); - results += PvlKeyword("Median", toString(median[i])); - results += PvlKeyword("Std", toString(stddev[i])); - results += PvlKeyword("Minimum", toString(minimum[i])); - results += PvlKeyword("Maximum", toString(maximum[i])); + results += PvlKeyword("Mean", std::to_string(average[i])); + results += PvlKeyword("Median", std::to_string(median[i])); + results += PvlKeyword("Std", std::to_string(stddev[i])); + results += PvlKeyword("Minimum", std::to_string(minimum[i])); + results += PvlKeyword("Maximum", std::to_string(maximum[i])); } else { - results += PvlKeyword("Mean", toString(0.0)); - results += PvlKeyword("Median", toString(0.0)); - results += PvlKeyword("Std", toString(0.0)); - results += PvlKeyword("Minimum", toString(0.0)); - results += PvlKeyword("Maximum", toString(0.0)); + results += PvlKeyword("Mean", std::to_string(0.0)); + results += PvlKeyword("Median", std::to_string(0.0)); + results += PvlKeyword("Std", std::to_string(0.0)); + results += PvlKeyword("Minimum", std::to_string(0.0)); + results += PvlKeyword("Maximum", std::to_string(0.0)); } } Pvl t; t.addGroup(results); - t.write(StatFile); + t.write(StatFile.toStdString()); } //******************************************************** @@ -333,26 +333,26 @@ namespace Isis { //******************************************************* void PVLIn(const Isis::FileName &filename) { Pvl pvlFileIn; - pvlFileIn.read(filename.expanded()); + pvlFileIn.read(filename.expanded().toStdString()); PvlGroup results = pvlFileIn.findGroup("Results"); PvlObject::PvlKeywordIterator itr = results.begin(); while(itr != results.end()) { - band.push_back(toInt((*itr)[0])); + band.push_back(std::stoi((*itr)[0])); itr++; - element.push_back(toInt((*itr)[0])); + element.push_back(std::stoi((*itr)[0])); itr++; - validpixels.push_back(toInt((*itr)[0])); + validpixels.push_back(std::stoi((*itr)[0])); itr++; - average.push_back(toDouble((*itr)[0])); + average.push_back(std::stod((*itr)[0])); itr++; - median.push_back(toDouble((*itr)[0])); + median.push_back(std::stod((*itr)[0])); itr++; - stddev.push_back(toDouble((*itr)[0])); + stddev.push_back(std::stod((*itr)[0])); itr++; - minimum.push_back(toDouble((*itr)[0])); + minimum.push_back(std::stod((*itr)[0])); itr++; - maximum.push_back(toDouble((*itr)[0])); + maximum.push_back(std::stod((*itr)[0])); itr++; } } diff --git a/isis/src/mro/apps/hideal2pds/main.cpp b/isis/src/mro/apps/hideal2pds/main.cpp index 354e49dd19..13e106d884 100644 --- a/isis/src/mro/apps/hideal2pds/main.cpp +++ b/isis/src/mro/apps/hideal2pds/main.cpp @@ -55,23 +55,23 @@ void IsisMain() { PvlObject *isisCubeLab = inputCube->label(); // Error check to make sure this is a valid cube for this program - QString origInstrument = isisCubeLab->findObject("IsisCube") - .findGroup("OriginalInstrument")["InstrumentId"][0]; + QString origInstrument = QString::fromStdString(isisCubeLab->findObject("IsisCube") + .findGroup("OriginalInstrument")["InstrumentId"][0]); if (origInstrument != "HIRISE") { QString msg = "Input cube must from a HiRISE image. The original " "InstrumentId = [" + origInstrument + "] is unsupported by hideal2pds."; throw IException(IException::Io, msg, _FILEINFO_); } - QString instrumentId = isisCubeLab->findObject("IsisCube") - .findGroup("Instrument")["InstrumentId"][0]; + QString instrumentId = QString::fromStdString(isisCubeLab->findObject("IsisCube") + .findGroup("Instrument")["InstrumentId"][0]); if (instrumentId != "IdealCamera") { QString msg = "Input cube must be IdealCamera. InstrumentId = [" + instrumentId + "] is unsupported by hideal2pds."; throw IException(IException::Io, msg, _FILEINFO_); } - QString target = isisCubeLab->findObject("IsisCube") - .findGroup("Instrument")["TargetName"][0]; + QString target = QString::fromStdString(isisCubeLab->findObject("IsisCube") + .findGroup("Instrument")["TargetName"][0]); if (target.toUpper() != "MARS") { QString msg = "Input cube must from a HiRise image. The target = [" + target + "] is unsupported by hideal2pds."; @@ -194,7 +194,7 @@ void IsisMain() { // change SAMPLE_BIT_MASK value according to BITS input PvlObject &image = pdsLabel.findObject("IMAGE"); - image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", toString((int)pow(2.0, (double)nbits) - 1)), + image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", std::to_string((int)pow(2.0, (double)nbits) - 1)), Pvl::Replace); Camera *cam = inputCube->camera(); @@ -273,7 +273,7 @@ void IsisMain() { } else { tableKeyword = PvlKeyword("SOLAR_LONGITUDE", - toString(cam->solarLongitude().force360Domain() + std::to_string(cam->solarLongitude().force360Domain() .positiveEast(Angle::Degrees)), "DEGREES"); } @@ -419,17 +419,17 @@ void updatePdsLabelImageObject(PvlObject *isisCubeLab, Pvl &pdsLabel) { firstSample = alphaStartingSample; firstLine = alphaStartingLine; } - image += PvlKeyword("SOURCE_LINE_SAMPLES", toString(sourceSamples)); - image += PvlKeyword("SOURCE_LINES", toString(sourceLines)); - image += PvlKeyword("FIRST_LINE_SAMPLE", toString(firstSample)); - image += PvlKeyword("FIRST_LINE", toString(firstLine)); + image += PvlKeyword("SOURCE_LINE_SAMPLES", std::to_string(sourceSamples)); + image += PvlKeyword("SOURCE_LINES", std::to_string(sourceLines)); + image += PvlKeyword("FIRST_LINE_SAMPLE", std::to_string(firstSample)); + image += PvlKeyword("FIRST_LINE", std::to_string(firstLine)); // Add center wavelength and bandwidth with correct units to the IMAGE object PvlKeyword &oldCenter = image["CENTER_FILTER_WAVELENGTH"]; PvlKeyword newCenter("CENTER_FILTER_WAVELENGTH"); for(int val = 0; val < oldCenter.size(); ++val) { - if(((QString)(oldCenter.unit(val))).toUpper() == "NANOMETERS") { + if((QString::fromStdString((oldCenter.unit(val)))).toUpper() == "NANOMETERS") { newCenter.addValue(oldCenter[val], "NM"); } else { @@ -441,7 +441,7 @@ void updatePdsLabelImageObject(PvlObject *isisCubeLab, Pvl &pdsLabel) { PvlKeyword &oldBandWidth = image["BAND_WIDTH"]; PvlKeyword newBandWidth("BAND_WIDTH"); for(int val = 0; val < oldBandWidth.size(); ++val) { - if(((QString)(oldBandWidth.unit(val))).toUpper() == "NANOMETERS") { + if((QString::fromStdString(oldBandWidth.unit(val))).toUpper() == "NANOMETERS") { newBandWidth.addValue(oldBandWidth[val], "NM"); } else { @@ -490,49 +490,49 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, // Add user-entered keywords to ROOT object in the label of the PDS product if(ui.WasEntered("RATIONALE_DESC")) { - PvlKeyword rationale("RATIONALE_DESC", ui.GetAsString("RATIONALE_DESC")); + PvlKeyword rationale("RATIONALE_DESC", ui.GetAsString("RATIONALE_DESC").toStdString()); pdsLabel.addKeyword(rationale, PvlContainer::Replace); } else if ( !pdsLabel.hasKeyword("RATIONALE_DESC") - || QString(pdsLabel["RATIONALE_DESC"]) == "NULL" ){ + || QString::fromStdString(pdsLabel["RATIONALE_DESC"]) == "NULL" ){ QString msg = "Unable to export HiRise product to PDS without " "RationaleDescription value. The input cube value for this " "keyword is Null, the user is required to enter a value."; throw IException(IException::Unknown, msg, _FILEINFO_); } - pdsLabel += PvlKeyword("PRODUCT_VERSION_ID", ui.GetString("VERSION")); + pdsLabel += PvlKeyword("PRODUCT_VERSION_ID", ui.GetString("VERSION").toStdString()); // Add the N/A constant keyword to the ROOT object - pdsLabel += PvlKeyword("NOT_APPLICABLE_CONSTANT", toString(-9998)); + pdsLabel += PvlKeyword("NOT_APPLICABLE_CONSTANT", std::to_string(-9998)); // Compute and add SOFTWARE_NAME to the ROOT object QString sfname; sfname.clear(); sfname += "Isis " + Application::Version() + " " + Application::GetUserInterface().ProgramName(); - pdsLabel += PvlKeyword("SOFTWARE_NAME", sfname); - QString matchedCube = isisCubeLab->findObject("IsisCube").findGroup("Instrument") - .findKeyword("MatchedCube")[0]; + pdsLabel += PvlKeyword("SOFTWARE_NAME", sfname.toStdString()); + QString matchedCube = QString::fromStdString(isisCubeLab->findObject("IsisCube").findGroup("Instrument") + .findKeyword("MatchedCube")[0]); FileName matchedCubeFileNoPath(matchedCube); - pdsLabel += PvlKeyword("MATCHED_CUBE", matchedCubeFileNoPath.name()); + pdsLabel += PvlKeyword("MATCHED_CUBE", matchedCubeFileNoPath.name().toStdString()); // Add jitter correction flag value to the ROOT object bool jitter = false; if (isisCubeLab->findObject("IsisCube").findGroup("Instrument") .hasKeyword("ImageJitterCorrected")) { - jitter = toInt(isisCubeLab->findObject("IsisCube") + jitter = std::stoi(isisCubeLab->findObject("IsisCube") .findGroup("Instrument")["ImageJitterCorrected"][0]); - pdsLabel += PvlKeyword("IMAGE_JITTER_CORRECTED", toString((int)jitter)); + pdsLabel += PvlKeyword("IMAGE_JITTER_CORRECTED", std::to_string((int)jitter)); } else { pdsLabel += PvlKeyword("IMAGE_JITTER_CORRECTED", "UNK"); } // Add Isis Kernels group keywords to the ROOT object - QString shapeModel = isisCubeLab->findObject("IsisCube").findGroup("Kernels") - .findKeyword("ShapeModel")[0]; + QString shapeModel = QString::fromStdString(isisCubeLab->findObject("IsisCube").findGroup("Kernels") + .findKeyword("ShapeModel")[0]); FileName shapeModelFileNoPath(shapeModel); - pdsLabel += PvlKeyword("SHAPE_MODEL", shapeModelFileNoPath.name()); + pdsLabel += PvlKeyword("SHAPE_MODEL", shapeModelFileNoPath.name().toStdString()); // PRODUCT_ID and SOURCE_PRODUCT_ID should be keywords added when creating the // mosaic input cube. @@ -541,8 +541,8 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, QString radiiName = "BODY" + QString::number(cam->naifBodyCode()) + "_RADII"; PvlObject naifKeywordGroup = cam->getStoredNaifKeywords(); - if (naifKeywordGroup.hasKeyword(radiiName)) { - PvlKeyword naifBodyRadii = naifKeywordGroup.findKeyword(radiiName); + if (naifKeywordGroup.hasKeyword(radiiName.toStdString())) { + PvlKeyword naifBodyRadii = naifKeywordGroup.findKeyword(radiiName.toStdString()); pdsLabel += PvlKeyword("A_AXIS_RADIUS", naifBodyRadii[0], "KILOMETERS"); pdsLabel += PvlKeyword("B_AXIS_RADIUS", naifBodyRadii[1], "KILOMETERS"); pdsLabel += PvlKeyword("C_AXIS_RADIUS", naifBodyRadii[2], "KILOMETERS"); @@ -550,30 +550,30 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, else { Distance naifBodyRadii[3]; cam->radii(naifBodyRadii); - pdsLabel += PvlKeyword("A_AXIS_RADIUS", toString(naifBodyRadii[0].kilometers()), "KILOMETERS"); - pdsLabel += PvlKeyword("B_AXIS_RADIUS", toString(naifBodyRadii[1].kilometers()), "KILOMETERS"); - pdsLabel += PvlKeyword("C_AXIS_RADIUS", toString(naifBodyRadii[2].kilometers()), "KILOMETERS"); + pdsLabel += PvlKeyword("A_AXIS_RADIUS", std::to_string(naifBodyRadii[0].kilometers()), "KILOMETERS"); + pdsLabel += PvlKeyword("B_AXIS_RADIUS", std::to_string(naifBodyRadii[1].kilometers()), "KILOMETERS"); + pdsLabel += PvlKeyword("C_AXIS_RADIUS", std::to_string(naifBodyRadii[2].kilometers()), "KILOMETERS"); } if (naifKeywordGroup.hasKeyword("BODY_FRAME_CODE")) { pdsLabel += naifKeywordGroup.findKeyword("BODY_FRAME_CODE"); } else { - pdsLabel += PvlKeyword("BODY_FRAME_CODE", toString(cam->naifBodyFrameCode())); + pdsLabel += PvlKeyword("BODY_FRAME_CODE", std::to_string(cam->naifBodyFrameCode())); } if (naifKeywordGroup.hasKeyword("IDEAL_FOCAL_LENGTH")) { pdsLabel += naifKeywordGroup.findKeyword("IDEAL_FOCAL_LENGTH"); } else { - pdsLabel += PvlKeyword("IDEAL_FOCAL_LENGTH", toString(cam->FocalLength())); + pdsLabel += PvlKeyword("IDEAL_FOCAL_LENGTH", std::to_string(cam->FocalLength())); } if (naifKeywordGroup.hasKeyword("IDEAL_PIXEL_PITCH")) { pdsLabel += naifKeywordGroup.findKeyword("IDEAL_PIXEL_PITCH"); } else { - pdsLabel += PvlKeyword("IDEAL_PIXEL_PITCH", toString(cam->PixelPitch())); + pdsLabel += PvlKeyword("IDEAL_PIXEL_PITCH", std::to_string(cam->PixelPitch())); } if (naifKeywordGroup.hasKeyword("IDEAL_TRANSX")) { @@ -583,7 +583,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, const double *transXValues = cam->FocalPlaneMap()->TransX(); PvlKeyword transX("IDEAL_TRANSX"); for (int i = 0; i < 3; i++) { - transX += toString(transXValues[i]); + transX += std::to_string(transXValues[i]); } pdsLabel += transX; } @@ -595,7 +595,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, const double *transYValues = cam->FocalPlaneMap()->TransY(); PvlKeyword transY("IDEAL_TRANSY"); for (int i = 0; i < 3; i++) { - transY += toString(transYValues[i]); + transY += std::to_string(transYValues[i]); } pdsLabel += transY; } @@ -607,7 +607,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, const double *transSValues = cam->FocalPlaneMap()->TransS(); PvlKeyword transS("IDEAL_TRANSS"); for (int i = 0; i < 3; i++) { - transS += toString(transSValues[i]); + transS += std::to_string(transSValues[i]); } pdsLabel += transS; } @@ -619,7 +619,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, const double *transLValues = cam->FocalPlaneMap()->TransL(); PvlKeyword transL("IDEAL_TRANSL"); for (int i = 0; i < 3; i++) { - transL += toString(transLValues[i]); + transL += std::to_string(transLValues[i]); } pdsLabel += transL; } @@ -644,5 +644,5 @@ void updatePdsLabelTimeParametersGroup(Pvl &pdsLabel) { QString dateTime = (QString) timestr; iTime tmpDateTime(dateTime); PvlGroup &timeParam = pdsLabel.findGroup("TIME_PARAMETERS"); - timeParam += PvlKeyword("PRODUCT_CREATION_TIME", tmpDateTime.UTC()); + timeParam += PvlKeyword("PRODUCT_CREATION_TIME", tmpDateTime.UTC().toStdString()); } diff --git a/isis/src/mro/apps/hidtmgen/hidtmgen.cpp b/isis/src/mro/apps/hidtmgen/hidtmgen.cpp index 015582cee0..b2843c675e 100644 --- a/isis/src/mro/apps/hidtmgen/hidtmgen.cpp +++ b/isis/src/mro/apps/hidtmgen/hidtmgen.cpp @@ -120,7 +120,7 @@ namespace Isis{ // -------------------------------------------------------------------------// // Get required global ui... // -------------------------------------------------------------------------// - Pvl paramsPvl(ui.GetFileName("PARAMSPVL")); + Pvl paramsPvl(ui.GetFileName("PARAMSPVL").toStdString()); bool defaultNames = ui.GetBoolean("DEFAULTNAMES"); // parameters: @@ -194,7 +194,7 @@ namespace Isis{ // These are our output labels, will be modifying heavily Pvl &pdsLabel = pdsExportProcess.StandardPdsLabel(ProcessExportPds::Image); PvlObject &mappingObject = pdsLabel.findObject("IMAGE_MAP_PROJECTION"); - QString projectionType = mappingObject["MAP_PROJECTION_TYPE"][0]; + QString projectionType = QString::fromStdString(mappingObject["MAP_PROJECTION_TYPE"][0]); setProjectionInformation(inCube, pdsLabel, mappingObject, projectionType); customizeDtmLabels(inCube, pdsLabel, mappingObject); @@ -299,7 +299,7 @@ namespace Isis{ // set map projection information PvlObject &mappingObject = pdsLabel.findObject("IMAGE_MAP_PROJECTION"); - QString projectionType = mappingObject["MAP_PROJECTION_TYPE"][0]; + QString projectionType = QString::fromStdString(mappingObject["MAP_PROJECTION_TYPE"][0]); setProjectionInformation(inCube, pdsLabel, mappingObject, projectionType); QString productId = ""; @@ -332,9 +332,9 @@ namespace Isis{ source += paramsPvl["ORTHO_SOURCE_DTM_ID"]; } else { - source += dtmProductId; + source += dtmProductId.toStdString(); } - source += orthoId; + source += orthoId.toStdString(); setIdentificationInformation(pdsLabel, productId, source, paramsPvl, ui); processCube(orthoExportProcess, outFile); @@ -499,7 +499,7 @@ namespace Isis{ PvlObject viewingParameters("VIEWING_PARAMETERS"); if (northAzimuth != Isis::Null) { - viewingParameters.addKeyword(PvlKeyword("NORTH_AZIMUTH", toString(northAzimuth), "DEG")); + viewingParameters.addKeyword(PvlKeyword("NORTH_AZIMUTH", std::to_string(northAzimuth), "DEG")); } else { viewingParameters.addKeyword(PvlKeyword("NORTH_AZIMUTH", "N/A")); @@ -532,14 +532,14 @@ namespace Isis{ // find the center latitude of this set of images // (not the same as the center lat for the projection) - double clat = ((toDouble(mappingObject["MAXIMUM_LATITUDE"][0]) - - toDouble(mappingObject["MINIMUM_LATITUDE"][0])) / 2) + - toDouble(mappingObject["MINIMUM_LATITUDE"][0]); + double clat = ((std::stod(mappingObject["MAXIMUM_LATITUDE"][0]) - + std::stod(mappingObject["MINIMUM_LATITUDE"][0])) / 2) + + std::stod(mappingObject["MINIMUM_LATITUDE"][0]); // find the center longitude of this set of images // (not the same as the center lon for the projection) - double clon = ((toDouble(mappingObject["EASTERNMOST_LONGITUDE"][0]) - - toDouble(mappingObject["WESTERNMOST_LONGITUDE"][0])) / 2) + - toDouble(mappingObject["WESTERNMOST_LONGITUDE"][0]); + double clon = ((std::stod(mappingObject["EASTERNMOST_LONGITUDE"][0]) - + std::stod(mappingObject["WESTERNMOST_LONGITUDE"][0])) / 2) + + std::stod(mappingObject["WESTERNMOST_LONGITUDE"][0]); if (clat > 0.0 && clon < 270.0) { // Northern Hemisphere, 0 to 270 lon northAzimuth = 270.00 - clon; @@ -597,13 +597,13 @@ namespace Isis{ QString dtmSourceOrbitAndTargetCodes(const PvlKeyword &sourceKeyword) { // we use the source product id for the DTM to get the orbit IDs and target code // for the source products (i.e. the stereo pair) - return sourceKeyword[0].mid(4,11) + "_" + - sourceKeyword[1].mid(4,12) + "_"; + return QString::fromStdString(sourceKeyword[0]).mid(4,11) + "_" + + QString::fromStdString(sourceKeyword[1]).mid(4,12) + "_"; } QString versionNumber(const Pvl ¶msPvl, const UserInterface &ui) { - double version = toDouble(paramsPvl["PRODUCT_VERSION_ID"]); + double version = std::stod(paramsPvl["PRODUCT_VERSION_ID"]); // Format the version for the output name: // Only important thing to note is that a #.0 number is converted to 0# @@ -652,7 +652,7 @@ namespace Isis{ QString producingInstitution(const Pvl ¶msPvl, const UserInterface &ui) { - QString producing = paramsPvl["PRODUCING_INSTITUTION"][0]; + QString producing = QString::fromStdString(paramsPvl["PRODUCING_INSTITUTION"][0]); if (producing.size() > 1) { QString msg = "PRODUCING_INSTITUTION value [" + producing + "] in the PARAMSPVL file must be a " "single character. See hidtmgen documentation for these character codes."; @@ -693,7 +693,7 @@ namespace Isis{ pdsLabel.addKeyword(paramsPvl["PRODUCER_FULL_NAME"]); // given product id - pdsLabel.addKeyword(PvlKeyword("PRODUCT_ID", productId)); + pdsLabel.addKeyword(PvlKeyword("PRODUCT_ID", productId.toStdString())); // This comes from the user (PARAMSPVL) pdsLabel.addKeyword(paramsPvl["PRODUCT_VERSION_ID"]); @@ -761,7 +761,7 @@ namespace Isis{ "units is given by the keyvalues for SCALING_FACTOR and OFFSET. This " "DTM was produced using ISIS and SOCET Set (copyright BAE Systems) " "software as described in Kirk et al. (2008)."; - dtmPdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("NOTE", note)); + dtmPdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("NOTE", note.toStdString())); // Label records should always be 1, my example didn't included it, so we won't. dtmPdsLabel.deleteKeyword("LABEL_RECORDS"); @@ -777,8 +777,8 @@ namespace Isis{ // Create statistics and add to image group Statistics *stat = inCube->statistics(); - image.addKeyword(PvlKeyword("VALID_MINIMUM", toString(stat->Minimum()))); - image.addKeyword(PvlKeyword("VALID_MAXIMUM", toString(stat->Maximum()))); + image.addKeyword(PvlKeyword("VALID_MINIMUM", std::to_string(stat->Minimum()))); + image.addKeyword(PvlKeyword("VALID_MAXIMUM", std::to_string(stat->Maximum()))); // delete unneeded keywords in map object mappingObject.deleteKeyword("FIRST_STANDARD_PARALLEL"); diff --git a/isis/src/mro/apps/hifurrows/main.cpp b/isis/src/mro/apps/hifurrows/main.cpp index 5dd3e3554a..7aff979db5 100644 --- a/isis/src/mro/apps/hifurrows/main.cpp +++ b/isis/src/mro/apps/hifurrows/main.cpp @@ -133,7 +133,7 @@ void IsisMain() { ss >> finish; } label += "Column" + begin + "to" + finish; - stats += PvlKeyword(label.c_str(), toString(furrows[i].mvstats[j].Correlation())); + stats += PvlKeyword(label.c_str(), std::to_string(furrows[i].mvstats[j].Correlation())); } } Application::Log(stats); diff --git a/isis/src/mro/apps/hijitreg/HiJitCube.cpp b/isis/src/mro/apps/hijitreg/HiJitCube.cpp index 731ca10a4e..dc6d4d2770 100644 --- a/isis/src/mro/apps/hijitreg/HiJitCube.cpp +++ b/isis/src/mro/apps/hijitreg/HiJitCube.cpp @@ -92,8 +92,8 @@ namespace Isis { OpenCube(filename); // Determine if a shift of the CCD exists in the definitions file - if(shift.hasGroup(jdata.ccdName)) { - PvlGroup &ccddef = shift.findGroup(jdata.ccdName, Pvl::Traverse); + if(shift.hasGroup(jdata.ccdName.toStdString())) { + PvlGroup &ccddef = shift.findGroup(jdata.ccdName.toStdString(), Pvl::Traverse); if(ccddef.hasKeyword("SampleOffset")) { jdata.sampOffset = (int) ccddef["SampleOffset"]; } @@ -236,7 +236,7 @@ namespace Isis { Isis::PvlGroup idinst; jdata.filename = fileName(); Isis::PvlGroup &archive = labelPvl->findGroup("Archive", Isis::Pvl::Traverse); - jdata.productId = (QString) archive["ProductId"]; + jdata.productId = QString::fromStdString(archive["ProductId"]); jdata.lines = lineCount(); if(labelPvl->findObject("IsisCube").hasGroup("OriginalInstrument")) { @@ -276,8 +276,8 @@ namespace Isis { } jdata.ccdName = Instrument::CCD_NAMES[jdata.cpmmNumber]; jdata.dltCount = inst["DeltaLineTimerCount"]; - jdata.UTCStartTime = (QString) inst["StartTime"]; - jdata.scStartTime = (QString) inst["SpacecraftClockStartCount"]; + jdata.UTCStartTime = QString::fromStdString(inst["StartTime"]); + jdata.scStartTime = QString::fromStdString(inst["SpacecraftClockStartCount"]); try { if(originst) { diff --git a/isis/src/mro/apps/hijitreg/main.cpp b/isis/src/mro/apps/hijitreg/main.cpp index 7fbadb32b1..85d2db9011 100644 --- a/isis/src/mro/apps/hijitreg/main.cpp +++ b/isis/src/mro/apps/hijitreg/main.cpp @@ -81,7 +81,7 @@ void IsisMain() { // Open the shift definitions file Pvl shiftdef; if (ui.WasEntered("SHIFTDEF")) { - shiftdef.read(ui.GetFileName("SHIFTDEF")); + shiftdef.read(ui.GetFileName("SHIFTDEF").toStdString()); } else { shiftdef.addObject(PvlObject("Hiccdstitch")); @@ -144,7 +144,7 @@ void IsisMain() { // of the grid points. Pvl regdef; FileName regFile(ui.GetFileName("REGDEF")); - regdef.read(regFile.expanded()); + regdef.read(regFile.expanded().toStdString()); AutoReg *ar = AutoRegFactory::Create(regdef); @@ -355,9 +355,9 @@ void IsisMain() { if (jparms.sStats.ValidPixels() > 0) { double sTrans = (int)(jparms.sStats.Average() * 100.0) / 100.0; double lTrans = (int)(jparms.lStats.Average() * 100.0) / 100.0; - results += PvlKeyword("Sample", toString(sTrans)); - results += PvlKeyword("Line", toString(lTrans)); - results += PvlKeyword("NSuspects", toString(jparms.nSuspects)); + results += PvlKeyword("Sample", std::to_string(sTrans)); + results += PvlKeyword("Line", std::to_string(lTrans)); + results += PvlKeyword("NSuspects", std::to_string(jparms.nSuspects)); } else { results += PvlKeyword("Sample", "NULL"); diff --git a/isis/src/mro/apps/hijitter/main.cpp b/isis/src/mro/apps/hijitter/main.cpp index 4b2e661f6d..5a1f994ccb 100644 --- a/isis/src/mro/apps/hijitter/main.cpp +++ b/isis/src/mro/apps/hijitter/main.cpp @@ -358,10 +358,10 @@ void init(FileList &inList) { for (int i = 0; i < inList.size(); i++) { try { FileName currentFileName(inList[i]); - Pvl labels(currentFileName.expanded()); + Pvl labels(currentFileName.expanded().toStdString()); PvlGroup &inst = labels.findGroup("Instrument", Pvl::Traverse); - QString ccdKeywordValue = (QString)inst["CcdId"]; + QString ccdKeywordValue = QString::fromStdString(inst["CcdId"]); int ccdNumber = 0; if (ccdKeywordValue.indexOf("RED") == 0) { ccdNumber = (int) toInt((QString)ccdKeywordValue.mid(3)); diff --git a/isis/src/mro/apps/himos/himos.cpp b/isis/src/mro/apps/himos/himos.cpp index 3cb60f55b0..29cb07521e 100644 --- a/isis/src/mro/apps/himos/himos.cpp +++ b/isis/src/mro/apps/himos/himos.cpp @@ -65,8 +65,8 @@ namespace Isis { sourceProductId += g["stitchedProductIds"][j]; } } - ProdId = (QString)pmatch->findGroup("Archive", Pvl::Traverse)["ObservationId"]; - QString bandname = (QString)pmatch->findGroup("BandBin", Pvl::Traverse)["Name"]; + ProdId = QString::fromStdString(pmatch->findGroup("Archive", Pvl::Traverse)["ObservationId"]); + QString bandname = QString::fromStdString(pmatch->findGroup("BandBin", Pvl::Traverse)["Name"]); bandname = bandname.toUpper(); ProdId = ProdId + "_" + bandname; } @@ -186,21 +186,21 @@ namespace Isis { OriginalLabel origLab = clist[i]->readOriginalLabel(); PvlGroup timegrp = origLab.ReturnLabels().findGroup("TIME_PARAMETERS", Pvl::Traverse); if(i == 0) { - startClock = (QString)timegrp["SpacecraftClockStartCount"]; - stopClock = (QString)timegrp["SpacecraftClockStopCount"]; - startTime = (QString)timegrp["StartTime"]; - stopTime = (QString)timegrp["StopTime"]; + startClock = QString::fromStdString(timegrp["SpacecraftClockStartCount"]); + stopClock = QString::fromStdString(timegrp["SpacecraftClockStopCount"]); + startTime = QString::fromStdString(timegrp["StartTime"]); + stopTime = QString::fromStdString(timegrp["StopTime"]); } else { - QString testStartTime = (QString)timegrp["StartTime"]; - QString testStopTime = (QString)timegrp["StopTime"]; + QString testStartTime = QString::fromStdString(timegrp["StartTime"]); + QString testStopTime = QString::fromStdString(timegrp["StopTime"]); if(testStartTime < startTime) { startTime = testStartTime; - startClock = (QString)timegrp["SpacecraftClockStartCount"]; + startClock = QString::fromStdString(timegrp["SpacecraftClockStartCount"]); } if(testStopTime > stopTime) { stopTime = testStopTime; - stopClock = (QString)timegrp["spacecraftClockStopCount"]; + stopClock = QString::fromStdString(timegrp["spacecraftClockStopCount"]); } } } @@ -210,9 +210,9 @@ namespace Isis { PvlKeyword cpmmSummingFlag("cpmmSummingFlag"); PvlKeyword specialProcessingFlag("SpecialProcessingFlag"); for(int i = 0; i < 14; i++) { - cpmmTdiFlag += (QString)""; - cpmmSummingFlag += (QString)""; - specialProcessingFlag += (QString)""; + cpmmTdiFlag += ""; + cpmmSummingFlag += ""; + specialProcessingFlag += ""; } for(int i = 0; i < (int)clist.size(); i++) { @@ -220,11 +220,11 @@ namespace Isis { PvlGroup cInst = clab->findGroup("Instrument", Pvl::Traverse); OriginalLabel cOrgLab = clist[i]->readOriginalLabel(); PvlGroup cGrp = cOrgLab.ReturnLabels().findGroup("INSTRUMENT_SETTING_PARAMETERS", Pvl::Traverse); - cpmmTdiFlag[(int)cInst["CpmmNumber"]] = (QString) cGrp["MRO:TDI"]; - cpmmSummingFlag[(int)cInst["CpmmNumber"]] = (QString) cGrp["MRO:BINNING"]; + cpmmTdiFlag[(int)cInst["CpmmNumber"]] = (std::string)cGrp["MRO:TDI"]; + cpmmSummingFlag[(int)cInst["CpmmNumber"]] = (std::string)cGrp["MRO:BINNING"]; if(cInst.hasKeyword("Special_Processing_Flag")) { - specialProcessingFlag[cInst["CpmmNumber"]] = (QString) cInst["Special_Processing_Flag"]; + specialProcessingFlag[cInst["CpmmNumber"]] = (std::string)cInst["Special_Processing_Flag"]; } else { // there may not be the keyword Special_Processing_Flag if no @@ -253,19 +253,19 @@ namespace Isis { // write out new information to new group mosaic PvlGroup mos("Mosaic"); - mos += PvlKeyword("ProductId ", ProdId); + mos += PvlKeyword("ProductId ", ProdId.toStdString()); mos += PvlKeyword(sourceProductId); - mos += PvlKeyword("StartTime ", startTime); - mos += PvlKeyword("SpacecraftClockStartCount ", startClock); - mos += PvlKeyword("StopTime ", stopTime); - mos += PvlKeyword("SpacecraftClockStopCount ", stopClock); - mos += PvlKeyword("IncidenceAngle ", toString(Cincid), "DEG"); - mos += PvlKeyword("EmissionAngle ", toString(Cemiss), "DEG"); - mos += PvlKeyword("PhaseAngle ", toString(Cphase), "DEG"); - mos += PvlKeyword("LocalTime ", toString(ClocalSolTime), "LOCALDAY/24"); - mos += PvlKeyword("SolarLongitude ", toString(CsolarLong), "DEG"); - mos += PvlKeyword("SubSolarAzimuth ", toString(CsunAzimuth), "DEG"); - mos += PvlKeyword("NorthAzimuth ", toString(CnorthAzimuth), "DEG"); + mos += PvlKeyword("StartTime ", startTime.toStdString()); + mos += PvlKeyword("SpacecraftClockStartCount ", startClock.toStdString()); + mos += PvlKeyword("StopTime ", stopTime.toStdString()); + mos += PvlKeyword("SpacecraftClockStopCount ", stopClock.toStdString()); + mos += PvlKeyword("IncidenceAngle ", std::to_string(Cincid), "DEG"); + mos += PvlKeyword("EmissionAngle ", std::to_string(Cemiss), "DEG"); + mos += PvlKeyword("PhaseAngle ", std::to_string(Cphase), "DEG"); + mos += PvlKeyword("LocalTime ", std::to_string(ClocalSolTime), "LOCALDAY/24"); + mos += PvlKeyword("SolarLongitude ", std::to_string(CsolarLong), "DEG"); + mos += PvlKeyword("SubSolarAzimuth ", std::to_string(CsunAzimuth), "DEG"); + mos += PvlKeyword("NorthAzimuth ", std::to_string(CnorthAzimuth), "DEG"); mos += cpmmTdiFlag; mos += cpmmSummingFlag; mos += specialProcessingFlag; @@ -295,8 +295,8 @@ namespace Isis { // test of the ObservationId PvlGroup matchgrp = pmatch.findGroup("Archive", Pvl::Traverse); PvlGroup compgrp = pcomp.findGroup("Archive", Pvl::Traverse); - QString obsMatch = matchgrp["ObservationId"]; - QString obsComp = compgrp["ObservationId"]; + QString obsMatch = QString::fromStdString(matchgrp["ObservationId"]); + QString obsComp = QString::fromStdString(compgrp["ObservationId"]); if(obsMatch != obsComp) { QString msg = "Images not from the same observation"; @@ -306,8 +306,8 @@ namespace Isis { // Test of the BandBin filter name PvlGroup bmatchgrp = pmatch.findGroup("BandBin", Pvl::Traverse); PvlGroup bcompgrp = pcomp.findGroup("BandBin", Pvl::Traverse); - QString bandMatch = bmatchgrp["Name"]; - QString bandComp = bcompgrp["Name"]; + QString bandMatch = QString::fromStdString(bmatchgrp["Name"]); + QString bandComp = QString::fromStdString(bcompgrp["Name"]); if(bandMatch != bandComp) { QString msg = "Images not the same filter"; diff --git a/isis/src/mro/apps/hinoise/main.cpp b/isis/src/mro/apps/hinoise/main.cpp index 97f7ac8078..87507f7462 100644 --- a/isis/src/mro/apps/hinoise/main.cpp +++ b/isis/src/mro/apps/hinoise/main.cpp @@ -86,10 +86,10 @@ void IsisMain() { gdHardHighEndPercent = ui.GetDouble("HARD_HIGHEND_PERCENT"); // Get Summing, CcdId and Channel Number from the cube label - Pvl cubeLabel = Pvl(sInputFile); - int iSumming = toInt (cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("Summing")[0]); - int iChannel = toInt (cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("ChannelNumber")[0]); - QString sCcdId = cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("CcdId"); + Pvl cubeLabel = Pvl(sInputFile.toStdString()); + int iSumming = std::stoi(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("Summing")[0]); + int iChannel = std::stoi(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("ChannelNumber")[0]); + QString sCcdId = QString::fromStdString(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("CcdId")); // Get the image histogram Pipeline p1("hinoise1"); diff --git a/isis/src/mro/apps/hirdr2isis/main.cpp b/isis/src/mro/apps/hirdr2isis/main.cpp index 5165790e05..1c929b45e9 100644 --- a/isis/src/mro/apps/hirdr2isis/main.cpp +++ b/isis/src/mro/apps/hirdr2isis/main.cpp @@ -75,10 +75,10 @@ void IsisMain() { // Modify the output Mosaic group if the Projection is of type // Equirectangular. PvlGroup mapgrp = otherLabels.findGroup("Mapping"); - if (mapgrp["ProjectionName"][0].toUpper() == "EQUIRECTANGULAR") { + if (QString::fromStdString(mapgrp["ProjectionName"][0]).toUpper() == "EQUIRECTANGULAR") { // Get the target and check for validity - QString target = label.findKeyword("TargetName", PvlObject::Traverse)[0]; + QString target = QString::fromStdString(label.findKeyword("TargetName", PvlObject::Traverse)[0]); PvlGroup radii = Target::radiiGroup(target); // Set existing radius to CenterLatitudeRadius diff --git a/isis/src/mro/apps/hirdrgen/main.cpp b/isis/src/mro/apps/hirdrgen/main.cpp index ceefe75141..3777ea8c42 100644 --- a/isis/src/mro/apps/hirdrgen/main.cpp +++ b/isis/src/mro/apps/hirdrgen/main.cpp @@ -195,7 +195,7 @@ void IsisMain() { if (ui.WasEntered("RATIONALE_DESC")) { pdsLabel.addKeyword( - PvlKeyword("RATIONALE_DESC", ui.GetString("RATIONALE_DESC")), + PvlKeyword("RATIONALE_DESC", ui.GetString("RATIONALE_DESC").toStdString()), Pvl::Replace); } @@ -207,20 +207,20 @@ void IsisMain() { QString dateTime = (QString) timestr; iTime tmpDateTime(dateTime); PvlGroup &timeParam = pdsLabel.findGroup("TIME_PARAMETERS"); - timeParam += PvlKeyword("PRODUCT_CREATION_TIME", tmpDateTime.UTC()); + timeParam += PvlKeyword("PRODUCT_CREATION_TIME", tmpDateTime.UTC().toStdString()); // Add the N/A constant keyword to the ROOT - pdsLabel += PvlKeyword("NOT_APPLICABLE_CONSTANT", toString(-9998)); + pdsLabel += PvlKeyword("NOT_APPLICABLE_CONSTANT", std::to_string(-9998)); // Add SOFTWARE_NAME to the ROOT QString sfname; sfname.clear(); sfname += "Isis " + Application::Version() + " " + Application::GetUserInterface().ProgramName(); - pdsLabel += PvlKeyword("SOFTWARE_NAME", sfname); + pdsLabel += PvlKeyword("SOFTWARE_NAME", sfname.toStdString()); // Add the PRODUCT_VERSION_ID from the user parameter VERSION - pdsLabel += PvlKeyword("PRODUCT_VERSION_ID", ui.GetString("VERSION")); + pdsLabel += PvlKeyword("PRODUCT_VERSION_ID", ui.GetString("VERSION").toStdString()); // Add MRO:CCD_FLAG, MRO:BINNING, MRO:TDI // As pulled from the input Isis cube, the values are in CPMM order, so @@ -246,7 +246,7 @@ void IsisMain() { ccdTdi.addValue(cpmmTdi[cpmmByCcd[ccd]] != "Null" ? cpmmTdi[cpmmByCcd[ccd]] : "-9998"); IString tmp = cpmmSpecial[cpmmByCcd[ccd]]; tmp.Trim("\""); - ccdSpecial.addValue(tmp.ToQt()); + ccdSpecial.addValue(tmp.ToQt().toStdString()); } if (!pdsLabel.hasGroup("INSTRUMENT_SETTING_PARAMETERS")) { @@ -311,7 +311,7 @@ void IsisMain() { mapObject["C_AXIS_RADIUS"].setValue(std::to_string(radius), "KM"); } - projName = mapObject["MAP_PROJECTION_TYPE"][0]; + projName = QString::fromStdString(mapObject["MAP_PROJECTION_TYPE"][0]); } // Calculate the min/max per band keywords @@ -319,11 +319,11 @@ void IsisMain() { // The input to output mapping is opposite from the one above double slope = (p.GetOutputMaximum() - p.GetOutputMinimum()) / (maxmax - minmin); double intercept = p.GetOutputMaximum() - slope * maxmax; - PvlKeyword minimum("MRO:MINIMUM_STRETCH", toString(slope * g_min[0] + intercept)); - PvlKeyword maximum("MRO:MAXIMUM_STRETCH", toString(slope * g_max[0] + intercept)); + PvlKeyword minimum("MRO:MINIMUM_STRETCH", std::to_string(slope * g_min[0] + intercept)); + PvlKeyword maximum("MRO:MAXIMUM_STRETCH", std::to_string(slope * g_max[0] + intercept)); for (int band = 1; band < icube2->bandCount(); ++band) { - minimum += toString(slope * g_min[band] + intercept); - maximum += toString(slope * g_max[band] + intercept); + minimum += std::to_string(slope * g_min[band] + intercept); + maximum += std::to_string(slope * g_max[band] + intercept); } if (enctype.Equal("jp2")) { @@ -334,18 +334,18 @@ void IsisMain() { imagejp2 += PvlKeyword("DESCRIPTION", "HiRISE projected and mosaicked product"); // Add the SCALLING_FACTOR and OFFSET keywords - imagejp2.addKeyword(PvlKeyword("SCALING_FACTOR", toString(slope)), Pvl::Replace); - imagejp2.addKeyword(PvlKeyword("OFFSET", toString(intercept)), Pvl::Replace); + imagejp2.addKeyword(PvlKeyword("SCALING_FACTOR", std::to_string(slope)), Pvl::Replace); + imagejp2.addKeyword(PvlKeyword("OFFSET", std::to_string(intercept)), Pvl::Replace); // Reformat some keyword units in the image object // This is lame, but PDS units are difficult to work with, so for now??? PvlKeyword &oldFilterNamejp2 = imagejp2["FILTER_NAME"]; PvlKeyword newFilterName("FILTER_NAME"); for (int val = 0; val < oldFilterNamejp2.size(); ++val) { - QString filtname(oldFilterNamejp2[val].toUpper()); + QString filtname(QString::fromStdString(oldFilterNamejp2[val]).toUpper()); if (filtname == "BLUEGREEN") filtname = "BLUE-GREEN"; else if (filtname == "NEARINFRARED") filtname = "NEAR-INFRARED"; - newFilterName.addValue(filtname); + newFilterName.addValue(filtname.toStdString()); } imagejp2.addKeyword(newFilterName, Pvl::Replace); @@ -381,7 +381,7 @@ void IsisMain() { // ProcessExportPds if (nbits != 8 && nbits != 16) { imagejp2.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", - toString((int)pow(2.0, (double)ui.GetInteger("BITS")) - 1)), + std::to_string((int)pow(2.0, (double)ui.GetInteger("BITS")) - 1)), Pvl::Replace); } } @@ -402,18 +402,18 @@ void IsisMain() { // ??? unneccessary calculation - this is done by ProcessExportPds class. double slope = (maxmax - minmin) / (p.GetOutputMaximum() - p.GetOutputMinimum()); double intercept = maxmax - slope * p.GetOutputMaximum(); - image.addKeyword(PvlKeyword("SCALING_FACTOR", toString(slope)), Pvl::Replace); - image.addKeyword(PvlKeyword("OFFSET", toString(intercept)), Pvl::Replace); + image.addKeyword(PvlKeyword("SCALING_FACTOR", std::to_string(slope)), Pvl::Replace); + image.addKeyword(PvlKeyword("OFFSET", std::to_string(intercept)), Pvl::Replace); // Reformat some keyword units in the image object // This is lame, but PDS units are difficult to work with, so for now PvlKeyword &oldFilterName = image["FILTER_NAME"]; PvlKeyword newFilterName("FILTER_NAME"); for (int val = 0; val < oldFilterName.size(); ++val) { - QString filtname(oldFilterName[val].toUpper()); + QString filtname(QString::fromStdString(oldFilterName[val]).toUpper()); if (filtname == "BLUEGREEN") filtname = "BLUE-GREEN"; else if (filtname == "NEARINFRARED") filtname = "NEAR-INFRARED"; - newFilterName.addValue(filtname); + newFilterName.addValue(filtname.toStdString()); } image.addKeyword(newFilterName, Pvl::Replace); @@ -449,7 +449,7 @@ void IsisMain() { // ProcessExportPds if (nbits != 8 && nbits != 16) { image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", - toString((int)pow(2.0, (double)ui.GetInteger("BITS")) - 1)), + std::to_string((int)pow(2.0, (double)ui.GetInteger("BITS")) - 1)), Pvl::Replace); } } diff --git a/isis/src/mro/apps/hisharpen/main.cpp b/isis/src/mro/apps/hisharpen/main.cpp index 5ecf8f27a4..d95b9713b7 100644 --- a/isis/src/mro/apps/hisharpen/main.cpp +++ b/isis/src/mro/apps/hisharpen/main.cpp @@ -143,7 +143,7 @@ void CreatePsf(Pipeline &p) { // Verify the image looks like a hirise image try { const PvlGroup &instGrp = fromCube.label()->findGroup("Instrument", Pvl::Traverse); - QString instrument = (QString)instGrp["InstrumentId"]; + QString instrument = QString::fromStdString(instGrp["InstrumentId"]); if(instrument != "HIRISE") { QString message = "This program is meant to be run on HiRISE images only, found " @@ -166,7 +166,7 @@ void CreatePsf(Pipeline &p) { // Let's figure out which point spread function we're supposed to be using QString psfFile = "$mro/calibration/psf/PSF_"; - QString filter = (QString)fromCube.label()->findGroup("Instrument", Pvl::Traverse)["CcdId"]; + QString filter = QString::fromStdString(fromCube.label()->findGroup("Instrument", Pvl::Traverse)["CcdId"]); if(filter.contains("RED")) { psfFile += "RED"; diff --git a/isis/src/mro/apps/histat/main.cpp b/isis/src/mro/apps/histat/main.cpp index bad9f041d5..b21a69c211 100644 --- a/isis/src/mro/apps/histat/main.cpp +++ b/isis/src/mro/apps/histat/main.cpp @@ -299,7 +299,7 @@ void IsisMain() { for(int i = 0 ; i < NUM_GROUPS ; i++) { temp.addGroup(groups[i]); } - temp.write(ui.GetFileName("TO")); + temp.write(ui.GetFileName("TO").toStdString()); } else { // Log the results @@ -312,21 +312,21 @@ void IsisMain() { // Return a PVL group containing the statistical information PvlGroup PvlStats(Statistics &stats, const QString &name) { // Construct a label with the results - PvlGroup results(name); + PvlGroup results(name.toStdString()); if(stats.ValidPixels() != 0) { - results += PvlKeyword("Average", toString(stats.Average())); - results += PvlKeyword("StandardDeviation", toString(stats.StandardDeviation())); - results += PvlKeyword("Variance", toString(stats.Variance())); - results += PvlKeyword("Minimum", toString(stats.Minimum())); - results += PvlKeyword("Maximum", toString(stats.Maximum())); + results += PvlKeyword("Average", std::to_string(stats.Average())); + results += PvlKeyword("StandardDeviation", std::to_string(stats.StandardDeviation())); + results += PvlKeyword("Variance", std::to_string(stats.Variance())); + results += PvlKeyword("Minimum", std::to_string(stats.Minimum())); + results += PvlKeyword("Maximum", std::to_string(stats.Maximum())); } - results += PvlKeyword("TotalPixels", toString(stats.TotalPixels())); - results += PvlKeyword("ValidPixels", toString(stats.ValidPixels())); - results += PvlKeyword("NullPixels", toString(stats.NullPixels())); - results += PvlKeyword("LisPixels", toString(stats.LisPixels())); - results += PvlKeyword("LrsPixels", toString(stats.LrsPixels())); - results += PvlKeyword("HisPixels", toString(stats.HisPixels())); - results += PvlKeyword("HrsPixels", toString(stats.HrsPixels())); + results += PvlKeyword("TotalPixels", std::to_string(stats.TotalPixels())); + results += PvlKeyword("ValidPixels", std::to_string(stats.ValidPixels())); + results += PvlKeyword("NullPixels", std::to_string(stats.NullPixels())); + results += PvlKeyword("LisPixels", std::to_string(stats.LisPixels())); + results += PvlKeyword("LrsPixels", std::to_string(stats.LrsPixels())); + results += PvlKeyword("HisPixels", std::to_string(stats.HisPixels())); + results += PvlKeyword("HrsPixels", std::to_string(stats.HrsPixels())); return results; } diff --git a/isis/src/mro/apps/histitch/main.cpp b/isis/src/mro/apps/histitch/main.cpp index 2292266462..89313425d4 100644 --- a/isis/src/mro/apps/histitch/main.cpp +++ b/isis/src/mro/apps/histitch/main.cpp @@ -158,7 +158,7 @@ void IsisMain() { PvlGroup &from1Instrument = icube1->group("INSTRUMENT"); fromData[0].ChnNumber = from1Instrument["ChannelNumber"]; - stitchedProductIds = (QString)from1Archive["ProductId"][0]; + stitchedProductIds = QString::fromStdString(from1Archive["ProductId"][0]); // Set initial conditions for one input file if(fromData[0].ChnNumber == 1) { @@ -191,20 +191,20 @@ void IsisMain() { PvlGroup &from2Archive = icube2->group("ARCHIVE"); //Make sure observation id's are the same - QString from1ObsId = from1Archive["ObservationId"]; - QString from2ObsId = from2Archive["ObservationId"]; + QString from1ObsId = QString::fromStdString(from1Archive["ObservationId"]); + QString from2ObsId = QString::fromStdString(from2Archive["ObservationId"]); if(from1ObsId != from2ObsId) { QString msg = "The input files Observation Id's are not compatable"; throw IException(IException::User, msg, _FILEINFO_); } stitchedProductIds = "(" + stitchedProductIds + ", " + - (QString)from2Archive["ProductId"][0] + ")"; + QString::fromStdString(from2Archive["ProductId"][0]) + ")"; PvlGroup &from2Instrument = icube2->group("INSTRUMENT"); //Make sure CCD Id's are the same - QString from1CcdId = from1Instrument["CCDId"]; - QString from2CcdId = from2Instrument["CCDId"]; + QString from1CcdId = QString::fromStdString(from1Instrument["CCDId"]); + QString from2CcdId = QString::fromStdString(from2Instrument["CCDId"]); if(from1CcdId != from2CcdId) { string msg = "The input files CCD Id's are not compatable"; throw IException(IException::User, msg, _FILEINFO_); @@ -242,16 +242,16 @@ void IsisMain() { // Set StitchedChannels and Stitched ProductIds keywords if(ui.WasEntered("FROM2")) { InstrumentOut += PvlKeyword("StitchedChannels", "(0,1)"); - InstrumentOut += PvlKeyword("StitchedProductIds", stitchedProductIds); + InstrumentOut += PvlKeyword("StitchedProductIds", stitchedProductIds.toStdString()); } else { - InstrumentOut += PvlKeyword("StitchedChannels", toString(fromData[0].ChnNumber)); - InstrumentOut += PvlKeyword("StitchedProductIds", stitchedProductIds); + InstrumentOut += PvlKeyword("StitchedChannels", std::to_string(fromData[0].ChnNumber)); + InstrumentOut += PvlKeyword("StitchedProductIds", stitchedProductIds.toStdString()); } // Do balance correction PvlGroup results("Results"); - results += PvlKeyword("Balance", balance); + results += PvlKeyword("Balance", balance.toStdString()); if((balance == "TRUE") || (balance == "EQUALIZE")) { ProcessByLine pAvg; @@ -293,15 +293,15 @@ void IsisMain() { fromData[ch0Index].mult = coeff; } } - results += PvlKeyword("TruthChannel", toString(hiChannel)); - results += PvlKeyword("BalanceRatio", toString(coeff)); + results += PvlKeyword("TruthChannel", std::to_string(hiChannel)); + results += PvlKeyword("BalanceRatio", std::to_string(coeff)); } else { // Store off original averages for table HiVector ch0_org = f0LineAvg; HiVector ch1_org = f1LineAvg; - results += PvlKeyword("FilterWidth", toString(filterWidth)); + results += PvlKeyword("FilterWidth", std::to_string(filterWidth)); if(filterWidth > 0) { f0LineAvg = filter(f0LineAvg, filterWidth); f1LineAvg = filter(f1LineAvg, filterWidth); @@ -311,13 +311,13 @@ void IsisMain() { if(fillNull) { int nfilled; f0LineAvg = filler(f0LineAvg, nfilled); - results += PvlKeyword("Channel0Filled", toString(nfilled)); + results += PvlKeyword("Channel0Filled", std::to_string(nfilled)); f1LineAvg = filler(f1LineAvg, nfilled); - results += PvlKeyword("Channel1Filled", toString(nfilled)); + results += PvlKeyword("Channel1Filled", std::to_string(nfilled)); } - results += PvlKeyword("TruthChannel", toString(hiChannel)); - results += PvlKeyword("Operator", fixop); + results += PvlKeyword("TruthChannel", std::to_string(hiChannel)); + results += PvlKeyword("Operator", fixop.toStdString()); int nunfilled(0); HiVector ch0_fixed(icube1->lineCount(), 1.0); HiVector ch1_fixed(icube1->lineCount(), 1.0); @@ -343,7 +343,7 @@ void IsisMain() { ch1_fixed = 0.0; } } - results += PvlKeyword("UnFilled", toString(nunfilled)); + results += PvlKeyword("UnFilled", std::to_string(nunfilled)); // Add a table to the output file of the data values TableField f1("Channel1Original", Isis::TableField::Double); diff --git a/isis/src/mro/apps/marci2isis/marci2isis.cpp b/isis/src/mro/apps/marci2isis/marci2isis.cpp index d409c07d75..673d9b72ad 100644 --- a/isis/src/mro/apps/marci2isis/marci2isis.cpp +++ b/isis/src/mro/apps/marci2isis/marci2isis.cpp @@ -58,7 +58,7 @@ namespace Isis{ FileName inFile = ui.GetFileName("FROM"); //Checks if in file is rdr - Pvl lab(inFile.expanded()); + Pvl lab(inFile.expanded().toStdString()); if(lab.hasObject("IMAGE_MAP_PROJECTION")) { QString msg = "[" + inFile.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; @@ -94,7 +94,7 @@ namespace Isis{ int numKnownFilters = sizeof(knownFilters) / sizeof(QString); while(filtNum < numKnownFilters && - (QString)pdsLab["FILTER_NAME"][filter] != knownFilters[filtNum]) { + pdsLab["FILTER_NAME"][filter] != knownFilters[filtNum].toStdString()) { filtNum ++; } @@ -161,19 +161,19 @@ namespace Isis{ translateMarciLabels(pdsLab, *outputCubes[i]->label()); PvlObject &isisCube = outputCubes[i]->label()->findObject("IsisCube"); - isisCube.findGroup("Instrument").addKeyword(PvlKeyword("Framelets", framelets[i])); + isisCube.findGroup("Instrument").addKeyword(PvlKeyword("Framelets", framelets[i].toStdString())); outputCubes[i]->write(origLabel); } - QString prodId = outputCubes[0]->label()->findGroup("Archive", Pvl::Traverse)["ProductId"][0]; + QString prodId = QString::fromStdString(outputCubes[0]->label()->findGroup("Archive", Pvl::Traverse)["ProductId"][0]); prodId = prodId.toUpper(); vector frameseq; vector exptime; // Populate with first values Pvl *isisLabelInitial = outputCubes[0]->label(); PvlGroup &instInitial = isisLabelInitial->findGroup("Instrument", Pvl::Traverse); - double exposure = instInitial["ExposureDuration"][0].toDouble() * 1000.0; + double exposure = std::stod(instInitial["ExposureDuration"][0]) * 1000.0; frameseq.push_back(0); exptime.push_back(exposure); @@ -223,9 +223,9 @@ namespace Isis{ if (exptime.size() < 2) { PvlGroup missing("NoExposureTimeDataFound"); PvlKeyword message("Message", "No variable exposure information found in the varexp file." - " Assuming exposure time is fixed for [" + inFile.toString() + "]" ); + " Assuming exposure time is fixed for [" + inFile.toString().toStdString() + "]" ); missing.addKeyword(message); - missing.addKeyword(PvlKeyword("FileNotFoundInVarexpFile", prodId), Pvl::Replace); + missing.addKeyword(PvlKeyword("FileNotFoundInVarexpFile", prodId.toStdString()), Pvl::Replace); Application::Log(missing); } @@ -240,8 +240,8 @@ namespace Isis{ PvlKeyword frameNumber("FrameNumber"); for (unsigned int i=0; i < exptime.size(); i++) { - varExposure.addValue( QString::number(exptime[i]), "ms" ); - frameNumber.addValue( QString::number(frameseq[i]) ); + varExposure.addValue(std::to_string(exptime[i]), "ms" ); + frameNumber.addValue(std::to_string(frameseq[i])); } inst.addKeyword(frameNumber); inst.addKeyword(varExposure); @@ -366,46 +366,46 @@ namespace Isis{ PvlGroup arch("Archive"); if(pdsLabel.hasKeyword("SAMPLE_BIT_MODE_ID")) { - arch += PvlKeyword("ProductId", (QString)pdsLabel["PRODUCT_ID"]); - arch += PvlKeyword("OriginalProductId", (QString)pdsLabel["ORIGINAL_PRODUCT_ID"]); - arch += PvlKeyword("OrbitNumber", (QString)pdsLabel["ORBIT_NUMBER"]); - arch += PvlKeyword("SampleBitModeId", (QString)pdsLabel["SAMPLE_BIT_MODE_ID"]); - arch += PvlKeyword("FocalPlaneTemperature", (QString)pdsLabel["FOCAL_PLANE_TEMPERATURE"]); - arch += PvlKeyword("RationaleDesc", (QString)pdsLabel["RATIONALE_DESC"]); + arch += PvlKeyword("ProductId", pdsLabel["PRODUCT_ID"]); + arch += PvlKeyword("OriginalProductId", pdsLabel["ORIGINAL_PRODUCT_ID"]); + arch += PvlKeyword("OrbitNumber", pdsLabel["ORBIT_NUMBER"]); + arch += PvlKeyword("SampleBitModeId", pdsLabel["SAMPLE_BIT_MODE_ID"]); + arch += PvlKeyword("FocalPlaneTemperature", pdsLabel["FOCAL_PLANE_TEMPERATURE"]); + arch += PvlKeyword("RationaleDesc", pdsLabel["RATIONALE_DESC"]); } PvlGroup inst("Instrument"); - if((QString)pdsLabel["SPACECRAFT_NAME"] == "MARS_RECONNAISSANCE_ORBITER") { + if(QString::fromStdString(pdsLabel["SPACECRAFT_NAME"]) == "MARS_RECONNAISSANCE_ORBITER") { inst += PvlKeyword("SpacecraftName", "MARS RECONNAISSANCE ORBITER"); } else { throw IException(IException::User, "The input file does not appear to be a MARCI image", _FILEINFO_); } - if((QString)pdsLabel["INSTRUMENT_ID"] == "MARCI") { + if(QString::fromStdString(pdsLabel["INSTRUMENT_ID"]) == "MARCI") { inst += PvlKeyword("InstrumentId", "Marci"); } else { throw IException(IException::User, "The input file does not appear to be a MARCI image", _FILEINFO_); } - inst += PvlKeyword("TargetName", (QString)pdsLabel["TARGET_NAME"]); - inst += PvlKeyword("SummingMode", (QString)pdsLabel["SAMPLING_FACTOR"]); - inst += PvlKeyword("StartTime", (QString) pdsLabel["START_TIME"]); - inst += PvlKeyword("StopTime", (QString) pdsLabel["STOP_TIME"]); - inst += PvlKeyword("SpacecraftClockCount", (QString)pdsLabel["SPACECRAFT_CLOCK_START_COUNT"]); - inst += PvlKeyword("DataFlipped", toString((int)(flip == 1))); - inst += PvlKeyword("ColorOffset", toString(colorOffset)); - inst += PvlKeyword("InterframeDelay", toString((double)pdsLabel["INTERFRAME_DELAY"]), "seconds"); - inst += PvlKeyword("ExposureDuration", toString((double)pdsLabel["LINE_EXPOSURE_DURATION"] / 1000.0), "seconds"); + inst += PvlKeyword("TargetName", pdsLabel["TARGET_NAME"]); + inst += PvlKeyword("SummingMode", pdsLabel["SAMPLING_FACTOR"]); + inst += PvlKeyword("StartTime", pdsLabel["START_TIME"]); + inst += PvlKeyword("StopTime", pdsLabel["STOP_TIME"]); + inst += PvlKeyword("SpacecraftClockCount", pdsLabel["SPACECRAFT_CLOCK_START_COUNT"]); + inst += PvlKeyword("DataFlipped", std::to_string((int)(flip == 1))); + inst += PvlKeyword("ColorOffset", std::to_string(colorOffset)); + inst += PvlKeyword("InterframeDelay", std::to_string((double)pdsLabel["INTERFRAME_DELAY"]), "seconds"); + inst += PvlKeyword("ExposureDuration", std::to_string((double)pdsLabel["LINE_EXPOSURE_DURATION"] / 1000.0), "seconds"); PvlGroup bandBin("BandBin"); PvlKeyword filterName("FilterName"); PvlKeyword origBands("OriginalBand"); for(int filter = 0; filter < pdsLabel["FILTER_NAME"].size(); filter++) { filterName += pdsLabel["FILTER_NAME"][filter]; - origBands += toString(filter + 1); + origBands += std::to_string(filter + 1); } bandBin += filterName; @@ -433,9 +433,9 @@ namespace Isis{ bandUvVis.insert(std::pair("SHORT_UV", "MRO_MARCI_UV")); PvlGroup kerns("Kernels"); - QString uvvis = bandUvVis.find((QString)bandBin["FilterName"][0])->second; + QString uvvis = bandUvVis.find(QString::fromStdString(bandBin["FilterName"][0]))->second; int iakCode = naifIkCodes.find(uvvis)->second; - kerns += PvlKeyword("NaifIkCode", toString(iakCode)); + kerns += PvlKeyword("NaifIkCode", std::to_string(iakCode)); isisCube.addGroup(kerns); } diff --git a/isis/src/mro/apps/marcical/marcical.cpp b/isis/src/mro/apps/marcical/marcical.cpp index f5592320a2..460a4598e3 100644 --- a/isis/src/mro/apps/marcical/marcical.cpp +++ b/isis/src/mro/apps/marcical/marcical.cpp @@ -182,7 +182,7 @@ namespace Isis { } if (icube.group("Archive")["SampleBitModeId"][0] != "SQROOT") { - QString msg = "Sample bit mode [" + icube.group("Archive")["SampleBitModeId"][0] + "] is not supported."; + QString msg = "Sample bit mode [" + QString::fromStdString(icube.group("Archive")["SampleBitModeId"][0]) + "] is not supported."; throw IException(IException::User, msg, _FILEINFO_); } @@ -198,7 +198,7 @@ namespace Isis { decimation.push_back(1.0); } - QString startTime = icube.label()->findGroup("Instrument", Pvl::Traverse)["StartTime"][0]; + QString startTime = QString::fromStdString(icube.label()->findGroup("Instrument", Pvl::Traverse)["StartTime"][0]); iTime start(startTime); iTime changeTime("November 6, 2006 21:30:00 UTC"); @@ -226,7 +226,7 @@ namespace Isis { stretchPairs.Close(); // This file stores radiance/spectral distance coefficients - Pvl calibrationData(calFile.expanded()); + Pvl calibrationData(calFile.expanded().toStdString()); // This will store the radiance coefficient and solar spectral distance coefficients // for each band. @@ -256,9 +256,9 @@ namespace Isis { vector flatcubes; vector fcubeMgrs; - int summing = toInt(icube.group("Instrument")["SummingMode"][0]); - double ifdelay = toDouble(icube.group("Instrument")["InterframeDelay"][0]) * 1000.0; - int flipped = toInt(icube.group("Instrument")["DataFlipped"][0]); + int summing = std::stoi(icube.group("Instrument")["SummingMode"][0]); + double ifdelay = std::stod(icube.group("Instrument")["InterframeDelay"][0]) * 1000.0; + int flipped = std::stoi(icube.group("Instrument")["DataFlipped"][0]); // Read in the flat files for (int band = 0; band < 7; band++) { @@ -320,26 +320,26 @@ namespace Isis { PvlKeyword filtNames = icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"]; int numFilters = filtNames.size(); for (int i = 0; i < filtNames.size(); i++) { - if (filterNameToFilterNumber.find(filtNames[i]) != filterNameToFilterNumber.end()) { - filter.push_back(filterNameToFilterNumber.find(filtNames[i])->second); + if (filterNameToFilterNumber.find(QString::fromStdString(filtNames[i])) != filterNameToFilterNumber.end()) { + filter.push_back(filterNameToFilterNumber.find(QString::fromStdString(filtNames[i]))->second); } else { - QString msg = "Unrecognized filter name [" + QString(filtNames[i]) + "]"; + QString msg = "Unrecognized filter name [" + QString::fromStdString(filtNames[i]) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } PvlKeyword &sumMode = icube.label()->findGroup("Instrument", Pvl::Traverse)["SummingMode"]; - int summingMode = toInt(sumMode[0]); + int summingMode = std::stoi(sumMode[0]); int filterHeight = 16 / summingMode; std::vector padding; padding.resize(numFilters); PvlKeyword &colOff = icube.label()->findGroup("Instrument", Pvl::Traverse)["ColorOffset"]; - int colorOffset = toInt(colOff[0]); + int colorOffset = std::stoi(colOff[0]); for (int i = 0; i < numFilters; i++) { if (colorOffset > 0) { - int filtNum = filterNameToFilterNumber[filtNames[i]] - 1; // if first vis filter (Blue) there is no offset 1 -> 0 + int filtNum = filterNameToFilterNumber[QString::fromStdString(filtNames[i])] - 1; // if first vis filter (Blue) there is no offset 1 -> 0 padding[i] = (colorOffset * filterHeight) * filtNum; } @@ -351,7 +351,7 @@ namespace Isis { int maxOffset = *max_element(padding.begin(),padding.end()); - QString prodId = icube.label()->findGroup("Archive", Pvl::Traverse)["ProductId"][0]; + QString prodId = QString::fromStdString(icube.label()->findGroup("Archive", Pvl::Traverse)["ProductId"][0]); prodId = prodId.toUpper(); vector frameseq; vector exptime; @@ -377,9 +377,9 @@ namespace Isis { PvlKeyword expTimesKey = inst["VariableExposureDuration"]; PvlKeyword frameNumbersKey = inst["FrameNumber"]; for (int i=0; ifindGroup("Instrument", Pvl::Traverse)["ExposureDuration"]) * 1000.0; } // Exposure duration for the UV filters are calculated from the non-UV exposure duration - if ((QString)icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"][band-1] == "LONG_UV" || - (QString)icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"][band-1] == "SHORT_UV") { + if (QString::fromStdString(icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"][band-1]) == "LONG_UV" || + QString::fromStdString(icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"][band-1]) == "SHORT_UV") { exposure = ifdelay - 57.763 - exposure; } seqno++; @@ -471,8 +471,8 @@ namespace Isis { if (frame < frameseq[seqno]) { exposure = exptime[seqno]; seqno++; - if ((QString)icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"][band-1] == "LONG_UV" || - (QString)icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"][band-1] == "SHORT_UV") { + if (QString::fromStdString(icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"][band-1]) == "LONG_UV" || + QString::fromStdString(icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterName"][band-1]) == "SHORT_UV") { exposure = ifdelay - 57.763 - exposure; } } @@ -549,7 +549,7 @@ namespace Isis { for (int o = 0; o < icube.label()->objects(); o++) { if (icube.label()->object(o).isNamed("Table")) { - Blob t(icube.label()->object(o)["Name"], icube.label()->object(o).name()); + Blob t(QString::fromStdString(icube.label()->object(o)["Name"]), icube.label()->object(o).name()); icube.read(t); ocube.write(t); } diff --git a/isis/src/mro/apps/marciflip/marciflip.cpp b/isis/src/mro/apps/marciflip/marciflip.cpp index 986dc0d4d5..342db50ef9 100644 --- a/isis/src/mro/apps/marciflip/marciflip.cpp +++ b/isis/src/mro/apps/marciflip/marciflip.cpp @@ -52,7 +52,7 @@ namespace Isis { PvlGroup inst = icube->group("Instrument"); // change flipped keyword - inst["DataFlipped"] = toString(((int)inst["DataFlipped"] + 1) % 2); + inst["DataFlipped"] = std::to_string(((int)inst["DataFlipped"] + 1) % 2); outputCube->label()->findObject("IsisCube").addGroup(inst); } diff --git a/isis/src/mro/apps/mroctx2isis/main.cpp b/isis/src/mro/apps/mroctx2isis/main.cpp index c0dfa8e81d..3c59febd17 100644 --- a/isis/src/mro/apps/mroctx2isis/main.cpp +++ b/isis/src/mro/apps/mroctx2isis/main.cpp @@ -48,10 +48,10 @@ void IsisMain() { QString msg; try { msg = "File could not be opened."; - Pvl lab(inFile.expanded()); + Pvl lab(inFile.expanded().toStdString()); msg = "PVL Keyword [DATA_SET_ID] not found in label."; - id = (QString) lab.findKeyword("DATA_SET_ID"); + id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); projected = lab.hasObject("IMAGE_MAP_PROJECTION"); msg = "PVL Keywords [SPATIAL_SUMMING] and [SAMPLING_FACTOR] not found in label."; @@ -64,7 +64,7 @@ void IsisMain() { } msg = "PVL Keyword [SAMPLE_BIT_MODE_ID] not found in label."; - bitMode = (QString) lab.findKeyword("SAMPLE_BIT_MODE_ID"); + bitMode = QString::fromStdString(lab.findKeyword("SAMPLE_BIT_MODE_ID")); msg = "PVL Keywords [EDIT_MODE_ID] and [SAMPLE_FIRST_PIXEL] not found in label."; msg += "The mroctx2isis application requires at least one to exist in order to set edit mode."; @@ -229,7 +229,7 @@ void TranslateMroCtxLabels(FileName &labelFile, Cube *ocube) { //Pvl to store the labels Pvl outLabel; QString transDir = "$ISISROOT/appdata/translations/"; - Pvl labelPvl(labelFile.expanded()); + Pvl labelPvl(labelFile.expanded().toStdString()); //Translate the Instrument group FileName transFile(transDir + "MroCtxInstrument.trn"); @@ -244,14 +244,14 @@ void TranslateMroCtxLabels(FileName &labelFile, Cube *ocube) { // Set up the BandBin groups PvlGroup bbin("BandBin"); bbin += PvlKeyword("FilterName", "BroadBand"); - bbin += PvlKeyword("Center", toString(0.650), "micrometers"); - bbin += PvlKeyword("Width", toString(0.150), "micrometers"); + bbin += PvlKeyword("Center", std::to_string(0.650), "micrometers"); + bbin += PvlKeyword("Width", std::to_string(0.150), "micrometers"); //Set up the Kernels group PvlGroup kern("Kernels"); - kern += PvlKeyword("NaifFrameCode", toString(-74021)); + kern += PvlKeyword("NaifFrameCode", std::to_string(-74021)); - Pvl lab(labelFile.expanded()); + Pvl lab(labelFile.expanded().toStdString()); int sumMode, startSamp; if(lab.hasKeyword("SPATIAL_SUMMING")) { sumMode = (int)lab.findKeyword("SPATIAL_SUMMING"); @@ -266,8 +266,8 @@ void TranslateMroCtxLabels(FileName &labelFile, Cube *ocube) { startSamp = (int)lab.findKeyword("SAMPLE_FIRST_PIXEL"); } PvlGroup inst = outLabel.findGroup("Instrument", Pvl::Traverse); - inst += PvlKeyword("SpatialSumming", toString(sumMode)); - inst += PvlKeyword("SampleFirstPixel", toString(startSamp)); + inst += PvlKeyword("SpatialSumming", std::to_string(sumMode)); + inst += PvlKeyword("SampleFirstPixel", std::to_string(startSamp)); //Add all groups to the output cube ocube->putGroup(inst); diff --git a/isis/src/mro/objs/CTXCamera/CTXCamera.cpp b/isis/src/mro/objs/CTXCamera/CTXCamera.cpp index aac46aab67..c219388a20 100644 --- a/isis/src/mro/objs/CTXCamera/CTXCamera.cpp +++ b/isis/src/mro/objs/CTXCamera/CTXCamera.cpp @@ -44,7 +44,7 @@ namespace Isis { Pvl &lab = *cube.label(); // Get the start time from labels PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockCount"]); double etStart = getClockTime(stime).Et(); // Get other info from labels diff --git a/isis/src/mro/objs/CrismCamera/CrismCamera.cpp b/isis/src/mro/objs/CrismCamera/CrismCamera.cpp index 1b2c5d83fb..92dd68c692 100644 --- a/isis/src/mro/objs/CrismCamera/CrismCamera.cpp +++ b/isis/src/mro/objs/CrismCamera/CrismCamera.cpp @@ -53,7 +53,7 @@ namespace Isis { PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); // SensorId = S (VNIR), = L (IR) = J (JOINT) - QString sensor = (QString) inst ["SensorId"]; + QString sensor = QString::fromStdString(inst ["SensorId"]); // Prepare instrument code QString ikCode(toString(naifIkCode())); @@ -63,8 +63,8 @@ namespace Isis { SetPixelPitch(); // Get the start and end time in et - double etStart = getEtTime((QString) inst ["SpacecraftClockStartCount"]); - double etStop = getEtTime((QString) inst ["SpacecraftClockStopCount"]); + double etStart = getEtTime(QString::fromStdString(inst ["SpacecraftClockStartCount"])); + double etStop = getEtTime(QString::fromStdString(inst ["SpacecraftClockStopCount"])); // Compute the exposure time of the first line and the line rate. This diff --git a/isis/src/mro/objs/HiCal/HiCalConf.cpp b/isis/src/mro/objs/HiCal/HiCalConf.cpp index bdb1b926fe..cdf3a05148 100644 --- a/isis/src/mro/objs/HiCal/HiCalConf.cpp +++ b/isis/src/mro/objs/HiCal/HiCalConf.cpp @@ -58,7 +58,7 @@ bool HiCalConf::_naifLoaded = false; * @param conf Name of configuration file to use */ HiCalConf::HiCalConf(Pvl &label, const QString &conf) : - DbAccess(Pvl(filepath(conf)).findObject("Hical", PvlObject::Traverse)) { + DbAccess(Pvl(filepath(conf).toStdString()).findObject("Hical", PvlObject::Traverse)) { _profName.clear(); init(label); } @@ -109,7 +109,7 @@ bool HiCalConf::_naifLoaded = false; * @param conf Name of configuration file to use */ void HiCalConf::setConf(const QString &conf) { - load(Pvl(filepath(conf)).findObject("Hical", PvlObject::Traverse)); + load((Pvl(filepath(conf).toStdString()).findObject("Hical", PvlObject::Traverse))); } /** @@ -309,12 +309,12 @@ bool HiCalConf::_naifLoaded = false; try { loadNaifTiming(); - QString scStartTime = getKey("SpacecraftClockStartCount", "Instrument"); + QString scStartTime = QString::fromStdString(getKey("SpacecraftClockStartCount", "Instrument")); double obsStartTime; NaifStatus::CheckErrors(); scs2e_c (-74999,scStartTime.toLatin1().data(),&obsStartTime); - QString targetName = getKey("TargetName", "Instrument"); + QString targetName = QString::fromStdString(getKey("TargetName", "Instrument")); if (targetName.toLower() == "sky" || targetName.toLower() == "cal" || targetName.toLower() == "phobos" || @@ -479,11 +479,11 @@ void HiCalConf::init(Pvl &label) { PvlKeyword &HiCalConf::getKey(const QString &key, const QString &group) { if (!group.isEmpty()) { - PvlGroup &grp = _label.findGroup(group, Pvl::Traverse); - return (grp[key]); + PvlGroup &grp = _label.findGroup(group.toStdString(), Pvl::Traverse); + return (grp[key.toStdString()]); } else { - return (_label.findKeyword(key)); + return (_label.findKeyword(key.toStdString())); } } @@ -543,7 +543,7 @@ DbProfile HiCalConf::getLabelProfile(const DbProfile &profile) const { Pvl label = _label; for ( int g = 0 ; g < ngroups ; g++ ) { QString group = profile("LabelGroups", g); - PvlGroup grp = label.findGroup(group, Pvl::Traverse); + PvlGroup grp = label.findGroup(group.toStdString(), Pvl::Traverse); lblprof = DbProfile(lblprof,DbProfile(grp)); } } @@ -562,8 +562,8 @@ DbProfile HiCalConf::makeParameters(Pvl &label) const { int channel = inst["ChannelNumber"]; parms.add("CCD",ToString(ccd)); parms.add("CHANNEL", ToString(channel)); - parms.add("TDI", inst["Tdi"]); - parms.add("BIN", inst["Summing"]); + parms.add("TDI", QString::fromStdString(inst["Tdi"])); + parms.add("BIN", QString::fromStdString(inst["Summing"])); parms.add("FILTER", CcdToFilter(ccd)); parms.add("CCDCHANNELINDEX", ToString(getChannelIndex(ccd, channel))); return (parms); diff --git a/isis/src/mro/objs/HiCal/HiCalTypes.h b/isis/src/mro/objs/HiCal/HiCalTypes.h index 70e23feeed..46c1ff0f9f 100644 --- a/isis/src/mro/objs/HiCal/HiCalTypes.h +++ b/isis/src/mro/objs/HiCal/HiCalTypes.h @@ -65,9 +65,9 @@ class HiHistory { void clear() { _events.clear(); } PvlKeyword makekey(const QString &name = "History") const { - PvlKeyword key(name); + PvlKeyword key(name.toStdString()); for (unsigned int i = 0 ; i < _events.size() ; i++) { - key.addValue(_events[i]); + key.addValue(_events[i].toStdString()); } return (key); } diff --git a/isis/src/mro/objs/HiCal/HiCalUtil.h b/isis/src/mro/objs/HiCal/HiCalUtil.h index 831476ff5f..69aa0cfbb5 100644 --- a/isis/src/mro/objs/HiCal/HiCalUtil.h +++ b/isis/src/mro/objs/HiCal/HiCalUtil.h @@ -435,7 +435,7 @@ inline HiVector rebin(const HiVector &v, int n) { inline void RemoveHiBlobs(Pvl &label) { for ( int blob = 0 ; blob < label.objects() ; blob++ ) { if ( label.object(blob).isNamed("Table") ) { - QString name = label.object(blob)["Name"][0]; + QString name = QString::fromStdString(label.object(blob)["Name"][0]); if ( name.toLower() == "hirise calibration ancillary" || name.toLower() == "hirise calibration images" || name.toLower() == "hirise ancillary") { diff --git a/isis/src/mro/objs/HiCal/ZeroReverse.h b/isis/src/mro/objs/HiCal/ZeroReverse.h index 557c6cbb2a..f5fe0cb0f2 100644 --- a/isis/src/mro/objs/HiCal/ZeroReverse.h +++ b/isis/src/mro/objs/HiCal/ZeroReverse.h @@ -109,7 +109,7 @@ namespace Isis { "],HisPixels["+ToString(_stats.HisPixels()) + "],NulPixels["+ToString(_stats.NullPixels())+ "])"); - DbAccess triggers(Pvl(tfile).findObject("ReverseClockStatistics")); + DbAccess triggers(Pvl(tfile.toStdString()).findObject("ReverseClockStatistics")); QString tprofName = conf.resolve("{FILTER}{CCD}_{CHANNEL}_{BIN}",prof); _history.add("ReverseClockStatistics(File["+tfile+ "],Profile["+tprofName+"])"); diff --git a/isis/src/mro/objs/HiriseCamera/HiriseCamera.cpp b/isis/src/mro/objs/HiriseCamera/HiriseCamera.cpp index 2de6a3f92a..912406095d 100644 --- a/isis/src/mro/objs/HiriseCamera/HiriseCamera.cpp +++ b/isis/src/mro/objs/HiriseCamera/HiriseCamera.cpp @@ -51,7 +51,7 @@ namespace Isis { int chan = inst["ChannelNumber"]; int cpmm = inst["CpmmNumber"]; double deltaLineTimerCount = inst["DeltaLineTimerCount"]; - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); // Convert CPMM number to CCD number static int cpmm2ccd[] = {0, 1, 2, 3, 12, 4, 10, 11, 5, 13, 6, 7, 8, 9}; diff --git a/isis/src/mro/objs/MarciCamera/MarciCamera.cpp b/isis/src/mro/objs/MarciCamera/MarciCamera.cpp index 497feee266..e1b59c9fa4 100644 --- a/isis/src/mro/objs/MarciCamera/MarciCamera.cpp +++ b/isis/src/mro/objs/MarciCamera/MarciCamera.cpp @@ -62,7 +62,7 @@ namespace Isis { // Get the start and end time double et; - QString stime = inst["SpacecraftClockCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockCount"]); et = getClockTime(stime).Et(); p_etStart = et - ((p_exposureDur / 1000.0) / 2.0); p_nframelets = (int) (ParentLines() / sumMode); @@ -103,14 +103,14 @@ namespace Isis { const PvlKeyword &filtNames = bandBin["FilterName"]; for(int i = 0; i < filtNames.size(); i++) { - if(filterToDetectorOffset.find(filtNames[i]) == filterToDetectorOffset.end()) { - QString msg = "Unrecognized filter name [" + filtNames[i] + "]"; + if(filterToDetectorOffset.find(QString::fromStdString(filtNames[i])) == filterToDetectorOffset.end()) { + QString msg = "Unrecognized filter name [" + QString::fromStdString(filtNames[i]) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } - p_detectorStartLines.push_back(filterToDetectorOffset.find(filtNames[i])->second); - p_filterNumbers.push_back(filterToFilterNumbers.find(filtNames[i])->second); - p_frameletOffsets.push_back(filterToFrameletOffset.find(filtNames[i])->second); + p_detectorStartLines.push_back(filterToDetectorOffset.find(QString::fromStdString(filtNames[i]))->second); + p_filterNumbers.push_back(filterToFilterNumbers.find(QString::fromStdString(filtNames[i]))->second); + p_frameletOffsets.push_back(filterToFrameletOffset.find(QString::fromStdString(filtNames[i]))->second); } // Setup detector map diff --git a/isis/src/near/apps/msi2isis/msi2isis.cpp b/isis/src/near/apps/msi2isis/msi2isis.cpp index e2cb04aad3..e7431e54a2 100644 --- a/isis/src/near/apps/msi2isis/msi2isis.cpp +++ b/isis/src/near/apps/msi2isis/msi2isis.cpp @@ -71,12 +71,12 @@ namespace Isis { throw IException(IException::Io, "The input label [" + from.expanded() + "] has an invalid " "value for INSTRUMENT_ID = [" - + inputLabelPvl["INSTRUMENT_ID"][0] + + QString::fromStdString(inputLabelPvl["INSTRUMENT_ID"][0]) + "]. The msi2isis program requires INSTRUMENT_ID = [MSI].", _FILEINFO_); } - int lines = inputLabelPvl.findObject("IMAGE")["LINES"][0].toInt(); - int samples = inputLabelPvl.findObject("IMAGE")["LINE_SAMPLES"][0].toInt(); + int lines = std::stoi(inputLabelPvl.findObject("IMAGE")["LINES"][0]); + int samples = std::stoi(inputLabelPvl.findObject("IMAGE")["LINE_SAMPLES"][0]); if ( ( (lines != 244) && (lines != 412) ) || samples != 537) { QString msg = "The given file [" + from.expanded() + "] does not contain " "a full MSI image. Full NEAR Shoemaker MSI images have " @@ -88,7 +88,7 @@ namespace Isis { if (inputLabelPvl["SAMPLE_DISPLAY_DIRECTION"][0] != "RIGHT") { QString msg = "The input label [" + from.expanded() + "] has an invalid " "value for SAMPLE_DISPLAY_DIRECTION = [" - + inputLabelPvl["SAMPLE_DISPLAY_DIRECTION"][0] + + QString::fromStdString(inputLabelPvl["SAMPLE_DISPLAY_DIRECTION"][0]) + "]. The msi2isis program requires " "SAMPLE_DISPLAY_DIRECTION = [RIGHT]."; throw IException(IException::Io, msg, _FILEINFO_); @@ -96,7 +96,7 @@ namespace Isis { if (inputLabelPvl["LINE_DISPLAY_DIRECTION"][0] != "UP") { QString msg = "The input label [" + from.expanded() + "] has an invalid " "value for LINE_DISPLAY_DIRECTION = [" - + inputLabelPvl["LINE_DISPLAY_DIRECTION"][0] + + QString::fromStdString(inputLabelPvl["LINE_DISPLAY_DIRECTION"][0]) + "]. The msi2isis program requires " "LINE_DISPLAY_DIRECTION = [UP]."; throw IException(IException::Io, msg, _FILEINFO_); @@ -284,9 +284,9 @@ namespace Isis { // Correct format of SCLK by remove the . // Test if the correction has been made - it should be an integer - if ( sclkStart[0].contains(".") ) { - sclkStart = sclkStart[0].remove("."); - sclkStop = sclkStop[0].remove("."); + if (QString::fromStdString(sclkStart[0]).contains(".") ) { + sclkStart = (QString::fromStdString(sclkStart[0]).remove(".")).toStdString(); + sclkStop = (QString::fromStdString(sclkStop[0]).remove(".")).toStdString(); } // Read DPU deck temperature value from the labels (This value is also given diff --git a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/unitTest.cpp b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/unitTest.cpp index 8f9fe62815..e17dd3064f 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/unitTest.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/unitTest.cpp @@ -69,7 +69,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/unitTest.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/unitTest.cpp index 886a23a7d2..1043777bf0 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/unitTest.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/unitTest.cpp @@ -59,7 +59,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp b/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp index 6ffbdb925c..7ad0485e3d 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp @@ -61,7 +61,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = toDouble( inst["ExposureDuration"][0] ); - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/viking/objs/VikingCamera/unitTest.cpp b/isis/src/viking/objs/VikingCamera/unitTest.cpp index 6d47628a98..5d2cdc2bb3 100644 --- a/isis/src/viking/objs/VikingCamera/unitTest.cpp +++ b/isis/src/viking/objs/VikingCamera/unitTest.cpp @@ -65,7 +65,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/src/voyager/objs/VoyagerCamera/unitTest.cpp b/isis/src/voyager/objs/VoyagerCamera/unitTest.cpp index 0c35afbc2b..05b41600c1 100644 --- a/isis/src/voyager/objs/VoyagerCamera/unitTest.cpp +++ b/isis/src/voyager/objs/VoyagerCamera/unitTest.cpp @@ -60,7 +60,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/tests/OsirisRexOCamsCameraTests.cpp b/isis/tests/OsirisRexOCamsCameraTests.cpp index 03e9ea4eee..0da8745f94 100644 --- a/isis/tests/OsirisRexOCamsCameraTests.cpp +++ b/isis/tests/OsirisRexOCamsCameraTests.cpp @@ -31,7 +31,7 @@ TEST_F(OsirisRexOcamsCube, PolyMath) { const PvlGroup &inst = testCube->label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); @@ -118,7 +118,7 @@ setInstrument("-64500", "PolyCam"); const PvlGroup &inst = testCube->label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/tests/OsirisRexTagCamsCameraTests.cpp b/isis/tests/OsirisRexTagCamsCameraTests.cpp index 06ecd382b4..46d8c00fa9 100644 --- a/isis/tests/OsirisRexTagCamsCameraTests.cpp +++ b/isis/tests/OsirisRexTagCamsCameraTests.cpp @@ -41,7 +41,7 @@ TEST_F(OsirisRexTagcamsNAVCamCube, NavigationCam) { const PvlGroup &inst = testCube->label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); @@ -90,7 +90,7 @@ TEST_F(OsirisRexTagcamsNFTCamCube, NaturalFeatureTrackingCam) { const PvlGroup &inst = testCube->label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); diff --git a/isis/tests/UnitTestOsirisRexTagCams.cpp b/isis/tests/UnitTestOsirisRexTagCams.cpp index 0ab3f9d31f..a622cb3bfa 100644 --- a/isis/tests/UnitTestOsirisRexTagCams.cpp +++ b/isis/tests/UnitTestOsirisRexTagCams.cpp @@ -39,7 +39,7 @@ TEST_F(TempTestingFiles, UnitTestOsirisRexTagCamsNAVCam) { // Test Shutter Open/Close const PvlGroup &inst = navCube.label()->findGroup("Instrument", Pvl::Traverse); double exposureDuration = ((double) inst["ExposureDuration"])/1000; - QString stime = inst["StartTime"]; + QString stime = QString::fromStdString(inst["StartTime"]); double et; // StartTime keyword is the center exposure time str2et_c(stime.toLatin1().data(), &et); pair shuttertimes = cam->ShutterOpenCloseTimes(et, exposureDuration); From 2e381882ec223f53e6acd5c2d31e2719a5317c5e Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Tue, 20 Aug 2024 14:26:05 -0700 Subject: [PATCH 56/95] more removal of qt from pvl --- isis/src/messenger/apps/mdis2pds/main.cpp | 52 +- isis/src/mro/apps/hifringe/main.cpp | 40 +- isis/src/mro/apps/pds2hideal/main.cpp | 40 +- isis/src/near/objs/MsiCamera/MsiCamera.cpp | 2 +- .../apps/leisa2isis/leisa2isis.cpp | 16 +- .../apps/lorri2isis/lorri2isis.cpp | 8 +- .../newhorizons/apps/mvic2isis/mvic2isis.cpp | 44 +- .../NewHorizonsLeisaCamera.cpp | 6 +- .../NewHorizonsLorriCamera.cpp | 2 +- .../NewHorizonsMvicFrameCamera.cpp | 6 +- .../NewHorizonsMvicTdiCamera.cpp | 2 +- isis/src/odyssey/apps/thm2isis/thm2isis.cpp | 66 +- isis/src/odyssey/apps/thmbasemap1/main.cpp | 30 +- isis/src/odyssey/apps/thmnoseam/main.cpp | 2 +- isis/src/odyssey/apps/thmproc/main.cpp | 6 +- isis/src/odyssey/apps/thmvisflat/main.cpp | 6 +- isis/src/odyssey/apps/thmvistrim/main.cpp | 2 +- .../objs/ThemisIrCamera/ThemisIrCamera.cpp | 6 +- .../objs/ThemisVisCamera/ThemisVisCamera.cpp | 6 +- .../apps/tagcams2isis/tagcams2isis.cpp | 16 +- .../OsirisRexOcamsCamera.cpp | 8 +- .../OsirisRexTagcamsCamera.cpp | 2 +- isis/src/rolo/apps/rolo2isis/main.cpp | 10 +- isis/src/rosetta/apps/rososiris2isis/main.cpp | 18 +- isis/src/rosetta/apps/rosvirtis2isis/main.cpp | 16 +- .../RosettaOsirisCamera.cpp | 4 +- .../RosettaVirtisCamera.cpp | 26 +- .../apps/tgocassis2isis/tgocassis2isis.cpp | 38 +- .../tgo/apps/tgocassismos/tgocassismos.cpp | 52 +- .../apps/tgocassisrdrgen/tgocassisrdrgen.cpp | 24 +- .../apps/tgocassisstitch/tgocassisstitch.cpp | 16 +- .../tgocassisunstitch/tgocassisunstitch.cpp | 36 +- .../objs/TgoCassisCamera/TgoCassisCamera.cpp | 8 +- .../src/tgo/objs/TgoCassisCamera/unitTest.cpp | 2 +- isis/src/viking/apps/vik2isis/main.cpp | 54 +- isis/src/viking/apps/vikcal/CalParameters.cpp | 22 +- isis/src/viking/apps/vikcal/main.cpp | 36 +- isis/src/viking/apps/vikcal/vikcal.cpp | 6 +- isis/src/viking/apps/viknobutter/main.cpp | 6 +- .../viking/objs/VikingCamera/VikingCamera.cpp | 6 +- isis/src/voyager/apps/voy2isis/main.cpp | 60 +- isis/src/voyager/apps/voycal/main.cpp | 44 +- isis/src/voyager/apps/voyramp/main.cpp | 8 +- .../objs/VoyagerCamera/VoyagerCamera.cpp | 6 +- isis/tests/AutoseedTests.cpp | 14 +- isis/tests/CameraFixtures.cpp | 22 +- isis/tests/ClipperWacFcCameraTests.cpp | 2 +- isis/tests/CsmFixtures.cpp | 4 +- isis/tests/CubeFixtures.cpp | 8 +- isis/tests/FunctionalTestsApollofindrx.cpp | 20 +- isis/tests/FunctionalTestsApolloremrx.cpp | 20 +- isis/tests/FunctionalTestsAutomos.cpp | 16 +- isis/tests/FunctionalTestsCaminfo.cpp | 52 +- isis/tests/FunctionalTestsCampt.cpp | 48 +- isis/tests/FunctionalTestsCamrange.cpp | 18 +- isis/tests/FunctionalTestsChan1m32isis.cpp | 168 +-- isis/tests/FunctionalTestsCiss2isis.cpp | 16 +- isis/tests/FunctionalTestsCkwriter.cpp | 4 +- isis/tests/FunctionalTestsCnetbin2pvl.cpp | 2 +- isis/tests/FunctionalTestsCnetdiff.cpp | 228 ++-- isis/tests/FunctionalTestsCnetedit.cpp | 1156 ++++++++--------- isis/tests/FunctionalTestsCnetstats.cpp | 26 +- isis/tests/FunctionalTestsCnetthinner.cpp | 6 +- isis/tests/FunctionalTestsCrism2isis.cpp | 72 +- isis/tests/FunctionalTestsCsminit.cpp | 58 +- isis/tests/FunctionalTestsCubeatt.cpp | 24 +- isis/tests/FunctionalTestsDemprep.cpp | 16 +- isis/tests/FunctionalTestsEis2isis.cpp | 40 +- isis/tests/FunctionalTestsFillGap.cpp | 2 +- isis/tests/FunctionalTestsFindGaps.cpp | 6 +- isis/tests/FunctionalTestsFits2isis.cpp | 8 +- isis/tests/FunctionalTestsFootprintinit.cpp | 4 +- isis/tests/FunctionalTestsFrameStitch.cpp | 6 +- isis/tests/FunctionalTestsGetsn.cpp | 10 +- isis/tests/FunctionalTestsGllssical.cpp | 24 +- isis/tests/FunctionalTestsHi2isis.cpp | 82 +- isis/tests/FunctionalTestsHical.cpp | 2 +- isis/tests/FunctionalTestsHicolormos.cpp | 6 +- isis/tests/FunctionalTestsHicrop.cpp | 112 +- isis/tests/FunctionalTestsHicubenorm.cpp | 10 +- isis/tests/FunctionalTestsHidtmgen.cpp | 230 ++-- isis/tests/FunctionalTestsHimos.cpp | 38 +- isis/tests/FunctionalTestsHrsc2isis.cpp | 54 +- isis/tests/FunctionalTestsHyb2onc2isis.cpp | 22 +- isis/tests/FunctionalTestsIsis2pds.cpp | 94 +- isis/tests/FunctionalTestsIsisImport.cpp | 12 +- .../FunctionalTestsIsisImportCassiniISS.cpp | 4 +- .../FunctionalTestsIsisImportKaguyaMI.cpp | 44 +- .../FunctionalTestsIsisImportKaguyaTC.cpp | 2 +- isis/tests/FunctionalTestsIsisImportLo.cpp | 84 +- .../tests/FunctionalTestsIsisImportLroNac.cpp | 62 +- isis/tests/FunctionalTestsIsisImportMerMI.cpp | 4 +- isis/tests/FunctionalTestsIsisexport.cpp | 18 +- isis/tests/FunctionalTestsJigsaw.cpp | 6 +- isis/tests/FunctionalTestsJitterfit.cpp | 14 +- isis/tests/FunctionalTestsKaguyami2isis.cpp | 44 +- isis/tests/FunctionalTestsKaguyatc2isis.cpp | 48 +- isis/tests/FunctionalTestsKerneldbgen.cpp | 242 ++-- isis/tests/FunctionalTestsLeisa2isis.cpp | 114 +- isis/tests/FunctionalTestsLo2isis.cpp | 84 +- isis/tests/FunctionalTestsLorri2isis.cpp | 56 +- isis/tests/FunctionalTestsLronac2isis.cpp | 62 +- isis/tests/FunctionalTestsLronac2pds.cpp | 60 +- isis/tests/FunctionalTestsLrowac2isis.cpp | 340 ++--- isis/tests/FunctionalTestsLrowac2pds.cpp | 140 +- isis/tests/FunctionalTestsLrowaccal.cpp | 4 +- isis/tests/FunctionalTestsMap2map.cpp | 40 +- isis/tests/FunctionalTestsMapmos.cpp | 4 +- isis/tests/FunctionalTestsMappt.cpp | 44 +- isis/tests/FunctionalTestsMaptrim.cpp | 52 +- isis/tests/FunctionalTestsMarci2isis.cpp | 92 +- isis/tests/FunctionalTestsMarcical.cpp | 16 +- isis/tests/FunctionalTestsMimap2isis.cpp | 1150 ++++++++-------- isis/tests/FunctionalTestsMosrange.cpp | 22 +- isis/tests/FunctionalTestsMsi2isis.cpp | 68 +- isis/tests/FunctionalTestsMvic2isis.cpp | 56 +- isis/tests/FunctionalTestsNoproj.cpp | 72 +- isis/tests/FunctionalTestsOverlapstats.cpp | 2 +- isis/tests/FunctionalTestsPds2isis.cpp | 188 +-- isis/tests/FunctionalTestsPhocube.cpp | 106 +- isis/tests/FunctionalTestsRingsautomos.cpp | 26 +- isis/tests/FunctionalTestsShadow.cpp | 2 +- isis/tests/FunctionalTestsSkypt.cpp | 4 +- isis/tests/FunctionalTestsSpiceinit.cpp | 30 +- isis/tests/FunctionalTestsSpiceserver.cpp | 20 +- isis/tests/FunctionalTestsSpkwriter.cpp | 4 +- isis/tests/FunctionalTestsStd2isis.cpp | 44 +- isis/tests/FunctionalTestsSumspice.cpp | 18 +- isis/tests/FunctionalTestsTagcams2isis.cpp | 136 +- isis/tests/FunctionalTestsTgocassis2isis.cpp | 166 +-- isis/tests/FunctionalTestsTgocassisstitch.cpp | 208 +-- .../FunctionalTestsTgocassisunstitch.cpp | 208 +-- isis/tests/FunctionalTestsThm2isis.cpp | 70 +- isis/tests/ImageImporterTests.cpp | 30 +- isis/tests/PvlToJSONTests.cpp | 72 +- isis/tests/TestUtilities.cpp | 59 +- isis/tests/TestUtilities.h | 6 + isis/tests/TgoCassisModuleTests.cpp | 130 +- isis/tests/statsTests.cpp | 22 +- 139 files changed, 4125 insertions(+), 4102 deletions(-) diff --git a/isis/src/messenger/apps/mdis2pds/main.cpp b/isis/src/messenger/apps/mdis2pds/main.cpp index ba934ca289..5542ab4864 100644 --- a/isis/src/messenger/apps/mdis2pds/main.cpp +++ b/isis/src/messenger/apps/mdis2pds/main.cpp @@ -47,10 +47,10 @@ inline void validateUnit(PvlKeyword &key, const QString &kunit) { for (int i = 0; i < temp.size(); i++) { try { // If this works, check unit, otherwise an exception is thrown - toDouble(temp[i]); - QString unit = temp.unit(i); + std::stod(temp[i]); + QString unit = QString::fromStdString(temp.unit(i)); if (unit.isEmpty()) unit = kunit; - key.addValue(temp[i], unit); + key.addValue(temp[i], unit.toStdString()); } catch (...) { key.addValue(temp[i]); @@ -60,8 +60,8 @@ inline void validateUnit(PvlKeyword &key, const QString &kunit) { } inline void fixUnit(PvlObject &obj, const QString &key, const QString &unit) { - if (obj.hasKeyword(key, PvlObject::Traverse)) { - validateUnit(obj.findKeyword(key, PvlObject::Traverse), unit); + if (obj.hasKeyword(key.toStdString(), PvlObject::Traverse)) { + validateUnit(obj.findKeyword(key.toStdString(), PvlObject::Traverse), unit); } return; } @@ -70,7 +70,7 @@ inline void fixQuotes(PvlContainer &kcont, const QString &value="N/A") { PvlContainer::PvlKeywordIterator kiter; for (kiter = kcont.begin(); kiter != kcont.end(); ++kiter) { for (int nv = 0; nv < kiter->size(); nv++) { - if ((*kiter)[nv] == value)(*kiter)[nv] = quote((*kiter)[nv]); + if (QString::fromStdString((*kiter)[nv]) == value)(*kiter)[nv] = quote(QString::fromStdString((*kiter)[nv])).toStdString(); } } } @@ -230,12 +230,12 @@ void IsisMain() { p.CheckStatus(); // Creates keywords from the input's hist above - PvlKeyword minDn("MINIMUM", toString(setRound(hist->Minimum(), 16))); - PvlKeyword maxDn("MAXIMUM", toString(setRound(hist->Maximum(), 16))); - PvlKeyword meanDn("MEAN", toString(setRound(hist->Average(), 16))); - PvlKeyword stddev("STANDARD_DEVIATION", toString(setRound(hist->StandardDeviation(), 16))); + PvlKeyword minDn("MINIMUM", std::to_string(setRound(hist->Minimum(), 16))); + PvlKeyword maxDn("MAXIMUM", std::to_string(setRound(hist->Maximum(), 16))); + PvlKeyword meanDn("MEAN", std::to_string(setRound(hist->Average(), 16))); + PvlKeyword stddev("STANDARD_DEVIATION", std::to_string(setRound(hist->StandardDeviation(), 16))); - PvlKeyword saturated("SATURATED_PIXEL_COUNT", toString(hist->HisPixels())); + PvlKeyword saturated("SATURATED_PIXEL_COUNT", std::to_string(hist->HisPixels())); PvlObject &imageObj = pdsLabel.findObject("IMAGE"); @@ -252,7 +252,7 @@ void IsisMain() { PvlKeyword &darkStripMean = imageObj.findKeyword("DARK_STRIP_MEAN"); try { - darkStripMean[0] = toString(setRound(toDouble(darkStripMean[0]), 16)); + darkStripMean[0] = std::to_string(setRound(std::stod(darkStripMean[0]), 16)); } catch (IException &) { // If we fail to convert this keyword to a number, then preserve @@ -266,32 +266,32 @@ void IsisMain() { // data set id PvlKeyword &dataSetIdKeyword = pdsLabel.findKeyword("DATA_SET_ID", Pvl::Traverse); - dataSetIdKeyword.setValue(dataSetID); + dataSetIdKeyword.setValue(dataSetID.toStdString()); // product id PvlKeyword &productIdKeyword = pdsLabel.findKeyword("PRODUCT_ID", Pvl::Traverse); if (productIdKeyword[0] == "N/A") { - productIdKeyword.setValue(output.baseName()); + productIdKeyword.setValue(output.baseName().toStdString()); } // product creation time PvlKeyword &productCreationTimeKeyword = pdsLabel.findKeyword("PRODUCT_CREATION_TIME", Pvl::Traverse); - productCreationTimeKeyword.setValue(mdis2pdsRuntime); + productCreationTimeKeyword.setValue(mdis2pdsRuntime.toStdString()); // software name PvlKeyword &softwareNameKeyword = pdsLabel.findKeyword("SOFTWARE_NAME", Pvl::Traverse); if (softwareNameKeyword[0] == "N/A") { - softwareNameKeyword.setValue(mdis2pdsProgram); + softwareNameKeyword.setValue(mdis2pdsProgram.toStdString()); } // software version id PvlKeyword &softwareVersionIdKeyword = pdsLabel.findKeyword("SOFTWARE_VERSION_ID", Pvl::Traverse); if (softwareVersionIdKeyword[0] == "N/A") { - softwareVersionIdKeyword.setValue(quote(mdis2pdsVersion)); + softwareVersionIdKeyword.setValue(quote(mdis2pdsVersion).toStdString()); } else { softwareVersionIdKeyword.setValue(softwareVersionIdKeyword[0]); @@ -301,7 +301,7 @@ void IsisMain() { PvlKeyword &filterNumberKeyword = pdsLabel.findKeyword("FILTER_NUMBER", Pvl::Traverse); if ((filterNumberKeyword.size() > 0)) { - filterNumberKeyword.setValue(quote(filterNumberKeyword[0])); + filterNumberKeyword.setValue(quote(QString::fromStdString(filterNumberKeyword[0])).toStdString()); } @@ -309,33 +309,33 @@ void IsisMain() { // data quality id PvlKeyword &dataQualityIdKeyword = pdsLabel.findKeyword("DATA_QUALITY_ID", Pvl::Traverse); - dataQualityIdKeyword.setValue(quote(dataQualityIdKeyword)); + dataQualityIdKeyword.setValue(quote(QString::fromStdString(dataQualityIdKeyword)).toStdString()); // sequence name PvlKeyword &sequenceNameKeyword = pdsLabel.findKeyword("SEQUENCE_NAME", Pvl::Traverse); - sequenceNameKeyword.setValue(quote(sequenceNameKeyword)); + sequenceNameKeyword.setValue(quote(QString::fromStdString(sequenceNameKeyword)).toStdString()); // spacecraft clock start count PvlKeyword &startCountKeyword = pdsLabel.findKeyword("SPACECRAFT_CLOCK_START_COUNT", Pvl::Traverse); - startCountKeyword.setValue(quote(startCountKeyword)); + startCountKeyword.setValue(quote(QString::fromStdString(startCountKeyword)).toStdString()); // spacecraft clock stop count PvlKeyword &stopCountKeyword = pdsLabel.findKeyword("SPACECRAFT_CLOCK_STOP_COUNT", Pvl::Traverse); - stopCountKeyword.setValue(quote(stopCountKeyword)); + stopCountKeyword.setValue(quote(QString::fromStdString(stopCountKeyword)).toStdString()); // site id PvlKeyword &siteIdKeyword = pdsLabel.findKeyword("SITE_ID", Pvl::Traverse); - siteIdKeyword.setValue(quote(siteIdKeyword)); + siteIdKeyword.setValue(quote(QString::fromStdString(siteIdKeyword)).toStdString()); // source product id PvlKeyword &sourceProductIdKeyword = pdsLabel.findKeyword("SOURCE_PRODUCT_ID", Pvl::Traverse); for (int i = 0; i < sourceProductIdKeyword.size(); i++) { - sourceProductIdKeyword[i] = quote(sourceProductIdKeyword[i]); + sourceProductIdKeyword[i] = quote(QString::fromStdString(sourceProductIdKeyword[i])).toStdString(); } // Enforce parentheses for scalars if (sourceProductIdKeyword.size() == 1) { @@ -360,8 +360,8 @@ void IsisMain() { for (int i = 1; i <= 5; i++) { QString n(toString(i)); QString group = "SUBFRAME" + n + "_PARAMETERS"; - if (pdsLabel.hasGroup(group)) { - PvlGroup &grp = pdsLabel.findGroup(group); + if (pdsLabel.hasGroup(group.toStdString())) { + PvlGroup &grp = pdsLabel.findGroup(group.toStdString()); validateUnit(grp.findKeyword("RETICLE_POINT_LATITUDE"), "DEG"); validateUnit(grp.findKeyword("RETICLE_POINT_LONGITUDE"), "DEG"); } diff --git a/isis/src/mro/apps/hifringe/main.cpp b/isis/src/mro/apps/hifringe/main.cpp index 24947c336a..a50f95cd70 100644 --- a/isis/src/mro/apps/hifringe/main.cpp +++ b/isis/src/mro/apps/hifringe/main.cpp @@ -178,7 +178,7 @@ void IsisMain() { Pvl outputPvl; PvlGroup sourceInfo("SourceInfo"); - sourceInfo += PvlKeyword("From", fromFile.expanded()); + sourceInfo += PvlKeyword("From", fromFile.expanded().toStdString()); sourceInfo += icube->group("Archive")["ProductId"]; outputPvl.addGroup(sourceInfo); if(numSections > 0) { @@ -193,34 +193,34 @@ void IsisMain() { outputPvl.addGroup(leftGroup); outputPvl.addGroup(rightGroup); } - outputPvl.write(ui.GetFileName("TO")); + outputPvl.write(ui.GetFileName("TO").toStdString()); } void pvlOut(Statistics stats1, Statistics stats2, QString name, int start, int end, PvlObject *one, PvlObject *two) { - PvlGroup left(name); - left += PvlKeyword("StartLine", toString(start + 1)); - left += PvlKeyword("EndLine", toString(end)); - left += PvlKeyword("TotalPixels", toString(stats1.TotalPixels())); - left += PvlKeyword("ValidPixels", toString(stats1.ValidPixels())); + PvlGroup left(name.toStdString()); + left += PvlKeyword("StartLine", std::to_string(start + 1)); + left += PvlKeyword("EndLine", std::to_string(end)); + left += PvlKeyword("TotalPixels", std::to_string(stats1.TotalPixels())); + left += PvlKeyword("ValidPixels", std::to_string(stats1.ValidPixels())); if(stats1.ValidPixels() > 0) { - left += PvlKeyword("Mean", toString(stats1.Average())); - left += PvlKeyword("StandardDeviation", toString(stats1.StandardDeviation())); - left += PvlKeyword("Minimum", toString(stats1.Minimum())); - left += PvlKeyword("Maximum", toString(stats1.Maximum())); + left += PvlKeyword("Mean", std::to_string(stats1.Average())); + left += PvlKeyword("StandardDeviation", std::to_string(stats1.StandardDeviation())); + left += PvlKeyword("Minimum", std::to_string(stats1.Minimum())); + left += PvlKeyword("Maximum", std::to_string(stats1.Maximum())); } one->addGroup(left); - PvlGroup right(name); - right += PvlKeyword("StartLine", toString(start + 1)); - right += PvlKeyword("EndLine", toString(end)); - right += PvlKeyword("TotalPixels", toString(stats2.TotalPixels())); - right += PvlKeyword("ValidPixels", toString(stats2.ValidPixels())); + PvlGroup right(name.toStdString()); + right += PvlKeyword("StartLine", std::to_string(start + 1)); + right += PvlKeyword("EndLine", std::to_string(end)); + right += PvlKeyword("TotalPixels", std::to_string(stats2.TotalPixels())); + right += PvlKeyword("ValidPixels", std::to_string(stats2.ValidPixels())); if(stats2.ValidPixels() > 0) { - right += PvlKeyword("Mean", toString(stats2.Average())); - right += PvlKeyword("StandardDeviation", toString(stats2.StandardDeviation())); - right += PvlKeyword("Minimum", toString(stats2.Minimum())); - right += PvlKeyword("Maximum", toString(stats2.Maximum())); + right += PvlKeyword("Mean", std::to_string(stats2.Average())); + right += PvlKeyword("StandardDeviation", std::to_string(stats2.StandardDeviation())); + right += PvlKeyword("Minimum", std::to_string(stats2.Minimum())); + right += PvlKeyword("Maximum", std::to_string(stats2.Maximum())); } two->addGroup(right); } diff --git a/isis/src/mro/apps/pds2hideal/main.cpp b/isis/src/mro/apps/pds2hideal/main.cpp index 6d1ade2ee8..f9c549a936 100644 --- a/isis/src/mro/apps/pds2hideal/main.cpp +++ b/isis/src/mro/apps/pds2hideal/main.cpp @@ -34,7 +34,7 @@ void IsisMain() { ProcessImportPds p; p.SetPdsFile(pdsLabelFile, "", pdsLabelPvl); - QString instId = pdsLabelPvl["INSTRUMENT_ID"][0]; + QString instId = QString::fromStdString(pdsLabelPvl["INSTRUMENT_ID"][0]); if(instId != "HIRISE_IDEAL_CAMERA") { QString msg = "Invalid PDS label [" + from.expanded() + "]. The PDS product" " must be from an Ideal camera model derived from a HiRISE" @@ -59,7 +59,7 @@ void IsisMain() { outputCube->putGroup(otherGroups.findGroup("Archive")); PvlGroup kernelGroup("Kernels"); - kernelGroup += PvlKeyword("NaifIkCode", toString(-74699)); + kernelGroup += PvlKeyword("NaifIkCode", std::to_string(-74699)); kernelGroup += PvlKeyword("TargetPosition", "Table"); kernelGroup += PvlKeyword("InstrumentPointing", "Table"); kernelGroup += PvlKeyword("InstrumentPosition", "Table"); @@ -67,8 +67,8 @@ void IsisMain() { if (!shapeModelPath.endsWith('/')) { shapeModelPath += "/"; } - QString shapeModelValue = shapeModelPath + pdsLabelPvl["SHAPE_MODEL"][0]; - kernelGroup += PvlKeyword("ShapeModel", shapeModelValue); + QString shapeModelValue = shapeModelPath + QString::fromStdString(pdsLabelPvl["SHAPE_MODEL"][0]); + kernelGroup += PvlKeyword("ShapeModel", shapeModelValue.toStdString()); outputCube->putGroup(kernelGroup); @@ -79,9 +79,9 @@ void IsisMain() { PvlObject &naifKeywords = isisLabel->findObject("NaifKeywords"); PvlKeyword bodyRadii("BODY499_RADII"); - bodyRadii.addValue(QString(pdsLabelPvl["A_AXIS_RADIUS"])); - bodyRadii.addValue(QString(pdsLabelPvl["B_AXIS_RADIUS"])); - bodyRadii.addValue(QString(pdsLabelPvl["C_AXIS_RADIUS"])); + bodyRadii.addValue(pdsLabelPvl["A_AXIS_RADIUS"]); + bodyRadii.addValue(pdsLabelPvl["B_AXIS_RADIUS"]); + bodyRadii.addValue(pdsLabelPvl["C_AXIS_RADIUS"]); naifKeywords += bodyRadii; PvlObject &isisCubeObject = isisLabel->findObject("IsisCube"); @@ -89,7 +89,7 @@ void IsisMain() { QString sfname = "Isis " + Application::Version() + " " + Application::GetUserInterface().ProgramName(); PvlGroup &archiveGroup = isisCubeObject.findGroup("Archive"); - archiveGroup += PvlKeyword("SOFTWARE_NAME", sfname); + archiveGroup += PvlKeyword("SOFTWARE_NAME", sfname.toStdString()); PvlObject &pdsImageObj = pdsLabelPvl.findObject("IMAGE"); double samples = double(pdsImageObj["LINE_SAMPLES"]); @@ -101,14 +101,14 @@ void IsisMain() { if (sourceLines != lines) { // this image is cropped, create an AlphaCube group PvlGroup alphaCube("AlphaCube"); - alphaCube += PvlKeyword("AlphaSamples", toString(sourceSamps)); - alphaCube += PvlKeyword("AlphaLines", toString(sourceLines)); - alphaCube += PvlKeyword("AlphaStartingSample", toString(firstSamp)); - alphaCube += PvlKeyword("AlphaEndingSample", toString((double) firstSamp + samples)); - alphaCube += PvlKeyword("AlphaStartingLine", toString(firstLine)); - alphaCube += PvlKeyword("AlphaEndingLine", toString((double) firstLine + lines)); - alphaCube += PvlKeyword("BetaSamples", toString(samples)); - alphaCube += PvlKeyword("BetaLines", toString(lines)); + alphaCube += PvlKeyword("AlphaSamples", std::to_string(sourceSamps)); + alphaCube += PvlKeyword("AlphaLines", std::to_string(sourceLines)); + alphaCube += PvlKeyword("AlphaStartingSample", std::to_string(firstSamp)); + alphaCube += PvlKeyword("AlphaEndingSample", std::to_string((double) firstSamp + samples)); + alphaCube += PvlKeyword("AlphaStartingLine", std::to_string(firstLine)); + alphaCube += PvlKeyword("AlphaEndingLine", std::to_string((double) firstLine + lines)); + alphaCube += PvlKeyword("BetaSamples", std::to_string(samples)); + alphaCube += PvlKeyword("BetaLines", std::to_string(lines)); isisCubeObject += alphaCube; } @@ -129,7 +129,7 @@ void addTableKeywords(Pvl *isisLabel, Pvl pdsLabelPvl) { for (int i = 0; i < isisLabel->objects(); i++) { if (isisLabel->object(i).name() == "Table") { PvlKeyword keyword; - if (QString(isisLabel->object(i)["Name"]) == "InstrumentPointing") { + if (QString::fromStdString((isisLabel->object(i)["Name"])) == "InstrumentPointing") { keyword = pdsLabelPvl.findObject("INSTRUMENT_POINTING_TABLE")["TIME_DEPENDENT_FRAMES"]; keyword.setName("TimeDependentFrames"); isisLabel->object(i) += keyword; @@ -149,7 +149,7 @@ void addTableKeywords(Pvl *isisLabel, Pvl pdsLabelPvl) { keyword.setName("CkTableOriginalSize"); isisLabel->object(i) += keyword; } - if (QString(isisLabel->object(i)["Name"]) == "InstrumentPosition") { + if (QString::fromStdString((isisLabel->object(i)["Name"])) == "InstrumentPosition") { keyword = pdsLabelPvl.findObject("INSTRUMENT_POSITION_TABLE")["CACHE_TYPE"]; keyword.setName("CacheType"); isisLabel->object(i) += keyword; @@ -163,7 +163,7 @@ void addTableKeywords(Pvl *isisLabel, Pvl pdsLabelPvl) { keyword.setName("SpkTableOriginalSize"); isisLabel->object(i) += keyword; } - if (QString(isisLabel->object(i)["Name"]) == "BodyRotation") { + if (QString::fromStdString((isisLabel->object(i)["Name"])) == "BodyRotation") { keyword = pdsLabelPvl.findObject("BODY_ROTATION_TABLE")["TIME_DEPENDENT_FRAMES"]; keyword.setName("TimeDependentFrames"); isisLabel->object(i) += keyword; @@ -180,7 +180,7 @@ void addTableKeywords(Pvl *isisLabel, Pvl pdsLabelPvl) { keyword.setName("SolarLongitude"); isisLabel->object(i) += keyword; } - if (QString(isisLabel->object(i)["Name"]) == "SunPosition") { + if (QString::fromStdString((isisLabel->object(i)["Name"])) == "SunPosition") { keyword = pdsLabelPvl.findObject("SUN_POSITION_TABLE")["CACHE_TYPE"]; keyword.setName("CacheType"); isisLabel->object(i) += keyword; diff --git a/isis/src/near/objs/MsiCamera/MsiCamera.cpp b/isis/src/near/objs/MsiCamera/MsiCamera.cpp index bb163993b5..d0ba4feec0 100644 --- a/isis/src/near/objs/MsiCamera/MsiCamera.cpp +++ b/isis/src/near/objs/MsiCamera/MsiCamera.cpp @@ -58,7 +58,7 @@ namespace Isis { // version of the msi2isis ensure updates by sumspice work // properly - ie., SpacecraftClockStartCount must be valid. // KJB/UA 2019-08-25 - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); stime.remove('.'); // Backward compatability!! iTime etStart = getClockTime(stime); diff --git a/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp b/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp index c16c448aab..7328c38206 100644 --- a/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp +++ b/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp @@ -48,8 +48,8 @@ namespace Isis { else if (mainLabel["MISSION"][0] != "New Horizons" || mainLabel["INSTRU"][0] != "lei") { QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " "file. Input file label value for MISSION is [%2], INSTRU is [%3]"). - arg(ui.GetFileName("FROM")).arg(mainLabel["MISSION"][0]). - arg(mainLabel["INSTRU"][0]); + arg(ui.GetFileName("FROM")).arg(QString::fromStdString(mainLabel["MISSION"][0])). + arg(QString::fromStdString(mainLabel["INSTRU"][0])); throw IException(IException::User, msg, _FILEINFO_); } @@ -188,10 +188,10 @@ namespace Isis { PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); //Add StartTime & EndTime - QString midTimeStr = archive["MidObservationTime"]; + QString midTimeStr = QString::fromStdString(archive["MidObservationTime"]); iTime midTime(midTimeStr.toDouble()); - QString obsDuration = archive["ObservationDuration"]; + QString obsDuration = QString::fromStdString(archive["ObservationDuration"]); double obsSeconds = obsDuration.toDouble(); iTime startTime = midTime - obsSeconds/2.0; iTime endTime = midTime + obsSeconds/2.0; @@ -199,12 +199,12 @@ namespace Isis { // inst.addKeyword(PvlKeyword("StopTime", endTime.EtString()), PvlGroup::Replace); //Need to make sure these times are correct. UTC != ET - inst.addKeyword(PvlKeyword("StartTime", startTime.UTC()), PvlGroup::Replace); - inst.addKeyword(PvlKeyword("StopTime", endTime.UTC()), PvlGroup::Replace); + inst.addKeyword(PvlKeyword("StartTime", startTime.UTC().toStdString()), PvlGroup::Replace); + inst.addKeyword(PvlKeyword("StopTime", endTime.UTC().toStdString()), PvlGroup::Replace); - QString exposureTime = inst["ExposureDuration"]; + QString exposureTime = QString::fromStdString(inst["ExposureDuration"]); double frameRate = 1.0/exposureTime.toDouble(); - inst.addKeyword(PvlKeyword("FrameRate", QString::number(frameRate)), PvlGroup::Replace); + inst.addKeyword(PvlKeyword("FrameRate", std::to_string(frameRate)), PvlGroup::Replace); inst.findKeyword("FrameRate").setUnits("Hz"); // Save the input FITS label in the Cube original labels diff --git a/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp b/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp index b2e343da9a..d12ecb8dda 100644 --- a/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp +++ b/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp @@ -37,7 +37,7 @@ namespace Isis { if (mainLabel["MISSION"][0] != "New Horizons" || mainLabel["INSTRU"][0] != "lor") { QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LORRI FITS " "file. Input file label value for MISSION is [%2] and INSTRU is [%3]"). - arg(ui.GetFileName("FROM")).arg(mainLabel["MISSION"][0]).arg(mainLabel["INSTRU"][0]); + arg(ui.GetFileName("FROM")).arg(QString::fromStdString(mainLabel["MISSION"][0])).arg(QString::fromStdString(mainLabel["INSTRU"][0])); throw IException(IException::User, msg, _FILEINFO_); } @@ -47,7 +47,7 @@ namespace Isis { if (errorLabel["XTENSION"][0] != "IMAGE" || errorLabel["EXTNAME"][0] != "LORRI Error image") { QString msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Error image. " "Input file label value for EXTNAME is [%2] and XTENSION is [%3]"). - arg(ui.GetFileName("FROM")).arg(errorLabel["EXTNAME"][0]).arg(errorLabel["XTENSION"][0]); + arg(ui.GetFileName("FROM")).arg(QString::fromStdString(errorLabel["EXTNAME"][0])).arg(QString::fromStdString(errorLabel["XTENSION"][0])); throw IException(IException::User, msg, _FILEINFO_); } } @@ -59,7 +59,7 @@ namespace Isis { qualityLabel["EXTNAME"][0] != "LORRI Quality flag image") { QString msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Quality image. " "Input file label value for EXTNAME is [%2] and XTENSION is [%3]"). - arg(ui.GetFileName("FROM")).arg(qualityLabel["EXTNAME"][0]).arg(qualityLabel["XTENSION"][0]); + arg(ui.GetFileName("FROM")).arg(QString::fromStdString(qualityLabel["EXTNAME"][0])).arg(QString::fromStdString(qualityLabel["XTENSION"][0])); throw IException(IException::User, msg, _FILEINFO_); } } @@ -86,7 +86,7 @@ namespace Isis { // Modify/add Instument group keywords not handled by the translater PvlGroup &inst = outLabel.findGroup("Instrument", Pvl::Traverse); - QString target = (QString)inst["TargetName"]; + QString target = QString::fromStdString(inst["TargetName"]); if (target.startsWith("RADEC=")) { inst.addKeyword(PvlKeyword("TargetName", "Sky"), PvlGroup::Replace); } diff --git a/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp b/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp index bb1d8739de..66b90bc39c 100644 --- a/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp +++ b/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp @@ -44,8 +44,8 @@ namespace Isis { bool mvic = true; if (primaryLabel.hasKeyword("MISSION", Pvl::Traverse) && primaryLabel.hasKeyword("INSTRU", Pvl::Traverse)) { - QString mission = primaryLabel.findKeyword("MISSION", Pvl::Traverse); - QString instrument = primaryLabel.findKeyword("INSTRU", Pvl::Traverse); + QString mission = QString::fromStdString(primaryLabel.findKeyword("MISSION", Pvl::Traverse)); + QString instrument = QString::fromStdString(primaryLabel.findKeyword("INSTRU", Pvl::Traverse)); if (!mission.contains("New Horizons")) { mvic = false; } @@ -70,7 +70,7 @@ namespace Isis { if (ui.WasEntered("UNDISTORTED")) { PvlGroup undistortedLabel = importFits.fitsImageLabel(1); if (!undistortedLabel.hasKeyword("COMMENT") || - !undistortedLabel["COMMENT"][0].startsWith("This is the bias-subtracted, " + !QString::fromStdString(undistortedLabel["COMMENT"][0]).startsWith("This is the bias-subtracted, " "flattened, distortion-removed image cube.")) { QString msg = QObject::tr("Input file [%1] does not appear to contain an MVIC undistorted " @@ -106,7 +106,7 @@ namespace Isis { } // Convert the primary image - QString bitpix = primaryLabel.findKeyword("BITPIX", Pvl::Traverse); + QString bitpix = QString::fromStdString(primaryLabel.findKeyword("BITPIX", Pvl::Traverse)); int bytesPerPix = abs(toInt(bitpix)) / 8; importFits.SetDataPrefixBytes(bytesPerPix * 12); importFits.SetDataSuffixBytes(bytesPerPix * 12); @@ -133,7 +133,7 @@ namespace Isis { if (ui.WasEntered("UNDISTORTED")) { PvlGroup undistortedLabel = importFits.fitsImageLabel(1); - QString bitpix = undistortedLabel.findKeyword("BITPIX"); + QString bitpix = QString::fromStdString(undistortedLabel.findKeyword("BITPIX")); int bytesPerPix = abs(toInt(bitpix)) / 8; importFits.SetDataPrefixBytes(bytesPerPix * 12); importFits.SetDataSuffixBytes(bytesPerPix * 12); @@ -158,7 +158,7 @@ namespace Isis { if (ui.WasEntered("ERROR")) { // Get the label of the Error image and make sure this is a New Horizons MVIC Error image PvlGroup errorLabel = importFits.fitsImageLabel(2); - QString bitpix = errorLabel.findKeyword("BITPIX"); + QString bitpix = QString::fromStdString(errorLabel.findKeyword("BITPIX")); int bytesPerPix = abs(toInt(bitpix)) / 8; importFits.SetDataPrefixBytes(bytesPerPix * 12); importFits.SetDataSuffixBytes(bytesPerPix * 12); @@ -183,7 +183,7 @@ namespace Isis { if (ui.WasEntered("QUALITY")) { // Get the label of the Error image and make sure this is a New Horizons MVIC Quality image PvlGroup qualityLabel = importFits.fitsImageLabel(3); - QString bitpix = qualityLabel.findKeyword("BITPIX"); + QString bitpix = QString::fromStdString(qualityLabel.findKeyword("BITPIX")); int bytesPerPix = abs(toInt(bitpix)) / 8; importFits.SetDataPrefixBytes(bytesPerPix * 12); importFits.SetDataSuffixBytes(bytesPerPix * 12); @@ -218,13 +218,13 @@ namespace Isis { // Modify/add Instument group keywords not handled by the translater PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - QString instId = (QString)inst["InstrumentId"]; - QString scanType = (QString)inst["ScanType"]; + QString instId = QString::fromStdString(inst["InstrumentId"]); + QString scanType = QString::fromStdString(inst["ScanType"]); instId = instId + "_" + scanType; - inst.addKeyword(PvlKeyword("InstrumentId", instId), PvlGroup::Replace); + inst.addKeyword(PvlKeyword("InstrumentId", instId.toStdString()), PvlGroup::Replace); // Not tested because we didn't have any files that do this at the time the test were done - QString target = (QString)inst["TargetName"]; + QString target = QString::fromStdString(inst["TargetName"]); if (target.startsWith("RADEC=")) { inst.addKeyword(PvlKeyword("TargetName", "Sky"), PvlGroup::Replace); } @@ -257,12 +257,12 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } - QString scTime = inst["SpacecraftClockStartCount"]; + QString scTime = QString::fromStdString(inst["SpacecraftClockStartCount"]); double et; scs2e_c(sclkCode, scTime.toLatin1().data(), &et); SpiceChar utc[30]; et2utc_c(et, "ISOC", 3, 30, utc); - inst.addKeyword(PvlKeyword("StartTime", QString(utc))); + inst.addKeyword(PvlKeyword("StartTime", utc)); // Create a Band Bin group FileName bandTransFile(transDir + "NewHorizonsMvicBandBin_fit.trn"); @@ -280,17 +280,17 @@ namespace Isis { // band. Also, add BandStartTime if (scanType.contains("FRAMING")) { PvlGroup &bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - QString name = bandBin.findKeyword("Name")[0]; - QString center = QString(bandBin.findKeyword("Center")[0]); - QString width = QString(bandBin.findKeyword("Width")[0]); + QString name = QString::fromStdString(bandBin.findKeyword("Name")[0]); + QString center = QString::fromStdString(bandBin.findKeyword("Center")[0]); + QString width = QString::fromStdString(bandBin.findKeyword("Width")[0]); for (int i = 1; i < ocube->bandCount(); i++) { - bandBin.findKeyword("Name").addValue(name); - bandBin.findKeyword("Center").addValue(center, "nanometers"); - bandBin.findKeyword("Width").addValue(width, "nanometers"); - bandBin.findKeyword("OriginalBand").addValue(QString::number(i+1)); + bandBin.findKeyword("Name").addValue(name.toStdString()); + bandBin.findKeyword("Center").addValue(center.toStdString(), "nanometers"); + bandBin.findKeyword("Width").addValue(width.toStdString(), "nanometers"); + bandBin.findKeyword("OriginalBand").addValue(std::to_string(i+1)); QString fitsKey = QString("UTCMID%1").arg(i, 2, 10, QChar('0')); - QString fitsVal = fitslabel.findKeyword(fitsKey, Pvl::Traverse); - bandBin.findKeyword("UtcTime").addValue(fitsVal); + QString fitsVal = QString::fromStdString(fitslabel.findKeyword(fitsKey.toStdString(), Pvl::Traverse)); + bandBin.findKeyword("UtcTime").addValue(fitsVal.toStdString()); } } diff --git a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp index 52eafb7e19..c632e393ff 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp @@ -50,9 +50,9 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString expDuration = inst["ExposureDuration"]; + QString expDuration = QString::fromStdString(inst["ExposureDuration"]); - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); double m_etStart = getClockTime(stime).Et(); // The line rate is set to the time between each frame since we are treating LEASA as a linescan @@ -91,7 +91,7 @@ namespace Isis { PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse); PvlKeyword &orgBand = bandBin["OriginalBand"]; for (int i = 0; i < orgBand.size(); i++) { - m_originalBand.append(toInt(orgBand[i])); + m_originalBand.append(std::stoi(orgBand[i])); } // Use the defualt no correction distortion map. diff --git a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp index b115e1e167..4e9ef5bf23 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp @@ -101,7 +101,7 @@ namespace Isis { // The observation start time and clock count for LORRI are based on the center of the exposure. Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString clockCount = inst["SpacecraftClockStartCount"]; + QString clockCount = QString::fromStdString(inst["SpacecraftClockStartCount"]); double et = getClockTime(clockCount).Et(); double exposureDuration = (double)inst["ExposureDuration"] / 1000.0; diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp index c0b2beeb85..72b8db40e5 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp @@ -53,7 +53,7 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); m_exposure = inst["ExposureDuration"]; - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); // ** TODO ** Need an offset time added to labels at ingestion?? The 0.125 value is // the value in DELTAT00. double offset = 0.125; @@ -70,8 +70,8 @@ namespace Isis { PvlKeyword &origBand = bandBin["OriginalBand"]; PvlKeyword &utcTime = bandBin["UtcTime"]; for(int i = 0; i < origBand.size(); i++) { - m_originalBand.push_back(toInt(origBand[i])); - m_utcTime.push_back(utcTime[i]); + m_originalBand.push_back(std::stoi(origBand[i])); + m_utcTime.push_back(QString::fromStdString(utcTime[i])); } CameraDetectorMap *detectorMap = new CameraDetectorMap(this); diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/NewHorizonsMvicTdiCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/NewHorizonsMvicTdiCamera.cpp index 29c2d6040a..3e55c941c4 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/NewHorizonsMvicTdiCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/NewHorizonsMvicTdiCamera.cpp @@ -43,7 +43,7 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockStartCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); m_etStart = getClockTime(stime).Et(); m_lineRate = 1.0 / (double)inst["TdiRate"]; diff --git a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp index 02f766a470..c22208a5f0 100644 --- a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp +++ b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp @@ -34,10 +34,10 @@ namespace Isis { // Make sure it is a Themis EDR/RDR bool projected; try { - Pvl lab(in.expanded()); + Pvl lab(in.expanded().toStdString()); projected = lab.hasObject("IMAGE_MAP_PROJECTION"); QString id; - id = (QString)lab["DATA_SET_ID"]; + id = QString::fromStdString(lab["DATA_SET_ID"]); id = id.simplified().trimmed(); if(!id.startsWith("ODY-M-THM")) { QString msg = "Invalid DATA_SET_ID [" + id + "]"; @@ -72,7 +72,7 @@ namespace Isis { PvlGroup &inst = isis3Lab.findGroup("Instrument", Pvl::Traverse); CubeAttributeOutput outAttr = ui.GetOutputAttribute("to"); - if((QString)inst["InstrumentId"] == "THEMIS_VIS") { + if(QString::fromStdString(inst["InstrumentId"]) == "THEMIS_VIS") { Cube *even = new Cube(); Cube *odd = new Cube(); @@ -109,12 +109,12 @@ namespace Isis { if(outputCubes.size() != 1) { int numFramelets = p.Lines() / frameletLines; isis3Lab.findGroup("Instrument").addKeyword( - PvlKeyword("NumFramelets", toString(numFramelets)), Pvl::Replace + PvlKeyword("NumFramelets", std::to_string(numFramelets)), Pvl::Replace ); QString frameletType = ((i == 0) ? "Odd" : "Even"); isis3Lab.findGroup("Instrument").addKeyword( - PvlKeyword("Framelets", frameletType), Pvl::Replace + PvlKeyword("Framelets", frameletType.toStdString()), Pvl::Replace ); } @@ -161,37 +161,35 @@ namespace Isis { // Create the Instrument Group PvlGroup inst("Instrument"); inst += PvlKeyword("SpacecraftName", "MARS_ODYSSEY"); - QString instId = (QString) pdsLab["InstrumentId"] + "_" + - (QString) pdsLab["DetectorId"]; - inst += PvlKeyword("InstrumentId", instId); - inst += PvlKeyword("TargetName", (QString) pdsLab["TargetName"]); - inst += PvlKeyword("MissionPhaseName", (QString) pdsLab["MissionPhaseName"]); - inst += PvlKeyword("StartTime", (QString)pdsLab["StartTime"]); - inst += PvlKeyword("StopTime", (QString)pdsLab["StopTime"]); - inst += PvlKeyword("SpacecraftClockCount", - (QString) pdsLab["SpacecraftClockStartCount"]); + QString instId = QString::fromStdString(pdsLab["InstrumentId"]) + "_" + QString::fromStdString(pdsLab["DetectorId"]); + inst += PvlKeyword("InstrumentId", instId.toStdString()); + inst += PvlKeyword("TargetName", pdsLab["TargetName"]); + inst += PvlKeyword("MissionPhaseName", pdsLab["MissionPhaseName"]); + inst += PvlKeyword("StartTime", pdsLab["StartTime"]); + inst += PvlKeyword("StopTime", pdsLab["StopTime"]); + inst += PvlKeyword("SpacecraftClockCount", pdsLab["SpacecraftClockStartCount"]); PvlObject &sqube = pdsLab.findObject("SPECTRAL_QUBE"); if(instId == "THEMIS_IR") { - inst += PvlKeyword("GainNumber", (QString)sqube["GainNumber"]); - inst += PvlKeyword("OffsetNumber", (QString)sqube["OffsetNumber"]); - inst += PvlKeyword("MissingScanLines", (QString)sqube["MissingScanLines"]); + inst += PvlKeyword("GainNumber", sqube["GainNumber"]); + inst += PvlKeyword("OffsetNumber", sqube["OffsetNumber"]); + inst += PvlKeyword("MissingScanLines", sqube["MissingScanLines"]); inst += PvlKeyword("TimeDelayIntegration", - (QString)sqube["TimeDelayIntegrationFlag"]); + sqube["TimeDelayIntegrationFlag"]); if(sqube.hasKeyword("SpatialSumming")) { - inst += PvlKeyword("SpatialSumming", (QString)sqube["SpatialSumming"]); + inst += PvlKeyword("SpatialSumming", sqube["SpatialSumming"]); } } else { - inst += PvlKeyword("ExposureDuration", (QString)sqube["ExposureDuration"]); - inst += PvlKeyword("InterframeDelay", (QString)sqube["InterframeDelay"]); - inst += PvlKeyword("SpatialSumming", (QString)sqube["SpatialSumming"]); + inst += PvlKeyword("ExposureDuration", sqube["ExposureDuration"]); + inst += PvlKeyword("InterframeDelay", sqube["InterframeDelay"]); + inst += PvlKeyword("SpatialSumming", sqube["SpatialSumming"]); } // Add at time offset to the Instrument group double spacecraftClockOffset = ui.GetDouble("TIMEOFFSET"); - inst += PvlKeyword("SpacecraftClockOffset", toString(spacecraftClockOffset), "seconds"); + inst += PvlKeyword("SpacecraftClockOffset", std::to_string(spacecraftClockOffset), "seconds"); isis3.addGroup(inst); @@ -236,29 +234,29 @@ namespace Isis { // Create the archive Group PvlGroup arch("Archive"); - arch += PvlKeyword("DataSetId", (QString)pdsLab["DataSetId"]); - arch += PvlKeyword("ProducerId", (QString)pdsLab["ProducerId"]); - arch += PvlKeyword("ProductId", (QString)pdsLab["ProductId"]); + arch += PvlKeyword("DataSetId", pdsLab["DataSetId"]); + arch += PvlKeyword("ProducerId", pdsLab["ProducerId"]); + arch += PvlKeyword("ProductId", pdsLab["ProductId"]); arch += PvlKeyword("ProductCreationTime", - (QString)pdsLab["ProductCreationTime"]); - arch += PvlKeyword("ProductVersionId", (QString)pdsLab["ProductVersionId"]); + pdsLab["ProductCreationTime"]); + arch += PvlKeyword("ProductVersionId", pdsLab["ProductVersionId"]); // arch += PvlKeyword("ReleaseId",(string)pdsLab["ReleaseId"]); - arch += PvlKeyword("OrbitNumber", (QString)pdsLab["OrbitNumber"]); + arch += PvlKeyword("OrbitNumber", pdsLab["OrbitNumber"]); arch += PvlKeyword("FlightSoftwareVersionId", - (QString)sqube["FlightSoftwareVersionId"]); + sqube["FlightSoftwareVersionId"]); arch += PvlKeyword("CommandSequenceNumber", - (QString)sqube["CommandSequenceNumber"]); - arch += PvlKeyword("Description", (QString)sqube["Description"]); + sqube["CommandSequenceNumber"]); + arch += PvlKeyword("Description", sqube["Description"]); isis3.addGroup(arch); // Create the Kernel Group PvlGroup kerns("Kernels"); if(instId == "THEMIS_IR") { - kerns += PvlKeyword("NaifFrameCode", toString(-53031)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-53031)); } else { - kerns += PvlKeyword("NaifFrameCode", toString(-53032)); + kerns += PvlKeyword("NaifFrameCode", std::to_string(-53032)); } isis3.addGroup(kerns); } diff --git a/isis/src/odyssey/apps/thmbasemap1/main.cpp b/isis/src/odyssey/apps/thmbasemap1/main.cpp index 8e8a12e8f9..6611599096 100644 --- a/isis/src/odyssey/apps/thmbasemap1/main.cpp +++ b/isis/src/odyssey/apps/thmbasemap1/main.cpp @@ -34,7 +34,7 @@ void IsisMain(){ // Input file options FileList cubes; Pvl &pref = Preference::Preferences(); - QString pathName = (QString)pref.findGroup("DataDirectory")["Temporary"] + "/"; + QString pathName = QString::fromStdString(pref.findGroup("DataDirectory")["Temporary"]) + "/"; if (ui.WasEntered("TOPATH")) { pathName = (QString)ui.GetString("TOPATH") + "/"; } @@ -161,7 +161,7 @@ void IsisMain(){ continue; } - Pvl lab(inFileStr); + Pvl lab(inFileStr.toStdString()); // Exit if not Themis image IString instrumentID = IString(lab["INSTRUMENT_ID"][0]); @@ -187,7 +187,7 @@ void IsisMain(){ pdsSanFile = true; } - QString duration =(QString)lab.findObject("SPECTRAL_QUBE",Isis::PvlObject::Traverse)["IMAGE_DURATION"]; + QString duration =QString::fromStdString(lab.findObject("SPECTRAL_QUBE",Isis::PvlObject::Traverse)["IMAGE_DURATION"]); // Make sure we have THEMIS IR at wavelength 12.57. // 12.57um wavelength has the best signal to noise ratio, and 14.88um wavelenght is atmospheric band @@ -225,11 +225,11 @@ void IsisMain(){ parameters = "FROM=" + input + " CKRECON=yes CKPREDICTED=yes CKNADIR=yes"; ProgramLauncher::RunIsisProgram("spiceinit", parameters); if (reportNadirSpc) { - Pvl spclab(input); + Pvl spclab(input.toStdString()); PvlGroup kernels = spclab.findGroup("Kernels", Pvl::Traverse); bool isNadir = false; for (int j=0; j < kernels["InstrumentPointing"].size(); j++) { - if (kernels["InstrumentPointing"][j].toUpper() == "NADIR") { + if (QString::fromStdString(kernels["InstrumentPointing"][j]).toUpper() == "NADIR") { isNadir = true; } } @@ -247,7 +247,7 @@ void IsisMain(){ parameters = "FROM=" + input + " TO=" + tempstat1 + " linc = 100 sinc = 100"; ProgramLauncher::RunIsisProgram("camstats", parameters); Pvl p1; - p1.read(tempstat1); + p1.read(tempstat1.toStdString()); double incAngle =p1.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceMinimum"]; // if do not process night and incidence angle > 90, then exit @@ -349,9 +349,9 @@ void IsisMain(){ " TO=" + tempgaps + " APPEND=no"; ProgramLauncher::RunIsisProgram("stats", parameters); Pvl tg; - tg.read(tempgaps); - QString totalpixels = tg.findGroup("Results",Pvl::Traverse)["TotalPixels"]; - QString validpixels = tg.findGroup("Results",Pvl::Traverse)["ValidPixels"]; + tg.read(tempgaps.toStdString()); + QString totalpixels = QString::fromStdString(tg.findGroup("Results",Pvl::Traverse)["TotalPixels"]); + QString validpixels = QString::fromStdString(tg.findGroup("Results",Pvl::Traverse)["ValidPixels"]); //if (tg.hasGroup("Gap")) { if (IString(totalpixels).ToInteger() != IString(validpixels).ToInteger()) { cout << tg << endl; @@ -373,16 +373,16 @@ void IsisMain(){ ProgramLauncher::RunIsisProgram("camstats", parameters); Pvl p2; - p2.read(tempstat2); - QString incavg = p2.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceAverage"]; - QString resavg = p2.findGroup("Resolution",Pvl::Traverse)["ResolutionAverage"]; - QString incmin = p2.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceMinimum"]; - QString incmax = p2.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceMaximum"]; + p2.read(tempstat2.toStdString()); + QString incavg = QString::fromStdString(p2.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceAverage"]); + QString resavg = QString::fromStdString(p2.findGroup("Resolution",Pvl::Traverse)["ResolutionAverage"]); + QString incmin = QString::fromStdString(p2.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceMinimum"]); + QString incmax = QString::fromStdString(p2.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceMaximum"]); remove (tstat2.expanded().toLatin1().data()); double summing = 1; FileName tosum = FileName(outFile); - Pvl sumlab(tosum.expanded()); + Pvl sumlab(tosum.expanded().toStdString()); PvlGroup InstGrp = sumlab.findGroup("Instrument",Pvl::Traverse); if (InstGrp.hasKeyword("SpatialSumming")) { summing = InstGrp["SpatialSumming"]; diff --git a/isis/src/odyssey/apps/thmnoseam/main.cpp b/isis/src/odyssey/apps/thmnoseam/main.cpp index 0efbabef29..ae28cdffbe 100644 --- a/isis/src/odyssey/apps/thmnoseam/main.cpp +++ b/isis/src/odyssey/apps/thmnoseam/main.cpp @@ -133,7 +133,7 @@ void IsisMain() { PvlGroup &inputInstrumentGrp = evenCube->group("Instrument"); PvlKeyword &spatialSumming = inputInstrumentGrp["SpatialSumming"]; - frameletSize = 192 / toInt(spatialSumming[0]); + frameletSize = 192 / std::stoi(spatialSumming[0]); overlapSize = FrameletOverlapSize(); if(overlapSize == 0) { diff --git a/isis/src/odyssey/apps/thmproc/main.cpp b/isis/src/odyssey/apps/thmproc/main.cpp index d25c5da9f3..fa9bb90cd9 100644 --- a/isis/src/odyssey/apps/thmproc/main.cpp +++ b/isis/src/odyssey/apps/thmproc/main.cpp @@ -60,10 +60,10 @@ void IsisMain() { } } if(ui.GetBoolean("INGESTION")) { - Pvl labels(ui.GetFileName("FROM")); + Pvl labels(ui.GetFileName("FROM").toStdString()); - if((QString)labels["DETECTOR_ID"][0] == "VIS") { - if(((QString)labels["DATA_SET_ID"]).contains("RDR")) { + if(QString::fromStdString(labels["DETECTOR_ID"][0]) == "VIS") { + if((QString::fromStdString(labels["DATA_SET_ID"])).contains("RDR")) { ProcessVis(true); } else { diff --git a/isis/src/odyssey/apps/thmvisflat/main.cpp b/isis/src/odyssey/apps/thmvisflat/main.cpp index 64982a03bc..9e9046fab9 100644 --- a/isis/src/odyssey/apps/thmvisflat/main.cpp +++ b/isis/src/odyssey/apps/thmvisflat/main.cpp @@ -46,7 +46,7 @@ void IsisMain() { vector flatcubes; vector fcubeMgrs; - int summing = toInt(icube.group("Instrument")["SpatialSumming"][0]); + int summing = std::stoi(icube.group("Instrument")["SpatialSumming"][0]); for(int filt = 0; filt < 5; filt++) { QString filePattern = "$odyssey/calibration/flat_filter_"; @@ -79,7 +79,7 @@ void IsisMain() { PvlKeyword &filtNums = icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterNumber"]; for(int i = 0; i < filtNums.size(); i++) { - filter.push_back(toInt(filtNums[i])); + filter.push_back(std::stoi(filtNums[i])); } LineManager ocubeMgr(ocube); @@ -136,7 +136,7 @@ void IsisMain() { for(int o = 0; o < icube.label()->objects(); o++) { if(icube.label()->object(o).isNamed("Table")) { - Blob t(icube.label()->object(o)["Name"], + Blob t(QString::fromStdString(icube.label()->object(o)["Name"]), icube.label()->object(o).name()); icube.read(t); ocube.write(t); diff --git a/isis/src/odyssey/apps/thmvistrim/main.cpp b/isis/src/odyssey/apps/thmvistrim/main.cpp index f2db2867fd..d9b8208f72 100644 --- a/isis/src/odyssey/apps/thmvistrim/main.cpp +++ b/isis/src/odyssey/apps/thmvistrim/main.cpp @@ -50,7 +50,7 @@ void IsisMain() { p.SetOutputCube("TO"); - frameletSize = 192 / toInt(icube->group("Instrument")["SpatialSumming"][0]); + frameletSize = 192 / std::stoi(icube->group("Instrument")["SpatialSumming"][0]); frameletTopTrimSize = ui.GetInteger("TOPTRIM"); frameletLeftTrimSize = ui.GetInteger("LEFTTRIM"); frameletRightTrimSize = ui.GetInteger("RIGHTTRIM"); diff --git a/isis/src/odyssey/objs/ThemisIrCamera/ThemisIrCamera.cpp b/isis/src/odyssey/objs/ThemisIrCamera/ThemisIrCamera.cpp index 9ce6b033cd..ac9d743940 100644 --- a/isis/src/odyssey/objs/ThemisIrCamera/ThemisIrCamera.cpp +++ b/isis/src/odyssey/objs/ThemisIrCamera/ThemisIrCamera.cpp @@ -45,7 +45,7 @@ namespace Isis { // to handle a random timing errors which can be up to four pixels Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString stime = inst["SpacecraftClockCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockCount"]); p_etStart = getClockTime(stime).Et(); double offset = inst["SpacecraftClockOffset"]; @@ -57,7 +57,7 @@ namespace Isis { PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse); PvlKeyword &orgBand = bandBin["FilterNumber"]; for(int i = 0; i < orgBand.size(); i++) { - p_originalBand.push_back(toInt(orgBand[i])); + p_originalBand.push_back(std::stoi(orgBand[i])); } // Themis IR had a summing mode added. This directly affects the line @@ -74,7 +74,7 @@ namespace Isis { // If the TDI mode is enabled then 16 line in the detector are summed // to improve the SNR. In the SetBand method we will the TDI mode to // determine line offset for the band. - p_tdiMode = (QString) inst["TimeDelayIntegration"]; + p_tdiMode = QString::fromStdString(inst["TimeDelayIntegration"]); // The detector map tells us how to convert from image coordinates to // detector coordinates. In our case, a (sample,line) to a (sample,time) diff --git a/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp b/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp index d3ec4b8508..c589707e57 100644 --- a/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp +++ b/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp @@ -56,7 +56,7 @@ namespace Isis { // make sure it is a themis vis image if(inst["InstrumentId"][0] != "THEMIS_VIS") { QString msg = "Unable to create Themis VIS camera model from an image with InstrumentId [" - + inst["InstrumentId"][0] + "]."; + + QString::fromStdString(inst["InstrumentId"][0]) + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -67,7 +67,7 @@ namespace Isis { // Get the start and end time double et; - QString stime = inst["SpacecraftClockCount"]; + QString stime = QString::fromStdString(inst["SpacecraftClockCount"]); et = getClockTime(stime).Et(); double offset = inst["SpacecraftClockOffset"]; @@ -79,7 +79,7 @@ namespace Isis { PvlKeyword &filterNumbers = bandBin["FilterNumber"]; for (int i = 0; i < filterNumbers.size(); i++) { - p_filterNumber.append(toInt(filterNumbers[i])); + p_filterNumber.append(std::stoi(filterNumbers[i])); } diff --git a/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp b/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp index 2349d84955..e4926b18f9 100644 --- a/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp +++ b/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp @@ -68,7 +68,7 @@ namespace Isis { binning = (int) flabel.findKeyword("TCSSMPL", Pvl::Traverse); rawcamT = (int) flabel.findKeyword("TCCHTEMP", Pvl::Traverse); tcmode = (int) flabel.findKeyword("TCMODE", Pvl::Traverse); - instId = ((QString) flabel.findKeyword("INSTRUME", Pvl::Traverse)).simplified(); + instId = QString::fromStdString((flabel.findKeyword("INSTRUME", Pvl::Traverse))).simplified(); } catch (IException &ie) { QString msg = QObject::tr("Unable to retrieve expected TAGCAMS keywords." @@ -104,7 +104,7 @@ namespace Isis { // Compute the boundary pixels if present and requested. if ( removeCal && hasDark ) { - QString bitpix = flabel.findKeyword("BITPIX", Pvl::Traverse); + QString bitpix = QString::fromStdString(flabel.findKeyword("BITPIX", Pvl::Traverse)); int bytesPerPix = abs(toInt(bitpix)) / 8; importFits.SetDataHeaderBytes(bytesPerPix * ((54 * rawSamples) / pixScale)); importFits.SetDataPrefixBytes(bytesPerPix * (144 / pixScale)); @@ -153,11 +153,11 @@ namespace Isis { // Add product id which is just the filename base FileName from(ui.GetFileName("FROM")); QString prodid = from.baseName(); - archiveGrp.addKeyword(PvlKeyword("SourceProductId", prodid), archiveGrp.begin()); + archiveGrp.addKeyword(PvlKeyword("SourceProductId", prodid.toStdString()), archiveGrp.begin()); // Create YearDoy keyword in Archive group - iTime stime(instGrp["StartTime"][0]); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + iTime stime(QString::fromStdString(instGrp["StartTime"][0])); + PvlKeyword yeardoy("YearDoy", std::to_string(stime.Year()*1000 + stime.DayOfYear())); archiveGrp.addKeyword(yeardoy); output->putGroup(archiveGrp); @@ -166,10 +166,10 @@ namespace Isis { // something so the camera will always work if (instGrp.findKeyword("TargetName").isNull() || (!target.isEmpty())) { if (!target.isEmpty()) { - instGrp["TargetName"] = QString(target); + instGrp["TargetName"] = target.toStdString(); } else { - instGrp["TargetName"] = QString("Sky"); + instGrp["TargetName"] = "Sky"; } } @@ -181,7 +181,7 @@ namespace Isis { if ( "NFT" == instId ) b = -273.43; double camHeadTempC = a * ((double)rawcamT) + b; - instGrp.addKeyword(PvlKeyword("CameraHeadTemperature", toString(camHeadTempC), "celsius")); + instGrp.addKeyword(PvlKeyword("CameraHeadTemperature", std::to_string(camHeadTempC), "celsius")); output->putGroup(instGrp); // Create a Band Bin group diff --git a/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp b/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp index 836bdcf28a..a19e4e2086 100644 --- a/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp +++ b/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp @@ -65,9 +65,9 @@ namespace Isis { QString ikCode = toString(frameCode); if (inst.hasKeyword("PolyCamFocusPositionNaifId") && frameCode == -64360) { - if (QString::compare("NONE", inst["PolyCamFocusPositionNaifId"], + if (QString::compare("NONE", QString::fromStdString(inst["PolyCamFocusPositionNaifId"]), Qt::CaseInsensitive) != 0) { - ikCode = inst["PolyCamFocusPositionNaifId"][0]; + ikCode = QString::fromStdString(inst["PolyCamFocusPositionNaifId"][0]); } } @@ -80,7 +80,7 @@ namespace Isis { // Get the start time in et // Set the observation time and exposure duration - QString clockCount = inst["SpacecraftClockStartCount"]; + QString clockCount = QString::fromStdString(inst["SpacecraftClockStartCount"]); double startTime = getClockTime(clockCount).Et(); double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0; pair shuttertimes = ShutterOpenCloseTimes(startTime, exposureDuration); @@ -106,7 +106,7 @@ namespace Isis { // Different distortion model for each instrument and filter PvlGroup bandBin = lab.findGroup("BandBin", Pvl::Traverse); - QString filterName = bandBin["FilterName"]; + QString filterName = QString::fromStdString(bandBin["FilterName"]); distortionMap->SetDistortion(ikCode.toInt(), filterName); // Setup the ground and sky map diff --git a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp index edd85b5316..c46fcc26e2 100644 --- a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp +++ b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp @@ -78,7 +78,7 @@ namespace Isis { // Get the start time in et // Set the observation time and exposure duration - QString clockCount = inst["SpacecraftClockStartCount"]; + QString clockCount = QString::fromStdString(inst["SpacecraftClockStartCount"]); double startTime = getClockTime(clockCount).Et(); double exposureDuration = ((double) inst["ExposureDuration"]); pair shuttertimes = ShutterOpenCloseTimes(startTime, exposureDuration); diff --git a/isis/src/rolo/apps/rolo2isis/main.cpp b/isis/src/rolo/apps/rolo2isis/main.cpp index 4943b003cb..9a0357445e 100644 --- a/isis/src/rolo/apps/rolo2isis/main.cpp +++ b/isis/src/rolo/apps/rolo2isis/main.cpp @@ -28,7 +28,7 @@ void IsisMain() { QString transDir = "$ISISROOT/appdata/translations/"; - Pvl inputLabel(labelFile); + Pvl inputLabel(labelFile.toStdString()); Pvl outputLabel; PvlToPvlTranslationManager *translator; @@ -51,13 +51,13 @@ void IsisMain() { translator = new PvlToPvlTranslationManager(inputLabel, transFile.expanded()); translator->Auto(outputLabel); outputLabel.findGroup("BandBin").findKeyword("OriginalBand").setUnits( - translator->Translate("BandBinUnit")); + translator->Translate("BandBinUnit").toStdString()); outputLabel.findGroup("BandBin").findKeyword("Center").setUnits(translator-> - Translate("BandBinUnit")); + Translate("BandBinUnit").toStdString()); outputLabel.findGroup("BandBin").findKeyword("Width").setUnits(translator-> - Translate("BandBinUnit")); + Translate("BandBinUnit").toStdString()); outputLabel.findGroup("BandBin").findKeyword("Exposure").setUnits(translator-> - Translate("ExposureUnit")); + Translate("ExposureUnit").toStdString()); delete translator; translator = NULL; diff --git a/isis/src/rosetta/apps/rososiris2isis/main.cpp b/isis/src/rosetta/apps/rososiris2isis/main.cpp index 4283648473..66dcfb696f 100644 --- a/isis/src/rosetta/apps/rososiris2isis/main.cpp +++ b/isis/src/rosetta/apps/rososiris2isis/main.cpp @@ -37,9 +37,9 @@ void IsisMain() { QString missionId; try { - Pvl lab(inFile.expanded()); - instId = (QString) lab.findKeyword("INSTRUMENT_ID"); - missionId = (QString) lab.findKeyword("MISSION_ID"); + Pvl lab(inFile.expanded().toStdString()); + instId = QString::fromStdString(lab.findKeyword("INSTRUMENT_ID")); + missionId = QString::fromStdString(lab.findKeyword("MISSION_ID")); } catch (IException &e) { QString msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + @@ -65,7 +65,7 @@ void IsisMain() { p.SetOutputCube(tmpFile.expanded(), outatt); p.SaveFileHeader(); - Pvl labelPvl(inFile.expanded()); + Pvl labelPvl(inFile.expanded().toStdString()); p.StartProcess(); p.EndProcess(); @@ -107,9 +107,9 @@ void IsisMain() { // must be looked up and stored for both. PvlGroup &bbGrp(outLabel.findGroup("BandBin", Pvl::Traverse)); PvlGroup groupWithFilterInfo=pdsLabel.findGroup("SR_MECHANISM_STATUS"); - QString combFilterName = groupWithFilterInfo["FILTER_NAME"]; - bbGrp.addKeyword(PvlKeyword("CombinedFilterName", combFilterName)); - bbGrp.addKeyword(PvlKeyword("FilterId", (QString)groupWithFilterInfo["FILTER_NUMBER"])); + QString combFilterName = QString::fromStdString(groupWithFilterInfo["FILTER_NAME"]); + bbGrp.addKeyword(PvlKeyword("CombinedFilterName", combFilterName.toStdString())); + bbGrp.addKeyword(PvlKeyword("FilterId", groupWithFilterInfo["FILTER_NUMBER"])); QStringList filterNames = combFilterName.split("_"); vector filterIds(2,0); vector filterWidths(2,0.0); @@ -139,10 +139,10 @@ void IsisMain() { } } // bandBin += PvlKeyword("FilterId", std::to_string(filterId)); - bbGrp.addKeyword(PvlKeyword("FilterOneName", filterNames[0])); + bbGrp.addKeyword(PvlKeyword("FilterOneName", filterNames[0].toStdString())); bbGrp.addKeyword(PvlKeyword("FilterOneCenter", std::to_string(filterCenters[0]), "nanometers")); bbGrp.addKeyword(PvlKeyword("FilterOneWidth", std::to_string(filterWidths[0]), "nanometers")); - bbGrp.addKeyword(PvlKeyword("FilterTwoName", filterNames[1])); + bbGrp.addKeyword(PvlKeyword("FilterTwoName", filterNames[1].toStdString())); bbGrp.addKeyword(PvlKeyword("FilterTwoCenter", std::to_string(filterCenters[1]), "nanometers")); bbGrp.addKeyword(PvlKeyword("FilterTwoWidth", std::to_string(filterWidths[1]), "nanometers")); outcube->putGroup(bbGrp); diff --git a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp index bd415a9660..f56829796b 100644 --- a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp +++ b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp @@ -49,7 +49,7 @@ void IsisMain () Pvl pdsLabel; try { - pdsLabel.read(inFile.expanded()); + pdsLabel.read(inFile.expanded().toStdString()); } catch (IException &e) { // Try to fix the PVL before reading it in @@ -89,9 +89,9 @@ void IsisMain () try { // ROSETTA:CHANNEL_ID will be IR or VIS - instid = (QString) pdsLabel.findKeyword("INSTRUMENT_ID"); - missid = (QString) pdsLabel.findKeyword("MISSION_ID"); - channelid = (QString) pdsLabel.findKeyword("ROSETTA:CHANNEL_ID"); + instid = QString::fromStdString(pdsLabel.findKeyword("INSTRUMENT_ID")); + missid = QString::fromStdString(pdsLabel.findKeyword("MISSION_ID")); + channelid = QString::fromStdString(pdsLabel.findKeyword("ROSETTA:CHANNEL_ID")); } catch (IException &e) { QString msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + @@ -420,7 +420,7 @@ void IsisMain () scs2e_c( (SpiceInt) -226, stopScet.toLatin1().data(), &etEnd); PvlKeyword &frameParam = inst["FrameParameter"]; - double exposureTime = toDouble(frameParam[0]); + double exposureTime = std::stod(frameParam[0]); QString startTime = iTime(etStart-exposureTime).UTC(); QString stopTime = iTime(etEnd-exposureTime).UTC(); @@ -430,8 +430,8 @@ void IsisMain () sce2s_c( (SpiceInt) -226, etStart-exposureTime, (SpiceInt) 50, startSclkString); sce2s_c( (SpiceInt) -226, etEnd-exposureTime, (SpiceInt) 50, endSclkString); - inst.findKeyword("StartTime").setValue(startTime); - inst.findKeyword("StopTime").setValue(stopTime); + inst.findKeyword("StartTime").setValue(startTime.toStdString()); + inst.findKeyword("StopTime").setValue(stopTime.toStdString()); inst.findKeyword("SpacecraftClockStartCount").setValue(startSclkString); inst.findKeyword("SpacecraftClockStopCount").setValue(endSclkString); @@ -471,7 +471,7 @@ void IsisMain () const PvlKeyword &frameKey = outcube->group("Instrument").findKeyword("FrameParameter"); // The third frame key is always the number of scans in between dark current scans. // So, we need to add one to that in order to get the number of lines to next dark current. - int darkRate = toInt(frameKey[3]) + 1; + int darkRate = std::stoi(frameKey[3]) + 1; LineManager darkLineManager(*outcube); for (int band = 1; band <= outcube->bandCount(); band++) { diff --git a/isis/src/rosetta/objs/RosettaOsirisCamera/RosettaOsirisCamera.cpp b/isis/src/rosetta/objs/RosettaOsirisCamera/RosettaOsirisCamera.cpp index 9677faf89f..d4b7e52575 100644 --- a/isis/src/rosetta/objs/RosettaOsirisCamera/RosettaOsirisCamera.cpp +++ b/isis/src/rosetta/objs/RosettaOsirisCamera/RosettaOsirisCamera.cpp @@ -90,7 +90,7 @@ namespace Isis { new CameraSkyMap(this); // Setup clock start and stop times. - QString clockStartCount = inst["SpacecraftClockStartCount"]; + QString clockStartCount = QString::fromStdString(inst["SpacecraftClockStartCount"]); double start = getClockTime(clockStartCount).Et(); // QString clockStopCount = inst["SpacecraftClockStopCount"]; // double stop = getClockTime(clockStopCount).Et(); @@ -98,7 +98,7 @@ namespace Isis { // Setup the distortion map PvlGroup &BandBin = lab.findGroup("BandBin", Pvl::Traverse); - QString filterNumber = BandBin["FilterNumber"]; + QString filterNumber = QString::fromStdString(BandBin["FilterNumber"]); initDistortion(ikCode, distortionMap); distortionMap->setPixelPitch(pixelPitch); diff --git a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp index a238a3c681..784e195988 100644 --- a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp +++ b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp @@ -55,7 +55,7 @@ namespace Isis { // PvlGroup &archive = lab.findGroup("Archive", Isis::Pvl::Traverse); PvlGroup &inst = lab.findGroup("Instrument", Isis::Pvl::Traverse); - QString instrumentId = inst["InstrumentId"]; + QString instrumentId = QString::fromStdString(inst["InstrumentId"]); if ( "virtis" != instrumentId.toLower()) { QString mess = "This data is apparently not from the VIRTIS instrument but " + instrumentId; @@ -67,9 +67,9 @@ namespace Isis { m_is1BCalibrated = (procLevel > 2) ? true : false; // Get the start time from labels - QString channelId = inst["ChannelId"]; + QString channelId = QString::fromStdString(inst["ChannelId"]); - QString instMode = inst["InstrumentModeId"]; + QString instMode = QString::fromStdString(inst["InstrumentModeId"]); m_slitMode = instMode[14].toLatin1(); // "F" for full slit, Q for quarter slit @@ -104,18 +104,18 @@ namespace Isis { // convert milliseconds to seconds - m_exposureTime = toDouble(frameParam[0]) * 0.001; - m_summing = toDouble(frameParam[1]); - m_scanRate = toDouble(frameParam[2]); + m_exposureTime = std::stod(frameParam[0]) * 0.001; + m_summing = std::stod(frameParam[1]); + m_scanRate = std::stod(frameParam[2]); // Setup detector map // Get the line scan rates/times if (!m_is1BCalibrated) { - readHouseKeeping(lab.fileName(), m_scanRate); + readHouseKeeping(QString::fromStdString(lab.fileName()), m_scanRate); } else { - readSCET(lab.fileName()); + readSCET(QString::fromStdString(lab.fileName())); } new VariableLineScanCameraDetectorMap(this, m_lineRates); @@ -527,20 +527,20 @@ namespace Isis { } // Add some necessary keywords - quats.Label() += PvlKeyword("CkTableStartTime", toString(startTime())); - quats.Label() += PvlKeyword("CkTableEndTime", toString(endTime())); - quats.Label() += PvlKeyword("CkTableOriginalSize", toString(quats.Records())); + quats.Label() += PvlKeyword("CkTableStartTime", std::to_string(startTime())); + quats.Label() += PvlKeyword("CkTableEndTime", std::to_string(endTime())); + quats.Label() += PvlKeyword("CkTableOriginalSize", std::to_string(quats.Records())); // Create the time dependant frames keyword int virZeroId = getInteger("FRAME_" + virZero); - PvlKeyword tdf("TimeDependentFrames", toString(virZeroId)); // ROS_VIRTIS_M_{ID}_ZERO + PvlKeyword tdf("TimeDependentFrames", std::to_string(virZeroId)); // ROS_VIRTIS_M_{ID}_ZERO tdf.addValue("-226200"); // ROS_VIRTIS tdf.addValue("-226000"); // ROSETTA_SPACECRAFT tdf.addValue("1"); // J2000 quats.Label() += tdf; // Create constant rotation frames - PvlKeyword cf("ConstantFrames", toString(virZeroId)); + PvlKeyword cf("ConstantFrames", std::to_string(virZeroId)); cf.addValue(std::to_string(virZeroId)); quats.Label() += cf; diff --git a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp index b2a8c9bf39..ac1c5a0a83 100644 --- a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp +++ b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp @@ -370,18 +370,18 @@ namespace Isis { // Remove trailing "Z" from PDS4 .xml (on re-ingestion) and create YearDoy keyword in Archive group PvlKeyword *startTime = &outputLabel->findGroup("Instrument", Pvl::Traverse)["StartTime"]; - QString startTimeString = startTime[0]; + QString startTimeString = QString::fromStdString(startTime[0]); if (startTimeString.endsWith("Z", Qt::CaseInsensitive)) { startTimeString.chop(1); - startTime->setValue(startTimeString); + startTime->setValue(startTimeString.toStdString()); } if (outputLabel->hasGroup("StopTime")) { PvlKeyword *stopTime = &outputLabel->findGroup("Instrument", Pvl::Traverse)["StopTime"]; - QString stopTimeString = stopTime[0]; + QString stopTimeString = QString::fromStdString(stopTime[0]); if (stopTimeString.endsWith("Z", Qt::CaseInsensitive)){ stopTimeString.chop(1); - stopTime->setValue(stopTimeString); + stopTime->setValue(stopTimeString.toStdString()); } } @@ -395,9 +395,9 @@ namespace Isis { sumMode = "0"; } else { - sumMode = (QString)archive["Window" + (QString)archive["WindowCount"] + "Binning"]; + sumMode = QString::fromStdString(archive["Window" + (std::string)archive["WindowCount"] + "Binning"]); } - PvlKeyword summingMode("SummingMode", sumMode); + PvlKeyword summingMode("SummingMode", sumMode.toStdString()); outputLabel->findGroup("Instrument", Pvl::Traverse).addKeyword(summingMode); PvlKeyword yeardoy("YearDoy", std::to_string(stime.Year()*1000 + stime.DayOfYear())); @@ -435,9 +435,9 @@ namespace Isis { // Setup the kernel group PvlGroup kern("Kernels"); QString spacecraftNumber; - QString instId = (QString) inst.findKeyword("InstrumentId"); - QString spcName = (QString) inst.findKeyword("SpacecraftName"); - QString filter = (QString) bandBin.findKeyword("FilterName"); + QString instId = QString::fromStdString(inst.findKeyword("InstrumentId")); + QString spcName = QString::fromStdString(inst.findKeyword("SpacecraftName")); + QString filter = QString::fromStdString(bandBin.findKeyword("FilterName")); if(spcName.compare("TRACE GAS ORBITER", Qt::CaseInsensitive) == 0 && instId.compare("CaSSIS", Qt::CaseInsensitive) == 0) { @@ -482,10 +482,10 @@ namespace Isis { if (archive.hasKeyword("Window_Count")) { int windowNumber = (int)archive["Window_Count"] + 1; QString windowString = "Window_" + toString(windowNumber); - int frameletStartSample = (int) archive[windowString + "_Start_Sample"] + 1; - int frameletEndSample = (int) archive[windowString + "_End_Sample"] + 1; - int frameletStartLine = (int) archive[windowString + "_Start_Line"] + 1; - int frameletEndLine = (int) archive[windowString + "_End_Line"] + 1; + int frameletStartSample = (int) archive[windowString.toStdString() + "_Start_Sample"] + 1; + int frameletEndSample = (int) archive[windowString.toStdString() + "_End_Sample"] + 1; + int frameletStartLine = (int) archive[windowString.toStdString() + "_Start_Line"] + 1; + int frameletEndLine = (int) archive[windowString.toStdString() + "_End_Line"] + 1; AlphaCube frameletArea(2048, 2048, frameletEndSample - frameletStartSample + 1, frameletEndLine - frameletStartLine + 1, @@ -504,16 +504,16 @@ namespace Isis { QString target = ""; if (outputLabel.findObject("IsisCube").hasGroup("Instrument")) { - target = outputLabel.findGroup("Instrument", Pvl::Traverse) - .findKeyword("TargetName")[0]; + target = QString::fromStdString(outputLabel.findGroup("Instrument", Pvl::Traverse) + .findKeyword("TargetName")[0]); } else { - target = outputLabel.findGroup("Mapping", Pvl::Traverse) - .findKeyword("TargetName")[0]; + target = QString::fromStdString(outputLabel.findGroup("Mapping", Pvl::Traverse) + .findKeyword("TargetName")[0]); } PvlGroup &archiveGroup = outputLabel.findGroup("Archive", Pvl::Traverse); - QString uniqueId = archiveGroup.findKeyword("UniqueIdentifier")[0]; + QString uniqueId = QString::fromStdString(archiveGroup.findKeyword("UniqueIdentifier")[0]); QString observationId = ""; BigInt uniqueIdDecimalValue = uniqueId.toLongLong(); @@ -541,7 +541,7 @@ namespace Isis { observationId += "_"; observationId += toString(imageType); - archiveGroup += PvlKeyword("ObservationId", observationId); + archiveGroup += PvlKeyword("ObservationId", observationId.toStdString()); return observationId; diff --git a/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp b/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp index 0944447b3d..c391447519 100644 --- a/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp +++ b/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp @@ -187,21 +187,21 @@ namespace Isis { PvlGroup archiveGroup = origLab->findGroup("Archive", Pvl::Traverse); if (i == 0) { - spacecraftName = instGroup["SpacecraftName"][0]; - instrumentId = instGroup["InstrumentId"][0]; - observationId = archiveGroup["ObservationId"][0]; - firstStartTime = instGroup["StartTime"][0]; - startClock = instGroup["SpacecraftClockStartCount"][0]; - lastStartTime = instGroup["StartTime"][0]; - exposureDuration = instGroup["ExposureDuration"][0]; + spacecraftName = QString::fromStdString( instGroup["SpacecraftName"][0]); + instrumentId = QString::fromStdString(instGroup["InstrumentId"][0]); + observationId = QString::fromStdString(archiveGroup["ObservationId"][0]); + firstStartTime = QString::fromStdString(instGroup["StartTime"][0]); + startClock = QString::fromStdString(instGroup["SpacecraftClockStartCount"][0]); + lastStartTime = QString::fromStdString(instGroup["StartTime"][0]); + exposureDuration = QString::fromStdString(instGroup["ExposureDuration"][0]); } else { // current cube's StartTime/StopTime values - iTime currentStartTime = iTime(instGroup["StartTime"][0]); + iTime currentStartTime = iTime(QString::fromStdString(instGroup["StartTime"][0])); if (currentStartTime < iTime(firstStartTime)) { firstStartTime = currentStartTime.UTC(); - startClock = instGroup["SpacecraftClockStartCount"][0]; + startClock = QString::fromStdString(instGroup["SpacecraftClockStartCount"][0]); } if (currentStartTime > iTime(lastStartTime)) { lastStartTime = currentStartTime.UTC(); @@ -244,19 +244,19 @@ namespace Isis { // write out new information to new group mosaic PvlGroup mos("Mosaic"); - mos += PvlKeyword("SpacecraftName", spacecraftName); - mos += PvlKeyword("InstrumentId", instrumentId); - mos += PvlKeyword("ObservationId ", observationId); - mos += PvlKeyword("StartTime ", firstStartTime); - mos += PvlKeyword("StopTime ", stopTime); - mos += PvlKeyword("SpacecraftClockStartCount ", startClock); - mos += PvlKeyword("IncidenceAngle ", toString(incidenceAngle), "degrees"); - mos += PvlKeyword("EmissionAngle ", toString(emissionAngle), "degrees"); - mos += PvlKeyword("PhaseAngle ", toString(phaseAngle), "degrees"); - mos += PvlKeyword("LocalTime ", toString(localSolarTime)); - mos += PvlKeyword("SolarLongitude ", toString(solarLongitude), "degrees"); - mos += PvlKeyword("SubSolarAzimuth ", toString(sunAzimuth), "degrees"); - mos += PvlKeyword("NorthAzimuth ", toString(northAzimuth), "degrees"); + mos += PvlKeyword("SpacecraftName", spacecraftName.toStdString()); + mos += PvlKeyword("InstrumentId", instrumentId.toStdString()); + mos += PvlKeyword("ObservationId ", observationId.toStdString()); + mos += PvlKeyword("StartTime ", firstStartTime.toStdString()); + mos += PvlKeyword("StopTime ", stopTime.toStdString()); + mos += PvlKeyword("SpacecraftClockStartCount ", startClock.toStdString()); + mos += PvlKeyword("IncidenceAngle ", std::to_string(incidenceAngle), "degrees"); + mos += PvlKeyword("EmissionAngle ", std::to_string(emissionAngle), "degrees"); + mos += PvlKeyword("PhaseAngle ", std::to_string(phaseAngle), "degrees"); + mos += PvlKeyword("LocalTime ", std::to_string(localSolarTime)); + mos += PvlKeyword("SolarLongitude ", std::to_string(solarLongitude), "degrees"); + mos += PvlKeyword("SubSolarAzimuth ", std::to_string(sunAzimuth), "degrees"); + mos += PvlKeyword("NorthAzimuth ", std::to_string(northAzimuth), "degrees"); Cube mosCube; mosCube.open(ui.GetCubeName("TO"), "rw"); @@ -286,8 +286,8 @@ namespace Isis { PvlGroup matchArchive = matchLabel.findGroup("Archive", Pvl::Traverse); PvlGroup compareArchive = compareLabel.findGroup("Archive", Pvl::Traverse); - QString matchObsId = matchArchive["ObservationId"]; - QString compareObsId = compareArchive["ObservationId"]; + QString matchObsId = QString::fromStdString(matchArchive["ObservationId"]); + QString compareObsId = QString::fromStdString(compareArchive["ObservationId"]); if (matchObsId != compareObsId) { QString msg = "Images not from the same observation"; @@ -297,8 +297,8 @@ namespace Isis { // Test of the BandBin filter name PvlGroup matchBandBin = matchLabel.findGroup("BandBin", Pvl::Traverse); PvlGroup compareBandBin = compareLabel.findGroup("BandBin", Pvl::Traverse); - QString matchFilter = matchBandBin["FilterName"]; - QString compareFilter = compareBandBin["FilterName"]; + QString matchFilter = QString::fromStdString(matchBandBin["FilterName"]); + QString compareFilter = QString::fromStdString(compareBandBin["FilterName"]); if (matchFilter != compareFilter) { QString msg = "Images not the same filter"; diff --git a/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp b/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp index 590eb61850..f8058438f7 100644 --- a/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp +++ b/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp @@ -80,7 +80,7 @@ namespace Isis { // because of the ease of editing pvl vs xml. PvlKeyword productId("ProductId"); if ( ui.WasEntered("PRODUCTID") ) { - productId.setValue( ui.GetString("PRODUCTID") ); + productId.setValue( ui.GetString("PRODUCTID").toStdString()); } else { // Get the observationId from the Archive Group, or the Mosaic group, if the input is a mosaic @@ -88,40 +88,40 @@ namespace Isis { if (label->findObject("IsisCube").hasGroup("Mosaic")) { PvlGroup mosaicGroup = label->findObject("IsisCube").findGroup("Mosaic"); - observationId = mosaicGroup.findKeyword("ObservationId")[0]; + observationId = QString::fromStdString(mosaicGroup.findKeyword("ObservationId")[0]); } else if(label->findObject("IsisCube").hasGroup("Archive")){ PvlGroup archiveGroup = label->findObject("IsisCube").findGroup("Archive"); - observationId = archiveGroup.findKeyword("ObservationId")[0]; + observationId = QString::fromStdString(archiveGroup.findKeyword("ObservationId")[0]); } - productId.setValue(observationId); + productId.setValue(observationId.toStdString()); } targetGroup.addKeyword(productId); - logicalId += productId[0]; + logicalId += QString::fromStdString(productId[0]); process.setLogicalId(logicalId); // For a mosaic, calculate stitched browse LID (lidvid) // This is as follows: // StartTime of the first framelet, rounded down to the nearest second if (label->findObject("IsisCube").hasGroup("Mosaic")) { - QString startTime = label->findObject("IsisCube").findGroup("Mosaic").findKeyword("StartTime"); + QString startTime = QString::fromStdString(label->findObject("IsisCube").findGroup("Mosaic").findKeyword("StartTime")); startTime = iTime(startTime).UTC(0).toLower().remove("-").remove(":"); // StopTime of the last framelet, rounded down to the nearest second + 4 seconds - QString stopTime = label->findObject("IsisCube").findGroup("Mosaic").findKeyword("StopTime"); + QString stopTime = QString::fromStdString(label->findObject("IsisCube").findGroup("Mosaic").findKeyword("StopTime")); stopTime = (iTime(iTime(stopTime).UTC(0)) + 4).UTC().toLower().remove("-").remove(":"); // UID - QString UID = label->findObject("IsisCube").findGroup("Archive").findKeyword("UID"); + QString UID = QString::fromStdString(label->findObject("IsisCube").findGroup("Archive").findKeyword("UID")); // FilterName - QString filterName = QString(label->findObject("IsisCube").findGroup("BandBin"). - findKeyword("FilterName")).toLower(); + QString filterName = QString::fromStdString((label->findObject("IsisCube").findGroup("BandBin"). + findKeyword("FilterName"))).toLower(); QString lid = QString("urn:esa:psa:em16_tgo_cas:data_calibrated:cas_cal_sc_%1-%2-%3-%4-sti").arg(startTime) .arg(stopTime).arg(filterName).arg(UID); - label->findObject("IsisCube").findGroup("Archive").addKeyword(PvlKeyword("LID", lid)); + label->findObject("IsisCube").findGroup("Archive").addKeyword(PvlKeyword("LID", lid.toStdString())); } // Set Title @@ -246,7 +246,7 @@ namespace Isis { QDomElement browseNode = pdsLabel.createElement("Browse"); for (int i = 0; i < browseKeyword.size(); i++) { - QString browseFile = browseKeyword[i]; + QString browseFile = QString::fromStdString(browseKeyword[i]); QStringList browseComponentList = browseFile.split(QLatin1Char('_')); QDomElement browseItem = pdsLabel.createElement("browse_record"); diff --git a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp index e23c9b10f1..1b62067411 100644 --- a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp +++ b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp @@ -181,7 +181,7 @@ namespace Isis { Pvl &frameCubeLabel = *frameCube.label(); for(int i = 0; i < firstFrameletLabel.objects(); i++) { if(firstFrameletLabel.object(i).isNamed("Table")) { - Isis::Blob table((QString)firstFrameletLabel.object(i)["Name"], firstFrameletLabel.object(i).name()); + Isis::Blob table(QString::fromStdString(firstFrameletLabel.object(i)["Name"]), firstFrameletLabel.object(i).name()); firstFrameletCube.read(table); frameCube.write(table); } @@ -204,7 +204,7 @@ namespace Isis { // Eventually summing can be handled, but right now we don't know enough, so error PvlGroup frameletInst = frameletCube->group("Instrument"); if ((int)frameletInst["SummingMode"] != 0) { - QString msg = "Summing mode [" + (QString)frameletInst["SummingMode"] + QString msg = "Summing mode [" + QString::fromStdString(frameletInst["SummingMode"]) + "] for framelet [" + frameletFile.expanded() + "] is not supported."; throw IException(IException::User, msg, _FILEINFO_); @@ -220,14 +220,14 @@ namespace Isis { stitchGroup["FilterIkCodes"] += frameletBandBin["NaifIkCode"]; PvlGroup archiveGroup = frameletCube->group("Archive"); - archiveGroup.setName("Archive" + QString(frameletBandBin["FilterName"])); + archiveGroup.setName("Archive" + (std::string)frameletBandBin["FilterName"]); frameCube.putGroup(archiveGroup); AlphaCube frameletAlphaCube(*frameletCube); - stitchGroup["FilterStartSamples"] += toString(frameletAlphaCube.AlphaSample(0.0)); - stitchGroup["FilterSamples"] += toString(frameletAlphaCube.BetaSamples()); - stitchGroup["FilterStartLines"] += toString(frameletAlphaCube.AlphaLine(0.0)); - stitchGroup["FilterLines"] += toString(frameletAlphaCube.BetaLines()); + stitchGroup["FilterStartSamples"] += std::to_string(frameletAlphaCube.AlphaSample(0.0)); + stitchGroup["FilterSamples"] += std::to_string(frameletAlphaCube.BetaSamples()); + stitchGroup["FilterStartLines"] += std::to_string(frameletAlphaCube.AlphaLine(0.0)); + stitchGroup["FilterLines"] += std::to_string(frameletAlphaCube.BetaLines()); PvlGroup frameletArchGroup = frameletCube->group("Archive"); stitchGroup["FilterFileNames"] += frameletArchGroup["FileName"]; @@ -236,7 +236,7 @@ namespace Isis { Pvl &frameletLabel = *frameletCube->label(); for(int i = 0; i < frameletLabel.objects(); i++) { if( frameletLabel.object(i).isNamed("History") ) { - Blob historyBlob((QString) frameletLabel.object(i)["Name"], "History" ); + Blob historyBlob(QString::fromStdString(frameletLabel.object(i)["Name"]), "History" ); frameletCube->read(historyBlob); frameCube.write(historyBlob); } diff --git a/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp b/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp index 04b2da35cd..04065f723c 100644 --- a/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp +++ b/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp @@ -89,26 +89,26 @@ namespace Isis { PvlKeyword filterWidth = inputLabel->findKeyword("FilterWidths", PvlObject::Traverse); for (int i = 0; i < filterKey.size(); i++) { - g_frameletInfoList.append(FilterInfo(filterIkCodes[i].toInt(), - filterKey[i], - filterStartSamples[i].toDouble(), - filterStartLines[i].toDouble(), - filterSamples[i].toDouble(), - filterLines[i].toDouble(), - filterWavelength[i].toDouble(), - filterWidth[i].toDouble())); + g_frameletInfoList.append(FilterInfo(std::stoi(filterIkCodes[i]), + QString::fromStdString(filterKey[i]), + std::stod(filterStartSamples[i]), + std::stod(filterStartLines[i]), + std::stod(filterSamples[i]), + std::stod(filterLines[i]), + std::stod(filterWavelength[i]), + std::stod(filterWidth[i]))); } // Collect the tables and history from the input stitched cube QList inputBlobs; for(int i = 0; i < inputLabel->objects(); i++) { if(inputLabel->object(i).isNamed("Table")) { - Blob table((QString)inputLabel->object(i)["Name"], inputLabel->object(i).name()); + Blob table(QString::fromStdString(inputLabel->object(i)["Name"]), inputLabel->object(i).name()); cube->read(table); inputBlobs.append(table); } if(inputLabel->object(i).isNamed("History") && iApp != NULL) { - History inputHistory = cube->readHistory((QString)inputLabel->object(i)["Name"]); + History inputHistory = cube->readHistory(QString::fromStdString(inputLabel->object(i)["Name"])); inputHistory.AddEntry(); inputBlobs.append(inputHistory.toBlob()); } @@ -168,8 +168,8 @@ namespace Isis { // The stitched frame has ArchiveRED, ArchiveNIR, ArchivePAN, and ArchiveBLU. // We won't add the archive group unless - if ( group.name().contains("Archive") && - group.name() != "Archive" + g_frameletInfoList[i].m_filterName ) { + if ( QString::fromStdString(group.name()).contains("Archive") && + group.name() != "Archive" + g_frameletInfoList[i].m_filterName.toStdString() ) { continue; } @@ -179,18 +179,18 @@ namespace Isis { // Update the labels Pvl *frameletLabel = g_outputCubes[i]->label(); frameletLabel->findGroup("Instrument", PvlObject::Traverse).addKeyword(PvlKeyword("Filter", - g_frameletInfoList[i].m_filterName), PvlObject::Replace); + g_frameletInfoList[i].m_filterName.toStdString()), PvlObject::Replace); // Sets the name from ArchiveRED (or NIR, BLU, PAN) to just "Archive" in the unstitched cube. - frameletLabel->findGroup("Archive" + g_frameletInfoList[i].m_filterName, PvlObject::Traverse).setName("Archive"); + frameletLabel->findGroup("Archive" + g_frameletInfoList[i].m_filterName.toStdString(), PvlObject::Traverse).setName("Archive"); PvlGroup &bandBin = frameletLabel->findGroup("BandBin", PvlObject::Traverse); - bandBin.addKeyword(PvlKeyword("FilterName", g_frameletInfoList[i].m_filterName), + bandBin.addKeyword(PvlKeyword("FilterName", g_frameletInfoList[i].m_filterName.toStdString()), PvlObject::Replace); - bandBin.addKeyword(PvlKeyword("Center", toString(g_frameletInfoList[i].m_wavelength))); - bandBin.addKeyword(PvlKeyword("Width", toString(g_frameletInfoList[i].m_width))); - bandBin.addKeyword(PvlKeyword("NaifIkCode", toString(g_frameletInfoList[i].m_frameId))); + bandBin.addKeyword(PvlKeyword("Center", std::to_string(g_frameletInfoList[i].m_wavelength))); + bandBin.addKeyword(PvlKeyword("Width", std::to_string(g_frameletInfoList[i].m_width))); + bandBin.addKeyword(PvlKeyword("NaifIkCode", std::to_string(g_frameletInfoList[i].m_frameId))); // Add the alpha cube AlphaCube frameletArea(cube->sampleCount(), cube->lineCount(), diff --git a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp index 37a1610721..3fb1ec464c 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp @@ -60,8 +60,8 @@ namespace Isis { // Get the Start time from the labels // TODO: This is currently using UTC time. Once the timestamp is figured out, // this will change to use SCLK. JAM 2017-02-06 - QString stime = inst["SpacecraftClockStartCount"]; - QString startT = inst["StartTime"]; + QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); + QString startT = QString::fromStdString(inst["StartTime"]); iTime et(startT); // Get summing mode @@ -69,7 +69,7 @@ namespace Isis { // 0 = 1x1 (No summing) // 1 = 2x2 // 2 = 4x4 - int sumMode = toInt(inst["SummingMode"][0]); + int sumMode = std::stoi(inst["SummingMode"][0]); int summing = sumMode * 2; // Setup camera detector map @@ -103,7 +103,7 @@ namespace Isis { // Set start time to center of exposure time to ensure // the proper SPICE data is cached. - double p_exposureDur = toDouble(inst["ExposureDuration"]); + double p_exposureDur = std::stod(inst["ExposureDuration"]); iTime p_etStart = et + ( p_exposureDur / 2.0); setTime(p_etStart); diff --git a/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp b/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp index 7ad0485e3d..4dd956e9a2 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp @@ -60,7 +60,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); - double exposureDuration = toDouble( inst["ExposureDuration"][0] ); + double exposureDuration = std::stod( inst["ExposureDuration"][0] ); QString stime = QString::fromStdString(inst["StartTime"]); double et; str2et_c(stime.toLatin1().data(), &et); diff --git a/isis/src/viking/apps/vik2isis/main.cpp b/isis/src/viking/apps/vik2isis/main.cpp index 2cce677b48..fa292aad1d 100644 --- a/isis/src/viking/apps/vik2isis/main.cpp +++ b/isis/src/viking/apps/vik2isis/main.cpp @@ -39,7 +39,7 @@ void IsisMain() { // object. If this fails then the file must be compressed, so // decompress the file using vdcomp. try { - Pvl compressionTest(in.expanded()); + Pvl compressionTest(in.expanded().toStdString()); if(compressionTest.groups() == 0 && compressionTest.objects() == 0 && compressionTest.keywords() < 2) { @@ -112,36 +112,36 @@ void IsisMain() { void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { // Setup the archive group PvlGroup arch("Archive"); - arch += PvlKeyword("DataSetId", (QString)pdsLabel["DATA_SET_ID"]); - arch += PvlKeyword("ProductId", (QString)pdsLabel["IMAGE_ID"]); - arch += PvlKeyword("MissonPhaseName", (QString)pdsLabel["MISSION_PHASE_NAME"]); - arch += PvlKeyword("ImageNumber", (QString)pdsLabel["IMAGE_NUMBER"]); - arch += PvlKeyword("OrbitNumber", (QString)pdsLabel["ORBIT_NUMBER"]); + arch += PvlKeyword("DataSetId", pdsLabel["DATA_SET_ID"]); + arch += PvlKeyword("ProductId", pdsLabel["IMAGE_ID"]); + arch += PvlKeyword("MissonPhaseName", pdsLabel["MISSION_PHASE_NAME"]); + arch += PvlKeyword("ImageNumber", pdsLabel["IMAGE_NUMBER"]); + arch += PvlKeyword("OrbitNumber", pdsLabel["ORBIT_NUMBER"]); ocube->putGroup(arch); // Setup the instrument group // Note SpacecraftClockCount used to be FDS_COUNT PvlGroup inst("Instrument"); - inst += PvlKeyword("SpacecraftName", (QString)pdsLabel["SPACECRAFT_NAME"]); - inst += PvlKeyword("InstrumentId", (QString)pdsLabel["INSTRUMENT_NAME"]); - inst += PvlKeyword("TargetName", (QString)pdsLabel["TARGET_NAME"]); + inst += PvlKeyword("SpacecraftName", pdsLabel["SPACECRAFT_NAME"]); + inst += PvlKeyword("InstrumentId", pdsLabel["INSTRUMENT_NAME"]); + inst += PvlKeyword("TargetName", pdsLabel["TARGET_NAME"]); - QString stime = (QString) pdsLabel["IMAGE_TIME"]; + QString stime = QString::fromStdString(pdsLabel["IMAGE_TIME"]); stime.remove(QRegExp("Z$")); - inst += PvlKeyword("StartTime", stime); + inst += PvlKeyword("StartTime", stime.toStdString()); inst += PvlKeyword("ExposureDuration", - (QString)pdsLabel["EXPOSURE_DURATION"], "seconds"); - inst += PvlKeyword("SpacecraftClockCount", (QString)pdsLabel["IMAGE_NUMBER"]); - inst += PvlKeyword("FloodModeId", (QString)pdsLabel["FLOOD_MODE_ID"]); - inst += PvlKeyword("GainModeId", (QString)pdsLabel["GAIN_MODE_ID"]); - inst += PvlKeyword("OffsetModeId", (QString)pdsLabel["OFFSET_MODE_ID"]); + pdsLabel["EXPOSURE_DURATION"], "seconds"); + inst += PvlKeyword("SpacecraftClockCount", pdsLabel["IMAGE_NUMBER"]); + inst += PvlKeyword("FloodModeId", pdsLabel["FLOOD_MODE_ID"]); + inst += PvlKeyword("GainModeId", pdsLabel["GAIN_MODE_ID"]); + inst += PvlKeyword("OffsetModeId", pdsLabel["OFFSET_MODE_ID"]); ocube->putGroup(inst); // Setup the band bin group PvlGroup bandBin("BandBin"); - QString filterName = pdsLabel["FILTER_NAME"]; - bandBin += PvlKeyword("FilterName", filterName); + QString filterName = QString::fromStdString(pdsLabel["FILTER_NAME"]); + bandBin += PvlKeyword("FilterName", filterName.toStdString()); int filterId; double filterCenter = 0.0; @@ -184,8 +184,8 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { // Setup the kernel group PvlGroup kern("Kernels"); int spn; - if((QString) pdsLabel["SPACECRAFT_NAME"] == "VIKING_ORBITER_1") { - if((QString) pdsLabel["INSTRUMENT_NAME"] == + if(QString::fromStdString(pdsLabel["SPACECRAFT_NAME"]) == "VIKING_ORBITER_1") { + if(QString::fromStdString(pdsLabel["INSTRUMENT_NAME"]) == "VISUAL_IMAGING_SUBSYSTEM_CAMERA_A") { kern += PvlKeyword("NaifFrameCode", "-27001"); } @@ -195,7 +195,7 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { spn = 1; } else { - if((QString) pdsLabel["INSTRUMENT_NAME"] == + if(QString::fromStdString(pdsLabel["INSTRUMENT_NAME"]) == "VISUAL_IMAGING_SUBSYSTEM_CAMERA_A") { kern += PvlKeyword("NaifFrameCode", "-30001"); } @@ -215,8 +215,8 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { type = PvlKeyword("Type"); valid = PvlKeyword("Valid"); QString prefix; - if((QString) pdsLabel["SPACECRAFT_NAME"] == "VIKING_ORBITER_1") { - if((QString) pdsLabel["INSTRUMENT_NAME"] == + if(QString::fromStdString(pdsLabel["SPACECRAFT_NAME"]) == "VIKING_ORBITER_1") { + if(QString::fromStdString(pdsLabel["INSTRUMENT_NAME"]) == "VISUAL_IMAGING_SUBSYSTEM_CAMERA_A") { prefix = "VO1_VISA_"; } @@ -225,7 +225,7 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { } } else { - if((QString) pdsLabel["INSTRUMENT_NAME"] == + if(QString::fromStdString(pdsLabel["INSTRUMENT_NAME"]) == "VISUAL_IMAGING_SUBSYSTEM_CAMERA_A") { prefix = "VO2_VISA_"; } @@ -233,13 +233,13 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { prefix = "VO2_VISB_"; } } - PvlKeyword key = nomRes.findKeyword(prefix + "RESEAUS"); - int numRes = nomRes[prefix + "NUMBER_RESEAUS"]; + PvlKeyword key = nomRes.findKeyword(prefix.toStdString() + "RESEAUS"); + int numRes = nomRes[prefix.toStdString() + "NUMBER_RESEAUS"]; for(int i = 0; i < numRes * 3; i += 3) { lines += key[i]; samps += key[i+1]; type += key[i+2]; - valid += QString::number(0); + valid += 0; } res += lines; res += samps; diff --git a/isis/src/viking/apps/vikcal/CalParameters.cpp b/isis/src/viking/apps/vikcal/CalParameters.cpp index a183360323..87342d2bdd 100644 --- a/isis/src/viking/apps/vikcal/CalParameters.cpp +++ b/isis/src/viking/apps/vikcal/CalParameters.cpp @@ -38,7 +38,7 @@ namespace Isis { PvlGroup &instrument = pvl.findGroup("INSTRUMENT", Pvl::Traverse); // Make sure it is a viking mission - QString spacecraft = (QString)instrument["SPACECRAFTNAME"]; + QString spacecraft = QString::fromStdString(instrument["SPACECRAFTNAME"]); QString mission = spacecraft.split("_").first(); spacecraft = spacecraft.split("_").last(); if(mission != "VIKING") { @@ -55,7 +55,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } double clock = instrument["SPACECRAFTCLOCKCOUNT"]; - QString instId = (QString)instrument["INSTRUMENTID"]; + QString instId = QString::fromStdString(instrument["INSTRUMENTID"]); int cam; // Camera State 4 is used to indicate an extended mission. This is // necessary because the dust spot changed position during the extended @@ -78,24 +78,24 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } - QString startTime = instrument["STARTTIME"]; + QString startTime = QString::fromStdString(instrument["STARTTIME"]); p_dist1 = CalcSunDist(startTime, icube); p_labexp = (double)instrument["EXPOSUREDURATION"] * 1000.0; // convert to msec QString target = " "; PvlKeyword cs1 = instrument["FLOODMODEID"]; - if((QString)cs1 == "ON") cs1 = "1"; - else if((QString)cs1 == "OFF") cs1 = "0"; + if(QString::fromStdString(cs1) == "ON") cs1 = "1"; + else if(QString::fromStdString(cs1) == "OFF") cs1 = "0"; PvlKeyword cs2 = instrument["GAINMODEID"]; - if((QString)cs2 == "LOW") cs2 = "0"; - else if((QString)cs2 == "HIGH") cs2 = "1"; + if(QString::fromStdString(cs2) == "LOW") cs2 = "0"; + else if(QString::fromStdString(cs2) == "HIGH") cs2 = "1"; PvlKeyword cs3 = instrument["OFFSETMODEID"]; - if((QString)cs3 == "ON") cs3 = "1"; - else if((QString)cs3 == "OFF") cs3 = "0"; + if(QString::fromStdString(cs3) == "ON") cs3 = "1"; + else if(QString::fromStdString(cs3) == "OFF") cs3 = "0"; PvlKeyword wav = pvl.findGroup("BANDBIN", Pvl::Traverse)["FILTERID"]; // Set up calibration, linearity, and offset variables for the input file - vikcalSetup(mission, spn, target, cam, wav, (int)cs1, (int)cs2, (int)cs3, (int)cs4); - viklinSetup(mission, spn, target, cam, wav, (int)cs1, (int)cs2, (int)cs3, (int)cs4); + vikcalSetup(mission, spn, target, cam, QString::fromStdString(wav), (int)cs1, (int)cs2, (int)cs3, (int)cs4); + viklinSetup(mission, spn, target, cam, QString::fromStdString(wav), (int)cs1, (int)cs2, (int)cs3, (int)cs4); vikoffSetup(mission, spn, target, cam, clock, (int)cs3); } catch(IException &e) { diff --git a/isis/src/viking/apps/vikcal/main.cpp b/isis/src/viking/apps/vikcal/main.cpp index 2edb5439d8..cdcd3704f3 100644 --- a/isis/src/viking/apps/vikcal/main.cpp +++ b/isis/src/viking/apps/vikcal/main.cpp @@ -71,24 +71,24 @@ void IsisMain() { calgrp.addComment("DI(l,s) = (1.0/(exp*w1))*G(l,s)*(gain*DR(l,s)+DC(l,s)+offt+offc)"); calgrp.addComment("with w1 = w0*((dist0*dist0) / (dist1*dist1))"); calgrp.addComment("and offt(l,s) = A*l + B*l*l + C*s + D*l*s + E"); - calgrp += PvlKeyword("offc", toString(calParam->Offset())); - calgrp += PvlKeyword("exp", toString(calParam->Exposure())); - calgrp += PvlKeyword("gain", toString(calParam->Gain())); - calgrp += PvlKeyword("DR", in); - calgrp += PvlKeyword("DC", calParam->OffsetFile()); - calgrp += PvlKeyword("G", calParam->GainFile()); - - calgrp += PvlKeyword("w0", toString(calParam->Omega0())); - calgrp += PvlKeyword("w1", toString(calParam->Omega1())); - calgrp += PvlKeyword("dist0", toString(calParam->Distance())); - calgrp += PvlKeyword("dist1", toString(calParam->Dist1())); - calgrp += PvlKeyword("1.0/exp*w1", toString(1.0 / (calParam->Exposure() * calParam->Omega1()))); - - calgrp += PvlKeyword("Acoeff", toString(calParam->Acoeff())); - calgrp += PvlKeyword("Bcoeff", toString(calParam->Bcoeff())); - calgrp += PvlKeyword("Ccoeff", toString(calParam->Ccoeff())); - calgrp += PvlKeyword("Dcoeff", toString(calParam->Dcoeff())); - calgrp += PvlKeyword("Ecoeff", toString(calParam->Ecoeff())); + calgrp += PvlKeyword("offc", std::to_string(calParam->Offset())); + calgrp += PvlKeyword("exp", std::to_string(calParam->Exposure())); + calgrp += PvlKeyword("gain", std::to_string(calParam->Gain())); + calgrp += PvlKeyword("DR", in.toStdString()); + calgrp += PvlKeyword("DC", calParam->OffsetFile().toStdString()); + calgrp += PvlKeyword("G", calParam->GainFile().toStdString()); + + calgrp += PvlKeyword("w0", std::to_string(calParam->Omega0())); + calgrp += PvlKeyword("w1", std::to_string(calParam->Omega1())); + calgrp += PvlKeyword("dist0", std::to_string(calParam->Distance())); + calgrp += PvlKeyword("dist1", std::to_string(calParam->Dist1())); + calgrp += PvlKeyword("1.0/exp*w1", std::to_string(1.0 / (calParam->Exposure() * calParam->Omega1()))); + + calgrp += PvlKeyword("Acoeff", std::to_string(calParam->Acoeff())); + calgrp += PvlKeyword("Bcoeff", std::to_string(calParam->Bcoeff())); + calgrp += PvlKeyword("Ccoeff", std::to_string(calParam->Ccoeff())); + calgrp += PvlKeyword("Dcoeff", std::to_string(calParam->Dcoeff())); + calgrp += PvlKeyword("Ecoeff", std::to_string(calParam->Ecoeff())); ocube->putGroup(calgrp); diff --git a/isis/src/viking/apps/vikcal/vikcal.cpp b/isis/src/viking/apps/vikcal/vikcal.cpp index 7e83b8e525..e8af1e3d1c 100644 --- a/isis/src/viking/apps/vikcal/vikcal.cpp +++ b/isis/src/viking/apps/vikcal/vikcal.cpp @@ -80,9 +80,9 @@ namespace Isis { calgrp += PvlKeyword("offc", std::to_string(calParam->Offset())); calgrp += PvlKeyword("exp", std::to_string(calParam->Exposure())); calgrp += PvlKeyword("gain", std::to_string(calParam->Gain())); - calgrp += PvlKeyword("DR", in); - calgrp += PvlKeyword("DC", calParam->OffsetFile()); - calgrp += PvlKeyword("G", calParam->GainFile()); + calgrp += PvlKeyword("DR", in.toStdString()); + calgrp += PvlKeyword("DC", calParam->OffsetFile().toStdString()); + calgrp += PvlKeyword("G", calParam->GainFile().toStdString()); calgrp += PvlKeyword("w0", std::to_string(calParam->Omega0())); calgrp += PvlKeyword("w1", std::to_string(calParam->Omega1())); diff --git a/isis/src/viking/apps/viknobutter/main.cpp b/isis/src/viking/apps/viknobutter/main.cpp index 003f52cb21..02b7717afc 100644 --- a/isis/src/viking/apps/viknobutter/main.cpp +++ b/isis/src/viking/apps/viknobutter/main.cpp @@ -23,10 +23,10 @@ void IsisMain() { pipeline.KeepTemporaryFiles(!rmv); // Figure out which masking cube to use - Pvl p(ui.GetCubeName("FROM")); + Pvl p(ui.GetCubeName("FROM").toStdString()); PvlGroup &inst = p.findGroup("Instrument", Pvl::Traverse); int spn; - QString scn = (QString)inst["SpacecraftName"]; + QString scn = QString::fromStdString(inst["SpacecraftName"]); if(scn == "VIKING_ORBITER_1") spn = 1; else if(scn == "VIKING_ORBITER_2") spn = 2; else { @@ -36,7 +36,7 @@ void IsisMain() { // determine if # of cols is even or odd bool even = true; PvlGroup &arch = p.findGroup("Archive", Pvl::Traverse); - QString id = (QString)arch["ProductId"]; + QString id = QString::fromStdString(arch["ProductId"]); int num = toInt(id.mid(5, 1)); if(num == 1 || num == 3 || num == 5 || num == 7 || num == 9) even = false; diff --git a/isis/src/viking/objs/VikingCamera/VikingCamera.cpp b/isis/src/viking/objs/VikingCamera/VikingCamera.cpp index 60523741bc..f80ec58ee7 100644 --- a/isis/src/viking/objs/VikingCamera/VikingCamera.cpp +++ b/isis/src/viking/objs/VikingCamera/VikingCamera.cpp @@ -51,8 +51,8 @@ namespace Isis { // raster orientation, cone, crosscone, and camera Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString spacecraft = inst["SPACECRAFTNAME"]; - QString instId = inst["INSTRUMENTID"]; + QString spacecraft = QString::fromStdString(inst["SPACECRAFTNAME"]); + QString instId = QString::fromStdString(inst["INSTRUMENTID"]); QString cam; int spn; double raster, cone, crosscone; @@ -146,7 +146,7 @@ namespace Isis { *****************************************************************************/ // Get clock count and convert it to a time - QString spacecraftClock = inst["SpacecraftClockCount"]; + QString spacecraftClock = QString::fromStdString(inst["SpacecraftClockCount"]); double etClock = getClockTime(spacecraftClock, altinstcode).Et(); // exposure duration keyword value is measured in seconds diff --git a/isis/src/voyager/apps/voy2isis/main.cpp b/isis/src/voyager/apps/voy2isis/main.cpp index dde6561c3b..6f1cb98a87 100644 --- a/isis/src/voyager/apps/voy2isis/main.cpp +++ b/isis/src/voyager/apps/voy2isis/main.cpp @@ -192,11 +192,11 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { // Camera_State_2 is from ShutterModeId and is 1 or 0, it is only 1 if // it is WA and BSIMAN or BOTSIM PvlKeyword sModeId = inst["ScanModeId"]; - QString cs1 = sModeId[0].split(":").first(); - inst.addKeyword(PvlKeyword("CameraState1",cs1)); + QString cs1 = QString::fromStdString(sModeId[0]).split(":").first(); + inst.addKeyword(PvlKeyword("CameraState1",cs1.toStdString())); - QString shutterMode = inst["ShutterModeId"]; - QString cam = inst["InstrumentId"]; + QString shutterMode = QString::fromStdString(inst["ShutterModeId"]); + QString cam = QString::fromStdString(inst["InstrumentId"]); if (cam == "WIDE_ANGLE_CAMERA" && (shutterMode == "BOTSIM" || shutterMode == "BSIMAN")) { inst.addKeyword(PvlKeyword("CameraState2","1")); } @@ -205,7 +205,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { } // Translate the band bin group information - if((QString)inst["InstrumentId"] == "WIDE_ANGLE_CAMERA") { + if(QString::fromStdString(inst["InstrumentId"]) == "WIDE_ANGLE_CAMERA") { FileName bandBinTransFile(missionDir + "/translations/voyager_wa_bandbin.trn"); PvlToPvlTranslationManager labelXlater(inputLabel, bandBinTransFile.expanded()); labelXlater.Auto(*(outputLabel)); @@ -228,18 +228,18 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { QString spacecraftNumber; int spacecraftCode = 0; - QString instId = (QString) inst.findKeyword("InstrumentId"); + QString instId = QString::fromStdString(inst.findKeyword("InstrumentId")); - if((QString) inst.findKeyword("SpacecraftName") == "VOYAGER_1") { + if(QString::fromStdString(inst.findKeyword("SpacecraftName")) == "VOYAGER_1") { spacecraftNumber = "1"; if(instId == "NARROW_ANGLE_CAMERA") { spacecraftCode = -31101; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", std::to_string(spacecraftCode)); instId = "issna"; } else if (instId == "WIDE_ANGLE_CAMERA") { spacecraftCode = -31102; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", std::to_string(spacecraftCode)); instId = "isswa"; } else { @@ -250,16 +250,16 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { throw IException(IException::User, msg, _FILEINFO_); } } - else if((QString) inst.findKeyword("SpacecraftName") == "VOYAGER_2") { + else if(QString::fromStdString(inst.findKeyword("SpacecraftName")) == "VOYAGER_2") { spacecraftNumber = "2"; if(instId == "NARROW_ANGLE_CAMERA") { spacecraftCode = -32101; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", std::to_string(spacecraftCode)); instId = "issna"; } else if (instId == "WIDE_ANGLE_CAMERA") { spacecraftCode = -32102; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", std::to_string(spacecraftCode)); instId = "isswa"; } else { @@ -271,24 +271,24 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { } } else { - QString msg = "Spacecraft name [" + (QString)inst.findKeyword("SpacecraftName") + + QString msg = "Spacecraft name [" + QString::fromStdString(inst.findKeyword("SpacecraftName")) + "] does not match Voyager1 or Voyager2 spacecraft"; throw IException(IException::User, msg, _FILEINFO_); } ocube->putGroup(kern); // Modify time to remove Z from end - QString time = inst.findKeyword("StartTime")[0]; + QString time = QString::fromStdString(inst.findKeyword("StartTime")[0]); time.remove("Z"); - inst.findKeyword("StartTime").setValue(time); + inst.findKeyword("StartTime").setValue(time.toStdString()); // Fix image number - remove the period, if Wide angle camera and one of two // shutter modes, we must fix the wide angle image number for use below. // Before #####.## After ####### - QString imgNumber = inst["SpacecraftClockCount"][0]; + QString imgNumber = QString::fromStdString(inst["SpacecraftClockCount"][0]); imgNumber.replace(".", ""); // Save this change - inst["SpacecraftClockCount"] = imgNumber; + inst["SpacecraftClockCount"] = imgNumber.toStdString(); // From vgrfixlabel documentation in Isis2. // Wide Angle (WA) images off of CD's will have a fake image @@ -303,7 +303,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { if((inst["ShutterModeId"][0] == "BSIMAN" || inst["ShutterModeId"][0] == "BOTSIM") && inst["InstrumentId"][0] == "WIDE_ANGLE_CAMERA") { - QString scanId = inst["ScanModeId"][0]; + QString scanId = QString::fromStdString(inst["ScanModeId"][0]); int scanNum = toInt(scanId.mid(0, 1)); int imgNum = toInt(imgNumber); @@ -376,7 +376,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { // The purpose of the next two steps, getting the spacecraft clock count, // are simply to get the partition, the very first number 1/... double approxEphemeris = 0.0; - utc2et_c(inst["StartTime"][0].toLatin1().data(), &approxEphemeris); + utc2et_c(QString::fromStdString(inst["StartTime"][0]).toLatin1().data(), &approxEphemeris); char approxSpacecraftClock[80]; // sce2s_c requires the spacecraft number, not the instrument number as @@ -417,33 +417,33 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { char utcOut[25]; et2utc_c(approxEphemeris, "ISOC", 3, 26, utcOut); NaifStatus::CheckErrors(); - inst["StartTime"].setValue(QString(utcOut)); + inst["StartTime"].setValue(utcOut); // Set up the nominal reseaus group PvlGroup res("Reseaus"); - Pvl nomRes("$voyager" + spacecraftNumber + "/reseaus/nominal.pvl"); + Pvl nomRes("$voyager" + spacecraftNumber.toStdString() + "/reseaus/nominal.pvl"); PvlKeyword samps, lines, type, valid; lines = PvlKeyword("Line"); samps = PvlKeyword("Sample"); type = PvlKeyword("Type"); valid = PvlKeyword("Valid"); - PvlKeyword key = nomRes.findKeyword("VG" + spacecraftNumber + "_" - + instId.toUpper() + "_RESEAUS"); - int numRes = nomRes["VG" + spacecraftNumber + "_" + instId.toUpper() + PvlKeyword key = nomRes.findKeyword("VG" + spacecraftNumber.toStdString() + "_" + + instId.toUpper().toStdString() + "_RESEAUS"); + int numRes = nomRes["VG" + spacecraftNumber.toStdString() + "_" + instId.toUpper().toStdString() + "_NUMBER_RESEAUS"]; for(int i = 0; i < numRes * 3; i += 3) { lines += key[i]; samps += key[i+1]; type += key[i+2]; - valid += QString("0"); + valid += "0"; } res += lines; res += samps; res += type; res += valid; - res += PvlKeyword("Template", "$voyager" + spacecraftNumber + "/reseaus/vg" - + spacecraftNumber + "." + instId.toLower() + res += PvlKeyword("Template", "$voyager" + spacecraftNumber.toStdString() + "/reseaus/vg" + + spacecraftNumber.toStdString() + "." + instId.toLower().toStdString() + ".template.cub"); res += PvlKeyword("Status", "Nominal"); ocube->putGroup(res); @@ -490,7 +490,7 @@ QByteArray fixLabels(QString fileName, History *hist){ if (ui.GetString("INSTRUMENT") == "AUTOMATIC") { labels.replace("INSTRUMENT_NAME", "INSTRUMENT_NAME = Unknown"); PvlGroup insNameWarning("Warning"); - PvlKeyword insNameMsg("Message", "The INSTRUMENT_NAME for [" + fileName + "] is empty." + PvlKeyword insNameMsg("Message", "The INSTRUMENT_NAME for [" + fileName.toStdString() + "] is empty." + "The InstrumentId in the output cube will instead be set to " + "[Unknown] and the labels will not translate. To create a cube " + "with translated labels, re-run this " @@ -533,8 +533,8 @@ QByteArray fixLabels(QString fileName, History *hist){ i - imageIdIndex - 1, QByteArray("IMAGE_ID = ").append(baseName.toUtf8())); PvlGroup insIdWarning("Warning"); - PvlKeyword insIdMsg("Message", "The IMAGE_ID for [" + fileName + "] is corrupted. The ProductId " - + "in the output cube will instead be set to [" + baseName + "]."); + PvlKeyword insIdMsg("Message", "The IMAGE_ID for [" + fileName.toStdString() + "] is corrupted. The ProductId " + + "in the output cube will instead be set to [" + baseName.toStdString() + "]."); insIdWarning += insIdMsg; Application::Log(insIdWarning); diff --git a/isis/src/voyager/apps/voycal/main.cpp b/isis/src/voyager/apps/voycal/main.cpp index a2920baf39..4787218625 100644 --- a/isis/src/voyager/apps/voycal/main.cpp +++ b/isis/src/voyager/apps/voycal/main.cpp @@ -85,7 +85,7 @@ void IsisMain() { } // Verify Voyager spacecraft and get number, 1 or 2 - QString scNumber = instrument["SpacecraftName"][0]; + QString scNumber = QString::fromStdString(instrument["SpacecraftName"][0]); if (scNumber != "VOYAGER_1" && scNumber != "VOYAGER_2") { QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Voyager image"; @@ -95,20 +95,20 @@ void IsisMain() { // Open calibration file to find constants and files Pvl calibra(FileName("$voyager" + scNumber + - "/calibration/voycal.pvl").expanded()); + "/calibration/voycal.pvl").expanded().toStdString()); PvlObject calib; QList hierarchy; try { // Search voycal.pvl for appropriate object - hierarchy.append(instrument.findKeyword("SpacecraftName")[0]); - hierarchy.append(instrument.findKeyword("InstrumentId")[0]); + hierarchy.append(QString::fromStdString(instrument.findKeyword("SpacecraftName")[0])); + hierarchy.append(QString::fromStdString(instrument.findKeyword("InstrumentId")[0])); hierarchy.append( - QString("ShutterMode" + instrument.findKeyword("CameraState2")[0])); - hierarchy.append(archive.findKeyword("MissionPhaseName")[0]); + QString("ShutterMode" + QString::fromStdString(instrument.findKeyword("CameraState2")[0]))); + hierarchy.append(QString::fromStdString(archive.findKeyword("MissionPhaseName")[0])); hierarchy.append( - QString("ScanRate" + instrument.findKeyword("CameraState1")[0])); + QString("ScanRate" + QString::fromStdString(instrument.findKeyword("CameraState1")[0]))); hierarchy.append( - QString(bandbin["FilterName"][0] + "_" + bandbin["FilterNumber"][0])); + QString(QString::fromStdString(bandbin["FilterName"][0]) + "_" + QString::fromStdString(bandbin["FilterNumber"][0]))); calib = fetchCoefficients(calibra, hierarchy); @@ -125,10 +125,10 @@ void IsisMain() { // Get appropriate calibration files CubeAttributeInput in1; p.SetInputCube(FileName("$voyager" + scNumber + "/calibration/" + - (QString)calib["OffsetCorrectionFile"]).expanded(), in1); + QString::fromStdString(calib["OffsetCorrectionFile"])).expanded(), in1); CubeAttributeInput in2; p.SetInputCube(FileName("$voyager" + scNumber + "/calibration/" + - (QString)calib["GainCorrectionFile"]).expanded(), in2); + QString::fromStdString(calib["GainCorrectionFile"])).expanded(), in2); // Constants from voycal.pvl for correction omegaNaught = calib["OmegaNaught"]; @@ -141,7 +141,7 @@ void IsisMain() { linear = ui.GetBoolean("LINEAR"); if (linear) { Pvl linearity(FileName("$voyager" + scNumber + - "/calibration/voylin.pvl").expanded()); + "/calibration/voylin.pvl").expanded().toStdString()); PvlObject lin; try { @@ -199,11 +199,11 @@ void IsisMain() { calgrp.addKeyword(calib[4]); calgrp.addKeyword(calib[5]); calgrp.addKeyword(calib[6]); - calgrp.addKeyword(PvlKeyword("CalcSunDistance",toString(dist1))); + calgrp.addKeyword(PvlKeyword("CalcSunDistance",std::to_string(dist1))); calgrp.addKeyword(instrument["ExposureDuration"]); - calgrp.addKeyword(PvlKeyword("XMLT",toString(XMLT))); - calgrp.addKeyword(PvlKeyword("Omega_W1",toString(w1))); - calgrp.addKeyword(PvlKeyword("CalcExpoDuration",toString(newExpo))); + calgrp.addKeyword(PvlKeyword("XMLT",std::to_string(XMLT))); + calgrp.addKeyword(PvlKeyword("Omega_W1",std::to_string(w1))); + calgrp.addKeyword(PvlKeyword("CalcExpoDuration",std::to_string(newExpo))); // Linear correction equation and constants if (linear) { @@ -215,10 +215,10 @@ void IsisMain() { linearity.addComment("XNORM = NormalizingPower"); linearity.addComment("KPOWER = K_PowerOfNon-Linearity"); calgrp.addKeyword(linearity); - calgrp.addKeyword(PvlKeyword("ACoefficient",toString(aCoef))); - calgrp.addKeyword(PvlKeyword("B_HighEndNon-LinearityCorrection",toString(bHighEnd))); - calgrp.addKeyword(PvlKeyword("K_PowerOfNon-Linearity",toString(kPowerOf))); - calgrp.addKeyword(PvlKeyword("NormalizingPower",toString(normalizingPower))); + calgrp.addKeyword(PvlKeyword("ACoefficient",std::to_string(aCoef))); + calgrp.addKeyword(PvlKeyword("B_HighEndNon-LinearityCorrection",std::to_string(bHighEnd))); + calgrp.addKeyword(PvlKeyword("K_PowerOfNon-Linearity",std::to_string(kPowerOf))); + calgrp.addKeyword(PvlKeyword("NormalizingPower",std::to_string(normalizingPower))); } else { calgrp.addKeyword(PvlKeyword("LinearityCorrection","False")); @@ -297,10 +297,10 @@ PvlObject fetchCoefficients(Pvl &calibration, QList &hierarchy) { for (int o = 0; o < hierarchy.size() && validHierarchy; o++) { QString objectName = hierarchy[o]; - if (parent->hasObject(objectName)) { + if (parent->hasObject(objectName.toStdString())) { // The object named in the hierarchy exists in the calibration file, so // grab it - PvlObject &object = parent->findObject(objectName); + PvlObject &object = parent->findObject(objectName.toStdString()); // Find all the keywords at the object level for (int k = 0; k < object.keywords(); k++) { @@ -337,7 +337,7 @@ PvlObject fetchCoefficients(Pvl &calibration, QList &hierarchy) { void checkCoefficients(PvlObject &coefficients, QStringList keyNames) { QStringList missingCoeffs; foreach(const QString &key, keyNames) { - if (!coefficients.hasKeyword(key)) { + if (!coefficients.hasKeyword(key.toStdString())) { missingCoeffs.append(key); } } diff --git a/isis/src/voyager/apps/voyramp/main.cpp b/isis/src/voyager/apps/voyramp/main.cpp index a47a1eb315..83c1efbf79 100644 --- a/isis/src/voyager/apps/voyramp/main.cpp +++ b/isis/src/voyager/apps/voyramp/main.cpp @@ -84,7 +84,7 @@ void IsisMain() { } // Image time - iTime time(inst["StartTime"][0]); + iTime time(QString::fromStdString(inst["StartTime"][0])); // Day 64, hour 1 iTime min("1979-03-05T01:00:00.000"); // Day 64, hour 17 @@ -155,10 +155,10 @@ void IsisMain() { plasmaC = detb3/deta; // Create data to go in Radiometry group - PvlKeyword top = PvlKeyword("TopCorrectiveDN", toString(y1)); + PvlKeyword top = PvlKeyword("TopCorrectiveDN", std::to_string(y1)); top.addComment("Voyramp plasma torus corrective DN values:"); - PvlKeyword mid = PvlKeyword("MiddleCorrectiveDN", toString(y2)); - PvlKeyword bot = PvlKeyword("BottomCorrectiveDN", toString(y3)); + PvlKeyword mid = PvlKeyword("MiddleCorrectiveDN", std::to_string(y2)); + PvlKeyword bot = PvlKeyword("BottomCorrectiveDN", std::to_string(y3)); // Add it radio += top; diff --git a/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp b/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp index 8cf15adfc4..1880223d89 100644 --- a/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp +++ b/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp @@ -59,8 +59,8 @@ namespace Isis { // and camera Pvl &lab = *cube.label(); PvlGroup &inst = lab.findGroup ("Instrument",Pvl::Traverse); - QString spacecraft = (QString)inst["SpacecraftName"]; - QString instId = (QString)inst["InstrumentId"]; + QString spacecraft = QString::fromStdString(inst["SpacecraftName"]); + QString instId = QString::fromStdString(inst["InstrumentId"]); QString reseauFileName = ""; @@ -143,7 +143,7 @@ namespace Isis { // exposure duration keyword value is measured in seconds double exposureDuration = inst["ExposureDuration"]; iTime startTime; - startTime.setUtc((QString)inst["StartTime"]); + startTime.setUtc(QString::fromStdString(inst["StartTime"])); // set the start (shutter open) and end (shutter close) times for the image /***************************************************************************** diff --git a/isis/tests/AutoseedTests.cpp b/isis/tests/AutoseedTests.cpp index 8fbcc3fc9a..db37a27af3 100644 --- a/isis/tests/AutoseedTests.cpp +++ b/isis/tests/AutoseedTests.cpp @@ -51,7 +51,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDefault) { Pvl autoseedDef; autoseedDef.addObject(autoseedObject); - autoseedDef.write(defFile); + autoseedDef.write(defFile.toStdString()); QVector autoseedArgs = {"fromlist="+cubeListFile, "onet="+outnet, @@ -85,7 +85,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedCnetInput) { Pvl autoseedDef; autoseedDef.addObject(autoseedObject); - autoseedDef.write(defFile); + autoseedDef.write(defFile.toStdString()); cubeList->removeLast(); cubeList->write(cubeListFile); @@ -144,7 +144,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDeffiles) { Pvl autoseedDef; autoseedDef.addObject(autoseedObject); - autoseedDef.write(defFile); + autoseedDef.write(defFile.toStdString()); autoseed(autoseedUi, log); ControlNet onet(outnet); @@ -156,7 +156,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDeffiles) { autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").deleteKeyword("MaxDN"); autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").addKeyword(PvlKeyword("MinEmission", "18.0")); autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").addKeyword(PvlKeyword("MaxEmission", "75.0")); - autoseedDef.write(defFile); + autoseedDef.write(defFile.toStdString()); autoseed(autoseedUi, log); onet = ControlNet(outnet); @@ -167,7 +167,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDeffiles) { autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").deleteKeyword("MinEmission"); autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").deleteKeyword("MaxEmission"); autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").addKeyword(PvlKeyword("PixelsFromEdge", "20.0")); - autoseedDef.write(defFile); + autoseedDef.write(defFile.toStdString()); autoseed(autoseedUi, log); onet = ControlNet(outnet); @@ -178,7 +178,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDeffiles) { autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").deleteKeyword("PixelsFromEdge"); autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").addKeyword(PvlKeyword("MinIncidence", "35.0")); autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").addKeyword(PvlKeyword("MaxIncidence", "65.0")); - autoseedDef.write(defFile); + autoseedDef.write(defFile.toStdString()); autoseed(autoseedUi, log); onet = ControlNet(outnet); @@ -190,7 +190,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDeffiles) { autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").deleteKeyword("MaxIncidence"); autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").addKeyword(PvlKeyword("MinResolution", "255.0")); autoseedDef.findObject("AutoSeed").findGroup("PolygonSeederAlgorithm").addKeyword(PvlKeyword("MaxResolution", "259.0")); - autoseedDef.write(defFile); + autoseedDef.write(defFile.toStdString()); autoseed(autoseedUi, log); onet = ControlNet(outnet); diff --git a/isis/tests/CameraFixtures.cpp b/isis/tests/CameraFixtures.cpp index 5c7b38e931..9a71cf00fa 100644 --- a/isis/tests/CameraFixtures.cpp +++ b/isis/tests/CameraFixtures.cpp @@ -219,9 +219,9 @@ namespace Isis { label.addObject(isisCube); PvlGroup &dim = label.findObject("IsisCube").findObject("Core").findGroup("Dimensions"); - dim.findKeyword("Samples").setValue(QString::number(samples)); - dim.findKeyword("Lines").setValue(QString::number(lines)); - dim.findKeyword("Bands").setValue(QString::number(bands)); + dim.findKeyword("Samples").setValue(std::to_string(samples)); + dim.findKeyword("Lines").setValue(std::to_string(lines)); + dim.findKeyword("Bands").setValue(std::to_string(bands)); delete testCube; testCube = new Cube(); @@ -245,9 +245,9 @@ namespace Isis { projLabel.addObject(isisProjCube); PvlGroup &projDim = projLabel.findObject("IsisCube").findObject("Core").findGroup("Dimensions"); - projDim.findKeyword("Samples").setValue(QString::number(samples)); - projDim.findKeyword("Lines").setValue(QString::number(lines)); - projDim.findKeyword("Bands").setValue(QString::number(bands)); + projDim.findKeyword("Samples").setValue(std::to_string(samples)); + projDim.findKeyword("Lines").setValue(std::to_string(lines)); + projDim.findKeyword("Bands").setValue(std::to_string(bands)); delete projTestCube; projTestCube = new Cube(); @@ -670,7 +670,7 @@ namespace Isis { label.addObject(isisCube); PvlGroup &kernels = label.findObject("IsisCube").findGroup("Kernels"); - kernels.findKeyword("NaifFrameCode").setValue(ikid); + kernels.findKeyword("NaifFrameCode").setValue(ikid.toStdString()); kernels["ShapeModel"] = "Null"; PvlGroup &dim = label.findObject("IsisCube").findObject("Core").findGroup("Dimensions"); @@ -698,8 +698,8 @@ namespace Isis { PvlGroup newInstGroup; iss >> newInstGroup; - newInstGroup.findKeyword("InstrumentId").setValue(instrumentId); - newInstGroup.findKeyword("SpacecraftName").setValue(spacecraftName); + newInstGroup.findKeyword("InstrumentId").setValue(instrumentId.toStdString()); + newInstGroup.findKeyword("SpacecraftName").setValue(spacecraftName.toStdString()); inst = newInstGroup; @@ -761,7 +761,7 @@ namespace Isis { testCube->fromIsd(newCube, label, isd, "rw"); PvlGroup &kernels = testCube->label()->findObject("IsisCube").findGroup("Kernels"); - kernels.findKeyword("NaifFrameCode").setValue(ikid); + kernels.findKeyword("NaifFrameCode").setValue(ikid.toStdString()); kernels["ShapeModel"] = "Null"; PvlGroup &inst = testCube->label()->findObject("IsisCube").findGroup("Instrument"); @@ -781,7 +781,7 @@ namespace Isis { PvlGroup newInstGroup; iss >> newInstGroup; - newInstGroup.findKeyword("InstrumentId").setValue(instrumentId); + newInstGroup.findKeyword("InstrumentId").setValue(instrumentId.toStdString()); inst = newInstGroup; diff --git a/isis/tests/ClipperWacFcCameraTests.cpp b/isis/tests/ClipperWacFcCameraTests.cpp index 5cd2136d28..a182888b70 100644 --- a/isis/tests/ClipperWacFcCameraTests.cpp +++ b/isis/tests/ClipperWacFcCameraTests.cpp @@ -74,7 +74,7 @@ TEST_F(ClipperWacFcCube, ClipperWacFcCameraUnitTest) { // Simple test for ClipperWacFcCamera::ShutterOpenCloseTimes PvlGroup &inst = wacFcCube->label()->findObject("IsisCube").findGroup("Instrument", Pvl::Traverse); - QString startTime = inst["StartTime"]; + QString startTime = QString::fromStdString(inst["StartTime"]); iTime etStart(startTime); std::pair startStop; diff --git a/isis/tests/CsmFixtures.cpp b/isis/tests/CsmFixtures.cpp index 17f864e8d7..697d980829 100644 --- a/isis/tests/CsmFixtures.cpp +++ b/isis/tests/CsmFixtures.cpp @@ -88,8 +88,8 @@ namespace Isis { // CSMState BLOB Blob csmStateBlob("CSMState", "String"); csmStateBlob.setData(mockModelName.c_str(), mockModelName.size()); - csmStateBlob.Label() += PvlKeyword("ModelName", QString::fromStdString(mockModelName)); - csmStateBlob.Label() += PvlKeyword("PluginName", QString::fromStdString(loadablePlugin.getPluginName())); + csmStateBlob.Label() += PvlKeyword("ModelName", mockModelName); + csmStateBlob.Label() += PvlKeyword("PluginName", loadablePlugin.getPluginName()); testCube->write(csmStateBlob); filename = testCube->fileName(); testCube->close(); diff --git a/isis/tests/CubeFixtures.cpp b/isis/tests/CubeFixtures.cpp index 18612e1eee..fe835b4837 100644 --- a/isis/tests/CubeFixtures.cpp +++ b/isis/tests/CubeFixtures.cpp @@ -308,13 +308,13 @@ namespace Isis { } PvlGroup reseausGroup("Reseaus"); - PvlKeyword samples = PvlKeyword("Sample", QString::number(reseaus[0].first)); - PvlKeyword lines = PvlKeyword("Line", QString::number(reseaus[0].second)); + PvlKeyword samples = PvlKeyword("Sample", std::to_string(reseaus[0].first)); + PvlKeyword lines = PvlKeyword("Line", std::to_string(reseaus[0].second)); PvlKeyword types = PvlKeyword("Type", "5"); PvlKeyword valid = PvlKeyword("Valid", "1"); for (size_t i = 1; i < reseaus.size(); i++) { - samples += QString::number(reseaus[i].first); - lines += QString::number(reseaus[i].second); + samples += std::to_string(reseaus[i].first); + lines += std::to_string(reseaus[i].second); types += "5"; valid += "1"; } diff --git a/isis/tests/FunctionalTestsApollofindrx.cpp b/isis/tests/FunctionalTestsApollofindrx.cpp index 8b673cd9d5..e18689bc14 100644 --- a/isis/tests/FunctionalTestsApollofindrx.cpp +++ b/isis/tests/FunctionalTestsApollofindrx.cpp @@ -69,21 +69,21 @@ TEST_F(LargeCube, FunctionalTestApollofindrxDefault) { PvlGroup newReseaus = newLab.findObject("IsisCube").findGroup("Reseaus"); PvlKeyword testKeyword = newReseaus.findKeyword("Line"); - EXPECT_NEAR(testKeyword[0].toDouble(), 100.8141, 0.0001); - EXPECT_NEAR(testKeyword[1].toDouble(), 192.8, 0.0001); - EXPECT_NEAR(testKeyword[2].toDouble(), 275.8, 0.0001); + EXPECT_NEAR(std::stod(testKeyword[0]), 100.8141, 0.0001); + EXPECT_NEAR(std::stod(testKeyword[1]), 192.8, 0.0001); + EXPECT_NEAR(std::stod(testKeyword[2]), 275.8, 0.0001); testKeyword = newReseaus.findKeyword("Sample"); - EXPECT_NEAR(testKeyword[0].toDouble(), 100.8141, 0.0001); - EXPECT_NEAR(testKeyword[1].toDouble(), 192.8, 0.0001); - EXPECT_NEAR(testKeyword[2].toDouble(), 167.8, 0.0001); + EXPECT_NEAR(std::stod(testKeyword[0]), 100.8141, 0.0001); + EXPECT_NEAR(std::stod(testKeyword[1]), 192.8, 0.0001); + EXPECT_NEAR(std::stod(testKeyword[2]), 167.8, 0.0001); testKeyword = newReseaus.findKeyword("Valid"); - EXPECT_EQ(testKeyword[0].toInt(), 1); - EXPECT_EQ(testKeyword[1].toInt(), 1); - EXPECT_EQ(testKeyword[2].toInt(), 1); + EXPECT_EQ(std::stoi(testKeyword[0]), 1); + EXPECT_EQ(std::stoi(testKeyword[1]), 1); + EXPECT_EQ(std::stoi(testKeyword[2]), 1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, newReseaus.findKeyword("Status"), "Refined"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, newReseaus.findKeyword("Status"), "Refined"); // Assert some stuff } diff --git a/isis/tests/FunctionalTestsApolloremrx.cpp b/isis/tests/FunctionalTestsApolloremrx.cpp index 394ccbde99..7c2b31051b 100644 --- a/isis/tests/FunctionalTestsApolloremrx.cpp +++ b/isis/tests/FunctionalTestsApolloremrx.cpp @@ -36,21 +36,21 @@ TEST_F(ApolloCube, FunctionalTestApolloremrxDefault) { PvlGroup reseausGroup = isisLabel->findObject("IsisCube").findGroup("Reseaus"); PvlKeyword lineKey = reseausGroup.findKeyword("Line"); - EXPECT_NEAR(lineKey[0].toDouble(), 200, 0.0001); - EXPECT_NEAR(lineKey[1].toDouble(), 400, 0.0001); - EXPECT_NEAR(lineKey[2].toDouble(), 600, 0.0001); + EXPECT_NEAR(std::stod(lineKey[0]), 200, 0.0001); + EXPECT_NEAR(std::stod(lineKey[1]), 400, 0.0001); + EXPECT_NEAR(std::stod(lineKey[2]), 600, 0.0001); PvlKeyword sampleKey = reseausGroup.findKeyword("Sample"); - EXPECT_NEAR(sampleKey[0].toDouble(), 200, 0.0001); - EXPECT_NEAR(sampleKey[1].toDouble(), 400, 0.0001); - EXPECT_NEAR(sampleKey[2].toDouble(), 600, 0.0001); + EXPECT_NEAR(std::stod(sampleKey[0]), 200, 0.0001); + EXPECT_NEAR(std::stod(sampleKey[1]), 400, 0.0001); + EXPECT_NEAR(std::stod(sampleKey[2]), 600, 0.0001); PvlKeyword validKey = reseausGroup.findKeyword("Valid"); - EXPECT_EQ(validKey[0].toInt(), 1); - EXPECT_EQ(validKey[1].toInt(), 1); - EXPECT_EQ(validKey[2].toInt(), 1); + EXPECT_EQ(std::stoi(validKey[0]), 1); + EXPECT_EQ(std::stoi(validKey[1]), 1); + EXPECT_EQ(std::stoi(validKey[2]), 1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, reseausGroup.findKeyword("Status"), "Removed"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, reseausGroup.findKeyword("Status"), "Removed"); Brick brick(reseauSize,reseauSize,1,cube.pixelType()); diff --git a/isis/tests/FunctionalTestsAutomos.cpp b/isis/tests/FunctionalTestsAutomos.cpp index 8aaf061ae9..7b7bdb2eb5 100644 --- a/isis/tests/FunctionalTestsAutomos.cpp +++ b/isis/tests/FunctionalTestsAutomos.cpp @@ -32,8 +32,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosDefault) { PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Sinusoidal"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Sinusoidal"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "MARS"); EXPECT_EQ((double)mapping.findKeyword("UpperLeftCornerX"), 0); EXPECT_EQ((double)mapping.findKeyword("UpperLeftCornerY"), 600000); EXPECT_EQ((double)mapping.findKeyword("PixelResolution"), 100000); @@ -118,8 +118,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosPriority) { PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Sinusoidal"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Sinusoidal"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "MARS"); EXPECT_EQ((double)mapping.findKeyword("UpperLeftCornerX"), 0); EXPECT_EQ((double)mapping.findKeyword("UpperLeftCornerY"), 600000); EXPECT_EQ((double)mapping.findKeyword("PixelResolution"), 100000); @@ -166,8 +166,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosTracking) { PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); PvlGroup tMapping = trackingLabel.findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), (QString)tMapping.findKeyword("ProjectionName")); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), (QString)tMapping.findKeyword("TargetName")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), tMapping.findKeyword("ProjectionName")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), tMapping.findKeyword("TargetName")); EXPECT_EQ((double)mapping.findKeyword("UpperLeftCornerX"), (double)mapping.findKeyword("UpperLeftCornerX")); EXPECT_EQ((double)mapping.findKeyword("UpperLeftCornerY"), (double)tMapping.findKeyword("UpperLeftCornerY")); EXPECT_EQ((double)mapping.findKeyword("PixelResolution"), (double)tMapping.findKeyword("PixelResolution")); @@ -203,8 +203,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosBandSelect) { Pvl label = *mos.label(); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Sinusoidal"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Sinusoidal"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "MARS"); EXPECT_EQ((double)mapping.findKeyword("UpperLeftCornerX"), 0); EXPECT_EQ((double)mapping.findKeyword("UpperLeftCornerY"), 600000); EXPECT_EQ((double)mapping.findKeyword("PixelResolution"), 100000); diff --git a/isis/tests/FunctionalTestsCaminfo.cpp b/isis/tests/FunctionalTestsCaminfo.cpp index 5ecd167849..56eac3445c 100644 --- a/isis/tests/FunctionalTestsCaminfo.cpp +++ b/isis/tests/FunctionalTestsCaminfo.cpp @@ -45,7 +45,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCsv) { FAIL() << "Failed to run caminfo with PVL output: " << e.what() << std::endl; } - Pvl caminfoPvl(outPvlFileName); + Pvl caminfoPvl(outPvlFileName.toStdString()); ASSERT_TRUE(caminfoPvl.hasObject("Caminfo")); PvlObject camobj = caminfoPvl.findObject("Caminfo"); @@ -67,27 +67,27 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCsv) { for (int i = 0; i < parameters.keywords(); i++) { PvlKeyword currentKey = parameters[i]; - CSVReader::CSVAxis currentColumn = caminfoCsv.getColumn(currentKey.name()); + CSVReader::CSVAxis currentColumn = caminfoCsv.getColumn(QString::fromStdString(currentKey.name())); // Skip RunDate as it's not in the CSV if (currentKey.name() != "RunDate") { EXPECT_TRUE(currentColumn.dim1() > 0) << "Failed to find column [" << - currentKey.name().toStdString() << "] in CSV"; + currentKey.name() << "] in CSV"; QString stringCsvValue = currentColumn[0]; bool isCsvNumeric = false; double numericCsvValue = stringCsvValue.toDouble(&isCsvNumeric); - QString stringPvlValue = QString(currentKey); + QString stringPvlValue = QString::fromStdString(currentKey); bool isPvlNumeric = false; double numericPvlValue = stringPvlValue.toDouble(&isPvlNumeric); if (isCsvNumeric && isPvlNumeric) { EXPECT_NEAR(numericCsvValue, numericPvlValue, 0.001) << - "Column [" << currentKey.name().toStdString() << "] value [" << + "Column [" << currentKey.name() << "] value [" << stringCsvValue.toStdString() << "] does not match Pvl value [" << stringPvlValue.toStdString() << "] within tolerance [0.001]."; } else { EXPECT_EQ(stringCsvValue.toStdString(), stringPvlValue.toStdString()) << - "Column [" << currentKey.name().toStdString() << "] value [" << + "Column [" << currentKey.name() << "] value [" << stringCsvValue.toStdString() << "] does not match Pvl value [" << stringPvlValue.toStdString() << "]."; } @@ -96,14 +96,14 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCsv) { for (int i = 0; i < camstats.keywords(); i++) { PvlKeyword currentKey = camstats[i]; - QString columnName = "CamStats_" + currentKey.name(); + QString columnName = "CamStats_" + QString::fromStdString(currentKey.name()); CSVReader::CSVAxis currentColumn = caminfoCsv.getColumn(columnName); EXPECT_TRUE(currentColumn.dim1() > 0) << "Failed to find column [" << columnName.toStdString() << "] in CSV"; QString stringCsvValue = currentColumn[0]; bool isCsvNumeric = false; double numericCsvValue = stringCsvValue.toDouble(&isCsvNumeric); - QString stringPvlValue = QString(currentKey); + QString stringPvlValue = QString::fromStdString(currentKey); bool isPvlNumeric = false; double numericPvlValue = stringPvlValue.toDouble(&isPvlNumeric); if (isCsvNumeric && isPvlNumeric) { @@ -122,14 +122,14 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCsv) { for (int i = 0; i < statistics.keywords(); i++) { PvlKeyword currentKey = statistics[i]; - QString columnName = "Stats_" + currentKey.name(); + QString columnName = "Stats_" + QString::fromStdString(currentKey.name()); CSVReader::CSVAxis currentColumn = caminfoCsv.getColumn(columnName); EXPECT_TRUE(currentColumn.dim1() > 0) << "Failed to find column [" << columnName.toStdString() << "] in CSV"; QString stringCsvValue = currentColumn[0]; bool isCsvNumeric = false; double numericCsvValue = stringCsvValue.toDouble(&isCsvNumeric); - QString stringPvlValue = QString(currentKey); + QString stringPvlValue = QString::fromStdString(currentKey); bool isPvlNumeric = false; double numericPvlValue = stringPvlValue.toDouble(&isPvlNumeric); if (isCsvNumeric && isPvlNumeric) { @@ -148,14 +148,14 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCsv) { for (int i = 0; i < geometry.keywords(); i++) { PvlKeyword currentKey = geometry[i]; - QString columnName = "Geom_" + currentKey.name(); + QString columnName = "Geom_" + QString::fromStdString(currentKey.name()); CSVReader::CSVAxis currentColumn = caminfoCsv.getColumn(columnName); EXPECT_TRUE(currentColumn.dim1() > 0) << "Failed to find column [" << columnName.toStdString() << "] in CSV"; QString stringCsvValue = currentColumn[0]; bool isCsvNumeric = false; double numericCsvValue = stringCsvValue.toDouble(&isCsvNumeric); - QString stringPvlValue = QString(currentKey); + QString stringPvlValue = QString::fromStdString(currentKey); bool isPvlNumeric = false; double numericPvlValue = stringPvlValue.toDouble(&isPvlNumeric); if (isCsvNumeric && isPvlNumeric) { @@ -197,10 +197,10 @@ TEST_F(DefaultCube, FunctionalTestCaminfoDefault) { PvlGroup &group = statsPvl.group(i); int entry = 0; - record[entry] = group.name().toStdString(); + record[entry] = group.name(); entry++; for (int j = 0; j < group.keywords(); j++) { - record[entry] = toDouble(group[j][0]); + record[entry] = std::stod(group[j][0]); entry++; } table += record; @@ -220,7 +220,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl pvlobject = Pvl(outFileName); + Pvl pvlobject = Pvl(outFileName.toStdString()); ASSERT_TRUE(pvlobject.hasObject("Caminfo")); PvlObject camobj = pvlobject.findObject("Caminfo"); @@ -311,9 +311,9 @@ TEST_F(DefaultCube, FunctionalTestCaminfoDefault) { EXPECT_DOUBLE_EQ(geometry.findKeyword("BandsUsed"), 1); EXPECT_DOUBLE_EQ(geometry.findKeyword("ReferenceBand"), 1); EXPECT_DOUBLE_EQ(geometry.findKeyword("OriginalBand"), 1); - EXPECT_EQ(geometry.findKeyword("Target")[0].toStdString(), "MARS"); - EXPECT_EQ(geometry.findKeyword("StartTime")[0].toStdString(), "1977-07-09T20:05:51.5549999"); - EXPECT_EQ(geometry.findKeyword("EndTime")[0].toStdString(), "1977-07-09T20:05:51.5549999"); + EXPECT_EQ(geometry.findKeyword("Target")[0], "MARS"); + EXPECT_EQ(geometry.findKeyword("StartTime")[0], "1977-07-09T20:05:51.5549999"); + EXPECT_EQ(geometry.findKeyword("EndTime")[0], "1977-07-09T20:05:51.5549999"); EXPECT_DOUBLE_EQ(geometry.findKeyword("CenterLine"), 528.0); EXPECT_DOUBLE_EQ(geometry.findKeyword("CenterSample"), 602.0); EXPECT_NEAR(geometry.findKeyword("CenterLatitude"), 10.181441241544, 0.0001); @@ -354,9 +354,9 @@ TEST_F(DefaultCube, FunctionalTestCaminfoDefault) { EXPECT_NEAR(geometry.findKeyword("ParallaxY"), -0.21479478952768, 0.0001); EXPECT_NEAR(geometry.findKeyword("ShadowX"), 1.3359751259293, 0.0001); EXPECT_NEAR(geometry.findKeyword("ShadowY"), 2.4227562244446, 0.0001); - EXPECT_EQ(geometry.findKeyword("HasLongitudeBoundary")[0].toStdString(), "FALSE"); - EXPECT_EQ(geometry.findKeyword("HasNorthPole")[0].toStdString(), "FALSE"); - EXPECT_EQ(geometry.findKeyword("HasSouthPole")[0].toStdString(), "FALSE"); + EXPECT_EQ(geometry.findKeyword("HasLongitudeBoundary")[0], "FALSE"); + EXPECT_EQ(geometry.findKeyword("HasNorthPole")[0], "FALSE"); + EXPECT_EQ(geometry.findKeyword("HasSouthPole")[0], "FALSE"); EXPECT_NEAR(geometry.findKeyword("ObliqueSampleResolution"), 19.589652452595999, 0.0001); EXPECT_NEAR(geometry.findKeyword("ObliqueLineResolution"), 19.589652452595999, 0.0001); EXPECT_NEAR(geometry.findKeyword("ObliquePixelResolution"), 19.589652452595999, 0.0001); @@ -378,7 +378,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoPoly) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl pvlobject = Pvl(outFileName); + Pvl pvlobject = Pvl(outFileName.toStdString()); PvlObject camobj = pvlobject.findObject("Caminfo"); PvlObject poly = camobj.findObject("Polygon"); @@ -409,7 +409,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoBoundary) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl pvlobject = Pvl(outFileName); + Pvl pvlobject = Pvl(outFileName.toStdString()); PvlObject camobj = pvlobject.findObject("Caminfo"); PvlObject poly = camobj.findObject("Polygon"); @@ -466,10 +466,10 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCamStatsTable) { PvlGroup &group = statsPvl.group(i); int entry = 0; - record[entry] = group.name().toStdString(); + record[entry] = group.name(); entry++; for (int j = 0; j < group.keywords(); j++) { - record[entry] = toDouble(group[j][0]); + record[entry] = std::stod(group[j][0]); entry++; } table += record; @@ -489,7 +489,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCamStatsTable) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl pvlobject = Pvl(outFileName); + Pvl pvlobject = Pvl(outFileName.toStdString()); ASSERT_TRUE(pvlobject.hasObject("Caminfo")); PvlObject camobj = pvlobject.findObject("Caminfo"); diff --git a/isis/tests/FunctionalTestsCampt.cpp b/isis/tests/FunctionalTestsCampt.cpp index 222c8d9c04..1e6aed93c5 100644 --- a/isis/tests/FunctionalTestsCampt.cpp +++ b/isis/tests/FunctionalTestsCampt.cpp @@ -78,7 +78,7 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("Sample"), 602.0); EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("Line"), 528.0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, groundPoint.findKeyword("PixelValue"), "Null"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, groundPoint.findKeyword("PixelValue"), "Null"); EXPECT_NEAR( (double) groundPoint.findKeyword("RightAscension"), 310.2070335306, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("Declination"), -46.327246785573, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("PlanetocentricLatitude"), 10.181441241544, 1e-8); @@ -88,9 +88,9 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_NEAR( (double) groundPoint.findKeyword("PositiveWest360Longitude"), 104.10707141824, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("PositiveWest180Longitude"), 104.10707141824, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("BodyFixedCoordinate")[0]), -818.59644749774, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("BodyFixedCoordinate")[1]), -3257.2675597135, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("BodyFixedCoordinate")[2]), 603.17640797124, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("BodyFixedCoordinate")[0]), -818.59644749774, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("BodyFixedCoordinate")[1]), -3257.2675597135, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("BodyFixedCoordinate")[2]), 603.17640797124, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("LocalRadius"), 3412288.6569795, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SampleResolution"), 18.904248467739, 1e-8); @@ -100,9 +100,9 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_NEAR( (double) groundPoint.findKeyword("ObliqueLineResolution"), 19.589652452595999, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("ObliqueSampleResolution"), 19.589652452595999, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("SpacecraftPosition")[0]), -1152.8979327717, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("SpacecraftPosition")[1]), -3930.9421518203, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("SpacecraftPosition")[2]), 728.14118380775, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("SpacecraftPosition")[0]), -1152.8979327717, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("SpacecraftPosition")[1]), -3930.9421518203, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("SpacecraftPosition")[2]), 728.14118380775, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SpacecraftAzimuth"), 240.08514246657, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SlantDistance"), 762.37204454685, 1e-8); @@ -113,9 +113,9 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_NEAR( (double) groundPoint.findKeyword("OffNadirAngle"), 9.9273765143684, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SubSpacecraftGroundAzimuth"), 267.5318718687, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("SunPosition")[0]), 147591102.63158, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("SunPosition")[1]), -127854342.1274, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("SunPosition")[2]), -81844199.02275, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("SunPosition")[0]), 147591102.63158, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("SunPosition")[1]), -127854342.1274, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("SunPosition")[2]), -81844199.02275, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SubSolarAzimuth"), 92.033828156965, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SolarDistance"), 1.4153000672557, 1e-8); @@ -129,21 +129,21 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_NEAR( (double) groundPoint.findKeyword("NorthAzimuth"), 332.65918493997, 2e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("EphemerisTime"), -709401200.26114, 1e-8); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, groundPoint.findKeyword("UTC"), "1977-07-09T20:05:51.5549999"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, groundPoint.findKeyword("UTC"), "1977-07-09T20:05:51.5549999"); EXPECT_NEAR( (double) groundPoint.findKeyword("LocalSolarTime"), 7.7862975330952, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SolarLongitude"), 294.73518830594998, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[0]), 0.43850176257802, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[1]), 0.88365594846443, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[2]), -0.16391573737569, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionBodyFixed")[0]), 0.43850176257802, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionBodyFixed")[1]), 0.88365594846443, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionBodyFixed")[2]), -0.16391573737569, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionJ2000")[0]), 0.44577814515745, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionJ2000")[1]), -0.52737586689974, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionJ2000")[2]), -0.72329561059897, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionJ2000")[0]), 0.44577814515745, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionJ2000")[1]), -0.52737586689974, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionJ2000")[2]), -0.72329561059897, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionCamera")[0]), -1.27447324380581e-04, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionCamera")[1]), 2.5816511718707e-05, 1e-8); - EXPECT_NEAR( toDouble(groundPoint.findKeyword("LookDirectionCamera")[2]), 0.99999999154535, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionCamera")[0]), -1.27447324380581e-04, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionCamera")[1]), 2.5816511718707e-05, 1e-8); + EXPECT_NEAR( std::stod(groundPoint.findKeyword("LookDirectionCamera")[2]), 0.99999999154535, 1e-8); } TEST_F(DefaultCube, FunctionalTestCamptSetSL) { @@ -240,18 +240,18 @@ TEST_F(DefaultCube, FunctionalTestCamptCoordList) { EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("Sample"), 1.0); EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("Line"), 10.0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, groundPoint.findKeyword("Error"), "NULL"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, groundPoint.findKeyword("Error"), "NULL"); groundPoint = appLog.group(1); EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("Sample"), 10.0); EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("Line"), 100.0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, groundPoint.findKeyword("Error"), "NULL"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, groundPoint.findKeyword("Error"), "NULL"); groundPoint = appLog.group(2); EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("Sample"), 100.0); EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("Line"), 10000.0); QString ErrorMsg = "Requested position does not project in camera model; no surface intersection"; - EXPECT_PRED_FORMAT2(AssertQStringsEqual, groundPoint.findKeyword("Error"), ErrorMsg); + EXPECT_PRED_FORMAT2(AssertStringsEqual, groundPoint.findKeyword("Error"), ErrorMsg.toStdString()); } @@ -274,7 +274,7 @@ TEST_F(DefaultCube, FunctionalTestCamptAllowError) { campt(testCube, options, &appLog); PvlGroup groundPoint = appLog.findGroup("GroundPoint"); QString ErrorMsg = "Requested position does not project in camera model; no surface intersection"; - EXPECT_PRED_FORMAT2(AssertQStringsEqual, groundPoint.findKeyword("Error"), ErrorMsg); + EXPECT_PRED_FORMAT2(AssertStringsEqual, groundPoint.findKeyword("Error"), ErrorMsg.toStdString()); } TEST_F(CSMCubeFixture, FunctionalTestCamptCSMCamera) { diff --git a/isis/tests/FunctionalTestsCamrange.cpp b/isis/tests/FunctionalTestsCamrange.cpp index 5fc5cb9e08..62d93f59d3 100644 --- a/isis/tests/FunctionalTestsCamrange.cpp +++ b/isis/tests/FunctionalTestsCamrange.cpp @@ -21,8 +21,8 @@ TEST_F(DefaultCube, FunctionalTestCamrangeMeta) { camrange(options, &appLog); PvlGroup target = appLog.findGroup("Target"); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, target.findKeyword("FROM"), testCube->fileName() ); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, target.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2( AssertStringsEqual, target.findKeyword("FROM"), testCube->fileName().toStdString() ); + EXPECT_PRED_FORMAT2( AssertStringsEqual, target.findKeyword("TargetName"), "MARS"); EXPECT_EQ( (double) target.findKeyword("RadiusA"), 3396190.0 ); EXPECT_EQ( (double) target.findKeyword("RadiusB"), 3396190.0 ); EXPECT_EQ( (double) target.findKeyword("RadiusC"), 3376200.0 ); @@ -40,9 +40,9 @@ TEST_F(DefaultCube, FunctionalTestCamrangeUniversalGround) { camrange(options, &appLog); PvlGroup universalGroundRange = appLog.findGroup("UniversalGroundRange"); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, universalGroundRange.findKeyword("LatitudeType"), "Planetocentric" ); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, universalGroundRange.findKeyword("LongitudeDirection"), "PositiveEast" ); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, universalGroundRange.findKeyword("LongitudeDirection"), "PositiveEast" ); + EXPECT_PRED_FORMAT2( AssertStringsEqual, universalGroundRange.findKeyword("LatitudeType"), "Planetocentric" ); + EXPECT_PRED_FORMAT2( AssertStringsEqual, universalGroundRange.findKeyword("LongitudeDirection"), "PositiveEast" ); + EXPECT_PRED_FORMAT2( AssertStringsEqual, universalGroundRange.findKeyword("LongitudeDirection"), "PositiveEast" ); EXPECT_EQ( (int) universalGroundRange.findKeyword("LongitudeDomain"), 360 ); EXPECT_EQ( (double) universalGroundRange.findKeyword("MinimumLatitude"), 9.928429270844 ); EXPECT_EQ( (double) universalGroundRange.findKeyword("MaximumLatitude"), 10.434928979804 ); @@ -58,7 +58,7 @@ TEST_F(DefaultCube, FunctionalTestCamrangeLatitude) { camrange(options, &appLog); PvlGroup latitudeRange = appLog.findGroup("LatitudeRange"); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, latitudeRange.findKeyword("LatitudeType"), "Planetographic" ); + EXPECT_PRED_FORMAT2( AssertStringsEqual, latitudeRange.findKeyword("LatitudeType"), "Planetographic" ); EXPECT_EQ( (double) latitudeRange.findKeyword("MinimumLatitude"), 10.043959653331 ); EXPECT_EQ( (double) latitudeRange.findKeyword("MaximumLatitude"), 10.55609248546 ); } @@ -71,19 +71,19 @@ TEST_F(DefaultCube, FunctionalTestCamrangeCardinals) { camrange(options, &appLog); PvlGroup positiveWest360 = appLog.findGroup("PositiveWest360"); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, positiveWest360.findKeyword("LongitudeDirection"), "PositiveWest" ); + EXPECT_PRED_FORMAT2( AssertStringsEqual, positiveWest360.findKeyword("LongitudeDirection"), "PositiveWest" ); EXPECT_EQ( (int) positiveWest360.findKeyword("LongitudeDomain"), 360 ); EXPECT_EQ( (double) positiveWest360.findKeyword("MinimumLongitude"), 103.85369874119 ); EXPECT_EQ( (double) positiveWest360.findKeyword("MaximumLongitude"), 104.35467340125 ); PvlGroup positiveEast180 = appLog.findGroup("PositiveEast180"); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, positiveEast180.findKeyword("LongitudeDirection"), "PositiveEast" ); + EXPECT_PRED_FORMAT2( AssertStringsEqual, positiveEast180.findKeyword("LongitudeDirection"), "PositiveEast" ); EXPECT_EQ( (int) positiveEast180.findKeyword("LongitudeDomain"), 180 ); EXPECT_EQ( (double) positiveEast180.findKeyword("MinimumLongitude"), -104.35467340125 ); EXPECT_EQ( (double) positiveEast180.findKeyword("MaximumLongitude"), -103.85369874119 ); PvlGroup positiveWest180 = appLog.findGroup("PositiveWest180"); - EXPECT_PRED_FORMAT2( AssertQStringsEqual, positiveWest180.findKeyword("LongitudeDirection"), "PositiveWest" ); + EXPECT_PRED_FORMAT2( AssertStringsEqual, positiveWest180.findKeyword("LongitudeDirection"), "PositiveWest" ); EXPECT_EQ( (int) positiveWest180.findKeyword("LongitudeDomain"), 180 ); EXPECT_EQ( (double) positiveWest180.findKeyword("MinimumLongitude"), 103.85369874119 ); EXPECT_EQ( (double) positiveWest180.findKeyword("MaximumLongitude"), 104.35467340125 ); diff --git a/isis/tests/FunctionalTestsChan1m32isis.cpp b/isis/tests/FunctionalTestsChan1m32isis.cpp index 81d4c22022..e2bfee3a17 100644 --- a/isis/tests/FunctionalTestsChan1m32isis.cpp +++ b/isis/tests/FunctionalTestsChan1m32isis.cpp @@ -51,21 +51,21 @@ TEST(Chan1m32Isis, Chan1m32IsisTestFowardAscending) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "CHANDRAYAAN-1"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "M3" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "MOON" ); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "12/1759056.764" ); + ASSERT_EQ(inst["SpacecraftName"][0], "CHANDRAYAAN-1"); + ASSERT_EQ(inst["InstrumentId"][0], "M3" ); + ASSERT_EQ(inst["TargetName"][0], "MOON" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "12/1759056.764" ); ASSERT_DOUBLE_EQ(double(inst["LineExposureDuration"]), 50.88); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2009-06-30T08:34:35.424411" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2009-06-30T08:34:35.678811" ); - ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "FORWARD" ); - ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "ASCENDING" ); + ASSERT_EQ(inst["StartTime"][0], "2009-06-30T08:34:35.424411" ); + ASSERT_EQ(inst["StopTime"][0], "2009-06-30T08:34:35.678811" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0], "FORWARD" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0], "ASCENDING" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3T20090630T083407_V03_RDN" ); - ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3T20090630T083407_V01_L0.IMG" ); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + ASSERT_EQ(archive["ProductId"][0], "M3T20090630T083407_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0], "M3T20090630T083407_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0], "CALIBRATED_IMAGE" ); // BandBin Group // Check size, first, 2 middle, and last values? Enough? @@ -75,26 +75,26 @@ TEST(Chan1m32Isis, Chan1m32IsisTestFowardAscending) { ASSERT_EQ(bandbin["FilterNumber"].size(), 256); ASSERT_EQ(bandbin["OriginalBand"].size(), 256); - ASSERT_DOUBLE_EQ(bandbin["Center"][0].toDouble(), 446.02); - ASSERT_DOUBLE_EQ(bandbin["Center"][64].toDouble(), 1084.8); - ASSERT_DOUBLE_EQ(bandbin["Center"][128].toDouble(), 1723.5899999999999); - ASSERT_DOUBLE_EQ(bandbin["Center"][255].toDouble(), 2991.17); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][0]), 446.02); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][64]), 1084.8); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][128]), 1723.5899999999999); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][255]), 2991.17); - ASSERT_DOUBLE_EQ(bandbin["Width"][0].toDouble(), 12.31); - ASSERT_DOUBLE_EQ(bandbin["Width"][64].toDouble(), 12.29); - ASSERT_DOUBLE_EQ(bandbin["Width"][128].toDouble(), 12.61); - ASSERT_DOUBLE_EQ(bandbin["Width"][255].toDouble(), 12.18); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][0]), 12.31); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][64]), 12.29); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][128]), 12.61); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][255]), 12.18); - ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][0].toDouble(), 5); - ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][64].toDouble(), 69); - ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][128].toDouble(), 133); - ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][255].toDouble(), 260); + ASSERT_DOUBLE_EQ(std::stod(bandbin["FilterNumber"][0]), 5); + ASSERT_DOUBLE_EQ(std::stod(bandbin["FilterNumber"][64]), 69); + ASSERT_DOUBLE_EQ(std::stod(bandbin["FilterNumber"][128]), 133); + ASSERT_DOUBLE_EQ(std::stod(bandbin["FilterNumber"][255]), 260); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][0].toDouble(), 1); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][64].toDouble(), 65); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][128].toDouble(), 129); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][255].toDouble(), 256); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][0]), 1); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][64]), 65); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][128]), 129); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][255]), 256); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -134,18 +134,18 @@ TEST(Chan1m32Isis, Chan1m32IsisTestFowardDescending) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2/1531046.542" ); - ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "2/1531047.050" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2008-11-29T17:14:29.729807" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2008-11-29T17:14:30.238607" ); - ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "FORWARD" ); - ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "DESCENDING" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "2/1531046.542" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0], "2/1531047.050" ); + ASSERT_EQ(inst["StartTime"][0], "2008-11-29T17:14:29.729807" ); + ASSERT_EQ(inst["StopTime"][0], "2008-11-29T17:14:30.238607" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0], "FORWARD" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0], "DESCENDING" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20081129T171431_V03_RDN" ); - ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3G20081129T171431_V01_L0.IMG" ); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + ASSERT_EQ(archive["ProductId"][0], "M3G20081129T171431_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0], "M3G20081129T171431_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0], "CALIBRATED_IMAGE" ); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -185,18 +185,18 @@ TEST(Chan1m32Isis, Chan1m32IsisTestReverseDescending) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "4/1165041.748" ); - ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "4/1165042.256" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2009-01-06T11:34:24.380656" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2009-01-06T11:34:24.889456" ); - ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "REVERSE" ); - ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "DESCENDING" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "4/1165041.748" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0], "4/1165042.256" ); + ASSERT_EQ(inst["StartTime"][0], "2009-01-06T11:34:24.380656" ); + ASSERT_EQ(inst["StopTime"][0], "2009-01-06T11:34:24.889456" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0], "REVERSE" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0], "DESCENDING" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20090106T113423_V03_RDN" ); - ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3G20090106T113423_V01_L0.IMG" ); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + ASSERT_EQ(archive["ProductId"][0], "M3G20090106T113423_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0], "M3G20090106T113423_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0], "CALIBRATED_IMAGE" ); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -238,18 +238,18 @@ TEST(Chan1m32Isis, Chan1m32IsisTestReverseAscending) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "9/1365765.385" ); - ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "9/1365765.893" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2009-04-23T19:19:44.679982" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2009-04-23T19:19:45.188782" ); - ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "REVERSE" ); - ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "ASCENDING" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "9/1365765.385" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0], "9/1365765.893" ); + ASSERT_EQ(inst["StartTime"][0], "2009-04-23T19:19:44.679982" ); + ASSERT_EQ(inst["StopTime"][0], "2009-04-23T19:19:45.188782" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0], "REVERSE" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0], "ASCENDING" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20090423T191900_V03_RDN" ); - ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3G20090423T191900_V01_L0.IMG" ); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + ASSERT_EQ(archive["ProductId"][0], "M3G20090423T191900_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0], "M3G20090423T191900_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0], "CALIBRATED_IMAGE" ); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -282,14 +282,14 @@ TEST(Chan1m32Isis, Chan1m32IsisTestLinerateNotConstant) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "FORWARD" ); - ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "DESCENDING" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0], "FORWARD" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0], "DESCENDING" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20081118T223204_V03_RDN" ); - ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3G20081118T223204_V01_L0.IMG" ); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + ASSERT_EQ(archive["ProductId"][0], "M3G20081118T223204_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0], "M3G20081118T223204_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0], "CALIBRATED_IMAGE" ); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); ASSERT_EQ(int(kernel["NaifFrameCode"]), -86520); @@ -328,29 +328,29 @@ TEST(Chan1m32Isis, Chan1m32IsisTestL0) { // Pixels Group PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "SignedWord"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ(double(pixels["Base"]), 0.0); ASSERT_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "CHANDRAYAAN-1"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "M3" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "MOON" ); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "4/1165041.799" ); - ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "4/1165065" ); + ASSERT_EQ(inst["SpacecraftName"][0], "CHANDRAYAAN-1"); + ASSERT_EQ(inst["InstrumentId"][0], "M3" ); + ASSERT_EQ(inst["TargetName"][0], "MOON" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "4/1165041.799" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0], "4/1165065" ); ASSERT_DOUBLE_EQ(double(inst["LineExposureDuration"]), 101.76); ASSERT_DOUBLE_EQ(double(inst["SpatialSumming"]), 2); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2009-01-06T11:34:23" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2009-01-06T11:34:47" ); - ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "UNKNOWN" ); - ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "UNKNOWN" ); + ASSERT_EQ(inst["StartTime"][0], "2009-01-06T11:34:23" ); + ASSERT_EQ(inst["StopTime"][0], "2009-01-06T11:34:47" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0], "UNKNOWN" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0], "UNKNOWN" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20090106T113423_V01_L0" ); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "RAW_IMAGE" ); + ASSERT_EQ(archive["ProductId"][0], "M3G20090106T113423_V01_L0" ); + ASSERT_EQ(archive["ProductType"][0], "RAW_IMAGE" ); // BandBin Group // Check size, first, 2 middle, and last values? Enough? @@ -359,20 +359,20 @@ TEST(Chan1m32Isis, Chan1m32IsisTestL0) { ASSERT_EQ(bandbin["FilterNumber"].size(), 85); ASSERT_EQ(bandbin["OriginalBand"].size(), 85); - ASSERT_DOUBLE_EQ(bandbin["Center"][0].toDouble(), 460.990); - ASSERT_DOUBLE_EQ(bandbin["Center"][21].toDouble(), 1009.95); - ASSERT_DOUBLE_EQ(bandbin["Center"][42].toDouble(), 1429.15); - ASSERT_DOUBLE_EQ(bandbin["Center"][84].toDouble(), 2976.20); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][0]), 460.990); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][21]), 1009.95); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][42]), 1429.15); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][84]), 2976.20); - ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][0].toDouble(), 5); - ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][21].toDouble(), 57); - ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][42].toDouble(), 99); - ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][84].toDouble(), 253); + ASSERT_DOUBLE_EQ(std::stod(bandbin["FilterNumber"][0]), 5); + ASSERT_DOUBLE_EQ(std::stod(bandbin["FilterNumber"][21]), 57); + ASSERT_DOUBLE_EQ(std::stod(bandbin["FilterNumber"][42]), 99); + ASSERT_DOUBLE_EQ(std::stod(bandbin["FilterNumber"][84]), 253); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][0].toDouble(), 1); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][21].toDouble(), 22); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][42].toDouble(), 43); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][84].toDouble(), 85); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][0]), 1); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][21]), 22); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][42]), 43); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][84]), 85); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsCiss2isis.cpp b/isis/tests/FunctionalTestsCiss2isis.cpp index 92bb9165c5..2590cf1540 100644 --- a/isis/tests/FunctionalTestsCiss2isis.cpp +++ b/isis/tests/FunctionalTestsCiss2isis.cpp @@ -35,8 +35,8 @@ TEST(Ciss2Isis, Ciss2isisTestNac) { ASSERT_EQ((int)dimensions["Bands"], 1); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "SignedWord"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); @@ -144,8 +144,8 @@ TEST(Ciss2Isis, Ciss2isisTestWac) { ASSERT_EQ((int)dimensions["Bands"], 1); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "SignedWord"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); @@ -235,9 +235,9 @@ TEST(Ciss2Isis, Ciss2isisCustomMax) { QString inputLabel = "data/ciss2isis/W1472855646_5.cropped.lbl"; QString updatedPvlLabel = prefix.path() + "/W1472855646_5.cropped.lbl"; - Pvl inputPvl(inputLabel); + Pvl inputPvl(inputLabel.toStdString()); inputPvl["VALID_MAXIMUM"][1] = "70"; - inputPvl.write(updatedPvlLabel); + inputPvl.write(updatedPvlLabel.toStdString()); QFile::copy("data/ciss2isis/W1472855646_5.cropped.img", prefix.path() + "/W1472855646_5.cropped.img"); QVector args = { "from=" + updatedPvlLabel, @@ -259,8 +259,8 @@ TEST(Ciss2Isis, Ciss2isisCustomMax) { ASSERT_EQ((int)dimensions["Bands"], 1); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "SignedWord"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); diff --git a/isis/tests/FunctionalTestsCkwriter.cpp b/isis/tests/FunctionalTestsCkwriter.cpp index 248965dd6c..b7a8bd5969 100644 --- a/isis/tests/FunctionalTestsCkwriter.cpp +++ b/isis/tests/FunctionalTestsCkwriter.cpp @@ -40,7 +40,7 @@ TEST_F(DefaultCube, FunctionalTestCkwriterDefault) { kernels.addKeyword(targetPosition, PvlContainer::InsertMode::Replace); PvlKeyword instrumentPointing("InstrumentPointing"); - instrumentPointing += options.GetFileName("TO"); + instrumentPointing += options.GetFileName("TO").toStdString(); instrumentPointing += "$viking1/kernels/fk/vo1_v10.tf"; kernels.addKeyword(instrumentPointing, PvlContainer::InsertMode::Replace); @@ -108,7 +108,7 @@ TEST_F(DefaultCube, FunctionalTestCkwriterFromlist) { kernels.addKeyword(targetPosition, PvlContainer::InsertMode::Replace); PvlKeyword instrumentPointing("InstrumentPointing"); - instrumentPointing += options.GetFileName("TO"); + instrumentPointing += options.GetFileName("TO").toStdString(); instrumentPointing += kernels["InstrumentPointing"][2]; kernels.addKeyword(instrumentPointing, PvlContainer::InsertMode::Replace); diff --git a/isis/tests/FunctionalTestsCnetbin2pvl.cpp b/isis/tests/FunctionalTestsCnetbin2pvl.cpp index cb25bcf414..83a170022b 100644 --- a/isis/tests/FunctionalTestsCnetbin2pvl.cpp +++ b/isis/tests/FunctionalTestsCnetbin2pvl.cpp @@ -23,7 +23,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetbin2pvlDefault) { Pvl pvl; try { - pvl.read(pvlOut); + pvl.read(pvlOut.toStdString()); } catch (IException &e) { FAIL() << "Unable to read PVL file" << std::endl; diff --git a/isis/tests/FunctionalTestsCnetdiff.cpp b/isis/tests/FunctionalTestsCnetdiff.cpp index 7ee007cf59..a52d9d52fd 100644 --- a/isis/tests/FunctionalTestsCnetdiff.cpp +++ b/isis/tests/FunctionalTestsCnetdiff.cpp @@ -221,7 +221,7 @@ class CompareNetsReportFirstDiff : public TempTestingFiles { PvlGroup toleranceGroup("Tolerances"); toleranceGroup.addKeyword(PvlKeyword("SampleResidual", "1.5")); diffs.addGroup(toleranceGroup); - diffs.write(diffsFile); + diffs.write(diffsFile.toStdString()); } }; @@ -560,7 +560,7 @@ class CompareNetsReportFull : public TempTestingFiles { toleranceGroup.addKeyword(PvlKeyword("AdjustedX", "3")); toleranceGroup.addKeyword(PvlKeyword("AdjustedY", "3")); diffs.addGroup(toleranceGroup); - diffs.write(diffsFile); + diffs.write(diffsFile.toStdString()); } }; @@ -595,14 +595,14 @@ TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { // read back CompareSame1 output file Pvl comparePvlSame1; try { - comparePvlSame1.read(tempDir.path()+ "/compareSame1.txt"); + comparePvlSame1.read(tempDir.path().toStdString() + "/compareSame1.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; } PvlGroup &results = comparePvlSame1.findGroup("Results", Pvl::Traverse); - EXPECT_EQ(results["Compare"][0].toStdString(), "Identical"); + EXPECT_EQ(results["Compare"][0], "Identical"); // cnet2 vs cnet2 args = {"from=" + cnetFile2, @@ -622,14 +622,14 @@ TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { // read back CompareSame2 output file Pvl comparePvlSame2; try { - comparePvlSame2.read(tempDir.path()+ "/compareSame2.txt"); + comparePvlSame2.read(tempDir.path().toStdString() + "/compareSame2.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; } results = comparePvlSame2.findGroup("Results", Pvl::Traverse); - EXPECT_EQ(results["Compare"][0].toStdString(), "Identical"); + EXPECT_EQ(results["Compare"][0], "Identical"); // cnet1 vs cnet2 args = {"from=" + cnetFile1, @@ -649,15 +649,15 @@ TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { // read back CompareDifferent output file Pvl comparePvlDifferent; try { - comparePvlDifferent.read(tempDir.path()+ "/compareDifferent.txt"); + comparePvlDifferent.read(tempDir.path().toStdString() + "/compareDifferent.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; } results = comparePvlDifferent.findGroup("Results", Pvl::Traverse); - EXPECT_EQ(results["Compare"][0].toStdString(), "Different"); - EXPECT_EQ(results["Reason"][0].toStdString(), + EXPECT_EQ(results["Compare"][0], "Different"); + EXPECT_EQ(results["Reason"][0], "Control Point [T0000] Control Measure for Cube [id1] " "Value [SampleResidual] difference is 2.0 (values are " "[-3.0] and [-1.0], tolerance is [0.0])"); @@ -681,15 +681,15 @@ TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { // read back CompareDifferent2 output file Pvl comparePvlDifferent2; try { - comparePvlDifferent2.read(tempDir.path()+ "/compareDifferent2.txt"); + comparePvlDifferent2.read(tempDir.path().toStdString() + "/compareDifferent2.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; } results = comparePvlDifferent2.findGroup("Results", Pvl::Traverse); - EXPECT_EQ(results["Compare"][0].toStdString(), "Different"); - EXPECT_EQ(results["Reason"][0].toStdString(), + EXPECT_EQ(results["Compare"][0], "Different"); + EXPECT_EQ(results["Reason"][0], "Control Point [T0000] Control Measure for Cube [id1] " "Value [SampleResidual] difference is 2.0 (values are " "[-3.0] and [-1.0], tolerance is [1.5])"); @@ -745,7 +745,7 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { // read back compareSame1 output file Pvl compareSame1; try { - compareSame1.read(tempDir.path()+ "/compareSame1.txt"); + compareSame1.read(tempDir.path().toStdString() + "/compareSame1.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; @@ -777,7 +777,7 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { // read back compareSame2 output file Pvl compareSame2; try { - compareSame2.read(tempDir.path()+ "/compareSame2.txt"); + compareSame2.read(tempDir.path().toStdString() + "/compareSame2.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; @@ -809,7 +809,7 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { // read back compareDifferent1 output file Pvl compareDifferent1; try { - compareDifferent1.read(tempDir.path() + "/compareDifferent1.txt"); + compareDifferent1.read(tempDir.path().toStdString() + "/compareDifferent1.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; @@ -818,112 +818,112 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { PvlObject &DifferencesObject1 = compareDifferent1.findObject("Differences"); EXPECT_EQ(DifferencesObject1.keywords(), 4); EXPECT_EQ(DifferencesObject1.objects(), 5); - EXPECT_EQ(DifferencesObject1["Filename"][0].toStdString(), "cnet1.net"); - EXPECT_EQ(DifferencesObject1["Filename"][1].toStdString(), "cnet2.net"); - EXPECT_EQ(DifferencesObject1["Points"][0].toStdString(), "4"); - EXPECT_EQ(DifferencesObject1["Points"][1].toStdString(), "3"); - EXPECT_EQ(DifferencesObject1["NetworkId"][0].toStdString(), "Test"); - EXPECT_EQ(DifferencesObject1["NetworkId"][1].toStdString(), "Test2"); - EXPECT_EQ(DifferencesObject1["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(DifferencesObject1["TargetName"][1].toStdString(), "Moon"); + EXPECT_EQ(DifferencesObject1["Filename"][0], "cnet1.net"); + EXPECT_EQ(DifferencesObject1["Filename"][1], "cnet2.net"); + EXPECT_EQ(DifferencesObject1["Points"][0], "4"); + EXPECT_EQ(DifferencesObject1["Points"][1], "3"); + EXPECT_EQ(DifferencesObject1["NetworkId"][0], "Test"); + EXPECT_EQ(DifferencesObject1["NetworkId"][1], "Test2"); + EXPECT_EQ(DifferencesObject1["TargetName"][0], "Mars"); + EXPECT_EQ(DifferencesObject1["TargetName"][1], "Moon"); PvlObject &comp1P1 = DifferencesObject1.findObject("Point"); EXPECT_EQ(comp1P1.keywords(), 2); EXPECT_EQ(comp1P1.groups(), 2); - EXPECT_EQ(comp1P1["PointId"][0].toStdString(), "T0000"); - EXPECT_EQ(comp1P1["EditLock"][0].toStdString(), "True"); - EXPECT_EQ(comp1P1["EditLock"][1].toStdString(), "N/A"); + EXPECT_EQ(comp1P1["PointId"][0], "T0000"); + EXPECT_EQ(comp1P1["EditLock"][0], "True"); + EXPECT_EQ(comp1P1["EditLock"][1], "N/A"); PvlGroup &comp1P1M1 = comp1P1.findGroup("Measure"); EXPECT_EQ(comp1P1M1.keywords(), 3); - EXPECT_EQ(comp1P1M1["SerialNumber"][0].toStdString(), "id0"); - EXPECT_EQ(comp1P1M1["Line"][0].toStdString(), "3.0"); - EXPECT_EQ(comp1P1M1["Line"][1].toStdString(), "2.0"); - EXPECT_EQ(comp1P1M1["Sample"][0].toStdString(), "2.0"); - EXPECT_EQ(comp1P1M1["Sample"][1].toStdString(), "1.0"); + EXPECT_EQ(comp1P1M1["SerialNumber"][0], "id0"); + EXPECT_EQ(comp1P1M1["Line"][0], "3.0"); + EXPECT_EQ(comp1P1M1["Line"][1], "2.0"); + EXPECT_EQ(comp1P1M1["Sample"][0], "2.0"); + EXPECT_EQ(comp1P1M1["Sample"][1], "1.0"); comp1P1.deleteGroup("Measure"); PvlGroup &comp1P1M2 = comp1P1.findGroup("Measure"); EXPECT_EQ(comp1P1M2.keywords(), 2); - EXPECT_EQ(comp1P1M2["SerialNumber"][0].toStdString(), "id1"); - EXPECT_EQ(comp1P1M2["SampleResidual"][0].toStdString(), "-3.0"); - EXPECT_EQ(comp1P1M2["SampleResidual"][1].toStdString(), "-1.0"); + EXPECT_EQ(comp1P1M2["SerialNumber"][0], "id1"); + EXPECT_EQ(comp1P1M2["SampleResidual"][0], "-3.0"); + EXPECT_EQ(comp1P1M2["SampleResidual"][1], "-1.0"); DifferencesObject1.deleteObject("Point"); PvlObject &comp1P2 = DifferencesObject1.findObject("Point"); EXPECT_EQ(comp1P2.keywords(), 1); - EXPECT_EQ(comp1P2["PointId"][0].toStdString(), "T0001"); - EXPECT_EQ(comp1P2["PointId"][1].toStdString(), "N/A"); + EXPECT_EQ(comp1P2["PointId"][0], "T0001"); + EXPECT_EQ(comp1P2["PointId"][1], "N/A"); DifferencesObject1.deleteObject("Point"); PvlObject &comp1P3 = DifferencesObject1.findObject("Point"); EXPECT_EQ(comp1P3.keywords(), 1); - EXPECT_EQ(comp1P3["PointId"][0].toStdString(), "N/A"); - EXPECT_EQ(comp1P3["PointId"][1].toStdString(), "T0002"); + EXPECT_EQ(comp1P3["PointId"][0], "N/A"); + EXPECT_EQ(comp1P3["PointId"][1], "T0002"); DifferencesObject1.deleteObject("Point"); PvlObject &comp1P4 = DifferencesObject1.findObject("Point"); EXPECT_EQ(comp1P4.keywords(), 1); - EXPECT_EQ(comp1P4["PointId"][0].toStdString(), "T0003"); - EXPECT_EQ(comp1P4["PointId"][1].toStdString(), "N/A"); + EXPECT_EQ(comp1P4["PointId"][0], "T0003"); + EXPECT_EQ(comp1P4["PointId"][1], "N/A"); DifferencesObject1.deleteObject("Point"); PvlObject &comp1P5 = DifferencesObject1.findObject("Point"); EXPECT_EQ(comp1P5.keywords(), 8); EXPECT_EQ(comp1P5.groups(), 4); - EXPECT_EQ(comp1P5["PointId"][0].toStdString(), "T0004"); - EXPECT_EQ(comp1P5["Measures"][0].toStdString(), "2"); - EXPECT_EQ(comp1P5["Measures"][1].toStdString(), "3"); - EXPECT_EQ(comp1P5["AdjustedX"][0].toStdString(), "-424.024048"); - EXPECT_EQ(comp1P5["AdjustedX"][1].toStdString(), "-423.024048"); - EXPECT_EQ(comp1P5["AdjustedY"][0].toStdString(), "734.4311949"); - EXPECT_EQ(comp1P5["AdjustedY"][1].toStdString(), "754.4311949"); - EXPECT_EQ(comp1P5["AdjustedZ"][0].toStdString(), "529.919264"); - EXPECT_EQ(comp1P5["AdjustedZ"][1].toStdString(), "523.919264"); - EXPECT_EQ(comp1P5["AprioriXYZSource"][0].toStdString(), "N/A"); - EXPECT_EQ(comp1P5["AprioriXYZSource"][1].toStdString(), "Basemap"); - EXPECT_EQ(comp1P5["AprioriXYZSourceFile"][0].toStdString(), "N/A"); - EXPECT_EQ(comp1P5["AprioriXYZSourceFile"][1].toStdString(), "/work1/tsucharski/basemap.cub"); - EXPECT_EQ(comp1P5["EditLock"][0].toStdString(), "True"); - EXPECT_EQ(comp1P5["EditLock"][1].toStdString(), "N/A"); + EXPECT_EQ(comp1P5["PointId"][0], "T0004"); + EXPECT_EQ(comp1P5["Measures"][0], "2"); + EXPECT_EQ(comp1P5["Measures"][1], "3"); + EXPECT_EQ(comp1P5["AdjustedX"][0], "-424.024048"); + EXPECT_EQ(comp1P5["AdjustedX"][1], "-423.024048"); + EXPECT_EQ(comp1P5["AdjustedY"][0], "734.4311949"); + EXPECT_EQ(comp1P5["AdjustedY"][1], "754.4311949"); + EXPECT_EQ(comp1P5["AdjustedZ"][0], "529.919264"); + EXPECT_EQ(comp1P5["AdjustedZ"][1], "523.919264"); + EXPECT_EQ(comp1P5["AprioriXYZSource"][0], "N/A"); + EXPECT_EQ(comp1P5["AprioriXYZSource"][1], "Basemap"); + EXPECT_EQ(comp1P5["AprioriXYZSourceFile"][0], "N/A"); + EXPECT_EQ(comp1P5["AprioriXYZSourceFile"][1], "/work1/tsucharski/basemap.cub"); + EXPECT_EQ(comp1P5["EditLock"][0], "True"); + EXPECT_EQ(comp1P5["EditLock"][1], "N/A"); PvlGroup &comp1P5M1 = comp1P5.findGroup("Measure"); EXPECT_EQ(comp1P5M1.keywords(), 9); - EXPECT_EQ(comp1P5M1["SerialNumber"][0].toStdString(), "id0"); - EXPECT_EQ(comp1P5M1["AprioriLine"][0].toStdString(), "20.0"); - EXPECT_EQ(comp1P5M1["AprioriLine"][1].toStdString(), "N/A"); - EXPECT_EQ(comp1P5M1["AprioriSample"][0].toStdString(), "10.0"); - EXPECT_EQ(comp1P5M1["AprioriSample"][1].toStdString(), "N/A"); - EXPECT_EQ(comp1P5M1["Line"][0].toStdString(), "3.0"); - EXPECT_EQ(comp1P5M1["Line"][1].toStdString(), "2.0"); - EXPECT_EQ(comp1P5M1["LineResidual"][0].toStdString(), "-4.0"); - EXPECT_EQ(comp1P5M1["LineResidual"][1].toStdString(), "4.0"); - EXPECT_EQ(comp1P5M1["LineSigma"][0].toStdString(), "N/A"); - EXPECT_EQ(comp1P5M1["LineSigma"][1].toStdString(), "0.21"); - EXPECT_EQ(comp1P5M1["Sample"][0].toStdString(), "4.0"); - EXPECT_EQ(comp1P5M1["Sample"][1].toStdString(), "1.0"); - EXPECT_EQ(comp1P5M1["SampleResidual"][0].toStdString(), "1.0"); - EXPECT_EQ(comp1P5M1["SampleResidual"][1].toStdString(), "-10.0"); - EXPECT_EQ(comp1P5M1["SampleSigma"][0].toStdString(), "N/A"); - EXPECT_EQ(comp1P5M1["SampleSigma"][1].toStdString(), "0.01"); + EXPECT_EQ(comp1P5M1["SerialNumber"][0], "id0"); + EXPECT_EQ(comp1P5M1["AprioriLine"][0], "20.0"); + EXPECT_EQ(comp1P5M1["AprioriLine"][1], "N/A"); + EXPECT_EQ(comp1P5M1["AprioriSample"][0], "10.0"); + EXPECT_EQ(comp1P5M1["AprioriSample"][1], "N/A"); + EXPECT_EQ(comp1P5M1["Line"][0], "3.0"); + EXPECT_EQ(comp1P5M1["Line"][1], "2.0"); + EXPECT_EQ(comp1P5M1["LineResidual"][0], "-4.0"); + EXPECT_EQ(comp1P5M1["LineResidual"][1], "4.0"); + EXPECT_EQ(comp1P5M1["LineSigma"][0], "N/A"); + EXPECT_EQ(comp1P5M1["LineSigma"][1], "0.21"); + EXPECT_EQ(comp1P5M1["Sample"][0], "4.0"); + EXPECT_EQ(comp1P5M1["Sample"][1], "1.0"); + EXPECT_EQ(comp1P5M1["SampleResidual"][0], "1.0"); + EXPECT_EQ(comp1P5M1["SampleResidual"][1], "-10.0"); + EXPECT_EQ(comp1P5M1["SampleSigma"][0], "N/A"); + EXPECT_EQ(comp1P5M1["SampleSigma"][1], "0.01"); comp1P5.deleteGroup("Measure"); PvlGroup &comp1P5M2 = comp1P5.findGroup("Measure"); EXPECT_EQ(comp1P5M2.keywords(), 1); - EXPECT_EQ(comp1P5M2["SerialNumber"][0].toStdString(), "id1"); - EXPECT_EQ(comp1P5M2["SerialNumber"][1].toStdString(), "N/A"); + EXPECT_EQ(comp1P5M2["SerialNumber"][0], "id1"); + EXPECT_EQ(comp1P5M2["SerialNumber"][1], "N/A"); comp1P5.deleteGroup("Measure"); PvlGroup &comp1P5M3 = comp1P5.findGroup("Measure"); EXPECT_EQ(comp1P5M3.keywords(), 1); - EXPECT_EQ(comp1P5M3["SerialNumber"][0].toStdString(), "N/A"); - EXPECT_EQ(comp1P5M3["SerialNumber"][1].toStdString(), "id2"); + EXPECT_EQ(comp1P5M3["SerialNumber"][0], "N/A"); + EXPECT_EQ(comp1P5M3["SerialNumber"][1], "id2"); comp1P5.deleteGroup("Measure"); PvlGroup &comp1P5M4 = comp1P5.findGroup("Measure"); EXPECT_EQ(comp1P5M4.keywords(), 1); - EXPECT_EQ(comp1P5M4["SerialNumber"][0].toStdString(), "N/A"); - EXPECT_EQ(comp1P5M4["SerialNumber"][1].toStdString(), "id3"); + EXPECT_EQ(comp1P5M4["SerialNumber"][0], "N/A"); + EXPECT_EQ(comp1P5M4["SerialNumber"][1], "id3"); // cnet3 vs cnet4 with diffsFile args = {"from=" + cnetFile1, @@ -945,7 +945,7 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { // read back compareDifferent2 output file Pvl compareDifferent2; try { - compareDifferent2.read(tempDir.path() + "/compareDifferent2.txt"); + compareDifferent2.read(tempDir.path().toStdString() + "/compareDifferent2.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; @@ -954,70 +954,70 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { PvlObject &DifferencesObject2 = compareDifferent2.findObject("Differences"); EXPECT_EQ(DifferencesObject2.keywords(), 3); EXPECT_EQ(DifferencesObject2.objects(), 4); - EXPECT_EQ(DifferencesObject2["Filename"][0].toStdString(), "cnet1.net"); - EXPECT_EQ(DifferencesObject2["Filename"][1].toStdString(), "cnet2.net"); - EXPECT_EQ(DifferencesObject2["Points"][0].toStdString(), "4"); - EXPECT_EQ(DifferencesObject2["Points"][1].toStdString(), "3"); - EXPECT_EQ(DifferencesObject2["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(DifferencesObject2["TargetName"][1].toStdString(), "Moon"); + EXPECT_EQ(DifferencesObject2["Filename"][0], "cnet1.net"); + EXPECT_EQ(DifferencesObject2["Filename"][1], "cnet2.net"); + EXPECT_EQ(DifferencesObject2["Points"][0], "4"); + EXPECT_EQ(DifferencesObject2["Points"][1], "3"); + EXPECT_EQ(DifferencesObject2["TargetName"][0], "Mars"); + EXPECT_EQ(DifferencesObject2["TargetName"][1], "Moon"); PvlObject &comp2P1 = DifferencesObject2.findObject("Point"); EXPECT_EQ(comp2P1.keywords(), 1); - EXPECT_EQ(comp2P1["PointId"][0].toStdString(), "T0001"); - EXPECT_EQ(comp2P1["PointId"][1].toStdString(), "N/A"); + EXPECT_EQ(comp2P1["PointId"][0], "T0001"); + EXPECT_EQ(comp2P1["PointId"][1], "N/A"); DifferencesObject2.deleteObject("Point"); PvlObject &comp2P2 = DifferencesObject2.findObject("Point"); EXPECT_EQ(comp2P2.keywords(), 1); - EXPECT_EQ(comp2P2["PointId"][0].toStdString(), "N/A"); - EXPECT_EQ(comp2P2["PointId"][1].toStdString(), "T0002"); + EXPECT_EQ(comp2P2["PointId"][0], "N/A"); + EXPECT_EQ(comp2P2["PointId"][1], "T0002"); DifferencesObject2.deleteObject("Point"); PvlObject &comp2P3 = DifferencesObject2.findObject("Point"); EXPECT_EQ(comp2P3.keywords(), 1); - EXPECT_EQ(comp2P3["PointId"][0].toStdString(), "T0003"); - EXPECT_EQ(comp2P3["PointId"][1].toStdString(), "N/A"); + EXPECT_EQ(comp2P3["PointId"][0], "T0003"); + EXPECT_EQ(comp2P3["PointId"][1], "N/A"); DifferencesObject2.deleteObject("Point"); PvlObject &comp2P4 = DifferencesObject2.findObject("Point"); EXPECT_EQ(comp2P4.keywords(), 4); EXPECT_EQ(comp2P4.groups(), 4); - EXPECT_EQ(comp2P4["PointId"][0].toStdString(), "T0004"); - EXPECT_EQ(comp2P4["Measures"][0].toStdString(), "2"); - EXPECT_EQ(comp2P4["Measures"][1].toStdString(), "3"); - EXPECT_EQ(comp2P4["AdjustedY"][0].toStdString(), "734.4311949"); - EXPECT_EQ(comp2P4["AdjustedY"][1].toStdString(), "754.4311949"); - EXPECT_EQ(comp2P4["AdjustedY"][2].toStdString(), "3.0"); - EXPECT_EQ(comp2P4["AprioriXYZSourceFile"][0].toStdString(), "N/A"); - EXPECT_EQ(comp2P4["AprioriXYZSourceFile"][1].toStdString(), "/work1/tsucharski/basemap.cub"); + EXPECT_EQ(comp2P4["PointId"][0], "T0004"); + EXPECT_EQ(comp2P4["Measures"][0], "2"); + EXPECT_EQ(comp2P4["Measures"][1], "3"); + EXPECT_EQ(comp2P4["AdjustedY"][0], "734.4311949"); + EXPECT_EQ(comp2P4["AdjustedY"][1], "754.4311949"); + EXPECT_EQ(comp2P4["AdjustedY"][2], "3.0"); + EXPECT_EQ(comp2P4["AprioriXYZSourceFile"][0], "N/A"); + EXPECT_EQ(comp2P4["AprioriXYZSourceFile"][1], "/work1/tsucharski/basemap.cub"); PvlGroup &comp2P4M1 = comp2P4.findGroup("Measure"); EXPECT_EQ(comp2P4M1.keywords(), 4); - EXPECT_EQ(comp2P4M1["SerialNumber"][0].toStdString(), "id0"); - EXPECT_EQ(comp2P4M1["LineResidual"][0].toStdString(), "-4.0"); - EXPECT_EQ(comp2P4M1["LineResidual"][1].toStdString(), "4.0"); - EXPECT_EQ(comp2P4M1["Sample"][0].toStdString(), "4.0"); - EXPECT_EQ(comp2P4M1["Sample"][1].toStdString(), "1.0"); - EXPECT_EQ(comp2P4M1["Sample"][2].toStdString(), "1.0"); - EXPECT_EQ(comp2P4M1["SampleResidual"][0].toStdString(), "1.0"); - EXPECT_EQ(comp2P4M1["SampleResidual"][1].toStdString(), "-10.0"); - EXPECT_EQ(comp2P4M1["SampleResidual"][2].toStdString(), "5.0"); + EXPECT_EQ(comp2P4M1["SerialNumber"][0], "id0"); + EXPECT_EQ(comp2P4M1["LineResidual"][0], "-4.0"); + EXPECT_EQ(comp2P4M1["LineResidual"][1], "4.0"); + EXPECT_EQ(comp2P4M1["Sample"][0], "4.0"); + EXPECT_EQ(comp2P4M1["Sample"][1], "1.0"); + EXPECT_EQ(comp2P4M1["Sample"][2], "1.0"); + EXPECT_EQ(comp2P4M1["SampleResidual"][0], "1.0"); + EXPECT_EQ(comp2P4M1["SampleResidual"][1], "-10.0"); + EXPECT_EQ(comp2P4M1["SampleResidual"][2], "5.0"); comp2P4.deleteGroup("Measure"); PvlGroup &comp2P4M2 = comp2P4.findGroup("Measure"); EXPECT_EQ(comp2P4M2.keywords(), 1); - EXPECT_EQ(comp2P4M2["SerialNumber"][0].toStdString(), "id1"); - EXPECT_EQ(comp2P4M2["SerialNumber"][1].toStdString(), "N/A"); + EXPECT_EQ(comp2P4M2["SerialNumber"][0], "id1"); + EXPECT_EQ(comp2P4M2["SerialNumber"][1], "N/A"); comp2P4.deleteGroup("Measure"); PvlGroup &comp2P4M3 = comp2P4.findGroup("Measure"); EXPECT_EQ(comp2P4M3.keywords(), 1); - EXPECT_EQ(comp2P4M3["SerialNumber"][0].toStdString(), "N/A"); - EXPECT_EQ(comp2P4M3["SerialNumber"][1].toStdString(), "id2"); + EXPECT_EQ(comp2P4M3["SerialNumber"][0], "N/A"); + EXPECT_EQ(comp2P4M3["SerialNumber"][1], "id2"); comp2P4.deleteGroup("Measure"); PvlGroup &comp2P4M4 = comp2P4.findGroup("Measure"); EXPECT_EQ(comp2P4M4.keywords(), 1); - EXPECT_EQ(comp2P4M4["SerialNumber"][0].toStdString(), "N/A"); - EXPECT_EQ(comp2P4M4["SerialNumber"][1].toStdString(), "id3"); + EXPECT_EQ(comp2P4M4["SerialNumber"][0], "N/A"); + EXPECT_EQ(comp2P4M4["SerialNumber"][1], "id3"); } diff --git a/isis/tests/FunctionalTestsCnetedit.cpp b/isis/tests/FunctionalTestsCnetedit.cpp index a7cca587e7..6ea73549b4 100644 --- a/isis/tests/FunctionalTestsCnetedit.cpp +++ b/isis/tests/FunctionalTestsCnetedit.cpp @@ -93,7 +93,7 @@ class CneteditCheckValid : public TempTestingFiles { validMeasureGroup.addKeyword(PvlKeyword("LineShift", "5")); Pvl p; p.addGroup(validMeasureGroup); - p.write(defFile); + p.write(defFile.toStdString()); } }; @@ -212,7 +212,7 @@ TEST_F(CneteditCheckValid, FunctionalTestCneteditCheckValid) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -228,57 +228,57 @@ TEST_F(CneteditCheckValid, FunctionalTestCneteditCheckValid) { // check retained references PvlObject retainedRefs = log.findObject("RetainedReferences"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, retainedRefs.findKeyword("pointregTest0001"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, retainedRefs.findKeyword("pointregTest0001"), "Validity Check failed: Sample Residual is greater than" " tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, retainedRefs.findKeyword("pointregTest0007"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, retainedRefs.findKeyword("pointregTest0007"), "Validity Check failed: Sample Residual is greater than" " tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, retainedRefs.findKeyword("pointregTest0008"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, retainedRefs.findKeyword("pointregTest0008"), "Validity Check failed: Pixels From Edge is less than" " tolerance 5"); // check deleted points PvlObject deletedPoints = log.findObject("Deleted").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0002"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0002"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0003"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0003"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0004"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0004"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0011"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0011"), "Too few measures"); // check deleted measures PvlObject deletedMeasures = log.findObject("Deleted").findObject("Measures"); PvlGroup pointregTest0002 = deletedMeasures.findGroup("pointregTest0002"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0002. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0002. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0002. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0002. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Point deleted"); PvlGroup pointregTest0003 = deletedMeasures.findGroup("pointregTest0003"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0003. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0003. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Validity Check failed: Pixels From Edge is less than" " tolerance 5 Line Residual is greater than tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0003. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0003. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Point deleted"); PvlGroup pointregTest0004 = deletedMeasures.findGroup("pointregTest0004"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0004. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0004. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0004. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0004. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Point deleted"); PvlGroup pointregTest0011 = deletedMeasures.findGroup("pointregTest0011"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0011. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0011. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Validity Check failed: Pixels From Edge is less than" " tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0011. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0011. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Point deleted"); @@ -335,7 +335,7 @@ TEST_F(CneteditCheckValid, FunctionalTestCneteditCheckValidIgnoreAll) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -354,76 +354,76 @@ TEST_F(CneteditCheckValid, FunctionalTestCneteditCheckValidIgnoreAll) { // check deleted points PvlObject deletedPoints = log.findObject("Deleted").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0001"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0001"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0002"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0002"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0003"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0003"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0004"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0004"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0007"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0007"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0008"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0008"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("pointregTest0011"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("pointregTest0011"), "Too few measures"); // check deleted measures PvlObject deletedMeasures = log.findObject("Deleted").findObject("Measures"); PvlGroup pointregTest0001 = deletedMeasures.findGroup("pointregTest0001"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0001. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0001. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Validity Check failed: Sample Residual is greater than " "tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0001. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0001. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Reference ignored"); PvlGroup pointregTest0002 = deletedMeasures.findGroup("pointregTest0002"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0002. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0002. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0002. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0002. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Reference ignored"); PvlGroup pointregTest0003 = deletedMeasures.findGroup("pointregTest0003"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0003. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0003. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Validity Check failed: Pixels From Edge is less than" " tolerance 5 Line Residual is greater than tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0003. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0003. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Point deleted"); PvlGroup pointregTest0004 = deletedMeasures.findGroup("pointregTest0004"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0004. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0004. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0004. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0004. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Reference ignored"); PvlGroup pointregTest0007 = deletedMeasures.findGroup("pointregTest0007"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0007. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0007. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Validity Check failed: Sample Residual is greater than " "tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0007. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0007. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Reference ignored"); PvlGroup pointregTest0008 = deletedMeasures.findGroup("pointregTest0008"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0008. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0008. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Validity Check failed: Pixels From Edge is less than " "tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0008. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0008. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Reference ignored"); PvlGroup pointregTest0011 = deletedMeasures.findGroup("pointregTest0011"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0011. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0011. findKeyword("MRO/HIRISE/856864216:41044/RED5/2"), "Validity Check failed: Pixels From Edge is less than" " tolerance 5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointregTest0011. + EXPECT_PRED_FORMAT2(AssertStringsEqual, pointregTest0011. findKeyword("MRO/HIRISE/856864216:41044/RED4/2"), "Point deleted"); @@ -470,7 +470,7 @@ TEST_F(Cnetedit, FunctionalTestCneteditDefault) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -489,94 +489,94 @@ TEST_F(Cnetedit, FunctionalTestCneteditDefault) { // check deleted points PvlObject deletedPoints = log.findObject("Deleted").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0038"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0038"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0039"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0039"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0067"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0067"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0068"), "Ignored from input"); // check deleted measures PvlObject deletedMeasures = log.findObject("Deleted").findObject("Measures"); PvlGroup new0031 = deletedMeasures.findGroup("new0031"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0031. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0031. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0032 = deletedMeasures.findGroup("new0032"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0032. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0032. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0038 = deletedMeasures.findGroup("new0038"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0038. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0038. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0039 = deletedMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0039. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0039. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0064 = deletedMeasures.findGroup("new0064"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0064. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0064. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064. findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0064. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0065 = deletedMeasures.findGroup("new0065"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0065. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0065. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065. findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0065. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0066"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0066"). findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0067 = deletedMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0067. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0067. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067. findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0067. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0068 = deletedMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); @@ -634,7 +634,7 @@ TEST_F(Cnetedit, FunctionalTestCneteditEditlock) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -653,50 +653,50 @@ TEST_F(Cnetedit, FunctionalTestCneteditEditlock) { // check deleted points PvlObject ignoredPoints = log.findObject("Ignored").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0068"), "Ignored from input"); // check ignored measures PvlObject ignoredMeasures = log.findObject("Ignored").findObject("Measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0038"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0038"). findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0039 = ignoredMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0039. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0039. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0065"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0065"). findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0066"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0066"). findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0067 = ignoredMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0067. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0067. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067. findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); PvlGroup new0068 = ignoredMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); @@ -754,7 +754,7 @@ TEST_F(Cnetedit, FunctionalTestCneteditEditUnlock) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -773,50 +773,50 @@ TEST_F(Cnetedit, FunctionalTestCneteditEditUnlock) { // check deleted points PvlObject ignoredPoints = log.findObject("Ignored").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0068"), "Ignored from input"); // check ignored measures PvlObject ignoredMeasures = log.findObject("Ignored").findObject("Measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0038"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0038"). findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0039 = ignoredMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0039. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0039. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0065"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0065"). findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0066"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0066"). findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0067 = ignoredMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0067. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0067. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067. findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); PvlGroup new0068 = ignoredMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, new0068. + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068. findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); @@ -900,7 +900,7 @@ TEST_F(Cnetedit, CneteditIgnore) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -919,261 +919,261 @@ TEST_F(Cnetedit, CneteditIgnore) { // check ignored points PvlObject ignoredPoints = log.findObject("Ignored").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0001"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0001"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0002"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0002"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0038"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0038"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0039"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0039"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0067"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0067"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0068"), "Ignored from input"); // check ignored measures PvlObject ignoredMeasures = log.findObject("Ignored").findObject("Measures"); PvlGroup new0001 = ignoredMeasures.findGroup("new0001"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); new0001.deleteKeyword("MGS/688540926:0/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Measure in MEASURELIST"); PvlGroup new0002 = ignoredMeasures.findGroup("new0002"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0002.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0002.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); PvlGroup new0038 = ignoredMeasures.findGroup("new0038"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); new0038.deleteKeyword("MGS/718369703:160/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0039 = ignoredMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0064"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0064"). findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); PvlGroup new0065 = ignoredMeasures.findGroup("new0065"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Reference ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); new0065.deleteKeyword("MGS/688540926:0/MOC-WA/RED"); new0065.deleteKeyword("MGS/691204200:96/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0066 = ignoredMeasures.findGroup("new0066"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Reference ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); new0066.deleteKeyword("MGS/688540926:0/MOC-WA/RED"); new0066.deleteKeyword("MGS/691204200:96/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0067 = ignoredMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); new0067.deleteKeyword("MGS/691204200:96/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0068 = ignoredMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0069"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0069"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0070"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0070"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0071"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0071"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0072"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0072"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0073"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0073"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0074"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0074"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0075"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0075"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0076"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0076"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0077"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0077"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0078"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0078"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0079"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0079"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0080"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0080"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0081"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0081"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0082"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0082"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0083"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0083"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0084"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0084"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0085"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0085"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0086"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0086"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0087"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0087"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0088"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0088"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0089"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0089"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0090"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0090"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0091"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0091"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0092"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0092"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0093"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0093"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0094"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0094"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0095"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0095"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0096"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0096"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0097"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0097"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0098"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0098"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0099"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0099"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0100"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0100"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0101"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0101"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0102"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0102"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0103"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0103"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0104"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0104"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0105"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0105"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0106"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0106"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0107"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0107"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0108"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0108"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); @@ -1225,7 +1225,7 @@ TEST_F(Cnetedit, CneteditIgnoreMeasuresPoints) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -1244,286 +1244,286 @@ TEST_F(Cnetedit, CneteditIgnoreMeasuresPoints) { // check deleted points PvlObject deletedPoints = log.findObject("Deleted").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0001"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0001"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0002"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0002"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0007"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0007"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0008"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0008"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0020"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0020"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0036"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0036"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0038"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0038"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0039"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0039"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0050"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0050"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0066"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0066"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0067"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0067"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0068"), "Ignored from input"); // check deleted measures PvlObject deletedMeasures = log.findObject("Deleted").findObject("Measures"); PvlGroup new0001 = deletedMeasures.findGroup("new0001"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0002 = deletedMeasures.findGroup("new0002"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0002.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0002.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0007 = deletedMeasures.findGroup("new0007"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0007.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0007.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0008 = deletedMeasures.findGroup("new0008"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0008.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0008.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0020 = deletedMeasures.findGroup("new0020"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0020.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0020.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0031 = deletedMeasures.findGroup("new0031"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0032 = deletedMeasures.findGroup("new0032"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0036 = deletedMeasures.findGroup("new0036"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0036.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0036.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0038 = deletedMeasures.findGroup("new0038"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0039 = deletedMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0050 = deletedMeasures.findGroup("new0050"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0050.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0050.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0064 = deletedMeasures.findGroup("new0064"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0065 = deletedMeasures.findGroup("new0065"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0066 = deletedMeasures.findGroup("new0066"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0067 = deletedMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0068 = deletedMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0069"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0069"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0070"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0070"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0071"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0071"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0072"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0072"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0073"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0073"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0074"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0074"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0075"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0075"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0076"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0076"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0077"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0077"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0078"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0078"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0079"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0079"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0080"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0080"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0081"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0081"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0082"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0082"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0083"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0083"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0084"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0084"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0085"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0085"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0086"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0086"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0087"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0087"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0088"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0088"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0089"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0089"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0090"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0090"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0091"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0091"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0092"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0092"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0093"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0093"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0094"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0094"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0095"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0095"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0096"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0096"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0097"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0097"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0098"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0098"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0099"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0099"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0100"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0100"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0101"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0101"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0102"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0102"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0103"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0103"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0104"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0104"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0105"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0105"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0106"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0106"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0107"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0107"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0108"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0108"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); @@ -1573,7 +1573,7 @@ TEST_F(Cnetedit, CneteditIgnorePoints) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -1592,148 +1592,148 @@ TEST_F(Cnetedit, CneteditIgnorePoints) { // check deleted points PvlObject deletedPoints = log.findObject("Deleted").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0001"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0001"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0007"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0007"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0008"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0008"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0020"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0020"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0036"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0036"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0038"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0038"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0039"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0039"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0050"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0050"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0067"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0067"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0068"), "Ignored from input"); // check deleted measures PvlObject deletedMeasures = log.findObject("Deleted").findObject("Measures"); PvlGroup new0001 = deletedMeasures.findGroup("new0001"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/688540926:0/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0007 = deletedMeasures.findGroup("new0007"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0007.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0007.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0008 = deletedMeasures.findGroup("new0008"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0008.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0008.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0020 = deletedMeasures.findGroup("new0020"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0020.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0020.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0031 = deletedMeasures.findGroup("new0031"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0032 = deletedMeasures.findGroup("new0032"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0036 = deletedMeasures.findGroup("new0036"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0036.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0036.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0038 = deletedMeasures.findGroup("new0038"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0039 = deletedMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0050 = deletedMeasures.findGroup("new0050"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0050.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0050.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0064 = deletedMeasures.findGroup("new0064"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0064"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0064"). findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0065 = deletedMeasures.findGroup("new0065"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0066"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0066"). findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0067 = deletedMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0068 = deletedMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); @@ -1785,7 +1785,7 @@ TEST_F(Cnetedit, CneteditIgnoreAllPoints) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -1804,189 +1804,189 @@ TEST_F(Cnetedit, CneteditIgnoreAllPoints) { // check deleted points PvlObject deletedPoints = log.findObject("Deleted").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0001"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0001"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0007"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0007"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0008"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0008"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0020"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0020"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0036"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0036"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0038"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0038"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0039"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0039"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0050"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0050"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0066"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0066"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0067"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0067"), "Reference measure ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0068"), "Ignored from input"); // check deleted measures PvlObject deletedMeasures = log.findObject("Deleted").findObject("Measures"); PvlGroup new0001 = deletedMeasures.findGroup("new0001"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/688540926:0/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); PvlGroup new0007 = deletedMeasures.findGroup("new0007"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0007.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0007.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); PvlGroup new0008 = deletedMeasures.findGroup("new0008"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0008.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0008.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); PvlGroup new0020 = deletedMeasures.findGroup("new0020"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0020.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0020.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); PvlGroup new0031 = deletedMeasures.findGroup("new0031"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); PvlGroup new0032 = deletedMeasures.findGroup("new0032"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); PvlGroup new0036 = deletedMeasures.findGroup("new0036"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0036.findKeyword("MGS/691204200:96/MOC-WA/RED "), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0036.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); PvlGroup new0038 = deletedMeasures.findGroup("new0038"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); new0038.deleteKeyword("MGS/718369703:160/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0038.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0039 = deletedMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0050 = deletedMeasures.findGroup("new0050"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0050.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0050.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Reference ignored"); PvlGroup new0064 = deletedMeasures.findGroup("new0064"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Reference ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); PvlGroup new0065 = deletedMeasures.findGroup("new0065"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Reference ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); new0065.deleteKeyword("MGS/688540926:0/MOC-WA/RED"); new0065.deleteKeyword("MGS/691204200:96/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0066 = deletedMeasures.findGroup("new0066"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Reference ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); new0066.deleteKeyword("MGS/688540926:0/MOC-WA/RED"); new0066.deleteKeyword("MGS/691204200:96/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0067 = deletedMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Reference ignored"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); new0067.deleteKeyword("MGS/691204200:96/MOC-WA/RED"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0068 = deletedMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); @@ -2039,7 +2039,7 @@ TEST_F(Cnetedit, CneteditNoDelete) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -2058,199 +2058,199 @@ TEST_F(Cnetedit, CneteditNoDelete) { // check ignored points PvlObject ignoredPoints = log.findObject("Ignored").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0001"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0001"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0007"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0007"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0008"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0008"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0020"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0020"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0036"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0036"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0050"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0050"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredPoints.findKeyword("new0068"), "Ignored from input"); // check ignored measures PvlObject ignoredMeasures = log.findObject("Ignored").findObject("Measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0001"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0001"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0002"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0002"). findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0038"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0038"). findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0039 = ignoredMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0064"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0064"). findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); PvlGroup new0065 = ignoredMeasures.findGroup("new0065"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); PvlGroup new0066 = ignoredMeasures.findGroup("new0066"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); PvlGroup new0067 = ignoredMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); PvlGroup new0068 = ignoredMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0069"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0069"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0070"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0070"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0071"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0071"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0072"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0072"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0073"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0073"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0074"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0074"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0075"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0075"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0076"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0076"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0077"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0077"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0078"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0078"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0079"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0079"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0080"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0080"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0081"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0081"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0082"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0082"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0083"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0083"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0084"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0084"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0085"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0085"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0086"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0086"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0087"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0087"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0088"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0088"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0089"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0089"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0090"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0090"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0091"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0091"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0092"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0092"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0093"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0093"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0094"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0094"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0095"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0095"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0096"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0096"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0097"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0097"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0098"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0098"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0099"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0099"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0100"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0100"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0101"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0101"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0102"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0102"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0103"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0103"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0104"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0104"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0105"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0105"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0106"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0106"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0107"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0107"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("new0108"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("new0108"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); @@ -2303,7 +2303,7 @@ TEST_F(Cnetedit, CneteditPreservePoints) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -2322,264 +2322,264 @@ TEST_F(Cnetedit, CneteditPreservePoints) { // check deleted points PvlObject deletedPoints = log.findObject("Deleted").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0001"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0001"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0007"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0007"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0008"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0008"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0020"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0020"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0031"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0031"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0032"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0032"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0036"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0036"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0039"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0039"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0050"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0050"), "Point ID in POINTLIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0064"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0064"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0065"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0065"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("new0068"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("new0068"), "Ignored from input"); // check deleted measures PvlObject deletedMeasures = log.findObject("Deleted").findObject("Measures"); PvlGroup new0001 = deletedMeasures.findGroup("new0001"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0001.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0002"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0002"). findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); PvlGroup new0007 = deletedMeasures.findGroup("new0007"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0007.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0007.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0008 = deletedMeasures.findGroup("new0008"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0008.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0008.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0020 = deletedMeasures.findGroup("new0020"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0020.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0020.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0031 = deletedMeasures.findGroup("new0031"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0031.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0032 = deletedMeasures.findGroup("new0032"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0032.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0036 = deletedMeasures.findGroup("new0036"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0036.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0036.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0038"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0038"). findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); PvlGroup new0039 = deletedMeasures.findGroup("new0039"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0039.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); PvlGroup new0050 = deletedMeasures.findGroup("new0050"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0050.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0050.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); PvlGroup new0064 = deletedMeasures.findGroup("new0064"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0064.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0065 = deletedMeasures.findGroup("new0065"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Point deleted"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0065.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Point deleted"); PvlGroup new0066 = deletedMeasures.findGroup("new0066"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0066.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Serial Number in CUBELIST"); PvlGroup new0067 = deletedMeasures.findGroup("new0067"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0067.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); PvlGroup new0068 = deletedMeasures.findGroup("new0068"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/718369703:160/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/688540926:0/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, new0068.findKeyword("MGS/691204200:96/MOC-WA/RED"), "Ignored from input"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0069"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0069"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0070"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0070"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0071"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0071"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0072"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0072"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0073"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0073"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0074"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0074"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0075"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0075"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0076"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0076"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0077"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0077"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0078"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0078"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0079"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0079"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0080"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0080"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0081"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0081"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0082"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0082"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0083"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0083"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0084"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0084"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0085"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0085"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0086"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0086"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0087"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0087"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0088"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0088"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0089"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0089"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0090"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0090"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0091"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0091"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0092"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0092"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0093"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0093"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0094"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0094"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0095"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0095"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0096"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0096"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0097"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0097"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0098"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0098"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0099"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0099"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0100"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0100"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0101"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0101"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0102"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0102"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0103"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0103"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0104"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0104"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0105"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0105"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0106"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0106"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0107"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0107"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedMeasures.findGroup("new0108"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedMeasures.findGroup("new0108"). findKeyword("MGS/688540926:0/MOC-WA/RED "), "Serial Number in CUBELIST"); @@ -2630,7 +2630,7 @@ TEST_F(CneteditMeasureList, CneteditMeasureListGeneral) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -2653,39 +2653,39 @@ TEST_F(CneteditMeasureList, CneteditMeasureListGeneral) { // check ignored measures PvlObject ignoredMeasures = log.findObject("Ignored").findObject("Measures"); PvlGroup bndry_32 = ignoredMeasures.findGroup("I24827003RDR_bndry_32"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_32.findKeyword("Odyssey/THEMIS_IR/766864399.204"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_32.findKeyword("Odyssey/THEMIS_IR/764644820.000"), "Measure in MEASURELIST"); PvlGroup bndry_35 = ignoredMeasures.findGroup("I24827003RDR_bndry_35"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/860700556.051"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); PvlGroup bndry_36 = ignoredMeasures.findGroup("I24827003RDR_bndry_36"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_36.findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_36.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_50"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_50"). findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_53"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_53"). findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_56"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_56"). findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_8"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_8"). findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); @@ -2738,7 +2738,7 @@ TEST_F(CneteditMeasureList, CneteditMeasureListIgnoreAll) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -2761,39 +2761,39 @@ TEST_F(CneteditMeasureList, CneteditMeasureListIgnoreAll) { // check ignored measures PvlObject ignoredMeasures = log.findObject("Ignored").findObject("Measures"); PvlGroup bndry_32 = ignoredMeasures.findGroup("I24827003RDR_bndry_32"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_32.findKeyword("Odyssey/THEMIS_IR/766864399.204"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_32.findKeyword("Odyssey/THEMIS_IR/764644820.000"), "Measure in MEASURELIST"); PvlGroup bndry_35 = ignoredMeasures.findGroup("I24827003RDR_bndry_35"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/860700556.051"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); PvlGroup bndry_36 = ignoredMeasures.findGroup("I24827003RDR_bndry_36"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_36.findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_36.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_50"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_50"). findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_53"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_53"). findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_56"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_56"). findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_8"). + EXPECT_PRED_FORMAT2(AssertStringsEqual, ignoredMeasures.findGroup("I24827003RDR_bndry_8"). findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); @@ -2844,7 +2844,7 @@ TEST_F(CneteditMeasureList, CneteditMeasureListDelete) { // read back log file Pvl log; try { - log.read(tempDir.path()+ "/log.txt"); + log.read(tempDir.path().toStdString() + "/log.txt"); } catch (IException &e) { FAIL() << "Unable to open log file: " << e.what() << std::endl; @@ -2863,72 +2863,72 @@ TEST_F(CneteditMeasureList, CneteditMeasureListDelete) { // check deleted points PvlObject deletedPoints = log.findObject("Deleted").findObject("Points"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_32"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_32"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_50"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_50"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_53"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_53"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_56"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_56"), "Too few measures"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_8"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, deletedPoints.findKeyword("I24827003RDR_bndry_8"), "Too few measures"); // check deleted measures PvlObject deletedMeasures = log.findObject("Deleted").findObject("Measures"); PvlGroup bndry_32 = deletedMeasures.findGroup("I24827003RDR_bndry_32"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_32.findKeyword("Odyssey/THEMIS_IR/766864399.204"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_32.findKeyword("Odyssey/THEMIS_IR/764644820.000"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_32.findKeyword("Odyssey/THEMIS_IR/860700556.051"), "Point deleted"); PvlGroup bndry_35 = deletedMeasures.findGroup("I24827003RDR_bndry_35"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/860700556.051"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_35.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); PvlGroup bndry_36 = deletedMeasures.findGroup("I24827003RDR_bndry_36"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_36.findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_36.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); PvlGroup bndry_50 = deletedMeasures.findGroup("I24827003RDR_bndry_50"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_50.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_50.findKeyword("Odyssey/THEMIS_IR/823680993.230"), "Point deleted"); PvlGroup bndry_53 = deletedMeasures.findGroup("I24827003RDR_bndry_53"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_53.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_53.findKeyword("Odyssey/THEMIS_IR/823680993.230"), "Point deleted"); PvlGroup bndry_56 = deletedMeasures.findGroup("I24827003RDR_bndry_56"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_56.findKeyword("Odyssey/THEMIS_IR/869400711.102"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_56.findKeyword("Odyssey/THEMIS_IR/823680993.230"), "Point deleted"); PvlGroup bndry_8 = deletedMeasures.findGroup("I24827003RDR_bndry_8"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_8.findKeyword("Odyssey/THEMIS_IR/748799078.000"), "Measure in MEASURELIST"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, + EXPECT_PRED_FORMAT2(AssertStringsEqual, bndry_8.findKeyword("Odyssey/THEMIS_IR/760206015.230"), "Point deleted"); diff --git a/isis/tests/FunctionalTestsCnetstats.cpp b/isis/tests/FunctionalTestsCnetstats.cpp index d308cb7109..7642b8e5f6 100644 --- a/isis/tests/FunctionalTestsCnetstats.cpp +++ b/isis/tests/FunctionalTestsCnetstats.cpp @@ -40,13 +40,13 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetstatsDefault) { EXPECT_DOUBLE_EQ( (double) cnetSummary.findKeyword("IgnoredMeasures"), 0); EXPECT_DOUBLE_EQ( (double) cnetSummary.findKeyword("EditLockMeasures"), 0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("AvgResidual"), "Null"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MinResidual"), "Null"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MaxResidual"), "Null"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MinLineResidual"), "Null"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MaxLineResidual"), "Null"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MinSampleResidual"), "Null"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MaxSampleResidual"), "Null"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("AvgResidual"), "Null"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MinResidual"), "Null"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MaxResidual"), "Null"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MinLineResidual"), "Null"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MaxLineResidual"), "Null"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MinSampleResidual"), "Null"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MaxSampleResidual"), "Null"); EXPECT_DOUBLE_EQ( (double) cnetSummary.findKeyword("MinLineShift"), 0); EXPECT_DOUBLE_EQ( (double) cnetSummary.findKeyword("MaxLineShift"), 0); @@ -56,12 +56,12 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetstatsDefault) { EXPECT_DOUBLE_EQ( (double) cnetSummary.findKeyword("MinPixelShift"), 0); EXPECT_DOUBLE_EQ( (double) cnetSummary.findKeyword("MaxPixelShift"), 0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MinGoodnessOfFit"), "NA"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MaxGoodnessOfFit"), "NA"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MinEccentricity"), "NA"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MaxEccentricity"), "NA"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MinPixelZScore"), "NA"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cnetSummary.findKeyword("MaxPixelZScore"), "NA"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MinGoodnessOfFit"), "NA"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MaxGoodnessOfFit"), "NA"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MinEccentricity"), "NA"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MaxEccentricity"), "NA"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MinPixelZScore"), "NA"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cnetSummary.findKeyword("MaxPixelZScore"), "NA"); EXPECT_NEAR( (double) cnetSummary.findKeyword("MinConvexHullRatio"), 0.40388096067313, 1e-10); EXPECT_NEAR( (double) cnetSummary.findKeyword("MaxConvexHullRatio"), 0.60732301576372, 1e-10); diff --git a/isis/tests/FunctionalTestsCnetthinner.cpp b/isis/tests/FunctionalTestsCnetthinner.cpp index 0b8c447b00..c5fd631a32 100644 --- a/isis/tests/FunctionalTestsCnetthinner.cpp +++ b/isis/tests/FunctionalTestsCnetthinner.cpp @@ -215,7 +215,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerIgnoreOrRemove) { // read back compareIgnored_IgnoredRemoved log file Pvl compareIgnored_IgnoredRemoved; try { - compareIgnored_IgnoredRemoved.read(tempDir.path()+ "/compareIgnored_IgnoredRemoved.txt"); + compareIgnored_IgnoredRemoved.read(tempDir.path().toStdString() + "/compareIgnored_IgnoredRemoved.txt"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; @@ -225,8 +225,8 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerIgnoreOrRemove) { // in the difference object confirming cnets are identical ASSERT_TRUE(compareIgnored_IgnoredRemoved.hasObject("Differences")); PvlObject differences = compareIgnored_IgnoredRemoved.findObject("Differences"); - EXPECT_EQ(differences["Filename"][0].toStdString(), "ignored_removed.net"); - EXPECT_EQ(differences["Filename"][1].toStdString(), "removed.net"); + EXPECT_EQ(differences["Filename"][0], "ignored_removed.net"); + EXPECT_EQ(differences["Filename"][1], "removed.net"); EXPECT_EQ(differences.groups(), 0); EXPECT_EQ(differences.objects(), 0); } diff --git a/isis/tests/FunctionalTestsCrism2isis.cpp b/isis/tests/FunctionalTestsCrism2isis.cpp index 828bd09fbb..438caf2c1c 100644 --- a/isis/tests/FunctionalTestsCrism2isis.cpp +++ b/isis/tests/FunctionalTestsCrism2isis.cpp @@ -46,27 +46,27 @@ TEST(Crism2isis, Crism2IsisTestDdr) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "MARS RECONNAISSANCE ORBITER"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "CRISM" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2/853135167:38571" ); - ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "2/853135171:21163" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2007-01-13T05:59:08.707" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2007-01-13T05:59:12.442" ); - ASSERT_EQ(inst["SensorId"][0].toStdString(), "L" ); - ASSERT_EQ(inst["ShutterModeId"][0].toStdString(), "UNKNOWN" ); + ASSERT_EQ(inst["SpacecraftName"][0], "MARS RECONNAISSANCE ORBITER"); + ASSERT_EQ(inst["InstrumentId"][0], "CRISM" ); + ASSERT_EQ(inst["TargetName"][0], "Mars" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "2/853135167:38571" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0], "2/853135171:21163" ); + ASSERT_EQ(inst["StartTime"][0], "2007-01-13T05:59:08.707" ); + ASSERT_EQ(inst["StopTime"][0], "2007-01-13T05:59:12.442" ); + ASSERT_EQ(inst["SensorId"][0], "L" ); + ASSERT_EQ(inst["ShutterModeId"][0], "UNKNOWN" ); ASSERT_DOUBLE_EQ(inst["FrameRate"], 3.75); - ASSERT_EQ(inst["ExposureParameter"][0].toStdString(), "Null" ); + ASSERT_EQ(inst["ExposureParameter"][0], "Null" ); ASSERT_EQ(int(inst["PixelAveragingWidth"]), 10); - ASSERT_EQ(inst["ScanModeId"][0].toStdString(), "LONG" ); - ASSERT_EQ(inst["SamplingModeId"][0].toStdString(), "UNKNOWN" ); + ASSERT_EQ(inst["ScanModeId"][0], "LONG" ); + ASSERT_EQ(inst["SamplingModeId"][0], "UNKNOWN" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MRO-M-CRISM-6-DDR-V1.0" ); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "FRT00003E25_01_DE156L_DDR1" ); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "DDR" ); - ASSERT_EQ(archive["ProductCreationTime"][0].toStdString(), "2007-04-04T22:49:30" ); + ASSERT_EQ(archive["DataSetId"][0], "MRO-M-CRISM-6-DDR-V1.0" ); + ASSERT_EQ(archive["ProductId"][0], "FRT00003E25_01_DE156L_DDR1" ); + ASSERT_EQ(archive["ProductType"][0], "DDR" ); + ASSERT_EQ(archive["ProductCreationTime"][0], "2007-04-04T22:49:30" ); ASSERT_EQ(int(archive["ProductVersionId"]), 1); // BandBin Group @@ -109,21 +109,21 @@ TEST(Crism2isis, Crism2IsisTestMrdr) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MRO-M-CRISM-5-RDR-MULTISPECTRAL-V1.0" ); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "T1865_MRRDE_70N185_0256_1" ); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "MAP_PROJECTED_MULTISPECTRAL_RDR" ); - ASSERT_EQ(archive["ProductCreationTime"][0].toStdString(), "2007-12-22T16:50:47.432000" ); + ASSERT_EQ(archive["DataSetId"][0], "MRO-M-CRISM-5-RDR-MULTISPECTRAL-V1.0" ); + ASSERT_EQ(archive["ProductId"][0], "T1865_MRRDE_70N185_0256_1" ); + ASSERT_EQ(archive["ProductType"][0], "MAP_PROJECTED_MULTISPECTRAL_RDR" ); + ASSERT_EQ(archive["ProductCreationTime"][0], "2007-12-22T16:50:47.432000" ); ASSERT_EQ(int(archive["ProductVersionId"]), 1); // Mapping Group PvlGroup &mapping = isisLabel->findGroup("Mapping", Pvl::Traverse); - ASSERT_EQ(mapping["ProjectionName"][0].toStdString(), "Equirectangular"); + ASSERT_EQ(mapping["ProjectionName"][0], "Equirectangular"); ASSERT_DOUBLE_EQ(double(mapping["CenterLongitude"]), -175.0); - ASSERT_EQ(mapping["TargetName"][0].toStdString(), "Mars"); + ASSERT_EQ(mapping["TargetName"][0], "Mars"); ASSERT_DOUBLE_EQ(double(mapping["EquatorialRadius"]), 3396000.0); ASSERT_DOUBLE_EQ(double(mapping["PolarRadius"]), 3396000.0); - ASSERT_EQ(mapping["LatitudeType"][0].toStdString(), "Planetocentric"); - ASSERT_EQ(mapping["LongitudeDirection"][0].toStdString(), "PositiveEast"); + ASSERT_EQ(mapping["LatitudeType"][0], "Planetocentric"); + ASSERT_EQ(mapping["LongitudeDirection"][0], "PositiveEast"); ASSERT_EQ(int(mapping["LongitudeDomain"]), 180); ASSERT_DOUBLE_EQ(double(mapping["MinimumLatitude"]), 67.5000001); ASSERT_DOUBLE_EQ(double(mapping["MaximumLatitude"]), 72.5); @@ -168,17 +168,17 @@ TEST(Crism2isis, Crism2IsisTestTrdr) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SensorId"][0].toStdString(), "S" ); - ASSERT_EQ(inst["ShutterModeId"][0].toStdString(), "OPEN" ); - ASSERT_EQ(inst["ScanModeId"][0].toStdString(), "SHORT" ); - ASSERT_EQ(inst["SamplingModeId"][0].toStdString(), "HYPERSPEC" ); + ASSERT_EQ(inst["SensorId"][0], "S" ); + ASSERT_EQ(inst["ShutterModeId"][0], "OPEN" ); + ASSERT_EQ(inst["ScanModeId"][0], "SHORT" ); + ASSERT_EQ(inst["SamplingModeId"][0], "HYPERSPEC" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MRO-M-CRISM-3-RDR-TARGETED-V1.0" ); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "FRT0001E5C3_07_IF124S_TRR3"); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "TARGETED_RDR" ); - ASSERT_EQ(archive["ProductCreationTime"][0].toStdString(), "2011-06-08T10:52:30" ); + ASSERT_EQ(archive["DataSetId"][0], "MRO-M-CRISM-3-RDR-TARGETED-V1.0" ); + ASSERT_EQ(archive["ProductId"][0], "FRT0001E5C3_07_IF124S_TRR3"); + ASSERT_EQ(archive["ProductType"][0], "TARGETED_RDR" ); + ASSERT_EQ(archive["ProductCreationTime"][0], "2011-06-08T10:52:30" ); ASSERT_EQ(int(archive["ProductVersionId"]), 3); } @@ -207,10 +207,10 @@ TEST(Crism2isis, Crism2IsisTestMrral) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MRO-M-CRISM-5-RDR-MULTISPECTRAL-V1.0" ); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "T0897_MRRAL_05S113_0256_1"); - ASSERT_EQ(archive["ProductType"][0].toStdString(), "MAP_PROJECTED_MULTISPECTRAL_RDR" ); - ASSERT_EQ(archive["ProductCreationTime"][0].toStdString(), "2008-03-25T23:01:30.319000" ); + ASSERT_EQ(archive["DataSetId"][0], "MRO-M-CRISM-5-RDR-MULTISPECTRAL-V1.0" ); + ASSERT_EQ(archive["ProductId"][0], "T0897_MRRAL_05S113_0256_1"); + ASSERT_EQ(archive["ProductType"][0], "MAP_PROJECTED_MULTISPECTRAL_RDR" ); + ASSERT_EQ(archive["ProductCreationTime"][0], "2008-03-25T23:01:30.319000" ); ASSERT_EQ(int(archive["ProductVersionId"]), 1); // BandBin Group diff --git a/isis/tests/FunctionalTestsCsminit.cpp b/isis/tests/FunctionalTestsCsminit.cpp index d066941190..d4a5b405a3 100644 --- a/isis/tests/FunctionalTestsCsminit.cpp +++ b/isis/tests/FunctionalTestsCsminit.cpp @@ -102,12 +102,12 @@ TEST_F(CSMPluginFixture, CSMInitDefault) { PvlObject blobPvl = stateString.Label(); // Check that the plugin can create a model from the state string - std::string modelName = QString(blobPvl.findKeyword("ModelName")).toStdString(); + std::string modelName = blobPvl.findKeyword("ModelName"); std::string modelState(stateString.getBuffer(), stateString.Size()); EXPECT_TRUE(plugin->canModelBeConstructedFromState(modelName, modelState)); // Check blob label ModelName and Plugin Name - EXPECT_EQ(QString(blobPvl.findKeyword("PluginName")).toStdString(), plugin->getPluginName()); + EXPECT_EQ(blobPvl.findKeyword("PluginName"), plugin->getPluginName()); EXPECT_EQ(modelName, TestCsmModel::SENSOR_MODEL_NAME); // Check the Instrument group @@ -119,23 +119,23 @@ TEST_F(CSMPluginFixture, CSMInitDefault) { ASSERT_TRUE(testCube->hasGroup("CsmInfo")); PvlGroup &infoGroup = testCube->group("CsmInfo"); ASSERT_TRUE(infoGroup.hasKeyword("CSMPlatformID")); - EXPECT_EQ(infoGroup["CSMPlatformID"][0].toStdString(), model.getPlatformIdentifier()); + EXPECT_EQ(infoGroup["CSMPlatformID"][0], model.getPlatformIdentifier()); ASSERT_TRUE(infoGroup.hasKeyword("CSMInstrumentId")); - EXPECT_EQ(infoGroup["CSMInstrumentId"][0].toStdString(), model.getSensorIdentifier()); + EXPECT_EQ(infoGroup["CSMInstrumentId"][0], model.getSensorIdentifier()); ASSERT_TRUE(infoGroup.hasKeyword("ReferenceTime")); - EXPECT_EQ(infoGroup["ReferenceTime"][0].toStdString(), model.getReferenceDateAndTime()); + EXPECT_EQ(infoGroup["ReferenceTime"][0], model.getReferenceDateAndTime()); ASSERT_TRUE(infoGroup.hasKeyword("ModelParameterNames")); ASSERT_EQ(infoGroup["ModelParameterNames"].size(), 3); - EXPECT_EQ(infoGroup["ModelParameterNames"][0].toStdString(), TestCsmModel::PARAM_NAMES[0]); - EXPECT_EQ(infoGroup["ModelParameterNames"][1].toStdString(), TestCsmModel::PARAM_NAMES[1]); + EXPECT_EQ(infoGroup["ModelParameterNames"][0], TestCsmModel::PARAM_NAMES[0]); + EXPECT_EQ(infoGroup["ModelParameterNames"][1], TestCsmModel::PARAM_NAMES[1]); ASSERT_TRUE(infoGroup.hasKeyword("ModelParameterUnits")); ASSERT_EQ(infoGroup["ModelParameterUnits"].size(), 3); - EXPECT_EQ(infoGroup["ModelParameterUnits"][0].toStdString(), TestCsmModel::PARAM_UNITS[0]); - EXPECT_EQ(infoGroup["ModelParameterUnits"][1].toStdString(), TestCsmModel::PARAM_UNITS[1]); + EXPECT_EQ(infoGroup["ModelParameterUnits"][0], TestCsmModel::PARAM_UNITS[0]); + EXPECT_EQ(infoGroup["ModelParameterUnits"][1], TestCsmModel::PARAM_UNITS[1]); ASSERT_TRUE(infoGroup.hasKeyword("ModelParameterTypes")); ASSERT_EQ(infoGroup["ModelParameterTypes"].size(), 3); - EXPECT_EQ(infoGroup["ModelParameterTypes"][0].toStdString(), "REAL"); - EXPECT_EQ(infoGroup["ModelParameterTypes"][1].toStdString(), "REAL"); + EXPECT_EQ(infoGroup["ModelParameterTypes"][0], "REAL"); + EXPECT_EQ(infoGroup["ModelParameterTypes"][1], "REAL"); // Check the Kernels group ASSERT_TRUE(testCube->hasGroup("Kernels")); @@ -173,11 +173,11 @@ TEST_F(CSMPluginFixture, CSMInitRunTwice) { PvlObject blobPvl = stateString.Label(); // Check blob label ModelName and Plugin Name - EXPECT_EQ(QString(blobPvl.findKeyword("PluginName")).toStdString(), plugin->getPluginName()); - EXPECT_EQ(QString(blobPvl.findKeyword("ModelName")).toStdString(), AlternativeTestCsmModel::SENSOR_MODEL_NAME); + EXPECT_EQ(blobPvl.findKeyword("PluginName"), plugin->getPluginName()); + EXPECT_EQ(blobPvl.findKeyword("ModelName"), AlternativeTestCsmModel::SENSOR_MODEL_NAME); // Check that the plugin can create a model from the state string - std::string modelName = QString(blobPvl.findKeyword("ModelName")).toStdString(); + std::string modelName = blobPvl.findKeyword("ModelName"); std::string modelState(stateString.getBuffer(), stateString.Size()); EXPECT_TRUE(plugin->canModelBeConstructedFromState(modelName, modelState)); @@ -233,38 +233,38 @@ TEST_F(CSMPluginFixture, CSMInitMultiplePossibleModels) { PvlObject blobPvl = stateString.Label(); // Check that the plugin can create a model from the state string - std::string modelName = QString(blobPvl.findKeyword("ModelName")).toStdString(); + std::string modelName = blobPvl.findKeyword("ModelName"); std::string modelState(stateString.getBuffer(), stateString.Size()); EXPECT_TRUE(plugin->canModelBeConstructedFromState(modelName, modelState)); // check blob label ModelName and Plugin Name - EXPECT_EQ(QString(blobPvl.findKeyword("PluginName")).toStdString(), plugin->getPluginName()); - EXPECT_EQ(QString(blobPvl.findKeyword("ModelName")).toStdString(), AlternativeTestCsmModel::SENSOR_MODEL_NAME); + EXPECT_EQ(blobPvl.findKeyword("PluginName"), plugin->getPluginName()); + EXPECT_EQ(blobPvl.findKeyword("ModelName"), AlternativeTestCsmModel::SENSOR_MODEL_NAME); // Check the CsmInfo group ASSERT_TRUE(testCube->hasGroup("CsmInfo")); PvlGroup &infoGroup = testCube->group("CsmInfo"); ASSERT_TRUE(infoGroup.hasKeyword("CSMPlatformID")); - EXPECT_EQ(infoGroup["CSMPlatformID"][0].toStdString(), altModel.getPlatformIdentifier()); + EXPECT_EQ(infoGroup["CSMPlatformID"][0], altModel.getPlatformIdentifier()); ASSERT_TRUE(infoGroup.hasKeyword("CSMInstrumentId")); - EXPECT_EQ(infoGroup["CSMInstrumentId"][0].toStdString(), altModel.getSensorIdentifier()); + EXPECT_EQ(infoGroup["CSMInstrumentId"][0], altModel.getSensorIdentifier()); ASSERT_TRUE(infoGroup.hasKeyword("ReferenceTime")); - EXPECT_EQ(infoGroup["ReferenceTime"][0].toStdString(), altModel.getReferenceDateAndTime()); + EXPECT_EQ(infoGroup["ReferenceTime"][0], altModel.getReferenceDateAndTime()); ASSERT_TRUE(infoGroup.hasKeyword("ModelParameterNames")); ASSERT_EQ(infoGroup["ModelParameterNames"].size(), 3); - EXPECT_EQ(infoGroup["ModelParameterNames"][0].toStdString(), AlternativeTestCsmModel::PARAM_NAMES[0]); - EXPECT_EQ(infoGroup["ModelParameterNames"][1].toStdString(), AlternativeTestCsmModel::PARAM_NAMES[1]); - EXPECT_EQ(infoGroup["ModelParameterNames"][2].toStdString(), AlternativeTestCsmModel::PARAM_NAMES[2]); + EXPECT_EQ(infoGroup["ModelParameterNames"][0], AlternativeTestCsmModel::PARAM_NAMES[0]); + EXPECT_EQ(infoGroup["ModelParameterNames"][1], AlternativeTestCsmModel::PARAM_NAMES[1]); + EXPECT_EQ(infoGroup["ModelParameterNames"][2], AlternativeTestCsmModel::PARAM_NAMES[2]); ASSERT_TRUE(infoGroup.hasKeyword("ModelParameterUnits")); ASSERT_EQ(infoGroup["ModelParameterUnits"].size(), 3); - EXPECT_EQ(infoGroup["ModelParameterUnits"][0].toStdString(), AlternativeTestCsmModel::PARAM_UNITS[0]); - EXPECT_EQ(infoGroup["ModelParameterUnits"][1].toStdString(), AlternativeTestCsmModel::PARAM_UNITS[1]); - EXPECT_EQ(infoGroup["ModelParameterUnits"][2].toStdString(), AlternativeTestCsmModel::PARAM_UNITS[2]); + EXPECT_EQ(infoGroup["ModelParameterUnits"][0], AlternativeTestCsmModel::PARAM_UNITS[0]); + EXPECT_EQ(infoGroup["ModelParameterUnits"][1], AlternativeTestCsmModel::PARAM_UNITS[1]); + EXPECT_EQ(infoGroup["ModelParameterUnits"][2], AlternativeTestCsmModel::PARAM_UNITS[2]); ASSERT_TRUE(infoGroup.hasKeyword("ModelParameterTypes")); ASSERT_EQ(infoGroup["ModelParameterTypes"].size(), 3); - EXPECT_EQ(infoGroup["ModelParameterTypes"][0].toStdString(), "FICTITIOUS"); - EXPECT_EQ(infoGroup["ModelParameterTypes"][1].toStdString(), "REAL"); - EXPECT_EQ(infoGroup["ModelParameterTypes"][2].toStdString(), "FIXED"); + EXPECT_EQ(infoGroup["ModelParameterTypes"][0], "FICTITIOUS"); + EXPECT_EQ(infoGroup["ModelParameterTypes"][1], "REAL"); + EXPECT_EQ(infoGroup["ModelParameterTypes"][2], "FIXED"); } diff --git a/isis/tests/FunctionalTestsCubeatt.cpp b/isis/tests/FunctionalTestsCubeatt.cpp index 174474920c..8994e600b3 100644 --- a/isis/tests/FunctionalTestsCubeatt.cpp +++ b/isis/tests/FunctionalTestsCubeatt.cpp @@ -74,15 +74,15 @@ TEST_F(SmallCube, FunctionalTestCubeattVirtualBands) { // in this context: Pvl *label = outputCube.label(); PvlGroup bandBin = label->findObject("IsisCube").findGroup("BandBin"); - EXPECT_EQ(QString(bandBin["OriginalBand"][0]), "3"); - EXPECT_EQ(QString(bandBin["OriginalBand"][1]), "2"); - EXPECT_EQ(QString(bandBin["OriginalBand"][2]), "4"); - EXPECT_EQ(QString(bandBin["OriginalBand"][3]), "2"); - EXPECT_EQ(QString(bandBin["OriginalBand"][4]), "1"); - EXPECT_EQ(QString(bandBin["OriginalBand"][5]), "5"); - EXPECT_EQ(QString(bandBin["OriginalBand"][6]), "7"); - EXPECT_EQ(QString(bandBin["OriginalBand"][7]), "6"); - EXPECT_EQ(QString(bandBin["OriginalBand"][8]), "4"); + EXPECT_EQ((bandBin["OriginalBand"][0]), "3"); + EXPECT_EQ((bandBin["OriginalBand"][1]), "2"); + EXPECT_EQ((bandBin["OriginalBand"][2]), "4"); + EXPECT_EQ((bandBin["OriginalBand"][3]), "2"); + EXPECT_EQ((bandBin["OriginalBand"][4]), "1"); + EXPECT_EQ((bandBin["OriginalBand"][5]), "5"); + EXPECT_EQ((bandBin["OriginalBand"][6]), "7"); + EXPECT_EQ((bandBin["OriginalBand"][7]), "6"); + EXPECT_EQ((bandBin["OriginalBand"][8]), "4"); // Test that DNs for each band have moved appropriately @@ -155,9 +155,9 @@ TEST_F(SmallCube, FunctionalTestCubeattInputAndOutputAttributes) { Pvl *label = outputCube.label(); PvlGroup bandBin = label->findObject("IsisCube").findGroup("BandBin"); - EXPECT_EQ(QString(bandBin["OriginalBand"][0]), "3"); - EXPECT_EQ(QString(bandBin["OriginalBand"][1]), "2"); - EXPECT_EQ(QString(bandBin["OriginalBand"][2]), "4"); + EXPECT_EQ(bandBin["OriginalBand"][0], "3"); + EXPECT_EQ(bandBin["OriginalBand"][1], "2"); + EXPECT_EQ(bandBin["OriginalBand"][2], "4"); // Test that DNs for each band have moved appropriately EXPECT_DOUBLE_EQ(outputCube.statistics(1)->Average(), testCube->statistics(3)->Average()); diff --git a/isis/tests/FunctionalTestsDemprep.cpp b/isis/tests/FunctionalTestsDemprep.cpp index ea35816155..e03f044502 100644 --- a/isis/tests/FunctionalTestsDemprep.cpp +++ b/isis/tests/FunctionalTestsDemprep.cpp @@ -41,8 +41,8 @@ TEST(Demprep, DemprepDefault){ // Pixels Group PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "SignedWord"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ(double(pixels["Base"]), 1737400.0); ASSERT_EQ(double(pixels["Multiplier"]), 1.0); @@ -54,13 +54,13 @@ TEST(Demprep, DemprepDefault){ // Mapping Group PvlGroup &mapping = isisLabel->findGroup("Mapping", Pvl::Traverse); - ASSERT_EQ(mapping["ProjectionName"][0].toStdString(), "Equirectangular"); + ASSERT_EQ(mapping["ProjectionName"][0], "Equirectangular"); ASSERT_DOUBLE_EQ(double(mapping["CenterLongitude"]), 180.0); - ASSERT_EQ(mapping["TargetName"][0].toStdString(), "Moon"); + ASSERT_EQ(mapping["TargetName"][0], "Moon"); ASSERT_DOUBLE_EQ(double(mapping["EquatorialRadius"]), 1737400.0); ASSERT_DOUBLE_EQ(double(mapping["PolarRadius"]), 1737400.0); - ASSERT_EQ(mapping["LatitudeType"][0].toStdString(), "Planetocentric"); - ASSERT_EQ(mapping["LongitudeDirection"][0].toStdString(), "PositiveEast"); + ASSERT_EQ(mapping["LatitudeType"][0], "Planetocentric"); + ASSERT_EQ(mapping["LongitudeDirection"][0], "PositiveEast"); ASSERT_EQ(int(mapping["LongitudeDomain"]), 180); ASSERT_DOUBLE_EQ(double(mapping["MinimumLatitude"]), -90.0); ASSERT_DOUBLE_EQ(double(mapping["MaximumLatitude"]), 90.0); @@ -111,7 +111,7 @@ TEST(Demprep, DemprepInside){ // Mapping Group PvlGroup &mapping = isisLabel->findGroup("Mapping", Pvl::Traverse); - ASSERT_EQ(mapping["ProjectionName"][0].toStdString(), "SimpleCylindrical"); + ASSERT_EQ(mapping["ProjectionName"][0], "SimpleCylindrical"); ASSERT_NEAR(double(mapping["UpperLeftCornerX"]), -5801235.97802, .00001); ASSERT_NEAR(double(mapping["UpperLeftCornerY"]), 77703.58546, .00001); ASSERT_NEAR(double(mapping["PixelResolution"]), 1895.20940, .00001); @@ -142,7 +142,7 @@ TEST(Demprep, DemprepSpecialPixels){ // Mapping Group PvlGroup &mapping = isisLabel->findGroup("Mapping", Pvl::Traverse); - ASSERT_EQ(mapping["ProjectionName"][0].toStdString(), "Equirectangular"); + ASSERT_EQ(mapping["ProjectionName"][0], "Equirectangular"); ASSERT_DOUBLE_EQ(double(mapping["UpperLeftCornerX"]), -915000.0); ASSERT_DOUBLE_EQ(double(mapping["UpperLeftCornerY"]), 460000.0); ASSERT_DOUBLE_EQ(double(mapping["PixelResolution"]), 5000); diff --git a/isis/tests/FunctionalTestsEis2isis.cpp b/isis/tests/FunctionalTestsEis2isis.cpp index dd2bf228d5..35190f11db 100644 --- a/isis/tests/FunctionalTestsEis2isis.cpp +++ b/isis/tests/FunctionalTestsEis2isis.cpp @@ -49,16 +49,16 @@ TEST(Eis2Isis, Eis2IsisTestNacDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Clipper"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "EIS-NAC-RS" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Europa" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2025-01-01T00:00:00.000" ); - ASSERT_EQ(inst["JitterLineCoefficients"][0].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterLineCoefficients"][1].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterLineCoefficients"][2].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterSampleCoefficients"][0].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterSampleCoefficients"][1].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterSampleCoefficients"][2].toStdString(), "0.0"); + ASSERT_EQ(inst["SpacecraftName"][0], "Clipper"); + ASSERT_EQ(inst["InstrumentId"][0], "EIS-NAC-RS" ); + ASSERT_EQ(inst["TargetName"][0], "Europa" ); + ASSERT_EQ(inst["StartTime"][0], "2025-01-01T00:00:00.000" ); + ASSERT_EQ(inst["JitterLineCoefficients"][0], "0.0"); + ASSERT_EQ(inst["JitterLineCoefficients"][1], "0.0"); + ASSERT_EQ(inst["JitterLineCoefficients"][2], "0.0"); + ASSERT_EQ(inst["JitterSampleCoefficients"][0], "0.0"); + ASSERT_EQ(inst["JitterSampleCoefficients"][1], "0.0"); + ASSERT_EQ(inst["JitterSampleCoefficients"][2], "0.0"); // Kernels Group PvlGroup &kernels = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -114,16 +114,16 @@ TEST(Eis2Isis, Eis2IsisTestNacCheckline) // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Clipper"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "EIS-NAC-RS" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Europa" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2025-01-01T00:00:00.000" ); - ASSERT_EQ(inst["JitterLineCoefficients"][0].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterLineCoefficients"][1].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterLineCoefficients"][2].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterSampleCoefficients"][0].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterSampleCoefficients"][1].toStdString(), "0.0"); - ASSERT_EQ(inst["JitterSampleCoefficients"][2].toStdString(), "0.0"); + ASSERT_EQ(inst["SpacecraftName"][0], "Clipper"); + ASSERT_EQ(inst["InstrumentId"][0], "EIS-NAC-RS" ); + ASSERT_EQ(inst["TargetName"][0], "Europa" ); + ASSERT_EQ(inst["StartTime"][0], "2025-01-01T00:00:00.000" ); + ASSERT_EQ(inst["JitterLineCoefficients"][0], "0.0"); + ASSERT_EQ(inst["JitterLineCoefficients"][1], "0.0"); + ASSERT_EQ(inst["JitterLineCoefficients"][2], "0.0"); + ASSERT_EQ(inst["JitterSampleCoefficients"][0], "0.0"); + ASSERT_EQ(inst["JitterSampleCoefficients"][1], "0.0"); + ASSERT_EQ(inst["JitterSampleCoefficients"][2], "0.0"); // Kernels Group diff --git a/isis/tests/FunctionalTestsFillGap.cpp b/isis/tests/FunctionalTestsFillGap.cpp index eae4da1366..60402caf41 100644 --- a/isis/tests/FunctionalTestsFillGap.cpp +++ b/isis/tests/FunctionalTestsFillGap.cpp @@ -407,5 +407,5 @@ TEST_F( SmallGapCube, FillGapTestGapsOnEdge ) } PvlGroup &mess = log.findGroup("Messages", Pvl::Traverse); - EXPECT_EQ(mess["Warning"][0].toStdString(), "Unable to fill 9 special pixels." ); + EXPECT_EQ(mess["Warning"][0], "Unable to fill 9 special pixels." ); } diff --git a/isis/tests/FunctionalTestsFindGaps.cpp b/isis/tests/FunctionalTestsFindGaps.cpp index 0d56b1dca6..d2c8a4e0e2 100644 --- a/isis/tests/FunctionalTestsFindGaps.cpp +++ b/isis/tests/FunctionalTestsFindGaps.cpp @@ -60,7 +60,7 @@ TEST_F( SmallCube, FindGapsDefault ) EXPECT_EQ( outHist->ValidPixels(), 60 ); // test that Gap group has been written to the logfile - Pvl logFile = Pvl(logFileName); + Pvl logFile = Pvl(logFileName.toStdString()); EXPECT_TRUE(logFile.hasGroup("Gap")); } @@ -111,7 +111,7 @@ TEST_F( SmallCube, FindGapsEndOfBand ) EXPECT_EQ( outHist->ValidPixels(), 50 ); // test that Gap group has been written to the logfile - Pvl logFile = Pvl(logFileName); + Pvl logFile = Pvl(logFileName.toStdString()); EXPECT_TRUE(logFile.hasGroup("Gap")); } @@ -174,7 +174,7 @@ TEST_F( SmallCube, FindGapsCorTol ) EXPECT_EQ( outHist->ValidPixels(), 50 ); // test that Gap group has been written to the logfile - Pvl logFile = Pvl(logFileName); + Pvl logFile = Pvl(logFileName.toStdString()); ASSERT_TRUE(logFile.hasGroup("Gap")); // test that the gap correlation is >0 and < our correlation tolerence: 0.9 diff --git a/isis/tests/FunctionalTestsFits2isis.cpp b/isis/tests/FunctionalTestsFits2isis.cpp index a3f2b41221..63d9c57180 100644 --- a/isis/tests/FunctionalTestsFits2isis.cpp +++ b/isis/tests/FunctionalTestsFits2isis.cpp @@ -40,8 +40,8 @@ TEST(Fits2Isis, Fits2IsisTestDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "WFPC2" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1999-02-20" ); + ASSERT_EQ(inst["InstrumentId"][0], "WFPC2" ); + ASSERT_EQ(inst["StartTime"][0], "1999-02-20" ); std::unique_ptr hist (cube.histogram()); @@ -83,7 +83,7 @@ TEST(Fits2Isis, Fits2IsisOrganizationBsq) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["Target"][0].toStdString(), "JUPITER" ); + ASSERT_EQ(inst["Target"][0], "JUPITER" ); std::unique_ptr hist (cube.histogram()); @@ -126,7 +126,7 @@ TEST(Fits2Isis, Fits2IsisOrganizationBil) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["Target"][0].toStdString(), "JUPITER" ); + ASSERT_EQ(inst["Target"][0], "JUPITER" ); std::unique_ptr hist (cube.histogram()); diff --git a/isis/tests/FunctionalTestsFootprintinit.cpp b/isis/tests/FunctionalTestsFootprintinit.cpp index d88c51aa09..f927ca092b 100644 --- a/isis/tests/FunctionalTestsFootprintinit.cpp +++ b/isis/tests/FunctionalTestsFootprintinit.cpp @@ -142,8 +142,8 @@ TEST_F(DefaultCube, FunctionalTestFootprintinitPrecision) { ASSERT_TRUE(testCube->label()->hasObject("Polygon")); ASSERT_TRUE(log.hasGroup("Results")); - ASSERT_EQ(100, log.findGroup("Results").findKeyword("LINC")[0].toInt()); - ASSERT_EQ(100, log.findGroup("Results").findKeyword("SINC")[0].toInt()); + ASSERT_EQ(100, std::stoi(log.findGroup("Results").findKeyword("LINC")[0])); + ASSERT_EQ(100, std::stoi(log.findGroup("Results").findKeyword("SINC")[0])); ImagePolygon poly = testCube->readFootprint(); diff --git a/isis/tests/FunctionalTestsFrameStitch.cpp b/isis/tests/FunctionalTestsFrameStitch.cpp index a1270a7896..92de4796db 100644 --- a/isis/tests/FunctionalTestsFrameStitch.cpp +++ b/isis/tests/FunctionalTestsFrameStitch.cpp @@ -163,7 +163,7 @@ TEST_F(PushFramePair, FunctionalTestFramestitchFlip) { ASSERT_TRUE(outCube.hasGroup("Instrument")); ASSERT_TRUE(outCube.group("Instrument").hasKeyword("DataFlipped")); - EXPECT_TRUE(toBool(outCube.group("Instrument")["DataFlipped"])); + EXPECT_TRUE(std::stoi(outCube.group("Instrument")["DataFlipped"])); } TEST_F(FlippedPushFramePair, FunctionalTestFramestitchNoFlip) { @@ -213,7 +213,7 @@ TEST_F(FlippedPushFramePair, FunctionalTestFramestitchNoFlip) { ASSERT_TRUE(outCube.hasGroup("Instrument")); ASSERT_TRUE(outCube.group("Instrument").hasKeyword("DataFlipped")); - EXPECT_TRUE(toBool(outCube.group("Instrument")["DataFlipped"])); + EXPECT_TRUE(std::stoi(outCube.group("Instrument")["DataFlipped"])); } TEST_F(FlippedPushFramePair, FunctionalTestFramestitchFlip) { @@ -264,7 +264,7 @@ TEST_F(FlippedPushFramePair, FunctionalTestFramestitchFlip) { ASSERT_TRUE(outCube.hasGroup("Instrument")); ASSERT_TRUE(outCube.group("Instrument").hasKeyword("DataFlipped")); - EXPECT_FALSE(toBool(outCube.group("Instrument")["DataFlipped"])); + EXPECT_FALSE(std::stoi(outCube.group("Instrument")["DataFlipped"])); } TEST_F(PushFramePair, FunctionalTestFramestitchDifferentObservations) { diff --git a/isis/tests/FunctionalTestsGetsn.cpp b/isis/tests/FunctionalTestsGetsn.cpp index 74abd477e7..7cd1daa23a 100644 --- a/isis/tests/FunctionalTestsGetsn.cpp +++ b/isis/tests/FunctionalTestsGetsn.cpp @@ -32,9 +32,9 @@ TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) { getsn( testCube, options, &appLog ); PvlGroup results = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("Filename"), testCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("SerialNumber"), expectedSN); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("ObservationNumber"), expectedON); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("Filename"), testCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("SerialNumber"), expectedSN.toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("ObservationNumber"), expectedON.toStdString()); } @@ -70,7 +70,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnDefaultTrue) { getsn( testCube, options, &appLog ); PvlGroup results = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fileName , results.findKeyword("SerialNumber")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fileName.toStdString() , results.findKeyword("SerialNumber")); } @@ -88,7 +88,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnDefaultFalse) { getsn( testCube, options, &appLog ); PvlGroup results = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fileName , results.findKeyword("SerialNumber")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fileName.toStdString() , results.findKeyword("SerialNumber")); } diff --git a/isis/tests/FunctionalTestsGllssical.cpp b/isis/tests/FunctionalTestsGllssical.cpp index 9b92e53a06..3971d86af0 100644 --- a/isis/tests/FunctionalTestsGllssical.cpp +++ b/isis/tests/FunctionalTestsGllssical.cpp @@ -29,10 +29,10 @@ TEST_F(GalileoSsiCube, FunctionalTestGllssicalDefault) { PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("RadiometricCalibration"); - EXPECT_EQ(radGroup.findKeyword("DarkCurrentFile")[0].toStdString(), "$galileo/calibration/darkcurrent/2f8.dc04.cub"); - EXPECT_EQ(radGroup.findKeyword("GainFile")[0].toStdString(), "$galileo/calibration/gain/redf.cal04.cub"); - EXPECT_EQ(radGroup.findKeyword("ShutterFile")[0].toStdString(), "$galileo/calibration/shutter/calibration.so02F.cub"); - EXPECT_EQ(radGroup.findKeyword("OutputUnits")[0].toStdString(), "I/F"); + EXPECT_EQ(radGroup.findKeyword("DarkCurrentFile")[0], "$galileo/calibration/darkcurrent/2f8.dc04.cub"); + EXPECT_EQ(radGroup.findKeyword("GainFile")[0], "$galileo/calibration/gain/redf.cal04.cub"); + EXPECT_EQ(radGroup.findKeyword("ShutterFile")[0], "$galileo/calibration/shutter/calibration.so02F.cub"); + EXPECT_EQ(radGroup.findKeyword("OutputUnits")[0], "I/F"); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("ScaleFactor"), 1.0); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("S1"), 0.005155); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("RSUN"), 0.27217458506088); @@ -82,10 +82,10 @@ TEST_F(GalileoSsiCube, FunctionalTestGllssicalClear) { PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("RadiometricCalibration"); - EXPECT_EQ(radGroup.findKeyword("DarkCurrentFile")[0].toStdString(), "$galileo/calibration/darkcurrent/2f8.dc04.cub"); - EXPECT_EQ(radGroup.findKeyword("GainFile")[0].toStdString(), "$galileo/calibration/gain/clrf.cal04.cub"); - EXPECT_EQ(radGroup.findKeyword("ShutterFile")[0].toStdString(), "$galileo/calibration/shutter/calibration.so02F.cub"); - EXPECT_EQ(radGroup.findKeyword("OutputUnits")[0].toStdString(), "I/F"); + EXPECT_EQ(radGroup.findKeyword("DarkCurrentFile")[0], "$galileo/calibration/darkcurrent/2f8.dc04.cub"); + EXPECT_EQ(radGroup.findKeyword("GainFile")[0], "$galileo/calibration/gain/clrf.cal04.cub"); + EXPECT_EQ(radGroup.findKeyword("ShutterFile")[0], "$galileo/calibration/shutter/calibration.so02F.cub"); + EXPECT_EQ(radGroup.findKeyword("OutputUnits")[0], "I/F"); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("ScaleFactor"), 1.0); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("S1"), 0.0043579999999999999); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("RSUN"), 0.27217458506088); @@ -121,10 +121,10 @@ TEST_F(GalileoSsiCube, FunctionalTestGllssicalRadiance) { PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("RadiometricCalibration"); - EXPECT_EQ(radGroup.findKeyword("DarkCurrentFile")[0].toStdString(), "$galileo/calibration/darkcurrent/2f8.dc04.cub"); - EXPECT_EQ(radGroup.findKeyword("GainFile")[0].toStdString(), "$galileo/calibration/gain/redf.cal04.cub"); - EXPECT_EQ(radGroup.findKeyword("ShutterFile")[0].toStdString(), "$galileo/calibration/shutter/calibration.so02F.cub"); - EXPECT_EQ(radGroup.findKeyword("OutputUnits")[0].toStdString(), "Radiance"); + EXPECT_EQ(radGroup.findKeyword("DarkCurrentFile")[0], "$galileo/calibration/darkcurrent/2f8.dc04.cub"); + EXPECT_EQ(radGroup.findKeyword("GainFile")[0], "$galileo/calibration/gain/redf.cal04.cub"); + EXPECT_EQ(radGroup.findKeyword("ShutterFile")[0], "$galileo/calibration/shutter/calibration.so02F.cub"); + EXPECT_EQ(radGroup.findKeyword("OutputUnits")[0], "Radiance"); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("ScaleFactor"), 0.0001); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("Scale"), 0.0001); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("GC"), 9.771); diff --git a/isis/tests/FunctionalTestsHi2isis.cpp b/isis/tests/FunctionalTestsHi2isis.cpp index 76a495a665..0b149ff286 100644 --- a/isis/tests/FunctionalTestsHi2isis.cpp +++ b/isis/tests/FunctionalTestsHi2isis.cpp @@ -37,20 +37,20 @@ TEST(hi2isisTest, FunctionalTestHi2isisDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "MARS RECONNAISSANCE ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "HIRISE"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2006-11-17T03:27:53.118"); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2006-11-17T03:27:54.792"); - EXPECT_EQ(inst["ObservationStartCount"][0].toStdString(), "848201291:54379"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "848201291:62546"); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "848201293:41165"); - EXPECT_EQ(inst["ReadoutStartCount"][0].toStdString(), "848201300:53057"); - EXPECT_EQ(inst["CalibrationStartTime"][0].toStdString(), "2006-11-17T03:27:53.104"); - EXPECT_EQ(inst["CalibrationStartCount"][0].toStdString(), "848201291:61647"); - EXPECT_EQ(inst["AnalogPowerStartTime"][0].toStdString(), "-9999"); - EXPECT_EQ(inst["AnalogPowerStartCount"][0].toStdString(), "-9999"); - EXPECT_EQ(inst["MissionPhaseName"][0].toStdString(), "PRIMARY SCIENCE PHASE"); + EXPECT_EQ(inst["SpacecraftName"][0], "MARS RECONNAISSANCE ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "HIRISE"); + EXPECT_EQ(inst["TargetName"][0], "Mars"); + EXPECT_EQ(inst["StartTime"][0], "2006-11-17T03:27:53.118"); + EXPECT_EQ(inst["StopTime"][0], "2006-11-17T03:27:54.792"); + EXPECT_EQ(inst["ObservationStartCount"][0], "848201291:54379"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "848201291:62546"); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "848201293:41165"); + EXPECT_EQ(inst["ReadoutStartCount"][0], "848201300:53057"); + EXPECT_EQ(inst["CalibrationStartTime"][0], "2006-11-17T03:27:53.104"); + EXPECT_EQ(inst["CalibrationStartCount"][0], "848201291:61647"); + EXPECT_EQ(inst["AnalogPowerStartTime"][0], "-9999"); + EXPECT_EQ(inst["AnalogPowerStartCount"][0], "-9999"); + EXPECT_EQ(inst["MissionPhaseName"][0], "PRIMARY SCIENCE PHASE"); EXPECT_DOUBLE_EQ(inst["LineExposureDuration"], 334.7500); EXPECT_DOUBLE_EQ(inst["ScanExposureDuration"], 83.6875); EXPECT_DOUBLE_EQ(inst["DeltaLineTimerCount"], 155); @@ -58,9 +58,9 @@ TEST(hi2isisTest, FunctionalTestHi2isisDefault) { EXPECT_DOUBLE_EQ(inst["Tdi"], 64); EXPECT_DOUBLE_EQ(inst["FocusPositionCount"], 2020); EXPECT_DOUBLE_EQ(inst["CpmmNumber"], 4); - EXPECT_EQ(inst["CcdId"][0].toStdString(), "BG12"); + EXPECT_EQ(inst["CcdId"][0], "BG12"); EXPECT_DOUBLE_EQ(inst["ChannelNumber"], 0); - EXPECT_EQ(inst["LookupTableType"][0].toStdString(), "Stored"); + EXPECT_EQ(inst["LookupTableType"][0], "Stored"); EXPECT_DOUBLE_EQ(inst["LookupTableMinimum"], -9998); EXPECT_DOUBLE_EQ(inst["LookupTableMaximum"], -9998); EXPECT_DOUBLE_EQ(inst["LookupTableMedian"], -9998); @@ -101,26 +101,26 @@ TEST(hi2isisTest, FunctionalTestHi2isisDefault) { EXPECT_DOUBLE_EQ(inst["CpmmPwsBoardTemperature"], 18.078); EXPECT_DOUBLE_EQ(inst["MechTlmBoardTemperature"], 35.0546); EXPECT_DOUBLE_EQ(inst["InstContBoardTemperature"], 34.6875); - EXPECT_EQ(inst["DllLockedFlag"][0].toStdString(), "YES"); - EXPECT_EQ(inst["DllLockedFlag"][1].toStdString(), "YES"); + EXPECT_EQ(inst["DllLockedFlag"][0], "YES"); + EXPECT_EQ(inst["DllLockedFlag"][1], "YES"); EXPECT_DOUBLE_EQ(inst["DllResetCount"], 0); - EXPECT_EQ(inst["DllLockedOnceFlag"][0].toStdString(), "YES"); - EXPECT_EQ(inst["DllLockedOnceFlag"][1].toStdString(), "YES"); + EXPECT_EQ(inst["DllLockedOnceFlag"][0], "YES"); + EXPECT_EQ(inst["DllLockedOnceFlag"][1], "YES"); EXPECT_DOUBLE_EQ(inst["DllFrequenceCorrectCount"], 4); - EXPECT_EQ(inst["ADCTimingSetting"][0].toStdString(), "5"); - EXPECT_EQ(inst["ADCTimingSetting"][1].toStdString(), "4"); - EXPECT_EQ(inst["Unlutted"][0].toStdString(), "TRUE"); + EXPECT_EQ(inst["ADCTimingSetting"][0], "5"); + EXPECT_EQ(inst["ADCTimingSetting"][1], "4"); + EXPECT_EQ(inst["Unlutted"][0], "TRUE"); // Archive Group PvlGroup &arch = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(arch["DataSetId"][0].toStdString(), "MRO-M-HIRISE-2-EDR-V1.0"); - EXPECT_EQ(arch["ProducerId"][0].toStdString(), "UA"); - EXPECT_EQ(arch["ObservationId"][0].toStdString(), "PSP_001446_1790"); - EXPECT_EQ(arch["ProductId"][0].toStdString(), "PSP_001446_1790_BG12_0"); + EXPECT_EQ(arch["DataSetId"][0], "MRO-M-HIRISE-2-EDR-V1.0"); + EXPECT_EQ(arch["ProducerId"][0], "UA"); + EXPECT_EQ(arch["ObservationId"][0], "PSP_001446_1790"); + EXPECT_EQ(arch["ProductId"][0], "PSP_001446_1790_BG12_0"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["Name"][0].toStdString(), "BlueGreen"); + EXPECT_EQ(bandbin["Name"][0], "BlueGreen"); EXPECT_DOUBLE_EQ(bandbin["Center"], 500); EXPECT_EQ(bandbin["Center"].unit(), "NANOMETERS"); EXPECT_DOUBLE_EQ(bandbin["Width"], 200); @@ -162,23 +162,23 @@ TEST(hi2isisTest, FunctionalTestHi2isisDefaultWorstCase) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "MARS RECONNAISSANCE ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "HIRISE"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2006-11-08T04:49:14.187"); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2006-11-08T04:49:17.990"); - EXPECT_EQ(inst["ObservationStartCount"][0].toStdString(), "847428572:42722"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "847428573:01190"); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "847428576:53783"); - EXPECT_EQ(inst["ReadoutStartCount"][0].toStdString(), "847428724:55340"); - EXPECT_EQ(inst["CalibrationStartTime"][0].toStdString(), "2006-11-08T04:49:14.175"); - EXPECT_EQ(inst["CalibrationStartCount"][0].toStdString(), "847428573:00368"); + EXPECT_EQ(inst["SpacecraftName"][0], "MARS RECONNAISSANCE ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "HIRISE"); + EXPECT_EQ(inst["TargetName"][0], "Mars"); + EXPECT_EQ(inst["StartTime"][0], "2006-11-08T04:49:14.187"); + EXPECT_EQ(inst["StopTime"][0], "2006-11-08T04:49:17.990"); + EXPECT_EQ(inst["ObservationStartCount"][0], "847428572:42722"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "847428573:01190"); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "847428576:53783"); + EXPECT_EQ(inst["ReadoutStartCount"][0], "847428724:55340"); + EXPECT_EQ(inst["CalibrationStartTime"][0], "2006-11-08T04:49:14.175"); + EXPECT_EQ(inst["CalibrationStartCount"][0], "847428573:00368"); EXPECT_DOUBLE_EQ(inst["LineExposureDuration"], 380.25); EXPECT_DOUBLE_EQ(inst["ScanExposureDuration"], 95.0625); EXPECT_DOUBLE_EQ(inst["DeltaLineTimerCount"], 337); EXPECT_DOUBLE_EQ(inst["Tdi"], 32); EXPECT_DOUBLE_EQ(inst["CpmmNumber"], 6); - EXPECT_EQ(inst["CcdId"][0].toStdString(), "IR10"); + EXPECT_EQ(inst["CcdId"][0], "IR10"); EXPECT_DOUBLE_EQ(inst["ChannelNumber"], 1); EXPECT_DOUBLE_EQ(inst["LookupTableNumber"], 17); EXPECT_DOUBLE_EQ(inst["OptBnchFlexureTemperature"], 19.5881); @@ -219,7 +219,7 @@ TEST(hi2isisTest, FunctionalTestHi2isisDefaultWorstCase) { // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["Name"][0].toStdString(), "NearInfrared"); + EXPECT_EQ(bandbin["Name"][0], "NearInfrared"); EXPECT_DOUBLE_EQ(bandbin["Center"], 900); EXPECT_DOUBLE_EQ(bandbin["Width"], 200); diff --git a/isis/tests/FunctionalTestsHical.cpp b/isis/tests/FunctionalTestsHical.cpp index 5047e398c3..f75f63b084 100644 --- a/isis/tests/FunctionalTestsHical.cpp +++ b/isis/tests/FunctionalTestsHical.cpp @@ -40,7 +40,7 @@ TEST(HicalTest, Default) { PvlGroup calibration = outCube.group("RadiometricCalibration"); ASSERT_TRUE(calibration.hasKeyword("Program")); - EXPECT_EQ(calibration.findKeyword("Program")[0].toStdString(), "hical"); + EXPECT_EQ(calibration.findKeyword("Program")[0], "hical"); std::unique_ptr stats (outCube.statistics()); EXPECT_NEAR(stats->Average(), 0.066949089371337, .00001); diff --git a/isis/tests/FunctionalTestsHicolormos.cpp b/isis/tests/FunctionalTestsHicolormos.cpp index afa14cd823..d2e60c8faa 100644 --- a/isis/tests/FunctionalTestsHicolormos.cpp +++ b/isis/tests/FunctionalTestsHicolormos.cpp @@ -43,17 +43,17 @@ TEST_F(MroHiriseCube, FunctionalTestHicolormosDefault) { PvlKeyword kw = group.findKeyword("cpmmTdiFlag"); for (int i = 0; i < cppmmTdiFlag.size(); i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cppmmTdiFlag[i], kw[i]); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cppmmTdiFlag[i].toStdString(), kw[i]); } kw = group.findKeyword("cpmmSummingFlag"); for (int i = 0; i < cppmmTdiFlag.size(); i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, cpmmSummingFlag[i], kw[i]); + EXPECT_PRED_FORMAT2(AssertStringsEqual, cpmmSummingFlag[i].toStdString(), kw[i]); } kw = group.findKeyword("SpecialProcessingFlag"); for (int i = 0; i < cppmmTdiFlag.size(); i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, specialProcessingFlag[i], kw[i]); + EXPECT_PRED_FORMAT2(AssertStringsEqual, specialProcessingFlag[i].toStdString(), kw[i]); } Histogram *oCubeStats = oCube.histogram(); diff --git a/isis/tests/FunctionalTestsHicrop.cpp b/isis/tests/FunctionalTestsHicrop.cpp index 2aa2ef1429..65dddfc0fd 100644 --- a/isis/tests/FunctionalTestsHicrop.cpp +++ b/isis/tests/FunctionalTestsHicrop.cpp @@ -40,20 +40,20 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByCk) { EXPECT_EQ((int)results.findKeyword("OututStartingLine"), 55); EXPECT_EQ((int)results.findKeyword("OututEndingLine"), 1056); EXPECT_EQ((int)results.findKeyword("OututLineCount"), 1002); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7300819"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopTime"), "2008-05-17T09:37:31.0666673"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartClock"), "4/0895484265.14186"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopClock"), "4/0895484271.36245"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7300819"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopTime"), "2008-05-17T09:37:31.0666673"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484265.14186"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484271.36245"); Cube oCube(outCubeFileName); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 1002); EXPECT_EQ(oCube.sampleCount(), 1204); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); } @@ -80,20 +80,20 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByLine) { EXPECT_EQ((int)results.findKeyword("OututStartingLine"), 55); EXPECT_EQ((int)results.findKeyword("OututEndingLine"), 1056); EXPECT_EQ((int)results.findKeyword("OututLineCount"), 1002); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7892562"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8845088"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartClock"), "4/0895484264.57678"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopClock"), "4/0895484264.63921"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7892562"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8845088"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57678"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63921"); Cube oCube(outCubeFileName); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 1002); EXPECT_EQ(oCube.sampleCount(), 1204); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); } @@ -121,20 +121,20 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByTimes) { EXPECT_EQ((int)results.findKeyword("OututStartingLine"), 1); EXPECT_EQ((int)results.findKeyword("OututEndingLine"), 953); EXPECT_EQ((int)results.findKeyword("OututLineCount"), 953); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7841228"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartClock"), "4/0895484264.57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopClock"), "4/0895484264.63279"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7841228"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); Cube oCube(outCubeFileName); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 953); EXPECT_EQ(oCube.sampleCount(), 1204); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); } @@ -162,20 +162,20 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByJitterDefault) { EXPECT_EQ((int)results.findKeyword("OututStartingLine"), 1); EXPECT_EQ((int)results.findKeyword("OututEndingLine"), 953); EXPECT_EQ((int)results.findKeyword("OututLineCount"), 953); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7841228"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartClock"), "4/0895484264.57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopClock"), "4/0895484264.63279"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7841228"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); Cube oCube(outCubeFileName); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 953); EXPECT_EQ(oCube.sampleCount(), 1204); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); } @@ -224,20 +224,20 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByJitterZero) { EXPECT_EQ((int)results.findKeyword("OututStartingLine"), 114); EXPECT_EQ((int)results.findKeyword("OututEndingLine"), 953); EXPECT_EQ((int)results.findKeyword("OututLineCount"), 840); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7948649"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartClock"), "4/0895484264.58046"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopClock"), "4/0895484264.63279"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7948649"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.58046"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); Cube oCube(outCubeFileName); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 840); EXPECT_EQ(oCube.sampleCount(), 1204); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); } @@ -286,20 +286,20 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByJitterZeroSample) { EXPECT_EQ((int)results.findKeyword("OututStartingLine"), 1); EXPECT_EQ((int)results.findKeyword("OututEndingLine"), 953); EXPECT_EQ((int)results.findKeyword("OututLineCount"), 953); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7841228"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartClock"), "4/0895484264.57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopClock"), "4/0895484264.63279"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7841228"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); Cube oCube(outCubeFileName); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 953); EXPECT_EQ(oCube.sampleCount(), 1204); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); } @@ -348,20 +348,20 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByJitterZeroLine) { EXPECT_EQ((int)results.findKeyword("OututStartingLine"), 1); EXPECT_EQ((int)results.findKeyword("OututEndingLine"), 953); EXPECT_EQ((int)results.findKeyword("OututLineCount"), 953); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7841228"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStartClock"), "4/0895484264.57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)results.findKeyword("OututStopClock"), "4/0895484264.63279"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartTime"), "2008-05-17T09:37:24.7841228"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopTime"), "2008-05-17T09:37:24.8747174"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); Cube oCube(outCubeFileName); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 953); EXPECT_EQ(oCube.sampleCount(), 1204); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StartTime"), "2008-05-17T09:37:24.7300819"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("StopTime"), "2008-05-17T09:37:31.0666673"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStartCount"), "895484264:57342"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, oCubeInstrument.findKeyword("SpacecraftClockStopCount"), "895484272:12777"); } diff --git a/isis/tests/FunctionalTestsHicubenorm.cpp b/isis/tests/FunctionalTestsHicubenorm.cpp index 660d8e19ba..ecbc1360b8 100644 --- a/isis/tests/FunctionalTestsHicubenorm.cpp +++ b/isis/tests/FunctionalTestsHicubenorm.cpp @@ -130,10 +130,10 @@ TEST_F(MroHiriseCube, FunctionalTestHicubenormNewVersion) { PvlGroup stats("Results"); for(int i = 1; i <= 1204; i++) { stats += PvlKeyword("Band", "1"); - stats += PvlKeyword("RowCol", QString::number(i)); - stats += PvlKeyword("ValidPixels", QString::number(1056)); - stats += PvlKeyword("Mean", QString::number(i)); - stats += PvlKeyword("Median", QString::number(i/2)); + stats += PvlKeyword("RowCol", std::to_string(i)); + stats += PvlKeyword("ValidPixels", std::to_string(1056)); + stats += PvlKeyword("Mean", std::to_string(i)); + stats += PvlKeyword("Median", std::to_string(i/2)); // the rest shouldn't matter stats += PvlKeyword("Std", "0.0"); stats += PvlKeyword("Minimum", "0.0"); @@ -142,7 +142,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicubenormNewVersion) { Pvl table; table.addGroup(stats); - table.write(tablePath); + table.write(tablePath.toStdString()); QVector args = {"to="+outCubeFileName, "mode=subtract", "fromstats="+tablePath, "statsource=pvl", "normalizer=average", "new_version=yes"}; diff --git a/isis/tests/FunctionalTestsHidtmgen.cpp b/isis/tests/FunctionalTestsHidtmgen.cpp index 467a50e472..0a7e9682f7 100644 --- a/isis/tests/FunctionalTestsHidtmgen.cpp +++ b/isis/tests/FunctionalTestsHidtmgen.cpp @@ -33,26 +33,26 @@ TEST(Hidtmgen, HidtmgenTestColor){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl dtmLabel(prefix.path()+"/DTEEZ_042252_1930_042753_1930_A31.IMG"); + Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A31.IMG"); - ASSERT_EQ(dtmLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + ASSERT_EQ(dtmLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(dtmLabel["RECORD_BYTES"], 32); ASSERT_DOUBLE_EQ(dtmLabel["FILE_RECORDS"], 155); ASSERT_DOUBLE_EQ(dtmLabel["^IMAGE"], 133); - ASSERT_EQ(dtmLabel["DATA_SET_ID"][0].toStdString(), "MRO-M-HIRISE-5-DTM-V1.0"); - ASSERT_EQ(dtmLabel["PRODUCER_INSTITUTION_NAME"][0].toStdString(), "UNIVERSITY OF ARIZONA"); - ASSERT_EQ(dtmLabel["PRODUCER_ID"][0].toStdString(), "UA"); - ASSERT_EQ(dtmLabel["PRODUCER_FULL_NAME"][0].toStdString(), "ALFRED MCEWEN"); - ASSERT_EQ(dtmLabel["PRODUCT_ID"][0].toStdString(), "DTEEZ_042252_1930_042753_1930_A31"); + ASSERT_EQ(dtmLabel["DATA_SET_ID"][0], "MRO-M-HIRISE-5-DTM-V1.0"); + ASSERT_EQ(dtmLabel["PRODUCER_INSTITUTION_NAME"][0], "UNIVERSITY OF ARIZONA"); + ASSERT_EQ(dtmLabel["PRODUCER_ID"][0], "UA"); + ASSERT_EQ(dtmLabel["PRODUCER_FULL_NAME"][0], "ALFRED MCEWEN"); + ASSERT_EQ(dtmLabel["PRODUCT_ID"][0], "DTEEZ_042252_1930_042753_1930_A31"); ASSERT_DOUBLE_EQ(dtmLabel["PRODUCT_VERSION_ID"], 0.314); - ASSERT_EQ(dtmLabel["INSTRUMENT_HOST_NAME"][0].toStdString(), "MARS RECONNAISSANCE ORBITER"); - ASSERT_EQ(dtmLabel["INSTRUMENT_NAME"][0].toStdString(), "HIGH RESOLUTION IMAGING SCIENCE EXPERIMENT"); - ASSERT_EQ(dtmLabel["INSTRUMENT_ID"][0].toStdString(), "HIRISE"); - ASSERT_EQ(dtmLabel["TARGET_NAME"][0].toStdString(), "MARS"); - ASSERT_EQ(dtmLabel["SOURCE_PRODUCT_ID"][0].toStdString(), "ESP_042252_1930"); - ASSERT_EQ(dtmLabel["SOURCE_PRODUCT_ID"][1].toStdString(), "ESP_042753_1930"); - ASSERT_EQ(dtmLabel["RATIONALE_DESC"][0].toStdString(), "NULL"); + ASSERT_EQ(dtmLabel["INSTRUMENT_HOST_NAME"][0], "MARS RECONNAISSANCE ORBITER"); + ASSERT_EQ(dtmLabel["INSTRUMENT_NAME"][0], "HIGH RESOLUTION IMAGING SCIENCE EXPERIMENT"); + ASSERT_EQ(dtmLabel["INSTRUMENT_ID"][0], "HIRISE"); + ASSERT_EQ(dtmLabel["TARGET_NAME"][0], "MARS"); + ASSERT_EQ(dtmLabel["SOURCE_PRODUCT_ID"][0], "ESP_042252_1930"); + ASSERT_EQ(dtmLabel["SOURCE_PRODUCT_ID"][1], "ESP_042753_1930"); + ASSERT_EQ(dtmLabel["RATIONALE_DESC"][0], "NULL"); PvlObject dtmImage = dtmLabel.findObject("IMAGE"); @@ -62,22 +62,22 @@ TEST(Hidtmgen, HidtmgenTestColor){ ASSERT_DOUBLE_EQ(dtmImage["OFFSET"], 0.0); ASSERT_DOUBLE_EQ(dtmImage["SCALING_FACTOR"], 1.0); ASSERT_DOUBLE_EQ(dtmImage["SAMPLE_BITS"], 32); - ASSERT_EQ(dtmImage["SAMPLE_BIT_MASK"][0].toStdString(), "2#11111111111111111111111111111111#"); - ASSERT_EQ(dtmImage["SAMPLE_TYPE"][0].toStdString(), "PC_REAL"); - ASSERT_EQ(dtmImage["MISSING_CONSTANT"][0].toStdString(), "16#FF7FFFFB#"); + ASSERT_EQ(dtmImage["SAMPLE_BIT_MASK"][0], "2#11111111111111111111111111111111#"); + ASSERT_EQ(dtmImage["SAMPLE_TYPE"][0], "PC_REAL"); + ASSERT_EQ(dtmImage["MISSING_CONSTANT"][0], "16#FF7FFFFB#"); ASSERT_DOUBLE_EQ(dtmImage["VALID_MINIMUM"], -1884.17); ASSERT_DOUBLE_EQ(dtmImage["VALID_MAXIMUM"], -1324.12); PvlObject dtmProj = dtmLabel.findObject("IMAGE_MAP_PROJECTION"); - ASSERT_EQ(dtmProj["^DATA_SET_MAP_PROJECTION"][0].toStdString(), "DSMAP.CAT"); - ASSERT_EQ(dtmProj["MAP_PROJECTION_TYPE"][0].toStdString(), "EQUIRECTANGULAR"); - ASSERT_EQ(dtmProj["PROJECTION_LATITUDE_TYPE"][0].toStdString(), "PLANETOCENTRIC"); + ASSERT_EQ(dtmProj["^DATA_SET_MAP_PROJECTION"][0], "DSMAP.CAT"); + ASSERT_EQ(dtmProj["MAP_PROJECTION_TYPE"][0], "EQUIRECTANGULAR"); + ASSERT_EQ(dtmProj["PROJECTION_LATITUDE_TYPE"][0], "PLANETOCENTRIC"); ASSERT_DOUBLE_EQ(dtmProj["A_AXIS_RADIUS"], 3396.19); ASSERT_DOUBLE_EQ(dtmProj["B_AXIS_RADIUS"], 3396.19); ASSERT_DOUBLE_EQ(dtmProj["C_AXIS_RADIUS"], 3396.19); - ASSERT_EQ(dtmProj["COORDINATE_SYSTEM_NAME"][0].toStdString(), "PLANETOCENTRIC"); - ASSERT_EQ(dtmProj["POSITIVE_LONGITUDE_DIRECTION"][0].toStdString(), "EAST"); - ASSERT_EQ(dtmProj["KEYWORD_LATITUDE_TYPE"][0].toStdString(), "PLANETOCENTRIC"); + ASSERT_EQ(dtmProj["COORDINATE_SYSTEM_NAME"][0], "PLANETOCENTRIC"); + ASSERT_EQ(dtmProj["POSITIVE_LONGITUDE_DIRECTION"][0], "EAST"); + ASSERT_EQ(dtmProj["KEYWORD_LATITUDE_TYPE"][0], "PLANETOCENTRIC"); ASSERT_DOUBLE_EQ(dtmProj["CENTER_LATITUDE"], 0.0); ASSERT_DOUBLE_EQ(dtmProj["CENTER_LONGITUDE"], 180.0); ASSERT_DOUBLE_EQ(dtmProj["LINE_FIRST_PIXEL"], 1); @@ -99,29 +99,29 @@ TEST(Hidtmgen, HidtmgenTestColor){ ASSERT_DOUBLE_EQ(dtmView["NORTH_AZIMUTH"], 270.0); - Pvl orthoLabel1(prefix.path()+"/ESP_042252_1930_IRB_B_41_ORTHO.IMG"); + Pvl orthoLabel1(prefix.path().toStdString() +"/ESP_042252_1930_IRB_B_41_ORTHO.IMG"); - ASSERT_EQ(orthoLabel1["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + ASSERT_EQ(orthoLabel1["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(orthoLabel1["RECORD_BYTES"], 40); ASSERT_DOUBLE_EQ(orthoLabel1["FILE_RECORDS"], 252); ASSERT_DOUBLE_EQ(orthoLabel1["^IMAGE"], 103); - ASSERT_EQ(orthoLabel1["DATA_SET_ID"][0].toStdString(), "MRO-M-HIRISE-5-DTM-V1.0"); - ASSERT_EQ(orthoLabel1["PRODUCER_INSTITUTION_NAME"][0].toStdString(), "UNIVERSITY OF ARIZONA"); - ASSERT_EQ(orthoLabel1["PRODUCER_ID"][0].toStdString(), "UA"); - ASSERT_EQ(orthoLabel1["PRODUCER_FULL_NAME"][0].toStdString(), "ALFRED MCEWEN"); - ASSERT_EQ(orthoLabel1["PRODUCT_ID"][0].toStdString(), "ESP_042252_1930_IRB_B_41_ORTHO"); + ASSERT_EQ(orthoLabel1["DATA_SET_ID"][0], "MRO-M-HIRISE-5-DTM-V1.0"); + ASSERT_EQ(orthoLabel1["PRODUCER_INSTITUTION_NAME"][0], "UNIVERSITY OF ARIZONA"); + ASSERT_EQ(orthoLabel1["PRODUCER_ID"][0], "UA"); + ASSERT_EQ(orthoLabel1["PRODUCER_FULL_NAME"][0], "ALFRED MCEWEN"); + ASSERT_EQ(orthoLabel1["PRODUCT_ID"][0], "ESP_042252_1930_IRB_B_41_ORTHO"); ASSERT_DOUBLE_EQ(orthoLabel1["PRODUCT_VERSION_ID"], 0.314); - ASSERT_EQ(orthoLabel1["INSTRUMENT_HOST_NAME"][0].toStdString(), "MARS RECONNAISSANCE ORBITER"); - ASSERT_EQ(orthoLabel1["INSTRUMENT_HOST_ID"][0].toStdString(), "MRO"); - ASSERT_EQ(orthoLabel1["INSTRUMENT_NAME"][0].toStdString(), "HIGH RESOLUTION IMAGING SCIENCE EXPERIMENT"); - ASSERT_EQ(orthoLabel1["INSTRUMENT_ID"][0].toStdString(), "HIRISE"); - ASSERT_EQ(orthoLabel1["TARGET_NAME"][0].toStdString(), "MARS"); - ASSERT_EQ(orthoLabel1["SOURCE_PRODUCT_ID"][0].toStdString(), "DTEEZ_042252_1930_042753_1930_A31"); - ASSERT_EQ(orthoLabel1["SOURCE_PRODUCT_ID"][1].toStdString(), "ESP_042252_1930"); - ASSERT_EQ(orthoLabel1["RATIONALE_DESC"][0].toStdString(), "NULL"); - ASSERT_EQ(orthoLabel1["SOFTWARE_NAME"][0].toStdString(), "Socet_Set 5.4.1"); - ASSERT_EQ(orthoLabel1["RATIONALE_DESC"][0].toStdString(), "NULL"); + ASSERT_EQ(orthoLabel1["INSTRUMENT_HOST_NAME"][0], "MARS RECONNAISSANCE ORBITER"); + ASSERT_EQ(orthoLabel1["INSTRUMENT_HOST_ID"][0], "MRO"); + ASSERT_EQ(orthoLabel1["INSTRUMENT_NAME"][0], "HIGH RESOLUTION IMAGING SCIENCE EXPERIMENT"); + ASSERT_EQ(orthoLabel1["INSTRUMENT_ID"][0], "HIRISE"); + ASSERT_EQ(orthoLabel1["TARGET_NAME"][0], "MARS"); + ASSERT_EQ(orthoLabel1["SOURCE_PRODUCT_ID"][0], "DTEEZ_042252_1930_042753_1930_A31"); + ASSERT_EQ(orthoLabel1["SOURCE_PRODUCT_ID"][1], "ESP_042252_1930"); + ASSERT_EQ(orthoLabel1["RATIONALE_DESC"][0], "NULL"); + ASSERT_EQ(orthoLabel1["SOFTWARE_NAME"][0], "Socet_Set 5.4.1"); + ASSERT_EQ(orthoLabel1["RATIONALE_DESC"][0], "NULL"); ASSERT_DOUBLE_EQ(orthoLabel1["LABEL_RECORDS"], 102); PvlObject orthoImage1 = orthoLabel1.findObject("IMAGE"); @@ -131,8 +131,8 @@ TEST(Hidtmgen, HidtmgenTestColor){ ASSERT_DOUBLE_EQ(orthoImage1["OFFSET"], 0.0); ASSERT_DOUBLE_EQ(orthoImage1["SCALING_FACTOR"], 1.0); ASSERT_DOUBLE_EQ(orthoImage1["SAMPLE_BITS"], 8); - ASSERT_EQ(orthoImage1["SAMPLE_TYPE"][0].toStdString(), "MSB_UNSIGNED_INTEGER"); - ASSERT_EQ(orthoImage1["BAND_STORAGE_TYPE"][0].toStdString(), "BAND_SEQUENTIAL"); + ASSERT_EQ(orthoImage1["SAMPLE_TYPE"][0], "MSB_UNSIGNED_INTEGER"); + ASSERT_EQ(orthoImage1["BAND_STORAGE_TYPE"][0], "BAND_SEQUENTIAL"); ASSERT_DOUBLE_EQ(orthoImage1["CORE_NULL"], 0); ASSERT_DOUBLE_EQ(orthoImage1["CORE_LOW_REPR_SATURATION"], 1); ASSERT_DOUBLE_EQ(orthoImage1["CORE_LOW_INSTR_SATURATION"], 1); @@ -140,15 +140,15 @@ TEST(Hidtmgen, HidtmgenTestColor){ ASSERT_DOUBLE_EQ(orthoImage1["CORE_HIGH_INSTR_SATURATION"], 255); PvlObject orthoProj1 = orthoLabel1.findObject("IMAGE_MAP_PROJECTION"); - ASSERT_EQ(orthoProj1["^DATA_SET_MAP_PROJECTION"][0].toStdString(), "DSMAP.CAT"); - ASSERT_EQ(orthoProj1["MAP_PROJECTION_TYPE"][0].toStdString(), "EQUIRECTANGULAR"); - ASSERT_EQ(orthoProj1["PROJECTION_LATITUDE_TYPE"][0].toStdString(), "PLANETOCENTRIC"); + ASSERT_EQ(orthoProj1["^DATA_SET_MAP_PROJECTION"][0], "DSMAP.CAT"); + ASSERT_EQ(orthoProj1["MAP_PROJECTION_TYPE"][0], "EQUIRECTANGULAR"); + ASSERT_EQ(orthoProj1["PROJECTION_LATITUDE_TYPE"][0], "PLANETOCENTRIC"); ASSERT_DOUBLE_EQ(orthoProj1["A_AXIS_RADIUS"], 3396.19); ASSERT_DOUBLE_EQ(orthoProj1["B_AXIS_RADIUS"], 3396.19); ASSERT_DOUBLE_EQ(orthoProj1["C_AXIS_RADIUS"], 3396.19); - ASSERT_EQ(orthoProj1["COORDINATE_SYSTEM_NAME"][0].toStdString(), "PLANETOCENTRIC"); - ASSERT_EQ(orthoProj1["POSITIVE_LONGITUDE_DIRECTION"][0].toStdString(), "EAST"); - ASSERT_EQ(orthoProj1["KEYWORD_LATITUDE_TYPE"][0].toStdString(), "PLANETOCENTRIC"); + ASSERT_EQ(orthoProj1["COORDINATE_SYSTEM_NAME"][0], "PLANETOCENTRIC"); + ASSERT_EQ(orthoProj1["POSITIVE_LONGITUDE_DIRECTION"][0], "EAST"); + ASSERT_EQ(orthoProj1["KEYWORD_LATITUDE_TYPE"][0], "PLANETOCENTRIC"); ASSERT_DOUBLE_EQ(orthoProj1["CENTER_LATITUDE"], 0.0); ASSERT_DOUBLE_EQ(orthoProj1["CENTER_LONGITUDE"], 180.0); ASSERT_DOUBLE_EQ(orthoProj1["LINE_FIRST_PIXEL"], 1); @@ -164,37 +164,37 @@ TEST(Hidtmgen, HidtmgenTestColor){ ASSERT_DOUBLE_EQ(orthoProj1["SAMPLE_PROJECTION_OFFSET"], -20600155.500001); ASSERT_NEAR(orthoProj1["EASTERNMOST_LONGITUDE"], 355.68076, .00001); ASSERT_NEAR(orthoProj1["WESTERNMOST_LONGITUDE"], 355.68041, .00001); - ASSERT_EQ(orthoProj1["FIRST_STANDARD_PARALLEL"][0].toStdString(), "N/A"); - ASSERT_EQ(orthoProj1["SECOND_STANDARD_PARALLEL"][0].toStdString(), "N/A"); + ASSERT_EQ(orthoProj1["FIRST_STANDARD_PARALLEL"][0], "N/A"); + ASSERT_EQ(orthoProj1["SECOND_STANDARD_PARALLEL"][0], "N/A"); PvlObject orthoView1 = orthoLabel1.findObject("VIEWING_PARAMETERS"); ASSERT_DOUBLE_EQ(orthoView1["NORTH_AZIMUTH"], 270.0); - Pvl orthoLabel2(prefix.path()+"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); + Pvl orthoLabel2(prefix.path().toStdString() +"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); - ASSERT_EQ(orthoLabel2["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + ASSERT_EQ(orthoLabel2["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(orthoLabel2["RECORD_BYTES"], 40); ASSERT_DOUBLE_EQ(orthoLabel2["FILE_RECORDS"], 252); ASSERT_DOUBLE_EQ(orthoLabel2["^IMAGE"], 103); - ASSERT_EQ(orthoLabel2["DATA_SET_ID"][0].toStdString(), "MRO-M-HIRISE-5-DTM-V1.0"); - ASSERT_EQ(orthoLabel2["PRODUCER_INSTITUTION_NAME"][0].toStdString(), "UNIVERSITY OF ARIZONA"); - ASSERT_EQ(orthoLabel2["PRODUCER_ID"][0].toStdString(), "UA"); - ASSERT_EQ(orthoLabel2["PRODUCER_FULL_NAME"][0].toStdString(), "ALFRED MCEWEN"); - ASSERT_EQ(orthoLabel2["PRODUCT_ID"][0].toStdString(), "ESP_042252_1930_IRB_D_31_ORTHO"); + ASSERT_EQ(orthoLabel2["DATA_SET_ID"][0], "MRO-M-HIRISE-5-DTM-V1.0"); + ASSERT_EQ(orthoLabel2["PRODUCER_INSTITUTION_NAME"][0], "UNIVERSITY OF ARIZONA"); + ASSERT_EQ(orthoLabel2["PRODUCER_ID"][0], "UA"); + ASSERT_EQ(orthoLabel2["PRODUCER_FULL_NAME"][0], "ALFRED MCEWEN"); + ASSERT_EQ(orthoLabel2["PRODUCT_ID"][0], "ESP_042252_1930_IRB_D_31_ORTHO"); ASSERT_DOUBLE_EQ(orthoLabel2["PRODUCT_VERSION_ID"], 0.314); - ASSERT_EQ(orthoLabel2["INSTRUMENT_HOST_NAME"][0].toStdString(), "MARS RECONNAISSANCE ORBITER"); - ASSERT_EQ(orthoLabel2["INSTRUMENT_HOST_ID"][0].toStdString(), "MRO"); - ASSERT_EQ(orthoLabel2["INSTRUMENT_NAME"][0].toStdString(), "HIGH RESOLUTION IMAGING SCIENCE EXPERIMENT"); - ASSERT_EQ(orthoLabel2["INSTRUMENT_ID"][0].toStdString(), "HIRISE"); - ASSERT_EQ(orthoLabel2["TARGET_NAME"][0].toStdString(), "MARS"); - ASSERT_EQ(orthoLabel2["SOURCE_PRODUCT_ID"][0].toStdString(), "DTEEZ_042252_1930_042753_1930_A31"); - ASSERT_EQ(orthoLabel2["SOURCE_PRODUCT_ID"][1].toStdString(), "ESP_042252_1930"); - ASSERT_EQ(orthoLabel2["RATIONALE_DESC"][0].toStdString(), "NULL"); - ASSERT_EQ(orthoLabel2["SOFTWARE_NAME"][0].toStdString(), "Socet_Set 5.4.1"); - ASSERT_EQ(orthoLabel2["RATIONALE_DESC"][0].toStdString(), "NULL"); + ASSERT_EQ(orthoLabel2["INSTRUMENT_HOST_NAME"][0], "MARS RECONNAISSANCE ORBITER"); + ASSERT_EQ(orthoLabel2["INSTRUMENT_HOST_ID"][0], "MRO"); + ASSERT_EQ(orthoLabel2["INSTRUMENT_NAME"][0], "HIGH RESOLUTION IMAGING SCIENCE EXPERIMENT"); + ASSERT_EQ(orthoLabel2["INSTRUMENT_ID"][0], "HIRISE"); + ASSERT_EQ(orthoLabel2["TARGET_NAME"][0], "MARS"); + ASSERT_EQ(orthoLabel2["SOURCE_PRODUCT_ID"][0], "DTEEZ_042252_1930_042753_1930_A31"); + ASSERT_EQ(orthoLabel2["SOURCE_PRODUCT_ID"][1], "ESP_042252_1930"); + ASSERT_EQ(orthoLabel2["RATIONALE_DESC"][0], "NULL"); + ASSERT_EQ(orthoLabel2["SOFTWARE_NAME"][0], "Socet_Set 5.4.1"); + ASSERT_EQ(orthoLabel2["RATIONALE_DESC"][0], "NULL"); ASSERT_DOUBLE_EQ(orthoLabel2["LABEL_RECORDS"], 102); PvlObject orthoImage2 = orthoLabel2.findObject("IMAGE"); @@ -204,8 +204,8 @@ TEST(Hidtmgen, HidtmgenTestColor){ ASSERT_DOUBLE_EQ(orthoImage2["OFFSET"], 0.0); ASSERT_DOUBLE_EQ(orthoImage2["SCALING_FACTOR"], 1.0); ASSERT_DOUBLE_EQ(orthoImage2["SAMPLE_BITS"], 8); - ASSERT_EQ(orthoImage2["SAMPLE_TYPE"][0].toStdString(), "MSB_UNSIGNED_INTEGER"); - ASSERT_EQ(orthoImage2["BAND_STORAGE_TYPE"][0].toStdString(), "BAND_SEQUENTIAL"); + ASSERT_EQ(orthoImage2["SAMPLE_TYPE"][0], "MSB_UNSIGNED_INTEGER"); + ASSERT_EQ(orthoImage2["BAND_STORAGE_TYPE"][0], "BAND_SEQUENTIAL"); ASSERT_DOUBLE_EQ(orthoImage2["CORE_NULL"], 0); ASSERT_DOUBLE_EQ(orthoImage2["CORE_LOW_REPR_SATURATION"], 1); ASSERT_DOUBLE_EQ(orthoImage2["CORE_LOW_INSTR_SATURATION"], 1); @@ -213,15 +213,15 @@ TEST(Hidtmgen, HidtmgenTestColor){ ASSERT_DOUBLE_EQ(orthoImage2["CORE_HIGH_INSTR_SATURATION"], 255); PvlObject orthoProj2 = orthoLabel2.findObject("IMAGE_MAP_PROJECTION"); - ASSERT_EQ(orthoProj2["^DATA_SET_MAP_PROJECTION"][0].toStdString(), "DSMAP.CAT"); - ASSERT_EQ(orthoProj2["MAP_PROJECTION_TYPE"][0].toStdString(), "EQUIRECTANGULAR"); - ASSERT_EQ(orthoProj2["PROJECTION_LATITUDE_TYPE"][0].toStdString(), "PLANETOCENTRIC"); + ASSERT_EQ(orthoProj2["^DATA_SET_MAP_PROJECTION"][0], "DSMAP.CAT"); + ASSERT_EQ(orthoProj2["MAP_PROJECTION_TYPE"][0], "EQUIRECTANGULAR"); + ASSERT_EQ(orthoProj2["PROJECTION_LATITUDE_TYPE"][0], "PLANETOCENTRIC"); ASSERT_DOUBLE_EQ(orthoProj2["A_AXIS_RADIUS"], 3396.19); ASSERT_DOUBLE_EQ(orthoProj2["B_AXIS_RADIUS"], 3396.19); ASSERT_DOUBLE_EQ(orthoProj2["C_AXIS_RADIUS"], 3396.19); - ASSERT_EQ(orthoProj2["COORDINATE_SYSTEM_NAME"][0].toStdString(), "PLANETOCENTRIC"); - ASSERT_EQ(orthoProj2["POSITIVE_LONGITUDE_DIRECTION"][0].toStdString(), "EAST"); - ASSERT_EQ(orthoProj2["KEYWORD_LATITUDE_TYPE"][0].toStdString(), "PLANETOCENTRIC"); + ASSERT_EQ(orthoProj2["COORDINATE_SYSTEM_NAME"][0], "PLANETOCENTRIC"); + ASSERT_EQ(orthoProj2["POSITIVE_LONGITUDE_DIRECTION"][0], "EAST"); + ASSERT_EQ(orthoProj2["KEYWORD_LATITUDE_TYPE"][0], "PLANETOCENTRIC"); ASSERT_DOUBLE_EQ(orthoProj2["CENTER_LATITUDE"], 0.0); ASSERT_DOUBLE_EQ(orthoProj2["CENTER_LONGITUDE"], 180.0); ASSERT_DOUBLE_EQ(orthoProj2["LINE_FIRST_PIXEL"], 1); @@ -237,8 +237,8 @@ TEST(Hidtmgen, HidtmgenTestColor){ ASSERT_DOUBLE_EQ(orthoProj2["SAMPLE_PROJECTION_OFFSET"], -5150060.5); ASSERT_NEAR(orthoProj2["EASTERNMOST_LONGITUDE"], 355.68250, .00001); ASSERT_NEAR(orthoProj2["WESTERNMOST_LONGITUDE"], 355.68114, .00001); - ASSERT_EQ(orthoProj2["FIRST_STANDARD_PARALLEL"][0].toStdString(), "N/A"); - ASSERT_EQ(orthoProj2["SECOND_STANDARD_PARALLEL"][0].toStdString(), "N/A"); + ASSERT_EQ(orthoProj2["FIRST_STANDARD_PARALLEL"][0], "N/A"); + ASSERT_EQ(orthoProj2["SECOND_STANDARD_PARALLEL"][0], "N/A"); PvlObject orthoView2 = orthoLabel2.findObject("VIEWING_PARAMETERS"); ASSERT_DOUBLE_EQ(orthoView2["NORTH_AZIMUTH"], 270.0); @@ -262,9 +262,9 @@ TEST(Hidtmgen, HidtmgenTestDtmOnly){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl dtmLabel(prefix.path()+"/DTEEZ_042252_1930_042753_1930_A15.IMG"); + Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A15.IMG"); - ASSERT_EQ(dtmLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + ASSERT_EQ(dtmLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(dtmLabel["RECORD_BYTES"], 32); ASSERT_DOUBLE_EQ(dtmLabel["FILE_RECORDS"], 155); ASSERT_DOUBLE_EQ(dtmLabel["^IMAGE"], 133); @@ -289,24 +289,24 @@ TEST(Hidtmgen, HidtmgenTestEqui){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl dtmLabel(prefix.path()+"/DTEEZ_002118_1510_003608_1510_A02.IMG"); - ASSERT_EQ(dtmLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_002118_1510_003608_1510_A02.IMG"); + ASSERT_EQ(dtmLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(dtmLabel["RECORD_BYTES"], 28); ASSERT_DOUBLE_EQ(dtmLabel["FILE_RECORDS"], 203); ASSERT_DOUBLE_EQ(dtmLabel["^IMAGE"], 183); PvlObject dtmProj = dtmLabel.findObject("IMAGE_MAP_PROJECTION"); - ASSERT_EQ(dtmProj["MAP_PROJECTION_TYPE"][0].toStdString(), "EQUIRECTANGULAR"); + ASSERT_EQ(dtmProj["MAP_PROJECTION_TYPE"][0], "EQUIRECTANGULAR"); - Pvl orthoLabel(prefix.path()+"/PSP_002118_1510_RED_C_01_ORTHO.IMG"); - ASSERT_EQ(orthoLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl orthoLabel(prefix.path().toStdString() +"/PSP_002118_1510_RED_C_01_ORTHO.IMG"); + ASSERT_EQ(orthoLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(orthoLabel["RECORD_BYTES"], 50); ASSERT_DOUBLE_EQ(orthoLabel["FILE_RECORDS"], 132); ASSERT_DOUBLE_EQ(orthoLabel["^IMAGE"], 83); PvlObject orthoProj = orthoLabel.findObject("IMAGE_MAP_PROJECTION"); - ASSERT_EQ(orthoProj["MAP_PROJECTION_TYPE"][0].toStdString(), "EQUIRECTANGULAR"); + ASSERT_EQ(orthoProj["MAP_PROJECTION_TYPE"][0], "EQUIRECTANGULAR"); } @@ -539,9 +539,9 @@ TEST(Hidtmgen, HidtmgenTestNonDefaultNames){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl dtmLabel(prefix.path()+"/dtm.img"); + Pvl dtmLabel(prefix.path().toStdString() +"/dtm.img"); - ASSERT_EQ(dtmLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + ASSERT_EQ(dtmLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(dtmLabel["RECORD_BYTES"], 28); ASSERT_DOUBLE_EQ(dtmLabel["FILE_RECORDS"], 203); ASSERT_DOUBLE_EQ(dtmLabel["^IMAGE"], 183); @@ -566,10 +566,10 @@ TEST(Hidtmgen, HidtmgenTestOrthoOnly){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl orthoLabel(prefix.path()+"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); - ASSERT_EQ(orthoLabel["SOURCE_PRODUCT_ID"][0].toStdString(), "DTems_xxxxxx_xxxx_yyyyyy_yyyy_vnn"); - ASSERT_EQ(orthoLabel["SOURCE_PRODUCT_ID"][1].toStdString(), "ESP_042252_1930"); - ASSERT_EQ(orthoLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl orthoLabel(prefix.path().toStdString() +"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); + ASSERT_EQ(orthoLabel["SOURCE_PRODUCT_ID"][0], "DTems_xxxxxx_xxxx_yyyyyy_yyyy_vnn"); + ASSERT_EQ(orthoLabel["SOURCE_PRODUCT_ID"][1], "ESP_042252_1930"); + ASSERT_EQ(orthoLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(orthoLabel["RECORD_BYTES"], 40); ASSERT_DOUBLE_EQ(orthoLabel["FILE_RECORDS"], 254); ASSERT_DOUBLE_EQ(orthoLabel["^IMAGE"], 105); @@ -603,8 +603,8 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesAll832){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl dtmLabel(prefix.path()+"/DTEEZ_042252_1930_042753_1930_A31.IMG"); - ASSERT_EQ(dtmLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A31.IMG"); + ASSERT_EQ(dtmLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(dtmLabel["RECORD_BYTES"], 8); ASSERT_DOUBLE_EQ(dtmLabel["FILE_RECORDS"], 558); ASSERT_DOUBLE_EQ(dtmLabel["^IMAGE"], 536); @@ -612,17 +612,17 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesAll832){ PvlObject dtmImage = dtmLabel.findObject("IMAGE"); ASSERT_DOUBLE_EQ(dtmImage["SAMPLE_BITS"], 8); - ASSERT_EQ(dtmImage["SAMPLE_TYPE"][0].toStdString(), "MSB_UNSIGNED_INTEGER"); + ASSERT_EQ(dtmImage["SAMPLE_TYPE"][0], "MSB_UNSIGNED_INTEGER"); - Pvl orthoLabel(prefix.path()+"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); - ASSERT_EQ(orthoLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl orthoLabel(prefix.path().toStdString() +"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); + ASSERT_EQ(orthoLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(orthoLabel["RECORD_BYTES"], 160); ASSERT_DOUBLE_EQ(orthoLabel["FILE_RECORDS"], 177); ASSERT_DOUBLE_EQ(orthoLabel["^IMAGE"], 28); PvlObject orthoImage = orthoLabel.findObject("IMAGE"); ASSERT_DOUBLE_EQ(orthoImage["SAMPLE_BITS"], 32); - ASSERT_EQ(orthoImage["SAMPLE_TYPE"][0].toStdString(), "IEEE_REAL"); + ASSERT_EQ(orthoImage["SAMPLE_TYPE"][0], "IEEE_REAL"); } @@ -653,8 +653,8 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesAllU16S16){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl dtmLabel(prefix.path()+"/DTEEZ_042252_1930_042753_1930_A07.IMG"); - ASSERT_EQ(dtmLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A07.IMG"); + ASSERT_EQ(dtmLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(dtmLabel["RECORD_BYTES"], 16); ASSERT_DOUBLE_EQ(dtmLabel["FILE_RECORDS"], 288); ASSERT_DOUBLE_EQ(dtmLabel["^IMAGE"], 266); @@ -662,17 +662,17 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesAllU16S16){ PvlObject dtmImage = dtmLabel.findObject("IMAGE"); ASSERT_DOUBLE_EQ(dtmImage["SAMPLE_BITS"], 16); - ASSERT_EQ(dtmImage["SAMPLE_TYPE"][0].toStdString(), "MSB_UNSIGNED_INTEGER"); + ASSERT_EQ(dtmImage["SAMPLE_TYPE"][0], "MSB_UNSIGNED_INTEGER"); - Pvl orthoLabel(prefix.path()+"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); - ASSERT_EQ(orthoLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl orthoLabel(prefix.path().toStdString() +"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); + ASSERT_EQ(orthoLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(orthoLabel["RECORD_BYTES"], 80); ASSERT_DOUBLE_EQ(orthoLabel["FILE_RECORDS"], 202); ASSERT_DOUBLE_EQ(orthoLabel["^IMAGE"], 53); PvlObject orthoImage = orthoLabel.findObject("IMAGE"); ASSERT_DOUBLE_EQ(orthoImage["SAMPLE_BITS"], 16); - ASSERT_EQ(orthoImage["SAMPLE_TYPE"][0].toStdString(), "MSB_INTEGER"); + ASSERT_EQ(orthoImage["SAMPLE_TYPE"][0], "MSB_INTEGER"); } @@ -702,8 +702,8 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesNoneS16U16){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl dtmLabel(prefix.path()+"/DTEEZ_042252_1930_042753_1930_A07.IMG"); - ASSERT_EQ(dtmLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A07.IMG"); + ASSERT_EQ(dtmLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(dtmLabel["RECORD_BYTES"], 16); ASSERT_DOUBLE_EQ(dtmLabel["FILE_RECORDS"], 288); ASSERT_DOUBLE_EQ(dtmLabel["^IMAGE"], 266); @@ -711,17 +711,17 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesNoneS16U16){ PvlObject dtmImage = dtmLabel.findObject("IMAGE"); ASSERT_DOUBLE_EQ(dtmImage["SAMPLE_BITS"], 16); - ASSERT_EQ(dtmImage["SAMPLE_TYPE"][0].toStdString(), "MSB_INTEGER"); + ASSERT_EQ(dtmImage["SAMPLE_TYPE"][0], "MSB_INTEGER"); - Pvl orthoLabel(prefix.path()+"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); - ASSERT_EQ(orthoLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl orthoLabel(prefix.path().toStdString() +"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); + ASSERT_EQ(orthoLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(orthoLabel["RECORD_BYTES"], 80); ASSERT_DOUBLE_EQ(orthoLabel["FILE_RECORDS"], 202); ASSERT_DOUBLE_EQ(orthoLabel["^IMAGE"], 53); PvlObject orthoImage = orthoLabel.findObject("IMAGE"); ASSERT_DOUBLE_EQ(orthoImage["SAMPLE_BITS"], 16); - ASSERT_EQ(orthoImage["SAMPLE_TYPE"][0].toStdString(), "MSB_UNSIGNED_INTEGER"); + ASSERT_EQ(orthoImage["SAMPLE_TYPE"][0], "MSB_UNSIGNED_INTEGER"); } @@ -743,21 +743,21 @@ TEST(Hidtmgen, HidtmgenTestPolar){ FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; } - Pvl dtmLabel(prefix.path()+"/DTEPZ_009404_2635_010221_2635_Z12.IMG"); - ASSERT_EQ(dtmLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl dtmLabel(prefix.path().toStdString() +"/DTEPZ_009404_2635_010221_2635_Z12.IMG"); + ASSERT_EQ(dtmLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(dtmLabel["RECORD_BYTES"], 52); ASSERT_DOUBLE_EQ(dtmLabel["FILE_RECORDS"], 96); ASSERT_DOUBLE_EQ(dtmLabel["^IMAGE"], 85); PvlObject dtmProj = dtmLabel.findObject("IMAGE_MAP_PROJECTION"); - ASSERT_EQ(dtmProj["MAP_PROJECTION_TYPE"][0].toStdString(), "POLAR STEREOGRAPHIC"); + ASSERT_EQ(dtmProj["MAP_PROJECTION_TYPE"][0], "POLAR STEREOGRAPHIC"); - Pvl orthoLabel(prefix.path()+"/PSP_009404_2635_RED_C_1_ORTHO.IMG"); - ASSERT_EQ(orthoLabel["RECORD_TYPE"][0].toStdString(), "FIXED_LENGTH"); + Pvl orthoLabel(prefix.path().toStdString() +"/PSP_009404_2635_RED_C_1_ORTHO.IMG"); + ASSERT_EQ(orthoLabel["RECORD_TYPE"][0], "FIXED_LENGTH"); ASSERT_DOUBLE_EQ(orthoLabel["RECORD_BYTES"], 50); ASSERT_DOUBLE_EQ(orthoLabel["FILE_RECORDS"], 115); ASSERT_DOUBLE_EQ(orthoLabel["^IMAGE"], 66); PvlObject orthoProj = orthoLabel.findObject("IMAGE_MAP_PROJECTION"); - ASSERT_EQ(orthoProj["MAP_PROJECTION_TYPE"][0].toStdString(), "POLAR STEREOGRAPHIC"); + ASSERT_EQ(orthoProj["MAP_PROJECTION_TYPE"][0], "POLAR STEREOGRAPHIC"); } diff --git a/isis/tests/FunctionalTestsHimos.cpp b/isis/tests/FunctionalTestsHimos.cpp index c43fd798df..7b6e771ba1 100644 --- a/isis/tests/FunctionalTestsHimos.cpp +++ b/isis/tests/FunctionalTestsHimos.cpp @@ -53,25 +53,25 @@ TEST_F(MroHiriseCube, FunctionalTestHimosDefault) { EXPECT_PRED_FORMAT2(AssertPvlGroupEqual, inputMappingGroup, outputMappingGroup); PvlGroup mos = outputCubeLabel.findGroup("Mosaic"); - EXPECT_EQ(mos["ProductId"][0].toStdString(), "TRA_000823_1720_BLUEGREEN"); - EXPECT_EQ(mos["SourceProductId"][0].toStdString(), "TRA_000823_1720_RED4_0"); - EXPECT_EQ(mos["SourceProductId"][1].toStdString(), "TRA_000823_1720_RED4_1"); - EXPECT_EQ(mos["StartTime"][0].toStdString(), "2006-09-29T15:16:33.385"); - EXPECT_EQ(mos["SpacecraftClockStartCount"][0].toStdString(), "844010212:12516"); - EXPECT_EQ(mos["StopTime"][0].toStdString(), "2006-09-29T15:16:35.036"); - EXPECT_EQ(mos["SpacecraftClockStopCount"][0].toStdString(), "844010213:55196"); - - EXPECT_NEAR(mos["IncidenceAngle"][0].toDouble(), 59.687930340662, 1e-6); - EXPECT_NEAR(mos["EmissionAngle"][0].toDouble(), 0.091672512439956, 1e-6); - EXPECT_NEAR(mos["PhaseAngle"][0].toDouble(), 59.597812369363, 1e-6); - EXPECT_NEAR(mos["LocalTime"][0].toDouble(), 15.486088288555, 1e-6); - EXPECT_NEAR(mos["SolarLongitude"][0].toDouble(), 113.54746578654, 1e-6); - EXPECT_NEAR(mos["SubSolarAzimuth"][0].toDouble(), 212.41484032558 , 1e-6); - EXPECT_NEAR(mos["NorthAzimuth"][0].toDouble(), 270.00024569628, 1e-6); - - EXPECT_EQ(mos["cpmmTdiFlag"][5].toStdString(), "128"); - EXPECT_EQ(mos["cpmmSummingFlag"][5].toStdString(), "1"); - EXPECT_EQ(mos["SpecialProcessingFlag"][5].toStdString(), "NOMINAL"); + EXPECT_EQ(mos["ProductId"][0], "TRA_000823_1720_BLUEGREEN"); + EXPECT_EQ(mos["SourceProductId"][0], "TRA_000823_1720_RED4_0"); + EXPECT_EQ(mos["SourceProductId"][1], "TRA_000823_1720_RED4_1"); + EXPECT_EQ(mos["StartTime"][0], "2006-09-29T15:16:33.385"); + EXPECT_EQ(mos["SpacecraftClockStartCount"][0], "844010212:12516"); + EXPECT_EQ(mos["StopTime"][0], "2006-09-29T15:16:35.036"); + EXPECT_EQ(mos["SpacecraftClockStopCount"][0], "844010213:55196"); + + EXPECT_NEAR(std::stod(mos["IncidenceAngle"][0]), 59.687930340662, 1e-6); + EXPECT_NEAR(std::stod(mos["EmissionAngle"][0]), 0.091672512439956, 1e-6); + EXPECT_NEAR(std::stod(mos["PhaseAngle"][0]), 59.597812369363, 1e-6); + EXPECT_NEAR(std::stod(mos["LocalTime"][0]), 15.486088288555, 1e-6); + EXPECT_NEAR(std::stod(mos["SolarLongitude"][0]), 113.54746578654, 1e-6); + EXPECT_NEAR(std::stod(mos["SubSolarAzimuth"][0]), 212.41484032558 , 1e-6); + EXPECT_NEAR(std::stod(mos["NorthAzimuth"][0]), 270.00024569628, 1e-6); + + EXPECT_EQ(mos["cpmmTdiFlag"][5], "128"); + EXPECT_EQ(mos["cpmmSummingFlag"][5], "1"); + EXPECT_EQ(mos["SpecialProcessingFlag"][5], "NOMINAL"); } TEST_F(MroHiriseCube, FunctionalTestHimosError) { diff --git a/isis/tests/FunctionalTestsHrsc2isis.cpp b/isis/tests/FunctionalTestsHrsc2isis.cpp index 04858d53bb..496e12d4ad 100644 --- a/isis/tests/FunctionalTestsHrsc2isis.cpp +++ b/isis/tests/FunctionalTestsHrsc2isis.cpp @@ -45,14 +45,14 @@ TEST(Hrsc2isis, Hrsc2IsisTestDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "MARS EXPRESS"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "HRSC" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2004-04-07T07:08:31.61500" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2004-04-07T07:10:08.32300" ); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "1/0029401660.57967" ); - ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "1/0029401808.32263" ); - ASSERT_EQ(inst["MissionPhaseName"][0].toStdString(), "MC_Phase_5" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); + ASSERT_EQ(inst["SpacecraftName"][0], "MARS EXPRESS"); + ASSERT_EQ(inst["InstrumentId"][0], "HRSC" ); + ASSERT_EQ(inst["StartTime"][0], "2004-04-07T07:08:31.61500" ); + ASSERT_EQ(inst["StopTime"][0], "2004-04-07T07:10:08.32300" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "1/0029401660.57967" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0], "1/0029401808.32263" ); + ASSERT_EQ(inst["MissionPhaseName"][0], "MC_Phase_5" ); + ASSERT_EQ(inst["TargetName"][0], "Mars" ); ASSERT_EQ(int(inst["Summing"]), 4); ASSERT_DOUBLE_EQ(inst["FocalPlaneTemperature"], 8.1755); ASSERT_DOUBLE_EQ(inst["LensTemperature"], 8.3794); @@ -60,11 +60,11 @@ TEST(Hrsc2isis, Hrsc2IsisTestDefault) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MEX-M-HRSC-3-RDR-V2.0" ); - ASSERT_EQ(archive["DetectorId"][0].toStdString(), "MEX_HRSC_RED" ); - ASSERT_EQ(archive["EventType"][0].toStdString(), "MARS-REGIONAL-STEREO-Vo-Te-Im" ); + ASSERT_EQ(archive["DataSetId"][0], "MEX-M-HRSC-3-RDR-V2.0" ); + ASSERT_EQ(archive["DetectorId"][0], "MEX_HRSC_RED" ); + ASSERT_EQ(archive["EventType"][0], "MARS-REGIONAL-STEREO-Vo-Te-Im" ); ASSERT_EQ(int(archive["OrbitNumber"]), 279); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "H0279_0000_RE2.IMG" ); + ASSERT_EQ(archive["ProductId"][0], "H0279_0000_RE2.IMG" ); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -84,7 +84,7 @@ TEST(Hrsc2isis, Hrsc2IsisTestDefault) { // check original label exists Pvl ogLab = cube.readOriginalLabel().ReturnLabels(); - ASSERT_EQ(archive["DETECTOR_ID"][0].toStdString(), "MEX_HRSC_RED" ); + ASSERT_EQ(archive["DETECTOR_ID"][0], "MEX_HRSC_RED" ); } @@ -112,17 +112,17 @@ TEST(Hrsc2isis, Hrsc2IsisTestPhobos) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["MissionPhaseName"][0].toStdString(), "ME_Phase_20" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Phobos" ); + ASSERT_EQ(inst["MissionPhaseName"][0], "ME_Phase_20" ); + ASSERT_EQ(inst["TargetName"][0], "Phobos" ); ASSERT_EQ(int(inst["Summing"]), 1); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MEX-M-HRSC-3-RDR-V2.0" ); - ASSERT_EQ(archive["DetectorId"][0].toStdString(), "MEX_HRSC_S2" ); - ASSERT_EQ(archive["EventType"][0].toStdString(), "PHOBOS-LIMB-CARTOGRAPHY-Im" ); + ASSERT_EQ(archive["DataSetId"][0], "MEX-M-HRSC-3-RDR-V2.0" ); + ASSERT_EQ(archive["DetectorId"][0], "MEX_HRSC_S2" ); + ASSERT_EQ(archive["EventType"][0], "PHOBOS-LIMB-CARTOGRAPHY-Im" ); ASSERT_EQ(int(archive["OrbitNumber"]), 7926); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "H7926_0009_S22.IMG" ); + ASSERT_EQ(archive["ProductId"][0], "H7926_0009_S22.IMG" ); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -142,7 +142,7 @@ TEST(Hrsc2isis, Hrsc2IsisTestPhobos) { // check original label exists Pvl ogLab = cube.readOriginalLabel().ReturnLabels(); - ASSERT_EQ(archive["DETECTOR_ID"][0].toStdString(), "MEX_HRSC_S2" ); + ASSERT_EQ(archive["DETECTOR_ID"][0], "MEX_HRSC_S2" ); } @@ -192,18 +192,18 @@ TEST(Hrsc2isis, Hrsc2IsisTestSrcImage) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "SRC" ); - ASSERT_EQ(inst["MissionPhaseName"][0].toStdString(), "ME_Phase_2" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Deimos" ); + ASSERT_EQ(inst["InstrumentId"][0], "SRC" ); + ASSERT_EQ(inst["MissionPhaseName"][0], "ME_Phase_2" ); + ASSERT_EQ(inst["TargetName"][0], "Deimos" ); ASSERT_DOUBLE_EQ(inst["ExposureDuration"], 27.216); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MEX-M-HRSC-3-RDR-V2.0" ); - ASSERT_EQ(archive["DetectorId"][0].toStdString(), "MEX_HRSC_SRC" ); - ASSERT_EQ(archive["EventType"][0].toStdString(), "DEIMOS-LIMB-CARTOGRAPHY-Im" ); + ASSERT_EQ(archive["DataSetId"][0], "MEX-M-HRSC-3-RDR-V2.0" ); + ASSERT_EQ(archive["DetectorId"][0], "MEX_HRSC_SRC" ); + ASSERT_EQ(archive["EventType"][0], "DEIMOS-LIMB-CARTOGRAPHY-Im" ); ASSERT_EQ(int(archive["OrbitNumber"]), 2862); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "H2862_0006_SR2.IMG" ); + ASSERT_EQ(archive["ProductId"][0], "H2862_0006_SR2.IMG" ); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsHyb2onc2isis.cpp b/isis/tests/FunctionalTestsHyb2onc2isis.cpp index b746c302e1..2add142355 100644 --- a/isis/tests/FunctionalTestsHyb2onc2isis.cpp +++ b/isis/tests/FunctionalTestsHyb2onc2isis.cpp @@ -45,19 +45,19 @@ TEST(Hyb2onc2isis, Hyb2onc2isisTestDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "HAYABUSA-2"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "ONC-W2" ); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2015-12-03T00:00:06.637" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2015-12-03T00:00:06.641" ); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "1/1009473117" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Earth" ); + ASSERT_EQ(inst["SpacecraftName"][0], "HAYABUSA-2"); + ASSERT_EQ(inst["InstrumentId"][0], "ONC-W2" ); + ASSERT_EQ(inst["StartTime"][0], "2015-12-03T00:00:06.637" ); + ASSERT_EQ(inst["StopTime"][0], "2015-12-03T00:00:06.641" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "1/1009473117" ); + ASSERT_EQ(inst["TargetName"][0], "Earth" ); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["ProducerId"][0].toStdString(), "ISAS/JAXA" ); - ASSERT_EQ(archive["FormatType"][0].toStdString(), "HAYABUSA2 IMAGE ONC L2a" ); - ASSERT_EQ(archive["Contenttype"][0].toStdString(), "ONC-W2 NON SMEARCORRECTED"); - ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "hyb2_onc_20151203_000006_w2f_l2a" ); + ASSERT_EQ(archive["ProducerId"][0], "ISAS/JAXA" ); + ASSERT_EQ(archive["FormatType"][0], "HAYABUSA2 IMAGE ONC L2a" ); + ASSERT_EQ(archive["Contenttype"][0], "ONC-W2 NON SMEARCORRECTED"); + ASSERT_EQ(archive["SourceProductId"][0], "hyb2_onc_20151203_000006_w2f_l2a" ); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -73,5 +73,5 @@ TEST(Hyb2onc2isis, Hyb2onc2isisTestDefault) { // check original label exists Pvl ogLabel = cube.readOriginalLabel().ReturnLabels(); PvlGroup &fitsLabel = ogLabel.findGroup("FitsLabels", Pvl::Traverse); - ASSERT_EQ(fitsLabel["SPCECRFT"][0].toStdString(), "HAYABUSA2" ); + ASSERT_EQ(fitsLabel["SPCECRFT"][0], "HAYABUSA2" ); } diff --git a/isis/tests/FunctionalTestsIsis2pds.cpp b/isis/tests/FunctionalTestsIsis2pds.cpp index a8556766f3..b38a6de772 100644 --- a/isis/tests/FunctionalTestsIsis2pds.cpp +++ b/isis/tests/FunctionalTestsIsis2pds.cpp @@ -28,29 +28,29 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); - EXPECT_EQ(QString(outputLabel["PDS_VERSION_ID"]), "PDS3"); - EXPECT_EQ(QString(outputLabel["RECORD_TYPE"]), "UNDEFINED"); + EXPECT_EQ((std::string)outputLabel["PDS_VERSION_ID"], "PDS3"); + EXPECT_EQ((std::string)outputLabel["RECORD_TYPE"], "UNDEFINED"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 809); EXPECT_EQ(int(outputLabel["^IMAGE"]), 810); - EXPECT_EQ(QString(outputLabel["CHECKSUM"]), "5656e616c61d8fa7ed568ff88632f044"); + EXPECT_EQ((std::string)outputLabel["CHECKSUM"], "5656e616c61d8fa7ed568ff88632f044"); EXPECT_EQ(int(imageObject["LINES"]), 1056); EXPECT_EQ(int(imageObject["LINE_SAMPLES"]), 1204); EXPECT_EQ(int(imageObject["BANDS"]), 1); - EXPECT_EQ(QString(imageObject["BAND_STORAGE_TYPE"]), "BAND_SEQUENTIAL"); + EXPECT_EQ((std::string)imageObject["BAND_STORAGE_TYPE"], "BAND_SEQUENTIAL"); EXPECT_DOUBLE_EQ(double(imageObject["OFFSET"]), 0.0); EXPECT_DOUBLE_EQ(double(imageObject["SCALING_FACTOR"]), 1.0); EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 32); - EXPECT_EQ(QString(imageObject["SAMPLE_BIT_MASK"]), "2#11111111111111111111111111111111#"); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "PC_REAL"); - EXPECT_EQ(QString(imageObject["CORE_NULL"]), "16#FF7FFFFB#"); - EXPECT_EQ(QString(imageObject["CORE_LOW_REPR_SATURATION"]), "16#FF7FFFFC#"); - EXPECT_EQ(QString(imageObject["CORE_LOW_INSTR_SATURATION"]), "16#FF7FFFFD#"); - EXPECT_EQ(QString(imageObject["CORE_HIGH_REPR_SATURATION"]), "16#FF7FFFFF#"); - EXPECT_EQ(QString(imageObject["CORE_HIGH_INSTR_SATURATION"]), "16#FF7FFFFE#"); + EXPECT_EQ((std::string)imageObject["SAMPLE_BIT_MASK"], "2#11111111111111111111111111111111#"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "PC_REAL"); + EXPECT_EQ((std::string)imageObject["CORE_NULL"], "16#FF7FFFFB#"); + EXPECT_EQ((std::string)imageObject["CORE_LOW_REPR_SATURATION"], "16#FF7FFFFC#"); + EXPECT_EQ((std::string)imageObject["CORE_LOW_INSTR_SATURATION"], "16#FF7FFFFD#"); + EXPECT_EQ((std::string)imageObject["CORE_HIGH_REPR_SATURATION"], "16#FF7FFFFF#"); + EXPECT_EQ((std::string)imageObject["CORE_HIGH_INSTR_SATURATION"], "16#FF7FFFFE#"); } @@ -71,15 +71,15 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsDefaultMSB) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 695); EXPECT_EQ(int(outputLabel["^IMAGE"]), 696); EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 8); - EXPECT_EQ(QString(imageObject["SAMPLE_BIT_MASK"]), "2#11111111#"); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "MSB_UNSIGNED_INTEGER"); + EXPECT_EQ((std::string)imageObject["SAMPLE_BIT_MASK"], "2#11111111#"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "MSB_UNSIGNED_INTEGER"); EXPECT_EQ(int(imageObject["CORE_NULL"]), 0); EXPECT_EQ(int(imageObject["CORE_LOW_REPR_SATURATION"]), 1); EXPECT_EQ(int(imageObject["CORE_LOW_INSTR_SATURATION"]), 1); @@ -111,7 +111,7 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsLinear8bit) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 700); @@ -150,7 +150,7 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsLinears16bit) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 745); @@ -159,8 +159,8 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsLinears16bit) { EXPECT_DOUBLE_EQ(double(imageObject["OFFSET"]), 127.49923699068999); EXPECT_DOUBLE_EQ(double(imageObject["SCALING_FACTOR"]), 0.00038150465435678302); EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 16); - EXPECT_EQ(QString(imageObject["SAMPLE_BIT_MASK"]), "2#1111111111111111#"); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "LSB_INTEGER"); + EXPECT_EQ((std::string)imageObject["SAMPLE_BIT_MASK"], "2#1111111111111111#"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "LSB_INTEGER"); EXPECT_EQ(int(imageObject["CORE_LOW_REPR_SATURATION"]), -32767); EXPECT_EQ(int(imageObject["CORE_LOW_INSTR_SATURATION"]), -32766); EXPECT_EQ(int(imageObject["CORE_HIGH_REPR_SATURATION"]), -32764); @@ -191,7 +191,7 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsLinearu16bit) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 735); @@ -199,7 +199,7 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsLinearu16bit) { EXPECT_DOUBLE_EQ(double(imageObject["OFFSET"]), 2.9886006409278001); EXPECT_DOUBLE_EQ(double(imageObject["SCALING_FACTOR"]), 0.0037997863573935998); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "LSB_UNSIGNED_INTEGER"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "LSB_UNSIGNED_INTEGER"); EXPECT_EQ(int(imageObject["CORE_LOW_REPR_SATURATION"]), 1); EXPECT_EQ(int(imageObject["CORE_LOW_INSTR_SATURATION"]), 2); EXPECT_EQ(int(imageObject["CORE_HIGH_REPR_SATURATION"]), 65535); @@ -226,7 +226,7 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsManual8bit) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 718); @@ -265,7 +265,7 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsManuals16bit) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 741); @@ -274,8 +274,8 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsManuals16bit) { EXPECT_DOUBLE_EQ(double(imageObject["OFFSET"]), -2.5001526018641); EXPECT_DOUBLE_EQ(double(imageObject["SCALING_FACTOR"]), 1.0000763009309); EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 16); - EXPECT_EQ(QString(imageObject["SAMPLE_BIT_MASK"]), "2#1111111111111111#"); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "LSB_INTEGER"); + EXPECT_EQ((std::string)imageObject["SAMPLE_BIT_MASK"], "2#1111111111111111#"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "LSB_INTEGER"); EXPECT_EQ(int(imageObject["CORE_NULL"]), -32768); EXPECT_EQ(int(imageObject["CORE_LOW_REPR_SATURATION"]), -32767); EXPECT_EQ(int(imageObject["CORE_LOW_INSTR_SATURATION"]), -32766); @@ -307,7 +307,7 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsManualu16bit) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 733); @@ -315,7 +315,7 @@ TEST_F(DefaultCube, FunctionalTestIsis2pdsManualu16bit) { EXPECT_DOUBLE_EQ(double(imageObject["OFFSET"]), -3.0002289027926); EXPECT_DOUBLE_EQ(double(imageObject["SCALING_FACTOR"]), 1.0000763009309); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "LSB_UNSIGNED_INTEGER"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "LSB_UNSIGNED_INTEGER"); EXPECT_EQ(int(imageObject["CORE_NULL"]), 0); EXPECT_EQ(int(imageObject["CORE_LOW_REPR_SATURATION"]), 1); EXPECT_EQ(int(imageObject["CORE_LOW_INSTR_SATURATION"]), 2); @@ -340,43 +340,43 @@ TEST(isis2pdsTest, FunctionalTestIsis2pdsOffset) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); - EXPECT_EQ(QString(outputLabel["PDS_VERSION_ID"]), "PDS3"); - EXPECT_EQ(QString(outputLabel["RECORD_TYPE"]), "UNDEFINED"); + EXPECT_EQ((std::string)outputLabel["PDS_VERSION_ID"], "PDS3"); + EXPECT_EQ((std::string)outputLabel["RECORD_TYPE"], "UNDEFINED"); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 2032); EXPECT_EQ(int(outputLabel["^IMAGE"]), 2033); - EXPECT_EQ(QString(outputLabel["CHECKSUM"]), "315348326c41130fdefd0615c24a1ac9"); - EXPECT_EQ(QString(outputLabel["TARGET_NAME"]), "MOON"); + EXPECT_EQ((std::string)outputLabel["CHECKSUM"], "315348326c41130fdefd0615c24a1ac9"); + EXPECT_EQ((std::string)outputLabel["TARGET_NAME"], "MOON"); EXPECT_EQ(int(imageObject["LINES"]), 240); EXPECT_EQ(int(imageObject["LINE_SAMPLES"]), 480); EXPECT_EQ(int(imageObject["BANDS"]), 1); - EXPECT_EQ(QString(imageObject["BAND_STORAGE_TYPE"]), "BAND_SEQUENTIAL"); + EXPECT_EQ((std::string)imageObject["BAND_STORAGE_TYPE"], "BAND_SEQUENTIAL"); EXPECT_DOUBLE_EQ(double(imageObject["OFFSET"]), 0.0); EXPECT_DOUBLE_EQ(double(imageObject["SCALING_FACTOR"]), 1.0); EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 32); - EXPECT_EQ(QString(imageObject["SAMPLE_BIT_MASK"]), "2#11111111111111111111111111111111#"); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "PC_REAL"); - EXPECT_EQ(QString(imageObject["CORE_NULL"]), "16#FF7FFFFB#"); - EXPECT_EQ(QString(imageObject["CORE_LOW_REPR_SATURATION"]), "16#FF7FFFFC#"); - EXPECT_EQ(QString(imageObject["CORE_LOW_INSTR_SATURATION"]), "16#FF7FFFFD#"); - EXPECT_EQ(QString(imageObject["CORE_HIGH_REPR_SATURATION"]), "16#FF7FFFFF#"); - EXPECT_EQ(QString(imageObject["CORE_HIGH_INSTR_SATURATION"]), "16#FF7FFFFE#"); + EXPECT_EQ((std::string)imageObject["SAMPLE_BIT_MASK"], "2#11111111111111111111111111111111#"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "PC_REAL"); + EXPECT_EQ((std::string)imageObject["CORE_NULL"], "16#FF7FFFFB#"); + EXPECT_EQ((std::string)imageObject["CORE_LOW_REPR_SATURATION"], "16#FF7FFFFC#"); + EXPECT_EQ((std::string)imageObject["CORE_LOW_INSTR_SATURATION"], "16#FF7FFFFD#"); + EXPECT_EQ((std::string)imageObject["CORE_HIGH_REPR_SATURATION"], "16#FF7FFFFF#"); + EXPECT_EQ((std::string)imageObject["CORE_HIGH_INSTR_SATURATION"], "16#FF7FFFFE#"); PvlObject projectionObject = outputLabel.findObject("IMAGE_MAP_PROJECTION"); - EXPECT_EQ(QString(projectionObject["MAP_PROJECTION_TYPE"]), "SIMPLE CYLINDRICAL"); - EXPECT_EQ(QString(projectionObject["PROJECTION_LATITUDE_TYPE"]), "PLANETOCENTRIC"); + EXPECT_EQ((std::string)projectionObject["MAP_PROJECTION_TYPE"], "SIMPLE CYLINDRICAL"); + EXPECT_EQ((std::string)projectionObject["PROJECTION_LATITUDE_TYPE"], "PLANETOCENTRIC"); EXPECT_DOUBLE_EQ(double(projectionObject["A_AXIS_RADIUS"]), 1737.4); EXPECT_DOUBLE_EQ(double(projectionObject["B_AXIS_RADIUS"]), 1737.4); EXPECT_DOUBLE_EQ(double(projectionObject["C_AXIS_RADIUS"]), 1737.4); - EXPECT_EQ(QString(projectionObject["FIRST_STANDARD_PARALLEL"]), "N/A"); - EXPECT_EQ(QString(projectionObject["SECOND_STANDARD_PARALLEL"]), "N/A"); - EXPECT_EQ(QString(projectionObject["COORDINATE_SYSTEM_NAME"]), "PLANETOCENTRIC"); - EXPECT_EQ(QString(projectionObject["POSITIVE_LONGITUDE_DIRECTION"]), "EAST"); - EXPECT_EQ(QString(projectionObject["KEYWORD_LATITUDE_TYPE"]), "PLANETOCENTRIC"); + EXPECT_EQ((std::string)projectionObject["FIRST_STANDARD_PARALLEL"], "N/A"); + EXPECT_EQ((std::string)projectionObject["SECOND_STANDARD_PARALLEL"], "N/A"); + EXPECT_EQ((std::string)projectionObject["COORDINATE_SYSTEM_NAME"], "PLANETOCENTRIC"); + EXPECT_EQ((std::string)projectionObject["POSITIVE_LONGITUDE_DIRECTION"], "EAST"); + EXPECT_EQ((std::string)projectionObject["KEYWORD_LATITUDE_TYPE"], "PLANETOCENTRIC"); EXPECT_DOUBLE_EQ(double(projectionObject["CENTER_LATITUDE"]), 0.0); EXPECT_DOUBLE_EQ(double(projectionObject["CENTER_LONGITUDE"]), 180.0); EXPECT_EQ(int(projectionObject["LINE_FIRST_PIXEL"]), 1); diff --git a/isis/tests/FunctionalTestsIsisImport.cpp b/isis/tests/FunctionalTestsIsisImport.cpp index 845404892b..b8b0d899e9 100644 --- a/isis/tests/FunctionalTestsIsisImport.cpp +++ b/isis/tests/FunctionalTestsIsisImport.cpp @@ -66,9 +66,9 @@ End)"; PvlGroup dimensionsGroup = label->findObject("IsisCube").findObject("Core").findGroup("Dimensions"); - EXPECT_EQ(toInt(dimensionsGroup["Samples"][0]), 3); - EXPECT_EQ(toInt(dimensionsGroup["Lines"][0]), 2); - EXPECT_EQ(toInt(dimensionsGroup["Bands"][0]), 1); + EXPECT_EQ(std::stoi(dimensionsGroup["Samples"][0]), 3); + EXPECT_EQ(std::stoi(dimensionsGroup["Lines"][0]), 2); + EXPECT_EQ(std::stoi(dimensionsGroup["Bands"][0]), 1); EXPECT_EQ(cube.sampleCount(), 3); EXPECT_EQ(cube.lineCount(), 2); @@ -135,7 +135,7 @@ End)"; Pvl *label = cube.label(); PvlGroup instrumentGroup = label->findObject("IsisCube").findGroup("Instrument"); - EXPECT_EQ(instrumentGroup["StartTime"][0].toStdString(), "2021-01-01T00:00:00"); + EXPECT_EQ(instrumentGroup["StartTime"][0], "2021-01-01T00:00:00"); } TEST_F(TempTestingFiles, FunctionalTestIsisImportLabelPds4YearDoy) { @@ -183,7 +183,7 @@ End)"; Pvl *label = cube.label(); PvlGroup archiveGroup = label->findObject("IsisCube").findGroup("Archive"); - EXPECT_EQ(archiveGroup["YearDoy"][0].toStdString(), "202132"); + EXPECT_EQ(archiveGroup["YearDoy"][0], "202132"); } TEST_F(TempTestingFiles, FunctionalTestIsisImportLabelObservationId) { @@ -231,5 +231,5 @@ End)"; Pvl *label = cube.label(); PvlGroup archiveGroup = label->findObject("IsisCube").findGroup("Archive"); - EXPECT_EQ(archiveGroup["ObservationId"][0].toStdString(), "CRUS_000000_505_1"); + EXPECT_EQ(archiveGroup["ObservationId"][0], "CRUS_000000_505_1"); } diff --git a/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp b/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp index e38e0ce5e2..a7be1b66ca 100644 --- a/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp +++ b/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp @@ -429,9 +429,9 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportCassiniIssCustomMax) { QString inputLabel = "data/ciss2isis/W1472855646_5.cropped.lbl"; QString updatedPvlLabel = tempDir.path() + "/W1472855646_5.cropped.lbl"; - Pvl inputPvl(inputLabel); + Pvl inputPvl(inputLabel.toStdString()); inputPvl["VALID_MAXIMUM"][1] = "70"; - inputPvl.write(updatedPvlLabel); + inputPvl.write(updatedPvlLabel.toStdString()); QFile::copy("data/ciss2isis/W1472855646_5.cropped.img", tempDir.path() + "/W1472855646_5.cropped.img"); QVector args = { "from=" + updatedPvlLabel, diff --git a/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp b/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp index c886da8ce2..817a908e93 100644 --- a/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp +++ b/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp @@ -51,15 +51,15 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiVis) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["MissionName"][0].toStdString(), "SELENE"); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "KAGUYA"); - EXPECT_EQ(inst["InstrumentName"][0].toStdString(), "Multiband Imager Visible"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "MI-VIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2008-09-16T20:11:04.162607"); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2008-09-16T20:11:16.629582"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "905631054.826"); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "905631067.294"); + EXPECT_EQ(inst["MissionName"][0], "SELENE"); + EXPECT_EQ(inst["SpacecraftName"][0], "KAGUYA"); + EXPECT_EQ(inst["InstrumentName"][0], "Multiband Imager Visible"); + EXPECT_EQ(inst["InstrumentId"][0], "MI-VIS"); + EXPECT_EQ(inst["TargetName"][0], "MOON"); + EXPECT_EQ(inst["StartTime"][0], "2008-09-16T20:11:04.162607"); + EXPECT_EQ(inst["StopTime"][0], "2008-09-16T20:11:16.629582"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "905631054.826"); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "905631067.294"); EXPECT_DOUBLE_EQ(inst["LineExposureDuration"], 2.6623); EXPECT_EQ(inst["LineExposureDuration"].unit(), "msec"); EXPECT_DOUBLE_EQ(inst["LineSamplingInterval"], 13); @@ -70,8 +70,8 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiVis) { // Archive Group PvlGroup &arch = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(arch["DataSetId"][0].toStdString(), "MI-VIS_Level2B"); - EXPECT_EQ(arch["ProductSetId"][0].toStdString(), "MI-VIS_Level2B2"); + EXPECT_EQ(arch["DataSetId"][0], "MI-VIS_Level2B"); + EXPECT_EQ(arch["ProductSetId"][0], "MI-VIS_Level2B2"); // Bandbin Group PvlGroup &bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -129,15 +129,15 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiNir) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["MissionName"][0].toStdString(), "SELENE"); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "KAGUYA"); - EXPECT_EQ(inst["InstrumentName"][0].toStdString(), "Multiband Imager Near Infrared"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "MI-NIR"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2008-09-16T20:10:30.480257"); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2008-09-16T20:10:42.921232"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "905631021.132"); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "905631033.574"); + EXPECT_EQ(inst["MissionName"][0], "SELENE"); + EXPECT_EQ(inst["SpacecraftName"][0], "KAGUYA"); + EXPECT_EQ(inst["InstrumentName"][0], "Multiband Imager Near Infrared"); + EXPECT_EQ(inst["InstrumentId"][0], "MI-NIR"); + EXPECT_EQ(inst["TargetName"][0], "MOON"); + EXPECT_EQ(inst["StartTime"][0], "2008-09-16T20:10:30.480257"); + EXPECT_EQ(inst["StopTime"][0], "2008-09-16T20:10:42.921232"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "905631021.132"); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "905631033.574"); EXPECT_DOUBLE_EQ(inst["LineExposureDuration"], 13.2148); EXPECT_EQ(inst["LineExposureDuration"].unit(), "msec"); EXPECT_DOUBLE_EQ(inst["LineSamplingInterval"], 39); @@ -148,8 +148,8 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiNir) { // Archive Group PvlGroup &arch = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(arch["DataSetId"][0].toStdString(), "MI-NIR_Level2B"); - EXPECT_EQ(arch["ProductSetId"][0].toStdString(), "MI-NIR_Level2B2"); + EXPECT_EQ(arch["DataSetId"][0], "MI-NIR_Level2B"); + EXPECT_EQ(arch["ProductSetId"][0], "MI-NIR_Level2B2"); // Bandbin Group PvlGroup &bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp b/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp index 7324dc745a..5065049bed 100644 --- a/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp +++ b/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp @@ -248,7 +248,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyaTC) { isisimport(options); - Pvl output = Pvl(tempDir.path() + "/kaguyatc.cub"); + Pvl output = Pvl(tempDir.path().toStdString() + "/kaguyatc.cub"); Pvl truth; PvlInput >> truth; diff --git a/isis/tests/FunctionalTestsIsisImportLo.cpp b/isis/tests/FunctionalTestsIsisImportLo.cpp index 3b0d3f97f5..341e1bb26e 100644 --- a/isis/tests/FunctionalTestsIsisImportLo.cpp +++ b/isis/tests/FunctionalTestsIsisImportLo.cpp @@ -51,38 +51,38 @@ TEST(IsisImportTests, loTestDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 3"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "High Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-02-20T08:14:28.610"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 3"); + ASSERT_EQ(inst["InstrumentId"][0], "High Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-02-20T08:14:28.610"); ASSERT_DOUBLE_EQ(inst["FiducialCoordinateMicron"], 50); ASSERT_EQ(inst["FiducialCoordinateMicron"].unit(), "um"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 3133); - ASSERT_EQ(inst["FiducialID"][0].toStdString(), "1b"); - ASSERT_EQ(inst["FiducialID"][6].toStdString(), "73a"); - ASSERT_EQ(inst["FiducialID"][14].toStdString(), "144b"); - ASSERT_EQ(inst["FiducialID"][29].toStdString(), "283b"); + ASSERT_EQ(inst["FiducialID"][0], "1b"); + ASSERT_EQ(inst["FiducialID"][6], "73a"); + ASSERT_EQ(inst["FiducialID"][14], "144b"); + ASSERT_EQ(inst["FiducialID"][29], "283b"); - ASSERT_DOUBLE_EQ(inst["FiducialSamples"][0].toDouble(), 32162.0); - ASSERT_DOUBLE_EQ(inst["FiducialSamples"][6].toDouble(), 24295.0); - ASSERT_DOUBLE_EQ(inst["FiducialSamples"][14].toDouble(), 16593.0); - ASSERT_DOUBLE_EQ(inst["FiducialSamples"][29].toDouble(), 1248.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialSamples"][0]), 32162.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialSamples"][6]), 24295.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialSamples"][14]), 16593.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialSamples"][29]), 1248.0); - ASSERT_DOUBLE_EQ(inst["FiducialLines"][0].toDouble(), 8510.0); - ASSERT_DOUBLE_EQ(inst["FiducialLines"][6].toDouble(), 8504.0); - ASSERT_DOUBLE_EQ(inst["FiducialLines"][14].toDouble(), 584.0); - ASSERT_DOUBLE_EQ(inst["FiducialLines"][29].toDouble(), 8496.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialLines"][0]), 8510.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialLines"][6]), 8504.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialLines"][14]), 584.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialLines"][29]), 8496.0); - ASSERT_DOUBLE_EQ(inst["FiducialXCoordinates"][0].toDouble(), -108.168); - ASSERT_DOUBLE_EQ(inst["FiducialXCoordinates"][6].toDouble(), -53.474); - ASSERT_DOUBLE_EQ(inst["FiducialXCoordinates"][14].toDouble(), 0.122); - ASSERT_DOUBLE_EQ(inst["FiducialXCoordinates"][29].toDouble(), 106.844); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialXCoordinates"][0]), -108.168); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialXCoordinates"][6]), -53.474); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialXCoordinates"][14]), 0.122); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialXCoordinates"][29]), 106.844); - ASSERT_DOUBLE_EQ(inst["FiducialYCoordinates"][0].toDouble(), 27.476); - ASSERT_DOUBLE_EQ(inst["FiducialYCoordinates"][6].toDouble(), 27.5); - ASSERT_DOUBLE_EQ(inst["FiducialYCoordinates"][14].toDouble(), -27.493); - ASSERT_DOUBLE_EQ(inst["FiducialYCoordinates"][29].toDouble(), 27.479); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialYCoordinates"][0]), 27.476); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialYCoordinates"][6]), 27.5); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialYCoordinates"][14]), -27.493); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialYCoordinates"][29]), 27.479); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -124,10 +124,10 @@ TEST(IsisImportTests, loMirrored) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 4"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "High Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-05-23T07:12:45.810"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 4"); + ASSERT_EQ(inst["InstrumentId"][0], "High Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-05-23T07:12:45.810"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 4164); // Bandbin Group @@ -163,10 +163,10 @@ TEST(IsisImportTests, loMedToHi) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 3"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "Medium Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-02-17T21:09:27.610"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 3"); + ASSERT_EQ(inst["InstrumentId"][0], "Medium Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-02-17T21:09:27.610"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 3083); ASSERT_DOUBLE_EQ(inst["BoresightSample"], 5427.039); ASSERT_DOUBLE_EQ(inst["BoresightLine"], 4550.455); @@ -174,7 +174,7 @@ TEST(IsisImportTests, loMedToHi) { // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["FilterName"][0].toStdString(), "none"); + ASSERT_EQ(bandbin["FilterName"][0], "none"); ASSERT_EQ(bandbin["Center"][0], "1.0"); ASSERT_EQ(bandbin["OriginalBand"][0], "1"); @@ -206,16 +206,16 @@ TEST(IsisImportTests, loMed) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 3"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "Medium Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-02-17T21:09:27.610"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 3"); + ASSERT_EQ(inst["InstrumentId"][0], "Medium Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-02-17T21:09:27.610"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 3083); ASSERT_DOUBLE_EQ(inst["SubFrame"], 0); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["FilterName"][0].toStdString(), "none"); + ASSERT_EQ(bandbin["FilterName"][0], "none"); ASSERT_EQ(bandbin["Center"][0], "1.0"); ASSERT_EQ(bandbin["OriginalBand"][0], "1"); @@ -247,10 +247,10 @@ TEST(IsisImportTests, loReingest) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 3"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "High Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-02-20T08:14:28.610000"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 3"); + ASSERT_EQ(inst["InstrumentId"][0], "High Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-02-20T08:14:28.610000"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 3133); ASSERT_DOUBLE_EQ(inst["SubFrame"], 2921); diff --git a/isis/tests/FunctionalTestsIsisImportLroNac.cpp b/isis/tests/FunctionalTestsIsisImportLroNac.cpp index cd4ea1f7a2..53eb69b5d8 100644 --- a/isis/tests/FunctionalTestsIsisImportLroNac.cpp +++ b/isis/tests/FunctionalTestsIsisImportLroNac.cpp @@ -51,21 +51,21 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportLroNacLFull) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "NACL"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2009-11-29T14:51:21.968000"); - - EXPECT_EQ(inst["TemperatureSCS"][0].toStdString(), "3.88"); - EXPECT_EQ(inst["TemperatureFPA"][0].toStdString(), "17.73"); - EXPECT_EQ(inst["TemperatureFPGA"][0].toStdString(), "-12.94"); - EXPECT_EQ(inst["TemperatureTelescope"][0].toStdString(), "8.89"); - EXPECT_EQ(inst["SpatialSumming"][0].toStdString(), "1"); - - EXPECT_EQ(inst["TemperatureSCSRaw"][0].toStdString(), "2770"); - EXPECT_EQ(inst["TemperatureFPARaw"][0].toStdString(), "2115"); - EXPECT_EQ(inst["TemperatureFPGARaw"][0].toStdString(), "3440"); - EXPECT_EQ(inst["TemperatureTelescopeRaw"][0].toStdString(), "2536"); + EXPECT_EQ(inst["SpacecraftName"][0], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "NACL"); + EXPECT_EQ(inst["TargetName"][0], "MOON"); + EXPECT_EQ(inst["StartTime"][0], "2009-11-29T14:51:21.968000"); + + EXPECT_EQ(inst["TemperatureSCS"][0], "3.88"); + EXPECT_EQ(inst["TemperatureFPA"][0], "17.73"); + EXPECT_EQ(inst["TemperatureFPGA"][0], "-12.94"); + EXPECT_EQ(inst["TemperatureTelescope"][0], "8.89"); + EXPECT_EQ(inst["SpatialSumming"][0], "1"); + + EXPECT_EQ(inst["TemperatureSCSRaw"][0], "2770"); + EXPECT_EQ(inst["TemperatureFPARaw"][0], "2115"); + EXPECT_EQ(inst["TemperatureFPGARaw"][0], "3440"); + EXPECT_EQ(inst["TemperatureTelescopeRaw"][0], "2536"); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -120,21 +120,21 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportLroNacRFull) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "NACR"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2009-11-29T14:51:21.968000"); - - EXPECT_EQ(inst["TemperatureSCS"][0].toStdString(), "3.88"); - EXPECT_EQ(inst["TemperatureFPA"][0].toStdString(), "17.67"); - EXPECT_EQ(inst["TemperatureFPGA"][0].toStdString(), "-11.38"); - EXPECT_EQ(inst["TemperatureTelescope"][0].toStdString(), "11.14"); - EXPECT_EQ(inst["SpatialSumming"][0].toStdString(), "1"); - - EXPECT_EQ(inst["TemperatureSCSRaw"][0].toStdString(), "2770"); - EXPECT_EQ(inst["TemperatureFPARaw"][0].toStdString(), "2118"); - EXPECT_EQ(inst["TemperatureFPGARaw"][0].toStdString(), "3388"); - EXPECT_EQ(inst["TemperatureTelescopeRaw"][0].toStdString(), "2429"); + EXPECT_EQ(inst["SpacecraftName"][0], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "NACR"); + EXPECT_EQ(inst["TargetName"][0], "MOON"); + EXPECT_EQ(inst["StartTime"][0], "2009-11-29T14:51:21.968000"); + + EXPECT_EQ(inst["TemperatureSCS"][0], "3.88"); + EXPECT_EQ(inst["TemperatureFPA"][0], "17.67"); + EXPECT_EQ(inst["TemperatureFPGA"][0], "-11.38"); + EXPECT_EQ(inst["TemperatureTelescope"][0], "11.14"); + EXPECT_EQ(inst["SpatialSumming"][0], "1"); + + EXPECT_EQ(inst["TemperatureSCSRaw"][0], "2770"); + EXPECT_EQ(inst["TemperatureFPARaw"][0], "2118"); + EXPECT_EQ(inst["TemperatureFPGARaw"][0], "3388"); + EXPECT_EQ(inst["TemperatureTelescopeRaw"][0], "2429"); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -165,7 +165,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportLroLabelFail) { Pvl lab("data/lronac/nacr.img"); PvlKeyword &bterm = lab.findKeyword("LRO:BTERM"); bterm.setValue("fake"); - lab.write(badLabelPath); + lab.write(badLabelPath.toStdString()); QString cubeFileName = prefix.path() + "/doesntMatter.cub"; QVector args = {"from="+badLabelPath, "to="+cubeFileName}; diff --git a/isis/tests/FunctionalTestsIsisImportMerMI.cpp b/isis/tests/FunctionalTestsIsisImportMerMI.cpp index 1b750c85ae..3e76d9bd30 100644 --- a/isis/tests/FunctionalTestsIsisImportMerMI.cpp +++ b/isis/tests/FunctionalTestsIsisImportMerMI.cpp @@ -119,7 +119,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportMerMICaseOne){ isisimport(options); - Pvl output = Pvl(tempDir.path() + "/MerMI1.cub"); + Pvl output = Pvl(tempDir.path().toStdString() + "/MerMI1.cub"); Pvl truth; PvlInput >> truth; @@ -243,7 +243,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportMerMICaseTwo){ isisimport(options); - Pvl output = Pvl(tempDir.path() + "/MerMI2.cub"); + Pvl output = Pvl(tempDir.path().toStdString() + "/MerMI2.cub"); Pvl truth; PvlInput >> truth; diff --git a/isis/tests/FunctionalTestsIsisexport.cpp b/isis/tests/FunctionalTestsIsisexport.cpp index 9c1052cdfe..ef77be5fff 100644 --- a/isis/tests/FunctionalTestsIsisexport.cpp +++ b/isis/tests/FunctionalTestsIsisexport.cpp @@ -43,7 +43,7 @@ TEST_F(SmallCube, FunctionalTestIsisexportMainLabel) { renderedStream.open(renderedFile.toStdString()); std::string line; std::getline(renderedStream, line); - EXPECT_EQ(testKey[0].toStdString(), line); + EXPECT_EQ(testKey[0], line); } TEST_F(SmallCube, FunctionalTestIsisexportOriginalLabel) { @@ -68,7 +68,7 @@ TEST_F(SmallCube, FunctionalTestIsisexportOriginalLabel) { renderedStream.open(renderedFile.toStdString()); std::string line; std::getline(renderedStream, line); - EXPECT_EQ(testKey[0].toStdString(), line); + EXPECT_EQ(testKey[0], line); } TEST_F(SmallCube, FunctionalTestIsisexportNoOriginalLabel) { @@ -117,7 +117,7 @@ TEST_F(SmallCube, FunctionalTestIsisexportExtraPvl) { Pvl testPvl; PvlKeyword testKey("TestValue", "a"); testPvl += testKey; - testPvl.write(pvlFile); + testPvl.write(pvlFile.toStdString()); QString templateFile = tempDir.path()+"/test_result.tpl"; QString renderedFile = tempDir.path()+"/test_result.txt"; @@ -136,7 +136,7 @@ TEST_F(SmallCube, FunctionalTestIsisexportExtraPvl) { renderedStream.open(renderedFile.toStdString()); std::string line; std::getline(renderedStream, line); - EXPECT_EQ(testKey[0].toStdString(), line); + EXPECT_EQ(testKey[0], line); } TEST_F(SmallCube, FunctionalTestIsisexportMultipleExtraPvl) { @@ -146,7 +146,7 @@ TEST_F(SmallCube, FunctionalTestIsisexportMultipleExtraPvl) { PvlKeyword safeKey("SafeValue", "true"); testPvl1 += testKey1; testPvl1 += safeKey; - testPvl1.write(pvlFile1); + testPvl1.write(pvlFile1.toStdString()); QString pvlfile2 = tempDir.path()+"/extra2.pvl"; Pvl testPvl2; @@ -154,7 +154,7 @@ TEST_F(SmallCube, FunctionalTestIsisexportMultipleExtraPvl) { PvlKeyword testKey2("AnotherValue", "10"); testPvl2 += duplicateKey; testPvl2 += testKey2; - testPvl2.write(pvlfile2); + testPvl2.write(pvlfile2.toStdString()); QString templateFile = tempDir.path()+"/test_result.tpl"; QString renderedFile = tempDir.path()+"/test_result.txt"; @@ -176,11 +176,11 @@ TEST_F(SmallCube, FunctionalTestIsisexportMultipleExtraPvl) { renderedStream.open(renderedFile.toStdString()); std::string line; std::getline(renderedStream, line); - EXPECT_EQ(duplicateKey[0].toStdString(), line); + EXPECT_EQ(duplicateKey[0], line); std::getline(renderedStream, line); - EXPECT_EQ(testKey2[0].toStdString(), line); + EXPECT_EQ(testKey2[0], line); std::getline(renderedStream, line); - EXPECT_EQ(safeKey[0].toStdString(), line); + EXPECT_EQ(safeKey[0], line); // The duplicate key should generate a warning EXPECT_TRUE(log.hasGroup("Warning")); diff --git a/isis/tests/FunctionalTestsJigsaw.cpp b/isis/tests/FunctionalTestsJigsaw.cpp index 9ec8ba322c..61975df4f5 100644 --- a/isis/tests/FunctionalTestsJigsaw.cpp +++ b/isis/tests/FunctionalTestsJigsaw.cpp @@ -872,7 +872,7 @@ TEST_F(ObservationPair, FunctionalTestJigsawErrorTBParamsNoSolve) { QString tbsolvepath = prefix.path() + "/tbsolve.pvl"; Pvl tbsolve; iss >> tbsolve; - tbsolve.write(tbsolvepath); + tbsolve.write(tbsolvepath.toStdString()); // just use isdPath for a valid PVL file without the wanted groups QVector args = {"fromlist="+cubeListFile, "cnet="+cnetPath, "onet="+outCnetFileName, "SOLVETARGETBODY=TRUE", "tbparameters="+tbsolvepath}; @@ -942,7 +942,7 @@ End)"); Pvl tbParams; tbPvlStr >> tbParams; - tbParams.write(tbParamsPath); + tbParams.write(tbParamsPath.toStdString()); QString outCnetFileName = prefix.path() + "/outTemp.net"; @@ -1102,7 +1102,7 @@ End)"); Pvl tbParams; tbPvlStr >> tbParams; - tbParams.write(tbParamsPath); + tbParams.write(tbParamsPath.toStdString()); QString outCnetFileName = prefix.path() + "/outTemp.net"; diff --git a/isis/tests/FunctionalTestsJitterfit.cpp b/isis/tests/FunctionalTestsJitterfit.cpp index 52cb170ad9..718fa076c5 100644 --- a/isis/tests/FunctionalTestsJitterfit.cpp +++ b/isis/tests/FunctionalTestsJitterfit.cpp @@ -72,12 +72,12 @@ TEST_F(TempTestingFiles, DISABLED_FunctionalTestJitterfitDefault){ Pvl *isisLabel = cube.label(); PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_DOUBLE_EQ(inst["JitterSampleCoefficients"][0].toDouble(), -6.3185740156776303e-09); - EXPECT_DOUBLE_EQ(inst["JitterSampleCoefficients"][1].toDouble(), 2.44034713747508e-06); - EXPECT_DOUBLE_EQ(inst["JitterSampleCoefficients"][2].toDouble(), 0.0032581267520383002); - EXPECT_DOUBLE_EQ(inst["JitterLineCoefficients"][0].toDouble(), -2.7623177125388001e-09); - EXPECT_DOUBLE_EQ(inst["JitterLineCoefficients"][1].toDouble(), 3.3727910440682698e-06); - EXPECT_DOUBLE_EQ(inst["JitterLineCoefficients"][2].toDouble(), 0.0013484324974775001); + EXPECT_DOUBLE_EQ(std::stod(inst["JitterSampleCoefficients"][0]), -6.3185740156776303e-09); + EXPECT_DOUBLE_EQ(std::stod(inst["JitterSampleCoefficients"][1]), 2.44034713747508e-06); + EXPECT_DOUBLE_EQ(std::stod(inst["JitterSampleCoefficients"][2]), 0.0032581267520383002); + EXPECT_DOUBLE_EQ(std::stod(inst["JitterLineCoefficients"][0]), -2.7623177125388001e-09); + EXPECT_DOUBLE_EQ(std::stod(inst["JitterLineCoefficients"][1]), 3.3727910440682698e-06); + EXPECT_DOUBLE_EQ(std::stod(inst["JitterLineCoefficients"][2]), 0.0013484324974775001); // Test residuals CSVReader::CSVAxis residLine; @@ -159,7 +159,7 @@ TEST_F(TempTestingFiles, DISABLED_FunctionalTestJitterfitDefault){ // Test statistics of registration - Pvl stats = Pvl(outputRegistrationStats); + Pvl stats = Pvl(outputRegistrationStats.toStdString()); PvlGroup &autoRegStats = stats.findGroup("AutoRegStatistics"); EXPECT_EQ((double) autoRegStats.findKeyword("Total"), 60); EXPECT_EQ((double) autoRegStats.findKeyword("Successful"), 42); diff --git a/isis/tests/FunctionalTestsKaguyami2isis.cpp b/isis/tests/FunctionalTestsKaguyami2isis.cpp index 6b42c8d913..7cdc982c2e 100644 --- a/isis/tests/FunctionalTestsKaguyami2isis.cpp +++ b/isis/tests/FunctionalTestsKaguyami2isis.cpp @@ -45,15 +45,15 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisVis) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["MissionName"][0].toStdString(), "SELENE"); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "KAGUYA"); - EXPECT_EQ(inst["InstrumentName"][0].toStdString(), "Multiband Imager Visible"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "MI-VIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2008-09-16T20:11:04.162607"); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2008-09-16T20:11:16.629582"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "905631054.826"); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "905631067.294"); + EXPECT_EQ(inst["MissionName"][0], "SELENE"); + EXPECT_EQ(inst["SpacecraftName"][0], "KAGUYA"); + EXPECT_EQ(inst["InstrumentName"][0], "Multiband Imager Visible"); + EXPECT_EQ(inst["InstrumentId"][0], "MI-VIS"); + EXPECT_EQ(inst["TargetName"][0], "MOON"); + EXPECT_EQ(inst["StartTime"][0], "2008-09-16T20:11:04.162607"); + EXPECT_EQ(inst["StopTime"][0], "2008-09-16T20:11:16.629582"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "905631054.826"); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "905631067.294"); EXPECT_DOUBLE_EQ(inst["LineExposureDuration"], 2.6623); EXPECT_EQ(inst["LineExposureDuration"].unit(), "msec"); EXPECT_DOUBLE_EQ(inst["LineSamplingInterval"], 13); @@ -64,8 +64,8 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisVis) { // Archive Group PvlGroup &arch = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(arch["DataSetId"][0].toStdString(), "MI-VIS_Level2B"); - EXPECT_EQ(arch["ProductSetId"][0].toStdString(), "MI-VIS_Level2B2"); + EXPECT_EQ(arch["DataSetId"][0], "MI-VIS_Level2B"); + EXPECT_EQ(arch["ProductSetId"][0], "MI-VIS_Level2B2"); // Bandbin Group PvlGroup &bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -123,15 +123,15 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisNir) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["MissionName"][0].toStdString(), "SELENE"); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "KAGUYA"); - EXPECT_EQ(inst["InstrumentName"][0].toStdString(), "Multiband Imager Near Infrared"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "MI-NIR"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2008-09-16T20:10:30.480257"); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2008-09-16T20:10:42.921232"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "905631021.132"); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "905631033.574"); + EXPECT_EQ(inst["MissionName"][0], "SELENE"); + EXPECT_EQ(inst["SpacecraftName"][0], "KAGUYA"); + EXPECT_EQ(inst["InstrumentName"][0], "Multiband Imager Near Infrared"); + EXPECT_EQ(inst["InstrumentId"][0], "MI-NIR"); + EXPECT_EQ(inst["TargetName"][0], "MOON"); + EXPECT_EQ(inst["StartTime"][0], "2008-09-16T20:10:30.480257"); + EXPECT_EQ(inst["StopTime"][0], "2008-09-16T20:10:42.921232"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "905631021.132"); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "905631033.574"); EXPECT_DOUBLE_EQ(inst["LineExposureDuration"], 13.2148); EXPECT_EQ(inst["LineExposureDuration"].unit(), "msec"); EXPECT_DOUBLE_EQ(inst["LineSamplingInterval"], 39); @@ -142,8 +142,8 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisNir) { // Archive Group PvlGroup &arch = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(arch["DataSetId"][0].toStdString(), "MI-NIR_Level2B"); - EXPECT_EQ(arch["ProductSetId"][0].toStdString(), "MI-NIR_Level2B2"); + EXPECT_EQ(arch["DataSetId"][0], "MI-NIR_Level2B"); + EXPECT_EQ(arch["ProductSetId"][0], "MI-NIR_Level2B2"); // Bandbin Group PvlGroup &bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsKaguyatc2isis.cpp b/isis/tests/FunctionalTestsKaguyatc2isis.cpp index 741a93a434..850aa082e0 100644 --- a/isis/tests/FunctionalTestsKaguyatc2isis.cpp +++ b/isis/tests/FunctionalTestsKaguyatc2isis.cpp @@ -43,26 +43,26 @@ TEST(kaguyatc2isisTest, kaguyatc2isisTestDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["MissionName"][0].toStdString(), "SELENE"); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "KAGUYA"); - ASSERT_EQ(inst["InstrumentName"][0].toStdString(), "TERRAIN CAMERA 1"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "TC1"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2008-12-07T05:04:34.458542"); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2008-12-07T05:05:04.715727"); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "912661463.551562"); - ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "912661493.808747"); + ASSERT_EQ(inst["MissionName"][0], "SELENE"); + ASSERT_EQ(inst["SpacecraftName"][0], "KAGUYA"); + ASSERT_EQ(inst["InstrumentName"][0], "TERRAIN CAMERA 1"); + ASSERT_EQ(inst["InstrumentId"][0], "TC1"); + ASSERT_EQ(inst["TargetName"][0], "MOON"); + ASSERT_EQ(inst["StartTime"][0], "2008-12-07T05:04:34.458542"); + ASSERT_EQ(inst["StopTime"][0], "2008-12-07T05:05:04.715727"); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "912661463.551562"); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0], "912661493.808747"); ASSERT_DOUBLE_EQ(inst["ExposureDuration"], 3.25); ASSERT_EQ(inst["ExposureDuration"].unit(), "ms"); ASSERT_DOUBLE_EQ(inst["LineSamplingInterval"], 6.499932); ASSERT_EQ(inst["LineSamplingInterval"].unit(), "ms"); - ASSERT_EQ(inst["IlluminationCondition"][0].toStdString(), "MORNING"); + ASSERT_EQ(inst["IlluminationCondition"][0], "MORNING"); // Archive Group PvlGroup &arch = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(arch["DataSetId"][0].toStdString(), "SLN-L-TC-3-S-LEVEL2B0-V1.0"); - ASSERT_EQ(arch["ImageValueType"][0].toStdString(), "RADIANCE"); + ASSERT_EQ(arch["DataSetId"][0], "SLN-L-TC-3-S-LEVEL2B0-V1.0"); + ASSERT_EQ(arch["ImageValueType"][0], "RADIANCE"); ASSERT_EQ(int(arch["SceneMaximumDn"]), 3913); ASSERT_EQ(int(arch["SceneMinimumDn"]), 30); ASSERT_DOUBLE_EQ(double(arch["SceneAverageDn"]), 868.1); @@ -116,26 +116,26 @@ TEST(kaguyatc2isisTest, kaguyatc2isisTestSpSupport) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["MissionName"][0].toStdString(), "SELENE"); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "KAGUYA"); - ASSERT_EQ(inst["InstrumentName"][0].toStdString(), "TERRAIN CAMERA 1"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "TC1"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2007-12-15T00:00:10.156275"); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2007-12-15T00:00:40.413540"); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "881712007.432675"); - ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "881712037.68994"); + ASSERT_EQ(inst["MissionName"][0], "SELENE"); + ASSERT_EQ(inst["SpacecraftName"][0], "KAGUYA"); + ASSERT_EQ(inst["InstrumentName"][0], "TERRAIN CAMERA 1"); + ASSERT_EQ(inst["InstrumentId"][0], "TC1"); + ASSERT_EQ(inst["TargetName"][0], "MOON"); + ASSERT_EQ(inst["StartTime"][0], "2007-12-15T00:00:10.156275"); + ASSERT_EQ(inst["StopTime"][0], "2007-12-15T00:00:40.413540"); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "881712007.432675"); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0], "881712037.68994"); ASSERT_DOUBLE_EQ(inst["ExposureDuration"], 3.25); ASSERT_EQ(inst["ExposureDuration"].unit(), "ms"); ASSERT_DOUBLE_EQ(inst["LineSamplingInterval"], 6.499949); ASSERT_EQ(inst["LineSamplingInterval"].unit(), "ms"); - ASSERT_EQ(inst["IlluminationCondition"][0].toStdString(), "MORNING"); + ASSERT_EQ(inst["IlluminationCondition"][0], "MORNING"); // Archive Group PvlGroup &arch = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(arch["DataSetId"][0].toStdString(), "SLN-L-TC-3-SP-SUPPORT-LEVEL2B0-V1.0"); - ASSERT_EQ(arch["ImageValueType"][0].toStdString(), "RADIANCE"); + ASSERT_EQ(arch["DataSetId"][0], "SLN-L-TC-3-SP-SUPPORT-LEVEL2B0-V1.0"); + ASSERT_EQ(arch["ImageValueType"][0], "RADIANCE"); ASSERT_EQ(int(arch["SceneMaximumDn"]), 2534); ASSERT_EQ(int(arch["SceneMinimumDn"]), 0); ASSERT_DOUBLE_EQ(double(arch["SceneAverageDn"]), 405.4); diff --git a/isis/tests/FunctionalTestsKerneldbgen.cpp b/isis/tests/FunctionalTestsKerneldbgen.cpp index 59388aa08f..c83c5a34e2 100644 --- a/isis/tests/FunctionalTestsKerneldbgen.cpp +++ b/isis/tests/FunctionalTestsKerneldbgen.cpp @@ -29,27 +29,27 @@ TEST(Kerneldbgen, FunctionalTestKerneldbgenCk) { FAIL() << "Unable to generate kernel db: " << e.what() << std::endl; } - Pvl kerneldbPvl(options.GetFileName("TO")); + Pvl kerneldbPvl(options.GetFileName("TO").toStdString()); EXPECT_TRUE(kerneldbPvl.hasObject("SpacecraftPointing")); PvlObject &scPointing = kerneldbPvl.findObject("SpacecraftPointing"); PvlGroup depend = kerneldbPvl.findGroup("Dependencies", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, depend.findKeyword("SpacecraftClockKernel"), "$mro/kernels/sclk/MRO_SCLKSCET.00006.tsc"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, depend.findKeyword("LeapsecondKernel"), "$base/kernels/lsk/naif0008.tls"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, depend.findKeyword("SpacecraftClockKernel"), "$mro/kernels/sclk/MRO_SCLKSCET.00006.tsc"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, depend.findKeyword("LeapsecondKernel"), "$base/kernels/lsk/naif0008.tls"); PvlGroup select = scPointing.group(1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[0], "2005 DEC 13 00:01:04.662071 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[1], "2005 DEC 14 00:01:03.933358 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("File"), "data/kerneldbgen/mro_sc_2005-12-13.bc"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Type"), "Reconstructed"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[0], "2005 DEC 13 00:01:04.662071 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[1], "2005 DEC 14 00:01:03.933358 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("File"), "data/kerneldbgen/mro_sc_2005-12-13.bc"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Type"), "Reconstructed"); PvlGroup select2 = scPointing.group(2); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select2.findKeyword("Time")[0], "2005 DEC 15 00:01:04.290582 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select2.findKeyword("Time")[1], "2005 DEC 16 00:01:03.241556 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select2.findKeyword("File"), "data/kerneldbgen/mro_sc_2005-12-15.bc"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select2.findKeyword("Type"), "Reconstructed"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select2.findKeyword("Time")[0], "2005 DEC 15 00:01:04.290582 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select2.findKeyword("Time")[1], "2005 DEC 16 00:01:03.241556 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select2.findKeyword("File"), "data/kerneldbgen/mro_sc_2005-12-15.bc"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select2.findKeyword("Type"), "Reconstructed"); } /** @@ -88,13 +88,13 @@ TEST(Kerneldbgen, FunctionalTestKerneldbgenCoverageLevelDefault) { catch (IException &e) { FAIL() << "Unable to generate kernel db: " << e.what() << std::endl; } - Pvl kerneldbPvl(options.GetFileName("TO")); + Pvl kerneldbPvl(options.GetFileName("TO").toStdString()); EXPECT_TRUE(kerneldbPvl.hasObject("SpacecraftPointing")); PvlGroup select = kerneldbPvl.findGroup("Selection", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[0], "2017 MAR 01 23:02:49.287637 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[1], "2017 APR 01 00:01:04.267617 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[0], "2017 MAR 01 23:02:49.287637 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[1], "2017 APR 01 00:01:04.267617 TDB"); } @@ -116,91 +116,91 @@ TEST(Kerneldbgen, FunctionalTestKerneldbgenCoverageLevelInterval) { FAIL() << "Unable to generate kernel db: " << e.what() << std::endl; } - Pvl kerneldbPvl(options.GetFileName("TO")); + Pvl kerneldbPvl(options.GetFileName("TO").toStdString()); EXPECT_TRUE(kerneldbPvl.hasObject("SpacecraftPointing")); PvlGroup select = kerneldbPvl.findGroup("Selection", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[0][0], "2017 MAR 01 23:02:49.287637 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[0][1], "2017 MAR 01 23:02:53.287636 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[1][0], "2017 MAR 01 23:43:13.288601 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[1][1], "2017 MAR 01 23:43:49.288601 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[2][0], "2017 MAR 01 23:44:53.288599 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[2][1], "2017 MAR 01 23:44:53.288599 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[3][0], "2017 MAR 02 23:55:57.321517 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[3][1], "2017 MAR 03 00:01:05.321613 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[4][0], "2017 MAR 03 23:51:13.354049 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[4][1], "2017 MAR 04 00:01:05.454240 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[5][0], "2017 MAR 04 23:51:13.386676 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[5][1], "2017 MAR 05 00:01:05.486867 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[6][0], "2017 MAR 05 23:54:28.419399 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[6][1], "2017 MAR 06 00:01:08.419494 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[7][0], "2017 MAR 06 23:52:15.451927 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[7][1], "2017 MAR 07 00:01:07.452120 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[8][0], "2017 MAR 08 00:00:45.484745 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[8][1], "2017 MAR 08 00:01:05.484745 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[9][0], "2017 MAR 08 23:56:46.517274 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[9][1], "2017 MAR 09 00:01:06.517370 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[10][0], "2017 MAR 09 23:56:34.549899 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[10][1], "2017 MAR 10 00:01:06.549995 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[11][0], "2017 MAR 10 23:56:34.582523 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[11][1], "2017 MAR 11 00:01:06.582619 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[12][0], "2017 MAR 11 15:06:34.603116 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[12][1], "2017 MAR 11 15:12:38.603311 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[13][0], "2017 MAR 11 15:34:26.603792 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[13][1], "2017 MAR 11 15:34:26.603792 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[14][0], "2017 MAR 11 15:35:46.603791 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[14][1], "2017 MAR 11 15:35:50.603791 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[15][0], "2017 MAR 11 16:04:34.604465 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[15][1], "2017 MAR 11 16:04:34.604465 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[16][0], "2017 MAR 11 16:28:38.605044 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[16][1], "2017 MAR 11 16:31:26.605041 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[17][0], "2017 MAR 11 17:04:42.605812 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[17][1], "2017 MAR 11 17:04:42.605812 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[18][0], "2017 MAR 11 18:49:34.608219 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[18][1], "2017 MAR 11 18:49:54.608219 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[19][0], "2017 MAR 12 23:56:34.647770 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[19][1], "2017 MAR 13 00:01:06.647866 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[20][0], "2017 MAR 13 23:58:12.680491 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[20][1], "2017 MAR 14 00:01:08.680489 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[21][0], "2017 MAR 14 23:58:12.713114 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[21][1], "2017 MAR 15 00:01:08.713111 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[22][0], "2017 MAR 15 23:36:26.745155 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[22][1], "2017 MAR 15 23:46:14.745446 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[23][0], "2017 MAR 16 23:39:26.777874 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[23][1], "2017 MAR 16 23:41:14.777972 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[24][0], "2017 MAR 17 02:33:19.781819 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[24][1], "2017 MAR 17 02:42:43.782011 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[25][0], "2017 MAR 18 23:29:36.842924 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[25][1], "2017 MAR 18 23:31:00.842922 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[26][0], "2017 MAR 18 23:59:40.843597 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[26][1], "2017 MAR 19 00:01:08.843596 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[27][0], "2017 MAR 19 23:59:00.876218 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[27][1], "2017 MAR 20 00:01:08.876216 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[28][0], "2017 MAR 20 23:59:28.908837 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[28][1], "2017 MAR 21 00:01:08.908835 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[29][0], "2017 MAR 21 23:57:34.941357 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[29][1], "2017 MAR 22 00:01:06.941454 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[30][0], "2017 MAR 22 23:55:34.973978 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[30][1], "2017 MAR 23 00:01:06.974073 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[31][0], "2017 MAR 23 23:53:10.006498 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[31][1], "2017 MAR 24 00:01:06.006691 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[32][0], "2017 MAR 24 23:56:23.039212 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[32][1], "2017 MAR 25 00:01:07.039308 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[33][0], "2017 MAR 25 23:59:10.071927 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[33][1], "2017 MAR 26 00:01:06.071925 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[34][0], "2017 MAR 26 23:59:25.104543 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[34][1], "2017 MAR 27 00:01:05.104542 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[35][0], "2017 MAR 27 23:54:23.137064 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[35][1], "2017 MAR 28 00:01:07.137158 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[36][0], "2017 MAR 28 23:56:41.169677 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[36][1], "2017 MAR 29 00:01:05.169773 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[37][0], "2017 MAR 29 23:54:22.202295 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[37][1], "2017 MAR 30 00:01:06.202389 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[38][0], "2017 MAR 30 23:59:06.235005 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[38][1], "2017 MAR 31 00:01:06.235003 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[39][0], "2017 MAR 31 23:51:32.267426 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select[39][1], "2017 APR 01 00:01:04.267617 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[0][0], "2017 MAR 01 23:02:49.287637 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[0][1], "2017 MAR 01 23:02:53.287636 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[1][0], "2017 MAR 01 23:43:13.288601 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[1][1], "2017 MAR 01 23:43:49.288601 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[2][0], "2017 MAR 01 23:44:53.288599 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[2][1], "2017 MAR 01 23:44:53.288599 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[3][0], "2017 MAR 02 23:55:57.321517 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[3][1], "2017 MAR 03 00:01:05.321613 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[4][0], "2017 MAR 03 23:51:13.354049 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[4][1], "2017 MAR 04 00:01:05.454240 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[5][0], "2017 MAR 04 23:51:13.386676 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[5][1], "2017 MAR 05 00:01:05.486867 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[6][0], "2017 MAR 05 23:54:28.419399 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[6][1], "2017 MAR 06 00:01:08.419494 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[7][0], "2017 MAR 06 23:52:15.451927 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[7][1], "2017 MAR 07 00:01:07.452120 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[8][0], "2017 MAR 08 00:00:45.484745 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[8][1], "2017 MAR 08 00:01:05.484745 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[9][0], "2017 MAR 08 23:56:46.517274 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[9][1], "2017 MAR 09 00:01:06.517370 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[10][0], "2017 MAR 09 23:56:34.549899 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[10][1], "2017 MAR 10 00:01:06.549995 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[11][0], "2017 MAR 10 23:56:34.582523 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[11][1], "2017 MAR 11 00:01:06.582619 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[12][0], "2017 MAR 11 15:06:34.603116 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[12][1], "2017 MAR 11 15:12:38.603311 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[13][0], "2017 MAR 11 15:34:26.603792 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[13][1], "2017 MAR 11 15:34:26.603792 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[14][0], "2017 MAR 11 15:35:46.603791 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[14][1], "2017 MAR 11 15:35:50.603791 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[15][0], "2017 MAR 11 16:04:34.604465 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[15][1], "2017 MAR 11 16:04:34.604465 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[16][0], "2017 MAR 11 16:28:38.605044 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[16][1], "2017 MAR 11 16:31:26.605041 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[17][0], "2017 MAR 11 17:04:42.605812 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[17][1], "2017 MAR 11 17:04:42.605812 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[18][0], "2017 MAR 11 18:49:34.608219 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[18][1], "2017 MAR 11 18:49:54.608219 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[19][0], "2017 MAR 12 23:56:34.647770 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[19][1], "2017 MAR 13 00:01:06.647866 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[20][0], "2017 MAR 13 23:58:12.680491 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[20][1], "2017 MAR 14 00:01:08.680489 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[21][0], "2017 MAR 14 23:58:12.713114 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[21][1], "2017 MAR 15 00:01:08.713111 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[22][0], "2017 MAR 15 23:36:26.745155 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[22][1], "2017 MAR 15 23:46:14.745446 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[23][0], "2017 MAR 16 23:39:26.777874 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[23][1], "2017 MAR 16 23:41:14.777972 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[24][0], "2017 MAR 17 02:33:19.781819 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[24][1], "2017 MAR 17 02:42:43.782011 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[25][0], "2017 MAR 18 23:29:36.842924 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[25][1], "2017 MAR 18 23:31:00.842922 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[26][0], "2017 MAR 18 23:59:40.843597 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[26][1], "2017 MAR 19 00:01:08.843596 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[27][0], "2017 MAR 19 23:59:00.876218 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[27][1], "2017 MAR 20 00:01:08.876216 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[28][0], "2017 MAR 20 23:59:28.908837 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[28][1], "2017 MAR 21 00:01:08.908835 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[29][0], "2017 MAR 21 23:57:34.941357 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[29][1], "2017 MAR 22 00:01:06.941454 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[30][0], "2017 MAR 22 23:55:34.973978 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[30][1], "2017 MAR 23 00:01:06.974073 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[31][0], "2017 MAR 23 23:53:10.006498 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[31][1], "2017 MAR 24 00:01:06.006691 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[32][0], "2017 MAR 24 23:56:23.039212 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[32][1], "2017 MAR 25 00:01:07.039308 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[33][0], "2017 MAR 25 23:59:10.071927 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[33][1], "2017 MAR 26 00:01:06.071925 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[34][0], "2017 MAR 26 23:59:25.104543 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[34][1], "2017 MAR 27 00:01:05.104542 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[35][0], "2017 MAR 27 23:54:23.137064 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[35][1], "2017 MAR 28 00:01:07.137158 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[36][0], "2017 MAR 28 23:56:41.169677 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[36][1], "2017 MAR 29 00:01:05.169773 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[37][0], "2017 MAR 29 23:54:22.202295 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[37][1], "2017 MAR 30 00:01:06.202389 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[38][0], "2017 MAR 30 23:59:06.235005 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[38][1], "2017 MAR 31 00:01:06.235003 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[39][0], "2017 MAR 31 23:51:32.267426 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select[39][1], "2017 APR 01 00:01:04.267617 TDB"); } @@ -223,13 +223,13 @@ TEST(Kerneldbgen, FunctionalTestKerneldbgenExtraDefault) { FAIL() << "Unable to generate kernel db: " << e.what() << std::endl; } - Pvl kerneldbPvl(options.GetFileName("TO")); + Pvl kerneldbPvl(options.GetFileName("TO").toStdString()); EXPECT_TRUE(kerneldbPvl.hasObject("SpacecraftPointing")); PvlGroup depend = kerneldbPvl.findGroup("Dependencies", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, depend[2], "$mro/kernels/fk/mro_v15.tf"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, depend[3], "$mro/kernels/fk/mro_v16.tf"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, depend[2], "$mro/kernels/fk/mro_v15.tf"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, depend[3], "$mro/kernels/fk/mro_v16.tf"); } @@ -370,25 +370,25 @@ TEST(Kerneldbgen, FunctionalTestKerneldbgenSpk) { FAIL() << "Unable to generate kernel db: " << e.what() << std::endl; } - Pvl kerneldbPvl(options.GetFileName("TO")); + Pvl kerneldbPvl(options.GetFileName("TO").toStdString()); EXPECT_TRUE(kerneldbPvl.hasObject("SpacecraftPosition")); PvlObject &scPosition = kerneldbPvl.findObject("SpacecraftPosition"); PvlGroup depend = kerneldbPvl.findGroup("Dependencies", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, depend.findKeyword("LeapsecondKernel"), "$base/kernels/lsk/naif0008.tls"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, depend.findKeyword("LeapsecondKernel"), "$base/kernels/lsk/naif0008.tls"); PvlGroup select = scPosition.group(1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[0], "2009 FEB 04 23:51:59.498030 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[1], "2009 FEB 04 23:52:03.370910 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("File"), "data/kerneldbgen/M3G20090204T235053_V03_nadir-jig_2014-08-18.bsp"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Type"), "Reconstructed"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[0], "2009 FEB 04 23:51:59.498030 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[1], "2009 FEB 04 23:52:03.370910 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("File"), "data/kerneldbgen/M3G20090204T235053_V03_nadir-jig_2014-08-18.bsp"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Type"), "Reconstructed"); PvlGroup select2 = scPosition.group(2); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select2.findKeyword("Time")[0], "2009 JUL 30 20:51:02.374189 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select2.findKeyword("Time")[1], "2009 JUL 30 20:51:05.534750 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select2.findKeyword("File"), "data/kerneldbgen/M3G20090730T204955_V03_nadir-jig_2014-08-18.bsp"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select2.findKeyword("Type"), "Reconstructed"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select2.findKeyword("Time")[0], "2009 JUL 30 20:51:02.374189 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select2.findKeyword("Time")[1], "2009 JUL 30 20:51:05.534750 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select2.findKeyword("File"), "data/kerneldbgen/M3G20090730T204955_V03_nadir-jig_2014-08-18.bsp"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select2.findKeyword("Type"), "Reconstructed"); } @@ -409,16 +409,16 @@ TEST(Kerneldbgen, FunctionalTestKerneldbgenSmithedCkOffsets) { FAIL() << "Unable to generate kernel db: " << e.what() << std::endl; } - Pvl kerneldbPvl(options.GetFileName("TO")); + Pvl kerneldbPvl(options.GetFileName("TO").toStdString()); EXPECT_TRUE(kerneldbPvl.hasObject("SpacecraftPointing")); PvlGroup select = kerneldbPvl.findGroup("Selection", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[0], "2002 FEB 20 22:58:59.720231 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[1], "2002 FEB 20 22:59:11.726211 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Instrument"), "THEMIS_IR"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("EndOffset"), "169.442"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Type"), "Smithed"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[0], "2002 FEB 20 22:58:59.720231 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[1], "2002 FEB 20 22:59:11.726211 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Instrument"), "THEMIS_IR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("EndOffset"), "169.442"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Type"), "Smithed"); } @@ -438,15 +438,15 @@ TEST(Kerneldbgen, FunctionalTestKerneldbgenSmithedSpkOffsets) { FAIL() << "Unable to generate kernel db: " << e.what() << std::endl; } - Pvl kerneldbPvl(options.GetFileName("TO")); + Pvl kerneldbPvl(options.GetFileName("TO").toStdString()); EXPECT_TRUE(kerneldbPvl.hasObject("SpacecraftPosition")); PvlGroup select = kerneldbPvl.findGroup("Selection", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[0], "2002 FEB 20 22:59:01.701369 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Time")[1], "2002 FEB 20 22:59:09.296828 TDB"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Instrument"), "THEMIS_IR"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("StartOffset"), "0.263"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("EndOffset"), "171.871"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, select.findKeyword("Type"), "Smithed"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[0], "2002 FEB 20 22:59:01.701369 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Time")[1], "2002 FEB 20 22:59:09.296828 TDB"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Instrument"), "THEMIS_IR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("StartOffset"), "0.263"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("EndOffset"), "171.871"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, select.findKeyword("Type"), "Smithed"); } diff --git a/isis/tests/FunctionalTestsLeisa2isis.cpp b/isis/tests/FunctionalTestsLeisa2isis.cpp index 28216abea7..c93c55c6ee 100644 --- a/isis/tests/FunctionalTestsLeisa2isis.cpp +++ b/isis/tests/FunctionalTestsLeisa2isis.cpp @@ -36,30 +36,30 @@ TEST(Leisa2Isis, Leisa2IsisTestDefault) { // Pixels Group PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ(double(pixels["Base"]), 0.0); ASSERT_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "NEW HORIZONS"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "LEISA" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "EUROPA" ); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "1/0034931099:00000" ); + ASSERT_EQ(inst["SpacecraftName"][0], "NEW HORIZONS"); + ASSERT_EQ(inst["InstrumentId"][0], "LEISA" ); + ASSERT_EQ(inst["TargetName"][0], "EUROPA" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "1/0034931099:00000" ); ASSERT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.676); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2007-02-28T01:13:01.3882781" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2007-02-28T01:17:12.388278" ); + ASSERT_EQ(inst["StartTime"][0], "2007-02-28T01:13:01.3882781" ); + ASSERT_EQ(inst["StopTime"][0], "2007-02-28T01:17:12.388278" ); ASSERT_DOUBLE_EQ(double(inst["FrameRate"]), 1.47929); - ASSERT_EQ(inst["FrameRate"].unit().toStdString(), "Hz"); + ASSERT_EQ(inst["FrameRate"].unit(), "Hz"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); ASSERT_DOUBLE_EQ(double(archive["MidObservationTime"]), 225897372.0736388); - ASSERT_EQ(archive["MidObservationTime"].unit().toStdString(), "s past J2000"); + ASSERT_EQ(archive["MidObservationTime"].unit(), "s past J2000"); ASSERT_DOUBLE_EQ(double(archive["ObservationDuration"]), 251.0); - ASSERT_EQ(archive["Detector"][0].toStdString(), "LEISA" ); - ASSERT_EQ(archive["ScanType"][0].toStdString(), "LEISA" ); + ASSERT_EQ(archive["Detector"][0], "LEISA" ); + ASSERT_EQ(archive["ScanType"][0], "LEISA" ); // BandBin Group // Check size, first, 2 middle, and last values? Enough? @@ -68,25 +68,25 @@ TEST(Leisa2Isis, Leisa2IsisTestDefault) { ASSERT_EQ(bandbin["Width"].size(), 256); ASSERT_EQ(bandbin["OriginalBand"].size(), 256); - ASSERT_DOUBLE_EQ(bandbin["Center"][0].toDouble(), 2.4892); - ASSERT_DOUBLE_EQ(bandbin["Center"][64].toDouble(), 1.9784); - ASSERT_DOUBLE_EQ(bandbin["Center"][128].toDouble(), 1.572); - ASSERT_DOUBLE_EQ(bandbin["Center"][255].toDouble(), 2.0898); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][0]), 2.4892); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][64]), 1.9784); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][128]), 1.572); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][255]), 2.0898); - ASSERT_DOUBLE_EQ(bandbin["Width"][0].toDouble(), 0.011228); - ASSERT_DOUBLE_EQ(bandbin["Width"][64].toDouble(), 0.008924); - ASSERT_DOUBLE_EQ(bandbin["Width"][128].toDouble(), 0.007091); - ASSERT_DOUBLE_EQ(bandbin["Width"][255].toDouble(), 0.004915); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][0]), 0.011228); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][64]), 0.008924); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][128]), 0.007091); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][255]), 0.004915); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][0].toDouble(), 1); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][64].toDouble(), 65); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][128].toDouble(), 129); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][255].toDouble(), 256); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][0]), 1); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][64]), 65); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][128]), 129); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][255]), 256); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); ASSERT_EQ(int(kernel["NaifFrameCode"]), -98901); - ASSERT_EQ(kernel["NaifFrameCode"].unit().toStdString(), "SPICE ID"); + ASSERT_EQ(kernel["NaifFrameCode"].unit(), "SPICE ID"); Histogram *hist = cube.histogram(); @@ -138,16 +138,16 @@ TEST(Leisa2Isis, Leisa2IsisTestJan2015Format) { // Quality File Pixels Group PvlGroup &qualPixels = isisQualityLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(qualPixels["Type"][0].toStdString(), "SignedWord"); - ASSERT_EQ(qualPixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(qualPixels["Type"][0], "SignedWord"); + ASSERT_EQ(qualPixels["ByteOrder"][0], "Lsb"); ASSERT_EQ(double(qualPixels["Base"]), 0.0); ASSERT_EQ(double(qualPixels["Multiplier"]), 1.0); // Quality File Pixels Group PvlGroup &errPixels = isisErrLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(errPixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(errPixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(errPixels["Type"][0], "Real"); + ASSERT_EQ(errPixels["ByteOrder"][0], "Lsb"); ASSERT_EQ(double(errPixels["Base"]), 0.0); ASSERT_EQ(double(errPixels["Multiplier"]), 1.0); @@ -211,16 +211,16 @@ TEST(Leisa2Isis, Leisa2IsisTestCalib) { // Quality File Pixels Group PvlGroup &qualPixels = isisQualityLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(qualPixels["Type"][0].toStdString(), "SignedWord"); - ASSERT_EQ(qualPixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(qualPixels["Type"][0], "SignedWord"); + ASSERT_EQ(qualPixels["ByteOrder"][0], "Lsb"); ASSERT_EQ(double(qualPixels["Base"]), 0.0); ASSERT_EQ(double(qualPixels["Multiplier"]), 1.0); // Quality File Pixels Group PvlGroup &errPixels = isisErrLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(errPixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(errPixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(errPixels["Type"][0], "Real"); + ASSERT_EQ(errPixels["ByteOrder"][0], "Lsb"); ASSERT_EQ(double(errPixels["Base"]), 0.0); ASSERT_EQ(double(errPixels["Multiplier"]), 1.0); @@ -273,30 +273,30 @@ TEST(Leisa2Isis, Leisa2IsisTestRaw) { // Pixels Group PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "SignedWord"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ(double(pixels["Base"]), 0.0); ASSERT_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "NEW HORIZONS"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "LEISA" ); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "CALLISTO" ); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "1/0030594839:00000" ); + ASSERT_EQ(inst["SpacecraftName"][0], "NEW HORIZONS"); + ASSERT_EQ(inst["InstrumentId"][0], "LEISA" ); + ASSERT_EQ(inst["TargetName"][0], "CALLISTO" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "1/0030594839:00000" ); ASSERT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.131); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2007-01-08T20:42:01.3824425" ); - ASSERT_EQ(inst["StopTime"][0].toStdString(), "2007-01-08T20:42:42.3824425" ); + ASSERT_EQ(inst["StartTime"][0], "2007-01-08T20:42:01.3824425" ); + ASSERT_EQ(inst["StopTime"][0], "2007-01-08T20:42:42.3824425" ); ASSERT_DOUBLE_EQ(double(inst["FrameRate"]), 7.63359); - ASSERT_EQ(inst["FrameRate"].unit().toStdString(), "Hz"); + ASSERT_EQ(inst["FrameRate"].unit(), "Hz"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); ASSERT_DOUBLE_EQ(double(archive["MidObservationTime"]), 221561007.0665882); - ASSERT_EQ(archive["MidObservationTime"].unit().toStdString(), "s past J2000"); + ASSERT_EQ(archive["MidObservationTime"].unit(), "s past J2000"); ASSERT_DOUBLE_EQ(double(archive["ObservationDuration"]), 41.0); - ASSERT_EQ(archive["Detector"][0].toStdString(), "LEISA" ); - ASSERT_EQ(archive["ScanType"][0].toStdString(), "LEISA" ); + ASSERT_EQ(archive["Detector"][0], "LEISA" ); + ASSERT_EQ(archive["ScanType"][0], "LEISA" ); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -304,20 +304,20 @@ TEST(Leisa2Isis, Leisa2IsisTestRaw) { ASSERT_EQ(bandbin["Width"].size(), 256); ASSERT_EQ(bandbin["OriginalBand"].size(), 256); - ASSERT_DOUBLE_EQ(bandbin["Center"][0].toDouble(), 2.4892); - ASSERT_DOUBLE_EQ(bandbin["Center"][64].toDouble(), 1.9784); - ASSERT_DOUBLE_EQ(bandbin["Center"][128].toDouble(), 1.572); - ASSERT_DOUBLE_EQ(bandbin["Center"][255].toDouble(), 2.0898); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][0]), 2.4892); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][64]), 1.9784); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][128]), 1.572); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Center"][255]), 2.0898); - ASSERT_DOUBLE_EQ(bandbin["Width"][0].toDouble(), 0.011228); - ASSERT_DOUBLE_EQ(bandbin["Width"][64].toDouble(), 0.008924); - ASSERT_DOUBLE_EQ(bandbin["Width"][128].toDouble(), 0.007091); - ASSERT_DOUBLE_EQ(bandbin["Width"][255].toDouble(), 0.004915); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][0]), 0.011228); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][64]), 0.008924); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][128]), 0.007091); + ASSERT_DOUBLE_EQ(std::stod(bandbin["Width"][255]), 0.004915); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][0].toDouble(), 1); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][64].toDouble(), 65); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][128].toDouble(), 129); - ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][255].toDouble(), 256); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][0]), 1); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][64]), 65); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][128]), 129); + ASSERT_DOUBLE_EQ(std::stod(bandbin["OriginalBand"][255]), 256); } diff --git a/isis/tests/FunctionalTestsLo2isis.cpp b/isis/tests/FunctionalTestsLo2isis.cpp index 1bdcd3a599..c2b57a47d7 100644 --- a/isis/tests/FunctionalTestsLo2isis.cpp +++ b/isis/tests/FunctionalTestsLo2isis.cpp @@ -43,38 +43,38 @@ TEST(lo2isisTest, lo2isisTestDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 3"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "High Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-02-20T08:14:28.610"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 3"); + ASSERT_EQ(inst["InstrumentId"][0], "High Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-02-20T08:14:28.610"); ASSERT_DOUBLE_EQ(inst["FiducialCoordinateMicron"], 50); ASSERT_EQ(inst["FiducialCoordinateMicron"].unit(), "um"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 3133); - ASSERT_EQ(inst["FiducialID"][0].toStdString(), "1b"); - ASSERT_EQ(inst["FiducialID"][6].toStdString(), "73a"); - ASSERT_EQ(inst["FiducialID"][14].toStdString(), "144b"); - ASSERT_EQ(inst["FiducialID"][29].toStdString(), "283b"); + ASSERT_EQ(inst["FiducialID"][0], "1b"); + ASSERT_EQ(inst["FiducialID"][6], "73a"); + ASSERT_EQ(inst["FiducialID"][14], "144b"); + ASSERT_EQ(inst["FiducialID"][29], "283b"); - ASSERT_DOUBLE_EQ(inst["FiducialSamples"][0].toDouble(), 32162.0); - ASSERT_DOUBLE_EQ(inst["FiducialSamples"][6].toDouble(), 24295.0); - ASSERT_DOUBLE_EQ(inst["FiducialSamples"][14].toDouble(), 16593.0); - ASSERT_DOUBLE_EQ(inst["FiducialSamples"][29].toDouble(), 1248.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialSamples"][0]), 32162.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialSamples"][6]), 24295.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialSamples"][14]), 16593.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialSamples"][29]), 1248.0); - ASSERT_DOUBLE_EQ(inst["FiducialLines"][0].toDouble(), 8510.0); - ASSERT_DOUBLE_EQ(inst["FiducialLines"][6].toDouble(), 8504.0); - ASSERT_DOUBLE_EQ(inst["FiducialLines"][14].toDouble(), 584.0); - ASSERT_DOUBLE_EQ(inst["FiducialLines"][29].toDouble(), 8496.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialLines"][0]), 8510.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialLines"][6]), 8504.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialLines"][14]), 584.0); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialLines"][29]), 8496.0); - ASSERT_DOUBLE_EQ(inst["FiducialXCoordinates"][0].toDouble(), -108.168); - ASSERT_DOUBLE_EQ(inst["FiducialXCoordinates"][6].toDouble(), -53.474); - ASSERT_DOUBLE_EQ(inst["FiducialXCoordinates"][14].toDouble(), 0.122); - ASSERT_DOUBLE_EQ(inst["FiducialXCoordinates"][29].toDouble(), 106.844); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialXCoordinates"][0]), -108.168); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialXCoordinates"][6]), -53.474); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialXCoordinates"][14]), 0.122); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialXCoordinates"][29]), 106.844); - ASSERT_DOUBLE_EQ(inst["FiducialYCoordinates"][0].toDouble(), 27.476); - ASSERT_DOUBLE_EQ(inst["FiducialYCoordinates"][6].toDouble(), 27.5); - ASSERT_DOUBLE_EQ(inst["FiducialYCoordinates"][14].toDouble(), -27.493); - ASSERT_DOUBLE_EQ(inst["FiducialYCoordinates"][29].toDouble(), 27.479); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialYCoordinates"][0]), 27.476); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialYCoordinates"][6]), 27.5); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialYCoordinates"][14]), -27.493); + ASSERT_DOUBLE_EQ(std::stod(inst["FiducialYCoordinates"][29]), 27.479); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -117,10 +117,10 @@ TEST(lo2isisTest, lo2isisMirrored) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 4"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "High Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-05-23T07:12:45.810"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 4"); + ASSERT_EQ(inst["InstrumentId"][0], "High Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-05-23T07:12:45.810"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 4164); // Bandbin Group @@ -158,10 +158,10 @@ TEST(lo2isisTest, lo2isisMedToHi) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 3"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "Medium Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-02-17T21:09:27.610"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 3"); + ASSERT_EQ(inst["InstrumentId"][0], "Medium Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-02-17T21:09:27.610"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 3083); ASSERT_DOUBLE_EQ(inst["BoresightSample"], 5427.039); ASSERT_DOUBLE_EQ(inst["BoresightLine"], 4550.455); @@ -169,7 +169,7 @@ TEST(lo2isisTest, lo2isisMedToHi) { // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["FilterName"][0].toStdString(), "none"); + ASSERT_EQ(bandbin["FilterName"][0], "none"); ASSERT_EQ(bandbin["Center"][0], "1.0"); ASSERT_EQ(bandbin["OriginalBand"][0], "1"); @@ -202,16 +202,16 @@ TEST(lo2isisTest, lo2isisMed) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 3"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "Medium Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-02-17T21:09:27.610"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 3"); + ASSERT_EQ(inst["InstrumentId"][0], "Medium Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-02-17T21:09:27.610"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 3083); ASSERT_DOUBLE_EQ(inst["SubFrame"], 0); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["FilterName"][0].toStdString(), "none"); + ASSERT_EQ(bandbin["FilterName"][0], "none"); ASSERT_EQ(bandbin["Center"][0], "1.0"); ASSERT_EQ(bandbin["OriginalBand"][0], "1"); @@ -244,10 +244,10 @@ TEST(lo2isisTest, lo2isisReingest) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "Lunar Orbiter 3"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "High Resolution Camera"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "1967-02-20T08:14:28.610000"); + ASSERT_EQ(inst["SpacecraftName"][0], "Lunar Orbiter 3"); + ASSERT_EQ(inst["InstrumentId"][0], "High Resolution Camera"); + ASSERT_EQ(inst["TargetName"][0], "Moon"); + ASSERT_EQ(inst["StartTime"][0], "1967-02-20T08:14:28.610000"); ASSERT_DOUBLE_EQ(inst["FrameNumber"], 3133); ASSERT_DOUBLE_EQ(inst["SubFrame"], 2921); diff --git a/isis/tests/FunctionalTestsLorri2isis.cpp b/isis/tests/FunctionalTestsLorri2isis.cpp index 761781b593..31f1d1c606 100644 --- a/isis/tests/FunctionalTestsLorri2isis.cpp +++ b/isis/tests/FunctionalTestsLorri2isis.cpp @@ -36,30 +36,30 @@ TEST(Lorri2Isis, Lorri2IsisTestDefault) { // Pixels Group PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); - EXPECT_EQ(pixels["Type"][0].toStdString(), "Real"); - EXPECT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + EXPECT_EQ(pixels["Type"][0], "Real"); + EXPECT_EQ(pixels["ByteOrder"][0], "Lsb"); EXPECT_EQ(double(pixels["Base"]), 0.0); EXPECT_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "NEW HORIZONS"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "LORRI" ); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "IO" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2007-02-28T13:14:22.331"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "1/0034974379:47125"); + EXPECT_EQ(inst["SpacecraftName"][0], "NEW HORIZONS"); + EXPECT_EQ(inst["InstrumentId"][0], "LORRI" ); + EXPECT_EQ(inst["TargetName"][0], "IO" ); + EXPECT_EQ(inst["StartTime"][0], "2007-02-28T13:14:22.331"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "1/0034974379:47125"); EXPECT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.075); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["HighSpeedCompressionMode"][0].toStdString(), "LOSSLESS"); - EXPECT_EQ(archive["ObservationCompletionStatus"][0].toStdString(), "COMPLETE"); - EXPECT_EQ(archive["SequenceDescription"][0].toStdString(), "Jupiter shine"); + EXPECT_EQ(archive["HighSpeedCompressionMode"][0], "LOSSLESS"); + EXPECT_EQ(archive["ObservationCompletionStatus"][0], "COMPLETE"); + EXPECT_EQ(archive["SequenceDescription"][0], "Jupiter shine"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_DOUBLE_EQ(bandbin["Center"][0].toDouble(), 600); - EXPECT_DOUBLE_EQ(bandbin["Width"][0].toDouble(), 500); + EXPECT_DOUBLE_EQ(std::stod(bandbin["Center"][0]), 600); + EXPECT_DOUBLE_EQ(std::stod(bandbin["Width"][0]), 500); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -101,30 +101,30 @@ TEST(Lorri2Isis, Lorri2IsisTestRaw) { // Pixels Group PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); - EXPECT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - EXPECT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + EXPECT_EQ(pixels["Type"][0], "SignedWord"); + EXPECT_EQ(pixels["ByteOrder"][0], "Lsb"); EXPECT_EQ(double(pixels["Base"]), 0.0); EXPECT_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "NEW HORIZONS"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "LORRI" ); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "IO" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2007-03-02T11:18:01.329" ); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "1/0035140198:47025" ); + EXPECT_EQ(inst["SpacecraftName"][0], "NEW HORIZONS"); + EXPECT_EQ(inst["InstrumentId"][0], "LORRI" ); + EXPECT_EQ(inst["TargetName"][0], "IO" ); + EXPECT_EQ(inst["StartTime"][0], "2007-03-02T11:18:01.329" ); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "1/0035140198:47025" ); EXPECT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.079); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["HighSpeedCompressionMode"][0].toStdString(), "LOSSLESS"); - EXPECT_EQ(archive["ObservationCompletionStatus"][0].toStdString(), "COMPLETE" ); - EXPECT_EQ(archive["SequenceDescription"][0].toStdString(), "High phase monitoring" ); + EXPECT_EQ(archive["HighSpeedCompressionMode"][0], "LOSSLESS"); + EXPECT_EQ(archive["ObservationCompletionStatus"][0], "COMPLETE" ); + EXPECT_EQ(archive["SequenceDescription"][0], "High phase monitoring" ); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_DOUBLE_EQ(bandbin["Center"][0].toDouble(), 600); - EXPECT_DOUBLE_EQ(bandbin["Width"][0].toDouble(), 500); + EXPECT_DOUBLE_EQ(std::stod(bandbin["Center"][0]), 600); + EXPECT_DOUBLE_EQ(std::stod(bandbin["Width"][0]), 500); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -162,8 +162,8 @@ TEST(Lorri2Isis, Lorri2IsisTestRaw) { // Quality File Pixels Group PvlGroup &qualPixels = isisQualityLabel->findGroup("Pixels", Pvl::Traverse); - EXPECT_EQ(qualPixels["Type"][0].toStdString(), "SignedWord"); - EXPECT_EQ(qualPixels["ByteOrder"][0].toStdString(), "Lsb"); + EXPECT_EQ(qualPixels["Type"][0], "SignedWord"); + EXPECT_EQ(qualPixels["ByteOrder"][0], "Lsb"); EXPECT_EQ(double(qualPixels["Base"]), 32768.0); EXPECT_EQ(double(qualPixels["Multiplier"]), 1.0); @@ -175,8 +175,8 @@ TEST(Lorri2Isis, Lorri2IsisTestRaw) { // Error File Pixels Group PvlGroup &errPixels = isisErrLabel->findGroup("Pixels", Pvl::Traverse); - EXPECT_EQ(errPixels["Type"][0].toStdString(), "Real"); - EXPECT_EQ(errPixels["ByteOrder"][0].toStdString(), "Lsb"); + EXPECT_EQ(errPixels["Type"][0], "Real"); + EXPECT_EQ(errPixels["ByteOrder"][0], "Lsb"); EXPECT_EQ(double(errPixels["Base"]), 0.0); EXPECT_EQ(double(errPixels["Multiplier"]), 1.0); diff --git a/isis/tests/FunctionalTestsLronac2isis.cpp b/isis/tests/FunctionalTestsLronac2isis.cpp index c647dc1c44..84528ff165 100644 --- a/isis/tests/FunctionalTestsLronac2isis.cpp +++ b/isis/tests/FunctionalTestsLronac2isis.cpp @@ -48,21 +48,21 @@ TEST(Lronac2isisTests, Lro2isisNacLFull) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "NACL"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2009-11-29T14:51:21.968000"); - - EXPECT_EQ(inst["TemperatureSCS"][0].toStdString(), "3.88"); - EXPECT_EQ(inst["TemperatureFPA"][0].toStdString(), "17.73"); - EXPECT_EQ(inst["TemperatureFPGA"][0].toStdString(), "-12.94"); - EXPECT_EQ(inst["TemperatureTelescope"][0].toStdString(), "8.89"); - EXPECT_EQ(inst["SpatialSumming"][0].toStdString(), "1"); - - EXPECT_EQ(inst["TemperatureSCSRaw"][0].toStdString(), "2770"); - EXPECT_EQ(inst["TemperatureFPARaw"][0].toStdString(), "2115"); - EXPECT_EQ(inst["TemperatureFPGARaw"][0].toStdString(), "3440"); - EXPECT_EQ(inst["TemperatureTelescopeRaw"][0].toStdString(), "2536"); + EXPECT_EQ(inst["SpacecraftName"][0], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "NACL"); + EXPECT_EQ(inst["TargetName"][0], "MOON"); + EXPECT_EQ(inst["StartTime"][0], "2009-11-29T14:51:21.968000"); + + EXPECT_EQ(inst["TemperatureSCS"][0], "3.88"); + EXPECT_EQ(inst["TemperatureFPA"][0], "17.73"); + EXPECT_EQ(inst["TemperatureFPGA"][0], "-12.94"); + EXPECT_EQ(inst["TemperatureTelescope"][0], "8.89"); + EXPECT_EQ(inst["SpatialSumming"][0], "1"); + + EXPECT_EQ(inst["TemperatureSCSRaw"][0], "2770"); + EXPECT_EQ(inst["TemperatureFPARaw"][0], "2115"); + EXPECT_EQ(inst["TemperatureFPGARaw"][0], "3440"); + EXPECT_EQ(inst["TemperatureTelescopeRaw"][0], "2536"); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -114,21 +114,21 @@ TEST(Lronac2isisTests, Lro2isisNacR) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "NACR"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MOON"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2009-11-29T14:51:21.968000"); - - EXPECT_EQ(inst["TemperatureSCS"][0].toStdString(), "3.88"); - EXPECT_EQ(inst["TemperatureFPA"][0].toStdString(), "17.67"); - EXPECT_EQ(inst["TemperatureFPGA"][0].toStdString(), "-11.38"); - EXPECT_EQ(inst["TemperatureTelescope"][0].toStdString(), "11.14"); - EXPECT_EQ(inst["SpatialSumming"][0].toStdString(), "1"); - - EXPECT_EQ(inst["TemperatureSCSRaw"][0].toStdString(), "2770"); - EXPECT_EQ(inst["TemperatureFPARaw"][0].toStdString(), "2118"); - EXPECT_EQ(inst["TemperatureFPGARaw"][0].toStdString(), "3388"); - EXPECT_EQ(inst["TemperatureTelescopeRaw"][0].toStdString(), "2429"); + EXPECT_EQ(inst["SpacecraftName"][0], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "NACR"); + EXPECT_EQ(inst["TargetName"][0], "MOON"); + EXPECT_EQ(inst["StartTime"][0], "2009-11-29T14:51:21.968000"); + + EXPECT_EQ(inst["TemperatureSCS"][0], "3.88"); + EXPECT_EQ(inst["TemperatureFPA"][0], "17.67"); + EXPECT_EQ(inst["TemperatureFPGA"][0], "-11.38"); + EXPECT_EQ(inst["TemperatureTelescope"][0], "11.14"); + EXPECT_EQ(inst["SpatialSumming"][0], "1"); + + EXPECT_EQ(inst["TemperatureSCSRaw"][0], "2770"); + EXPECT_EQ(inst["TemperatureFPARaw"][0], "2118"); + EXPECT_EQ(inst["TemperatureFPGARaw"][0], "3388"); + EXPECT_EQ(inst["TemperatureTelescopeRaw"][0], "2429"); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -157,7 +157,7 @@ TEST(Lronac2isisTests, Lro2isisLabelFail) { Pvl lab("data/lronac/nacr.img"); PvlKeyword &bterm = lab.findKeyword("LRO:BTERM"); bterm.setValue("fake"); - lab.write(badLabelPath); + lab.write(badLabelPath.toStdString()); QString cubeFileName = prefix.path() + "/doesntMatter.cub"; QVector args = {"from="+badLabelPath, "to="+cubeFileName}; diff --git a/isis/tests/FunctionalTestsLronac2pds.cpp b/isis/tests/FunctionalTestsLronac2pds.cpp index 2e020d6fb3..528809c98d 100644 --- a/isis/tests/FunctionalTestsLronac2pds.cpp +++ b/isis/tests/FunctionalTestsLronac2pds.cpp @@ -24,26 +24,26 @@ TEST_F(ObservationPair, FunctionalTestLronac2pdsIof) { lronac2pds(options); - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); - EXPECT_EQ(QString(outputLabel["FILE_RECORDS"]), "104449"); - EXPECT_EQ(QString(outputLabel["DATA_SET_ID"]), "LRO-L-LROC-3-CDR-V1.0"); - EXPECT_EQ(QString(outputLabel["PRODUCT_ID"]), "M102128467LC"); - EXPECT_EQ(QString(outputLabel["PRODUCT_TYPE"]), "CDR"); - EXPECT_EQ(QString(outputLabel["PRODUCT_VERSION_ID"]), "N/A"); + EXPECT_EQ((std::string)outputLabel["FILE_RECORDS"], "104449"); + EXPECT_EQ((std::string)outputLabel["DATA_SET_ID"], "LRO-L-LROC-3-CDR-V1.0"); + EXPECT_EQ((std::string)outputLabel["PRODUCT_ID"], "M102128467LC"); + EXPECT_EQ((std::string)outputLabel["PRODUCT_TYPE"], "CDR"); + EXPECT_EQ((std::string)outputLabel["PRODUCT_VERSION_ID"], "N/A"); EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 16); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "LSB_INTEGER"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "LSB_INTEGER"); EXPECT_DOUBLE_EQ(double(imageObject["SCALING_FACTOR"]), 3.0518509475997199e-05); - EXPECT_EQ(QString(imageObject["VALID_MINIMUM"]), "-32752"); - EXPECT_EQ(QString(imageObject["NULL"]), "-32768"); - EXPECT_EQ(QString(imageObject["LOW_REPR_SATURATION"]), "-32767"); - EXPECT_EQ(QString(imageObject["LOW_INSTR_SATURATION"]), "-32766"); - EXPECT_EQ(QString(imageObject["HIGH_INSTR_SATURATION"]), "-32765"); - EXPECT_EQ(QString(imageObject["HIGH_REPR_SATURATION"]), "-32764"); - EXPECT_EQ(QString(imageObject["UNIT"]), "Scaled I/F"); - EXPECT_EQ(QString(imageObject["MD5_CHECKSUM"]), "5f5d7bc236f794ca651cebdde529f8a4"); + EXPECT_EQ((std::string)imageObject["VALID_MINIMUM"], "-32752"); + EXPECT_EQ((std::string)imageObject["NULL"], "-32768"); + EXPECT_EQ((std::string)imageObject["LOW_REPR_SATURATION"], "-32767"); + EXPECT_EQ((std::string)imageObject["LOW_INSTR_SATURATION"], "-32766"); + EXPECT_EQ((std::string)imageObject["HIGH_INSTR_SATURATION"], "-32765"); + EXPECT_EQ((std::string)imageObject["HIGH_REPR_SATURATION"], "-32764"); + EXPECT_EQ((std::string)imageObject["UNIT"], "Scaled I/F"); + EXPECT_EQ((std::string)imageObject["MD5_CHECKSUM"], "5f5d7bc236f794ca651cebdde529f8a4"); } TEST_F(ObservationPair, FunctionalTestLronac2pdsRadiance) { @@ -57,23 +57,23 @@ TEST_F(ObservationPair, FunctionalTestLronac2pdsRadiance) { lronac2pds(options); - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); - EXPECT_EQ(QString(outputLabel["FILE_RECORDS"]), "208897"); - EXPECT_EQ(QString(outputLabel["DATA_SET_ID"]), "LRO-L-LROC-3-CDR-V1.0"); - EXPECT_EQ(QString(outputLabel["PRODUCT_ID"]), "M102128467LC"); - EXPECT_EQ(QString(outputLabel["PRODUCT_TYPE"]), "CDR"); - EXPECT_EQ(QString(outputLabel["PRODUCT_VERSION_ID"]), "N/A"); + EXPECT_EQ((std::string)outputLabel["FILE_RECORDS"], "208897"); + EXPECT_EQ((std::string)outputLabel["DATA_SET_ID"], "LRO-L-LROC-3-CDR-V1.0"); + EXPECT_EQ((std::string)outputLabel["PRODUCT_ID"], "M102128467LC"); + EXPECT_EQ((std::string)outputLabel["PRODUCT_TYPE"], "CDR"); + EXPECT_EQ((std::string)outputLabel["PRODUCT_VERSION_ID"], "N/A"); EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 32); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "PC_REAL"); - EXPECT_EQ(QString(imageObject["VALID_MINIMUM"]), "16#FF7FFFFA#"); - EXPECT_EQ(QString(imageObject["NULL"]), "16#FF7FFFFB#"); - EXPECT_EQ(QString(imageObject["LOW_REPR_SATURATION"]), "16#FF7FFFFC#"); - EXPECT_EQ(QString(imageObject["LOW_INSTR_SATURATION"]), "16#FF7FFFFD#"); - EXPECT_EQ(QString(imageObject["HIGH_INSTR_SATURATION"]), "16#FF7FFFFE#"); - EXPECT_EQ(QString(imageObject["HIGH_REPR_SATURATION"]), "16#FF7FFFFF#"); - EXPECT_EQ(QString(imageObject["UNIT"]), "W / (m**2 micrometer sr)"); - EXPECT_EQ(QString(imageObject["MD5_CHECKSUM"]), "b51ea10347da242b4a5f8a25c21026f6"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "PC_REAL"); + EXPECT_EQ((std::string)imageObject["VALID_MINIMUM"], "16#FF7FFFFA#"); + EXPECT_EQ((std::string)imageObject["NULL"], "16#FF7FFFFB#"); + EXPECT_EQ((std::string)imageObject["LOW_REPR_SATURATION"], "16#FF7FFFFC#"); + EXPECT_EQ((std::string)imageObject["LOW_INSTR_SATURATION"], "16#FF7FFFFD#"); + EXPECT_EQ((std::string)imageObject["HIGH_INSTR_SATURATION"], "16#FF7FFFFE#"); + EXPECT_EQ((std::string)imageObject["HIGH_REPR_SATURATION"], "16#FF7FFFFF#"); + EXPECT_EQ((std::string)imageObject["UNIT"], "W / (m**2 micrometer sr)"); + EXPECT_EQ((std::string)imageObject["MD5_CHECKSUM"], "b51ea10347da242b4a5f8a25c21026f6"); } diff --git a/isis/tests/FunctionalTestsLrowac2isis.cpp b/isis/tests/FunctionalTestsLrowac2isis.cpp index 36f6093744..9577ef9572 100644 --- a/isis/tests/FunctionalTestsLrowac2isis.cpp +++ b/isis/tests/FunctionalTestsLrowac2isis.cpp @@ -46,34 +46,34 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisDefault) { // Instrument Group PvlGroup &uvEvenInst = uvEvenLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(uvEvenInst["SpacecraftName"][0].toStdString(), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(uvEvenInst["InstrumentId"][0].toStdString(), "WAC-UV"); - EXPECT_EQ(uvEvenInst["TargetName"][0].toStdString(), "Moon"); - EXPECT_EQ(uvEvenInst["StartTime"][0].toStdString(), "2009-09-15T07:27:49.230000"); - EXPECT_EQ(uvEvenInst["StopTime"][0].toStdString(), "2009-09-15T07:30:19.542000"); - EXPECT_EQ(uvEvenInst["MissionPhaseName"][0].toStdString(), "COMMISSIONING"); - EXPECT_EQ(uvEvenInst["BeginTemperatureFpa"][0].toDouble(), -1.66529297828674); - EXPECT_EQ(uvEvenInst["MiddleTemperatureFpa"][0].toDouble(), -1.12489998340607); - EXPECT_EQ(uvEvenInst["EndTemperatureFpa"][0].toDouble(), -0.669131994247437); - EXPECT_EQ(uvEvenInst["BeginTemperatureScs"][0].toDouble(), 10.8307619094849); - EXPECT_EQ(uvEvenInst["MiddleTemperatureScs"][0].toDouble(), 10.914568901062); - EXPECT_EQ(uvEvenInst["EndTemperatureScs"][0].toDouble(), 10.9736194610596); - EXPECT_EQ(uvEvenInst["Mode"][0].toStdString(), "0"); - EXPECT_EQ(uvEvenInst["DataFlipped"][0].toStdString(), "No"); - EXPECT_EQ(uvEvenInst["ColorOffset"][0].toStdString(), "0"); - EXPECT_EQ(uvEvenInst["Decompanded"][0].toStdString(), "Yes"); - EXPECT_EQ(uvEvenInst["Framelets"][0].toStdString(), "Even"); - EXPECT_EQ(uvEvenInst["NumFramelets"][0].toStdString(), "1"); - EXPECT_EQ(uvEvenInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(uvEvenInst["SpacecraftName"][0], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ(uvEvenInst["InstrumentId"][0], "WAC-UV"); + EXPECT_EQ(uvEvenInst["TargetName"][0], "Moon"); + EXPECT_EQ(uvEvenInst["StartTime"][0], "2009-09-15T07:27:49.230000"); + EXPECT_EQ(uvEvenInst["StopTime"][0], "2009-09-15T07:30:19.542000"); + EXPECT_EQ(uvEvenInst["MissionPhaseName"][0], "COMMISSIONING"); + EXPECT_EQ(std::stod(uvEvenInst["BeginTemperatureFpa"][0]), -1.66529297828674); + EXPECT_EQ(std::stod(uvEvenInst["MiddleTemperatureFpa"][0]), -1.12489998340607); + EXPECT_EQ(std::stod(uvEvenInst["EndTemperatureFpa"][0]), -0.669131994247437); + EXPECT_EQ(std::stod(uvEvenInst["BeginTemperatureScs"][0]), 10.8307619094849); + EXPECT_EQ(std::stod(uvEvenInst["MiddleTemperatureScs"][0]), 10.914568901062); + EXPECT_EQ(std::stod(uvEvenInst["EndTemperatureScs"][0]), 10.9736194610596); + EXPECT_EQ(uvEvenInst["Mode"][0], "0"); + EXPECT_EQ(uvEvenInst["DataFlipped"][0], "No"); + EXPECT_EQ(uvEvenInst["ColorOffset"][0], "0"); + EXPECT_EQ(uvEvenInst["Decompanded"][0], "Yes"); + EXPECT_EQ(uvEvenInst["Framelets"][0], "Even"); + EXPECT_EQ(uvEvenInst["NumFramelets"][0], "1"); + EXPECT_EQ(uvEvenInst["InstrumentModeId"][0], "COLOR"); // Bandbin Group PvlGroup &uvEvenBandbin = uvEvenLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(uvEvenBandbin["FilterNumber"][0].toStdString(), "1"); - EXPECT_EQ(uvEvenBandbin["FilterNumber"][1].toStdString(), "2"); - EXPECT_EQ(uvEvenBandbin["Center"][0].toStdString(), "321"); - EXPECT_EQ(uvEvenBandbin["Center"][1].toStdString(), "360"); - EXPECT_EQ(uvEvenBandbin["Width"][0].toStdString(), "32"); - EXPECT_EQ(uvEvenBandbin["Width"][1].toStdString(), "15"); + EXPECT_EQ(uvEvenBandbin["FilterNumber"][0], "1"); + EXPECT_EQ(uvEvenBandbin["FilterNumber"][1], "2"); + EXPECT_EQ(uvEvenBandbin["Center"][0], "321"); + EXPECT_EQ(uvEvenBandbin["Center"][1], "360"); + EXPECT_EQ(uvEvenBandbin["Width"][0], "32"); + EXPECT_EQ(uvEvenBandbin["Width"][1], "15"); std::unique_ptr uvEvenHist (uvEvenCube.histogram()); @@ -100,34 +100,34 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisDefault) { // Instrument Group PvlGroup &uvOddInst = uvOddLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(uvOddInst["SpacecraftName"][0].toStdString(), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(uvOddInst["InstrumentId"][0].toStdString(), "WAC-UV"); - EXPECT_EQ(uvOddInst["TargetName"][0].toStdString(), "Moon"); - EXPECT_EQ(uvOddInst["StartTime"][0].toStdString(), "2009-09-15T07:27:49.230000"); - EXPECT_EQ(uvOddInst["StopTime"][0].toStdString(), "2009-09-15T07:30:19.542000"); - EXPECT_EQ(uvOddInst["MissionPhaseName"][0].toStdString(), "COMMISSIONING"); - EXPECT_EQ(uvOddInst["BeginTemperatureFpa"][0].toDouble(), -1.66529297828674); - EXPECT_EQ(uvOddInst["MiddleTemperatureFpa"][0].toDouble(), -1.12489998340607); - EXPECT_EQ(uvOddInst["EndTemperatureFpa"][0].toDouble(), -0.669131994247437); - EXPECT_EQ(uvOddInst["BeginTemperatureScs"][0].toDouble(), 10.8307619094849); - EXPECT_EQ(uvOddInst["MiddleTemperatureScs"][0].toDouble(), 10.914568901062); - EXPECT_EQ(uvOddInst["EndTemperatureScs"][0].toDouble(), 10.9736194610596); - EXPECT_EQ(uvOddInst["Mode"][0].toStdString(), "0"); - EXPECT_EQ(uvOddInst["DataFlipped"][0].toStdString(), "No"); - EXPECT_EQ(uvOddInst["ColorOffset"][0].toStdString(), "0"); - EXPECT_EQ(uvOddInst["Decompanded"][0].toStdString(), "Yes"); - EXPECT_EQ(uvOddInst["Framelets"][0].toStdString(), "Odd"); - EXPECT_EQ(uvOddInst["NumFramelets"][0].toStdString(), "1"); - EXPECT_EQ(uvOddInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(uvOddInst["SpacecraftName"][0], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ(uvOddInst["InstrumentId"][0], "WAC-UV"); + EXPECT_EQ(uvOddInst["TargetName"][0], "Moon"); + EXPECT_EQ(uvOddInst["StartTime"][0], "2009-09-15T07:27:49.230000"); + EXPECT_EQ(uvOddInst["StopTime"][0], "2009-09-15T07:30:19.542000"); + EXPECT_EQ(uvOddInst["MissionPhaseName"][0], "COMMISSIONING"); + EXPECT_EQ(std::stod(uvOddInst["BeginTemperatureFpa"][0]), -1.66529297828674); + EXPECT_EQ(std::stod(uvOddInst["MiddleTemperatureFpa"][0]), -1.12489998340607); + EXPECT_EQ(std::stod(uvOddInst["EndTemperatureFpa"][0]), -0.669131994247437); + EXPECT_EQ(std::stod(uvOddInst["BeginTemperatureScs"][0]), 10.8307619094849); + EXPECT_EQ(std::stod(uvOddInst["MiddleTemperatureScs"][0]), 10.914568901062); + EXPECT_EQ(std::stod(uvOddInst["EndTemperatureScs"][0]), 10.9736194610596); + EXPECT_EQ(uvOddInst["Mode"][0], "0"); + EXPECT_EQ(uvOddInst["DataFlipped"][0], "No"); + EXPECT_EQ(uvOddInst["ColorOffset"][0], "0"); + EXPECT_EQ(uvOddInst["Decompanded"][0], "Yes"); + EXPECT_EQ(uvOddInst["Framelets"][0], "Odd"); + EXPECT_EQ(uvOddInst["NumFramelets"][0], "1"); + EXPECT_EQ(uvOddInst["InstrumentModeId"][0], "COLOR"); // Bandbin Group PvlGroup &uvOddBandbin = uvOddLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(uvOddBandbin["FilterNumber"][0].toStdString(), "1"); - EXPECT_EQ(uvOddBandbin["FilterNumber"][1].toStdString(), "2"); - EXPECT_EQ(uvOddBandbin["Center"][0].toStdString(), "321"); - EXPECT_EQ(uvOddBandbin["Center"][1].toStdString(), "360"); - EXPECT_EQ(uvOddBandbin["Width"][0].toStdString(), "32"); - EXPECT_EQ(uvOddBandbin["Width"][1].toStdString(), "15"); + EXPECT_EQ(uvOddBandbin["FilterNumber"][0], "1"); + EXPECT_EQ(uvOddBandbin["FilterNumber"][1], "2"); + EXPECT_EQ(uvOddBandbin["Center"][0], "321"); + EXPECT_EQ(uvOddBandbin["Center"][1], "360"); + EXPECT_EQ(uvOddBandbin["Width"][0], "32"); + EXPECT_EQ(uvOddBandbin["Width"][1], "15"); std::unique_ptr uvOddHist (uvOddCube.histogram()); @@ -154,34 +154,34 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisDefault) { // Instrument Group PvlGroup &visEvenInst = visEvenLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(visEvenInst["SpacecraftName"][0].toStdString(), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(visEvenInst["InstrumentId"][0].toStdString(), "WAC-VIS"); - EXPECT_EQ(visEvenInst["TargetName"][0].toStdString(), "Moon"); - EXPECT_EQ(visEvenInst["StartTime"][0].toStdString(), "2009-09-15T07:27:49.230000"); - EXPECT_EQ(visEvenInst["StopTime"][0].toStdString(), "2009-09-15T07:30:19.542000"); - EXPECT_EQ(visEvenInst["MissionPhaseName"][0].toStdString(), "COMMISSIONING"); - EXPECT_EQ(visEvenInst["BeginTemperatureFpa"][0].toDouble(), -1.66529297828674); - EXPECT_EQ(visEvenInst["MiddleTemperatureFpa"][0].toDouble(), -1.12489998340607); - EXPECT_EQ(visEvenInst["EndTemperatureFpa"][0].toDouble(), -0.669131994247437); - EXPECT_EQ(visEvenInst["BeginTemperatureScs"][0].toDouble(), 10.8307619094849); - EXPECT_EQ(visEvenInst["MiddleTemperatureScs"][0].toDouble(), 10.914568901062); - EXPECT_EQ(visEvenInst["EndTemperatureScs"][0].toDouble(), 10.9736194610596); - EXPECT_EQ(visEvenInst["Mode"][0].toStdString(), "0"); - EXPECT_EQ(visEvenInst["DataFlipped"][0].toStdString(), "No"); - EXPECT_EQ(visEvenInst["ColorOffset"][0].toStdString(), "0"); - EXPECT_EQ(visEvenInst["Decompanded"][0].toStdString(), "Yes"); - EXPECT_EQ(visEvenInst["Framelets"][0].toStdString(), "Even"); - EXPECT_EQ(visEvenInst["NumFramelets"][0].toStdString(), "1"); - EXPECT_EQ(visEvenInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(visEvenInst["SpacecraftName"][0], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ(visEvenInst["InstrumentId"][0], "WAC-VIS"); + EXPECT_EQ(visEvenInst["TargetName"][0], "Moon"); + EXPECT_EQ(visEvenInst["StartTime"][0], "2009-09-15T07:27:49.230000"); + EXPECT_EQ(visEvenInst["StopTime"][0], "2009-09-15T07:30:19.542000"); + EXPECT_EQ(visEvenInst["MissionPhaseName"][0], "COMMISSIONING"); + EXPECT_EQ(std::stod(visEvenInst["BeginTemperatureFpa"][0]), -1.66529297828674); + EXPECT_EQ(std::stod(visEvenInst["MiddleTemperatureFpa"][0]), -1.12489998340607); + EXPECT_EQ(std::stod(visEvenInst["EndTemperatureFpa"][0]), -0.669131994247437); + EXPECT_EQ(std::stod(visEvenInst["BeginTemperatureScs"][0]), 10.8307619094849); + EXPECT_EQ(std::stod(visEvenInst["MiddleTemperatureScs"][0]), 10.914568901062); + EXPECT_EQ(std::stod(visEvenInst["EndTemperatureScs"][0]), 10.9736194610596); + EXPECT_EQ(visEvenInst["Mode"][0], "0"); + EXPECT_EQ(visEvenInst["DataFlipped"][0], "No"); + EXPECT_EQ(visEvenInst["ColorOffset"][0], "0"); + EXPECT_EQ(visEvenInst["Decompanded"][0], "Yes"); + EXPECT_EQ(visEvenInst["Framelets"][0], "Even"); + EXPECT_EQ(visEvenInst["NumFramelets"][0], "1"); + EXPECT_EQ(visEvenInst["InstrumentModeId"][0], "COLOR"); // Bandbin Group PvlGroup &visEvenBandbin = visEvenLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(visEvenBandbin["FilterNumber"][0].toStdString(), "3"); - EXPECT_EQ(visEvenBandbin["FilterNumber"][1].toStdString(), "4"); - EXPECT_EQ(visEvenBandbin["Center"][0].toStdString(), "415"); - EXPECT_EQ(visEvenBandbin["Center"][1].toStdString(), "566"); - EXPECT_EQ(visEvenBandbin["Width"][0].toStdString(), "36"); - EXPECT_EQ(visEvenBandbin["Width"][1].toStdString(), "20"); + EXPECT_EQ(visEvenBandbin["FilterNumber"][0], "3"); + EXPECT_EQ(visEvenBandbin["FilterNumber"][1], "4"); + EXPECT_EQ(visEvenBandbin["Center"][0], "415"); + EXPECT_EQ(visEvenBandbin["Center"][1], "566"); + EXPECT_EQ(visEvenBandbin["Width"][0], "36"); + EXPECT_EQ(visEvenBandbin["Width"][1], "20"); std::unique_ptr visEvenHist (visEvenCube.histogram()); @@ -208,34 +208,34 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisDefault) { // Instrument Group PvlGroup &visOddInst = visOddLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(visOddInst["SpacecraftName"][0].toStdString(), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(visOddInst["InstrumentId"][0].toStdString(), "WAC-VIS"); - EXPECT_EQ(visOddInst["TargetName"][0].toStdString(), "Moon"); - EXPECT_EQ(visOddInst["StartTime"][0].toStdString(), "2009-09-15T07:27:49.230000"); - EXPECT_EQ(visOddInst["StopTime"][0].toStdString(), "2009-09-15T07:30:19.542000"); - EXPECT_EQ(visOddInst["MissionPhaseName"][0].toStdString(), "COMMISSIONING"); - EXPECT_EQ(visOddInst["BeginTemperatureFpa"][0].toDouble(), -1.66529297828674); - EXPECT_EQ(visOddInst["MiddleTemperatureFpa"][0].toDouble(), -1.12489998340607); - EXPECT_EQ(visOddInst["EndTemperatureFpa"][0].toDouble(), -0.669131994247437); - EXPECT_EQ(visOddInst["BeginTemperatureScs"][0].toDouble(), 10.8307619094849); - EXPECT_EQ(visOddInst["MiddleTemperatureScs"][0].toDouble(), 10.914568901062); - EXPECT_EQ(visOddInst["EndTemperatureScs"][0].toDouble(), 10.9736194610596); - EXPECT_EQ(visOddInst["Mode"][0].toStdString(), "0"); - EXPECT_EQ(visOddInst["DataFlipped"][0].toStdString(), "No"); - EXPECT_EQ(visOddInst["ColorOffset"][0].toStdString(), "0"); - EXPECT_EQ(visOddInst["Decompanded"][0].toStdString(), "Yes"); - EXPECT_EQ(visOddInst["Framelets"][0].toStdString(), "Odd"); - EXPECT_EQ(visOddInst["NumFramelets"][0].toStdString(), "1"); - EXPECT_EQ(visOddInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(visOddInst["SpacecraftName"][0], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ(visOddInst["InstrumentId"][0], "WAC-VIS"); + EXPECT_EQ(visOddInst["TargetName"][0], "Moon"); + EXPECT_EQ(visOddInst["StartTime"][0], "2009-09-15T07:27:49.230000"); + EXPECT_EQ(visOddInst["StopTime"][0], "2009-09-15T07:30:19.542000"); + EXPECT_EQ(visOddInst["MissionPhaseName"][0], "COMMISSIONING"); + EXPECT_EQ(std::stod(visOddInst["BeginTemperatureFpa"][0]), -1.66529297828674); + EXPECT_EQ(std::stod(visOddInst["MiddleTemperatureFpa"][0]), -1.12489998340607); + EXPECT_EQ(std::stod(visOddInst["EndTemperatureFpa"][0]), -0.669131994247437); + EXPECT_EQ(std::stod(visOddInst["BeginTemperatureScs"][0]), 10.8307619094849); + EXPECT_EQ(std::stod(visOddInst["MiddleTemperatureScs"][0]), 10.914568901062); + EXPECT_EQ(std::stod(visOddInst["EndTemperatureScs"][0]), 10.9736194610596); + EXPECT_EQ(visOddInst["Mode"][0], "0"); + EXPECT_EQ(visOddInst["DataFlipped"][0], "No"); + EXPECT_EQ(visOddInst["ColorOffset"][0], "0"); + EXPECT_EQ(visOddInst["Decompanded"][0], "Yes"); + EXPECT_EQ(visOddInst["Framelets"][0], "Odd"); + EXPECT_EQ(visOddInst["NumFramelets"][0], "1"); + EXPECT_EQ(visOddInst["InstrumentModeId"][0], "COLOR"); // Bandbin Group PvlGroup &visOddBandbin = visOddLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(visOddBandbin["FilterNumber"][0].toStdString(), "3"); - EXPECT_EQ(visOddBandbin["FilterNumber"][1].toStdString(), "4"); - EXPECT_EQ(visOddBandbin["Center"][0].toStdString(), "415"); - EXPECT_EQ(visOddBandbin["Center"][1].toStdString(), "566"); - EXPECT_EQ(visOddBandbin["Width"][0].toStdString(), "36"); - EXPECT_EQ(visOddBandbin["Width"][1].toStdString(), "20"); + EXPECT_EQ(visOddBandbin["FilterNumber"][0], "3"); + EXPECT_EQ(visOddBandbin["FilterNumber"][1], "4"); + EXPECT_EQ(visOddBandbin["Center"][0], "415"); + EXPECT_EQ(visOddBandbin["Center"][1], "566"); + EXPECT_EQ(visOddBandbin["Width"][0], "36"); + EXPECT_EQ(visOddBandbin["Width"][1], "20"); std::unique_ptr visOddHist (visOddCube.histogram()); @@ -273,11 +273,11 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisColorOffset) { // Instrument Group PvlGroup &uvEvenInst = uvEvenLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(uvEvenInst["ColorOffset"][0].toStdString(), "2"); - EXPECT_EQ(uvEvenInst["Decompanded"][0].toStdString(), "Yes"); - EXPECT_EQ(uvEvenInst["Framelets"][0].toStdString(), "Even"); - EXPECT_EQ(uvEvenInst["NumFramelets"][0].toStdString(), "3"); - EXPECT_EQ(uvEvenInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(uvEvenInst["ColorOffset"][0], "2"); + EXPECT_EQ(uvEvenInst["Decompanded"][0], "Yes"); + EXPECT_EQ(uvEvenInst["Framelets"][0], "Even"); + EXPECT_EQ(uvEvenInst["NumFramelets"][0], "3"); + EXPECT_EQ(uvEvenInst["InstrumentModeId"][0], "COLOR"); std::unique_ptr uvEvenHist (uvEvenCube.histogram()); @@ -299,11 +299,11 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisColorOffset) { // Instrument Group PvlGroup &uvOddInst = uvOddLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(uvOddInst["ColorOffset"][0].toStdString(), "2"); - EXPECT_EQ(uvOddInst["Decompanded"][0].toStdString(), "Yes"); - EXPECT_EQ(uvOddInst["Framelets"][0].toStdString(), "Odd"); - EXPECT_EQ(uvOddInst["NumFramelets"][0].toStdString(), "3"); - EXPECT_EQ(uvOddInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(uvOddInst["ColorOffset"][0], "2"); + EXPECT_EQ(uvOddInst["Decompanded"][0], "Yes"); + EXPECT_EQ(uvOddInst["Framelets"][0], "Odd"); + EXPECT_EQ(uvOddInst["NumFramelets"][0], "3"); + EXPECT_EQ(uvOddInst["InstrumentModeId"][0], "COLOR"); std::unique_ptr uvOddHist (uvOddCube.histogram()); @@ -325,29 +325,29 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisColorOffset) { // Instrument Group PvlGroup &visEvenInst = visEvenLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(visEvenInst["ColorOffset"][0].toStdString(), "2"); - EXPECT_EQ(visEvenInst["Decompanded"][0].toStdString(), "Yes"); - EXPECT_EQ(visEvenInst["Framelets"][0].toStdString(), "Even"); - EXPECT_EQ(visEvenInst["NumFramelets"][0].toStdString(), "9"); - EXPECT_EQ(visEvenInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(visEvenInst["ColorOffset"][0], "2"); + EXPECT_EQ(visEvenInst["Decompanded"][0], "Yes"); + EXPECT_EQ(visEvenInst["Framelets"][0], "Even"); + EXPECT_EQ(visEvenInst["NumFramelets"][0], "9"); + EXPECT_EQ(visEvenInst["InstrumentModeId"][0], "COLOR"); // Bandbin Group PvlGroup &visEvenBandbin = visEvenLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(visEvenBandbin["FilterNumber"][0].toStdString(), "3"); - EXPECT_EQ(visEvenBandbin["FilterNumber"][1].toStdString(), "4"); - EXPECT_EQ(visEvenBandbin["FilterNumber"][2].toStdString(), "5"); - EXPECT_EQ(visEvenBandbin["FilterNumber"][3].toStdString(), "6"); - EXPECT_EQ(visEvenBandbin["FilterNumber"][4].toStdString(), "7"); - EXPECT_EQ(visEvenBandbin["Center"][0].toStdString(), "415"); - EXPECT_EQ(visEvenBandbin["Center"][1].toStdString(), "566"); - EXPECT_EQ(visEvenBandbin["Center"][2].toStdString(), "604"); - EXPECT_EQ(visEvenBandbin["Center"][3].toStdString(), "643"); - EXPECT_EQ(visEvenBandbin["Center"][4].toStdString(), "689"); - EXPECT_EQ(visEvenBandbin["Width"][0].toStdString(), "36"); - EXPECT_EQ(visEvenBandbin["Width"][1].toStdString(), "20"); - EXPECT_EQ(visEvenBandbin["Width"][2].toStdString(), "20"); - EXPECT_EQ(visEvenBandbin["Width"][3].toStdString(), "23"); - EXPECT_EQ(visEvenBandbin["Width"][4].toStdString(), "39"); + EXPECT_EQ(visEvenBandbin["FilterNumber"][0], "3"); + EXPECT_EQ(visEvenBandbin["FilterNumber"][1], "4"); + EXPECT_EQ(visEvenBandbin["FilterNumber"][2], "5"); + EXPECT_EQ(visEvenBandbin["FilterNumber"][3], "6"); + EXPECT_EQ(visEvenBandbin["FilterNumber"][4], "7"); + EXPECT_EQ(visEvenBandbin["Center"][0], "415"); + EXPECT_EQ(visEvenBandbin["Center"][1], "566"); + EXPECT_EQ(visEvenBandbin["Center"][2], "604"); + EXPECT_EQ(visEvenBandbin["Center"][3], "643"); + EXPECT_EQ(visEvenBandbin["Center"][4], "689"); + EXPECT_EQ(visEvenBandbin["Width"][0], "36"); + EXPECT_EQ(visEvenBandbin["Width"][1], "20"); + EXPECT_EQ(visEvenBandbin["Width"][2], "20"); + EXPECT_EQ(visEvenBandbin["Width"][3], "23"); + EXPECT_EQ(visEvenBandbin["Width"][4], "39"); std::unique_ptr visEvenHist (visEvenCube.histogram()); @@ -369,29 +369,29 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisColorOffset) { // Instrument Group PvlGroup &visOddInst = visOddLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(visOddInst["ColorOffset"][0].toStdString(), "2"); - EXPECT_EQ(visOddInst["Decompanded"][0].toStdString(), "Yes"); - EXPECT_EQ(visOddInst["Framelets"][0].toStdString(), "Odd"); - EXPECT_EQ(visOddInst["NumFramelets"][0].toStdString(), "9"); - EXPECT_EQ(visOddInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(visOddInst["ColorOffset"][0], "2"); + EXPECT_EQ(visOddInst["Decompanded"][0], "Yes"); + EXPECT_EQ(visOddInst["Framelets"][0], "Odd"); + EXPECT_EQ(visOddInst["NumFramelets"][0], "9"); + EXPECT_EQ(visOddInst["InstrumentModeId"][0], "COLOR"); // Bandbin Group PvlGroup &visOddBandbin = visOddLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(visOddBandbin["FilterNumber"][0].toStdString(), "3"); - EXPECT_EQ(visOddBandbin["FilterNumber"][1].toStdString(), "4"); - EXPECT_EQ(visOddBandbin["FilterNumber"][2].toStdString(), "5"); - EXPECT_EQ(visOddBandbin["FilterNumber"][3].toStdString(), "6"); - EXPECT_EQ(visOddBandbin["FilterNumber"][4].toStdString(), "7"); - EXPECT_EQ(visOddBandbin["Center"][0].toStdString(), "415"); - EXPECT_EQ(visOddBandbin["Center"][1].toStdString(), "566"); - EXPECT_EQ(visOddBandbin["Center"][2].toStdString(), "604"); - EXPECT_EQ(visOddBandbin["Center"][3].toStdString(), "643"); - EXPECT_EQ(visOddBandbin["Center"][4].toStdString(), "689"); - EXPECT_EQ(visOddBandbin["Width"][0].toStdString(), "36"); - EXPECT_EQ(visOddBandbin["Width"][1].toStdString(), "20"); - EXPECT_EQ(visOddBandbin["Width"][2].toStdString(), "20"); - EXPECT_EQ(visOddBandbin["Width"][3].toStdString(), "23"); - EXPECT_EQ(visOddBandbin["Width"][4].toStdString(), "39"); + EXPECT_EQ(visOddBandbin["FilterNumber"][0], "3"); + EXPECT_EQ(visOddBandbin["FilterNumber"][1], "4"); + EXPECT_EQ(visOddBandbin["FilterNumber"][2], "5"); + EXPECT_EQ(visOddBandbin["FilterNumber"][3], "6"); + EXPECT_EQ(visOddBandbin["FilterNumber"][4], "7"); + EXPECT_EQ(visOddBandbin["Center"][0], "415"); + EXPECT_EQ(visOddBandbin["Center"][1], "566"); + EXPECT_EQ(visOddBandbin["Center"][2], "604"); + EXPECT_EQ(visOddBandbin["Center"][3], "643"); + EXPECT_EQ(visOddBandbin["Center"][4], "689"); + EXPECT_EQ(visOddBandbin["Width"][0], "36"); + EXPECT_EQ(visOddBandbin["Width"][1], "20"); + EXPECT_EQ(visOddBandbin["Width"][2], "20"); + EXPECT_EQ(visOddBandbin["Width"][3], "23"); + EXPECT_EQ(visOddBandbin["Width"][4], "39"); std::unique_ptr visOddHist (visOddCube.histogram()); @@ -431,11 +431,11 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisNoUnlut) { // Instrument Group PvlGroup &uvEvenInst = uvEvenLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(uvEvenInst["ColorOffset"][0].toStdString(), "0"); - EXPECT_EQ(uvEvenInst["Decompanded"][0].toStdString(), "No"); - EXPECT_EQ(uvEvenInst["Framelets"][0].toStdString(), "Even"); - EXPECT_EQ(uvEvenInst["NumFramelets"][0].toStdString(), "1"); - EXPECT_EQ(uvEvenInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(uvEvenInst["ColorOffset"][0], "0"); + EXPECT_EQ(uvEvenInst["Decompanded"][0], "No"); + EXPECT_EQ(uvEvenInst["Framelets"][0], "Even"); + EXPECT_EQ(uvEvenInst["NumFramelets"][0], "1"); + EXPECT_EQ(uvEvenInst["InstrumentModeId"][0], "COLOR"); std::unique_ptr uvEvenHist (uvEvenCube.histogram()); @@ -457,11 +457,11 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisNoUnlut) { // Instrument Group PvlGroup &uvOddInst = uvOddLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(uvOddInst["ColorOffset"][0].toStdString(), "0"); - EXPECT_EQ(uvOddInst["Decompanded"][0].toStdString(), "No"); - EXPECT_EQ(uvOddInst["Framelets"][0].toStdString(), "Odd"); - EXPECT_EQ(uvOddInst["NumFramelets"][0].toStdString(), "1"); - EXPECT_EQ(uvOddInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(uvOddInst["ColorOffset"][0], "0"); + EXPECT_EQ(uvOddInst["Decompanded"][0], "No"); + EXPECT_EQ(uvOddInst["Framelets"][0], "Odd"); + EXPECT_EQ(uvOddInst["NumFramelets"][0], "1"); + EXPECT_EQ(uvOddInst["InstrumentModeId"][0], "COLOR"); std::unique_ptr uvOddHist (uvOddCube.histogram()); @@ -483,11 +483,11 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisNoUnlut) { // Instrument Group PvlGroup &visEvenInst = visEvenLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(visEvenInst["ColorOffset"][0].toStdString(), "0"); - EXPECT_EQ(visEvenInst["Decompanded"][0].toStdString(), "No"); - EXPECT_EQ(visEvenInst["Framelets"][0].toStdString(), "Even"); - EXPECT_EQ(visEvenInst["NumFramelets"][0].toStdString(), "1"); - EXPECT_EQ(visEvenInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(visEvenInst["ColorOffset"][0], "0"); + EXPECT_EQ(visEvenInst["Decompanded"][0], "No"); + EXPECT_EQ(visEvenInst["Framelets"][0], "Even"); + EXPECT_EQ(visEvenInst["NumFramelets"][0], "1"); + EXPECT_EQ(visEvenInst["InstrumentModeId"][0], "COLOR"); std::unique_ptr visEvenHist (visEvenCube.histogram()); @@ -509,11 +509,11 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisNoUnlut) { // Instrument Group PvlGroup &visOddInst = visOddLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(visOddInst["ColorOffset"][0].toStdString(), "0"); - EXPECT_EQ(visOddInst["Decompanded"][0].toStdString(), "No"); - EXPECT_EQ(visOddInst["Framelets"][0].toStdString(), "Odd"); - EXPECT_EQ(visOddInst["NumFramelets"][0].toStdString(), "1"); - EXPECT_EQ(visOddInst["InstrumentModeId"][0].toStdString(), "COLOR"); + EXPECT_EQ(visOddInst["ColorOffset"][0], "0"); + EXPECT_EQ(visOddInst["Decompanded"][0], "No"); + EXPECT_EQ(visOddInst["Framelets"][0], "Odd"); + EXPECT_EQ(visOddInst["NumFramelets"][0], "1"); + EXPECT_EQ(visOddInst["InstrumentModeId"][0], "COLOR"); std::unique_ptr visOddHist (visOddCube.histogram()); diff --git a/isis/tests/FunctionalTestsLrowac2pds.cpp b/isis/tests/FunctionalTestsLrowac2pds.cpp index 742823c575..9efd8dbd44 100644 --- a/isis/tests/FunctionalTestsLrowac2pds.cpp +++ b/isis/tests/FunctionalTestsLrowac2pds.cpp @@ -25,28 +25,28 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsUv) { lrowac2pds(options); - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); // File Characteristics - EXPECT_EQ(QString(outputLabel["PDS_VERSION_ID"]), "PDS3"); - EXPECT_EQ(QString(outputLabel["RECORD_TYPE"]), "FIXED_LENGTH"); + EXPECT_EQ((std::string)outputLabel["PDS_VERSION_ID"], "PDS3"); + EXPECT_EQ((std::string)outputLabel["RECORD_TYPE"], "FIXED_LENGTH"); EXPECT_EQ(int(outputLabel["RECORD_BYTES"]), 128); EXPECT_EQ(int(outputLabel["FILE_RECORDS"]), 8780); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 76); EXPECT_EQ(int(outputLabel["^IMAGE"]), 77); // Data Identification - EXPECT_EQ(QString(outputLabel["DATA_SET_ID"]), "LRO-L-LROC-3-CDR-V1.0"); - EXPECT_EQ(QString(outputLabel["PRODUCT_ID"]), "M115631721UC"); - EXPECT_EQ(QString(outputLabel["MISSION_NAME"]), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(QString(outputLabel["MISSION_PHASE_NAME"]), "NOMINAL MISSION"); + EXPECT_EQ((std::string)outputLabel["DATA_SET_ID"], "LRO-L-LROC-3-CDR-V1.0"); + EXPECT_EQ((std::string)outputLabel["PRODUCT_ID"], "M115631721UC"); + EXPECT_EQ((std::string)outputLabel["MISSION_NAME"], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ((std::string)outputLabel["MISSION_PHASE_NAME"], "NOMINAL MISSION"); EXPECT_EQ(int(outputLabel["ORBIT_NUMBER"]), 2174); // Data Description - EXPECT_EQ(QString(outputLabel["TARGET_NAME"]), "MOON"); - EXPECT_EQ(QString(outputLabel["RATIONALE_DESC"]), "GLOBAL COVERAGE"); - EXPECT_EQ(QString(outputLabel["DATA_QUALITY_ID"]), "0"); + EXPECT_EQ((std::string)outputLabel["TARGET_NAME"], "MOON"); + EXPECT_EQ((std::string)outputLabel["RATIONALE_DESC"], "GLOBAL COVERAGE"); + EXPECT_EQ((std::string)outputLabel["DATA_QUALITY_ID"], "0"); // Environment EXPECT_DOUBLE_EQ(double(outputLabel["LRO:BEGIN_TEMPERATURE_SCS"]), 2.10); @@ -65,25 +65,25 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsUv) { EXPECT_DOUBLE_EQ(double(outputLabel["EXPOSURE_DURATION"]), 48.0); EXPECT_EQ(int(outputLabel["LRO:EXPOSURE_CODE"]), 480); EXPECT_DOUBLE_EQ(double(outputLabel["INTERFRAME_DELAY"]), 703.125); - EXPECT_EQ(QString(outputLabel["INSTRUMENT_MODE_ID"]), "UV"); - EXPECT_EQ(QString(outputLabel["FILTER_NUMBER"][0]), "1"); - EXPECT_EQ(QString(outputLabel["FILTER_NUMBER"][1]), "2"); - EXPECT_EQ(QString(outputLabel["CENTER_FILTER_WAVELENGTH"][0]), "321"); - EXPECT_EQ(QString(outputLabel["CENTER_FILTER_WAVELENGTH"][1]), "360"); - EXPECT_EQ(QString(outputLabel["BANDWIDTH"][0]), "32"); - EXPECT_EQ(QString(outputLabel["BANDWIDTH"][1]), "15"); + EXPECT_EQ((std::string)outputLabel["INSTRUMENT_MODE_ID"], "UV"); + EXPECT_EQ((std::string)outputLabel["FILTER_NUMBER"][0], "1"); + EXPECT_EQ((std::string)outputLabel["FILTER_NUMBER"][1], "2"); + EXPECT_EQ((std::string)outputLabel["CENTER_FILTER_WAVELENGTH"][0], "321"); + EXPECT_EQ((std::string)outputLabel["CENTER_FILTER_WAVELENGTH"][1], "360"); + EXPECT_EQ((std::string)outputLabel["BANDWIDTH"][0], "32"); + EXPECT_EQ((std::string)outputLabel["BANDWIDTH"][1], "15"); // Data Object EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 32); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "PC_REAL"); - EXPECT_EQ(QString(imageObject["VALID_MINIMUM"]), "16#FF7FFFFA#"); - EXPECT_EQ(QString(imageObject["NULL"]), "16#FF7FFFFB#"); - EXPECT_EQ(QString(imageObject["LOW_REPR_SATURATION"]), "16#FF7FFFFC#"); - EXPECT_EQ(QString(imageObject["LOW_INSTR_SATURATION"]), "16#FF7FFFFD#"); - EXPECT_EQ(QString(imageObject["HIGH_INSTR_SATURATION"]), "16#FF7FFFFE#"); - EXPECT_EQ(QString(imageObject["HIGH_REPR_SATURATION"]), "16#FF7FFFFF#"); - EXPECT_EQ(QString(imageObject["UNIT"]), "I/F"); - EXPECT_EQ(QString(imageObject["MD5_CHECKSUM"]), "72b64e9200aa6b03838b166da9b0159d"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "PC_REAL"); + EXPECT_EQ((std::string)imageObject["VALID_MINIMUM"], "16#FF7FFFFA#"); + EXPECT_EQ((std::string)imageObject["NULL"], "16#FF7FFFFB#"); + EXPECT_EQ((std::string)imageObject["LOW_REPR_SATURATION"], "16#FF7FFFFC#"); + EXPECT_EQ((std::string)imageObject["LOW_INSTR_SATURATION"], "16#FF7FFFFD#"); + EXPECT_EQ((std::string)imageObject["HIGH_INSTR_SATURATION"], "16#FF7FFFFE#"); + EXPECT_EQ((std::string)imageObject["HIGH_REPR_SATURATION"], "16#FF7FFFFF#"); + EXPECT_EQ((std::string)imageObject["UNIT"], "I/F"); + EXPECT_EQ((std::string)imageObject["MD5_CHECKSUM"], "72b64e9200aa6b03838b166da9b0159d"); } TEST(Lrowac2pds, FunctionalTestLrowac2pdsVis) { @@ -95,27 +95,27 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsVis) { lrowac2pds(options); - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); // File Characteristics - EXPECT_EQ(QString(outputLabel["PDS_VERSION_ID"]), "PDS3"); - EXPECT_EQ(QString(outputLabel["RECORD_TYPE"]), "FIXED_LENGTH"); + EXPECT_EQ((std::string)outputLabel["PDS_VERSION_ID"], "PDS3"); + EXPECT_EQ((std::string)outputLabel["RECORD_TYPE"], "FIXED_LENGTH"); EXPECT_EQ(int(outputLabel["FILE_RECORDS"]), 27175); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 15); EXPECT_EQ(int(outputLabel["^IMAGE"]), 16); // Data Identification - EXPECT_EQ(QString(outputLabel["DATA_SET_ID"]), "LRO-L-LROC-3-CDR-V1.0"); - EXPECT_EQ(QString(outputLabel["PRODUCT_ID"]), "M103709659VC"); - EXPECT_EQ(QString(outputLabel["MISSION_NAME"]), "LUNAR RECONNAISSANCE ORBITER"); - EXPECT_EQ(QString(outputLabel["MISSION_PHASE_NAME"]), "COMMISSIONING"); + EXPECT_EQ((std::string)outputLabel["DATA_SET_ID"], "LRO-L-LROC-3-CDR-V1.0"); + EXPECT_EQ((std::string)outputLabel["PRODUCT_ID"], "M103709659VC"); + EXPECT_EQ((std::string)outputLabel["MISSION_NAME"], "LUNAR RECONNAISSANCE ORBITER"); + EXPECT_EQ((std::string)outputLabel["MISSION_PHASE_NAME"], "COMMISSIONING"); EXPECT_EQ(int(outputLabel["ORBIT_NUMBER"]), 449); // Data Description - EXPECT_EQ(QString(outputLabel["TARGET_NAME"]), "MOON"); - EXPECT_EQ(QString(outputLabel["RATIONALE_DESC"]), "GLOBAL COVERAGE"); - EXPECT_EQ(QString(outputLabel["DATA_QUALITY_ID"]), "32"); + EXPECT_EQ((std::string)outputLabel["TARGET_NAME"], "MOON"); + EXPECT_EQ((std::string)outputLabel["RATIONALE_DESC"], "GLOBAL COVERAGE"); + EXPECT_EQ((std::string)outputLabel["DATA_QUALITY_ID"], "32"); // Environment EXPECT_DOUBLE_EQ(double(outputLabel["LRO:BEGIN_TEMPERATURE_SCS"]), 2.62); @@ -134,22 +134,22 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsVis) { EXPECT_DOUBLE_EQ(double(outputLabel["EXPOSURE_DURATION"]), 50.0); EXPECT_EQ(int(outputLabel["LRO:EXPOSURE_CODE"]), 500); EXPECT_DOUBLE_EQ(double(outputLabel["INTERFRAME_DELAY"]), 2234.375); - EXPECT_EQ(QString(outputLabel["INSTRUMENT_MODE_ID"]), "VIS"); - EXPECT_EQ(QString(outputLabel["FILTER_NUMBER"][0]), "3"); - EXPECT_EQ(QString(outputLabel["FILTER_NUMBER"][1]), "4"); - EXPECT_EQ(QString(outputLabel["FILTER_NUMBER"][2]), "5"); - EXPECT_EQ(QString(outputLabel["FILTER_NUMBER"][3]), "6"); - EXPECT_EQ(QString(outputLabel["FILTER_NUMBER"][4]), "7"); - EXPECT_EQ(QString(outputLabel["CENTER_FILTER_WAVELENGTH"][0]), "415"); - EXPECT_EQ(QString(outputLabel["CENTER_FILTER_WAVELENGTH"][1]), "566"); - EXPECT_EQ(QString(outputLabel["CENTER_FILTER_WAVELENGTH"][2]), "604"); - EXPECT_EQ(QString(outputLabel["CENTER_FILTER_WAVELENGTH"][3]), "643"); - EXPECT_EQ(QString(outputLabel["CENTER_FILTER_WAVELENGTH"][4]), "689"); - EXPECT_EQ(QString(outputLabel["BANDWIDTH"][0]), "36"); - EXPECT_EQ(QString(outputLabel["BANDWIDTH"][1]), "20"); - EXPECT_EQ(QString(outputLabel["BANDWIDTH"][2]), "20"); - EXPECT_EQ(QString(outputLabel["BANDWIDTH"][3]), "23"); - EXPECT_EQ(QString(outputLabel["BANDWIDTH"][4]), "39"); + EXPECT_EQ((std::string)outputLabel["INSTRUMENT_MODE_ID"], "VIS"); + EXPECT_EQ((std::string)outputLabel["FILTER_NUMBER"][0], "3"); + EXPECT_EQ((std::string)outputLabel["FILTER_NUMBER"][1], "4"); + EXPECT_EQ((std::string)outputLabel["FILTER_NUMBER"][2], "5"); + EXPECT_EQ((std::string)outputLabel["FILTER_NUMBER"][3], "6"); + EXPECT_EQ((std::string)outputLabel["FILTER_NUMBER"][4], "7"); + EXPECT_EQ((std::string)outputLabel["CENTER_FILTER_WAVELENGTH"][0], "415"); + EXPECT_EQ((std::string)outputLabel["CENTER_FILTER_WAVELENGTH"][1], "566"); + EXPECT_EQ((std::string)outputLabel["CENTER_FILTER_WAVELENGTH"][2], "604"); + EXPECT_EQ((std::string)outputLabel["CENTER_FILTER_WAVELENGTH"][3], "643"); + EXPECT_EQ((std::string)outputLabel["CENTER_FILTER_WAVELENGTH"][4], "689"); + EXPECT_EQ((std::string)outputLabel["BANDWIDTH"][0], "36"); + EXPECT_EQ((std::string)outputLabel["BANDWIDTH"][1], "20"); + EXPECT_EQ((std::string)outputLabel["BANDWIDTH"][2], "20"); + EXPECT_EQ((std::string)outputLabel["BANDWIDTH"][3], "23"); + EXPECT_EQ((std::string)outputLabel["BANDWIDTH"][4], "39"); EXPECT_EQ(int(outputLabel["LRO:COMPRESSION_FLAG"]), 0); EXPECT_EQ(int(outputLabel["LRO:MODE"]), 0); EXPECT_EQ(int(outputLabel["LRO:NFRAMES"]), 97); @@ -160,15 +160,15 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsVis) { // Data Object EXPECT_EQ(int(imageObject["SAMPLE_BITS"]), 32); - EXPECT_EQ(QString(imageObject["SAMPLE_TYPE"]), "PC_REAL"); - EXPECT_EQ(QString(imageObject["VALID_MINIMUM"]), "16#FF7FFFFA#"); - EXPECT_EQ(QString(imageObject["NULL"]), "16#FF7FFFFB#"); - EXPECT_EQ(QString(imageObject["LOW_REPR_SATURATION"]), "16#FF7FFFFC#"); - EXPECT_EQ(QString(imageObject["LOW_INSTR_SATURATION"]), "16#FF7FFFFD#"); - EXPECT_EQ(QString(imageObject["HIGH_INSTR_SATURATION"]), "16#FF7FFFFE#"); - EXPECT_EQ(QString(imageObject["HIGH_REPR_SATURATION"]), "16#FF7FFFFF#"); - EXPECT_EQ(QString(imageObject["UNIT"]), "I/F"); - EXPECT_EQ(QString(imageObject["MD5_CHECKSUM"]), "03ff4198df40b995b4bf759e0eab49b9"); + EXPECT_EQ((std::string)imageObject["SAMPLE_TYPE"], "PC_REAL"); + EXPECT_EQ((std::string)imageObject["VALID_MINIMUM"], "16#FF7FFFFA#"); + EXPECT_EQ((std::string)imageObject["NULL"], "16#FF7FFFFB#"); + EXPECT_EQ((std::string)imageObject["LOW_REPR_SATURATION"], "16#FF7FFFFC#"); + EXPECT_EQ((std::string)imageObject["LOW_INSTR_SATURATION"], "16#FF7FFFFD#"); + EXPECT_EQ((std::string)imageObject["HIGH_INSTR_SATURATION"], "16#FF7FFFFE#"); + EXPECT_EQ((std::string)imageObject["HIGH_REPR_SATURATION"], "16#FF7FFFFF#"); + EXPECT_EQ((std::string)imageObject["UNIT"], "I/F"); + EXPECT_EQ((std::string)imageObject["MD5_CHECKSUM"], "03ff4198df40b995b4bf759e0eab49b9"); } TEST(Lrowac2pds, FunctionalTestLrowac2pdsColor) { @@ -180,12 +180,12 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsColor) { lrowac2pds(options); - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); // File Characteristics - EXPECT_EQ(QString(outputLabel["PDS_VERSION_ID"]), "PDS3"); - EXPECT_EQ(QString(outputLabel["RECORD_TYPE"]), "FIXED_LENGTH"); + EXPECT_EQ((std::string)outputLabel["PDS_VERSION_ID"], "PDS3"); + EXPECT_EQ((std::string)outputLabel["RECORD_TYPE"], "FIXED_LENGTH"); EXPECT_EQ(int(outputLabel["RECORD_BYTES"]), 704); EXPECT_EQ(int(outputLabel["FILE_RECORDS"]), 7503); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 15); @@ -208,7 +208,7 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsColor) { EXPECT_DOUBLE_EQ(double(outputLabel["EXPOSURE_DURATION"]), 45.0); EXPECT_EQ(int(outputLabel["LRO:EXPOSURE_CODE"]), 450); EXPECT_DOUBLE_EQ(double(outputLabel["INTERFRAME_DELAY"]), 4375.0); - EXPECT_EQ(QString(outputLabel["INSTRUMENT_MODE_ID"]), "COLOR"); + EXPECT_EQ((std::string)outputLabel["INSTRUMENT_MODE_ID"], "COLOR"); EXPECT_EQ(int(outputLabel["LRO:COMPRESSION_FLAG"]), 0); EXPECT_EQ(int(outputLabel["LRO:MODE"]), 0); EXPECT_EQ(int(outputLabel["LRO:NFRAMES"]), 24); @@ -232,12 +232,12 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsMono) { lrowac2pds(options); - Pvl outputLabel(options.GetFileName("TO")); + Pvl outputLabel(options.GetFileName("TO").toStdString()); PvlObject imageObject = outputLabel.findObject("IMAGE"); // File Characteristics - EXPECT_EQ(QString(outputLabel["PDS_VERSION_ID"]), "PDS3"); - EXPECT_EQ(QString(outputLabel["RECORD_TYPE"]), "FIXED_LENGTH"); + EXPECT_EQ((std::string)outputLabel["PDS_VERSION_ID"], "PDS3"); + EXPECT_EQ((std::string)outputLabel["RECORD_TYPE"], "FIXED_LENGTH"); EXPECT_EQ(int(outputLabel["RECORD_BYTES"]), 1024); EXPECT_EQ(int(outputLabel["FILE_RECORDS"]), 2250); EXPECT_EQ(int(outputLabel["LABEL_RECORDS"]), 10); @@ -260,8 +260,8 @@ TEST(Lrowac2pds, FunctionalTestLrowac2pdsMono) { EXPECT_DOUBLE_EQ(double(outputLabel["EXPOSURE_DURATION"]), 26.0); EXPECT_EQ(int(outputLabel["LRO:EXPOSURE_CODE"]), 260); EXPECT_DOUBLE_EQ(double(outputLabel["INTERFRAME_DELAY"]), 421.875); - EXPECT_EQ(QString(outputLabel["INSTRUMENT_MODE_ID"]), "BW"); - EXPECT_EQ(QString(outputLabel["FILTER_NUMBER"]), "6"); + EXPECT_EQ((std::string)outputLabel["INSTRUMENT_MODE_ID"], "BW"); + EXPECT_EQ((std::string)outputLabel["FILTER_NUMBER"], "6"); EXPECT_EQ(int(outputLabel["CENTER_FILTER_WAVELENGTH"]), 643); EXPECT_EQ(int(outputLabel["BANDWIDTH"]), 23); EXPECT_EQ(int(outputLabel["LRO:COMPRESSION_FLAG"]), 1); diff --git a/isis/tests/FunctionalTestsLrowaccal.cpp b/isis/tests/FunctionalTestsLrowaccal.cpp index cb848f4d61..2981997fa5 100644 --- a/isis/tests/FunctionalTestsLrowaccal.cpp +++ b/isis/tests/FunctionalTestsLrowaccal.cpp @@ -39,7 +39,7 @@ TEST(Lrowaccal, FunctionalTestLrowaccalRadianceUnitsLabelExists) { ASSERT_TRUE(radiometry.hasKeyword("RadiometricType")); PvlKeyword &radiometricType = radiometry["RadiometricType"]; - ASSERT_EQ(radiometricType.unit().toStdString(), "W/m2/sr/um"); + ASSERT_EQ(radiometricType.unit(), "W/m2/sr/um"); } TEST(Lrowaccal, FunctionalTestLrowaccalRadianceUnitsLabelNotForIOF) { @@ -69,5 +69,5 @@ TEST(Lrowaccal, FunctionalTestLrowaccalRadianceUnitsLabelNotForIOF) { ASSERT_TRUE(radiometry.hasKeyword("RadiometricType")); PvlKeyword &radiometricType = radiometry["RadiometricType"]; - ASSERT_NE(radiometricType.unit().toStdString(), "W/m2/sr/um"); + ASSERT_NE(radiometricType.unit(), "W/m2/sr/um"); } diff --git a/isis/tests/FunctionalTestsMap2map.cpp b/isis/tests/FunctionalTestsMap2map.cpp index 7bf5c37f3d..c7c6a516df 100644 --- a/isis/tests/FunctionalTestsMap2map.cpp +++ b/isis/tests/FunctionalTestsMap2map.cpp @@ -36,15 +36,15 @@ TEST_F(ThreeImageNetwork, FunctionalTestMap2mapDefault) { PvlGroup &mapping = ocube.label()->findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Equirectangular"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Equirectangular"); EXPECT_NEAR((double)mapping.findKeyword("CenterLongitude"), 0.25400668736684, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Mars"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Mars"); EXPECT_NEAR((double)mapping.findKeyword("EquatorialRadius"), 3396190.0, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("PolarRadius"), 3376200.0, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("LatitudeType"), "Planetocentric"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("LongitudeDirection"), "PositiveEast"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LatitudeType"), "Planetocentric"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LongitudeDirection"), "PositiveEast"); EXPECT_EQ((int)mapping.findKeyword("LongitudeDomain"), 180); EXPECT_NEAR((double)mapping.findKeyword("MinimumLatitude"), 0.47920860194551, 0.0001); @@ -87,15 +87,15 @@ TEST_F(ThreeImageNetwork, FunctionalTestMap2mapKeywords) { PvlGroup &mapping = ocube.label()->findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Equirectangular"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Equirectangular"); EXPECT_NEAR((double)mapping.findKeyword("CenterLongitude"), 0.25400668736684, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Mars"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Mars"); EXPECT_NEAR((double)mapping.findKeyword("EquatorialRadius"), 3396190.0, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("PolarRadius"), 3376200.0, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("LatitudeType"), "Planetocentric"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("LongitudeDirection"), "PositiveEast"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LatitudeType"), "Planetocentric"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LongitudeDirection"), "PositiveEast"); EXPECT_EQ((int)mapping.findKeyword("LongitudeDomain"), 180); EXPECT_NEAR((double)mapping.findKeyword("MinimumLatitude"), 0.47920860194551, 0.0001); @@ -139,15 +139,15 @@ TEST_F(ThreeImageNetwork, FunctionalTestMap2mapKeywords) { PvlGroup &mapNoScale = ocubeNoScale.label()->findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapNoScale.findKeyword("ProjectionName"), "Equirectangular"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapNoScale.findKeyword("ProjectionName"), "Equirectangular"); EXPECT_NEAR((double)mapNoScale.findKeyword("CenterLongitude"), 0.25400668736684, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Mars"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Mars"); EXPECT_NEAR((double)mapNoScale.findKeyword("EquatorialRadius"), 3396190.0, 0.0001); EXPECT_NEAR((double)mapNoScale.findKeyword("PolarRadius"), 3376200.0, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapNoScale.findKeyword("LatitudeType"), "Planetocentric"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapNoScale.findKeyword("LongitudeDirection"), "PositiveEast"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapNoScale.findKeyword("LatitudeType"), "Planetocentric"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapNoScale.findKeyword("LongitudeDirection"), "PositiveEast"); EXPECT_EQ((int)mapNoScale.findKeyword("LongitudeDomain"), 180); EXPECT_NEAR((double)mapNoScale.findKeyword("MinimumLatitude"), 0.47920860194551, 0.0001); @@ -190,15 +190,15 @@ TEST_F(ThreeImageNetwork, FunctionalTestMap2mapUnits) { PvlGroup &mapping = ocube.label()->findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Equirectangular"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Equirectangular"); EXPECT_NEAR((double)mapping.findKeyword("CenterLongitude"), -0.25400668736682003, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Mars"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Mars"); EXPECT_NEAR((double)mapping.findKeyword("EquatorialRadius"), 3396190.0, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("PolarRadius"), 3376200.0, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("LatitudeType"), "Planetocentric"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("LongitudeDirection"), "PositiveWest"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LatitudeType"), "Planetocentric"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LongitudeDirection"), "PositiveWest"); EXPECT_EQ((int)mapping.findKeyword("LongitudeDomain"), 180); EXPECT_NEAR((double)mapping.findKeyword("MinimumLatitude"), 0.47920860194551, 0.0001); @@ -241,15 +241,15 @@ TEST(Map2mapTest, FunctionalTestMap2mapProjection) { PvlGroup &mapping = ocube.label()->findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Orthographic"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Orthographic"); EXPECT_DOUBLE_EQ((double)mapping.findKeyword("CenterLongitude"), 0.0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Moon"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Moon"); EXPECT_NEAR((double)mapping.findKeyword("EquatorialRadius"), 1737400.0, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("PolarRadius"), 1737400.0, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("LatitudeType"), "Planetocentric"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("LongitudeDirection"), "PositiveEast"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LatitudeType"), "Planetocentric"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LongitudeDirection"), "PositiveEast"); EXPECT_EQ((int)mapping.findKeyword("LongitudeDomain"), 360); EXPECT_EQ((int)mapping.findKeyword("MinimumLatitude"), -90); diff --git a/isis/tests/FunctionalTestsMapmos.cpp b/isis/tests/FunctionalTestsMapmos.cpp index 38b2d18579..124a0821da 100644 --- a/isis/tests/FunctionalTestsMapmos.cpp +++ b/isis/tests/FunctionalTestsMapmos.cpp @@ -229,7 +229,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosTracking) { PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup bandbin = mosaicLabel.findGroup("BandBin"); PvlGroup tracking = mosaicLabel.findGroup("Tracking"); - QString trackPath = prefix.path() + "/" + tracking["FileName"][0]; + QString trackPath = prefix.path() + "/" + QString::fromStdString(tracking["FileName"][0]); try { Cube trackCube(trackPath); @@ -375,7 +375,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosAppLog) { } PvlGroup location = appLog.findGroup("ImageLocation"); - EXPECT_EQ(location["File"][0], fromPath); + EXPECT_EQ(location["File"][0], fromPath.toStdString()); EXPECT_EQ(int(location["StartSample"]), 6); EXPECT_EQ(int(location["StartLine"]), 194); } diff --git a/isis/tests/FunctionalTestsMappt.cpp b/isis/tests/FunctionalTestsMappt.cpp index de6050286e..32f7175fa3 100644 --- a/isis/tests/FunctionalTestsMappt.cpp +++ b/isis/tests/FunctionalTestsMappt.cpp @@ -24,8 +24,8 @@ TEST_F(DefaultCube, FunctionalTestMapptImageTest) { mappt(projTestCube, options, &appLog); PvlGroup mapPoint = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ( (double) mapPoint.findKeyword("Band"), 1); EXPECT_DOUBLE_EQ( (double) mapPoint.findKeyword("PlanetographicLatitude"), 9.3870849567571); EXPECT_DOUBLE_EQ( (double) mapPoint.findKeyword("PlanetocentricLatitude"), 9.2788326719634); @@ -45,8 +45,8 @@ TEST_F(DefaultCube, FunctionalTestMapptGroundTest) { PvlGroup mapPoint = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ( (double) mapPoint.findKeyword("Band"), 1); EXPECT_NEAR( (double) mapPoint.findKeyword("Sample"), 1, 1e-8); EXPECT_NEAR( (double) mapPoint.findKeyword("Line"), 1, 1e-8); @@ -68,8 +68,8 @@ TEST_F(DefaultCube, FunctionalTestMapptProjectionTest) { PvlGroup mapPoint = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ( (double) mapPoint.findKeyword("Band"), 1); EXPECT_NEAR( (double) mapPoint.findKeyword("Sample"), 1, 1e-8); EXPECT_NEAR( (double) mapPoint.findKeyword("Line"), 1, 1e-8); @@ -99,8 +99,8 @@ TEST_F(DefaultCube, FunctionalTestMapptCoordsysTest) { PvlGroup mapPoint = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ( (double) mapPoint.findKeyword("Band"), 1); EXPECT_NEAR( (double) mapPoint.findKeyword("Sample"), 1, 1e-8); EXPECT_NEAR( (double) mapPoint.findKeyword("Line"), 1, 1e-8); @@ -149,12 +149,12 @@ TEST_F(DefaultCube, FunctionalTestMapptFlatFileTest) { EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(13), "PositiveWest180Longitude"); } else if(lineNumber == 1) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(0), mapPoint.findKeyword("FileName")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fields.value(0).toStdString(), mapPoint.findKeyword("FileName")); EXPECT_DOUBLE_EQ(fields.value(1).toDouble(), mapPoint.findKeyword("Sample")); EXPECT_DOUBLE_EQ(fields.value(2).toDouble(), mapPoint.findKeyword("Line")); EXPECT_DOUBLE_EQ(fields.value(3).toDouble(), mapPoint.findKeyword("Band")); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(4), mapPoint.findKeyword("FilterName")); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(5), mapPoint.findKeyword("PixelValue")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fields.value(4).toStdString(), mapPoint.findKeyword("FilterName")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fields.value(5).toStdString(), mapPoint.findKeyword("PixelValue")); EXPECT_DOUBLE_EQ(fields.value(6).toDouble(), mapPoint.findKeyword("X")); EXPECT_DOUBLE_EQ(fields.value(7).toDouble(), mapPoint.findKeyword("Y")); EXPECT_DOUBLE_EQ(fields.value(8).toDouble(), mapPoint.findKeyword("PlanetocentricLatitude")); @@ -187,7 +187,7 @@ TEST_F(DefaultCube, FunctionalTestMapptAllowOutside) { PvlGroup mapPoint = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("OutsideOfImage"), "Requested point falls outside of image boundaries"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("OutsideOfImage"), "Requested point falls outside of image boundaries"); } TEST_F(DefaultCube, FunctionalTestMapptBandTest) { @@ -197,7 +197,7 @@ TEST_F(DefaultCube, FunctionalTestMapptBandTest) { mappt(options, &appLog); PvlGroup mapPoint = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FilterName"), "NIR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FilterName"), "NIR"); EXPECT_EQ( (double) mapPoint.findKeyword("Band"), 2); } @@ -219,8 +219,8 @@ TEST_F(DefaultCube, FunctionalTestMapptImageCoordList) { PvlGroup mapPoint = appLog.group(0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ( (double) mapPoint.findKeyword("Band"), 1); EXPECT_NEAR( (double) mapPoint.findKeyword("Sample"), 1, 1e-8); EXPECT_NEAR( (double) mapPoint.findKeyword("Line"), 1, 1e-8); @@ -235,8 +235,8 @@ TEST_F(DefaultCube, FunctionalTestMapptImageCoordList) { mapPoint = appLog.group(1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ( (double) mapPoint.findKeyword("Band"), 1); EXPECT_NEAR( (double) mapPoint.findKeyword("Sample"), 2, 1e-8); EXPECT_NEAR( (double) mapPoint.findKeyword("Line"), 2, 1e-8); @@ -251,8 +251,8 @@ TEST_F(DefaultCube, FunctionalTestMapptImageCoordList) { mapPoint = appLog.group(2); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FileName"), projTestCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapPoint.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ( (double) mapPoint.findKeyword("Band"), 1); EXPECT_NEAR( (double) mapPoint.findKeyword("Sample"), 3, 1e-8); EXPECT_NEAR( (double) mapPoint.findKeyword("Line"), 3, 1e-8); @@ -312,12 +312,12 @@ TEST_F(DefaultCube, FunctionalTestMapptCoordListFlatFile) { else { mapPoint = appLog.group(lineNumber-1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(0), mapPoint.findKeyword("FileName")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fields.value(0).toStdString(), mapPoint.findKeyword("FileName")); EXPECT_DOUBLE_EQ(fields.value(1).toDouble(), mapPoint.findKeyword("Sample")); EXPECT_DOUBLE_EQ(fields.value(2).toDouble(), mapPoint.findKeyword("Line")); EXPECT_DOUBLE_EQ(fields.value(3).toDouble(), mapPoint.findKeyword("Band")); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(4), mapPoint.findKeyword("FilterName")); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(5), mapPoint.findKeyword("PixelValue")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fields.value(4).toStdString(), mapPoint.findKeyword("FilterName")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fields.value(5).toStdString(), mapPoint.findKeyword("PixelValue")); EXPECT_DOUBLE_EQ(fields.value(6).toDouble(), mapPoint.findKeyword("X")); EXPECT_DOUBLE_EQ(fields.value(7).toDouble(), mapPoint.findKeyword("Y")); EXPECT_DOUBLE_EQ(fields.value(8).toDouble(), mapPoint.findKeyword("PlanetocentricLatitude")); diff --git a/isis/tests/FunctionalTestsMaptrim.cpp b/isis/tests/FunctionalTestsMaptrim.cpp index 81715f3fd2..bacb55f265 100644 --- a/isis/tests/FunctionalTestsMaptrim.cpp +++ b/isis/tests/FunctionalTestsMaptrim.cpp @@ -56,20 +56,20 @@ TEST_F(DefaultCube, FunctionalTestMaptrimDefault){ // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "VIKING_ORBITER_1"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "VISUAL_IMAGING_SUBSYSTEM_CAMERA_B"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MARS"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "1977-07-09T20:05:51"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "0.008480"); - EXPECT_EQ(inst["SpacecraftClockCount"][0].toStdString(), "33322515"); - EXPECT_EQ(inst["FloodModeId"][0].toStdString(), "ON"); - EXPECT_EQ(inst["GainModeId"][0].toStdString(), "HIGH"); - EXPECT_EQ(inst["OffsetModeId"][0].toStdString(), "ON"); + EXPECT_EQ(inst["SpacecraftName"][0], "VIKING_ORBITER_1"); + EXPECT_EQ(inst["InstrumentId"][0], "VISUAL_IMAGING_SUBSYSTEM_CAMERA_B"); + EXPECT_EQ(inst["TargetName"][0], "MARS"); + EXPECT_EQ(inst["StartTime"][0], "1977-07-09T20:05:51"); + EXPECT_EQ(inst["ExposureDuration"][0], "0.008480"); + EXPECT_EQ(inst["SpacecraftClockCount"][0], "33322515"); + EXPECT_EQ(inst["FloodModeId"][0], "ON"); + EXPECT_EQ(inst["GainModeId"][0], "HIGH"); + EXPECT_EQ(inst["OffsetModeId"][0], "ON"); PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "VO1/VO2-M-VIS-2-EDR-V2.0"); - EXPECT_EQ(archive["ProductId"][0].toStdString(), "387A06"); - EXPECT_EQ(archive["MissionPhaseName"][0].toStdString(), "EXTENDED_MISSION"); + EXPECT_EQ(archive["DataSetId"][0], "VO1/VO2-M-VIS-2-EDR-V2.0"); + EXPECT_EQ(archive["ProductId"][0], "387A06"); + EXPECT_EQ(archive["MissionPhaseName"][0], "EXTENDED_MISSION"); EXPECT_EQ(int(archive["ImageNumber"]), 33322515); EXPECT_EQ(int(archive["OrbitNumber"]), 387); @@ -81,21 +81,21 @@ TEST_F(DefaultCube, FunctionalTestMaptrimDefault){ PvlGroup &kern = isisLabel->findGroup("Kernels", Pvl::Traverse); EXPECT_EQ(int(kern["NaifFrameCode"]), -27002); - EXPECT_EQ(kern["LeapSecond"][0].toStdString(), "$base/kernels/lsk/naif0012.tls"); - EXPECT_EQ(kern["TargetAttitudeShape"][0].toStdString(), "$base/kernels/pck/pck00009.tpc"); - EXPECT_EQ(kern["TargetPosition"][0].toStdString(), "Table"); - EXPECT_EQ(kern["TargetPosition"][1].toStdString(), "$base/kernels/spk/de430.bsp"); - EXPECT_EQ((kern["InstrumentPointing"][0].toStdString()), "Table"); - EXPECT_EQ((kern["InstrumentPointing"][1].toStdString()), "$viking1/kernels/ck/vo1_sedr_ck2.bc"); - EXPECT_EQ((kern["InstrumentPointing"][2].toStdString()), "$viking1/kernels/fk/vo1_v10.tf"); - EXPECT_EQ(kern["Instrument"][0].toStdString(), "Null"); + EXPECT_EQ(kern["LeapSecond"][0], "$base/kernels/lsk/naif0012.tls"); + EXPECT_EQ(kern["TargetAttitudeShape"][0], "$base/kernels/pck/pck00009.tpc"); + EXPECT_EQ(kern["TargetPosition"][0], "Table"); + EXPECT_EQ(kern["TargetPosition"][1], "$base/kernels/spk/de430.bsp"); + EXPECT_EQ((kern["InstrumentPointing"][0]), "Table"); + EXPECT_EQ((kern["InstrumentPointing"][1]), "$viking1/kernels/ck/vo1_sedr_ck2.bc"); + EXPECT_EQ((kern["InstrumentPointing"][2]), "$viking1/kernels/fk/vo1_v10.tf"); + EXPECT_EQ(kern["Instrument"][0], "Null"); EXPECT_EQ(kern["SpacecraftClock"][0], "$viking1/kernels/sclk/vo1_fict.tsc"); - EXPECT_EQ(kern["InstrumentPosition"][0].toStdString(), "Table"); - EXPECT_EQ(kern["InstrumentPosition"][1].toStdString(), "$viking1/kernels/spk/viking1a.bsp"); - EXPECT_EQ(kern["InstrumentAddendum"][0].toStdString(), "$viking1/kernels/iak/vikingAddendum003.ti"); - EXPECT_EQ(kern["ShapeModel"][0].toStdString(), "$base/dems/molaMarsPlanetaryRadius0005.cub"); - EXPECT_EQ(kern["InstrumentPositionQuality"][0].toStdString(), "Reconstructed"); - EXPECT_EQ(kern["InstrumentPointingQuality"][0].toStdString(), "Reconstructed"); + EXPECT_EQ(kern["InstrumentPosition"][0], "Table"); + EXPECT_EQ(kern["InstrumentPosition"][1], "$viking1/kernels/spk/viking1a.bsp"); + EXPECT_EQ(kern["InstrumentAddendum"][0], "$viking1/kernels/iak/vikingAddendum003.ti"); + EXPECT_EQ(kern["ShapeModel"][0], "$base/dems/molaMarsPlanetaryRadius0005.cub"); + EXPECT_EQ(kern["InstrumentPositionQuality"][0], "Reconstructed"); + EXPECT_EQ(kern["InstrumentPointingQuality"][0], "Reconstructed"); EXPECT_EQ(int(kern["CameraVersion"]), 1); PvlGroup &mapping = isisLabel->findGroup("Mapping", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsMarci2isis.cpp b/isis/tests/FunctionalTestsMarci2isis.cpp index 295379a253..f586e98faa 100644 --- a/isis/tests/FunctionalTestsMarci2isis.cpp +++ b/isis/tests/FunctionalTestsMarci2isis.cpp @@ -44,8 +44,8 @@ TEST(Marci2Isis, Marci2isisTestDefault) { PvlGroup &evenPixels = evenLabel->findGroup("Pixels", Pvl::Traverse); PvlGroup &oddPixels = oddLabel->findGroup("Pixels", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, evenPixels["Type"][0], oddPixels["Type"][0]); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, evenPixels["ByteOrder"][0], oddPixels["ByteOrder"][0]); + EXPECT_PRED_FORMAT2(AssertStringsEqual, evenPixels["Type"][0], oddPixels["Type"][0]); + EXPECT_PRED_FORMAT2(AssertStringsEqual, evenPixels["ByteOrder"][0], oddPixels["ByteOrder"][0]); ASSERT_EQ((double)evenPixels["Base"], (double)oddPixels["Base"]); ASSERT_EQ((double)evenPixels["Multiplier"], (double)oddPixels["Multiplier"]); @@ -53,16 +53,16 @@ TEST(Marci2Isis, Marci2isisTestDefault) { PvlGroup &evenInst = evenLabel->findGroup("Instrument", Pvl::Traverse); PvlGroup &oddInst = oddLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(evenInst["Framelets"][0].toStdString(), "Even"); - ASSERT_EQ(oddInst["Framelets"][0].toStdString(), "Odd"); + ASSERT_EQ(evenInst["Framelets"][0], "Even"); + ASSERT_EQ(oddInst["Framelets"][0], "Odd"); - ASSERT_EQ(evenInst["SpacecraftName"][0].toStdString(), "MARS RECONNAISSANCE ORBITER"); - ASSERT_EQ(evenInst["InstrumentId"][0].toStdString(), "Marci" ); - ASSERT_EQ(evenInst["TargetName"][0].toStdString(), "MARS" ); + ASSERT_EQ(evenInst["SpacecraftName"][0], "MARS RECONNAISSANCE ORBITER"); + ASSERT_EQ(evenInst["InstrumentId"][0], "Marci" ); + ASSERT_EQ(evenInst["TargetName"][0], "MARS" ); ASSERT_EQ((int)evenInst["SummingMode"], 8); - ASSERT_EQ(evenInst["StartTime"][0].toStdString(), "2006-03-24T04:25:53.096000" ); - ASSERT_EQ(evenInst["StopTime"][0].toStdString(), "2006-03-24T04:55:48.296000" ); - ASSERT_EQ(evenInst["SpacecraftClockCount"][0].toStdString(), "827641567:30" ); + ASSERT_EQ(evenInst["StartTime"][0], "2006-03-24T04:25:53.096000" ); + ASSERT_EQ(evenInst["StopTime"][0], "2006-03-24T04:55:48.296000" ); + ASSERT_EQ(evenInst["SpacecraftClockCount"][0], "827641567:30" ); ASSERT_EQ((int)evenInst["DataFlipped"], 1 ); ASSERT_EQ((int)evenInst["ColorOffset"], 2 ); ASSERT_DOUBLE_EQ(double(evenInst["InterframeDelay"]), 3.2); @@ -70,19 +70,19 @@ TEST(Marci2Isis, Marci2isisTestDefault) { ASSERT_EQ((int)evenInst["FrameNumber"], 0); ASSERT_DOUBLE_EQ(double(evenInst["VariableExposureDuration"]), 3112.24); - ASSERT_EQ(evenInst["SpacecraftName"][0].toStdString(), oddInst["SpacecraftName"][0].toStdString()); - ASSERT_EQ(evenInst["InstrumentId"][0].toStdString(), oddInst["InstrumentId"][0].toStdString()); - ASSERT_EQ(evenInst["TargetName"][0].toStdString(), oddInst["TargetName"][0].toStdString()); + ASSERT_EQ(evenInst["SpacecraftName"][0], oddInst["SpacecraftName"][0]); + ASSERT_EQ(evenInst["InstrumentId"][0], oddInst["InstrumentId"][0]); + ASSERT_EQ(evenInst["TargetName"][0], oddInst["TargetName"][0]); ASSERT_EQ((int)evenInst["SummingMode"], (int)oddInst["SummingMode"]); - ASSERT_EQ(evenInst["StartTime"][0].toStdString(), oddInst["StartTime"][0].toStdString()); - ASSERT_EQ(evenInst["StopTime"][0].toStdString(), oddInst["StopTime"][0].toStdString()); - ASSERT_EQ(evenInst["SpacecraftClockCount"][0].toStdString(), oddInst["SpacecraftClockCount"][0].toStdString()); + ASSERT_EQ(evenInst["StartTime"][0], oddInst["StartTime"][0]); + ASSERT_EQ(evenInst["StopTime"][0], oddInst["StopTime"][0]); + ASSERT_EQ(evenInst["SpacecraftClockCount"][0], oddInst["SpacecraftClockCount"][0]); ASSERT_EQ((int)evenInst["DataFlipped"], (int)oddInst["DataFlipped"]); ASSERT_EQ((int)evenInst["ColorOffset"], (int)oddInst["ColorOffset"]); ASSERT_DOUBLE_EQ(double(evenInst["InterframeDelay"]), double(oddInst["InterframeDelay"])); ASSERT_DOUBLE_EQ(double(evenInst["ExposureDuration"]), double(oddInst["ExposureDuration"])); - ASSERT_EQ(evenInst["StartTime"][0].toStdString(), oddInst["StartTime"][0].toStdString()); - ASSERT_EQ(evenInst["StopTime"][0].toStdString(), oddInst["StopTime"][0].toStdString()); + ASSERT_EQ(evenInst["StartTime"][0], oddInst["StartTime"][0]); + ASSERT_EQ(evenInst["StopTime"][0], oddInst["StopTime"][0]); ASSERT_EQ((int)evenInst["DataFlipped"], (int)oddInst["DataFlipped"]); // Archive Group @@ -90,32 +90,32 @@ TEST(Marci2Isis, Marci2isisTestDefault) { PvlGroup &oddArchive = oddLabel->findGroup("Archive", Pvl::Traverse); QString ratDesc = "Post-MOI image of Argyre and Mare Erythraeum region"; - ASSERT_EQ(evenArchive["ProductId"][0].toStdString(), "MOI_000009_0294_MU_00N044W" ); - ASSERT_EQ(evenArchive["OriginalProductId"][0].toStdString(), "4A_05_0001000200" ); + ASSERT_EQ(evenArchive["ProductId"][0], "MOI_000009_0294_MU_00N044W" ); + ASSERT_EQ(evenArchive["OriginalProductId"][0], "4A_05_0001000200" ); ASSERT_EQ((int)evenArchive["OrbitNumber"], 9); - ASSERT_EQ(evenArchive["SampleBitModeId"][0].toStdString(), "SQROOT" ); + ASSERT_EQ(evenArchive["SampleBitModeId"][0], "SQROOT" ); ASSERT_DOUBLE_EQ(double(evenArchive["FocalPlaneTemperature"]), 240.9 ); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, evenArchive["RationaleDesc"][0], ratDesc); + EXPECT_PRED_FORMAT2(AssertStringsEqual, evenArchive["RationaleDesc"][0], ratDesc.toStdString()); - ASSERT_EQ(evenArchive["ProductId"][0].toStdString(), oddArchive["ProductId"][0].toStdString()); - ASSERT_EQ(evenArchive["OriginalProductId"][0].toStdString(), oddArchive["OriginalProductId"][0].toStdString()); + ASSERT_EQ(evenArchive["ProductId"][0], oddArchive["ProductId"][0]); + ASSERT_EQ(evenArchive["OriginalProductId"][0], oddArchive["OriginalProductId"][0]); ASSERT_EQ((int)evenArchive["OrbitNumber"], (int)oddArchive["OrbitNumber"]); - ASSERT_EQ(evenArchive["SampleBitModeId"][0].toStdString(), oddArchive["SampleBitModeId"][0].toStdString()); + ASSERT_EQ(evenArchive["SampleBitModeId"][0], oddArchive["SampleBitModeId"][0]); ASSERT_DOUBLE_EQ(double(evenArchive["FocalPlaneTemperature"]), double(oddArchive["FocalPlaneTemperature"])); - ASSERT_EQ(evenArchive["RationaleDesc"][0].toStdString(), oddArchive["RationaleDesc"][0].toStdString()); + ASSERT_EQ(evenArchive["RationaleDesc"][0], oddArchive["RationaleDesc"][0]); // BandBin Group PvlGroup &evenBandBin = evenLabel->findGroup("BandBin", Pvl::Traverse); PvlGroup &oddBandBin = oddLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(evenBandBin["FilterName"][0].toStdString(), "SHORT_UV"); - ASSERT_EQ(evenBandBin["FilterName"][1].toStdString(), "LONG_UV"); - ASSERT_EQ(evenBandBin["OriginalBand"][0].toStdString(), "1"); - ASSERT_EQ(evenBandBin["OriginalBand"][1].toStdString(), "2"); + ASSERT_EQ(evenBandBin["FilterName"][0], "SHORT_UV"); + ASSERT_EQ(evenBandBin["FilterName"][1], "LONG_UV"); + ASSERT_EQ(evenBandBin["OriginalBand"][0], "1"); + ASSERT_EQ(evenBandBin["OriginalBand"][1], "2"); - ASSERT_EQ(evenBandBin["FilterName"][0].toStdString(), oddBandBin["FilterName"][0].toStdString()); - ASSERT_EQ(evenBandBin["FilterName"][1].toStdString(), oddBandBin["FilterName"][1].toStdString()); + ASSERT_EQ(evenBandBin["FilterName"][0], oddBandBin["FilterName"][0]); + ASSERT_EQ(evenBandBin["FilterName"][1], oddBandBin["FilterName"][1]); ASSERT_EQ(evenBandBin["OriginalBand"][0], oddBandBin["OriginalBand"][0]); ASSERT_EQ(evenBandBin["OriginalBand"][1], oddBandBin["OriginalBand"][1]); @@ -137,9 +137,9 @@ TEST(Marci2Isis, Marci2isisTestDefault) { PvlObject evenOgLbl = evenLabel->findObject("OriginalLabel"); PvlObject oddOgLbl = oddLabel->findObject("OriginalLabel"); - ASSERT_EQ(evenOgLbl["Name"][0].toStdString(), "IsisCube"); + ASSERT_EQ(evenOgLbl["Name"][0], "IsisCube"); ASSERT_EQ((int)evenOgLbl["StartByte"], 141313); - ASSERT_EQ(evenOgLbl["Name"][0].toStdString(), oddOgLbl["Name"][0].toStdString()); + ASSERT_EQ(evenOgLbl["Name"][0], oddOgLbl["Name"][0]); ASSERT_EQ((int)evenOgLbl["StartByte"], (int)oddOgLbl["StartByte"]); } @@ -215,18 +215,18 @@ TEST(Marci2Isis, Marci2isisTestVarExp) { // check and compare output ASSERT_EQ((int)instFlipped["DataFlipped"], 1); - ASSERT_EQ(instFlipped["FrameNumber"][0].toStdString(), "400"); - ASSERT_EQ(instFlipped["FrameNumber"][1].toStdString(), "64"); - ASSERT_EQ(instFlipped["FrameNumber"][2].toStdString(), "0"); - ASSERT_EQ(instFlipped["VariableExposureDuration"][0].toStdString(), "17.5"); - ASSERT_EQ(instFlipped["VariableExposureDuration"][1].toStdString(), "15"); - ASSERT_EQ(instFlipped["VariableExposureDuration"][2].toStdString(), "17.5"); + ASSERT_EQ(instFlipped["FrameNumber"][0], "400"); + ASSERT_EQ(instFlipped["FrameNumber"][1], "64"); + ASSERT_EQ(instFlipped["FrameNumber"][2], "0"); + ASSERT_EQ(instFlipped["VariableExposureDuration"][0], "17.5"); + ASSERT_EQ(instFlipped["VariableExposureDuration"][1], "15"); + ASSERT_EQ(instFlipped["VariableExposureDuration"][2], "17.5"); ASSERT_EQ((int)instUnflipped["DataFlipped"], 0); - ASSERT_EQ(instUnflipped["FrameNumber"][0].toStdString(), "0"); - ASSERT_EQ(instUnflipped["FrameNumber"][1].toStdString(), "64"); - ASSERT_EQ(instUnflipped["FrameNumber"][2].toStdString(), "400"); - ASSERT_EQ(instUnflipped["VariableExposureDuration"][0].toStdString(), "17.5"); - ASSERT_EQ(instUnflipped["VariableExposureDuration"][1].toStdString(), "15"); - ASSERT_EQ(instUnflipped["VariableExposureDuration"][2].toStdString(), "17.5"); + ASSERT_EQ(instUnflipped["FrameNumber"][0], "0"); + ASSERT_EQ(instUnflipped["FrameNumber"][1], "64"); + ASSERT_EQ(instUnflipped["FrameNumber"][2], "400"); + ASSERT_EQ(instUnflipped["VariableExposureDuration"][0], "17.5"); + ASSERT_EQ(instUnflipped["VariableExposureDuration"][1], "15"); + ASSERT_EQ(instUnflipped["VariableExposureDuration"][2], "17.5"); } diff --git a/isis/tests/FunctionalTestsMarcical.cpp b/isis/tests/FunctionalTestsMarcical.cpp index 07cae980f3..a19de770b9 100644 --- a/isis/tests/FunctionalTestsMarcical.cpp +++ b/isis/tests/FunctionalTestsMarcical.cpp @@ -29,9 +29,9 @@ TEST(Marcical, MarcicalTestDefault) { EXPECT_EQ( (int)dims["Bands"], 5 ); PvlGroup &inst = label->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ( inst["VariableExposureDuration"][0].toStdString(), "17.5" ); - EXPECT_EQ( inst["VariableExposureDuration"][1].toStdString(), "15.0" ); - EXPECT_EQ( inst["VariableExposureDuration"][2].toStdString(), "17.5" ); + EXPECT_EQ( inst["VariableExposureDuration"][0], "17.5" ); + EXPECT_EQ( inst["VariableExposureDuration"][1], "15.0" ); + EXPECT_EQ( inst["VariableExposureDuration"][2], "17.5" ); std::unique_ptr outHist (outCube.histogram()); EXPECT_NEAR( outHist->Average(), 0.046682, 1e-6 ); @@ -56,9 +56,9 @@ TEST(Marcical, MarcicalTestDefaultNoIof) { EXPECT_EQ( (int)dims["Bands"], 5 ); PvlGroup &inst = label->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ( inst["VariableExposureDuration"][0].toStdString(), "17.5" ); - EXPECT_EQ( inst["VariableExposureDuration"][1].toStdString(), "15.0" ); - EXPECT_EQ( inst["VariableExposureDuration"][2].toStdString(), "17.5" ); + EXPECT_EQ( inst["VariableExposureDuration"][0], "17.5" ); + EXPECT_EQ( inst["VariableExposureDuration"][1], "15.0" ); + EXPECT_EQ( inst["VariableExposureDuration"][2], "17.5" ); std::unique_ptr outHist (outCube.histogram()); EXPECT_NEAR( outHist->Average(), 11.78765, 1e-5); @@ -83,7 +83,7 @@ TEST(Marcical, MarcicalTestSingleDuration) { EXPECT_EQ( (int)dims["Bands"], 5 ); PvlGroup &inst = label->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ( inst["VariableExposureDuration"][0].toStdString(), "8.8" ); + EXPECT_EQ( inst["VariableExposureDuration"][0], "8.8" ); std::unique_ptr outHist (outCube.histogram()); EXPECT_NEAR( outHist->Average(), 0.00879284, 1e-7 ); @@ -108,7 +108,7 @@ TEST(Marcical, MarcicalTestSingleDurationNoIof) { EXPECT_EQ( (int)dims["Bands"], 5 ); PvlGroup &inst = label->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ( inst["VariableExposureDuration"][0].toStdString(), "8.8" ); + EXPECT_EQ( inst["VariableExposureDuration"][0], "8.8" ); std::unique_ptr outHist (outCube.histogram()); EXPECT_NEAR( outHist->Average(), 2.16086, 1e-4 ); diff --git a/isis/tests/FunctionalTestsMimap2isis.cpp b/isis/tests/FunctionalTestsMimap2isis.cpp index f9461b7264..df166870b6 100644 --- a/isis/tests/FunctionalTestsMimap2isis.cpp +++ b/isis/tests/FunctionalTestsMimap2isis.cpp @@ -37,274 +37,274 @@ TEST(FunctionalTestMimap2Isis, Default) { // Pixels Group PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pixels.findKeyword("Type"), "SignedWord"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, pixels.findKeyword("ByteOrder"), "Lsb"); - EXPECT_DOUBLE_EQ((double) pixels.findKeyword("Base"), 0.0); - EXPECT_DOUBLE_EQ((double) pixels.findKeyword("Multiplier"), 2.0e-05); + EXPECT_PRED_FORMAT2(AssertStringsEqual, pixels.findKeyword("Type"), "SignedWord"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, pixels.findKeyword("ByteOrder"), "Lsb"); + EXPECT_DOUBLE_EQ(std::stod( pixels.findKeyword("Base")), 0.0); + EXPECT_DOUBLE_EQ(std::stod( pixels.findKeyword("Multiplier")), 2.0e-05); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, inst.findKeyword("SpacecraftName"), "KAGUYA"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, inst.findKeyword("InstrumentName"), "Multiband Imager"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, inst.findKeyword("InstrumentId"), "MI"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, inst.findKeyword("TargetName"), "MOON"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, inst.findKeyword("ObservationModeId"), "NORMAL"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, inst.findKeyword("SensorDescription"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, inst.findKeyword("SpacecraftName"), "KAGUYA"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, inst.findKeyword("InstrumentName"), "Multiband Imager"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, inst.findKeyword("InstrumentId"), "MI"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, inst.findKeyword("TargetName"), "MOON"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, inst.findKeyword("ObservationModeId"), "NORMAL"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, inst.findKeyword("SensorDescription"), "MI is a multiband push-broom imaging camera consisting of VIS(V) and NIR(N) sensors (each has nadir-directed optics of f number 65 mm and F ratio 3.7). Detector pixel sizes in micron are 13(V) and 40(N)."); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, inst.findKeyword("SensorDescription2"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, inst.findKeyword("SensorDescription2"), "Physical band arrangement [from satellite -x to +x] are VIS1>VIS2>VIS5>VIS4>VIS3 and NIR3>NIR4>NIR1>NIR2. Parallax between nearest band sets [degree] are 2.7 for VIS and 2.6 for NIR. Sampling time [msec] are 13 for VIS and 39 for NIR."); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SoftwareName"), "RGC_TC_MI"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SoftwareVersion"), "2.10.1"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProcessVersionId"), "MAP"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductCreationTime"), "2011-10-25T04:31:02"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProgramStartTime"), "2011-10-25T04:25:07"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProducerId"), "LISM"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductSetId"), "MI_MAP"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductVersionId"), "02"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("RegisteredProduct"), "Y"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[0], "MV52A0_02NM04884_004_0030.img"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[1], "MV52A0_02NM04883_004_0030.img"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[2], "MV52A0_02NM04884_004_0029.img"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[3], "MV52A0_02NM04883_004_0029.img"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[4], "MV52A0_02NM04884_004_0028.img"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[5], "MV52A0_02NM04883_004_0028.img"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[6], "{MV22A0_02NL01385_002_0045.img, MV22A0_02NL01385_002_0044.img}"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[7], "{MV22A0_02NL01384_003_0045.img, MV22A0_02NL01384_003_0046.img}"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[8], "{MV22A0_02NL01385_002_0046.img, MV22A0_02NL01385_002_0045.img}"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[9], "{MV22A0_02NL01384_003_0047.img, MV22A0_02NL01384_003_0046.img}"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName")[10], "{MV22A0_02NL01385_002_0046.img, MV22A0_02NL01385_002_0047.img}"); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[0], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[1], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[2], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[3], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[4], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[5], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[6], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[7], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[8], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[9], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[10], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DataSetId"), "MI_MAP"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ImageValueType"), "REFLECTANCE"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ImageUnit"), "ND"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SoftwareName"), "RGC_TC_MI"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SoftwareVersion"), "2.10.1"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProcessVersionId"), "MAP"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductCreationTime"), "2011-10-25T04:31:02"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProgramStartTime"), "2011-10-25T04:25:07"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProducerId"), "LISM"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductSetId"), "MI_MAP"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductVersionId"), "02"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("RegisteredProduct"), "Y"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[0], "MV52A0_02NM04884_004_0030.img"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[1], "MV52A0_02NM04883_004_0030.img"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[2], "MV52A0_02NM04884_004_0029.img"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[3], "MV52A0_02NM04883_004_0029.img"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[4], "MV52A0_02NM04884_004_0028.img"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[5], "MV52A0_02NM04883_004_0028.img"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[6], "{MV22A0_02NL01385_002_0045.img, MV22A0_02NL01385_002_0044.img}"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[7], "{MV22A0_02NL01384_003_0045.img, MV22A0_02NL01384_003_0046.img}"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[8], "{MV22A0_02NL01385_002_0046.img, MV22A0_02NL01385_002_0045.img}"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[9], "{MV22A0_02NL01384_003_0047.img, MV22A0_02NL01384_003_0046.img}"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName")[10], "{MV22A0_02NL01385_002_0046.img, MV22A0_02NL01385_002_0047.img}"); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[0], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[1], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[2], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[3], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[4], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[5], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_LongCK_D_V02_de421_110706.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[6], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[7], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[8], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[9], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName")[10], "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_04_LongCK_D_de421_101125.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DataSetId"), "MI_MAP"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageValueType"), "REFLECTANCE"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageUnit"), "ND"); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("MinForStatisticalEvaluation")[i].toDouble(), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ((double) archive.findKeyword("MaxForStatisticalEvaluation")[i].toDouble(), 32767) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[0].toDouble(), 32268); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[1].toDouble(), 32178); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[2].toDouble(), 32562); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[3].toDouble(), 31727); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[4].toDouble(), 32684); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[5].toDouble(), 32528); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[6].toDouble(), 32179); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[7].toDouble(), 32293); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[8].toDouble(), 32433); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[0]), 32268); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[1]), 32178); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[2]), 32562); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[3]), 31727); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[4]), 32684); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[5]), 32528); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[6]), 32179); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[7]), 32293); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[8]), 32433); for (int i = 0; i < 7; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[i].toDouble(), 0) << "Error at index: " << i;; - } - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[8].toDouble(), 1); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[0].toDouble(), 3096.5); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[1].toDouble(), 5582.3); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[2].toDouble(), 5993.3); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[3].toDouble(), 6101.0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[4].toDouble(), 6480.5); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[5].toDouble(), 6425.4); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[6].toDouble(), 6767.4); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[7].toDouble(), 8075.3); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[8].toDouble(), 9526.2); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[0].toDouble(), 1232.1); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[1].toDouble(), 1933.4); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[2].toDouble(), 2080.3); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[3].toDouble(), 2053.8); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[4].toDouble(), 2138.1); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[5].toDouble(), 2049.9); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[6].toDouble(), 2110.4); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[7].toDouble(), 2367.1); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[8].toDouble(), 2629.7); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[0].toDouble(), 2980); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[1].toDouble(), 5635); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[2].toDouble(), 3); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[3].toDouble(), 6095); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[4].toDouble(), 6324); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[5].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[6].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[7].toDouble(), 7965); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[8].toDouble(), 9305); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[i]), 0) << "Error at index: " << i;; + } + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[8]), 1); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[0]), 3096.5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[1]), 5582.3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[2]), 5993.3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[3]), 6101.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[4]), 6480.5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[5]), 6425.4); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[6]), 6767.4); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[7]), 8075.3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[8]), 9526.2); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[0]), 1232.1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[1]), 1933.4); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[2]), 2080.3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[3]), 2053.8); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[4]), 2138.1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[5]), 2049.9); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[6]), 2110.4); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[7]), 2367.1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[8]), 2629.7); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[0]), 2980); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[1]), 5635); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[2]), 3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[3]), 6095); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[4]), 6324); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[5]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[6]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[7]), 7965); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[8]), 9305); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaMinimum")[i].toDouble(), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaMaximum")[i].toDouble(), 327) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[0].toDouble(), 2); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[1].toDouble(), 2); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[2].toDouble(), 2); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[3].toDouble(), 2); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[4].toDouble(), 1); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[5].toDouble(), 3); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[6].toDouble(), 2); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[7].toDouble(), 1); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[8].toDouble(), 1); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); - - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[0].toDouble(), -20000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[1].toDouble(), -21000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[2].toDouble(), -22000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[3].toDouble(), -23000); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[0], "(94, 365, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[1], "(176, 370, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[2], "(147, 378, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[3], "(228, 340, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[4], "(218, 386, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[5], "(161, 989, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[6], "(430, 774, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[7], "(162, 1245, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[8], "(585, 952, 0, 0)"); - - EXPECT_DOUBLE_EQ(archive.findKeyword("OutOfImageBoundsValue"), -30000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaMaximum")[i]), 327) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[0]), 2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[1]), 2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[2]), 2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[3]), 2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[4]), 1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[5]), 3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[6]), 2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[7]), 1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[8]), 1); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[0]), -20000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[1]), -21000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[2]), -22000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[3]), -23000); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[0], "(94, 365, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[1], "(176, 370, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[2], "(147, 378, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[3], "(228, 340, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[4], "(218, 386, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[5], "(161, 989, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[6], "(430, 774, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[7], "(162, 1245, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[8], "(585, 952, 0, 0)"); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("OutOfImageBoundsValue")), -30000); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("OutOfImageBoundsPixel")[i].toDouble(), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("OutOfImageBoundsPixel")[i]), 0) << "Error at index: " << i; } - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("StretchedFlag"), "FALSE"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("StretchedFlag"), "FALSE"); for (int i = 0; i < 6; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DarkFileName")[i], "{MIV_DRK_04724_05494_M___002.csv, MIN_DRK_04724_05494_M___002.csv}") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DarkFileName")[i], "{MIV_DRK_04724_05494_M___002.csv, MIN_DRK_04724_05494_M___002.csv}") << "Error at index: " << i; } for (int i = 6; i < 11; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DarkFileName")[i], "{MIN_DRK_01226_01571_L___002.csv, MIV_DRK_01226_01571_L___002.csv}") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DarkFileName")[i], "{MIN_DRK_01226_01571_L___002.csv, MIV_DRK_01226_01571_L___002.csv}") << "Error at index: " << i; } for (int i = 0; i < 11; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FtFileName")[i], "MIV_FTF_PRFLT_N___v01.csv") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FtFileName")[i], "MIV_FTF_PRFLT_N___v01.csv") << "Error at index: " << i; } for (int i = 0; i < 6; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FlatFileName")[i], "{MIV_FLT_04724_05494_N___002.csv, MIN_FLT_04724_05494_N___002.csv}") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FlatFileName")[i], "{MIV_FLT_04724_05494_N___002.csv, MIN_FLT_04724_05494_N___002.csv}") << "Error at index: " << i; } for (int i = 6; i < 11; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FlatFileName")[i], "{MIV_FLT_01226_01571_L___002.csv, MIN_FLT_01226_01571_L___002.csv}") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FlatFileName")[i], "{MIV_FLT_01226_01571_L___002.csv, MIN_FLT_01226_01571_L___002.csv}") << "Error at index: " << i; } for (int i = 0; i < 11; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("EfficFileName")[i], "{MIN_EFF_PRFLT_N___v01.csv, MIV_EFF_PRFLT_N___v01.csv}") << "Error at index: " << i; - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("NonlinFileName")[i], "{MIV_NLT_PRFLT_N___v01.csv, MIN_NLT_PRFLT_N___v01.csv}") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("EfficFileName")[i], "{MIN_EFF_PRFLT_N___v01.csv, MIV_EFF_PRFLT_N___v01.csv}") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[i], "{MIV_NLT_PRFLT_N___v01.csv, MIN_NLT_PRFLT_N___v01.csv}") << "Error at index: " << i; } for (int i = 0; i < 11; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("RadCnvCoef")[i], "(1.470593, 2.204781, 2.244315, 2.734361, 1.885889, 3.04924, 3.312096, 4.788256, 7.969085)") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("RadCnvCoef")[i], "(1.470593, 2.204781, 2.244315, 2.734361, 1.885889, 3.04924, 3.312096, 4.788256, 7.969085)") << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[0].toDouble(), 0.002353311); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[1].toDouble(), 0.002450451); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[2].toDouble(), 0.003549924); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[3].toDouble(), 0.003886012); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[4].toDouble(), 0.004316842); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[5].toDouble(), 0.004316842); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[6].toDouble(), 0.004893535); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[7].toDouble(), 0.007400877); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[8].toDouble(), 0.01218292); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[0].toDouble(), 30.0); - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[1].toDouble(), 0.0); - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[2].toDouble(), 30.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[0]), 30.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[1]), 0.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[2]), 30.0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[0], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05678, 1.913, 0.0643, 0.2448, 0.0, 0.0, 0.0, 0.06797, 1.3, -0.0144, 0.2441, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[1], "(0.5, -0.019, 0.000242, -1.46e-06, 0.06921, 1.487, -0.0382, 0.2122, 0.0, 0.0, 0.0, 0.08916, 0.997, -0.2526, 0.1986, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[2], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05908, 1.43, 0.056, 0.227, 0.0, 0.0, 0.0, 0.09298, 0.918, -0.2251, 0.198, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[3], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05345, 1.413, 0.1263, 0.2409, 0.0, 0.0, 0.0, 0.08705, 0.883, -0.1655, 0.2052, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[4], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[5], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[6], "(0.5, -0.019, 0.000242, -1.46e-06, 0.03968, 1.335, 0.1809, 0.2632, 0.0, 0.0, 0.0, 0.09486, 0.843, -0.2059, 0.1958, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[7], "(0.5, -0.019, 0.000242, -1.46e-06, 0.06407, 1.103, -0.0062, 0.2168, 0.0, 0.0, 0.0, 0.11201, 0.773, -0.3129, 0.175, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[8], "(0.5, -0.019, 0.000242, -1.46e-06, 0.09175, 0.954, 0.0111, 0.1967, 0.0, 0.0, 0.0, 0.12374, 0.692, -0.2914, 0.1648, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[0], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05678, 1.913, 0.0643, 0.2448, 0.0, 0.0, 0.0, 0.06797, 1.3, -0.0144, 0.2441, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[1], "(0.5, -0.019, 0.000242, -1.46e-06, 0.06921, 1.487, -0.0382, 0.2122, 0.0, 0.0, 0.0, 0.08916, 0.997, -0.2526, 0.1986, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[2], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05908, 1.43, 0.056, 0.227, 0.0, 0.0, 0.0, 0.09298, 0.918, -0.2251, 0.198, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[3], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05345, 1.413, 0.1263, 0.2409, 0.0, 0.0, 0.0, 0.08705, 0.883, -0.1655, 0.2052, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[4], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[5], "(0.5, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[6], "(0.5, -0.019, 0.000242, -1.46e-06, 0.03968, 1.335, 0.1809, 0.2632, 0.0, 0.0, 0.0, 0.09486, 0.843, -0.2059, 0.1958, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[7], "(0.5, -0.019, 0.000242, -1.46e-06, 0.06407, 1.103, -0.0062, 0.2168, 0.0, 0.0, 0.0, 0.11201, 0.773, -0.3129, 0.175, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[8], "(0.5, -0.019, 0.000242, -1.46e-06, 0.09175, 0.954, 0.0111, 0.1967, 0.0, 0.0, 0.0, 0.12374, 0.692, -0.2914, 0.1648, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ResamplingMethod"), "Bi-Linear"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ResamplingMethod"), "Bi-Linear"); for (int i = 0; i < 11; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("TcoMosaicFileName")[i], "N/A") << "Error at index: " << i; - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DtmMosaicFileName")[i], "N/A") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("TcoMosaicFileName")[i], "N/A") << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DtmMosaicFileName")[i], "N/A") << "Error at index: " << i; } - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("OverlapSelectionId"), + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("OverlapSelectionId"), "Prioritized order : nominal mission period and phase angle closer to the standard geometry"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("MatchingMosaic"), "N/A"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("MatchingMosaic"), "N/A"); for (int i = 0; i < 5; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aDeadPixelThreshold")[i].toDouble(), 35) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aSaturationThreshold")[i].toDouble(), 1023) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("DarkValidMinimum")[i].toDouble(), -3) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aDeadPixelThreshold")[i].toDouble(), 200) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aSaturationThreshold")[i].toDouble(), 4095) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("DarkValidMinimum")[i].toDouble(), -10) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(archive.findKeyword("FtValidMinimum"), -2); - EXPECT_DOUBLE_EQ(archive.findKeyword("RadianceSaturationThreshold"), 425.971); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefSaturationThreshold"), 0.65534); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("FtValidMinimum")), -2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RadianceSaturationThreshold")), 425.971); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefSaturationThreshold")), 0.65534); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); for (int i = 0; i < 5; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + QString::number(i + 1)) << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + std::to_string(i + 1)) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + QString::number(i - 4)) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[0].toDouble(), 414.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[1].toDouble(), 749.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[2].toDouble(), 901.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[3].toDouble(), 950.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[4].toDouble(), 1001.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[5].toDouble(), 1000.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[6].toDouble(), 1049.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[7].toDouble(), 1248.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[8].toDouble(), 1548.0); - - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[0].toDouble(), 20.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[1].toDouble(), 12.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[2].toDouble(), 21.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[3].toDouble(), 30.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[4].toDouble(), 42.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[5].toDouble(), 27.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[6].toDouble(), 28.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[7].toDouble(), 33.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[8].toDouble(), 48.0); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + std::to_string(i - 4)) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[0]), 414.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[1]), 749.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[2]), 901.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[3]), 950.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[4]), 1001.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[5]), 1000.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[6]), 1049.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[7]), 1248.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[8]), 1548.0); + + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[0]), 20.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[1]), 12.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[2]), 21.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[3]), 30.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[4]), 42.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[5]), 27.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[6]), 28.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[7]), 33.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[8]), 48.0); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); // Mappihg Group PvlGroup &mapping = isisLabel->findGroup("Mapping", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapping.findKeyword("ProjectionName"), "SimpleCylindrical"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "SimpleCylindrical"); EXPECT_DOUBLE_EQ(mapping.findKeyword("CenterLongitude"), 0.0); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapping.findKeyword("TargetName"), "Moon"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Moon"); EXPECT_DOUBLE_EQ(mapping.findKeyword("EquatorialRadius"), 1737400); EXPECT_DOUBLE_EQ(mapping.findKeyword("PolarRadius"), 1737400); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapping.findKeyword("LatitudeType"), "Planetocentric"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, mapping.findKeyword("LongitudeDirection"), "PositiveEast"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LatitudeType"), "Planetocentric"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("LongitudeDirection"), "PositiveEast"); EXPECT_DOUBLE_EQ(mapping.findKeyword("LongitudeDomain"), 360); EXPECT_DOUBLE_EQ(mapping.findKeyword("MinimumLatitude"), 64.00048828); EXPECT_DOUBLE_EQ(mapping.findKeyword("MaximumLatitude"), 65.0); @@ -334,212 +334,212 @@ TEST(FunctionalTestMimap2Isis, L3C) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SoftwareName"), "RGC_TC_MI_PLUS"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SoftwareVersion"), "4.0.0"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProcessVersionId"), "L3C"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductCreationTime"), "2014-11-15T12:08:44"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProgramStartTime"), "2014-11-13T04:40:05"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProducerId"), "LISM"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductSetId"), "MI_Level3C5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductVersionId"), "03"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("RegisteredProduct"), "Y"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("Level2AFileName"), "MV52A0_02NL01351_003_0029.img"); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName"), "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_100h_02_LongCK_DS_V02_de421_131210.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DataSetId"), "MI_L3C"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ImageValueType"), "REFLECTANCE"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ImageUnit"), "ND"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SoftwareName"), "RGC_TC_MI_PLUS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SoftwareVersion"), "4.0.0"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProcessVersionId"), "L3C"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductCreationTime"), "2014-11-15T12:08:44"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProgramStartTime"), "2014-11-13T04:40:05"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProducerId"), "LISM"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductSetId"), "MI_Level3C5"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductVersionId"), "03"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("RegisteredProduct"), "Y"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("Level2AFileName"), "MV52A0_02NL01351_003_0029.img"); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName"), "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_100h_02_LongCK_DS_V02_de421_131210.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DataSetId"), "MI_L3C"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageValueType"), "REFLECTANCE"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageUnit"), "ND"); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("MinForStatisticalEvaluation")[i].toDouble(), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ((double) archive.findKeyword("MaxForStatisticalEvaluation")[i].toDouble(), 32767) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[0].toDouble(), 20866); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[1].toDouble(), 31905); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[2].toDouble(), 32710); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[3].toDouble(), 32352); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[4].toDouble(), 32589); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[5].toDouble(), 32644); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[6].toDouble(), 32670); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[7].toDouble(), 32720); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[8].toDouble(), 32673); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[0].toDouble(), 6); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[1].toDouble(), 14); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[2].toDouble(), 12); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[3].toDouble(), 18); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[4].toDouble(), 23); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[5].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[6].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[7].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[8].toDouble(), 11); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[0].toDouble(), 5313.7); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[1].toDouble(), 9108.2); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[2].toDouble(), 9735.2); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[3].toDouble(), 9950.5); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[4].toDouble(), 10454.1); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[5].toDouble(), 9948.5); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[6].toDouble(), 10312.5); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[7].toDouble(), 11676.5); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[8].toDouble(), 13360.7); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[0].toDouble(), 2756.2); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[1].toDouble(), 4579.0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[2].toDouble(), 5173.3); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[3].toDouble(), 4877.5); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[4].toDouble(), 5046.1); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[5].toDouble(), 5216.4); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[6].toDouble(), 5294.5); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[7].toDouble(), 5561.1); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[8].toDouble(), 5645.0); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[0].toDouble(), 4834); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[1].toDouble(), 8614); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[2].toDouble(), 8969); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[3].toDouble(), 9179); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[4].toDouble(), 9650); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[5].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[6].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[7].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[8].toDouble(), 13310); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod( archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[0]), 20866); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[1]), 31905); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[2]), 32710); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[3]), 32352); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[4]), 32589); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[5]), 32644); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[6]), 32670); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[7]), 32720); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[8]), 32673); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[0]), 6); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[1]), 14); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[2]), 12); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[3]), 18); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[4]), 23); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[5]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[6]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[7]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[8]), 11); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[0]), 5313.7); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[1]), 9108.2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[2]), 9735.2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[3]), 9950.5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[4]), 10454.1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[5]), 9948.5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[6]), 10312.5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[7]), 11676.5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[8]), 13360.7); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[0]), 2756.2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[1]), 4579.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[2]), 5173.3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[3]), 4877.5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[4]), 5046.1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[5]), 5216.4); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[6]), 5294.5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[7]), 5561.1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[8]), 5645.0); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[0]), 4834); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[1]), 8614); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[2]), 8969); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[3]), 9179); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[4]), 9650); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[5]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[6]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[7]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[8]), 13310); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaMinimum")[i].toDouble(), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaMaximum")[i].toDouble(), 500) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[0].toDouble(), 1); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[1].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[2].toDouble(), 1); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[3].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[4].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[5].toDouble(), 6); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[6].toDouble(), 5); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[7].toDouble(), 2); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[8].toDouble(), 0); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); - - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[0].toDouble(), -20000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[1].toDouble(), -21000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[2].toDouble(), -22000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[3].toDouble(), -23000); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[0], "(100, 0, 0, 7)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[1], "(2956, 0, 0, 622)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[2], "(11715, 0, 0, 6064)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[3], "(7400, 0, 0, 2574)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[4], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[5], "(19830, 2905, 0, 59224)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[6], "(22289, 890, 0, 61386)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[7], "(33821, 135, 0, 112625)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[8], "(51843, 162, 0, 209314)"); - - EXPECT_DOUBLE_EQ(archive.findKeyword("OutOfImageBoundsValue"), -30000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaMaximum")[i]), 500) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[0]), 1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[1]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[2]), 1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[3]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[4]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[5]), 6); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[6]), 5); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[7]), 2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[8]), 0); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[0]), -20000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[1]), -21000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[2]), -22000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[3]), -23000); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[0], "(100, 0, 0, 7)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[1], "(2956, 0, 0, 622)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[2], "(11715, 0, 0, 6064)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[3], "(7400, 0, 0, 2574)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[4], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[5], "(19830, 2905, 0, 59224)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[6], "(22289, 890, 0, 61386)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[7], "(33821, 135, 0, 112625)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[8], "(51843, 162, 0, 209314)"); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("OutOfImageBoundsValue")), -30000); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("OutOfImageBoundsPixel")[i].toDouble(), 1642126) << "Error at index: " << i; - } - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DarkFileName")[0], "MIN_DRK_01313_01398_L___003.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DarkFileName")[1], "MIV_DRK_01226_01571_L___002.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FtFileName"), "MIV_FTF_PRFLT_N___v01.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FlatFileName")[0], "MIN_FLT_01226_01571_L___003.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FlatFileName")[1], "MIV_FLT_01226_01571_L___002.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("EfficFileName")[0], "MIV_EFF_PRFLT_N___v01.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("EfficFileName")[1], "MIN_EFF_PRFLT_N___v01.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("NonlinFileName")[0], "MIN_NLT_PRFLT_N___v01.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("NonlinFileName")[1], "MIV_NLT_PRFLT_N___v01.csv"); - - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[0].toDouble(), 1.470593, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[1].toDouble(), 2.204781, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[2].toDouble(), 2.244315, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[3].toDouble(), 2.734361, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[4].toDouble(), 1.885889, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[5].toDouble(), 3.04924, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[6].toDouble(), 3.312096, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[7].toDouble(), 4.788256, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[8].toDouble(), 7.969085, .000001); - - - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[0].toDouble(), 0.002353311); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[1].toDouble(), 0.002450451); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[2].toDouble(), 0.003549924); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[3].toDouble(), 0.003886012); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[4].toDouble(), 0.004316842); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[5].toDouble(), 0.004316842); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[6].toDouble(), 0.004893535); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[7].toDouble(), 0.007400877); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[8].toDouble(), 0.01218292); - - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[0].toDouble(), 30.0); - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[1].toDouble(), 0.0); - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[2].toDouble(), 30.0); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[0], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05678, 1.913, 0.0643, 0.2448, 0.0, 0.0, 0.0, 0.06797, 1.3, -0.0144, 0.2441, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[1], "(1.0, -0.019, 0.000242, -1.46e-06, 0.06921, 1.487, -0.0382, 0.2122, 0.0, 0.0, 0.0, 0.08916, 0.997, -0.2526, 0.1986, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[2], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05908, 1.43, 0.056, 0.227, 0.0, 0.0, 0.0, 0.09298, 0.918, -0.2251, 0.198, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[3], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05345, 1.413, 0.1263, 0.2409, 0.0, 0.0, 0.0, 0.08705, 0.883, -0.1655, 0.2052, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[4], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[5], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[6], "(1.0, -0.019, 0.000242, -1.46e-06, 0.03968, 1.335, 0.1809, 0.2632, 0.0, 0.0, 0.0, 0.09486, 0.843, -0.2059, 0.1958, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[7], "(1.0, -0.019, 0.000242, -1.46e-06, 0.06407, 1.103, -0.0062, 0.2168, 0.0, 0.0, 0.0, 0.11201, 0.773, -0.3129, 0.175, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[8], "(1.0, -0.019, 0.000242, -1.46e-06, 0.09175, 0.954, 0.0111, 0.1967, 0.0, 0.0, 0.0, 0.12374, 0.692, -0.2914, 0.1648, -0.00265, 0.00174, -0.000381)"); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ResamplingMethod"), "Bi-Linear"); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("OutOfImageBoundsPixel")[i]), 1642126) << "Error at index: " << i; + } + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DarkFileName")[0], "MIN_DRK_01313_01398_L___003.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DarkFileName")[1], "MIV_DRK_01226_01571_L___002.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FtFileName"), "MIV_FTF_PRFLT_N___v01.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FlatFileName")[0], "MIN_FLT_01226_01571_L___003.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FlatFileName")[1], "MIV_FLT_01226_01571_L___002.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("EfficFileName")[0], "MIV_EFF_PRFLT_N___v01.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("EfficFileName")[1], "MIN_EFF_PRFLT_N___v01.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[0], "MIN_NLT_PRFLT_N___v01.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[1], "MIV_NLT_PRFLT_N___v01.csv"); + + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[0]), 1.470593, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[1]), 2.204781, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[2]), 2.244315, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[3]), 2.734361, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[4]), 1.885889, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[5]), 3.04924, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[6]), 3.312096, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[7]), 4.788256, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[8]), 7.969085, .000001); + + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[0]), 30.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[1]), 0.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[2]), 30.0); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[0], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05678, 1.913, 0.0643, 0.2448, 0.0, 0.0, 0.0, 0.06797, 1.3, -0.0144, 0.2441, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[1], "(1.0, -0.019, 0.000242, -1.46e-06, 0.06921, 1.487, -0.0382, 0.2122, 0.0, 0.0, 0.0, 0.08916, 0.997, -0.2526, 0.1986, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[2], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05908, 1.43, 0.056, 0.227, 0.0, 0.0, 0.0, 0.09298, 0.918, -0.2251, 0.198, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[3], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05345, 1.413, 0.1263, 0.2409, 0.0, 0.0, 0.0, 0.08705, 0.883, -0.1655, 0.2052, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[4], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[5], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[6], "(1.0, -0.019, 0.000242, -1.46e-06, 0.03968, 1.335, 0.1809, 0.2632, 0.0, 0.0, 0.0, 0.09486, 0.843, -0.2059, 0.1958, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[7], "(1.0, -0.019, 0.000242, -1.46e-06, 0.06407, 1.103, -0.0062, 0.2168, 0.0, 0.0, 0.0, 0.11201, 0.773, -0.3129, 0.175, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[8], "(1.0, -0.019, 0.000242, -1.46e-06, 0.09175, 0.954, 0.0111, 0.1967, 0.0, 0.0, 0.0, 0.12374, 0.692, -0.2914, 0.1648, -0.00265, 0.00174, -0.000381)"); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ResamplingMethod"), "Bi-Linear"); for (int i = 0; i < 5; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aDeadPixelThreshold")[i].toDouble(), 35) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aSaturationThreshold")[i].toDouble(), 1023) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("DarkValidMinimum")[i].toDouble(), -3) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aDeadPixelThreshold")[i].toDouble(), 200) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aSaturationThreshold")[i].toDouble(), 4095) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("DarkValidMinimum")[i].toDouble(), -10) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(archive.findKeyword("FtValidMinimum"), -2); - EXPECT_DOUBLE_EQ(archive.findKeyword("RadianceSaturationThreshold"), 425.971); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefSaturationThreshold"), 0.65534); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("FtValidMinimum")), -2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RadianceSaturationThreshold")), 425.971); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefSaturationThreshold")), 0.65534); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); for (int i = 0; i < 5; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + QString::number(i + 1)) << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + std::to_string(i + 1)) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + QString::number(i - 4)) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[0].toDouble(), 414.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[1].toDouble(), 749.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[2].toDouble(), 901.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[3].toDouble(), 950.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[4].toDouble(), 1001.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[5].toDouble(), 1000.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[6].toDouble(), 1049.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[7].toDouble(), 1248.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[8].toDouble(), 1548.0); - - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[0].toDouble(), 20.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[1].toDouble(), 12.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[2].toDouble(), 21.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[3].toDouble(), 30.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[4].toDouble(), 42.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[5].toDouble(), 27.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[6].toDouble(), 28.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[7].toDouble(), 33.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[8].toDouble(), 48.0); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + std::to_string(i - 4)) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[0]), 414.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[1]), 749.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[2]), 901.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[3]), 950.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[4]), 1001.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[5]), 1000.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[6]), 1049.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[7]), 1248.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[8]), 1548.0); + + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[0]), 20.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[1]), 12.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[2]), 21.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[3]), 30.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[4]), 42.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[5]), 27.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[6]), 28.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[7]), 33.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[8]), 48.0); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); } TEST(FunctionalTestMimap2Isis, MAPv3) { @@ -562,211 +562,211 @@ TEST(FunctionalTestMimap2Isis, MAPv3) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SoftwareName"), "RGC_TC_MI_PLUS"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SoftwareVersion"), "4.0.0"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProcessVersionId"), "MAP"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductCreationTime"), "2015-01-02T01:45:16"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProgramStartTime"), "2015-01-02T01:43:13"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProducerId"), "LISM"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductSetId"), "MI_MAP"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ProductVersionId"), "03"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("RegisteredProduct"), "Y"); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("SpiceMetakernelFileName"), "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_100h_02_LongCK_DS_V02_de421_131210.mk"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DataSetId"), "SLN-L-MI-5-MAP-V3.0"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ImageValueType"), "REFLECTANCE"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ImageUnit"), "ND"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SoftwareName"), "RGC_TC_MI_PLUS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SoftwareVersion"), "4.0.0"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProcessVersionId"), "MAP"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductCreationTime"), "2015-01-02T01:45:16"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProgramStartTime"), "2015-01-02T01:43:13"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProducerId"), "LISM"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductSetId"), "MI_MAP"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ProductVersionId"), "03"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("RegisteredProduct"), "Y"); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("SpiceMetakernelFileName"), "RGC_INF_TCv401IK_MIv200IK_SPv105IK_RISE100i_05_100h_02_LongCK_DS_V02_de421_131210.mk"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DataSetId"), "SLN-L-MI-5-MAP-V3.0"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageValueType"), "REFLECTANCE"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageUnit"), "ND"); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("MinForStatisticalEvaluation")[i].toDouble(), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ((double) archive.findKeyword("MaxForStatisticalEvaluation")[i].toDouble(), 32767) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[0].toDouble(), 11914); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[1].toDouble(), 18693); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[2].toDouble(), 22004); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[3].toDouble(), 21392); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[4].toDouble(), 22057); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[5].toDouble(), 19521); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[6].toDouble(), 20790); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[7].toDouble(), 22610); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMaximumDn")[8].toDouble(), 27149); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[0].toDouble(), 2336); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[1].toDouble(), 4236); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[2].toDouble(), 4020); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[3].toDouble(), 4643); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[4].toDouble(), 4957); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[5].toDouble(), 5559); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[6].toDouble(), 5804); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[7].toDouble(), 6892); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneMinimumDn")[8].toDouble(), 8121); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[0].toDouble(), 3739.9); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[1].toDouble(), 6790.8); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[2].toDouble(), 7729.2); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[3].toDouble(), 7954.9); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[4].toDouble(), 8312.9); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[5].toDouble(), 8080.9); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[6].toDouble(), 8416.3); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[7].toDouble(), 9692.3); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneAverageDn")[8].toDouble(), 11512.4); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[0].toDouble(), 528.9); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[1].toDouble(), 785.4); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[2].toDouble(), 860.7); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[3].toDouble(), 826.7); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[4].toDouble(), 837.4); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[5].toDouble(), 798.7); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[6].toDouble(), 837.1); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[7].toDouble(), 882.8); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneStdevDn")[8].toDouble(), 1005.1); - - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[0].toDouble(), 3495); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[1].toDouble(), 6483); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[2].toDouble(), 7484); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[3].toDouble(), 7645); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[4].toDouble(), 8086); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[5].toDouble(), 7789); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[6].toDouble(), 8103); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[7].toDouble(), 9429); - EXPECT_DOUBLE_EQ(archive.findKeyword("SceneModeDn")[8].toDouble(), 11274); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[0]), 11914); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[1]), 18693); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[2]), 22004); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[3]), 21392); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[4]), 22057); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[5]), 19521); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[6]), 20790); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[7]), 22610); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMaximumDn")[8]), 27149); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[0]), 2336); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[1]), 4236); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[2]), 4020); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[3]), 4643); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[4]), 4957); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[5]), 5559); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[6]), 5804); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[7]), 6892); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneMinimumDn")[8]), 8121); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[0]), 3739.9); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[1]), 6790.8); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[2]), 7729.2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[3]), 7954.9); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[4]), 8312.9); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[5]), 8080.9); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[6]), 8416.3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[7]), 9692.3); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneAverageDn")[8]), 11512.4); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[0]), 528.9); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[1]), 785.4); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[2]), 860.7); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[3]), 826.7); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[4]), 837.4); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[5]), 798.7); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[6]), 837.1); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[7]), 882.8); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneStdevDn")[8]), 1005.1); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[0]), 3495); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[1]), 6483); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[2]), 7484); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[3]), 7645); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[4]), 8086); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[5]), 7789); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[6]), 8103); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[7]), 9429); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("SceneModeDn")[8]), 11274); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaMinimum")[i].toDouble(), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaMaximum")[i].toDouble(), 500) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[0].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[1].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[2].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[3].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[4].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[5].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[6].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[7].toDouble(), 0); - EXPECT_DOUBLE_EQ(archive.findKeyword("ShadowedAreaPercentage")[8].toDouble(), 0); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); - - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[0].toDouble(), -20000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[1].toDouble(), -21000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[2].toDouble(), -22000); - EXPECT_DOUBLE_EQ(archive.findKeyword("InvalidValue")[3].toDouble(), -23000); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[0], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[1], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[2], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[3], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[4], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[5], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[6], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[7], "(0, 0, 0, 0)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("InvalidPixels")[8], "(0, 0, 0, 0)"); - - EXPECT_DOUBLE_EQ(archive.findKeyword("OutOfImageBoundsValue"), -30000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaMaximum")[i]), 500) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[0]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[1]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[2]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[3]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[4]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[5]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[6]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[7]), 0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("ShadowedAreaPercentage")[8]), 0); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[0]), -20000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[1]), -21000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[2]), -22000); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("InvalidValue")[3]), -23000); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[0], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[1], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[2], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[3], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[4], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[5], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[6], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[7], "(0, 0, 0, 0)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[8], "(0, 0, 0, 0)"); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("OutOfImageBoundsValue")), -30000); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("OutOfImageBoundsPixel")[i].toDouble(), 0) << "Error at index: " << i; - } - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DarkFileName")[0], "MIV_DRK_04375_04723_S___002.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("DarkFileName")[1], "MIN_DRK_04375_04460_S___003.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FtFileName"), "MIV_FTF_PRFLT_N___v01.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FlatFileName")[0], "MIV_FLT_04375_04723_N___002.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("FlatFileName")[1], "MIN_FLT_04375_04460_S___003.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("EfficFileName")[0], "MIV_EFF_PRFLT_N___v01.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("EfficFileName")[1], "MIN_EFF_PRFLT_N___v01.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("NonlinFileName")[0], "MIV_NLT_PRFLT_N___v01.csv"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("NonlinFileName")[1], "MIN_NLT_PRFLT_N___v01.csv"); - - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[0].toDouble(), 1.470593, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[1].toDouble(), 2.204781, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[2].toDouble(), 2.244315, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[3].toDouble(), 2.734361, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[4].toDouble(), 1.885889, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[5].toDouble(), 3.04924, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[6].toDouble(), 3.312096, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[7].toDouble(), 4.788256, .000001); - EXPECT_NEAR(archive.findKeyword("RadCnvCoef")[8].toDouble(), 7.969085, .000001); - - - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[0].toDouble(), 0.002353311); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[1].toDouble(), 0.002450451); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[2].toDouble(), 0.003549924); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[3].toDouble(), 0.003886012); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[4].toDouble(), 0.004316842); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[5].toDouble(), 0.004316842); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[6].toDouble(), 0.004893535); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[7].toDouble(), 0.007400877); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefCnvCoef")[8].toDouble(), 0.01218292); - - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[0].toDouble(), 30.0); - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[1].toDouble(), 0.0); - EXPECT_DOUBLE_EQ(archive.findKeyword("StandardGeometry")[2].toDouble(), 30.0); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[0], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05678, 1.913, 0.0643, 0.2448, 0.0, 0.0, 0.0, 0.06797, 1.3, -0.0144, 0.2441, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[1], "(1.0, -0.019, 0.000242, -1.46e-06, 0.06921, 1.487, -0.0382, 0.2122, 0.0, 0.0, 0.0, 0.08916, 0.997, -0.2526, 0.1986, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[2], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05908, 1.43, 0.056, 0.227, 0.0, 0.0, 0.0, 0.09298, 0.918, -0.2251, 0.198, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[3], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05345, 1.413, 0.1263, 0.2409, 0.0, 0.0, 0.0, 0.08705, 0.883, -0.1655, 0.2052, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[4], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[5], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[6], "(1.0, -0.019, 0.000242, -1.46e-06, 0.03968, 1.335, 0.1809, 0.2632, 0.0, 0.0, 0.0, 0.09486, 0.843, -0.2059, 0.1958, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[7], "(1.0, -0.019, 0.000242, -1.46e-06, 0.06407, 1.103, -0.0062, 0.2168, 0.0, 0.0, 0.0, 0.11201, 0.773, -0.3129, 0.175, -0.00265, 0.00174, -0.000381)"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("PhotoCorrCoef")[8], "(1.0, -0.019, 0.000242, -1.46e-06, 0.09175, 0.954, 0.0111, 0.1967, 0.0, 0.0, 0.0, 0.12374, 0.692, -0.2914, 0.1648, -0.00265, 0.00174, -0.000381)"); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, archive.findKeyword("ResamplingMethod"), "Bi-Linear"); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("OutOfImageBoundsPixel")[i]), 0) << "Error at index: " << i; + } + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DarkFileName")[0], "MIV_DRK_04375_04723_S___002.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DarkFileName")[1], "MIN_DRK_04375_04460_S___003.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FtFileName"), "MIV_FTF_PRFLT_N___v01.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FlatFileName")[0], "MIV_FLT_04375_04723_N___002.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("FlatFileName")[1], "MIN_FLT_04375_04460_S___003.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("EfficFileName")[0], "MIV_EFF_PRFLT_N___v01.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("EfficFileName")[1], "MIN_EFF_PRFLT_N___v01.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[0], "MIV_NLT_PRFLT_N___v01.csv"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[1], "MIN_NLT_PRFLT_N___v01.csv"); + + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[0]), 1.470593, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[1]), 2.204781, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[2]), 2.244315, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[3]), 2.734361, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[4]), 1.885889, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[5]), 3.04924, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[6]), 3.312096, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[7]), 4.788256, .000001); + EXPECT_NEAR(std::stod(archive.findKeyword("RadCnvCoef")[8]), 7.969085, .000001); + + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); + + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[0]), 30.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[1]), 0.0); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("StandardGeometry")[2]), 30.0); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[0], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05678, 1.913, 0.0643, 0.2448, 0.0, 0.0, 0.0, 0.06797, 1.3, -0.0144, 0.2441, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[1], "(1.0, -0.019, 0.000242, -1.46e-06, 0.06921, 1.487, -0.0382, 0.2122, 0.0, 0.0, 0.0, 0.08916, 0.997, -0.2526, 0.1986, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[2], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05908, 1.43, 0.056, 0.227, 0.0, 0.0, 0.0, 0.09298, 0.918, -0.2251, 0.198, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[3], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05345, 1.413, 0.1263, 0.2409, 0.0, 0.0, 0.0, 0.08705, 0.883, -0.1655, 0.2052, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[4], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[5], "(1.0, -0.019, 0.000242, -1.46e-06, 0.05096, 1.377, 0.0736, 0.2383, 0.0, 0.0, 0.0, 0.09746, 0.889, -0.2248, 0.1933, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[6], "(1.0, -0.019, 0.000242, -1.46e-06, 0.03968, 1.335, 0.1809, 0.2632, 0.0, 0.0, 0.0, 0.09486, 0.843, -0.2059, 0.1958, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[7], "(1.0, -0.019, 0.000242, -1.46e-06, 0.06407, 1.103, -0.0062, 0.2168, 0.0, 0.0, 0.0, 0.11201, 0.773, -0.3129, 0.175, -0.00265, 0.00174, -0.000381)"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrCoef")[8], "(1.0, -0.019, 0.000242, -1.46e-06, 0.09175, 0.954, 0.0111, 0.1967, 0.0, 0.0, 0.0, 0.12374, 0.692, -0.2914, 0.1648, -0.00265, 0.00174, -0.000381)"); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ResamplingMethod"), "Bi-Linear"); for (int i = 0; i < 5; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aDeadPixelThreshold")[i].toDouble(), 35) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aSaturationThreshold")[i].toDouble(), 1023) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("DarkValidMinimum")[i].toDouble(), -3) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aDeadPixelThreshold")[i].toDouble(), 200) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("L2aSaturationThreshold")[i].toDouble(), 4095) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(archive.findKeyword("DarkValidMinimum")[i].toDouble(), -10) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(archive.findKeyword("FtValidMinimum"), -2); - EXPECT_DOUBLE_EQ(archive.findKeyword("RadianceSaturationThreshold"), 425.971); - EXPECT_DOUBLE_EQ(archive.findKeyword("RefSaturationThreshold"), 0.65534); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("FtValidMinimum")), -2); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RadianceSaturationThreshold")), 425.971); + EXPECT_DOUBLE_EQ(std::stod(archive.findKeyword("RefSaturationThreshold")), 0.65534); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); for (int i = 0; i < 5; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + QString::number(i + 1)) << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + std::to_string(i + 1)) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + QString::number(i - 4)) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[0].toDouble(), 414.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[1].toDouble(), 749.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[2].toDouble(), 901.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[3].toDouble(), 950.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[4].toDouble(), 1001.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[5].toDouble(), 1000.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[6].toDouble(), 1049.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[7].toDouble(), 1248.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Center")[8].toDouble(), 1548.0); - - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[0].toDouble(), 20.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[1].toDouble(), 12.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[2].toDouble(), 21.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[3].toDouble(), 30.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[4].toDouble(), 42.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[5].toDouble(), 27.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[6].toDouble(), 28.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[7].toDouble(), 33.0); - EXPECT_DOUBLE_EQ(bandbin.findKeyword("Width")[8].toDouble(), 48.0); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + std::to_string(i - 4)) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[0]), 414.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[1]), 749.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[2]), 901.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[3]), 950.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[4]), 1001.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[5]), 1000.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[6]), 1049.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[7]), 1248.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Center")[8]), 1548.0); + + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[0]), 20.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[1]), 12.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[2]), 21.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[3]), 30.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[4]), 42.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[5]), 27.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[6]), 28.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[7]), 33.0); + EXPECT_DOUBLE_EQ(std::stod(bandbin.findKeyword("Width")[8]), 48.0); + + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); } TEST(FunctionalTestMimap2Isis, SpecialPixels) { diff --git a/isis/tests/FunctionalTestsMosrange.cpp b/isis/tests/FunctionalTestsMosrange.cpp index 3fdfad82f3..1ed09ae2b8 100644 --- a/isis/tests/FunctionalTestsMosrange.cpp +++ b/isis/tests/FunctionalTestsMosrange.cpp @@ -39,12 +39,12 @@ TEST(Mosrange, MosrangeDefault) { PvlGroup &mapping = results.findGroup("Mapping", Pvl::Traverse); - EXPECT_EQ(mapping["ProjectionName"][0].toStdString(), "Equirectangular"); - EXPECT_EQ(mapping["TargetName"][0].toStdString(), "Mercury"); + EXPECT_EQ(mapping["ProjectionName"][0], "Equirectangular"); + EXPECT_EQ(mapping["TargetName"][0], "Mercury"); EXPECT_DOUBLE_EQ(double(mapping["EquatorialRadius"]), 2440000.0); EXPECT_DOUBLE_EQ(double(mapping["PolarRadius"]), 2440000.0); - EXPECT_EQ(mapping["LatitudeType"][0].toStdString(), "Planetocentric"); - EXPECT_EQ(mapping["LongitudeDirection"][0].toStdString(), "PositiveEast"); + EXPECT_EQ(mapping["LatitudeType"][0], "Planetocentric"); + EXPECT_EQ(mapping["LongitudeDirection"][0], "PositiveEast"); EXPECT_EQ(int(mapping["LongitudeDomain"]), 360); EXPECT_DOUBLE_EQ(double(mapping["PixelResolution"]), 506.7143); EXPECT_DOUBLE_EQ(double(mapping["Scale"]), 84.0435); @@ -86,12 +86,12 @@ TEST(Mosrange, MosrangeOnErrorContinue) { PvlGroup &mapping = results.findGroup("Mapping", Pvl::Traverse); - EXPECT_EQ(mapping["ProjectionName"][0].toStdString(), "Equirectangular"); - EXPECT_EQ(mapping["TargetName"][0].toStdString(), "Mercury"); + EXPECT_EQ(mapping["ProjectionName"][0], "Equirectangular"); + EXPECT_EQ(mapping["TargetName"][0], "Mercury"); EXPECT_DOUBLE_EQ(double(mapping["EquatorialRadius"]), 2440000.0); EXPECT_DOUBLE_EQ(double(mapping["PolarRadius"]), 2440000.0); - EXPECT_EQ(mapping["LatitudeType"][0].toStdString(), "Planetocentric"); - EXPECT_EQ(mapping["LongitudeDirection"][0].toStdString(), "PositiveEast"); + EXPECT_EQ(mapping["LatitudeType"][0], "Planetocentric"); + EXPECT_EQ(mapping["LongitudeDirection"][0], "PositiveEast"); EXPECT_EQ(int(mapping["LongitudeDomain"]), 360); EXPECT_DOUBLE_EQ(double(mapping["PixelResolution"]), 495.0249); EXPECT_DOUBLE_EQ(double(mapping["Scale"]), 86.0281); @@ -140,7 +140,7 @@ TEST(Mosrange, MosrangeOnErrorFail) { // try to read back error log pvl output file Pvl errorLogPvl; try { - errorLogPvl.read(tempDir.path()+ "/errorLog.log"); + errorLogPvl.read(tempDir.path().toStdString() + "/errorLog.log"); } catch (IException &e) { FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; @@ -154,11 +154,11 @@ TEST(Mosrange, MosrangeOnErrorFail) { ASSERT_TRUE(errorFile.hasKeyword("Error")); // confirm name of cube with no spice error - QFileInfo errorFileFullPath = (QFileInfo)(errorFile.findKeyword("Name")); + QFileInfo errorFileFullPath = (QFileInfo)(QString::fromStdString(errorFile.findKeyword("Name"))); ASSERT_EQ(errorFileFullPath.fileName(), "EN0108828337M_noSPICE.cub"); // confirm bad cube needs to be re-spiceinited - QString errorType = (QString)(errorFile.findKeyword("Error")); + QString errorType = QString::fromStdString(errorFile.findKeyword("Error")); ASSERT_TRUE(errorType.contains("re-run spiceinit")); // try to read back errorList output file diff --git a/isis/tests/FunctionalTestsMsi2isis.cpp b/isis/tests/FunctionalTestsMsi2isis.cpp index a5006e8a45..4866a1a820 100644 --- a/isis/tests/FunctionalTestsMsi2isis.cpp +++ b/isis/tests/FunctionalTestsMsi2isis.cpp @@ -38,33 +38,33 @@ TEST_F(TempTestingFiles, Msi2isisTestGblIngestDefault) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "NEAR EARTH ASTEROID RENDEZVOUS"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "MSI" ); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "EROS" ); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "157063318856" ); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "157063318919" ); - EXPECT_EQ(inst["OriginalSpacecraftClockStartCount"][0].toStdString(), "157063318.856" ); - EXPECT_EQ(inst["OriginalSpacecraftClockStopCount"][0].toStdString(), "157063318.919" ); + EXPECT_EQ(inst["SpacecraftName"][0], "NEAR EARTH ASTEROID RENDEZVOUS"); + EXPECT_EQ(inst["InstrumentId"][0], "MSI" ); + EXPECT_EQ(inst["TargetName"][0], "EROS" ); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "157063318856" ); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "157063318919" ); + EXPECT_EQ(inst["OriginalSpacecraftClockStartCount"][0], "157063318.856" ); + EXPECT_EQ(inst["OriginalSpacecraftClockStopCount"][0], "157063318.919" ); ASSERT_DOUBLE_EQ(double(inst["ExposureDuration"]), 63.0); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2001-02-08T17:24:42.217" ); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2001-02-08T17:24:42.280" ); + EXPECT_EQ(inst["StartTime"][0], "2001-02-08T17:24:42.217" ); + EXPECT_EQ(inst["StopTime"][0], "2001-02-08T17:24:42.280" ); ASSERT_DOUBLE_EQ(double(inst["DpuDeckTemperature"]), 286.5); - EXPECT_EQ(inst["DpuDeckTemperature"].unit().toStdString(), "K"); + EXPECT_EQ(inst["DpuDeckTemperature"].unit(), "K"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "NEAR-A-MSI-3-EDR-EROS/ORBIT-V1.0"); - EXPECT_EQ(archive["ProductId"][0].toStdString(), "M0157063318F4_2P_IOF_GBL.FIT"); - EXPECT_EQ(archive["InstrumentHostName"][0].toStdString(), "NEAR EARTH ASTEROID RENDEZVOUS"); - EXPECT_EQ(archive["InstrumentName"][0].toStdString(), "MULTI-SPECTRAL IMAGER"); - EXPECT_EQ(archive["InstrumentId"][0].toStdString(), "MSI"); - EXPECT_EQ(archive["TargetName"][0].toStdString(), "EROS"); + EXPECT_EQ(archive["DataSetId"][0], "NEAR-A-MSI-3-EDR-EROS/ORBIT-V1.0"); + EXPECT_EQ(archive["ProductId"][0], "M0157063318F4_2P_IOF_GBL.FIT"); + EXPECT_EQ(archive["InstrumentHostName"][0], "NEAR EARTH ASTEROID RENDEZVOUS"); + EXPECT_EQ(archive["InstrumentName"][0], "MULTI-SPECTRAL IMAGER"); + EXPECT_EQ(archive["InstrumentId"][0], "MSI"); + EXPECT_EQ(archive["TargetName"][0], "EROS"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); EXPECT_EQ(int(bandbin["FilterNumber"]), 4); EXPECT_EQ(int(bandbin["Center"]), 950); - EXPECT_EQ(bandbin["Center"].unit().toStdString(), "nm"); + EXPECT_EQ(bandbin["Center"].unit(), "nm"); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -223,33 +223,33 @@ TEST_F(TempTestingFiles, Msi2isisTestCubicConvolution) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "NEAR EARTH ASTEROID RENDEZVOUS"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "MSI" ); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "EROS" ); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "126865998830" ); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "126865998919" ); - EXPECT_EQ(inst["OriginalSpacecraftClockStartCount"][0].toStdString(), "126865998.830" ); - EXPECT_EQ(inst["OriginalSpacecraftClockStopCount"][0].toStdString(), "126865998.919" ); + EXPECT_EQ(inst["SpacecraftName"][0], "NEAR EARTH ASTEROID RENDEZVOUS"); + EXPECT_EQ(inst["InstrumentId"][0], "MSI" ); + EXPECT_EQ(inst["TargetName"][0], "EROS" ); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "126865998830" ); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "126865998919" ); + EXPECT_EQ(inst["OriginalSpacecraftClockStartCount"][0], "126865998.830" ); + EXPECT_EQ(inst["OriginalSpacecraftClockStopCount"][0], "126865998.919" ); EXPECT_DOUBLE_EQ(double(inst["ExposureDuration"]), 89.0); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2000-02-25T05:16:12.656" ); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2000-02-25T05:16:12.745" ); + EXPECT_EQ(inst["StartTime"][0], "2000-02-25T05:16:12.656" ); + EXPECT_EQ(inst["StopTime"][0], "2000-02-25T05:16:12.745" ); EXPECT_DOUBLE_EQ(double(inst["DpuDeckTemperature"]), 286.5); - EXPECT_EQ(inst["DpuDeckTemperature"].unit().toStdString(), "K"); + EXPECT_EQ(inst["DpuDeckTemperature"].unit(), "K"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "NEAR-A-MSI-3-EDR-EROS/ORBIT-V1.0"); - EXPECT_EQ(archive["ProductId"][0].toStdString(), "M0126865998F4_2P_IOF.FIT"); - EXPECT_EQ(archive["InstrumentHostName"][0].toStdString(), "NEAR EARTH ASTEROID RENDEZVOUS"); - EXPECT_EQ(archive["InstrumentName"][0].toStdString(), "MULTI-SPECTRAL IMAGER"); - EXPECT_EQ(archive["InstrumentId"][0].toStdString(), "MSI"); - EXPECT_EQ(archive["TargetName"][0].toStdString(), "EROS"); + EXPECT_EQ(archive["DataSetId"][0], "NEAR-A-MSI-3-EDR-EROS/ORBIT-V1.0"); + EXPECT_EQ(archive["ProductId"][0], "M0126865998F4_2P_IOF.FIT"); + EXPECT_EQ(archive["InstrumentHostName"][0], "NEAR EARTH ASTEROID RENDEZVOUS"); + EXPECT_EQ(archive["InstrumentName"][0], "MULTI-SPECTRAL IMAGER"); + EXPECT_EQ(archive["InstrumentId"][0], "MSI"); + EXPECT_EQ(archive["TargetName"][0], "EROS"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); EXPECT_EQ(int(bandbin["FilterNumber"]), 4); EXPECT_EQ(int(bandbin["Center"]), 950); - EXPECT_EQ(bandbin["Center"].unit().toStdString(), "nm"); + EXPECT_EQ(bandbin["Center"].unit(), "nm"); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsMvic2isis.cpp b/isis/tests/FunctionalTestsMvic2isis.cpp index 8845fba90c..5f57e8a7cc 100644 --- a/isis/tests/FunctionalTestsMvic2isis.cpp +++ b/isis/tests/FunctionalTestsMvic2isis.cpp @@ -52,29 +52,29 @@ TEST_F(TempTestingFiles, Mvic2IsisTestTdiMode) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "NEW HORIZONS"); - ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "MVIC_TDI"); - ASSERT_EQ(inst["TargetName"][0].toStdString(), "Jupiter"); - ASSERT_EQ(inst["MidObservationTime"][0].toStdString(), "2007-02-28T06:00:23.454"); - ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "1/0034948318:06600"); + ASSERT_EQ(inst["SpacecraftName"][0], "NEW HORIZONS"); + ASSERT_EQ(inst["InstrumentId"][0], "MVIC_TDI"); + ASSERT_EQ(inst["TargetName"][0], "Jupiter"); + ASSERT_EQ(inst["MidObservationTime"][0], "2007-02-28T06:00:23.454"); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0], "1/0034948318:06600"); ASSERT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.59168); - ASSERT_EQ(inst["Detector"][0].toStdString(), "CH4"); - ASSERT_EQ(inst["HwSide"][0].toStdString(), "1"); - ASSERT_EQ(inst["ScanType"][0].toStdString(), "TDI"); - ASSERT_EQ(inst["InstrumentMode"][0].toStdString(), "2"); + ASSERT_EQ(inst["Detector"][0], "CH4"); + ASSERT_EQ(inst["HwSide"][0], "1"); + ASSERT_EQ(inst["ScanType"][0], "TDI"); + ASSERT_EQ(inst["InstrumentMode"][0], "2"); ASSERT_EQ(double(inst["RalphExposureDuration"]), 0.59168); ASSERT_EQ(double(inst["TdiRate"]), 54.0833); - ASSERT_EQ(inst["StartTime"][0].toStdString(), "2007-02-28T06:00:00.520"); + ASSERT_EQ(inst["StartTime"][0], "2007-02-28T06:00:00.520"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["HighSpeedCompressionMode"][0].toStdString(), "LOSSLESS"); - ASSERT_EQ(archive["ObservationCompletionStatus"][0].toStdString(), "COMPLETE"); - ASSERT_EQ(archive["SequenceDescription"][0].toStdString(), "MVIC terminator flat"); + ASSERT_EQ(archive["HighSpeedCompressionMode"][0], "LOSSLESS"); + ASSERT_EQ(archive["ObservationCompletionStatus"][0], "COMPLETE"); + ASSERT_EQ(archive["SequenceDescription"][0], "MVIC terminator flat"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "CH4"); + ASSERT_EQ(bandbin["Name"][0], "CH4"); ASSERT_EQ(double(bandbin["Center"]), 895); ASSERT_EQ(double(bandbin["Width"]), 40); ASSERT_EQ(double(bandbin["OriginalBand"]), 1); @@ -82,7 +82,7 @@ TEST_F(TempTestingFiles, Mvic2IsisTestTdiMode) { // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); ASSERT_EQ(int(kernel["NaifFrameCode"]), -98908); - ASSERT_EQ(kernel["NaifFrameCode"].unit().toStdString(), "SPICE ID"); + ASSERT_EQ(kernel["NaifFrameCode"].unit(), "SPICE ID"); // RadiometricCalibration Group PvlGroup &radiometricCalibration = isisLabel->findGroup("RadiometricCalibration", Pvl::Traverse); @@ -153,12 +153,12 @@ TEST_F(TempTestingFiles, Mvic2IsisTestPanMode) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["Detector"][0].toStdString(), "PAN1"); - ASSERT_EQ(inst["InstrumentMode"][0].toStdString(), "3"); + ASSERT_EQ(inst["Detector"][0], "PAN1"); + ASSERT_EQ(inst["InstrumentMode"][0], "3"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "CLEAR"); + ASSERT_EQ(bandbin["Name"][0], "CLEAR"); ASSERT_EQ(double(bandbin["Center"]), 680); ASSERT_EQ(double(bandbin["Width"]), 560); ASSERT_EQ(double(bandbin["OriginalBand"]), 1); @@ -166,7 +166,7 @@ TEST_F(TempTestingFiles, Mvic2IsisTestPanMode) { // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); ASSERT_EQ(int(kernel["NaifFrameCode"]), -98905); - ASSERT_EQ(kernel["NaifFrameCode"].unit().toStdString(), "SPICE ID"); + ASSERT_EQ(kernel["NaifFrameCode"].unit(), "SPICE ID"); // RadiometricCalibration Group PvlGroup &radiometricCalibration = isisLabel->findGroup("RadiometricCalibration", Pvl::Traverse); @@ -212,12 +212,12 @@ TEST_F(TempTestingFiles, Mvic2IsisTestFrameMode) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["Detector"][0].toStdString(), "FRAME"); - ASSERT_EQ(inst["InstrumentMode"][0].toStdString(), "1"); + ASSERT_EQ(inst["Detector"][0], "FRAME"); + ASSERT_EQ(inst["InstrumentMode"][0], "1"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "CLEAR"); + ASSERT_EQ(bandbin["Name"][0], "CLEAR"); ASSERT_EQ(double(bandbin["Center"]), 680); ASSERT_EQ(double(bandbin["Width"]), 560); ASSERT_EQ(double(bandbin["OriginalBand"]), 1); @@ -225,7 +225,7 @@ TEST_F(TempTestingFiles, Mvic2IsisTestFrameMode) { // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); ASSERT_EQ(int(kernel["NaifFrameCode"]), -98903); - ASSERT_EQ(kernel["NaifFrameCode"].unit().toStdString(), "SPICE ID"); + ASSERT_EQ(kernel["NaifFrameCode"].unit(), "SPICE ID"); // RadiometricCalibration Group PvlGroup &radiometricCalibration = isisLabel->findGroup("RadiometricCalibration", Pvl::Traverse); @@ -244,7 +244,7 @@ TEST_F(TempTestingFiles, Mvic2IsisTestFrameMode) { ASSERT_EQ(double(radiometricCalibration["PholusPivotWavelength"]), 7.01E-5); ASSERT_EQ(double(radiometricCalibration["PlutoPivotWavelength"]), 6.64E-5); ASSERT_EQ(double(radiometricCalibration["CharonPivotWavelength"]), 6.51E-5); - ASSERT_EQ(radiometricCalibration["FlatFile"][0].toStdString(), "mfr_flat_20070130.fits"); + ASSERT_EQ(radiometricCalibration["FlatFile"][0], "mfr_flat_20070130.fits"); std::unique_ptr hist (cube->histogram()); @@ -272,12 +272,12 @@ TEST_F(TempTestingFiles, Mvic2IsisTestUncalibrated) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - ASSERT_EQ(inst["Detector"][0].toStdString(), "BLUE"); - ASSERT_EQ(inst["InstrumentMode"][0].toStdString(), "2"); + ASSERT_EQ(inst["Detector"][0], "BLUE"); + ASSERT_EQ(inst["InstrumentMode"][0], "2"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "BLUE"); + ASSERT_EQ(bandbin["Name"][0], "BLUE"); ASSERT_EQ(double(bandbin["Center"]), 475); ASSERT_EQ(double(bandbin["Width"]), 150); ASSERT_EQ(double(bandbin["OriginalBand"]), 1); @@ -285,7 +285,7 @@ TEST_F(TempTestingFiles, Mvic2IsisTestUncalibrated) { // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); ASSERT_EQ(int(kernel["NaifFrameCode"]), -98907); - ASSERT_EQ(kernel["NaifFrameCode"].unit().toStdString(), "SPICE ID"); + ASSERT_EQ(kernel["NaifFrameCode"].unit(), "SPICE ID"); std::unique_ptr hist (cube->histogram()); diff --git a/isis/tests/FunctionalTestsNoproj.cpp b/isis/tests/FunctionalTestsNoproj.cpp index ad79fb98e6..79af20e819 100644 --- a/isis/tests/FunctionalTestsNoproj.cpp +++ b/isis/tests/FunctionalTestsNoproj.cpp @@ -25,19 +25,19 @@ TEST_F(DefaultCube, FunctionalTestNoprojDefault) { Cube oCube(cubeFileName); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); EXPECT_EQ((int) instGroup.findKeyword("SampleDetectors"), 1250); EXPECT_EQ((int) instGroup.findKeyword("LineDetectors"), 1150); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("EphemerisTime"), -709401200.26114); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); EXPECT_EQ((int) instGroup.findKeyword("FocalPlaneXDependency"), 1); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); FileName defaultCubeName(testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); @@ -62,19 +62,19 @@ TEST_F(DefaultCube, DISABLED_FunctionalTestNoprojExpand) { Cube oCube(cubeFileName); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); EXPECT_EQ((int) instGroup.findKeyword("SampleDetectors"), 1375); EXPECT_EQ((int) instGroup.findKeyword("LineDetectors"), 1208); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("EphemerisTime"), -709401200.26114); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); EXPECT_EQ((int) instGroup.findKeyword("FocalPlaneXDependency"), 1); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); FileName defaultCubeName(testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); @@ -102,19 +102,19 @@ TEST_F(DefaultCube, FunctionalTestNoprojFromInput) { Cube oCube(cubeFileName); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); EXPECT_EQ((int) instGroup.findKeyword("SampleDetectors"), 1250); EXPECT_EQ((int) instGroup.findKeyword("LineDetectors"), 1150); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("EphemerisTime"), -709401200.26114); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); EXPECT_EQ((int) instGroup.findKeyword("FocalPlaneXDependency"), 1); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); FileName defaultCubeName(testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); @@ -139,19 +139,19 @@ TEST_F(DefaultCube, FunctionalTestNoprojFromUser) { Cube oCube(cubeFileName); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); EXPECT_EQ((int) instGroup.findKeyword("SampleDetectors"), 625); EXPECT_EQ((int) instGroup.findKeyword("LineDetectors"), 1150); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("EphemerisTime"), -709401200.26114); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); EXPECT_EQ((int) instGroup.findKeyword("FocalPlaneXDependency"), 1); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); FileName defaultCubeName(testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); @@ -324,19 +324,19 @@ TEST_F(DefaultCube, FunctionalTestNoprojSpecs) { Cube oCube(cubeFileName); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("TargetName"), "MARS"); EXPECT_EQ((int) instGroup.findKeyword("SampleDetectors"), 2000); EXPECT_EQ((int) instGroup.findKeyword("LineDetectors"), 1000); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentType"), "FRAMING"); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("EphemerisTime"), -709401200.26114); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("StartTime"), "1977-07-09T20:05:51"); EXPECT_EQ((int) instGroup.findKeyword("FocalPlaneXDependency"), 1); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); FileName defaultCubeName(testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); @@ -376,19 +376,19 @@ TEST_F(LineScannerCube, FunctionalTestNoprojLineScanner) { Cube oCube(cubeFileName); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("TargetName"), "MOON"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("TargetName"), "MOON"); EXPECT_EQ((int) instGroup.findKeyword("SampleDetectors"), 2000); EXPECT_EQ((int) instGroup.findKeyword("LineDetectors"), 1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentType"), "LINESCAN"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("InstrumentType"), "LINESCAN"); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("EphemerisTime"), 266722396.06431001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("StartTime"), "2008-06-14T13:32:10.933207"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("StartTime"), "2008-06-14T13:32:10.933207"); EXPECT_EQ((int) instGroup.findKeyword("FocalPlaneXDependency"), 1); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), -1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), -1.0); - FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); FileName defaultCubeName(testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); diff --git a/isis/tests/FunctionalTestsOverlapstats.cpp b/isis/tests/FunctionalTestsOverlapstats.cpp index 5ed262b717..838c00708a 100644 --- a/isis/tests/FunctionalTestsOverlapstats.cpp +++ b/isis/tests/FunctionalTestsOverlapstats.cpp @@ -197,5 +197,5 @@ TEST_F(ThreeImageNetwork, FunctionalTestOverlapstatsNoOverlap) { overlapstats(options, &appLog); PvlGroup group = appLog.findGroup("Results"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, group.findKeyword("NoOverlap"), tempDir.path() + "/cube3.cub"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, group.findKeyword("NoOverlap"), tempDir.path().toStdString() + "/cube3.cub"); } diff --git a/isis/tests/FunctionalTestsPds2isis.cpp b/isis/tests/FunctionalTestsPds2isis.cpp index 90ab832fd6..c002722d60 100644 --- a/isis/tests/FunctionalTestsPds2isis.cpp +++ b/isis/tests/FunctionalTestsPds2isis.cpp @@ -35,19 +35,19 @@ TEST(Pds2Isis, Pds2isisTestDefault) { ASSERT_EQ((int)dimensions["Bands"], 1); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "UnsignedByte"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); - ASSERT_EQ((double)pixels["Base"], 0.0); - ASSERT_EQ((double)pixels["Multiplier"], 1.0); + ASSERT_EQ(pixels["Type"][0], "UnsignedByte"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); + ASSERT_EQ(std::stod(pixels["Base"]), 0.0); + ASSERT_EQ(std::stod(pixels["Multiplier"]), 1.0); PvlGroup archive = outLabel->findGroup("Archive", Pvl::Traverse); - ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MGS-M-MOC-NA/WA-2-DSDP-L0-V1.0"); - ASSERT_EQ(archive["ProducerId"][0].toStdString(), "MGS_MOC_TEAM"); - ASSERT_EQ(archive["ProductId"][0].toStdString(), "AB-1-024/01"); - ASSERT_EQ(archive["InstrumentId"][0].toStdString(), "MOC-WA"); - ASSERT_EQ(archive["TargetName"][0].toStdString(), "MARS"); - ASSERT_EQ(archive["MissionPhaseName"][0].toStdString(), "AB-1"); - ASSERT_EQ(archive["RationaleDescription"][0].toStdString(), "OLYMPUS MONS SPECIAL RED WIDE ANGLE"); + ASSERT_EQ(archive["DataSetId"][0], "MGS-M-MOC-NA/WA-2-DSDP-L0-V1.0"); + ASSERT_EQ(archive["ProducerId"][0], "MGS_MOC_TEAM"); + ASSERT_EQ(archive["ProductId"][0], "AB-1-024/01"); + ASSERT_EQ(archive["InstrumentId"][0], "MOC-WA"); + ASSERT_EQ(archive["TargetName"][0], "MARS"); + ASSERT_EQ(archive["MissionPhaseName"][0], "AB-1"); + ASSERT_EQ(archive["RationaleDescription"][0], "OLYMPUS MONS SPECIAL RED WIDE ANGLE"); std::unique_ptr hist (outCube.histogram()); @@ -83,59 +83,59 @@ TEST(Pds2Isis, Pds2isisTestBandBin) { bool ok = false; PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Center"][0].toDouble(&ok), 0.7360); - ASSERT_EQ(bandbin["Center"][1].toDouble(&ok), 0.8750); - ASSERT_EQ(bandbin["Center"][2].toDouble(&ok), 1.0546); - ASSERT_EQ(bandbin["Center"][3].toDouble(&ok), 1.3326); - ASSERT_EQ(bandbin["Center"][4].toDouble(&ok), 1.6110); - ASSERT_EQ(bandbin["Center"][5].toDouble(&ok), 1.8914); - ASSERT_EQ(bandbin["Center"][6].toDouble(&ok), 2.1728); - ASSERT_EQ(bandbin["Center"][7].toDouble(&ok), 2.4529); - ASSERT_EQ(bandbin["Center"][8].toDouble(&ok), 2.7382); - ASSERT_EQ(bandbin["Center"][9].toDouble(&ok), 3.0178); - ASSERT_EQ(bandbin["Center"][10].toDouble(&ok), 3.3012); - ASSERT_EQ(bandbin["Center"][11].toDouble(&ok), 3.5839); - ASSERT_EQ(bandbin["Center"][12].toDouble(&ok), 3.8670); - ASSERT_EQ(bandbin["Center"][13].toDouble(&ok), 4.1503); - ASSERT_EQ(bandbin["Center"][14].toDouble(&ok), 4.4343); - ASSERT_EQ(bandbin["Center"][15].toDouble(&ok), 4.7164); - ASSERT_EQ(bandbin["Center"][16].toDouble(&ok), 4.9988); - - ASSERT_EQ(bandbin["Width"][0].toDouble(&ok), 0.0125); - ASSERT_EQ(bandbin["Width"][1].toDouble(&ok), 0.0125); - ASSERT_EQ(bandbin["Width"][2].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][3].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][4].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][5].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][6].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][7].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][8].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][9].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][10].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][11].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][12].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][13].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][14].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][15].toDouble(&ok), 0.0250); - ASSERT_EQ(bandbin["Width"][16].toDouble(&ok), 0.0250); - - ASSERT_EQ(bandbin["FilterNumber"][0].toInt(&ok, 10), 1); - ASSERT_EQ(bandbin["FilterNumber"][1].toInt(&ok, 10), 2); - ASSERT_EQ(bandbin["FilterNumber"][2].toInt(&ok, 10), 3); - ASSERT_EQ(bandbin["FilterNumber"][3].toInt(&ok, 10), 4); - ASSERT_EQ(bandbin["FilterNumber"][4].toInt(&ok, 10), 5); - ASSERT_EQ(bandbin["FilterNumber"][5].toInt(&ok, 10), 6); - ASSERT_EQ(bandbin["FilterNumber"][6].toInt(&ok, 10), 7); - ASSERT_EQ(bandbin["FilterNumber"][7].toInt(&ok, 10), 8); - ASSERT_EQ(bandbin["FilterNumber"][8].toInt(&ok, 10), 9); - ASSERT_EQ(bandbin["FilterNumber"][9].toInt(&ok, 10), 10); - ASSERT_EQ(bandbin["FilterNumber"][10].toInt(&ok, 10), 11); - ASSERT_EQ(bandbin["FilterNumber"][11].toInt(&ok, 10), 12); - ASSERT_EQ(bandbin["FilterNumber"][12].toInt(&ok, 10), 13); - ASSERT_EQ(bandbin["FilterNumber"][13].toInt(&ok, 10), 14); - ASSERT_EQ(bandbin["FilterNumber"][14].toInt(&ok, 10), 15); - ASSERT_EQ(bandbin["FilterNumber"][15].toInt(&ok, 10), 16); - ASSERT_EQ(bandbin["FilterNumber"][16].toInt(&ok, 10), 17); + ASSERT_EQ(std::stod(bandbin["Center"][0]), 0.7360); + ASSERT_EQ(std::stod(bandbin["Center"][1]), 0.8750); + ASSERT_EQ(std::stod(bandbin["Center"][2]), 1.0546); + ASSERT_EQ(std::stod(bandbin["Center"][3]), 1.3326); + ASSERT_EQ(std::stod(bandbin["Center"][4]), 1.6110); + ASSERT_EQ(std::stod(bandbin["Center"][5]), 1.8914); + ASSERT_EQ(std::stod(bandbin["Center"][6]), 2.1728); + ASSERT_EQ(std::stod(bandbin["Center"][7]), 2.4529); + ASSERT_EQ(std::stod(bandbin["Center"][8]), 2.7382); + ASSERT_EQ(std::stod(bandbin["Center"][9]), 3.0178); + ASSERT_EQ(std::stod(bandbin["Center"][10]), 3.3012); + ASSERT_EQ(std::stod(bandbin["Center"][11]), 3.5839); + ASSERT_EQ(std::stod(bandbin["Center"][12]), 3.8670); + ASSERT_EQ(std::stod(bandbin["Center"][13]), 4.1503); + ASSERT_EQ(std::stod(bandbin["Center"][14]), 4.4343); + ASSERT_EQ(std::stod(bandbin["Center"][15]), 4.7164); + ASSERT_EQ(std::stod(bandbin["Center"][16]), 4.9988); + + ASSERT_EQ(std::stod(bandbin["Width"][0]), 0.0125); + ASSERT_EQ(std::stod(bandbin["Width"][1]), 0.0125); + ASSERT_EQ(std::stod(bandbin["Width"][2]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][3]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][4]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][5]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][6]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][7]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][8]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][9]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][10]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][11]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][12]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][13]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][14]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][15]), 0.0250); + ASSERT_EQ(std::stod(bandbin["Width"][16]), 0.0250); + + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][0]), 1); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][1]), 2); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][2]), 3); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][3]), 4); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][4]), 5); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][5]), 6); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][6]), 7); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][7]), 8); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][8]), 9); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][9]), 10); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][10]), 11); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][11]), 12); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][12]), 13); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][13]), 14); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][14]), 15); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][15]), 16); + ASSERT_EQ(std::stoi(bandbin["FilterNumber"][16]), 17); std::unique_ptr hist (outCube.histogram(0)); ASSERT_NEAR(hist->Average(), 0.205984, 1e-3); @@ -164,22 +164,22 @@ TEST(Pds2Isis, Pds2isisTestOffset) { Pvl *outLabel = outCube.label(); PvlGroup mapping = outLabel->findGroup("Mapping", Pvl::Traverse); - ASSERT_EQ(mapping["ProjectionName"][0].toStdString(), "SimpleCylindrical"); - ASSERT_EQ((double)mapping["CenterLongitude"], 180.0); - ASSERT_EQ(mapping["TargetName"][0].toStdString(), "Moon"); - ASSERT_EQ((double)mapping["EquatorialRadius"], 1737400.0); - ASSERT_EQ((double)mapping["PolarRadius"], 1737400.0); - ASSERT_EQ(mapping["LatitudeType"][0].toStdString(), "Planetocentric"); - ASSERT_EQ(mapping["LongitudeDirection"][0].toStdString(), "PositiveEast"); + ASSERT_EQ(mapping["ProjectionName"][0], "SimpleCylindrical"); + ASSERT_EQ(std::stod(mapping["CenterLongitude"]), 180.0); + ASSERT_EQ(mapping["TargetName"][0], "Moon"); + ASSERT_EQ(std::stod(mapping["EquatorialRadius"]), 1737400.0); + ASSERT_EQ(std::stod(mapping["PolarRadius"]), 1737400.0); + ASSERT_EQ(mapping["LatitudeType"][0], "Planetocentric"); + ASSERT_EQ(mapping["LongitudeDirection"][0], "PositiveEast"); ASSERT_EQ((int)mapping["LongitudeDomain"], 360); - ASSERT_EQ((double)mapping["MinimumLatitude"], -90.0); - ASSERT_EQ((double)mapping["MaximumLatitude"], 90.0); - ASSERT_EQ((double)mapping["MinimumLongitude"], 0.0); - ASSERT_EQ((double)mapping["MaximumLongitude"], 360.0); - ASSERT_EQ((double)mapping["UpperLeftCornerX"], -5458204.8); - ASSERT_EQ((double)mapping["UpperLeftCornerY"], 2729102.4); - ASSERT_EQ((double)mapping["PixelResolution"], 7580.84); - ASSERT_EQ((double)mapping["Scale"], 4.0); + ASSERT_EQ(std::stod(mapping["MinimumLatitude"]), -90.0); + ASSERT_EQ(std::stod(mapping["MaximumLatitude"]), 90.0); + ASSERT_EQ(std::stod(mapping["MinimumLongitude"]), 0.0); + ASSERT_EQ(std::stod(mapping["MaximumLongitude"]), 360.0); + ASSERT_EQ(std::stod(mapping["UpperLeftCornerX"]), -5458204.8); + ASSERT_EQ(std::stod(mapping["UpperLeftCornerY"]), 2729102.4); + ASSERT_EQ(std::stod(mapping["PixelResolution"]), 7580.84); + ASSERT_EQ(std::stod(mapping["Scale"]), 4.0); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 1.7375e+06, 10); @@ -207,22 +207,22 @@ TEST(Pds2Isis, Pds2isisTestProjection) { Pvl *outLabel = outCube.label(); PvlGroup mapping = outLabel->findGroup("Mapping", Pvl::Traverse); - ASSERT_EQ(mapping["ProjectionName"][0].toStdString(), "Sinusoidal"); - ASSERT_EQ((double)mapping["CenterLongitude"], 325.3829); - ASSERT_EQ(mapping["TargetName"][0].toStdString(), "Venus"); - ASSERT_EQ((double)mapping["EquatorialRadius"], 6051920.0); - ASSERT_EQ((double)mapping["PolarRadius"], 6051920.0); - ASSERT_EQ(mapping["LatitudeType"][0].toStdString(), "Planetocentric"); - ASSERT_EQ(mapping["LongitudeDirection"][0].toStdString(), "PositiveEast"); + ASSERT_EQ(mapping["ProjectionName"][0], "Sinusoidal"); + ASSERT_EQ(std::stod(mapping["CenterLongitude"]), 325.3829); + ASSERT_EQ(mapping["TargetName"][0], "Venus"); + ASSERT_EQ(std::stod(mapping["EquatorialRadius"]), 6051920.0); + ASSERT_EQ(std::stod(mapping["PolarRadius"]), 6051920.0); + ASSERT_EQ(mapping["LatitudeType"][0], "Planetocentric"); + ASSERT_EQ(mapping["LongitudeDirection"][0], "PositiveEast"); ASSERT_EQ((int)mapping["LongitudeDomain"], 360); - ASSERT_EQ((double)mapping["MinimumLatitude"], -29.6357); - ASSERT_EQ((double)mapping["MaximumLatitude"], -28.9092); - ASSERT_EQ((double)mapping["MinimumLongitude"], 322.0367); - ASSERT_EQ((double)mapping["MaximumLongitude"], 322.8903); - ASSERT_EQ((double)mapping["UpperLeftCornerX"], -307162.5); - ASSERT_EQ((double)mapping["UpperLeftCornerY"], -3053025.0); - ASSERT_EQ((double)mapping["PixelResolution"], 75.0); - ASSERT_EQ((double)mapping["Scale"], 1407.4); + ASSERT_EQ(std::stod(mapping["MinimumLatitude"]), -29.6357); + ASSERT_EQ(std::stod(mapping["MaximumLatitude"]), -28.9092); + ASSERT_EQ(std::stod(mapping["MinimumLongitude"]), 322.0367); + ASSERT_EQ(std::stod(mapping["MaximumLongitude"]), 322.8903); + ASSERT_EQ(std::stod(mapping["UpperLeftCornerX"]), -307162.5); + ASSERT_EQ(std::stod(mapping["UpperLeftCornerY"]), -3053025.0); + ASSERT_EQ(std::stod(mapping["PixelResolution"]), 75.0); + ASSERT_EQ(std::stod(mapping["Scale"]), 1407.4); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 67.7978515625, .00001); diff --git a/isis/tests/FunctionalTestsPhocube.cpp b/isis/tests/FunctionalTestsPhocube.cpp index b77d0a79a7..872d1c4b41 100644 --- a/isis/tests/FunctionalTestsPhocube.cpp +++ b/isis/tests/FunctionalTestsPhocube.cpp @@ -33,17 +33,17 @@ TEST_F(DefaultCube, FunctionalTestPhocubeDefault) { ASSERT_EQ(cube.bandCount(), 5); PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[0], "Phase Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[1], "Emission Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[2], "Incidence Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[3], "Latitude"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[4], "Longitude"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[0], "Phase Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[1], "Emission Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[2], "Incidence Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[3], "Latitude"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[4], "Longitude"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ((int) bandBin.findKeyword("FilterId"), 4); for (int i = 0; i < cube.bandCount(); i++) { - EXPECT_DOUBLE_EQ(bandBin.findKeyword("Center")[i].toDouble(), 1.0); - EXPECT_DOUBLE_EQ(bandBin.findKeyword("Width")[i].toDouble(), 1.0); + EXPECT_DOUBLE_EQ(std::stod(bandBin.findKeyword("Center")[i]), 1.0); + EXPECT_DOUBLE_EQ(std::stod(bandBin.findKeyword("Width")[i]), 1.0); } std::unique_ptr hist (cube.histogram(0)); @@ -79,33 +79,33 @@ TEST_F(DefaultCube, FunctionalTestPhocubeAllBands) { ASSERT_EQ(cube.bandCount(), 27); PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[0], "CLEAR"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[1], "Phase Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[2], "Emission Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[3], "Incidence Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[4], "Local Emission Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[5], "Local Incidence Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[6], "Latitude"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[7], "Longitude"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[8], "Pixel Resolution"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[9], "Line Resolution"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[10], "Sample Resolution"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[11], "Detector Resolution"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[12], "Oblique Detector Resolution"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[13], "North Azimuth"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[14], "Sun Azimuth"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[15], "Spacecraft Azimuth"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[16], "OffNadir Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[17], "Sub Spacecraft Ground Azimuth"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[18], "Sub Solar Ground Azimuth"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[19], "Morphology Rank"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[20], "Albedo Rank"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[21], "Right Ascension"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[22], "Declination"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[23], "Body Fixed X"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[24], "Body Fixed Y"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[25], "Body Fixed Z"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[26], "Local Solar Time"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[0], "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[1], "Phase Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[2], "Emission Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[3], "Incidence Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[4], "Local Emission Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[5], "Local Incidence Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[6], "Latitude"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[7], "Longitude"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[8], "Pixel Resolution"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[9], "Line Resolution"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[10], "Sample Resolution"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[11], "Detector Resolution"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[12], "Oblique Detector Resolution"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[13], "North Azimuth"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[14], "Sun Azimuth"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[15], "Spacecraft Azimuth"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[16], "OffNadir Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[17], "Sub Spacecraft Ground Azimuth"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[18], "Sub Solar Ground Azimuth"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[19], "Morphology Rank"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[20], "Albedo Rank"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[21], "Right Ascension"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[22], "Declination"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[23], "Body Fixed X"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[24], "Body Fixed Y"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[25], "Body Fixed Z"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[26], "Local Solar Time"); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), -56.952873505781646, .000001); @@ -196,8 +196,8 @@ TEST_F(DefaultCube, FunctionalTestPhocubeSpecialPixels) { ASSERT_EQ(cube.bandCount(), 2); PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[0], "CLEAR"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[1], "Phase Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[0], "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[1], "Phase Angle"); int band = 1; LineManager outLine(cube); @@ -247,9 +247,9 @@ TEST_F(OffBodyCube, FunctionalTestPhocubeOffBody) { ASSERT_EQ(cube.bandCount(), 3); PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[0], "Phase Angle"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[1], "Right Ascension"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[2], "Declination"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[0], "Phase Angle"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[1], "Right Ascension"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[2], "Declination"); int band = 1; LineManager outLine(cube); @@ -300,7 +300,7 @@ TEST_F(DefaultCube, FunctionalTestPhocubeMosaic) { ASSERT_EQ(cube.bandCount(), 1); PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("FilterName"), "CLEAR"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("FilterName"), "CLEAR"); EXPECT_EQ((int) bandBin.findKeyword("FilterId"), 4); EXPECT_DOUBLE_EQ((double) bandBin.findKeyword("Center"), 1.0); @@ -332,8 +332,8 @@ TEST_F(MiniRFCube, FunctionalTestPhocubeMiniRF) { ASSERT_EQ(cube.bandCount(), 1); PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name"), "Sub Spacecraft Ground Azimuth"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("FilterName"), "H RECEIVE INTENSITY"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name"), "Sub Spacecraft Ground Azimuth"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("FilterName"), "H RECEIVE INTENSITY"); LineManager outLine(cube); for (int i = 1; i <= cube.lineCount(); i++) { @@ -377,7 +377,7 @@ TEST_F(DefaultCube, FunctionalTestPhocubeNoBandBin) { ASSERT_EQ(cube.bandCount(), 1); PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name"), "DN"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name"), "DN"); std::unique_ptr hist (cube.histogram(1)); EXPECT_NEAR(hist->Average(), 13, .000001); @@ -409,9 +409,9 @@ TEST_F(DefaultCube, FunctionalTestPhocubeAllDnBands) { ASSERT_EQ(cube.bandCount(), 8); PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("FilterName")[0], "B1"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("FilterName")[1], "B2"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("FilterName")[2], "B3"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("FilterName")[0], "B1"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("FilterName")[1], "B2"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("FilterName")[2], "B3"); // Test band 1 { @@ -488,13 +488,13 @@ TEST(Phocube, FunctionalTestPhocubeSunIlluminationMask) { // confirm "Sun Illumination Mask" is in BandBin group PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[0], + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[0], "Sun Illumination Mask"); // verify center and width entries in BandBin group for (int i = 0; i < cube.bandCount(); i++) { - EXPECT_DOUBLE_EQ(bandBin.findKeyword("Center")[i].toDouble(), 650.0); - EXPECT_DOUBLE_EQ(bandBin.findKeyword("Width")[i].toDouble(), 1.0); + EXPECT_DOUBLE_EQ(std::stod(bandBin.findKeyword("Center")[i]), 650.0); + EXPECT_DOUBLE_EQ(std::stod(bandBin.findKeyword("Width")[i]), 1.0); } // verify statistics of SunIlluminationMask band @@ -545,13 +545,13 @@ TEST(Phocube, FunctionalTestPhocubeSurfaceObliqueDetectorResolution) { // confirm "Surface Oblique Detector Resolution" is in BandBin group PvlGroup bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, bandBin.findKeyword("Name")[0], + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("Name")[0], "Surface Oblique Detector Resolution"); // verify center and width entries in BandBin group for (int i = 0; i < cube.bandCount(); i++) { - EXPECT_DOUBLE_EQ(bandBin.findKeyword("Center")[i].toDouble(), 650.0); - EXPECT_DOUBLE_EQ(bandBin.findKeyword("Width")[i].toDouble(), 1.0); + EXPECT_DOUBLE_EQ(std::stod(bandBin.findKeyword("Center")[i]), 650.0); + EXPECT_DOUBLE_EQ(std::stod(bandBin.findKeyword("Width")[i]), 1.0); } // verify statistics of SurfaceObliqueDetectorResolution band diff --git a/isis/tests/FunctionalTestsRingsautomos.cpp b/isis/tests/FunctionalTestsRingsautomos.cpp index 2c7a25d21c..0df95e9eef 100644 --- a/isis/tests/FunctionalTestsRingsautomos.cpp +++ b/isis/tests/FunctionalTestsRingsautomos.cpp @@ -25,13 +25,13 @@ TEST_F(RingsCube, FunctionalTestRingsautomos) { PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Planar"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Saturn"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Planar"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Saturn"); EXPECT_NEAR((double)mapping.findKeyword("UpperLeftCornerX"), -141593057.92723, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("UpperLeftCornerY"), 141593057.92723, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("PixelResolution"), 5899710.746968, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("Scale"), 0.5, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("RingLongitudeDirection"), "CounterClockwise"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("RingLongitudeDirection"), "CounterClockwise"); EXPECT_EQ((int)mapping.findKeyword("RingLongitudeDomain"), 360); EXPECT_NEAR((double)mapping.findKeyword("MaximumRingRadius"), 198012526.14923, 0.0001); EXPECT_DOUBLE_EQ((double)mapping.findKeyword("MinimumRingLongitude"), 0); @@ -67,13 +67,13 @@ TEST_F(RingsCube, FunctionalTestRingsautomosSetRanges) { PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Planar"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Saturn"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Planar"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Saturn"); EXPECT_NEAR((double)mapping.findKeyword("UpperLeftCornerX"), -100295082.69846, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("UpperLeftCornerY"), -9.7971743931788306e-10, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("PixelResolution"), 5899710.746968, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("Scale"), 0.5, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("RingLongitudeDirection"), "CounterClockwise"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("RingLongitudeDirection"), "CounterClockwise"); EXPECT_EQ((int)mapping.findKeyword("RingLongitudeDomain"), 360); EXPECT_NEAR((double)mapping.findKeyword("MaximumRingRadius"), 100000000, 0.0001); EXPECT_DOUBLE_EQ((double)mapping.findKeyword("MinimumRingLongitude"), 0); @@ -113,13 +113,13 @@ TEST_F(RingsCube, FunctionalTestRingsautomosPriority) { PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Planar"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Saturn"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Planar"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Saturn"); EXPECT_NEAR((double)mapping.findKeyword("UpperLeftCornerX"), -141593057.92723, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("UpperLeftCornerY"), 141593057.92723, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("PixelResolution"), 5899710.746968, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("Scale"), 0.5, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("RingLongitudeDirection"), "CounterClockwise"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("RingLongitudeDirection"), "CounterClockwise"); EXPECT_EQ((int)mapping.findKeyword("RingLongitudeDomain"), 360); EXPECT_NEAR((double)mapping.findKeyword("MaximumRingRadius"), 198012526.14923, 0.0001); EXPECT_DOUBLE_EQ((double)mapping.findKeyword("MinimumRingLongitude"), 0); @@ -151,19 +151,19 @@ TEST_F(RingsCube, FunctionalTestRingsautomosBandSelect) { Pvl label = *mos.label(); PvlGroup bandBin = label.findObject("IsisCube").findGroup("BandBin"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)bandBin.findKeyword("FilterName"), "CL1/CL2"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandBin.findKeyword("FilterName"), "CL1/CL2"); ASSERT_EQ((int)bandBin.findKeyword("OriginalBand"), 1); ASSERT_DOUBLE_EQ((double)bandBin.findKeyword("Center"), 633.837); ASSERT_DOUBLE_EQ((double)bandBin.findKeyword("Width"), 285.938); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("ProjectionName"), "Planar"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("TargetName"), "Saturn"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("ProjectionName"), "Planar"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("TargetName"), "Saturn"); EXPECT_NEAR((double)mapping.findKeyword("UpperLeftCornerX"), -141593057.92723, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("UpperLeftCornerY"), 141593057.92723, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("PixelResolution"), 5899710.746968, 0.0001); EXPECT_NEAR((double)mapping.findKeyword("Scale"), 0.5, 0.0001); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, (QString)mapping.findKeyword("RingLongitudeDirection"), "CounterClockwise"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, mapping.findKeyword("RingLongitudeDirection"), "CounterClockwise"); EXPECT_EQ((int)mapping.findKeyword("RingLongitudeDomain"), 360); EXPECT_NEAR((double)mapping.findKeyword("MaximumRingRadius"), 198012526.14923, 0.0001); EXPECT_DOUBLE_EQ((double)mapping.findKeyword("MinimumRingLongitude"), 0); diff --git a/isis/tests/FunctionalTestsShadow.cpp b/isis/tests/FunctionalTestsShadow.cpp index 9c7ce62383..1f157ab6fe 100644 --- a/isis/tests/FunctionalTestsShadow.cpp +++ b/isis/tests/FunctionalTestsShadow.cpp @@ -60,7 +60,7 @@ TEST_F(DemCube, FunctionalTestShadowTime) { "sunpositionsource=time", "time=1977-07-09T15:05:53"}; PvlGroup kernels = testCube->label()->findObject("IsisCube").findGroup("Kernels"); - shadowArgs.push_back("spk=" + kernels["TargetPosition"][2]); + shadowArgs.push_back("spk=" + QString::fromStdString(kernels["TargetPosition"][2])); UserInterface shadowUi(APP_XML, shadowArgs); Pvl appLog; diff --git a/isis/tests/FunctionalTestsSkypt.cpp b/isis/tests/FunctionalTestsSkypt.cpp index 40a2750162..9762616667 100644 --- a/isis/tests/FunctionalTestsSkypt.cpp +++ b/isis/tests/FunctionalTestsSkypt.cpp @@ -106,7 +106,7 @@ TEST_F(DefaultCube, FunctionalTestSkyptFlatSampleLine) { EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(7), "CelestialNorthClockAngle"); } else if(lineNumber == 1) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(0), skyPoint.findKeyword("Filename")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fields.value(0).toStdString(), skyPoint.findKeyword("Filename")); EXPECT_DOUBLE_EQ(fields.value(1).toDouble(), skyPoint.findKeyword("Sample")); EXPECT_DOUBLE_EQ(fields.value(2).toDouble(), skyPoint.findKeyword("Line")); EXPECT_DOUBLE_EQ(fields.value(3).toDouble(), skyPoint.findKeyword("RightAscension")); @@ -182,7 +182,7 @@ TEST_F(DefaultCube, FunctionalTestSkyptFlatRaDec) { EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(7), "CelestialNorthClockAngle"); } else if(lineNumber == 1) { - EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(0), skyPoint.findKeyword("Filename")); + EXPECT_PRED_FORMAT2(AssertStringsEqual, fields.value(0).toStdString(), skyPoint.findKeyword("Filename")); EXPECT_DOUBLE_EQ(fields.value(1).toDouble(), skyPoint.findKeyword("Sample")); EXPECT_DOUBLE_EQ(fields.value(2).toDouble(), skyPoint.findKeyword("Line")); EXPECT_DOUBLE_EQ(fields.value(3).toDouble(), skyPoint.findKeyword("RightAscension")); diff --git a/isis/tests/FunctionalTestsSpiceinit.cpp b/isis/tests/FunctionalTestsSpiceinit.cpp index 9687fb577e..8b2169c202 100644 --- a/isis/tests/FunctionalTestsSpiceinit.cpp +++ b/isis/tests/FunctionalTestsSpiceinit.cpp @@ -103,11 +103,11 @@ TEST(Spiceinit, TestSpiceinitPredictAndReconCk) { ASSERT_TRUE(kernels.hasKeyword("InstrumentPointing")); PvlKeyword instrumentPointing = kernels["InstrumentPointing"]; ASSERT_EQ(instrumentPointing.size(), 3); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instrumentPointing[0], "$Clementine1/kernels/ck/clem_2mn.bck"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instrumentPointing[1], "$Clementine1/kernels/ck/clem_5sc.bck"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instrumentPointing[2], "$clementine1/kernels/fk/clem_v12.tf"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instrumentPointing[0], "$Clementine1/kernels/ck/clem_2mn.bck"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instrumentPointing[1], "$Clementine1/kernels/ck/clem_5sc.bck"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instrumentPointing[2], "$clementine1/kernels/fk/clem_v12.tf"); ASSERT_TRUE(kernels.hasKeyword("InstrumentPointingQuality")); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, kernels["InstrumentPointingQuality"][0], "Reconstructed"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, kernels["InstrumentPointingQuality"][0], "Reconstructed"); } @@ -194,14 +194,14 @@ TEST(Spiceinit, TestSpiceinitCkConfigFile) { ASSERT_TRUE(kernels.hasKeyword("InstrumentPointing")); PvlKeyword instrumentPointing = kernels["InstrumentPointing"]; ASSERT_EQ(instrumentPointing.size(), 4); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instrumentPointing[0], "Table"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instrumentPointing[1], "$mro/kernels/ck/mro_crm_psp_110223_101128.bc"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, instrumentPointing[2], "$mro/kernels/ck/mro_sc_psp_110222_110228.bc"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instrumentPointing[0], "Table"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instrumentPointing[1], "$mro/kernels/ck/mro_crm_psp_110223_101128.bc"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, instrumentPointing[2], "$mro/kernels/ck/mro_sc_psp_110222_110228.bc"); // Use a regex to match the version # for the frame kernel because this sometimes updates // when new MRO spice is released. QRegularExpression fkRegex("mro_v\\d\\d\\.tf"); - EXPECT_TRUE(fkRegex.match(instrumentPointing[3]).hasMatch()) << "Frame kernel [" - << instrumentPointing[3].toStdString() << "] doesn't match regex [" + EXPECT_TRUE(fkRegex.match(QString::fromStdString(instrumentPointing[3])).hasMatch()) << "Frame kernel [" + << instrumentPointing[3] << "] doesn't match regex [" << fkRegex.pattern().toStdString() << "]."; } @@ -419,7 +419,7 @@ TEST(Spiceinit, TestSpiceinitNadir) { ASSERT_TRUE(kernels.hasKeyword("InstrumentPointing")); ASSERT_EQ(kernels["InstrumentPointing"].size(), 1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, kernels["InstrumentPointing"][0], "Nadir"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, kernels["InstrumentPointing"][0], "Nadir"); } @@ -518,13 +518,13 @@ TEST(Spiceinit, TestSpiceinitPadding) { ASSERT_TRUE(kernels.hasKeyword("StartPadding")); ASSERT_EQ(kernels["StartPadding"].size(), 1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, kernels["StartPadding"][0], "1.1"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, kernels["StartPadding"].unit(0), "seconds"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, kernels["StartPadding"][0], "1.1"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, kernels["StartPadding"].unit(0), "seconds"); ASSERT_TRUE(kernels.hasKeyword("EndPadding")); ASSERT_EQ(kernels["EndPadding"].size(), 1); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, kernels["EndPadding"][0], "0.5"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, kernels["EndPadding"].unit(0), "seconds"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, kernels["EndPadding"][0], "0.5"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, kernels["EndPadding"].unit(0), "seconds"); } TEST_F(DefaultCube, TestSpiceinitCsmCleanup) { @@ -661,7 +661,7 @@ TEST_F(DemCube, FunctionalTestSpiceinitWebAndShapeModel) { spiceinit(&testCube, options); PvlGroup kernels = testCube.label()->findGroup("Kernels", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, kernels.findKeyword("ShapeModel"), demCube->fileName()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, kernels.findKeyword("ShapeModel"), demCube->fileName().toStdString()); } diff --git a/isis/tests/FunctionalTestsSpiceserver.cpp b/isis/tests/FunctionalTestsSpiceserver.cpp index 522b2940f8..f39a0d14a5 100644 --- a/isis/tests/FunctionalTestsSpiceserver.cpp +++ b/isis/tests/FunctionalTestsSpiceserver.cpp @@ -131,18 +131,18 @@ TEST_F(TestPayload, FunctionalTestSpiceserverDefaultParameters) { PvlGroup naifKeywords = kernelsLabel.group(0); EXPECT_EQ((int)naifKeywords.findKeyword("NaifFrameCode"), -27002); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, naifKeywords.findKeyword("TargetPosition")[0], "Table"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, naifKeywords.findKeyword("InstrumentPointing")[0], "Table"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, naifKeywords.findKeyword("InstrumentPosition")[0], "Table"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, naifKeywords.findKeyword("TargetPosition")[0], "Table"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, naifKeywords.findKeyword("InstrumentPointing")[0], "Table"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, naifKeywords.findKeyword("InstrumentPosition")[0], "Table"); PvlObject table = instrumentPositionTable.findObject("Table"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, QString(table.findKeyword("Name")), "InstrumentPosition"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, QString(table.group(0).findKeyword("Name")), "J2000X"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, QString(table.group(1).findKeyword("Name")), "J2000Y"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, QString(table.group(2).findKeyword("Name")), "J2000Z"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, QString(table.group(3).findKeyword("Name")), "J2000XV"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, QString(table.group(4).findKeyword("Name")), "J2000YV"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, QString(table.group(5).findKeyword("Name")), "J2000ZV"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, (table.findKeyword("Name")), "InstrumentPosition"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, (table.group(0).findKeyword("Name")), "J2000X"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, (table.group(1).findKeyword("Name")), "J2000Y"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, (table.group(2).findKeyword("Name")), "J2000Z"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, (table.group(3).findKeyword("Name")), "J2000XV"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, (table.group(4).findKeyword("Name")), "J2000YV"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, (table.group(5).findKeyword("Name")), "J2000ZV"); } diff --git a/isis/tests/FunctionalTestsSpkwriter.cpp b/isis/tests/FunctionalTestsSpkwriter.cpp index e581ff21b1..36583761c5 100644 --- a/isis/tests/FunctionalTestsSpkwriter.cpp +++ b/isis/tests/FunctionalTestsSpkwriter.cpp @@ -47,7 +47,7 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterDefault) { kernels.addKeyword(instrumentPointing, PvlContainer::InsertMode::Replace); PvlKeyword instrumentPosition("InstrumentPosition"); - instrumentPosition += options.GetFileName("TO"); + instrumentPosition += options.GetFileName("TO").toStdString(); kernels.addKeyword(instrumentPosition, PvlContainer::InsertMode::Replace); newKernelCube.reopen("rw"); @@ -104,7 +104,7 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterFromlist) { kernels.addKeyword(instrumentPointing, PvlContainer::InsertMode::Replace); PvlKeyword instrumentPosition("InstrumentPosition"); - instrumentPosition += options.GetFileName("TO"); + instrumentPosition += options.GetFileName("TO").toStdString(); kernels.addKeyword(instrumentPosition, PvlContainer::InsertMode::Replace); newKernelCube.reopen("rw"); diff --git a/isis/tests/FunctionalTestsStd2isis.cpp b/isis/tests/FunctionalTestsStd2isis.cpp index 4df229706e..19ab844afb 100644 --- a/isis/tests/FunctionalTestsStd2isis.cpp +++ b/isis/tests/FunctionalTestsStd2isis.cpp @@ -43,15 +43,15 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisDefault) { ASSERT_EQ((int)dimensions["Bands"], 3); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "Red"); - ASSERT_EQ(bandbin["Name"][1].toStdString(), "Green"); - ASSERT_EQ(bandbin["Name"][2].toStdString(), "Blue"); + ASSERT_EQ(bandbin["Name"][0], "Red"); + ASSERT_EQ(bandbin["Name"][1], "Green"); + ASSERT_EQ(bandbin["Name"][2], "Blue"); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 113.11904761904762, .00001); @@ -83,16 +83,16 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisArgb) { ASSERT_EQ((int)dimensions["Bands"], 4); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "Red"); - ASSERT_EQ(bandbin["Name"][1].toStdString(), "Green"); - ASSERT_EQ(bandbin["Name"][2].toStdString(), "Blue"); - ASSERT_EQ(bandbin["Name"][3].toStdString(), "Alpha"); + ASSERT_EQ(bandbin["Name"][0], "Red"); + ASSERT_EQ(bandbin["Name"][1], "Green"); + ASSERT_EQ(bandbin["Name"][2], "Blue"); + ASSERT_EQ(bandbin["Name"][3], "Alpha"); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 113.11904761904762, .00001); @@ -124,13 +124,13 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisTiffGrayscale) { ASSERT_EQ((int)dimensions["Bands"], 1); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "Gray"); + ASSERT_EQ(bandbin["Name"][0], "Gray"); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 96.403951009114579, .00001); @@ -165,13 +165,13 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisSpecial) { ASSERT_EQ((int)dimensions["Bands"], 1); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "Gray"); + ASSERT_EQ(bandbin["Name"][0], "Gray"); std::unique_ptr hist (outCube.histogram()); @@ -207,15 +207,15 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisJp2) { ASSERT_EQ((int)dimensions["Bands"], 3); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "Red"); - ASSERT_EQ(bandbin["Name"][1].toStdString(), "Green"); - ASSERT_EQ(bandbin["Name"][2].toStdString(), "Blue"); + ASSERT_EQ(bandbin["Name"][0], "Red"); + ASSERT_EQ(bandbin["Name"][1], "Green"); + ASSERT_EQ(bandbin["Name"][2], "Blue"); std::unique_ptr hist (outCube.histogram()); diff --git a/isis/tests/FunctionalTestsSumspice.cpp b/isis/tests/FunctionalTestsSumspice.cpp index 6e929a57f8..fe6242178b 100644 --- a/isis/tests/FunctionalTestsSumspice.cpp +++ b/isis/tests/FunctionalTestsSumspice.cpp @@ -34,18 +34,18 @@ TEST(Sumspice, FunctionalTestSumspiceTimeUpdate) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "1/2395694869:238"); - EXPECT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "1/2395694872:183"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2005-09-21T10:44:07.352"); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2005-09-21T10:44:07.439"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "1/2395694869:238"); + EXPECT_EQ(inst["SpacecraftClockStopCount"][0], "1/2395694872:183"); + EXPECT_EQ(inst["StartTime"][0], "2005-09-21T10:44:07.352"); + EXPECT_EQ(inst["StopTime"][0], "2005-09-21T10:44:07.439"); // SumTimeHistory Group PvlGroup &sumTime = isisLabel->findGroup("SumTimeHistory", Pvl::Traverse); - EXPECT_EQ(sumTime["SUMFILE"][0].toStdString(), "N2395699394"); - EXPECT_EQ(sumTime["SpacecraftClockStartCount"][0].toDouble(), 2395694888); - EXPECT_EQ(sumTime["SpacecraftClockStopCount"][0].toDouble(), 2395695365); - EXPECT_EQ(sumTime["StartTime"][0].toStdString(), "2005-09-21T10:44:07"); - EXPECT_EQ(sumTime["StopTime"][0].toStdString(), "2005-09-21T10:44:07"); + EXPECT_EQ(sumTime["SUMFILE"][0], "N2395699394"); + EXPECT_EQ(std::stod(sumTime["SpacecraftClockStartCount"][0]), 2395694888); + EXPECT_EQ(std::stod(sumTime["SpacecraftClockStopCount"][0]), 2395695365); + EXPECT_EQ(sumTime["StartTime"][0], "2005-09-21T10:44:07"); + EXPECT_EQ(sumTime["StopTime"][0], "2005-09-21T10:44:07"); std::unique_ptr hist (cube.histogram()); diff --git a/isis/tests/FunctionalTestsTagcams2isis.cpp b/isis/tests/FunctionalTestsTagcams2isis.cpp index 8511809256..b045444fce 100644 --- a/isis/tests/FunctionalTestsTagcams2isis.cpp +++ b/isis/tests/FunctionalTestsTagcams2isis.cpp @@ -48,7 +48,7 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCam) { // Core object PvlObject &core = isisLabel->findObject("Core", Pvl::Traverse); EXPECT_EQ(int(core["StartByte"]), 65537); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, core.findKeyword("Format"), "Tile"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, core.findKeyword("Format"), "Tile"); EXPECT_EQ(int(core["TileSamples"]), 864); EXPECT_EQ(int(core["TileLines"]), 972); @@ -60,22 +60,22 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCam) { // Pixels Group in Core PvlGroup &pixels = core.findGroup("Pixels", Pvl::Traverse); - EXPECT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - EXPECT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + EXPECT_EQ(pixels["Type"][0], "SignedWord"); + EXPECT_EQ(pixels["ByteOrder"][0], "Lsb"); EXPECT_DOUBLE_EQ(double(pixels["Base"]), 32768.0); EXPECT_DOUBLE_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["MissionName"][0].toStdString(), "OSIRIS-REx"); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "OSIRIS-REX"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "NAVCam"); - EXPECT_EQ(inst["InstrumentName"][0].toStdString(), "TAGCAMS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Bennu"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2020-03-03T21:30:31.138"); - EXPECT_EQ(inst["MidObservationTime"][0].toStdString(), "2020-03-03T21:30:31.140"); + EXPECT_EQ(inst["MissionName"][0], "OSIRIS-REx"); + EXPECT_EQ(inst["SpacecraftName"][0], "OSIRIS-REX"); + EXPECT_EQ(inst["InstrumentId"][0], "NAVCam"); + EXPECT_EQ(inst["InstrumentName"][0], "TAGCAMS"); + EXPECT_EQ(inst["TargetName"][0], "Bennu"); + EXPECT_EQ(inst["StartTime"][0], "2020-03-03T21:30:31.138"); + EXPECT_EQ(inst["MidObservationTime"][0], "2020-03-03T21:30:31.140"); EXPECT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.0042976); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "3/0636542973.02560"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "3/0636542973.02560"); EXPECT_DOUBLE_EQ(double(inst["EphemerisTime"]), 636543100.32543004); EXPECT_EQ(int(inst["Binning"]), 0); EXPECT_EQ(int(inst["Summing"]), 0); @@ -91,9 +91,9 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCam) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["SourceProductId"][0].toStdString(), "20200303T213031S138_ncm_L0"); - EXPECT_EQ(archive["ProducerId"][0].toStdString(), "SPOC"); - EXPECT_EQ(archive["MetaKernel"][0].toStdString(), "spoc-digestfits-2020-03-10T15_08_20.712Z.mk"); + EXPECT_EQ(archive["SourceProductId"][0], "20200303T213031S138_ncm_L0"); + EXPECT_EQ(archive["ProducerId"][0], "SPOC"); + EXPECT_EQ(archive["MetaKernel"][0], "spoc-digestfits-2020-03-10T15_08_20.712Z.mk"); EXPECT_EQ(int(archive["TagcamsCommandedSequenceId"]), 85); EXPECT_EQ(int(archive["TagcamsCommandedImageId"]), 6); EXPECT_EQ(int(archive["RawCameraHeadTemperature"]), 1613); @@ -103,8 +103,8 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCam) { // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["FilterName"][0].toStdString(), "Monochrome"); - EXPECT_EQ(bandbin["Name"][0].toStdString(), "NAVCam"); + ASSERT_EQ(bandbin["FilterName"][0], "Monochrome"); + EXPECT_EQ(bandbin["Name"][0], "NAVCam"); ASSERT_EQ(int(bandbin["Number"]), 1); ASSERT_EQ(int(bandbin["Center"]), 550); @@ -118,7 +118,7 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCam) { // OriginalLabel object PvlObject &origLabel = isisLabel->findObject("OriginalLabel", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, origLabel.findKeyword("Name"), "IsisCube"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, origLabel.findKeyword("Name"), "IsisCube"); EXPECT_EQ(int(origLabel["StartByte"]), 10143233); EXPECT_EQ(int(origLabel["Bytes"]), 5638); } @@ -160,7 +160,7 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCamRemCalPixOff) { // Core object PvlObject &core = isisLabel->findObject("Core", Pvl::Traverse); EXPECT_EQ(int(core["StartByte"]), 65537); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, core.findKeyword("Format"), "Tile"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, core.findKeyword("Format"), "Tile"); EXPECT_EQ(int(core["TileSamples"]), 688); EXPECT_EQ(int(core["TileLines"]), 1002); @@ -172,22 +172,22 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCamRemCalPixOff) { // Pixels Group in Core PvlGroup &pixels = core.findGroup("Pixels", Pvl::Traverse); - EXPECT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - EXPECT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + EXPECT_EQ(pixels["Type"][0], "SignedWord"); + EXPECT_EQ(pixels["ByteOrder"][0], "Lsb"); EXPECT_DOUBLE_EQ(double(pixels["Base"]), 32768.0); EXPECT_DOUBLE_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["MissionName"][0].toStdString(), "OSIRIS-REx"); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "OSIRIS-REX"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "NAVCam"); - EXPECT_EQ(inst["InstrumentName"][0].toStdString(), "TAGCAMS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Bennu"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2020-03-03T21:30:31.138"); - EXPECT_EQ(inst["MidObservationTime"][0].toStdString(), "2020-03-03T21:30:31.140"); + EXPECT_EQ(inst["MissionName"][0], "OSIRIS-REx"); + EXPECT_EQ(inst["SpacecraftName"][0], "OSIRIS-REX"); + EXPECT_EQ(inst["InstrumentId"][0], "NAVCam"); + EXPECT_EQ(inst["InstrumentName"][0], "TAGCAMS"); + EXPECT_EQ(inst["TargetName"][0], "Bennu"); + EXPECT_EQ(inst["StartTime"][0], "2020-03-03T21:30:31.138"); + EXPECT_EQ(inst["MidObservationTime"][0], "2020-03-03T21:30:31.140"); EXPECT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.0042976); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "3/0636542973.02560"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "3/0636542973.02560"); EXPECT_DOUBLE_EQ(double(inst["EphemerisTime"]), 636543100.32543004); EXPECT_EQ(int(inst["Binning"]), 0); EXPECT_EQ(int(inst["Summing"]), 0); @@ -203,9 +203,9 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCamRemCalPixOff) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["SourceProductId"][0].toStdString(), "20200303T213031S138_ncm_L0"); - EXPECT_EQ(archive["ProducerId"][0].toStdString(), "SPOC"); - EXPECT_EQ(archive["MetaKernel"][0].toStdString(), "spoc-digestfits-2020-03-10T15_08_20.712Z.mk"); + EXPECT_EQ(archive["SourceProductId"][0], "20200303T213031S138_ncm_L0"); + EXPECT_EQ(archive["ProducerId"][0], "SPOC"); + EXPECT_EQ(archive["MetaKernel"][0], "spoc-digestfits-2020-03-10T15_08_20.712Z.mk"); EXPECT_EQ(int(archive["TagcamsCommandedSequenceId"]), 85); EXPECT_EQ(int(archive["TagcamsCommandedImageId"]), 6); EXPECT_EQ(int(archive["RawCameraHeadTemperature"]), 1613); @@ -215,8 +215,8 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCamRemCalPixOff) { // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["FilterName"][0].toStdString(), "Monochrome"); - EXPECT_EQ(bandbin["Name"][0].toStdString(), "NAVCam"); + ASSERT_EQ(bandbin["FilterName"][0], "Monochrome"); + EXPECT_EQ(bandbin["Name"][0], "NAVCam"); ASSERT_EQ(int(bandbin["Number"]), 1); ASSERT_EQ(int(bandbin["Center"]), 550); @@ -230,7 +230,7 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCamRemCalPixOff) { // OriginalLabel object PvlObject &origLabel = isisLabel->findObject("OriginalLabel", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, origLabel.findKeyword("Name"), "IsisCube"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, origLabel.findKeyword("Name"), "IsisCube"); EXPECT_EQ(int(origLabel["StartByte"]), 11095553); EXPECT_EQ(int(origLabel["Bytes"]), 5638); } @@ -270,7 +270,7 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNftCam) { // Core object PvlObject &core = isisLabel->findObject("Core", Pvl::Traverse); EXPECT_EQ(int(core["StartByte"]), 65537); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, core.findKeyword("Format"), "Tile"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, core.findKeyword("Format"), "Tile"); EXPECT_EQ(int(core["TileSamples"]), 864); EXPECT_EQ(int(core["TileLines"]), 972); @@ -282,22 +282,22 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNftCam) { // Pixels Group in Core PvlGroup &pixels = core.findGroup("Pixels", Pvl::Traverse); - EXPECT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - EXPECT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + EXPECT_EQ(pixels["Type"][0], "SignedWord"); + EXPECT_EQ(pixels["ByteOrder"][0], "Lsb"); EXPECT_DOUBLE_EQ(double(pixels["Base"]), 32768.0); EXPECT_DOUBLE_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["MissionName"][0].toStdString(), "OSIRIS-REx"); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "OSIRIS-REX"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "NFTCam"); - EXPECT_EQ(inst["InstrumentName"][0].toStdString(), "TAGCAMS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Bennu"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2020-10-20T21:42:40.974"); - EXPECT_EQ(inst["MidObservationTime"][0].toStdString(), "2020-10-20T21:42:40.976"); + EXPECT_EQ(inst["MissionName"][0], "OSIRIS-REx"); + EXPECT_EQ(inst["SpacecraftName"][0], "OSIRIS-REX"); + EXPECT_EQ(inst["InstrumentId"][0], "NFTCam"); + EXPECT_EQ(inst["InstrumentName"][0], "TAGCAMS"); + EXPECT_EQ(inst["TargetName"][0], "Bennu"); + EXPECT_EQ(inst["StartTime"][0], "2020-10-20T21:42:40.974"); + EXPECT_EQ(inst["MidObservationTime"][0], "2020-10-20T21:42:40.976"); EXPECT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.005894); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "3/0656502090.40704"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "3/0656502090.40704"); EXPECT_DOUBLE_EQ(double(inst["EphemerisTime"]), 656502230.15840399); EXPECT_EQ(int(inst["Binning"]), 0); EXPECT_EQ(int(inst["Summing"]), 0); @@ -313,9 +313,9 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNftCam) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["SourceProductId"][0].toStdString(), "20201020T214241S004_nft_L0"); - EXPECT_EQ(archive["ProducerId"][0].toStdString(), "SPOC"); - EXPECT_EQ(archive["MetaKernel"][0].toStdString(), "spoc-digestfits-2021-02-13T22_56_01.274Z.mk"); + EXPECT_EQ(archive["SourceProductId"][0], "20201020T214241S004_nft_L0"); + EXPECT_EQ(archive["ProducerId"][0], "SPOC"); + EXPECT_EQ(archive["MetaKernel"][0], "spoc-digestfits-2021-02-13T22_56_01.274Z.mk"); EXPECT_EQ(int(archive["TagcamsCommandedSequenceId"]), 200); EXPECT_EQ(int(archive["TagcamsCommandedImageId"]), 21); EXPECT_EQ(int(archive["RawCameraHeadTemperature"]), 1654); @@ -325,8 +325,8 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNftCam) { // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["FilterName"][0].toStdString(), "Monochrome"); - EXPECT_EQ(bandbin["Name"][0].toStdString(), "NFTCam"); + ASSERT_EQ(bandbin["FilterName"][0], "Monochrome"); + EXPECT_EQ(bandbin["Name"][0], "NFTCam"); ASSERT_EQ(int(bandbin["Number"]), 1); ASSERT_EQ(int(bandbin["Center"]), 550); @@ -340,7 +340,7 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNftCam) { // OriginalLabel object PvlObject &origLabel = isisLabel->findObject("OriginalLabel", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, origLabel.findKeyword("Name"), "IsisCube"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, origLabel.findKeyword("Name"), "IsisCube"); EXPECT_EQ(int(origLabel["StartByte"]), 10143233); EXPECT_EQ(int(origLabel["Bytes"]), 5635); } @@ -380,7 +380,7 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisStowCam) { // Core object PvlObject &core = isisLabel->findObject("Core", Pvl::Traverse); EXPECT_EQ(int(core["StartByte"]), 65537); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, core.findKeyword("Format"), "Tile"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, core.findKeyword("Format"), "Tile"); EXPECT_EQ(int(core["TileSamples"]), 864); EXPECT_EQ(int(core["TileLines"]), 972); @@ -392,22 +392,22 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisStowCam) { // Pixels Group in Core PvlGroup &pixels = core.findGroup("Pixels", Pvl::Traverse); - EXPECT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); - EXPECT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + EXPECT_EQ(pixels["Type"][0], "SignedWord"); + EXPECT_EQ(pixels["ByteOrder"][0], "Lsb"); EXPECT_DOUBLE_EQ(double(pixels["Base"]), 32768.0); EXPECT_DOUBLE_EQ(double(pixels["Multiplier"]), 1.0); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["MissionName"][0].toStdString(), "OSIRIS-REx"); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "OSIRIS-REX"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "StowCam"); - EXPECT_EQ(inst["InstrumentName"][0].toStdString(), "TAGCAMS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Bennu"); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2019-12-11T19:13:26.938"); - EXPECT_EQ(inst["MidObservationTime"][0].toStdString(), "2019-12-11T19:13:26.952"); + EXPECT_EQ(inst["MissionName"][0], "OSIRIS-REx"); + EXPECT_EQ(inst["SpacecraftName"][0], "OSIRIS-REX"); + EXPECT_EQ(inst["InstrumentId"][0], "StowCam"); + EXPECT_EQ(inst["InstrumentName"][0], "TAGCAMS"); + EXPECT_EQ(inst["TargetName"][0], "Bennu"); + EXPECT_EQ(inst["StartTime"][0], "2019-12-11T19:13:26.938"); + EXPECT_EQ(inst["MidObservationTime"][0], "2019-12-11T19:13:26.952"); EXPECT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.0299888); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "3/0629363554.01024"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "3/0629363554.01024"); EXPECT_DOUBLE_EQ(double(inst["EphemerisTime"]), 629363676.135341); EXPECT_EQ(int(inst["Binning"]), 0); EXPECT_EQ(int(inst["Summing"]), 0); @@ -423,9 +423,9 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisStowCam) { // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["SourceProductId"][0].toStdString(), "20191211T191327S037_sto_L0"); - EXPECT_EQ(archive["ProducerId"][0].toStdString(), "SPOC"); - EXPECT_EQ(archive["MetaKernel"][0].toStdString(), "spoc-digestfits-2020-02-05T20_27_37.424Z.mk"); + EXPECT_EQ(archive["SourceProductId"][0], "20191211T191327S037_sto_L0"); + EXPECT_EQ(archive["ProducerId"][0], "SPOC"); + EXPECT_EQ(archive["MetaKernel"][0], "spoc-digestfits-2020-02-05T20_27_37.424Z.mk"); EXPECT_EQ(int(archive["TagcamsCommandedSequenceId"]), 190); EXPECT_EQ(int(archive["TagcamsCommandedImageId"]), 0); EXPECT_EQ(int(archive["RawCameraHeadTemperature"]), 1743); @@ -435,8 +435,8 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisStowCam) { // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["FilterName"][0].toStdString(), "Monochrome"); - EXPECT_EQ(bandbin["Name"][0].toStdString(), "StowCam"); + ASSERT_EQ(bandbin["FilterName"][0], "Monochrome"); + EXPECT_EQ(bandbin["Name"][0], "StowCam"); ASSERT_EQ(int(bandbin["Number"]), 1); ASSERT_EQ(int(bandbin["Center"]), 550); @@ -450,7 +450,7 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisStowCam) { // OriginalLabel object PvlObject &origLabel = isisLabel->findObject("OriginalLabel", Pvl::Traverse); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, origLabel.findKeyword("Name"), "IsisCube"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, origLabel.findKeyword("Name"), "IsisCube"); EXPECT_EQ(int(origLabel["StartByte"]), 10143233); EXPECT_EQ(int(origLabel["Bytes"]), 5546); } \ No newline at end of file diff --git a/isis/tests/FunctionalTestsTgocassis2isis.cpp b/isis/tests/FunctionalTestsTgocassis2isis.cpp index dc55e85aec..170e5b3cd0 100644 --- a/isis/tests/FunctionalTestsTgocassis2isis.cpp +++ b/isis/tests/FunctionalTestsTgocassis2isis.cpp @@ -36,20 +36,20 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestBlu) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f015435767e275a"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f015435767e275a"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "BLU"); + EXPECT_EQ(inst["Filter"][0], "BLU"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(archive["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(archive["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(archive["DataSetId"][0], "TBD"); + EXPECT_EQ(archive["ProductVersionId"][0], "UNK"); + EXPECT_EQ(archive["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(archive["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(archive["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(archive["PredictMaximumExposureTime"]), 1.5952); @@ -66,7 +66,7 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestBlu) { EXPECT_EQ(int(archive["ImageFrequency"]), 400000); EXPECT_EQ(int(archive["NumberOfWindows"]), 6); EXPECT_EQ(int(archive["UniqueIdentifier"]), 100799268); - EXPECT_EQ(archive["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(archive["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(archive["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(archive["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(archive["WindowCount"]), 3); @@ -101,14 +101,14 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestBlu) { EXPECT_EQ(int(archive["Window6StartLine"]), 1850); EXPECT_EQ(int(archive["Window6EndLine"]), 1858); EXPECT_EQ(int(archive["YearDoy"]), 2016331); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_201_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_201_0"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "BLU"); + EXPECT_EQ(bandbin["FilterName"][0], "BLU"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 494.8); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 133.6); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143424"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143424"); // Kernels Group PvlGroup &kernels = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -145,14 +145,14 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestRed) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f015435767e275a"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f015435767e275a"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "RED"); + EXPECT_EQ(inst["Filter"][0], "RED"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); @@ -172,17 +172,17 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestRed) { EXPECT_EQ(int(archive["ImageFrequency"]), 400000); EXPECT_EQ(int(archive["NumberOfWindows"]), 6); EXPECT_EQ(int(archive["UniqueIdentifier"]), 100799268); - EXPECT_EQ(archive["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(archive["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(archive["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(archive["PixelsPossiblySaturated"]), 0.16); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_201_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_201_0"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "RED"); + EXPECT_EQ(bandbin["FilterName"][0], "RED"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 836.0); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 98.5); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143422"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143422"); // Kernels Group PvlGroup &kernels = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -219,14 +219,14 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestNir) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f015435767e275a"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f015435767e275a"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "NIR"); + EXPECT_EQ(inst["Filter"][0], "NIR"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); @@ -246,17 +246,17 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestNir) { EXPECT_EQ(int(archive["ImageFrequency"]), 400000); EXPECT_EQ(int(archive["NumberOfWindows"]), 6); EXPECT_EQ(int(archive["UniqueIdentifier"]), 100799268); - EXPECT_EQ(archive["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(archive["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(archive["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(archive["PixelsPossiblySaturated"]), 0.00); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_201_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_201_0"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "NIR"); + EXPECT_EQ(bandbin["FilterName"][0], "NIR"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 939.3); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 121.8); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143423"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143423"); // Kernels Group PvlGroup &kernels = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -293,14 +293,14 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestPan) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f015435767e275a"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f015435767e275a"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "PAN"); + EXPECT_EQ(inst["Filter"][0], "PAN"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); @@ -320,17 +320,17 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestPan) { EXPECT_EQ(int(archive["ImageFrequency"]), 400000); EXPECT_EQ(int(archive["NumberOfWindows"]), 6); EXPECT_EQ(int(archive["UniqueIdentifier"]), 100799268); - EXPECT_EQ(archive["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(archive["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(archive["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(archive["PixelsPossiblySaturated"]), 29.17); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_201_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_201_0"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "PAN"); + EXPECT_EQ(bandbin["FilterName"][0], "PAN"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 678.2); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 231.9); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143421"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143421"); // Kernels Group PvlGroup &kernels = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -415,27 +415,27 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestReingestedUnproj) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2018-05-05T23:11:48.767"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.488e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2018-05-05T23:11:48.767"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.488e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "RED"); + EXPECT_EQ(inst["Filter"][0], "RED"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "MY34_002002_211_2"); - EXPECT_EQ(archive["ProductVersionId"][0].toStdString(), "1.0"); - EXPECT_EQ(archive["ScalingFactor"][0].toStdString(), "1.0"); - EXPECT_EQ(archive["YearDoy"][0].toStdString(), "2018125"); + EXPECT_EQ(archive["ObservationId"][0], "MY34_002002_211_2"); + EXPECT_EQ(archive["ProductVersionId"][0], "1.0"); + EXPECT_EQ(archive["ScalingFactor"][0], "1.0"); + EXPECT_EQ(archive["YearDoy"][0], "2018125"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "RED"); + EXPECT_EQ(bandbin["FilterName"][0], "RED"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 836.0); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 98.5); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143422"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143422"); // Kernels Group PvlGroup &kernels = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -472,27 +472,27 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestReingestedProj) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2018-05-05T23:11:48.767"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.488e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2018-05-05T23:11:48.767"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.488e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "RED"); + EXPECT_EQ(inst["Filter"][0], "RED"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "MY34_002002_211_2"); - EXPECT_EQ(archive["ProductVersionId"][0].toStdString(), "1.0"); - EXPECT_EQ(archive["ScalingFactor"][0].toStdString(), "1.0"); - EXPECT_EQ(archive["YearDoy"][0].toStdString(), "2018125"); + EXPECT_EQ(archive["ObservationId"][0], "MY34_002002_211_2"); + EXPECT_EQ(archive["ProductVersionId"][0], "1.0"); + EXPECT_EQ(archive["ScalingFactor"][0], "1.0"); + EXPECT_EQ(archive["YearDoy"][0], "2018125"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "RED"); + EXPECT_EQ(bandbin["FilterName"][0], "RED"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 836.0); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 98.5); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143422"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143422"); // Kernels Group PvlGroup &kernels = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -530,27 +530,27 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestPSALabel) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2021-06-07T00:31:03.723"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.018e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2021-06-07T00:31:03.723"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.018e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "PAN"); + EXPECT_EQ(inst["Filter"][0], "PAN"); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "MY36_015782_024_0"); - EXPECT_EQ(archive["ProductVersionId"][0].toStdString(), "1.0"); - EXPECT_EQ(archive["ScalingFactor"][0].toStdString(), "1.0"); - EXPECT_EQ(archive["YearDoy"][0].toStdString(), "2021158"); + EXPECT_EQ(archive["ObservationId"][0], "MY36_015782_024_0"); + EXPECT_EQ(archive["ProductVersionId"][0], "1.0"); + EXPECT_EQ(archive["ScalingFactor"][0], "1.0"); + EXPECT_EQ(archive["YearDoy"][0], "2021158"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "PAN"); + EXPECT_EQ(bandbin["FilterName"][0], "PAN"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 678.2); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 231.9); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143421"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143421"); // Kernels Group PvlGroup &kernels = isisLabel->findGroup("Kernels", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsTgocassisstitch.cpp b/isis/tests/FunctionalTestsTgocassisstitch.cpp index df0b73b237..267905d86e 100644 --- a/isis/tests/FunctionalTestsTgocassisstitch.cpp +++ b/isis/tests/FunctionalTestsTgocassisstitch.cpp @@ -49,20 +49,20 @@ TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-22T16:16:16.833"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f014e933c4a631f"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.152e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-22T16:16:16.833"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f014e933c4a631f"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.152e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "FULLCCD"); + EXPECT_EQ(inst["Filter"][0], "FULLCCD"); // Red Archive Group PvlGroup &arcRed = isisLabel->findGroup("archiveRED", Pvl::Traverse); - EXPECT_EQ(arcRed["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(arcRed["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(arcRed["ProductCreationTime"][0].toStdString(), "2017-10-03T09:38:29"); + EXPECT_EQ(arcRed["DataSetId"][0], "TBD"); + EXPECT_EQ(arcRed["ProductVersionId"][0], "UNK"); + EXPECT_EQ(arcRed["ProductCreationTime"][0], "2017-10-03T09:38:29"); EXPECT_DOUBLE_EQ(double(arcRed["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(arcRed["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(arcRed["PredictMaximumExposureTime"]), 5.2866); @@ -79,16 +79,16 @@ TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) { EXPECT_EQ(int(arcRed["ImageFrequency"]), 1000000); EXPECT_EQ(int(arcRed["NumberOfWindows"]), 6); EXPECT_EQ(int(arcRed["UniqueIdentifier"]), 100732832); - EXPECT_EQ(arcRed["ExposureTimestamp"][0].toStdString(), "2f014e931416226d"); + EXPECT_EQ(arcRed["ExposureTimestamp"][0], "2f014e931416226d"); EXPECT_DOUBLE_EQ(double(arcRed["ExposureTimePEHK"]), 1.152e-003); EXPECT_DOUBLE_EQ(double(arcRed["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(arcRed["YearDoy"]), 2016327); // Pan Archive Group PvlGroup &arcPan = isisLabel->findGroup("archivePAN", Pvl::Traverse); - EXPECT_EQ(arcPan["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(arcPan["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(arcPan["ProductCreationTime"][0].toStdString(), "2017-10-03T09:38:29"); + EXPECT_EQ(arcPan["DataSetId"][0], "TBD"); + EXPECT_EQ(arcPan["ProductVersionId"][0], "UNK"); + EXPECT_EQ(arcPan["ProductCreationTime"][0], "2017-10-03T09:38:29"); EXPECT_DOUBLE_EQ(double(arcPan["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(arcPan["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(arcPan["PredictMaximumExposureTime"]), 5.2866); @@ -105,16 +105,16 @@ TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) { EXPECT_EQ(int(arcPan["ImageFrequency"]), 1000000); EXPECT_EQ(int(arcPan["NumberOfWindows"]), 6); EXPECT_EQ(int(arcPan["UniqueIdentifier"]), 100732832); - EXPECT_EQ(arcPan["ExposureTimestamp"][0].toStdString(), "2f014e931416226d"); + EXPECT_EQ(arcPan["ExposureTimestamp"][0], "2f014e931416226d"); EXPECT_DOUBLE_EQ(double(arcPan["ExposureTimePEHK"]), 1.152e-003); EXPECT_DOUBLE_EQ(double(arcPan["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(arcPan["YearDoy"]), 2016327); // Nir Archive Group PvlGroup &arcNir = isisLabel->findGroup("archiveNIR", Pvl::Traverse); - EXPECT_EQ(arcNir["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(arcNir["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(arcNir["ProductCreationTime"][0].toStdString(), "2017-10-03T09:38:29"); + EXPECT_EQ(arcNir["DataSetId"][0], "TBD"); + EXPECT_EQ(arcNir["ProductVersionId"][0], "UNK"); + EXPECT_EQ(arcNir["ProductCreationTime"][0], "2017-10-03T09:38:29"); EXPECT_DOUBLE_EQ(double(arcNir["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(arcNir["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(arcNir["PredictMaximumExposureTime"]), 5.2866); @@ -131,16 +131,16 @@ TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) { EXPECT_EQ(int(arcNir["ImageFrequency"]), 1000000); EXPECT_EQ(int(arcNir["NumberOfWindows"]), 6); EXPECT_EQ(int(arcNir["UniqueIdentifier"]), 100732832); - EXPECT_EQ(arcNir["ExposureTimestamp"][0].toStdString(), "2f014e931416226d"); + EXPECT_EQ(arcNir["ExposureTimestamp"][0], "2f014e931416226d"); EXPECT_DOUBLE_EQ(double(arcNir["ExposureTimePEHK"]), 1.152e-003); EXPECT_DOUBLE_EQ(double(arcNir["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(arcNir["YearDoy"]), 2016327); // Blue Archive Group PvlGroup &arcBlu = isisLabel->findGroup("archiveBLU", Pvl::Traverse); - EXPECT_EQ(arcBlu["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(arcBlu["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(arcBlu["ProductCreationTime"][0].toStdString(), "2017-10-03T09:38:29"); + EXPECT_EQ(arcBlu["DataSetId"][0], "TBD"); + EXPECT_EQ(arcBlu["ProductVersionId"][0], "UNK"); + EXPECT_EQ(arcBlu["ProductCreationTime"][0], "2017-10-03T09:38:29"); EXPECT_DOUBLE_EQ(double(arcBlu["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(arcBlu["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(arcBlu["PredictMaximumExposureTime"]), 5.2866); @@ -157,45 +157,45 @@ TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) { EXPECT_EQ(int(arcBlu["ImageFrequency"]), 1000000); EXPECT_EQ(int(arcBlu["NumberOfWindows"]), 6); EXPECT_EQ(int(arcBlu["UniqueIdentifier"]), 100732832); - EXPECT_EQ(arcBlu["ExposureTimestamp"][0].toStdString(), "2f014e931416226d"); + EXPECT_EQ(arcBlu["ExposureTimestamp"][0], "2f014e931416226d"); EXPECT_DOUBLE_EQ(double(arcBlu["ExposureTimePEHK"]), 1.152e-003); EXPECT_DOUBLE_EQ(double(arcBlu["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(arcBlu["YearDoy"]), 2016327); // Stitch Group PvlGroup &stitch = isisLabel->findGroup("Stitch", Pvl::Traverse); - EXPECT_EQ(stitch["OriginalFilters"][0].toStdString(), "PAN"); - EXPECT_EQ(stitch["OriginalFilters"][1].toStdString(), "NIR"); - EXPECT_EQ(stitch["OriginalFilters"][2].toStdString(), "RED"); - EXPECT_EQ(stitch["OriginalFilters"][3].toStdString(), "BLU"); - EXPECT_EQ(stitch["FilterCenters"][0].toStdString(), "675"); - EXPECT_EQ(stitch["FilterCenters"][1].toStdString(), "985"); - EXPECT_EQ(stitch["FilterCenters"][2].toStdString(), "840"); - EXPECT_EQ(stitch["FilterCenters"][3].toStdString(), "485"); - EXPECT_EQ(stitch["FilterWidths"][0].toStdString(), "250"); - EXPECT_EQ(stitch["FilterWidths"][1].toStdString(), "220"); - EXPECT_EQ(stitch["FilterWidths"][2].toStdString(), "100"); - EXPECT_EQ(stitch["FilterWidths"][3].toStdString(), "165"); - EXPECT_EQ(stitch["FilterIkCodes"][0].toStdString(), "-143421"); - EXPECT_EQ(stitch["FilterIkCodes"][1].toStdString(), "-143423"); - EXPECT_EQ(stitch["FilterIkCodes"][2].toStdString(), "-143422"); - EXPECT_EQ(stitch["FilterIkCodes"][3].toStdString(), "-143424"); - EXPECT_EQ(stitch["FilterStartSamples"][0].toStdString(), "0.0"); - EXPECT_EQ(stitch["FilterStartSamples"][1].toStdString(), "0.0"); - EXPECT_EQ(stitch["FilterStartSamples"][2].toStdString(), "0.0"); - EXPECT_EQ(stitch["FilterStartSamples"][3].toStdString(), "1024.0"); - EXPECT_EQ(stitch["FilterStartLines"][0].toStdString(), "354.0"); - EXPECT_EQ(stitch["FilterStartLines"][1].toStdString(), "1048.0"); - EXPECT_EQ(stitch["FilterStartLines"][2].toStdString(), "712.0"); - EXPECT_EQ(stitch["FilterStartLines"][3].toStdString(), "1409.0"); - EXPECT_EQ(stitch["FilterLines"][0].toStdString(), "5"); - EXPECT_EQ(stitch["FilterLines"][1].toStdString(), "5"); - EXPECT_EQ(stitch["FilterLines"][2].toStdString(), "5"); - EXPECT_EQ(stitch["FilterLines"][3].toStdString(), "218"); + EXPECT_EQ(stitch["OriginalFilters"][0], "PAN"); + EXPECT_EQ(stitch["OriginalFilters"][1], "NIR"); + EXPECT_EQ(stitch["OriginalFilters"][2], "RED"); + EXPECT_EQ(stitch["OriginalFilters"][3], "BLU"); + EXPECT_EQ(stitch["FilterCenters"][0], "675"); + EXPECT_EQ(stitch["FilterCenters"][1], "985"); + EXPECT_EQ(stitch["FilterCenters"][2], "840"); + EXPECT_EQ(stitch["FilterCenters"][3], "485"); + EXPECT_EQ(stitch["FilterWidths"][0], "250"); + EXPECT_EQ(stitch["FilterWidths"][1], "220"); + EXPECT_EQ(stitch["FilterWidths"][2], "100"); + EXPECT_EQ(stitch["FilterWidths"][3], "165"); + EXPECT_EQ(stitch["FilterIkCodes"][0], "-143421"); + EXPECT_EQ(stitch["FilterIkCodes"][1], "-143423"); + EXPECT_EQ(stitch["FilterIkCodes"][2], "-143422"); + EXPECT_EQ(stitch["FilterIkCodes"][3], "-143424"); + EXPECT_EQ(stitch["FilterStartSamples"][0], "0.0"); + EXPECT_EQ(stitch["FilterStartSamples"][1], "0.0"); + EXPECT_EQ(stitch["FilterStartSamples"][2], "0.0"); + EXPECT_EQ(stitch["FilterStartSamples"][3], "1024.0"); + EXPECT_EQ(stitch["FilterStartLines"][0], "354.0"); + EXPECT_EQ(stitch["FilterStartLines"][1], "1048.0"); + EXPECT_EQ(stitch["FilterStartLines"][2], "712.0"); + EXPECT_EQ(stitch["FilterStartLines"][3], "1409.0"); + EXPECT_EQ(stitch["FilterLines"][0], "5"); + EXPECT_EQ(stitch["FilterLines"][1], "5"); + EXPECT_EQ(stitch["FilterLines"][2], "5"); + EXPECT_EQ(stitch["FilterLines"][3], "218"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "FULLCCD"); + EXPECT_EQ(bandbin["FilterName"][0], "FULLCCD"); // Kernels Group @@ -246,20 +246,20 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-22T16:16:10.833"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f014e932e2620aa"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.152e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-22T16:16:10.833"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f014e932e2620aa"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.152e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "FULLCCD"); + EXPECT_EQ(inst["Filter"][0], "FULLCCD"); // Red Archive Group PvlGroup &arcRed = isisLabel->findGroup("archiveRED", Pvl::Traverse); - EXPECT_EQ(arcRed["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(arcRed["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(arcRed["ProductCreationTime"][0].toStdString(), "2017-10-03T09:38:28"); + EXPECT_EQ(arcRed["DataSetId"][0], "TBD"); + EXPECT_EQ(arcRed["ProductVersionId"][0], "UNK"); + EXPECT_EQ(arcRed["ProductCreationTime"][0], "2017-10-03T09:38:28"); EXPECT_DOUBLE_EQ(double(arcRed["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(arcRed["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(arcRed["PredictMaximumExposureTime"]), 5.3718000000000004); @@ -276,16 +276,16 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) { EXPECT_EQ(int(arcRed["ImageFrequency"]), 1000000); EXPECT_EQ(int(arcRed["NumberOfWindows"]), 6); EXPECT_EQ(int(arcRed["UniqueIdentifier"]), 100732832); - EXPECT_EQ(arcRed["ExposureTimestamp"][0].toStdString(), "2f014e930e16226d"); + EXPECT_EQ(arcRed["ExposureTimestamp"][0], "2f014e930e16226d"); EXPECT_DOUBLE_EQ(double(arcRed["ExposureTimePEHK"]), 1.152e-003); EXPECT_DOUBLE_EQ(double(arcRed["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(arcRed["YearDoy"]), 2016327); // Pan Archive Group PvlGroup &arcPan = isisLabel->findGroup("archivePAN", Pvl::Traverse); - EXPECT_EQ(arcPan["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(arcPan["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(arcPan["ProductCreationTime"][0].toStdString(), "2017-10-03T09:38:28"); + EXPECT_EQ(arcPan["DataSetId"][0], "TBD"); + EXPECT_EQ(arcPan["ProductVersionId"][0], "UNK"); + EXPECT_EQ(arcPan["ProductCreationTime"][0], "2017-10-03T09:38:28"); EXPECT_DOUBLE_EQ(double(arcPan["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(arcPan["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(arcPan["PredictMaximumExposureTime"]), 5.3718); @@ -302,16 +302,16 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) { EXPECT_EQ(int(arcPan["ImageFrequency"]), 1000000); EXPECT_EQ(int(arcPan["NumberOfWindows"]), 6); EXPECT_EQ(int(arcPan["UniqueIdentifier"]), 100732832); - EXPECT_EQ(arcPan["ExposureTimestamp"][0].toStdString(), "2f014e930e16226d"); + EXPECT_EQ(arcPan["ExposureTimestamp"][0], "2f014e930e16226d"); EXPECT_DOUBLE_EQ(double(arcPan["ExposureTimePEHK"]), 1.152e-003); EXPECT_DOUBLE_EQ(double(arcPan["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(arcPan["YearDoy"]), 2016327); // Nir Archive Group PvlGroup &arcNir = isisLabel->findGroup("archiveNIR", Pvl::Traverse); - EXPECT_EQ(arcNir["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(arcNir["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(arcNir["ProductCreationTime"][0].toStdString(), "2017-10-03T09:38:28"); + EXPECT_EQ(arcNir["DataSetId"][0], "TBD"); + EXPECT_EQ(arcNir["ProductVersionId"][0], "UNK"); + EXPECT_EQ(arcNir["ProductCreationTime"][0], "2017-10-03T09:38:28"); EXPECT_DOUBLE_EQ(double(arcNir["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(arcNir["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(arcNir["PredictMaximumExposureTime"]), 5.3718); @@ -328,16 +328,16 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) { EXPECT_EQ(int(arcNir["ImageFrequency"]), 1000000); EXPECT_EQ(int(arcNir["NumberOfWindows"]), 6); EXPECT_EQ(int(arcNir["UniqueIdentifier"]), 100732832); - EXPECT_EQ(arcNir["ExposureTimestamp"][0].toStdString(), "2f014e930e16226d"); + EXPECT_EQ(arcNir["ExposureTimestamp"][0], "2f014e930e16226d"); EXPECT_DOUBLE_EQ(double(arcNir["ExposureTimePEHK"]), 1.152e-003); EXPECT_DOUBLE_EQ(double(arcNir["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(arcNir["YearDoy"]), 2016327); // Blue Archive Group PvlGroup &arcBlu = isisLabel->findGroup("archiveBLU", Pvl::Traverse); - EXPECT_EQ(arcBlu["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(arcBlu["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(arcBlu["ProductCreationTime"][0].toStdString(), "2017-10-03T09:38:28"); + EXPECT_EQ(arcBlu["DataSetId"][0], "TBD"); + EXPECT_EQ(arcBlu["ProductVersionId"][0], "UNK"); + EXPECT_EQ(arcBlu["ProductCreationTime"][0], "2017-10-03T09:38:28"); EXPECT_DOUBLE_EQ(double(arcBlu["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(arcBlu["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(arcBlu["PredictMaximumExposureTime"]), 5.3718); @@ -354,45 +354,45 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) { EXPECT_EQ(int(arcBlu["ImageFrequency"]), 1000000); EXPECT_EQ(int(arcBlu["NumberOfWindows"]), 6); EXPECT_EQ(int(arcBlu["UniqueIdentifier"]), 100732832); - EXPECT_EQ(arcBlu["ExposureTimestamp"][0].toStdString(), "2f014e930e16226d"); + EXPECT_EQ(arcBlu["ExposureTimestamp"][0], "2f014e930e16226d"); EXPECT_DOUBLE_EQ(double(arcBlu["ExposureTimePEHK"]), 1.152e-003); EXPECT_DOUBLE_EQ(double(arcBlu["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(arcBlu["YearDoy"]), 2016327); // Stitch Group PvlGroup &stitch = isisLabel->findGroup("Stitch", Pvl::Traverse); - EXPECT_EQ(stitch["OriginalFilters"][0].toStdString(), "RED"); - EXPECT_EQ(stitch["OriginalFilters"][1].toStdString(), "PAN"); - EXPECT_EQ(stitch["OriginalFilters"][2].toStdString(), "NIR"); - EXPECT_EQ(stitch["OriginalFilters"][3].toStdString(), "BLU"); - EXPECT_EQ(stitch["FilterCenters"][0].toStdString(), "840"); - EXPECT_EQ(stitch["FilterCenters"][1].toStdString(), "675"); - EXPECT_EQ(stitch["FilterCenters"][2].toStdString(), "985"); - EXPECT_EQ(stitch["FilterCenters"][3].toStdString(), "485"); - EXPECT_EQ(stitch["FilterWidths"][0].toStdString(), "100"); - EXPECT_EQ(stitch["FilterWidths"][1].toStdString(), "250"); - EXPECT_EQ(stitch["FilterWidths"][2].toStdString(), "220"); - EXPECT_EQ(stitch["FilterWidths"][3].toStdString(), "165"); - EXPECT_EQ(stitch["FilterIkCodes"][0].toStdString(), "-143422"); - EXPECT_EQ(stitch["FilterIkCodes"][1].toStdString(), "-143421"); - EXPECT_EQ(stitch["FilterIkCodes"][2].toStdString(), "-143423"); - EXPECT_EQ(stitch["FilterIkCodes"][3].toStdString(), "-143424"); - EXPECT_EQ(stitch["FilterStartSamples"][0].toStdString(), "0.0"); - EXPECT_EQ(stitch["FilterStartSamples"][1].toStdString(), "0.0"); - EXPECT_EQ(stitch["FilterStartSamples"][2].toStdString(), "0.0"); - EXPECT_EQ(stitch["FilterStartSamples"][3].toStdString(), "1024.0"); - EXPECT_EQ(stitch["FilterStartLines"][0].toStdString(), "712.0"); - EXPECT_EQ(stitch["FilterStartLines"][1].toStdString(), "354.0"); - EXPECT_EQ(stitch["FilterStartLines"][2].toStdString(), "1048.0"); - EXPECT_EQ(stitch["FilterStartLines"][3].toStdString(), "1409.0"); - EXPECT_EQ(stitch["FilterLines"][0].toStdString(), "5"); - EXPECT_EQ(stitch["FilterLines"][1].toStdString(), "5"); - EXPECT_EQ(stitch["FilterLines"][2].toStdString(), "5"); - EXPECT_EQ(stitch["FilterLines"][3].toStdString(), "5"); + EXPECT_EQ(stitch["OriginalFilters"][0], "RED"); + EXPECT_EQ(stitch["OriginalFilters"][1], "PAN"); + EXPECT_EQ(stitch["OriginalFilters"][2], "NIR"); + EXPECT_EQ(stitch["OriginalFilters"][3], "BLU"); + EXPECT_EQ(stitch["FilterCenters"][0], "840"); + EXPECT_EQ(stitch["FilterCenters"][1], "675"); + EXPECT_EQ(stitch["FilterCenters"][2], "985"); + EXPECT_EQ(stitch["FilterCenters"][3], "485"); + EXPECT_EQ(stitch["FilterWidths"][0], "100"); + EXPECT_EQ(stitch["FilterWidths"][1], "250"); + EXPECT_EQ(stitch["FilterWidths"][2], "220"); + EXPECT_EQ(stitch["FilterWidths"][3], "165"); + EXPECT_EQ(stitch["FilterIkCodes"][0], "-143422"); + EXPECT_EQ(stitch["FilterIkCodes"][1], "-143421"); + EXPECT_EQ(stitch["FilterIkCodes"][2], "-143423"); + EXPECT_EQ(stitch["FilterIkCodes"][3], "-143424"); + EXPECT_EQ(stitch["FilterStartSamples"][0], "0.0"); + EXPECT_EQ(stitch["FilterStartSamples"][1], "0.0"); + EXPECT_EQ(stitch["FilterStartSamples"][2], "0.0"); + EXPECT_EQ(stitch["FilterStartSamples"][3], "1024.0"); + EXPECT_EQ(stitch["FilterStartLines"][0], "712.0"); + EXPECT_EQ(stitch["FilterStartLines"][1], "354.0"); + EXPECT_EQ(stitch["FilterStartLines"][2], "1048.0"); + EXPECT_EQ(stitch["FilterStartLines"][3], "1409.0"); + EXPECT_EQ(stitch["FilterLines"][0], "5"); + EXPECT_EQ(stitch["FilterLines"][1], "5"); + EXPECT_EQ(stitch["FilterLines"][2], "5"); + EXPECT_EQ(stitch["FilterLines"][3], "5"); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "FULLCCD"); + EXPECT_EQ(bandbin["FilterName"][0], "FULLCCD"); // Kernels Group diff --git a/isis/tests/FunctionalTestsTgocassisunstitch.cpp b/isis/tests/FunctionalTestsTgocassisunstitch.cpp index 79ca68e31b..5bd354e397 100644 --- a/isis/tests/FunctionalTestsTgocassisunstitch.cpp +++ b/isis/tests/FunctionalTestsTgocassisunstitch.cpp @@ -39,20 +39,20 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Instrument Group PvlGroup &panInst = panLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(panInst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(panInst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(panInst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(panInst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(panInst["SpaceCraftClockStartCount"][0].toStdString(), "2f01543594abe199"); - EXPECT_EQ(panInst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(panInst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(panInst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(panInst["TargetName"][0], "Mars"); + EXPECT_EQ(panInst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(panInst["SpaceCraftClockStartCount"][0], "2f01543594abe199"); + EXPECT_EQ(panInst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(panInst["SummingMode"]), 0); - EXPECT_EQ(panInst["Filter"][0].toStdString(), "PAN"); + EXPECT_EQ(panInst["Filter"][0], "PAN"); // Archive Group PvlGroup &panArch = panLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(panArch["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(panArch["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(panArch["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(panArch["DataSetId"][0], "TBD"); + EXPECT_EQ(panArch["ProductVersionId"][0], "UNK"); + EXPECT_EQ(panArch["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(panArch["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(panArch["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(panArch["PredictMaximumExposureTime"]), 1.5952); @@ -69,7 +69,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { EXPECT_EQ(int(panArch["ImageFrequency"]), 400000); EXPECT_EQ(int(panArch["NumberOfWindows"]), 6); EXPECT_EQ(int(panArch["UniqueIdentifier"]), 100799268); - EXPECT_EQ(panArch["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(panArch["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(panArch["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(panArch["PixelsPossiblySaturated"]), 29.17); EXPECT_EQ(int(panArch["WindowCount"]), 0); @@ -107,10 +107,10 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Bandbin Group PvlGroup &panBand = panLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(panBand["FilterName"][0].toStdString(), "PAN"); + EXPECT_EQ(panBand["FilterName"][0], "PAN"); EXPECT_DOUBLE_EQ(double(panBand["Center"]), 675.0); EXPECT_DOUBLE_EQ(double(panBand["Width"]), 250.0); - EXPECT_EQ(panBand["NaifIkCode"][0].toStdString(), "-143421"); + EXPECT_EQ(panBand["NaifIkCode"][0], "-143421"); // Kernels Group PvlGroup &panKern = panLabel->findGroup("Kernels", Pvl::Traverse); @@ -128,20 +128,20 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Instrument Group PvlGroup &redInst = redLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(redInst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(redInst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(redInst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(redInst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(redInst["SpaceCraftClockStartCount"][0].toStdString(), "2f01543594abe199"); - EXPECT_EQ(redInst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(redInst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(redInst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(redInst["TargetName"][0], "Mars"); + EXPECT_EQ(redInst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(redInst["SpaceCraftClockStartCount"][0], "2f01543594abe199"); + EXPECT_EQ(redInst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(redInst["SummingMode"]), 0); - EXPECT_EQ(redInst["Filter"][0].toStdString(), "RED"); + EXPECT_EQ(redInst["Filter"][0], "RED"); // Archive Group PvlGroup &redArch = redLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(redArch["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(redArch["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(redArch["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(redArch["DataSetId"][0], "TBD"); + EXPECT_EQ(redArch["ProductVersionId"][0], "UNK"); + EXPECT_EQ(redArch["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(redArch["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(redArch["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(redArch["PredictMaximumExposureTime"]), 1.5952); @@ -158,7 +158,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { EXPECT_EQ(int(redArch["ImageFrequency"]), 400000); EXPECT_EQ(int(redArch["NumberOfWindows"]), 6); EXPECT_EQ(int(redArch["UniqueIdentifier"]), 100799268); - EXPECT_EQ(redArch["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(redArch["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(redArch["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(redArch["PixelsPossiblySaturated"]), 0.16); EXPECT_EQ(int(redArch["WindowCount"]), 1); @@ -196,10 +196,10 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Bandbin Group PvlGroup &redBand = redLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(redBand["FilterName"][0].toStdString(), "RED"); + EXPECT_EQ(redBand["FilterName"][0], "RED"); EXPECT_DOUBLE_EQ(double(redBand["Center"]), 840.0); EXPECT_DOUBLE_EQ(double(redBand["Width"]), 100.0); - EXPECT_EQ(redBand["NaifIkCode"][0].toStdString(), "-143422"); + EXPECT_EQ(redBand["NaifIkCode"][0], "-143422"); // Kernels Group PvlGroup &redKern = redLabel->findGroup("Kernels", Pvl::Traverse); @@ -218,20 +218,20 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Instrument Group PvlGroup &bluInst = bluLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(bluInst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(bluInst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(bluInst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(bluInst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(bluInst["SpaceCraftClockStartCount"][0].toStdString(), "2f01543594abe199"); - EXPECT_EQ(bluInst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(bluInst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(bluInst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(bluInst["TargetName"][0], "Mars"); + EXPECT_EQ(bluInst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(bluInst["SpaceCraftClockStartCount"][0], "2f01543594abe199"); + EXPECT_EQ(bluInst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(bluInst["SummingMode"]), 0); - EXPECT_EQ(bluInst["Filter"][0].toStdString(), "BLU"); + EXPECT_EQ(bluInst["Filter"][0], "BLU"); // Archive Group PvlGroup &bluArch = bluLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(bluArch["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(bluArch["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(bluArch["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(bluArch["DataSetId"][0], "TBD"); + EXPECT_EQ(bluArch["ProductVersionId"][0], "UNK"); + EXPECT_EQ(bluArch["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(bluArch["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(bluArch["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(bluArch["PredictMaximumExposureTime"]), 1.5952); @@ -248,7 +248,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { EXPECT_EQ(int(bluArch["ImageFrequency"]), 400000); EXPECT_EQ(int(bluArch["NumberOfWindows"]), 6); EXPECT_EQ(int(bluArch["UniqueIdentifier"]), 100799268); - EXPECT_EQ(bluArch["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(bluArch["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(bluArch["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(bluArch["PixelsPossiblySaturated"]), 0); EXPECT_EQ(int(bluArch["WindowCount"]), 3); @@ -286,10 +286,10 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Bandbin Group PvlGroup &bluBand = bluLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bluBand["FilterName"][0].toStdString(), "BLU"); + EXPECT_EQ(bluBand["FilterName"][0], "BLU"); EXPECT_DOUBLE_EQ(double(bluBand["Center"]), 485.0); EXPECT_DOUBLE_EQ(double(bluBand["Width"]), 165.0); - EXPECT_EQ(bluBand["NaifIkCode"][0].toStdString(), "-143424"); + EXPECT_EQ(bluBand["NaifIkCode"][0], "-143424"); // Kernels Group PvlGroup &bluKern = bluLabel->findGroup("Kernels", Pvl::Traverse); @@ -308,20 +308,20 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Instrument Group PvlGroup &nirInst = nirLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(nirInst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(nirInst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(nirInst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(nirInst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(nirInst["SpaceCraftClockStartCount"][0].toStdString(), "2f01543594abe199"); - EXPECT_EQ(nirInst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(nirInst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(nirInst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(nirInst["TargetName"][0], "Mars"); + EXPECT_EQ(nirInst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(nirInst["SpaceCraftClockStartCount"][0], "2f01543594abe199"); + EXPECT_EQ(nirInst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(nirInst["SummingMode"]), 0); - EXPECT_EQ(nirInst["Filter"][0].toStdString(), "NIR"); + EXPECT_EQ(nirInst["Filter"][0], "NIR"); // Archive Group PvlGroup &nirArch = nirLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(nirArch["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(nirArch["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(nirArch["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(nirArch["DataSetId"][0], "TBD"); + EXPECT_EQ(nirArch["ProductVersionId"][0], "UNK"); + EXPECT_EQ(nirArch["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(nirArch["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(nirArch["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(nirArch["PredictMaximumExposureTime"]), 1.5952); @@ -338,7 +338,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { EXPECT_EQ(int(nirArch["ImageFrequency"]), 400000); EXPECT_EQ(int(nirArch["NumberOfWindows"]), 6); EXPECT_EQ(int(nirArch["UniqueIdentifier"]), 100799268); - EXPECT_EQ(nirArch["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(nirArch["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(nirArch["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(nirArch["PixelsPossiblySaturated"]), 0); EXPECT_EQ(int(nirArch["WindowCount"]), 2); @@ -376,10 +376,10 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Bandbin Group PvlGroup &nirBand = nirLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(nirBand["FilterName"][0].toStdString(), "NIR"); + EXPECT_EQ(nirBand["FilterName"][0], "NIR"); EXPECT_DOUBLE_EQ(double(nirBand["Center"]), 985.0); EXPECT_DOUBLE_EQ(double(nirBand["Width"]), 220.0); - EXPECT_EQ(nirBand["NaifIkCode"][0].toStdString(), "-143423"); + EXPECT_EQ(nirBand["NaifIkCode"][0], "-143423"); // Kernels Group PvlGroup &nirKern = nirLabel->findGroup("Kernels", Pvl::Traverse); @@ -413,20 +413,20 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Instrument Group PvlGroup &panInst = panLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(panInst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(panInst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(panInst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(panInst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(panInst["SpaceCraftClockStartCount"][0].toStdString(), "2f01543594abe199"); - EXPECT_EQ(panInst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(panInst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(panInst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(panInst["TargetName"][0], "Mars"); + EXPECT_EQ(panInst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(panInst["SpaceCraftClockStartCount"][0], "2f01543594abe199"); + EXPECT_EQ(panInst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(panInst["SummingMode"]), 0); - EXPECT_EQ(panInst["Filter"][0].toStdString(), "PAN"); + EXPECT_EQ(panInst["Filter"][0], "PAN"); // Archive Group PvlGroup &panArch = panLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(panArch["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(panArch["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(panArch["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(panArch["DataSetId"][0], "TBD"); + EXPECT_EQ(panArch["ProductVersionId"][0], "UNK"); + EXPECT_EQ(panArch["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(panArch["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(panArch["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(panArch["PredictMaximumExposureTime"]), 1.5952); @@ -443,7 +443,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { EXPECT_EQ(int(panArch["ImageFrequency"]), 400000); EXPECT_EQ(int(panArch["NumberOfWindows"]), 6); EXPECT_EQ(int(panArch["UniqueIdentifier"]), 100799268); - EXPECT_EQ(panArch["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(panArch["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(panArch["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(panArch["PixelsPossiblySaturated"]), 29.17); EXPECT_EQ(int(panArch["WindowCount"]), 0); @@ -481,10 +481,10 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Bandbin Group PvlGroup &panBand = panLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(panBand["FilterName"][0].toStdString(), "PAN"); + EXPECT_EQ(panBand["FilterName"][0], "PAN"); EXPECT_DOUBLE_EQ(double(panBand["Center"]), 675.0); EXPECT_DOUBLE_EQ(double(panBand["Width"]), 250.0); - EXPECT_EQ(panBand["NaifIkCode"][0].toStdString(), "-143421"); + EXPECT_EQ(panBand["NaifIkCode"][0], "-143421"); // Kernels Group PvlGroup &panKern = panLabel->findGroup("Kernels", Pvl::Traverse); @@ -511,20 +511,20 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Instrument Group PvlGroup &redInst = redLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(redInst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(redInst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(redInst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(redInst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(redInst["SpaceCraftClockStartCount"][0].toStdString(), "2f01543594abe199"); - EXPECT_EQ(redInst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(redInst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(redInst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(redInst["TargetName"][0], "Mars"); + EXPECT_EQ(redInst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(redInst["SpaceCraftClockStartCount"][0], "2f01543594abe199"); + EXPECT_EQ(redInst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(redInst["SummingMode"]), 0); - EXPECT_EQ(redInst["Filter"][0].toStdString(), "RED"); + EXPECT_EQ(redInst["Filter"][0], "RED"); // Archive Group PvlGroup &redArch = redLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(redArch["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(redArch["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(redArch["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(redArch["DataSetId"][0], "TBD"); + EXPECT_EQ(redArch["ProductVersionId"][0], "UNK"); + EXPECT_EQ(redArch["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(redArch["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(redArch["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(redArch["PredictMaximumExposureTime"]), 1.5952); @@ -541,7 +541,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { EXPECT_EQ(int(redArch["ImageFrequency"]), 400000); EXPECT_EQ(int(redArch["NumberOfWindows"]), 6); EXPECT_EQ(int(redArch["UniqueIdentifier"]), 100799268); - EXPECT_EQ(redArch["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(redArch["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(redArch["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(redArch["PixelsPossiblySaturated"]), 0.16); EXPECT_EQ(int(redArch["WindowCount"]), 1); @@ -579,10 +579,10 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Bandbin Group PvlGroup &redBand = redLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(redBand["FilterName"][0].toStdString(), "RED"); + EXPECT_EQ(redBand["FilterName"][0], "RED"); EXPECT_DOUBLE_EQ(double(redBand["Center"]), 840.0); EXPECT_DOUBLE_EQ(double(redBand["Width"]), 100.0); - EXPECT_EQ(redBand["NaifIkCode"][0].toStdString(), "-143422"); + EXPECT_EQ(redBand["NaifIkCode"][0], "-143422"); // Kernels Group PvlGroup &redKern = redLabel->findGroup("Kernels", Pvl::Traverse); @@ -610,20 +610,20 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Instrument Group PvlGroup &bluInst = bluLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(bluInst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(bluInst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(bluInst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(bluInst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(bluInst["SpaceCraftClockStartCount"][0].toStdString(), "2f01543594abe199"); - EXPECT_EQ(bluInst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(bluInst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(bluInst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(bluInst["TargetName"][0], "Mars"); + EXPECT_EQ(bluInst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(bluInst["SpaceCraftClockStartCount"][0], "2f01543594abe199"); + EXPECT_EQ(bluInst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(bluInst["SummingMode"]), 0); - EXPECT_EQ(bluInst["Filter"][0].toStdString(), "BLU"); + EXPECT_EQ(bluInst["Filter"][0], "BLU"); // Archive Group PvlGroup &bluArch = bluLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(bluArch["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(bluArch["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(bluArch["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(bluArch["DataSetId"][0], "TBD"); + EXPECT_EQ(bluArch["ProductVersionId"][0], "UNK"); + EXPECT_EQ(bluArch["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(bluArch["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(bluArch["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(bluArch["PredictMaximumExposureTime"]), 1.5952); @@ -640,7 +640,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { EXPECT_EQ(int(bluArch["ImageFrequency"]), 400000); EXPECT_EQ(int(bluArch["NumberOfWindows"]), 6); EXPECT_EQ(int(bluArch["UniqueIdentifier"]), 100799268); - EXPECT_EQ(bluArch["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(bluArch["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(bluArch["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(bluArch["PixelsPossiblySaturated"]), 0); EXPECT_EQ(int(bluArch["WindowCount"]), 3); @@ -678,10 +678,10 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Bandbin Group PvlGroup &bluBand = bluLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bluBand["FilterName"][0].toStdString(), "BLU"); + EXPECT_EQ(bluBand["FilterName"][0], "BLU"); EXPECT_DOUBLE_EQ(double(bluBand["Center"]), 485.0); EXPECT_DOUBLE_EQ(double(bluBand["Width"]), 165.0); - EXPECT_EQ(bluBand["NaifIkCode"][0].toStdString(), "-143424"); + EXPECT_EQ(bluBand["NaifIkCode"][0], "-143424"); // Kernels Group PvlGroup &bluKern = bluLabel->findGroup("Kernels", Pvl::Traverse); @@ -709,20 +709,20 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Instrument Group PvlGroup &nirInst = nirLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(nirInst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(nirInst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(nirInst["TargetName"][0].toStdString(), "Mars"); - EXPECT_EQ(nirInst["StartTime"][0].toStdString(), "2016-11-26T22:50:27.381"); - EXPECT_EQ(nirInst["SpaceCraftClockStartCount"][0].toStdString(), "2f01543594abe199"); - EXPECT_EQ(nirInst["ExposureDuration"][0].toStdString(), "1.440e-003"); + EXPECT_EQ(nirInst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(nirInst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(nirInst["TargetName"][0], "Mars"); + EXPECT_EQ(nirInst["StartTime"][0], "2016-11-26T22:50:27.381"); + EXPECT_EQ(nirInst["SpaceCraftClockStartCount"][0], "2f01543594abe199"); + EXPECT_EQ(nirInst["ExposureDuration"][0], "1.440e-003"); EXPECT_EQ(int(nirInst["SummingMode"]), 0); - EXPECT_EQ(nirInst["Filter"][0].toStdString(), "NIR"); + EXPECT_EQ(nirInst["Filter"][0], "NIR"); // Archive Group PvlGroup &nirArch = nirLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(nirArch["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(nirArch["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(nirArch["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:12"); + EXPECT_EQ(nirArch["DataSetId"][0], "TBD"); + EXPECT_EQ(nirArch["ProductVersionId"][0], "UNK"); + EXPECT_EQ(nirArch["ProductCreationTime"][0], "2017-10-03T10:50:12"); EXPECT_DOUBLE_EQ(double(nirArch["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(nirArch["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(nirArch["PredictMaximumExposureTime"]), 1.5952); @@ -739,7 +739,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { EXPECT_EQ(int(nirArch["ImageFrequency"]), 400000); EXPECT_EQ(int(nirArch["NumberOfWindows"]), 6); EXPECT_EQ(int(nirArch["UniqueIdentifier"]), 100799268); - EXPECT_EQ(nirArch["ExposureTimestamp"][0].toStdString(), "2f015435767e275a"); + EXPECT_EQ(nirArch["ExposureTimestamp"][0], "2f015435767e275a"); EXPECT_DOUBLE_EQ(double(nirArch["ExposureTimePEHK"]), 1.440e-003); EXPECT_DOUBLE_EQ(double(nirArch["PixelsPossiblySaturated"]), 0); EXPECT_EQ(int(nirArch["WindowCount"]), 2); @@ -777,10 +777,10 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Bandbin Group PvlGroup &nirBand = nirLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(nirBand["FilterName"][0].toStdString(), "NIR"); + EXPECT_EQ(nirBand["FilterName"][0], "NIR"); EXPECT_DOUBLE_EQ(double(nirBand["Center"]), 985.0); EXPECT_DOUBLE_EQ(double(nirBand["Width"]), 220.0); - EXPECT_EQ(nirBand["NaifIkCode"][0].toStdString(), "-143423"); + EXPECT_EQ(nirBand["NaifIkCode"][0], "-143423"); // Kernels Group PvlGroup &nirKern = nirLabel->findGroup("Kernels", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsThm2isis.cpp b/isis/tests/FunctionalTestsThm2isis.cpp index 7733c6a333..f8dbde7c3f 100644 --- a/isis/tests/FunctionalTestsThm2isis.cpp +++ b/isis/tests/FunctionalTestsThm2isis.cpp @@ -42,22 +42,22 @@ TEST_F(TempTestingFiles, FunctionalTestThm2isisVis) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "MARS_ODYSSEY"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "THEMIS_VIS" ); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MARS" ); - EXPECT_EQ(inst["SpacecraftClockCount"][0].toStdString(), "698642092.025" ); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "6.0" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2002-02-20T03:14:02.471000" ); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2002-02-20T03:14:09.471000" ); - EXPECT_EQ(inst["Framelets"][0].toStdString(), "Even" ); - EXPECT_EQ(inst["InterframeDelay"][0].toStdString(), "1.0" ); + EXPECT_EQ(inst["SpacecraftName"][0], "MARS_ODYSSEY"); + EXPECT_EQ(inst["InstrumentId"][0], "THEMIS_VIS" ); + EXPECT_EQ(inst["TargetName"][0], "MARS" ); + EXPECT_EQ(inst["SpacecraftClockCount"][0], "698642092.025" ); + EXPECT_EQ(inst["ExposureDuration"][0], "6.0" ); + EXPECT_EQ(inst["StartTime"][0], "2002-02-20T03:14:02.471000" ); + EXPECT_EQ(inst["StopTime"][0], "2002-02-20T03:14:09.471000" ); + EXPECT_EQ(inst["Framelets"][0], "Even" ); + EXPECT_EQ(inst["InterframeDelay"][0], "1.0" ); EXPECT_EQ(int(inst["NumFramelets"]), 1); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "ODY-M-THM-3-VISRDR-V1.0" ); - EXPECT_EQ(archive["ProductId"][0].toStdString(), "V00821003RDR" ); - EXPECT_EQ(archive["ProductCreationTime"][0].toStdString(), "2003-07-08T03:07:17" ); + EXPECT_EQ(archive["DataSetId"][0], "ODY-M-THM-3-VISRDR-V1.0" ); + EXPECT_EQ(archive["ProductId"][0], "V00821003RDR" ); + EXPECT_EQ(archive["ProductCreationTime"][0], "2003-07-08T03:07:17" ); EXPECT_EQ(double(archive["ProductVersionId"]), 1.3); // BandBin Group @@ -95,22 +95,22 @@ TEST_F(TempTestingFiles, FunctionalTestThm2isisVis) { // Instrument Group inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "MARS_ODYSSEY"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "THEMIS_VIS" ); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MARS" ); - EXPECT_EQ(inst["SpacecraftClockCount"][0].toStdString(), "698642092.025" ); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "6.0" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2002-02-20T03:14:02.471000" ); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2002-02-20T03:14:09.471000" ); - EXPECT_EQ(inst["Framelets"][0].toStdString(), "Odd" ); - EXPECT_EQ(inst["InterframeDelay"][0].toStdString(), "1.0" ); + EXPECT_EQ(inst["SpacecraftName"][0], "MARS_ODYSSEY"); + EXPECT_EQ(inst["InstrumentId"][0], "THEMIS_VIS" ); + EXPECT_EQ(inst["TargetName"][0], "MARS" ); + EXPECT_EQ(inst["SpacecraftClockCount"][0], "698642092.025" ); + EXPECT_EQ(inst["ExposureDuration"][0], "6.0" ); + EXPECT_EQ(inst["StartTime"][0], "2002-02-20T03:14:02.471000" ); + EXPECT_EQ(inst["StopTime"][0], "2002-02-20T03:14:09.471000" ); + EXPECT_EQ(inst["Framelets"][0], "Odd" ); + EXPECT_EQ(inst["InterframeDelay"][0], "1.0" ); EXPECT_EQ(int(inst["NumFramelets"]), 1); // Archive Group archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "ODY-M-THM-3-VISRDR-V1.0" ); - EXPECT_EQ(archive["ProductId"][0].toStdString(), "V00821003RDR" ); - EXPECT_EQ(archive["ProductCreationTime"][0].toStdString(), "2003-07-08T03:07:17" ); + EXPECT_EQ(archive["DataSetId"][0], "ODY-M-THM-3-VISRDR-V1.0" ); + EXPECT_EQ(archive["ProductId"][0], "V00821003RDR" ); + EXPECT_EQ(archive["ProductCreationTime"][0], "2003-07-08T03:07:17" ); EXPECT_EQ(double(archive["ProductVersionId"]), 1.3); // BandBin Group @@ -165,19 +165,19 @@ TEST_F(TempTestingFiles, FunctionalTestThm2isisIr) { // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "MARS_ODYSSEY"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "THEMIS_IR" ); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "MARS" ); - EXPECT_EQ(inst["SpacecraftClockCount"][0].toStdString(), "698713127.000" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2002-02-20T22:57:57.253000" ); - EXPECT_EQ(inst["StopTime"][0].toStdString(), "2002-02-20T23:00:56.983000" ); + EXPECT_EQ(inst["SpacecraftName"][0], "MARS_ODYSSEY"); + EXPECT_EQ(inst["InstrumentId"][0], "THEMIS_IR" ); + EXPECT_EQ(inst["TargetName"][0], "MARS" ); + EXPECT_EQ(inst["SpacecraftClockCount"][0], "698713127.000" ); + EXPECT_EQ(inst["StartTime"][0], "2002-02-20T22:57:57.253000" ); + EXPECT_EQ(inst["StopTime"][0], "2002-02-20T23:00:56.983000" ); EXPECT_EQ((int)inst["GainNumber"], 16); // Archive Group PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "ODY-M-THM-3-IRRDR-V1.0" ); - EXPECT_EQ(archive["ProductId"][0].toStdString(), "I00831002RDR" ); - EXPECT_EQ(archive["ProductCreationTime"][0].toStdString(), "2003-03-12T12:59:33" ); + EXPECT_EQ(archive["DataSetId"][0], "ODY-M-THM-3-IRRDR-V1.0" ); + EXPECT_EQ(archive["ProductId"][0], "I00831002RDR" ); + EXPECT_EQ(archive["ProductCreationTime"][0], "2003-03-12T12:59:33" ); EXPECT_EQ(double(archive["ProductVersionId"]), 1.4); // BandBin Group @@ -215,8 +215,8 @@ TEST_F(TempTestingFiles, FunctionalTestThm2isisOutAttributes) { Cube evenCube( tempDir.path() + "/test.even.cub"); // Pixels Group - EXPECT_EQ(PixelTypeName(evenCube.pixelType()).toStdString(), "UnsignedByte"); - EXPECT_EQ(ByteOrderName(evenCube.byteOrder()).toStdString(), "Msb"); + EXPECT_EQ(PixelTypeName(evenCube.pixelType()), "UnsignedByte"); + EXPECT_EQ(ByteOrderName(evenCube.byteOrder()), "Msb"); EXPECT_DOUBLE_EQ(evenCube.base(), 0.001199604743083); EXPECT_DOUBLE_EQ(evenCube.multiplier(), 3.95256916996048e-07); diff --git a/isis/tests/ImageImporterTests.cpp b/isis/tests/ImageImporterTests.cpp index 4279c3607c..8fd17e2f36 100644 --- a/isis/tests/ImageImporterTests.cpp +++ b/isis/tests/ImageImporterTests.cpp @@ -30,15 +30,15 @@ TEST_F(TempTestingFiles, DISABLED_UnitTestImageImporterTestJpeg) { ASSERT_EQ((int)dimensions["Bands"], 3); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "Red"); - ASSERT_EQ(bandbin["Name"][1].toStdString(), "Green"); - ASSERT_EQ(bandbin["Name"][2].toStdString(), "Blue"); + ASSERT_EQ(bandbin["Name"][0], "Red"); + ASSERT_EQ(bandbin["Name"][1], "Green"); + ASSERT_EQ(bandbin["Name"][2], "Blue"); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 113.11904761904762, .00001); @@ -65,15 +65,15 @@ TEST_F(TempTestingFiles, UnitTestImageImporterStd2IsisTiffRgb) { ASSERT_EQ((int)dimensions["Bands"], 3); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "Red"); - ASSERT_EQ(bandbin["Name"][1].toStdString(), "Green"); - ASSERT_EQ(bandbin["Name"][2].toStdString(), "Blue"); + ASSERT_EQ(bandbin["Name"][0], "Red"); + ASSERT_EQ(bandbin["Name"][1], "Green"); + ASSERT_EQ(bandbin["Name"][2], "Blue"); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 88.4844970703125, .00001); @@ -100,15 +100,15 @@ TEST_F(TempTestingFiles, UnitTestImageImporterStd2IsisJp2) { ASSERT_EQ((int)dimensions["Bands"], 3); PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); - ASSERT_EQ(pixels["Type"][0].toStdString(), "Real"); - ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(pixels["Type"][0], "Real"); + ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); ASSERT_EQ((double)pixels["Base"], 0.0); ASSERT_EQ((double)pixels["Multiplier"], 1.0); PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(bandbin["Name"][0].toStdString(), "Red"); - ASSERT_EQ(bandbin["Name"][1].toStdString(), "Green"); - ASSERT_EQ(bandbin["Name"][2].toStdString(), "Blue"); + ASSERT_EQ(bandbin["Name"][0], "Red"); + ASSERT_EQ(bandbin["Name"][1], "Green"); + ASSERT_EQ(bandbin["Name"][2], "Blue"); std::unique_ptr hist (outCube.histogram()); diff --git a/isis/tests/PvlToJSONTests.cpp b/isis/tests/PvlToJSONTests.cpp index 171130f60f..8d6e449ef2 100644 --- a/isis/tests/PvlToJSONTests.cpp +++ b/isis/tests/PvlToJSONTests.cpp @@ -20,9 +20,9 @@ TEST(PvlToJSONTest, KeywordConversion) { json testJson1 = pvlKeywordToJSON(testKey1); json testJson2 = pvlKeywordToJSON(testKey2); - EXPECT_EQ(testJson1["Value"], testKey1[0].toStdString()); - EXPECT_EQ(testJson2["Value"][0], testKey2[0].toStdString()); - EXPECT_EQ(testJson2["Value"][1], testKey2[1].toStdString()); + EXPECT_EQ(testJson1["Value"], testKey1[0]); + EXPECT_EQ(testJson2["Value"][0], testKey2[0]); + EXPECT_EQ(testJson2["Value"][1], testKey2[1]); } @@ -38,9 +38,9 @@ TEST(PvlToJSONTest, KeywordCommentConversion) { json testJson2 = pvlKeywordToJSON(testKey2); json testJson3 = pvlKeywordToJSON(testKey3); - EXPECT_EQ(testJson1["Comment"], testKey1.comment(0).toStdString()); - EXPECT_EQ(testJson2["Comment"][0], testKey2.comment(0).toStdString()); - EXPECT_EQ(testJson2["Comment"][1], testKey2.comment(1).toStdString()); + EXPECT_EQ(testJson1["Comment"], testKey1.comment(0)); + EXPECT_EQ(testJson2["Comment"][0], testKey2.comment(0)); + EXPECT_EQ(testJson2["Comment"][1], testKey2.comment(1)); EXPECT_FALSE(testJson3.contains("Comment")); } @@ -58,10 +58,10 @@ TEST(PvlToJSONTest, KeywordUnitConversion) { json testJson2 = pvlKeywordToJSON(testKey2); json testJson3 = pvlKeywordToJSON(testKey3); - EXPECT_EQ(testJson1["Units"], testKey1.unit(0).toStdString()); - EXPECT_EQ(testJson2["Units"][0], testKey2.unit(0).toStdString()); - EXPECT_EQ(testJson2["Units"][1], testKey2.unit(1).toStdString()); - EXPECT_EQ(testJson2["Units"][2], testKey2.unit(2).toStdString()); + EXPECT_EQ(testJson1["Units"], testKey1.unit(0)); + EXPECT_EQ(testJson2["Units"][0], testKey2.unit(0)); + EXPECT_EQ(testJson2["Units"][1], testKey2.unit(1)); + EXPECT_EQ(testJson2["Units"][2], testKey2.unit(2)); EXPECT_FALSE(testJson3.contains("Units")); } @@ -75,8 +75,8 @@ TEST(PvlToJSONTest, GroupConversion) { json testJson = pvlGroupToJSON(testGroup); - EXPECT_TRUE(testJson.contains(testKey1.name().toStdString())); - EXPECT_TRUE(testJson.contains(testKey2.name().toStdString())); + EXPECT_TRUE(testJson.contains(testKey1.name())); + EXPECT_TRUE(testJson.contains(testKey2.name())); } @@ -89,10 +89,10 @@ TEST(PvlToJSONTest, GroupRepeatedKeysConversion) { json testJson = pvlGroupToJSON(testGroup); - EXPECT_TRUE(testJson.contains(testKey2.name().toStdString())); - EXPECT_EQ(testJson[testKey1.name().toStdString()].size(), 2); - EXPECT_EQ(testJson[testKey1.name().toStdString()][0]["Value"], testKey1[0].toStdString()); - EXPECT_EQ(testJson[testKey2.name().toStdString()][1]["Value"], testKey2[0].toStdString()); + EXPECT_TRUE(testJson.contains(testKey2.name())); + EXPECT_EQ(testJson[testKey1.name()].size(), 2); + EXPECT_EQ(testJson[testKey1.name()][0]["Value"], testKey1[0]); + EXPECT_EQ(testJson[testKey2.name()][1]["Value"], testKey2[0]); } @@ -108,9 +108,9 @@ TEST(PvlToJSONTest, GroupCommentConversion) { json testJson2 = pvlGroupToJSON(testGroup2); json testJson3 = pvlGroupToJSON(testGroup3); - EXPECT_EQ(testJson1["Comment"], testGroup1.comment(0).toStdString()); - EXPECT_EQ(testJson2["Comment"][0], testGroup2.comment(0).toStdString()); - EXPECT_EQ(testJson2["Comment"][1], testGroup2.comment(1).toStdString()); + EXPECT_EQ(testJson1["Comment"], testGroup1.comment(0)); + EXPECT_EQ(testJson2["Comment"][0], testGroup2.comment(0)); + EXPECT_EQ(testJson2["Comment"][1], testGroup2.comment(1)); EXPECT_FALSE(testJson3.contains("Comment")); } @@ -128,8 +128,8 @@ TEST(PvlToJSONTest, ObjectConversion) { json testJson = pvlObjectToJSON(testObject); - EXPECT_TRUE(testJson.contains(testGroup.name().toStdString())); - EXPECT_TRUE(testJson.contains(testKey3.name().toStdString())); + EXPECT_TRUE(testJson.contains(testGroup.name())); + EXPECT_TRUE(testJson.contains(testKey3.name())); } @@ -146,10 +146,10 @@ TEST(PvlToJSONTest, ObjectNestedConversion) { json testJson = pvlObjectToJSON(testObject2); - EXPECT_TRUE(testJson.contains(testKey3.name().toStdString())); - EXPECT_TRUE(testJson.contains(testObject1.name().toStdString())); - EXPECT_TRUE(testJson[testObject1.name().toStdString()].contains(testKey1.name().toStdString())); - EXPECT_TRUE(testJson[testObject1.name().toStdString()].contains(testKey2.name().toStdString())); + EXPECT_TRUE(testJson.contains(testKey3.name())); + EXPECT_TRUE(testJson.contains(testObject1.name())); + EXPECT_TRUE(testJson[testObject1.name()].contains(testKey1.name())); + EXPECT_TRUE(testJson[testObject1.name()].contains(testKey2.name())); } @@ -165,11 +165,11 @@ TEST(PvlToJSONTest, ObjectRepeatedConversion) { json testJson = pvlObjectToJSON(testObject); - EXPECT_TRUE(testJson.contains(testKey1.name().toStdString())); - EXPECT_TRUE(testJson.contains(testKey2.name().toStdString())); - EXPECT_EQ(testJson[testKey1.name().toStdString()].size(), 2); - EXPECT_TRUE(testJson[testKey1.name().toStdString()][0].contains("Value")); - EXPECT_TRUE(testJson[testKey1.name().toStdString()][1].contains(testKey2.name().toStdString())); + EXPECT_TRUE(testJson.contains(testKey1.name())); + EXPECT_TRUE(testJson.contains(testKey2.name())); + EXPECT_EQ(testJson[testKey1.name()].size(), 2); + EXPECT_TRUE(testJson[testKey1.name()][0].contains("Value")); + EXPECT_TRUE(testJson[testKey1.name()][1].contains(testKey2.name())); } @@ -185,9 +185,9 @@ TEST(PvlToJSONTest, ObjectCommentConversion) { json testJson2 = pvlObjectToJSON(testObject2); json testJson3 = pvlObjectToJSON(testObject3); - EXPECT_EQ(testJson1["Comment"], testObject1.comment(0).toStdString()); - EXPECT_EQ(testJson2["Comment"][0], testObject2.comment(0).toStdString()); - EXPECT_EQ(testJson2["Comment"][1], testObject2.comment(1).toStdString()); + EXPECT_EQ(testJson1["Comment"], testObject1.comment(0)); + EXPECT_EQ(testJson2["Comment"][0], testObject2.comment(0)); + EXPECT_EQ(testJson2["Comment"][1], testObject2.comment(1)); EXPECT_FALSE(testJson3.contains("Comment")); } @@ -209,7 +209,7 @@ TEST(PvlToJSONTest, PvlConversion) { json testJson = pvlToJSON(testPvl); - EXPECT_TRUE(testJson.contains(testGroup.name().toStdString())); - EXPECT_TRUE(testJson.contains(testObject.name().toStdString())); - EXPECT_TRUE(testJson.contains(testKey4.name().toStdString())); + EXPECT_TRUE(testJson.contains(testGroup.name())); + EXPECT_TRUE(testJson.contains(testObject.name())); + EXPECT_TRUE(testJson.contains(testKey4.name())); } diff --git a/isis/tests/TestUtilities.cpp b/isis/tests/TestUtilities.cpp index 65149f73bf..b548c3e729 100644 --- a/isis/tests/TestUtilities.cpp +++ b/isis/tests/TestUtilities.cpp @@ -58,6 +58,25 @@ namespace Isis { } + /** + * Custom std::string assertion that properly outputs them as string if they + * are different. + */ + ::testing::AssertionResult AssertStringsEqual( + const char* string1_expr, + const char* string2_expr, + std::string string1, + std::string string2) { + if (string1 != string2) { + return ::testing::AssertionFailure() << "std::strings " << string1_expr + << " (" << string1 << ") and " << string2_expr + << " (" << string2 << ") are not the same."; + } + + return ::testing::AssertionSuccess(); + } + + /** * Custom PvlGroup assertion that compares the group names and * all of the PvlKeywords in the groups. @@ -69,33 +88,33 @@ namespace Isis { PvlGroup group2) { if (group1.name() != group2.name()) { return ::testing::AssertionFailure() << "PvlGroup " << group1_expr - << " has name (" << group1.name().toStdString() << ") and PvlGroup " - << group2_expr << " has name (" << group2.name().toStdString() << ")."; + << " has name (" << group1.name() << ") and PvlGroup " + << group2_expr << " has name (" << group2.name() << ")."; } for (auto grp1KeyIt = group1.begin(); grp1KeyIt != group1.end(); grp1KeyIt++) { if (!group2.hasKeyword(grp1KeyIt->name())) { return ::testing::AssertionFailure() << "PvlGroup " << group1_expr - << " contains keyword " << grp1KeyIt->name().toStdString() + << " contains keyword " << grp1KeyIt->name() << " that is not in PvlGroup " << group2_expr; } const PvlKeyword &group2Key = group2.findKeyword(grp1KeyIt->name()); if (grp1KeyIt->size() != group2Key.size()) { - return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name().toStdString() + return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name() << ") has size (" << grp1KeyIt->size() << ") in PvlGroup " << group1_expr << " and size (" << group2Key.size() << ") in PvlGroup " << group2_expr; } for (int i = 0; i < grp1KeyIt->size(); i++) { if (!grp1KeyIt->isEquivalent(group2Key[i], i)) { - return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name().toStdString() - << ") has value (" << (*grp1KeyIt)[i].toStdString() << ") in PvlGroup " - << group1_expr << " and value (" << group2Key[i].toStdString() + return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name() + << ") has value (" << (*grp1KeyIt)[i] << ") in PvlGroup " + << group1_expr << " and value (" << group2Key[i] << ") in PvlGroup " << group2_expr << " at index " << i; } if (grp1KeyIt->unit(i) != group2Key.unit(i)) { - return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name().toStdString() - << ") has units (" << grp1KeyIt->unit(i).toStdString() << ") in PvlGroup " - << group1_expr << " and units (" << group2Key.unit(i).toStdString() + return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name() + << ") has units (" << grp1KeyIt->unit(i) << ") in PvlGroup " + << group1_expr << " and units (" << group2Key.unit(i) << ") in PvlGroup " << group2_expr << " at index " << i; } } @@ -105,7 +124,7 @@ namespace Isis { for (auto grp2KeyIt = group2.begin(); grp2KeyIt != group2.end(); grp2KeyIt++) { if (!group1.hasKeyword(grp2KeyIt->name())) { return ::testing::AssertionFailure() << "PvlGroup " << group2_expr - << " contains keyword " << grp2KeyIt->name().toStdString() + << " contains keyword " << grp2KeyIt->name() << " that is not in PvlGroup " << group1_expr; } } @@ -125,26 +144,26 @@ namespace Isis { for (auto grp1KeyIt = group1.begin(); grp1KeyIt != group1.end(); grp1KeyIt++) { if (!group2.hasKeyword(grp1KeyIt->name())) { return ::testing::AssertionFailure() << "PvlGroup " << group1_expr - << " contains keyword " << grp1KeyIt->name().toStdString() + << " contains keyword " << grp1KeyIt->name() << " that is not in PvlGroup " << group2_expr; } const PvlKeyword &group2Key = group2.findKeyword(grp1KeyIt->name()); if (grp1KeyIt->size() != group2Key.size()) { - return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name().toStdString() + return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name() << ") has size (" << grp1KeyIt->size() << ") in PvlGroup " << group1_expr << " and size (" << group2Key.size() << ") in PvlGroup " << group2_expr; } for (int i = 0; i < grp1KeyIt->size(); i++) { if (!grp1KeyIt->isEquivalent(group2Key[i], i)) { - return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name().toStdString() - << ") has value (" << (*grp1KeyIt)[i].toStdString() << ") in PvlGroup " - << group1_expr << " and value (" << group2Key[i].toStdString() + return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name() + << ") has value (" << (*grp1KeyIt)[i] << ") in PvlGroup " + << group1_expr << " and value (" << group2Key[i] << ") in PvlGroup " << group2_expr << " at index " << i; } if (grp1KeyIt->unit(i) != group2Key.unit(i)) { - return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name().toStdString() - << ") has units (" << grp1KeyIt->unit(i).toStdString() << ") in PvlGroup " - << group1_expr << " and units (" << group2Key.unit(i).toStdString() + return ::testing::AssertionFailure() << "Keyword (" << grp1KeyIt->name() + << ") has units (" << grp1KeyIt->unit(i) << ") in PvlGroup " + << group1_expr << " and units (" << group2Key.unit(i) << ") in PvlGroup " << group2_expr << " at index " << i; } } @@ -154,7 +173,7 @@ namespace Isis { for (auto grp2KeyIt = group2.begin(); grp2KeyIt != group2.end(); grp2KeyIt++) { if (!group1.hasKeyword(grp2KeyIt->name())) { return ::testing::AssertionFailure() << "PvlGroup " << group2_expr - << " contains keyword " << grp2KeyIt->name().toStdString() + << " contains keyword " << grp2KeyIt->name() << " that is not in PvlGroup " << group1_expr; } } diff --git a/isis/tests/TestUtilities.h b/isis/tests/TestUtilities.h index c150b80bf5..49ac398f4c 100644 --- a/isis/tests/TestUtilities.h +++ b/isis/tests/TestUtilities.h @@ -41,6 +41,12 @@ namespace Isis { QString string1, QString string2); + ::testing::AssertionResult AssertStringsEqual( + const char* string1_expr, + const char* string2_expr, + std::string string1, + std::string string2); + ::testing::AssertionResult AssertPvlGroupEqual( const char* group1_expr, const char* group2_expr, diff --git a/isis/tests/TgoCassisModuleTests.cpp b/isis/tests/TgoCassisModuleTests.cpp index d26fe37c34..4c10c89f3d 100644 --- a/isis/tests/TgoCassisModuleTests.cpp +++ b/isis/tests/TgoCassisModuleTests.cpp @@ -728,20 +728,20 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { // Instrument Group PvlGroup &inst = panLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:58:02.583"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f0154373db1aa13"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.920e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:58:02.583"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f0154373db1aa13"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.920e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "PAN"); + EXPECT_EQ(inst["Filter"][0], "PAN"); // Archive Group PvlGroup &archive = panLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(archive["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(archive["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:26"); + EXPECT_EQ(archive["DataSetId"][0], "TBD"); + EXPECT_EQ(archive["ProductVersionId"][0], "UNK"); + EXPECT_EQ(archive["ProductCreationTime"][0], "2017-10-03T10:50:26"); EXPECT_DOUBLE_EQ(double(archive["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(archive["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(archive["PredictMaximumExposureTime"]), 3.4317); @@ -758,7 +758,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_EQ(int(archive["ImageFrequency"]), 1200000); EXPECT_EQ(int(archive["NumberOfWindows"]), 6); EXPECT_EQ(int(archive["UniqueIdentifier"]), 100799468); - EXPECT_EQ(archive["ExposureTimestamp"][0].toStdString(), "2f0154373db1aa13"); + EXPECT_EQ(archive["ExposureTimestamp"][0], "2f0154373db1aa13"); EXPECT_DOUBLE_EQ(double(archive["ExposureTimePEHK"]), 0.00192); EXPECT_DOUBLE_EQ(double(archive["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(archive["WindowCount"]), 0); @@ -793,14 +793,14 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_EQ(int(archive["Window6StartLine"]), 1850); EXPECT_EQ(int(archive["Window6EndLine"]), 1858); EXPECT_EQ(int(archive["YearDoy"]), 2016331); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_251_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_251_0"); // BandBin Group PvlGroup &bandbin = panLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "PAN"); + EXPECT_EQ(bandbin["FilterName"][0], "PAN"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 678.2); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 231.9); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143421"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143421"); // Kernels Group PvlGroup &kernels = panLabel->findGroup("Kernels", Pvl::Traverse); @@ -819,20 +819,20 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { // Instrument Group inst = nirLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:58:02.583"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f0154373db1aa13"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.920e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:58:02.583"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f0154373db1aa13"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.920e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "NIR"); + EXPECT_EQ(inst["Filter"][0], "NIR"); // Archive Group archive = nirLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(archive["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(archive["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:26"); + EXPECT_EQ(archive["DataSetId"][0], "TBD"); + EXPECT_EQ(archive["ProductVersionId"][0], "UNK"); + EXPECT_EQ(archive["ProductCreationTime"][0], "2017-10-03T10:50:26"); EXPECT_DOUBLE_EQ(double(archive["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(archive["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(archive["PredictMaximumExposureTime"]), 3.4317); @@ -849,7 +849,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_EQ(int(archive["ImageFrequency"]), 1200000); EXPECT_EQ(int(archive["NumberOfWindows"]), 6); EXPECT_EQ(int(archive["UniqueIdentifier"]), 100799468); - EXPECT_EQ(archive["ExposureTimestamp"][0].toStdString(), "2f0154373db1aa13"); + EXPECT_EQ(archive["ExposureTimestamp"][0], "2f0154373db1aa13"); EXPECT_DOUBLE_EQ(double(archive["ExposureTimePEHK"]), 0.00192); EXPECT_DOUBLE_EQ(double(archive["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(archive["WindowCount"]), 2); @@ -884,14 +884,14 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_EQ(int(archive["Window6StartLine"]), 1850); EXPECT_EQ(int(archive["Window6EndLine"]), 1858); EXPECT_EQ(int(archive["YearDoy"]), 2016331); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_251_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_251_0"); // BandBin Group bandbin = nirLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "NIR"); + EXPECT_EQ(bandbin["FilterName"][0], "NIR"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 939.3); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 121.8); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143423"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143423"); // Kernels Group kernels = nirLabel->findGroup("Kernels", Pvl::Traverse); @@ -910,20 +910,20 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { // Instrument Group inst = redLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:58:02.583"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f0154373db1aa13"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.920e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:58:02.583"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f0154373db1aa13"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.920e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "RED"); + EXPECT_EQ(inst["Filter"][0], "RED"); // Archive Group archive = redLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(archive["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(archive["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:26"); + EXPECT_EQ(archive["DataSetId"][0], "TBD"); + EXPECT_EQ(archive["ProductVersionId"][0], "UNK"); + EXPECT_EQ(archive["ProductCreationTime"][0], "2017-10-03T10:50:26"); EXPECT_DOUBLE_EQ(double(archive["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(archive["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(archive["PredictMaximumExposureTime"]), 3.4317); @@ -940,7 +940,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_EQ(int(archive["ImageFrequency"]), 1200000); EXPECT_EQ(int(archive["NumberOfWindows"]), 6); EXPECT_EQ(int(archive["UniqueIdentifier"]), 100799468); - EXPECT_EQ(archive["ExposureTimestamp"][0].toStdString(), "2f0154373db1aa13"); + EXPECT_EQ(archive["ExposureTimestamp"][0], "2f0154373db1aa13"); EXPECT_DOUBLE_EQ(double(archive["ExposureTimePEHK"]), 0.00192); EXPECT_DOUBLE_EQ(double(archive["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(archive["WindowCount"]), 1); @@ -975,14 +975,14 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_EQ(int(archive["Window6StartLine"]), 1850); EXPECT_EQ(int(archive["Window6EndLine"]), 1858); EXPECT_EQ(int(archive["YearDoy"]), 2016331); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_251_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_251_0"); // BandBin Group bandbin = redLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "RED"); + EXPECT_EQ(bandbin["FilterName"][0], "RED"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 836); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 98.5); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143422"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143422"); // Kernels Group kernels = redLabel->findGroup("Kernels", Pvl::Traverse); @@ -1002,20 +1002,20 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { // Instrument Group inst = bluLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:58:02.583"); - EXPECT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2f0154373db1aa13"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.920e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:58:02.583"); + EXPECT_EQ(inst["SpacecraftClockStartCount"][0], "2f0154373db1aa13"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.920e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "BLU"); + EXPECT_EQ(inst["Filter"][0], "BLU"); // Archive Group archive = bluLabel->findGroup("Archive", Pvl::Traverse); - EXPECT_EQ(archive["DataSetId"][0].toStdString(), "TBD"); - EXPECT_EQ(archive["ProductVersionId"][0].toStdString(), "UNK"); - EXPECT_EQ(archive["ProductCreationTime"][0].toStdString(), "2017-10-03T10:50:26"); + EXPECT_EQ(archive["DataSetId"][0], "TBD"); + EXPECT_EQ(archive["ProductVersionId"][0], "UNK"); + EXPECT_EQ(archive["ProductCreationTime"][0], "2017-10-03T10:50:26"); EXPECT_DOUBLE_EQ(double(archive["ScalingFactor"]), 1.0); EXPECT_DOUBLE_EQ(double(archive["Offset"]), 0.0); EXPECT_DOUBLE_EQ(double(archive["PredictMaximumExposureTime"]), 3.4317); @@ -1032,7 +1032,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_EQ(int(archive["ImageFrequency"]), 1200000); EXPECT_EQ(int(archive["NumberOfWindows"]), 6); EXPECT_EQ(int(archive["UniqueIdentifier"]), 100799468); - EXPECT_EQ(archive["ExposureTimestamp"][0].toStdString(), "2f0154373db1aa13"); + EXPECT_EQ(archive["ExposureTimestamp"][0], "2f0154373db1aa13"); EXPECT_DOUBLE_EQ(double(archive["ExposureTimePEHK"]), 0.00192); EXPECT_DOUBLE_EQ(double(archive["PixelsPossiblySaturated"]), 0.00); EXPECT_EQ(int(archive["WindowCount"]), 3); @@ -1067,14 +1067,14 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_EQ(int(archive["Window6StartLine"]), 1850); EXPECT_EQ(int(archive["Window6EndLine"]), 1858); EXPECT_EQ(int(archive["YearDoy"]), 2016331); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_251_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_251_0"); // BandBin Group bandbin = bluLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "BLU"); + EXPECT_EQ(bandbin["FilterName"][0], "BLU"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 494.8); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 133.6); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143424"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143424"); // Kernels Group kernels = bluLabel->findGroup("Kernels", Pvl::Traverse); @@ -1134,27 +1134,27 @@ TEST(TgoCassisModuleTests, TgoCassisIngestReingest) { // Instrument Group PvlGroup &inst = redLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_EQ(inst["SpacecraftName"][0].toStdString(), "TRACE GAS ORBITER"); - EXPECT_EQ(inst["InstrumentId"][0].toStdString(), "CaSSIS"); - EXPECT_EQ(inst["TargetName"][0].toStdString(), "Mars" ); - EXPECT_EQ(inst["StartTime"][0].toStdString(), "2016-11-26T22:58:02.583"); - EXPECT_EQ(inst["ExposureDuration"][0].toStdString(), "1.920e-003"); + EXPECT_EQ(inst["SpacecraftName"][0], "TRACE GAS ORBITER"); + EXPECT_EQ(inst["InstrumentId"][0], "CaSSIS"); + EXPECT_EQ(inst["TargetName"][0], "Mars" ); + EXPECT_EQ(inst["StartTime"][0], "2016-11-26T22:58:02.583"); + EXPECT_EQ(inst["ExposureDuration"][0], "1.920e-003"); EXPECT_EQ(int(inst["SummingMode"]), 0); - EXPECT_EQ(inst["Filter"][0].toStdString(), "RED"); + EXPECT_EQ(inst["Filter"][0], "RED"); // Archive Group PvlGroup &archive = redLabel->findGroup("Archive", Pvl::Traverse); EXPECT_DOUBLE_EQ(double(archive["ProductVersionId"]), 1.0); EXPECT_DOUBLE_EQ(double(archive["ScalingFactor"]), 1.0); EXPECT_EQ(int(archive["YearDoy"]), 2016331); - EXPECT_EQ(archive["ObservationId"][0].toStdString(), "CRUS_049218_251_0"); + EXPECT_EQ(archive["ObservationId"][0], "CRUS_049218_251_0"); // BandBin Group PvlGroup &bandbin = redLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_EQ(bandbin["FilterName"][0].toStdString(), "RED"); + EXPECT_EQ(bandbin["FilterName"][0], "RED"); EXPECT_DOUBLE_EQ(double(bandbin["Center"]), 836); EXPECT_DOUBLE_EQ(double(bandbin["Width"]), 98.5); - EXPECT_EQ(bandbin["NaifIkCode"][0].toStdString(), "-143422"); + EXPECT_EQ(bandbin["NaifIkCode"][0], "-143422"); // Kernels Group PvlGroup &kernels = redLabel->findGroup("Kernels", Pvl::Traverse); diff --git a/isis/tests/statsTests.cpp b/isis/tests/statsTests.cpp index c5376b149b..ebf230a911 100644 --- a/isis/tests/statsTests.cpp +++ b/isis/tests/statsTests.cpp @@ -101,7 +101,7 @@ TEST_F(stats_MockHist, TestStats) { ASSERT_EQ(statsPvl.groups(), 2); PvlGroup band1Stats = statsPvl.group(0); - EXPECT_EQ("TestCube.cub", (QString) (band1Stats.findKeyword("From"))); + EXPECT_EQ("TestCube.cub", (std::string)(band1Stats.findKeyword("From"))); EXPECT_EQ(1, (int) (band1Stats.findKeyword("Band"))); EXPECT_EQ(22, (int) (band1Stats.findKeyword("ValidPixels"))); EXPECT_EQ(22, (int) (band1Stats.findKeyword("TotalPixels"))); @@ -123,7 +123,7 @@ TEST_F(stats_MockHist, TestStats) { EXPECT_EQ(0.0, (double) (band1Stats.findKeyword("Sum"))); PvlGroup band2Stats = statsPvl.group(1); - EXPECT_EQ("TestCube.cub", (QString) (band2Stats.findKeyword("From"))); + EXPECT_EQ("TestCube.cub", (std::string)(band2Stats.findKeyword("From"))); EXPECT_EQ(2, (int) (band2Stats.findKeyword("Band"))); EXPECT_EQ(0, (int) (band2Stats.findKeyword("ValidPixels"))); EXPECT_EQ(5, (int) (band2Stats.findKeyword("TotalPixels"))); @@ -134,15 +134,15 @@ TEST_F(stats_MockHist, TestStats) { EXPECT_EQ(1, (int) (band2Stats.findKeyword("LrsPixels"))); EXPECT_EQ(1, (int) (band2Stats.findKeyword("HisPixels"))); EXPECT_EQ(1, (int) (band2Stats.findKeyword("HrsPixels"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("Average"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("StandardDeviation"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("Variance"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("Median"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("Mode"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("Skew"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("Minimum"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("Maximum"))); - EXPECT_TRUE("N/A" == (band2Stats.findKeyword("Sum"))); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("Average")); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("StandardDeviation")); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("Variance")); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("Median")); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("Mode")); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("Skew")); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("Minimum")); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("Maximum")); + EXPECT_EQ("N/A", (std::string)band2Stats.findKeyword("Sum")); } TEST(stats, ValidMinimum) { From 4a38f6f120accc0c4788b3de5772e1a6d7ef1e82 Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Wed, 28 Aug 2024 11:37:59 -0700 Subject: [PATCH 57/95] Removed qt from FileName.cpp --- isis/src/core/CMakeLists.txt | 2 +- isis/src/core/include/Blob.h | 4 +- isis/src/core/include/FileName.h | 90 ++- isis/src/core/include/IException.h | 2 +- isis/src/core/include/Message.h | 24 +- isis/src/core/src/Blob.cpp | 28 +- isis/src/core/src/FileCreate.cpp | 2 +- isis/src/core/src/FileName.cpp | 604 ++++++++++-------- isis/src/core/src/FileOpen.cpp | 2 +- isis/src/core/src/FileRead.cpp | 2 +- isis/src/core/src/FileWrite.cpp | 2 +- isis/src/core/src/Preference.cpp | 2 +- isis/src/core/src/Pvl.cpp | 36 +- isis/src/core/src/PvlContainer.cpp | 6 +- isis/src/core/src/PvlFormatPds.cpp | 2 - isis/src/core/src/PvlObject.cpp | 4 +- isis/src/core/src/Table.cpp | 2 +- .../tests/unitTests/FileName/unitTest.cpp | 180 ++++-- 18 files changed, 559 insertions(+), 435 deletions(-) diff --git a/isis/src/core/CMakeLists.txt b/isis/src/core/CMakeLists.txt index 2af0d26e24..2aedcc37eb 100644 --- a/isis/src/core/CMakeLists.txt +++ b/isis/src/core/CMakeLists.txt @@ -12,7 +12,7 @@ set(PACKAGE "CORE") set(PACKAGE_NAME "USGS ISIS PVL CORE") # specify the C++ standard -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(Pvl_source_files ${PROJECT_SOURCE_DIR}/src/ArraySubscriptNotInRange.cpp diff --git a/isis/src/core/include/Blob.h b/isis/src/core/include/Blob.h index e87a79c665..6ac2830f76 100644 --- a/isis/src/core/include/Blob.h +++ b/isis/src/core/include/Blob.h @@ -66,9 +66,9 @@ namespace Isis { int Size() const; PvlObject &Label(); - void Read(const QString &file, const std::vector + void Read(const std::string &file, const std::vector keywords=std::vector()); - void Read(const QString &file, const Pvl &pvlLabels, + void Read(const std::string &file, const Pvl &pvlLabels, const std::vector keywords = std::vector()); virtual void Read(const Pvl &pvl, std::istream &is, const std::vector keywords = std::vector()); diff --git a/isis/src/core/include/FileName.h b/isis/src/core/include/FileName.h index 87380309bd..30dfd8937b 100644 --- a/isis/src/core/include/FileName.h +++ b/isis/src/core/include/FileName.h @@ -7,11 +7,8 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ -#include - -class QDate; -class QDir; -class QString; +#include +#include namespace Isis { /** @@ -99,8 +96,8 @@ namespace Isis { public: // Constructors FileName(); - FileName(const char *fileName); - FileName(const QString &fileName); + FileName(const char *file); + FileName(const std::string &file); // Copy Constructor, creates a copy of a FileName object. FileName(const FileName &other); @@ -109,46 +106,44 @@ namespace Isis { ~FileName(); // Methods - QString originalPath() const; - QString path() const; - QString attributes() const; - QString baseName() const; - QString name() const; - QString extension() const; - + std::string originalPath() const; + std::string path() const; + std::string attributes() const; + std::string baseName() const; + std::string name() const; + std::string extension() const; /** - * Returns a QString of the full file name including the file path, excluding the attributes. + * Returns a std::string of the full file name including the file path, excluding the attributes. * Any Isis Preferences or environment variables indicated by $, are changed to what they * represent. * - * @returns QString + * @returns std::string *
        *   for a full file specification of:
-       *    QString(ISISROOT) + "/tmp/Peaks.cub+Bsq"
+       *    std::string(ISISROOT) + "/tmp/Peaks.cub+Bsq"
        *   expanded() gives:
        *    "/usgs/pkgs/isis3/isis/tmp/Peaks.cub"
        * 
*/ - QString expanded() const; - + std::string expanded() const; /** * Returns the full file name including the file path * - * @returns QString containing every character in the file name and the path + * @returns std::string containing every character in the file name and the path *
        *   for a full file specification of:
-       *    QString(ISISROOT) + "/tmp/Peaks.cub+Bsq"
+       *    std::string(ISISROOT) + "/tmp/Peaks.cub+Bsq"
        *   original() gives:
-       *    QString(ISISROOT) + "/tmp/Peaks.cub+Bsq"
+       *    std::string(ISISROOT) + "/tmp/Peaks.cub+Bsq"
        * 
*/ - QString original() const; + std::string original() const; - FileName addExtension(const QString &extension) const; + FileName addExtension(const std::string &extension) const; FileName removeExtension() const; - FileName setExtension(const QString &extension) const; + FileName setExtension(const std::string &extension) const; bool isVersioned() const; bool isNumericallyVersioned() const; @@ -158,38 +153,37 @@ namespace Isis { FileName newVersion() const; bool fileExists() const; - QDir dir() const; + std::filesystem::path dir() const; static FileName createTempFile(FileName templateFileName = "$TEMPORARY/temp"); - /** - * Returns a QString of the full file name including the file path, excluding the attributes + * Returns a std::string of the full file name including the file path, excluding the attributes * with any Isis Preferences or environment variables indicated by $, changed to what they * represent. * - * @returns QString + * @returns std::string *
        *   for a full file specification of:
-       *    QString(ISISROOT) + "/tmp/Peaks.cub+Bsq"
+       *    std::string(ISISROOT) + "/tmp/Peaks.cub+Bsq"
        *   toString() gives:
        *    "/usgs/pkgs/isis3/isis/tmp/Peaks.cub"
        * 
*/ - QString toString() const; + std::string toString() const; FileName &operator=(const FileName &rhs); bool operator==(const FileName &rhs); bool operator!=(const FileName &rhs); - private: FileName version(long versionNumber) const; - FileName version(QDate versionDate) const; - QDate highestVersionDate() const; + FileName version(const std::tm &versionDate) const; + std::tm highestVersionDate() const; long highestVersionNum() const; void validateVersioningState() const; - QString fileNameQDatePattern() const; - std::pair splitNameAroundVersionNum() const; - + std::string fileNameDatePattern() const; + std::pair splitNameAroundVersionNum() const; + bool isValidDate(std::tm &tm) const; + std::vector getFilesMatchingFilters(std::filesystem::path &directory, std::string &pattern) const; private: /** * This is the reference-counted data for FileName @@ -198,34 +192,32 @@ namespace Isis { * * @internal */ - class Data : public QSharedData { + class FileData { public: // Constructors - Data(); + FileData(); // Copy Constructor, creates a copy of a Data object. - Data(const Data &other); + FileData(const FileData &other); // Destroys the Data Object - ~Data(); + ~FileData(); // Methods - QString original(bool includeAttributes) const; - void setOriginal(const QString &originalStr); - QString expanded(bool includeAttributes) const; + std::string original(bool includeAttributes) const; + void setOriginal(const std::string &originalStr); + std::string expanded(bool includeAttributes) const; private: // Holds the original file name. - QString *m_originalFileNameString; + std::string *m_originalFileNameString; // Holds the expanded file name. - QString *m_expandedFileNameString; + std::string *m_expandedFileNameString; }; - - // @see QSharedDataPointer - QSharedDataPointer m_d; + std::shared_ptr m_d; }; }; diff --git a/isis/src/core/include/IException.h b/isis/src/core/include/IException.h index 17c0c84fac..91b1fcfd36 100644 --- a/isis/src/core/include/IException.h +++ b/isis/src/core/include/IException.h @@ -21,7 +21,7 @@ class QString; * Macro for the filename and line number. This is typically used for the last * arguments to constructing an IException. */ -#define _FILEINFO_ Isis::FileName(__FILE__).name().toStdString().c_str(),__LINE__ +#define _FILEINFO_ Isis::FileName(__FILE__).name().c_str(),__LINE__ namespace Isis { class Pvl; diff --git a/isis/src/core/include/Message.h b/isis/src/core/include/Message.h index 788897b5d0..25a7146bf6 100644 --- a/isis/src/core/include/Message.h +++ b/isis/src/core/include/Message.h @@ -5,8 +5,6 @@ The authors of ISIS do not claim copyright on the contents of this file. For more details about the LICENSE terms and the AUTHORS, you will find files of those names at the top level of this repository. **/ - -#include #include namespace Isis { @@ -158,7 +156,7 @@ namespace Isis { * @param key - The keyword name which has a bad value * @param value - The value of the keyword * @param range - The minimum and maximum allowed values for the keyword - * formatted and inserted into a QString + * formatted and inserted into a std::string * * @return std::string - A standardized Isis error message with the parameter * inserted @@ -185,7 +183,7 @@ namespace Isis { * * @param delimiter - The delimiter that is missing * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ std::string MissingDelimiter(const char delimiter); @@ -196,7 +194,7 @@ namespace Isis { * @param delimiter - The delimiter that is missing * @param near - The value the missing delimiter is near * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ std::string MissingDelimiter(const char delimiter, const std::string near); @@ -206,40 +204,40 @@ namespace Isis { * * @param filename - The name of the file * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString FileOpen(const QString &filename); + std::string FileOpen(const std::string &filename); /** * This error should be used when a file could not be created. * * @param filename - The name of the file * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString FileCreate(const QString &filename); + std::string FileCreate(const std::string &filename); /** * This error should be used when an error accrues during a read of a file. * * @param filename - The name of the file * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString FileRead(const QString &filename); + std::string FileRead(const std::string &filename); /** * This error should be used when an error accrues during a write to a file. * * @param filename - The name of the file * - * @return QString - A standardized Isis error message with the parameter + * @return std::string - A standardized Isis error message with the parameter * inserted */ - QString FileWrite(const QString &filename); + std::string FileWrite(const std::string &filename); /** * This error should be used when an error accrues during a memory diff --git a/isis/src/core/src/Blob.cpp b/isis/src/core/src/Blob.cpp index f184e43d54..fc1908bb0e 100644 --- a/isis/src/core/src/Blob.cpp +++ b/isis/src/core/src/Blob.cpp @@ -10,8 +10,6 @@ find files of those names at the top level of this repository. **/ #include #include -#include - #include "FileName.h" #include "IException.h" #include "Message.h" @@ -52,9 +50,9 @@ namespace Isis { p_buffer = NULL; p_nbytes = 0; p_type = type; - p_labelFile = FileName(file).expanded(); + p_labelFile = QString::fromStdString(FileName(file.toStdString()).expanded()); - Read(file); + Read(file.toStdString()); } /** @@ -230,11 +228,11 @@ namespace Isis { p_nbytes = p_blobPvl["Bytes"]; p_detached = ""; if (p_blobPvl.hasKeyword("^" + p_type)) { - QString path = ""; + std::string path = ""; if (p_labelFile != "") { - path = FileName(p_labelFile).path() + "/"; + path = FileName(p_labelFile.toStdString()).path() + "/"; } - p_detached = path + QString::fromStdString((std::string) p_blobPvl["^"+p_type]); + p_detached = QString::fromStdString(path + (std::string)p_blobPvl["^"+p_type]); p_blobPvl.deleteKeyword("^" + p_type); } } @@ -252,9 +250,9 @@ namespace Isis { * @throws iException::Io - Unable to open file * @throws iException::Pvl - Invalid label format */ - void Blob::Read(const QString &file, const std::vector keywords) { + void Blob::Read(const std::string &file, const std::vector keywords) { // Expand the filename - std::string temp(FileName(file).expanded().toStdString()); + std::string temp(FileName(file).expanded()); // Get the pvl Pvl pvl; @@ -276,15 +274,15 @@ namespace Isis { * * @throws iException::Io - Unable to open file */ - void Blob::Read(const QString &file, const Pvl &pvlLabels, const std::vector keywords) { + void Blob::Read(const std::string &file, const Pvl &pvlLabels, const std::vector keywords) { // Expand the filename - QString temp(FileName(file).expanded()); + std::string temp(FileName(file).expanded()); // Open the file fstream istm; - istm.open(temp.toLatin1().data(), std::ios::in); + istm.open(temp.c_str(), std::ios::in); if (!istm) { - QString message = Message::FileOpen(temp); + std::string message = Message::FileOpen(temp); throw IException(IException::Io, message, _FILEINFO_); } @@ -295,7 +293,7 @@ namespace Isis { catch (IException &e) { istm.close(); std::string msg = "Unable to open " + p_type + " [" + p_blobName.toStdString() + - "] in file [" + temp.toStdString() + "]"; + "] in file [" + temp + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -318,7 +316,7 @@ namespace Isis { fstream dstm; dstm.open(p_detached.toLatin1().data(), std::ios::in); if (!dstm) { - QString message = Message::FileOpen(p_detached); + std::string message = Message::FileOpen(p_detached.toStdString()); throw IException(IException::Io, message, _FILEINFO_); } ReadData(dstm); diff --git a/isis/src/core/src/FileCreate.cpp b/isis/src/core/src/FileCreate.cpp index dcdcb47729..a204d19ba3 100644 --- a/isis/src/core/src/FileCreate.cpp +++ b/isis/src/core/src/FileCreate.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::FileCreate(const QString &filename) { +std::string Isis::Message::FileCreate(const std::string &filename) { return "Unable to create [" + filename + "]"; } diff --git a/isis/src/core/src/FileName.cpp b/isis/src/core/src/FileName.cpp index 895566d50c..0e8331c2dc 100644 --- a/isis/src/core/src/FileName.cpp +++ b/isis/src/core/src/FileName.cpp @@ -10,26 +10,26 @@ find files of those names at the top level of this repository. **/ #include #include -#include #include #include -#include -#include - #include "Preference.h" #include "PvlGroup.h" #include "IException.h" #include "IString.h" +#include +#include +#include using namespace std; +namespace fs = std::filesystem; namespace Isis { /** * Constructs an empty FileName object. */ - FileName::FileName() { - m_d = new Data; + FileName::FileName() : m_d(std::make_shared()) { + } /** @@ -37,21 +37,19 @@ namespace Isis { * * @param file char pointer representing new filename */ - FileName::FileName(const char *file) { - m_d = new Data; + FileName::FileName(const char *file) : m_d(std::make_shared()) { m_d->setOriginal(file); } /** - * Constructs a FileName object using a QString as a file name. + * Constructs a FileName object using a std::string as a file name. * * @param file Qstring representing new filename */ - FileName::FileName(const QString &file) { - m_d = new Data; + FileName::FileName(const std::string &file) : m_d(std::make_shared()) { m_d->setOriginal(file); } - + /** * Constructs a copy of a FileName object using another FileName object. * @@ -79,10 +77,14 @@ namespace Isis { * "/home/me/img" * * - * @return QString of the path portion of the original filename. + * @return std::string of the path portion of the original filename. */ - QString FileName::originalPath() const { - return QFileInfo(m_d->original(false)).path(); + std::string FileName::originalPath() const { + std::string ogPath = fs::path(m_d->original(false)).parent_path().string(); + if (ogPath.empty()) { + return "."; + } + return ogPath; } /** @@ -98,16 +100,20 @@ namespace Isis { * "/home/me/img" * * - * @return QString of the path portion of the filename. + * @return std::string of the path portion of the filename. */ - QString FileName::path() const { - return QFileInfo(expanded()).path(); + std::string FileName::path() const { + std::string path = fs::path(expanded()).parent_path().string(); + if (path.empty()) { + return "."; + } + return path; } /** - * Returns a QString of the attributes in a filename, attributes are expected to be of type + * Returns a std::string of the attributes in a filename, attributes are expected to be of type * CubeAttributeInput or CubeAttributeOutput. Filenames without any attributes return an - * empty QString. + * empty std::string. * *
    *   for a full file specification of:
@@ -116,16 +122,16 @@ namespace Isis {
    *    "Bsq"
    * 
* - * @return QString of the attributes specified in the filename. + * @return std::string of the attributes specified in the filename. */ - QString FileName::attributes() const { - QString result; - QString fileNameWithAttribs = QFileInfo(m_d->original(true)).fileName(); + std::string FileName::attributes() const { + std::string result; + std::string fileNameWithAttribs = fs::path(m_d->original(true)).filename(); - int attribStartPos = fileNameWithAttribs.indexOf("+"); + size_t attribStartPos = fileNameWithAttribs.find("+"); - if (attribStartPos != -1) - result = fileNameWithAttribs.mid(attribStartPos + 1); + if (attribStartPos != std::string::npos) + result = fileNameWithAttribs.substr(attribStartPos + 1); return result; } @@ -140,10 +146,14 @@ namespace Isis { * "Peaks" * * - * @return QString containing every character excluding the path and all extensions. + * @return std::string containing every character excluding the path and all extensions. */ - QString FileName::baseName() const { - return QFileInfo(m_d->original(false)).completeBaseName(); + std::string FileName::baseName() const { + std::string stem = fs::path(m_d->original(false)).filename().stem().string(); + if (stem.erase(0, 1) == extension()){ + return ""; + } + return fs::path(m_d->original(false)).filename().stem().string(); } /** @@ -156,11 +166,11 @@ namespace Isis { * "Peaks.cub" * * - * @return QString containing every character in the file name exluding the path and attributes + * @return std::string containing every character in the file name exluding the path and attributes * of the file. */ - QString FileName::name() const { - return QFileInfo(m_d->original(false)).fileName(); + std::string FileName::name() const { + return fs::path(m_d->original(false)).filename(); } /** @@ -173,14 +183,18 @@ namespace Isis { * "gz" * * - * @return QString containing every character in the file name after the last "." character. + * @return std::string containing every character in the file name after the last "." character. */ - QString FileName::extension() const { - return QFileInfo(m_d->original(false)).suffix(); + std::string FileName::extension() const { + std::string ext = fs::path(m_d->original(false)).extension().string(); + if (ext.empty() && m_d->original(false)[0] == '.') { + return fs::path(m_d->original(false)).filename().string().erase(0, 1); + } + return ext.erase(0, 1); } /** - * Returns a QString of the full file name including the file path, excluding the attributes. + * Returns a std::string of the full file name including the file path, excluding the attributes. * Any Isis Preferences or environment variables indicated by $, are changed to what they * represent. * @@ -191,9 +205,9 @@ namespace Isis { * "/usgs/pkgs/isis3/isis/tmp/Peaks.cub" * * - * @return QString + * @return std::string */ - QString FileName::expanded() const { + std::string FileName::expanded() const { return m_d->expanded(false); } @@ -207,9 +221,9 @@ namespace Isis { * "$ISISROOT/tmp/Peaks.cub+Bsq" * * - * @return QString containing every character in the file name and the path + * @return std::string containing every character in the file name and the path */ - QString FileName::original() const { + std::string FileName::original() const { return m_d->original(true); } @@ -222,11 +236,11 @@ namespace Isis { * * @return FileName object with added extension */ - FileName FileName::addExtension(const QString &newExtension) const { + FileName FileName::addExtension(const std::string &newExtension) const { FileName result = *this; if (result.extension() != newExtension) { - QString attributesStr = result.attributes(); + std::string attributesStr = result.attributes(); if (attributesStr == "") result = FileName(result.originalPath() + "/" + result.name() + "." + newExtension); @@ -244,7 +258,7 @@ namespace Isis { * @return FileName object with all extensions removed */ FileName FileName::removeExtension() const { - QString attributesStr = attributes(); + std::string attributesStr = attributes(); FileName result; if (attributesStr == "") @@ -262,7 +276,7 @@ namespace Isis { * * @return FileName object with all existing extensions replaced by the new extension */ - FileName FileName::setExtension(const QString &newExtension) const { + FileName FileName::setExtension(const std::string &newExtension) const { FileName result = *this; if (extension() != newExtension) { @@ -291,7 +305,7 @@ namespace Isis { * @return Boolean */ bool FileName::isNumericallyVersioned() const { - return FileName(expanded()).name().contains("?"); + return (FileName(expanded()).name().find("?") != std::string::npos); } /** @@ -301,7 +315,8 @@ namespace Isis { * @return Boolean */ bool FileName::isDateVersioned() const { - return FileName(expanded()).name().contains(QRegExp("\\{.*\\}")); + std::regex datePattern("\\{.*\\}"); + return (std::regex_search(FileName(expanded()).name(), datePattern)); } /** @@ -316,11 +331,9 @@ namespace Isis { FileName result = *this; if (!isVersioned()) { - throw IException(IException::Unknown, - QObject::tr("Asked for highest version of file named [%1] in [%2] but there " - "are no version sequences in the name") - .arg(name()).arg(originalPath()), - _FILEINFO_); + std::string msg = "Asked for highest version of file named [" + name() + + "] in [" + originalPath() + "] but there are no version sequences in the name"; + throw IException(IException::Unknown, msg, _FILEINFO_); } // Look for dates @@ -351,18 +364,18 @@ namespace Isis { FileName result = *this; if (!isVersioned()) { - throw IException(IException::Unknown, - QObject::tr("Asked for new version of file named [%1] in [%2] but there " - "are no version sequences in the name") - .arg(name()).arg(originalPath()), - _FILEINFO_); + std::string msg = "Asked for new version of file named [" + name() + "] in [" + originalPath() + "] but there are no version sequences in the name"; + throw IException(IException::Unknown, msg, _FILEINFO_); } // Look for date if (isDateVersioned()) { - result = result.version(QDate::currentDate()); - } + auto now = std::chrono::system_clock::now(); + std::time_t now_c = std::chrono::system_clock::to_time_t(now); + std::tm now_tm = *std::localtime(&now_c); + result = result.version(now_tm); + } // Look for #'s if (isNumericallyVersioned()) { try { @@ -374,12 +387,8 @@ namespace Isis { } if (result.fileExists()) { - throw IException(IException::Unknown, - QObject::tr("Could not generate unique new version of file named [%1] in " - "[%2] because the file [%3] exists") - .arg(name()).arg(originalPath()).arg(result.name()), - _FILEINFO_); - + std::string msg = "Could not generate unique new version of file named [" + name() + "] in [" + originalPath() + "] because the file [" + result.name() + "] exists"; + throw IException(IException::Unknown, msg, _FILEINFO_); } return result; @@ -396,31 +405,28 @@ namespace Isis { * @throws Isis::IException::Unknown */ FileName FileName::version(long versionNumber) const { - QString file = FileName(expanded()).name(); + std::string file = FileName(expanded()).name(); - int width = file.count("?"); + int width = std::count(file.begin(), file.end(), '?'); if (versionNumber < 0) { - throw IException(IException::Unknown, - QObject::tr("FileName does not support negative version numbers in the file name, " - "tried to get version [%1] in file named [%2]") - .arg(versionNumber).arg(originalPath() + "/" + file), - _FILEINFO_); + std::string msg = "FileName does not support negative version numbers in the file name, tried to get version [" + std::to_string(versionNumber) + "] in file named " + originalPath() + "/" + file; + throw IException(IException::Unknown, msg, _FILEINFO_); } if (versionNumber >= pow(10.0, width)) { - throw IException(IException::Unknown, - QObject::tr("FileName does not support version numbers greater than what would fit in " - "the file name, tried to get version [%1] in file named [%2]") - .arg(versionNumber).arg(originalPath() + "/" + file), - _FILEINFO_); + std::string msg = "FileName does not support version numbers greater than what would fit in the file name, tried to get version [" + std::to_string(versionNumber) + "] in file named [" + originalPath() + "/" + file + "]"; + throw IException(IException::Unknown, msg, _FILEINFO_); } - std::pair splitName = splitNameAroundVersionNum(); - QString &before = splitName.first; - QString &after = splitName.second; + std::pair splitName = splitNameAroundVersionNum(); + std::string &before = splitName.first; + std::string &after = splitName.second; - file = before + QString("%1").arg(QString::number(versionNumber), width, '0') + after; + std::ostringstream formattedVersion; + formattedVersion << std::setw(width) << std::setfill('0') << versionNumber; + + file = before + formattedVersion.str() + after; return FileName(originalPath() + "/" + file); } @@ -429,13 +435,17 @@ namespace Isis { * Returns a FileName object of the same file name but versioned by the * date passed in as a parameter. * - * @param versionDate QDate to version the new FileName object + * @param versionDate std::tm to version the new FileName object * * @return FileName object with the new version file name. * */ - FileName FileName::version(QDate versionDate) const { - QString newName = versionDate.toString(fileNameQDatePattern()); + FileName FileName::version(const std::tm& versionDate) const { + std::ostringstream oss; + oss << std::put_time(&versionDate, fileNameDatePattern().c_str()); + + std::string newName = oss.str(); + newName.erase(std::remove(newName.begin(), newName.end(), ' '), newName.end()); return FileName(originalPath() + "/" + newName); } @@ -447,11 +457,11 @@ namespace Isis { * @return Boolean */ bool FileName::fileExists() const { - return QFileInfo(expanded()).exists(); + return fs::exists(expanded()); } /** - * Returns the path of the file's parent directory as a QDir object + * Returns the path of the file's parent directory as a std::filesystem::path * *
    *   for a full file specification of:
@@ -460,10 +470,14 @@ namespace Isis {
    *    "/tmp/"
    * 
* - * @return QDir + * @return fs::path */ - QDir FileName::dir() const { - return QFileInfo(expanded()).dir(); + std::filesystem::path FileName::dir() const { + fs::path dir = fs::path(expanded()).parent_path(); + if (dir.empty()){ + return "."; + } + return dir; } /** @@ -476,30 +490,29 @@ namespace Isis { * @throws Isis::IException::Io */ FileName FileName::createTempFile(FileName templateFileName) { - QString preppedFileName = QString("%1/%2XXXXXX.%3").arg(templateFileName.path()) - .arg(templateFileName.baseName()).arg(templateFileName.extension()); - QTemporaryFile tempFile(preppedFileName); - tempFile.setAutoRemove(false); - - if (!tempFile.open()) { + fs::path tempPath = templateFileName.path(); + std::string baseName = templateFileName.baseName(); + std::string extension = templateFileName.extension(); + + std::string uniqueFileName = baseName + "XXXXXX." + extension; + fs::path tempFilePath = tempPath / uniqueFileName; + + std::ofstream tempFile(tempFilePath.string()); + if (!tempFile) { throw IException(IException::Io, - QObject::tr("Could not create a unique temporary file name based on [%1]") - .arg(templateFileName.original()), + "Could not create a unique temporary file name based on [" + templateFileName.original() + "]", _FILEINFO_); } - // We want to set the 'original' path as correctly as possible. So let's use the input original - // path with the output temp file's file name in our result. FileName result; - QString newTempFileNameStr = templateFileName.originalPath() + "/" + - QFileInfo(tempFile.fileName()).fileName(); + std::string newTempFileNameStr = templateFileName.originalPath() + "/" + uniqueFileName; result = FileName(newTempFileNameStr); return result; } /** - * Returns a QString of the full file name including the file path, excluding the attributes + * Returns a std::string of the full file name including the file path, excluding the attributes * with any Isis Preferences or environment variables indicated by $, changed to what they * represent. * @@ -510,9 +523,9 @@ namespace Isis { * "/usgs/pkgs/isis3/isis/tmp/Peaks.cub" * * - * @return QString + * @return std::string */ - QString FileName::toString() const { + std::string FileName::toString() const { return expanded(); } @@ -538,20 +551,17 @@ namespace Isis { * @return Boolean */ bool FileName::operator==(const FileName &rhs) { - QString expandedOfThis = expanded(); - QString canonicalOfThis = QFileInfo(expandedOfThis).canonicalFilePath(); + std::filesystem::path expandedOfThis = expanded(); + std::filesystem::path expandedOfRhs = rhs.expanded(); - QString expandedOfRhs = rhs.expanded(); - QString canonicalOfRhs = QFileInfo(expandedOfRhs).canonicalFilePath(); + std::filesystem::path canonicalOfThis = std::filesystem::absolute(expandedOfThis); + std::filesystem::path canonicalOfRhs = std::filesystem::absolute(expandedOfRhs); - // Cononical file paths return empty strings if the file does not exist. Either both canonicals - // are valid and the same (equal is initialized to true), or neither canonical is valid but - // the expandeds are the same (equal is set to true when it isn't initialized to true). - bool equal = (!canonicalOfThis.isEmpty() && canonicalOfThis == canonicalOfRhs); + bool equal = !canonicalOfThis.empty() && canonicalOfThis == canonicalOfRhs; if (!equal) { - equal = (canonicalOfThis.isEmpty() && canonicalOfRhs.isEmpty() && - expandedOfThis == expandedOfRhs); + equal = canonicalOfThis.empty() && canonicalOfRhs.empty() && + expandedOfThis == expandedOfRhs; } return equal; @@ -569,63 +579,139 @@ namespace Isis { return !(*this == rhs); } + /** + * This function iterates over all the files in the specified directory and returns a vector of filenames + * that match the pattern formed by the `before` and `after` strings. The pattern is constructed as: + * `before + ".*" + after`, where `.*` matches any sequence of characters. + * + * @param directory The directory in which to search for files. + * @param pattern The pattern string. + * @return std::vector A vector containing the filenames that match the specified pattern. + */ + std::vector FileName::getFilesMatchingFilters(fs::path &directory, std::string &pattern) const { + std::vector files; + std::regex regex(pattern); + + for (const auto& entry : fs::directory_iterator(directory)) { + if (fs::is_regular_file(entry.path())) { + std::string filename = entry.path().filename().string(); + if (std::regex_match(filename, regex)) { + files.push_back(filename); + } + } + } + + return files; + } + /** + * This function verifies that the individual fields of a `std::tm` structure + * are within their respective valid ranges. Specifically, it checks the following: + * - `tm_year` should be non-negative (i.e., year >= 1900). + * - `tm_mon` should be in the range [0, 11], representing months January through December. + * - `tm_mday` should be in the range [1, 31], representing days of the month. + * + * @param tm The `std::tm` structure representing the date to be validated. + * @return `true` if the date is valid, `false` otherwise. + */ + bool FileName::isValidDate(std::tm &tm) const { + if (tm.tm_year < 0 || tm.tm_mon < 0 || tm.tm_mon > 11 || tm.tm_mday < 1 || tm.tm_mday > 31) { + return false; + } + return true; +} + /** * This looks through the directory of the file and checks for the highest version date of * the file that is versioned date. * - * @return QDate + * @return std::tm */ - QDate FileName::highestVersionDate() const { - QString fileQDatePattern = fileNameQDatePattern(); + std::tm FileName::highestVersionDate() const { + std::string fileDatePattern = fileNameDatePattern(); std::pair truncateRange(-1, -1); - if (fileQDatePattern.contains("?")) { - QString trueLengthName = name().replace(QRegExp("[{}]"), ""); - truncateRange.first = trueLengthName.indexOf("?"); - truncateRange.second = trueLengthName.lastIndexOf("?"); - fileQDatePattern = fileQDatePattern.replace("?", ""); + if (fileDatePattern.find('?') != std::string::npos) { + std::string trueLengthName = name(); + trueLengthName.erase(std::remove(trueLengthName.begin(), trueLengthName.end(), '{'), trueLengthName.end()); + trueLengthName.erase(std::remove(trueLengthName.begin(), trueLengthName.end(), '}'), trueLengthName.end()); + truncateRange.first = trueLengthName.find('?'); + truncateRange.second = trueLengthName.rfind('?'); + fileDatePattern.erase(std::remove(fileDatePattern.begin(), fileDatePattern.end(), '?'), fileDatePattern.end()); } - QString file = name(); + std::string file = name(); - QDate result; - QDate sputnikLaunch(1957, 10, 4); + std::tm result = {}; + std::tm sputnikLaunch = {}; + sputnikLaunch.tm_year = 1957 - 1900; + sputnikLaunch.tm_mon = 10 - 1; + sputnikLaunch.tm_mday = 4; - QString before = file.mid(0, file.indexOf("{")); - QString after = file.mid(file.lastIndexOf("}") + 1); + std::string after = file.substr(file.rfind("}") + 1); - QStringList nameFilters; + std::string regexPattern = fileDatePattern; + std::regex pattern("%d"); + regexPattern = std::regex_replace(regexPattern, pattern, R"(\d{2})"); - nameFilters.append(before + "*" + after); - QStringList files = dir().entryList(nameFilters); + pattern = "%e"; + regexPattern = std::regex_replace(regexPattern, pattern, R"(\d{1})"); + + pattern = "%b"; + regexPattern = std::regex_replace(regexPattern, pattern, R"([a-zA-Z]{3})"); + + pattern = "%B"; + regexPattern = std::regex_replace(regexPattern, pattern, R"([a-zA-Z]{4,})"); + + pattern = "%Y"; + regexPattern = std::regex_replace(regexPattern, pattern, R"(\d{4})"); + + pattern = "%y"; + regexPattern = std::regex_replace(regexPattern, pattern, R"(\d{2})"); + + pattern = "\'"; + regexPattern = std::regex_replace(regexPattern, pattern, "^"); + + pattern = "_v"; + regexPattern = std::regex_replace(regexPattern, pattern, R"(_v\d+)"); + + std::size_t pos = regexPattern.rfind('.'); + if (pos != std::string::npos) { + regexPattern.insert(pos, 1, '\\'); + } + + fs::path directory = dir(); + std::vector files = getFilesMatchingFilters(directory, regexPattern); // We can't sort the files to get our answer, so we need to go through every possible file. - foreach (QString foundFile, files) { - // Toss any numerical versioning sequence - if (truncateRange.first >= 0 && truncateRange.second > truncateRange.first) { - foundFile = foundFile.mid(0, truncateRange.first) + - foundFile.mid(truncateRange.second + 1); + for (std::string foundFile : files) { + // Toss any numerical versioning sequence + if (truncateRange.first >= 0 && truncateRange.second > truncateRange.first) { + foundFile = foundFile.substr(0, truncateRange.first) + + foundFile.substr(truncateRange.second + 1); - } - QDate fileDate = QLocale(QLocale::English, QLocale::UnitedStates).toDate(foundFile, fileQDatePattern); + } + std::istringstream ss(foundFile); + std::tm fileDate = {}; + ss >> std::get_time(&fileDate, fileDatePattern.c_str()); - if (fileDate.isValid()) { + if (isValidDate(fileDate)) { // No missions before Sputnik 1, so we must be in the new millenium - if (fileDate < sputnikLaunch) - fileDate = fileDate.addYears(100); - - if (!result.isValid() || fileDate > result) { + std::time_t fileDateTime = std::mktime(const_cast(&fileDate)); + std::time_t sputnikLaunchTime = std::mktime(const_cast(&sputnikLaunch)); + std::time_t resultTime = std::mktime(const_cast(&result)); + if (fileDateTime < sputnikLaunchTime) { + fileDate.tm_year += 100; + fileDateTime = std::mktime(&fileDate); + } + if (!isValidDate(result) || fileDateTime > resultTime) { result = fileDate; } } } - if (!result.isValid()) { - throw IException(IException::Unknown, - QObject::tr("No existing files found with a date version matching [%1] in " - "[%2]") - .arg(FileName(expanded()).name()).arg(path()), - _FILEINFO_); + if (!isValidDate(result)) { + std::string msg = "No existing files found with a date version matching [" + FileName(expanded()).name() + "] in [" + path() + "]"; + throw IException(IException::Unknown,msg, _FILEINFO_); } return result; @@ -638,35 +724,45 @@ namespace Isis { * @return long */ long FileName::highestVersionNum() const { - QString file = FileName(expanded()).name(); + std::string file = FileName(expanded()).name(); int result = 0; - int width = file.count("?"); + int width = std::count(file.begin(), file.end(), '?'); + + std::pair splitName = splitNameAroundVersionNum(); + std::string &before = splitName.first; + std::string &after = splitName.second; - std::pair splitName = splitNameAroundVersionNum(); - QString &before = splitName.first; - QString &after = splitName.second; + std::ostringstream oss; + oss << "^" << before << "\\d{" << width << "}" << after << "$"; + std::string pattern = oss.str(); - QStringList nameFilters; - nameFilters.append(before + QString("%1").arg("", width, '?') + after); - QStringList files = dir().entryList(nameFilters, QDir::NoFilter, QDir::Name); + fs::path directory = dir(); + std::vector files = getFilesMatchingFilters(directory, pattern); long foundValue = -1; + long highestValue = 0; bool success = false; - for (int i = files.count() - 1; !success && i >= 0; i--) { - foundValue = files[i].mid(before.count(), width).toLong(&success); + for (std::string foundFile : files) { + try { + foundValue = std::stoi(foundFile.substr(before.length(), width)); + success = true; + } + catch (...) { + success = false; + } + if (foundValue > highestValue) { + highestValue = foundValue; + } } if (success) { - result = foundValue; + result = highestValue; } else { - throw IException(IException::Unknown, - QObject::tr("No existing files found with a numerical version matching [%1] " - "in [%2]") - .arg(FileName(expanded()).name()).arg(path()), - _FILEINFO_); + std::string msg = "No existing files found with a numerical version matching [" + FileName(expanded()).name() + "] in [" + path() + "]"; + throw IException(IException::Unknown, msg, _FILEINFO_); } return result; @@ -677,43 +773,38 @@ namespace Isis { * state to find file version numbers. */ void FileName::validateVersioningState() const { - QString file = QFileInfo(expanded()).fileName(); + std::string file = fs::path(expanded()).filename(); - if (file.contains(QRegExp("\\?\\?*[^?][^?]*\\?"))) { - throw IException(IException::Unknown, - QObject::tr("Only one numerical version sequence is allowed in a filename; " - "there are multiple in [%1]").arg(file), - _FILEINFO_); + std::regex regex("\\?\\?*[^?][^?]*\\?+"); + if(std::regex_match(file, regex)) { + std::string msg = "Only one numerical version sequence is allowed in a filename; " + "there are multiple in [" + file + "]"; + throw IException(IException::Unknown, msg, _FILEINFO_); } if (isDateVersioned()) { - QString fileDatePattern = FileName(expanded()).name(); - - // {} needs to be removed from the fileDatePattern (i.e. an empty date version sequence). - // This prevents the replacement of {} with '' in the pattern, since - // Qt5's QDate.toString(pattern) handles these two adjacent single quotes in the pattern - // differently than Qt4 did. - fileDatePattern.replace(QRegExp("\\{\\}"), ""); - - fileDatePattern = "'" + fileDatePattern.replace(QRegExp("[{}]"), "'") + "'"; - - QString dated = QDate::currentDate().toString(fileDatePattern); - if (file.contains("'")) { - throw IException(IException::Unknown, - QObject::tr("Date version sequenced file names cannot have single quotes in them; " - "the file named [%1] is not usable").arg(file), - _FILEINFO_); + std::string fileDatePattern = fileNameDatePattern(); + const std::time_t t_c = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); + std::tm buf; + localtime_r(&t_c, &buf); + + std::stringstream ss; + ss << std::put_time(&buf, fileDatePattern.c_str()); + + std::string dated = ss.str(); + + if (file.find("'") != std::string::npos) { + std::string msg = "Date version sequenced file names cannot have single quotes in them; " + "the file named [" + file + "] is not usable"; + throw IException(IException::Unknown, msg, _FILEINFO_); } - else if (dated == "") { - throw IException(IException::Unknown, - QObject::tr("The date version sequence is not usable in the file named [%1]").arg(file), - _FILEINFO_); + else if (dated.empty()) { + std::string msg = "The date version sequence is not usable in the file named [" + file + "]"; + throw IException(IException::Unknown, msg, _FILEINFO_); } - else if (dated == fileDatePattern.replace(QRegExp("'"), "")) { - throw IException(IException::Unknown, - QObject::tr("The date version sequences are not recognized in the file named [%1]") - .arg(file), - _FILEINFO_); + else if (fileDatePattern.find('{') != std::string::npos && fileDatePattern.find('}') != std::string::npos) { + std::string msg = "The date version sequences are not recognized in the file named [" + file + "]"; + throw IException(IException::Unknown, msg, _FILEINFO_); } } } @@ -722,29 +813,33 @@ namespace Isis { * This changes the files format. Specifically quotes everything not in {} with single quotes * and removes the {} from the file name. * - * @return QString + * @return std::string */ - QString FileName::fileNameQDatePattern() const { + std::string FileName::fileNameDatePattern() const { // We need to quote everything not in {} with single quotes. - QString file = FileName(expanded()).name(); + std::string file = FileName(expanded()).name(); - // Current Text: {VAR}XXX{VAR}XXX{VAR} or XXX{VAR}XXX{VAR} or XXX{VAR}XXX or {VAR}XXX - file = file.replace(QRegExp("[{}]"), "'"); + std::regex regex("\\{MMM\\}"); + file = std::regex_replace(file, regex, "%b"); - // Current Text: 'VAR'XXX'VAR'XXX'VAR' or XXX'VAR'XXX'VAR' or XXX'VAR'XXX or 'VAR'XXX - if (file.startsWith("'")) - file = file.mid(1); - else - file = "'" + file; + regex = "\\{MMMM\\}"; + file = std::regex_replace(file, regex, "%B"); - // Current Text: VAR'XXX'VAR'XXX'VAR' or 'XXX'VAR'XXX'VAR' or 'XXX'VAR'XXX or VAR'XXX - if (file.endsWith("'")) - file = file.mid(0, file.length() - 1); - else - file = file + "'"; + regex = "\\{dd\\}"; + file = std::regex_replace(file, regex, "%d"); + + regex = "\\{d\\}"; + file = std::regex_replace(file, regex, "%e"); + + regex = "\\{yy\\}"; + file = std::regex_replace(file, regex, "%y"); + + regex = "\\{yyyy\\}"; + file = std::regex_replace(file, regex, "%Y"); + + regex = "\\{ddMMMyyyy\\}"; + file = std::regex_replace(file, regex, "%d%b%Y"); - // Current Text: VAR'XXX'VAR'XXX'VAR or 'XXX'VAR'XXX'VAR or 'XXX'VAR'XXX' or VAR'XXX' -- VAR's - // are the only text not quoted; this is success. return file; } @@ -754,50 +849,50 @@ namespace Isis { * * @return std::pair */ - std::pair FileName::splitNameAroundVersionNum() const { - QString file = FileName(expanded()).name(); - QString before; - QString after; + std::pair FileName::splitNameAroundVersionNum() const { + std::string file = FileName(expanded()).name(); + std::string before; + std::string after; if (!isNumericallyVersioned()) { before = file; } else { - before = file.mid(0, file.indexOf("?")); - after = file.mid(file.lastIndexOf("?") + 1); + before = file.substr(0, file.find("?")); + after = file.substr(file.find_last_of("?") + 1); } - return std::pair(before, after); + return std::pair(before, after); } /** * Data constructor, creates a new Data object. */ - FileName::Data::Data() { + FileName::FileData::FileData() { m_originalFileNameString = NULL; m_expandedFileNameString = NULL; - m_originalFileNameString = new QString; - m_expandedFileNameString = new QString; + m_originalFileNameString = new std::string; + m_expandedFileNameString = new std::string; } /** - * Data copy constructor, creates a copy of a Data object. + * FileData copy constructor, creates a copy of a FileData object. * - * @param &other Data object to copy + * @param &other FileData object to copy */ - FileName::Data::Data(const Data &other) : QSharedData(other) { + FileName::FileData::FileData(const FileData &other) { m_originalFileNameString = NULL; m_expandedFileNameString = NULL; - m_originalFileNameString = new QString(*other.m_originalFileNameString); - m_expandedFileNameString = new QString(*other.m_expandedFileNameString); + m_originalFileNameString = new std::string(*other.m_originalFileNameString); + m_expandedFileNameString = new std::string(*other.m_expandedFileNameString); } /** - * Destroys the Data object. + * Destroys the FileData object. */ - FileName::Data::~Data() { + FileName::FileData::~FileData() { delete m_originalFileNameString; m_originalFileNameString = NULL; @@ -814,40 +909,45 @@ namespace Isis { * * @return Qstring */ - QString FileName::Data::original(bool includeAttributes) const { - QString result = *m_originalFileNameString; - + std::string FileName::FileData::original(bool includeAttributes) const { + std::string result = *m_originalFileNameString; if (!includeAttributes) { - int attributesPos = result.indexOf("+"); + size_t attributesPos = result.find("+"); - if (attributesPos != -1) - result = result.left(attributesPos); + if (attributesPos != string::npos) + result = result.substr(0, attributesPos); } return result; } /** - * Sets the original file name, stored in m_originalFileNameString. QString parameter + * Sets the original file name, stored in m_originalFileNameString. std::string parameter * is the new file name to store in m_originalFileNameString. The expanded verison is also * set and stored in m_expandedFileNameString when this method is called. * * @param originalStr the new file name */ - void FileName::Data::setOriginal(const QString &originalStr) { + void FileName::FileData::setOriginal(const std::string &originalStr) { *m_originalFileNameString = originalStr; // Expand the file name and store that too. - QString expandedStr = original(true); + std::string expandedStr = original(true); int varSearchStartPos = 0; int varStartPos = -1; // Loop while there are any "$" at the current position or after // Some "$" might be skipped if no translation can be found - while((varStartPos = expandedStr.indexOf("$", varSearchStartPos)) != -1) { - int varEndPos = expandedStr.indexOf(QRegExp("[^a-zA-Z{}0-9_]"), varStartPos + 1); + while((varStartPos = expandedStr.find("$", varSearchStartPos)) != -1) { + std::regex pattern("[^a-zA-Z{}0-9_]"); + std::smatch match; + + auto search_start = expandedStr.begin() + varStartPos + 1; + auto it = std::sregex_iterator(search_start, expandedStr.end(), pattern); + + int varEndPos = (it != std::sregex_iterator()) ? std::distance(expandedStr.begin(), it->position() + search_start) : -1; if (varEndPos == -1) varEndPos = expandedStr.length(); @@ -855,33 +955,33 @@ namespace Isis { int varNameLength = varEndPos - varStartPos; if (varNameLength > 0) { - QString varName = expandedStr.mid(varStartPos + 1, varEndPos - varStartPos - 1); + std::string varName = expandedStr.substr(varStartPos + 1, varEndPos - varStartPos - 1); if (varName.length()) { if (varName[0] =='{' && varName[varName.length() - 1] == '}') - varName = varName.mid(1, varName.length() - 2); + varName = varName.substr(1, varName.length() - 2); - QString varValue; + std::string varValue; // Find the corresponding Isis Preference if one exists if(Preference::Preferences().hasGroup("DataDirectory")) { PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - if(dataDir.hasKeyword(varName.toStdString())) { - varValue = QString::fromStdString(dataDir[varName.toStdString()][0]); + if(dataDir.hasKeyword(varName)) { + varValue = dataDir[varName][0]; } } // Find the corresponding environment variable if one exists - if (varValue.isEmpty()) { + if (varValue.empty()) { char *val; - val = getenv(varName.toStdString().c_str()); + val = getenv(varName.c_str()); if(val != NULL) varValue = val; } // Replace the $xxxx with the pref/env, but don't move // the pointer. We may have replaced one $ for another. // Note: May need to put a test for circular replaces in here - if (!varValue.isEmpty()) { + if (!varValue.empty()) { expandedStr = expandedStr.replace(varStartPos, varNameLength, varValue); variableValid = true; } @@ -910,14 +1010,14 @@ namespace Isis { * * @return Qstring */ - QString FileName::Data::expanded(bool includeAttributes) const { - QString result = *m_expandedFileNameString; + std::string FileName::FileData::expanded(bool includeAttributes) const { + std::string result = *m_expandedFileNameString; if (!includeAttributes) { - int attributesPos = result.indexOf("+"); + int attributesPos = result.find("+"); if (attributesPos != -1) - result = result.left(attributesPos); + result = result.substr(0, attributesPos); } return result; diff --git a/isis/src/core/src/FileOpen.cpp b/isis/src/core/src/FileOpen.cpp index 02472775c2..b9295fcd7f 100644 --- a/isis/src/core/src/FileOpen.cpp +++ b/isis/src/core/src/FileOpen.cpp @@ -8,6 +8,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::FileOpen(const QString &filename) { +std::string Isis::Message::FileOpen(const std::string &filename) { return "Unable to open [" + filename + "]"; } diff --git a/isis/src/core/src/FileRead.cpp b/isis/src/core/src/FileRead.cpp index 7e5bef6848..7684948680 100644 --- a/isis/src/core/src/FileRead.cpp +++ b/isis/src/core/src/FileRead.cpp @@ -9,6 +9,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::FileRead(const QString &filename) { +std::string Isis::Message::FileRead(const std::string &filename) { return "Unable to read [" + filename + "]"; } diff --git a/isis/src/core/src/FileWrite.cpp b/isis/src/core/src/FileWrite.cpp index 66f7a36637..59b7148fdb 100644 --- a/isis/src/core/src/FileWrite.cpp +++ b/isis/src/core/src/FileWrite.cpp @@ -8,6 +8,6 @@ find files of those names at the top level of this repository. **/ using namespace std; -QString Isis::Message::FileWrite(const QString &filename) { +std::string Isis::Message::FileWrite(const std::string &filename) { return "Unable to write [" + filename + "]"; } diff --git a/isis/src/core/src/Preference.cpp b/isis/src/core/src/Preference.cpp index 0ee12fac1c..5e936055be 100644 --- a/isis/src/core/src/Preference.cpp +++ b/isis/src/core/src/Preference.cpp @@ -29,7 +29,7 @@ namespace Isis { // Read the input PVL preference file Isis::Pvl pvl; - if(Isis::FileName(QString::fromStdString(file)).fileExists()) { + if(Isis::FileName(file).fileExists()) { pvl.read(file); } else { diff --git a/isis/src/core/src/Pvl.cpp b/isis/src/core/src/Pvl.cpp index 6749d9cec3..f6088d2997 100644 --- a/isis/src/core/src/Pvl.cpp +++ b/isis/src/core/src/Pvl.cpp @@ -88,14 +88,14 @@ namespace Isis { */ void Pvl::read(const std::string &file) { // Expand the filename - Isis::FileName temp(QString::fromStdString(file)); - m_filename = temp.expanded().toStdString(); + Isis::FileName temp(file); + m_filename = temp.expanded(); // Open the file ifstream istm; istm.open(m_filename, std::ios::in); if(!istm) { - QString message = Message::FileOpen(temp.expanded()); + std::string message = Message::FileOpen(temp.expanded()); throw IException(IException::Io, message, _FILEINFO_); } @@ -105,12 +105,12 @@ namespace Isis { } catch(IException &e) { istm.close(); - QString message = "Unable to read PVL file [" + temp.expanded() + "]"; + std::string message = "Unable to read PVL file [" + temp.expanded() + "]"; throw IException(e, IException::Unknown, message, _FILEINFO_); } catch(...) { istm.close(); - QString message = "Unable to read PVL file [" + temp.expanded() + "]"; + std::string message = "Unable to read PVL file [" + temp.expanded() + "]"; throw IException(IException::Unknown, message, _FILEINFO_); } istm.close(); @@ -128,7 +128,7 @@ namespace Isis { */ void Pvl::write(const std::string &file) { // Expand the filename - Isis::FileName temp(QString::fromStdString(file)); + Isis::FileName temp(file); // Set up a Formatter bool removeFormatter = false; @@ -139,11 +139,11 @@ namespace Isis { // Open the file ofstream ostm; - QString tempName(temp.expanded()); - ostm.open(tempName.toLatin1().data(), std::ios::out); + std::string tempName(temp.expanded()); + ostm.open(tempName.c_str(), std::ios::out); ostm.seekp(0, std::ios::beg); if(!ostm) { - QString message = Isis::Message::FileCreate(temp.expanded()); + std::string message = Isis::Message::FileCreate(temp.expanded()); throw IException(IException::Io, message, _FILEINFO_); } @@ -154,12 +154,12 @@ namespace Isis { } catch(IException &e) { ostm.close(); - QString message = "Unable to write PVL to file [" + temp.expanded() + "]"; + std::string message = "Unable to write PVL to file [" + temp.expanded() + "]"; throw IException(e, IException::Io, message, _FILEINFO_); } catch(...) { ostm.close(); - QString message = "Unable to write PVL to file [" + temp.expanded() + "]"; + std::string message = "Unable to write PVL to file [" + temp.expanded() + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -182,7 +182,7 @@ namespace Isis { */ void Pvl::append(const std::string &file) { // Set up for opening and writing - Isis::FileName temp(QString::fromStdString(file)); + Isis::FileName temp(file); // Set up a Formatter bool removeFormatter = false; @@ -193,11 +193,11 @@ namespace Isis { // Open the file ofstream ostm; - QString tempName(temp.expanded()); - ostm.open(tempName.toLatin1().data(), std::ios::app); + std::string tempName(temp.expanded()); + ostm.open(tempName.c_str(), std::ios::app); ostm.seekp(0, std::ios::end); if(!ostm) { - QString message = Message::FileOpen(temp.expanded()); + std::string message = Message::FileOpen(temp.expanded()); throw IException(IException::Io, message, _FILEINFO_); } @@ -208,7 +208,7 @@ namespace Isis { } catch(...) { ostm.close(); - QString message = "Unable to append PVL infomation to file [" + + std::string message = "Unable to append PVL infomation to file [" + temp.expanded() + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -263,12 +263,12 @@ namespace Isis { for(int i = 0; i < outTemplate.keywords(); i++) { if(outTemplate[i].isNamed("Isis:PvlTemplate:File")) { std::string filename = outTemplate[i]; - Isis::FileName file(QString::fromStdString(filename)); + Isis::FileName file(filename); if(!file.fileExists()) { std::string message = "Could not open the template file [" + filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } - Isis::Pvl include(file.expanded().toStdString()); + Isis::Pvl include(file.expanded()); for(int j = 0; j < include.keywords(); j++) { if(!newTemp.hasKeyword(include[j].name())) diff --git a/isis/src/core/src/PvlContainer.cpp b/isis/src/core/src/PvlContainer.cpp index 2754cf3859..94b8f32f55 100644 --- a/isis/src/core/src/PvlContainer.cpp +++ b/isis/src/core/src/PvlContainer.cpp @@ -6,8 +6,6 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include -#include - #include "PvlContainer.h" #include "Pvl.h" #include "FileName.h" @@ -261,12 +259,12 @@ namespace Isis { for(int i = 0; i < outTemplate.keywords(); i++) { if(outTemplate[i].isNamed("Isis:PvlTemplate:File")) { std::string filename = outTemplate[i]; - Isis::FileName file(QString::fromStdString(filename)); + Isis::FileName file(filename); if(!file.fileExists()) { std::string message = "Could not open the template file [" + filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } - Isis::Pvl include(file.expanded().toStdString()); + Isis::Pvl include(file.expanded()); for(int j = 0; j < include.keywords(); j++) { if(!newTemp.hasKeyword(include[j].name())) diff --git a/isis/src/core/src/PvlFormatPds.cpp b/isis/src/core/src/PvlFormatPds.cpp index fdf4bed7b5..23886848e7 100644 --- a/isis/src/core/src/PvlFormatPds.cpp +++ b/isis/src/core/src/PvlFormatPds.cpp @@ -7,8 +7,6 @@ find files of those names at the top level of this repository. **/ #include #include -#include - #include "IException.h" #include "Message.h" #include "IString.h" diff --git a/isis/src/core/src/PvlObject.cpp b/isis/src/core/src/PvlObject.cpp index 18916e8d9e..f44d594d3e 100644 --- a/isis/src/core/src/PvlObject.cpp +++ b/isis/src/core/src/PvlObject.cpp @@ -537,14 +537,14 @@ namespace Isis { for(int i = 0; i < outTemplate.keywords(); i++) { if(outTemplate[i].isNamed("Isis:PvlTemplate:File")) { std::string filename = outTemplate[i]; - Isis::FileName file(QString::fromStdString(filename)); + Isis::FileName file(filename); if(!file.fileExists()) { std::string message = "Could not open the following PVL template file: "; message += filename; throw IException(IException::Io, message, _FILEINFO_); } - Isis::Pvl include(file.expanded().toStdString()); + Isis::Pvl include(file.expanded()); for(int j = 0; j < include.keywords(); j++) { if(!newTemp.hasKeyword(include[j].name())) diff --git a/isis/src/core/src/Table.cpp b/isis/src/core/src/Table.cpp index 533b7423ff..04f42df90f 100644 --- a/isis/src/core/src/Table.cpp +++ b/isis/src/core/src/Table.cpp @@ -108,7 +108,7 @@ namespace Isis { */ Table::Table(const std::string &tableName, const QString &file, const Pvl &fileHeader) { Blob blob(QString::fromStdString(tableName), "Table"); - blob.Read(file, fileHeader); + blob.Read(file.toStdString(), fileHeader); initFromBlob(blob); } diff --git a/isis/src/core/tests/unitTests/FileName/unitTest.cpp b/isis/src/core/tests/unitTests/FileName/unitTest.cpp index 4991d7041c..0d0daffa77 100644 --- a/isis/src/core/tests/unitTests/FileName/unitTest.cpp +++ b/isis/src/core/tests/unitTests/FileName/unitTest.cpp @@ -6,12 +6,8 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include #include - -#include -#include -#include -#include -#include +#include +#include #include "FileName.h" #include "IException.h" @@ -20,26 +16,30 @@ find files of those names at the top level of this repository. **/ using namespace std; using namespace Isis; -void TestVersioning(QString prefix, QString name, bool containsDate = false); -void TestExpanded(QString prefix, QString name); -void TestExtensionChanges(QString prefix, QString name, bool showExpandedValues); -void TestGenericAccessors(QString prefix, QString name, bool showExpandedValues); +void TestVersioning(std::string prefix, std::string name, bool containsDate = false); +void TestExpanded(std::string prefix, std::string name); +void TestExtensionChanges(std::string prefix, std::string name, bool showExpandedValues); +void TestGenericAccessors(std::string prefix, std::string name, bool showExpandedValues); int main(int argc, char *argv[]) { Preference::Preferences(true); - QCoreApplication app(argc, argv); - - QStringList filesToFullTest; - filesToFullTest << "/path/base.ext+attr" << "/path1/.path2/base.ext+attr" - << "/path1/pat.h2/base+attr" << "/.path1/path2/base" - << "/.path1/path2/base.+attr" << "/another/path/base.ex1.exten2.ext3" - << "/$BADENV/base.ext+attr" << "/.path1/base+attr1+attr2" - << "unitTest.cpp" << "./unitTest.cpp" << ".cub" - << "/$TEMPORARY/unitTest.cpp"; - - foreach (QString fileToTest, filesToFullTest) { - cout << "Running Full Test on [" << qPrintable(fileToTest) << "]" << endl; + std::vector filesToFullTest; + filesToFullTest.push_back("/path/base.ext+attr"); + filesToFullTest.push_back("/path1/.path2/base.ext+attr"); + filesToFullTest.push_back("/path1/pat.h2/base+attr"); + filesToFullTest.push_back("/.path1/path2/base"); + filesToFullTest.push_back("/.path1/path2/base.+attr"); + filesToFullTest.push_back("/another/path/base.ex1.exten2.ext3"); + filesToFullTest.push_back("/$BADENV/base.ext+attr"); + filesToFullTest.push_back("/.path1/base+attr1+attr2"); + filesToFullTest.push_back("unitTest.cpp"); + filesToFullTest.push_back("./unitTest.cpp"); + filesToFullTest.push_back(".cub"); + filesToFullTest.push_back("/$TEMPORARY/unitTest.cpp"); + + foreach (std::string fileToTest, filesToFullTest) { + cout << "Running Full Test on [" << fileToTest << "]" << endl; TestGenericAccessors("\t", fileToTest, true); TestExtensionChanges("\t", fileToTest, true); TestExpanded("\t", fileToTest); @@ -47,50 +47,58 @@ int main(int argc, char *argv[]) { // Test temp files thoroughly cout << "Testing temporary file name placement" << endl; - QString tempFileNameTestStr = "$TEMPORARY/tttt.tmp"; + std::string tempFileNameTestStr = "$TEMPORARY/tttt.tmp"; + FileName n = FileName::createTempFile(tempFileNameTestStr); + std::string prefix = n.name().substr(0, 4); + std::string suffix = n.name().substr(n.name().size() - 4); + std::string middle(n.name().size() - 8, '?'); cout << "\tInput name and extension : " << tempFileNameTestStr << endl; cout << "\tExtension: : " << n.extension() << endl; cout << "\tOriginal Path: : " << n.originalPath() << endl; cout << "\tExists: : " << n.fileExists() << endl; - cout << "\tName (cleaned): : " << - QString(n.name().mid(0, 4) + - QString("%1").arg("", n.name().size() - 8, '?') + - n.name().mid(n.name().size() - 4)) << endl; + cout << "\tName (cleaned): : " << prefix + middle + suffix << endl; cout << endl; - if (!QFile(n.toString()).remove()) { - cout << "\t**Failed to delete temporary file [" << n.toString() << "]**" << endl; - } + // if (!std::remove(n.toString())) { + // cout << "\t**Failed to delete temporary file [" << n.toString() << "]**" << endl; + // } { cout << "Testing parallel temporary file name creation for atomicity" << endl; - int numToTest = QThreadPool::globalInstance()->maxThreadCount() * 20; + int numToTest = std::thread::hardware_concurrency() * 20; - QStringList templateFileNames; + std::vector templateFileNames; for (int i = 0; i < numToTest; i++) - templateFileNames.append(QString("tttt.tmp")); - - QList results = QtConcurrent::blockingMapped(templateFileNames, - &FileName::createTempFile); + templateFileNames.push_back("tttt.tmp"); + + std::vector results; + results.reserve(templateFileNames.size()); + std::transform(templateFileNames.begin(), templateFileNames.end(), std::back_inserter(results), + [](const FileName& fileName) { + return FileName::createTempFile(fileName); + }); bool success = true; - while (results.count()) { - FileName result = results.first(); - int count = results.removeAll(result); + while (!results.empty()) { + FileName result = results.front(); + results.erase(std::remove(results.begin(), results.end(), result), results.end()); - if (count != 1) { + int count = std::count(results.begin(), results.end(), result); + + if (count != 0) { cout << "File name: " << result.toString() << " encountered " << count << " times" << endl; success = false; } - if (!result.fileExists()) { + if (!std::filesystem::exists(result.toString())) { cout << "File name: " << result.toString() << " encountered does not exists"; success = false; } - QFile(result.toString()).remove(); + // std::remove(result.toString()); + std::filesystem::remove(result.toString()); } if (success) { @@ -106,18 +114,35 @@ int main(int argc, char *argv[]) { // Test versioning thoroughly { - QStringList tempFiles; - tempFiles << "tttt000001" << "tttt000001.tmp" << "tttt000005.tmp" << "tttt000006.tmp" - << "tttt000008.tmp" << "1tttt000008.tmp" << "2tttt000008.tmp" - << "tttt_0.tmp" << "junk06.tmp" << "junk09.tmp" << "tttt05Sep2002.tmp" - << "tttt20Jan2010.tmp" << "tttt14Apr2010.tmp" << "ttAPRtt22yy99.tmp" - << "ttMARtt11yy00.tmp" << "ttFEBtt04yy01.tmp" << "ttMARtt072003.tmp" - << "tt14ttNovember.tmp" << "tt2ttDecember.tmp" << "tttt.tmp" << "APR-22-99_v001.tmp" - << "APR-22-99_v004.tmp" << "APR-21-99_v009.tmp"; - - foreach (QString fileName, tempFiles) { - if (!QFile(fileName).open(QIODevice::WriteOnly | QIODevice::Truncate)) { - cout << "Failed to create temporary file for test: " << qPrintable(fileName) << endl; + std::vector tempFiles; + tempFiles.push_back("tttt000001"); + tempFiles.push_back("tttt000001.tmp"); + tempFiles.push_back("tttt000005.tmp"); + tempFiles.push_back("tttt000006.tmp"); + tempFiles.push_back("tttt000008.tmp"); + tempFiles.push_back("1tttt000008.tmp"); + tempFiles.push_back("2tttt000008.tmp"); + tempFiles.push_back("tttt_0.tmp"); + tempFiles.push_back("junk06.tmp"); + tempFiles.push_back("junk09.tmp"); + tempFiles.push_back("tttt05Sep2002.tmp"); + tempFiles.push_back("tttt20Jan2010.tmp"); + tempFiles.push_back("tttt14Apr2010.tmp"); + tempFiles.push_back("ttAprtt22yy99.tmp"); + tempFiles.push_back("ttMartt11yy00.tmp"); + tempFiles.push_back("ttFebtt04yy01.tmp"); + tempFiles.push_back("ttMartt072003.tmp"); + tempFiles.push_back("tt14ttNovember.tmp"); + tempFiles.push_back("tt2ttDecember.tmp"); + tempFiles.push_back("tttt.tmp"); + tempFiles.push_back("Apr-22-99_v001.tmp"); + tempFiles.push_back("Apr-22-99_v004.tmp"); + tempFiles.push_back("Apr-21-99_v009.tmp"); + + foreach (std::string fileName, tempFiles) { + std::ofstream file(fileName, std::ios::out | std::ios::trunc); + if (!file.is_open()) { + cout << "Failed to create temporary file for test: " << fileName << endl; } } @@ -156,14 +181,22 @@ int main(int argc, char *argv[]) { cout << "Verifying NewVersion for file " << todayFileName.name() << " is today" << endl; bool success = false; try { - todayFileName = todayFileName.newVersion(); - QDate today = QDate::currentDate(); - QString expected = today.toString("'tttt'dd'tt'yyyy'tt'MMM'.tmp'"); - success = todayFileName.name() == expected; - cout << "\tMade today's filename successfully? " << success << endl; + todayFileName = todayFileName.newVersion(); + std::time_t now_c = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); + std::tm *now_tm = std::localtime(&now_c); + std::ostringstream oss; + oss << "tttt" + << std::put_time(now_tm, "%d") << "tt" + << std::put_time(now_tm, "%Y") << "tt" + << std::put_time(now_tm, "%b") + << ".tmp"; + + std::string expected = oss.str(); + success = todayFileName.name() == expected; + cout << "\tMade today's filename successfully? " << success << endl; if (!success) - cout << "\t\tMade: " << todayFileName.name() << "; expected: " << expected.toStdString() + cout << "\t\tMade: " << todayFileName.name() << "; expected: " << expected << endl; } catch(IException &error) { @@ -171,11 +204,18 @@ int main(int argc, char *argv[]) { } cout << endl; - foreach (QString fileName, tempFiles) { - if (!QFile(fileName).remove()) { - cout << "Failed to delete temporary file for test: " << qPrintable(fileName) << endl; - cout << "Was it specified twice?" << endl; - } + for (const auto& fileName : tempFiles) { + std::filesystem::path filePath(fileName); + + try { + if (std::filesystem::exists(filePath) && std::filesystem::is_regular_file(filePath)) { + if (!std::filesystem::remove(filePath)) { + std::cout << "Failed to delete temporary file for test: " << fileName << std::endl; + } + } + } catch (const std::filesystem::filesystem_error& e) { + std::cerr << "Error deleting file: " << e.what() << std::endl; + } } } @@ -183,7 +223,7 @@ int main(int argc, char *argv[]) { } -void TestVersioning(QString prefix, QString name, bool containsDate) { +void TestVersioning(std::string prefix, std::string name, bool containsDate) { cout << prefix << "Testing Versioning Methods [" << name << "]" << endl; try { @@ -227,7 +267,7 @@ void TestVersioning(QString prefix, QString name, bool containsDate) { } -void TestGenericAccessors(QString prefix, QString name, bool showExpandedValues) { +void TestGenericAccessors(std::string prefix, std::string name, bool showExpandedValues) { FileName a(name); // Test our assignment & copy construct every time @@ -262,7 +302,7 @@ void TestGenericAccessors(QString prefix, QString name, bool showExpandedValues) } -void TestExtensionChanges(QString prefix, QString name, bool showExpandedValues) { +void TestExtensionChanges(std::string prefix, std::string name, bool showExpandedValues) { FileName a(name); // Test our assignment & copy construct every time @@ -272,7 +312,7 @@ void TestExtensionChanges(QString prefix, QString name, bool showExpandedValues) FileName test; test = c; - QString (FileName::*toStringMethod)() const = &FileName::toString; + std::string (FileName::*toStringMethod)() const = &FileName::toString; FileName beforeLastChange = test; @@ -323,7 +363,7 @@ void TestExtensionChanges(QString prefix, QString name, bool showExpandedValues) } -void TestExpanded(QString prefix, QString name) { +void TestExpanded(std::string prefix, std::string name) { FileName a(name); // Test our assignment & copy construct every time From f19a2078d171fedbcd1ae00520c672e3f9dc26dc Mon Sep 17 00:00:00 2001 From: acpaquette Date: Thu, 22 Aug 2024 19:55:06 -0700 Subject: [PATCH 58/95] Removed QStrings from IString in ISIS core --- gtest | 2 +- isis/src/core/include/IString.h | 29 +-- isis/src/core/include/SpecialPixel.h | 2 +- isis/src/core/include/TableRecord.h | 2 +- isis/src/core/src/IException.cpp | 2 +- isis/src/core/src/IString.cpp | 239 +++++++----------- isis/src/core/src/Preference.cpp | 8 +- .../tests/unitTests/IString/IString.truth | 22 -- .../core/tests/unitTests/IString/unitTest.cpp | 31 --- 9 files changed, 114 insertions(+), 223 deletions(-) diff --git a/gtest b/gtest index b10fad38c4..f8d7d77c06 160000 --- a/gtest +++ b/gtest @@ -1 +1 @@ -Subproject commit b10fad38c4026a29ea6561ab15fc4818170d1c10 +Subproject commit f8d7d77c06936315286eb55f8de22cd23c188571 diff --git a/isis/src/core/include/IString.h b/isis/src/core/include/IString.h index 4c06c47af0..29d120c608 100644 --- a/isis/src/core/include/IString.h +++ b/isis/src/core/include/IString.h @@ -9,7 +9,6 @@ find files of those names at the top level of this repository. **/ #include #include -#include #include #include "Constants.h" @@ -17,17 +16,17 @@ find files of those names at the top level of this repository. **/ namespace Isis { class IString; - bool toBool(const QString &); - int toInt(const QString &); - BigInt toBigInt(const QString &); - double toDouble(const QString &); + bool toBool(const std::string &); + int toInt(const std::string &); + BigInt toBigInt(const std::string &); + double toDouble(const std::string &); - QString toString(bool); - QString toString(char); - QString toString(const int &); - QString toString(const unsigned int &); - QString toString(const BigInt &); - QString toString(double, int precision = 14); + std::string toString(bool); + std::string toString(char); + std::string toString(const int &); + std::string toString(const unsigned int &); + std::string toString(const BigInt &); + std::string toString(double, int precision = 14); /** * @brief Adds specific functionality to C++ strings @@ -200,9 +199,6 @@ namespace Isis { double ToDouble() const; static double ToDouble(const std::string &str); - QString ToQt() const; - static QString ToQt(const std::string &str); - IString Token(const IString &separator); static int Split(const char separator, const std::string &instr, std::vector &tokens, @@ -291,11 +287,6 @@ namespace Isis { bool Equal(const std::string &str) const; static bool Equal(const std::string &str1, const std::string &str2); - static std::string ToStd(const QString &str); - - static QStringList ToQt(const std::vector &sl); - static std::vector ToStd(const QStringList &sl); - private: void SetDouble(const double &value, const int piPrecision = 14); }; diff --git a/isis/src/core/include/SpecialPixel.h b/isis/src/core/include/SpecialPixel.h index 2d1c56ed98..004bd2db84 100644 --- a/isis/src/core/include/SpecialPixel.h +++ b/isis/src/core/include/SpecialPixel.h @@ -413,7 +413,7 @@ namespace Isis { } if(matches == 0) { try { - return toDouble(s); + return toDouble(s.toStdString()); } catch(IException &e) { QString msg = "Input [" + str + "] does not appear to be a legal special pixel abbreviation or double value."; diff --git a/isis/src/core/include/TableRecord.h b/isis/src/core/include/TableRecord.h index fc16938662..6d746f42ae 100644 --- a/isis/src/core/include/TableRecord.h +++ b/isis/src/core/include/TableRecord.h @@ -46,7 +46,7 @@ namespace Isis { static std::string toString(TableRecord record, std::string fieldDelimiter = ",", bool fieldNames = false, bool endLine = true); void operator+=(Isis::TableField &field); - TableField&operator [](const int field); + TableField &operator[](const int field); TableField &operator[](const std::string field); int Fields() const; diff --git a/isis/src/core/src/IException.cpp b/isis/src/core/src/IException.cpp index a69da19e97..51225830b6 100644 --- a/isis/src/core/src/IException.cpp +++ b/isis/src/core/src/IException.cpp @@ -590,7 +590,7 @@ namespace Isis { if(includeFileInfo && exception.m_fileName) { result += " in " + *exception.m_fileName; if (exception.m_lineNumber != -1) - result += " at " + Isis::toString(exception.m_lineNumber); + result += " at " + QString(Isis::toString(exception.m_lineNumber).c_str()); needsPeriod = true; } diff --git a/isis/src/core/src/IString.cpp b/isis/src/core/src/IString.cpp index eb94568c78..e4b8209521 100644 --- a/isis/src/core/src/IString.cpp +++ b/isis/src/core/src/IString.cpp @@ -35,46 +35,65 @@ namespace Isis { * @param string QString to be converted to a boolean. * @return The boolean equivalent to the string */ - bool toBool(const QString &string) { - QStringList trues; - trues.append("true"); - trues.append("t"); - trues.append("yes"); - trues.append("y"); - trues.append("on"); - trues.append("1"); - - QStringList falses; - falses.append("false"); - falses.append("f"); - falses.append("no"); - falses.append("n"); - falses.append("off"); - falses.append("0"); + bool toBool(const std::string &string) { + std::vector trues; + trues.push_back("true"); + trues.push_back("t"); + trues.push_back("yes"); + trues.push_back("y"); + trues.push_back("on"); + trues.push_back("1"); + + std::vector falses; + falses.push_back("false"); + falses.push_back("f"); + falses.push_back("no"); + falses.push_back("n"); + falses.push_back("off"); + falses.push_back("0"); bool result = true; bool foundMatch = false; + std::string lowerString = IString::DownCase(string); - QListIterator truesIterator(trues); - while (!foundMatch && truesIterator.hasNext()) { - foundMatch = (string.compare(truesIterator.next(), Qt::CaseInsensitive) == 0); + for (auto it = trues.cbegin(); it != trues.cend(); ++it) { + foundMatch = (lowerString == *it); + if (foundMatch) { + break; + } } if (!foundMatch) { result = false; - QListIterator falsesIterator(falses); - while (!foundMatch && falsesIterator.hasNext()) { - foundMatch = (string.compare(falsesIterator.next(), Qt::CaseInsensitive) == 0); + for (auto it = falses.cbegin(); it != falses.cend(); ++it) { + foundMatch = (lowerString == *it); + if (foundMatch) { + break; + } } } if (!foundMatch) { - trues.sort(); - falses.sort(); - QString message = QObject::tr("Failed to convert string [%1] to a boolean. " - "Please specify one of [%2] for true, or one of [%3] for false.") - .arg(string).arg(trues.join(", ")).arg(falses.join(", ")); + std::sort(trues.begin(), trues.end()); + std::sort(falses.begin(), falses.end()); + + std::string message = "Failed to convert string ["; + message += string; + message += "] to a boolean. Please specify one of ["; + for (auto it = trues.cbegin(); it != trues.cend() - 1; ++it) { + message += (*it); + message += ", "; + } + message += (trues[trues.size() - 1]); + message += "] for true, or one of ["; + for (auto it = falses.cbegin(); it != falses.cend() - 1; ++it) { + message += (*it); + message += ", "; + } + message += (falses[falses.size() - 1]); + message += "] for false."; + throw IException(IException::Unknown, message, _FILEINFO_); } @@ -90,17 +109,24 @@ namespace Isis { * @param string QString to be converted to an integer. * @return The integer equivalent to the string */ - int toInt(const QString &string) { - bool ok = true; + int toInt(const std::string &string) { - int result = string.toInt(&ok); - - if (!ok) { - QString message = QObject::tr("Failed to convert string [%1] to an integer").arg(string); + try { + for(auto character : string) { + if(character == '.') { + throw std::invalid_argument(""); + } + } + int result = std::stoi(string); + return result; + } + catch(...) { + std::string message = "Failed to convert string ["; + message += string; + message += "] to an integer"; throw IException(IException::Unknown, message, _FILEINFO_); } - return result; } @@ -112,14 +138,14 @@ namespace Isis { * @param string QString to be converted to a big integer. * @return The BigInt equivalent to the string */ - BigInt toBigInt(const QString &string) { + BigInt toBigInt(const std::string &string) { BigInt result; try { std::stringstream s; - s << string.toStdString(); // Put the string into a stream + s << string; // Put the string into a stream s.seekg(0, std::ios::beg); // Move the input pointer to the beginning - s >> result; // read/get "type T" out of the stream + s >> result; // read/get "type T" out of the stream std::ios::iostate state = s.rdstate(); if((state & std::ios::failbit) || (state & std::ios::badbit) || (!(state & std::ios::eofbit))) { // Make sure the stream is empty @@ -127,7 +153,9 @@ namespace Isis { } } catch(...) { - QString message = QObject::tr("Failed to convert string [%1] to a big integer").arg(string); + std::string message = "Failed to convert string ["; + message += string; + message += "] to a big integer"; throw IException(IException::Unknown, message, _FILEINFO_); } @@ -146,13 +174,13 @@ namespace Isis { * hexadecimal string. * @return The double equivalent to the string */ - double toDouble(const QString &string) { + double toDouble(const std::string &string) { double result = 0.0; - if (string.startsWith("16#") && string.endsWith("#")) { + if ((string.substr(0, 3).compare("16#") == 0) && (string[string.size() - 1] == '#')) { try { stringstream s; - s << string.mid(3, string.size() - 3); + s << string.substr(3, string.size() - 3); s.seekg(0, ios::beg); union { @@ -170,31 +198,34 @@ namespace Isis { result = raw.floatData; } catch(...) { - QString message = QObject::tr("Failed to convert HEX string [%1] to a " - "double").arg(string); + std::string message = "Failed to convert HEX string "; + message += string; + message += " to a double"; throw IException(IException::Unknown, message, _FILEINFO_); } } else { - static QMap knownStrings; + static QMap knownStrings; if (knownStrings.isEmpty()) { // Special case: user called toDouble(toString(DBL_MAX)) knownStrings["1.79769313486232e+308"] = DBL_MAX; knownStrings["-1.79769313486232e+308"] = -DBL_MAX; } - bool ok = true; if (!knownStrings.contains(string)) { - result = string.toDouble(&ok); + try { + result = std::stod(string); + } + catch (...) { + std::string message = "Failed to convert string ["; + message += string; + message += "] to a double"; + throw IException(IException::Unknown, message, _FILEINFO_); + } } else { result = knownStrings[string]; } - - if (!ok) { - QString message = QObject::tr("Failed to convert string [%1] to a double").arg(string); - throw IException(IException::Unknown, message, _FILEINFO_); - } } return result; @@ -208,7 +239,7 @@ namespace Isis { * @param boolToConvert Boolean value to be converted to a QString. * @return string Converted QString (Yes or No). */ - QString toString(bool boolToConvert) { + std::string toString(bool boolToConvert) { return boolToConvert? "Yes" : "No"; } @@ -221,9 +252,9 @@ namespace Isis { * @param charToConvert Character value to be converted to a QString. * @return string Converted QString. */ - QString toString(char charToConvert) { - QString result; - result += QChar(charToConvert); + std::string toString(char charToConvert) { + std::string result; + result += charToConvert; return result; } @@ -234,8 +265,8 @@ namespace Isis { * @param intToConvert Integer value to be converted to a QString. * @return string Converted QString. */ - QString toString(const int &intToConvert) { - return QString::number(intToConvert); + std::string toString(const int &intToConvert) { + return std::to_string(intToConvert); } @@ -245,8 +276,8 @@ namespace Isis { * @param intToConvert Unsigned integer value to be converted to a QString. * @return string Converted QString. */ - QString toString(const unsigned int &intToConvert) { - return QString::number(intToConvert); + std::string toString(const unsigned int &intToConvert) { + return std::to_string(intToConvert); } @@ -256,8 +287,8 @@ namespace Isis { * @param intToConvert Big integer value to be converted to a QString. * @return string Converted QString. */ - QString toString(const BigInt &intToConvert) { - return QString::number(intToConvert); + std::string toString(const BigInt &intToConvert) { + return std::to_string(intToConvert); } @@ -274,10 +305,10 @@ namespace Isis { * @param precision Number of significant figures to convert. * @return string Converted QString. */ - QString toString(double doubleToConvert, int precision) { + std::string toString(double doubleToConvert, int precision) { // If number is zero, then it is not valid to do a log10 on it. To avoid this, // check for zero ahead of time and handle it. - QString result; + std::string result; if(doubleToConvert == 0.0) { result = "0.0"; @@ -388,7 +419,7 @@ namespace Isis { } } - result = QString(doubleString); + result = std::string(doubleString); } return result; @@ -492,17 +523,7 @@ namespace Isis { * @param num The input value to be stored */ void IString::SetDouble(const double &num, const int piPrecision) { - *this = toString(num, piPrecision).toStdString(); - } - - /** - * Constructs a IString object with initial value set to the input QString - * - * @deprecated - * @param str - */ - IString::IString(const QString &str) : string() { - assign(str.toStdString()); + *this = toString(num, piPrecision); } /** @@ -861,26 +882,6 @@ namespace Isis { return(v_out); } - /** - * Retuns the object string as a QString - * - * @deprecated - */ - QString IString::ToQt() const { - return QString::fromStdString(*this); - } - - /** - * Returns the input string as a QString - * - * @deprecated - * - * @param s [in] The standard string to be converted to a Qt string - */ - QString IString::ToQt(const std::string &s) { - return(QString::fromStdString(s)); - } - /** * Returns the first token in the IString. A token is defined as a string of * characters from the beginning of the string to, but not including, the first @@ -1321,54 +1322,6 @@ namespace Isis { return *this; } - /** - * Converts a Qt string into a std::string - * - * @deprecated - * - * @param str [in] The Qt string to be converted to a std::string - * - * @return The std::string representation of the Qt string - */ - std::string IString::ToStd(const QString &str) { - return(str.toStdString()); - } - - /** - * Converts a vector of strings into a QStringList - * - * @deprecated - * - * @param sl STL vector of strings - * - * @return QStringList - */ - QStringList IString::ToQt(const std::vector &sl) { - QStringList Qsl; - for(unsigned int i = 0 ; i < sl.size() ; i++) { - Qsl << ToQt(sl[i]); - } - return Qsl; - } - - /** - * Converts a QStringList into a vector of strings - * - * @deprecated - * - * @param sl - * - * @return vector - */ - std::vector IString::ToStd(const QStringList &sl) { - std::vector Stdsl; - for(int i = 0 ; i < sl.size() ; i++) { - Stdsl.push_back(ToStd(sl.at(i))); - } - - return(Stdsl); - } - /** * Print an ASCII representation of the given QString to a stl stream (most commonly cout, cerr). diff --git a/isis/src/core/src/Preference.cpp b/isis/src/core/src/Preference.cpp index 5e936055be..5a35163da1 100644 --- a/isis/src/core/src/Preference.cpp +++ b/isis/src/core/src/Preference.cpp @@ -62,11 +62,11 @@ namespace Isis { if (hasGroup("Performance")) { PvlGroup &performance = findGroup("Performance"); if (performance.hasKeyword("GlobalThreads")) { - IString threadsPreference = performance["GlobalThreads"][0]; + std::string threadsPreference = IString::DownCase(performance["GlobalThreads"][0]); - if (threadsPreference.DownCase() != "optimized") { + if (threadsPreference != "optimized") { // We need a no-iException conversion here - int threads = threadsPreference.ToQt().toInt(); + int threads = std::stoi(threadsPreference); if (threads > 0) { QThreadPool::globalInstance()->setMaxThreadCount(threads); @@ -92,7 +92,7 @@ namespace Isis { Isis::FileName setup("$HOME/.Isis"); if(!setup.fileExists()) { QDir dir; - QString dirName(IString(setup.expanded()).ToQt()); + QString dirName(setup.expanded()); dir.mkdir(dirName); } diff --git a/isis/src/core/tests/unitTests/IString/IString.truth b/isis/src/core/tests/unitTests/IString/IString.truth index f70c5ebc5f..c1ba144269 100644 --- a/isis/src/core/tests/unitTests/IString/IString.truth +++ b/isis/src/core/tests/unitTests/IString/IString.truth @@ -52,9 +52,6 @@ Testing toString double(1e100): 1.0e+100 double(-1e100): -1.0e+100 -Testing cerr with QString and with QStringRef - QString - QStringRef ---------------------------------- -- Now testing deprecated class -- @@ -151,7 +148,6 @@ Before Upcase >xxxXXX0< After Upcase >XXXXXX0< Before DownCase >XXXXXX0< After DownCase >xxxxxx0< -Testing QT conversion: 1 255.0 0.333 -255.0 @@ -175,21 +171,3 @@ Element 2: a Element 3: test Element 4: string < - -Qt QStringList values: -String1 -String2 -String3 -String4 - -Converted to std::vector... -String1 -String2 -String3 -String4 -Are they equivalent? -Counts? Yes -string(String1) == QString(String1)? Yes -string(String2) == QString(String2)? Yes -string(String3) == QString(String3)? Yes -string(String4) == QString(String4)? Yes diff --git a/isis/src/core/tests/unitTests/IString/unitTest.cpp b/isis/src/core/tests/unitTests/IString/unitTest.cpp index 1ee2c6bdb9..a952364ebc 100644 --- a/isis/src/core/tests/unitTests/IString/unitTest.cpp +++ b/isis/src/core/tests/unitTests/IString/unitTest.cpp @@ -122,9 +122,6 @@ int main(int argc, char *argv[]) { cerr << "\tdouble(-1e100): " << toString(-1e100) << endl; cerr << endl; - cerr << "Testing cerr with QString and with QStringRef" << endl; - cerr << QString("\tQString\n"); - cerr << QString("\tQStringRef - FAIL!\n").leftRef(11) << endl; cerr << endl; cerr << "----------------------------------" << endl; @@ -315,8 +312,6 @@ int main(int argc, char *argv[]) { cerr << "After DownCase >" << str20.DownCase() << "<" << endl; IString str21 = "Test String"; - QString qstr1 = "Test String"; - cerr << "Testing QT conversion: " << (str21.ToQt() == qstr1) << endl; IString str22(255.0); IString str23(0.333); @@ -373,32 +368,6 @@ int main(int argc, char *argv[]) { cerr << endl << "Element " << i << ": " << strVec[i]; } cerr << endl << "<" << endl; - - QStringList qlist; - qlist << "String1" - << "String2" - << "String3" - << "String4"; - - cerr << "\nQt QStringList values:\n"; - for(int i = 0 ; i < qlist.size() ; i++) { - cerr << qlist.at(i).toLocal8Bit().constData() << endl; - } - - cerr << "\nConverted to std::vector...\n"; - vector slist = IString::ToStd(qlist); - copy(slist.begin(), slist.end(), ostream_iterator(cerr, "\n")); - - cerr << "Are they equivalent?\n"; - cerr << "Counts? " << yesOrNo((int) slist.size() == qlist.size()) << endl; - for(int j = 0 ; j < qlist.size() ; j++) { - QString qs = qlist.at(j); - string ss = slist.at(j); - cerr << "string(" << ss << ") == QString(" - << qs.toLocal8Bit().constData() << ")? " - << yesOrNo(ss == qs.toStdString()) << endl; - } - } catch(IException &error) { error.print(); From e28401c11c3b96ec6a2776759e516fffcd68186f Mon Sep 17 00:00:00 2001 From: acpaquette Date: Tue, 3 Sep 2024 11:49:37 -0700 Subject: [PATCH 59/95] Remove final QString elements from IString --- isis/src/core/include/IString.h | 5 ++--- isis/src/core/src/IString.cpp | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/isis/src/core/include/IString.h b/isis/src/core/include/IString.h index 29d120c608..402b4b5c9c 100644 --- a/isis/src/core/include/IString.h +++ b/isis/src/core/include/IString.h @@ -171,7 +171,6 @@ namespace Isis { IString(const int &num); IString(const double &num, const int piPrecision = 14); IString(const BigInt &num); - IString(const QString &str); ~IString(); @@ -291,8 +290,8 @@ namespace Isis { void SetDouble(const double &value, const int piPrecision = 14); }; - std::ostream &operator<<(std::ostream &os, const QString &string); - std::ostream &operator<<(std::ostream &os, const QStringRef &string); + // std::ostream &operator<<(std::ostream &os, const QString &string); + // std::ostream &operator<<(std::ostream &os, const QStringRef &string); } #endif diff --git a/isis/src/core/src/IString.cpp b/isis/src/core/src/IString.cpp index e4b8209521..6c45b3dcb6 100644 --- a/isis/src/core/src/IString.cpp +++ b/isis/src/core/src/IString.cpp @@ -1323,20 +1323,20 @@ namespace Isis { } - /** - * Print an ASCII representation of the given QString to a stl stream (most commonly cout, cerr). - * - * This is provided for convenience. No extra formatting is done; please see qDebug for a better - * way of printing out debug statements. - * - * @param outputStream The stream to write the string to - * @param string The string to put into the stream - * - * @return The modified output stream - */ - std::ostream &operator<<(std::ostream &outputStream, const QString &string) { - return (outputStream << string.toLatin1().data()); - } + // /** + // * Print an ASCII representation of the given QString to a stl stream (most commonly cout, cerr). + // * + // * This is provided for convenience. No extra formatting is done; please see qDebug for a better + // * way of printing out debug statements. + // * + // * @param outputStream The stream to write the string to + // * @param string The string to put into the stream + // * + // * @return The modified output stream + // */ + // std::ostream &operator<<(std::ostream &outputStream, const QString &string) { + // return (outputStream << string.toLatin1().data()); + // } /** From 6abf3d4def3c04472f6823a19677fc74c34a83ef Mon Sep 17 00:00:00 2001 From: acpaquette Date: Wed, 4 Sep 2024 09:43:58 -0700 Subject: [PATCH 60/95] Initial propogation of IString changes --- isis/src/base/apps/appjit/PixelOffset.cpp | 6 +- isis/src/base/objs/Albedo/Albedo.cpp | 8 +-- .../BulletTargetShape/BulletTargetShape.cpp | 4 +- isis/src/base/objs/Chip/Chip.h | 2 +- .../base/objs/CubeAttribute/CubeAttribute.h | 2 +- .../objs/CubeCalculator/CubeCalculator.cpp | 4 +- isis/src/base/objs/Gruen/Gruen.h | 6 +- isis/src/base/objs/Gruen/GruenTypes.h | 2 +- isis/src/base/objs/Gui/Gui.cpp | 24 +++---- isis/src/base/objs/Gui/GuiEditFile.cpp | 2 +- .../base/objs/OriginalLabel/OriginalLabel.cpp | 2 +- .../ProcessExportPds/ProcessExportPds.cpp | 38 +++++----- isis/src/base/objs/QtExporter/QtExporter.cpp | 8 +-- isis/src/base/objs/QtImporter/QtImporter.cpp | 2 +- .../control/objs/ControlNet/ControlNet.cpp | 18 ++--- .../ControlNetValidMeasure.h | 2 +- .../ControlNetVersioner.cpp | 36 +++++----- isis/src/core/include/IException.h | 10 +-- isis/src/core/src/IException.cpp | 70 +++++++++---------- isis/src/core/src/Preference.cpp | 6 +- .../core/tests/unitTests/Blob/unitTest.cpp | 8 +-- .../core/tests/unitTests/Endian/unitTest.cpp | 4 +- .../tests/unitTests/PvlFormatPds/unitTest.cpp | 8 +-- isis/src/database/objs/DbProfile/DbProfile.h | 4 +- .../objs/JigsawRunWidget/JigsawRunWidget.cpp | 16 ++--- .../ProjectionConfigDialog.cpp | 2 +- isis/src/qisis/objs/TrackTool/TrackTool.cpp | 6 +- 27 files changed, 148 insertions(+), 152 deletions(-) diff --git a/isis/src/base/apps/appjit/PixelOffset.cpp b/isis/src/base/apps/appjit/PixelOffset.cpp index ff1b3ce863..e7859ef150 100644 --- a/isis/src/base/apps/appjit/PixelOffset.cpp +++ b/isis/src/base/apps/appjit/PixelOffset.cpp @@ -63,9 +63,9 @@ namespace Isis { std::string msg = "Three fields are required: sample, line, and ephemeris time."; throw IException(IException::Io, msg, _FILEINFO_); } - p_samples.push_back(toDouble(fields[0])); - p_lines.push_back(toDouble(fields[1])); - p_times.push_back(toDouble(fields[2])); + p_samples.push_back(toDouble(fields[0].toStdString())); + p_lines.push_back(toDouble(fields[1].toStdString())); + p_times.push_back(toDouble(fields[2].toStdString())); } // Compute scalers diff --git a/isis/src/base/objs/Albedo/Albedo.cpp b/isis/src/base/objs/Albedo/Albedo.cpp index e766736eb0..64e11a8f89 100644 --- a/isis/src/base/objs/Albedo/Albedo.cpp +++ b/isis/src/base/objs/Albedo/Albedo.cpp @@ -117,7 +117,7 @@ namespace Isis { */ void Albedo::SetNormPharef(const double pharef) { if(pharef < 0.0 || pharef >= 180.0) { - QString msg = "Invalid value of normalization pharef [" + + std::string msg = "Invalid value of normalization pharef [" + toString(pharef) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -135,7 +135,7 @@ namespace Isis { */ void Albedo::SetNormIncref(const double incref) { if(incref < 0.0 || incref >= 90.0) { - QString msg = "Invalid value of normalization incref [" + + std::string msg = "Invalid value of normalization incref [" + toString(incref) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -153,7 +153,7 @@ namespace Isis { */ void Albedo::SetNormEmaref(const double emaref) { if(emaref < 0.0 || emaref >= 90.0) { - QString msg = "Invalid value of normalization emaref [" + + std::string msg = "Invalid value of normalization emaref [" + toString(emaref) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -168,7 +168,7 @@ namespace Isis { */ void Albedo::SetNormIncmat(const double incmat) { if(incmat < 0.0 || incmat >= 90.0) { - QString msg = "Invalid value of normalization incmat [" + + std::string msg = "Invalid value of normalization incmat [" + toString(incmat) + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/BulletTargetShape/BulletTargetShape.cpp b/isis/src/base/objs/BulletTargetShape/BulletTargetShape.cpp index 32920c2cec..f8f4fffa7c 100644 --- a/isis/src/base/objs/BulletTargetShape/BulletTargetShape.cpp +++ b/isis/src/base/objs/BulletTargetShape/BulletTargetShape.cpp @@ -82,9 +82,9 @@ namespace Isis { * @return @b BulletTargetShape A target shape containing the DEM */ BulletTargetShape *BulletTargetShape::load(const QString &dem, const Pvl *conf) { - FileName v_file(dem); + FileName v_file(dem.toStdString()); - QString ext = v_file.extension().toLower(); + std::string ext = IString::DownCase(v_file.extension()); if ( "bds" == ext) return ( loadDSK(dem) ); if ( "cub" == ext) return ( loadCube(dem) ); diff --git a/isis/src/base/objs/Chip/Chip.h b/isis/src/base/objs/Chip/Chip.h index ee3e5bb77a..c5d34fda94 100644 --- a/isis/src/base/objs/Chip/Chip.h +++ b/isis/src/base/objs/Chip/Chip.h @@ -328,7 +328,7 @@ namespace Isis { return; } // Interpolator::None is not valid type - QString msg = "Invalid Interpolator type. Cannot use ["; + std::string msg = "Invalid Interpolator type. Cannot use ["; msg += toString(type) + "] to read cube into chip."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/CubeAttribute/CubeAttribute.h b/isis/src/base/objs/CubeAttribute/CubeAttribute.h index 28684c4a5a..767f90d1dd 100644 --- a/isis/src/base/objs/CubeAttribute/CubeAttribute.h +++ b/isis/src/base/objs/CubeAttribute/CubeAttribute.h @@ -260,7 +260,7 @@ namespace Isis { * FileName("out.cub+Bsq") */ void setAttributes(const FileName &fileName) { - QStringList attributes = fileName.attributes().split("+", Qt::SkipEmptyParts); + QStringList attributes = QString::fromStdString(fileName.attributes()).split("+", Qt::SkipEmptyParts); m_attributes.clear(); foreach (QString attribute, attributes) diff --git a/isis/src/base/objs/CubeCalculator/CubeCalculator.cpp b/isis/src/base/objs/CubeCalculator/CubeCalculator.cpp index 1b51e276f1..2a2426332b 100644 --- a/isis/src/base/objs/CubeCalculator/CubeCalculator.cpp +++ b/isis/src/base/objs/CubeCalculator/CubeCalculator.cpp @@ -253,7 +253,7 @@ namespace Isis { m_outputSamples = outCube->sampleCount(); - IString eq = equation; + IString eq = equation.toStdString(); while (eq != "") { IString token = eq.Token(" "); @@ -273,7 +273,7 @@ namespace Isis { IString tok(token.substr(1)); int file = tok.ToInteger() - 1; if (file < 0 || file >= (int)inCubes.size()) { - QString msg = "Invalid file number [" + tok.ToQt() + "]"; + QString msg = "Invalid file number [" + QString::fromStdString(tok) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Gruen/Gruen.h b/isis/src/base/objs/Gruen/Gruen.h index 42504513b0..fadb4b190f 100644 --- a/isis/src/base/objs/Gruen/Gruen.h +++ b/isis/src/base/objs/Gruen/Gruen.h @@ -247,9 +247,7 @@ namespace Isis { return (defval); } QString iValue(conf.value(keyname, index)); - IString tmp(iValue); - QString value = tmp.ToQt(); // This makes it work with a string? - return (value); + return iValue; }; /** @@ -278,7 +276,7 @@ namespace Isis { return (defval); } QString iValue(conf.value(keyname, index)); - IString tmp(iValue); + IString tmp(iValue.toStdString()); T value = tmp; // This makes it work with a string? return (value); }; diff --git a/isis/src/base/objs/Gruen/GruenTypes.h b/isis/src/base/objs/Gruen/GruenTypes.h index 5e4394ca7f..1db99ae31f 100644 --- a/isis/src/base/objs/Gruen/GruenTypes.h +++ b/isis/src/base/objs/Gruen/GruenTypes.h @@ -284,7 +284,7 @@ namespace Isis { /** Generate a matrix from the Gruen alpha vector */ void clone(const GVector &alpha) { if ( alpha.dim1() != 8 ) { - QString mess = "Alpha array for AffineRadio must have 8 elements " + std::string mess = "Alpha array for AffineRadio must have 8 elements " " but has " + toString(alpha.dim1()); throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/Gui/Gui.cpp b/isis/src/base/objs/Gui/Gui.cpp index b3c3a9c9f2..7598336b9c 100644 --- a/isis/src/base/objs/Gui/Gui.cpp +++ b/isis/src/base/objs/Gui/Gui.cpp @@ -94,7 +94,7 @@ namespace Isis { setlocale(LC_ALL, "en_US"); QApplication::setQuitOnLastWindowClosed(true); - QApplication::setApplicationName(FileName(argv[0]).baseName()); + QApplication::setApplicationName(QString::fromStdString(FileName(argv[0]).baseName())); // Qt is smart enough to use the style of the system running the program. @@ -307,7 +307,7 @@ namespace Isis { // Create the "Begin/Start Processing" action QAction *Gui::CreateProcessAction() { QAction *processAction = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); processAction->setIcon(QPixmap(baseDir + "/guiRun.png")); processAction->setText("&Run"); processAction->setToolTip("Run"); @@ -394,7 +394,7 @@ namespace Isis { // Create the "Exit" action QAction *Gui::CreateExitAction() { QAction *exitAction = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); exitAction->setIcon(QPixmap(baseDir + "/guiExit.png")); exitAction->setText("&Exit"); exitAction->setToolTip("Exit"); @@ -409,7 +409,7 @@ namespace Isis { // Create the "Reset" action QAction *Gui::CreateResetAction() { QAction *resetAction = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); resetAction->setIcon(QPixmap(baseDir + "/guiReset.png")); resetAction->setText("&Reset"); resetAction->setToolTip("Reset parameters"); @@ -426,7 +426,7 @@ namespace Isis { // Create the "Stop" action QAction *Gui::CreateStopAction() { QAction *stopAction = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); stopAction->setIcon(QPixmap(baseDir + "/guiStop.png")); stopAction->setText("&Stop"); stopAction->setToolTip("Stop"); @@ -443,7 +443,7 @@ namespace Isis { // Create the "SaveLog" action QAction *Gui::CreateSaveLogAction() { QAction *saveLogAction = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); saveLogAction->setIcon(QPixmap(baseDir + "/guiSaveLog.png")); saveLogAction->setText("&Save Log..."); saveLogAction->setToolTip("Save log"); @@ -459,7 +459,7 @@ namespace Isis { // Create the "ClearLog" action QAction *Gui::CreateClearLogAction() { QAction *clearlogAction = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); clearlogAction->setIcon(QPixmap(baseDir + "/guiClearLog.png")); clearlogAction->setText("&Clear Log"); clearlogAction->setToolTip("Clear log"); @@ -476,7 +476,7 @@ namespace Isis { // Create the "Previous History" action QAction *Gui::CreatePreviousHistoryAction() { QAction *previousHistoryAction = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); previousHistoryAction->setIcon(QPixmap(baseDir + "/guiPrevHistory.png")); previousHistoryAction->setText("&Previous"); previousHistoryAction->setToolTip("Previous parameters"); @@ -493,7 +493,7 @@ namespace Isis { // Create the "Next History" action QAction *Gui::CreateNextHistoryAction() { QAction *nextHistoryAction = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); nextHistoryAction->setIcon(QPixmap(baseDir + "/guiNextHistory.png")); nextHistoryAction->setText("&Next"); nextHistoryAction->setToolTip("Next parameters"); @@ -510,7 +510,7 @@ namespace Isis { // Create the Whats Action action QAction *Gui::CreateWhatsThisAction() { QAction *action = new QAction(this); - QString baseDir = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString baseDir = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); action->setIcon(QPixmap(baseDir + "/contexthelp.png")); action->setText("&What's This"); action->setToolTip("What's This"); @@ -716,7 +716,7 @@ namespace Isis { Preference &p = Preference::Preferences(); PvlGroup &grp = p.findGroup("UserInterface", Isis::Pvl::Traverse); - Isis::FileName progHist(QString::fromStdString(grp["HistoryPath"][0]) + "/" + ui.ProgramName() + ".par"); + Isis::FileName progHist(grp["HistoryPath"][0] + "/" + ui.ProgramName() + ".par"); if(!progHist.fileExists()) { p_historyEntry = -1; @@ -731,7 +731,7 @@ namespace Isis { } catch(...) { p_historyEntry = -1; - QString msg = "A corrupt parameter history file [" + progHist.expanded() + + QString msg = "A corrupt parameter history file [" + QString::fromStdString(progHist.expanded()) + "] has been detected. Please fix or remove this file"; LoadMessage(msg); // When the warning is rejected (i.e. Abort), clean up from within qApp's exec event loop diff --git a/isis/src/base/objs/Gui/GuiEditFile.cpp b/isis/src/base/objs/Gui/GuiEditFile.cpp index f6a4281015..ccb6091b46 100644 --- a/isis/src/base/objs/Gui/GuiEditFile.cpp +++ b/isis/src/base/objs/Gui/GuiEditFile.cpp @@ -342,7 +342,7 @@ namespace Isis { * @param psfile - current file */ void GuiEditFile::windowTitle(QString & psfile) { - m_editWin->setWindowTitle(FileName(psfile).name()); + m_editWin->setWindowTitle(QString::fromStdString(FileName(psfile.toStdString()).name())); } } diff --git a/isis/src/base/objs/OriginalLabel/OriginalLabel.cpp b/isis/src/base/objs/OriginalLabel/OriginalLabel.cpp index 3e16d330b3..d2a37dfba8 100644 --- a/isis/src/base/objs/OriginalLabel/OriginalLabel.cpp +++ b/isis/src/base/objs/OriginalLabel/OriginalLabel.cpp @@ -37,7 +37,7 @@ namespace Isis { */ OriginalLabel::OriginalLabel(const QString &file){ Blob blob = Blob("IsisCube", "OriginalLabel"); - blob.Read(file); + blob.Read(file.toStdString()); fromBlob(blob); } diff --git a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp index 328152285e..0eac23c27f 100644 --- a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp +++ b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp @@ -218,8 +218,8 @@ namespace Isis { else { sImageFile += ".img"; } - FileName outFile(sImageFile); - mainPvl += PvlKeyword("^IMAGE", outFile.name().toStdString()); + FileName outFile(sImageFile.toStdString()); + mainPvl += PvlKeyword("^IMAGE", outFile.name()); } else { mainPvl += PvlKeyword("^IMAGE", "???????", "BYTES"); @@ -254,15 +254,15 @@ namespace Isis { QString msg = "Labels must be detached for JP2 files."; throw IException(IException::Programmer, msg, _FILEINFO_); } - FileName outFile(sImageFile); + FileName outFile(sImageFile.toStdString()); PvlObject cmpObj("COMPRESSED_FILE"); - cmpObj += PvlKeyword("FILE_NAME", outFile.name().toStdString()); + cmpObj += PvlKeyword("FILE_NAME", outFile.name()); cmpObj += PvlKeyword("RECORD_TYPE", "UNDEFINED"); cmpObj += PvlKeyword("ENCODING_TYPE", "JP2"); cmpObj += PvlKeyword("ENCODING_TYPE_VERSION_NAME", "ISO/IEC15444-1:2004"); cmpObj += PvlKeyword("INTERCHANGE_FORMAT", "BINARY"); - FileName infilename(InputCubes[0]->fileName()); - cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name().toStdString()); + FileName infilename(InputCubes[0]->fileName().toStdString()); + cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name()); int storagebytes = InputCubes[0]->sampleCount() * InputCubes[0]->lineCount(); if(p_pixelType == Isis::Real) { QString msg = "JPEG2000 does not support floating point data."; @@ -274,7 +274,7 @@ namespace Isis { cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", std::to_string(storagebytes)); mainPvl.addObject(cmpObj); PvlObject ucmpObj("UNCOMPRESSED_FILE"); - ucmpObj += PvlKeyword("FILE_NAME", infilename.name().toStdString()); + ucmpObj += PvlKeyword("FILE_NAME", infilename.name()); ucmpObj += PvlKeyword("RECORD_TYPE", "FIXED_LENGTH"); int recordbytes = InputCubes[0]->sampleCount(); if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { @@ -282,7 +282,7 @@ namespace Isis { } ucmpObj += PvlKeyword("RECORD_BYTES", std::to_string(recordbytes)); ucmpObj += PvlKeyword("FILE_RECORDS", std::to_string(InputCubes[0]->lineCount())); - ucmpObj += PvlKeyword("^IMAGE", infilename.name().toStdString()); + ucmpObj += PvlKeyword("^IMAGE", infilename.name()); mainPvl.addObject(ucmpObj); } @@ -310,8 +310,8 @@ namespace Isis { else { sImageFile += ".img"; } - FileName outFile(sImageFile); - mainPvl += PvlKeyword("^IMAGE", outFile.name().toStdString()); + FileName outFile(sImageFile.toStdString()); + mainPvl += PvlKeyword("^IMAGE", outFile.name()); } else { mainPvl += PvlKeyword("^IMAGE", "???"); @@ -345,15 +345,15 @@ namespace Isis { QString msg = "Labels must be detached for JP2 files."; throw IException(IException::Programmer, msg, _FILEINFO_); } - FileName outFile(sImageFile); + FileName outFile(sImageFile.toStdString()); PvlObject cmpObj("COMPRESSED_FILE"); - cmpObj += PvlKeyword("FILE_NAME", outFile.name().toStdString()); + cmpObj += PvlKeyword("FILE_NAME", outFile.name()); cmpObj += PvlKeyword("RECORD_TYPE", "UNDEFINED"); cmpObj += PvlKeyword("ENCODING_TYPE", "JP2"); cmpObj += PvlKeyword("ENCODING_TYPE_VERSION_NAME", "ISO/IEC15444-1:2004"); cmpObj += PvlKeyword("INTERCHANGE_FORMAT", "BINARY"); - FileName infilename(InputCubes[0]->fileName()); - cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name().toStdString()); + FileName infilename(InputCubes[0]->fileName().toStdString()); + cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name()); int storagebytes = InputCubes[0]->sampleCount() * InputCubes[0]->lineCount(); if(p_pixelType == Isis::Real) { QString msg = "JPEG2000 does not support floating point data."; @@ -365,7 +365,7 @@ namespace Isis { cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", std::to_string(storagebytes)); mainPvl.addObject(cmpObj); PvlObject ucmpObj("UNCOMPRESSED_FILE"); - ucmpObj += PvlKeyword("FILE_NAME", infilename.name().toStdString()); + ucmpObj += PvlKeyword("FILE_NAME", infilename.name()); ucmpObj += PvlKeyword("RECORD_TYPE", "FIXED_LENGTH"); int recordbytes = InputCubes[0]->sampleCount(); if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { @@ -373,7 +373,7 @@ namespace Isis { } ucmpObj += PvlKeyword("RECORD_BYTES", std::to_string(recordbytes)); ucmpObj += PvlKeyword("FILE_RECORDS", std::to_string(InputCubes[0]->lineCount())); - ucmpObj += PvlKeyword("^IMAGE", infilename.name().toStdString()); + ucmpObj += PvlKeyword("^IMAGE", infilename.name()); mainPvl.addObject(ucmpObj); } @@ -394,7 +394,7 @@ namespace Isis { Pvl *inputLabel = InputCubes[0]->label(); FileName transfile; transfile = "$ISISROOT/appdata/translations/pdsExportImageImage.trn"; - PvlToPvlTranslationManager Xlator(*inputLabel, transfile.expanded()); + PvlToPvlTranslationManager Xlator(*inputLabel, QString::fromStdString(transfile.expanded())); Xlator.Auto(mainPvl); // Calculate the core base/mult for this cube @@ -538,7 +538,7 @@ namespace Isis { Pvl *inputLabel = InputCubes[0]->label(); FileName transfile; transfile = "$ISISROOT/appdata/translations/pdsExportImageJP2.trn"; - PvlToPvlTranslationManager Xlator(*inputLabel, transfile.expanded()); + PvlToPvlTranslationManager Xlator(*inputLabel, QString::fromStdString(transfile.expanded())); Xlator.Auto(mainPvl); // Calculate the core base/mult for this cube @@ -1038,7 +1038,7 @@ namespace Isis { } else { mainPvl += PvlKeyword("^" + pdsTableName.toStdString(), detachedPdsTableFileName.toStdString()); - FileName labelFile(m_detachedPdsLabelFile); + FileName labelFile(m_detachedPdsLabelFile.toStdString()); QString tableFileWithPath = labelFile.path() + "/" + detachedPdsTableFileName; ofstream os(tableFileWithPath.toLatin1().data()); diff --git a/isis/src/base/objs/QtExporter/QtExporter.cpp b/isis/src/base/objs/QtExporter/QtExporter.cpp index 400cb2c2b9..3a33143ac7 100644 --- a/isis/src/base/objs/QtExporter/QtExporter.cpp +++ b/isis/src/base/objs/QtExporter/QtExporter.cpp @@ -205,10 +205,10 @@ namespace Isis { // The return status is wrong for JPEG images, so the code will always // continue - if (!m_qimage->save(outputName.expanded(), m_format.toLatin1().data(), + if (!m_qimage->save(QString::fromStdString(outputName.expanded()), m_format.toLatin1().data(), quality)) { - QString err = "Unable to save [" + outputName.expanded() + + std::string err = "Unable to save [" + outputName.expanded() + "] to the disk"; throw IException(IException::Programmer, err, _FILEINFO_); } @@ -229,8 +229,8 @@ namespace Isis { BigInt size = samples * lines * bands; if (size >= maxSize) { - QString gigaBytes = toString(size / (1024.0 * 1024.0 * 1024.0)); - QString msg = "Cube exceeds max size of 2GB. Qimage cannot support "; + std::string gigaBytes = toString(size / (1024.0 * 1024.0 * 1024.0)); + std::string msg = "Cube exceeds max size of 2GB. Qimage cannot support "; msg += "that much raw data. Your cube is " + gigaBytes + " GB."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/QtImporter/QtImporter.cpp b/isis/src/base/objs/QtImporter/QtImporter.cpp index 12675ded00..7d77779b6e 100644 --- a/isis/src/base/objs/QtImporter/QtImporter.cpp +++ b/isis/src/base/objs/QtImporter/QtImporter.cpp @@ -24,7 +24,7 @@ namespace Isis { QtImporter::QtImporter(FileName inputName) : ImageImporter(inputName) { m_qimage = NULL; - m_qimage = new QImage(inputName.expanded()); + m_qimage = new QImage(QString::fromStdString(inputName.expanded())); if (m_qimage->isNull()) { throw IException(IException::User, "The file [" + inputName.expanded() + diff --git a/isis/src/control/objs/ControlNet/ControlNet.cpp b/isis/src/control/objs/ControlNet/ControlNet.cpp index 8d0e84b544..21a56a6698 100644 --- a/isis/src/control/objs/ControlNet/ControlNet.cpp +++ b/isis/src/control/objs/ControlNet/ControlNet.cpp @@ -268,7 +268,7 @@ namespace Isis { */ void ControlNet::ReadControl(const QString &filename, Progress *progress) { - FileName cnetFileName(filename); + FileName cnetFileName(filename.toStdString()); ControlNetVersioner versionedReader(cnetFileName, progress); SetTarget( versionedReader.targetName() ); p_networkId = versionedReader.netId(); @@ -329,7 +329,7 @@ namespace Isis { } else { try { - versionedWriter.write(FileName(ptfile)); + versionedWriter.write(QString::fromStdString((FileName(ptfile).toString()))); } catch (IException &e) { QString msg = "Failed writing control network to file [" + ptfile + "]"; @@ -544,7 +544,7 @@ namespace Isis { m_controlGraph); QString edgeStrength = "UNKNOWN"; if (result.second) { - edgeStrength = toString(m_controlGraph[result.first].strength); + edgeStrength = QString::fromStdString(toString(m_controlGraph[result.first].strength)); } graphString.append(imageSerial); @@ -894,7 +894,7 @@ namespace Isis { */ int ControlNet::DeletePoint(QString pointId) { if (!points->contains(pointId)) { - IString msg = "point Id [" + pointId + "] does not exist in the network"; + std::string msg = "point Id [" + pointId.toStdString() + "] does not exist in the network"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1060,7 +1060,7 @@ namespace Isis { */ QList< ControlMeasure * > ControlNet::GetMeasuresInCube(QString serialNumber) { if( !ValidateSerialNumber(serialNumber) ) { - IString msg = "Cube Serial Number [" + serialNumber + "] not found in " + std::string msg = "Cube Serial Number [" + serialNumber.toStdString() + "] not found in " "the network"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1822,8 +1822,8 @@ namespace Isis { const ControlPoint *ControlNet::GetPoint(QString id) const { if (!points->contains(id)) { - IString msg = "The control network has no control points with an ID " - "equal to [" + id + "]"; + std::string msg = "The control network has no control points with an ID " + "equal to [" + id.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1833,8 +1833,8 @@ namespace Isis { ControlPoint *ControlNet::GetPoint(QString id) { if (!points->contains(id)) { - IString msg = "The control network has no control points with an ID " - "equal to [" + id + "]"; + std::string msg = "The control network has no control points with an ID " + "equal to [" + id.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.h b/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.h index 4da11e7cc6..57a8443e0a 100644 --- a/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.h +++ b/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.h @@ -170,7 +170,7 @@ namespace Isis { //! API to display location in the form "Sample,Line" QString LocationString(double pdSample, double pdLine) const { - return toString((int)pdSample) + "," + toString((int)pdLine); + return QString::fromStdString(toString((int)pdSample) + "," + toString((int)pdLine)); }; //! Test for a point to be user defined number of pixels from the edge diff --git a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp index 470ec4aff2..2291dc8d1c 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp @@ -344,14 +344,14 @@ namespace Isis { && aprioriSurfacePoint.GetLonSigmaDistance().meters() != Isis::Null && aprioriSurfacePoint.GetLocalRadiusSigma().meters() != Isis::Null ) { - QString sigmas = "AprioriLatitudeSigma = " + std::string sigmas = "AprioriLatitudeSigma = " + toString(aprioriSurfacePoint.GetLatSigmaDistance().meters()) + " AprioriLongitudeSigma = " + toString(aprioriSurfacePoint.GetLonSigmaDistance().meters()) + " AprioriRadiusSigma = " + toString(aprioriSurfacePoint.GetLocalRadiusSigma().meters()) + " "; - matrix.addComment(sigmas.toStdString()); + matrix.addComment(sigmas); } // If the covariance matrix has a value, add it to the PVL point. @@ -422,7 +422,7 @@ namespace Isis { && adjustedSurfacePoint.GetLonSigmaDistance().meters() != Isis::Null && adjustedSurfacePoint.GetLocalRadiusSigma().meters() != Isis::Null ) { - QString sigmas = "AdjustedLatitudeSigma = " + std::string sigmas = "AdjustedLatitudeSigma = " + toString(adjustedSurfacePoint.GetLatSigmaDistance().meters()) + " AdjustedLongitudeSigma = " + toString(adjustedSurfacePoint.GetLonSigmaDistance().meters()) @@ -430,7 +430,7 @@ namespace Isis { + toString(adjustedSurfacePoint.GetLocalRadiusSigma().meters()) + " "; - matrix.addComment(sigmas.toStdString()); + matrix.addComment(sigmas); } // If the covariance matrix has a value, add it to the PVL point. if ( adjustedCovarianceMatrix(0, 0) != 0.0 @@ -553,7 +553,7 @@ namespace Isis { void ControlNetVersioner::read(const FileName netFile, Progress *progress) { try { - const Pvl &network(netFile.expanded().toStdString()); + const Pvl &network(netFile.expanded()); if ( network.hasObject("ProtoBuffer") ) { readProtobuf(network, netFile, progress); @@ -567,7 +567,7 @@ namespace Isis { } } catch (IException &e) { - std::string msg = "Reading the control network [" + netFile.name().toStdString() + std::string msg = "Reading the control network [" + netFile.name() + "] failed"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -920,9 +920,9 @@ namespace Isis { BigInt coreStartPos = protoBufferCore["StartByte"]; BigInt coreLength = protoBufferCore["Bytes"]; - fstream input(netFile.expanded().toLatin1().data(), ios::in | ios::binary); + fstream input(netFile.expanded(), ios::in | ios::binary); if ( !input.is_open() ) { - std::string msg = "Failed to open protobuf file [" + netFile.name().toStdString() + "]."; + std::string msg = "Failed to open protobuf file [" + netFile.name() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -937,7 +937,7 @@ namespace Isis { ControlNetFileProtoV0001 protoNet; try { if ( !protoNet.ParseFromCodedStream(&codedInStream) ) { - std::string msg = "Failed to read input PB file [" + netFile.name().toStdString() + "]."; + std::string msg = "Failed to read input PB file [" + netFile.name() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -966,7 +966,7 @@ namespace Isis { ControlNetLogDataProtoV0001 protoLogData; try { if ( !protoLogData.ParseFromCodedStream(&codedLogInStream) ) { - std::string msg = "Failed to read log data in protobuf file [" + netFile.name().toStdString() + "]."; + std::string msg = "Failed to read log data in protobuf file [" + netFile.name() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1046,7 +1046,7 @@ namespace Isis { fstream input(netFile.expanded().toLatin1().data(), ios::in | ios::binary); if ( !input.is_open() ) { - std::string msg = "Failed to open control network file" + netFile.name().toStdString(); + std::string msg = "Failed to open control network file" + netFile.name(); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1062,7 +1062,7 @@ namespace Isis { CodedInputStream::Limit oldLimit = headerCodedInStream.PushLimit(headerLength); if ( !protoHeader.ParseFromCodedStream(&headerCodedInStream) ) { std::string msg = "Failed to parse protobuf header from input control net file [" - + netFile.name().toStdString() + "]"; + + netFile.name() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } headerCodedInStream.PopLimit(oldLimit); @@ -1097,7 +1097,7 @@ namespace Isis { // read each protobuf control point and then initialize it // For some reason, reading the header causes the input stream to fail so reopen the file input.close(); - input.open(netFile.expanded().toLatin1().data(), ios::in | ios::binary); + input.open(netFile.expanded(), ios::in | ios::binary); input.seekg(filePos, ios::beg); IstreamInputStream pointInStream(&input); int numPoints = protoHeader.pointmessagesizes_size(); @@ -1163,9 +1163,9 @@ namespace Isis { BigInt headerLength = protoBufferCore["HeaderBytes"]; BigInt pointsLength = protoBufferCore["PointsBytes"]; - fstream input(netFile.expanded().toLatin1().data(), ios::in | ios::binary); + fstream input(netFile.expanded(), ios::in | ios::binary); if ( !input.is_open() ) { - std::string msg = "Failed to open control network file" + netFile.name().toStdString(); + std::string msg = "Failed to open control network file" + netFile.name(); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1186,7 +1186,7 @@ namespace Isis { if ( !protoHeader.ParseFromCodedStream(&headerCodedInStream) ) { std::string msg = "Failed to parse protobuf header from input control net file [" - + netFile.name().toStdString()+ "]"; + + netFile.name()+ "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1222,7 +1222,7 @@ namespace Isis { // read each protobuf control point and then initialize it // For some reason, reading the header causes the input stream to fail so reopen the file input.close(); - input.open(netFile.expanded().toLatin1().data(), ios::in | ios::binary); + input.open(netFile.expanded(), ios::in | ios::binary); input.seekg(filePos, ios::beg); IstreamInputStream pointInStream(&input); @@ -1658,7 +1658,7 @@ namespace Isis { try { const int labelBytes = 65536; - fstream output(netFile.expanded().toLatin1().data(), ios::out | ios::trunc | ios::binary); + fstream output(netFile.expanded(), ios::out | ios::trunc | ios::binary); char *blankLabel = new char[labelBytes]; memset(blankLabel, 0, labelBytes); output.write(blankLabel, labelBytes); diff --git a/isis/src/core/include/IException.h b/isis/src/core/include/IException.h index 91b1fcfd36..7a11dc9781 100644 --- a/isis/src/core/include/IException.h +++ b/isis/src/core/include/IException.h @@ -187,12 +187,12 @@ namespace Isis { void append(const IException &exceptionSource); ErrorType errorType() const; - static QString errorTypeToString(ErrorType t); + static std::string errorTypeToString(ErrorType t); void print() const; void print(bool printFileInfo) const; Pvl toPvl() const; - QString toString() const; - QString toString(bool printFileInfo) const; + std::string toString() const; + std::string toString(bool printFileInfo) const; void swap(IException &other); IException &operator=(const IException &rhs); @@ -222,12 +222,12 @@ namespace Isis { * The message associated with this exception. This will be NULL if the * message is empty (or only contained whitespace). */ - QString * m_message; + std::string * m_message; /** * The source code file that threw this exception. */ - QString * m_fileName; + std::string * m_fileName; /** * The line in the source code file that threw this exception. diff --git a/isis/src/core/src/IException.cpp b/isis/src/core/src/IException.cpp index 51225830b6..aaad235245 100644 --- a/isis/src/core/src/IException.cpp +++ b/isis/src/core/src/IException.cpp @@ -74,8 +74,8 @@ namespace Isis { m_previousExceptions = NULL; m_errorType = type; - m_message = new QString(QString(message).trimmed()); - m_fileName = new QString(fileName); + m_message = new std::string(message.trimmed().toStdString()); + m_fileName = new std::string(fileName); m_lineNumber = lineNumber; deleteEmptyMemberStrings(); @@ -112,8 +112,8 @@ namespace Isis { m_previousExceptions = NULL; m_errorType = type; - m_message = new QString(QString(message).trimmed()); - m_fileName = new QString(fileName); + m_message = new std::string(IString(message).Trim("\t\n\v\f\r ")); + m_fileName = new std::string(fileName); m_lineNumber = lineNumber; deleteEmptyMemberStrings(); @@ -150,8 +150,8 @@ namespace Isis { m_previousExceptions = NULL; m_errorType = type; - m_message = new QString(QString(message.c_str()).trimmed()); - m_fileName = new QString(fileName); + m_message = new std::string(IString(message).Trim("\t\n\v\f\r ")); + m_fileName = new std::string(fileName); m_lineNumber = lineNumber; deleteEmptyMemberStrings(); @@ -199,8 +199,8 @@ namespace Isis { m_previousExceptions = NULL; m_errorType = type; - m_message = new QString(QString(message).trimmed()); - m_fileName = new QString(fileName); + m_message = new std::string(IString(message).Trim("\t\n\v\f\r ")); + m_fileName = new std::string(fileName); m_lineNumber = lineNumber; deleteEmptyMemberStrings(); @@ -247,8 +247,8 @@ namespace Isis { m_previousExceptions = NULL; m_errorType = type; - m_message = new QString(QString(message.c_str()).trimmed()); - m_fileName = new QString(fileName); + m_message = new std::string(IString(message).Trim("\t\n\v\f\r ")); + m_fileName = new std::string(fileName); m_lineNumber = lineNumber; deleteEmptyMemberStrings(); @@ -294,8 +294,8 @@ namespace Isis { m_previousExceptions = NULL; m_errorType = type; - m_message = new QString(message.trimmed()); - m_fileName = new QString(fileName); + m_message = new std::string(message.trimmed().toStdString()); + m_fileName = new std::string(fileName); m_lineNumber = lineNumber; deleteEmptyMemberStrings(); @@ -326,11 +326,11 @@ namespace Isis { } if (other.m_message) { - m_message = new QString(*other.m_message); + m_message = new std::string(*other.m_message); } if (other.m_fileName) { - m_fileName = new QString(*other.m_fileName); + m_fileName = new std::string(*other.m_fileName); } if (other.m_previousExceptions) { @@ -440,9 +440,9 @@ namespace Isis { * exceptions thrown by your class. */ void IException::print() const { - QString errorString = toString(); + std::string errorString = toString(); if (errorString != "") - cerr << errorString.toLatin1().data() << endl; + cerr << errorString << endl; } @@ -456,9 +456,9 @@ namespace Isis { * user's preferences file regarding file info. */ void IException::print(bool printFileInfo) const { - QString errorString = toString(printFileInfo); + std::string errorString = toString(printFileInfo); if (errorString != "") - cerr << errorString.toLatin1().data() << endl; + cerr << errorString << endl; } @@ -489,7 +489,7 @@ namespace Isis { if (exception.m_errorType != Unknown) { errGroup += PvlKeyword("Class", - errorTypeToString(exception.m_errorType).toStdString()); + errorTypeToString(exception.m_errorType)); exceptionIsBlank = false; } @@ -497,16 +497,16 @@ namespace Isis { if (exception.m_message) { exceptionIsBlank = false; - QString message(*exception.m_message); + std::string message(*exception.m_message); if (message.size() && message[message.size() - 1] == '.') - message = message.mid(0, message.size() - 1); - errGroup += PvlKeyword("Message", message.toStdString()); + message = message.substr(0, message.size() - 1); + errGroup += PvlKeyword("Message", message); } if (exception.m_fileName) { exceptionIsBlank = false; - errGroup += PvlKeyword("File", exception.m_fileName->toStdString()); + errGroup += PvlKeyword("File", *exception.m_fileName); if (exception.m_lineNumber != -1) errGroup += PvlKeyword("Line", std::to_string(exception.m_lineNumber)); @@ -529,7 +529,7 @@ namespace Isis { * * @return a string representation of this exception */ - QString IException::toString() const { + std::string IException::toString() const { return toString(Preference::Preferences().reportFileLine()); } @@ -545,8 +545,8 @@ namespace Isis { * the user's preferences file regarding file info. * @return a string representation of this exception */ - QString IException::toString(bool includeFileInfo) const { - QString result; + std::string IException::toString(bool includeFileInfo) const { + std::string result; if (Preference::Preferences().outputErrorAsPvl()) { Pvl errors = toPvl(); @@ -554,7 +554,7 @@ namespace Isis { if (errors.groups() != 0) { stringstream stringStream; stringStream << errors; - result = stringStream.str().c_str(); + result = stringStream.str(); } } else { @@ -577,10 +577,10 @@ namespace Isis { bool needsPeriod = false; if (exception.m_message) { - QString message(*exception.m_message); + std::string message(*exception.m_message); if (message.size() && message[message.size() - 1] == '.') - message = message.mid(0, message.size() - 1); + message = message.substr(0, message.size() - 1); // There is always a **TYPE** already in the string, so prefix the // message with a space. result += " " + message; @@ -590,7 +590,7 @@ namespace Isis { if(includeFileInfo && exception.m_fileName) { result += " in " + *exception.m_fileName; if (exception.m_lineNumber != -1) - result += " at " + QString(Isis::toString(exception.m_lineNumber).c_str()); + result += " at " + Isis::toString(exception.m_lineNumber); needsPeriod = true; } @@ -602,7 +602,7 @@ namespace Isis { } } - return result.trimmed(); + return IString(result).Trim("\t\n\v\f\r "); } @@ -644,8 +644,8 @@ namespace Isis { * @return a string representation of the error type. For example, * "USER ERROR" if the error type is User */ - QString IException::errorTypeToString(ErrorType type) { - QString result; + std::string IException::errorTypeToString(ErrorType type) { + std::string result; switch(type) { case User: @@ -697,10 +697,10 @@ namespace Isis { * @return a C string representation of this exception */ char *IException::buildWhat() const { - QString whatStr = toString(); + std::string whatStr = toString(); char *result = new char[whatStr.size() + 1]; - strncpy(result, whatStr.toLatin1().data(), whatStr.size()); + strncpy(result, whatStr.c_str(), whatStr.size()); result[whatStr.size()] = '\0'; return result; diff --git a/isis/src/core/src/Preference.cpp b/isis/src/core/src/Preference.cpp index 5a35163da1..6559053a85 100644 --- a/isis/src/core/src/Preference.cpp +++ b/isis/src/core/src/Preference.cpp @@ -9,7 +9,6 @@ find files of those names at the top level of this repository. **/ #include #include -#include #include #include "Preference.h" @@ -91,9 +90,8 @@ namespace Isis { // Make sure the user has a .Isis directory Isis::FileName setup("$HOME/.Isis"); if(!setup.fileExists()) { - QDir dir; - QString dirName(setup.expanded()); - dir.mkdir(dirName); + std::string dirName(setup.expanded()); + std::filesystem::create_directories(dirName); } // If its a unitTest then load with the unitTest preference file diff --git a/isis/src/core/tests/unitTests/Blob/unitTest.cpp b/isis/src/core/tests/unitTests/Blob/unitTest.cpp index 56113ace38..1d3db7b3b5 100644 --- a/isis/src/core/tests/unitTests/Blob/unitTest.cpp +++ b/isis/src/core/tests/unitTests/Blob/unitTest.cpp @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { char buf[] = {"ABCD"}; b.MyBuf(buf, 4); b.Write("junk"); - cout << "Name = " << b.Name() << endl; + cout << "Name = " << b.Name().toStdString() << endl; cout << "Number of Bytes = " << b.Size() << endl; cout << "StartByte = " << b.StartByte() << endl; cout << "Type = " << b.Type() << endl; @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) { char buf2[5]; c.GetBuf(buf2); buf2[4] = 0; - cout << "Name = " << c.Name() << endl; + cout << "Name = " << c.Name().toStdString() << endl; cout << "Number of Bytes = " << c.Size() << endl; cout << "StartByte = " << c.StartByte() << endl; cout << "Type = " << c.Type() << endl; @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) { c.Write(pvl, strm); strm.seekp(0, std::ios::beg); strm << pvl; - cout << "Name = " << c.Name() << endl; + cout << "Name = " << c.Name().toStdString() << endl; cout << "Number of Bytes = " << c.Size() << endl; cout << "StartByte = " << c.StartByte() << endl; cout << "Type = " << c.Type() << endl; @@ -83,7 +83,7 @@ int main(int argc, char *argv[]) { c.Write(pvl2, strm2); strm2.seekp(0, std::ios::beg); strm2 << pvl2; - cout << "Name = " << c.Name() << endl; + cout << "Name = " << c.Name().toStdString() << endl; cout << "Number of Bytes = " << c.Size() << endl; cout << "StartByte = " << c.StartByte() << endl; cout << "Type = " << c.Type() << endl; diff --git a/isis/src/core/tests/unitTests/Endian/unitTest.cpp b/isis/src/core/tests/unitTests/Endian/unitTest.cpp index 8da2eb26fd..443fd66064 100644 --- a/isis/src/core/tests/unitTests/Endian/unitTest.cpp +++ b/isis/src/core/tests/unitTests/Endian/unitTest.cpp @@ -35,6 +35,6 @@ int main(int argc, char *argv[]) { cout << IsLsb() << endl; } - cout << ByteOrderName(ByteOrderEnumeration("msb")) << endl; - cout << ByteOrderName(ByteOrderEnumeration("lsb")) << endl; + cout << ByteOrderName(ByteOrderEnumeration("msb")).toStdString() << endl; + cout << ByteOrderName(ByteOrderEnumeration("lsb")).toStdString() << endl; } diff --git a/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp b/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp index 4840e96154..f003fa515b 100644 --- a/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp +++ b/isis/src/core/tests/unitTests/PvlFormatPds/unitTest.cpp @@ -31,10 +31,10 @@ int main() { // Create a temp file for the keyword to type map { FileName fname = FileName::createTempFile("tempPvlFormatPDSunitTest_.tmp"); - QString pdsFile = fname.expanded(); + std::string pdsFile = fname.expanded(); ofstream out; - out.open(pdsFile.toLatin1().data(), std::ios::out); + out.open(pdsFile, std::ios::out); { PvlKeyword key("skey", "string"); @@ -110,8 +110,8 @@ int main() { out.close(); - pdsFormatter = new PvlFormatPds(pdsFile.toStdString()); - QFile::remove(pdsFile); + pdsFormatter = new PvlFormatPds(pdsFile); + std::remove(pdsFile); } // Test Keywords diff --git a/isis/src/database/objs/DbProfile/DbProfile.h b/isis/src/database/objs/DbProfile/DbProfile.h index 4e07cc9507..05c0f05c61 100644 --- a/isis/src/database/objs/DbProfile/DbProfile.h +++ b/isis/src/database/objs/DbProfile/DbProfile.h @@ -113,7 +113,7 @@ namespace Isis { * @return bool True if it exists, false if it doesn't */ bool exists(const QString &key) const { - return (_keys.exists(key)); + return (_keys.exists(key.toStdString())); } // Convenience methods for adding keys @@ -139,7 +139,7 @@ namespace Isis { * @throws Out-of-range exception if the nth keyword does not exist */ QString key(int nth) const { - return (_keys.key(nth).ToQt()); + return (QString::fromStdString(_keys.key(nth))); } QString value(const QString &key, int nth = 0) const; QString operator()(const QString &key, int nth = 0) const; diff --git a/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.cpp b/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.cpp index 6d79119def..70bef88229 100644 --- a/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.cpp +++ b/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.cpp @@ -63,7 +63,7 @@ namespace Isis { m_project = project; m_bundleSettings = bundleSettings; m_selectedControl = selectedControl; - m_selectedControlName = FileName(selectedControl->fileName()).name(); + m_selectedControlName = FileName(selectedControl->fileName().toStdString()).name(); m_outputControlName = outputControlFileName; m_bundleThread = NULL; init(); @@ -195,7 +195,7 @@ namespace Isis { // Grab the control name that was used in that bundle adjustment. m_selectedControlName - = FileName(bundleSolutionInfo.last()->inputControlNetFileName()).name(); + = FileName(bundleSolutionInfo.last()->inputControlNetFileName().toStdString()).name(); } // Clear the dialog displays. @@ -296,13 +296,13 @@ namespace Isis { FileName outputControlName; if (!m_outputControlName.isEmpty()) { outputControlName - = FileName(m_project->bundleSolutionInfoRoot() + "/" + runTime + "/" + + = FileName(m_project->bundleSolutionInfoRoot().toStdString() + "/" + runTime + "/" + m_outputControlName); } else { outputControlName - = FileName(m_project->bundleSolutionInfoRoot() + "/" + runTime + "/Out-" + runTime + "-" + - FileName(m_bundleSolutionInfo->inputControlNetFileName()).name()); + = FileName(m_project->bundleSolutionInfoRoot().toStdString() + "/" + runTime + "/Out-" + runTime + "-" + + FileName(m_bundleSolutionInfo->inputControlNetFileName().toStdString()).name()); } // Write output control net with correct path to results folder + runtime @@ -321,7 +321,7 @@ namespace Isis { // Now, we iterate through each image in the current image list ("import"), and we determine // the location of the image and where to copy it to (as an ecub). foreach (Image *image, *imageList) { - FileName original(image->fileName()); + FileName original(image->fileName().toStdString()); // Update our list of tracked file names for the images we are going to copy. imagesToCopy.append(original.expanded()); } @@ -439,13 +439,13 @@ namespace Isis { if (importCube.externalCubeFileName().path() == ".") { QDir relative(m_destinationFolder.absolutePath()); - dnCubeFileName = FileName(QDir(image.path()).canonicalPath() + "/" + importCube.externalCubeFileName().name()); + dnCubeFileName = FileName(QDir(image.path()).canonicalPath().toStdString() + "/" + importCube.externalCubeFileName().name()); QString s = relative.relativeFilePath(dnCubeFileName.toString()); // Locate the DnFile cube by using the input image's (ecub) path and the DnFile name (cub) //dnCubeFileName = FileName(image.path() + "/" + importCube.externalCubeFileName().name()); // WHY DO WE NEED TO USE QDIR canonical path? why is the image.path relative and not abs? //dnCubeFileName = FileName(s); - dnCubeFileName = FileName(QDir(image.path()).canonicalPath() + "/" + + dnCubeFileName = FileName(QDir(image.path()).canonicalPath().toStdString() + "/" + importCube.externalCubeFileName().name()); Cube dnCube(dnCubeFileName, "r"); diff --git a/isis/src/qisis/objs/MosaicSceneWidget/ProjectionConfigDialog.cpp b/isis/src/qisis/objs/MosaicSceneWidget/ProjectionConfigDialog.cpp index 57388ead17..8583bcf621 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/ProjectionConfigDialog.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/ProjectionConfigDialog.cpp @@ -297,7 +297,7 @@ namespace Isis { catch (IException &e) { QMessageBox::warning(this, tr("Failed to Load Map File"), tr("Failed to load projection from the given file.\n") + - e.toString()); + QString::fromStdString(e.toString())); } diff --git a/isis/src/qisis/objs/TrackTool/TrackTool.cpp b/isis/src/qisis/objs/TrackTool/TrackTool.cpp index 1873105218..051ef2b367 100644 --- a/isis/src/qisis/objs/TrackTool/TrackTool.cpp +++ b/isis/src/qisis/objs/TrackTool/TrackTool.cpp @@ -263,19 +263,19 @@ namespace Isis { ViewportBuffer *redBuf = cvp->redBuffer(); QString pixelString = updateColorLabel(p, redBuf, p_redLabel); QString rLab = "R "; - rLab += IString(pixelString).ToQt(); + rLab += pixelString; p_redLabel->setText(rLab); ViewportBuffer *greenBuf = cvp->greenBuffer(); pixelString = updateColorLabel(p, greenBuf, p_grnLabel); QString gLab = "G "; - gLab += IString(pixelString).ToQt(); + gLab += pixelString; p_grnLabel->setText(gLab); ViewportBuffer *blueBuf = cvp->blueBuffer(); pixelString = updateColorLabel(p, blueBuf, p_bluLabel); QString bLab = "B "; - bLab += IString(pixelString).ToQt(); + bLab += pixelString; p_bluLabel->setText(bLab); } } From 5efcaa42b0d1a57717f9b534b686156159dba95a Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Fri, 6 Sep 2024 14:23:36 -0700 Subject: [PATCH 61/95] Change in progress --- isis/src/apollo/apps/apollocal/apollocal.cpp | 2 +- .../apollo/apps/apollofindrx/apollofindrx.cpp | 2 +- isis/src/apollo/apps/apollopaninit/main.cpp | 10 +- .../apollopanstitcher/apollopanstitcher.cpp | 4 +- .../apollo/apps/apolloremrx/apolloremrx.cpp | 4 +- isis/src/apollo/apps/apollowarp/main.cpp | 2 +- isis/src/apollo/objs/Apollo/Apollo.h | 4 +- isis/src/base/apps/appjit/PixelOffset.cpp | 6 +- isis/src/base/apps/appjit/main.cpp | 10 +- isis/src/base/apps/ascii2isis/main.cpp | 6 +- isis/src/base/apps/automos/automos.cpp | 6 +- isis/src/base/apps/automos/main.cpp | 2 +- isis/src/base/apps/autoregtemplate/main.cpp | 6 +- isis/src/base/apps/bandnorm/bandnorm.cpp | 6 +- isis/src/base/apps/blend/main.cpp | 8 +- isis/src/base/apps/butterworth/main.cpp | 2 +- isis/src/base/apps/cam2map/cam2map.cpp | 4 +- isis/src/base/apps/cam2map/main.cpp | 4 +- isis/src/base/apps/caminfo/CamTools.cpp | 4 +- isis/src/base/apps/caminfo/caminfo.cpp | 12 +- isis/src/base/apps/campt/campt.cpp | 8 +- isis/src/base/apps/camrange/camrange.cpp | 2 +- isis/src/base/apps/camstats/camstats.cpp | 6 +- isis/src/base/apps/cathist/main.cpp | 8 +- isis/src/base/apps/catlab/main.cpp | 4 +- isis/src/base/apps/catoriglab/main.cpp | 12 +- isis/src/base/apps/center/main.cpp | 2 +- .../src/base/apps/ckwriter/CkKernelWriter.cpp | 8 +- .../src/base/apps/ckwriter/CkSpiceSegment.cpp | 8 +- isis/src/base/apps/ckwriter/SpiceKernel.cpp | 2 +- isis/src/base/apps/ckwriter/ckwriter.cpp | 12 +- isis/src/base/apps/crop/crop.cpp | 6 +- isis/src/base/apps/csminit/csminit.cpp | 24 +- isis/src/base/apps/cubeavg/main.cpp | 4 +- isis/src/base/apps/cubediff/WriteTabular.cpp | 10 +- isis/src/base/apps/cubefunc/main.cpp | 2 +- isis/src/base/apps/cubeit/cubeit.cpp | 28 +- isis/src/base/apps/cubenorm/main.cpp | 4 +- isis/src/base/apps/demprep/demprep.cpp | 2 +- isis/src/base/apps/errors/main.cpp | 8 +- .../findimageoverlaps/findimageoverlaps.cpp | 10 +- isis/src/base/apps/fits2isis/fits2isis.cpp | 4 +- .../base/apps/footprintinit/footprintinit.cpp | 4 +- isis/src/base/apps/footprintmerge/main.cpp | 4 +- .../src/base/apps/framestitch/framestitch.cpp | 14 +- isis/src/base/apps/getkey/main.cpp | 2 +- isis/src/base/apps/getsn/getsn.cpp | 2 +- isis/src/base/apps/grid/grid.cpp | 8 +- isis/src/base/apps/hist/hist.cpp | 2 +- isis/src/base/apps/isis2fits/main.cpp | 4 +- isis/src/base/apps/isis2gml/main.cpp | 6 +- isis/src/base/apps/isis2pds/isis2pds.cpp | 10 +- isis/src/base/apps/isis2raw/main.cpp | 4 +- isis/src/base/apps/isis2std/isis2std.cpp | 6 +- isis/src/base/apps/isisexport/isisexport.cpp | 30 +- isis/src/base/apps/isisimport/isisimport.cpp | 50 +- .../apps/isisminer/CnetReaderStrategy.cpp | 2 +- .../base/apps/isisminer/CsvReaderStrategy.cpp | 12 +- .../base/apps/isisminer/CsvWriterStrategy.cpp | 6 +- .../apps/isisminer/DatabaseReaderStrategy.cpp | 4 +- .../apps/isisminer/GisIntersectStrategy.cpp | 4 +- .../apps/isisminer/GisOverlapStrategy.cpp | 4 +- .../apps/isisminer/NumericalSortStrategy.cpp | 2 +- isis/src/base/apps/isisminer/PdsColumn.cpp | 2 +- .../isisminer/PdsTableCreatorStrategy.cpp | 4 +- .../apps/isisminer/PdsTableFormatStrategy.cpp | 2 +- .../apps/isisminer/PdsTableReaderStrategy.cpp | 2 +- .../base/apps/isisminer/PvlReaderStrategy.cpp | 8 +- .../isisminer/ResourceManagerStrategy.cpp | 8 +- .../apps/isisminer/RunCommandStrategy.cpp | 4 +- .../base/apps/isisminer/SidebarStrategy.cpp | 2 +- .../base/apps/isisminer/StrategyFactory.cpp | 14 +- isis/src/base/apps/makeflat/main.cpp | 2 +- isis/src/base/apps/map2cam/map2cam.cpp | 6 +- isis/src/base/apps/map2map/map2map.cpp | 2 +- isis/src/base/apps/mapgrid/main.cpp | 4 +- isis/src/base/apps/maplab/main.cpp | 2 +- isis/src/base/apps/mapmos/mapmos.cpp | 4 +- isis/src/base/apps/mappt/mappt.cpp | 18 +- isis/src/base/apps/maptemplate/main.cpp | 2 +- isis/src/base/apps/maptrim/maptrim.cpp | 2 +- isis/src/base/apps/mask/main.cpp | 2 +- isis/src/base/apps/mosrange/mosrange.cpp | 22 +- isis/src/base/apps/mvstats/main.cpp | 4 +- isis/src/base/apps/nocam2map/main.cpp | 4 +- isis/src/base/apps/nocam2map/nocam2map.cpp | 6 +- isis/src/base/apps/noproj/noproj.cpp | 14 +- .../base/apps/overlapstats/overlapstats.cpp | 8 +- isis/src/base/apps/phocube/phocube.cpp | 6 +- isis/src/base/apps/phoemplocal/main.cpp | 6 +- isis/src/base/apps/photemplate/main.cpp | 70 +-- isis/src/base/apps/pvldiff/main.cpp | 6 +- isis/src/base/apps/reduce/reduce_app.cpp | 8 +- isis/src/base/apps/remrx/main.cpp | 4 +- isis/src/base/apps/ringsautomos/main.cpp | 2 +- .../base/apps/ringsautomos/ringsautomos.cpp | 6 +- isis/src/base/apps/ringscam2map/main.cpp | 8 +- isis/src/base/apps/ringsmappt/main.cpp | 10 +- .../apps/ringspt/CameraRingsPointInfo.cpp | 2 +- isis/src/base/apps/ringspt/main.cpp | 2 +- isis/src/base/apps/rotate/main.cpp | 2 +- isis/src/base/apps/segment/segment.cpp | 6 +- isis/src/base/apps/shade/main.cpp | 2 +- isis/src/base/apps/shadow/ShadowFunctor.cpp | 6 +- isis/src/base/apps/shadow/shadow.cpp | 10 +- isis/src/base/apps/shadowtau/main.cpp | 6 +- isis/src/base/apps/skymap/main.cpp | 4 +- isis/src/base/apps/skypt/skypt.cpp | 12 +- isis/src/base/apps/slpmap/main.cpp | 2 +- isis/src/base/apps/smtk/main.cpp | 8 +- isis/src/base/apps/specdivfilter/main.cpp | 2 +- isis/src/base/apps/spechighpass/main.cpp | 2 +- isis/src/base/apps/speclowpass/main.cpp | 2 +- isis/src/base/apps/spicefit/main.cpp | 4 +- isis/src/base/apps/spiceinit/SpiceClient.cpp | 8 +- isis/src/base/apps/spiceinit/spiceinit.cpp | 10 +- .../src/base/apps/spiceserver/spiceserver.cpp | 16 +- isis/src/base/apps/spkwriter/KernelWriter.h | 2 +- .../src/base/apps/spkwriter/SpkKernelWriter.h | 8 +- isis/src/base/apps/spkwriter/SpkSegment.cpp | 6 +- .../base/apps/spkwriter/SpkSpiceSegment.cpp | 2 +- isis/src/base/apps/spkwriter/spkwriter.cpp | 16 +- isis/src/base/apps/stats/stats.cpp | 4 +- isis/src/base/apps/std2isis/std2isis.cpp | 4 +- isis/src/base/apps/stretch/stretch_app.cpp | 4 +- isis/src/base/apps/tabledump/main.cpp | 4 +- isis/src/base/apps/trackextract/main.cpp | 14 +- isis/src/base/apps/translate/main.cpp | 2 +- isis/src/base/objs/AbstractShape/unitTest.cpp | 2 +- isis/src/base/objs/Albedo/Albedo.cpp | 2 +- isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp | 16 +- isis/src/base/objs/Angle/Angle.cpp | 6 +- .../base/objs/Anisotropic1/Anisotropic1.cpp | 2 +- .../base/objs/Anisotropic2/Anisotropic2.cpp | 6 +- .../src/base/objs/Application/Application.cpp | 62 +-- isis/src/base/objs/Application/unitTest.cpp | 6 +- isis/src/base/objs/Area3D/Area3D.cpp | 15 +- isis/src/base/objs/AtmosModel/AtmosModel.cpp | 4 +- isis/src/base/objs/AutoReg/AutoReg.cpp | 4 +- isis/src/base/objs/AutoReg/AutoReg.h | 1 + .../base/objs/BasisFunction/BasisFunction.cpp | 6 +- isis/src/base/objs/Blobber/Blobber.cpp | 2 +- isis/src/base/objs/Brick/Brick.cpp | 2 +- .../objs/BulletDskShape/BulletDskShape.cpp | 8 +- .../BulletShapeModel/BulletShapeModel.cpp | 12 +- .../base/objs/BulletShapeModel/unitTest.cpp | 2 +- .../base/objs/BulletTargetShape/unitTest.cpp | 2 +- .../base/objs/BulletWorldManager/unitTest.cpp | 6 +- isis/src/base/objs/CSMCamera/CSMCamera.cpp | 34 +- isis/src/base/objs/CSVReader/CSVReader.cpp | 2 +- isis/src/base/objs/CSVReader/CSVReader.h | 3 +- isis/src/base/objs/Calculator/Calculator.cpp | 2 +- isis/src/base/objs/Camera/Camera.cpp | 6 +- isis/src/base/objs/Camera/unitTest.cpp | 2 +- .../CameraDetectorMap/CameraDetectorMap.cpp | 2 +- .../CameraDistortionMap.cpp | 2 +- .../base/objs/CameraFactory/CameraFactory.cpp | 26 +- .../CameraFocalPlaneMap.cpp | 8 +- .../objs/CameraGroundMap/CameraGroundMap.cpp | 2 +- .../objs/CameraPointInfo/CameraPointInfo.cpp | 6 +- isis/src/base/objs/Chip/Chip.cpp | 20 +- isis/src/base/objs/Chip/Chip.h | 1 + .../src/base/objs/CollectorMap/CollectorMap.h | 4 +- isis/src/base/objs/Column/Column.cpp | 12 +- isis/src/base/objs/Cube/Cube.cpp | 276 +++++----- isis/src/base/objs/Cube/Cube.h | 8 +- isis/src/base/objs/Cube/CubeBsqHandler.cpp | 12 +- isis/src/base/objs/Cube/CubeTileHandler.cpp | 12 +- .../base/objs/CubeAttribute/CubeAttribute.cpp | 28 +- .../base/objs/CubeAttribute/CubeAttribute.h | 10 +- .../objs/CubeCalculator/CubeCalculator.cpp | 6 +- .../objs/CubeDataThread/CubeDataThread.cpp | 12 +- .../CubeInfixToPostfix/CubeInfixToPostfix.cpp | 2 +- .../src/base/objs/CubeManager/CubeManager.cpp | 12 +- isis/src/base/objs/DemShape/unitTest.cpp | 2 +- isis/src/base/objs/Distance/Distance.cpp | 2 +- isis/src/base/objs/Distance/Distance.h | 1 + .../src/base/objs/EllipsoidShape/unitTest.cpp | 2 +- .../EmbreeShapeModel/EmbreeShapeModel.cpp | 12 +- .../base/objs/EmbreeShapeModel/unitTest.cpp | 2 +- .../EmbreeTargetManager.cpp | 14 +- .../objs/EmbreeTargetManager/unitTest.cpp | 2 +- .../EmbreeTargetShape/EmbreeTargetShape.cpp | 26 +- .../base/objs/EmbreeTargetShape/unitTest.cpp | 2 +- .../base/objs/EndianSwapper/EndianSwapper.h | 1 + .../src/base/objs/Environment/Environment.cpp | 2 +- .../base/objs/Equalization/Equalization.cpp | 96 ++-- .../EquatorialCylindricalShape.cpp | 4 +- .../EquatorialCylindricalShape/unitTest.cpp | 2 +- .../objs/Equirectangular/Equirectangular.cpp | 8 +- .../objs/Equirectangular/Equirectangular.h | 1 + isis/src/base/objs/FileList/FileList.cpp | 12 +- isis/src/base/objs/FitsToJson/FitsToJson.cpp | 10 +- .../base/objs/FunctionTools/FunctionTools.h | 4 +- .../src/base/objs/GisGeometry/GisGeometry.cpp | 3 +- isis/src/base/objs/GisGeometry/unitTest.cpp | 2 +- .../src/base/objs/GisTopology/GisTopology.cpp | 4 +- isis/src/base/objs/GisTopology/unitTest.cpp | 2 +- .../GroupedStatistics/GroupedStatistics.cpp | 2 +- isis/src/base/objs/Gruen/Gruen.cpp | 16 +- isis/src/base/objs/Gui/Gui.cpp | 8 +- .../base/objs/Gui/GuiComboBoxParameter.cpp | 4 +- isis/src/base/objs/Gui/GuiCubeParameter.cpp | 18 +- .../base/objs/Gui/GuiFilenameParameter.cpp | 16 +- isis/src/base/objs/Gui/GuiInputAttribute.cpp | 2 +- isis/src/base/objs/Gui/GuiOutputAttribute.cpp | 4 +- isis/src/base/objs/Gui/GuiParameter.cpp | 16 +- .../src/base/objs/Gui/GuiParameterFactory.cpp | 2 +- isis/src/base/objs/Hapke/Hapke.cpp | 2 +- isis/src/base/objs/Hillshade/Hillshade.cpp | 32 +- isis/src/base/objs/History/History.cpp | 2 +- isis/src/base/objs/History/History.h | 1 + isis/src/base/objs/ID/ID.cpp | 6 +- .../base/objs/ImageExporter/ImageExporter.cpp | 12 +- .../base/objs/ImageImporter/ImageImporter.cpp | 6 +- .../base/objs/ImageOverlap/ImageOverlap.cpp | 7 +- .../objs/ImageOverlapSet/ImageOverlapSet.cpp | 36 +- .../objs/ImageOverlapSet/ImageOverlapSet.h | 6 +- .../base/objs/ImagePolygon/ImagePolygon.cpp | 8 +- .../objs/ImportPdsTable/ImportPdsTable.cpp | 96 ++-- .../objs/InfixToPostfix/InfixToPostfix.cpp | 94 ++-- .../InlineCalculator/InlineCalculator.cpp | 26 +- .../InlineInfixToPostfix.cpp | 4 +- isis/src/base/objs/Intercept/Intercept.cpp | 2 +- isis/src/base/objs/IsisAml/IsisAml.cpp | 484 +++++++++--------- isis/src/base/objs/IsisAml/IsisXMLHandler.cpp | 1 + isis/src/base/objs/JP2Decoder/JP2Decoder.cpp | 4 +- isis/src/base/objs/JP2Decoder/JP2Decoder.h | 1 + .../src/base/objs/JP2Exporter/JP2Exporter.cpp | 4 +- .../src/base/objs/JP2Importer/JP2Importer.cpp | 2 +- isis/src/base/objs/Kernels/Kernels.cpp | 18 +- .../LabelTranslationManager.cpp | 11 +- .../LambertAzimuthalEqualArea.cpp | 4 +- .../LambertConformal/LambertConformal.cpp | 8 +- isis/src/base/objs/Latitude/Latitude.cpp | 26 +- .../base/objs/LeastSquares/LeastSquares.cpp | 24 +- isis/src/base/objs/LidarData/LidarData.cpp | 26 +- isis/src/base/objs/LidarData/unitTest.cpp | 2 +- .../src/base/objs/LineManager/LineManager.cpp | 2 +- .../base/objs/LinearAlgebra/LinearAlgebra.cpp | 56 +- .../LunarAzimuthalEqualArea.cpp | 2 +- .../LunarLambertEmpirical.cpp | 22 +- isis/src/base/objs/Mercator/Mercator.cpp | 2 +- .../MinnaertEmpirical/MinnaertEmpirical.cpp | 8 +- isis/src/base/objs/Mollweide/Mollweide.cpp | 2 +- isis/src/base/objs/NaifDskApi/NaifDskApi.cpp | 4 +- .../NaifDskPlateModel/NaifDskPlateModel.cpp | 16 +- .../base/objs/NaifDskShape/NaifDskShape.cpp | 10 +- isis/src/base/objs/NaifDskShape/unitTest.cpp | 2 +- isis/src/base/objs/NaifStatus/NaifStatus.cpp | 6 +- .../NthOrderPolynomial/NthOrderPolynomial.cpp | 2 +- .../ObliqueCylindrical/ObliqueCylindrical.cpp | 2 +- .../ObservationNumber/ObservationNumber.cpp | 10 +- .../base/objs/ObservationNumber/unitTest.cpp | 2 +- .../ObservationNumberList.cpp | 14 +- .../objs/ObservationNumberList/unitTest.cpp | 12 +- .../OriginalXmlLabel/OriginalXmlLabel.cpp | 16 +- .../base/objs/OriginalXmlLabel/unitTest.cpp | 4 +- .../base/objs/Orthographic/Orthographic.cpp | 6 +- .../OverlapStatistics/OverlapStatistics.cpp | 18 +- .../PhotoModelFactory/PhotoModelFactory.cpp | 2 +- isis/src/base/objs/Pipeline/Pipeline.cpp | 62 +-- .../objs/Pipeline/PipelineApplication.cpp | 24 +- isis/src/base/objs/PixelFOV/PixelFOV.cpp | 2 +- isis/src/base/objs/PlaneShape/unitTest.cpp | 2 +- isis/src/base/objs/Plugin/Plugin.cpp | 10 +- .../PointPerspective/PointPerspective.cpp | 2 +- .../PolarStereographic/PolarStereographic.cpp | 6 +- .../base/objs/PolygonSeeder/PolygonSeeder.cpp | 2 +- .../PolynomialUnivariate.cpp | 2 +- isis/src/base/objs/Process/Process.cpp | 52 +- .../src/base/objs/ProcessByBrick/unitTest.cpp | 2 +- .../base/objs/ProcessExport/ProcessExport.cpp | 4 +- .../ProcessExportPds/ProcessExportPds.cpp | 26 +- .../ProcessExportPds4/ProcessExportPds4.cpp | 90 ++-- .../base/objs/ProcessExportPds4/unitTest.cpp | 2 +- .../ProcessGroundPolygons.cpp | 16 +- .../base/objs/ProcessImport/ProcessImport.cpp | 124 ++--- .../ProcessImportFits/ProcessImportFits.cpp | 37 +- .../ProcessImportPds/ProcessImportPds.cpp | 106 ++-- .../ProcessImportVicar/ProcessImportVicar.cpp | 10 +- .../ProcessMapMosaic/ProcessMapMosaic.cpp | 50 +- .../base/objs/ProcessMosaic/ProcessMosaic.cpp | 14 +- isis/src/base/objs/ProcessMosaic/unitTest.cpp | 2 +- .../objs/ProcessPolygons/ProcessPolygons.cpp | 16 +- .../objs/ProgramLauncher/ProgramLauncher.cpp | 14 +- .../objs/ProgramLauncher/ProgramLauncher.h | 2 +- isis/src/base/objs/Projection/Projection.h | 1 + .../ProjectionFactory/ProjectionFactory.cpp | 18 +- .../PushFrameCameraCcdLayout.cpp | 12 +- .../base/objs/PvlEditDialog/PvlEditDialog.cpp | 4 +- isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp | 10 +- isis/src/base/objs/PvlToJSON/PvlToJSON.cpp | 2 +- .../PvlTranslationTable.cpp | 6 +- .../PvlTranslationTable/PvlTranslationTable.h | 1 + isis/src/base/objs/QtExporter/QtExporter.cpp | 4 +- .../objs/RadarGroundMap/RadarGroundMap.cpp | 2 +- isis/src/base/objs/Robinson/Robinson.cpp | 2 +- .../RollingShutterCameraDetectorMap.cpp | 2 +- isis/src/base/objs/Sensor/Sensor.cpp | 2 +- isis/src/base/objs/Sensor/Sensor.h | 1 + .../base/objs/SerialNumber/SerialNumber.cpp | 6 +- isis/src/base/objs/SerialNumber/unitTest.cpp | 2 +- .../SerialNumberList/SerialNumberList.cpp | 72 +-- .../base/objs/SerialNumberList/unitTest.cpp | 24 +- isis/src/base/objs/ShapeModel/ShapeModel.cpp | 16 +- isis/src/base/objs/ShapeModel/unitTest.cpp | 2 +- .../ShapeModelFactory/ShapeModelFactory.cpp | 16 +- .../SimpleCylindrical/SimpleCylindrical.cpp | 2 +- isis/src/base/objs/Sinusoidal/Sinusoidal.cpp | 2 +- .../src/base/objs/SmtkMatcher/SmtkMatcher.cpp | 4 +- .../SpectralDefinition1D.cpp | 15 +- .../SpectralDefinition2D.cpp | 10 +- isis/src/base/objs/Spice/Spice.cpp | 24 +- isis/src/base/objs/Spice/Spice.h | 1 + .../base/objs/SpicePosition/SpicePosition.cpp | 8 +- .../base/objs/SpiceRotation/SpiceRotation.cpp | 20 +- .../StatCumProbDistDynCalc.cpp | 4 +- .../objs/StatCumProbDistDynCalc/unitTest.cpp | 2 +- isis/src/base/objs/Statistics/Statistics.cpp | 6 +- isis/src/base/objs/Statistics/unitTest.cpp | 2 +- isis/src/base/objs/Strategy/Strategy.cpp | 4 +- .../src/base/objs/TProjection/TProjection.cpp | 4 +- isis/src/base/objs/Target/Target.cpp | 8 +- isis/src/base/objs/TextFile/TextFile.cpp | 22 +- .../base/objs/TiffExporter/TiffExporter.cpp | 6 +- .../base/objs/TiffImporter/TiffImporter.cpp | 14 +- .../base/objs/TrackingTable/TrackingTable.cpp | 16 +- .../objs/TriangularPlate/TriangularPlate.cpp | 2 +- .../UniversalGroundMap/UniversalGroundMap.cpp | 2 +- .../UpturnedEllipsoidTransverseAzimuthal.cpp | 2 +- .../base/objs/UserInterface/UserInterface.cpp | 84 +-- isis/src/base/objs/XmlToJson/XmlToJson.cpp | 6 +- .../XmlToPvlTranslationManager.cpp | 26 +- .../XmlToPvlTranslationManager/unitTest.cpp | 2 +- isis/src/base/objs/iTime/iTime.cpp | 6 +- isis/src/cassini/apps/ciss2isis/ciss2isis.cpp | 6 +- isis/src/cassini/apps/vims2isis/main.cpp | 22 +- isis/src/cassini/apps/vimscal/main.cpp | 20 +- .../cassini/objs/CisscalFile/CisscalFile.cpp | 2 +- .../apps/chan1m32isis/chan1m32isis.cpp | 6 +- isis/src/clementine/apps/clem2isis/main.cpp | 10 +- .../src/clementine/apps/clemhirescal/main.cpp | 6 +- isis/src/clipper/apps/eis2isis/eis2isis.cpp | 16 +- .../ClipperPushBroomCamera.cpp | 4 +- isis/src/control/apps/autoseed/autoseed.cpp | 10 +- .../control/apps/cnet2dem/DatumFunctoid.cpp | 6 +- isis/src/control/apps/cnet2dem/main.cpp | 2 +- isis/src/control/apps/cnet2mat/main.cpp | 2 +- isis/src/control/apps/cnetadd/main.cpp | 8 +- isis/src/control/apps/cnetcheck/cnetcheck.cpp | 40 +- .../apps/cnetcombinept/cnetcombinept.cpp | 20 +- isis/src/control/apps/cnetdiff/cnetdiff.cpp | 12 +- isis/src/control/apps/cnetedit/cnetedit.cpp | 14 +- .../control/apps/cnetextract/cnetextract.cpp | 66 +-- isis/src/control/apps/cnethist/main.cpp | 4 +- isis/src/control/apps/cnetmerge/main.cpp | 8 +- isis/src/control/apps/cnetnewradii/main.cpp | 8 +- .../apps/cnetref/CnetRefByEmission.cpp | 2 +- isis/src/control/apps/cnetref/main.cpp | 14 +- isis/src/control/apps/cnetsplit/main.cpp | 2 +- .../control/apps/cnetthinner/cnetthinner.cpp | 2 +- .../control/apps/cnetwinnow/cnetwinnow.cpp | 4 +- isis/src/control/apps/coreg/main.cpp | 10 +- isis/src/control/apps/deltack/main.cpp | 10 +- .../apps/findfeatures/AKAZEAlgorithm.cpp | 4 +- .../apps/findfeatures/AgastAlgorithm.cpp | 2 +- .../apps/findfeatures/BRISKAlgorithm.cpp | 2 +- .../findfeatures/BlobDetectionAlgorithm.cpp | 2 +- .../findfeatures/BriefDescriptorAlgorithm.cpp | 2 +- .../apps/findfeatures/BruteForceMatcher.cpp | 6 +- .../apps/findfeatures/DaisyAlgorithm.cpp | 4 +- .../apps/findfeatures/DaisyExtractor.cpp | 14 +- .../apps/findfeatures/FASTAlgorithm.cpp | 2 +- .../apps/findfeatures/FREAKAlgorithm.cpp | 2 +- .../control/apps/findfeatures/FastGeom.cpp | 14 +- .../apps/findfeatures/FeatureAlgorithm.h | 8 +- .../findfeatures/FeatureAlgorithmFactory.cpp | 22 +- .../apps/findfeatures/FeatureInventory.cpp | 16 +- .../apps/findfeatures/FlannBasedMatcher.cpp | 2 +- .../apps/findfeatures/GenericTransform.cpp | 4 +- .../control/apps/findfeatures/ImageSource.cpp | 26 +- .../apps/findfeatures/KAZEAlgorithm.cpp | 2 +- .../apps/findfeatures/LATCHAlgorithm.cpp | 2 +- .../apps/findfeatures/LUCIDAlgorithm.cpp | 2 +- .../apps/findfeatures/MSDAlgorithm.cpp | 2 +- .../apps/findfeatures/MSERAlgorithm.cpp | 2 +- .../apps/findfeatures/MSERExtractor.cpp | 18 +- .../control/apps/findfeatures/MatchMaker.cpp | 4 +- .../src/control/apps/findfeatures/MatchPair.h | 2 +- .../apps/findfeatures/MatcherAlgorithms.cpp | 8 +- .../apps/findfeatures/ORBAlgorithm.cpp | 2 +- .../control/apps/findfeatures/QDebugLogger.h | 10 +- .../apps/findfeatures/RobustMatcher.cpp | 52 +- .../apps/findfeatures/SIFTAlgorithm.cpp | 2 +- .../apps/findfeatures/StarAlgorithm.cpp | 2 +- .../apps/findfeatures/findfeatures.cpp | 24 +- isis/src/control/apps/jigsaw/jigsaw.cpp | 39 +- isis/src/control/apps/mat2cnet/main.cpp | 28 +- isis/src/control/apps/pointreg/pointreg.cpp | 18 +- isis/src/control/apps/seedgrid/main.cpp | 18 +- isis/src/control/apps/slither/ControlByRow.h | 2 +- isis/src/control/apps/slither/main.cpp | 2 +- isis/src/control/apps/sumspice/SumFile.cpp | 26 +- isis/src/control/apps/sumspice/SumFinder.cpp | 6 +- isis/src/control/apps/sumspice/sumspice.cpp | 28 +- isis/src/control/apps/warp/main.cpp | 6 +- .../objs/BundleAdjust/BundleAdjust.cpp | 24 +- .../objs/BundleResults/BundleResults.cpp | 10 +- .../objs/BundleSettings/BundleSettings.cpp | 2 +- .../BundleSolutionInfo/BundleSolutionInfo.cpp | 64 ++- .../BundleLidarRangeConstraint.cpp | 14 +- .../objs/BundleUtilities/BundleMeasure.cpp | 6 +- .../BundleObservationSolveSettings.cpp | 6 +- .../BundleObservationVector.cpp | 2 +- .../objs/BundleUtilities/BundleTargetBody.cpp | 164 +++--- .../BundleUtilities/IsisBundleObservation.cpp | 8 +- .../control/objs/BundleUtilities/unitTest.cpp | 2 +- .../objs/ControlMeasure/ControlMeasure.cpp | 14 +- .../control/objs/ControlNet/ControlNet.cpp | 34 +- .../objs/ControlNetDiff/ControlNetDiff.cpp | 2 +- .../control/objs/ControlNetDiff/unitTest.cpp | 2 +- .../ControlNetFilter/ControlNetFilter.cpp | 12 +- .../ControlNetStatistics.cpp | 18 +- .../ControlNetValidMeasure.cpp | 38 +- .../ControlNetVersioner.cpp | 14 +- .../ControlNetVersioner/ControlPointV0001.cpp | 8 +- .../ControlNetVersioner/ControlPointV0002.cpp | 8 +- .../ControlNetVersioner/ControlPointV0003.cpp | 22 +- .../objs/ControlNetVersioner/unitTest.cpp | 10 +- .../objs/ControlPoint/ControlPoint.cpp | 40 +- .../ControlPointList/ControlPointList.cpp | 8 +- .../CorrelationMatrix/CorrelationMatrix.cpp | 27 +- .../objs/CorrelationMatrix/unitTest.cpp | 2 +- .../CsmBundleObservation.cpp | 8 +- .../InterestOperator/InterestOperator.cpp | 10 +- isis/src/core/include/Blob.h | 20 +- isis/src/core/include/Endian.h | 8 +- isis/src/core/include/IException.h | 11 +- isis/src/core/include/IString.h | 4 +- isis/src/core/include/PvlContainer.h | 6 +- isis/src/core/include/PvlKeyword.h | 13 +- isis/src/core/include/PvlObject.h | 16 +- isis/src/core/include/SpecialPixel.h | 31 +- isis/src/core/include/Table.h | 6 +- isis/src/core/src/Blob.cpp | 55 +- isis/src/core/src/IException.cpp | 93 +--- isis/src/core/src/IString.cpp | 46 +- isis/src/core/src/PvlKeyword.cpp | 6 +- isis/src/core/src/PvlObject.cpp | 2 - isis/src/core/src/Table.cpp | 20 +- .../src/core/tests/unitTests/Pvl/unitTest.cpp | 6 +- isis/src/database/objs/Database/Database.cpp | 12 +- .../objs/DatabaseFactory/DatabaseFactory.cpp | 6 +- .../src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp | 12 +- isis/src/dawn/apps/dawnvir2isis/main.cpp | 12 +- .../dawn/objs/DawnFcCamera/DawnFcCamera.cpp | 2 +- isis/src/dev/apps/camdev/camdev.cpp | 6 +- isis/src/dev/apps/camdev/main.cpp | 6 +- isis/src/dev/apps/m3loc2net/main.cpp | 2 +- isis/src/galileo/apps/gllnims2isis/main.cpp | 10 +- isis/src/galileo/apps/gllssi2isis/main.cpp | 8 +- isis/src/galileo/apps/gllssical/gllssical.cpp | 8 +- .../apps/amica2isis/AmicaImportFits.cpp | 2 +- isis/src/hayabusa/apps/amica2isis/main.cpp | 4 +- .../hayabusa/apps/amicacal/AmicaCalUtils.h | 2 +- isis/src/hayabusa/apps/amicacal/main.cpp | 8 +- .../apps/nirs2isis/NirsImportFits.cpp | 2 +- isis/src/hayabusa/apps/nirs2isis/main.cpp | 6 +- .../apps/hyb2onc2isis/hyb2onc2isis.cpp | 8 +- isis/src/hayabusa2/apps/hyb2onccal/main.cpp | 6 +- .../objs/Hyb2OncCamera/Hyb2OncCamera.cpp | 2 +- isis/src/juno/apps/junocam2isis/main.cpp | 14 +- .../apps/kaguyami2isis/kaguyami2isis.cpp | 12 +- isis/src/kaguya/apps/kaguyasp2ascii/main.cpp | 30 +- isis/src/kaguya/apps/kaguyasp2isis/main.cpp | 28 +- .../apps/kaguyatc2isis/kaguyatc2isis.cpp | 4 +- .../objs/KaguyaMiCamera/KaguyaMiCamera.cpp | 2 +- isis/src/lo/apps/lo2isis/lo2isis.cpp | 12 +- isis/src/lo/apps/lopdsgen/main.cpp | 4 +- .../src/lo/objs/LoHighCamera/LoHighCamera.cpp | 4 +- .../lo/objs/LoMediumCamera/LoMediumCamera.cpp | 4 +- .../lro/apps/lrolola2isis/lrolola2isis.cpp | 6 +- isis/src/lro/apps/lromakeflat/main.cpp | 2 +- isis/src/lro/apps/lronac2isis/lronac2isis.cpp | 16 +- isis/src/lro/apps/lronaccal/lronaccal.cpp | 32 +- isis/src/lro/apps/lronacecho/main.cpp | 2 +- isis/src/lro/apps/lronacpho/lronacpho.cpp | 6 +- isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp | 38 +- isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp | 6 +- isis/src/lro/apps/lrowaccal/lrowaccal.cpp | 24 +- isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp | 2 +- isis/src/lro/apps/lrowacphomap/HapkeLRO.h | 2 +- isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp | 2 +- isis/src/lro/apps/lrowacphomap/HapkeLROC.h | 2 +- .../lro/apps/lrowacphomap/lrowacphomap.cpp | 12 +- isis/src/lro/apps/mrf2isis/main.cpp | 10 +- isis/src/lro/apps/mrf2pds/main.cpp | 2 +- .../LroNarrowAngleCamera.cpp | 2 +- .../LroWideAngleCamera/LroWideAngleCamera.cpp | 4 +- .../LroWideAngleCameraDistortionMap.cpp | 2 +- .../LroWideAngleCameraFocalPlaneMap.cpp | 2 +- isis/src/lro/objs/MiniRF/MiniRF.cpp | 2 +- isis/src/mariner/apps/mar102isis/main.cpp | 4 +- isis/src/mariner/apps/mar10cal/main.cpp | 8 +- isis/src/mariner/apps/mar10clean/main.cpp | 6 +- isis/src/mariner/apps/mar10nonoise/main.cpp | 2 +- isis/src/mariner/apps/mar10restore/main.cpp | 4 +- .../objs/Mariner10Camera/Mariner10Camera.cpp | 2 +- isis/src/mer/apps/mer2isis/main.cpp | 6 +- isis/src/mer/apps/mical/main.cpp | 2 +- isis/src/messenger/apps/mdis2isis/main.cpp | 16 +- isis/src/messenger/apps/mdis2pds/main.cpp | 2 +- .../src/messenger/apps/mdiscal/MdisCalUtils.h | 10 +- isis/src/messenger/apps/mdiscal/main.cpp | 10 +- .../messenger/apps/mdisedrinfo/MdisEdrKeys.h | 4 +- .../apps/mdisedrinfo/SpiceManager.cpp | 2 +- isis/src/messenger/apps/mdisedrinfo/main.cpp | 8 +- .../messenger/objs/MdisCamera/MdisCamera.cpp | 2 +- isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp | 4 +- isis/src/mgs/apps/moc2isis/main.cpp | 14 +- isis/src/mgs/apps/moccal/moccal.cpp | 6 +- isis/src/mgs/apps/mocnoise50/main.cpp | 4 +- isis/src/mgs/apps/mocproc/main.cpp | 4 +- isis/src/mgs/objs/MocLabels/MocLabels.cpp | 8 +- isis/src/mro/apps/crism2isis/crism2isis.cpp | 12 +- isis/src/mro/apps/ctxcal/ctxcal.cpp | 8 +- isis/src/mro/apps/ctxevenodd/main.cpp | 6 +- isis/src/mro/apps/hi2isis/hi2isis.cpp | 12 +- isis/src/mro/apps/hical/hical.cpp | 6 +- isis/src/mro/apps/hicalbeta/main.cpp | 4 +- isis/src/mro/apps/hicalproc/main.cpp | 4 +- isis/src/mro/apps/hiccdstitch/main.cpp | 16 +- isis/src/mro/apps/hicolormos/hicolormos.cpp | 4 +- isis/src/mro/apps/hicubeit/hicubeit.cpp | 6 +- isis/src/mro/apps/hicubenorm/hicubenorm.cpp | 10 +- isis/src/mro/apps/hideal2pds/main.cpp | 10 +- isis/src/mro/apps/hidestripe/main.cpp | 4 +- isis/src/mro/apps/hidtmgen/hidtmgen.cpp | 10 +- isis/src/mro/apps/hifringe/main.cpp | 6 +- isis/src/mro/apps/hijitreg/HiJitCube.cpp | 2 +- isis/src/mro/apps/hijitreg/main.cpp | 6 +- isis/src/mro/apps/hijitter/main.cpp | 28 +- isis/src/mro/apps/himos/himos.cpp | 10 +- isis/src/mro/apps/hirdrgen/main.cpp | 2 +- isis/src/mro/apps/hisharpen/main.cpp | 12 +- isis/src/mro/apps/histat/main.cpp | 2 +- isis/src/mro/apps/histitch/main.cpp | 6 +- isis/src/mro/apps/marci2isis/marci2isis.cpp | 6 +- isis/src/mro/apps/marcical/marcical.cpp | 14 +- isis/src/mro/apps/mroctx2isis/main.cpp | 12 +- isis/src/mro/apps/pds2hideal/main.cpp | 2 +- isis/src/mro/objs/HiCal/HiCalConf.cpp | 2 +- isis/src/mro/objs/HiCal/HiCalUtil.h | 4 +- isis/src/mro/objs/HiCal/LoadCSV.cpp | 8 +- isis/src/mro/objs/HiCal/Module.h | 2 +- isis/src/mro/objs/HiCal/ZeroDarkRate.h | 4 +- .../objs/HiEqualization/HiEqualization.cpp | 6 +- isis/src/mro/objs/MarciCamera/MarciCamera.cpp | 2 +- isis/src/near/apps/msi2isis/msi2isis.cpp | 10 +- .../apps/leisa2isis/leisa2isis.cpp | 20 +- .../apps/lorri2isis/lorri2isis.cpp | 6 +- .../newhorizons/apps/mvic2isis/mvic2isis.cpp | 10 +- .../NewHorizonsLeisaCamera.cpp | 2 +- .../NewHorizonsLorriCamera.cpp | 2 +- .../NewHorizonsMvicFrameCamera.cpp | 2 +- isis/src/odyssey/apps/thm2isis/thm2isis.cpp | 8 +- isis/src/odyssey/apps/thmbasemap1/main.cpp | 14 +- isis/src/odyssey/apps/thmnoseam/main.cpp | 10 +- isis/src/odyssey/apps/thmproc/main.cpp | 12 +- isis/src/odyssey/apps/thmvisflat/main.cpp | 4 +- isis/src/odyssey/apps/thmvistrim/main.cpp | 2 +- .../objs/ThemisVisCamera/ThemisVisCamera.cpp | 2 +- isis/src/osirisrex/apps/ocams2isis/main.cpp | 2 +- .../apps/tagcams2isis/tagcams2isis.cpp | 2 +- .../OsirisRexOcamsCamera.cpp | 2 +- .../OsirisRexOcamsDistortionMap.cpp | 2 +- .../OsirisRexTagcamsCamera.cpp | 2 +- .../OsirisRexTagcamsDistortionMap.cpp | 2 +- .../apps/cneteditor/CnetEditorWindow.cpp | 10 +- isis/src/qisis/apps/ipce/IpceMainWindow.cpp | 4 +- isis/src/qisis/apps/qtie/QtieFileTool.cpp | 34 +- isis/src/qisis/apps/qtie/QtieTool.cpp | 48 +- isis/src/qisis/apps/qview/main.cpp | 4 +- .../AdvancedTrackTool/AdvancedTrackTool.cpp | 12 +- isis/src/qisis/objs/BlinkTool/BlinkTool.cpp | 4 +- .../qisis/objs/BrowseDialog/BrowseDialog.cpp | 2 +- .../qisis/objs/ChipViewport/ChipViewport.cpp | 10 +- .../ChipViewportsWidget.cpp | 4 +- .../objs/CnetEditorView/CnetEditorView.cpp | 2 +- .../AbstractFilterSelector.cpp | 2 +- .../CnetEditorWidget/AbstractMeasureItem.cpp | 8 +- .../CnetEditorWidget/AbstractPointItem.cpp | 12 +- .../CnetEditorWidget/AbstractTreeModel.cpp | 4 +- .../CnetEditorWidget/CnetEditorWidget.cpp | 12 +- .../objs/CnetEditorWidget/FilterGroup.cpp | 2 +- .../objs/CnetEditorWidget/FilterWidget.cpp | 2 +- .../CnetEditorWidget/PointTableDelegate.cpp | 2 +- .../objs/CnetEditorWidget/TableColumnList.cpp | 6 +- .../ConcurrentControlNetReader.cpp | 4 +- isis/src/qisis/objs/Control/Control.cpp | 26 +- .../qisis/objs/ControlList/ControlList.cpp | 22 +- .../ControlMeasureEditWidget.cpp | 68 +-- .../objs/ControlNetTool/ControlNetTool.cpp | 14 +- .../ControlPointEdit/ControlPointEdit.cpp | 66 +-- .../ControlPointEditWidget.cpp | 146 +++--- .../objs/CubePlotCurve/CubePlotCurve.cpp | 2 +- .../qisis/objs/CubeViewport/CubeViewport.cpp | 4 +- isis/src/qisis/objs/Directory/Directory.cpp | 28 +- .../Directory/ExportControlNetWorkOrder.cpp | 2 +- .../objs/Directory/ExportImagesWorkOrder.cpp | 2 +- .../Directory/ImportControlNetWorkOrder.cpp | 7 +- .../objs/Directory/ImportImagesWorkOrder.cpp | 30 +- .../Directory/ImportMapTemplateWorkOrder.cpp | 7 +- .../ImportRegistrationTemplateWorkOrder.cpp | 7 +- .../objs/Directory/ImportShapesWorkOrder.cpp | 27 +- .../qisis/objs/Directory/JigsawWorkOrder.cpp | 2 +- .../objs/Directory/MatrixViewWorkOrder.cpp | 2 +- .../objs/Directory/OpenProjectWorkOrder.cpp | 2 +- .../objs/Directory/SaveProjectAsWorkOrder.cpp | 2 +- .../objs/Directory/SensorGetInfoWorkOrder.cpp | 2 +- .../objs/Directory/TargetGetInfoWorkOrder.cpp | 2 +- .../Directory/TemplateEditViewWorkOrder.cpp | 2 +- .../FeatureNomenclature.cpp | 2 +- .../FeatureNomenclatureTool.cpp | 6 +- isis/src/qisis/objs/FileDialog/FileDialog.cpp | 8 +- isis/src/qisis/objs/FileTool/FileTool.cpp | 8 +- isis/src/qisis/objs/FindTool/FindTool.cpp | 2 +- isis/src/qisis/objs/Image/Image.cpp | 42 +- .../ImageFileListWidget/ImageTreeWidget.cpp | 9 +- isis/src/qisis/objs/ImageList/ImageList.cpp | 21 +- .../qisis/objs/ImageReader/ImageReader.cpp | 13 +- .../objs/JigsawRunWidget/JigsawRunWidget.cpp | 47 +- .../objs/JigsawRunWidget/JigsawRunWidget.h | 2 +- .../JigsawSetupDialog/JigsawSetupDialog.cpp | 32 +- isis/src/qisis/objs/MainWindow/MainWindow.cpp | 4 +- isis/src/qisis/objs/MatchTool/MatchTool.cpp | 104 ++-- .../objs/MdiCubeViewport/MdiCubeViewport.cpp | 6 +- .../qisis/objs/MeasureTool/MeasureTool.cpp | 6 +- .../MosaicMainWindow/MosaicController.cpp | 2 +- .../MosaicMainWindow/MosaicMainWindow.cpp | 4 +- .../ControlNetGraphicsItem.cpp | 2 +- .../ControlPointGraphicsItem.cpp | 2 +- .../objs/MosaicSceneWidget/MosaicAreaTool.cpp | 2 +- .../MosaicControlNetTool.cpp | 10 +- .../objs/MosaicSceneWidget/MosaicFindTool.cpp | 2 +- .../objs/MosaicSceneWidget/MosaicGridTool.cpp | 8 +- .../MosaicSceneWidget/MosaicSceneWidget.cpp | 12 +- .../objs/MosaicSceneWidget/MosaicTool.cpp | 2 +- .../objs/PaletteWindow/PaletteWindow.cpp | 8 +- isis/src/qisis/objs/PanTool/PanTool.cpp | 4 +- isis/src/qisis/objs/PlotWindow/PlotWindow.cpp | 32 +- isis/src/qisis/objs/Project/Project.cpp | 18 +- .../src/qisis/objs/QnetTools/QnetFileTool.cpp | 16 +- isis/src/qisis/objs/QnetTools/QnetNavTool.cpp | 10 +- .../objs/QnetTools/QnetPointRangeFilter.cpp | 4 +- .../objs/QnetTools/QnetSetAprioriDialog.cpp | 32 +- isis/src/qisis/objs/QnetTools/QnetTool.cpp | 84 +-- .../objs/ScatterPlotTool/ScatterPlotData.cpp | 4 +- isis/src/qisis/objs/Shape/Shape.cpp | 4 +- .../qisis/objs/StereoTool/ProfileDialog.cpp | 2 +- isis/src/qisis/objs/StereoTool/StereoTool.cpp | 58 +-- .../StretchTool/AdvancedStretchDialog.cpp | 12 +- .../qisis/objs/StretchTool/StretchTool.cpp | 2 +- isis/src/qisis/objs/Tab/Tab.cpp | 2 +- .../objs/TableMainWindow/TableMainWindow.cpp | 2 +- .../objs/TableMainWindow/TableMainWindow.h | 2 +- .../TargetInfoWidget/TargetInfoWidget.cpp | 4 +- isis/src/qisis/objs/Workspace/Workspace.cpp | 4 +- isis/src/qisis/objs/ZoomTool/ZoomTool.cpp | 6 +- isis/src/rosetta/apps/rososiris2isis/main.cpp | 12 +- isis/src/rosetta/apps/rosvirtis2isis/main.cpp | 12 +- .../RosettaVirtisCamera.cpp | 2 +- .../socet/apps/socetframesettings/main.cpp | 18 +- .../socetlinescankeywords.cpp | 12 +- isis/src/system/apps/blobdump/main.cpp | 2 +- isis/src/system/apps/csspckgen/main.cpp | 4 +- isis/src/system/apps/dempack/main.cpp | 2 +- .../apps/isisdataeval/IsisDataModel.cpp | 16 +- .../system/apps/isisdataeval/isisdataeval.cpp | 10 +- .../system/apps/kerneldbgen/SpiceDbGen.cpp | 4 +- .../system/apps/kerneldbgen/kerneldbgen.cpp | 6 +- isis/src/system/apps/messckgen/main.cpp | 10 +- isis/src/system/apps/messspkgen/main.cpp | 4 +- isis/src/system/apps/prtloganalyzer/main.cpp | 2 +- isis/src/system/objs/KernelDb/KernelDb.cpp | 6 +- .../apps/tgocassis2isis/tgocassis2isis.cpp | 16 +- .../tgo/apps/tgocassismos/tgocassismos.cpp | 10 +- .../apps/tgocassisrdrgen/tgocassisrdrgen.cpp | 4 +- .../apps/tgocassisstitch/tgocassisstitch.cpp | 4 +- .../tgocassisunstitch/tgocassisunstitch.cpp | 2 +- isis/src/viking/apps/vik2isis/main.cpp | 6 +- isis/src/viking/apps/vikcal/CalParameters.cpp | 8 +- isis/src/viking/apps/vikcal/main.cpp | 2 +- isis/src/viking/apps/vikcal/vikcal.cpp | 2 +- isis/src/viking/apps/viknobutter/main.cpp | 2 +- .../viking/objs/VikingCamera/VikingCamera.cpp | 6 +- isis/src/voyager/apps/voy2isis/main.cpp | 8 +- isis/src/voyager/apps/voycal/main.cpp | 10 +- isis/src/voyager/apps/voyramp/main.cpp | 6 +- .../objs/VoyagerCamera/VoyagerCamera.cpp | 6 +- isis/tests/AffineTests.cpp | 4 +- isis/tests/Area3DTests.cpp | 6 +- .../BundleObservationSolveSettingsTests.cpp | 10 +- isis/tests/ColorTests.cpp | 2 +- isis/tests/ColumnTests.cpp | 10 +- isis/tests/FunctionalTestsCnetstats.cpp | 2 +- isis/tests/FunctionalTestsEnlarge.cpp | 2 +- isis/tests/FunctionalTestsMosrange.cpp | 2 +- isis/tests/FunctionalTestsMvic2isis.cpp | 2 +- isis/tests/FunctionalTestsOverlapstats.cpp | 2 +- isis/tests/FunctionalTestsSpiceserver.cpp | 2 +- isis/tests/GaussianDistributionTests.cpp | 2 +- isis/tests/IDTests.cpp | 6 +- isis/tests/IsisDataFixtures.cpp | 2 +- isis/tests/LatitudeTests.cpp | 18 +- isis/tests/Mocks.h | 2 +- isis/tests/TestUtilities.cpp | 2 +- isis/tests/UnitTestImagePolygon.cpp | 12 +- isis/tests/statsTests.cpp | 2 +- 720 files changed, 4175 insertions(+), 4307 deletions(-) diff --git a/isis/src/apollo/apps/apollocal/apollocal.cpp b/isis/src/apollo/apps/apollocal/apollocal.cpp index d658efc821..81759d69b7 100644 --- a/isis/src/apollo/apps/apollocal/apollocal.cpp +++ b/isis/src/apollo/apps/apollocal/apollocal.cpp @@ -24,7 +24,7 @@ namespace Isis { void apollocal(UserInterface &ui) { - Cube cube(ui.GetCubeName("FROM"), "r"); + Cube cube(ui.GetCubeName("FROM").toStdString(), "r"); apollocal(&cube, ui); } diff --git a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp b/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp index c55fc84006..730d1ee2ee 100644 --- a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp +++ b/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp @@ -41,7 +41,7 @@ namespace Isis { double GoodnessOfFit = 1.0; void apollofindrx(UserInterface &ui) { - Cube *cube = new Cube(ui.GetCubeName("FROM"), "rw"); + Cube *cube = new Cube(ui.GetCubeName("FROM").toStdString(), "rw"); apollofindrx(cube, ui); } diff --git a/isis/src/apollo/apps/apollopaninit/main.cpp b/isis/src/apollo/apps/apollopaninit/main.cpp index d8c76dbc13..4d9984193a 100644 --- a/isis/src/apollo/apps/apollopaninit/main.cpp +++ b/isis/src/apollo/apps/apollopaninit/main.cpp @@ -121,7 +121,7 @@ void IsisMain() { } catch (IException &e) { throw IException(IException::User, - "Unable to open the file [" + ui.GetCubeName("FROM") + "] as a cube.", + "Unable to open the file [" + ui.GetCubeName("FROM").toStdString() + "] as a cube.", _FILEINFO_); } @@ -243,7 +243,7 @@ void IsisMain() { QString naifTarget = QString("IAU_MOOM"); namfrm_c(naifTarget.toLatin1().data(), &frameCode); if(frameCode == 0) { - QString msg = "Can not find NAIF code for [" + naifTarget + "]"; + std::string msg = "Can not find NAIF code for [" + naifTarget + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -630,7 +630,7 @@ void IsisMain() { //parameters for maximum correlation autoregestration // see: file:///usgs/pkgs/isis3nightly2011-09-21/isis/doc/documents/patternSMatch/patternSMatch.html#DistanceTolerance FileName fiducialPvl("$ISISROOT/appdata/templates/apollo/PanFiducialFinder.def"); - pvl.read(fiducialPvl.expanded().toStdString()); //read in the autoreg parameters + pvl.read(fiducialPvl.expanded()); //read in the autoreg parameters AutoReg *arS = AutoRegFactory::Create(pvl); *arS->PatternChip() = patternS; //patternS chip is constant @@ -681,7 +681,7 @@ void IsisMain() { } } if(s>=averageLines+searchCellSize/2.0) { - QString msg = "Unable to locate a fiducial mark in the input cube [" + fileName + + std::string msg = "Unable to locate a fiducial mark in the input cube [" + fileName + "]. Check FROM and MICRONS parameters."; throw IException(IException::Io, msg, _FILEINFO_); return; @@ -804,7 +804,7 @@ void Load_Kernel(Isis::PvlKeyword &key) { if(QString::fromStdString(key[i]).toUpper() == "TABLE") continue; Isis::FileName file(QString::fromStdString(key[i])); if(!file.fileExists()) { - QString msg = "Spice file does not exist [" + file.expanded() + "]"; + std::string msg = "Spice file does not exist [" + file.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } QString fileName(file.expanded()); diff --git a/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp b/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp index e18d7ae669..90c825d9fe 100644 --- a/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp +++ b/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp @@ -167,7 +167,7 @@ namespace Isis { //parameters for maximum correlation autoregestration // see: ///usgs/pkgs/isis3nightly2011-09-21/isis/doc/documents/patternSMatch/patternSMatch.html#DistanceTolerance FileName fiducialPvl("$ISISROOT/appdata/templates/apollo/PanFiducialFinder.def"); - pvl.read(fiducialPvl.expanded().toStdString()); //read in the autoreg parameters + pvl.read(fiducialPvl.expanded()); //read in the autoreg parameters AutoReg *arS = AutoRegFactory::Create(pvl); *arS->PatternChip() = patternS; //patternS chip is constant @@ -232,7 +232,7 @@ namespace Isis { } } if (s >= averageLines + searchCellSize / 2.0) { - QString msg = "Unable to locate a fiducial mark in the input cube [" + panC[i]->fileName() + std::string msg = "Unable to locate a fiducial mark in the input cube [" + panC[i]->fileName() + "]. Check FROM and MICRONS parameters."; throw IException(IException::Io, msg, _FILEINFO_); return; diff --git a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp b/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp index 88aa836e1f..7ecbb5152c 100644 --- a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp +++ b/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp @@ -57,12 +57,12 @@ namespace Isis { // Check reseau status and make sure it is not nominal or removed if ((std::string)status == "Nominal") { - QString msg = "Input file [" + in + + std::string msg = "Input file [" + in + "] appears to have nominal reseau status. You must run findrx first."; throw IException(IException::User,msg, _FILEINFO_); } if ((std::string)status == "Removed") { - QString msg = "Input file [" + in + + std::string msg = "Input file [" + in + "] appears to already have reseaus removed."; throw IException(IException::User,msg, _FILEINFO_); } diff --git a/isis/src/apollo/apps/apollowarp/main.cpp b/isis/src/apollo/apps/apollowarp/main.cpp index 7a0471a49c..c823f3e77d 100644 --- a/isis/src/apollo/apps/apollowarp/main.cpp +++ b/isis/src/apollo/apps/apollowarp/main.cpp @@ -82,7 +82,7 @@ void IsisMain() { interp = new Interpolator(Interpolator::CubicConvolutionType); } else { - QString msg = "Unknow value for INTERP [" + + std::string msg = "Unknow value for INTERP [" + ui.GetString("INTERP") + "]"; throw IException(IException::Programmer, msg,_FILEINFO_); } diff --git a/isis/src/apollo/objs/Apollo/Apollo.h b/isis/src/apollo/objs/Apollo/Apollo.h index faed80550f..ca64cfb8ed 100644 --- a/isis/src/apollo/objs/Apollo/Apollo.h +++ b/isis/src/apollo/objs/Apollo/Apollo.h @@ -264,7 +264,7 @@ namespace Isis { p_imagePixelPitch = 200.5; } else { - QString msg = "Unknown instrument: " + instrument; + std::string msg = "Unknown instrument: " + instrument; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -290,7 +290,7 @@ namespace Isis { else if (IsPanoramic()) p_naifFrameCode = "-917230"; } else { - QString msg = "Unknown spacecraft: " + spacecraft; + std::string msg = "Unknown spacecraft: " + spacecraft; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/appjit/PixelOffset.cpp b/isis/src/base/apps/appjit/PixelOffset.cpp index e7859ef150..4bfa2259d8 100644 --- a/isis/src/base/apps/appjit/PixelOffset.cpp +++ b/isis/src/base/apps/appjit/PixelOffset.cpp @@ -124,7 +124,7 @@ namespace Isis { loc0 = p_lines[index]; } else { - QString msg; + std::string msg; msg = "Error in extrapolation code"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -164,7 +164,7 @@ namespace Isis { // Make sure angles aren't already loaded TBD /* if () { - QString msg = "An angle cache has already been created"; + std::string msg = "An angle cache has already been created"; throw Isis::iException::Message(Isis::iException::Programmer,msg,_FILEINFO_); } */ @@ -236,7 +236,7 @@ namespace Isis { } if(fitAng1->Knowns() == 0) { - QString msg; + std::string msg; msg = "Cube time range is not covered by jitter file"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/appjit/main.cpp b/isis/src/base/apps/appjit/main.cpp index e077bd0164..23fd6f0cbd 100644 --- a/isis/src/base/apps/appjit/main.cpp +++ b/isis/src/base/apps/appjit/main.cpp @@ -31,7 +31,7 @@ void IsisMain() { list.read(ui.GetFileName("FROMLIST")); if(list.size() < 1) { - QString msg = "The input list file [" + ui.GetFileName("FROMLIST") + "is empty"; + std::string msg = "The input list file [" + ui.GetFileName("FROMLIST") + "is empty"; throw IException(IException::User, msg, _FILEINFO_); } @@ -42,7 +42,7 @@ void IsisMain() { } if(ifile >= list.size()) { - QString msg = "The master file, [" + FileName(ui.GetCubeName("MASTER")).expanded() + " is not included in " + + std::string msg = "The master file, [" + FileName(ui.GetCubeName("MASTER")).expanded() + " is not included in " + "the input list file " + ui.GetCubeName("FROMLIST") + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -65,7 +65,7 @@ void IsisMain() { // Get the camera Camera *cam = cube.camera(); if(cam->DetectorMap()->LineRate() == 0.0) { - QString msg = "[" + ui.GetCubeName("MASTER") + "] is not a line scan camera image"; + std::string msg = "[" + ui.GetCubeName("MASTER") + "] is not a line scan camera image"; throw IException(IException::User, msg, _FILEINFO_); } @@ -142,7 +142,7 @@ void IsisMain() { // Get the camera and make sure it is a line scan camera Camera *cam = cube.camera(); if(cam->DetectorMap()->LineRate() == 0.0) { - QString msg = "[" + ui.GetCubeName("FROM") + "] is not a line scan camera"; + std::string msg = "[" + ui.GetCubeName("FROM") + "] is not a line scan camera"; throw IException(IException::User, msg, _FILEINFO_); } // Write out the pointing cache as a table @@ -166,7 +166,7 @@ void IsisMain() { Application::Log(gp); } catch(IException &e) { - QString msg; + std::string msg; if(!step2) { msg = "Unable to fit pointing for [" + ui.GetCubeName("MASTER") + "]"; } diff --git a/isis/src/base/apps/ascii2isis/main.cpp b/isis/src/base/apps/ascii2isis/main.cpp index 81edeffabf..1a469f67cd 100644 --- a/isis/src/base/apps/ascii2isis/main.cpp +++ b/isis/src/base/apps/ascii2isis/main.cpp @@ -64,7 +64,7 @@ void IsisMain() { fin.open(from.toLatin1().data(), std::ios::in); if (!fin.is_open()) { - QString msg = "Cannot open input file [" + from + "]"; + std::string msg = "Cannot open input file [" + from + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -119,7 +119,7 @@ void ascii2isis(Buffer &out) { // If we've reached the end of file and stream is bad, we didn't find enough numerical data if (!fin && fin.eof()) { - QString msg = "End of file reached. There is not enough data in [" + from; + std::string msg = "End of file reached. There is not enough data in [" + from; msg += "] to fill the output cube."; throw IException(IException::User, msg, _FILEINFO_); } @@ -128,7 +128,7 @@ void ascii2isis(Buffer &out) { if (!fin) { // Clean stream to get the position and invalid data that broke the stream fin.clear(); - QString msg = "Could not extract non-numerical data [" + QString(fin.peek()) + "] "; + std::string msg = "Could not extract non-numerical data [" + QString(fin.peek()) + "] "; msg += "at byte position [" + QString::number(fin.tellg()) + "]. "; msg += "Please make sure to skip any header data in [" + from + "]."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/base/apps/automos/automos.cpp b/isis/src/base/apps/automos/automos.cpp index 7cc1cca5e0..70b5e2eec6 100644 --- a/isis/src/base/apps/automos/automos.cpp +++ b/isis/src/base/apps/automos/automos.cpp @@ -15,7 +15,7 @@ namespace Isis { FileList list; // Get the list of cubes to mosaic - list.read(FileName(ui.GetFileName("FROMLIST"))); + list.read(FileName(ui.GetFileName("FROMLIST").toStdString())); fstream os; bool olistFlag = false; @@ -76,9 +76,9 @@ namespace Isis { bool mosaicCreated = false; for (int i = 0; i < list.size(); i++) { - if (!m.StartProcess(list[i].toString())) { + if (!m.StartProcess(QString::fromStdString(list[i].toString()))) { PvlGroup outsiders("Outside"); - outsiders += PvlKeyword("File", (list[i].toString().toStdString())); + outsiders += PvlKeyword("File", (list[i].toString())); Application::AppendAndLog(outsiders, log); } else { diff --git a/isis/src/base/apps/automos/main.cpp b/isis/src/base/apps/automos/main.cpp index 3134c8aabc..de00426b56 100644 --- a/isis/src/base/apps/automos/main.cpp +++ b/isis/src/base/apps/automos/main.cpp @@ -55,7 +55,7 @@ void calcRange(double &minLat, double &maxLat, double &minLon, double &maxLon) { firstProj = proj; } else if(*proj != *firstProj) { - QString msg = "Mapping groups do not match between cubes [" + list[0].toString() + + std::string msg = "Mapping groups do not match between cubes [" + list[0].toString() + "] and [" + list[i].toString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/autoregtemplate/main.cpp b/isis/src/base/apps/autoregtemplate/main.cpp index 33e718c761..b1878c19b5 100644 --- a/isis/src/base/apps/autoregtemplate/main.cpp +++ b/isis/src/base/apps/autoregtemplate/main.cpp @@ -77,18 +77,18 @@ void IsisMain() { // Make sure the pattern chip is not just one pixel if(psamp + pline < 3) { - QString msg = "The Pattern Chip must be larger than one pixel for the "; + std::string msg = "The Pattern Chip must be larger than one pixel for the "; msg += "autoregistration to work properly"; throw IException(IException::User, msg, _FILEINFO_); } // Make sure the pattern chip is smaller than the search chip if(ssamp < psamp || sline < pline) { - QString msg = "The Pattern Chip must be smaller than the Search Chip"; + std::string msg = "The Pattern Chip must be smaller than the Search Chip"; throw IException(IException::User, msg, _FILEINFO_); } // Make sure the pattern chip spans at least a 3x3 window in the search chip if(psamp + 2 > ssamp || pline + 2 > sline) { - QString msg = "The Pattern Chip must span at least a 3x3 window in the "; + std::string msg = "The Pattern Chip must span at least a 3x3 window in the "; msg += "Search Chip"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/bandnorm/bandnorm.cpp b/isis/src/base/apps/bandnorm/bandnorm.cpp index 1838c182bc..d5bdcc290a 100644 --- a/isis/src/base/apps/bandnorm/bandnorm.cpp +++ b/isis/src/base/apps/bandnorm/bandnorm.cpp @@ -31,7 +31,7 @@ namespace Isis { const QString &delimiters = " "); void bandnorm(UserInterface &ui) { - Cube icube(ui.GetCubeName("FROM"), "r"); + Cube icube(ui.GetCubeName("FROM").toStdString(), "r"); bandnorm(&icube, ui); } @@ -64,7 +64,7 @@ namespace Isis { pencil.Open(ui.GetFileName("SPECTRUM")); std::cout << pencil.LineCount() << " " << icube->bandCount() << std::endl; if(pencil.LineCount() - 1 < icube->bandCount()) { - QString msg = "The spectral pencil file [" + ui.GetAsString("SPECTRUM") + + std::string msg = "The spectral pencil file [" + ui.GetAsString("SPECTRUM") + "] does not contain enough data for all bands."; throw IException(IException::User, msg, _FILEINFO_); } @@ -85,7 +85,7 @@ namespace Isis { } } if(column < 0 || (unsigned)column > tokens.size()) { - QString msg = "The column specified in file [" + ui.GetFileName("SPECTRUM") + std::string msg = "The column specified in file [" + ui.GetFileName("SPECTRUM") + "] was not found."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/blend/main.cpp b/isis/src/base/apps/blend/main.cpp index e44556c0a0..a8e72bc96e 100644 --- a/isis/src/base/apps/blend/main.cpp +++ b/isis/src/base/apps/blend/main.cpp @@ -147,7 +147,7 @@ void IsisMain() { QFile::remove(output); if (!QFile::copy(input, output)) { - QString msg = "Cannot create output cube [" + output + "]"; + std::string msg = "Cannot create output cube [" + output + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -236,7 +236,7 @@ void IsisMain() { if (ui.GetBoolean("ERROR")) { for (int i = 1; i < inputs.size(); i++) { if (!overlapped.contains(inputs[i].toString())) { - QString msg = "Input Cube [" + inputs[i].toString() + + std::string msg = "Input Cube [" + inputs[i].toString() + "] does not overlap another cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -395,7 +395,7 @@ void readOutputs(QString outName, const FileList &inputs, FileList &outputs) { // Make sure each file in the tolist matches a file in the fromlist if (outputs.size() != inputs.size()) { - QString msg = "There must be exactly one output image in the TOLIST for " + std::string msg = "There must be exactly one output image in the TOLIST for " "each input image in the FROMLIST"; throw IException(IException::User, msg, _FILEINFO_); } @@ -404,7 +404,7 @@ void readOutputs(QString outName, const FileList &inputs, FileList &outputs) { // corresponding input file for (int i = 0; i < outputs.size(); i++) { if (outputs[i].toString().compare(inputs[i].toString()) == 0) { - QString msg = "The to list file [" + outputs[i].toString() + + std::string msg = "The to list file [" + outputs[i].toString() + "] has the same name as its corresponding from list file."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/butterworth/main.cpp b/isis/src/base/apps/butterworth/main.cpp index d33bec9d4e..69aff64404 100644 --- a/isis/src/base/apps/butterworth/main.cpp +++ b/isis/src/base/apps/butterworth/main.cpp @@ -51,7 +51,7 @@ void IsisMain() { p.StartProcess(bandstop); } else { - QString msg = "Unknow value for TYPE [" + + std::string msg = "Unknow value for TYPE [" + ui.GetString("TYPE") + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/cam2map/cam2map.cpp b/isis/src/base/apps/cam2map/cam2map.cpp index b1370b8259..9b0e37749f 100644 --- a/isis/src/base/apps/cam2map/cam2map.cpp +++ b/isis/src/base/apps/cam2map/cam2map.cpp @@ -53,7 +53,7 @@ namespace Isis { // Make sure it is not the sky if (incam->target()->isSky()) { - QString msg = "The image [" + ui.GetCubeName("FROM") + + std::string msg = "The image [" + ui.GetCubeName("FROM") + "] is targeting the sky, use skymap instead."; throw IException(IException::User, msg, _FILEINFO_); } @@ -219,7 +219,7 @@ namespace Isis { } else if (ui.GetString("LONSEAM") == "ERROR") { - QString msg = "The image [" + ui.GetCubeName("FROM") + "] crosses the " + + std::string msg = "The image [" + ui.GetCubeName("FROM") + "] crosses the " + "longitude seam"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/cam2map/main.cpp b/isis/src/base/apps/cam2map/main.cpp index 43e1f5d649..775cb5b1ce 100644 --- a/isis/src/base/apps/cam2map/main.cpp +++ b/isis/src/base/apps/cam2map/main.cpp @@ -74,7 +74,7 @@ void loadMapRes() { ui.PutAsString("PIXRES", "MPP"); } else { - QString msg = "No resolution value found in [" + ui.GetFileName("MAP") + "]"; + std::string msg = "No resolution value found in [" + ui.GetFileName("MAP") + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -136,7 +136,7 @@ void loadMapRange() { ui.PutAsString("DEFAULTRANGE", "MAP"); if (count < 4) { - QString msg = "One or more of the values for the ground range was not found"; + std::string msg = "One or more of the values for the ground range was not found"; msg += " in [" + ui.GetFileName("MAP") + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/caminfo/CamTools.cpp b/isis/src/base/apps/caminfo/CamTools.cpp index cf610766e2..2c4abebe80 100644 --- a/isis/src/base/apps/caminfo/CamTools.cpp +++ b/isis/src/base/apps/caminfo/CamTools.cpp @@ -361,7 +361,7 @@ namespace Isis { void BandGeometry::generateGeometryKeys(PvlObject &pband) { if(size() <= 0) { - QString mess = "No Band geometry available!"; + std::string mess = "No Band geometry available!"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -626,7 +626,7 @@ namespace Isis { void BandGeometry::generatePolygonKeys(PvlObject &pband) { if(size() <= 0) { - QString mess = "No Band geometry available!"; + std::string mess = "No Band geometry available!"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/caminfo/caminfo.cpp b/isis/src/base/apps/caminfo/caminfo.cpp index 2dc5469b94..5c68eb5892 100644 --- a/isis/src/base/apps/caminfo/caminfo.cpp +++ b/isis/src/base/apps/caminfo/caminfo.cpp @@ -88,7 +88,7 @@ namespace Isis{ params.addObject(p); } else { - QString msg = "Could not find OriginalLabel " + std::string msg = "Could not find OriginalLabel " "in input file [" + incube->fileName() + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -147,7 +147,7 @@ namespace Isis{ // Output the result fstream outFile; QString sOutFile = ui.GetAsString("TO"); - bool appending = ui.GetBoolean("APPEND") && FileName(sOutFile).fileExists(); + bool appending = ui.GetBoolean("APPEND") && FileName(sOutFile.toStdString()).fileExists(); if(appending) outFile.open(sOutFile.toLatin1().data(), std::ios::out | std::ios::app); else @@ -237,7 +237,7 @@ namespace Isis{ } if (incube->hasGroup("Mapping")) { - QString msg = "Caminfo expects a level 1 input cube. For more information, see:\n" + std::string msg = "Caminfo expects a level 1 input cube. For more information, see:\n" "https://isis.astrogeology.usgs.gov/documents/Glossary/Glossary.html#Level1"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -248,7 +248,7 @@ namespace Isis{ general->append(MakePair("IsisVersion", Application::Version())); general->append(MakePair("RunDate", iTime::CurrentGMT())); general->append(MakePair("IsisId", SerialNumber::Compose(*incube))); - general->append(MakePair("From", FileName(incube->fileName()).baseName() + ".cub")); + general->append(MakePair("From", QString::fromStdString(FileName(incube->fileName().toStdString()).baseName() + ".cub"))); general->append(MakePair("Lines", toString(incube->lineCount()))); general->append(MakePair("Samples", toString(incube->sampleCount()))); general->append(MakePair("Bands", toString(incube->bandCount()))); @@ -421,7 +421,7 @@ namespace Isis{ } } else { - QString msg = "Invalid INCTYPE option[" + incType + "]"; + std::string msg = "Invalid INCTYPE option[" + incType + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -489,7 +489,7 @@ namespace Isis{ // Check if the user requires valid image center geometry if(ui.GetBoolean("VCAMERA") && (!bandGeom->hasCenterGeometry())) { - QString msg = "Image center does not project in camera model"; + std::string msg = "Image center does not project in camera model"; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/campt/campt.cpp b/isis/src/base/apps/campt/campt.cpp index 93173929b9..cf400a3232 100644 --- a/isis/src/base/apps/campt/campt.cpp +++ b/isis/src/base/apps/campt/campt.cpp @@ -29,7 +29,7 @@ namespace Isis{ void writePoints(const UserInterface &ui, QList camPoints, Pvl *log); void campt(UserInterface &ui, Pvl *log) { - Cube *cube = new Cube(ui.GetCubeName("FROM"), "r"); + Cube *cube = new Cube(ui.GetCubeName("FROM").toStdString(), "r"); campt(cube, ui, log); } @@ -74,7 +74,7 @@ namespace Isis{ if (usePointList) { CSVReader reader; - reader.read(FileName(ui.GetFileName("COORDLIST")).expanded()); + reader.read(QString::fromStdString(FileName(ui.GetFileName("COORDLIST").toStdString()).expanded())); if (!reader.isTableValid(reader.getTable()) || reader.columns() != 2) { std::string msg = "Coordinate file formatted incorrectly.\n" @@ -176,14 +176,14 @@ namespace Isis{ QString outFile; // Get user params from ui if (ui.WasEntered("TO")) { - outFile = FileName(ui.GetFileName("TO")).expanded(); + outFile = QString::fromStdString(FileName(ui.GetFileName("TO").toStdString()).expanded()); } bool append = ui.GetBoolean("APPEND"); QString fileFormat = ui.GetString("FORMAT"); PvlGroup *point = NULL; for (int p = 0; p < camPoints.size(); p++) { - bool fileExists = FileName(outFile).fileExists(); + bool fileExists = FileName(outFile.toStdString()).fileExists(); prog.CheckStatus(); point = camPoints[p]; diff --git a/isis/src/base/apps/camrange/camrange.cpp b/isis/src/base/apps/camrange/camrange.cpp index 13be4c86cd..da6990e57f 100644 --- a/isis/src/base/apps/camrange/camrange.cpp +++ b/isis/src/base/apps/camrange/camrange.cpp @@ -13,7 +13,7 @@ using namespace Isis; namespace Isis { void camrange(UserInterface &ui, Pvl *log) { - Cube *cube = new Cube( ui.GetCubeName("FROM"), "r"); + Cube *cube = new Cube(ui.GetCubeName("FROM").toStdString(), "r"); camrange(cube, ui, log); } diff --git a/isis/src/base/apps/camstats/camstats.cpp b/isis/src/base/apps/camstats/camstats.cpp index 8123bffac7..75b404502f 100644 --- a/isis/src/base/apps/camstats/camstats.cpp +++ b/isis/src/base/apps/camstats/camstats.cpp @@ -57,8 +57,8 @@ namespace Isis { } if(ui.WasEntered("TO")) { - QString outfile = FileName(ui.GetFileName("TO")).expanded(); - bool exists = FileName(outfile).fileExists(); + QString outfile = QString::fromStdString(FileName(ui.GetFileName("TO").toStdString()).expanded()); + bool exists = FileName(outfile.toStdString()).fileExists(); bool append = ui.GetBoolean("APPEND"); // If the user chose a format of PVL, then write to the output file ("TO") @@ -146,7 +146,7 @@ namespace Isis { } - os << FileName(from).expanded() << ","; + os << FileName(from.toStdString()).expanded() << ","; //call the function to write out the values for each group writeFlat(os, camStats.getLatStat()); writeFlat(os, camStats.getLonStat()); diff --git a/isis/src/base/apps/cathist/main.cpp b/isis/src/base/apps/cathist/main.cpp index 03ba4af8af..2b1f2d8060 100644 --- a/isis/src/base/apps/cathist/main.cpp +++ b/isis/src/base/apps/cathist/main.cpp @@ -15,13 +15,13 @@ void IsisMain() { // Get user entered file name & mode UserInterface &ui = Application::GetUserInterface(); - FileName fromfile(ui.GetCubeName("FROM")); + FileName fromfile(ui.GetCubeName("FROM").toStdString()); QString mode = ui.GetString("MODE"); FileName tofile; bool append = false; if (ui.WasEntered("TO")) { - tofile = FileName(ui.GetFileName("TO")); + tofile = FileName(ui.GetFileName("TO").toStdString()); append = ui.GetBoolean("APPEND"); } @@ -37,10 +37,10 @@ void IsisMain() { } else if (ui.WasEntered("TO")) { if (append) { - pvl.append(tofile.expanded().toStdString()); + pvl.append(tofile.expanded()); } else { - pvl.write(tofile.expanded().toStdString()); + pvl.write(tofile.expanded()); } } else { diff --git a/isis/src/base/apps/catlab/main.cpp b/isis/src/base/apps/catlab/main.cpp index 1a78ef13fb..fd18768c4e 100644 --- a/isis/src/base/apps/catlab/main.cpp +++ b/isis/src/base/apps/catlab/main.cpp @@ -22,10 +22,10 @@ void IsisMain() { // Output to file if entered if(ui.WasEntered("TO")) { if (ui.GetBoolean("APPEND")) { - label.append(FileName(ui.GetFileName("TO")).expanded().toStdString()); + label.append(FileName(ui.GetFileName("TO").toStdString()).expanded()); } else { - label.write(FileName(ui.GetFileName("TO")).expanded().toStdString()); + label.write(FileName(ui.GetFileName("TO").toStdString()).expanded()); } } diff --git a/isis/src/base/apps/catoriglab/main.cpp b/isis/src/base/apps/catoriglab/main.cpp index b4ba454d45..de56805aa0 100644 --- a/isis/src/base/apps/catoriglab/main.cpp +++ b/isis/src/base/apps/catoriglab/main.cpp @@ -31,10 +31,10 @@ void IsisMain() { } else if (ui.WasEntered("TO")) { if (ui.GetBoolean("APPEND")) { - pvl.append(FileName(ui.GetFileName("TO")).expanded().toStdString()); + pvl.append(FileName(ui.GetFileName("TO").toStdString()).expanded()); } else { - pvl.write(FileName(ui.GetFileName("TO")).expanded().toStdString()); + pvl.write(FileName(ui.GetFileName("TO").toStdString()).expanded()); } } else { @@ -49,7 +49,7 @@ void IsisMain() { } else if (ui.WasEntered("TO")) { // Open the output file - QFile outFile( FileName( ui.GetFileName("TO") ).expanded() ); + QFile outFile( FileName( ui.GetFileName("TO").toStdString() ).expanded() ); QIODevice::OpenMode openMode; if (ui.GetBoolean("APPEND")) { openMode = QIODevice::WriteOnly | QIODevice::Append; @@ -58,8 +58,8 @@ void IsisMain() { openMode = QIODevice::WriteOnly | QIODevice::Truncate; } if ( !outFile.open(openMode) ) { - QString msg = "Unable to open output file [" + - FileName( ui.GetFileName("TO") ).expanded() + + std::string msg = "Unable to open output file [" + + FileName( ui.GetFileName("TO").toStdString() ).expanded() + "] with write permissions."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -76,7 +76,7 @@ void IsisMain() { } } else { - QString msg = "Could not find OriginalLabel or OriginalXmlLabel " + std::string msg = "Could not find OriginalLabel or OriginalXmlLabel " "in input file [" + file + "]."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/center/main.cpp b/isis/src/base/apps/center/main.cpp index 353d42b87b..ed61bd0f7e 100644 --- a/isis/src/base/apps/center/main.cpp +++ b/isis/src/base/apps/center/main.cpp @@ -70,7 +70,7 @@ void IsisMain() { if (ui.WasEntered("TO")) { if (sumall.ValidPixels() == 0) { - QString mess = "No valid pixels so cannot compute center in " + icube->fileName(); + std::string mess = "No valid pixels so cannot compute center in " + icube->fileName(); throw IException(IException::User, mess, _FILEINFO_); } double sTrans = sMiddle - csamp; diff --git a/isis/src/base/apps/ckwriter/CkKernelWriter.cpp b/isis/src/base/apps/ckwriter/CkKernelWriter.cpp index 5057893df0..b29f0f90ce 100644 --- a/isis/src/base/apps/ckwriter/CkKernelWriter.cpp +++ b/isis/src/base/apps/ckwriter/CkKernelWriter.cpp @@ -92,13 +92,13 @@ namespace Isis { void CkKernelWriter::open(const QString &kfile, const QString &intCkName) { NaifStatus::CheckErrors(); - FileName kf(kfile); + FileName kf(kfile.toStdString()); if ( kf.fileExists() ) { - QString full_kf = kf.expanded(); + QString full_kf = QString::fromStdString(kf.expanded()); QFile::remove(full_kf); } SpiceInt myHandle; - ckopn_c(kf.expanded().toLatin1().data(), intCkName.toLatin1().data(), _comSize, &myHandle); + ckopn_c(kf.expanded().c_str(), intCkName.toLatin1().data(), _comSize, &myHandle); _handle = myHandle; NaifStatus::CheckErrors(); @@ -201,7 +201,7 @@ namespace Isis { void CkKernelWriter::writeCk2(const CkSpiceSegment &segment) const { if ( !segment.hasAngularVelocities() ) { - QString mess = "Type 2 CK kernels require angular velocities"; + std::string mess = "Type 2 CK kernels require angular velocities"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp index 9e1bd26d70..2a9e3edb7b 100644 --- a/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp +++ b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp @@ -200,7 +200,7 @@ void CkSpiceSegment::import(Cube &cube, const QString &tblname) { if ( _name.isEmpty() ) { _name = getKeyValue(*label, "ProductId"); if (_name.isEmpty() ) { - _name = FileName(_fname).baseName(); + _name = QString::fromStdString(FileName(_fname.toStdString()).baseName()); } } @@ -603,13 +603,13 @@ void CkSpiceSegment::getRotationMatrices(Cube &cube, Camera &camera, Table &tabl #if 0 int LtoId, LfromId; if ( !getTimeDependentFrameIds(table, LtoId, LfromId) ) { - QString mess = "Cannot determine time dependent frames! - perhaps a spiceinit is in order."; + std::string mess = "Cannot determine time dependent frames! - perhaps a spiceinit is in order."; throw IException(IException::User, mess, _FILEINFO_); } #else QVector leftFrames, rightFrames; if ( !getFrameChains(table, leftId, rightId, leftFrames, rightFrames) ) { - QString mess = "Cannot determine left/right frame chains! - perhaps a spiceinit is in order."; + std::string mess = "Cannot determine left/right frame chains! - perhaps a spiceinit is in order."; throw IException(IException::User, mess, _FILEINFO_); } #endif @@ -714,7 +714,7 @@ void CkSpiceSegment::convert(const CkSpiceSegment::SMatrix &quats, QString CkSpiceSegment::getComment() const { ostringstream comment; - FileName fname(_fname); + FileName fname(_fname.toStdString()); comment << "\n-----------------------------------------------------------------------\n" << diff --git a/isis/src/base/apps/ckwriter/SpiceKernel.cpp b/isis/src/base/apps/ckwriter/SpiceKernel.cpp index 52b7d6c1c0..2a8c552e3e 100644 --- a/isis/src/base/apps/ckwriter/SpiceKernel.cpp +++ b/isis/src/base/apps/ckwriter/SpiceKernel.cpp @@ -115,7 +115,7 @@ bool SpiceKernel::validate() const { // Now check for problems if ( 0 < errors.size() ) { - QString mess = "Time overlap conflicts are present in segment (image) list. " + std::string mess = "Time overlap conflicts are present in segment (image) list. " "This will likely create erroneous pointing in one or more " "images. You should create a seperate kernel for conflicting " "images that overlap another. Images with time overlap " diff --git a/isis/src/base/apps/ckwriter/ckwriter.cpp b/isis/src/base/apps/ckwriter/ckwriter.cpp index 47e0949d21..b50dab5519 100644 --- a/isis/src/base/apps/ckwriter/ckwriter.cpp +++ b/isis/src/base/apps/ckwriter/ckwriter.cpp @@ -17,10 +17,10 @@ namespace Isis { // Get the list of names of input CCD cubes to stitch together FileList flist; - if (ui.WasEntered("FROM")) flist.push_back(FileName(ui.GetCubeName("FROM"))); - if (ui.WasEntered("FROMLIST")) flist.read(FileName(ui.GetFileName("FROMLIST"))); + if (ui.WasEntered("FROM")) flist.push_back(FileName(ui.GetCubeName("FROM").toStdString())); + if (ui.WasEntered("FROMLIST")) flist.read(FileName(ui.GetFileName("FROMLIST").toStdString())); if (flist.size() < 1) { - QString msg = "Files must be specified in FROM and/or FROMLIST - none found!"; + std::string msg = "Files must be specified in FROM and/or FROMLIST - none found!"; throw IException(IException::User,msg,_FILEINFO_); } @@ -33,7 +33,7 @@ namespace Isis { for (int i = 0 ; i < flist.size() ; i++) { // Add and process each image - kernel.add(flist[i].toString()); + kernel.add(QString::fromStdString(flist[i].toString())); prog.CheckStatus(); } @@ -68,11 +68,11 @@ namespace Isis { // Write a summary of the documentation if (ui.WasEntered("SUMMARY")) { - QString fFile = FileName(ui.GetFileName("SUMMARY")).expanded(); + QString fFile = QString::fromStdString(FileName(ui.GetFileName("SUMMARY").toStdString()).expanded()); ofstream os; os.open(fFile.toLatin1().data(),ios::out); if (!os) { - QString mess = "Cannot create SUMMARY output file " + fFile; + std::string mess = "Cannot create SUMMARY output file " + fFile; throw IException(IException::User, mess, _FILEINFO_); } os << kernel.getSummary(comfile); diff --git a/isis/src/base/apps/crop/crop.cpp b/isis/src/base/apps/crop/crop.cpp index f03195f249..16b306538a 100644 --- a/isis/src/base/apps/crop/crop.cpp +++ b/isis/src/base/apps/crop/crop.cpp @@ -55,7 +55,7 @@ namespace Isis { // Open the input cube QString from = ui.GetAsString("FROM"); - CubeAttributeInput inAtt(from); + CubeAttributeInput inAtt(from.toStdString()); cube = new Cube(); cube->setVirtualBands(inAtt.bands()); from = ui.GetCubeName("FROM"); @@ -93,14 +93,14 @@ namespace Isis { // Make sure the number of elements do not fall outside the cube if (es > cube->sampleCount()) { cube->close(); - QString msg = "[SAMPLE+NSAMPLES-1] exceeds number of "; + std::string msg = "[SAMPLE+NSAMPLES-1] exceeds number of "; msg += "samples in the [FROM] cube"; throw IException(IException::User, msg, _FILEINFO_); } if (el > cube->lineCount()) { cube->close(); - QString msg = "[LINE+NLINES-1] exceeds number of "; + std::string msg = "[LINE+NLINES-1] exceeds number of "; msg += "lines in the [FROM] cube"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/csminit/csminit.cpp b/isis/src/base/apps/csminit/csminit.cpp index 78b8c25c00..cc6a044404 100644 --- a/isis/src/base/apps/csminit/csminit.cpp +++ b/isis/src/base/apps/csminit/csminit.cpp @@ -58,12 +58,12 @@ namespace Isis { csm::Model *model = nullptr; if (ui.WasEntered("ISD") && ui.WasEntered("STATE")) { - QString message = "Cannot enter both [ISD] and [STATE]. Please enter either [ISD] or [STATE]."; + std::string message = "Cannot enter both [ISD] and [STATE]. Please enter either [ISD] or [STATE]."; throw IException(IException::User, message, _FILEINFO_); } else if (!ui.WasEntered("ISD") && !ui.WasEntered("STATE")) { - QString message = "Either an ISD or a State string must be entered."; + std::string message = "Either an ISD or a State string must be entered."; throw IException(IException::User, message, _FILEINFO_); } @@ -106,7 +106,7 @@ namespace Isis { } if (possibleModels.size() > 1) { - QString message = "Multiple models can be created from the ISD [" + isdFilePath + "]. " + std::string message = "Multiple models can be created from the ISD [" + isdFilePath + "]. " "Re-run with the PLUGINNAME and MODELNAME parameters. " "Possible plugin & model names:\n"; for (const QStringList &modelSpec : possibleModels) { @@ -132,7 +132,7 @@ namespace Isis { QStringList modelSpec = possibleModels.front(); if (modelSpec.size() != 3) { - QString message = "Model specification [" + modelSpec.join(" ") + "] has [" + modelSpec.size() + "] elements " + std::string message = "Model specification [" + modelSpec.join(" ") + "] has [" + modelSpec.size() + "] elements " "when it should have 3 elements."; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -143,7 +143,7 @@ namespace Isis { const csm::Plugin *plugin = csm::Plugin::findPlugin(pluginName.toStdString()); if (plugin == NULL) { - QString message = "Cannot find requested Plugin: [" + pluginName + "]."; + std::string message = "Cannot find requested Plugin: [" + pluginName + "]."; throw IException(IException::User, message, _FILEINFO_); } @@ -156,21 +156,21 @@ namespace Isis { model = plugin->constructModelFromISD(nitf21Isd, modelName.toStdString()); } else { - QString message = "Invalid ISD format specifications [" + isdFormat + "]."; + std::string message = "Invalid ISD format specifications [" + isdFormat + "]."; throw IException(IException::Programmer, message, _FILEINFO_); } } // end of ISD if statement else if (ui.WasEntered("STATE")) { - FileName stateFilePath = ui.GetFileName("STATE"); + FileName stateFilePath = ui.GetFileName("STATE").toStdString(); - std::ifstream file(stateFilePath.expanded().toStdString()); + std::ifstream file(stateFilePath.expanded()); std::stringstream buffer; buffer << file.rdbuf(); QString stateString = QString::fromStdString(buffer.str()); if (!ui.WasEntered("PLUGINNAME") && !ui.WasEntered("MODELNAME")) { - QString message = "When using a State string, PLUGINNAME and MODELNAME must be specified"; + std::string message = "When using a State string, PLUGINNAME and MODELNAME must be specified"; throw IException(IException::Programmer, message, _FILEINFO_); } pluginName = ui.GetString("PLUGINNAME"); @@ -178,7 +178,7 @@ namespace Isis { const csm::Plugin *plugin = csm::Plugin::findPlugin(pluginName.toStdString()); if (plugin == NULL) { - QString message = "Cannot find requested Plugin: [" + pluginName + "]."; + std::string message = "Cannot find requested Plugin: [" + pluginName + "]."; throw IException(IException::User, message, _FILEINFO_); } @@ -187,7 +187,7 @@ namespace Isis { model = plugin->constructModelFromState(stateString.toStdString()); } else { - QString message = "Could not construct sensor model using STATE string and MODELNAME: [" + modelName + "]"; + std::string message = "Could not construct sensor model using STATE string and MODELNAME: [" + modelName + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } } // end of State else statement @@ -488,7 +488,7 @@ namespace Isis { cube->write(originalFootprint); } - QString message = "Failed to create a CSMCamera."; + std::string message = "Failed to create a CSMCamera."; throw IException(e, IException::Unknown, message, _FILEINFO_); } } diff --git a/isis/src/base/apps/cubeavg/main.cpp b/isis/src/base/apps/cubeavg/main.cpp index 301df4d8cd..b11263ba47 100644 --- a/isis/src/base/apps/cubeavg/main.cpp +++ b/isis/src/base/apps/cubeavg/main.cpp @@ -49,12 +49,12 @@ void IsisMain() { compute(centers, widths, ocube); } else { - QString message = "The BandBin in your input cube does not have a Center value."; + std::string message = "The BandBin in your input cube does not have a Center value."; throw IException(IException::User, message, _FILEINFO_); } } else { - QString message = "There is not a BandBin Group in the input cube."; + std::string message = "There is not a BandBin Group in the input cube."; throw IException(IException::User, message, _FILEINFO_); } } diff --git a/isis/src/base/apps/cubediff/WriteTabular.cpp b/isis/src/base/apps/cubediff/WriteTabular.cpp index cb0d9dbdd0..41cdd6921b 100644 --- a/isis/src/base/apps/cubediff/WriteTabular.cpp +++ b/isis/src/base/apps/cubediff/WriteTabular.cpp @@ -69,7 +69,7 @@ namespace Isis { QString thisTitle = thisCol.Name(); if((int)thisTitle.length() > (int)thisCol.Width()) { - QString message = "Column header [" + thisTitle + "] is wider " + + std::string message = "Column header [" + thisTitle + "] is wider " + "than the set width for column [" + toString((int)index) + "]"; throw IException(IException::User, message, _FILEINFO_); } @@ -83,7 +83,7 @@ namespace Isis { thisTitle = " " + thisTitle; } else { - QString message = "Alignment is improperly set"; + std::string message = "Alignment is improperly set"; throw IException(IException::User, message, _FILEINFO_); } }//end while @@ -140,7 +140,7 @@ namespace Isis { Write((double)item); return; } - QString message = "Wrong data type for this Column"; + std::string message = "Wrong data type for this Column"; throw IException(IException::User, message, _FILEINFO_); } QString thisItem(toString(item)); @@ -186,7 +186,7 @@ namespace Isis { Column thisCol = p_cols[p_curCol]; if(thisCol.DataType() != Column::String && thisCol.DataType() != Column::Pixel) { - QString message = "Wrong data type for this Column"; + std::string message = "Wrong data type for this Column"; throw IException(IException::User, message, _FILEINFO_); } @@ -233,7 +233,7 @@ namespace Isis { Column thisCol = p_cols[p_curCol]; if(thisCol.DataType() != Column::Real && thisCol.DataType() != Column::Pixel) { - QString message = "Wrong data type for this Column"; + std::string message = "Wrong data type for this Column"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/base/apps/cubefunc/main.cpp b/isis/src/base/apps/cubefunc/main.cpp index ca5d2cfd7b..fe5dc99d63 100644 --- a/isis/src/base/apps/cubefunc/main.cpp +++ b/isis/src/base/apps/cubefunc/main.cpp @@ -73,7 +73,7 @@ void IsisMain() { if(bad != 0) { PvlGroup results("Results"); - QString message = "Invalid input pixels converted to Isis NULL values"; + std::string message = "Invalid input pixels converted to Isis NULL values"; results += PvlKeyword("Error", message.toStdString()); results += PvlKeyword("Count", std::to_string(bad)); Application::Log(results); diff --git a/isis/src/base/apps/cubeit/cubeit.cpp b/isis/src/base/apps/cubeit/cubeit.cpp index 5a23cf4aae..f446ad44be 100644 --- a/isis/src/base/apps/cubeit/cubeit.cpp +++ b/isis/src/base/apps/cubeit/cubeit.cpp @@ -14,7 +14,7 @@ namespace Isis { void cubeit(UserInterface &ui, Pvl *log) { // Get the list of cubes to stack Process p; - FileList cubeList(ui.GetFileName("FROMLIST")); + FileList cubeList(ui.GetFileName("FROMLIST").toStdString()); FileList newcubeList; //cubes with at least 1 non-TRACKING band QList > newVirtualBands; //non-TRACKING bands to propagate @@ -31,7 +31,7 @@ namespace Isis { CubeAttributeInput inatt(cubeList[i].original()); vector bands = inatt.bands(); cube.setVirtualBands(bands); - cube.open(cubeList[i].toString()); + cube.open(QString::fromStdString(cubeList[i].toString())); if( cube.hasTable("InputImages") ) { //search through band bin group of input cube for "TRACKING" @@ -48,7 +48,7 @@ namespace Isis { filterName = bandbin.findKeyword("FilterNumber"); } else { - QString msg = "The BandBin group of a cube with tracking information [" + + std::string msg = "The BandBin group of a cube with tracking information [" + cubeList[i].toString() + "] does not have a FilterName or a FilterNumber."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -58,7 +58,7 @@ namespace Isis { newBands.push_back(QString::number(j+1)); } else { - std::string msg = "TRACKING band not propagated from " + cubeList[i].toString().toStdString(); + std::string msg = "TRACKING band not propagated from " + cubeList[i].toString(); results += PvlKeyword("UnpropagatedBand", msg); } } @@ -67,7 +67,7 @@ namespace Isis { if (newBands.size() > 0) { cube.close(); cube.setVirtualBands(newBands); - cube.open(cubeList[i].toString()); + cube.open(QString::fromStdString(cubeList[i].toString())); } //if the only provided bands are TRACKING, don't use this cube at all else { @@ -85,7 +85,7 @@ namespace Isis { else { // Make sure they are all the same size if((nsamps != cube.sampleCount()) || (nlines != cube.lineCount())) { - QString msg = "Spatial dimensions of cube [" + + std::string msg = "Spatial dimensions of cube [" + cubeList[i].toString() + "] does not match other cubes in list"; throw IException(IException::User, msg, _FILEINFO_); } @@ -112,7 +112,7 @@ namespace Isis { } cube.close(); newVirtualBands.append(newBands); - newcubeList.append(cubeList[i]); + newcubeList.push_back(cubeList[i]); } //Only write out results group if we added something to it. if (results.hasKeyword("UnpropagatedBand")) { @@ -120,13 +120,13 @@ namespace Isis { } } catch(IException &e) { - QString msg = "Invalid cube in list file [" + ui.GetFileName("FROMLIST") + "]"; + std::string msg = "Invalid cube in list file [" + ui.GetFileName("FROMLIST") + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } //if literally everything is a TRACKING band, throw an error, since we don't prop. TRACKING bands if (newcubeList.size() == 0) { - QString msg = "Only TRACKING bands supplied in [" + ui.GetFileName("FROMLIST") + "]"; + std::string msg = "Only TRACKING bands supplied in [" + ui.GetFileName("FROMLIST") + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -139,20 +139,20 @@ namespace Isis { bool match = false; QString fname = ui.GetCubeName("PROPLAB"); for(int i = 0; i < cubeList.size(); i++) { - if(fname == cubeList[i].toString()) { + if(fname == QString::fromStdString(cubeList[i].toString())) { index = i; match = true; break; } } if(!match) { - QString msg = "FileName [" + ui.GetCubeName("PROPLAB") + + std::string msg = "FileName [" + ui.GetCubeName("PROPLAB") + "] to propagate labels from is not in the list file [" + ui.GetFileName("FROMLIST") + "]"; throw IException(IException::User, msg, _FILEINFO_); } } - p2.SetInputCube(newcubeList[index].toString(), inatt); + p2.SetInputCube(QString::fromStdString(newcubeList[index].toString()), inatt); // Create the output cube CubeAttributeOutput &att = ui.GetOutputAttribute("TO"); @@ -187,7 +187,7 @@ namespace Isis { Progress *prog = m.Progress(); prog->SetText("Adding bands from Cube " + toString((int)i + 1) + - " of " + toString(newcubeList.size())); + " of " + newcubeList.size()); m.SetOutputCube("TO", ui); //update attributes to the input cube @@ -204,7 +204,7 @@ namespace Isis { } } - Cube *icube = m.SetInputCube(newcubeList[i].toString(), attrib, 1, 1, 1, -1, -1, -1); + Cube *icube = m.SetInputCube(QString::fromStdString(newcubeList[i].toString()), attrib, 1, 1, 1, -1, -1, -1); // Delete any tracking tables from the input cube if necessary icube->deleteBlob("InputImages", "Table"); diff --git a/isis/src/base/apps/cubenorm/main.cpp b/isis/src/base/apps/cubenorm/main.cpp index 2f9aa10749..fb0e378d3a 100644 --- a/isis/src/base/apps/cubenorm/main.cpp +++ b/isis/src/base/apps/cubenorm/main.cpp @@ -104,7 +104,7 @@ void IsisMain() { // vector, and that there is a vector element for each row/col if((band.size() != (unsigned int)(rowcol * totalBands)) || (st.size() != (unsigned int)(rowcol * totalBands))) { - QString message = "You have entered an invalid input file " + + std::string message = "You have entered an invalid input file " + ui.GetFileName("FROMSTATS"); throw IException(IException::Io, message, _FILEINFO_); } @@ -342,7 +342,7 @@ void tableIn(const Isis::FileName &filename) { if(!in) { - QString message = "Error opening " + filename.expanded(); + std::string message = "Error opening " + filename.expanded(); throw IException(IException::Io, message, _FILEINFO_); } diff --git a/isis/src/base/apps/demprep/demprep.cpp b/isis/src/base/apps/demprep/demprep.cpp index 97bb829f78..440e4f1451 100644 --- a/isis/src/base/apps/demprep/demprep.cpp +++ b/isis/src/base/apps/demprep/demprep.cpp @@ -256,7 +256,7 @@ namespace Isis{ // We need to create the output file ocube = new Cube(); - ocube->open(FileName(ui.GetCubeName("TO")).expanded(), "rw"); + ocube->open(QString::fromStdString(FileName(ui.GetCubeName("TO").toStdString()).expanded()), "rw"); p.StartProcess(DoWrap); diff --git a/isis/src/base/apps/errors/main.cpp b/isis/src/base/apps/errors/main.cpp index 7dbcdee4a2..5ee0e603ce 100644 --- a/isis/src/base/apps/errors/main.cpp +++ b/isis/src/base/apps/errors/main.cpp @@ -13,9 +13,9 @@ void IsisMain() { Pvl output; // Check to see if output file exists - FileName outFile = ui.GetFileName("TO"); + FileName outFile = ui.GetFileName("TO").toStdString(); if(outFile.fileExists() && !append) { - QString msg = "Output file [" + outFile.expanded() + "] already exists."; + std::string msg = "Output file [" + outFile.expanded() + "] already exists."; msg += " Append option set to False."; throw IException(IException::User, msg, _FILEINFO_); } @@ -33,10 +33,10 @@ void IsisMain() { output.addKeyword(errors); // write output to file if(!append) { - output.write(outFile.expanded().toStdString()); + output.write(outFile.expanded()); } else { - output.append(outFile.expanded().toStdString()); + output.append(outFile.expanded()); } cout << errors << endl; } diff --git a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp index a86a593f02..44cc74b740 100644 --- a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp +++ b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp @@ -12,7 +12,7 @@ using namespace std; namespace Isis { void findimageoverlaps(UserInterface &ui, bool useThread, Pvl *log) { - FileList images(ui.GetFileName("FROMLIST")); + FileList images(ui.GetFileName("FROMLIST").toStdString()); findimageoverlaps(images, ui, useThread, log); } @@ -33,11 +33,11 @@ namespace Isis { // images. This is a modified insertion sort. for (int image = 0; image < images.size(); image++) { unsigned int insertPos = 0; - QString sn = SerialNumber::Compose(images[image].toString()); + QString sn = SerialNumber::Compose(QString::fromStdString(images[image].toString())); for (insertPos = 0; insertPos < sortedList.size(); insertPos++) { if (sn.compare(sortedList[insertPos].first) < 0) break; } - pair newPair = pair(sn, images[image].toString()); + pair newPair = pair(sn, QString::fromStdString(images[image].toString())); sortedList.insert(sortedList.begin() + insertPos, newPair); } @@ -51,7 +51,7 @@ namespace Isis { // Use multi-threading to create the overlaps overlaps.FindImageOverlaps(serialNumbers, - FileName(ui.GetFileName("OVERLAPLIST")).expanded()); + QString::fromStdString(FileName(ui.GetFileName("OVERLAPLIST").toStdString()).expanded())); // This will only occur when "CONTINUE" is true, so we can assume "ERRORS" was // an entered parameter. @@ -80,7 +80,7 @@ namespace Isis { } } - outFile.write(FileName(ui.GetFileName("ERRORS")).expanded().toStdString()); + outFile.write(FileName(ui.GetFileName("ERRORS").toStdString()).expanded()); } PvlGroup results("Results"); diff --git a/isis/src/base/apps/fits2isis/fits2isis.cpp b/isis/src/base/apps/fits2isis/fits2isis.cpp index e266caac3e..f827a13de7 100644 --- a/isis/src/base/apps/fits2isis/fits2isis.cpp +++ b/isis/src/base/apps/fits2isis/fits2isis.cpp @@ -20,7 +20,7 @@ namespace Isis{ void fits2isis(UserInterface &ui) { ProcessImportFits pfits; - pfits.setFitsFile(FileName(ui.GetFileName("FROM"))); + pfits.setFitsFile(FileName(ui.GetFileName("FROM").toStdString())); if(ui.GetString("ORGANIZATION") == "BIL") { pfits.SetOrganization(ProcessImport::BIL); @@ -32,7 +32,7 @@ namespace Isis{ pfits.SetOrganization(ProcessImport::BIP); } else { - QString msg = "Unknow value for ORGANIZATION [" + ui.GetString("ORGANIZATION") + "]"; + std::string msg = "Unknow value for ORGANIZATION [" + ui.GetString("ORGANIZATION") + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/footprintinit/footprintinit.cpp b/isis/src/base/apps/footprintinit/footprintinit.cpp index 01ba059725..cb51e1ffd6 100644 --- a/isis/src/base/apps/footprintinit/footprintinit.cpp +++ b/isis/src/base/apps/footprintinit/footprintinit.cpp @@ -81,7 +81,7 @@ namespace Isis { poly.Create(*cube, sinc, linc, 1, 1, 0, 0, 1, precision); } catch (IException &e) { - QString msg = "Cannot generate polygon for [" + cube->fileName() + "]"; + std::string msg = "Cannot generate polygon for [" + cube->fileName() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -126,7 +126,7 @@ namespace Isis { delete proj; delete xyPoly; e.print(); // This should be a NAIF error - QString msg = "Cannot calculate XY for ["; + std::string msg = "Cannot calculate XY for ["; msg += cube->fileName() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/footprintmerge/main.cpp b/isis/src/base/apps/footprintmerge/main.cpp index 8db6ef5624..8c112306b9 100644 --- a/isis/src/base/apps/footprintmerge/main.cpp +++ b/isis/src/base/apps/footprintmerge/main.cpp @@ -22,7 +22,7 @@ void IsisMain() { FileList imageList; imageList.read(ui.GetFileName("FROMLIST")); if(imageList.size() < 1) { - QString msg = "The list file [" + ui.GetFileName("FROMLIST") + + std::string msg = "The list file [" + ui.GetFileName("FROMLIST") + "] does not contain any data"; throw IException(IException::User, msg, _FILEINFO_); } @@ -47,7 +47,7 @@ void IsisMain() { cube.camera(); } catch(IException &e) { - QString msg = "Spiceinit must be run prior to running footprintmerge"; + std::string msg = "Spiceinit must be run prior to running footprintmerge"; msg += " for cube [" + imageList[img].toString() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/framestitch/framestitch.cpp b/isis/src/base/apps/framestitch/framestitch.cpp index 153dc9d521..e205359cce 100644 --- a/isis/src/base/apps/framestitch/framestitch.cpp +++ b/isis/src/base/apps/framestitch/framestitch.cpp @@ -59,12 +59,12 @@ namespace Isis { } if (frameHeights.TotalPixels() == 0) { - QString msg = "Failed to find any NULL frames in cube [" + cube->fileName() + "]." + std::string msg = "Failed to find any NULL frames in cube [" + cube->fileName() + "]." "Please manually enter the frame height."; throw IException(IException::User, msg, _FILEINFO_); } if (frameHeights.Minimum() != frameHeights.Maximum()) { - QString msg = "Found different frame heights between [" + toString((int)frameHeights.Minimum()) + std::string msg = "Found different frame heights between [" + toString((int)frameHeights.Minimum()) + "] and [" + toString((int)frameHeights.Maximum()) + "] lines in cube [" + cube->fileName() + "]. Please manually enter the frame height."; throw IException(IException::User, msg, _FILEINFO_); @@ -88,10 +88,10 @@ namespace Isis { // we'll use frameNumber % 2 to index the input cube vector QString oddCubeFile = ui.GetCubeName("ODD"); Cube* oddCube = process.SetInputCube(oddCubeFile, - CubeAttributeInput(oddCubeFile)); + CubeAttributeInput(oddCubeFile.toStdString())); QString evenCubeFile = ui.GetCubeName("EVEN"); Cube* evenCube = process.SetInputCube(evenCubeFile, - CubeAttributeInput(evenCubeFile)); + CubeAttributeInput(evenCubeFile.toStdString())); // Check that all the inputs are valid @@ -133,7 +133,7 @@ namespace Isis { int oddFrameHeight = computeFrameHeight(oddCube); if (evenFrameHeight != oddFrameHeight) { - QString msg = "Computed frame heights for even cube [" + toString(evenFrameHeight) + std::string msg = "Computed frame heights for even cube [" + toString(evenFrameHeight) + "] and odd cube [" + toString(oddFrameHeight) + "] do not match."; throw IException(IException::User, msg, _FILEINFO_); } @@ -147,7 +147,7 @@ namespace Isis { numLinesOverlap = ui.GetInteger("NUM_LINES_OVERLAP"); if (numLinesOverlap % 2 != 0 || numLinesOverlap < 0) { - QString msg = "Expecting a non-negative and even value for NUM_LINES_OVERLAP."; + std::string msg = "Expecting a non-negative and even value for NUM_LINES_OVERLAP."; throw IException(IException::User, msg, _FILEINFO_); } @@ -155,7 +155,7 @@ namespace Isis { QString outCubeFile = ui.GetCubeName("TO"); Cube *outCube = process.SetOutputCube( - outCubeFile, CubeAttributeOutput(outCubeFile), + outCubeFile, CubeAttributeOutput(outCubeFile.toStdString()), evenCube->sampleCount(), numFrames * reducedFrameHeight, evenCube->bandCount()); // If there's an even number of frames and the inputs are flipped, we have to diff --git a/isis/src/base/apps/getkey/main.cpp b/isis/src/base/apps/getkey/main.cpp index 257a994337..a1c022c69c 100644 --- a/isis/src/base/apps/getkey/main.cpp +++ b/isis/src/base/apps/getkey/main.cpp @@ -82,7 +82,7 @@ void IsisMain() { // Make sure they requested a value inside the range of the list if(key.size() < i) { - QString msg = "The value entered for [KEYINDEX] is out of the array "; + std::string msg = "The value entered for [KEYINDEX] is out of the array "; msg += "bounds for the keyword [" + ui.GetString("KEYWORD") + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/getsn/getsn.cpp b/isis/src/base/apps/getsn/getsn.cpp index 20e15b2505..934f3d21e3 100644 --- a/isis/src/base/apps/getsn/getsn.cpp +++ b/isis/src/base/apps/getsn/getsn.cpp @@ -23,7 +23,7 @@ namespace Isis { void getsn( UserInterface &ui, Pvl *log ) { // Open the input cube - Cube *cube = new Cube( ui.GetCubeName("FROM"), "r"); + Cube *cube = new Cube( ui.GetCubeName("FROM").toStdString(), "r"); getsn( cube, ui, log ); diff --git a/isis/src/base/apps/grid/grid.cpp b/isis/src/base/apps/grid/grid.cpp index a41896e597..69639bde92 100644 --- a/isis/src/base/apps/grid/grid.cpp +++ b/isis/src/base/apps/grid/grid.cpp @@ -274,7 +274,7 @@ namespace Isis { if ( latLonGrid->GetMappingGroup()->findKeyword("LongitudeDomain")[0] == "360" && (latLonGrid->minLongitude().degrees() < 0.0 || latLonGrid->maxLongitude().degrees() > 360.0) ) { - QString msg = "**WARNING** minimum longitude [" + std::string msg = "**WARNING** minimum longitude [" + toString( latLonGrid->minLongitude().degrees() ) + "] and maximum longitude [" + toString( latLonGrid->maxLongitude().degrees() ) @@ -286,7 +286,7 @@ namespace Isis { else if ( latLonGrid->GetMappingGroup()->findKeyword("LongitudeDomain")[0] == "180" && (latLonGrid->minLongitude().degrees() < -180.0 || latLonGrid->maxLongitude().degrees() > 180.0) ) { - QString msg = "**WARNING** minimum longitude [" + std::string msg = "**WARNING** minimum longitude [" + toString( latLonGrid->minLongitude().degrees() ) + "] and maximum longitude [" + toString( latLonGrid->maxLongitude().degrees() ) @@ -467,7 +467,7 @@ namespace Isis { if ( latLonGrid->GetMappingGroup()->findKeyword("LongitudeDomain")[0] == "360" && (latLonGrid->minLongitude().degrees() < 0.0 || latLonGrid->maxLongitude().degrees() > 360.0) ) { - QString msg = "**WARNING** minimum longitude [" + std::string msg = "**WARNING** minimum longitude [" + toString( latLonGrid->minLongitude().degrees() ) + "] and maximum longitude [" + toString( latLonGrid->maxLongitude().degrees() ) @@ -480,7 +480,7 @@ namespace Isis { else if ( latLonGrid->GetMappingGroup()->findKeyword("LongitudeDomain")[0] == "180" && (latLonGrid->minLongitude().degrees() < -180.0 || latLonGrid->maxLongitude().degrees() > 180.0) ) { - QString msg = "**WARNING** minimum longitude [" + std::string msg = "**WARNING** minimum longitude [" + toString( latLonGrid->minLongitude().degrees() ) + "] and maximum longitude [" + toString( latLonGrid->maxLongitude().degrees() ) diff --git a/isis/src/base/apps/hist/hist.cpp b/isis/src/base/apps/hist/hist.cpp index 3d6728724c..7668c303be 100644 --- a/isis/src/base/apps/hist/hist.cpp +++ b/isis/src/base/apps/hist/hist.cpp @@ -167,7 +167,7 @@ namespace Isis { title = ui.GetString("TITLE"); } else { - title = "Histogram Plot for " + FileName(ui.GetAsString("FROM")).name(); + title = "Histogram Plot for " + QString::fromStdString(FileName(ui.GetAsString("FROM").toStdString()).name()); } // Create the QHistogram, set the title & load the Isis::Histogram into it diff --git a/isis/src/base/apps/isis2fits/main.cpp b/isis/src/base/apps/isis2fits/main.cpp index 9d0c5db0c8..541019eeb8 100644 --- a/isis/src/base/apps/isis2fits/main.cpp +++ b/isis/src/base/apps/isis2fits/main.cpp @@ -45,7 +45,7 @@ void IsisMain() { else if (ui.GetString("BITTYPE") == "16BIT") bitpix = "16"; else if (ui.GetString("BITTYPE") == "32BIT") bitpix = "-32"; else { - QString msg = "Pixel type of [" + ui.GetString("BITTYPE") + "] is unsupported"; + std::string msg = "Pixel type of [" + ui.GetString("BITTYPE") + "] is unsupported"; throw IException(IException::User, msg, _FILEINFO_); } @@ -118,7 +118,7 @@ void IsisMain() { if (ui.GetString("INFO") == "SKY" || ui.GetString("INFO") == "ALL") { //tjw: IString msg changed to QString - QString msg = "cube has not been skymapped"; + std::string msg = "cube has not been skymapped"; PvlGroup map; if (icube->hasGroup("mapping")) { diff --git a/isis/src/base/apps/isis2gml/main.cpp b/isis/src/base/apps/isis2gml/main.cpp index 118a5eb23d..44b074a21b 100644 --- a/isis/src/base/apps/isis2gml/main.cpp +++ b/isis/src/base/apps/isis2gml/main.cpp @@ -52,14 +52,14 @@ void IsisMain() { // Get the output gml file name QString outgml; if (ui.WasEntered("TO")) { - outgml = ui.GetFileName("TO"); - FileName out = ui.GetFileName("TO"); + outgml = ui.GetFileName("TO").toStdString(); + FileName out = ui.GetFileName("TO").toStdString(); if(out.extension() == "") { outgml += ".gml"; } } else { - FileName inputFile = ui.GetCubeName("FROM"); + FileName inputFile = ui.GetCubeName("FROM").toStdString(); outgml = inputFile.removeExtension().addExtension("gml").expanded(); } diff --git a/isis/src/base/apps/isis2pds/isis2pds.cpp b/isis/src/base/apps/isis2pds/isis2pds.cpp index 8ce5ea6b9c..3eec0a1e61 100644 --- a/isis/src/base/apps/isis2pds/isis2pds.cpp +++ b/isis/src/base/apps/isis2pds/isis2pds.cpp @@ -100,8 +100,8 @@ namespace Isis{ p.StandardPdsLabel(ProcessExportPds::Image); - FileName outFile(ui.GetFileName("TO", "img")); - QString outFileName(outFile.expanded()); + FileName outFile(ui.GetFileName("TO", "img").toStdString()); + QString outFileName(QString::fromStdString(outFile.expanded())); ofstream oCube(outFileName.toLatin1().data()); p.OutputLabel(oCube); p.StartProcess(oCube); @@ -130,13 +130,13 @@ namespace Isis{ PvlObject *label= icube->label(); if (!label->hasObject("IsisCube")) { - QString msg = "Input file [" + ui.GetCubeName("FROM") + + std::string msg = "Input file [" + ui.GetCubeName("FROM") + "] does not appear to be an ISIS cube."; throw IException(IException::User, msg, _FILEINFO_); } - FileName outFile(ui.GetFileName("TO", "img")); - QString outFileName(outFile.expanded()); + FileName outFile(ui.GetFileName("TO", "img").toStdString()); + QString outFileName(QString::fromStdString(outFile.expanded())); if (ui.GetString("STRETCH") == "LINEAR") { if (ui.GetString("BITTYPE") != "32BIT") { diff --git a/isis/src/base/apps/isis2raw/main.cpp b/isis/src/base/apps/isis2raw/main.cpp index 113e6f7bd3..e85110ea5e 100644 --- a/isis/src/base/apps/isis2raw/main.cpp +++ b/isis/src/base/apps/isis2raw/main.cpp @@ -123,7 +123,7 @@ void checkRange(UserInterface &ui, double &min, double &max) { if(ui.WasEntered("OMIN")) { if(ui.GetDouble("OMIN") < min) { - QString message = "OMIN [" + toString(min) + "] is too small for the provided BITTYPE ["; + std::string message = "OMIN [" + toString(min) + "] is too small for the provided BITTYPE ["; message += ui.GetString("BITTYPE") + "]"; throw IException(IException::User, message, _FILEINFO_); } @@ -142,7 +142,7 @@ void checkRange(UserInterface &ui, double &min, double &max) { if(ui.WasEntered("OMAX")) { if(ui.GetDouble("OMAX") > max) { - QString message = "OMAX [" + toString(max) + "] is too large for the provided BITTYPE ["; + std::string message = "OMAX [" + toString(max) + "] is too large for the provided BITTYPE ["; message += ui.GetString("BITTYPE") + "]"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/base/apps/isis2std/isis2std.cpp b/isis/src/base/apps/isis2std/isis2std.cpp index 9a5c2a5417..7d671362cf 100644 --- a/isis/src/base/apps/isis2std/isis2std.cpp +++ b/isis/src/base/apps/isis2std/isis2std.cpp @@ -60,7 +60,7 @@ namespace Isis { } } - FileName outputName = ui.GetFileName("TO"); + FileName outputName = ui.GetFileName("TO").toStdString(); int quality = ui.GetInteger("QUALITY"); @@ -94,7 +94,7 @@ namespace Isis { // Write out the results PvlGroup results("Results"); - results += PvlKeyword("OutputFileName", outputName.expanded().toStdString()); + results += PvlKeyword("OutputFileName", outputName.expanded()); if (mode == "GRAYSCALE") { addResults(results, exporter, "", 0); @@ -116,7 +116,7 @@ namespace Isis { int addChannel(UserInterface &ui, ExportDescription &desc, QString param, QString mode) { - FileName name = ui.GetCubeName(param); + FileName name = ui.GetCubeName(param).toStdString(); CubeAttributeInput &att = ui.GetInputAttribute(param); int index = -1; diff --git a/isis/src/base/apps/isisexport/isisexport.cpp b/isis/src/base/apps/isisexport/isisexport.cpp index b4d9a9539c..518f8d582f 100644 --- a/isis/src/base/apps/isisexport/isisexport.cpp +++ b/isis/src/base/apps/isisexport/isisexport.cpp @@ -47,9 +47,9 @@ namespace Isis { QString outputFile = ui.GetFileName("TO"); // Name for output image - FileName outputFileName(outputFile); - QString path(outputFileName.originalPath()); - QString name(outputFileName.baseName()); + FileName outputFileName(outputFile.toStdString()); + QString path(QString::fromStdString(outputFileName.originalPath())); + QString name(QString::fromStdString(outputFileName.baseName())); QString outputCubePath = path + "/" + name + ".cub"; CubeAttributeOutput outputAttributes("+bsq"); cubeatt(icube, outputCubePath, outputAttributes); @@ -68,19 +68,19 @@ namespace Isis { FileName genDefaultTemplate = ("$ISISROOT/appdata/export/pvl2template.tpl"); FileName templateFn; if (ui.WasEntered("TEMPLATE")) { - templateFn = ui.GetFileName("TEMPLATE"); + templateFn = ui.GetFileName("TEMPLATE").toStdString(); } else { std::string templateFnStd; try { - templateFnStd = env.render_file(genDefaultTemplate.expanded().toStdString(), dataSource); - templateFn = FileName(QString::fromStdString(templateFnStd)); + templateFnStd = env.render_file(genDefaultTemplate.expanded(), dataSource); + templateFn = FileName(templateFnStd); } catch (const std::exception& e) { - QString msg = "Cannot automatically determine the output template file name from ["; + std::string msg = "Cannot automatically determine the output template file name from ["; msg += genDefaultTemplate.expanded(); msg += "] using input label ["; - msg += FileName(ui.GetFileName("FROM")).expanded(); + msg += FileName(ui.GetFileName("FROM").toStdString()).expanded(); msg += "]. You can explicitly provide an output template file using the [TEMPLATE] parameter. "; msg += e.what(); throw IException(IException::User, msg, _FILEINFO_); @@ -88,7 +88,7 @@ namespace Isis { } if (!templateFn.fileExists()) { - QString msg = "Template file [" + templateFn.expanded() + "] does not exist."; + std::string msg = "Template file [" + templateFn.expanded() + "] does not exist."; if(!ui.WasEntered("TEMPLATE")) { msg += " Unsupported Spacecraft/Instrument for export."; @@ -123,7 +123,7 @@ namespace Isis { for (auto& element : extraJson.items()) { if (dataSource["ExtraPvl"].contains(element.key())) { PvlGroup duplicateWarnings("Warning"); - QString message = "Duplicate key [" + QString::fromStdString(element.key()) + std::string message = "Duplicate key [" + QString::fromStdString(element.key()) + "] in extra Pvl file [" + pvlFile + "]. " + "Previous value [" + QString::fromStdString(dataSource["ExtraPvl"][element.key()].dump()) + "] will be overwritten."; @@ -170,7 +170,7 @@ namespace Isis { for (auto& element : extraJson.items()) { if (dataSource["ExtraJson"].contains(element.key())) { PvlGroup duplicateWarnings("Warning"); - QString message = "Duplicate key [" + QString::fromStdString(element.key()) + std::string message = "Duplicate key [" + QString::fromStdString(element.key()) + "] in extra json file [" + jsonFile + "]. " + "Previous value [" + QString::fromStdString(dataSource["ExtraJson"][element.key()].dump()) + "] will be overwritten."; @@ -187,7 +187,7 @@ namespace Isis { // NOTE: The environment has already been used to determine the output template file, so // if there is a problem with that template this dump will never happen. if (ui.WasEntered("DATA")) { - std::ofstream jsonDataFile(FileName(ui.GetFileName("DATA")).expanded().toStdString()); + std::ofstream jsonDataFile(FileName(ui.GetFileName("DATA").toStdString()).expanded()); jsonDataFile << dataSource.dump(4); jsonDataFile.close(); } @@ -220,8 +220,8 @@ namespace Isis { * Renders to the final file size in bytes of the output image file */ env.add_callback("outputFileSize", 0, [outputCubePath](Arguments& args) { - FileName cubeFileName = outputCubePath; - return QFile(cubeFileName.expanded()).size(); + FileName cubeFileName = outputCubePath.toStdString(); + return QFile(QString::fromStdString(cubeFileName.expanded())).size(); }); /** @@ -243,7 +243,7 @@ namespace Isis { std::string result; try { - result = env.render_file(templateFn.expanded().toStdString(), dataSource); + result = env.render_file(templateFn.expanded(), dataSource); } catch (const std::exception &ex) { throw IException(IException::ErrorType::Unknown, ex.what(), _FILEINFO_); diff --git a/isis/src/base/apps/isisimport/isisimport.cpp b/isis/src/base/apps/isisimport/isisimport.cpp index 27aefaec7c..98b96c478b 100644 --- a/isis/src/base/apps/isisimport/isisimport.cpp +++ b/isis/src/base/apps/isisimport/isisimport.cpp @@ -29,26 +29,26 @@ namespace Isis { FileName fileTemplate = ("$ISISROOT/appdata/import/fileTemplate.tpl"); json jsonData; bool isPDS4 = false; - FileName inputFileName = ui.GetCubeName("FROM"); + FileName inputFileName = ui.GetCubeName("FROM").toStdString(); - if (inputFileName.extension().toUpper() == "IMQ"){ - QString msg = "Input image may be compressed. Please run image through vdcomp to uncompress" + if (QString::fromStdString(inputFileName.extension()).toUpper() == "IMQ"){ + std::string msg = "Input image may be compressed. Please run image through vdcomp to uncompress" "or verify image has correct file extension."; throw IException(IException::User, msg, _FILEINFO_); } try { // try to convert xml file to json - jsonData = xmlToJson(inputFileName.toString()); + jsonData = xmlToJson(QString::fromStdString(inputFileName.toString())); isPDS4 = true; } catch(...) { try { // try to convert pvl to json - jsonData = pvlToJSON(inputFileName.toString()); + jsonData = pvlToJSON(QString::fromStdString(inputFileName.toString())); } catch(...) { - QString msg = "Unable to process import image. Please confirm image is in PDS3 or PDS4 format"; + std::string msg = "Unable to process import image. Please confirm image is in PDS3 or PDS4 format"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -57,7 +57,7 @@ namespace Isis { // Dump the JSON to the debugging file if requested // This needs to be above all uses of the JSON by the template engine if (ui.WasEntered("DATA")) { - std::ofstream jsonDataFile(FileName(ui.GetFileName("DATA")).expanded().toStdString()); + std::ofstream jsonDataFile(FileName(ui.GetFileName("DATA").toStdString()).expanded()); jsonDataFile << jsonData.dump(4); jsonDataFile.close(); } @@ -65,17 +65,17 @@ namespace Isis { // Find associated template FileName inputTemplate; if (ui.WasEntered("TEMPLATE")) { - inputTemplate = ui.GetFileName("TEMPLATE"); + inputTemplate = ui.GetFileName("TEMPLATE").toStdString(); } else { std::string templateFile; try { - templateFile = env.render_file(fileTemplate.expanded().toStdString(), jsonData); - inputTemplate = FileName(QString::fromStdString(templateFile)); + templateFile = env.render_file(fileTemplate.expanded(), jsonData); + inputTemplate = FileName(templateFile); } catch(const std::exception& e) { - QString msg = "Cannot locate a template named [" + QString::fromStdString(templateFile) + "] for input label ["; - msg += FileName(ui.GetCubeName("FROM")).expanded(); + std::string msg = "Cannot locate a template named [" + templateFile + "] for input label ["; + msg += FileName(ui.GetCubeName("FROM").toStdString()).expanded(); msg += "]. You can explicitly provide a template file using the [TEMPLATE] parameter. "; msg += e.what(); throw IException(IException::User, msg, _FILEINFO_); @@ -150,8 +150,8 @@ namespace Isis { env.add_callback("CassiniIssStretchPairs", 0, [](Arguments& args) { PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); QString missionDir = QString::fromStdString(dataDir["Cassini"]); - FileName *lutFile = new FileName(missionDir + "/calibration/lut/lut.tab"); - TextFile *stretchPairs = new TextFile(lutFile->expanded()); + FileName *lutFile = new FileName(missionDir.toStdString() + "/calibration/lut/lut.tab"); + TextFile *stretchPairs = new TextFile(QString::fromStdString(lutFile->expanded())); vector vectorStretchPairs = {}; @@ -346,25 +346,25 @@ namespace Isis { ProcessImport importer; if (inputFileName.removeExtension().addExtension("dat").fileExists()){ - importer.SetInputFile(inputFileName.removeExtension().addExtension("dat").expanded()); + importer.SetInputFile(QString::fromStdString(inputFileName.removeExtension().addExtension("dat").expanded())); } else if (inputFileName.removeExtension().addExtension("img").fileExists()) { - importer.SetInputFile(inputFileName.removeExtension().addExtension("img").expanded()); + importer.SetInputFile(QString::fromStdString(inputFileName.removeExtension().addExtension("img").expanded())); } else if (inputFileName.removeExtension().addExtension("QUB").fileExists()) { - importer.SetInputFile(inputFileName.removeExtension().addExtension("QUB").expanded()); + importer.SetInputFile(QString::fromStdString(inputFileName.removeExtension().addExtension("QUB").expanded())); } else { - importer.SetInputFile(inputFileName.expanded()); + importer.SetInputFile(QString::fromStdString(inputFileName.expanded())); } // Use inja to get number of lines, samples, and bands from the input label std::string result; try { - result = env.render_file(inputTemplate.expanded().toStdString(), jsonData); + result = env.render_file(inputTemplate.expanded(), jsonData); } catch(const std::exception& e) { - QString msg = "Unable to create a cube label from ["; + std::string msg = "Unable to create a cube label from ["; msg += inputTemplate.expanded() + "]. "; msg += e.what(); if (ui.WasEntered("TEMPLATE")) { @@ -432,7 +432,7 @@ namespace Isis { units = QString::fromStdString(dataFilePointer.unit(1)); } else { - QString msg = "Improperly formatted data file pointer keyword ^IMAGE or " + std::string msg = "Improperly formatted data file pointer keyword ^IMAGE or " "^QUBE, in [" + inputFileName.toString() + "], must contain filename " " or offset or both"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -459,11 +459,11 @@ namespace Isis { // Checks that are unique to mgsmoc if (translation.hasKeyword("compressed") && translation.hasKeyword("projected")) { if (toBool(QString::fromStdString(translation["compressed"]))) { - QString msg = "[" + inputFileName.name() + "] may be compressed. Please run image through mocuncompress to uncompress."; + std::string msg = "[" + inputFileName.name() + "] may be compressed. Please run image through mocuncompress to uncompress."; throw IException(IException::User, msg, _FILEINFO_); } if (toBool(QString::fromStdString(translation["projected"]))) { - QString msg = "[" + inputFileName.name() + "] appears to be an rdr file."; + std::string msg = "[" + inputFileName.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -549,7 +549,7 @@ namespace Isis { if (translation.hasKeyword("CubeAtts")) { cubeAtts = QString::fromStdString(translation["CubeAtts"]); } - CubeAttributeOutput outputAtts = CubeAttributeOutput(cubeAtts); + CubeAttributeOutput outputAtts = CubeAttributeOutput(cubeAtts.toStdString()); Cube *outputCube = importer.SetOutputCube(ui.GetCubeName("TO"), outputAtts); if (isPDS4) { @@ -559,7 +559,7 @@ namespace Isis { } // Assume PDS3 else { - Pvl pdsLab(inputFileName.expanded().toStdString()); + Pvl pdsLab(inputFileName.expanded()); OriginalLabel pds3Label(pdsLab); outputCube->write(pds3Label); } diff --git a/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp b/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp index 536d0126fb..000df038e5 100644 --- a/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp @@ -116,7 +116,7 @@ namespace Isis { int nrows = pointNum; - FileName netfile(translateKeywordArgs("CnetFile", globals)); + FileName netfile(translateKeywordArgs("CnetFile", globals).toStdString()); ControlNetVersioner cnetReader(netfile); Pvl pvl(cnetReader.toPvl()); diff --git a/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp b/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp index cce41172ae..94e118685b 100644 --- a/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp @@ -69,7 +69,7 @@ namespace Isis { // Check for valid delimiter if ( m_delimiter.size() != 1 ) { - QString mess = "Delimiter value (" + m_delimiter + ") must be one and only" + std::string mess = "Delimiter value (" + m_delimiter + ") must be one and only" " one value - try again"; throw IException(IException::User, mess, _FILEINFO_); } @@ -116,7 +116,7 @@ namespace Isis { csv.read(fname); } catch (IException &ie) { - QString mess = "Could not read CSV file \'" + fname + "\'"; + std::string mess = "Could not read CSV file \'" + fname + "\'"; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -167,7 +167,7 @@ namespace Isis { importGeometry(rowsrc, getGlobals(rowsrc, globals)); } catch (IException &ie) { - QString mess = "Geometry conversion failed horribly for Resource(" + + std::string mess = "Geometry conversion failed horribly for Resource(" + identity + ")"; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -212,7 +212,7 @@ namespace Isis { if (keys.exists("Index") ) { QStringList indexes = keys.allValues("Index"); if ( names.size() != indexes.size() ) { - QString mess = "Size of Header (" + QString::number(names.size()) + + std::string mess = "Size of Header (" + QString::number(names.size()) + " does not match size of Index (" + QString::number(indexes.size()) + ")"; throw IException(IException::User, mess, _FILEINFO_); @@ -221,7 +221,7 @@ namespace Isis { for ( int i = 0 ; i < names.size() ; i++ ) { int index = toInt(indexes[i]); if ( (index < 0) || (index >= ncols) ) { - QString mess = "Column " + names[i] + " index (" + indexes[i] + + std::string mess = "Column " + names[i] + " index (" + indexes[i] + ") exceeds input column size (" + QString::number(ncols) + ")"; // throw IException(IException::User, mess, _FILEINFO_); @@ -236,7 +236,7 @@ namespace Isis { } else { if ( names.size() > ncols ) { - QString mess = "Size of Header (" + QString::number(names.size()) + + std::string mess = "Size of Header (" + QString::number(names.size()) + ") exceeds input column size (" + QString::number(ncols) + ") - must provide Index otherwise"; diff --git a/isis/src/base/apps/isisminer/CsvWriterStrategy.cpp b/isis/src/base/apps/isisminer/CsvWriterStrategy.cpp index bd6e5eb2b6..5841d01fc7 100644 --- a/isis/src/base/apps/isisminer/CsvWriterStrategy.cpp +++ b/isis/src/base/apps/isisminer/CsvWriterStrategy.cpp @@ -136,7 +136,7 @@ namespace Isis { // Now open the filename ofstream os; - QString ofFile = FileName(fname).expanded(); + QString ofFile = QString::fromStdString(FileName(fname.toStdString()).expanded()); QByteArray qofFile = ofFile.toLatin1(); if ( "append" == m_mode ) { os.open(qofFile.data(), ios::out | ios::app); @@ -146,7 +146,7 @@ namespace Isis { } if ( !os.is_open() ) { - QString mess = "CsvWriter::Cannot open/create output file [" + fname + + std::string mess = "CsvWriter::Cannot open/create output file [" + fname + "]."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -248,7 +248,7 @@ namespace Isis { value = gis->wkb(geos, GisTopology::PreserveGeometry); } else { - QString mess = "Unsupported geometry type: " + gisType; + std::string mess = "Unsupported geometry type: " + gisType; throw IException(IException::User, mess, _FILEINFO_); } } diff --git a/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp b/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp index 9243c9072e..f90b967ee9 100644 --- a/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp @@ -145,7 +145,7 @@ namespace Isis { } } catch ( IException &ie ) { - QString mess = "Query failed after " + QString::number(nrows+1) + + std::string mess = "Query failed after " + QString::number(nrows+1) + " rows: " + ie.what(); if ( isDebug() ) { cout << "Db::Error - " << mess << "\n"; @@ -311,7 +311,7 @@ namespace Isis { importGeometry(rowrec, globals); } catch (IException &ie) { - QString mess = "Geometry conversion failed horribly for Resource [" + + std::string mess = "Geometry conversion failed horribly for Resource [" + rowId + "]."; throw IException(ie, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp b/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp index ee039372ce..b4fc31010a 100644 --- a/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp @@ -77,7 +77,7 @@ namespace Isis { // Check for validity if ( !m_geom->isValid() ) { - QString mess = "User provided geometry for " + name() + + std::string mess = "User provided geometry for " + name() + " is not valid!"; throw IException(IException::User, mess, _FILEINFO_); } @@ -137,7 +137,7 @@ namespace Isis { geom = new GisGeometry(gisgeom, gtype); } catch (IException &ie) { - QString mess = "Problems converting GIS Geometry in keyword " + key + + std::string mess = "Problems converting GIS Geometry in keyword " + key + ", PVL source file: " + pfile; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp b/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp index 190dcf5e0e..a8addb5ffb 100644 --- a/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp @@ -112,7 +112,7 @@ namespace Isis { m_merge = None; } else { - QString mess = "OverlapMerge = " + parms.get("OverlapMerge") + + std::string mess = "OverlapMerge = " + parms.get("OverlapMerge") + " is not a recognized/valid option"; throw IException(IException::User, mess, _FILEINFO_); } @@ -208,7 +208,7 @@ namespace Isis { GEOSSTRtree *rtree = GEOSSTRtree_create(ngeoms); if ( !rtree ) { cout << "Address: " << rtree << "\n"; - QString mess = "GEOS RTree allocation failed for " + + std::string mess = "GEOS RTree allocation failed for " + toString(goodones.size()) + " geometries."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/NumericalSortStrategy.cpp b/isis/src/base/apps/isisminer/NumericalSortStrategy.cpp index c5ca0655b3..6ccf896779 100644 --- a/isis/src/base/apps/isisminer/NumericalSortStrategy.cpp +++ b/isis/src/base/apps/isisminer/NumericalSortStrategy.cpp @@ -74,7 +74,7 @@ namespace Isis { // check validity of keyword if ( (m_order != "ascending") && (m_order != "descending") ) { - QString mess = "Specified sort Order [" + order + "] is invalid." + std::string mess = "Specified sort Order [" + order + "] is invalid." " Must be Ascending or Descending."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/PdsColumn.cpp b/isis/src/base/apps/isisminer/PdsColumn.cpp index 2c3f237908..ac26fb465b 100644 --- a/isis/src/base/apps/isisminer/PdsColumn.cpp +++ b/isis/src/base/apps/isisminer/PdsColumn.cpp @@ -410,7 +410,7 @@ namespace Isis { PdsColumn *PdsColumn::promote(SharedResource &resource) { PdsColumn *column = dynamic_cast (resource.data()); if ( 0 == column ) { - QString mess = "Could not cast Resource [" + resource->name() + + std::string mess = "Could not cast Resource [" + resource->name() + "] to a PdsColumn pointer."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp index ea5a6f7a76..83b80cee5d 100644 --- a/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp @@ -119,7 +119,7 @@ namespace Isis { // Now open the filename ofstream os; - QString ofFile = FileName(fname).expanded(); + QString ofFile = QString::fromStdString(FileName(fname.toStdString()).expanded()); QByteArray qofFile = ofFile.toLatin1(); if ( "append" == m_mode ) { os.open(qofFile.data(), ios::out | ios::app); @@ -129,7 +129,7 @@ namespace Isis { } if ( !os.is_open() ) { - QString mess = "PdsTableCreator::Cannot open/create output file (" + + std::string mess = "PdsTableCreator::Cannot open/create output file (" + fname + ")"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp index 5ea81b9e3e..45d59b9254 100644 --- a/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp @@ -267,7 +267,7 @@ namespace Isis { int nvals = definition->count(keynam); if ( !((maxcols == nvals) || (mincols == nvals)) ) { if ( throwOnError ) { - QString mess = "The keyword count [" + QString::number(nvals) + "] for the given " + keynam + std::string mess = "The keyword count [" + QString::number(nvals) + "] for the given " + keynam + " Resource definition is invalid. Must equal maxcols [" + QString::number(maxcols) + "or mincols [" + QString::number(mincols) + "]."; diff --git a/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp index dd866a78f1..388eb1f926 100644 --- a/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp @@ -130,7 +130,7 @@ namespace Isis { catch ( IException &ie ) { m_resources.clear(); m_globals.clear(); - QString mess = "Failed to read PDS label/table " + lblfile + "," + tblfile; + std::string mess = "Failed to read PDS label/table " + lblfile + "," + tblfile; throw IException(ie, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp b/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp index 31b5cfffb1..1c450f41ec 100644 --- a/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp @@ -80,7 +80,7 @@ namespace Isis { // allows for using KeyListFileArgs QString keyfile = translateKeywordArgs("KeyListFile", globals); if ( !keyfile.isEmpty() ) { - m_pvlparms.addKeyToList(FileName(keyfile)); + m_pvlparms.addKeyToList(FileName(keyfile.toStdString())); } } @@ -110,12 +110,12 @@ namespace Isis { int PvlReaderStrategy::apply(ResourceList &resources, const ResourceList &globals) { m_pvlfile = translateKeywordArgs("FromList", globals); - FileName fromlistFile(m_pvlfile); + FileName fromlistFile(m_pvlfile.toStdString()); FileList fromlist(fromlistFile); int npvls(0); BOOST_FOREACH ( FileName from, fromlist ) { - resources.push_back( pvlResource(from.expanded(), globals, npvls) ); + resources.push_back( pvlResource(QString::fromStdString(from.expanded()), globals, npvls) ); npvls++; } @@ -185,7 +185,7 @@ namespace Isis { importGeometry(pvlsrc, globals); } catch (IException &ie) { - QString mess = "Geometry conversion failed horribly for Resource(" + + std::string mess = "Geometry conversion failed horribly for Resource(" + identity + ")"; throw IException(ie, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/ResourceManagerStrategy.cpp b/isis/src/base/apps/isisminer/ResourceManagerStrategy.cpp index b4ae5776f6..bfca010bc1 100644 --- a/isis/src/base/apps/isisminer/ResourceManagerStrategy.cpp +++ b/isis/src/base/apps/isisminer/ResourceManagerStrategy.cpp @@ -173,13 +173,13 @@ namespace Isis { const { QStringList parts = qualifiers(op); if ( parts.isEmpty() || (parts.size() > 2)) { - QString mess = "ResourceManager::Operator [" + op + "] is ill-formed."; + std::string mess = "ResourceManager::Operator [" + op + "] is ill-formed."; throw IException(IException::User, mess, _FILEINFO_); } QString opName = parts[0].toLower(); if ( !m_opFunctions.contains(opName) ) { - QString mess = "ResourceManager::Operator [" + op + "] not recognized."; + std::string mess = "ResourceManager::Operator [" + op + "] not recognized."; mess += " Valid are ResetDiscard, ToggleDiscard, DeleteDiscard" " and DeleteAsset::AssetName."; throw IException(IException::User, mess, _FILEINFO_); @@ -285,7 +285,7 @@ namespace Isis { ResourceList &resources) { QStringList parts = qualifiers(op); if ( parts.size() != 2) { - QString mess = "ResourceManager " + parts[0] + " requires an asset name. " + std::string mess = "ResourceManager " + parts[0] + " requires an asset name. " " Operation [" + op + "] is ill-formed."; throw IException(IException::User, mess, _FILEINFO_); } @@ -324,7 +324,7 @@ namespace Isis { ResourceList &resources) { QStringList parts = qualifiers(op); if ( parts.size() != 2) { - QString mess = "ResourceManager " + parts[0] + " requires an asset name. " + std::string mess = "ResourceManager " + parts[0] + " requires an asset name. " " Operation [" + op + "] is ill-formed."; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp index 568af9129d..a4fe89c845 100644 --- a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp +++ b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp @@ -170,7 +170,7 @@ namespace Isis { int status = system(cmd.toLatin1().data()); if ( 0 != status) { if ( !m_onPreCommandErrorContinue ) { - QString mess = command.m_name + " RunCommand::PreCommand failed - " + + std::string mess = command.m_name + " RunCommand::PreCommand failed - " + cmd + " - you are terminated!"; throw IException(IException::User, mess, _FILEINFO_); } @@ -198,7 +198,7 @@ namespace Isis { int status = system(cmd.toLatin1().data()); if ( 0 != status) { if ( !m_onPostCommandErrorContinue ) { - QString mess = command.m_name + " RunCommand::PostCommand failed - " + + std::string mess = command.m_name + " RunCommand::PostCommand failed - " + cmd + " - you are terminated!"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/SidebarStrategy.cpp b/isis/src/base/apps/isisminer/SidebarStrategy.cpp index fdaf06ead2..d145e31887 100644 --- a/isis/src/base/apps/isisminer/SidebarStrategy.cpp +++ b/isis/src/base/apps/isisminer/SidebarStrategy.cpp @@ -84,7 +84,7 @@ namespace Isis { m_strategies = factory->buildRun(getDefinition().findObject("IsisMiner")); } else { - QString mess = "No IsisMiner strategies found in " + name() + " Sidebar."; + std::string mess = "No IsisMiner strategies found in " + name() + " Sidebar."; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/StrategyFactory.cpp b/isis/src/base/apps/isisminer/StrategyFactory.cpp index ed70ce85d1..56faafdba8 100644 --- a/isis/src/base/apps/isisminer/StrategyFactory.cpp +++ b/isis/src/base/apps/isisminer/StrategyFactory.cpp @@ -270,7 +270,7 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; const ResourceList &globals) const { Strategy *strategy = findStrategy(definition, globals); if ( !strategy ) { - std:string sname("UNKNOWN"), stype("UNKNOWN"); + std::string sname("UNKNOWN"), stype("UNKNOWN"); if ( definition.hasKeyword("Name") ) { sname = definition["Name"][0]; } @@ -331,7 +331,7 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; } if ( !missing.isEmpty() ) { - QString mess = "Users of this configuration must provide the " + std::string mess = "Users of this configuration must provide the " "following parameter(s) but they were not found: " + missing.join(", "); throw IException(IException::User, mess, _FILEINFO_); @@ -369,7 +369,7 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; if ( definition.hasKeyword("Name") ) { sname = QString::fromStdString(definition["Name"][0]); } - QString mess = "Strategy Type does not exist in configuration for " + + std::string mess = "Strategy Type does not exist in configuration for " + sname + " strategy!"; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -523,14 +523,14 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; QString libname = pluginkeys.get("Library"); BOOST_FOREACH ( QString dir, dirlist ) { QDir path(dir); - FileName library(path.filePath(libname)); - plugin.setFileName(library.expanded()); + FileName library(path.filePath(libname).toStdString()); + plugin.setFileName(QString::fromStdString(library.expanded())); if ( plugin.load() ) { break; } // library successfully loaded! } // Check for successful load if ( !plugin.isLoaded() ) { - QString mess = "Cannot find/load Strategy plugin library " + libname; + std::string mess = "Cannot find/load Strategy plugin library " + libname; throw IException(IException::User, mess, _FILEINFO_); } @@ -539,7 +539,7 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; QString routine = pluginkeys.get("Routine"); StrategyCreator maker = (StrategyCreator) plugin.resolve(routine.toLatin1().data()); if ( !maker ) { - QString mess = "Unable to resolve Routine name [" + routine + + std::string mess = "Unable to resolve Routine name [" + routine + "] in Strategy plugin [" + plugin.fileName() + "]"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/makeflat/main.cpp b/isis/src/base/apps/makeflat/main.cpp index 2cef581129..981954bcd9 100644 --- a/isis/src/base/apps/makeflat/main.cpp +++ b/isis/src/base/apps/makeflat/main.cpp @@ -513,7 +513,7 @@ void IsisMain() { excludeFile.addObject(excludedDetails[i]); } - excludeFile.write(FileName(ui.GetFileName("EXCLUDE")).expanded().toStdString()); + excludeFile.write(FileName(ui.GetFileName("EXCLUDE")).expanded()); } remove(outTmpName.toLatin1().data()); diff --git a/isis/src/base/apps/map2cam/map2cam.cpp b/isis/src/base/apps/map2cam/map2cam.cpp index 5712792b58..43e98c6c46 100644 --- a/isis/src/base/apps/map2cam/map2cam.cpp +++ b/isis/src/base/apps/map2cam/map2cam.cpp @@ -17,7 +17,7 @@ namespace Isis{ // Open the input camera cube that we will be matching and create // the camera object - FileName match = FileName(ui.GetCubeName("MATCH")); + FileName match = FileName(ui.GetCubeName("MATCH").toStdString()); Process p; QString fname = ui.GetCubeName("MATCH"); @@ -50,8 +50,8 @@ namespace Isis{ transform->OutputSamples(), transform->OutputLines(), mcube->bandCount()); - rub.PropagateLabels(match.expanded()); - rub.PropagateTables(match.expanded()); + rub.PropagateLabels(QString::fromStdString(match.expanded())); + rub.PropagateTables(QString::fromStdString(match.expanded())); // Set up the interpolator Interpolator *interp = NULL; diff --git a/isis/src/base/apps/map2map/map2map.cpp b/isis/src/base/apps/map2map/map2map.cpp index 3f31d836fe..82cf54acf5 100644 --- a/isis/src/base/apps/map2map/map2map.cpp +++ b/isis/src/base/apps/map2map/map2map.cpp @@ -362,7 +362,7 @@ namespace Isis { interp = new Interpolator(Interpolator::CubicConvolutionType); } else { - QString msg = "Unknow value for INTERP [" + ui.GetString("INTERP") + "]"; + std::string msg = "Unknow value for INTERP [" + ui.GetString("INTERP") + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/mapgrid/main.cpp b/isis/src/base/apps/mapgrid/main.cpp index 04110b9d59..aafd08efed 100644 --- a/isis/src/base/apps/mapgrid/main.cpp +++ b/isis/src/base/apps/mapgrid/main.cpp @@ -62,14 +62,14 @@ void IsisMain() { proj = (TProjection *) ProjectionFactory::Create(p); } catch(IException &e) { - QString msg = "Cannot create grid - MapFile [" + mapFile + + std::string msg = "Cannot create grid - MapFile [" + mapFile + "] does not contain necessary information to create a projection"; throw IException(e, IException::User, msg, _FILEINFO_); } // Write grid to well known text output - QString out = FileName(ui.GetFileName("TO")).expanded(); + QString out = FileName(ui.GetFileName("TO").toStdString()).expanded(); std::ofstream os; os.open(out.toLatin1().data(), std::ios::out); diff --git a/isis/src/base/apps/maplab/main.cpp b/isis/src/base/apps/maplab/main.cpp index c3d19d88ab..78a6870d50 100644 --- a/isis/src/base/apps/maplab/main.cpp +++ b/isis/src/base/apps/maplab/main.cpp @@ -60,7 +60,7 @@ void IsisMain() { y = proj->YCoord(); } else { - QString message = "Invalid option [" + option + "] for parameter COORDINATES"; + std::string message = "Invalid option [" + option + "] for parameter COORDINATES"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/base/apps/mapmos/mapmos.cpp b/isis/src/base/apps/mapmos/mapmos.cpp index 55423d0909..9ab2c8dcc8 100644 --- a/isis/src/base/apps/mapmos/mapmos.cpp +++ b/isis/src/base/apps/mapmos/mapmos.cpp @@ -12,7 +12,7 @@ using namespace Isis; namespace Isis { void mapmos(UserInterface &ui, Pvl *log) { - Cube *inCube = new Cube( ui.GetCubeName("FROM"), "r"); + Cube *inCube = new Cube( ui.GetCubeName("FROM").toStdString(), "r"); mapmos(inCube, ui, log); } @@ -80,7 +80,7 @@ namespace Isis { //check to make sure they're all there. If not, throw error, need to enter all. if (!mapGroup.hasKeyword("MinimumLongitude") || !mapGroup.hasKeyword("MaximumLongitude") || !mapGroup.hasKeyword("MinimumLatitude") || !mapGroup.hasKeyword("MaximumLatitude") ) { - QString msg = "One of the extents is missing. Please input all extents."; + std::string msg = "One of the extents is missing. Please input all extents."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/mappt/mappt.cpp b/isis/src/base/apps/mappt/mappt.cpp index 5df4a96857..dd69ae6eb1 100644 --- a/isis/src/base/apps/mappt/mappt.cpp +++ b/isis/src/base/apps/mappt/mappt.cpp @@ -49,8 +49,8 @@ void mappt(Cube *icube, UserInterface &ui, Pvl *log, CubeAttributeInput* inAtt) // Write an output label file if necessary if(ui.WasEntered("TO")) { // Get user params from ui - QString outFile = FileName(ui.GetFileName("TO")).expanded(); - bool exists = FileName(outFile).fileExists(); + QString outFile = QString::fromStdString(FileName(ui.GetFileName("TO").toStdString()).expanded()); + bool exists = FileName(outFile.toStdString()).fileExists(); bool append = ui.GetBoolean("APPEND"); // Write the pvl group out to the file @@ -126,7 +126,7 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac if (!outsideAllowed) { if (samp < .5 || line < .5 || samp > cubeSampleLimit || line > cubeLineLimit) { - QString error = "Requested line,sample is not on the image"; + std::string error = "Requested line,sample is not on the image"; throw IException(IException::Unknown, error, _FILEINFO_); } } @@ -165,17 +165,17 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac // Use the mapping group from a given file else if(coordsys == "MAP") { - FileName mapFile = ui.GetFileName("MAP"); + FileName mapFile = ui.GetFileName("MAP").toStdString(); // Does it exist? if(!mapFile.fileExists()) { - QString msg = "Filename [" + ui.GetFileName("MAP") + "] does not exist"; + std::string msg = "Filename [" + ui.GetFileName("MAP") + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } // Load it up into a new projection Pvl mapPvl; - mapPvl.read(mapFile.expanded().toStdString()); + mapPvl.read(mapFile.expanded()); TProjection *altmap = (TProjection *) ProjectionFactory::CreateFromCube(mapPvl); // Set lat and lon in its system @@ -226,7 +226,7 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac if (proj->WorldX() < .5 || proj->WorldY() < .5 || proj->WorldX() > cubeSampleLimit || proj->WorldY() > cubeLineLimit) { if (!outsideAllowed) { - QString error = "Resulting line,sample is not on the image"; + std::string error = "Resulting line,sample is not on the image"; throw IException(IException::Unknown, error, _FILEINFO_); } else { @@ -254,7 +254,7 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac // Log the position if(proj->IsGood()) { results += PvlKeyword("Filename", - FileName(icube->fileName()).expanded().toStdString()); + FileName(icube->fileName().toStdString()).expanded()); results += PvlKeyword("Sample", std::to_string(proj->WorldX())); results += PvlKeyword("Line", std::to_string(proj->WorldY())); results += PvlKeyword("Band", std::to_string(icube->physicalBand(1))); @@ -386,7 +386,7 @@ QList< QPair > getMapPoints(const UserInterface &ui, bool usePoi if (usePointList) { CSVReader reader; - reader.read(FileName(ui.GetFileName("COORDLIST")).expanded()); + reader.read(QString::fromStdString(FileName(ui.GetFileName("COORDLIST").toStdString()).expanded())); if (!reader.isTableValid(reader.getTable()) || reader.columns() != 2) { std::string msg = "Coordinate file formatted incorrectly.\n" diff --git a/isis/src/base/apps/maptemplate/main.cpp b/isis/src/base/apps/maptemplate/main.cpp index 29b0f8344c..2637c5aa72 100644 --- a/isis/src/base/apps/maptemplate/main.cpp +++ b/isis/src/base/apps/maptemplate/main.cpp @@ -579,7 +579,7 @@ void calcRange(double &minLat, double &maxLat, // this ensures that we look for the target radii of the TARGET specified by the user radii += PvlKeyword("TargetName", targetName.toStdString()); // this group will contain TargetName, EquatorialRadius, and PolarRadius - Pvl cubeLab(flist[0].expanded().toStdString()); + Pvl cubeLab(flist[0].expanded()); radii = Target::radiiGroup(cubeLab, radii); } catch (IException &e) { diff --git a/isis/src/base/apps/maptrim/maptrim.cpp b/isis/src/base/apps/maptrim/maptrim.cpp index ad845ad24a..2b3123c1f0 100644 --- a/isis/src/base/apps/maptrim/maptrim.cpp +++ b/isis/src/base/apps/maptrim/maptrim.cpp @@ -83,7 +83,7 @@ namespace Isis{ ProgramLauncher::RunIsisProgram("crop", cropParams); } catch(IException &e) { - QString msg = "Could not execute crop with params: [" + cropParams + "]"; + std::string msg = "Could not execute crop with params: [" + cropParams + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } if(mode == "BOTH") { diff --git a/isis/src/base/apps/mask/main.cpp b/isis/src/base/apps/mask/main.cpp index f614ee0f55..8569b9d07e 100644 --- a/isis/src/base/apps/mask/main.cpp +++ b/isis/src/base/apps/mask/main.cpp @@ -40,7 +40,7 @@ void IsisMain() { p.SetInputCube("MASK", OneBand); } catch (IException &e) { - QString msg = "The MASK input must be a single band."; + std::string msg = "The MASK input must be a single band."; throw IException(e, IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/mosrange/mosrange.cpp b/isis/src/base/apps/mosrange/mosrange.cpp index 61045b2b94..4b0a5e4996 100644 --- a/isis/src/base/apps/mosrange/mosrange.cpp +++ b/isis/src/base/apps/mosrange/mosrange.cpp @@ -63,7 +63,7 @@ namespace Isis { // Get the list of names of input cubes to stitch together FileList cubeFileList; - cubeFileList.read(ui.GetFileName("FROMLIST")); + cubeFileList.read(ui.GetFileName("FROMLIST").toStdString()); return mosrange(cubeFileList, ui); } @@ -81,7 +81,7 @@ namespace Isis { */ Pvl mosrange(FileList &cubeFileList, UserInterface &ui) { if ( cubeFileList.size() < 1) { - QString msg = "The list file[" + ui.GetFileName("FROMLIST") + + std::string msg = "The list file[" + ui.GetFileName("FROMLIST") + " does not contain any filenames"; throw IException(IException::User, msg, _FILEINFO_); } @@ -131,18 +131,18 @@ namespace Isis { for(int i = 0 ; i < cubeFileList.size() ; i++) { PvlObject fmap("File"); - fmap += PvlKeyword("Name", cubeFileList[i].toString().toStdString()); + fmap += PvlKeyword("Name", cubeFileList[i].toString()); try { // Set input image, get camera model, and a basic mapping group Cube cube; - cube.open(cubeFileList[i].toString()); + cube.open(QString::fromStdString(cubeFileList[i].toString())); int lines = cube.lineCount(); int samples = cube.sampleCount(); PvlObject fmap("File"); - fmap += PvlKeyword("Name", cubeFileList[i].toString().toStdString()); + fmap += PvlKeyword("Name", cubeFileList[i].toString()); fmap += PvlKeyword("Lines", std::to_string(lines)); fmap += PvlKeyword("Samples", std::to_string(samples)); @@ -206,11 +206,11 @@ namespace Isis { latitudeStat.AddData(&maxlat, 1); } catch(IException &ie) { - std::string mess = cubeFileList[i].toString().toStdString() + " - " + ie.what(); + std::string mess = cubeFileList[i].toString() + " - " + ie.what(); fmap += PvlKeyword("Error", mess); errorset.addObject(fmap); - badfiles.append(qMakePair(cubeFileList[i].toString(), ie.what())); + badfiles.append(qMakePair(QString::fromStdString(cubeFileList[i].toString()), ie.what())); } p.ClearInputCubes(); @@ -227,11 +227,11 @@ namespace Isis { } if ( ui.WasEntered("ERRORLIST") ) { - FileName filename( ui.GetFileName("ERRORLIST") ); - QFile logfile(filename.expanded()); + FileName filename( ui.GetFileName("ERRORLIST").toStdString() ); + QFile logfile(QString::fromStdString(filename.expanded())); if ( !logfile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text | QIODevice::Unbuffered) ) { - QString mess = "Unable to open/create error list file " + filename.name(); + std::string mess = "Unable to open/create error list file " + filename.name(); throw IException(IException::User, mess, _FILEINFO_); } @@ -244,7 +244,7 @@ namespace Isis { // Now check onerror status if ( ("FAIL" == ui.GetString("ONERROR").toUpper()) || (badfiles.size() == cubeFileList.size()) ) { - QString errors("--> Fatal Errors Encountered <___\n"); + std::string errors("--> Fatal Errors Encountered <___\n"); for (int i = 0 ; i < badfiles.size() ; i++) { errors += badfiles[i].first + " - " + badfiles[i].second + "\n"; } diff --git a/isis/src/base/apps/mvstats/main.cpp b/isis/src/base/apps/mvstats/main.cpp index 14bd03ebef..c47a9be5e2 100644 --- a/isis/src/base/apps/mvstats/main.cpp +++ b/isis/src/base/apps/mvstats/main.cpp @@ -24,7 +24,7 @@ void IsisMain() { //Check to see if an output file was specified UserInterface &ui = Application::GetUserInterface(); if(!ui.WasEntered("CUBE") && !ui.WasEntered("FLATFILE")) { - QString message = "At least one output file must be entered"; + std::string message = "At least one output file must be entered"; throw IException(IException::User, message, _FILEINFO_); } @@ -37,7 +37,7 @@ void IsisMain() { //Check to see if the input cube has enough bands if(bands < 2) { - QString message = "Input band must have at least two bands!"; + std::string message = "Input band must have at least two bands!"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/base/apps/nocam2map/main.cpp b/isis/src/base/apps/nocam2map/main.cpp index a975a6b05b..f06dd6ce1c 100644 --- a/isis/src/base/apps/nocam2map/main.cpp +++ b/isis/src/base/apps/nocam2map/main.cpp @@ -138,7 +138,7 @@ void LoadMapRes() { ui.PutAsString("PIXRES", "MPP"); } else { - QString msg = "No resolution value found in [" + ui.GetFileName("MAP") + "]"; + std::string msg = "No resolution value found in [" + ui.GetFileName("MAP") + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -294,7 +294,7 @@ void LoadMapRange() { ui.PutAsString("DEFAULTRANGE", "MAP"); if (count < 4) { - QString msg = "One or more of the values for the ground range was not found"; + std::string msg = "One or more of the values for the ground range was not found"; msg += " in [" + ui.GetFileName("MAP") + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/nocam2map/nocam2map.cpp b/isis/src/base/apps/nocam2map/nocam2map.cpp index b2b59980d7..46d078bee7 100644 --- a/isis/src/base/apps/nocam2map/nocam2map.cpp +++ b/isis/src/base/apps/nocam2map/nocam2map.cpp @@ -33,7 +33,7 @@ namespace Isis { void nocam2map(UserInterface &ui, Pvl *log) { QString inputFileName = ui.GetCubeName("FROM"); - Cube iCube(inputFileName); + Cube iCube(inputFileName.toStdString()); nocam2map(&iCube, ui, log); } @@ -129,8 +129,8 @@ namespace Isis { lineSol.Solve(LeastSquares::QRD); } catch (IException &e) { - FileName inFile = inCube->fileName(); - QString msg = "Unable to calculate transformation of projection for [" + inFile.expanded() + "]."; + FileName inFile = inCube->fileName().toStdString(); + std::string msg = "Unable to calculate transformation of projection for [" + inFile.expanded() + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/noproj/noproj.cpp b/isis/src/base/apps/noproj/noproj.cpp index baad947e85..042a30032a 100644 --- a/isis/src/base/apps/noproj/noproj.cpp +++ b/isis/src/base/apps/noproj/noproj.cpp @@ -48,7 +48,7 @@ namespace Isis { Cube *mcube = NULL; if((ui.WasEntered("MATCH"))) { - mcube = new Cube(ui.GetCubeName("MATCH")); + mcube = new Cube(ui.GetCubeName("MATCH").toStdString()); } noproj(&icube, mcube, ui); @@ -94,12 +94,12 @@ namespace Isis { // Get Ideal camera specifications FileName specs; if((ui.WasEntered("SPECS"))) { - specs = ui.GetFileName("SPECS"); + specs = ui.GetFileName("SPECS").toStdString(); } else { specs = "$ISISROOT/appdata/templates/noproj/noprojInstruments.pvl"; } - Pvl idealSpecs(specs.expanded().toStdString()); + Pvl idealSpecs(specs.expanded()); PvlObject obSpecs = idealSpecs.findObject("IdealInstrumentsSpecifications"); PvlGroup idealGp = obSpecs.findGroup(groupName.toStdString()); @@ -193,12 +193,12 @@ namespace Isis { // Can we do a regular label? Didn't work on 12-15-2006 cao.setLabelAttachment(Isis::DetachedLabel); FileName matchCubeFile = FileName::createTempFile("$Temporary/match.cub"); - QString matchCubeFileNoExt = matchCubeFile.path() + "/" + matchCubeFile.baseName(); + QString matchCubeFileNoExt = QString::fromStdString(matchCubeFile.path() + "/" + matchCubeFile.baseName()); // Determine the output image size from // 1) the idealInstrument pvl if there or // 2) the input size expanded by user specified percentage - Cube *ocube = p.SetOutputCube(matchCubeFile.expanded(), cao, 1, 1, 1); + Cube *ocube = p.SetOutputCube(QString::fromStdString(matchCubeFile.expanded()), cao, 1, 1, 1); // Extract the times and the target from the instrument group QString startTime = QString::fromStdString(inst["StartTime"]); @@ -374,9 +374,9 @@ namespace Isis { // And run cam2cam to apply the transformation QVector args = {"to=" + ui.GetCubeName("TO"), "INTERP=" + ui.GetString("INTERP")}; - UserInterface cam2camUI(FileName("$ISISROOT/bin/xml/cam2cam.xml").expanded(), args); + UserInterface cam2camUI(QString::fromStdString(FileName("$ISISROOT/bin/xml/cam2cam.xml").expanded()), args); Cube matchCube; - matchCube.open(matchCubeFile.expanded(), "rw"); + matchCube.open(QString::fromStdString(matchCubeFile.expanded()), "rw"); cam2cam(icube, &matchCube, cam2camUI); matchCube.close(); diff --git a/isis/src/base/apps/overlapstats/overlapstats.cpp b/isis/src/base/apps/overlapstats/overlapstats.cpp index af39d467d2..c08d905787 100644 --- a/isis/src/base/apps/overlapstats/overlapstats.cpp +++ b/isis/src/base/apps/overlapstats/overlapstats.cpp @@ -207,10 +207,10 @@ namespace Isis { // Checks if there were overlaps to output results from if (overlapnum == 0) { - QString msg = "The overlap file ["; - msg += FileName(ui.GetFileName("OVERLAPLIST")).name(); + std::string msg = "The overlap file ["; + msg += FileName(ui.GetFileName("OVERLAPLIST").toStdString()).name(); msg += "] does not contain any overlaps across the provided cubes ["; - msg += FileName(ui.GetFileName("FROMLIST")).name() + "]"; + msg += FileName(ui.GetFileName("FROMLIST").toStdString()).name() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -249,7 +249,7 @@ namespace Isis { //Log the ERRORS file if (ui.WasEntered("ERRORS")) { - QString errorname = ui.GetFileName("ERRORS"); + std::string errorname = ui.GetFileName("ERRORS"); std::ofstream errorsfile; errorsfile.open(errorname.toLatin1().data()); errorsfile << errors.str(); diff --git a/isis/src/base/apps/phocube/phocube.cpp b/isis/src/base/apps/phocube/phocube.cpp index 8e217f58e7..dac57be4da 100644 --- a/isis/src/base/apps/phocube/phocube.cpp +++ b/isis/src/base/apps/phocube/phocube.cpp @@ -74,7 +74,7 @@ namespace Isis { proj = (TProjection *) icube->projection(); } catch(IException &e) { - QString msg = "Mosaic files must contain mapping labels"; + std::string msg = "Mosaic files must contain mapping labels"; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -83,7 +83,7 @@ namespace Isis { cam = icube->camera(); } catch(IException &e) { - QString msg = "If " + FileName(ui.GetCubeName("FROM")).name() + " is a mosaic, make sure the SOURCE " + std::string msg = "If " + FileName(ui.GetCubeName("FROM").toStdString()).name() + " is a mosaic, make sure the SOURCE " "option is set to PROJECTION"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -177,7 +177,7 @@ namespace Isis { if ((pixelResolution = ui.GetBoolean("PIXELRESOLUTION"))) nbands++; if (nbands < 1) { - QString message = "At least one photometry parameter must be entered" + std::string message = "At least one photometry parameter must be entered" "[PHASE, EMISSION, INCIDENCE, LATITUDE, LONGITUDE...]"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/base/apps/phoemplocal/main.cpp b/isis/src/base/apps/phoemplocal/main.cpp index 6a03b17c50..032fddb258 100644 --- a/isis/src/base/apps/phoemplocal/main.cpp +++ b/isis/src/base/apps/phoemplocal/main.cpp @@ -164,7 +164,7 @@ void IsisMain() { os << "CH = " << ui.GetDouble("CH") << endl; } else { - QString errMsg = "Undefined Hapke Model\n"; + std::string errMsg = "Undefined Hapke Model\n"; throw IException(IException::User, errMsg, _FILEINFO_); } @@ -214,7 +214,7 @@ void IsisMain() { os << "# SECOND ORDER HAPKE ATMOSPHERIC SCATTERING MODEL" << endl; } else { - QString errMsg = "Undefined Atmospheric Scattering Model\n"; + std::string errMsg = "Undefined Atmospheric Scattering Model\n"; throw IException(IException::User, errMsg, _FILEINFO_); } @@ -482,7 +482,7 @@ double LinearFitPhotometricToHapke(double pPar, void* pParams){ */ void GetHapkeImgLocation(PhotoModel *pHapke, AtmosModel *pAsmModel, HapkeArrs & pHapkeArrs, Datum & pDatum) { if (NS != (NL * 2 - 1)) { - QString errMsg = "Bad Buffer Dimensions\n"; + std::string errMsg = "Bad Buffer Dimensions\n"; throw IException(IException::User, errMsg, _FILEINFO_); } diff --git a/isis/src/base/apps/photemplate/main.cpp b/isis/src/base/apps/photemplate/main.cpp index 7e98fef6d5..c27e99ad8d 100644 --- a/isis/src/base/apps/photemplate/main.cpp +++ b/isis/src/base/apps/photemplate/main.cpp @@ -80,7 +80,7 @@ void LoadPvl() { if (inPvl.hasObject("PhotometricModel")) { PvlObject phtObj = inPvl.findObject("PhotometricModel"); if (!phtObj.hasGroup("Algorithm")) { - QString message = "The input PVL does not contain a valid photometric model so you must specify one "; + std::string message = "The input PVL does not contain a valid photometric model so you must specify one "; message += "- the [Algorithm] group is missing in your [PhotometricModel]"; throw IException(IException::User, message, _FILEINFO_); } @@ -92,7 +92,7 @@ void LoadPvl() { } else if (phtGrp->hasKeyword("NAME")) { phtVal = QString::fromStdString(phtGrp->findKeyword("NAME")); } else { - QString message = "The input PVL does not contain a valid photometric model so you must specify one "; + std::string message = "The input PVL does not contain a valid photometric model so you must specify one "; message += "- the [Phtname] keyword is missing in your [Algorithm] group"; throw IException(IException::User, message, _FILEINFO_); } @@ -108,7 +108,7 @@ void LoadPvl() { } else if (phtGrp->hasKeyword("NAME")) { phtVal = QString::fromStdString(phtGrp->findKeyword("NAME")); } else { - QString message = "The input PVL does not contain a valid photometric model so you must specify one "; + std::string message = "The input PVL does not contain a valid photometric model so you must specify one "; message += "- the [Phtname] keyword is missing in your [Algorithm] group"; throw IException(IException::User, message, _FILEINFO_); } @@ -168,7 +168,7 @@ void LoadPvl() { } else if (izerob0 == "FALSE") { ui.PutString("ZEROB0STANDARD", "FALSE"); } else { - QString message = "The ZEROB0STANDARD value is invalid - must be set to TRUE or FALSE"; + std::string message = "The ZEROB0STANDARD value is invalid - must be set to TRUE or FALSE"; throw IException(IException::User, message, _FILEINFO_); } } @@ -235,7 +235,7 @@ void LoadPvl() { } } else if (phtVal != "LAMBERT" && phtVal != "LOMMELSEELIGER" && phtVal != "LUNARLAMBERTMCEWEN") { - QString message = "Unsupported photometric model [" + phtVal + "]."; + std::string message = "Unsupported photometric model [" + phtVal + "]."; throw IException(IException::User, message, _FILEINFO_); } ui.PutAsString("PHTNAME", phtVal); @@ -247,7 +247,7 @@ void LoadPvl() { if (inPvl.hasObject("AtmosphericModel")) { PvlObject atmObj = inPvl.findObject("AtmosphericModel"); if (!atmObj.hasGroup("Algorithm")) { - QString message = "The input PVL does not contain a valid atmospheric model so you must specify one "; + std::string message = "The input PVL does not contain a valid atmospheric model so you must specify one "; message += "- the [Algorithm] group is missing in your [AtmosphericModel]"; throw IException(IException::User, message, _FILEINFO_); } @@ -259,7 +259,7 @@ void LoadPvl() { } else if (atmGrp->hasKeyword("NAME")) { atmVal = QString::fromStdString(atmGrp->findKeyword("NAME")); } else { - QString message = "The input PVL does not contain a valid atmospheric model so you must specify one "; + std::string message = "The input PVL does not contain a valid atmospheric model so you must specify one "; message += "- the [Atmname] keyword is missing in your [Algorithm] group"; throw IException(IException::User, message, _FILEINFO_); } @@ -275,7 +275,7 @@ void LoadPvl() { } else if (atmGrp->hasKeyword("NAME")) { atmVal = QString::fromStdString(atmGrp->findKeyword("NAME")); } else { - QString message = "The input PVL does not contain a valid atmospheric model so you must specify one "; + std::string message = "The input PVL does not contain a valid atmospheric model so you must specify one "; message += "- the [Atmname] keyword is missing in your [Algorithm] group"; throw IException(IException::User, message, _FILEINFO_); } @@ -330,7 +330,7 @@ void LoadPvl() { } else if (nulneg.compare("NO")) { ui.PutString("NULNEG", "NO"); } else { - QString message = "The NULNEG value is invalid - must be set to YES or NO"; + std::string message = "The NULNEG value is invalid - must be set to YES or NO"; throw IException(IException::User, message, _FILEINFO_); } } @@ -355,7 +355,7 @@ void LoadPvl() { if (atmVal != "ANISOTROPIC1" && atmVal != "ANISOTROPIC2" && atmVal != "HAPKEATM1" && atmVal != "HAPKEATM2" && atmVal != "ISOTROPIC1" && atmVal != "ISOTROPIC2") { - QString message = "Unsupported atmospheric model [" + atmVal + "]."; + std::string message = "Unsupported atmospheric model [" + atmVal + "]."; throw IException(IException::User, message, _FILEINFO_); } ui.PutAsString("ATMNAME", atmVal); @@ -385,7 +385,7 @@ void IsisMain() { //Check to make sure that a model was specified if (ui.GetAsString("PHTNAME") == "NONE" && ui.GetAsString("ATMNAME") == "NONE") { - QString message = "A photometric model or an atmospheric model must be specified before running this program"; + std::string message = "A photometric model or an atmospheric model must be specified before running this program"; throw IException(IException::User, message, _FILEINFO_); } @@ -474,7 +474,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("THETA")) { - QString message = "The " + phtName + " Photometric model requires a value for the THETA parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the THETA parameter."; message += "The normal range for THETA is: 0 <= THETA <= 90"; throw IException(IException::User, message, _FILEINFO_); } @@ -487,7 +487,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("WH")) { - QString message = "The " + phtName + " Photometric model requires a value for the WH parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the WH parameter."; message += "The normal range for WH is: 0 < WH <= 1"; throw IException(IException::User, message, _FILEINFO_); } @@ -500,7 +500,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("HH")) { - QString message = "The " + phtName + " Photometric model requires a value for the HH parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the HH parameter."; message += "The normal range for HH is: 0 <= HH"; throw IException(IException::User, message, _FILEINFO_); } @@ -513,7 +513,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("B0")) { - QString message = "The " + phtName + " Photometric model requires a value for the B0 parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the B0 parameter."; message += "The normal range for B0 is: 0 <= B0"; throw IException(IException::User, message, _FILEINFO_); } @@ -530,7 +530,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { hasKeyword("ZEROB0STANDARD")) { if (ui.IsInteractive()) { QMessageBox msgbox; - QString message = "You requested that the ZEROB0STANDARD value come from the input PVL file, but there is not one, so the "; + std::string message = "You requested that the ZEROB0STANDARD value come from the input PVL file, but there is not one, so the "; message += "ZEROB0STANDARD parameter is being set to TRUE."; msgbox.setText(message); msgbox.exec(); @@ -547,7 +547,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("HG1")) { - QString message = "The " + phtName + " Photometric model requires a value for the HG1 parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the HG1 parameter."; message += "The normal range for HG1 is: -1 < HG1 < 1"; throw IException(IException::User, message, _FILEINFO_); } @@ -560,7 +560,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("HG2")) { - QString message = "The " + phtName + " Photometric model requires a value for the HG2 parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the HG2 parameter."; message += "The normal range for HG2 is: 0 <= HG2 <= 1"; throw IException(IException::User, message, _FILEINFO_); } @@ -574,7 +574,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("BH")) { - QString message = "The " + phtName + " Photometric model requires a value for the BH parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the BH parameter."; message += "The normal range for BH is: -1 <= BH <= 1"; throw IException(IException::User, message, _FILEINFO_); } @@ -587,7 +587,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("CH")) { - QString message = "The " + phtName + " Photometric model requires a value for the CH parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the CH parameter."; message += "The normal range for CH is: -1 <= CH <= 1"; throw IException(IException::User, message, _FILEINFO_); } @@ -610,7 +610,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("PHASELIST")) { - QString message = "The " + phtName + " Photometric model requires a value for the PHASELIST parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the PHASELIST parameter."; throw IException(IException::User, message, _FILEINFO_); } phaselistsize = outPvl.findObject("PhotometricModel").findGroup("Algorithm"). @@ -625,7 +625,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("PHASECURVELIST")) { - QString message = "The " + phtName + " Photometric model requires a value for the PHASECURVELIST parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the PHASECURVELIST parameter."; throw IException(IException::User, message, _FILEINFO_); } phasecurvelistsize = outPvl.findObject("PhotometricModel").findGroup("Algorithm"). @@ -641,14 +641,14 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("LLIST")) { - QString message = "The " + phtName + " Photometric model requires a value for the LLIST parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the LLIST parameter."; throw IException(IException::User, message, _FILEINFO_); } llistsize = outPvl.findObject("PhotometricModel").findGroup("Algorithm"). findKeyword("LLIST").size(); } if (llistsize != phaselistsize || llistsize != phasecurvelistsize) { - QString message = "The " + phtName + " Photometric model requires that the LLIST, "; + std::string message = "The " + phtName + " Photometric model requires that the LLIST, "; message += "PHASELIST, and PHASECURVELIST parameters all have the same number of "; message += "entries."; throw IException(IException::User, message, _FILEINFO_); @@ -663,14 +663,14 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("KLIST")) { - QString message = "The " + phtName + " Photometric model requires a value for the KLIST parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the KLIST parameter."; throw IException(IException::User, message, _FILEINFO_); } klistsize = outPvl.findObject("PhotometricModel").findGroup("Algorithm"). findKeyword("KLIST").size(); } if (klistsize != phaselistsize || klistsize != phasecurvelistsize) { - QString message = "The " + phtName + " Photometric model requires that the KLIST, "; + std::string message = "The " + phtName + " Photometric model requires that the KLIST, "; message += "PHASELIST, and PHASECURVELIST parameters all have the same number of "; message += "entries."; throw IException(IException::User, message, _FILEINFO_); @@ -687,7 +687,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("L")) { - QString message = "The " + phtName + " Photometric model requires a value for the L parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the L parameter."; message += "The L parameter has no limited range"; throw IException(IException::User, message, _FILEINFO_); } @@ -703,7 +703,7 @@ void addPhoModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("PhotometricModel").findGroup("Algorithm"). hasKeyword("K")) { - QString message = "The " + phtName + " Photometric model requires a value for the K parameter."; + std::string message = "The " + phtName + " Photometric model requires a value for the K parameter."; message += "The normal range for K is: 0 <= K"; throw IException(IException::User, message, _FILEINFO_); } @@ -785,7 +785,7 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). hasKeyword("HNORM")) { - QString message = "The " + atmName + " Atmospheric model requires a value for the HNORM parameter."; + std::string message = "The " + atmName + " Atmospheric model requires a value for the HNORM parameter."; message += "The normal range for HNORM is: 0 <= HNORM"; throw IException(IException::User, message, _FILEINFO_); } @@ -798,7 +798,7 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). hasKeyword("TAU")) { - QString message = "The " + atmName + " Atmospheric model requires a value for the TAU parameter."; + std::string message = "The " + atmName + " Atmospheric model requires a value for the TAU parameter."; message += "The normal range for TAU is: 0 <= TAU"; throw IException(IException::User, message, _FILEINFO_); } @@ -811,7 +811,7 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). hasKeyword("TAUREF")) { - QString message = "The " + atmName + " Atmospheric model requires a value for the TAUREF parameter."; + std::string message = "The " + atmName + " Atmospheric model requires a value for the TAUREF parameter."; message += "The normal range for TAUREF is: 0 <= TAUREF"; throw IException(IException::User, message, _FILEINFO_); } @@ -824,7 +824,7 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). hasKeyword("WHA")) { - QString message = "The " + atmName + " Atmospheric model requires a value for the WHA parameter."; + std::string message = "The " + atmName + " Atmospheric model requires a value for the WHA parameter."; message += "The normal range for WHA is: 0 < WHA < 1"; throw IException(IException::User, message, _FILEINFO_); } @@ -838,7 +838,7 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { addKeyword(PvlKeyword("NULNEG","NO"),Pvl::Replace); } else if (!outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). hasKeyword("NULNEG")) { - QString message = "The " + atmName + " Atmospheric model requires a value for the NULNEG parameter."; + std::string message = "The " + atmName + " Atmospheric model requires a value for the NULNEG parameter."; message += "The valid values for NULNEG are: YES, NO"; throw IException(IException::User, message, _FILEINFO_); } @@ -853,7 +853,7 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). hasKeyword("BHA")) { - QString message = "The " + atmName + " Atmospheric model requires a value for the BHA parameter."; + std::string message = "The " + atmName + " Atmospheric model requires a value for the BHA parameter."; message += "The normal range for BHA is: -1 <= BHA <= 1"; throw IException(IException::User, message, _FILEINFO_); } @@ -868,7 +868,7 @@ void addAtmosModel(Pvl &pvl, Pvl &outPvl) { } else { if (!outPvl.findObject("AtmosphericModel").findGroup("Algorithm"). hasKeyword("HGA")) { - QString message = "The " + atmName + " Atmospheric model requires a value for the HGA parameter."; + std::string message = "The " + atmName + " Atmospheric model requires a value for the HGA parameter."; message += "The normal range for HGA is: -1 < HGA < 1"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/base/apps/pvldiff/main.cpp b/isis/src/base/apps/pvldiff/main.cpp index 292c924f18..47cc4ae149 100644 --- a/isis/src/base/apps/pvldiff/main.cpp +++ b/isis/src/base/apps/pvldiff/main.cpp @@ -91,7 +91,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { tolerances[pvl1.name()].size() > 1 && pvl1.size() != tolerances[pvl1.name()].size() ) { - QString msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; + std::string msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of tolerances in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); @@ -101,7 +101,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { ignoreKeys[pvl1.name()].size() > 1 && pvl1.size() != ignoreKeys[pvl1.name()].size() ) { - QString msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; + std::string msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of ignore keys in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); @@ -111,7 +111,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { ignoreFilePaths[pvl1.name()].size() > 1 && pvl1.size() != ignoreFilePaths[pvl1.name()].size() ) { - QString msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; + std::string msg = "Size of keyword '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of filepath ignores in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/base/apps/reduce/reduce_app.cpp b/isis/src/base/apps/reduce/reduce_app.cpp index 929eb7bf0a..d908f3af24 100644 --- a/isis/src/base/apps/reduce/reduce_app.cpp +++ b/isis/src/base/apps/reduce/reduce_app.cpp @@ -28,7 +28,7 @@ namespace Isis{ // Setup the input and output cubes QString replaceMode = ui.GetAsString("VPER_REPLACE"); - CubeAttributeInput cai(ui.GetAsString("FROM")); + CubeAttributeInput cai(ui.GetAsString("FROM").toStdString()); bands = cai.bands(); QString from = ui.GetCubeName("FROM"); @@ -56,7 +56,7 @@ namespace Isis{ } if(ons > ins || onl > inl) { - QString msg = "Number of output samples/lines must be less than or equal"; + std::string msg = "Number of output samples/lines must be less than or equal"; msg = msg + " to the input samples/lines."; throw IException(IException::User, msg, _FILEINFO_); } @@ -92,11 +92,11 @@ namespace Isis{ throw; } catch (std::exception const &se) { - QString message = "std::exception: " + (QString)se.what(); + std::string message = "std::exception: " + (QString)se.what(); throw IException(IException::User, message, _FILEINFO_); } catch (...) { - QString message = "Other Error"; + std::string message = "Other Error"; throw IException(IException::User, message, _FILEINFO_); } } diff --git a/isis/src/base/apps/remrx/main.cpp b/isis/src/base/apps/remrx/main.cpp index 2c73c82a8a..6737f9ca39 100644 --- a/isis/src/base/apps/remrx/main.cpp +++ b/isis/src/base/apps/remrx/main.cpp @@ -31,12 +31,12 @@ void IsisMain() { // Check reseau status and make sure it is not nominal or removed if(((std::string)status == "Nominal")) { - QString msg = "Input file [" + in + + std::string msg = "Input file [" + in + "] appears to have nominal reseau status. You must run findrx first."; throw IException(IException::User, msg, _FILEINFO_); } if((std::string)status == "Removed") { - QString msg = "Input file [" + in + + std::string msg = "Input file [" + in + "] appears to already have reseaus removed."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/ringsautomos/main.cpp b/isis/src/base/apps/ringsautomos/main.cpp index dcca1cdd91..ee6633f276 100644 --- a/isis/src/base/apps/ringsautomos/main.cpp +++ b/isis/src/base/apps/ringsautomos/main.cpp @@ -82,7 +82,7 @@ void calcRange(double &minRingRad, double &maxRingRad, double &minRingLon, doubl firstProj = proj; } else if(*proj != *firstProj) { - QString msg = "Mapping groups do not match between cubes [" + list[0].toString() + + std::string msg = "Mapping groups do not match between cubes [" + list[0].toString() + "] and [" + list[i].toString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/ringsautomos/ringsautomos.cpp b/isis/src/base/apps/ringsautomos/ringsautomos.cpp index 56b9828a19..8624a7b1dc 100644 --- a/isis/src/base/apps/ringsautomos/ringsautomos.cpp +++ b/isis/src/base/apps/ringsautomos/ringsautomos.cpp @@ -16,7 +16,7 @@ namespace Isis { FileList list; // Get the list of cubes to mosaic - list.read(FileName(ui.GetFileName("FROMLIST"))); + list.read(FileName(ui.GetFileName("FROMLIST").toStdString())); fstream os; bool olistFlag = false; @@ -77,9 +77,9 @@ namespace Isis { bool mosaicCreated = false; for (int i = 0; i < list.size(); i++) { - if (!m.StartProcess(list[i].toString())) { + if (!m.StartProcess(QString::fromStdString(list[i].toString()))) { PvlGroup outsiders("Outside"); - outsiders += PvlKeyword("File", list[i].toString().toStdString()); + outsiders += PvlKeyword("File", list[i].toString()); Application::Log(outsiders); } else { diff --git a/isis/src/base/apps/ringscam2map/main.cpp b/isis/src/base/apps/ringscam2map/main.cpp index 4c98360b69..e5dd94afe7 100644 --- a/isis/src/base/apps/ringscam2map/main.cpp +++ b/isis/src/base/apps/ringscam2map/main.cpp @@ -54,7 +54,7 @@ void IsisMain() { // Make sure it is not the sky if(incam->target()->isSky()) { - QString msg = "The image [" + ui.GetCubeName("FROM") + + std::string msg = "The image [" + ui.GetCubeName("FROM") + "] is targeting the sky, use skymap instead."; throw IException(IException::User, msg, _FILEINFO_); } @@ -209,7 +209,7 @@ void IsisMain() { } } else if(ui.GetString("RINGLONSEAM") == "ERROR") { - QString msg = "The image [" + ui.GetCubeName("FROM") + "] crosses the " + + std::string msg = "The image [" + ui.GetCubeName("FROM") + "] crosses the " + "ring longitude seam"; throw IException(IException::User, msg, _FILEINFO_); } @@ -589,7 +589,7 @@ void LoadMapRes() { ui.PutAsString("PIXRES", "MPP"); } else { - QString msg = "No resolution value found in [" + ui.GetFileName("MAP") + "]"; + std::string msg = "No resolution value found in [" + ui.GetFileName("MAP") + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -651,7 +651,7 @@ void LoadMapRange() { ui.PutAsString("DEFAULTRANGE", "MAP"); if(count < 4) { - QString msg = "One or more of the values for the ground range was not found"; + std::string msg = "One or more of the values for the ground range was not found"; msg += " in [" + ui.GetFileName("MAP") + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/ringsmappt/main.cpp b/isis/src/base/apps/ringsmappt/main.cpp index 31683040ca..8fcefdd5cb 100644 --- a/isis/src/base/apps/ringsmappt/main.cpp +++ b/isis/src/base/apps/ringsmappt/main.cpp @@ -71,13 +71,13 @@ void IsisMain() { // Does it exist? if(!mapFile.fileExists()) { - QString msg = "Filename [" + ui.GetFileName("MAP") + "] does not exist"; + std::string msg = "Filename [" + ui.GetFileName("MAP") + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } // Load it up into a new projection Pvl mapPvl; - mapPvl.read(mapFile.expanded().toStdString()); + mapPvl.read(mapFile.expanded()); RingPlaneProjection *altmap = (RingPlaneProjection *) ProjectionFactory::CreateFromCube(mapPvl); // Set lat and lon in its system @@ -130,7 +130,7 @@ void IsisMain() { if(proj->IsGood()) { PvlGroup results("Results"); results += PvlKeyword("Filename", - FileName(ui.GetCubeName("FROM")).expanded().toStdString()); + FileName(ui.GetCubeName("FROM")).expanded()); results += PvlKeyword("Sample", std::to_string(proj->WorldX())); results += PvlKeyword("Line", std::to_string(proj->WorldY())); results += PvlKeyword("PixelValue", PixelToString(b[0]).toStdString()); @@ -243,12 +243,12 @@ void IsisMain() { } } else if(ui.GetString("FORMAT") == "FLAT") { - QString msg = "Flat file must have a name."; + std::string msg = "Flat file must have a name."; throw IException(IException::User, msg, _FILEINFO_); } } else { - QString msg = "Could not project requested position"; + std::string msg = "Could not project requested position"; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp b/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp index 3c68959018..e4dfea6f11 100644 --- a/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp +++ b/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp @@ -121,7 +121,7 @@ namespace Isis { } bool noErrors = passed; - QString error = ""; + std::string error = ""; if (!camera()->HasSurfaceIntersection()) { error = "Requested position does not project in camera model; no surface intersection"; noErrors = false; diff --git a/isis/src/base/apps/ringspt/main.cpp b/isis/src/base/apps/ringspt/main.cpp index f21f6aa60b..a84b8f0395 100644 --- a/isis/src/base/apps/ringspt/main.cpp +++ b/isis/src/base/apps/ringspt/main.cpp @@ -132,7 +132,7 @@ void IsisMain() { } else { if(ui.GetString("FORMAT") == "FLAT") { - QString msg = "Flat file must have a name."; + std::string msg = "Flat file must have a name."; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/rotate/main.cpp b/isis/src/base/apps/rotate/main.cpp index d94846c79e..ff16a681d2 100644 --- a/isis/src/base/apps/rotate/main.cpp +++ b/isis/src/base/apps/rotate/main.cpp @@ -36,7 +36,7 @@ void IsisMain() { interp = new Interpolator(Interpolator::CubicConvolutionType); } else { - QString msg = "Unknow value for INTERP [" + + std::string msg = "Unknow value for INTERP [" + ui.GetString("INTERP") + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/segment/segment.cpp b/isis/src/base/apps/segment/segment.cpp index 7cb1bfde99..53411311c7 100644 --- a/isis/src/base/apps/segment/segment.cpp +++ b/isis/src/base/apps/segment/segment.cpp @@ -17,7 +17,7 @@ namespace Isis { void segment(Cube *cube, UserInterface &ui) { //Get user parameters - FileName inFile = ui.GetCubeName("FROM"); + FileName inFile = ui.GetCubeName("FROM").toStdString(); int numberOfLines = ui.GetInteger("NL"); int lineOverlap = ui.GetInteger("OVERLAP"); @@ -32,8 +32,8 @@ namespace Isis { bool hasReachedEndOfCube = false; while(startLine <= cube->lineCount() && not hasReachedEndOfCube) { //! Sets up the proper paramaters for running the crop program - QString parameters = "FROM=" + inFile.expanded() + - " TO=" + inFile.path() + "/" + inFile.baseName() + ".segment" + toString(cropNum) + ".cub" + QString parameters = "FROM=" + QString::fromStdString(inFile.expanded()) + + " TO=" + QString::fromStdString(inFile.path()) + "/" + QString::fromStdString(inFile.baseName()) + ".segment" + toString(cropNum) + ".cub" + " LINE=" + toString(startLine) + " NLINES="; if(startLine + numberOfLines > cube->lineCount()) { diff --git a/isis/src/base/apps/shade/main.cpp b/isis/src/base/apps/shade/main.cpp index ca40c3bc40..101cd8fc05 100644 --- a/isis/src/base/apps/shade/main.cpp +++ b/isis/src/base/apps/shade/main.cpp @@ -42,7 +42,7 @@ void IsisMain() { inCube->label()->findObject("IsisCube").findGroup("Mapping")["PixelResolution"]); } else { - QString msg = "The file [" + ui.GetCubeName("FROM") + "] does not have a mapping group," + std::string msg = "The file [" + ui.GetCubeName("FROM") + "] does not have a mapping group," + " you must enter a Pixel Resolution"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/shadow/ShadowFunctor.cpp b/isis/src/base/apps/shadow/ShadowFunctor.cpp index 3b8e7318fd..076ab704e1 100644 --- a/isis/src/base/apps/shadow/ShadowFunctor.cpp +++ b/isis/src/base/apps/shadow/ShadowFunctor.cpp @@ -463,15 +463,13 @@ namespace Isis { void ShadowFunctor::setSunPosition(FileName cubeFileNameWithCamToMatch) { try { Cube matchCube; - matchCube.open(cubeFileNameWithCamToMatch.original(), "r"); + matchCube.open(QString::fromStdString(cubeFileNameWithCamToMatch.original()), "r"); setSunPosition(&matchCube); } catch (IException &e) { throw IException(e, - IException::User, - QObject::tr("Could not find the sun position from the match file [%1]") - .arg(cubeFileNameWithCamToMatch.original()), + IException::User,"Could not find the sun position from the match file [" + cubeFileNameWithCamToMatch.original() + "]", _FILEINFO_); } } diff --git a/isis/src/base/apps/shadow/shadow.cpp b/isis/src/base/apps/shadow/shadow.cpp index d095ad12b4..994ec3e2bb 100644 --- a/isis/src/base/apps/shadow/shadow.cpp +++ b/isis/src/base/apps/shadow/shadow.cpp @@ -18,7 +18,7 @@ namespace Isis { UserInterface &ui); void shadow(UserInterface &ui, Pvl *log) { - Cube *demCube = new Cube(ui.GetCubeName("FROM")); + Cube *demCube = new Cube(ui.GetCubeName("FROM").toStdString()); shadow(demCube, ui, log); } @@ -38,7 +38,7 @@ namespace Isis { "spkpos_c.html"); if (ui.GetString("SUNPOSITIONSOURCE") == "MATCH") { - functor.setSunPosition(ui.GetCubeName("MATCH")); + functor.setSunPosition(ui.GetCubeName("MATCH").toStdString()); } else { QStringList allKernelFiles; @@ -50,7 +50,7 @@ namespace Isis { foreach (QString kernelFile, allKernelFiles) { kernelsUsed += kernelFile.toStdString(); - furnsh_c(FileName(kernelFile).expanded().toLatin1().data()); + furnsh_c(FileName(kernelFile.toStdString()).expanded().c_str()); } // Find the NAIF target code for the DEM's target @@ -81,7 +81,7 @@ namespace Isis { sunPosition[2] *= 1000; foreach (QString kernelFile, allKernelFiles) { - unload_c(FileName(kernelFile).expanded().toLatin1().data()); + unload_c(FileName(kernelFile.toStdString()).expanded().c_str()); } NaifStatus::CheckErrors(); @@ -173,7 +173,7 @@ namespace Isis { int allowed = Kernel::typeEnum("PREDICTED") | Kernel::typeEnum("RECONSTRUCTED") | Kernel::typeEnum("SMITHED"); - KernelDb kernelDb(FileName(kernelDbFile).highestVersion().expanded(), allowed); + KernelDb kernelDb(QString::fromStdString(FileName(kernelDbFile.toStdString()).highestVersion().expanded()), allowed); Kernel detectedKernels = (kernelDb.*kernelDbAccessor)(labels); diff --git a/isis/src/base/apps/shadowtau/main.cpp b/isis/src/base/apps/shadowtau/main.cpp index bc429208fd..6915a62ef0 100644 --- a/isis/src/base/apps/shadowtau/main.cpp +++ b/isis/src/base/apps/shadowtau/main.cpp @@ -230,7 +230,7 @@ void IsisMain() { asmModel = AtmosModelFactory::Create(asmPvl, *photoModel); if (asmModel == NULL) { - QString errMsg = "Unable create an Atmospheric Model\n"; + std::string errMsg = "Unable create an Atmospheric Model\n"; throw IException(IException::User, errMsg, _FILEINFO_); } @@ -258,7 +258,7 @@ void IsisMain() { } if (inFile.getRow(0).dim() <= 1) { - QString msg = "File [" + sInFileName.expanded() + "] either has only one line item or is not delimited by a ',' or ' '."; + std::string msg = "File [" + sInFileName.expanded() + "] either has only one line item or is not delimited by a ',' or ' '."; throw IException(IException::User, msg, _FILEINFO_); } @@ -277,7 +277,7 @@ void IsisMain() { angles.push_back(toDouble(row[j])); } catch (IException &e) { - QString msg = "Unable to convert (" + toString(i) + ", " + toString(j) + + std::string msg = "Unable to convert (" + toString(i) + ", " + toString(j) + ") element [" + row[j] + "] to double. You may want to check for excess delimiters." + "Current delimiter is set to '" + inFile.getDelimiter() + "'"; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/base/apps/skymap/main.cpp b/isis/src/base/apps/skymap/main.cpp index c300d05665..b543eb432e 100644 --- a/isis/src/base/apps/skymap/main.cpp +++ b/isis/src/base/apps/skymap/main.cpp @@ -301,7 +301,7 @@ void LoadMapRes() { ui.PutDouble("SCALE", userGrp["Scale"]); } else { - QString msg = "Mapfile [" + ui.GetFileName("MAP") + + std::string msg = "Mapfile [" + ui.GetFileName("MAP") + "] does not have [SCALE] keyword to load"; throw IException(IException::User, msg, _FILEINFO_); } @@ -359,7 +359,7 @@ void LoadMapRange() { ui.PutAsString("DEFAULTRANGE", "MAP"); if(count < 4) { - QString msg = "One or more of the values for the sky range was not found"; + std::string msg = "One or more of the values for the sky range was not found"; msg += " in [" + ui.GetFileName("MAP") + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/skypt/skypt.cpp b/isis/src/base/apps/skypt/skypt.cpp index 513b624aba..b57c955fd4 100644 --- a/isis/src/base/apps/skypt/skypt.cpp +++ b/isis/src/base/apps/skypt/skypt.cpp @@ -25,7 +25,7 @@ using namespace Isis; namespace Isis{ void skypt(UserInterface &ui, Pvl *log) { - Cube *cube = new Cube(ui.GetCubeName("FROM")); + Cube *cube = new Cube(ui.GetCubeName("FROM").toStdString()); skypt(cube, ui, log); } @@ -51,7 +51,7 @@ namespace Isis{ double ra = ui.GetDouble("RA"); double dec = ui.GetDouble("DEC"); if (!cam->SetRightAscensionDeclination(ra, dec)) { - QString msg = "Invalid Ra/Dec coordinate"; + std::string msg = "Invalid Ra/Dec coordinate"; throw IException(IException::User, msg, _FILEINFO_); } samp = cam->Sample(); @@ -75,7 +75,7 @@ namespace Isis{ // Create group with sky position PvlGroup sp("SkyPoint"); { - sp += PvlKeyword("Filename", FileName(channel).expanded().toStdString()); + sp += PvlKeyword("Filename", FileName(channel.toStdString()).expanded()); sp += PvlKeyword("Sample", std::to_string(cam->Sample())); sp += PvlKeyword("Line", std::to_string(cam->Line())); sp += PvlKeyword("RightAscension", std::to_string(cam->RightAscension())); @@ -91,8 +91,8 @@ namespace Isis{ // Write an output label file if necessary if (ui.WasEntered("TO")) { // Get user params from ui - QString outFile = FileName(ui.GetFileName("TO")).expanded(); - bool exists = FileName(outFile).fileExists(); + QString outFile = QString::fromStdString(FileName(ui.GetFileName("TO").toStdString()).expanded()); + bool exists = FileName(outFile.toStdString()).fileExists(); bool append = ui.GetBoolean("APPEND"); // Write the pvl group out to the file @@ -144,7 +144,7 @@ namespace Isis{ } } else if (ui.GetString("FORMAT") == "FLAT") { - QString msg = "Flat file must have a name."; + std::string msg = "Flat file must have a name."; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/slpmap/main.cpp b/isis/src/base/apps/slpmap/main.cpp index 5dc6693968..723891de67 100644 --- a/isis/src/base/apps/slpmap/main.cpp +++ b/isis/src/base/apps/slpmap/main.cpp @@ -138,7 +138,7 @@ void createSlpCubeAutomatic(Buffer &in, double &v) { Distance(in[4], Distance::Meters); } catch (IException &e) { - QString msg = QString("The input cube contains a negative DN at (sample,line,band) " + std::string msg = QString("The input cube contains a negative DN at (sample,line,band) " "[(%1,%2,%3)]. The automatic pixel resolution option requires the input cube contain " "raduis values. It is possible the input cube contains elevation or other data."). arg( in.Sample(4) ).arg( in.Line(4) ).arg( in.Band(4) ); diff --git a/isis/src/base/apps/smtk/main.cpp b/isis/src/base/apps/smtk/main.cpp index 5eb35176ff..7c55519ef9 100644 --- a/isis/src/base/apps/smtk/main.cpp +++ b/isis/src/base/apps/smtk/main.cpp @@ -112,7 +112,7 @@ void IsisMain() { // Ensure only single bands if (lhImage.bandCount() != 1 || rhImage.bandCount() != 1) { - QString msg = "Input Cubes must have only one band!"; + std::string msg = "Input Cubes must have only one band!"; throw IException(IException::User,msg,_FILEINFO_); } @@ -126,7 +126,7 @@ void IsisMain() { rhCamera = rhImage.camera(); } catch (IException &ie) { - QString msg = "Both input images must have a camera"; + std::string msg = "Both input images must have a camera"; throw IException(ie, IException::User, msg, _FILEINFO_); } @@ -144,7 +144,7 @@ void IsisMain() { QString sLeft = FileName(lhImage.fileName()).name(); QString sRight = FileName(rhImage.fileName()).name(); if (sLeft == sRight) { - QString msg = "Cube Serial Numbers must be unique - FROM=" + serialLeft + + std::string msg = "Cube Serial Numbers must be unique - FROM=" + serialLeft + ", MATCH=" + serialRight; throw IException(IException::User,msg,_FILEINFO_); } @@ -292,7 +292,7 @@ void IsisMain() { // some. /////////////////////////////////////////////////////////////////////// if (gstack.size() <= 0) { - QString msg = "No seed points found - may need to check Gruen parameters."; + std::string msg = "No seed points found - may need to check Gruen parameters."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/specdivfilter/main.cpp b/isis/src/base/apps/specdivfilter/main.cpp index ea0aa67dfa..cae26fe180 100644 --- a/isis/src/base/apps/specdivfilter/main.cpp +++ b/isis/src/base/apps/specdivfilter/main.cpp @@ -27,7 +27,7 @@ void IsisMain() { //Check for cases of too many bands if(bands > maxBands) { - QString msg = "Parameter bands [" + toString(bands) + "] exceeds maximum allowable size " + std::string msg = "Parameter bands [" + toString(bands) + "] exceeds maximum allowable size " + "of [" + toString(maxBands) + "] for cube [" + icube->fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/spechighpass/main.cpp b/isis/src/base/apps/spechighpass/main.cpp index 17b3493168..b79d6db0d0 100644 --- a/isis/src/base/apps/spechighpass/main.cpp +++ b/isis/src/base/apps/spechighpass/main.cpp @@ -28,7 +28,7 @@ void IsisMain() { //Check for cases of too many bands if(bands >= (2 * cubeBands)) { - QString msg = "Parameter bands [" + QString::number(bands) + "] " + std::string msg = "Parameter bands [" + QString::number(bands) + "] " "exceeds maximum allowable size of [" + QString::number((cubeBands * 2) - 1) + "] for cube [" + icube->fileName() + "]"; diff --git a/isis/src/base/apps/speclowpass/main.cpp b/isis/src/base/apps/speclowpass/main.cpp index ab475f1284..5253286e8b 100644 --- a/isis/src/base/apps/speclowpass/main.cpp +++ b/isis/src/base/apps/speclowpass/main.cpp @@ -26,7 +26,7 @@ void IsisMain() { // Check for cases of too many bands if(bands > maxBands) { - QString msg = "Parameter bands [" + toString(bands) + "] exceeds maximum allowable size " + std::string msg = "Parameter bands [" + toString(bands) + "] exceeds maximum allowable size " + "of [" + toString(maxBands) + "] for cube [" + icube->fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/spicefit/main.cpp b/isis/src/base/apps/spicefit/main.cpp index a2af7c5451..ad77e99f53 100644 --- a/isis/src/base/apps/spicefit/main.cpp +++ b/isis/src/base/apps/spicefit/main.cpp @@ -23,7 +23,7 @@ void IsisMain() { // Get the camera, interpolate to a parabola Camera *cam = cube.camera(); if(cam->DetectorMap()->LineRate() == 0.0) { - QString msg = "[" + ui.GetCubeName("FROM") + "] is not a line scan camera"; + std::string msg = "[" + ui.GetCubeName("FROM") + "] is not a line scan camera"; throw IException(IException::User, msg, _FILEINFO_); } cam->instrumentRotation()->SetPolynomial(); @@ -53,7 +53,7 @@ void IsisMain() { cube.close(); } catch(IException &e) { - QString msg = "Unable to fit pointing for [" + ui.GetFileName("FROM") + "]"; + std::string msg = "Unable to fit pointing for [" + ui.GetFileName("FROM") + "]"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/spiceinit/SpiceClient.cpp b/isis/src/base/apps/spiceinit/SpiceClient.cpp index 27d5f3b52a..1f42230d82 100644 --- a/isis/src/base/apps/spiceinit/SpiceClient.cpp +++ b/isis/src/base/apps/spiceinit/SpiceClient.cpp @@ -418,12 +418,12 @@ namespace Isis { */ QDomElement SpiceClient::rootXMLElement() { if(!p_response || !p_rawResponse) { - QString error = "No server response available"; + std::string error = "No server response available"; throw IException(IException::Io, error, _FILEINFO_); } QDomDocument document; - QString errorMsg; + std::string errorMsg; int errorLine, errorCol; if(!p_response->isEmpty() && @@ -432,7 +432,7 @@ namespace Isis { return document.firstChild().toElement(); } else { - QString msg = "Unexpected response from spice server ["; + std::string msg = "Unexpected response from spice server ["; msg += *p_rawResponse; msg += "]"; throw IException(IException::Io, msg, _FILEINFO_); @@ -461,7 +461,7 @@ namespace Isis { } } - QString msg = "Server response missing XML Tag [" + name + "]"; + std::string msg = "Server response missing XML Tag [" + name + "]"; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/spiceinit/spiceinit.cpp b/isis/src/base/apps/spiceinit/spiceinit.cpp index f5757ad46d..231beb4a7f 100644 --- a/isis/src/base/apps/spiceinit/spiceinit.cpp +++ b/isis/src/base/apps/spiceinit/spiceinit.cpp @@ -70,12 +70,12 @@ namespace Isis { // Make sure at least one CK & SPK quality was selected if (!ui.GetBoolean("CKPREDICTED") && !ui.GetBoolean("CKRECON") && !ui.GetBoolean("CKSMITHED") && !ui.GetBoolean("CKNADIR")) { - QString msg = "At least one CK quality must be selected"; + std::string msg = "At least one CK quality must be selected"; throw IException(IException::User, msg, _FILEINFO_); } if (!ui.GetBoolean("SPKPREDICTED") && !ui.GetBoolean("SPKRECON") && !ui.GetBoolean("SPKSMITHED")) { - QString msg = "At least one SPK quality must be selected"; + std::string msg = "At least one SPK quality must be selected"; throw IException(IException::User, msg, _FILEINFO_); } @@ -89,7 +89,7 @@ namespace Isis { } if (proj != NULL) { - QString msg = "Can not initialize SPICE for a map projected cube"; + std::string msg = "Can not initialize SPICE for a map projected cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -611,12 +611,12 @@ namespace Isis { QString::fromStdString(labels.findGroup("Instrument", Pvl::Traverse)["InstrumentId"][0]); if (instrumentId == "HRSC"){ - QString msg = "Spice Server does not support MEX HRSC images. Please rerun spiceinit with local MEX data."; + std::string msg = "Spice Server does not support MEX HRSC images. Please rerun spiceinit with local MEX data."; throw IException(IException::User, msg, _FILEINFO_); } if (ui.GetString("URL") == "https://services.isis.astrogeology.usgs.gov/cgi-bin/spiceinit.cgi"){ - QString msg = "USER WARNING: The URL you entered has been deprecated and no longer recommended for use."; + std::string msg = "USER WARNING: The URL you entered has been deprecated and no longer recommended for use."; std::cerr << msg << std::endl; } diff --git a/isis/src/base/apps/spiceserver/spiceserver.cpp b/isis/src/base/apps/spiceserver/spiceserver.cpp index 64369154b6..884e082dbb 100644 --- a/isis/src/base/apps/spiceserver/spiceserver.cpp +++ b/isis/src/base/apps/spiceserver/spiceserver.cpp @@ -90,7 +90,7 @@ namespace Isis { // Parse the XML with Qt's XML parser... kindof convoluted, I'm sorry QDomDocument document; - QString error; + std::string error; int errorLine, errorCol; if ( document.setContent(QString(xml), &error, &errorLine, &errorCol) ) { QDomElement rootElement = document.firstChild().toElement(); @@ -127,7 +127,7 @@ namespace Isis { } } else { - QString msg = "Unable to read input file"; + std::string msg = "Unable to read input file"; throw IException(IException::User, msg, _FILEINFO_); } @@ -136,7 +136,7 @@ namespace Isis { QStringList remoteVersion = otherVersion.split(QRegExp("\\s+"))[0].split(QRegExp("\\.")); if ( remoteVersion[0].toInt() <= 3 && remoteVersion[1].toInt() < 5) { - QString msg ="The SPICE server only supports Isis versions greater than or equal to 3.5.*.*."; + std::string msg ="The SPICE server only supports Isis versions greater than or equal to 3.5.*.*."; msg += "Your version: [" + otherVersion + "] is not compatible"; throw IException(IException::User, msg, _FILEINFO_); } @@ -272,10 +272,10 @@ namespace Isis { * * This program has read and write access on the spice server in /tmp/spice_web_service. */ - inputLabels = FileName::createTempFile( ui.GetCubeName("TEMPFILE") ); - label.write( inputLabels.expanded().toStdString() ); + inputLabels = FileName::createTempFile(ui.GetCubeName("TEMPFILE").toStdString()); + label.write(inputLabels.expanded()); Cube cube; - cube.open(inputLabels.expanded(), "rw"); + cube.open(QString::fromStdString(inputLabels.expanded()), "rw"); kernelSuccess = tryKernels(cube, ui, log, label, p, lk, pck, targetSpk, realCkKernel, fk, ik, sclk, spk, iak, dem, exk); @@ -287,7 +287,7 @@ namespace Isis { else { packageKernels( ui.GetFileName("TO") ); } - remove( inputLabels.expanded().toLatin1() ); //clean up + remove(inputLabels.expanded().c_str()); //clean up p.EndProcess(); } catch (...) { @@ -516,7 +516,7 @@ namespace Isis { QFile tableFile(file); if ( !tableFile.open(QIODevice::ReadOnly) ) { - QString msg = "Unable to read temporary file [" + file + "]"; + std::string msg = "Unable to read temporary file [" + file + "]"; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/spkwriter/KernelWriter.h b/isis/src/base/apps/spkwriter/KernelWriter.h index 4b46e3ce67..b458c253cd 100644 --- a/isis/src/base/apps/spkwriter/KernelWriter.h +++ b/isis/src/base/apps/spkwriter/KernelWriter.h @@ -144,7 +144,7 @@ class KernelWriter { virtual bool WriteComment(SpiceInt handle, const QString &comment) const { if ( handle == 0 ) { - QString mess = "Comments cannot be written as the file is not open"; + std::string mess = "Comments cannot be written as the file is not open"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/spkwriter/SpkKernelWriter.h b/isis/src/base/apps/spkwriter/SpkKernelWriter.h index ad26a033ba..a11276668b 100644 --- a/isis/src/base/apps/spkwriter/SpkKernelWriter.h +++ b/isis/src/base/apps/spkwriter/SpkKernelWriter.h @@ -83,7 +83,7 @@ class SpkKernelWriter : public KernelWriter { */ void setType(const int spktype) { if ( (spktype != 9) && (spktype != 13) ) { - QString mess = "SPK kernel type " + QString(spktype) + + std::string mess = "SPK kernel type " + QString(spktype) + " not valid/supported - must 9 or 13"; throw IException(IException::User, mess, _FILEINFO_); } @@ -93,15 +93,15 @@ class SpkKernelWriter : public KernelWriter { protected: int k_open(const QString &kfile, const int &comsize = 512) { - FileName kf(kfile); + FileName kf(kfile.toStdString()); if ( kf.fileExists() ) { - QString full_kf = kf.expanded(); + QString full_kf = QString::fromStdString(kf.expanded()); std::remove(full_kf.toLatin1().data()); } SpiceInt myHandle; NaifStatus::CheckErrors(); - spkopn_c(kf.expanded().toLatin1().data(), "USGS_SPK_FILE", comsize, &myHandle); + spkopn_c(kf.expanded().c_str(), "USGS_SPK_FILE", comsize, &myHandle); NaifStatus::CheckErrors(); return (myHandle); } diff --git a/isis/src/base/apps/spkwriter/SpkSegment.cpp b/isis/src/base/apps/spkwriter/SpkSegment.cpp index 027b23d20f..c64e5ea799 100644 --- a/isis/src/base/apps/spkwriter/SpkSegment.cpp +++ b/isis/src/base/apps/spkwriter/SpkSegment.cpp @@ -115,7 +115,7 @@ void SpkSegment::import(Cube &cube) { spkCache = camera->instrumentPosition()->LoadHermiteCache("SpkSegment"); } else { - QString mess = "Unsupported SPK kernel type (" + + std::string mess = "Unsupported SPK kernel type (" + QString::number(m_spkType) + ") - must be 9 or 13."; throw IException(IException::User, mess, _FILEINFO_); } @@ -326,7 +326,7 @@ QString SpkSegment::getComment() const { comment << "\n-----------------------------------------------------------------------\n" << -" File: " << FileName(Source()).name() << endl << +" File: " << FileName(Source().toStdString()).name() << endl << " Segment ID: " << Id() << " (ProductId)" << endl << " StartTime: " << utcStartTime() << endl << " EndTime: " << utcEndTime() << endl << @@ -462,7 +462,7 @@ SpkSegment::SMatrix SpkSegment::load(Table &table) { void SpkSegment::validateType(const int spktype) const { if ( !(( 9 == spktype ) || ( 13 == spktype )) ) { - QString mess = "Unsupported SPK kernel type (" + + std::string mess = "Unsupported SPK kernel type (" + QString::number(spktype) + ") - must be 9 or 13."; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/spkwriter/SpkSpiceSegment.cpp b/isis/src/base/apps/spkwriter/SpkSpiceSegment.cpp index ab2916c3ee..6e1f73532b 100644 --- a/isis/src/base/apps/spkwriter/SpkSpiceSegment.cpp +++ b/isis/src/base/apps/spkwriter/SpkSpiceSegment.cpp @@ -127,7 +127,7 @@ void SpkSpiceSegment::init(Cube &cube) { if ( _name.isEmpty() ) { _name = getKeyValue(*label, "ProductId"); if (_name.isEmpty() ) { - _name = FileName(_fname).baseName(); + _name = QString::fromStdString(FileName(_fname.toStdString()).baseName()); } } diff --git a/isis/src/base/apps/spkwriter/spkwriter.cpp b/isis/src/base/apps/spkwriter/spkwriter.cpp index ed653a3e04..c72e0d1729 100644 --- a/isis/src/base/apps/spkwriter/spkwriter.cpp +++ b/isis/src/base/apps/spkwriter/spkwriter.cpp @@ -32,7 +32,7 @@ namespace Isis { // Now check for problems if ( 0 < errors.size() ) { - QString mess = "Time/body overlap conflicts are present in segment (image) list. " + std::string mess = "Time/body overlap conflicts are present in segment (image) list. " "This will likely create erroneous positions in one or more " "images. You should create a seperate kernel for conflicting " "images that overlap another. Images with time/body overlap " @@ -49,10 +49,10 @@ namespace Isis { // Get the list of names of input CCD cubes to stitch together FileList flist; - if (ui.WasEntered("FROM")) flist.push_back(ui.GetCubeName("FROM")); - if (ui.WasEntered("FROMLIST")) flist.read(ui.GetFileName("FROMLIST")); + if (ui.WasEntered("FROM")) flist.push_back(ui.GetCubeName("FROM").toStdString()); + if (ui.WasEntered("FROMLIST")) flist.read(ui.GetFileName("FROMLIST").toStdString()); if (flist.size() < 1) { - QString msg = "Files must be specified in FROM and/or FROMLIST - none found!"; + std::string msg = "Files must be specified in FROM and/or FROMLIST - none found!"; throw IException(IException::User,msg,_FILEINFO_); } @@ -67,10 +67,10 @@ namespace Isis { for (int i = 0 ; i < flist.size() ; i++) { // Add and process each image try { - kernel.add(SpkSegment(flist[i].toString(), spkType)); + kernel.add(SpkSegment(QString::fromStdString(flist[i].toString()), spkType)); } catch (IException &ie) { - QString mess = "Cannot create type 13 SPK. Please use type 9 or run jigsaw to create a " + std::string mess = "Cannot create type 13 SPK. Please use type 9 or run jigsaw to create a " " polynomical solution for the Spice Position."; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -110,11 +110,11 @@ namespace Isis { // Write a summary of the documentation if (ui.WasEntered("SUMMARY")) { - QString fFile = FileName(ui.GetFileName("SUMMARY")).expanded(); + QString fFile = QString::fromStdString(FileName(ui.GetFileName("SUMMARY").toStdString()).expanded()); ofstream os; os.open(fFile.toLatin1().data(),ios::out); if (!os) { - QString mess = "Cannot create SPK SUMMARY output file " + fFile; + std::string mess = "Cannot create SPK SUMMARY output file " + fFile; throw IException(IException::User, mess, _FILEINFO_); } os << kwriter.getComment(kernel, comfile) << endl; diff --git a/isis/src/base/apps/stats/stats.cpp b/isis/src/base/apps/stats/stats.cpp index 21847cf5dc..953d73d9ec 100644 --- a/isis/src/base/apps/stats/stats.cpp +++ b/isis/src/base/apps/stats/stats.cpp @@ -59,7 +59,7 @@ namespace Isis { inputCube = nullptr; if ( ui.WasEntered("TO") ) { - QString outFile = FileName(ui.GetFileName("TO")).expanded(); + QString outFile = QString::fromStdString(FileName(ui.GetFileName("TO").toStdString()).expanded()); bool append = ui.GetBoolean("APPEND"); //write the results in the requested format. if ( ui.GetString("FORMAT") == "PVL" ) { @@ -71,7 +71,7 @@ namespace Isis { } } else { - bool exists = FileName(outFile).fileExists(); + bool exists = FileName(outFile.toStdString()).fileExists(); bool writeHeader = false; ofstream *os = new ofstream; if (append) { diff --git a/isis/src/base/apps/std2isis/std2isis.cpp b/isis/src/base/apps/std2isis/std2isis.cpp index 81daba04d1..6ac2f83608 100644 --- a/isis/src/base/apps/std2isis/std2isis.cpp +++ b/isis/src/base/apps/std2isis/std2isis.cpp @@ -7,7 +7,7 @@ namespace Isis { void std2isis(UserInterface &ui) { - FileName inputName = ui.GetFileName("FROM"); + FileName inputName = ui.GetFileName("FROM").toStdString(); ImageImporter *importer = ImageImporter::fromFileName(inputName); // Explicitly set band dimension if a specific color mode is desired @@ -26,7 +26,7 @@ namespace Isis { importer->setLrsRange(ui.GetDouble("LRSMIN"), ui.GetDouble("LRSMAX")); // Import the image - FileName outputName = ui.GetCubeName("TO"); + FileName outputName = ui.GetCubeName("TO").toStdString(); CubeAttributeOutput &att = ui.GetOutputAttribute("TO"); importer->import(outputName, att); diff --git a/isis/src/base/apps/stretch/stretch_app.cpp b/isis/src/base/apps/stretch/stretch_app.cpp index 6a53bfdf57..d317b9b008 100644 --- a/isis/src/base/apps/stretch/stretch_app.cpp +++ b/isis/src/base/apps/stretch/stretch_app.cpp @@ -27,10 +27,10 @@ namespace Isis { // first just get the pairs from where ever and worry about // whether they are dn values or %'s later if(ui.GetBoolean("READFILE")) { - FileName pairsFileName = ui.GetFileName("INPUTFILE"); + FileName pairsFileName = ui.GetFileName("INPUTFILE").toStdString(); TextFile pairsFile; pairsFile.SetComment("#"); - pairsFile.Open(pairsFileName.expanded()); + pairsFile.Open(QString::fromStdString(pairsFileName.expanded())); // concat all non-comment lines into one string (pairs) QString line = ""; diff --git a/isis/src/base/apps/tabledump/main.cpp b/isis/src/base/apps/tabledump/main.cpp index 276fa1b5c7..50ab1bf381 100644 --- a/isis/src/base/apps/tabledump/main.cpp +++ b/isis/src/base/apps/tabledump/main.cpp @@ -147,7 +147,7 @@ void helperButtonGetTableList() { UserInterface &ui = Application::GetUserInterface(); QString currentFile = ui.GetCubeName("FROM"); - const Pvl label(FileName(currentFile).expanded().toStdString()); + const Pvl label(FileName(currentFile).expanded()); // Check to see if the "FILE" parameter has changed since last press if (currentFile != g_previousFile) { @@ -162,7 +162,7 @@ void helperButtonGetTableList() { // If we've gone through all objects and found nothing, throw an exception if (cnt >= label.objects()) { g_pos = 0; - QString msg = "Parameter [FROM] has no tables."; + std::string msg = "Parameter [FROM] has no tables."; throw IException(IException::User, msg, _FILEINFO_); } // When the end of the objects is hit, display "NAME" parameter as blank diff --git a/isis/src/base/apps/trackextract/main.cpp b/isis/src/base/apps/trackextract/main.cpp index 1993739e12..157f67702a 100644 --- a/isis/src/base/apps/trackextract/main.cpp +++ b/isis/src/base/apps/trackextract/main.cpp @@ -83,7 +83,7 @@ void IsisMain() { Cube inputCube = Cube(inputName); PixelType pixelType = inputCube.pixelType(); if (pixelType != Real) { - QString msg = "The input mosaic [" + inputName + "] is of pixel type [" + std::string msg = "The input mosaic [" + inputName + "] is of pixel type [" + PixelTypeName(pixelType) + "]. This application only works for mosaics of pixel type Real."; throw IException(IException::User, msg, _FILEINFO_); } @@ -123,17 +123,17 @@ void findTrackBand(QString inputName, QVector ©Bands, int &trackBan } } catch (IException &e) { - QString msg = "The input cube [" + inputName + "] does not have any keywords"; + std::string msg = "The input cube [" + inputName + "] does not have any keywords"; msg += " in the BandBin group. Make sure TRACKING is a keyword in the BandBin group."; throw IException(IException::Programmer, msg, _FILEINFO_); } } else { - QString msg = "The input cube [" + inputName + "] does not have a BandBin group."; + std::string msg = "The input cube [" + inputName + "] does not have a BandBin group."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (trackBand == -1) { - QString msg = "The input cube [" + inputName + "] does not have a tracking band."; + std::string msg = "The input cube [" + inputName + "] does not have a tracking band."; msg += " If you want to create a tracking cube, run a mosaic program."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -171,7 +171,7 @@ void createMosaicCube(QString inputName, QString outputName, QVector ba } if (!mosaicCube.deleteBlob("InputImages", "Table")) { - QString msg = "The input cube [" + inputName + "] does not have a tracking table."; + std::string msg = "The input cube [" + inputName + "] does not have a tracking table."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -235,7 +235,7 @@ void createTrackCube(QString inputName, QString ouputName, int trackBand) { break; default: - QString msg = "Invalid Pixel Type [" + QString(inputCube.pixelType()) + "]"; + std::string msg = "Invalid Pixel Type [" + QString(inputCube.pixelType()) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } CopyPixelsFunctor copyTrackPixels(offset, defaultVal); @@ -263,7 +263,7 @@ void createTrackCube(QString inputName, QString ouputName, int trackBand) { trackCube.write(newTable); } else { - QString msg = "The tracking cube [" + trackingName + "] does not have a tracking table."; + std::string msg = "The tracking cube [" + trackingName + "] does not have a tracking table."; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/translate/main.cpp b/isis/src/base/apps/translate/main.cpp index 8c861a224b..2cbac174e4 100644 --- a/isis/src/base/apps/translate/main.cpp +++ b/isis/src/base/apps/translate/main.cpp @@ -33,7 +33,7 @@ void IsisMain() { interp = new Interpolator(Interpolator::CubicConvolutionType); } else { - QString msg = "Unknow value for INTERP [" + + std::string msg = "Unknow value for INTERP [" + ui.GetString("INTERP") + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/AbstractShape/unitTest.cpp b/isis/src/base/objs/AbstractShape/unitTest.cpp index c3c5f38a8c..f977994f26 100755 --- a/isis/src/base/objs/AbstractShape/unitTest.cpp +++ b/isis/src/base/objs/AbstractShape/unitTest.cpp @@ -27,7 +27,7 @@ int main(int argc, char *argv[]) { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/Albedo/Albedo.cpp b/isis/src/base/objs/Albedo/Albedo.cpp index 64e11a8f89..0d9897a366 100644 --- a/isis/src/base/objs/Albedo/Albedo.cpp +++ b/isis/src/base/objs/Albedo/Albedo.cpp @@ -93,7 +93,7 @@ namespace Isis { } else { if(psurf == 0.0) { - QString msg = "Albedo math divide by zero error"; + std::string msg = "Albedo math divide by zero error"; throw IException(IException::Unknown, msg, _FILEINFO_); } else { diff --git a/isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp b/isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp index 80ae831902..82707d1a3a 100644 --- a/isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp +++ b/isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp @@ -141,7 +141,7 @@ namespace Isis { fourthterm = pow(q, 2.0) - 4.0 * thirdterm; if(fourthterm < 0.0) { - QString msg = "Square root of negative (math) encountered"; + std::string msg = "Square root of negative (math) encountered"; throw IException(IException::Unknown, msg, _FILEINFO_); } else { @@ -153,7 +153,7 @@ namespace Isis { // Now use rho and reference geometry to calculate output dnout if((1.0 - rho * GetAtmosModel()->AtmosAb()*p_normSbar) <= 0.0) { - QString msg = "Divide by zero (math) encountered"; + std::string msg = "Divide by zero (math) encountered"; throw IException(IException::Unknown, msg, _FILEINFO_); } else { @@ -175,8 +175,8 @@ namespace Isis { */ void AlbedoAtm::SetNormPharef(const double pharef) { if(pharef < 0.0 || pharef >= 180.0) { - QString msg = "Invalid value of normalization pharef [" + - toString(pharef) + "]"; + std::string msg = "Invalid value of normalization pharef [" + + std::to_string(pharef) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -194,8 +194,8 @@ namespace Isis { */ void AlbedoAtm::SetNormIncref(const double incref) { if(incref < 0.0 || incref >= 90.0) { - QString msg = "Invalid value of normalization incref [" + - toString(incref) + "]"; + std::string msg = "Invalid value of normalization incref [" + + std::to_string(incref) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -213,8 +213,8 @@ namespace Isis { */ void AlbedoAtm::SetNormEmaref(const double emaref) { if(emaref < 0.0 || emaref >= 90.0) { - QString msg = "Invalid value of normalization emaref [" + - toString(emaref) + "]"; + std::string msg = "Invalid value of normalization emaref [" + + std::to_string(emaref) + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Angle/Angle.cpp b/isis/src/base/objs/Angle/Angle.cpp index 352ba15b3b..f3fa992aca 100644 --- a/isis/src/base/objs/Angle/Angle.cpp +++ b/isis/src/base/objs/Angle/Angle.cpp @@ -60,8 +60,8 @@ namespace Isis { double seconds = angle.section(' ', 2, 2, flag).toDouble(&secondsSucceeded); if (!(degreesSucceeded && minutesSucceeded && secondsSucceeded) ) { - QString msg = QObject::tr("[%1] is not a vaid input to Angle. It needs to be of the form: " - "\"dd mm ss.ss\"").arg(angle); + std::string msg = "[" + angle.toStdString() + "] is not a vaid input to Angle. It needs to be of the form: " + "\"dd mm ss.ss\""; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -244,7 +244,7 @@ namespace Isis { QString textResult = ""; if (isValid()) { - textResult = Isis::toString(degrees()); + textResult = toString(degrees()); if (includeUnits) textResult += " degrees"; diff --git a/isis/src/base/objs/Anisotropic1/Anisotropic1.cpp b/isis/src/base/objs/Anisotropic1/Anisotropic1.cpp index bed366790e..95b72bda5c 100644 --- a/isis/src/base/objs/Anisotropic1/Anisotropic1.cpp +++ b/isis/src/base/objs/Anisotropic1/Anisotropic1.cpp @@ -106,7 +106,7 @@ namespace Isis { } if(p_atmosWha == 1.0) { - QString msg = "Anisotropic conservative case not implemented yet - WHA parameter cannot be set to 1.0"; + std::string msg = "Anisotropic conservative case not implemented yet - WHA parameter cannot be set to 1.0"; msg += "This will cause negative planetary curvature to occur."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Anisotropic2/Anisotropic2.cpp b/isis/src/base/objs/Anisotropic2/Anisotropic2.cpp index 945558f6fc..0656175dd4 100644 --- a/isis/src/base/objs/Anisotropic2/Anisotropic2.cpp +++ b/isis/src/base/objs/Anisotropic2/Anisotropic2.cpp @@ -92,7 +92,7 @@ namespace Isis { } if(p_atmosWha == 1.0) { - QString msg = "Anisotropic conservative case not implemented yet - WHA parameter cannot be set to 1.0."; + std::string msg = "Anisotropic conservative case not implemented yet - WHA parameter cannot be set to 1.0."; msg += "This will cause negative planetary curvature to occur."; throw IException(IException::User, msg, _FILEINFO_); } @@ -269,7 +269,7 @@ namespace Isis { AtmosModel::En(1, p_atmosTau * (1.0 + 1.0 / xx))); } else { - QString msg = "Negative length of planetary curvature encountered"; + std::string msg = "Negative length of planetary curvature encountered"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -288,7 +288,7 @@ namespace Isis { f1mmu = xx * (log(1.0 + 1.0 / xx) - p_e1 * emu + AtmosModel::En(1, p_atmosTau * (1.0 + 1.0 / xx))); } else { - QString msg = "Negative length of planetary curvature encountered"; + std::string msg = "Negative length of planetary curvature encountered"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Application/Application.cpp b/isis/src/base/objs/Application/Application.cpp index 88b8abbd71..19e7a41906 100644 --- a/isis/src/base/objs/Application/Application.cpp +++ b/isis/src/base/objs/Application/Application.cpp @@ -93,7 +93,7 @@ namespace Isis { // Create user interface and log try { - FileName f(QString(argv[0]) + ".xml"); + FileName f(std::string(argv[0]) + ".xml"); // Create preferences Preference::Preferences(f.name() == "unitTest.xml"); @@ -101,11 +101,11 @@ namespace Isis { if (!f.fileExists()) { f = "$ISISROOT/bin/xml/" + f.name(); if (!f.fileExists()) { - QString message = Message::FileOpen(f.expanded()); + std::string message = Message::FileOpen(f.expanded()); throw IException(IException::Io, message, _FILEINFO_); } } - QString xmlfile = f.expanded(); + QString xmlfile = QString::fromStdString(f.expanded()); p_ui = new UserInterface(xmlfile, argc, argv); @@ -128,7 +128,7 @@ namespace Isis { setlocale(LC_ALL, "en_US"); } - QCoreApplication::setApplicationName(FileName(p_appName).baseName()); + QCoreApplication::setApplicationName(QString::fromStdString(FileName(p_appName.toStdString()).baseName())); } } catch (IException &e) { @@ -143,7 +143,7 @@ namespace Isis { p_connectionToParent = new QLocalSocket; QString serverName = "isis_" + UserName() + - "_" + toString(iApp->GetUserInterface().ParentId()); + "_" + QString::number(iApp->GetUserInterface().ParentId()); p_connectionToParent->connectToServer(serverName); if (!p_connectionToParent->waitForConnected()) { @@ -223,12 +223,12 @@ namespace Isis { #if 0 catch (exception &e) { - QString message = e.what(); + std::string message = e.what(); Isis::iExceptionSystem i(message, _FILEINFO_); status = i.Report(); } catch (...) { - QString message = "Unknown error expection"; + std::string message = "Unknown error expection"; Isis::iExceptionSystem i(message, _FILEINFO_); status = i.Report(); } @@ -511,7 +511,7 @@ namespace Isis { const QString &message) { // See if we need to connect to the parent if (p_connectionToParent == NULL) { - QString msg = "This process (program) was executed by an existing Isis " + std::string msg = "This process (program) was executed by an existing Isis " "process. However, we failed to establish a communication channel " "with the parent (launcher) process. The parent process has a PID of " "[" + toString(iApp->GetUserInterface().ParentId()) + "]"; @@ -526,11 +526,11 @@ namespace Isis { data += '\n'; if (p_connectionToParent->write(data.toLatin1().data(), data.toLatin1().size()) == -1) { - QString msg = "This process (program) was executed by an exiting Isis " + std::string msg = "This process (program) was executed by an exiting Isis " "process. A communication channel was established with the parent " "(launcher) process, but when we tried to send data to the parent " "process an error occurred. The parent process has a PID of [" + - QString(iApp->GetUserInterface().ParentId()) + "]"; + std::to_string(iApp->GetUserInterface().ParentId()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -587,16 +587,16 @@ namespace Isis { if (p_BatchlistPass == 0) { ofstream debugingLog(filename.toLatin1().data()); if (!debugingLog.good()) { - QString msg = "Error opening debugging log file [" + filename + "]"; + std::string msg = "Error opening debugging log file [" + filename.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } debugingLog << log << endl; debugingLog << "\n############### User Preferences ################\n" << endl; debugingLog << Preference::Preferences(); debugingLog << "\n############## System Disk Space ################\n" << endl; - debugingLog << GetSystemDiskSpace() << endl; + debugingLog << GetSystemDiskSpace().toStdString() << endl; debugingLog << "\n############ Executable Information #############\n" << endl; - debugingLog << GetLibraryDependencies(app) << endl; + debugingLog << GetLibraryDependencies(app).toStdString() << endl; debugingLog.close(); } else { @@ -611,9 +611,9 @@ namespace Isis { cout << "\n############### User Preferences ################\n" << endl; cout << Preference::Preferences(); cout << "\n############## System Disk Space ################\n" << endl; - cout << GetSystemDiskSpace() << endl; + cout << GetSystemDiskSpace().toStdString() << endl; cout << "\n############ Executable Information #############\n" << endl; - cout << GetLibraryDependencies(app) << endl; + cout << GetLibraryDependencies(app).toStdString() << endl; } else { cout << SessionLog::TheLog() << endl; @@ -654,7 +654,7 @@ namespace Isis { cerr << SessionLog::TheLog() << endl; } else { - cerr << Application::formatError(e) << endl; + cerr << Application::formatError(e).toStdString() << endl; } // If debugging flag on write debugging log @@ -678,16 +678,16 @@ namespace Isis { if (p_BatchlistPass == 0) { ofstream debugingLog(filename.toLatin1().data()); if (!debugingLog.good()) { - QString msg = "Error opening debugging log file [" + filename + "]"; + std::string msg = "Error opening debugging log file [" + filename.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } debugingLog << log << endl; debugingLog << "\n############### User Preferences ################\n" << endl; debugingLog << Preference::Preferences(); debugingLog << "\n############ System Disk Space #############\n" << endl; - debugingLog << GetSystemDiskSpace() << endl; + debugingLog << GetSystemDiskSpace().toStdString() << endl; debugingLog << "\n############ Executable Information #############\n" << endl; - debugingLog << GetLibraryDependencies(app) << endl; + debugingLog << GetLibraryDependencies(app).toStdString() << endl; debugingLog.close(); } else { @@ -702,9 +702,9 @@ namespace Isis { cout << "\n############### User Preferences ################\n" << endl; cout << Preference::Preferences(); cout << "\n############ System Disk Space #############\n" << endl; - cout << GetSystemDiskSpace() << endl; + cout << GetSystemDiskSpace().toStdString() << endl; cout << "\n############ Executable Information #############\n" << endl; - cout << GetLibraryDependencies(app) << endl; + cout << GetLibraryDependencies(app).toStdString() << endl; } else { cout << SessionLog::TheLog() << endl; @@ -722,12 +722,12 @@ namespace Isis { * @param e The Isis::iException */ void Application::GuiReportError(IException &e) { - QString errorMessage = Application::formatError(e); + std::string errorMessage = Application::formatError(e).toStdString(); if (errorMessage == "") { p_ui->TheGui()->ProgressText("Stopped"); } else { - p_ui->TheGui()->LoadMessage(errorMessage); + p_ui->TheGui()->LoadMessage(QString::fromStdString(errorMessage)); p_ui->TheGui()->ProgressText("Error"); } @@ -737,7 +737,7 @@ namespace Isis { QString Application::formatError(IException &e) { stringstream stringStream; - QString stringErrors = e.toString(Preference::Preferences().reportFileLine()); + std::string stringErrors = e.toString(Preference::Preferences().reportFileLine()); if (Preference::Preferences().outputErrorAsPvl()) { stringStream << stringErrors; @@ -755,7 +755,7 @@ namespace Isis { stringErrors = stringStream.str().c_str(); } - return stringErrors; + return QString::fromStdString(stringErrors); } QString Application::p_appName("Unknown"); //!< @@ -784,7 +784,7 @@ namespace Isis { p_ui->TheGui()->ProgressText(text); } else if (print) { - QString msg = p_ui->ProgramName() + ": " + text; + std::string msg = p_ui->ProgramName().toStdString() + ": " + text.toStdString(); cout << msg << endl; } @@ -800,7 +800,7 @@ namespace Isis { */ void Application::UpdateProgress(int percent, bool print) { if (HasParent() && print) { - QString data = toString(percent); + QString data = QString::number(percent); iApp->SendParentData(QString("PROGRESS"), data); } else if (p_ui->IsInteractive()) { @@ -883,7 +883,7 @@ namespace Isis { PvlGroup Application::GetUnameInfo() { // Create a temporary file to store console output to FileName temp = FileName::createTempFile("$temporary/UnameConsoleInfo.txt"); - QString tempFile = temp.expanded(); + QString tempFile = QString::fromStdString(temp.expanded()); // Uname commands output to temp file with each of the following // values on its own line in this order: @@ -963,7 +963,7 @@ namespace Isis { PvlGroup Application::GetEnviromentInfo() { // Create a temporary file to store console output to FileName temp = FileName::createTempFile("$temporary/EnviromentInfo.txt"); - QString tempFile = temp.expanded(); + QString tempFile = QString::fromStdString(temp.expanded()); PvlGroup envGroup("EnviromentVariables"); ifstream readTemp; @@ -1004,7 +1004,7 @@ namespace Isis { */ QString Application::GetSystemDiskSpace() { FileName temp = FileName::createTempFile("$temporary/SystemDiskSpace.txt"); - QString tempFile = temp.expanded(); + QString tempFile = QString::fromStdString(temp.expanded()); ifstream readTemp; QString diskspace = "df >| " + tempFile; ProgramLauncher::RunSystemCommand(diskspace); @@ -1031,7 +1031,7 @@ namespace Isis { */ QString Application::GetLibraryDependencies(QString file) { FileName temp = FileName::createTempFile("$temporary/LibraryDependencies.txt"); - QString tempFile = temp.expanded(); + QString tempFile = QString::fromStdString(temp.expanded()); ifstream readTemp; QString dependencies = ""; #if defined(__linux__) diff --git a/isis/src/base/objs/Application/unitTest.cpp b/isis/src/base/objs/Application/unitTest.cpp index cad1b91105..2e38b2018e 100644 --- a/isis/src/base/objs/Application/unitTest.cpp +++ b/isis/src/base/objs/Application/unitTest.cpp @@ -18,19 +18,19 @@ void myFunct() { } void myError() { - QString msg = "testing an error"; + std::string msg = "testing an error"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } void errorFormatting() { - QString msg = "local test error"; + std::string msg = "local test error"; Isis::IException exception = Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); // Add test for formatError Isis::Pvl &prefs = Isis::Preference::Preferences(); Isis::PvlGroup &errorPrefs = prefs.findGroup("ErrorFacility"); - QString errorString = Isis::Application::formatError(exception); + std::string errorString = Isis::Application::formatError(exception); std::cout << errorString.toStdString() << std::endl; std::string &formatValue = errorPrefs["Format"][0]; diff --git a/isis/src/base/objs/Area3D/Area3D.cpp b/isis/src/base/objs/Area3D/Area3D.cpp index b964210649..3c95c253c1 100644 --- a/isis/src/base/objs/Area3D/Area3D.cpp +++ b/isis/src/base/objs/Area3D/Area3D.cpp @@ -615,23 +615,20 @@ namespace Isis { } else { if(startXValid && endXValid && startX > endX) { - QString msg = QObject::tr("Cannot have a 3D area with inverted X coordinates of " - "[%1 meters] to [%2 meters]") - .arg(startX.meters()).arg(endX.meters()); + std::string msg = "Cannot have a 3D area with inverted X coordinates of " + "[" + std::to_string(startX.meters()) + " meters] to [" + std::to_string(endX.meters()) + " meters]"; throw IException(IException::Programmer, msg, _FILEINFO_); } if(startYValid && endYValid && startY > endY) { - QString msg = QObject::tr("Cannot have a 3D area with inverted Y coordinates of " - "[%1 meters] to [%2 meters]") - .arg(startY.meters()).arg(endY.meters()); + std::string msg = "Cannot have a 3D area with inverted Y coordinates of " + "[" + std::to_string(startY.meters()) + " meters] to [" + std::to_string(endY.meters()) + " meters]"; throw IException(IException::Programmer, msg, _FILEINFO_); } if(startZValid && endZValid && startZ > endZ) { - QString msg = QObject::tr("Cannot have a 3D area with inverted Z coordinates of " - "[%1 meters] to [%2 meters]") - .arg(startZ.meters()).arg(endZ.meters()); + std::string msg = "Cannot have a 3D area with inverted Z coordinates of " + "[" + std::to_string(startZ.meters()) + " meters] to [" + std::to_string(endZ.meters()) + " meters]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/AtmosModel/AtmosModel.cpp b/isis/src/base/objs/AtmosModel/AtmosModel.cpp index 7b3bb7a0ee..a2401552c3 100644 --- a/isis/src/base/objs/AtmosModel/AtmosModel.cpp +++ b/isis/src/base/objs/AtmosModel/AtmosModel.cpp @@ -554,7 +554,7 @@ namespace Isis { p_atmosMunot = cos((PI / 180.0) * p_atmosInc); p_atmosSini = sin((PI / 180.0) * p_atmosInc); - IString phtName = p_atmosPM->AlgorithmName(); + IString phtName = p_atmosPM->AlgorithmName().toStdString(); phtName.UpCase(); if(p_atmosInc == 90.0) { p_atmosAhTable[inccnt] = 0.0; @@ -967,7 +967,7 @@ namespace Isis { */ void AtmosModel::SetAtmosHnorm(const double hnorm) { if(hnorm < 0.0) { - QString msg = "Invalid value of Atmospheric hnorm [" + toString(hnorm) + "]"; + std::string msg = "Invalid value of Atmospheric hnorm [" + toString(hnorm) + "]"; throw IException(IException::User, msg, _FILEINFO_); } p_atmosHnorm = hnorm; diff --git a/isis/src/base/objs/AutoReg/AutoReg.cpp b/isis/src/base/objs/AutoReg/AutoReg.cpp index 9072f142be..c34c61cb35 100644 --- a/isis/src/base/objs/AutoReg/AutoReg.cpp +++ b/isis/src/base/objs/AutoReg/AutoReg.cpp @@ -280,7 +280,7 @@ namespace Isis { else { throw IException(IException::User, "Invalid Gradient type. Cannot use [" - + gradientFilterType + "] to filter chip", + + gradientFilterType.toStdString() + "] to filter chip", _FILEINFO_); } } @@ -452,7 +452,7 @@ namespace Isis { else { throw IException(IException::User, "Invalid Interpolator type. Cannot use [" - + interpolator + "] to load chip", + + interpolator.toStdString() + "] to load chip", _FILEINFO_); } diff --git a/isis/src/base/objs/AutoReg/AutoReg.h b/isis/src/base/objs/AutoReg/AutoReg.h index 2a095eb394..ba0afe521d 100644 --- a/isis/src/base/objs/AutoReg/AutoReg.h +++ b/isis/src/base/objs/AutoReg/AutoReg.h @@ -12,6 +12,7 @@ find files of those names at the top level of this repository. **/ #include "Chip.h" #include "Statistics.h" +#include class QString; diff --git a/isis/src/base/objs/BasisFunction/BasisFunction.cpp b/isis/src/base/objs/BasisFunction/BasisFunction.cpp index 89acb88054..c988655f7a 100644 --- a/isis/src/base/objs/BasisFunction/BasisFunction.cpp +++ b/isis/src/base/objs/BasisFunction/BasisFunction.cpp @@ -42,7 +42,7 @@ namespace Isis { void BasisFunction::SetCoefficients(const std::vector &coefs) { if ( (int)coefs.size() != p_numCoefs ) { - QString msg = "Unable to set coefficients vector. The size of the given vector [" + std::string msg = "Unable to set coefficients vector. The size of the given vector [" + toString((int)coefs.size()) + "] does not match number of coefficients " "in the basis equation [" + toString(p_numCoefs) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -64,7 +64,7 @@ namespace Isis { double BasisFunction::Evaluate(const std::vector &vars) { if ( (int)vars.size() != p_numVars ) { - QString msg = "Unable to evaluate function for the given vector of values. " + std::string msg = "Unable to evaluate function for the given vector of values. " "The size of the given vector [" + toString((int)vars.size()) + "] does not match number of variables " "in the basis equation [" + toString(p_numVars) + "]"; @@ -74,7 +74,7 @@ namespace Isis { Expand(vars); if ( (int)p_terms.size() != p_numCoefs ) { - QString msg = "Unable to evaluate function for the given vector of values. " + std::string msg = "Unable to evaluate function for the given vector of values. " "The number of terms in the expansion [" + toString( (int)p_terms.size() ) + "] does not match number of coefficients " "in the basis equation [" + toString(p_numCoefs) + "]"; diff --git a/isis/src/base/objs/Blobber/Blobber.cpp b/isis/src/base/objs/Blobber/Blobber.cpp index 38533a6b34..2850196c5d 100644 --- a/isis/src/base/objs/Blobber/Blobber.cpp +++ b/isis/src/base/objs/Blobber/Blobber.cpp @@ -147,7 +147,7 @@ namespace Isis { loadInteger(tbl); } else { - QString msg = "Field type for " + getFieldName() + + std::string msg = "Field type for " + getFieldName().toStdString() + " is not double or integer"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Brick/Brick.cpp b/isis/src/base/objs/Brick/Brick.cpp index 630458f0d0..8cb6a6a749 100644 --- a/isis/src/base/objs/Brick/Brick.cpp +++ b/isis/src/base/objs/Brick/Brick.cpp @@ -41,7 +41,7 @@ namespace Isis { */ bool Brick::SetBrick(const int brick) { if(brick < 1) { - QString message = "Invalid value for argument [brick]"; + std::string message = "Invalid value for argument [brick]"; throw IException(IException::Programmer, message, _FILEINFO_); } diff --git a/isis/src/base/objs/BulletDskShape/BulletDskShape.cpp b/isis/src/base/objs/BulletDskShape/BulletDskShape.cpp index 148ab16809..127fde7d6b 100644 --- a/isis/src/base/objs/BulletDskShape/BulletDskShape.cpp +++ b/isis/src/base/objs/BulletDskShape/BulletDskShape.cpp @@ -165,14 +165,14 @@ namespace Isis { SpiceInt handle; //!< The DAS file handle of the DSK file. // Sanity check - FileName dskFile(dskfile); + FileName dskFile(dskfile.toStdString()); if ( !dskFile.fileExists() ) { - QString mess = "NAIF DSK file [" + dskfile + "] does not exist."; + std::string mess = "NAIF DSK file [" + dskfile.toStdString() + "] does not exist."; throw IException(IException::User, mess, _FILEINFO_); } // Open the NAIF Digital Shape Kernel (DSK) - dasopr_c( dskFile.expanded().toLatin1().data(), &handle ); + dasopr_c( dskFile.expanded().c_str(), &handle ); NaifStatus::CheckErrors(); // Search to the first DLA segment @@ -181,7 +181,7 @@ namespace Isis { dlabfs_c( handle, &segment, &found ); NaifStatus::CheckErrors(); if ( !found ) { - QString mess = "No segments found in DSK file " + dskfile ; + std::string mess = "No segments found in DSK file " + dskfile.toStdString() ; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp b/isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp index 5f2f544071..4f8846ba78 100644 --- a/isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp +++ b/isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp @@ -101,7 +101,7 @@ namespace Isis { QScopedPointer v_shape( BulletTargetShape::load(shapefile) ); if (v_shape.isNull() ) { - QString mess = "Cannot create a BulletShape from " + shapefile; + std::string mess = "Cannot create a BulletShape from " + shapefile.toStdString(); throw IException(IException::User, mess, _FILEINFO_); } @@ -437,7 +437,7 @@ namespace Isis { // Sanity check if ( !hasIntersection() ) { // hasIntersection() <==> !m_intercept.isNull() - QString mess = "Intercept point does not exist - cannot provide normal vector"; + std::string mess = "Intercept point does not exist - cannot provide normal vector"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -517,7 +517,7 @@ namespace Isis { // Sanity check if ( !hasIntersection() ) { // hasIntersection() <==> !m_intercept.isNull() - QString mess = "Intercept point does not exist - cannot provide normal vector"; + std::string mess = "Intercept point does not exist - cannot provide normal vector"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -561,17 +561,17 @@ namespace Isis { // Sanity check on state if ( !hasIntersection() ) { - QString msg = "An intersection must be defined before computing the surface normal."; + std::string msg = "An intersection must be defined before computing the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } if ( !surfaceIntersection()->Valid() ) { - QString msg = "The surface point intersection must be valid to compute the surface normal."; + std::string msg = "The surface point intersection must be valid to compute the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (!hasValidTarget()) { - QString msg = "A valid target must be defined before computing the surface normal."; + std::string msg = "A valid target must be defined before computing the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/BulletShapeModel/unitTest.cpp b/isis/src/base/objs/BulletShapeModel/unitTest.cpp index 98c1d27e78..48e900e983 100644 --- a/isis/src/base/objs/BulletShapeModel/unitTest.cpp +++ b/isis/src/base/objs/BulletShapeModel/unitTest.cpp @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } diff --git a/isis/src/base/objs/BulletTargetShape/unitTest.cpp b/isis/src/base/objs/BulletTargetShape/unitTest.cpp index 54eb5696b2..91558d9bcf 100644 --- a/isis/src/base/objs/BulletTargetShape/unitTest.cpp +++ b/isis/src/base/objs/BulletTargetShape/unitTest.cpp @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/BulletWorldManager/unitTest.cpp b/isis/src/base/objs/BulletWorldManager/unitTest.cpp index 84373d30e1..37559993a3 100644 --- a/isis/src/base/objs/BulletWorldManager/unitTest.cpp +++ b/isis/src/base/objs/BulletWorldManager/unitTest.cpp @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) { qDebug() << ""; BulletTargetShape *itokawaShape = BulletTargetShape::load(dskfile); if (!itokawaShape) { - QString msg = "Failed loading shapefile."; + std::string msg = "Failed loading shapefile."; throw IException(IException::Unknown, msg, _FILEINFO_); } namedWorld.addTarget(itokawaShape); @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) { qDebug() << "Target name: " << namedTarget->name(); } else { - QString msg = "Failed accessing the first target shape."; + std::string msg = "Failed accessing the first target shape."; throw IException(IException::Unknown, msg, _FILEINFO_); } qDebug() << ""; @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } \ No newline at end of file diff --git a/isis/src/base/objs/CSMCamera/CSMCamera.cpp b/isis/src/base/objs/CSMCamera/CSMCamera.cpp index 4d423c81d6..e74a9de5c6 100644 --- a/isis/src/base/objs/CSMCamera/CSMCamera.cpp +++ b/isis/src/base/objs/CSMCamera/CSMCamera.cpp @@ -85,21 +85,21 @@ void sanitize(std::string &input); for (const csm::Plugin *plugin: csm::Plugin::getList()) { availablePlugins.append(QString::fromStdString(plugin->getPluginName())); } - QString msg = "Failed to find plugin [" + pluginName + "] for image [" + cube.fileName() + + std::string msg = "Failed to find plugin [" + pluginName.toStdString() + "] for image [" + cube.fileName().toStdString() + "]. Check that the corresponding CSM plugin library is in the directory " "specified by your IsisPreferences. Loaded plugins [" + - availablePlugins.join(", ") + "]."; + availablePlugins.join(", ").toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } if (!plugin->canModelBeConstructedFromState(modelName.toStdString(), stateString.toStdString())) { - QString msg = "CSM state string attached to image [" + cube.fileName() + "] cannot " - "be converted to a [" + modelName + "] using [" + pluginName + "]."; + std::string msg = "CSM state string attached to image [" + cube.fileName().toStdString() + "] cannot " + "be converted to a [" + modelName.toStdString() + "] using [" + pluginName.toStdString() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } m_model = dynamic_cast(plugin->constructModelFromState(stateString.toStdString())); // If the dynamic cast failed, raise an exception if (!m_model) { - QString msg = "Failed to convert CSM Model to RasterGM."; + std::string msg = "Failed to convert CSM Model to RasterGM."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1003,8 +1003,8 @@ void sanitize(std::string &input); } if (!failedParams.empty()) { - QString msg = "Failed to find indices for the following parameters [" + - failedParams.join(",") + "]."; + std::string msg = "Failed to find indices for the following parameters [" + + failedParams.join(",").toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } return parameterIndices; @@ -1099,7 +1099,7 @@ void sanitize(std::string &input); * @param time The time to set */ void CSMCamera::setTime(const iTime &time) { - QString msg = "Setting the image time is not supported for CSM camera models"; + std::string msg = "Setting the image time is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1115,7 +1115,7 @@ void sanitize(std::string &input); * @param lon Sub-solar longitude */ void CSMCamera::subSolarPoint(double &lat, double &lon) { - QString msg = "Sub solar point is not supported for CSM camera models"; + std::string msg = "Sub solar point is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1128,7 +1128,7 @@ void sanitize(std::string &input); * @returns @b QList The field of view offsets */ QList CSMCamera::PixelIfovOffsets() { - QString msg = "Pixel Field of View is not supported for CSM camera models"; + std::string msg = "Pixel Field of View is not supported for CSM camera models"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1142,7 +1142,7 @@ void sanitize(std::string &input); * @param[out] p The position of the sun */ void CSMCamera::sunPosition(double p[3]) const { - QString msg = "Sun position is not supported for CSM camera models"; + std::string msg = "Sun position is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1156,7 +1156,7 @@ void sanitize(std::string &input); * @returns @b SpicePosition* A pointer to the SpicePosition object for the Sun */ SpicePosition *CSMCamera::sunPosition() const { - QString msg = "Sun position is not supported for CSM camera models"; + std::string msg = "Sun position is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1171,7 +1171,7 @@ void sanitize(std::string &input); * @returns @b SpicePosition* A pointer to the SpicePosition object for the sensor */ SpicePosition *CSMCamera::instrumentPosition() const { - QString msg = "Instrument position is not supported for CSM camera models"; + std::string msg = "Instrument position is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1185,7 +1185,7 @@ void sanitize(std::string &input); * @returns @b SpiceRotation* A pointer to the SpiceRotation object for the body orientation */ SpiceRotation *CSMCamera::bodyRotation() const { - QString msg = "Body orientation is not supported for CSM camera models"; + std::string msg = "Body orientation is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1200,7 +1200,7 @@ void sanitize(std::string &input); * @returns @b SpiceRotation* A pointer to the SpiceRotation object for the sensor orientation */ SpiceRotation *CSMCamera::instrumentRotation() const { - QString msg = "Instrument orientation is not supported for CSM camera models"; + std::string msg = "Instrument orientation is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1214,7 +1214,7 @@ void sanitize(std::string &input); * @param et Ephemeris time */ void CSMCamera::computeSolarLongitude(iTime et) { - QString msg = "Solar longitude is not supported for CSM camera models"; + std::string msg = "Solar longitude is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1227,7 +1227,7 @@ void sanitize(std::string &input); * @returns @b double The distance to the sun */ double CSMCamera::SolarDistance() const { - QString msg = "Solar distance is not supported for CSM camera models"; + std::string msg = "Solar distance is not supported for CSM camera models"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/CSVReader/CSVReader.cpp b/isis/src/base/objs/CSVReader/CSVReader.cpp index 086f88fe2d..0a1c2ae9b3 100644 --- a/isis/src/base/objs/CSVReader/CSVReader.cpp +++ b/isis/src/base/objs/CSVReader/CSVReader.cpp @@ -140,7 +140,7 @@ namespace Isis { void CSVReader::read(const QString &csvfile) { ifstream ifile(csvfile.toLatin1().data(), ios::in); if(!ifile) { - QString mess = "Unable to open file [" + csvfile + "]"; + std::string mess = "Unable to open file [" + csvfile.toStdString() + "]"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/CSVReader/CSVReader.h b/isis/src/base/objs/CSVReader/CSVReader.h index ca0b30b063..e3cae62e00 100644 --- a/isis/src/base/objs/CSVReader/CSVReader.h +++ b/isis/src/base/objs/CSVReader/CSVReader.h @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include +#include #include #include #include @@ -533,7 +534,7 @@ namespace Isis { TNT::Array1D out(data.dim()); for(int i = 0 ; i < data.dim() ; i++) { Parser::TokenType s = data[i]; - out[i] = toDouble(s); + out[i] = s.toDouble(); } return (out); } diff --git a/isis/src/base/objs/Calculator/Calculator.cpp b/isis/src/base/objs/Calculator/Calculator.cpp index 5fb2e15161..c1315bb7b9 100644 --- a/isis/src/base/objs/Calculator/Calculator.cpp +++ b/isis/src/base/objs/Calculator/Calculator.cpp @@ -1001,7 +1001,7 @@ namespace Isis { // Because this method is only used as a cout in our tests, we do not // care about the difference between nan and -nan; they are the same in this case. temp.replace(QRegExp("-nan"), "nan"); - std::cout<shape()->name() == "Plane") { - QString msg = "North Azimuth is not available for plane target shapes."; + std::string msg = "North Azimuth is not available for plane target shapes."; throw IException(IException::Programmer, msg, _FILEINFO_); } // Get the latitude of your current location using the shape model diff --git a/isis/src/base/objs/Camera/unitTest.cpp b/isis/src/base/objs/Camera/unitTest.cpp index ba987c4df9..b0ee0d52aa 100644 --- a/isis/src/base/objs/Camera/unitTest.cpp +++ b/isis/src/base/objs/Camera/unitTest.cpp @@ -679,7 +679,7 @@ int main() { } catch (IException &e) { cout << endl << endl; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/CameraDetectorMap/CameraDetectorMap.cpp b/isis/src/base/objs/CameraDetectorMap/CameraDetectorMap.cpp index af2deec360..b599f43bb6 100644 --- a/isis/src/base/objs/CameraDetectorMap/CameraDetectorMap.cpp +++ b/isis/src/base/objs/CameraDetectorMap/CameraDetectorMap.cpp @@ -212,7 +212,7 @@ namespace Isis { double CameraDetectorMap::exposureDuration(const double sample, const double line, const int band) const { - QString msg = "Exposure duration is only available for LineScan, VariableLineScan, " + std::string msg = "Exposure duration is only available for LineScan, VariableLineScan, " "and PushFrame Cameras."; throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/base/objs/CameraDistortionMap/CameraDistortionMap.cpp b/isis/src/base/objs/CameraDistortionMap/CameraDistortionMap.cpp index 7e7cb47e54..e9cc0e7516 100644 --- a/isis/src/base/objs/CameraDistortionMap/CameraDistortionMap.cpp +++ b/isis/src/base/objs/CameraDistortionMap/CameraDistortionMap.cpp @@ -57,7 +57,7 @@ namespace Isis { */ void CameraDistortionMap::SetDistortion(int naifIkCode) { p_odk.clear(); - QString odkkey = "INS" + toString(naifIkCode) + "_OD_K"; + QString odkkey = "INS" + QString::number(naifIkCode) + "_OD_K"; for (int i = 0; i < 3; ++i) { p_odk.push_back(p_camera->Spice::getDouble(odkkey, i)); } diff --git a/isis/src/base/objs/CameraFactory/CameraFactory.cpp b/isis/src/base/objs/CameraFactory/CameraFactory.cpp index e32f1eed07..71f2b49d6d 100644 --- a/isis/src/base/objs/CameraFactory/CameraFactory.cpp +++ b/isis/src/base/objs/CameraFactory/CameraFactory.cpp @@ -56,7 +56,7 @@ namespace Isis { return new CSMCamera(cube); } catch (IException &e) { - QString msg = "Unable to create CSM camera using CSMState Cube blob."; + std::string msg = "Unable to create CSM camera using CSMState Cube blob."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -93,9 +93,9 @@ namespace Isis { ptr = m_cameraPlugin.GetPlugin(group); } catch(IException &e) { - QString msg = "Unsupported camera model, unable to find plugin for "; - msg += "SpacecraftName [" + spacecraft + "] with InstrumentId ["; - msg += name + "]"; + std::string msg = "Unsupported camera model, unable to find plugin for "; + msg += "SpacecraftName [" + spacecraft.toStdString() + "] with InstrumentId ["; + msg += name.toStdString() + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -124,11 +124,11 @@ namespace Isis { if (m_cameraPlugin.fileName() == "") { FileName localFile("Camera.plugin"); if (localFile.fileExists()) - m_cameraPlugin.read(localFile.expanded().toStdString()); + m_cameraPlugin.read(localFile.expanded()); FileName systemFile("$ISISROOT/lib/Camera.plugin"); if (systemFile.fileExists()) - m_cameraPlugin.read(systemFile.expanded().toStdString()); + m_cameraPlugin.read(systemFile.expanded()); } // Find the CSM plugins by searching the directories identified in the Preferences. @@ -137,9 +137,9 @@ namespace Isis { Preference &p = Preference::Preferences(); PvlGroup &grp = p.findGroup("Plugins", Isis::Pvl::Traverse); for (int i = 0; igetDouble(xkey, i); p_transy[i] = parent->getDouble(ykey, i); diff --git a/isis/src/base/objs/CameraGroundMap/CameraGroundMap.cpp b/isis/src/base/objs/CameraGroundMap/CameraGroundMap.cpp index a6e26550b5..08d09fc488 100644 --- a/isis/src/base/objs/CameraGroundMap/CameraGroundMap.cpp +++ b/isis/src/base/objs/CameraGroundMap/CameraGroundMap.cpp @@ -460,7 +460,7 @@ namespace Isis { v[2] = sinLat; break; default: - QString msg = "Invalid partial type for this method"; + std::string msg = "Invalid partial type for this method"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp index 336871d409..a87d1814e7 100644 --- a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp +++ b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp @@ -336,7 +336,7 @@ namespace Isis { } bool noErrors = passed; - QString error = ""; + std::string error = ""; if (!m_camera->HasSurfaceIntersection()) { error = "Requested position does not project in camera model; no surface intersection"; noErrors = false; @@ -414,7 +414,7 @@ namespace Isis { } // Set all keywords that still have valid information - gp->findKeyword("Error").setValue(error.toStdString()); + gp->findKeyword("Error").setValue(error); gp->findKeyword("FileName").setValue(m_currentCube->fileName().toStdString()); gp->findKeyword("Sample").setValue(std::to_string(m_camera->Sample())); gp->findKeyword("Line").setValue(std::to_string(m_camera->Line())); @@ -444,7 +444,7 @@ namespace Isis { gp->findKeyword("FileName").setValue(m_currentCube->fileName().toStdString()); gp->findKeyword("Sample").setValue(std::to_string(m_camera->Sample())); gp->findKeyword("Line").setValue(std::to_string(m_camera->Line())); - gp->findKeyword("PixelValue").setValue(PixelToString(b[0]).toStdString()); + gp->findKeyword("PixelValue").setValue(PixelToString(b[0])); try { gp->findKeyword("RightAscension").setValue(std::to_string( m_camera->RightAscension()), "DEGREE"); diff --git a/isis/src/base/objs/Chip/Chip.cpp b/isis/src/base/objs/Chip/Chip.cpp index d7a4f66655..c73ddb4972 100644 --- a/isis/src/base/objs/Chip/Chip.cpp +++ b/isis/src/base/objs/Chip/Chip.cpp @@ -133,7 +133,7 @@ namespace Isis { */ void Chip::SetSize(const int samples, const int lines) { if ( samples <= 0.0 || lines <= 0.0 ) { - QString msg; + std::string msg; msg += "Unable to set chip size to ["; msg += toString(samples) + ", "; msg += toString(lines) + "]. Samples and lines must be greater than zero."; @@ -310,8 +310,8 @@ namespace Isis { matchProj = (TProjection *) matchChipCube.projection(); } catch (IException &error2) { - QString msg = "Can not geom chip. "; - msg += "Match chip cube [" + matchChipCube.fileName(); + std::string msg = "Can not geom chip. "; + msg += "Match chip cube [" + matchChipCube.fileName().toStdString(); msg += "] is not a camera or map projection"; IException fullError(IException::User, msg, _FILEINFO_); @@ -333,8 +333,8 @@ namespace Isis { proj = cube.projection(); } catch (IException &error2) { - QString msg = "Can not geom chip. "; - msg += "Chip cube [" + cube.fileName(); + std::string msg = "Can not geom chip. "; + msg += "Chip cube [" + cube.fileName().toStdString(); msg += "] is not a camera or map projection"; IException fullError(IException::User, msg, _FILEINFO_); @@ -494,9 +494,9 @@ namespace Isis { } if (xp.size() < 3) { - QString msg = "Cannot find enough points to perform Affine transformation. "; - msg += "Unable to load chip from [" + cube.fileName(); - msg += "] to match chip from [" + matchChipCube.fileName() + "]."; + std::string msg = "Cannot find enough points to perform Affine transformation. "; + msg += "Unable to load chip from [" + cube.fileName().toStdString(); + msg += "] to match chip from [" + matchChipCube.fileName().toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -680,7 +680,7 @@ namespace Isis { */ void Chip::SetValidRange(const double minimum, const double maximum) { if (minimum >= maximum) { - QString msg = "Unable to set valid chip range to [" + toString(minimum); + std::string msg = "Unable to set valid chip range to [" + toString(minimum); msg += ", " + toString(maximum) + "]. First parameter must be smaller than the second."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -726,7 +726,7 @@ namespace Isis { */ Chip Chip::Extract(int samples, int lines, int samp, int line) { if ( samples > Samples() || lines > Lines() ) { - QString msg = "Cannot extract sub-chip of size [" + toString(samples); + std::string msg = "Cannot extract sub-chip of size [" + toString(samples); msg += ", " + toString(lines) + "] from chip of size [" + toString(Samples()); msg += ", " + toString(Lines()) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/base/objs/Chip/Chip.h b/isis/src/base/objs/Chip/Chip.h index c5d34fda94..d56e9a0d4b 100644 --- a/isis/src/base/objs/Chip/Chip.h +++ b/isis/src/base/objs/Chip/Chip.h @@ -15,6 +15,7 @@ find files of those names at the top level of this repository. **/ #include "SpecialPixel.h" #include +#include #include diff --git a/isis/src/base/objs/CollectorMap/CollectorMap.h b/isis/src/base/objs/CollectorMap/CollectorMap.h index 50fd0a1dae..e46fd9c80b 100644 --- a/isis/src/base/objs/CollectorMap/CollectorMap.h +++ b/isis/src/base/objs/CollectorMap/CollectorMap.h @@ -567,7 +567,7 @@ namespace Isis { T &get(const K &key) { CollectorIter cItr = _list.find(key); if(cItr == _list.end()) { - QString mess = "Requested value does not exist!"; + std::string mess = "Requested value does not exist!"; throw IException(IException::Programmer, mess, _FILEINFO_); } return (cItr->second); @@ -583,7 +583,7 @@ namespace Isis { const T &get(const K &key) const { CollectorConstIter cItr = _list.find(key); if(cItr == _list.end()) { - QString mess = "Requested value does not exist!"; + std::string mess = "Requested value does not exist!"; throw IException(IException::Programmer, mess, _FILEINFO_); } return (cItr->second); diff --git a/isis/src/base/objs/Column/Column.cpp b/isis/src/base/objs/Column/Column.cpp index 628dedec43..1179e51888 100644 --- a/isis/src/base/objs/Column/Column.cpp +++ b/isis/src/base/objs/Column/Column.cpp @@ -54,7 +54,7 @@ namespace Isis { */ void Column::SetName(QString name) { if (p_width != 0 && name.length() > (int)p_width) { - QString message = "Name [" + name + "] is wider than width"; + std::string message = "Name [" + name.toStdString() + "] is wider than width"; throw IException(IException::User, message, _FILEINFO_); } p_name = name; @@ -67,8 +67,8 @@ namespace Isis { */ void Column::SetWidth(unsigned int width) { if (p_name.size() > 0 && p_name.size() > (int)width) { - QString message = "Width is insufficient to contain name["; - message += p_name + "]"; + std::string message = "Width is insufficient to contain name["; + message += p_name.toStdString() + "]"; throw IException(IException::User, message, _FILEINFO_); } p_width = width; @@ -82,7 +82,7 @@ namespace Isis { void Column::SetType(Column::Type type) { if (p_align == Column::Decimal && (type == Column::Integer || type == Column::String)) { - QString message = "Integer or string type is not sensible if "; + std::string message = "Integer or string type is not sensible if "; message += "alignment is Decimal."; throw IException(IException::User, message, _FILEINFO_); } @@ -101,7 +101,7 @@ namespace Isis { void Column::SetAlignment(Column::Align alignment) { if (alignment == Column::Decimal && (p_type == Column::Integer || p_type == Column::String)) { - QString message = "Decimal alignment does not make sense for "; + std::string message = "Decimal alignment does not make sense for "; message += "integer or string values."; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -119,7 +119,7 @@ namespace Isis { void Column::SetPrecision(unsigned int precision) { if (DataType() != Column::Real && DataType() != Column::Pixel) { - QString message = "Setting precision only makes sense for Decimal Alignment"; + std::string message = "Setting precision only makes sense for Decimal Alignment"; throw IException(IException::User, message, _FILEINFO_); } p_precision = precision; diff --git a/isis/src/base/objs/Cube/Cube.cpp b/isis/src/base/objs/Cube/Cube.cpp index 87ab15181c..d54c056e18 100644 --- a/isis/src/base/objs/Cube/Cube.cpp +++ b/isis/src/base/objs/Cube/Cube.cpp @@ -61,7 +61,7 @@ namespace Isis { */ Cube::Cube(const FileName &fileName, QString access) { construct(); - open(fileName.toString(), access); + open(QString::fromStdString(fileName.toString()), access); } /** @@ -75,7 +75,7 @@ namespace Isis { */ void Cube::fromLabel(const FileName &fileName, Pvl &label, QString access) { initCoreFromLabel(label); - create(fileName.expanded()); + create(QString::fromStdString(fileName.expanded())); PvlObject cubeLabel = label.findObject("IsisCube"); for (auto grpIt = cubeLabel.beginGroup(); grpIt!= cubeLabel.endGroup(); grpIt++) { @@ -83,7 +83,7 @@ namespace Isis { } close(); - open(fileName.toString(), access); + open(QString::fromStdString(fileName.toString()), access); } /** @@ -107,7 +107,7 @@ namespace Isis { attachSpiceFromIsd(isd); close(); - open(fileName.toString(), access); + open(QString::fromStdString(fileName.toString()), access); } /** @@ -121,19 +121,19 @@ namespace Isis { * "r" or read-write "rw". */ void Cube::fromIsd(const FileName &fileName, FileName &labelFile, FileName &isdFile, QString access) { - std::ifstream isdStream(isdFile.expanded().toStdString()); - std::ifstream labelStream(labelFile.expanded().toStdString()); + std::ifstream isdStream(isdFile.expanded()); + std::ifstream labelStream(labelFile.expanded()); if (isdStream.fail()) { - QString msg = QString("failed to open isd stream: %1").arg(isdFile.expanded()); + std::string msg = "failed to open isd stream: " + isdFile.expanded(); throw IException(IException::Io, msg, - isdFile.baseName().toStdString().c_str(), 153); + isdFile.baseName().c_str(), 153); } if (labelStream.fail()) { - QString msg = "failed to open file stream"; + std::string msg = "failed to open file stream"; throw IException(IException::Io, msg, - fileName.baseName().toStdString().c_str(), 153); + fileName.baseName().c_str(), 153); } Pvl label; @@ -143,9 +143,9 @@ namespace Isis { labelStream >> label; } catch (std::exception &ex) { - QString msg = QString("Failed to open label file, %1, %2").arg(labelFile.expanded()).arg(ex.what()); + std::string msg = "Failed to open label file, " + labelFile.expanded() + ", " + ex.what(); throw IException(IException::Io, msg, - fileName.baseName().toStdString().c_str(), 153); + fileName.baseName().c_str(), 153); } @@ -153,9 +153,9 @@ namespace Isis { isdStream >> isd; } catch (std::exception &ex) { - QString msg = QString("Failed to open ISD file, %1, %2").arg(isdFile.expanded()).arg(ex.what()); + std::string msg = "Failed to open ISD file, " + isdFile.expanded() + ", " + ex.what(); throw IException(IException::Io, msg, - fileName.baseName().toStdString().c_str(), 145); + fileName.baseName().c_str(), 145); } fromIsd(fileName, label, isd, access); @@ -216,7 +216,7 @@ namespace Isis { bool readOnly = false; if (!isOpen()) { - QString msg = "No cube opened"; + std::string msg = "No cube opened"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -277,8 +277,7 @@ namespace Isis { */ Cube *Cube::copy(FileName newFile, const CubeAttributeOutput &newFileAttributes) { if (!isOpen()) { - throw IException(IException::Unknown, - QObject::tr("Cube::copy requires the originating cube to be open"), + throw IException(IException::Unknown,"Cube::copy requires the originating cube to be open", _FILEINFO_); } @@ -309,9 +308,7 @@ namespace Isis { result->setBaseMultiplier(base(), multiplier()); } else { - QString msg = - QObject::tr("Cannot reduce the output PixelType for [%1] from [%2] without output " - "pixel range").arg(newFile.original()).arg(fileName()); + std::string msg = "Cannot reduce the output PixelType for " + newFile.original() + " from " + fileName().toStdString() + " without output pixel range"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -328,11 +325,11 @@ namespace Isis { m_ioHandler->clearCache(true); } - result->setExternalDnData(fileName()); + result->setExternalDnData(fileName().toStdString()); } // Allocate the cube - result->create(newFile.expanded()); + result->create(QString::fromStdString(newFile.expanded())); PvlObject &isisCube = label()->findObject("IsisCube"); PvlObject &outIsisCube = result->label()->findObject("IsisCube"); @@ -349,7 +346,7 @@ namespace Isis { PvlObject &obj = m_label->object(i); if (obj.isNamed("Table") || obj.isNamed("Polygon") || obj.isNamed("OriginalLabel") || obj.isNamed("History")) { - Isis::Blob t(QString::fromStdString(obj["Name"]), obj.name()); + Isis::Blob t(obj["Name"], obj.name()); read(t); result->write(t); } @@ -421,16 +418,14 @@ namespace Isis { } if (m_samples < 1 || m_lines < 1 || m_bands < 1) { - QString msg = "Number of samples [" + toString(m_samples) + - "], lines [" + toString(m_lines) + "], or bands [" + toString(m_bands) + + std::string msg = "Number of samples [" + std::to_string(m_samples) + + "], lines [" + std::to_string(m_lines) + "], or bands [" + std::to_string(m_bands) + "] cannot be less than 1"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (m_pixelType == None) { - throw IException(IException::Unknown, - QString("Cannot create the cube [%1] with a pixel type set to None") - .arg(cubeFileName), + throw IException(IException::Unknown,"Cannot create the cube ["+ cubeFileName.toStdString() +"] with a pixel type set to None", _FILEINFO_); } @@ -449,13 +444,13 @@ namespace Isis { Preference::Preferences().findGroup("CubeCustomization")["MaximumSize"]; if (size > maxSizePreference) { - QString msg; - msg += "The cube you are attempting to create [" + cubeFileName + "] is [" - + toString(size) + "GB]. This is larger than the current allowed " - "size of [" + toString(maxSizePreference) + "GB]. The cube " - "dimensions were (S,L,B) [" + toString(m_samples) + ", " + - toString(m_lines) + ", " + toString(m_bands) + "] with [" + - toString(SizeOf(m_pixelType)) + "] bytes per pixel. If you still " + std::string msg; + msg += "The cube you are attempting to create [" + cubeFileName.toStdString() + "] is [" + + std::to_string(size) + "GB]. This is larger than the current allowed " + "size of [" + std::to_string(maxSizePreference) + "GB]. The cube " + "dimensions were (S,L,B) [" + std::to_string(m_samples) + ", " + + std::to_string(m_lines) + ", " + std::to_string(m_bands) + "] with [" + + std::to_string(SizeOf(m_pixelType)) + "] bytes per pixel. If you still " "wish to create this cube, the maximum value can be changed in your personal " "preference file located in [~/.Isis/IsisPreferences] within the group " "CubeCustomization, keyword MaximumSize. If you do not have an ISISPreference file, " @@ -465,7 +460,7 @@ namespace Isis { } // Expand output name - FileName cubFile(cubeFileName); + FileName cubFile(cubeFileName.toStdString()); PvlObject isiscube("IsisCube"); PvlObject core("Core"); @@ -478,18 +473,18 @@ namespace Isis { core += PvlKeyword("StartByte", std::to_string(m_labelBytes + 1)); m_labelFileName = new FileName(cubFile); m_dataFileName = new FileName(cubFile); - m_labelFile = new QFile(m_labelFileName->expanded()); + m_labelFile = new QFile(QString::fromStdString(m_labelFileName->expanded())); } else { core += PvlKeyword("StartByte", std::to_string(1)); - core += PvlKeyword("^Core", cubFile.name().toStdString()); + core += PvlKeyword("^Core", cubFile.name()); m_dataFileName = new FileName(cubFile); - m_dataFile = new QFile(realDataFileName().expanded()); + m_dataFile = new QFile(QString::fromStdString(realDataFileName().expanded())); FileName labelFileName(cubFile); labelFileName = labelFileName.setExtension("lbl"); m_labelFileName = new FileName(labelFileName); - m_labelFile = new QFile(m_labelFileName->expanded()); + m_labelFile = new QFile(QString::fromStdString(m_labelFileName->expanded())); } // Create the size of the core @@ -504,7 +499,7 @@ namespace Isis { ptype += PvlKeyword("Type", PixelTypeName(m_pixelType).toStdString()); // And the byte ordering - ptype += PvlKeyword("ByteOrder", ByteOrderName(m_byteOrder).toStdString()); + ptype += PvlKeyword("ByteOrder", ByteOrderName(m_byteOrder)); ptype += PvlKeyword("Base", std::to_string(m_base)); ptype += PvlKeyword("Multiplier", std::to_string(m_multiplier)); core.addGroup(ptype); @@ -512,12 +507,12 @@ namespace Isis { else { cubFile = cubFile.addExtension("ecub"); - core += PvlKeyword("^DnFile", m_dataFileName->original().toStdString()); + core += PvlKeyword("^DnFile", m_dataFileName->original()); // m_dataFileName = new FileName(cubFile); - m_dataFile = new QFile(realDataFileName().expanded()); + m_dataFile = new QFile(QString::fromStdString(realDataFileName().expanded())); m_labelFileName = new FileName(cubFile); - m_labelFile = new QFile(cubFile.expanded()); + m_labelFile = new QFile(QString::fromStdString(cubFile.expanded())); } isiscube.addObject(core); @@ -534,13 +529,13 @@ namespace Isis { Preference::Preferences().findGroup("CubeCustomization"); bool overwrite = QString::fromStdString(pref["Overwrite"][0]).toUpper() == "ALLOW"; if (!overwrite && m_labelFile->exists() && m_labelFile->size()) { - QString msg = "Cube file [" + m_labelFileName->original() + "] exists, " + + std::string msg = "Cube file [" + m_labelFileName->original() + "] exists, " + "user preference does not allow overwrite"; throw IException(IException::User, msg, _FILEINFO_); } if (!m_labelFile->open(QIODevice::Truncate | QIODevice::ReadWrite)) { - QString msg = "Failed to create [" + m_labelFile->fileName() + "]. "; + std::string msg = "Failed to create [" + m_labelFile->fileName().toStdString() + "]. "; msg += "Verify the output path exists and you have permission to write to the path."; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); @@ -548,13 +543,13 @@ namespace Isis { if (m_dataFile) { if (m_storesDnData && !m_dataFile->open(QIODevice::Truncate | QIODevice::ReadWrite)) { - QString msg = "Failed to create [" + m_dataFile->fileName() + "]. "; + std::string msg = "Failed to create [" + m_dataFile->fileName().toStdString() + "]. "; msg += "Verify the output path exists and you have permission to write to the path."; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); } else if (!m_storesDnData && !m_dataFile->open(QIODevice::ReadOnly)) { - QString msg = "Failed to open [" + m_dataFile->fileName() + "] for reading. "; + std::string msg = "Failed to open [" + m_dataFile->fileName().toStdString() + "] for reading. "; msg += "Verify the output path exists and you have permission to read from the path."; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); @@ -634,10 +629,10 @@ namespace Isis { throw IException(IException::Programmer, msg, _FILEINFO_); } - initLabelFromFile(cubeFileName, (access == "rw")); + initLabelFromFile(FileName(cubeFileName.toStdString()), (access == "rw")); try { - Isis::CubeAttributeInput att(cubeFileName); + Isis::CubeAttributeInput att(cubeFileName.toStdString()); if(att.bands().size() != 0) { vector bands = att.bands(); setVirtualBands(bands); @@ -652,9 +647,9 @@ namespace Isis { PvlObject &core = m_label->findObject("IsisCube").findObject("Core"); // Detached labels if (core.hasKeyword("^Core")) { - FileName temp(QString::fromStdString(core["^Core"][0])); + FileName temp(core["^Core"][0]); - if (!temp.originalPath().startsWith("/")) { + if (!QString::fromStdString(temp.originalPath()).startsWith("/")) { m_dataFileName = new FileName(m_labelFileName->path() + "/" + temp.original()); } else { @@ -664,11 +659,11 @@ namespace Isis { m_attached = false; m_storesDnData = true; - m_dataFile = new QFile(realDataFileName().expanded()); + m_dataFile = new QFile(QString::fromStdString(realDataFileName().expanded())); } // External cube files (ecub), ecub contains all labels and SPICE blobs, history else if (core.hasKeyword("^DnFile")) { - FileName dataFileName(QString::fromStdString(core["^DnFile"][0])); + FileName dataFileName(core["^DnFile"][0]); if (dataFileName.originalPath() == ".") { m_dataFileName = new FileName(m_labelFileName->path() + "/" + dataFileName.name()); @@ -680,7 +675,7 @@ namespace Isis { m_attached = true; m_storesDnData = false; *m_dataFileName = FileName(realDataFileName().expanded()); - m_dataFile = new QFile(realDataFileName().expanded()); + m_dataFile = new QFile(QString::fromStdString(realDataFileName().expanded())); } // Typical cube containing labels, SPICE, history and dn data else { @@ -696,7 +691,7 @@ namespace Isis { if (access == "r") { if (!m_labelFile->open(QIODevice::ReadOnly)) { - QString msg = "Failed to open [" + m_labelFile->fileName() + "] with " + std::string msg = "Failed to open [" + m_labelFile->fileName().toStdString() + "] with " "read only access"; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); @@ -704,7 +699,7 @@ namespace Isis { if (m_dataFile) { if (!m_dataFile->open(QIODevice::ReadOnly)) { - QString msg = "Failed to open [" + m_dataFile->fileName() + "] with " + std::string msg = "Failed to open [" + m_dataFile->fileName().toStdString() + "] with " "read only access"; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); @@ -714,7 +709,7 @@ namespace Isis { else if (access == "rw") { if (!m_labelFile->open(QIODevice::ReadWrite)) { - QString msg = "Failed to open [" + m_labelFile->fileName() + "] with " + std::string msg = "Failed to open [" + m_labelFile->fileName().toStdString() + "] with " "read/write access"; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); @@ -722,13 +717,13 @@ namespace Isis { if (m_dataFile) { if (m_storesDnData && !m_dataFile->open(QIODevice::ReadWrite)) { - QString msg = "Failed to open [" + m_dataFile->fileName() + "] with " + std::string msg = "Failed to open [" + m_dataFile->fileName().toStdString() + "] with " "read/write access"; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); } else if (!m_storesDnData && !m_dataFile->open(QIODevice::ReadOnly)) { - QString msg = "Failed to open [" + m_dataFile->fileName() + "] with " + std::string msg = "Failed to open [" + m_dataFile->fileName().toStdString() + "] with " "read access"; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); @@ -736,7 +731,7 @@ namespace Isis { } } else { - QString msg = "Unknown value for access [" + access + "]. Expected 'r' " + std::string msg = "Unknown value for access [" + access.toStdString() + "]. Expected 'r' " " or 'rw'"; cleanUp(false); throw IException(IException::Programmer, msg, _FILEINFO_); @@ -754,7 +749,7 @@ namespace Isis { QPair dataLabel = qMakePair(false, m_label); if (!m_storesDnData) { - dataLabel = qMakePair(true, new Pvl(m_dataFileName->expanded().toStdString())); + dataLabel = qMakePair(true, new Pvl(m_dataFileName->expanded())); } // Now examine the format to see which type of handler to create @@ -786,7 +781,7 @@ namespace Isis { */ void Cube::reopen(QString access) { if (!m_labelFile) { - QString msg = "Cube has not been opened yet. The filename to re-open is " + std::string msg = "Cube has not been opened yet. The filename to re-open is " "unknown"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -799,7 +794,7 @@ namespace Isis { virtualBandList = *m_virtualBandList; close(); - open(filename.expanded(), access); + open(QString::fromStdString(filename.expanded()), access); if (virtualBandList.size()) { if (m_virtualBandList) @@ -858,7 +853,7 @@ namespace Isis { * standardized. */ History Cube::readHistory(const QString &name) const { - Blob historyBlob(name, "History"); + Blob historyBlob(name.toStdString(), "History"); try { // read history from cube, if it exists. read(historyBlob); @@ -883,8 +878,8 @@ namespace Isis { read(footprintBlob); } catch (IException &e) { - QString msg = "Footprintinit must be run prior to reading the footprint"; - msg += " with POLYGON=TRUE for cube [" + fileName() + "]"; + std::string msg = "Footprintinit must be run prior to reading the footprint"; + msg += " with POLYGON=TRUE for cube [" + fileName().toStdString() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } ImagePolygon footprint(footprintBlob); @@ -900,12 +895,12 @@ namespace Isis { * @return @b OriginalLabel The original PDS3 label as a PVL document */ OriginalLabel Cube::readOriginalLabel(const QString &name) const { - Blob origLabelBlob(name, "OriginalLabel"); + Blob origLabelBlob(name.toStdString(), "OriginalLabel"); try { read(origLabelBlob); } catch (IException &e){ - QString msg = "Unable to locate OriginalLabel in " + fileName(); + std::string msg = "Unable to locate OriginalLabel in " + fileName().toStdString(); throw IException(e, IException::User, msg, _FILEINFO_); } OriginalLabel origLabel(origLabelBlob); @@ -923,12 +918,12 @@ namespace Isis { * @return @b CubeStretch */ CubeStretch Cube::readCubeStretch(QString name, const std::vector keywords) const { - Blob stretchBlob(name, "Stretch"); + Blob stretchBlob(name.toStdString(), "Stretch"); try { read(stretchBlob, keywords); } catch (IException &e){ - QString msg = "Unable to locate Stretch information in " + fileName(); + std::string msg = "Unable to locate Stretch information in " + fileName().toStdString(); throw IException(e, IException::User, msg, _FILEINFO_); } CubeStretch cubeStretch(stretchBlob); @@ -947,7 +942,7 @@ namespace Isis { read(origXmlLabelBlob); } catch (IException &e){ - QString msg = "Unable to locate OriginalXmlLabel in " + fileName(); + std::string msg = "Unable to locate OriginalXmlLabel in " + fileName().toStdString(); throw IException(e, IException::User, msg, _FILEINFO_); } OriginalXmlLabel origXmlLabel(origXmlLabelBlob); @@ -963,12 +958,12 @@ namespace Isis { * @return @b Table */ Table Cube::readTable(const QString &name) { - Blob tableBlob(name, "Table"); + Blob tableBlob(name.toStdString(), "Table"); try { read(tableBlob); } catch (IException &e) { - QString msg = "Failed to read table [" + name + "] from cube [" + fileName() + "]."; + std::string msg = "Failed to read table [" + name.toStdString() + "] from cube [" + fileName().toStdString() + "]."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } return Table(tableBlob); @@ -999,7 +994,7 @@ namespace Isis { // Compute the number of bytes in the cube + label bytes and if the // endpos of the file // is not greater than this then seek to that position. - fstream stream(m_labelFileName->expanded().toLatin1().data(), + fstream stream(m_labelFileName->expanded().c_str(), ios::in | ios::out | ios::binary); stream.seekp(0, ios::end); @@ -1023,17 +1018,16 @@ namespace Isis { // Write a detached blob else { - FileName blobFileName = fileName(); + FileName blobFileName = fileName().toStdString(); blobFileName = blobFileName.removeExtension(); - blobFileName = blobFileName.addExtension(QString::fromStdString(blob.Type())); + blobFileName = blobFileName.addExtension(blob.Type()); blobFileName = blobFileName.addExtension(blob.Name()); - QString blobFile(blobFileName.expanded()); + std::string blobFile(blobFileName.expanded()); ios::openmode flags = ios::in | ios::binary | ios::out | ios::trunc; fstream detachedStream; - detachedStream.open(blobFile.toLatin1().data(), flags); + detachedStream.open(blobFile.c_str(), flags); if (!detachedStream) { - QString message = "Unable to open data file [" + - blobFileName.expanded() + "]"; + std::string message = "Unable to open data file [" + blobFileName.expanded() + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -1135,13 +1129,13 @@ namespace Isis { } if (isReadOnly()) { - QString msg = "Cannot write to the cube [" + (QString)QFileInfo(fileName()).fileName() + + std::string msg = "Cannot write to the cube [" + QFileInfo(fileName()).fileName().toStdString() + "] because it is opened read-only"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (!m_storesDnData) { - QString msg = "The cube [" + QFileInfo(fileName()).fileName() + + std::string msg = "The cube [" + QFileInfo(fileName()).fileName().toStdString() + "] does not support storing DN data because it is using an external file for DNs"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -1341,7 +1335,7 @@ namespace Isis { if (vbands.size() > 0) { QListIterator it(vbands); while (it.hasNext()) { - m_virtualBandList->append(toInt(it.next())); + m_virtualBandList->append(it.next().toInt()); } } else { @@ -1378,24 +1372,20 @@ namespace Isis { */ void Cube::relocateDnData(FileName dnDataFile) { if (!isOpen()) { - throw IException(IException::Unknown, - QString("Cannot relocate the DN data to [%1] for an external cube label " - "file which is not open.") - .arg(dnDataFile.original()), - _FILEINFO_); + throw IException(IException::Unknown, "Cannot relocate the DN data to " + dnDataFile.original() + " for an external cube label " + "file which is not open.", _FILEINFO_); } if (m_storesDnData) { throw IException(IException::Unknown, - QString("The cube [%1] stores DN data. It cannot be relocated to [%2] - " - "this is only supported for external cube label files.") - .arg(m_labelFileName->original()).arg(dnDataFile.original()), + "The cube " + m_labelFileName->original() + " stores DN data. It cannot be relocated to " + dnDataFile.original() + " - " + "this is only supported for external cube label files.", _FILEINFO_); } m_label->findObject("IsisCube").findObject("Core").findKeyword("^DnFile")[0] = - dnDataFile.original().toStdString(); + dnDataFile.original(); reopen(m_labelFile->isWritable()? "rw" : "r"); } @@ -1583,7 +1573,7 @@ namespace Isis { PvlObject &core = m_label->findObject("IsisCube").findObject("Core"); - return QString::fromStdString(core["^DnFile"][0]); + return core["^DnFile"][0]; } @@ -1595,7 +1585,7 @@ namespace Isis { */ QString Cube::fileName() const { if (isOpen()) - return m_labelFileName->expanded(); + return QString::fromStdString(m_labelFileName->expanded()); else return ""; } @@ -1629,7 +1619,7 @@ namespace Isis { * @throws IsisProgrammerError Band was less than zero or more than the number * of bands in the cube. */ - Histogram *Cube::histogram(const int &band, QString msg) { + Histogram *Cube::histogram(const int &band, std::string msg) { return histogram(band, ValidMinimum, ValidMaximum, msg); } @@ -1660,16 +1650,16 @@ namespace Isis { * of bands in the cube. */ Histogram *Cube::histogram(const int &band, const double &validMin, - const double &validMax, QString msg) { + const double &validMax, std::string msg) { // Make sure cube is open if ( !isOpen() ) { - QString msg = "Cannot create histogram object for an unopened cube"; + std::string msg = "Cannot create histogram object for an unopened cube"; throw IException(IException::Programmer, msg, _FILEINFO_); } // Make sure band is valid if ((band < 0) || (band > bandCount())) { - QString msg = "Invalid band in [CubeInfo::Histogram]"; + std::string msg = "Invalid band in [CubeInfo::Histogram]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1705,7 +1695,7 @@ namespace Isis { hist->SetValidRange(binMin,binMax); // Loop and get the histogram - progress.SetText(msg); + progress.SetText(QString::fromStdString(msg)); progress.SetMaximumSteps(maxSteps); progress.CheckStatus(); @@ -1860,7 +1850,7 @@ namespace Isis { * such as the minimum and maximum pixel values for the input cube on the * band specified, or all bands as the case may be. */ - Statistics *Cube::statistics(const int &band, QString msg) { + Statistics *Cube::statistics(const int &band, std::string msg) { return statistics(band, ValidMinimum, ValidMaximum, msg); } @@ -1882,10 +1872,10 @@ namespace Isis { * @return Statistics* */ Statistics *Cube::statistics(const int &band, const double &validMin, - const double &validMax, QString msg) { + const double &validMax, std::string msg) { // Make sure cube is open if ( !isOpen() ) { - QString msg = "Cannot create statistics object for an unopened cube"; + std::string msg = "Cannot create statistics object for an unopened cube"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1911,7 +1901,7 @@ namespace Isis { } Progress progress; - progress.SetText(msg); + progress.SetText(QString::fromStdString(msg)); progress.SetMaximumSteps(maxSteps); progress.CheckStatus(); @@ -1958,7 +1948,7 @@ namespace Isis { m_ioHandler->addCachingAlgorithm(algorithm); } else if (!isOpen()) { - QString msg = "Cannot add a caching algorithm until the cube is open"; + std::string msg = "Cannot add a caching algorithm until the cube is open"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -2088,7 +2078,7 @@ namespace Isis { */ void Cube::putGroup(const PvlGroup &group) { if (isReadOnly()) { - QString msg = "Cannot add a group to the label of cube [" + (QString)QFileInfo(fileName()).fileName() + + std::string msg = "Cannot add a group to the label of cube [" + QFileInfo(fileName()).fileName().toStdString() + "] because it is opened read-only"; throw IException(IException::Programmer, msg, _FILEINFO_); return; @@ -2144,7 +2134,7 @@ namespace Isis { // Always remove a temporary file if (m_tempCube) { - QFile::remove(m_tempCube->expanded()); + QFile::remove(QString::fromStdString(m_tempCube->expanded())); removeIt = false; // dont remove originals delete m_tempCube; @@ -2152,10 +2142,10 @@ namespace Isis { } if (removeIt) { - QFile::remove(m_labelFileName->expanded()); + QFile::remove(QString::fromStdString(m_labelFileName->expanded())); if (*m_labelFileName != *m_dataFileName) - QFile::remove(m_dataFileName->expanded()); + QFile::remove(QString::fromStdString(m_dataFileName->expanded())); } delete m_labelFile; @@ -2244,31 +2234,31 @@ namespace Isis { // External cube - go look at our external file else if (!m_storesDnData) { FileName guess = *m_dataFileName; - QDir dir(guess.toString()); + QDir dir(QString::fromStdString(guess.toString())); // If path is relative and there is a labelFileName, start in directory of the ecub, then // cd to the directory containing the DnFile, since it is relative to the location of the ecub. // We need to turn the relative path into an absolute path. if (dir.isRelative() && m_labelFileName) { - QDir dir2(m_labelFileName->originalPath()); - dir2.cd(guess.path()); - guess = dir2.absolutePath() + "/" + guess.name(); + QDir dir2(QString::fromStdString(m_labelFileName->originalPath())); + dir2.cd(QString::fromStdString(guess.path())); + guess = dir2.absolutePath().toStdString() + "/" + guess.name(); } do { - Pvl guessLabel(guess.expanded().toStdString()); + Pvl guessLabel(guess.expanded()); PvlObject &core = guessLabel.findObject("IsisCube").findObject("Core"); if (core.hasKeyword("^DnFile")) { FileName currentGuess = guess; - guess = QString::fromStdString(core["^DnFile"][0]); + guess = core["^DnFile"][0]; - if (!guess.path().startsWith("/")) { + if (!QString::fromStdString(guess.path()).startsWith("/")) { guess = currentGuess.path() + "/" + guess.original(); } } else if (core.hasKeyword("^Core")) { - result = QString::fromStdString(core["^Core"][0]); + result = core["^Core"][0]; } else { result = guess; @@ -2329,7 +2319,7 @@ namespace Isis { // Stored pixel information const PvlGroup &pixelsGroup = core.findGroup("Pixels"); - m_byteOrder = ByteOrderEnumeration(QString::fromStdString(pixelsGroup["ByteOrder"])); + m_byteOrder = ByteOrderEnumeration(pixelsGroup["ByteOrder"]); m_base = pixelsGroup["Base"]; m_multiplier = pixelsGroup["Multiplier"]; m_pixelType = PixelTypeEnumeration(QString::fromStdString(pixelsGroup["Type"])); @@ -2343,12 +2333,12 @@ namespace Isis { } } else { - FileName temp(QString::fromStdString(core["^DnFile"][0])); - if (!temp.expanded().startsWith("/")) { + FileName temp(core["^DnFile"][0]); + if (!QString::fromStdString(temp.expanded()).startsWith("/")) { temp = FileName(m_labelFileName->path() + "/" + temp.original()); } - initCoreFromLabel(Pvl(temp.toString().toStdString())); + initCoreFromLabel(Pvl(temp.toString())); } } @@ -2365,7 +2355,7 @@ namespace Isis { try { if (labelFileName.fileExists()) { - m_label = new Pvl(labelFileName.expanded().toStdString()); + m_label = new Pvl(labelFileName.expanded()); if (!m_label->objects()) { throw IException(); } @@ -2383,7 +2373,7 @@ namespace Isis { FileName tmp(labelFileName); tmp = tmp.addExtension("cub"); if (tmp.fileExists()) { - m_label = new Pvl(tmp.expanded().toStdString()); + m_label = new Pvl(tmp.expanded()); if (!m_label->objects()) { throw IException(); } @@ -2403,7 +2393,7 @@ namespace Isis { FileName tmp(labelFileName); tmp = tmp.setExtension("lbl"); if (tmp.fileExists()) { - m_label = new Pvl(tmp.expanded().toStdString()); + m_label = new Pvl(tmp.expanded()); if (!m_label->objects()) { throw IException(); } @@ -2423,7 +2413,7 @@ namespace Isis { FileName tmp(labelFileName); tmp = tmp.addExtension("ecub"); if (tmp.fileExists()) { - m_label = new Pvl(tmp.expanded().toStdString()); + m_label = new Pvl(tmp.expanded()); if (!m_label->objects()) { throw IException(); } @@ -2439,7 +2429,7 @@ namespace Isis { } if (!m_label) { - QString msg = Message::FileOpen(labelFileName.original()); + std::string msg = Message::FileOpen(labelFileName.original()); throw IException(IException::Io, msg, _FILEINFO_); } @@ -2449,17 +2439,17 @@ namespace Isis { // need to internalize a new label if (m_label->hasKeyword("CCSD3ZF0000100000001NJPL3IF0PDS200000001")) { if (!readWrite) { - reformatOldIsisLabel(m_labelFileName->expanded()); + reformatOldIsisLabel(QString::fromStdString(m_labelFileName->expanded())); } else { - QString msg = "Can not open [" + m_labelFileName->original() + "]" + std::string msg = "Can not open [" + m_labelFileName->original() + "]" " because it is an ISIS2 cube."; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); } } else { - m_labelFile = new QFile(m_labelFileName->expanded()); + m_labelFile = new QFile(QString::fromStdString(m_labelFileName->expanded())); } } @@ -2489,12 +2479,12 @@ namespace Isis { if (core->hasKeyword("^DnFile")) { - FileName temp(QString::fromStdString((*core)["^DnFile"][0])); - if (!temp.expanded().startsWith("/")) { + FileName temp((*core)["^DnFile"][0]); + if (!QString::fromStdString(temp.expanded()).startsWith("/")) { temp = realDataFileName(); } - label = Pvl(temp.toString().toStdString()); + label = Pvl(temp.toString()); core = NULL; } } @@ -2512,9 +2502,9 @@ namespace Isis { */ void Cube::reformatOldIsisLabel(const QString &oldCube) { QString parameters = "from=" + oldCube; - FileName oldName(oldCube); + FileName oldName(oldCube.toStdString()); FileName tempCube = FileName::createTempFile("Temporary_" + oldName.name() + ".cub"); - parameters += " to=" + tempCube.expanded(); + parameters += " to=" + QString::fromStdString(tempCube.expanded()); if (iApp == NULL) { QString command = "$ISISROOT/bin/pds2isis " + parameters; @@ -2526,8 +2516,8 @@ namespace Isis { } m_tempCube = new FileName(tempCube); - *m_label = Pvl(m_tempCube->toString().toStdString()); - m_labelFile = new QFile(m_tempCube->expanded()); + *m_label = Pvl(m_tempCube->toString()); + m_labelFile = new QFile(QString::fromStdString(m_tempCube->expanded())); } @@ -2558,7 +2548,7 @@ namespace Isis { proj = (TProjection *) projection(); } catch(IException &e) { - QString msg = "Cannot calculate lat/lon range without a camera or projection"; + std::string msg = "Cannot calculate lat/lon range without a camera or projection"; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -2567,7 +2557,7 @@ namespace Isis { cam = camera(); } catch(IException &e) { - QString msg = "Unable to create camera when calculating a lat/lon range."; + std::string msg = "Unable to create camera when calculating a lat/lon range."; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -2618,7 +2608,7 @@ namespace Isis { } if ( (minLatitude == 99999) || (minLongitude == 99999) || (maxLatitude == -99999) || (maxLongitude == -99999) ) { - QString msg = "Unable to calculate a minimum or maximum latitutde or longitude."; + std::string msg = "Unable to calculate a minimum or maximum latitutde or longitude."; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -2634,7 +2624,7 @@ namespace Isis { } // Set the pvl's format template - m_label->setFormatTemplate(m_formatTemplateFile->original().toStdString()); + m_label->setFormatTemplate(m_formatTemplateFile->original()); // Write them with attached data if (m_attached) { @@ -2654,8 +2644,8 @@ namespace Isis { } else { locker2.unlock(); - QString msg = "Label space is full in [" + - (QString)FileName(*m_labelFileName).name() + + std::string msg = "Label space is full in [" + + FileName(*m_labelFileName).name() + "] unable to write labels"; cleanUp(false); throw IException(IException::Io, msg, _FILEINFO_); @@ -2664,7 +2654,7 @@ namespace Isis { // or detached label else { - m_label->write(m_labelFileName->expanded().toStdString()); + m_label->write(m_labelFileName->expanded()); } } } diff --git a/isis/src/base/objs/Cube/Cube.h b/isis/src/base/objs/Cube/Cube.h index 32d234367c..f3626b2b89 100644 --- a/isis/src/base/objs/Cube/Cube.h +++ b/isis/src/base/objs/Cube/Cube.h @@ -296,10 +296,10 @@ namespace Isis { virtual QString fileName() const; Format format() const; virtual Histogram *histogram(const int &band = 1, - QString msg = "Gathering histogram"); + std::string msg = "Gathering histogram"); virtual Histogram *histogram(const int &band, const double &validMin, const double &validMax, - QString msg = "Gathering histogram"); + std::string msg = "Gathering histogram"); Pvl *label() const; int labelSize(bool actual = false) const; int lineCount() const; @@ -309,10 +309,10 @@ namespace Isis { Projection *projection(); int sampleCount() const; Statistics *statistics(const int &band = 1, - QString msg = "Gathering statistics"); + std::string msg = "Gathering statistics"); Statistics *statistics(const int &band, const double &validMin, const double &validMax, - QString msg = "Gathering statistics"); + std::string msg = "Gathering statistics"); bool storesDnData() const; void addCachingAlgorithm(CubeCachingAlgorithm *); diff --git a/isis/src/base/objs/Cube/CubeBsqHandler.cpp b/isis/src/base/objs/Cube/CubeBsqHandler.cpp index 949188e326..08ad458487 100644 --- a/isis/src/base/objs/Cube/CubeBsqHandler.cpp +++ b/isis/src/base/objs/Cube/CubeBsqHandler.cpp @@ -88,10 +88,10 @@ namespace Isis { } if(!success) { - IString msg = "Reading from the file [" + dataFile->fileName() + "] " + IString msg = "Reading from the file [" + dataFile->fileName().toStdString() + "] " "failed with reading [" + - QString::number(chunkToFill.getByteCount()) + - "] bytes at position [" + QString::number(startByte) + "]"; + std::to_string(chunkToFill.getByteCount()) + + "] bytes at position [" + std::to_string(startByte) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -112,10 +112,10 @@ namespace Isis { } if(!success) { - IString msg = "Writing to the file [" + dataFile->fileName() + "] " + IString msg = "Writing to the file [" + dataFile->fileName().toStdString() + "] " "failed with writing [" + - QString::number(chunkToWrite.getByteCount()) + - "] bytes at position [" + QString::number(startByte) + "]"; + std::to_string(chunkToWrite.getByteCount()) + + "] bytes at position [" + std::to_string(startByte) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/Cube/CubeTileHandler.cpp b/isis/src/base/objs/Cube/CubeTileHandler.cpp index 0cbe2a1611..72e47e8cb0 100644 --- a/isis/src/base/objs/Cube/CubeTileHandler.cpp +++ b/isis/src/base/objs/Cube/CubeTileHandler.cpp @@ -90,10 +90,10 @@ namespace Isis { } if(!success) { - IString msg = "Reading from the file [" + dataFile->fileName() + "] " + IString msg = "Reading from the file [" + dataFile->fileName().toStdString() + "] " "failed with reading [" + - QString::number(chunkToFill.getByteCount()) + - "] bytes at position [" + QString::number(startByte) + "]"; + std::to_string(chunkToFill.getByteCount()) + + "] bytes at position [" + std::to_string(startByte) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -113,10 +113,10 @@ namespace Isis { } if(!success) { - IString msg = "Writing to the file [" + dataFile->fileName() + "] " + IString msg = "Writing to the file [" + dataFile->fileName().toStdString() + "] " "failed with writing [" + - QString::number(chunkToWrite.getByteCount()) + - "] bytes at position [" + QString::number(startByte) + "]"; + std::to_string(chunkToWrite.getByteCount()) + + "] bytes at position [" + std::to_string(startByte) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp b/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp index 1402990f61..2443a10138 100644 --- a/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp +++ b/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp @@ -89,15 +89,15 @@ namespace Isis { // Is this token a range of bands if (commaTok.contains('-')) { QString dashTok; - int start = toInt(commaTok.mid(0, commaTok.indexOf("-"))); - int end = toInt(commaTok.mid(commaTok.indexOf("-") + 1)); + int start = commaTok.mid(0, commaTok.indexOf("-")).toInt(); + int end = commaTok.mid(commaTok.indexOf("-") + 1).toInt(); int direction; direction = (start <= end) ? 1 : -1; // Save the entire range of bands for (int band = start; band != end; band += direction) { - result.push_back(Isis::toString(band)); + result.push_back(QString::number(band)); } - result.push_back(Isis::toString(end)); + result.push_back(QString::number(end)); } // This token is a single band specification else { @@ -115,7 +115,7 @@ namespace Isis { void CubeAttributeInput::setBands(const vector &bands) { - setAttributes("+" + toString(bands)); + setAttributes("+" + toString(bands).toStdString()); } @@ -299,7 +299,7 @@ namespace Isis { QStringList rangeList = range.split(":"); if (rangeList.count() == 2 && rangeList.first() != "") - result = toDouble(rangeList.first()); + result = rangeList.first().toDouble(); } return result; @@ -314,7 +314,7 @@ namespace Isis { QStringList rangeList = range.split(":"); if (rangeList.count() == 2 && rangeList.last() != "") - result = toDouble(rangeList.last()); + result = rangeList.last().toDouble(); } return result; @@ -323,15 +323,15 @@ namespace Isis { void CubeAttributeOutput::setMinimum(double min) { if (!IsSpecial(min)) { - QString newRange = Isis::toString(min) + ":"; + QString newRange = QString::number(min) + ":"; if (!IsSpecial(maximum())) - newRange += Isis::toString(maximum()); + newRange += QString::number(maximum()); setAttribute(newRange, &CubeAttributeOutput::isRange); } else if (!IsSpecial(maximum())) { - setAttribute(":" + Isis::toString(maximum()), &CubeAttributeOutput::isRange); + setAttribute(":" + QString::number(maximum()), &CubeAttributeOutput::isRange); } else { setAttribute("", &CubeAttributeOutput::isRange); @@ -341,15 +341,15 @@ namespace Isis { void CubeAttributeOutput::setMaximum(double max) { if (!IsSpecial(max)) { - QString newRange = ":" + Isis::toString(max); + QString newRange = ":" + QString::number(max); if (!IsSpecial(minimum())) - newRange = Isis::toString(minimum()) + newRange; + newRange = QString::number(minimum()) + newRange; setAttribute(newRange, &CubeAttributeOutput::isRange); } else if (!IsSpecial(minimum())) { - setAttribute(Isis::toString(minimum()) + ":", &CubeAttributeOutput::isRange); + setAttribute(QString::number(minimum()) + ":", &CubeAttributeOutput::isRange); } else { setAttribute("", &CubeAttributeOutput::isRange); @@ -467,7 +467,7 @@ namespace Isis { QString CubeAttributeOutput::byteOrderString() const { - return ByteOrderName(byteOrder()); + return QString::fromStdString(ByteOrderName(byteOrder())); } diff --git a/isis/src/base/objs/CubeAttribute/CubeAttribute.h b/isis/src/base/objs/CubeAttribute/CubeAttribute.h index 767f90d1dd..d8f1f7971c 100644 --- a/isis/src/base/objs/CubeAttribute/CubeAttribute.h +++ b/isis/src/base/objs/CubeAttribute/CubeAttribute.h @@ -54,7 +54,7 @@ namespace Isis { if(labelType == DetachedLabel) return "Detached"; if(labelType == ExternalLabel) return "External"; - QString msg = "Invalid label attachment type [" + QString::number(labelType) + "]"; + std::string msg = "Invalid label attachment type [" + std::to_string(labelType) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -73,7 +73,7 @@ namespace Isis { if(temp == "DETACHED") return DetachedLabel; if(temp == "External") return ExternalLabel; - QString msg = "Invalid label attachment type string [" + labelType + "]"; + std::string msg = "Invalid label attachment type string [" + labelType.toStdString() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -192,8 +192,7 @@ namespace Isis { foreach (tester, m_attributeTypeTesters) { if ( (static_cast(this)->*tester)(upcaseAtt) ) { if (legal) { - throw IException(IException::Unknown, - QObject::tr("Attribute [%1] is ambiguous").arg(attribute), + throw IException(IException::Unknown,"Attribute [" + attribute.toStdString() + "] is ambiguous", _FILEINFO_); } @@ -202,8 +201,7 @@ namespace Isis { } if (!legal) { - throw IException(IException::Unknown, - QObject::tr("Attribute [%1] is not recognized").arg(attribute), + throw IException(IException::Unknown, "Attribute [" + attribute.toStdString() + "] is not recognized", _FILEINFO_); } diff --git a/isis/src/base/objs/CubeCalculator/CubeCalculator.cpp b/isis/src/base/objs/CubeCalculator/CubeCalculator.cpp index 2a2426332b..392fa8f782 100644 --- a/isis/src/base/objs/CubeCalculator/CubeCalculator.cpp +++ b/isis/src/base/objs/CubeCalculator/CubeCalculator.cpp @@ -273,7 +273,7 @@ namespace Isis { IString tok(token.substr(1)); int file = tok.ToInteger() - 1; if (file < 0 || file >= (int)inCubes.size()) { - QString msg = "Invalid file number [" + QString::fromStdString(tok) + "]"; + std::string msg = "Invalid file number [" + tok + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -1183,8 +1183,8 @@ namespace Isis { } } else { - QString msg = "Unable to compute illumination angles at image center for operator [" - + tokenName + "]."; + std::string msg = "Unable to compute illumination angles at image center for operator [" + + tokenName.toStdString() + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/CubeDataThread/CubeDataThread.cpp b/isis/src/base/objs/CubeDataThread/CubeDataThread.cpp index d566ea8a4a..dd32cee25f 100644 --- a/isis/src/base/objs/CubeDataThread/CubeDataThread.cpp +++ b/isis/src/base/objs/CubeDataThread/CubeDataThread.cpp @@ -126,11 +126,11 @@ namespace Isis { Cube *newCube = new Cube(); try { - newCube->open(fileName.expanded(), "rw"); + newCube->open(QString::fromStdString(fileName.expanded()), "rw"); } catch (IException &e) { if (!mustOpenReadWrite) { - newCube->open(fileName.expanded(), "r"); + newCube->open(QString::fromStdString(fileName.expanded()), "r"); } else { throw; @@ -196,16 +196,16 @@ namespace Isis { if (i == p_managedCubes->end()) { p_threadSafeMutex->unlock(); - QString msg = "CubeDataThread::RemoveCube failed because cube ID ["; - msg += QString::number(cubeId); + std::string msg = "CubeDataThread::RemoveCube failed because cube ID ["; + msg += std::to_string(cubeId); msg += "] not found"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (p_managedDataSources->contains(cubeId)) { p_threadSafeMutex->unlock(); - QString msg = "CubeDataThread::RemoveCube failed cube ID ["; - msg += QString::number(cubeId); + std::string msg = "CubeDataThread::RemoveCube failed cube ID ["; + msg += std::to_string(cubeId); msg += "] has requested Bricks"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/CubeInfixToPostfix/CubeInfixToPostfix.cpp b/isis/src/base/objs/CubeInfixToPostfix/CubeInfixToPostfix.cpp index 4be50ca595..b2405e7b7f 100644 --- a/isis/src/base/objs/CubeInfixToPostfix/CubeInfixToPostfix.cpp +++ b/isis/src/base/objs/CubeInfixToPostfix/CubeInfixToPostfix.cpp @@ -104,7 +104,7 @@ namespace Isis { } throw IException(IException::User, - "The operator '" + representation + "' is not recognized.", + "The operator '" + representation.toStdString() + "' is not recognized.", _FILEINFO_); } diff --git a/isis/src/base/objs/CubeManager/CubeManager.cpp b/isis/src/base/objs/CubeManager/CubeManager.cpp index a80c7858f8..cce69083dd 100644 --- a/isis/src/base/objs/CubeManager/CubeManager.cpp +++ b/isis/src/base/objs/CubeManager/CubeManager.cpp @@ -47,7 +47,7 @@ namespace Isis { struct rlimit fileLimit; if (getrlimit(RLIMIT_NOFILE, &fileLimit) != 0) { - QString msg = "Cannot read the maximum allowable open files from system resources."; + std::string msg = "Cannot read the maximum allowable open files from system resources."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -93,9 +93,9 @@ namespace Isis { * to and may delete at any time */ Cube *CubeManager::OpenCube(const QString &cubeFileName) { - CubeAttributeInput attIn(cubeFileName); - IString attri = attIn.toString(); - IString expName = FileName(cubeFileName).expanded(); + CubeAttributeInput attIn(cubeFileName.toStdString()); + IString attri = attIn.toString().toStdString(); + IString expName = FileName(cubeFileName.toStdString()).expanded(); // If there are attributes, we need a plus sign on the name if (attri.size() > 0) { @@ -103,7 +103,7 @@ namespace Isis { } IString fullName = expName + attri; - QString fileName(fullName.ToQt()); + QString fileName(QString::fromStdString(fullName)); QMap::iterator searchResult = p_cubes.find(fileName); if (searchResult == p_cubes.end()) { @@ -145,7 +145,7 @@ namespace Isis { */ void CubeManager::CleanCubes(const QString &cubeFileName) { - QString fileName(FileName(cubeFileName).expanded()); + QString fileName(QString::fromStdString(FileName(cubeFileName.toStdString()).expanded())); QMap::iterator searchResult = p_cubes.find(fileName); if (searchResult == p_cubes.end()) { diff --git a/isis/src/base/objs/DemShape/unitTest.cpp b/isis/src/base/objs/DemShape/unitTest.cpp index 2e0b892dac..1e653fa4ed 100644 --- a/isis/src/base/objs/DemShape/unitTest.cpp +++ b/isis/src/base/objs/DemShape/unitTest.cpp @@ -233,7 +233,7 @@ int main() { } catch (IException &e) { cout << endl << endl; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/Distance/Distance.cpp b/isis/src/base/objs/Distance/Distance.cpp index eb06230a00..afdcab1ef4 100644 --- a/isis/src/base/objs/Distance/Distance.cpp +++ b/isis/src/base/objs/Distance/Distance.cpp @@ -178,7 +178,7 @@ namespace Isis { QString string; if (isValid()) - string = Isis::toString(meters()) + " meters"; + string = QString::number(meters()) + " meters"; return string; } diff --git a/isis/src/base/objs/Distance/Distance.h b/isis/src/base/objs/Distance/Distance.h index 551092c77e..708dd92fbb 100644 --- a/isis/src/base/objs/Distance/Distance.h +++ b/isis/src/base/objs/Distance/Distance.h @@ -6,6 +6,7 @@ For more details about the LICENSE terms and the AUTHORS, you will find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ +#include class QString; diff --git a/isis/src/base/objs/EllipsoidShape/unitTest.cpp b/isis/src/base/objs/EllipsoidShape/unitTest.cpp index d76d03afce..2db9561335 100644 --- a/isis/src/base/objs/EllipsoidShape/unitTest.cpp +++ b/isis/src/base/objs/EllipsoidShape/unitTest.cpp @@ -158,7 +158,7 @@ int main() { } catch (IException &e) { cout << endl << endl; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/EmbreeShapeModel/EmbreeShapeModel.cpp b/isis/src/base/objs/EmbreeShapeModel/EmbreeShapeModel.cpp index 5496d99b3e..b472b9b35a 100644 --- a/isis/src/base/objs/EmbreeShapeModel/EmbreeShapeModel.cpp +++ b/isis/src/base/objs/EmbreeShapeModel/EmbreeShapeModel.cpp @@ -93,7 +93,7 @@ namespace Isis { m_targetShape = m_targetManager->create(m_shapeFile); } catch(IException &e) { - QString msg = "Cannot create a EmbreeShape from " + m_shapeFile; + std::string msg = "Cannot create a EmbreeShape from " + m_shapeFile.toStdString(); throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -131,7 +131,7 @@ namespace Isis { m_targetShape = m_targetManager->create(m_shapeFile); } catch(IException &e) { - QString msg = "Cannot create a EmbreeShape from " + m_shapeFile; + std::string msg = "Cannot create a EmbreeShape from " + m_shapeFile.toStdString(); throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -502,7 +502,7 @@ namespace Isis { void EmbreeShapeModel::calculateLocalNormal(QVector neighborPoints) { // Sanity check if ( !hasIntersection() ) { // hasIntersection() <==> hasNormall() - QString mess = "Intercept point does not exist - cannot provide normal vector"; + std::string mess = "Intercept point does not exist - cannot provide normal vector"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -548,17 +548,17 @@ namespace Isis { // Sanity check on state if ( !hasIntersection() ) { - QString msg = "An intersection must be defined before computing the surface normal."; + std::string msg = "An intersection must be defined before computing the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } if ( !surfaceIntersection()->Valid() ) { - QString msg = "The surface point intersection must be valid to compute the surface normal."; + std::string msg = "The surface point intersection must be valid to compute the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (!hasValidTarget()) { - QString msg = "A valid target must be defined before computing the surface normal."; + std::string msg = "A valid target must be defined before computing the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/EmbreeShapeModel/unitTest.cpp b/isis/src/base/objs/EmbreeShapeModel/unitTest.cpp index 6ef0490b1e..3d6fcb6265 100644 --- a/isis/src/base/objs/EmbreeShapeModel/unitTest.cpp +++ b/isis/src/base/objs/EmbreeShapeModel/unitTest.cpp @@ -295,7 +295,7 @@ int main(int argc, char *argv[]) { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/EmbreeTargetManager/EmbreeTargetManager.cpp b/isis/src/base/objs/EmbreeTargetManager/EmbreeTargetManager.cpp index 2c59e7c882..4eaba1334f 100644 --- a/isis/src/base/objs/EmbreeTargetManager/EmbreeTargetManager.cpp +++ b/isis/src/base/objs/EmbreeTargetManager/EmbreeTargetManager.cpp @@ -92,8 +92,8 @@ namespace Isis { * @see FileName::Expanded() */ QString EmbreeTargetManager::fullFilePath(const QString &filePath) const { - FileName fileName(filePath); - return fileName.expanded(); + FileName fileName(filePath.toStdString()); + return QString::fromStdString(fileName.expanded()); } @@ -141,7 +141,7 @@ namespace Isis { // First check how many already exist if ( m_targeCache.size() >= maxCacheSize() ) { - QString msg = "Failed creating EmbreeTargetShape for [" + shapeFile + std::string msg = "Failed creating EmbreeTargetShape for [" + shapeFile.toStdString() + "] Too many EmbreeTargetShapes are already open."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -176,8 +176,8 @@ namespace Isis { // Sanity check if ( !inCache(fullPath) ) { - QString msg = "Cannot free EmbreeTargetShape for file [" - + fullPath + "] because it is not stored in the cache."; + std::string msg = "Cannot free EmbreeTargetShape for file [" + + fullPath.toStdString() + "] because it is not stored in the cache."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -213,8 +213,8 @@ namespace Isis { // Sanity check if ( !inCache(fullPath) ) { - QString msg = "Cannot free EmbreeTargetShape for file [" - + fullPath + "] because it is not stored in the cache."; + std::string msg = "Cannot free EmbreeTargetShape for file [" + + fullPath.toStdString() + "] because it is not stored in the cache."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/EmbreeTargetManager/unitTest.cpp b/isis/src/base/objs/EmbreeTargetManager/unitTest.cpp index a770f020fa..c31395480b 100644 --- a/isis/src/base/objs/EmbreeTargetManager/unitTest.cpp +++ b/isis/src/base/objs/EmbreeTargetManager/unitTest.cpp @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/EmbreeTargetShape/EmbreeTargetShape.cpp b/isis/src/base/objs/EmbreeTargetShape/EmbreeTargetShape.cpp index e3d6e61435..3e531a7227 100644 --- a/isis/src/base/objs/EmbreeTargetShape/EmbreeTargetShape.cpp +++ b/isis/src/base/objs/EmbreeTargetShape/EmbreeTargetShape.cpp @@ -269,18 +269,18 @@ namespace Isis { m_scene(rtcNewScene(m_device)) { rtcSetSceneFlags(m_scene, RTC_SCENE_FLAG_ROBUST | RTC_SCENE_FLAG_CONTEXT_FILTER_FUNCTION); rtcSetSceneBuildQuality(m_scene, RTC_BUILD_QUALITY_HIGH); - FileName file(dem); + FileName file(dem.toStdString()); pcl::PolygonMesh::Ptr mesh; - m_name = file.baseName(); + m_name = QString::fromStdString(file.baseName()); try { // DEMs (ISIS cubes) TODO implement this if (file.extension() == "cub") { - QString msg = "DEMs cannot be used to create an EmbreeTargetShape."; + std::string msg = "DEMs cannot be used to create an EmbreeTargetShape."; throw IException(IException::Io, msg, _FILEINFO_); } // DSKs - else if (file.extension().toLower() == "bds") { + else if (QString::fromStdString(file.extension()).toLower() == "bds") { mesh = readDSK(file); } // Let PCL try to handle other formats (obj, ply, etc.) @@ -289,7 +289,7 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Failed creating an EmbreeTargetShape from [" + std::string msg = "Failed creating an EmbreeTargetShape from [" + file.expanded() + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -320,12 +320,12 @@ namespace Isis { // Sanity check if ( !file.fileExists() ) { - QString mess = "NAIF DSK file [" + file.expanded() + "] does not exist."; + std::string mess = "NAIF DSK file [" + file.expanded() + "] does not exist."; throw IException(IException::User, mess, _FILEINFO_); } // Open the NAIF Digital Shape Kernel (DSK) - dasopr_c( file.expanded().toLatin1().data(), &dskHandle ); + dasopr_c( file.expanded().c_str(), &dskHandle ); NaifStatus::CheckErrors(); // Search to the first DLA segment @@ -333,7 +333,7 @@ namespace Isis { dlabfs_c( dskHandle, &dlaDescriptor, &found ); NaifStatus::CheckErrors(); if ( !found ) { - QString mess = "No segments found in DSK file [" + file.expanded() + "]"; + std::string mess = "No segments found in DSK file [" + file.expanded() + "]"; throw IException(IException::User, mess, _FILEINFO_); } @@ -357,7 +357,7 @@ namespace Isis { &numRead, ( SpiceDouble(*)[3] )(verticesArray) ); NaifStatus::CheckErrors(); if ( numRead != numVertices ) { - QString msg = "Failed reading all vertices from the DSK file, [" + std::string msg = "Failed reading all vertices from the DSK file, [" + toString(numRead) + "] out of [" + toString(numVertices) + "] vertices read."; throw IException(IException::Io, msg, _FILEINFO_); @@ -369,7 +369,7 @@ namespace Isis { &numRead, ( SpiceInt(*)[3] )(polygonsArray) ); NaifStatus::CheckErrors(); if ( numRead != numPlates ) { - QString msg = "Failed reading all polygons from the DSK file, [" + std::string msg = "Failed reading all polygons from the DSK file, [" + toString(numRead) + "] out of [" + toString(numPlates) + "] polygons read."; throw IException(IException::Io, msg, _FILEINFO_); @@ -421,9 +421,9 @@ namespace Isis { pcl::PolygonMesh::Ptr EmbreeTargetShape::readPC(FileName file) { pcl::PolygonMesh::Ptr mesh( new pcl::PolygonMesh ); - int loadStatus = pcl::io::load(file.expanded().toStdString(), *mesh); + int loadStatus = pcl::io::load(file.expanded(), *mesh); if (loadStatus == -1) { - QString msg = "Failed loading target shape file [" + file.expanded() + "]"; + std::string msg = "Failed loading target shape file [" + file.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } return mesh; @@ -706,7 +706,7 @@ namespace Isis { */ RayHitInformation EmbreeTargetShape::getHitInformation(RTCMultiHitRay &ray, int hitIndex) { if (hitIndex > ray.lastHit || hitIndex < 0) { - QString msg = "Hit index [" + toString(hitIndex) + "] is out of bounds."; + std::string msg = "Hit index [" + toString(hitIndex) + "] is out of bounds."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/EmbreeTargetShape/unitTest.cpp b/isis/src/base/objs/EmbreeTargetShape/unitTest.cpp index 9169dbfa8e..65d797eeb3 100644 --- a/isis/src/base/objs/EmbreeTargetShape/unitTest.cpp +++ b/isis/src/base/objs/EmbreeTargetShape/unitTest.cpp @@ -270,7 +270,7 @@ int main(int argc, char *argv[]) { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/EndianSwapper/EndianSwapper.h b/isis/src/base/objs/EndianSwapper/EndianSwapper.h index bfe3ac1157..5c2f82918a 100644 --- a/isis/src/base/objs/EndianSwapper/EndianSwapper.h +++ b/isis/src/base/objs/EndianSwapper/EndianSwapper.h @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "IException.h" +#include namespace Isis { diff --git a/isis/src/base/objs/Environment/Environment.cpp b/isis/src/base/objs/Environment/Environment.cpp index 56363cf1a2..428703cbbe 100644 --- a/isis/src/base/objs/Environment/Environment.cpp +++ b/isis/src/base/objs/Environment/Environment.cpp @@ -25,7 +25,7 @@ find files of those names at the top level of this repository. **/ // Set the Qt plugin directory QStringList pluginPaths; - Isis::IString root = Isis::Environment::getEnvironmentValue("ISISROOT", ""); + Isis::IString root = Isis::Environment::getEnvironmentValue("ISISROOT", "").toStdString(); QCoreApplication *core = QCoreApplication::instance(); if ( !core ) { std::cout << "**** Qt Plugin Path is not set because no instance of QCoreApplication ****\n"; diff --git a/isis/src/base/objs/Equalization/Equalization.cpp b/isis/src/base/objs/Equalization/Equalization.cpp index ad1825d52a..06792c65bc 100644 --- a/isis/src/base/objs/Equalization/Equalization.cpp +++ b/isis/src/base/objs/Equalization/Equalization.cpp @@ -83,10 +83,10 @@ namespace Isis { */ void Equalization::addHolds(QString holdListName) { FileList holdList; - holdList.read(FileName(holdListName)); + holdList.read(FileName(holdListName.toStdString())); if (holdList.size() > m_imageList.size()) { - QString msg = "The list of identifiers to be held must be less than or "; + std::string msg = "The list of identifiers to be held must be less than or "; msg += "equal to the total number of identitifers."; throw IException(IException::User, msg, _FILEINFO_); } @@ -102,7 +102,7 @@ namespace Isis { } } if (!matched) { - QString msg = "The hold list file [" + holdList[i].toString() + + std::string msg = "The hold list file [" + holdList[i].toString() + "] does not match a file in the from list"; throw IException(IException::User, msg, _FILEINFO_); } @@ -155,14 +155,14 @@ namespace Isis { for (int img = 0; img < m_imageList.size(); img++) { // Record name of each input cube without an overlap if (!m_doesOverlapList[img]) { - m_badFiles += m_imageList[img].toString(); + m_badFiles += QString::fromStdString(m_imageList[img].toString()); } } if (!m_badFiles.isEmpty()) { // Make sure we set the results for the already calculated overlap statistics setResults(); - QString msg; + std::string msg; // Let user know where to find list of non-overlapping files so they can make corrections. msg = "There are input images that do not overlap with enough valid pixels. "; msg += "See application log or \"NonOverlaps\" keyword in output statistics file."; @@ -193,7 +193,7 @@ namespace Isis { } catch (IException &e) { setResults(); - QString msg = "Unable to calculate the equalization statistics. You may " + std::string msg = "Unable to calculate the equalization statistics. You may " "want to try another LeastSquares::SolveMethod."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -217,13 +217,13 @@ namespace Isis { vector statsList; for (int img = 0; img < (int) m_imageList.size(); img++) { ProcessByLine p; - QString bandStr(toString(band)); + QString bandStr(QString::number(band)); QString statMsg = "Calculating Statistics for Band " + bandStr + - " of " + toString(m_maxBand) + " in Cube " + toString(img + 1) + - " of " + toString(m_maxCube); + " of " + QString::number(m_maxBand) + " in Cube " + QString::number(img + 1) + + " of " + QString::number(m_maxCube); p.Progress()->SetText(statMsg); - CubeAttributeInput att("+" + bandStr); - QString inp = m_imageList[img].toString(); + CubeAttributeInput att("+" + bandStr.toStdString()); + QString inp = QString::fromStdString(m_imageList[img].toString()); p.SetInputCube(inp, att); Statistics *stats = new Statistics(); @@ -259,7 +259,7 @@ namespace Isis { // each band shared amongst cubes for (int i = 0; i < m_imageList.size(); i++) { Cube cube1; - cube1.open(m_imageList[i].toString()); + cube1.open(QString::fromStdString(m_imageList[i].toString())); for (int j = (i + 1); j < m_imageList.size(); j++) { // Skip if overlap already calculated @@ -271,12 +271,12 @@ namespace Isis { } Cube cube2; - cube2.open(m_imageList[j].toString()); - QString cubeStr1 = toString((int)(i + 1)); - QString cubeStr2 = toString((int)(j + 1)); + cube2.open(QString::fromStdString(m_imageList[j].toString())); + QString cubeStr1 = QString::number((int)(i + 1)); + QString cubeStr2 = QString::number((int)(j + 1)); QString statMsg = "Gathering Overlap Statisitcs for Cube " + cubeStr1 + " vs " + cubeStr2 + " of " + - toString(m_maxCube); + QString::number(m_maxCube); // Get overlap statistics for new cubes OverlapStatistics *oStats = new OverlapStatistics(cube1, cube2, statMsg, m_samplingPercent); @@ -374,12 +374,12 @@ namespace Isis { norm.addComment("BandN = (GAIN)"); break; } - norm += PvlKeyword("FileName", m_imageList[img].original().toStdString()); + norm += PvlKeyword("FileName", m_imageList[img].original()); if (m_normsSolved) { // Band by band statistics for (int band = 1; band <= m_maxBand; band++) { - QString bandNum = toString(band); + QString bandNum = QString::number(band); QString bandStr = "Band" + bandNum; PvlKeyword bandStats(bandStr.toStdString()); // GAIN @@ -495,12 +495,12 @@ namespace Isis { */ void Equalization::applyCorrection(QString toListName="") { if (!isSolved()) { - QString msg = "Corrective factors have not yet been determined. "; + std::string msg = "Corrective factors have not yet been determined. "; if (m_badFiles.size() > 0) { msg += "Fix any non-overlapping images and recalculate the image statistics. "; msg += "File(s) without overlaps: "; for (int img = 0; img < m_badFiles.size(); img++) { - msg += " [" + m_badFiles[img] + "] "; + msg += " [" + m_badFiles[img].toStdString() + "] "; } } else { @@ -513,20 +513,20 @@ namespace Isis { FileList outList; fillOutList(outList, toListName); - QString maxCubeStr = toString((int) m_imageList.size()); + QString maxCubeStr = QString::number((int) m_imageList.size()); for (int img = 0; img < m_imageList.size(); img++) { // Set up for progress bar ProcessByLine p; - p.Progress()->SetText("Equalizing Cube " + toString((int) img + 1) + + p.Progress()->SetText("Equalizing Cube " + QString::number((int) img + 1) + " of " + maxCubeStr); // Open input cube CubeAttributeInput att; - const QString inp = m_imageList[img].toString(); + const QString inp = QString::fromStdString(m_imageList[img].toString()); Cube *icube = p.SetInputCube(inp, att); // Allocate output cube - QString out = outList[img].toString(); + QString out = QString::fromStdString(outList[img].toString()); CubeAttributeOutput outAtt; p.SetOutputCube(out, outAtt, icube->sampleCount(), icube->lineCount(), icube->bandCount()); @@ -553,14 +553,14 @@ namespace Isis { // Name and band modifiers for each image for (int img = 0; img < m_imageList.size(); img++) { - results += PvlKeyword("FileName", m_imageList[img].toString().toStdString()); + results += PvlKeyword("FileName", m_imageList[img].toString()); // Band by band statistics for (int band = 1; band <= m_maxBand; band++) { - QString mult = toString(m_adjustments[img]->getGain(band - 1)); - QString base = toString(m_adjustments[img]->getOffset(band - 1)); - QString avg = toString(m_adjustments[img]->getAverage(band - 1)); - QString bandNum = toString(band); + QString mult = QString::number(m_adjustments[img]->getGain(band - 1)); + QString base = QString::number(m_adjustments[img]->getOffset(band - 1)); + QString avg = QString::number(m_adjustments[img]->getAverage(band - 1)); + QString bandNum = QString::number(band); QString bandStr = "Band" + bandNum; PvlKeyword bandStats(bandStr.toStdString()); bandStats += mult.toStdString(); @@ -601,17 +601,17 @@ namespace Isis { */ void Equalization::loadInputs(QString fromListName) { // Get the list of cubes to mosaic - m_imageList.read(fromListName); + m_imageList.read(fromListName.toStdString()); m_maxCube = m_imageList.size(); if (m_imageList.size() < 2) { - QString msg = "The input file [" + fromListName + + std::string msg = "The input file [" + fromListName.toStdString() + "] must contain at least 2 file names"; throw IException(IException::User, msg, _FILEINFO_); } Cube tempCube; - tempCube.open(m_imageList[0].toString()); + tempCube.open(QString::fromStdString(m_imageList[0].toString())); m_maxBand = tempCube.bandCount(); m_doesOverlapList.resize(m_imageList.size(), false); @@ -622,7 +622,7 @@ namespace Isis { void Equalization::setInput(int index, QString value) { - m_imageList[index] = value; + m_imageList[index] = value.toStdString(); } @@ -650,15 +650,15 @@ namespace Isis { void Equalization::errorCheck(QString fromListName) { for (int i = 0; i < m_imageList.size(); i++) { Cube cube1; - cube1.open(m_imageList[i].toString()); + cube1.open(QString::fromStdString(m_imageList[i].toString())); for (int j = (i + 1); j < m_imageList.size(); j++) { Cube cube2; - cube2.open(m_imageList[j].toString()); + cube2.open(QString::fromStdString(m_imageList[j].toString())); // Make sure number of bands match if (m_maxBand != cube2.bandCount()) { - QString msg = "Number of bands do not match between cubes [" + + std::string msg = "Number of bands do not match between cubes [" + m_imageList[i].toString() + "] and [" + m_imageList[j].toString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -669,7 +669,7 @@ namespace Isis { // Test to make sure projection parameters match if (*proj1 != *proj2) { - QString msg = "Mapping groups do not match between cubes [" + + std::string msg = "Mapping groups do not match between cubes [" + m_imageList[i].toString() + "] and [" + m_imageList[j].toString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -684,7 +684,7 @@ namespace Isis { void Equalization::generateOutputs(FileList &outList) { for (int img = 0; img < m_imageList.size(); img++) { FileName file(m_imageList[img]); - QString filename = file.path() + "/" + file.baseName() + + std::string filename = file.path() + "/" + file.baseName() + ".equ." + file.extension(); outList.push_back(FileName(filename)); } @@ -700,11 +700,11 @@ namespace Isis { * fil." */ void Equalization::loadOutputs(FileList &outList, QString toListName) { - outList.read(FileName(toListName)); + outList.read(FileName(toListName.toStdString())); // Make sure each file in the tolist matches a file in the fromlist if (outList.size() != m_imageList.size()) { - QString msg = "Each input file in the FROM LIST must have a "; + std::string msg = "Each input file in the FROM LIST must have a "; msg += "corresponding output file in the TO LIST."; throw IException(IException::User, msg, _FILEINFO_); } @@ -713,7 +713,7 @@ namespace Isis { // corresponding input files for (int i = 0; i < outList.size(); i++) { if (outList[i].toString().compare(m_imageList[i].toString()) == 0) { - QString msg = "The to list file [" + outList[i].toString() + + std::string msg = "The to list file [" + outList[i].toString() + "] has the same name as its corresponding from list file."; throw IException(IException::User, msg, _FILEINFO_); } @@ -805,7 +805,7 @@ namespace Isis { // Make a copy of our image list with names only (instead of full path) QList imgNames; for (int img = 0; img < m_imageList.size(); img++) { - imgNames.append(m_imageList[img].name()); + imgNames.append(QString::fromStdString(m_imageList[img].name())); } // Load in previous user params @@ -861,15 +861,15 @@ namespace Isis { // This means ensuring that each overlap has the X overlap statistics associated with // the X index and the Y overlap statistics associated with the Y index. for (int i = 0; i < m_imageList.size(); i++) { - QString imageName(m_imageList[i].name()); + QString imageName(QString::fromStdString(m_imageList[i].name())); // Always push the X file index to the front (0) - if (oStat->FileNameX() == imageName) + if (oStat->FileNameX() == imageName.toStdString()) //overlapIndices[o].insert(overlapIndices[o].begin(), i); //overlapIndices[o][0] = i; overlapIndices[o].push_front(i); // Always push the Y file index to the back (1) - if (oStat->FileNameY() == imageName) + if (oStat->FileNameY() == imageName.toStdString()) //overlapIndices[o].push_back(i); //overlapIndices[o][1] = i; overlapIndices[o].push_back(i); @@ -961,14 +961,14 @@ namespace Isis { // Make sure each file in the instats matches a file in the fromlist if (m_imageList.size() > equalInfo.groups() - 1) { - QString msg = "Each input file in the FROM LIST must have a "; + std::string msg = "Each input file in the FROM LIST must have a "; msg += "corresponding input file in the INPUT STATISTICS."; throw IException(IException::User, msg, _FILEINFO_); } // Check that each file in the FROM LIST is present in the INPUT STATISTICS for (int i = 0; i < m_imageList.size(); i++) { - QString fromFile = m_imageList[i].original(); + QString fromFile = QString::fromStdString(m_imageList[i].original()); bool foundFile = false; for (int j = 1; j < equalInfo.groups(); j++) { PvlGroup &normalization = equalInfo.group(j); @@ -982,7 +982,7 @@ namespace Isis { } } if (!foundFile) { - QString msg = "The from list file [" + fromFile + + std::string msg = "The from list file [" + fromFile.toStdString() + "] does not have any corresponding file in the stats list."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.cpp b/isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.cpp index ba969599db..bea88cc7a9 100644 --- a/isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.cpp +++ b/isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.cpp @@ -50,7 +50,7 @@ namespace Isis { // Read in the min/max radius of the DEM file and the Scale of the DEM // file in pixels/degree if (!demCube()->hasTable("ShapeModelStatistics")) { - QString msg = "The input cube references a ShapeModel that has " + std::string msg = "The input cube references a ShapeModel that has " "not been updated for the new ray tracing algorithm. All DEM " "files must now be padded at the poles and contain a " "ShapeModelStatistics table defining their minimum and maximum " @@ -61,7 +61,7 @@ namespace Isis { } // Table table("ShapeModelStatistics", demCubeFile(), *demCube()->label())); - Table table("ShapeModelStatistics", demCube()->fileName(), *demCube()->label()); + Table table("ShapeModelStatistics", demCube()->fileName().toStdString(), *demCube()->label()); // Find minimum and maximum radius m_minRadius = new Distance(table[0]["MinimumRadius"], Distance::Kilometers); diff --git a/isis/src/base/objs/EquatorialCylindricalShape/unitTest.cpp b/isis/src/base/objs/EquatorialCylindricalShape/unitTest.cpp index 952e8beb79..51b10d177c 100644 --- a/isis/src/base/objs/EquatorialCylindricalShape/unitTest.cpp +++ b/isis/src/base/objs/EquatorialCylindricalShape/unitTest.cpp @@ -113,7 +113,7 @@ int main() { } catch (IException &e) { cout << endl << endl; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/Equirectangular/Equirectangular.cpp b/isis/src/base/objs/Equirectangular/Equirectangular.cpp index 7be65898ff..0a1689b8c2 100644 --- a/isis/src/base/objs/Equirectangular/Equirectangular.cpp +++ b/isis/src/base/objs/Equirectangular/Equirectangular.cpp @@ -59,7 +59,7 @@ namespace Isis { mapGroup += PvlKeyword("CenterLongitude", std::to_string(lon)); } else { - QString message = "Cannot project using Equirectangular Cylindrical"; + std::string message = "Cannot project using Equirectangular Cylindrical"; message += " without [CenterLongitude] value. Keyword does not exist"; message += " in labels and defaults are not allowed."; throw IException(IException::Unknown, message, _FILEINFO_); @@ -72,7 +72,7 @@ namespace Isis { mapGroup += PvlKeyword("CenterLatitude", std::to_string(lat)); } else { - QString message = "Cannot project using Equirectangular Cylindrical"; + std::string message = "Cannot project using Equirectangular Cylindrical"; message += " without [CenterLatitude] value. Keyword does not exist"; message += " in labels and defaults are not allowed."; throw IException(IException::Unknown, message, _FILEINFO_); @@ -101,13 +101,13 @@ namespace Isis { // we will be dividing with it later on m_cosCenterLatitude = cos(m_centerLatitude); if (fabs(m_cosCenterLatitude) < DBL_EPSILON) { - QString message = "Keyword value for CenterLatitude is " + std::string message = "Keyword value for CenterLatitude is " "too close to the pole"; throw IException(IException::Io, message, _FILEINFO_); } } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/Equirectangular/Equirectangular.h b/isis/src/base/objs/Equirectangular/Equirectangular.h index aedba0c138..e1d1b8216e 100644 --- a/isis/src/base/objs/Equirectangular/Equirectangular.h +++ b/isis/src/base/objs/Equirectangular/Equirectangular.h @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "TProjection.h" +#include namespace Isis { class Pvl; diff --git a/isis/src/base/objs/FileList/FileList.cpp b/isis/src/base/objs/FileList/FileList.cpp index e195b8155f..031dd5992c 100644 --- a/isis/src/base/objs/FileList/FileList.cpp +++ b/isis/src/base/objs/FileList/FileList.cpp @@ -52,9 +52,9 @@ namespace Isis { void FileList::read(FileName listFile) { // Open the file ifstream istm; - istm.open(listFile.toString().toLatin1().data(), std::ios::in); + istm.open(listFile.toString().c_str(), std::ios::in); if(!istm) { - QString message = Isis::Message::FileOpen(listFile.toString()); + std::string message = Isis::Message::FileOpen(listFile.toString()); throw IException(IException::Io, message, _FILEINFO_); } @@ -67,7 +67,7 @@ namespace Isis { } catch (IException &e) { istm.close(); - QString msg = "File [" + listFile.toString() + "] contains no data"; + std::string msg = "File [" + listFile.toString() + "] contains no data"; throw IException(IException::User, msg, _FILEINFO_); } @@ -136,7 +136,7 @@ namespace Isis { s = s.Token(" \n\r\t\v,"); } - this->push_back(s.ToQt()); + this->push_back(s); } } while(!in.eof()); @@ -158,9 +158,9 @@ namespace Isis { void FileList::write(FileName outputFileList) { // Open the file ofstream ostm; - ostm.open(outputFileList.toString().toLatin1().data(), std::ios::out); + ostm.open(outputFileList.toString().c_str(), std::ios::out); if (!ostm) { - QString message = Message::FileOpen(outputFileList.toString()); + std::string message = Message::FileOpen(outputFileList.toString()); throw IException(IException::Io, message, _FILEINFO_); } diff --git a/isis/src/base/objs/FitsToJson/FitsToJson.cpp b/isis/src/base/objs/FitsToJson/FitsToJson.cpp index 651ad902d6..970fb1cea4 100644 --- a/isis/src/base/objs/FitsToJson/FitsToJson.cpp +++ b/isis/src/base/objs/FitsToJson/FitsToJson.cpp @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ #include #include +#include #include "IException.h" #include "IString.h" @@ -162,8 +163,8 @@ namespace Isis { } else { - QString msg = QObject::tr("The FITS file does not contain a section header that appears " - "to describe an image."); + std::string msg = "The FITS file does not contain a section header that appears " + "to describe an image."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -181,11 +182,10 @@ namespace Isis { json fitsToJson(FileName fitsFile) { std::ifstream fileStream; try { - fileStream.open(fitsFile.expanded().toLocal8Bit().constData(), std::ios::in | std::ios::binary); + fileStream.open(fitsFile.expanded().c_str(), std::ios::in | std::ios::binary); } catch (IException &e) { - QString msg = QString("Unable to open FITS formatted file [%1].") - .arg(fitsFile.toString()); + std::string msg = "Unable to open FITS formatted file " + fitsFile.toString() + "."; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/FunctionTools/FunctionTools.h b/isis/src/base/objs/FunctionTools/FunctionTools.h index b6bc02858b..e4c8e00c87 100644 --- a/isis/src/base/objs/FunctionTools/FunctionTools.h +++ b/isis/src/base/objs/FunctionTools/FunctionTools.h @@ -186,7 +186,7 @@ namespace Isis { // check to see if the points bracket a root(s), if the signs are equal they don't if ( (fa > 0) - (fa < 0) == (fb > 0) - (fb < 0) ) { - QString msg = "The function evaluations of two bounding points passed to Brents Method " + std::string msg = "The function evaluations of two bounding points passed to Brents Method " "have the same sign. Therefore, they don't necessary bound a root. No " "root finding will be attempted.\n"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -265,7 +265,7 @@ namespace Isis { try { fbnew = func(bnew + offset); } catch (IException &e) { - QString msg = "Function evaluation failed at:" + toString(bnew) + + std::string msg = "Function evaluation failed at:" + toString(bnew) + ". Function must be continuous and defined for the entire interval " "inorder to gaurentee brentsRootFinder will work."; throw IException(e, IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/base/objs/GisGeometry/GisGeometry.cpp b/isis/src/base/objs/GisGeometry/GisGeometry.cpp index 12a0bca550..ec30aeaea9 100644 --- a/isis/src/base/objs/GisGeometry/GisGeometry.cpp +++ b/isis/src/base/objs/GisGeometry/GisGeometry.cpp @@ -97,8 +97,7 @@ namespace Isis { m_geom = fromCube(cube); } else { - throw IException(IException::Programmer, - QString("Unknown GIS type given [%1]").arg(typeToString(t)), + throw IException(IException::Programmer,"Unknown GIS type given ["+ typeToString(t).toStdString() +"]", _FILEINFO_); } diff --git a/isis/src/base/objs/GisGeometry/unitTest.cpp b/isis/src/base/objs/GisGeometry/unitTest.cpp index 4a654e75cd..65e88cd5a2 100644 --- a/isis/src/base/objs/GisGeometry/unitTest.cpp +++ b/isis/src/base/objs/GisGeometry/unitTest.cpp @@ -262,7 +262,7 @@ int main() { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/GisTopology/GisTopology.cpp b/isis/src/base/objs/GisTopology/GisTopology.cpp index 757c14d3bd..72fe29db7e 100644 --- a/isis/src/base/objs/GisTopology/GisTopology.cpp +++ b/isis/src/base/objs/GisTopology/GisTopology.cpp @@ -108,7 +108,7 @@ namespace Isis { wkb.size()); #endif if (!geom) { - QString mess = "Unable convert the given WKB string [" + wkb + "] to a GEOSGeometry"; + std::string mess = "Unable convert the given WKB string [" + wkb.toStdString() + "] to a GEOSGeometry"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -130,7 +130,7 @@ namespace Isis { const char *footy = wkt_data.data(); GEOSGeometry *geom = GEOSWKTReader_read(wktReader(), footy); if (!geom) { - QString mess = "Unable convert the given WKT string [" + wkt + "] to a GEOSGeometry"; + std::string mess = "Unable convert the given WKT string [" + wkt.toStdString() + "] to a GEOSGeometry"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/GisTopology/unitTest.cpp b/isis/src/base/objs/GisTopology/unitTest.cpp index b112003e58..0435767b7e 100644 --- a/isis/src/base/objs/GisTopology/unitTest.cpp +++ b/isis/src/base/objs/GisTopology/unitTest.cpp @@ -168,7 +168,7 @@ int main() { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } diff --git a/isis/src/base/objs/GroupedStatistics/GroupedStatistics.cpp b/isis/src/base/objs/GroupedStatistics/GroupedStatistics.cpp index 96187d17fb..0763fcdb9c 100644 --- a/isis/src/base/objs/GroupedStatistics/GroupedStatistics.cpp +++ b/isis/src/base/objs/GroupedStatistics/GroupedStatistics.cpp @@ -69,7 +69,7 @@ namespace Isis { i = groupedStats->constFind(statType); if(i == groupedStats->constEnd()) { - QString msg = statType; + std::string msg = statType.toStdString(); msg += " passed to GetStats but does not exist within the map"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Gruen/Gruen.cpp b/isis/src/base/objs/Gruen/Gruen.cpp index 5f19c74b32..46a2b437f2 100644 --- a/isis/src/base/objs/Gruen/Gruen.cpp +++ b/isis/src/base/objs/Gruen/Gruen.cpp @@ -243,8 +243,8 @@ namespace Isis { atai = Cholsl(atai, p, b, x); } catch(IException &ie) { - QString mess = "Cholesky Failed:: " + ie.toString(); - return (logError(CholeskyFailed, mess)); + std::string mess = "Cholesky Failed:: " + ie.toString(); + return (logError(CholeskyFailed, QString::fromStdString(mess))); } // Compute the affine update if result are requested by caller. @@ -268,8 +268,8 @@ namespace Isis { affrad = AffineRadio(alpha); } catch(IException &ie) { - QString mess = "Affine failed: " + ie.toString(); - return (logError(AffineNotInvertable, mess)); + std::string mess = "Affine failed: " + ie.toString(); + return (logError(AffineNotInvertable, QString::fromStdString(mess))); } return (0); @@ -319,8 +319,8 @@ namespace Isis { } } catch(IException &ie) { - QString errmsg = "Eigen Solution Failed:: " + ie.toString(); - results.m_status = logError(EigenSolutionFailed, errmsg); + std::string errmsg = "Eigen Solution Failed:: " + ie.toString(); + results.m_status = logError(EigenSolutionFailed, QString::fromStdString(errmsg)); return (results); } @@ -784,8 +784,8 @@ namespace Isis { affine += alpha; } catch (IException &ie) { - QString mess = "Affine invalid/not invertable"; - matchpt.setStatus(logError(AffineNotInvertable, mess)); + std::string mess = "Affine invalid/not invertable"; + matchpt.setStatus(logError(AffineNotInvertable, QString::fromStdString(mess))); return (Status(matchpt)); // Another error condition to return } } while (!done); diff --git a/isis/src/base/objs/Gui/Gui.cpp b/isis/src/base/objs/Gui/Gui.cpp index 7598336b9c..39f77e7146 100644 --- a/isis/src/base/objs/Gui/Gui.cpp +++ b/isis/src/base/objs/Gui/Gui.cpp @@ -716,7 +716,7 @@ namespace Isis { Preference &p = Preference::Preferences(); PvlGroup &grp = p.findGroup("UserInterface", Isis::Pvl::Traverse); - Isis::FileName progHist(grp["HistoryPath"][0] + "/" + ui.ProgramName() + ".par"); + Isis::FileName progHist(grp["HistoryPath"][0] + "/" + ui.ProgramName().toStdString() + ".par"); if(!progHist.fileExists()) { p_historyEntry = -1; @@ -727,13 +727,13 @@ namespace Isis { Isis::Pvl hist; try { - hist.read(progHist.expanded().toStdString()); + hist.read(progHist.expanded()); } catch(...) { p_historyEntry = -1; - QString msg = "A corrupt parameter history file [" + QString::fromStdString(progHist.expanded()) + + std::string msg = "A corrupt parameter history file [" + progHist.expanded() + "] has been detected. Please fix or remove this file"; - LoadMessage(msg); + LoadMessage(QString::fromStdString(msg)); // When the warning is rejected (i.e. Abort), clean up from within qApp's exec event loop if (ShowWarning()) { qApp->quit(); diff --git a/isis/src/base/objs/Gui/GuiComboBoxParameter.cpp b/isis/src/base/objs/Gui/GuiComboBoxParameter.cpp index 1557495797..1bb574e9f8 100644 --- a/isis/src/base/objs/Gui/GuiComboBoxParameter.cpp +++ b/isis/src/base/objs/Gui/GuiComboBoxParameter.cpp @@ -54,12 +54,12 @@ namespace Isis { void GuiComboBoxParameter::Set(QString newValue) { - IString value = newValue; + IString value = newValue.toStdString(); value.UpCase(); int foundAtButton = -1; for(int i = 0; i < p_ui->ParamListSize(p_group, p_param); i++) { - IString option = p_ui->ParamListValue(p_group, p_param, i); + IString option = p_ui->ParamListValue(p_group, p_param, i).toStdString(); option.UpCase(); //if(option.compare(0, value.size(), value) == 0) foundAtButton = i; if(option == value) foundAtButton = i; diff --git a/isis/src/base/objs/Gui/GuiCubeParameter.cpp b/isis/src/base/objs/Gui/GuiCubeParameter.cpp index 8f42af672d..054197c59e 100644 --- a/isis/src/base/objs/Gui/GuiCubeParameter.cpp +++ b/isis/src/base/objs/Gui/GuiCubeParameter.cpp @@ -89,21 +89,21 @@ namespace Isis { */ void GuiCubeParameter::SelectAttribute() { if(p_ui->ParamFileMode(p_group, p_param) == "input") { - Isis::CubeAttributeInput att(p_lineEdit->text()); + Isis::CubeAttributeInput att(FileName(p_lineEdit->text().toStdString())); QString curAtt = att.toString(); QString newAtt; int status = GuiInputAttribute::GetAttributes(curAtt, newAtt, p_ui->ParamName(p_group, p_param), p_fileButton); if((status == 1) && (curAtt != newAtt)) { - Isis::FileName f(p_lineEdit->text()); - p_lineEdit->setText(f.expanded() + newAtt); + Isis::FileName f(p_lineEdit->text().toStdString()); + p_lineEdit->setText(QString::fromStdString(f.expanded()) + newAtt); } } else { - Isis::CubeAttributeOutput att("+" + p_ui->PixelType(p_group, p_param)); + Isis::CubeAttributeOutput att("+" + p_ui->PixelType(p_group, p_param).toStdString()); bool allowProp = att.propagatePixelType(); - att.addAttributes(FileName(p_lineEdit->text())); + att.addAttributes(FileName(p_lineEdit->text().toStdString())); QString curAtt = att.toString(); QString newAtt; @@ -112,8 +112,8 @@ namespace Isis { allowProp, p_fileButton); if((status == 1) && (curAtt != newAtt)) { - Isis::FileName f(p_lineEdit->text()); - p_lineEdit->setText(f.expanded() + newAtt); + Isis::FileName f(p_lineEdit->text().toStdString()); + p_lineEdit->setText(QString::fromStdString(f.expanded()) + newAtt); } } @@ -141,7 +141,7 @@ namespace Isis { } // Throw an error if no cube name was entered else { - QString msg = "You must enter a cube name to open"; + std::string msg = "You must enter a cube name to open"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -173,7 +173,7 @@ namespace Isis { } else { - QString msg = "You must enter a cube name to open"; + std::string msg = "You must enter a cube name to open"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/Gui/GuiFilenameParameter.cpp b/isis/src/base/objs/Gui/GuiFilenameParameter.cpp index c7e918d675..e05094c6c2 100644 --- a/isis/src/base/objs/Gui/GuiFilenameParameter.cpp +++ b/isis/src/base/objs/Gui/GuiFilenameParameter.cpp @@ -35,7 +35,7 @@ namespace Isis { grid->addWidget(p_fileButton, param, 3); QAction *action = new QAction(this); - QString file = FileName("$ISISROOT/appdata/images/icons/view_tree.png").expanded(); + QString file = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/view_tree.png").expanded()); action->setIcon(QPixmap(file)); connect(action, SIGNAL(triggered(bool)), this, SLOT(SelectFile())); @@ -107,12 +107,12 @@ namespace Isis { QString dir; if((p_lineEdit->text().length() > 0) && (p_lineEdit->text() != p_ui->ParamInternalDefault(p_group, p_param))) { - Isis::FileName fname(p_lineEdit->text()); - dir = fname.expanded(); + Isis::FileName fname(p_lineEdit->text().toStdString()); + dir = QString::fromStdString(fname.expanded()); } else if(p_ui->ParamPath(p_group, p_param).length() > 0) { - Isis::FileName fname(p_ui->ParamPath(p_group, p_param)); - dir = fname.expanded(); + Isis::FileName fname(p_ui->ParamPath(p_group, p_param).toStdString()); + dir = QString::fromStdString(fname.expanded()); } // Set up the filter @@ -143,9 +143,9 @@ namespace Isis { fnameQString = QFileDialog::getSaveFileName(p_fileButton, "Select file", dir, filter, 0, options); } if(fnameQString != "") { - Isis::FileName fname(fnameQString); - if(fname.dir() == QDir::currentPath()) { - fnameQString = fname.name(); + Isis::FileName fname(fnameQString.toStdString()); + if(fname.dir() == std::filesystem::current_path()) { + fnameQString = QString::fromStdString(fname.name()); } Set(fnameQString); } diff --git a/isis/src/base/objs/Gui/GuiInputAttribute.cpp b/isis/src/base/objs/Gui/GuiInputAttribute.cpp index 7e6872800d..1ad4a01d4b 100644 --- a/isis/src/base/objs/Gui/GuiInputAttribute.cpp +++ b/isis/src/base/objs/Gui/GuiInputAttribute.cpp @@ -115,7 +115,7 @@ namespace Isis { // Set the attributes in the dialog void GuiInputAttribute::SetAttributes(const QString &value) { - Isis::CubeAttributeInput att(value); + Isis::CubeAttributeInput att(value.toStdString()); std::vector bands = att.bands(); if(bands.size() == 0) { p_buttonGroup->buttons()[0]->setChecked(true); diff --git a/isis/src/base/objs/Gui/GuiOutputAttribute.cpp b/isis/src/base/objs/Gui/GuiOutputAttribute.cpp index cff2ed9119..aeb5dc0fb0 100644 --- a/isis/src/base/objs/Gui/GuiOutputAttribute.cpp +++ b/isis/src/base/objs/Gui/GuiOutputAttribute.cpp @@ -222,14 +222,14 @@ namespace Isis { } } - Isis::CubeAttributeOutput catt(att); + Isis::CubeAttributeOutput catt(att.toStdString()); QString s = catt.toString(); return s; } // Set the attributes in the dialog void GuiOutputAttribute::SetAttributes(const QString &value) { - Isis::CubeAttributeOutput att(value); + Isis::CubeAttributeOutput att(value.toStdString()); if(att.fileFormat() == Cube::Tile) { p_tiled->setChecked(true); } diff --git a/isis/src/base/objs/Gui/GuiParameter.cpp b/isis/src/base/objs/Gui/GuiParameter.cpp index 29b11168da..4c0461e368 100644 --- a/isis/src/base/objs/Gui/GuiParameter.cpp +++ b/isis/src/base/objs/Gui/GuiParameter.cpp @@ -248,8 +248,8 @@ namespace Isis { GuiHelperAction *action = new GuiHelperAction(lo, p_ui->HelperFunction(p_group, p_param, 0)); if(p_ui->HelperIcon(p_group, p_param, 0) != "") { - QString file = FileName( - p_ui->HelperIcon(p_group, p_param, 0)).expanded(); + QString file = QString::fromStdString(FileName( + p_ui->HelperIcon(p_group, p_param, 0).toStdString()).expanded()); action->setIcon(QIcon(QPixmap(file))); } else { @@ -268,8 +268,8 @@ namespace Isis { if(p_ui->HelperIcon(p_group, p_param, 0) != "") { helper->setText(""); - QString file = FileName( - p_ui->HelperIcon(p_group, p_param, 0)).expanded(); + QString file = QString::fromStdString(FileName( + p_ui->HelperIcon(p_group, p_param, 0).toStdString()).expanded()); helper->setIconSize(QSize(22, 22)); helper->setIcon(QIcon(QPixmap(file))); } @@ -295,8 +295,8 @@ namespace Isis { GuiHelperAction *action = new GuiHelperAction(lo, p_ui->HelperFunction(p_group, p_param, 0)); if(p_ui->HelperIcon(p_group, p_param, 0) != "") { - QString file = FileName( - p_ui->HelperIcon(p_group, p_param, 0)).expanded(); + QString file = QString::fromStdString(FileName( + p_ui->HelperIcon(p_group, p_param, 0).toStdString()).expanded()); action->setIcon(QIcon(QPixmap(file))); } else { @@ -320,8 +320,8 @@ namespace Isis { if(p_ui->HelperIcon(p_group, p_param, 0) != "") { helper->setText(""); - QString file = FileName( - p_ui->HelperIcon(p_group, p_param, 0)).expanded(); + QString file = QString::fromStdString(FileName( + p_ui->HelperIcon(p_group, p_param, 0).toStdString()).expanded()); helper->setIconSize(QSize(22, 22)); helper->setIcon(QIcon(QPixmap(file))); } diff --git a/isis/src/base/objs/Gui/GuiParameterFactory.cpp b/isis/src/base/objs/Gui/GuiParameterFactory.cpp index a931a59733..a04415c958 100644 --- a/isis/src/base/objs/Gui/GuiParameterFactory.cpp +++ b/isis/src/base/objs/Gui/GuiParameterFactory.cpp @@ -49,7 +49,7 @@ namespace Isis { p = new GuiBooleanParameter(grid, ui, group, param); } else { - QString msg = "Invalid parameter type in XML [" + paramType + "]"; + std::string msg = "Invalid parameter type in XML [" + paramType.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Hapke/Hapke.cpp b/isis/src/base/objs/Hapke/Hapke.cpp index 652c9a1074..2aee586faa 100644 --- a/isis/src/base/objs/Hapke/Hapke.cpp +++ b/isis/src/base/objs/Hapke/Hapke.cpp @@ -421,7 +421,7 @@ namespace Isis { * @param b0standard Hapke opposition surge initialization, default is true */ void Hapke::SetPhoto0B0Standard(const QString &b0standard) { - IString temp(b0standard); + IString temp(b0standard.toStdString()); temp = temp.UpCase(); if(temp != "NO" && temp != "YES" && temp != "FALSE" && temp != "TRUE") { diff --git a/isis/src/base/objs/Hillshade/Hillshade.cpp b/isis/src/base/objs/Hillshade/Hillshade.cpp index a37b31b977..31db3911eb 100644 --- a/isis/src/base/objs/Hillshade/Hillshade.cpp +++ b/isis/src/base/objs/Hillshade/Hillshade.cpp @@ -164,53 +164,37 @@ namespace Isis { if (input.SampleDimension() != 3 || input.LineDimension() != 3 || input.BandDimension() != 1) { - throw IException(IException::Programmer, - QObject::tr("Hillshade requires a 3x3x1 portal of data, but a %1x%2x%3 " - "portal of data was provided instead") - .arg(input.SampleDimension()).arg(input.LineDimension()) - .arg(input.BandDimension()), + throw IException(IException::Programmer,"Hillshade requires a 3x3x1 portal of data, but a " + std::to_string(input.SampleDimension()) + "x" + std::to_string(input.LineDimension()) + "x" + std::to_string(input.BandDimension()) + " portal of data was provided instead", _FILEINFO_); } if (!m_azimuth) { - throw IException(IException::Unknown, - QObject::tr("Hillshade requires a valid azimuth angle (sun direction) to " - "operate"), + throw IException(IException::Unknown,"Hillshade requires a valid azimuth angle (sun direction) to operate", _FILEINFO_); } if (*m_azimuth < Angle(0, Angle::Degrees) || *m_azimuth > Angle::fullRotation()) { - throw IException(IException::Unknown, - QObject::tr("Hillshade azimuth angle [%1] must be between 0 and 360 degrees") - .arg(m_azimuth->toString()), + throw IException(IException::Unknown,"Hillshade azimuth angle [" + m_azimuth->toString().toStdString() + "] must be between 0 and 360 degrees", _FILEINFO_); } if (!m_zenith) { - throw IException(IException::Unknown, - QObject::tr("Hillshade requires a valid zenith angle (solar elevation) to " - "operate"), + throw IException(IException::Unknown,"Hillshade requires a valid zenith angle (solar elevation) to operate", _FILEINFO_); } if (*m_zenith < Angle(0, Angle::Degrees) || *m_zenith > Angle(90, Angle::Degrees)) { - throw IException(IException::Unknown, - QObject::tr("Hillshade zenith angle [%1] must be between 0 and 90 degrees") - .arg(m_zenith->toString()), + throw IException(IException::Unknown,"Hillshade zenith angle [" + m_zenith->toString().toStdString() + "] must be between 0 and 90 degrees", _FILEINFO_); } if (IsSpecial(m_pixelResolution)) { - throw IException(IException::Unknown, - QObject::tr("Hillshade requires a pixel resolution (meters/pixel) to " - "operate"), + throw IException(IException::Unknown,"Hillshade requires a pixel resolution (meters/pixel) to operate", _FILEINFO_); } if (qFuzzyCompare(0.0, m_pixelResolution)) { - throw IException(IException::Unknown, - QObject::tr("Hillshade requires a non-zero pixel resolution (meters/pixel) " - "to operate"), + throw IException(IException::Unknown, "Hillshade requires a non-zero pixel resolution (meters/pixel) to operate", _FILEINFO_); } @@ -314,7 +298,7 @@ namespace Isis { QString resolution = "Null"; if (!IsSpecial(hillshade.resolution())) - resolution = toString(hillshade.resolution()); + resolution = QString::number(hillshade.resolution()); debug << "Hillshade[ azimuth =" << hillshade.azimuth().toString().toLatin1().data() << "zenith =" << hillshade.zenith().toString().toLatin1().data() diff --git a/isis/src/base/objs/History/History.cpp b/isis/src/base/objs/History/History.cpp index 0ba8faf3e7..da4cadb336 100644 --- a/isis/src/base/objs/History/History.cpp +++ b/isis/src/base/objs/History/History.cpp @@ -89,7 +89,7 @@ namespace Isis { const char *ptr = histStr.c_str(); memcpy(&blobBuffer[p_bufferSize], (void *)ptr, bytes); - Blob newBlob(name, "History"); + Blob newBlob(name.toStdString(), "History"); newBlob.takeData(blobBuffer, blobBufferSize); return newBlob; } diff --git a/isis/src/base/objs/History/History.h b/isis/src/base/objs/History/History.h index 4a085c2d15..a58762ef09 100644 --- a/isis/src/base/objs/History/History.h +++ b/isis/src/base/objs/History/History.h @@ -10,6 +10,7 @@ find files of those names at the top level of this repository. **/ #include "Blob.h" #include "Pvl.h" +#include namespace Isis { class PvlObject; diff --git a/isis/src/base/objs/ID/ID.cpp b/isis/src/base/objs/ID/ID.cpp index 856064b735..c6db6b22a4 100644 --- a/isis/src/base/objs/ID/ID.cpp +++ b/isis/src/base/objs/ID/ID.cpp @@ -23,7 +23,7 @@ namespace Isis { p_current = basenum; p_namebase = name; if(!p_namebase.contains("?")) { - QString msg = "No replacement set in string [" + p_namebase + "]"; + std::string msg = "No replacement set in string [" + p_namebase.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } p_numStart = ((int) p_namebase.indexOf("?", 0)); @@ -32,7 +32,7 @@ namespace Isis { QString sub = p_namebase.mid(p_numStart, p_numLength); for(int i = 0; i < (int)sub.length(); i++) { if(sub[i] != '?') { - QString msg = "IString [" + p_namebase + "] contains more than one replacement set"; + std::string msg = "IString [" + p_namebase.toStdString() + "] contains more than one replacement set"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -59,7 +59,7 @@ namespace Isis { } QString original = p_namebase; original.insert(p_numStart, replacement); - QString msg = "Maximum number reached for string [" + original + "]"; + std::string msg = "Maximum number reached for string [" + original.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } while((int)num.size() < p_numLength) { diff --git a/isis/src/base/objs/ImageExporter/ImageExporter.cpp b/isis/src/base/objs/ImageExporter/ImageExporter.cpp index 21bef787e7..8be5510f8e 100644 --- a/isis/src/base/objs/ImageExporter/ImageExporter.cpp +++ b/isis/src/base/objs/ImageExporter/ImageExporter.cpp @@ -113,7 +113,7 @@ namespace Isis { } p.ProcessCubes(*this); - outputName = outputName.addExtension(m_extension); + outputName = outputName.addExtension(m_extension.toStdString()); createWorldFile(outputName); } @@ -265,7 +265,7 @@ namespace Isis { break; default: throw IException(IException::Programmer, - "Cannot export an image with [" + QString(m_exportDescription->channelCount()) + + "Cannot export an image with [" + std::to_string(m_exportDescription->channelCount()) + "] channels", _FILEINFO_); } @@ -356,7 +356,7 @@ namespace Isis { ProcessExport &p = process(); const ExportDescription::ChannelDescription &channel = m_exportDescription->channel(i); - Cube *cube = p.SetInputCube(channel.filename().expanded(), channel.attributes(), Isis::OneBand); + Cube *cube = p.SetInputCube(QString::fromStdString(channel.filename().expanded()), channel.attributes(), Isis::OneBand); if (channel.hasCustomRange()) p.SetInputRange(channel.inputMinimum(), channel.inputMaximum(), i); @@ -372,10 +372,10 @@ namespace Isis { */ void ImageExporter::createWorldFile(FileName outputName) { outputName = outputName.removeExtension(); - outputName = outputName.addExtension(m_worldExtension); + outputName = outputName.addExtension(m_worldExtension.toStdString()); ProcessExport &p = process(); - p.CreateWorldFile(outputName.expanded()); + p.CreateWorldFile(QString::fromStdString(outputName.expanded())); p.EndProcess(); } @@ -411,7 +411,7 @@ namespace Isis { } else { throw IException(IException::Programmer, - "Cannot export image as format [" + format + "]", + "Cannot export image as format [" + format.toStdString() + "]", _FILEINFO_); } diff --git a/isis/src/base/objs/ImageImporter/ImageImporter.cpp b/isis/src/base/objs/ImageImporter/ImageImporter.cpp index a314619fef..216947dc20 100644 --- a/isis/src/base/objs/ImageImporter/ImageImporter.cpp +++ b/isis/src/base/objs/ImageImporter/ImageImporter.cpp @@ -180,7 +180,7 @@ namespace Isis { FileName outputName, CubeAttributeOutput &att) { m_outCube->setDimensions(samples(), lines(), bands()); - m_outCube->create(outputName.expanded(), att); + m_outCube->create(QString::fromStdString(outputName.expanded()), att); return m_outCube; } @@ -420,14 +420,14 @@ namespace Isis { ImageImporter * ImageImporter::fromFileName(FileName inputName) { ImageImporter *importer = NULL; - QString format = QImageReader::imageFormat(inputName.expanded()); + QString format = QImageReader::imageFormat(QString::fromStdString(inputName.expanded())); if (format == "tiff") { importer = new TiffImporter(inputName); } else if (format != "" && format != "jp2") { importer = new QtImporter(inputName); } - else if (JP2Decoder::IsJP2(inputName.expanded().toLatin1().data())) { + else if (JP2Decoder::IsJP2(inputName.expanded().c_str())) { importer = new JP2Importer(inputName); } else { diff --git a/isis/src/base/objs/ImageOverlap/ImageOverlap.cpp b/isis/src/base/objs/ImageOverlap/ImageOverlap.cpp index ffbc7a96bc..d8faf048a7 100644 --- a/isis/src/base/objs/ImageOverlap/ImageOverlap.cpp +++ b/isis/src/base/objs/ImageOverlap/ImageOverlap.cpp @@ -6,6 +6,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include #include +#include #include "geos/io/WKBReader.h" #include "geos/io/WKBWriter.h" @@ -140,7 +141,7 @@ namespace Isis { serialNums += "\n"; - outputStream << serialNums; + outputStream << serialNums.toStdString(); geosWriter.writeHEX(*p_polygon, outputStream); } @@ -156,8 +157,8 @@ namespace Isis { void ImageOverlap::Add(QString &sn) { for(unsigned int s = 0; s < p_serialNumbers.size(); ++s) { if(sn == p_serialNumbers[s]) { - QString msg = "Duplicate SN added to [" + - QString::fromStdString(p_polygon->toString()) + "]"; + std::string msg = "Duplicate SN added to [" + + p_polygon->toString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp index 85f2bed612..286c5653c1 100644 --- a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp +++ b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp @@ -86,8 +86,8 @@ namespace Isis { cube.open(sns.fileName(i)); } catch (IException &error) { - QString msg = "Unable to open cube for serial number ["; - msg += sns.serialNumber(i) + "] filename [" + sns.fileName(i) + "]"; + std::string msg = "Unable to open cube for serial number ["; + msg += sns.serialNumber(i).toStdString() + "] filename [" + sns.fileName(i).toStdString() + "]"; HandleError(error, &sns, msg); } @@ -105,7 +105,7 @@ namespace Isis { if(!tmp->isValid()) { delete tmp; tmp = NULL; - QString msg = "The image [" + sns.fileName(sns.serialNumber(i)) + + std::string msg = "The image [" + sns.fileName(sns.serialNumber(i)).toStdString() + "] has an invalid footprint"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -328,7 +328,7 @@ namespace Isis { */ void ImageOverlapSet::ReadImageOverlaps(const QString &filename) { - QString file = FileName(filename).expanded(); + QString file = QString::fromStdString(FileName(filename.toStdString()).expanded()); try { // Let's get an istream pointed at our file @@ -346,13 +346,13 @@ namespace Isis { } catch (IException &e) { p_lonLatOverlapsMutex.unlock(); - QString msg = "The overlap file [" + filename + "] does not contain a " + std::string msg = "The overlap file [" + filename.toStdString() + "] does not contain a " "valid list of image overlaps"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } catch (...) { p_lonLatOverlapsMutex.unlock(); - QString msg = "The overlap file [" + filename + "] does not contain a " + std::string msg = "The overlap file [" + filename.toStdString() + "] does not contain a " "valid list of image overlaps"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -446,7 +446,7 @@ namespace Isis { */ void ImageOverlapSet::WriteImageOverlaps(const QString &filename) { - QString file = FileName(filename).expanded(); + QString file = QString::fromStdString(FileName(filename.toStdString()).expanded()); bool failed = false; bool noOverlaps = false; @@ -519,13 +519,13 @@ namespace Isis { if (failed) { p_calculatePolygonMutex.tryLock(); p_calculatePolygonMutex.unlock(); - QString msg = "Unable to write the image overlap list to [" + filename + "]"; + std::string msg = "Unable to write the image overlap list to [" + filename.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } else if (noOverlaps) { p_calculatePolygonMutex.tryLock(); p_calculatePolygonMutex.unlock(); - QString msg = "No overlaps were found."; + std::string msg = "No overlaps were found."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -598,7 +598,7 @@ namespace Isis { } catch (IException &e) { intersected = NULL; - QString error = "Intersection of overlaps failed."; + std::string error = "Intersection of overlaps failed."; // We never want to double seed, so we must delete one or both // of these polygons because they more than likely have an intersection @@ -885,7 +885,7 @@ namespace Isis { */ void ImageOverlapSet::HandleError(IException &e, SerialNumberList *snlist, - QString msg, + std::string msg, int overlap1, int overlap2) { PvlGroup err("ImageOverlapError"); @@ -939,8 +939,8 @@ namespace Isis { err += PvlKeyword("Error", e.what()); - if (!msg.isEmpty()) { - err += PvlKeyword("Description", msg.toStdString()); + if (!msg.empty()) { + err += PvlKeyword("Description", msg); } p_errorLog.push_back(err); @@ -961,7 +961,7 @@ namespace Isis { */ void ImageOverlapSet::HandleError(geos::util::GEOSException *exc, SerialNumberList *snlist, - QString msg, + std::string msg, int overlap1, int overlap2) { PvlGroup err("ImageOverlapError"); @@ -1007,8 +1007,8 @@ namespace Isis { err += PvlKeyword("Error", exc->what()); - if (!msg.isEmpty()) { - err += PvlKeyword("Description", msg.toStdString()); + if (!msg.empty()) { + err += PvlKeyword("Description", msg); } p_errorLog.push_back(err); @@ -1031,7 +1031,7 @@ namespace Isis { * @param overlap2 Second problematic overlap */ void ImageOverlapSet::HandleError(SerialNumberList *snlist, - QString msg, + std::string msg, int overlap1, int overlap2) { PvlGroup err("ImageOverlapError"); @@ -1075,7 +1075,7 @@ namespace Isis { } } - err += PvlKeyword("Description", msg.toStdString()); + err += PvlKeyword("Description", msg); p_errorLog.push_back(err); diff --git a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.h b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.h index 19c1606ab4..bb5d797e4c 100644 --- a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.h +++ b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.h @@ -143,9 +143,9 @@ namespace Isis { geos::geom::MultiPolygon *lonLatPolygon); bool SetPolygon(geos::geom::Geometry *poly, int position, ImageOverlap *sncopy = NULL, bool insert = false); - void HandleError(IException &e, SerialNumberList *snlist, QString msg = "", int overlap1 = -1, int overlap2 = -1); - void HandleError(geos::util::GEOSException *exc, SerialNumberList *snlist, QString msg = "", int overlap1 = -1, int overlap2 = -1); - void HandleError(SerialNumberList *snlist, QString msg, int overlap1 = -1, int overlap2 = -1); + void HandleError(IException &e, SerialNumberList *snlist, std::string msg = "", int overlap1 = -1, int overlap2 = -1); + void HandleError(geos::util::GEOSException *exc, SerialNumberList *snlist, std::string msg = "", int overlap1 = -1, int overlap2 = -1); + void HandleError(SerialNumberList *snlist, std::string msg, int overlap1 = -1, int overlap2 = -1); bool p_continueAfterError; //!< If false iExceptions will be thrown from FindImageOverlaps(...) bool p_threadedCalculate; //!< True if we want to do calculations in a threaded way diff --git a/isis/src/base/objs/ImagePolygon/ImagePolygon.cpp b/isis/src/base/objs/ImagePolygon/ImagePolygon.cpp index 49dddecbf6..8160cefb63 100644 --- a/isis/src/base/objs/ImagePolygon/ImagePolygon.cpp +++ b/isis/src/base/objs/ImagePolygon/ImagePolygon.cpp @@ -136,8 +136,8 @@ namespace Isis { p_isProjected = true; } catch(IException &projError) { - QString msg = "Can not create polygon, "; - msg += "cube [" + cube.fileName(); + std::string msg = "Can not create polygon, "; + msg += "cube [" + cube.fileName().toStdString(); msg += "] is not a camera or map projection"; IException polyError(IException::User, msg, _FILEINFO_); @@ -250,8 +250,8 @@ namespace Isis { } else { e.print(); // This should be a NAIF error - QString msg = "Cannot find polygon for image " - "[" + cube.fileName() + "]: "; + std::string msg = "Cannot find polygon for image " + "[" + cube.fileName().toStdString() + "]: "; msg += increasePrecision ? "Cannot increase precision any further" : "The increment/step size might be too large"; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp b/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp index ce0d95f832..9bc2805c56 100644 --- a/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp +++ b/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp @@ -140,9 +140,9 @@ namespace Isis { // Vet the table filename. Many PDS files record the filename in // uppercase and in practice, the filename is in lowercase. Do this // check here. - FileName tableFile(tempTblFile); + FileName tableFile(tempTblFile.toStdString()); try { - int tableStartRecord = toInt(tableFile.baseName()); + int tableStartRecord = std::stoi(tableFile.baseName()); tempTblFile = pdsLabFile; m_pdsTableStart = tableStartRecord; } @@ -151,8 +151,10 @@ namespace Isis { // file name, not a location in the label file. if (!tableFile.fileExists()) { // if the table file name doesn't exist, try lowercased version... + std::string tableFileLower = tableFile.name(); + std::transform(tableFileLower.begin(), tableFileLower.end(), tableFileLower.begin(), ::tolower); FileName tableFileLowercase(tableFile.path() + "/" - + tableFile.name().toLower()); + + tableFileLower); if (!tableFileLowercase.fileExists()) { IString msg = "Unable to import PDS table. Neither of the following " "possible table files were found: [" @@ -161,7 +163,7 @@ namespace Isis { throw IException(e, IException::Unknown, msg, _FILEINFO_); } tableFile = tableFileLowercase.expanded(); - tempTblFile = tableFile.expanded(); + tempTblFile = QString::fromStdString(tableFile.expanded()); } m_pdsTableStart = 1; } @@ -211,11 +213,11 @@ namespace Isis { QString ImportPdsTable::getColumnName(const unsigned int &index, const bool &formatted) const { if ((int) index >= columns() - 1) { - QString msg = "Unable to import the binary PDS table [" + m_tableName + std::string msg = "Unable to import the binary PDS table [" + m_tableName.toStdString() + "] into Isis. The requested column index [" - + toString((int) index) + "] exceeds the last column index [" - + toString(columns() - 1) + "]"; - throw IException(IException::Programmer, msg.toStdString(), _FILEINFO_); + + std::to_string((int) index) + "] exceeds the last column index [" + + std::to_string(columns() - 1) + "]"; + throw IException(IException::Programmer, msg, _FILEINFO_); } QString name = m_coldesc[index].m_name; if (formatted) name = getFormattedName(name); @@ -323,9 +325,9 @@ namespace Isis { return (table); } catch (IException &e) { - QString msg = "Unable to import the PDS table [" + m_tableName - + "] from the PDS file [" + m_pdsTableFile + "] into Isis."; - throw IException(e, IException::Unknown, msg.toStdString(), _FILEINFO_); + std::string msg = "Unable to import the PDS table [" + m_tableName.toStdString() + + "] from the PDS file [" + m_pdsTableFile.toStdString() + "] into Isis."; + throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -376,11 +378,11 @@ namespace Isis { for (int i = 0 ; i < colnames.size() ; i++) { const ColumnDescr *descr = findColumn(colnames[i]); if (!descr) { - QString msg = "Unable to import the PDS table [" + m_tableName + std::string msg = "Unable to import the PDS table [" + m_tableName.toStdString() + "] into Isis. The requested column name [" - + colnames[i] + "] does not " + + colnames[i].toStdString() + "] does not " "exist in table."; - throw IException(IException::Programmer, msg.toStdString(), _FILEINFO_); + throw IException(IException::Programmer, msg, _FILEINFO_); } ctypes.push_back(*descr); } @@ -443,10 +445,10 @@ namespace Isis { QString tableName = ( tblname.isEmpty() ) ? m_tableName : tblname; if (!label.hasObject(tableName.toStdString())) { - QString msg = "The PDS file " + pdsLabFile + + std::string msg = "The PDS file " + pdsLabFile.toStdString() + " does not have the required TABLE object, [" - + tableName +"]. The PDS label file is probably invalid"; - throw IException(IException::Unknown, msg.toStdString(), _FILEINFO_); + + tableName.toStdString() +"]. The PDS label file is probably invalid"; + throw IException(IException::Unknown, msg, _FILEINFO_); } // Get some pertinent information from the label PvlObject &tabObj = label.findObject(tableName.toStdString()); @@ -470,25 +472,25 @@ namespace Isis { PvlObject *tableDetails = &tabObj; if (label.hasKeyword(("^" + tableName).toStdString())) { trueTableName = tableName; - pdsTableFile = FileName(pdsLabFile).path() + "/" - + QString::fromStdString(label[("^" + tableName).toStdString()][0]); + pdsTableFile = QString::fromStdString(FileName(pdsLabFile.toStdString()).path() + "/" + + label[("^" + tableName.toStdString())][0]); } else if (tabObj.objects() == 1) { trueTableName = QString::fromStdString(tabObj.object(0).name()); tableDetails = &tabObj.object(0); - pdsTableFile = FileName(pdsLabFile).path() + "/" - + QString::fromStdString(tabObj[("^" + trueTableName).toStdString()][0]); + pdsTableFile = QString::fromStdString(FileName(pdsLabFile.toStdString()).path() + "/" + + tabObj[("^" + trueTableName.toStdString())][0]); } m_trows = (int) tableDetails->findKeyword("ROWS"); int ncols = (int) tableDetails->findKeyword("COLUMNS"); m_pdsTableType = QString::fromStdString(tableDetails->findKeyword("INTERCHANGE_FORMAT")); if (m_pdsTableType != "ASCII" && m_pdsTableType.toUpper() != "BINARY") { - QString msg = "Unable to import the PDS table [" + tableName + std::string msg = "Unable to import the PDS table [" + tableName.toStdString() + "] from the PDS file [" - + pdsTableFile + "] into Isis. " - "The PDS INTERCHANGE_FORMAT [" + m_pdsTableType + + pdsTableFile.toStdString() + "] into Isis. " + "The PDS INTERCHANGE_FORMAT [" + m_pdsTableType.toStdString() + "] is not supported. Valid values are ASCII or BINARY."; - throw IException(IException::User, msg.toStdString(), _FILEINFO_); + throw IException(IException::User, msg, _FILEINFO_); } m_rowBytes = tableDetails->findKeyword("ROW_BYTES"); @@ -615,8 +617,8 @@ namespace Isis { // Ensure the nrequested column is valid if ( (nth >= columns()) || ( nth < 0) ) { - QString mess = "Index (" + QString::number(nth) + - ") into Columns invalid (max: " + QString::number(columns()) + ")"; + std::string mess = "Index (" + std::to_string(nth) + + ") into Columns invalid (max: " + std::to_string(columns()) + ")"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -884,7 +886,7 @@ namespace Isis { TableField &tfield) const { int ith = cdesc.m_colnum; try { - IString data(cols[ith]); + IString data(cols[ith].toStdString()); if (tfield.isInteger()) { data.Trim(" \t\r\n"); tfield = data.ToInteger(); @@ -895,12 +897,12 @@ namespace Isis { } else { // Its a text field QString str(tfield.size(), ' '); - str.insert(0, data.Trim(" \t\r\n").ToQt()); + str.insert(0, QString::fromStdString(data.Trim(" \t\r\n"))); tfield = str.toStdString(); } } catch (IException &e) { - QString msg = "Conversion failure of column " + cdesc.m_name; + std::string msg = "Conversion failure of column " + cdesc.m_name.toStdString(); throw IException(e, IException::Programmer, msg, _FILEINFO_); } @@ -956,7 +958,7 @@ namespace Isis { table += extract(m_rows[i], cols, record); } catch (IException &e) { - QString msg = "Failed to convert data in row [" + toString((int) i) + "]"; + std::string msg = "Failed to convert data in row [" + std::to_string((int) i) + "]"; throw IException(e, IException::Programmer, msg, _FILEINFO_); } } @@ -968,7 +970,7 @@ namespace Isis { if (!pdsFileStream) { IString msg = "Unable to open file containing PDS table [" - + tempTblFile + "]."; + + tempTblFile.toStdString() + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -1106,10 +1108,10 @@ namespace Isis { if (dataType == "MSB_INTEGER" || dataType == "INTEGER" || dataType == "SUN_INTEGER" || dataType == "MAC_INTEGER") { if (cdesc.m_numBytes != 4) { - QString msg = "Only 4 byte integer values are supported in Isis. " - "PDS Column [" + cdesc.m_name + std::string msg = "Only 4 byte integer values are supported in Isis. " + "PDS Column [" + cdesc.m_name.toStdString() + "] has an integer DATA_TYPE with [BYTES = " - + toString(cdesc.m_numBytes) + "]."; + + std::to_string(cdesc.m_numBytes) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } setPdsByteOrder("MSB"); @@ -1118,10 +1120,10 @@ namespace Isis { else if (dataType == "LSB_INTEGER" || dataType == "VAX_INTEGER" || dataType == "PC_INTEGER" ) { if (cdesc.m_numBytes != 4) { - QString msg = "Only 4 byte integer values are supported in Isis. " - "PDS Column [" + cdesc.m_name + std::string msg = "Only 4 byte integer values are supported in Isis. " + "PDS Column [" + cdesc.m_name.toStdString() + "] has an integer DATA_TYPE with [BYTES = " - + toString(cdesc.m_numBytes) + "]."; + + std::to_string(cdesc.m_numBytes) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } setPdsByteOrder("LSB"); @@ -1141,9 +1143,9 @@ namespace Isis { } else { IString msg = "Only 4 byte or 8 byte real values are supported in Isis. " - "PDS Column [" + cdesc.m_name + "PDS Column [" + cdesc.m_name.toStdString() + "] has a real DATA_TYPE with [BYTES = " - + toString(cdesc.m_numBytes) + "]."; + + std::to_string(cdesc.m_numBytes) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -1156,10 +1158,10 @@ namespace Isis { return TableField(name.toStdString(), TableField::Real); } else { - QString msg = "Only 4 byte or 8 byte real values are supported in Isis. " - "PDS Column [" + cdesc.m_name + std::string msg = "Only 4 byte or 8 byte real values are supported in Isis. " + "PDS Column [" + cdesc.m_name.toStdString() + "] has a real DATA_TYPE with [BYTES = " - + toString(cdesc.m_numBytes) + "]."; + + std::to_string(cdesc.m_numBytes) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -1170,9 +1172,9 @@ namespace Isis { } // Isis tables currently don't support any of the following PDS DATA_TYPE: // BIT_STRING, COMPLEX, N/A, BOOLEAN, UNSIGNED_INTEGER, IBM types, some VAX types - IString msg = "PDS Column [" + cdesc.m_name + IString msg = "PDS Column [" + cdesc.m_name.toStdString() + "] has an unsupported DATA_TYPE [" - + dataType + "]."; + + dataType.toStdString() + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -1190,10 +1192,10 @@ namespace Isis { */ void ImportPdsTable::setPdsByteOrder(QString byteOrder) { if (!m_byteOrder.isEmpty() && m_byteOrder != byteOrder) { - QString msg = "Unable to import the binary PDS table [" + m_tableName + std::string msg = "Unable to import the binary PDS table [" + m_tableName.toStdString() + "]. The column DATA_TYPE values indicate differing byte " "orders. "; - throw IException(IException::Unknown, msg.toStdString(), _FILEINFO_); + throw IException(IException::Unknown, msg, _FILEINFO_); } m_byteOrder = byteOrder; } diff --git a/isis/src/base/objs/InfixToPostfix/InfixToPostfix.cpp b/isis/src/base/objs/InfixToPostfix/InfixToPostfix.cpp index 83629046be..a8d07b8871 100644 --- a/isis/src/base/objs/InfixToPostfix/InfixToPostfix.cpp +++ b/isis/src/base/objs/InfixToPostfix/InfixToPostfix.cpp @@ -107,7 +107,7 @@ namespace Isis { * @return IString A space-delimited string with data between every pair of spaces */ QString InfixToPostfix::cleanSpaces(QString equation) { - IString equationIStr = equation; + IString equationIStr = equation.toStdString(); IString clean = ""; while(!equationIStr.empty()) { IString data = equationIStr.Token(" "); @@ -123,7 +123,7 @@ namespace Isis { } } - return clean.ToQt(); + return QString::fromStdString(clean); } /** @@ -138,7 +138,7 @@ namespace Isis { */ QString InfixToPostfix::convert(const QString &infix) { // Prep our equation for the conversion - IString equation = tokenizeEquation(infix); + IString equation = tokenizeEquation(infix).toStdString(); IString postfix = ""; // The algorithm uses a stack @@ -159,20 +159,20 @@ namespace Isis { // There will be no empty tokens, so don't worry about checking for it. // TokenizeEquation cleans excess spaces in it's return value. - QString data = equation.Token(" ").ToQt(); + QString data = QString::fromStdString(equation.Token(" ")); if(data.compare("(") == 0) { theStack.push(*findOperator(data)); } else if(data.compare(")") == 0) { - QString postfixQStr = postfix.ToQt(); + QString postfixQStr = QString::fromStdString(postfix); closeParenthesis(postfixQStr, theStack); - postfix = postfixQStr; + postfix = postfixQStr.toStdString(); } else if(isKnownSymbol(data)) { - QString postfixQStr = postfix.ToQt(); + QString postfixQStr = QString::fromStdString(postfix); addOperator(postfixQStr, *findOperator(data), theStack); - postfix = postfixQStr; + postfix = postfixQStr.toStdString(); if(isFunction(data)) { // For a general check, zero single argument functions the @@ -196,11 +196,11 @@ namespace Isis { else { try { // Make sure this is truly an operand and not an operator by casting it - toDouble(data); + data.toDouble(); } catch(IException &) { throw IException(IException::User, - "The operator '" + data + "' is not recognized.", + "The operator '" + data.toStdString() + "' is not recognized.", _FILEINFO_); } @@ -208,20 +208,20 @@ namespace Isis { numConsecutiveOperators = 0; numConsecutiveOperands ++; - postfix += IString(' ' + data + ' '); + postfix += IString(' ' + data.toStdString() + ' '); } // If we found consecutive operators or operands, tell the user if(numConsecutiveOperators > 1) { - throw IException(IException::User, "Missing an operand near the operator '" + data + "'.", _FILEINFO_); + throw IException(IException::User, "Missing an operand near the operator '" + data.toStdString() + "'.", _FILEINFO_); } else if(numConsecutiveOperands > 1) { - throw IException(IException::User, "Missing an operator before " + data + ".", _FILEINFO_); + throw IException(IException::User, "Missing an operator before " + data.toStdString() + ".", _FILEINFO_); } } while(!theStack.empty()) { - IString op = theStack.top().outputString(); + IString op = theStack.top().outputString().toStdString(); // Any opening parentheses here are invalid at this point if(op == "(") { @@ -239,7 +239,7 @@ namespace Isis { postfix = postfix.Remove(","); // Clean spaces just to double check and return our postfix answer - return cleanSpaces(postfix.ToQt()); + return cleanSpaces(QString::fromStdString(postfix)); } /** @@ -352,7 +352,7 @@ namespace Isis { } // Nothing found - throw IException(IException::User, "The operator '" + representation + "' is not recognized.", _FILEINFO_); + throw IException(IException::User, "The operator '" + representation.toStdString() + "' is not recognized.", _FILEINFO_); } /** @@ -460,7 +460,7 @@ namespace Isis { } } - QString cleanedEquation = cleanSpaces(formatFunctionCalls(output.DownCase().ToQt())); + QString cleanedEquation = cleanSpaces(formatFunctionCalls(QString::fromStdString(output.DownCase()))); return cleanedEquation; } @@ -484,10 +484,10 @@ namespace Isis { // We'll use tokens to get through the entire equation, which is space-delimited. // So continue processing until we're out of tokens and the string is empty. while(!equation.isEmpty()) { - IString tmp = equation; + IString tmp = equation.toStdString(); - QString element = tmp.Token(" ").ToQt(); - equation = tmp.ToQt(); + QString element = QString::fromStdString(tmp.Token(" ")); + equation = QString::fromStdString(tmp); // Did we find a function? Figure out what it is! if(isFunction(element)) { @@ -501,9 +501,9 @@ namespace Isis { // Deal with 0-argument functions if(func->argumentCount() == 0) { - IString tmp = equation; - QString next = tmp.Token(" ").ToQt(); - equation = tmp.ToQt(); + IString tmp = equation.toStdString(); + QString next = QString::fromStdString(tmp.Token(" ")); + equation = QString::fromStdString(tmp); // If they didn't add parentheses around the zero-argument // function, we still know what they mean. Close the arguments @@ -515,15 +515,15 @@ namespace Isis { equation = next + " " + equation; } else { - IString tmp = equation; + IString tmp = equation.toStdString(); // We see a zero-arg function, and we grabbed an open parenthesis from it. // Make sure the next thing is a close or we have a problem. if(tmp.Token(" ") != ")") { throw IException(IException::User, - "The function " + func->inputString() + " should not have any arguments.", + "The function " + func->inputString().toStdString() + " should not have any arguments.", _FILEINFO_); } - equation = tmp.ToQt(); + equation = QString::fromStdString(tmp); // Close the arguments and the wrapping parentheses. They wrote their call correct :) output += " ) ) "; @@ -532,23 +532,23 @@ namespace Isis { else { // Deal with 1+ argument functions by parsing out the arguments - IString tmp = equation; + IString tmp = equation.toStdString(); // Make sure the user put parentheses around these, otherwise we're left in the dark. if (func->argumentCount() > 1 && tmp.Token(" ") != "(") { throw IException(IException::User, - "Missing parenthesis after " + func->inputString(), + "Missing parenthesis after " + func->inputString().toStdString(), _FILEINFO_); } - equation = tmp.ToQt(); + equation = QString::fromStdString(tmp); // Single argument missing parenthesis? if(func->argumentCount() == 1) { - IString tmp = equation; - QString argument = tmp.Token(" ").ToQt(); - equation = tmp.ToQt(); + IString tmp = equation.toStdString(); + QString argument = QString::fromStdString(tmp.Token(" ")); + equation = QString::fromStdString(tmp); if(argument != "(") { // We might have a problem. They're calling a function without adding parentheses.... @@ -556,7 +556,7 @@ namespace Isis { // my job to figure out what they mean! if(func->inputString() != "--") { throw IException(IException::User, - "Missing parenthesis after " + func->inputString(), + "Missing parenthesis after " + func->inputString().toStdString(), _FILEINFO_); } @@ -571,9 +571,9 @@ namespace Isis { // the function and resursively call, then append the negation. QString functionName = argument; - IString tmp = equation; - QString openParen = tmp.Token(" ").ToQt(); - equation = tmp.ToQt(); + IString tmp = equation.toStdString();; + QString openParen = QString::fromStdString(tmp.Token(" ")); + equation = QString::fromStdString(tmp); // No open parens? Call ourself again with this supposed function if(openParen != "(") { @@ -589,13 +589,13 @@ namespace Isis { // and append the negation. int numParens = 0; while(numParens > -1) { - IString tmp = equation; - QString newElem = tmp.Token(" ").ToQt(); - equation = tmp.ToQt(); + IString tmp = equation.toStdString();; + QString newElem = QString::fromStdString(tmp.Token(" ")); + equation = QString::fromStdString(tmp); if(newElem == "") { throw IException(IException::User, - "Missing closing parentheses after '" + argument + "'.", + "Missing closing parentheses after '" + argument.toStdString() + "'.", _FILEINFO_); } @@ -624,14 +624,14 @@ namespace Isis { int numParens = 0; int argNum = 0; while(argNum < func->argumentCount()) { - IString tmp = equation; - QString elem = tmp.Token(" ").ToQt(); - equation = tmp.ToQt(); + IString tmp = equation.toStdString();; + QString elem = QString::fromStdString(tmp.Token(" ")); + equation = QString::fromStdString(tmp); // Ran out of data, the function call is not complete. if(elem == "") { throw IException(IException::User, - "The definition of '" + func->inputString() + "' is not complete.", + "The definition of '" + func->inputString().toStdString() + "' is not complete.", _FILEINFO_); } @@ -657,7 +657,7 @@ namespace Isis { // Too many arguments? We don't expect a comma delimiter on the last argument. if(argNum == func->argumentCount()) { throw IException(IException::User, - "There were too many arguments supplied to the function '" + func->inputString() + "'.", + "There were too many arguments supplied to the function '" + func->inputString().toStdString() + "'.", _FILEINFO_); } } @@ -676,7 +676,7 @@ namespace Isis { // Closed the function early? else if(numParens == -1) { throw IException(IException::User, - "There were not enough arguments supplied to the function '" + func->inputString() + "'.", + "There were not enough arguments supplied to the function '" + func->inputString().toStdString() + "'.", _FILEINFO_); } } @@ -696,7 +696,7 @@ namespace Isis { if(argument == "") { throw IException(IException::User, - "Argument " + toString(argNum + 1) + " in function " + funcName + " must not be empty.", + "Argument " + std::to_string(argNum + 1) + " in function " + funcName.toStdString() + " must not be empty.", _FILEINFO_); } } diff --git a/isis/src/base/objs/InlineCalculator/InlineCalculator.cpp b/isis/src/base/objs/InlineCalculator/InlineCalculator.cpp index 8661a689d2..53f3523e9a 100644 --- a/isis/src/base/objs/InlineCalculator/InlineCalculator.cpp +++ b/isis/src/base/objs/InlineCalculator/InlineCalculator.cpp @@ -110,7 +110,7 @@ namespace Isis { tokenOps = tokenOps.simplified(); int nerrors = 0; - QString error = "Errors parsing inline equation[" + equation + "]."; + std::string error = "Errors parsing inline equation[" + equation.toStdString() + "]."; IException errList(IException::User, error, _FILEINFO_); Clear(); // Clear the stack @@ -146,7 +146,7 @@ namespace Isis { // in the current state of the resource pool. try { if ( !orphanTokenHandler(token) ) { - error = "Equation element (" + token + ") invalid - token not recognized."; + error = "Equation element (" + token.toStdString() + ") invalid - token not recognized."; errList.append(IException(IException::User, error, _FILEINFO_)); nerrors++; } @@ -222,7 +222,7 @@ namespace Isis { } if (StackSize() != 1) { - QString msg = "Too many operands in the equation [" + m_equation + "]."; + std::string msg = "Too many operands in the equation [" + m_equation.toStdString() + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -255,7 +255,7 @@ namespace Isis { bool InlineCalculator::isScalar(const QString &scalar) { if (scalar.isEmpty()) return (false); try { - toDouble(scalar); + scalar.toDouble(); return (true); } catch (IException &e) { @@ -292,7 +292,7 @@ namespace Isis { * */ void InlineCalculator::scalar(const QVariant &scalar) { - Push(toDouble(scalar.toString())); + Push((scalar.toString()).toDouble()); } @@ -316,7 +316,7 @@ namespace Isis { } // Error! - QString error = "Could not find variable [" + key + "] in variable pool."; + std::string error = "Could not find variable [" + key.toStdString() + "] in variable pool."; throw IException(IException::User, error, _FILEINFO_); } @@ -395,7 +395,7 @@ namespace Isis { QVector inputB = Pop(); QVector results; if ( inputA.size() != inputB.size() ) { - QString msg = "Failed performing logical or operation, " + std::string msg = "Failed performing logical or operation, " "input vectors are of differnet lengths."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -419,7 +419,7 @@ namespace Isis { QVector inputB = Pop(); QVector results; if ( inputA.size() != inputB.size() ) { - QString msg = "Failed performing logical and operation, " + std::string msg = "Failed performing logical and operation, " "input vectors are of differnet lengths."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -481,7 +481,7 @@ namespace Isis { m_fxPool.insert(function->name(), function); } else { - QString msg = "Function operator [" + function->name() + + std::string msg = "Function operator [" + function->name().toStdString() + "] exists! Cannot replace existing functions in the pool :-("; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -690,8 +690,8 @@ namespace Isis { */ QVector CalculatorVariablePool::value(const QString &variable, const int &index) const { - QString mess = "No implementation in Calculator variable pool to provide " - " value for variable [" + variable + "]."; + std::string mess = "No implementation in Calculator variable pool to provide " + " value for variable [" + variable.toStdString() + "]."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -709,8 +709,8 @@ namespace Isis { * value for variable." */ void CalculatorVariablePool::add(const QString &key, QVector &values) { - QString mess = "No implementation in Calculator variable pool to add " - " value for variable [" + key + "]."; + std::string mess = "No implementation in Calculator variable pool to add " + " value for variable [" + key.toStdString() + "]."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp b/isis/src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp index 92249532b5..f0ad222c3a 100644 --- a/isis/src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp +++ b/isis/src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp @@ -92,7 +92,7 @@ namespace Isis { return (findOperator(token)); } else { - QString msg = "The token '" + token + std::string msg = "The token '" + token.toStdString() + "' is not recognized as an operator, function or variable."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -155,7 +155,7 @@ namespace Isis { // if (InfixToPostfix::isKnownSymbol(token)) return (false); try { - Isis::toDouble(token); + token.toDouble(); return (true); } catch (IException &) { diff --git a/isis/src/base/objs/Intercept/Intercept.cpp b/isis/src/base/objs/Intercept/Intercept.cpp index 198c9b588a..797ea94264 100755 --- a/isis/src/base/objs/Intercept/Intercept.cpp +++ b/isis/src/base/objs/Intercept/Intercept.cpp @@ -205,7 +205,7 @@ namespace Isis { bool Intercept::verify(const bool &test, const QString &errmsg, const Intercept::ErrAction &action) const { if ( ( Throw == action ) && ( !test ) ) { - throw IException(IException::Programmer, errmsg, _FILEINFO_); + throw IException(IException::Programmer, errmsg.toStdString(), _FILEINFO_); } // Looks good diff --git a/isis/src/base/objs/IsisAml/IsisAml.cpp b/isis/src/base/objs/IsisAml/IsisAml.cpp index debe3566c1..17967cf5ef 100644 --- a/isis/src/base/objs/IsisAml/IsisAml.cpp +++ b/isis/src/base/objs/IsisAml/IsisAml.cpp @@ -71,7 +71,7 @@ void IsisAml::PutAsString(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been entered."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } @@ -99,7 +99,7 @@ void IsisAml::PutAsString(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been entered."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } @@ -133,12 +133,12 @@ void IsisAml::PutString(const QString ¶mName, const QString &value) { IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "string" && param->type != "combo") { - QString message = "Parameter [" + paramName + "] is not a string."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a string."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -166,12 +166,12 @@ void IsisAml::PutString(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "string" && param->type != "combo") { - QString message = "Parameter [" + paramName + "] is not a string."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a string."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -201,12 +201,12 @@ void IsisAml::PutFileName(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if((param->type != "filename") && (param->type != "cube")) { - QString message = "Parameter [" + paramName + "] is not a filename."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a filename."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -243,12 +243,12 @@ void IsisAml::PutFileName(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if((param->type != "filename") && (param->type != "cube")) { - QString message = "Parameter [" + paramName + "] is not a filename."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a filename."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -276,12 +276,12 @@ void IsisAml::PutCubeName(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "cube") { - QString message = "Parameter [" + paramName + "] is not a cubename."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a cubename."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -314,19 +314,19 @@ void IsisAml::PutInteger(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "integer") { - QString message = "Parameter [" + paramName + "] is not an integer."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not an integer."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } param->values.clear(); - param->values.push_back(Isis::toString(value)); + param->values.push_back(QString::number(value)); Verify(param); } @@ -355,12 +355,12 @@ void IsisAml::PutInteger(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "integer") { - QString message = "Parameter [" + paramName + "] is not an integer."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not an integer."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -368,7 +368,7 @@ void IsisAml::PutInteger(const QString ¶mName, param->values.resize(value.size()); for(unsigned int i = 0; i < value.size(); i++) { - param->values[i] = Isis::toString(value[i]); + param->values[i] = QString::number(value[i]); } Verify(param); @@ -398,19 +398,19 @@ void IsisAml::PutDouble(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "double") { - QString message = "Parameter [" + paramName + "] is not a double."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a double."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } param->values.clear(); - param->values.push_back(Isis::toString(value)); + param->values.push_back(QString::number(value)); Verify(param); } @@ -439,12 +439,12 @@ void IsisAml::PutDouble(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "double") { - QString message = "Parameter [" + paramName + "] is not a double."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a double."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -452,7 +452,7 @@ void IsisAml::PutDouble(const QString ¶mName, param->values.resize(value.size()); for(unsigned int i = 0; i < value.size(); i++) { - param->values[i] = Isis::toString(value[i]); + param->values[i] = QString::number(value[i]); } Verify(param); @@ -482,12 +482,12 @@ void IsisAml::PutBoolean(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "boolean") { - QString message = "Parameter [" + paramName + "] is not a boolean."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a boolean."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -528,12 +528,12 @@ void IsisAml::PutBoolean(const QString ¶mName, IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "boolean") { - QString message = "Parameter [" + paramName + "] is not a boolean."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a boolean."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() > 0) { - QString message = "A value for this parameter [" + paramName + "] has " + std::string message = "A value for this parameter [" + paramName.toStdString() + "] has " "already been saved (possibly by IsisGui). If you need to " "change the value use \"Clear\" before the Put."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); @@ -573,7 +573,7 @@ QString IsisAml::GetAsString(const QString ¶mName) const { QString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } else { @@ -609,7 +609,7 @@ void IsisAml::GetAsString(const QString ¶mName, QString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { @@ -642,14 +642,14 @@ QString IsisAml::GetFileName(const QString ¶mName, QString extension) const const IsisParameterData *param = ReturnParam(paramName); if(param->type != "filename") { - QString message = "Parameter [" + paramName + "] is not a filename."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a filename."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } QString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { @@ -660,9 +660,9 @@ QString IsisAml::GetFileName(const QString ¶mName, QString extension) const value = param->values[0]; } - Isis::FileName name(value); - if(extension != "") name = name.addExtension(extension); - value = name.expanded(); + Isis::FileName name(value.toStdString()); + if(extension != "") name = name.addExtension(extension.toStdString()); + value = QString::fromStdString(name.expanded()); return value; } @@ -683,27 +683,27 @@ void IsisAml::GetFileName(const QString ¶mName, const IsisParameterData *param = ReturnParam(paramName); if(param->type != "filename") { - QString message = "Parameter [" + paramName + "] is not a filename."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a filename."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } values.clear(); if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { for(unsigned int i = 0; i < param->defaultValues.size(); i++) { - Isis::FileName name(param->defaultValues[i]); - values.push_back(name.expanded()); + Isis::FileName name(param->defaultValues[i].toStdString()); + values.push_back(QString::fromStdString(name.expanded())); } } } else { for(unsigned int i = 0; i < param->values.size(); i++) { - Isis::FileName name(param->values[i]); - values.push_back(name.expanded()); + Isis::FileName name(param->values[i].toStdString()); + values.push_back(QString::fromStdString(name.expanded())); } } @@ -726,14 +726,14 @@ QString IsisAml::GetCubeName(const QString ¶mName, QString extension) const const IsisParameterData *param = ReturnParam(paramName); if (param->type != "cube") { - QString message = "Parameter [" + paramName + "] is not a cubename."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a cubename."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } QString value; if (param->values.size() == 0) { if (param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { @@ -744,11 +744,11 @@ QString IsisAml::GetCubeName(const QString ¶mName, QString extension) const value = param->values[0]; } - Isis::FileName name(value); - if (extension != "") name = name.addExtension(extension); - value = name.expanded(); + Isis::FileName name(value.toStdString()); + if (extension != "") name = name.addExtension(extension.toStdString()); + value = QString::fromStdString(name.expanded()); if (name.attributes().length() > 0) { - value += "+" + name.attributes(); + value += "+" + QString::fromStdString(name.attributes()); } return value; @@ -772,13 +772,13 @@ QString IsisAml::GetString(const QString ¶mName) const { QString value; if(param->type != "string" && param->type != "combo") { - QString message = "Parameter [" + paramName + "] is not a string."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a string."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { @@ -805,13 +805,13 @@ QString IsisAml::GetString(const QString ¶mName) const { } } if(foundcount == 0) { - QString message = "Value [" + value + "] for parameter [" + - paramName + "] is not a valid value."; + std::string message = "Value [" + value.toStdString() + "] for parameter [" + + paramName.toStdString() + "] is not a valid value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } if(foundcount > 1) { - QString message = "Value [" + value + "] for parameter [" + - paramName + "] is not unique."; + std::string message = "Value [" + value.toStdString() + "] for parameter [" + + paramName.toStdString() + "] is not unique."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } return param->listOptions[found].value; @@ -844,7 +844,7 @@ void IsisAml::GetString(const QString ¶mName, const IsisParameterData *param = ReturnParam(paramName); if(param->type != "string" && param->type != "combo") { - QString message = "Parameter [" + paramName + "] is not a string."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a string."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } @@ -852,7 +852,7 @@ void IsisAml::GetString(const QString ¶mName, QString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { @@ -885,22 +885,22 @@ int IsisAml::GetInteger(const QString ¶mName) const { const IsisParameterData *param = ReturnParam(paramName); if(param->type != "integer") { - QString message = "Parameter [" + paramName + "] is not an integer."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not an integer."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } Isis::IString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { - value = param->defaultValues[0]; + value = param->defaultValues[0].toStdString(); } } else { - value = param->values[0]; + value = param->values[0].toStdString(); } return value.ToInteger(); @@ -925,7 +925,7 @@ void IsisAml::GetInteger(const QString ¶mName, const IsisParameterData *param = ReturnParam(paramName); if(param->type != "integer") { - QString message = "Parameter [" + paramName + "] is not an integer."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not an integer."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } @@ -933,18 +933,18 @@ void IsisAml::GetInteger(const QString ¶mName, Isis::IString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { for(unsigned int i = 0; i < param->defaultValues.size(); i++) - value = param->defaultValues[i]; + value = param->defaultValues[i].toStdString(); values.push_back(value.ToInteger()); } } else { for(unsigned int i = 0; i < param->values.size(); i++) - value = param->values[i]; + value = param->values[i].toStdString(); values.push_back(value.ToInteger()); } @@ -968,22 +968,22 @@ double IsisAml::GetDouble(const QString ¶mName) const { const IsisParameterData *param = ReturnParam(paramName); if(param->type != "double") { - QString message = "Parameter [" + paramName + "] is not a double."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a double."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } Isis::IString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { - value = param->defaultValues[0]; + value = param->defaultValues[0].toStdString(); } } else { - value = param->values[0]; + value = param->values[0].toStdString(); } return value.ToDouble(); @@ -1008,7 +1008,7 @@ void IsisAml::GetDouble(const QString ¶mName, const IsisParameterData *param = ReturnParam(paramName); if(param->type != "double") { - QString message = "Parameter [" + paramName + "] is not a double."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a double."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } @@ -1016,18 +1016,18 @@ void IsisAml::GetDouble(const QString ¶mName, Isis::IString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { for(unsigned int i = 0; i < param->defaultValues.size(); i++) - value = param->defaultValues[i]; + value = param->defaultValues[i].toStdString(); values.push_back(value.ToDouble()); } } else { for(unsigned int i = 0; i < param->values.size(); i++) - value = param->values[i]; + value = param->values[i].toStdString(); values.push_back(value.ToDouble()); } @@ -1051,14 +1051,14 @@ bool IsisAml::GetBoolean(const QString ¶mName) const { const IsisParameterData *param = ReturnParam(paramName); if(param->type != "boolean") { - QString message = "Parameter [" + paramName + "] is not a boolean."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a boolean."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } QString value; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { @@ -1069,7 +1069,7 @@ bool IsisAml::GetBoolean(const QString ¶mName) const { value = param->values[0]; } - return Isis::toBool(value); + return Isis::toBool(value.toStdString()); } @@ -1092,7 +1092,7 @@ void IsisAml::GetBoolean(const QString ¶mName, const IsisParameterData *param = ReturnParam(paramName); if(param->type != "boolean") { - QString message = "Parameter [" + paramName + "] is not a boolean."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not a boolean."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } @@ -1101,7 +1101,7 @@ void IsisAml::GetBoolean(const QString ¶mName, QString tmp; if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { - QString message = "Parameter [" + paramName + "] has no value."; + std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { @@ -1190,7 +1190,7 @@ QString IsisAml::GroupName(const int &index) const { */ int IsisAml::GroupIndex(const QString & grpName) const { for(int i=0; i<(int)groups.size(); i++) { - if(Isis::IString(grpName).DownCase() == Isis::IString(groups[i].name).DownCase()) { + if(Isis::IString(grpName.toStdString()).DownCase() == Isis::IString(groups[i].name.toStdString()).DownCase()) { return i; } } @@ -1281,7 +1281,7 @@ void IsisAml::CreatePVL(Isis::Pvl &pvlDef , QString guiGrpName, QString pvlObjNa int grpIndex= GroupIndex(guiGrpName); if (pvlGrpName == "" || grpIndex == -1 ) { - QString errMsg = "Must provide Group Name\n"; + std::string errMsg = "Must provide Group Name\n"; throw Isis::IException(Isis::IException::User, errMsg, _FILEINFO_); } @@ -1290,7 +1290,7 @@ void IsisAml::CreatePVL(Isis::Pvl &pvlDef , QString guiGrpName, QString pvlObjNa QString paramName = ParamName(grpIndex, i); if(IsParamInPvlInclude(paramName,include)) { - Isis::IString paramType = Isis::IString(ParamType(grpIndex, i)).DownCase(); + Isis::IString paramType = Isis::IString(ParamType(grpIndex, i).toStdString()).DownCase(); if(paramType == "double") { grp += Isis::PvlKeyword(paramName.toStdString(), std::to_string(GetDouble(paramName))); } @@ -1331,7 +1331,7 @@ void IsisAml::CreatePVL(Isis::Pvl &pvlDef , QString guiGrpName, QString pvlObjNa bool IsisAml::IsParamInPvlInclude(QString & paramName, vector & include) { for(int i=0; i<(int)include.size(); i++) { - if(Isis::IString(paramName).DownCase() == Isis::IString(include[i]).DownCase()) { + if(Isis::IString(paramName.toStdString()).DownCase() == Isis::IString(include[i].toStdString()).DownCase()) { return true; } } @@ -2039,7 +2039,7 @@ void IsisAml::Clear(const QString ¶mName) { IsisParameterData *param = const_cast (ReturnParam(paramName)); param->values.clear(); - param->outCubeAtt.setAttributes("+" + param->pixelType); + param->outCubeAtt.setAttributes("+" + param->pixelType.toStdString()); param->inCubeAtt.setAttributes(""); return; @@ -2061,8 +2061,8 @@ Isis::CubeAttributeInput &IsisAml::GetInputAttribute(const QString ¶mName) { IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "cube") { - QString message = "Unable to get input cube attributes. Parameter [" - + paramName + "] is not a cube. Parameter type = [" + param->type + "]."; + std::string message = "Unable to get input cube attributes. Parameter [" + + paramName.toStdString() + "] is not a cube. Parameter type = [" + param->type.toStdString() + "]."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } @@ -2070,7 +2070,7 @@ Isis::CubeAttributeInput &IsisAml::GetInputAttribute(const QString ¶mName) { if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { value.clear(); -// QString message = "Parameter [" + paramName + "] has no value."; +// std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; // throw Isis::IException(Isis::IException::User,message, _FILEINFO_); } else { @@ -2081,11 +2081,11 @@ Isis::CubeAttributeInput &IsisAml::GetInputAttribute(const QString ¶mName) { value = param->values[0]; } if(param->fileMode == "input") { - param->inCubeAtt.setAttributes(value); + param->inCubeAtt.setAttributes(value.toStdString()); } else { - QString message = "Unable to get input cube attributes. Parameter [" - + paramName + "] is not an input. Parameter fileMode = [" + param->fileMode + "]."; + std::string message = "Unable to get input cube attributes. Parameter [" + + paramName.toStdString() + "] is not an input. Parameter fileMode = [" + param->fileMode.toStdString() + "]."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } return param->inCubeAtt; @@ -2107,8 +2107,8 @@ Isis::CubeAttributeOutput &IsisAml::GetOutputAttribute(const QString ¶mName) IsisParameterData *param = const_cast (ReturnParam(paramName)); if(param->type != "cube") { - QString message = "Unable to get output cube attributes. Parameter [" - + paramName + "] is not a cube. Parameter type = [" + param->type + "]."; + std::string message = "Unable to get output cube attributes. Parameter [" + + paramName.toStdString() + "] is not a cube. Parameter type = [" + param->type.toStdString() + "]."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } @@ -2116,7 +2116,7 @@ Isis::CubeAttributeOutput &IsisAml::GetOutputAttribute(const QString ¶mName) if(param->values.size() == 0) { if(param->defaultValues.size() == 0) { value.clear(); -// QString message = "Parameter [" + paramName + "] has no value."; +// std::string message = "Parameter [" + paramName.toStdString() + "] has no value."; // throw Isis::IException(Isis::IException::User,message, _FILEINFO_); } else { @@ -2127,12 +2127,12 @@ Isis::CubeAttributeOutput &IsisAml::GetOutputAttribute(const QString ¶mName) value = param->values[0]; } if(param->fileMode == "output") { - param->outCubeAtt.setAttributes("+" + param->pixelType); - param->outCubeAtt.addAttributes(Isis::FileName(value)); + param->outCubeAtt.setAttributes("+" + param->pixelType.toStdString()); + param->outCubeAtt.addAttributes(Isis::FileName(value.toStdString())); } else { - QString message = "Unable to get output cube attributes. Parameter [" - + paramName + "] is not an output. Parameter fileMode = [" + param->fileMode + "]."; + std::string message = "Unable to get output cube attributes. Parameter [" + + paramName.toStdString() + "] is not an output. Parameter fileMode = [" + param->fileMode.toStdString() + "]."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } return param->outCubeAtt; @@ -2150,7 +2150,7 @@ Isis::CubeAttributeOutput &IsisAml::GetOutputAttribute(const QString ¶mName) * @throws iException::User (Unknown Parameter) */ const IsisParameterData *IsisAml::ReturnParam(const QString ¶mName) const { - Isis::IString pn = paramName; + Isis::IString pn = paramName.toStdString(); pn.UpCase(); int found = 0; bool exact = false; @@ -2159,12 +2159,12 @@ const IsisParameterData *IsisAml::ReturnParam(const QString ¶mName) const { for(unsigned int g = 0; g < groups.size(); g++) { for(unsigned int p = 0; p < groups[g].parameters.size(); p++) { - cur_pn = groups[g].parameters[p].name; + cur_pn = groups[g].parameters[p].name.toStdString(); cur_pn.UpCase(); if(cur_pn.find(pn) == 0) { if(cur_pn == pn) { if(exact) { - QString message = "Parameter [" + paramName + "] is not unique."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not unique."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else { @@ -2181,11 +2181,11 @@ const IsisParameterData *IsisAml::ReturnParam(const QString ¶mName) const { } } if(param == NULL) { - QString message = "Unknown parameter [" + paramName + "]."; + std::string message = "Unknown parameter [" + paramName.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if((found > 1) && (!exact)) { - QString message = "Parameter [" + paramName + "] is not unique."; + std::string message = "Parameter [" + paramName.toStdString() + "] is not unique."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } return param; @@ -2208,23 +2208,23 @@ void IsisAml::Verify(const IsisParameterData *param) { for(unsigned int i = 0; i < param->values.size(); i++) { if(param->type == "integer") { try { - Isis::IString value(param->values[i]); + Isis::IString value(param->values[i].toStdString()); value.ToInteger(); } catch(Isis::IException &e) { - QString message = "Unable to convert [" + param->values[i] + "] to an integer," - " parameter [" + param->name + "]."; + std::string message = "Unable to convert [" + param->values[i].toStdString() + "] to an integer," + " parameter [" + param->name.toStdString() + "]."; throw Isis::IException(e, Isis::IException::User, message, _FILEINFO_); } } else if(param->type == "double") { try { - Isis::IString value(param->values[i]); + Isis::IString value(param->values[i].toStdString()); value.ToDouble(); } catch(Isis::IException &e) { - QString message = "Unable to convert [" + param->values[i] + "] to a double," - " parameter [" + param->name + "]."; + std::string message = "Unable to convert [" + param->values[i].toStdString() + "] to a double," + " parameter [" + param->name.toStdString() + "]."; throw Isis::IException(e, Isis::IException::User, message, _FILEINFO_); } } @@ -2235,7 +2235,7 @@ void IsisAml::Verify(const IsisParameterData *param) { StringToBool(v); } catch(Isis::IException &e) { - QString message = "Illegal value for [" + param->name + "], [" + param->values[i] + "]."; + std::string message = "Illegal value for [" + param->name.toStdString() + "], [" + param->values[i].toStdString() + "]."; throw Isis::IException(e, Isis::IException::User, message, _FILEINFO_); } } @@ -2243,8 +2243,8 @@ void IsisAml::Verify(const IsisParameterData *param) { // If this is an output file and a file with this name already exists, // check user filename customization preferences. QString value(param->values[i]); - Isis::FileName name(value); - value = name.expanded(); + Isis::FileName name(value.toStdString()); + value = QString::fromStdString(name.expanded()); if(name.fileExists() && param->fileMode == "output") { CheckFileNamePreference(value, param->name); } @@ -2258,7 +2258,7 @@ void IsisAml::Verify(const IsisParameterData *param) { // value = name.expanded(); // if (name.Exists() && param->fileMode == "output" // && Isis::Preference::Preferences().findGroup("CubeCustomization").findKeyword("Overwrite")[0] == "Error") { - // QString message = "Invalid output cube for [" + param->name + "]. The cube file [" + value + "] already exists. " + + // std::string message = "Invalid output cube for [" + param->name + "]. The cube file [" + value + "] already exists. " + // "The user preference cube customization group is set to disallow cube overwrites."; // throw Isis::IException(Isis::IException::User, message, _FILEINFO_); // } @@ -2272,23 +2272,23 @@ void IsisAml::Verify(const IsisParameterData *param) { // correct type if(param->type == "integer") { try { - Isis::IString value(param->defaultValues[i]); + Isis::IString value(param->defaultValues[i].toStdString()); value.ToInteger(); } catch(Isis::IException &e) { - QString message = "Unable to convert default [" + param->defaultValues[i] + - "] to an integer, parameter [" + param->name + "]."; + std::string message = "Unable to convert default [" + param->defaultValues[i].toStdString() + + "] to an integer, parameter [" + param->name.toStdString() + "]."; throw Isis::IException(e, Isis::IException::Programmer, message, _FILEINFO_); } } else if(param->type == "double") { try { - Isis::IString value(param->defaultValues[i]); + Isis::IString value(param->defaultValues[i].toStdString()); value.ToDouble(); } catch(Isis::IException &e) { - QString message = "Unable to convert default [" + param->defaultValues[i] + - "] to a double, parameter [" + param->name + "]."; + std::string message = "Unable to convert default [" + param->defaultValues[i].toStdString() + + "] to a double, parameter [" + param->name.toStdString() + "]."; throw Isis::IException(e, Isis::IException::Programmer, message, _FILEINFO_); } } @@ -2299,16 +2299,16 @@ void IsisAml::Verify(const IsisParameterData *param) { StringToBool(v); } catch(Isis::IException &e) { - QString message = "Illegal default value for [" + param->name + "], [" - + param->defaultValues[i] + "]."; + std::string message = "Illegal default value for [" + param->name.toStdString() + "], [" + + param->defaultValues[i].toStdString() + "]."; throw Isis::IException(e, Isis::IException::User, message, _FILEINFO_); } } else if(param->type == "filename") { // Put something here once we figure out what to do with filenames QString value(param->defaultValues[i]); - Isis::FileName name(value); - value = name.expanded(); + Isis::FileName name(value.toStdString()); + value = QString::fromStdString(name.expanded()); if(name.fileExists() && param->fileMode == "output") { CheckFileNamePreference(value, param->name); } @@ -2319,20 +2319,20 @@ void IsisAml::Verify(const IsisParameterData *param) { // Check the values against the values list if there is one if(param->listOptions.size() > 0) { for(unsigned int i = 0; i < param->values.size(); i++) { - Isis::IString value = param->values[i]; + Isis::IString value = param->values[i].toStdString(); value = value.UpCase(); int partial = 0; bool exact = false; for(unsigned int p = 0; p < param->listOptions.size(); p++) { - Isis::IString option = param->listOptions[p].value; + Isis::IString option = param->listOptions[p].value.toStdString(); option = option.UpCase(); // Check to see if the value matches the list option exactly if(value == option) { // If we already have one exact match then there is an error if(exact) { - QString message = "Duplicate list options [" + - param->listOptions[p].value + - "] in parameter [" + param->name + "]."; + std::string message = "Duplicate list options [" + + param->listOptions[p].value.toStdString() + + "] in parameter [" + param->name.toStdString() + "]."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } exact = true; @@ -2346,16 +2346,16 @@ void IsisAml::Verify(const IsisParameterData *param) { } } if(!exact && partial == 0) { - QString message = "Value of [" + param->name + "] must be one of [" + - param->listOptions[0].value; + std::string message = "Value of [" + param->name.toStdString() + "] must be one of [" + + param->listOptions[0].value.toStdString(); for(unsigned int p = 1; p < param->listOptions.size(); p++) { - message += ", " + param->listOptions[p].value; + message += ", " + param->listOptions[p].value.toStdString(); } message += "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!exact && partial > 1) { - QString msg = "Value of [" + param->name + + std::string msg = "Value of [" + param->name.toStdString() + "] does not match a list option uniquely."; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } @@ -2368,33 +2368,33 @@ void IsisAml::Verify(const IsisParameterData *param) { for(unsigned int i = 0; i < param->values.size(); i++) { if(param->type == "integer") { QString value(param->values[i]); - int temp = Isis::toInt(value); + int temp = Isis::toInt(value.toStdString()); value = param->minimum; - int min = Isis::toInt(value); + int min = Isis::toInt(value.toStdString()); if(StringToBool(incl) && (temp < min)) { - QString message = "Parameter [" + param->name + - "] must be greater than or equal to [" + param->minimum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be greater than or equal to [" + param->minimum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!StringToBool(incl) && (temp <= min)) { - QString message = "Parameter [" + param->name + - "] must be greater than [" + param->minimum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be greater than [" + param->minimum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } else if(param->type == "double") { - Isis::IString value(param->values[i]); + Isis::IString value(param->values[i].toStdString()); double temp = value.ToDouble(); - value = param->minimum; + value = param->minimum.toStdString(); double min = value.ToDouble(); if(StringToBool(incl) && (temp < min)) { - QString message = "Parameter [" + param->name + - "] must be greater than or equal to [" + param->minimum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be greater than or equal to [" + param->minimum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!StringToBool(incl) && (temp <= min)) { - QString message = "Parameter [" + param->name + - "] must be greater than [" + param->minimum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be greater than [" + param->minimum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2402,34 +2402,34 @@ void IsisAml::Verify(const IsisParameterData *param) { if(param->values.size() == 0) { for(unsigned int i = 0; i < param->defaultValues.size(); i++) { if(param->type == "integer") { - Isis::IString value(param->defaultValues[i]); + Isis::IString value(param->defaultValues[i].toStdString()); int temp = value.ToInteger(); - value = param->minimum; + value = param->minimum.toStdString(); int min = value.ToInteger(); if(StringToBool(incl) && (temp < min)) { - QString message = "Parameter [" + param->name + - "] must be greater than or equal to [" + param->minimum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be greater than or equal to [" + param->minimum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!StringToBool(incl) && (temp <= min)) { - QString message = "Parameter [" + param->name + - "] must be greater than [" + param->minimum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be greater than [" + param->minimum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } else if(param->type == "double") { - Isis::IString value(param->defaultValues[i]); + Isis::IString value(param->defaultValues[i].toStdString()); double temp = value.ToDouble(); - value = param->minimum; + value = param->minimum.toStdString(); double min = value.ToDouble(); if(StringToBool(incl) && (temp < min)) { - QString message = "Parameter [" + param->name + - "] must be greater than or equal to [" + param->minimum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be greater than or equal to [" + param->minimum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!StringToBool(incl) && (temp <= min)) { - QString message = "Parameter [" + param->name + - "] must be greater than [" + param->minimum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be greater than [" + param->minimum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2443,33 +2443,33 @@ void IsisAml::Verify(const IsisParameterData *param) { for(unsigned int i = 0; i < param->values.size(); i++) { if(param->type == "integer") { QString value(param->values[i]); - int temp = Isis::toInt(value); + int temp = Isis::toInt(value.toStdString()); value = param->maximum; - int max = Isis::toInt(value); + int max = Isis::toInt(value.toStdString()); if(StringToBool(incl) && (temp > max)) { - QString message = "Parameter [" + param->name + - "] must be less than or equal to [" + param->maximum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be less than or equal to [" + param->maximum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!StringToBool(incl) && (temp >= max)) { - QString message = "Parameter [" + param->name + - "] must be less than [" + param->maximum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be less than [" + param->maximum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } else if(param->type == "double") { - Isis::IString value(param->values[i]); + Isis::IString value(param->values[i].toStdString()); double temp = value.ToDouble(); - value = param->maximum; + value = param->maximum.toStdString(); double max = value.ToDouble(); if(StringToBool(incl) && (temp > max)) { - QString message = "Parameter [" + param->name + - "] must be less than or equal to [" + param->maximum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be less than or equal to [" + param->maximum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!StringToBool(incl) && (temp >= max)) { - QString message = "Parameter [" + param->name + - "] must be less than [" + param->maximum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be less than [" + param->maximum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2477,34 +2477,34 @@ void IsisAml::Verify(const IsisParameterData *param) { if(param->values.size() == 0) { for(unsigned int i = 0; i < param->defaultValues.size(); i++) { if(param->type == "integer") { - Isis::IString value(param->defaultValues[i]); + Isis::IString value(param->defaultValues[i].toStdString()); int temp = value.ToInteger(); - value = param->maximum; + value = param->maximum.toStdString(); int max = value.ToInteger(); if(StringToBool(incl) && (temp > max)) { - QString message = "Parameter [" + param->name + - "] must be less than or equal to [" + param->maximum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be less than or equal to [" + param->maximum .toStdString()+ "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!StringToBool(incl) && (temp >= max)) { - QString message = "Parameter [" + param->name + - "] must be less than [" + param->maximum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be less than [" + param->maximum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } else if(param->type == "double") { - Isis::IString value(param->defaultValues[i]); + Isis::IString value(param->defaultValues[i].toStdString()); double temp = value.ToDouble(); - value = param->maximum; + value = param->maximum.toStdString(); double max = value.ToDouble(); if(StringToBool(incl) && (temp > max)) { - QString message = "Parameter [" + param->name + - "] must be less than or equal to [" + param->maximum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be less than or equal to [" + param->maximum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(!StringToBool(incl) && (temp >= max)) { - QString message = "Parameter [" + param->name + - "] must be less than [" + param->maximum + "]."; + std::string message = "Parameter [" + param->name.toStdString() + + "] must be less than [" + param->maximum.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2517,15 +2517,15 @@ void IsisAml::Verify(const IsisParameterData *param) { if((odd != "") || StringToBool(odd)) { if(param->type != "integer") { - QString message = "Parameter [" + param->name + + std::string message = "Parameter [" + param->name.toStdString() + "] must be of type integer to have an [odd] test."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } else { for(unsigned int i = 0; i < param->values.size(); i++) { - Isis::IString value(param->values[i]); + Isis::IString value(param->values[i].toStdString()); if((value.ToInteger() % 2) != 1) { - QString message = "Value for [" + param->name + "] must be odd."; + std::string message = "Value for [" + param->name.toStdString() + "] must be odd."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2557,13 +2557,13 @@ void IsisAml::CheckFileNamePreference(QString filename, QString paramname) { QString overwritePreference = QString::fromStdString(fileCustomization.findKeyword("Overwrite")[0]).simplified().trimmed(); QString temp = overwritePreference; if(overwritePreference.toUpper() == "ERROR") { - QString message = "Invalid output filename for [" + paramname + "]. The file [" + filename + "] already exists. " + + std::string message = "Invalid output filename for [" + paramname.toStdString() + "]. The file [" + filename.toStdString() + "] already exists. " + "The user preference file customization group is set to disallow file overwrites."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } else if(overwritePreference.toUpper() != "ALLOW") { // not set to ERROR or ALLOW - QString message = "Invalid entry in user preference file FileCustomization group."; - message += " Overwrite = [" + temp + "]. Valid values: [Allow] or [Error]."; + std::string message = "Invalid entry in user preference file FileCustomization group."; + message += " Overwrite = [" + temp.toStdString() + "]. Valid values: [Allow] or [Error]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2592,9 +2592,9 @@ void IsisAml::VerifyAll() { if((param2->values.size()) == 0 && (param2->defaultValues.size() == 0) && (param2->internalDefault.size() == 0)) { - QString message = "Parameter [" + param2->name + + std::string message = "Parameter [" + param2->name.toStdString() + "] must be used if parameter [" + - param->name + "] equates to true."; + param->name.toStdString() + "] equates to true."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2611,9 +2611,9 @@ void IsisAml::VerifyAll() { if((param->values.size()) == 0 && (param->defaultValues.size() == 0) && (param->internalDefault.size() == 0)) { - QString message = "Parameter [" + param2->name + + std::string message = "Parameter [" + param2->name.toStdString() + "] must be used if parameter [" + - param->name + "] is used."; + param->name.toStdString() + "] is used."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2625,9 +2625,9 @@ void IsisAml::VerifyAll() { param2->values.size() == 0 && param2->defaultValues.size() == 0 && param2->internalDefault.size() == 0) { - QString message = "Parameter [" + param2->name + + std::string message = "Parameter [" + param2->name.toStdString() + "] must be used if parameter [" + - param->name + "] is used."; + param->name.toStdString() + "] is used."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2644,9 +2644,9 @@ void IsisAml::VerifyAll() { const IsisParameterData *param2 = ReturnParam(param->exclude[item]); if(param2->values.size() > 0) { - QString message = "Parameter [" + param2->name + + std::string message = "Parameter [" + param2->name.toStdString() + "] must NOT be used if parameter [" + - param->name + "] equates to true."; + param->name.toStdString() + "] equates to true."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2659,9 +2659,9 @@ void IsisAml::VerifyAll() { ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) && StringToBool(param2->defaultValues[0]))) { if(param->values.size() > 0) { - QString message = "Parameter [" + param2->name + + std::string message = "Parameter [" + param2->name.toStdString() + "] must be used if parameter [" + - param->name + "] is used."; + param->name.toStdString() + "] is used."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2669,9 +2669,9 @@ void IsisAml::VerifyAll() { // Neither parameter is a boolean else { if(param->values.size() > 0 && param2->values.size() > 0) { - QString message = "Parameter [" + param2->name + + std::string message = "Parameter [" + param2->name.toStdString() + "] must NOT be used if parameter [" + - param->name + "] is used."; + param->name.toStdString() + "] is used."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2691,8 +2691,8 @@ void IsisAml::VerifyAll() { double1 = GetDouble(param->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } @@ -2703,15 +2703,15 @@ void IsisAml::VerifyAll() { double2 = GetDouble(param2->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } if(double2 >= double1) { - QString message = "Parameter [" + param->name + + std::string message = "Parameter [" + param->name.toStdString() + "] must be greater than parameter [" + - param2->name + "]."; + param2->name.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2732,8 +2732,8 @@ void IsisAml::VerifyAll() { double1 = GetDouble(param->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } @@ -2744,15 +2744,15 @@ void IsisAml::VerifyAll() { double2 = GetDouble(param2->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } if(double2 > double1) { - QString message = "Parameter [" + param->name + + std::string message = "Parameter [" + param->name.toStdString() + "] must be greater than or equal to parameter [" + - param2->name + "]."; + param2->name.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2771,8 +2771,8 @@ void IsisAml::VerifyAll() { double1 = GetDouble(param->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } @@ -2783,15 +2783,15 @@ void IsisAml::VerifyAll() { double2 = GetDouble(param2->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } if(double2 <= double1) { - QString message = "Parameter [" + param->name + + std::string message = "Parameter [" + param->name.toStdString() + "] must be less than parameter [" + - param2->name + "]."; + param2->name.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2812,8 +2812,8 @@ void IsisAml::VerifyAll() { double1 = GetDouble(param->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } @@ -2824,15 +2824,15 @@ void IsisAml::VerifyAll() { double2 = GetDouble(param2->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } if(double2 < double1) { - QString message = "Parameter [" + param->name + + std::string message = "Parameter [" + param->name.toStdString() + "] must be less than or equal to parameter [" + - param2->name + "]."; + param2->name.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2852,8 +2852,8 @@ void IsisAml::VerifyAll() { double1 = GetDouble(param->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } @@ -2864,15 +2864,15 @@ void IsisAml::VerifyAll() { double2 = GetDouble(param2->name); } else { - QString msg = "Parameter is not INTEGER or DOUBLE type [" + - param->name + "]"; + std::string msg = "Parameter is not INTEGER or DOUBLE type [" + + param->name.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_); } if(double2 == double1) { - QString message = "Parameter [" + param->name + + std::string message = "Parameter [" + param->name.toStdString() + "] must NOT be equal to parameter [" + - param2->name + "]."; + param2->name.toStdString() + "]."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2901,10 +2901,10 @@ void IsisAml::VerifyAll() { const IsisParameterData *param2 = ReturnParam(param->listOptions[o2].exclude[e2]); if(param2->values.size() > 0) { - QString message = "Parameter [" + param2->name + + std::string message = "Parameter [" + param2->name.toStdString() + "] can not be entered if parameter [" + - param->name + "] is equal to [" + - value + "]"; + param->name.toStdString() + "] is equal to [" + + value.toStdString() + "]"; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -2935,10 +2935,10 @@ void IsisAml::VerifyAll() { ReturnParam(param->listOptions[o2].include[e2]); if((param2->values.size() == 0) && (param2->defaultValues.size() == 0)) { - QString message = "Parameter [" + param2->name + + std::string message = "Parameter [" + param2->name.toStdString() + "] must be entered if parameter [" + - param->name + "] is equal to [" + - value + "]"; + param->name.toStdString() + "] is equal to [" + + value.toStdString() + "]"; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -3035,7 +3035,7 @@ void IsisAml::VerifyAll() { } if(!excluded) { - QString message = "Parameter [" + param->name + "] must be entered."; + std::string message = "Parameter [" + param->name.toStdString() + "] must be entered."; throw Isis::IException(Isis::IException::User, message, _FILEINFO_); } } @@ -3084,7 +3084,7 @@ bool IsisAml::StringToBool(QString value) const { return true; } else { - QString message = "Invalid boolean value [" + value + "]."; + std::string message = "Invalid boolean value [" + value.toStdString() + "]."; throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); } return false; @@ -3137,15 +3137,15 @@ void IsisAml::CommandLine(Isis::Pvl &cont) const { for(unsigned int o2 = 0; o2 < param->listOptions.size(); o2++) { Isis::IString value, option; if(param->type == "string" || param->type == "combo") { - value = GetAsString(param->name); + value = GetAsString(param->name).toStdString(); value = value.UpCase(); - option = param->listOptions[o2].value; + option = param->listOptions[o2].value.toStdString(); option = option.UpCase(); } else if(param->type == "integer") { - value = GetAsString(param->name); + value = GetAsString(param->name).toStdString(); value = value.Trim("\n\r\t\f\v\b"); - option = param->listOptions[o2].value; + option = param->listOptions[o2].value.toStdString(); option = option.Trim("\n\r\t\f\v\b"); } if(value == option) { @@ -3198,8 +3198,8 @@ void IsisAml::StartParser(const char *xmlfile) { catch(const XERCES::XMLException &toCatch) { - QString message = "Error during XML parser initialization" + - (QString)XERCES::XMLString::transcode(toCatch.getMessage()); + std::string message = "Error during XML parser initialization" + + (std::string)XERCES::XMLString::transcode(toCatch.getMessage()); throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); return; } @@ -3242,8 +3242,8 @@ void IsisAml::StartParser(const char *xmlfile) { parser->parse(xmlfile); } catch (const XERCES::XMLException &toCatch) { - QString message = "Error in application XML file: " + - (QString)XERCES::XMLString::transcode(toCatch.getMessage()); + std::string message = "Error in application XML file: " + + (std::string)XERCES::XMLString::transcode(toCatch.getMessage()); throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_); XERCES::XMLPlatformUtils::Terminate(); return; @@ -3252,8 +3252,8 @@ void IsisAml::StartParser(const char *xmlfile) { // Stacked error messages are generated containing the file path and additional data about where the error occurred. catch (Isis::IException &e) { QString filePath = (QString) xmlfile; - QString previousErrorMessage = (QString) e.toString(); - QString additionalErrorMessage = "Error while parsing application XML file [" + filePath + "]"; + std::string previousErrorMessage = e.toString(); + std::string additionalErrorMessage = "Error while parsing application XML file [" + filePath.toStdString() + "]"; throw Isis::IException(Isis::IException::Programmer, additionalErrorMessage + "\n" + previousErrorMessage, _FILEINFO_); XERCES::XMLPlatformUtils::Terminate(); diff --git a/isis/src/base/objs/IsisAml/IsisXMLHandler.cpp b/isis/src/base/objs/IsisAml/IsisXMLHandler.cpp index b1ca6ccc1a..14f996e1df 100644 --- a/isis/src/base/objs/IsisAml/IsisXMLHandler.cpp +++ b/isis/src/base/objs/IsisAml/IsisXMLHandler.cpp @@ -11,6 +11,7 @@ find files of those names at the top level of this repository. **/ #include #include +#include #include "IException.h" diff --git a/isis/src/base/objs/JP2Decoder/JP2Decoder.cpp b/isis/src/base/objs/JP2Decoder/JP2Decoder.cpp index 2353a864be..8b5929b4cb 100644 --- a/isis/src/base/objs/JP2Decoder/JP2Decoder.cpp +++ b/isis/src/base/objs/JP2Decoder/JP2Decoder.cpp @@ -61,7 +61,7 @@ namespace Isis { // Open the JP2 source JP2_Source = new jp2_source(); if(!JP2_Source->open(JP2_Stream)) { - QString msg = "Unable to open the decoder because the source file "; + std::string msg = "Unable to open the decoder because the source file "; msg += "does not have valid JP2 format content [" + p_jp2File + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -86,7 +86,7 @@ namespace Isis { p_pixelBytes = (p_pixelBits >> 3) + ((p_pixelBits % 8) ? 1 : 0); if(p_pixelBytes == 3) p_pixelBytes = 4; if(p_pixelBits > 16 || p_pixelBytes > 2) { - QString msg = "The source file has unsupported pixel type "; + std::string msg = "The source file has unsupported pixel type "; msg += "[" + p_jp2File + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/JP2Decoder/JP2Decoder.h b/isis/src/base/objs/JP2Decoder/JP2Decoder.h index e6f79de547..4985ccf2be 100644 --- a/isis/src/base/objs/JP2Decoder/JP2Decoder.h +++ b/isis/src/base/objs/JP2Decoder/JP2Decoder.h @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include +#include #if ENABLEJP2K #include "jp2.h" diff --git a/isis/src/base/objs/JP2Exporter/JP2Exporter.cpp b/isis/src/base/objs/JP2Exporter/JP2Exporter.cpp index f3ce0a032d..00280fe156 100644 --- a/isis/src/base/objs/JP2Exporter/JP2Exporter.cpp +++ b/isis/src/base/objs/JP2Exporter/JP2Exporter.cpp @@ -65,11 +65,11 @@ namespace Isis { void JP2Exporter::write(FileName outputName, int quality, QString compression, UserInterface *ui) { - outputName = outputName.addExtension(extension()); + outputName = outputName.addExtension(extension().toStdString()); PixelType type = pixelType(); m_encoder = new JP2Encoder( - outputName.expanded(), samples(), lines(), bands(), type); + QString::fromStdString(outputName.expanded()), samples(), lines(), bands(), type); m_encoder->OpenFile(); ImageExporter::write(outputName, quality, compression, ui); diff --git a/isis/src/base/objs/JP2Importer/JP2Importer.cpp b/isis/src/base/objs/JP2Importer/JP2Importer.cpp index c7355283d4..1eda4680aa 100644 --- a/isis/src/base/objs/JP2Importer/JP2Importer.cpp +++ b/isis/src/base/objs/JP2Importer/JP2Importer.cpp @@ -26,7 +26,7 @@ namespace Isis { try { // Determine if input file is a JPEG2000 file - m_decoder = new JP2Decoder(inputName.expanded()); + m_decoder = new JP2Decoder(QString::fromStdString(inputName.expanded())); m_decoder->OpenFile(); setSamples(m_decoder->GetSampleDimension()); setLines(m_decoder->GetLineDimension()); diff --git a/isis/src/base/objs/Kernels/Kernels.cpp b/isis/src/base/objs/Kernels/Kernels.cpp index c56c5ed7ea..d0af6d6d6c 100644 --- a/isis/src/base/objs/Kernels/Kernels.cpp +++ b/isis/src/base/objs/Kernels/Kernels.cpp @@ -866,7 +866,7 @@ namespace Isis { // Find types and return requested types QStringList tlist = ktypes.split(","); for (int k = 0 ; k < tlist.size() ; k++) { - tlist[k] = IString(tlist[k]).Trim(" \r\n\t\v\b\f").UpCase().ToQt(); + tlist[k] = QString::fromStdString(IString(tlist[k].toStdString()).Trim(" \r\n\t\v\b\f").UpCase()); } return (tlist); } @@ -1044,11 +1044,11 @@ namespace Isis { Kernels::KernelFile Kernels::examine(const QString &kfile, const bool &manage) const { - FileName kernfile(kfile); + FileName kernfile(kfile.toStdString()); KernelFile kf; kf.pathname = kfile; - kf.name = kernfile.name(); - kf.fullpath = kernfile.expanded(); + kf.name = QString::fromStdString(kernfile.name()); + kf.fullpath = QString::fromStdString(kernfile.expanded()); kf.exists = kernfile.fileExists(); kf.ktype = "UNKNOWN"; kf.loaded = false; // Assumes its not loaded @@ -1073,7 +1073,7 @@ namespace Isis { if (found == SPICETRUE) { kf.loaded = true; kf.managed = false; - kf.ktype = IString(ktype).UpCase().ToQt(); + kf.ktype = QString::fromStdString(IString(ktype).UpCase()); } } } @@ -1106,8 +1106,8 @@ namespace Isis { * "UNKNOWN" is returned. */ QString Kernels::resolveType(const QString &kfile) const { - FileName kernFile(kfile); - QString kpath = kernFile.expanded(); + FileName kernFile(kfile.toStdString()); + QString kpath = QString::fromStdString(kernFile.expanded()); ifstream ifile(kpath.toLatin1().data(), ios::in | ios::binary); QString ktype("UNKNOWN"); if (ifile) { @@ -1119,7 +1119,7 @@ namespace Isis { // See if the file is a known NAIF type. Assume it has been // extracted from a NAIF compliant kernel - QString istr = IString(ibuf).Trim(" \n\r\f\t\v\b").ToQt(); + QString istr = QString::fromStdString(IString(ibuf).Trim(" \n\r\f\t\v\b")); if (istr.contains("/")) { ktype = istr.split("/").last(); } @@ -1184,7 +1184,7 @@ namespace Isis { QString ktype(iktype); // Set default condition // Deciminate file parts - FileName kf(kfile); + FileName kf(kfile.toStdString()); string ext = IString(kf.extension()).DownCase(); // Check extensions for types diff --git a/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp index 96eb716493..bfc23e58c1 100644 --- a/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp +++ b/isis/src/base/objs/LabelTranslationManager/LabelTranslationManager.cpp @@ -16,6 +16,9 @@ find files of those names at the top level of this repository. **/ #include "PvlKeyword.h" #include "PvlObject.h" +#include +#include + using namespace std; namespace Isis { @@ -181,7 +184,7 @@ QStringList LabelTranslationManager::parseSpecification(QString specification) c if (typeSplit[0].toLower() != "att" && typeSplit[0].toLower() != "tag" && typeSplit[0].toLower() != "new") { - QString msg = "Dependency type specification [" + typeSplit[0] + + std::string msg = "Dependency type specification [" + typeSplit[0].toStdString() + "] is invalid. Valid types are [att], [tag] and [new]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -195,7 +198,7 @@ QStringList LabelTranslationManager::parseSpecification(QString specification) c parsedSpecification.append(nameValueSplit); } else { //nameValueSplit is an unexpected value - QString msg = "Malformed dependency specification [" + specification + "]."; + std::string msg = "Malformed dependency specification [" + specification.toStdString() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -206,13 +209,13 @@ QStringList LabelTranslationManager::parseSpecification(QString specification) c parsedSpecification = barSplit; } else { //nameValueSplit is an unexpected value - QString msg = " [" + specification + "] has unexpected number of '@' or '|' delimiters"; + std::string msg = " [" + specification.toStdString() + "] has unexpected number of '@' or '|' delimiters"; throw IException(IException::Programmer,msg, _FILEINFO_); } } catch (IException &e) { - QString msg = "Malformed dependency specification [" + specification + "]."; + std::string msg = "Malformed dependency specification [" + specification.toStdString() + "]."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp b/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp index 41263156e9..f30e110e0b 100644 --- a/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp +++ b/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp @@ -78,7 +78,7 @@ namespace Isis { mapGroup += PvlKeyword("CenterLongitude", std::to_string(centerLon), "Degrees"); } else { - QString message = "Cannot project using Lambert Azimuthal equal-area"; + std::string message = "Cannot project using Lambert Azimuthal equal-area"; message += " without [CenterLongitude] value. Keyword does not exist"; message += " in labels and defaults are not allowed."; throw IException(IException::Unknown, message, _FILEINFO_); @@ -93,7 +93,7 @@ namespace Isis { mapGroup += PvlKeyword("CenterLatitude", std::to_string(centerLat), "Degrees"); } else { - QString message = "Cannot project using Lambert Azimuthal equal-area"; + std::string message = "Cannot project using Lambert Azimuthal equal-area"; message += " without [CenterLatitude] value. Keyword does not exist"; message += " in labels and defaults are not allowed."; throw IException(IException::Unknown, message, _FILEINFO_); diff --git a/isis/src/base/objs/LambertConformal/LambertConformal.cpp b/isis/src/base/objs/LambertConformal/LambertConformal.cpp index 0176832898..c928c17a8a 100644 --- a/isis/src/base/objs/LambertConformal/LambertConformal.cpp +++ b/isis/src/base/objs/LambertConformal/LambertConformal.cpp @@ -88,17 +88,17 @@ namespace Isis { // Test to make sure standard parallels are valid if (fabs(m_par1) > 90.0 || fabs(m_par2) > 90.0) { - QString message = "Standard Parallels must between -90 and 90"; + std::string message = "Standard Parallels must between -90 and 90"; throw IException(IException::Unknown, message, _FILEINFO_); } if (fabs(m_par1 + m_par2) < DBL_EPSILON) { - QString message = "Standard Parallels cannot be symmetric to the equator"; + std::string message = "Standard Parallels cannot be symmetric to the equator"; throw IException(IException::Unknown, message, _FILEINFO_); } // Removed because this test only works for northern hemisphere // Just reorder the parallels so p1 is at the larger radius of the two //if (m_par1 > m_par2) { - // QString message = "Standard Parallels must be ordered"; + // std::string message = "Standard Parallels must be ordered"; // throw IException::Message(IException::Projection,message,_FILEINFO_); //} @@ -164,7 +164,7 @@ namespace Isis { m_rho = m_equatorialRadius * m_f * pow(tclat, m_n); } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/Latitude/Latitude.cpp b/isis/src/base/objs/Latitude/Latitude.cpp index da4df2284d..25764deb66 100644 --- a/isis/src/base/objs/Latitude/Latitude.cpp +++ b/isis/src/base/objs/Latitude/Latitude.cpp @@ -108,7 +108,7 @@ namespace Isis { Distance::Meters); } catch (IException &e) { - QString msg = "Unable to create Latitude object from given mapping group."; + std::string msg = "Unable to create Latitude object from given mapping group."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -168,7 +168,7 @@ namespace Isis { Distance::Meters); } catch (IException &e) { - QString msg = "Unable to create Latitude object from given mapping group."; + std::string msg = "Unable to create Latitude object from given mapping group."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -226,7 +226,7 @@ namespace Isis { setPlanetographic(latitude, latitudeUnits); } else { - QString msg = "Enumeration value [" + toString(latType) + "] is not a valid CoordinateType"; + std::string msg = "Enumeration value [" + std::to_string(latType) + "] is not a valid CoordinateType"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -315,7 +315,7 @@ namespace Isis { double Latitude::planetographic(Angle::Units units) const { if (m_equatorialRadius == NULL || m_polarRadius == NULL) { - QString msg = "Latitude [" + toString(true) + "] cannot " + std::string msg = "Latitude [" + std::to_string(true) + "] cannot " "be converted to Planetographic without the planetary radii, please " "use the other Latitude constructor."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -323,13 +323,13 @@ namespace Isis { if (*this > Angle(90.0, Angle::Degrees) || *this < Angle(-90.0, Angle::Degrees)) { - QString msg = "Latitudes outside of the -90/90 range cannot be converted " + std::string msg = "Latitudes outside of the -90/90 range cannot be converted " "between Planetographic and Planetocentric"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (!isValid()) { - QString msg = "Invalid planetographic latitudes are not currently " + std::string msg = "Invalid planetographic latitudes are not currently " "supported"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -360,7 +360,7 @@ namespace Isis { void Latitude::setPlanetographic(double latitude, Angle::Units units) { if (m_equatorialRadius == NULL || m_polarRadius == NULL) { - QString msg = "Latitude [" + Isis::toString(latitude) + " degrees] cannot be " + std::string msg = "Latitude [" + Isis::toString(latitude) + " degrees] cannot be " "converted to Planetocentic without the planetary radii, please use " "the other Latitude constructor."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -370,7 +370,7 @@ namespace Isis { if (inputAngle > Angle(90.0, Angle::Degrees) || inputAngle < Angle(-90.0, Angle::Degrees)) { - QString msg = "Latitudes outside of the -90/90 range cannot be converted " + std::string msg = "Latitudes outside of the -90/90 range cannot be converted " "between Planetographic and Planetocentric"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -379,7 +379,7 @@ namespace Isis { // when passing in a special pixel. // Left this here just in case the functionality in Angle changes. if (IsSpecial(latitude)) { - QString msg = "Invalid planetographic latitudes are not currently " + std::string msg = "Invalid planetographic latitudes are not currently " "supported"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -440,9 +440,9 @@ namespace Isis { // Validity check on the range if (min > max) { - QString msg = "Minimum latitude [" + min.toString(true) + + std::string msg = "Minimum latitude [" + min.toString(true).toStdString() + "] is greater than maximum latitude [" + - max.toString(true) + "]"; + max.toString(true).toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -521,7 +521,7 @@ namespace Isis { Distance::Meters); } catch (IException &e) { - QString msg = "Unable to add angle to Latitude object from given mapping group."; + std::string msg = "Unable to add angle to Latitude object from given mapping group."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -588,7 +588,7 @@ namespace Isis { Angle tmpAngle(angle, units); if (tmpAngle > Angle(90, Angle::Degrees) || tmpAngle < Angle(-90, Angle::Degrees)) { - QString msg = "Latitudes past 90 degrees are not valid. The latitude [" + std::string msg = "Latitudes past 90 degrees are not valid. The latitude [" + Isis::toString(tmpAngle.degrees(), 8) + "] is not allowed"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/LeastSquares/LeastSquares.cpp b/isis/src/base/objs/LeastSquares/LeastSquares.cpp index f3a1a406d5..f86aea4e5c 100644 --- a/isis/src/base/objs/LeastSquares/LeastSquares.cpp +++ b/isis/src/base/objs/LeastSquares/LeastSquares.cpp @@ -36,7 +36,7 @@ namespace Isis { // make sure sparse nrows/ncols have been set if (sparseRows == 0 || sparseCols == 0) { - QString msg = "If solving using sparse matrices, you must enter the " + std::string msg = "If solving using sparse matrices, you must enter the " "number of rows/columns"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -96,8 +96,8 @@ namespace Isis { void LeastSquares::AddKnown(const std::vector &data, double result, double weight) { if((int) data.size() != p_basis->Variables()) { - QString msg = "Number of elements in data does not match basis [" + - p_basis->Name() + "] requirements"; + std::string msg = "Number of elements in data does not match basis [" + + p_basis->Name().toStdString() + "] requirements"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -157,7 +157,7 @@ namespace Isis { */ std::vector LeastSquares::GetInput(int row) const { if((row >= Rows()) || (row < 0)) { - QString msg = "Index out of bounds [Given = " + toString(row) + "]"; + std::string msg = "Index out of bounds [Given = " + toString(row) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } return p_input[row]; @@ -172,7 +172,7 @@ namespace Isis { */ double LeastSquares::GetExpected(int row) const { if((row >= Rows()) || (row < 0)) { - QString msg = "Index out of bounds [Given = " + toString(row) + "]"; + std::string msg = "Index out of bounds [Given = " + toString(row) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } return p_expected[row]; @@ -207,7 +207,7 @@ namespace Isis { if((method == SPARSE && p_sparseRows == 0) || (method != SPARSE && Rows() == 0 )) { p_solved = false; - QString msg = "No solution available because no input data was provided"; + std::string msg = "No solution available because no input data was provided"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -290,7 +290,7 @@ namespace Isis { // If the rank of the matrix is not large enough we don't // have enough coefficients for the solution if (coefs.dim1() < p_basis->Coefficients()) { - QString msg = "Unable to solve least-squares using SVD method. No " + std::string msg = "Unable to solve least-squares using SVD method. No " "solution available. Not enough knowns or knowns are " "co-linear ... [Unknowns = " + toString(p_basis->Coefficients()) + "] [Knowns = " @@ -365,7 +365,7 @@ namespace Isis { // to be successful int full = qr.isFullRank(); if(full == 0) { - QString msg = "Unable to solve-least squares using QR Decomposition. " + std::string msg = "Unable to solve-least squares using QR Decomposition. " "The upper triangular R matrix is not full rank"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -456,7 +456,7 @@ namespace Isis { bool status = spsolve(p_xSparse, p_normals, p_ATb, "superlu"); if (status == false) { - QString msg = "Could not solve sparse least squares problem."; + std::string msg = "Could not solve sparse least squares problem."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -552,7 +552,7 @@ namespace Isis { */ double LeastSquares::Evaluate(const std::vector &data) { if(!p_solved) { - QString msg = "Unable to evaluate until a solution has been computed"; + std::string msg = "Unable to evaluate until a solution has been computed"; throw IException(IException::Programmer, msg, _FILEINFO_); } return p_basis->Evaluate(data); @@ -569,7 +569,7 @@ namespace Isis { */ std::vector LeastSquares::Residuals() const { if(!p_solved) { - QString msg = "Unable to return residuals until a solution has been computed"; + std::string msg = "Unable to return residuals until a solution has been computed"; throw IException(IException::Programmer, msg, _FILEINFO_); } return p_residuals; @@ -589,7 +589,7 @@ namespace Isis { */ double LeastSquares::Residual(int i) const { if(!p_solved) { - QString msg = "Unable to return residuals until a solution has been computed"; + std::string msg = "Unable to return residuals until a solution has been computed"; throw IException(IException::Programmer, msg, _FILEINFO_); } return p_residuals[i]; diff --git a/isis/src/base/objs/LidarData/LidarData.cpp b/isis/src/base/objs/LidarData/LidarData.cpp index b4f58df457..df43e576ce 100644 --- a/isis/src/base/objs/LidarData/LidarData.cpp +++ b/isis/src/base/objs/LidarData/LidarData.cpp @@ -60,7 +60,7 @@ namespace Isis { QSharedPointer LidarData::point(QString pointId) const{ QSharedPointer point = m_points.value(pointId, 0); if (!point) { - QString msg = "Point " + pointId + " is not in the lidar data."; + std::string msg = "Point " + pointId.toStdString() + " is not in the lidar data."; throw IException(IException::Programmer, msg, _FILEINFO_); } return point; @@ -175,8 +175,8 @@ namespace Isis { Isis::Camera *cam = p_cameraMap[serialNumber]; if (cam == NULL) { - IString msg = "Lidar Control point [" + curPoint->GetId() + - "], measure [" + curMeasure->GetCubeSerialNumber() + + IString msg = "Lidar Control point [" + curPoint->GetId().toStdString() + + "], measure [" + curMeasure->GetCubeSerialNumber().toStdString() + "] does not have a cube in the ISIS control net with a matching serial number"; throw IException(IException::User, msg, _FILEINFO_); } @@ -222,7 +222,7 @@ namespace Isis { for (int i = 0; i < list.size(); i++) { QString serialNumber = list.serialNumber(i); QString filename = list.fileName(i); - Cube cube(filename, "r"); + Cube cube(filename.toStdString(), "r"); try { Isis::Camera *cam = CameraFactory::Create(cube); @@ -232,8 +232,8 @@ namespace Isis { p_cameraList.push_back(cam); } catch (IException &e) { - QString msg = "Unable to create camera for cube file "; - msg += filename; + std::string msg = "Unable to create camera for cube file "; + msg += filename.toStdString(); throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -259,8 +259,8 @@ namespace Isis { if (!curMeasure->IsIgnored()) p_cameraValidMeasuresMap[serialNumber]++; } else { - IString msg = "Control point [" + curPoint->GetId() + - "], measure [" + curMeasure->GetCubeSerialNumber() + + IString msg = "Control point [" + curPoint->GetId().toStdString() + + "], measure [" + curMeasure->GetCubeSerialNumber().toStdString() + "] does not have a cube with a matching serial number"; throw IException(IException::User, msg, _FILEINFO_); } @@ -280,10 +280,10 @@ namespace Isis { */ void LidarData::read(FileName lidarDataFile) { // Set up the input file - QFile loadFile(lidarDataFile.expanded()); + QFile loadFile(QString::fromStdString(lidarDataFile.expanded())); // Make sure we can open the file successfully if (!loadFile.open(QIODevice::ReadOnly)) { - QString msg("Could not open " + loadFile.fileName()); + std::string msg("Could not open " + loadFile.fileName().toStdString()); throw IException(IException::User, msg, _FILEINFO_); } @@ -499,10 +499,10 @@ namespace Isis { else { outputFile = outputFile.setExtension("dat"); } - QFile saveFile(outputFile.expanded()); + QFile saveFile(QString::fromStdString(outputFile.expanded())); if (!saveFile.open(QIODevice::WriteOnly)) { - QString msg("Could not open " + saveFile.fileName()); + std::string msg("Could not open " + saveFile.fileName().toStdString()); throw IException(IException::User, msg, _FILEINFO_); } @@ -681,7 +681,7 @@ namespace Isis { */ QList< ControlMeasure * > LidarData::GetMeasuresInCube(QString serialNumber) { if( !ValidateSerialNumber(serialNumber) ) { - IString msg = "Cube Serial Number [" + serialNumber + "] not found in " + IString msg = "Cube Serial Number [" + serialNumber.toStdString() + "] not found in " "the network"; throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/base/objs/LidarData/unitTest.cpp b/isis/src/base/objs/LidarData/unitTest.cpp index ba8cd8076f..c3bdd705f3 100644 --- a/isis/src/base/objs/LidarData/unitTest.cpp +++ b/isis/src/base/objs/LidarData/unitTest.cpp @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) { cout << outputFile.extension() << endl; outputFile = outputFile.setExtension("dat"); cout << outputFile.extension() << endl; - cout << outputFile.expanded().toStdString() << endl; + cout << outputFile.expanded() << endl; mockData.write(outputFile, LidarData::Binary); // Test read() binary format diff --git a/isis/src/base/objs/LineManager/LineManager.cpp b/isis/src/base/objs/LineManager/LineManager.cpp index d2a28620fd..1515b3a6e6 100644 --- a/isis/src/base/objs/LineManager/LineManager.cpp +++ b/isis/src/base/objs/LineManager/LineManager.cpp @@ -43,7 +43,7 @@ namespace Isis { bool LineManager::SetLine(const int line, const int band) { if(line < 1) { - QString message = "LineManager is unable to set the line to [" + std::string message = "LineManager is unable to set the line to [" + toString(line) + "]. Minimum line value is 1."; throw IException(IException::Programmer, message, _FILEINFO_); } diff --git a/isis/src/base/objs/LinearAlgebra/LinearAlgebra.cpp b/isis/src/base/objs/LinearAlgebra/LinearAlgebra.cpp index c86fa7ab93..b5ebeb51ed 100644 --- a/isis/src/base/objs/LinearAlgebra/LinearAlgebra.cpp +++ b/isis/src/base/objs/LinearAlgebra/LinearAlgebra.cpp @@ -383,7 +383,7 @@ namespace Isis { */ LinearAlgebra::Matrix LinearAlgebra::identity(int size) { if (size < 1) { - QString msg = "Can not create identity matrix of negative size [" + std::string msg = "Can not create identity matrix of negative size [" + toString((int) size) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -439,7 +439,7 @@ namespace Isis { */ double LinearAlgebra::determinant(const Matrix &matrix) { if ( (matrix.size1() != matrix.size2()) || (matrix.size1() != 2 && matrix.size1() != 3) ) { - QString msg = "Unable to calculate the determinant for the given matrix. " + std::string msg = "Unable to calculate the determinant for the given matrix. " "This method only calculates the determinant for 2x2 or 3x3 matrices." "The given matrix is [" + toString((int) matrix.size1()) + "x" + toString((int) matrix.size2()) + "]."; @@ -549,7 +549,7 @@ namespace Isis { LinearAlgebra::Matrix LinearAlgebra::multiply(const Matrix &matrix1, const Matrix &matrix2) { // Check to make sure we can multiply if (matrix1.size2() != matrix2.size1()) { - QString msg = "Unable to multiply matrices with mismatched dimensions. " + std::string msg = "Unable to multiply matrices with mismatched dimensions. " "The left matrix has [" + toString((int) matrix1.size2()) + "] columns and the right matrix has [" + toString((int) matrix2.size1()) + "] rows."; @@ -580,7 +580,7 @@ namespace Isis { LinearAlgebra::Vector LinearAlgebra::multiply(const Matrix &matrix, const Vector &vector) { // Check to make sure we can multiply if (matrix.size2() != vector.size()) { - QString msg = "Unable to multiply matrix and vector with mismatched dimensions." + std::string msg = "Unable to multiply matrix and vector with mismatched dimensions." "The given vector has [" + toString((int) vector.size()) + "] components and the given matrix has [" + toString((int) matrix.size2()) + "] columns."; @@ -634,7 +634,7 @@ namespace Isis { LinearAlgebra::Vector LinearAlgebra::add(const Vector &vector1, const Vector &vector2) { // Vectors best be the same size if (vector1.size() != vector2.size()) { - QString msg = "Unable to add vectors with mismatched sizes." + std::string msg = "Unable to add vectors with mismatched sizes." "Vector1 has [" + toString((int) vector1.size()) + "] components and vector2 has [" + toString((int) vector2.size()) + "] components."; @@ -660,7 +660,7 @@ namespace Isis { LinearAlgebra::Vector LinearAlgebra::subtract(const Vector &vector1, const Vector &vector2) { // Vectors best be the same size if (vector1.size() != vector2.size()) { - QString msg = "Unable to subtract vectors with mismatched sizes." + std::string msg = "Unable to subtract vectors with mismatched sizes." "Vector1 has [" + toString((int) vector1.size()) + "] components and vector2 has [" + toString((int) vector2.size()) + "] components."; @@ -687,7 +687,7 @@ namespace Isis { */ LinearAlgebra::Vector LinearAlgebra::crossProduct(const Vector &vector1, const Vector &vector2) { if ((vector1.size() != 3) || (vector2.size() != 3)) { - QString msg = "Unable to calculate the cross product on vectors that are not size 3. " + std::string msg = "Unable to calculate the cross product on vectors that are not size 3. " "Vector1 has [" + toString((int) vector1.size()) + "] components and vector2 has [" + toString((int) vector2.size()) + "] components."; @@ -756,7 +756,7 @@ namespace Isis { */ LinearAlgebra::Matrix LinearAlgebra::outerProduct(const Vector &vector1, const Vector &vector2) { if (vector1.size() != vector2.size()) { - QString msg = "Unable to compute the outer product for vectors with mismatched sizes." + std::string msg = "Unable to compute the outer product for vectors with mismatched sizes." "Vector1 has [" + toString((int) vector1.size()) + "] components and vector2 has [" + toString((int) vector2.size()) + "] components."; @@ -800,7 +800,7 @@ namespace Isis { */ double LinearAlgebra::innerProduct(const Vector &vector1, const Vector &vector2) { if (vector1.size() != vector2.size()) { - QString msg = "Unable to compute the dot product for vectors with mismatched sizes." + std::string msg = "Unable to compute the dot product for vectors with mismatched sizes." "Vector1 has [" + toString((int) vector1.size()) + "] components and vector2 has [" + toString((int) vector2.size()) + "] components."; @@ -832,7 +832,7 @@ namespace Isis { // derived from naif's vproj routine LinearAlgebra::Vector LinearAlgebra::project(const Vector &vector1, const Vector &vector2) { if (vector1.size() != vector2.size()) { - QString msg = "Unable to project vector1 onto vector2 with mismatched sizes." + std::string msg = "Unable to project vector1 onto vector2 with mismatched sizes." "Vector1 has [" + toString((int) vector1.size()) + "] components and vector2 has [" + toString((int) vector2.size()) + "] components."; @@ -872,7 +872,7 @@ namespace Isis { LinearAlgebra::Vector LinearAlgebra::rotate(const Vector &vector, const Vector &axis, Angle angle) { if ((vector.size() != 3) || (axis.size() != 3)) { - QString msg = "Unable to rotate vector about the given axis and angle. " + std::string msg = "Unable to rotate vector about the given axis and angle. " "Vectors must be of size 3 to perform rotation. " "The given vector has [" + toString((int) vector.size()) + "] components and the given axis has [" @@ -973,7 +973,7 @@ namespace Isis { LinearAlgebra::AxisAngle LinearAlgebra::toAxisAngle(const Matrix &rotationMatrix) { if ((rotationMatrix.size1() != 3) || (rotationMatrix.size2() != 3)) { - QString msg = "Unable to convert the given matrix to an axis of rotation " + std::string msg = "Unable to convert the given matrix to an axis of rotation " "and a rotation angle. A 3x3 matrix is required. The given matrix is [" + toString((int) rotationMatrix.size1()) + "x" + toString((int) rotationMatrix.size2()) + "]."; @@ -1053,7 +1053,7 @@ namespace Isis { // check there are 3 axes in the set {1,2,3} with center axis not equal to first or last if (axes.size() != 3) { - QString msg = "Unable to convert the given matrix to Euler angles. " + std::string msg = "Unable to convert the given matrix to Euler angles. " "Exactly 3 axis codes are required. The given list has [" + toString((int) axes.size()) + "] axes."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1064,14 +1064,14 @@ namespace Isis { if (!validAxes.contains(axes[0]) || !validAxes.contains(axes[1]) || !validAxes.contains(axes[2])) { - QString msg = "Unable to convert the given matrix to Euler angles using the given axis codes " + std::string msg = "Unable to convert the given matrix to Euler angles using the given axis codes " "[" + toString(axes[0]) + ", " + toString(axes[1]) + ", " + toString(axes[2]) + "]. Axis codes must be 1, 2, or 3."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (axes[0] == axes[1] || axes[1] == axes[2]) { - QString msg = "Unable to convert the given matrix to Euler angles using the given axis codes " + std::string msg = "Unable to convert the given matrix to Euler angles using the given axis codes " "[" + toString(axes[0]) + ", " + toString(axes[1]) + ", " + toString(axes[2]) + "]. The middle axis code must differ from its neighbors."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1079,7 +1079,7 @@ namespace Isis { // check the matrix is 3x3 rotation if ((rotationMatrix.size1() != 3) || (rotationMatrix.size2() != 3)) { - QString msg = "Unable to convert the given matrix to Euler angles. A 3x3 matrix is required. " + std::string msg = "Unable to convert the given matrix to Euler angles. A 3x3 matrix is required. " "The given matrix is [" + toString((int) rotationMatrix.size1()) + "x" + toString((int) rotationMatrix.size2()) + "]."; @@ -1211,7 +1211,7 @@ namespace Isis { LinearAlgebra::Vector LinearAlgebra::toQuaternion(const Matrix &rotationMatrix) { if ((rotationMatrix.size1() != 3) || (rotationMatrix.size2() != 3)) { - QString msg = "Unable to convert the given matrix to a quaternion. " + std::string msg = "Unable to convert the given matrix to a quaternion. " "A 3x3 matrix is required. The given matrix is [" + toString((int) rotationMatrix.size1()) + "x" + toString((int) rotationMatrix.size2()) + "]."; @@ -1220,7 +1220,7 @@ namespace Isis { // if given matrix is not a rotation matrix, we can't proceed. if ( !isRotationMatrix(rotationMatrix) ) { - QString msg = "Unable to convert the given matrix to an axis of rotation " + std::string msg = "Unable to convert the given matrix to an axis of rotation " "and a rotation angle. The given matrix is not a rotation matrix."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1404,7 +1404,7 @@ namespace Isis { // Derived from NAIF's axisar routine LinearAlgebra::Matrix LinearAlgebra::toMatrix(const Vector &axis, Angle angle) { if (axis.size() != 3) { - QString msg = "Unable to convert the given vector and angle to a rotation matrix. " + std::string msg = "Unable to convert the given vector and angle to a rotation matrix. " "The given vector with size [" + toString((int) axis.size()) + "] is not a 3D axis vector."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1467,7 +1467,7 @@ namespace Isis { if (!validAxes.contains(angle3.second) || !validAxes.contains(angle2.second) || !validAxes.contains(angle1.second)) { - QString msg = "Unable to convert the given Euler angles to a matrix using the given axis " + std::string msg = "Unable to convert the given Euler angles to a matrix using the given axis " "codes [" + toString(angle3.second) + ", " + toString(angle2.second) + ", " + toString(angle1.second) + "]. Axis codes must be 1, 2, or 3."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1545,7 +1545,7 @@ namespace Isis { LinearAlgebra::Matrix LinearAlgebra::toMatrix(const QList &eulerAngles) { if (eulerAngles.size() != 3) { - QString msg = "Unable to convert the given Euler angles to a matrix. " + std::string msg = "Unable to convert the given Euler angles to a matrix. " "Exactly 3 Euler angles are required. The given list has [" + toString((int) eulerAngles.size()) + "] angles."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1571,7 +1571,7 @@ namespace Isis { // Derived from NAIF's q2m routine LinearAlgebra::Matrix LinearAlgebra::toMatrix(const Vector &quaternion) { if (quaternion.size() != 4) { - QString msg = "Unable to convert the given vector to a rotation matrix. " + std::string msg = "Unable to convert the given vector to a rotation matrix. " "The given vector with [" + toString((int) quaternion.size()) + "] components is not a quaternion."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1625,7 +1625,7 @@ namespace Isis { */ void LinearAlgebra::setRow(Matrix &matrix, const Vector &vector, int rowIndex) { if ( (rowIndex+1 > (int) matrix.size1()) ) { - QString msg = "Unable to set the matrix row to the given vector. Row index " + std::string msg = "Unable to set the matrix row to the given vector. Row index " + toString(rowIndex) + " is out of bounds. The given matrix only has " + toString((int) matrix.size1()) + " rows." ; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1646,7 +1646,7 @@ namespace Isis { */ void LinearAlgebra::setColumn(Matrix &matrix, const Vector &vector, int columnIndex) { if ( (columnIndex+1 > (int) matrix.size2()) ) { - QString msg = "Unable to set the matrix column to the given vector. Column index " + std::string msg = "Unable to set the matrix column to the given vector. Column index " + toString(columnIndex) + " is out of bounds. The given matrix only has " + toString((int) matrix.size1()) + " columns." ; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1669,7 +1669,7 @@ namespace Isis { */ LinearAlgebra::Vector LinearAlgebra::row(const Matrix &matrix, int rowIndex) { if ( (rowIndex+1 > (int) matrix.size1()) ) { - QString msg = "Unable to get the matrix row to the given vector. Row index " + std::string msg = "Unable to get the matrix row to the given vector. Row index " + toString(rowIndex) + " is out of bounds. The given matrix only has " + toString((int) matrix.size1()) + " rows." ; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1692,7 +1692,7 @@ namespace Isis { */ LinearAlgebra::Vector LinearAlgebra::column(const Matrix &matrix, int columnIndex) { if ( (columnIndex+1 > (int) matrix.size2()) ) { - QString msg = "Unable to get the matrix column to the given vector. Column index " + std::string msg = "Unable to get the matrix column to the given vector. Column index " + toString(columnIndex) + " is out of bounds. The given matrix only has " + toString((int) matrix.size1()) + " columns." ; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1830,7 +1830,7 @@ namespace Isis { for (unsigned int i = 0; i < matrix.size1(); i++) { dbg.noquote() << " "; for (unsigned int j = 0; j < matrix.size2(); j++) { - dbg.noquote() << toString(matrix(i, j), 15) << " "; + dbg.noquote() << QString::fromStdString(toString(matrix(i, j), 15)) << " "; } dbg.noquote() << Qt::endl; } @@ -1852,7 +1852,7 @@ namespace Isis { QString toString(const LinearAlgebra::Vector &vector, int precision) { QString result = "( "; for (unsigned int i = 0; i < vector.size(); i++) { - result += toString(vector(i), precision); + result += QString::fromStdString(toString(vector(i), precision)); if (i != vector.size() - 1) result += ", "; } result += " )"; diff --git a/isis/src/base/objs/LunarAzimuthalEqualArea/LunarAzimuthalEqualArea.cpp b/isis/src/base/objs/LunarAzimuthalEqualArea/LunarAzimuthalEqualArea.cpp index 37fe3e2403..3b383b2073 100644 --- a/isis/src/base/objs/LunarAzimuthalEqualArea/LunarAzimuthalEqualArea.cpp +++ b/isis/src/base/objs/LunarAzimuthalEqualArea/LunarAzimuthalEqualArea.cpp @@ -38,7 +38,7 @@ namespace Isis { m_maxLibration *= PI / 180.0; } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(IException::Unknown, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp b/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp index a20a31ab09..62eae50207 100755 --- a/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp +++ b/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp @@ -17,19 +17,19 @@ namespace Isis { if (algo.hasKeyword("PhaseList")) { SetPhotoPhaseList(algo["PhaseList"]); } else { - QString msg = "The empirical Lunar Lambert phase list was not provided by user"; + std::string msg = "The empirical Lunar Lambert phase list was not provided by user"; throw IException(IException::User, msg, _FILEINFO_); } if (algo.hasKeyword("LList")) { SetPhotoLList(algo["LList"]); } else { - QString msg = "The empirical Lunar Lambert l exponent list was not provided by user"; + std::string msg = "The empirical Lunar Lambert l exponent list was not provided by user"; throw IException(IException::User, msg, _FILEINFO_); } if (algo.hasKeyword("PhaseCurveList")) { SetPhotoPhaseCurveList(algo["PhaseCurveList"]); } else { - QString msg = "The empirical Lunar Lambert phase brightness list was not provided by user"; + std::string msg = "The empirical Lunar Lambert phase brightness list was not provided by user"; throw IException(IException::User, msg, _FILEINFO_); } @@ -37,13 +37,13 @@ namespace Isis { p_photoPhaseAngleCount = (int)p_photoPhaseList.size(); if (p_photoPhaseAngleCount != (int)p_photoLList.size()) { - QString msg = "Number of empirical Lunar Lambert l list values must be equal"; + std::string msg = "Number of empirical Lunar Lambert l list values must be equal"; msg += "to number of phase angles provided"; throw IException(IException::User, msg, _FILEINFO_); } if (p_photoPhaseAngleCount != (int)p_photoPhaseCurveList.size()) { - QString msg = "Number of empirical Lunar Lambert phase curve list values must be equal"; + std::string msg = "Number of empirical Lunar Lambert phase curve list values must be equal"; msg += "to number of phase angles provided"; throw IException(IException::User, msg, _FILEINFO_); } @@ -79,14 +79,14 @@ namespace Isis { */ void LunarLambertEmpirical::SetPhotoPhaseList(QString phasestrlist) { double phaseangle; - IString strlist(phasestrlist); + IString strlist(phasestrlist.toStdString()); p_photoPhaseList.clear(); while (strlist.length()) { phaseangle = strlist.Token(","); if (phaseangle < 0.0 || phaseangle > 180.0) { - QString msg = "Invalid value of empirical Lunar Lambert phase angle list value [" + - toString(phaseangle) + "]"; + std::string msg = "Invalid value of empirical Lunar Lambert phase angle list value [" + + std::to_string(phaseangle) + "]"; throw IException(IException::User, msg, _FILEINFO_); } p_photoPhaseList.push_back(phaseangle); @@ -118,7 +118,7 @@ namespace Isis { phaseAngle = std::stod(phaseList[i]); if (phaseAngle < 0.0 || phaseAngle > 180.0) { - QString msg = "Invalid value of empirical Lunar Lambert phase angle list value [" + + std::string msg = "Invalid value of empirical Lunar Lambert phase angle list value [" + toString(phaseAngle) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -139,7 +139,7 @@ namespace Isis { */ void LunarLambertEmpirical::SetPhotoLList(QString lstrlist) { double lvalue; - IString strlist(lstrlist); + IString strlist(lstrlist.toStdString()); p_photoLList.clear(); while (strlist.length()) { @@ -183,7 +183,7 @@ namespace Isis { */ void LunarLambertEmpirical::SetPhotoPhaseCurveList(QString phasecurvestrlist) { double phasecurve; - IString strlist(phasecurvestrlist); + IString strlist(phasecurvestrlist.toStdString()); p_photoPhaseCurveList.clear(); while (strlist.length()) { diff --git a/isis/src/base/objs/Mercator/Mercator.cpp b/isis/src/base/objs/Mercator/Mercator.cpp index 072f56a269..208471ec97 100644 --- a/isis/src/base/objs/Mercator/Mercator.cpp +++ b/isis/src/base/objs/Mercator/Mercator.cpp @@ -73,7 +73,7 @@ namespace Isis { m_scalefactor = cos_clat / sqrt(1.0 - m_eccsq * sin_clat * sin_clat); } catch (IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/MinnaertEmpirical/MinnaertEmpirical.cpp b/isis/src/base/objs/MinnaertEmpirical/MinnaertEmpirical.cpp index eb45177b96..b8cfa9be0f 100755 --- a/isis/src/base/objs/MinnaertEmpirical/MinnaertEmpirical.cpp +++ b/isis/src/base/objs/MinnaertEmpirical/MinnaertEmpirical.cpp @@ -78,7 +78,7 @@ namespace Isis { */ void MinnaertEmpirical::SetPhotoPhaseList(QString phasestrlist) { double phaseangle; - IString strlist(phasestrlist); + IString strlist(phasestrlist.toStdString()); p_photoPhaseList.clear(); while (strlist.length()) { @@ -116,7 +116,7 @@ namespace Isis { phaseAngle = std::stod(phaseList[i]); if (phaseAngle < 0.0 || phaseAngle > 180.0) { - QString msg = "Invalid value of empirical Minnaert phase angle list value [" + + std::string msg = "Invalid value of empirical Minnaert phase angle list value [" + toString(phaseAngle) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -135,7 +135,7 @@ namespace Isis { */ void MinnaertEmpirical::SetPhotoKList(QString kstrlist) { double kvalue; - IString strlist(kstrlist); + IString strlist(kstrlist.toStdString()); p_photoKList.clear(); while (strlist.length()) { @@ -181,7 +181,7 @@ namespace Isis { */ void MinnaertEmpirical::SetPhotoPhaseCurveList(QString phasecurvestrlist) { double phasecurve; - IString strlist(phasecurvestrlist); + IString strlist(phasecurvestrlist.toStdString()); p_photoPhaseCurveList.clear(); while (strlist.length()) { diff --git a/isis/src/base/objs/Mollweide/Mollweide.cpp b/isis/src/base/objs/Mollweide/Mollweide.cpp index 535e9d2206..448a47dd3e 100644 --- a/isis/src/base/objs/Mollweide/Mollweide.cpp +++ b/isis/src/base/objs/Mollweide/Mollweide.cpp @@ -62,7 +62,7 @@ namespace Isis { if (m_longitudeDirection == PositiveWest) m_centerLongitude *= -1.0; } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/NaifDskApi/NaifDskApi.cpp b/isis/src/base/objs/NaifDskApi/NaifDskApi.cpp index 407dda9660..534d62f395 100755 --- a/isis/src/base/objs/NaifDskApi/NaifDskApi.cpp +++ b/isis/src/base/objs/NaifDskApi/NaifDskApi.cpp @@ -73,7 +73,7 @@ namespace Isis { for (int i = 0; i < tntMatrix.dim1(); i++) { dbg.nospace() << " "; for (int j = 0; j < tntMatrix.dim2(); j++) { - dbg.nospace() << toString(tntMatrix[i][j], 15) << " "; + dbg.nospace() << QString::fromStdString(toString(tntMatrix[i][j], 15)) << " "; } dbg.nospace() << Qt::endl; } @@ -95,7 +95,7 @@ namespace Isis { QString toString(const TNT::Array1D &naifArray, int precision) { QString result = "( "; for (int i = 0; i < naifArray.dim1(); i++) { - result += toString(naifArray[i], precision); + result += QString::fromStdString(toString(naifArray[i], precision)); if (i != naifArray.dim1() - 1) result += ", "; } result += " )"; diff --git a/isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp b/isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp index bb49a8dd72..983619b2c3 100755 --- a/isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp +++ b/isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp @@ -49,7 +49,7 @@ namespace Isis { NaifDskPlateModel::NaifDskPlateModel(const QString &dskfile) : m_dsk(0) { m_dsk = SharedNaifDskDescriptor(openDSK(dskfile)); if ( !isValid() ) { - QString mess = "Could not open DSK file " + dskfile; + std::string mess = "Could not open DSK file " + dskfile.toStdString(); throw IException(IException::User, mess, _FILEINFO_); } } @@ -147,7 +147,7 @@ namespace Isis { #if 0 if ( !isPlateIdValid(plateId) ) { - QString mess = "Plateid = " + QString::number(plateId) + " is invalid"; + std::string mess = "Plateid = " + QString::number(plateId) + " is invalid"; throw IException(IException::Programmer, mess, _FILEINFO_); } #endif @@ -294,7 +294,7 @@ namespace Isis { // Sanity check on plateid if ( !isPlateIdValid(plateid) ) { - QString mess = "Plateid = " + QString::number(plateid) + " is invalid"; + std::string mess = "Plateid = " + std::to_string(plateid) + " is invalid"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -345,9 +345,9 @@ namespace Isis { NaifDskPlateModel::NaifDskDescriptor *NaifDskPlateModel::openDSK(const QString &dskfile) { // Sanity check - FileName dskFile(dskfile); + FileName dskFile(dskfile.toStdString()); if ( !dskFile.fileExists() ) { - QString mess = "NAIF DSK file [" + dskfile + "] does not exist."; + std::string mess = "NAIF DSK file [" + dskfile.toStdString() + "] does not exist."; throw IException(IException::User, mess, _FILEINFO_); } @@ -355,7 +355,7 @@ namespace Isis { QScopedPointer dsk(new NaifDskDescriptor()); dsk->m_dskfile = dskfile; NaifStatus::CheckErrors(); - dasopr_c( dskFile.expanded().toLatin1().data(), &dsk->m_handle ); + dasopr_c( dskFile.expanded().c_str(), &dsk->m_handle ); NaifStatus::CheckErrors(); // Search to the first DLA segment @@ -363,7 +363,7 @@ namespace Isis { dlabfs_c( dsk->m_handle, &dsk->m_dladsc, &found ); NaifStatus::CheckErrors(); if ( !found ) { - QString mess = "No segments found in DSK file " + dskfile ; + std::string mess = "No segments found in DSK file " + dskfile.toStdString(); throw IException(IException::User, mess, _FILEINFO_); } @@ -386,7 +386,7 @@ namespace Isis { const NaifDskPlateModel::ErrAction &action) const { if ( ( Throw == action ) && ( !test ) ) { - throw IException(IException::Programmer, errmsg, _FILEINFO_); + throw IException(IException::Programmer, errmsg.toStdString(), _FILEINFO_); } // Looks good diff --git a/isis/src/base/objs/NaifDskShape/NaifDskShape.cpp b/isis/src/base/objs/NaifDskShape/NaifDskShape.cpp index d30426b7c8..c24995afe7 100755 --- a/isis/src/base/objs/NaifDskShape/NaifDskShape.cpp +++ b/isis/src/base/objs/NaifDskShape/NaifDskShape.cpp @@ -214,7 +214,7 @@ namespace Isis { // Sanity check if ( !hasIntersection() ) { // hasIntersection() <==> !m_intercept.isNull() - QString mess = "Intercept point does not exist - cannot provide normal vector"; + std::string mess = "Intercept point does not exist - cannot provide normal vector"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -265,7 +265,7 @@ namespace Isis { void NaifDskShape::calculateLocalNormal(QVector neighborPoints) { // Sanity check if ( !hasIntersection() ) { // hasIntersection() <==> !m_intercept.isNull() - QString mess = "Intercept point does not exist - cannot provide normal vector"; + std::string mess = "Intercept point does not exist - cannot provide normal vector"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -308,15 +308,15 @@ namespace Isis { // Sanity check on state if ( !hasIntersection() ) { - QString msg = "An intersection must be defined before computing the surface normal."; + std::string msg = "An intersection must be defined before computing the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } if ( !surfaceIntersection()->Valid() ) { - QString msg = "The surface point intersection must be valid to compute the surface normal."; + std::string msg = "The surface point intersection must be valid to compute the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (!hasValidTarget()) { - QString msg = "A valid target must be defined before computing the surface normal."; + std::string msg = "A valid target must be defined before computing the surface normal."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/NaifDskShape/unitTest.cpp b/isis/src/base/objs/NaifDskShape/unitTest.cpp index f27810526f..c73daee835 100755 --- a/isis/src/base/objs/NaifDskShape/unitTest.cpp +++ b/isis/src/base/objs/NaifDskShape/unitTest.cpp @@ -240,7 +240,7 @@ int main(int argc, char *argv[]) { catch (IException &e) { qDebug() << ""; qDebug() << ""; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/NaifStatus/NaifStatus.cpp b/isis/src/base/objs/NaifStatus/NaifStatus.cpp index 4cd6678d51..95dabbf2bf 100644 --- a/isis/src/base/objs/NaifStatus/NaifStatus.cpp +++ b/isis/src/base/objs/NaifStatus/NaifStatus.cpp @@ -65,7 +65,7 @@ namespace Isis { getmsg_c("LONG", LONG_DESC_LEN, naifLong); // Search for known naif errors... - QString errMsg; + std::string errMsg; Pvl error; PvlGroup errorDescription("ErrorDescription"); @@ -94,8 +94,8 @@ namespace Isis { } errMsg += " The short explanation "; - errMsg += "provided by NAIF is [" + QString(naifShort) + "]. "; - errMsg += "The Naif error is [" + QString(naifLong) + "]"; + errMsg += "provided by NAIF is [" + (std::string)naifShort + "]. "; + errMsg += "The Naif error is [" + (std::string)naifLong + "]"; throw IException(IException::Unknown, errMsg, _FILEINFO_); } diff --git a/isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp b/isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp index 74b0b368ab..4574df5d4e 100644 --- a/isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp +++ b/isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp @@ -38,7 +38,7 @@ namespace Isis { void NthOrderPolynomial::Expand(const std::vector &vars) { if((int) vars.size() != Variables()) { - QString mess = "Number of variables given (" + QString::number(vars.size()) + std::string mess = "Number of variables given (" + QString::number(vars.size()) + ") does not match expected (" + Variables() + ")!"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/ObliqueCylindrical/ObliqueCylindrical.cpp b/isis/src/base/objs/ObliqueCylindrical/ObliqueCylindrical.cpp index 63a955a794..8653b8ae18 100644 --- a/isis/src/base/objs/ObliqueCylindrical/ObliqueCylindrical.cpp +++ b/isis/src/base/objs/ObliqueCylindrical/ObliqueCylindrical.cpp @@ -144,7 +144,7 @@ namespace Isis { init(); } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/ObservationNumber/ObservationNumber.cpp b/isis/src/base/objs/ObservationNumber/ObservationNumber.cpp index 5de418e77a..722bd2d70a 100644 --- a/isis/src/base/objs/ObservationNumber/ObservationNumber.cpp +++ b/isis/src/base/objs/ObservationNumber/ObservationNumber.cpp @@ -40,7 +40,7 @@ namespace Isis { // "Unknown" as a last resort. QString snTemp = QString::fromStdString(label.fileName()); if(!snTemp.isEmpty()) { - sn = FileName(snTemp).name(); + sn = QString::fromStdString(FileName(snTemp.toStdString()).name()); } else { sn = "Unknown"; @@ -105,11 +105,11 @@ namespace Isis { if(translationIterator == missionTranslators.end()) { // Get the file - FileName snFile((QString) "$ISISROOT/appdata/translations/" + mission + - instrument + "SerialNumber.trn"); + FileName snFile("$ISISROOT/appdata/translations/" + mission.toStdString() + + instrument.toStdString() + "SerialNumber.trn"); // Delets the extra - Pvl translation(snFile.expanded().toStdString()); + Pvl translation(snFile.expanded()); PvlKeyword observationKeys; if(translation.hasKeyword("ObservationKeys")) { observationKeys = translation["ObservationKeys"]; @@ -118,7 +118,7 @@ namespace Isis { // use the translation file to generate keywords missionTranslators.insert( std::pair > - (key, std::pair(PvlToPvlTranslationManager(snFile.expanded()), observationKeys)) + (key, std::pair(PvlToPvlTranslationManager(QString::fromStdString(snFile.expanded())), observationKeys)) ); translationIterator = missionTranslators.find(key); diff --git a/isis/src/base/objs/ObservationNumber/unitTest.cpp b/isis/src/base/objs/ObservationNumber/unitTest.cpp index b50c63f487..252cfbd6ad 100644 --- a/isis/src/base/objs/ObservationNumber/unitTest.cpp +++ b/isis/src/base/objs/ObservationNumber/unitTest.cpp @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) { Preference::Preferences(true); FileName file("$ISISTESTDATA/isis/src/lo/unitTestData/3133_h1.cub"); - Pvl p1(file.expanded().toStdString()); + Pvl p1(file.expanded()); cout << ObservationNumber::Compose(p1) << endl; diff --git a/isis/src/base/objs/ObservationNumberList/ObservationNumberList.cpp b/isis/src/base/objs/ObservationNumberList/ObservationNumberList.cpp index 093cdb5a9e..f05ec8a4c3 100644 --- a/isis/src/base/objs/ObservationNumberList/ObservationNumberList.cpp +++ b/isis/src/base/objs/ObservationNumberList/ObservationNumberList.cpp @@ -51,7 +51,7 @@ namespace Isis { void ObservationNumberList::init(SerialNumberList *snlist) { if (snlist->size() == 0) { - QString msg = "Serial number list is empty"; + std::string msg = "Serial number list is empty"; throw IException(IException::User, msg, _FILEINFO_); } @@ -95,7 +95,7 @@ namespace Isis { void ObservationNumberList::remove(SerialNumberList *snlist) { if (snlist->size() == 0) { - QString msg = "Cannot remove, serial number list is empty"; + std::string msg = "Cannot remove, serial number list is empty"; throw IException(IException::User, msg, _FILEINFO_); } @@ -207,7 +207,7 @@ namespace Isis { return m_indexMap.find(serialNumberIndex)->second; } else { - QString msg = "Serial Number Index [" + toString(serialNumberIndex) + "] is invalid"; + std::string msg = "Serial Number Index [" + toString(serialNumberIndex) + "] is invalid"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -224,8 +224,8 @@ namespace Isis { * the input filename */ QString ObservationNumberList::observationNumber(const QString &filename) { - if (m_fileMap.find(FileName(filename).expanded()) == m_fileMap.end()) { - QString msg = "Requested filename [" + FileName(filename).expanded() + "] "; + if (m_fileMap.find(QString::fromStdString(FileName(filename.toStdString()).expanded())) == m_fileMap.end()) { + std::string msg = "Requested filename [" + FileName(filename.toStdString()).expanded() + "] "; msg += "does not exist in the list"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -248,7 +248,7 @@ namespace Isis { return m_pairs[index].observationNumber; } else { - QString msg = "Index [" + toString(index) + "] is invalid"; + std::string msg = "Index [" + toString(index) + "] is invalid"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -275,7 +275,7 @@ namespace Isis { return filenames; } else { - QString msg = "Requested observation number [" + on + "] "; + std::string msg = "Requested observation number [" + on + "] "; msg += "does not exist in the list"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ObservationNumberList/unitTest.cpp b/isis/src/base/objs/ObservationNumberList/unitTest.cpp index 13099c51b1..115fbaea64 100644 --- a/isis/src/base/objs/ObservationNumberList/unitTest.cpp +++ b/isis/src/base/objs/ObservationNumberList/unitTest.cpp @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) { ObservationNumberList emptyONL(&empty); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) { onl.remove(&empty); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) { onl.observationNumberMapIndex(-1); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) { onl.observationNumber("$ISISTESTDATA/isis/src/odyssey/unitTestData/I00824006RDR.lev2.cub"); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -212,7 +212,7 @@ int main(int argc, char *argv[]) { onl.observationNumber(5); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -222,7 +222,7 @@ int main(int argc, char *argv[]) { onl.possibleFileNames("DNE"); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } diff --git a/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp b/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp index e9ace9ce02..fcacc94c3e 100644 --- a/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp +++ b/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp @@ -31,7 +31,7 @@ namespace Isis { */ OriginalXmlLabel::OriginalXmlLabel(const QString &file) { Blob blob = Blob("IsisCube", "OriginalXmlLabel"); - blob.Read(file); + blob.Read(file.toStdString()); fromBlob(blob); } @@ -56,12 +56,12 @@ namespace Isis { * Load blob data into m_originalLabel */ void OriginalXmlLabel::fromBlob(Isis::Blob blob) { - QString errorMessage; + std::string errorMessage; int errorLine = 0; int errorColumn = 0; if ( !m_originalLabel.setContent( QByteArray(blob.getBuffer(), blob.Size()) ) ) { - QString msg = "XML read/parse error when parsing original label. " + std::string msg = "XML read/parse error when parsing original label. " "Error at line [" + toString(errorLine) + "], column [" + toString(errorColumn) + "]. Error message: " + errorMessage; @@ -101,9 +101,9 @@ namespace Isis { * @throws IException::Unknown "XML read/parse error in file." */ void OriginalXmlLabel::readFromXmlFile(const FileName &xmlFileName) { - QFile xmlFile(xmlFileName.expanded()); + QFile xmlFile(QString::fromStdString(xmlFileName.expanded())); if ( !xmlFile.open(QIODevice::ReadOnly) ) { - QString msg = "Could not open label file [" + xmlFileName.expanded() + + std::string msg = "Could not open label file [" + xmlFileName.expanded() + "]."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -112,9 +112,9 @@ namespace Isis { int errline, errcol; if ( !m_originalLabel.setContent(&xmlFile, false, &errmsg, &errline, &errcol) ) { xmlFile.close(); - QString msg = "XML read/parse error in file [" + xmlFileName.expanded() - + "] at line [" + toString(errline) + "], column [" + toString(errcol) - + "], message: " + errmsg; + std::string msg = "XML read/parse error in file [" + xmlFileName.expanded() + + "] at line [" + std::to_string(errline) + "], column [" + std::to_string(errcol) + + "], message: " + errmsg.toStdString(); throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/OriginalXmlLabel/unitTest.cpp b/isis/src/base/objs/OriginalXmlLabel/unitTest.cpp index 9087e0db0d..c66d093469 100644 --- a/isis/src/base/objs/OriginalXmlLabel/unitTest.cpp +++ b/isis/src/base/objs/OriginalXmlLabel/unitTest.cpp @@ -59,7 +59,7 @@ QDomDocument parseXmlFile(const FileName &xmlFileName) { QFile xmlFile(xmlFileName.expanded()); if ( !xmlFile.open(QIODevice::ReadOnly) ) { - QString msg = "Could not open label file [" + xmlFileName.expanded() + + std::string msg = "Could not open label file [" + xmlFileName.expanded() + "]."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -68,7 +68,7 @@ QDomDocument parseXmlFile(const FileName &xmlFileName) { int errline, errcol; if ( !parsedXmlFile.setContent(&xmlFile, false, &errmsg, &errline, &errcol) ) { xmlFile.close(); - QString msg = "XML read/parse error in file [" + xmlFileName.expanded() + std::string msg = "XML read/parse error in file [" + xmlFileName.expanded() + "] at line [" + toString(errline) + "], column [" + toString(errcol) + "], message: " + errmsg; throw IException(IException::Unknown, msg, _FILEINFO_); diff --git a/isis/src/base/objs/Orthographic/Orthographic.cpp b/isis/src/base/objs/Orthographic/Orthographic.cpp index 235fb5b120..77950e9ff9 100644 --- a/isis/src/base/objs/Orthographic/Orthographic.cpp +++ b/isis/src/base/objs/Orthographic/Orthographic.cpp @@ -69,7 +69,7 @@ namespace Isis { //Restrict center longitude to avoid converting between domains. if ((m_centerLongitude < -360.0) || (m_centerLongitude > 360.0)) { - QString msg = "The center longitude cannot exceed [-360, 360]. " + std::string msg = "The center longitude cannot exceed [-360, 360]. " "[" + toString(m_centerLongitude) + "] is not valid"; throw IException(IException::User, msg, _FILEINFO_); } @@ -124,7 +124,7 @@ namespace Isis { //Restrict the longitude range to 360 degrees to simplify comparisons. if ((m_maximumLongitude - m_minimumLongitude) > 360.0) { - QString msg = "The longitude range cannot exceed 360 degrees."; + std::string msg = "The longitude range cannot exceed 360 degrees."; throw IException(IException::User, msg, _FILEINFO_); } @@ -146,7 +146,7 @@ namespace Isis { } } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp index dbc099ca5b..663b89df46 100644 --- a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp +++ b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp @@ -62,12 +62,12 @@ namespace Isis { p_sampPercent = sampPercent; // Extract filenames and band number from cubes - p_xFile = x.fileName(); - p_yFile = y.fileName(); + p_xFile = x.fileName().toStdString(); + p_yFile = y.fileName().toStdString(); // Make sure number of bands match if (x.bandCount() != y.bandCount()) { - QString msg = "Number of bands do not match between cubes [" + + std::string msg = "Number of bands do not match between cubes [" + p_xFile.name() + "] and [" + p_yFile.name() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -80,7 +80,7 @@ namespace Isis { // Test to make sure projection parameters match if (*projX != *projY) { - QString msg = "Mapping groups do not match between cubes [" + + std::string msg = "Mapping groups do not match between cubes [" + p_xFile.name() + "] and [" + p_yFile.name() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -198,8 +198,8 @@ namespace Isis { // Add keywords for OverlapStatistics data PvlObject o(name.toStdString()); - o += PvlKeyword("File1", FileNameX().name().toStdString()); - o += PvlKeyword("File2", FileNameY().name().toStdString()); + o += PvlKeyword("File1", FileNameX().name()); + o += PvlKeyword("File2", FileNameY().name()); o += PvlKeyword("Width", std::to_string(Samples())); o += PvlKeyword("Height", std::to_string(Lines())); o += PvlKeyword("Bands", std::to_string(Bands())); @@ -280,7 +280,7 @@ namespace Isis { } catch (IException &e) { - QString msg = "Trivial overlap between [" + FileNameX().name(); + std::string msg = "Trivial overlap between [" + FileNameX().name(); msg += "] and [" + FileNameY().name() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -297,8 +297,8 @@ namespace Isis { const PvlGroup &fileX = inStats.findGroup("File1"); const PvlGroup &fileY = inStats.findGroup("File2"); - p_xFile = QString::fromStdString(inStats["File1"][0]); - p_yFile = QString::fromStdString(inStats["File2"][0]); + p_xFile = inStats["File1"][0]; + p_yFile = inStats["File2"][0]; p_sampRange = inStats["Width"]; p_lineRange = inStats["Height"]; p_bands = inStats["Bands"]; diff --git a/isis/src/base/objs/PhotoModelFactory/PhotoModelFactory.cpp b/isis/src/base/objs/PhotoModelFactory/PhotoModelFactory.cpp index 0328845a77..8acc43e742 100644 --- a/isis/src/base/objs/PhotoModelFactory/PhotoModelFactory.cpp +++ b/isis/src/base/objs/PhotoModelFactory/PhotoModelFactory.cpp @@ -45,7 +45,7 @@ namespace Isis { algorithm = QString::fromStdString(algo["Name"][0]); } else { - QString msg = "Keyword [Name] or keyword [PhtName] must "; + std::string msg = "Keyword [Name] or keyword [PhtName] must "; msg += "exist in [Group = Algorithm]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Pipeline/Pipeline.cpp b/isis/src/base/objs/Pipeline/Pipeline.cpp index 1efb46ba47..31315081d2 100644 --- a/isis/src/base/objs/Pipeline/Pipeline.cpp +++ b/isis/src/base/objs/Pipeline/Pipeline.cpp @@ -96,7 +96,7 @@ namespace Isis { if (p_apps[i] == NULL) continue; if (mustElimBands && p_apps[i]->SupportsVirtualBands()) { if (i != 0 && p_virtualBands.size() != 1) { - QString message = "If multiple original inputs were set in the pipeline, the first application must support virtual bands."; + std::string message = "If multiple original inputs were set in the pipeline, the first application must support virtual bands."; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -140,7 +140,7 @@ namespace Isis { foundFirst = true; if (p_apps[i]->InputBranches().size() != OriginalBranches().size()) { - QString msg = "The program [" + p_apps[i]->Name() + "] can not be the first in the pipeline"; + std::string msg = "The program [" + p_apps[i]->Name() + "] can not be the first in the pipeline"; msg += " because it must be run multiple times with unspecified varying inputs"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -157,7 +157,7 @@ namespace Isis { for (int i = 0; successfulPrepare && i < (int)tmpFiles.size(); i++) { for (int j = i + 1; j < (int)tmpFiles.size(); j++) { if (tmpFiles[i] == tmpFiles[j]) { - QString msg = "There is a conflict with the temporary file naming. The temporary file ["; + std::string msg = "There is a conflict with the temporary file naming. The temporary file ["; msg += tmpFiles[i] + "] is created twice."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -239,10 +239,10 @@ namespace Isis { FileList listFile; while (!listData.isEmpty()) { - listFile.push_back(listData.takeFirst()); + listFile.push_back(listData.takeFirst().toStdString()); } - listFile.write(listFileName); + listFile.write(listFileName.toStdString()); } else { // Nothing special is happening, just execute the program @@ -322,8 +322,8 @@ namespace Isis { * to p_inputBranches */ void Pipeline::SetInputFile(const FileName &inputFile) { - p_originalInput.push_back(inputFile.original()); - p_inputBranches.push_back(inputFile.original()); + p_originalInput.push_back(QString::fromStdString(inputFile.original())); + p_inputBranches.push_back(QString::fromStdString(inputFile.original())); p_virtualBands.push_back(""); } @@ -353,7 +353,7 @@ namespace Isis { */ void Pipeline::SetInputListFile(const QString &inputParam) { UserInterface &ui = Application::GetUserInterface(); - FileName inputFileName = FileName(ui.GetFileName(inputParam)); + FileName inputFileName = FileName(ui.GetFileName(inputParam).toStdString()); SetInputListFile(inputFileName); } @@ -372,12 +372,13 @@ namespace Isis { FileName filename; int branch = 1; - while (!filelist.isEmpty()) { - filename = filelist.takeFirst(); - p_originalInput.push_back(filename.expanded()); - p_inputBranches.push_back(inputFileName.name() + toString(branch)); + while (!filelist.empty()) { + filename = filelist.front(); + filelist.erase(filelist.begin()); + p_originalInput.push_back(QString::fromStdString(filename.expanded())); + p_inputBranches.push_back(QString::fromStdString(inputFileName.name()) + toString(branch)); p_virtualBands.push_back(""); - p_finalOutput.push_back(filename.name()); + p_finalOutput.push_back(QString::fromStdString(filename.name())); branch ++; } @@ -472,7 +473,7 @@ namespace Isis { */ void Pipeline::SetOutputFile(const FileName &outputFile) { p_finalOutput.clear(); - p_finalOutput.push_back(outputFile.expanded()); + p_finalOutput.push_back(QString::fromStdString(outputFile.expanded())); } @@ -501,14 +502,14 @@ namespace Isis { UserInterface &ui = Application::GetUserInterface(); if (ui.WasEntered(outputFileNameParam)) { - SetOutputListFile(FileName(ui.GetFileName(outputFileNameParam))); + SetOutputListFile(FileName(ui.GetFileName(outputFileNameParam).toStdString())); } else { p_finalOutput.clear(); // Calculate output files for (unsigned int i = 0; i < p_originalInput.size(); i++) { - p_finalOutput.push_back(FileName(p_originalInput[i]).name()); + p_finalOutput.push_back(QString::fromStdString(FileName(p_originalInput[i].toStdString()).name())); } p_outputListNeedsModifiers = true; @@ -528,8 +529,9 @@ namespace Isis { FileList filelist(outputFileNameList.expanded()); QString filename; - while (!filelist.isEmpty()) { - filename = filelist.takeFirst().expanded(); + while (!filelist.empty()) { + filename = QString::fromStdString(filelist.front().expanded()); + filelist.erase(filelist.begin()); p_finalOutput.push_back(filename); } @@ -582,7 +584,7 @@ namespace Isis { // Check uniqueness first for (unsigned int appIdentifier = 0; appIdentifier < p_appIdentifiers.size(); appIdentifier++) { if (p_appIdentifiers[appIdentifier] == identifier) { - QString message = "The application identifier [" + identifier + "] is not unique. " + + std::string message = "The application identifier [" + identifier + "] is not unique. " + "Please providing a unique identifier"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -640,7 +642,7 @@ namespace Isis { // Check uniqueness first for (unsigned int appIdentifier = 0; appIdentifier < p_appIdentifiers.size(); appIdentifier++) { if (p_appIdentifiers[appIdentifier] == appname) { - QString message = "The application identifier [" + appname + "] is not unique. Please use " + + std::string message = "The application identifier [" + appname + "] is not unique. Please use " + "the other AddToPipeline method providing a unique identifier"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -703,7 +705,7 @@ namespace Isis { } if (!found) { - QString msg = "Application identified by [" + identifier + "] has not been added to the pipeline"; + std::string msg = "Application identified by [" + identifier + "] has not been added to the pipeline"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -721,7 +723,7 @@ namespace Isis { */ PipelineApplication &Pipeline::Application(const int &index) { if (index > Size()) { - QString msg = "Index [" + QString(index) + "] out of bounds"; + std::string msg = "Index [" + QString(index) + "] out of bounds"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -753,7 +755,7 @@ namespace Isis { // } if (appIndex >= (int)p_apps.size()) { - QString msg = "Pipeline could not find application [" + appname + "]"; + std::string msg = "Pipeline could not find application [" + appname + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -779,7 +781,7 @@ namespace Isis { } if (appIndex < 0) { - QString msg = "Pipeline could not find application [" + appname + "]"; + std::string msg = "Pipeline could not find application [" + appname + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -805,7 +807,7 @@ namespace Isis { if (p_finalOutput.size() > 1) { if ((unsigned int)branch >= p_finalOutput.size()) { - QString msg = "Output not set for branch [" + QString(branch) + "]"; + std::string msg = "Output not set for branch [" + QString(branch) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -824,10 +826,10 @@ namespace Isis { if (output == "" || p_finalOutput.size() > 1) { if (output == "") { - output = "./" + FileName(p_originalInput[0]).baseName(); + output = "./" + QString::fromStdString(FileName(p_originalInput[0].toStdString()).baseName()); } else { - output = "./" + FileName(p_originalInput[branch]).baseName(); + output = "./" + QString::fromStdString(FileName(p_originalInput[branch].toStdString()).baseName()); } // Base filename off of first input file @@ -854,9 +856,9 @@ namespace Isis { PipelineApplication *last = p_apps[p_apps.size()-1]; if (!last->Enabled()) last = last->Previous(); - output = FileName(p_finalOutput[0]).path() + "/" + - FileName(p_finalOutput[0]).baseName() + "." + - last->OutputBranches()[branch] + "."; + output = QString::fromStdString(FileName(p_finalOutput[0].toStdString()).path() + "/" + + FileName(p_finalOutput[0].toStdString()).baseName() + "." + + last->OutputBranches()[branch].toStdString() + "."); if (p_finalOutput.size() > 1) { output += last->OutputNameModifier() + "."; diff --git a/isis/src/base/objs/Pipeline/PipelineApplication.cpp b/isis/src/base/objs/Pipeline/PipelineApplication.cpp index 4732c8aa62..921e7ca599 100644 --- a/isis/src/base/objs/Pipeline/PipelineApplication.cpp +++ b/isis/src/base/objs/Pipeline/PipelineApplication.cpp @@ -385,7 +385,7 @@ namespace Isis { listName = Name(); } - QString input = p_pipeline->TemporaryFolder() + "/" + FileName(listName).baseName() + ".lis"; + QString input = p_pipeline->TemporaryFolder() + "/" + QString::fromStdString(FileName(listName.toStdString()).baseName()) + ".lis"; params = ">>LIST " + input + " "; PipelineApplication * prev = Previous(); @@ -446,7 +446,7 @@ namespace Isis { params += " " + p_output[outParam].Name() + "=\"" + p_outputs[outBranch] + "\""; if(outputSet) { - QString message = "Application [" + Name() + "] in the pipeline branches with an "; + std::string message = "Application [" + Name() + "] in the pipeline branches with an "; message += "output parameter for each branch, but branch [" + p_outBranches[outBranch]; message += "] has multiple output files specified."; throw IException(IException::Programmer, message, _FILEINFO_); @@ -457,7 +457,7 @@ namespace Isis { } if(!outputSet) { - QString message = "Application [" + Name() + "] in the pipeline branches with an "; + std::string message = "Application [" + Name() + "] in the pipeline branches with an "; message += "output parameter for each branch, but branch [" + p_outBranches[outBranch]; message += "] has no output files specified."; throw IException(IException::Programmer, message, _FILEINFO_); @@ -495,7 +495,7 @@ namespace Isis { } if(inputFile.isEmpty()) { - QString message = "There was a problem with calculating the inputs for program [" + Name(); + std::string message = "There was a problem with calculating the inputs for program [" + Name(); message += "]. Please verify your program is not setting outputs for branches that "; message += "don't have input."; throw IException(IException::Programmer, message, _FILEINFO_); @@ -624,22 +624,22 @@ namespace Isis { if(!LastApplicationWithOutput()) { QString lastOutput = p_pipeline->FinalOutput(branch, false); outputFile = outFolder + "/" + - FileName(lastOutput).baseName() + "." + p_outputMod + "." + p_outputExtension; + QString::fromStdString(FileName(lastOutput.toStdString()).baseName()) + "." + p_outputMod + "." + p_outputExtension; if(p_outputMod.isEmpty()) { outputFile = outFolder + "/" + - FileName(lastOutput).baseName() + "." + p_outputExtension; + QString::fromStdString(FileName(lastOutput.toStdString()).baseName()) + "." + p_outputExtension; } } else { outputFile = p_pipeline->FinalOutput(branch, numUsedBranches > 1); - outFolder = FileName(outputFile).path(); + outFolder = QString::fromStdString(FileName(outputFile.toStdString()).path()); } if(!LastApplicationWithOutput() && numUsedBranches != 1 && !p_outputMod.isEmpty()) { - FileName outfile(outputFile); + FileName outfile(outputFile.toStdString()); - QString realOut(outFolder + "/" + outfile.baseName() + "." + p_outBranches[branch] + "." + p_outputExtension); + QString realOut(outFolder + "/" + QString::fromStdString(outfile.baseName()) + "." + p_outBranches[branch] + "." + p_outputExtension); if(usedBranch) { @@ -738,11 +738,11 @@ namespace Isis { } if(p_inBranches[0] != "") { - QString msg = "Application [" + Name() + "] in the pipeline does not have an input for branch [" + p_inBranches[branch] + "]"; + std::string msg = "Application [" + Name() + "] in the pipeline does not have an input for branch [" + p_inBranches[branch] + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { - QString msg = "Application [" + Name() + "] in the pipeline does not have an input"; + std::string msg = "Application [" + Name() + "] in the pipeline does not have an input"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -782,7 +782,7 @@ namespace Isis { } if(!found) { - QString msg = "Branch [" + name + "] does not exist in the pipeline application [" + Name() + "]"; + std::string msg = "Branch [" + name + "] does not exist in the pipeline application [" + Name() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PixelFOV/PixelFOV.cpp b/isis/src/base/objs/PixelFOV/PixelFOV.cpp index 075672a506..3d1beb870b 100755 --- a/isis/src/base/objs/PixelFOV/PixelFOV.cpp +++ b/isis/src/base/objs/PixelFOV/PixelFOV.cpp @@ -79,7 +79,7 @@ namespace Isis { if (numIfovs < 1) { - QString msg = "The number of instantaneous field of views must be a positive integer."; + std::string msg = "The number of instantaneous field of views must be a positive integer."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PlaneShape/unitTest.cpp b/isis/src/base/objs/PlaneShape/unitTest.cpp index f598d86fce..d805ae2e7b 100644 --- a/isis/src/base/objs/PlaneShape/unitTest.cpp +++ b/isis/src/base/objs/PlaneShape/unitTest.cpp @@ -166,7 +166,7 @@ int main() { } catch (IException &e) { cout << endl << endl; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/Plugin/Plugin.cpp b/isis/src/base/objs/Plugin/Plugin.cpp index a5256489c9..d572319ef3 100644 --- a/isis/src/base/objs/Plugin/Plugin.cpp +++ b/isis/src/base/objs/Plugin/Plugin.cpp @@ -39,9 +39,9 @@ namespace Isis { QFunctionPointer Plugin::GetPlugin(const QString &group) { // Get the library and plugin to load PvlGroup &g = findGroup(group.toStdString()); - QString library = QString::fromStdString(g["Library"]); + std::string library = g["Library"]; - QString path = "./"; + std::string path = "./"; Isis::FileName libraryFile(path + library); QString pluginName = QString::fromStdString(g["Routine"]); @@ -49,7 +49,7 @@ namespace Isis { // Open the library, resolve the routine name, and return the function // address. The function will stay in memory until the application exists // so the scope of lib does not matter. - QLibrary lib(libraryFile.expanded()); + QLibrary lib(QString::fromStdString(libraryFile.expanded())); bool loadedOk = lib.load(); if(!loadedOk) { @@ -57,11 +57,11 @@ namespace Isis { libraryFile = path + library; } - lib.setFileName(libraryFile.expanded()); + lib.setFileName(QString::fromStdString(libraryFile.expanded())); QFunctionPointer plugin = lib.resolve(pluginName.toLatin1().data()); if (plugin == 0) { - QString msg = "Unable to find plugin [" + pluginName + + std::string msg = "Unable to find plugin [" + pluginName + "] in shared library [" + lib.fileName() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PointPerspective/PointPerspective.cpp b/isis/src/base/objs/PointPerspective/PointPerspective.cpp index 6fb6202f9b..e9d1591aba 100644 --- a/isis/src/base/objs/PointPerspective/PointPerspective.cpp +++ b/isis/src/base/objs/PointPerspective/PointPerspective.cpp @@ -80,7 +80,7 @@ namespace Isis { m_P = 1.0 + (m_distance / m_equatorialRadius); } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp b/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp index d6bb6f2963..b6657ac71b 100644 --- a/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp +++ b/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp @@ -74,7 +74,7 @@ namespace Isis { // radians. m_centerLatitude = mapGroup["CenterLatitude"]; if (m_centerLatitude == 0) { - QString msg = "Invalid value for keyword [CenterLatitude] in map file."; + std::string msg = "Invalid value for keyword [CenterLatitude] in map file."; msg += " CenterLatitude cannot equal 0.0"; throw IException(IException::User, msg, _FILEINFO_); } @@ -104,7 +104,7 @@ namespace Isis { } } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Unknown, message, _FILEINFO_); } } @@ -255,7 +255,7 @@ namespace Isis { m_latitude = m_signFactor * phi; if (fabs(m_latitude) > HALFPI) { - QString msg = "X,Y causes latitude to be outside [-90,90] " + std::string msg = "X,Y causes latitude to be outside [-90,90] " "in PolarStereographic Class"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp b/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp index 322f8bd010..e76e41adf7 100644 --- a/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp +++ b/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp @@ -84,7 +84,7 @@ namespace Isis { **/ void PolygonSeeder::Parse(Pvl &pvl) { - QString errorSpot; + std::string errorSpot; try { // Get info from Algorithm group diff --git a/isis/src/base/objs/PolynomialUnivariate/PolynomialUnivariate.cpp b/isis/src/base/objs/PolynomialUnivariate/PolynomialUnivariate.cpp index 8ac7e10d1d..7228e28129 100644 --- a/isis/src/base/objs/PolynomialUnivariate/PolynomialUnivariate.cpp +++ b/isis/src/base/objs/PolynomialUnivariate/PolynomialUnivariate.cpp @@ -98,7 +98,7 @@ namespace Isis { derivative = 1; } else { - QString msg = "Unable to evaluate the derivative of the univariate polynomial for the given " + std::string msg = "Unable to evaluate the derivative of the univariate polynomial for the given " "coefficient index [" + toString(coefIndex) + "]. " "Index is negative or exceeds degree of polynomial [" + toString(Coefficients()) + "]"; diff --git a/isis/src/base/objs/Process/Process.cpp b/isis/src/base/objs/Process/Process.cpp index c5fcff3493..70df8625ca 100644 --- a/isis/src/base/objs/Process/Process.cpp +++ b/isis/src/base/objs/Process/Process.cpp @@ -80,7 +80,7 @@ namespace Isis { } else { // Make sure attributes don't get processed twice - cube->open(FileName(fname).expanded()); + cube->open(QString::fromStdString(FileName(fname.toStdString()).expanded())); } } catch(IException &e) { @@ -114,7 +114,7 @@ namespace Isis { AddInputCube(inCube, false); } else { - QString message = "Input cube does not exist"; + std::string message = "Input cube does not exist"; throw IException(IException::User, message, _FILEINFO_); } } @@ -140,7 +140,7 @@ namespace Isis { const int requirements) { QString fname = Application::GetUserInterface().GetCubeName(parameter); Isis::CubeAttributeInput &att = Application::GetUserInterface().GetInputAttribute(parameter); - return SetInputCube(FileName(fname).expanded(), att, requirements); + return SetInputCube(QString::fromStdString(FileName(fname.toStdString()).expanded()), att, requirements); } @@ -163,7 +163,7 @@ namespace Isis { Isis::Cube *Process::SetOutputCube(const QString ¶meter) { // Make sure we have an input cube to get a default size from if(InputCubes.size() == 0) { - QString message = "No input images have been selected ... therefore"; + std::string message = "No input images have been selected ... therefore"; message += "the output image size can not be determined"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -196,7 +196,7 @@ namespace Isis { Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, UserInterface *ui) { // Make sure we have an input cube to get a default size from if(InputCubes.size() == 0) { - QString message = "No input images have been selected ... therefore"; + std::string message = "No input images have been selected ... therefore"; message += "the output image size can not be determined"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -336,7 +336,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns cube->setPixelType(InputCubes[0]->pixelType()); } else { - QString msg = "You told me to propagate PixelType from input to output"; + std::string msg = "You told me to propagate PixelType from input to output"; msg += " cube but there are no input cubes loaded"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -350,7 +350,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns cube->setBaseMultiplier(0.0, 1.0); } else if(InputCubes.size() == 0) { - QString msg = "You told me to propagate base/multiplier from input to output"; + std::string msg = "You told me to propagate base/multiplier from input to output"; msg += " cube but there are no input cubes loaded"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -365,12 +365,12 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns (cube->pixelType() != Isis::SignedWord) && (cube->pixelType() != Isis::UnsignedInteger) && (cube->pixelType() != Isis::SignedInteger)) { - QString msg = "Looks like your refactoring to add different pixel types"; + std::string msg = "Looks like your refactoring to add different pixel types"; msg += " you'll need to make changes here"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { - QString msg = "You've chosen to reduce your output PixelType for [" + + std::string msg = "You've chosen to reduce your output PixelType for [" + fname + "] you must specify the output pixel range too"; throw IException(IException::User, msg, _FILEINFO_); } @@ -516,7 +516,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns if(InputCubes.size() > 0) { if(cube->lineCount() != 1) { if(cube->lineCount() != InputCubes[0]->lineCount()) { - QString message = "The number of lines in the secondary input cubes must match"; + std::string message = "The number of lines in the secondary input cubes must match"; message += " the primary input cube or be exactly one"; throw IException(IException::User, message, _FILEINFO_); } @@ -524,14 +524,14 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns if(cube->sampleCount() != 1) { if(cube->sampleCount() != InputCubes[0]->sampleCount()) { - QString message = "The number of samples in the secondary input cubes must match"; + std::string message = "The number of samples in the secondary input cubes must match"; message += " the primary input cube or be exactly one"; throw IException(IException::User, message, _FILEINFO_); } } if(cube->bandCount() != 1) { if(cube->bandCount() != InputCubes[0]->bandCount()) { - QString message = "The number of bands in the secondary input cubes must match"; + std::string message = "The number of bands in the secondary input cubes must match"; message += " the primary input cube or be exactly one"; throw IException(IException::User, message, _FILEINFO_); } @@ -546,15 +546,15 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns if(requirements & Isis::SizeMatch) { if(InputCubes.size() > 0) { if(cube->lineCount() != InputCubes[0]->lineCount()) { - QString message = "The number of lines in the input cubes must match"; + std::string message = "The number of lines in the input cubes must match"; throw IException(IException::User, message, _FILEINFO_); } if(cube->sampleCount() != InputCubes[0]->sampleCount()) { - QString message = "The number of samples in the input cubes must match"; + std::string message = "The number of samples in the input cubes must match"; throw IException(IException::User, message, _FILEINFO_); } if(cube->bandCount() != InputCubes[0]->bandCount()) { - QString message = "The number of bands in the input cubes must match"; + std::string message = "The number of bands in the input cubes must match"; throw IException(IException::User, message, _FILEINFO_); } } @@ -564,11 +564,11 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns if(requirements & Isis::SpatialMatch) { if(InputCubes.size() > 0) { if(cube->lineCount() != InputCubes[0]->lineCount()) { - QString message = "The number of lines in the input cubes must match"; + std::string message = "The number of lines in the input cubes must match"; throw IException(IException::User, message, _FILEINFO_); } if(cube->sampleCount() != InputCubes[0]->sampleCount()) { - QString message = "The number of samples in the input cubes must match"; + std::string message = "The number of samples in the input cubes must match"; throw IException(IException::User, message, _FILEINFO_); } } @@ -577,7 +577,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns // Test for one band if(requirements & Isis::OneBand) { if(cube->bandCount() != 1) { - QString message = "Input cube [" + cube->fileName() + "] must have one band"; + std::string message = "Input cube [" + cube->fileName() + "] must have one band"; throw IException(IException::User, message, _FILEINFO_); } } @@ -587,7 +587,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns if(cube->bandCount() != 1) { if(InputCubes.size() > 0) { if(cube->bandCount() != InputCubes[0]->bandCount()) { - QString message = "The number of bands in the secondary input cubes must match"; + std::string message = "The number of bands in the secondary input cubes must match"; message += " the primary input cube or be exactly one"; throw IException(IException::User, message, _FILEINFO_); } @@ -788,17 +788,17 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns QString Process::MissionData(const QString &mission, const QString &file, bool highestVersion) { Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory"); - QString dir = QString::fromStdString(dataDir[mission.toStdString()]); + std::string dir = dataDir[mission.toStdString()]; // See if the data directory is installed Isis::FileName installed(dir); if(!installed.fileExists()) { - QString message = "Data directory for mission [" + mission + "] " + + std::string message = "Data directory for mission [" + mission + "] " + "is not installed at your site"; throw IException(IException::Io, message, _FILEINFO_); } - Isis::FileName expanded(dir + "/" + file); + Isis::FileName expanded(dir + "/" + file.toStdString()); // Highest version checks if the file exists, if we // do not ask for the highest version, then we need to check // if the file exists @@ -807,12 +807,12 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns } else { if (!expanded.fileExists()) { - QString message = "The file [" + expanded.original() + "] " + - "cannot be found under [" + mission + "]"; + std::string message = "The file [" + expanded.original() + "] " + + "cannot be found under [" + mission.toStdString() + "]"; throw IException(IException::Io, message, _FILEINFO_); } } - return expanded.expanded(); + return QString::fromStdString(expanded.expanded()); } @@ -869,7 +869,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns QString cubeNumStr = toString(cubeNum + 1); QString totalCubes = toString((int)InputCubes.size()); - QString msg = "Calculating statistics for cube " + cubeNumStr + " of " + totalCubes; + std::string msg = "Calculating statistics for cube " + cubeNumStr + " of " + totalCubes; Isis::Progress progress; progress.SetText(msg); diff --git a/isis/src/base/objs/ProcessByBrick/unitTest.cpp b/isis/src/base/objs/ProcessByBrick/unitTest.cpp index eb98dd12bb..5d0308fa85 100644 --- a/isis/src/base/objs/ProcessByBrick/unitTest.cpp +++ b/isis/src/base/objs/ProcessByBrick/unitTest.cpp @@ -311,7 +311,7 @@ void IsisMain() { } catch(Isis::IException &ex){ - QString msg = ex.toString(); + std::string msg = ex.toString(); cout << msg.toStdString() << endl; } diff --git a/isis/src/base/objs/ProcessExport/ProcessExport.cpp b/isis/src/base/objs/ProcessExport/ProcessExport.cpp index a763ca8cf8..6a71172c0f 100644 --- a/isis/src/base/objs/ProcessExport/ProcessExport.cpp +++ b/isis/src/base/objs/ProcessExport/ProcessExport.cpp @@ -696,12 +696,12 @@ namespace Isis { QString checksum; if (!m_canGenerateChecksum) { - QString msg = "Cannot generate a checksum. Call setGenerateChecksum(true) before startProcess"; + std::string msg = "Cannot generate a checksum. Call setGenerateChecksum(true) before startProcess"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { if (m_cryptographicHash == NULL) { - QString msg = "Unable to generate a checksum. Did you call startProcess?"; + std::string msg = "Unable to generate a checksum. Did you call startProcess?"; throw IException(IException::Programmer, msg, _FILEINFO_); return checksum; } diff --git a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp index 0eac23c27f..c36a068bae 100644 --- a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp +++ b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp @@ -105,7 +105,7 @@ namespace Isis { CreateImageLabel(); } else { - QString msg = "Unsupported PDS output type"; + std::string msg = "Unsupported PDS output type"; throw IException(IException::User, msg, _FILEINFO_); } @@ -137,7 +137,7 @@ namespace Isis { } } else { - QString msg = "Invalid PDS export type."; + std::string msg = "Invalid PDS export type."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -251,7 +251,7 @@ namespace Isis { } } else { - QString msg = "Labels must be detached for JP2 files."; + std::string msg = "Labels must be detached for JP2 files."; throw IException(IException::Programmer, msg, _FILEINFO_); } FileName outFile(sImageFile.toStdString()); @@ -265,7 +265,7 @@ namespace Isis { cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name()); int storagebytes = InputCubes[0]->sampleCount() * InputCubes[0]->lineCount(); if(p_pixelType == Isis::Real) { - QString msg = "JPEG2000 does not support floating point data."; + std::string msg = "JPEG2000 does not support floating point data."; throw IException(IException::Programmer, msg, _FILEINFO_); } if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { @@ -342,7 +342,7 @@ namespace Isis { } } else { - QString msg = "Labels must be detached for JP2 files."; + std::string msg = "Labels must be detached for JP2 files."; throw IException(IException::Programmer, msg, _FILEINFO_); } FileName outFile(sImageFile.toStdString()); @@ -356,7 +356,7 @@ namespace Isis { cmpObj += PvlKeyword("UNCOMPRESSED_FILE_NAME", infilename.name()); int storagebytes = InputCubes[0]->sampleCount() * InputCubes[0]->lineCount(); if(p_pixelType == Isis::Real) { - QString msg = "JPEG2000 does not support floating point data."; + std::string msg = "JPEG2000 does not support floating point data."; throw IException(IException::Programmer, msg, _FILEINFO_); } if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { @@ -513,7 +513,7 @@ namespace Isis { mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel32.typ"); } else { - QString msg = "Unsupported PDS pixel type or sample size"; + std::string msg = "Unsupported PDS pixel type or sample size"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -657,7 +657,7 @@ namespace Isis { mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel32.typ"); } else { - QString msg = "Unsupported PDS pixel type or sample size"; + std::string msg = "Unsupported PDS pixel type or sample size"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -865,7 +865,7 @@ namespace Isis { */ void ProcessExportPds::OutputDetachedLabel() { if(!m_detachedLabel) { - QString msg = "Unable to output detached label. Use " + std::string msg = "Unable to output detached label. Use " "ProcessExportPds::SetDetached() to set the " "output PDS label file name."; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -996,7 +996,7 @@ namespace Isis { void ProcessExportPds::ExportTable(Table isisTable, QString detachedPdsTableFileName) { if(Attached() && detachedPdsTableFileName != "") { - QString msg = "The output PDS file has been set to attached and a " + std::string msg = "The output PDS file has been set to attached and a " "detached PDS table file name has been given. If detached " "is preferred, set the process to detached SetDetached() " "and call StandardPdsLabel() before calling ExportTable()."; @@ -1004,7 +1004,7 @@ namespace Isis { } if(Detached() && detachedPdsTableFileName == "") { - QString msg = "The output PDS file has been set to detached. A file name " + std::string msg = "The output PDS file has been set to detached. A file name " "for the detached ouput PDS table file is required. " "If an attached output file is prefered, use the method " "ProcessExportPds::SetAttached() before calling ExportTable()."; @@ -1039,7 +1039,7 @@ namespace Isis { else { mainPvl += PvlKeyword("^" + pdsTableName.toStdString(), detachedPdsTableFileName.toStdString()); FileName labelFile(m_detachedPdsLabelFile.toStdString()); - QString tableFileWithPath = labelFile.path() + "/" + QString tableFileWithPath = QString::fromStdString(labelFile.path()) + "/" + detachedPdsTableFileName; ofstream os(tableFileWithPath.toLatin1().data()); os.write(tableBuffer, isisTable.Records() * fileRecordBytes); @@ -1322,7 +1322,7 @@ namespace Isis { if (!m_detachedLabel) { for (unsigned int i = 0; i < m_tableBuffers.size(); i++) { if (m_tableBuffers[i] == NULL) { - QString msg = "Unable to add tables to PDS output file."; + std::string msg = "Unable to add tables to PDS output file."; throw IException(IException::Unknown, msg, _FILEINFO_); } // write each table buffer to fout. diff --git a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp index d0710d82aa..6bfc0e1d9f 100644 --- a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp +++ b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp @@ -107,7 +107,7 @@ namespace Isis { */ void ProcessExportPds4::CreateImageLabel() { if (InputCubes.size() == 0) { - QString msg("Must set an input cube before creating a PDS4 label."); + std::string msg("Must set an input cube before creating a PDS4 label."); throw IException(IException::Programmer, msg, _FILEINFO_); } if (m_domDoc->documentElement().isNull()) { @@ -125,7 +125,7 @@ namespace Isis { identificationArea(); } catch (IException &e) { - QString msg = "Unable to translate and export identification information."; + std::string msg = "Unable to translate and export identification information."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } try { @@ -134,7 +134,7 @@ namespace Isis { standardInstrument(); } catch (IException &e) { - QString msg = "Unable to translate and export instrument information."; + std::string msg = "Unable to translate and export instrument information."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } try { @@ -145,7 +145,7 @@ namespace Isis { displaySettings(); } catch (IException &e) { - QString msg = "Unable to translate and export display settings."; + std::string msg = "Unable to translate and export display settings."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } @@ -157,7 +157,7 @@ namespace Isis { standardBandBin(); } catch (IException &e) { - QString msg = "Unable to translate and export spectral information."; + std::string msg = "Unable to translate and export spectral information."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } @@ -169,7 +169,7 @@ namespace Isis { StandardAllMapping(); } catch (IException &e) { - QString msg = "Unable to translate and export mapping group."; + std::string msg = "Unable to translate and export mapping group."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } try { @@ -178,7 +178,7 @@ namespace Isis { fileAreaObservational(); } catch (IException &e) { - QString msg = "Unable to translate and export standard image information."; + std::string msg = "Unable to translate and export standard image information."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } } @@ -196,7 +196,7 @@ namespace Isis { // Translate the Instrument group translationFileName = "$ISISROOT/appdata/translations/pds4ExportInstrument.trn"; - PvlToXmlTranslationManager instXlator(*inputLabel, translationFileName.expanded()); + PvlToXmlTranslationManager instXlator(*inputLabel, QString::fromStdString(translationFileName.expanded())); instXlator.Auto(*m_domDoc); // If instrument and spacecraft values were translated, create the combined name @@ -258,7 +258,8 @@ namespace Isis { // Translate the Target name translationFileName = "$ISISROOT/appdata/translations/pds4ExportTargetFromInstrument.trn"; - PvlToXmlTranslationManager targXlator(*inputLabel, translationFileName.expanded()); + PvlToXmlTranslationManager targXlator(*inputLabel, QString::fromStdString(translationFileName.expanded()) +); targXlator.Auto(*m_domDoc); // Move target to just below Observing_System. @@ -268,7 +269,8 @@ namespace Isis { else if (inputLabel->findObject("IsisCube").hasGroup("Mapping")) { translationFileName = "$ISISROOT/appdata/translations/pds4ExportTargetFromMapping.trn"; - PvlToXmlTranslationManager targXlator(*inputLabel, translationFileName.expanded()); + PvlToXmlTranslationManager targXlator(*inputLabel, QString::fromStdString(translationFileName.expanded()) +); targXlator.Auto(*m_domDoc); } else { @@ -463,7 +465,8 @@ namespace Isis { Pvl *inputLabel = InputCubes[0]->label(); FileName translationFileName; translationFileName = "$ISISROOT/appdata/translations/pds4ExportIdentificationArea.trn"; - PvlToXmlTranslationManager xlator(*inputLabel, translationFileName.expanded()); + PvlToXmlTranslationManager xlator(*inputLabel, QString::fromStdString(translationFileName.expanded()) +); xlator.Auto(*m_domDoc); if (m_lid.isEmpty()) { @@ -481,7 +484,7 @@ namespace Isis { } } catch(IException &e) { - QString msg = "Could not find Identification_Area element " + std::string msg = "Could not find Identification_Area element " "to add modification history under."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -504,7 +507,7 @@ namespace Isis { // the Application::Version() return value. QRegularExpression versionRegex(" \\| \\d{4}\\-\\d{2}\\-\\d{2}"); QString historyDescription = "Created PDS4 output product from ISIS cube with the " - + FileName(Application::Name()).baseName() + + QString::fromStdString(FileName(Application::Name().toStdString()).baseName()) + " application from ISIS version " + Application::Version().remove(versionRegex) + "."; // This regular expression matches the time from the Application::DateTime return value. @@ -528,7 +531,8 @@ namespace Isis { Pvl *inputLabel = InputCubes[0]->label(); FileName translationFileName; translationFileName = "$ISISROOT/appdata/translations/pds4ExportDisplaySettings.trn"; - PvlToXmlTranslationManager xlator(*inputLabel, translationFileName.expanded()); + PvlToXmlTranslationManager xlator(*inputLabel, QString::fromStdString(translationFileName.expanded()) +); xlator.Auto(*m_domDoc); } @@ -572,8 +576,9 @@ namespace Isis { void ProcessExportPds4::translateBandBinImage(Pvl &inputLabel) { QString translationFile = "$ISISROOT/appdata/translations/"; translationFile += "pds4ExportBandBinImage.trn"; - FileName translationFileName(translationFile); - PvlToXmlTranslationManager xlator(inputLabel, translationFileName.expanded()); + FileName translationFileName(translationFile.toStdString()); + PvlToXmlTranslationManager xlator(inputLabel, QString::fromStdString(translationFileName.expanded()) +); xlator.Auto(*m_domDoc); } @@ -584,8 +589,9 @@ namespace Isis { void ProcessExportPds4::translateBandBinSpectrumUniform(Pvl &inputLabel) { QString translationFile = "$ISISROOT/appdata/translations/"; translationFile += "pds4ExportBandBinSpectrumUniform.trn"; - FileName translationFileName(translationFile); - PvlToXmlTranslationManager xlator(inputLabel, translationFileName.expanded()); + FileName translationFileName(translationFile.toStdString()); + PvlToXmlTranslationManager xlator(inputLabel, QString::fromStdString(translationFileName.expanded()) +); xlator.Auto(*m_domDoc); PvlGroup bandBinGroup = inputLabel.findObject("IsisCube").findGroup("BandBin"); @@ -610,7 +616,7 @@ namespace Isis { center = bandBinGroup["FilterCenter"]; } else { - QString msg = "Unable to translate BandBin info for BinSetSpectrum. " + std::string msg = "Unable to translate BandBin info for BinSetSpectrum. " "Translation for PDS4 required value [center_value] not found."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -622,7 +628,7 @@ namespace Isis { width = bandBinGroup["FilterWidth"]; } else { - QString msg = "Unable to translate BandBin info for BinSetSpectrum. " + std::string msg = "Unable to translate BandBin info for BinSetSpectrum. " "Translation for PDS4 required value [bin_width] not found."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -634,7 +640,7 @@ namespace Isis { units = QString::fromStdString(width.unit()); } if (units.compare(QString::fromStdString(width.unit()), Qt::CaseInsensitive) != 0) { - QString msg = "Unable to translate BandBin info for BinSetSpectrum. " + std::string msg = "Unable to translate BandBin info for BinSetSpectrum. " "Unknown or unmatching units for [center_value] and [bin_width]."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -726,8 +732,9 @@ namespace Isis { void ProcessExportPds4::translateBandBinSpectrumBinSet(Pvl &inputLabel) { QString translationFile = "$ISISROOT/appdata/translations/"; translationFile += "pds4ExportBandBinSpectrumBinSet.trn"; - FileName translationFileName(translationFile); - PvlToXmlTranslationManager xlator(inputLabel, translationFileName.expanded()); + FileName translationFileName(translationFile.toStdString()); + PvlToXmlTranslationManager xlator(inputLabel, QString::fromStdString(translationFileName.expanded()) +); xlator.Auto(*m_domDoc); PvlGroup bandBinGroup = inputLabel.findObject("IsisCube").findGroup("BandBin"); @@ -766,7 +773,7 @@ namespace Isis { center = bandBinGroup["Center"]; } else { - QString msg = "Unable to translate BandBin info for UniformlySpacedSpectrum. " + std::string msg = "Unable to translate BandBin info for UniformlySpacedSpectrum. " "Translation for PDS4 required value [last_center_value] not found."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -828,9 +835,10 @@ namespace Isis { } } translationFile += ".trn"; - FileName translationFileName(translationFile); + FileName translationFileName(translationFile.toStdString()); - PvlToXmlTranslationManager xlator(*inputLabel, translationFileName.expanded()); + PvlToXmlTranslationManager xlator(*inputLabel, QString::fromStdString(translationFileName.expanded()) +); xlator.Auto(*m_domDoc); QDomElement rootElement = m_domDoc->documentElement(); @@ -1109,19 +1117,19 @@ namespace Isis { */ void ProcessExportPds4::WritePds4(QString outFile) { - FileName outputFile(outFile); + FileName outputFile(outFile.toStdString()); // Name for output label - QString path(outputFile.originalPath()); - QString name(outputFile.baseName()); + QString path(QString::fromStdString(outputFile.originalPath())); + QString name(QString::fromStdString(outputFile.baseName())); QString labelName = path + "/" + name + ".xml"; // Name for output image - QString imageName = outputFile.expanded(); + QString imageName = QString::fromStdString(outputFile.expanded()); // If input file ends in .xml, the user entered a label name for the output file, not an // image name with a unique file extension. - if (QString::compare(outputFile.extension(), "xml", Qt::CaseInsensitive) == 0) { + if (QString::compare(QString::fromStdString(outputFile.extension()), "xml", Qt::CaseInsensitive) == 0) { imageName = path + "/" + name + ".img"; } @@ -1134,7 +1142,7 @@ namespace Isis { fileAreaObservationalElement.firstChildElement()); QDomElement fileNameElement = m_domDoc->createElement("file_name"); - PvlToXmlTranslationManager::setElementValue(fileNameElement, outputFile.name()); + PvlToXmlTranslationManager::setElementValue(fileNameElement, QString::fromStdString(outputFile.name())); fileElement.appendChild(fileNameElement); // QDomElement creationElement = m_domDoc->createElement("creation_date_time"); @@ -1183,7 +1191,7 @@ namespace Isis { xlatorSpecProj.Auto(*m_domDoc); } catch (IException &e) { - QString msg = "Unable to export projection [" + projName + "] to PDS4 product. " + + std::string msg = "Unable to export projection [" + projName + "] to PDS4 product. " + "This projection is not supported in ISIS3."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -1330,12 +1338,12 @@ namespace Isis { baseElement = m_domDoc->documentElement(); } if (baseElement.isNull()) { - QString msg = "Unable to get element from empty XML document."; + std::string msg = "Unable to get element from empty XML document."; throw IException(IException::Programmer, msg, _FILEINFO_); } QString parentName = xmlPath[0]; if (parentName != baseElement.tagName()) { - QString msg = "The tag name of the parent element passed in " + std::string msg = "The tag name of the parent element passed in " "must be the first value in the given XML path."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1380,7 +1388,7 @@ namespace Isis { pds4Type = "IEEE754LSBSingle"; } else { - QString msg = "Unsupported PDS pixel type or sample size"; + std::string msg = "Unsupported PDS pixel type or sample size"; throw IException(IException::User, msg, _FILEINFO_); } return pds4Type; @@ -1409,7 +1417,7 @@ namespace Isis { } } catch(IException &e) { - QString msg = "Could not find Identification_Area element " + std::string msg = "Could not find Identification_Area element " "to add modification history under."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1467,7 +1475,7 @@ namespace Isis { configPvl.read(transMapFile.toStdString()); } catch(IException &e) { - QString msg = "Failed to read unit translation config file [" + transMapFile + "]."; + std::string msg = "Failed to read unit translation config file [" + transMapFile + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -1476,7 +1484,7 @@ namespace Isis { transMap = createUnitMap(configPvl); } catch(IException &e) { - QString msg = "Failed to load unit translation config file [" + transMapFile + "]."; + std::string msg = "Failed to load unit translation config file [" + transMapFile + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -1486,7 +1494,7 @@ namespace Isis { translateChildUnits( label.documentElement(), transMap ); } catch(IException &e) { - QString msg = "Failed to translate units with config file [" + transMapFile + "]."; + std::string msg = "Failed to translate units with config file [" + transMapFile + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -1552,7 +1560,7 @@ namespace Isis { childElement.setAttribute("unit", transMap.value( originalUnit.toLower() ) ); } else { - QString msg = "Could not translate unit [" + originalUnit + "] to PDS4 format."; + std::string msg = "Could not translate unit [" + originalUnit + "] to PDS4 format."; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ProcessExportPds4/unitTest.cpp b/isis/src/base/objs/ProcessExportPds4/unitTest.cpp index 7c2227f996..1075fc0ec0 100644 --- a/isis/src/base/objs/ProcessExportPds4/unitTest.cpp +++ b/isis/src/base/objs/ProcessExportPds4/unitTest.cpp @@ -208,7 +208,7 @@ void IsisMain() { testProcess.StandardPds4Label(); } catch(Isis::IException &e) { - QString message = e.toString(); + std::string message = e.toString(); cout << message.replace(QRegExp("file.*/translations"), "file [translations"); cout << endl; cout << endl; diff --git a/isis/src/base/objs/ProcessGroundPolygons/ProcessGroundPolygons.cpp b/isis/src/base/objs/ProcessGroundPolygons/ProcessGroundPolygons.cpp index c68c58807d..1a59293be4 100644 --- a/isis/src/base/objs/ProcessGroundPolygons/ProcessGroundPolygons.cpp +++ b/isis/src/base/objs/ProcessGroundPolygons/ProcessGroundPolygons.cpp @@ -284,7 +284,7 @@ geos::geom::Geometry* ProcessGroundPolygons::Vectorize(std::vector &lat, const QString &avgFileName, const QString &countFileName) { /*We need a ground map for converting lat/long to line/sample see Convert()*/ - Cube cube(cubeStr, "r"); + Cube cube(cubeStr.toStdString(), "r"); p_groundMap = new UniversalGroundMap(cube); ProcessPolygons::AppendOutputCube(avgFileName, countFileName); @@ -305,7 +305,7 @@ geos::geom::Geometry* ProcessGroundPolygons::Vectorize(std::vector &lat, Isis::CubeAttributeOutput &outAtts, QString &cubeStr) { /*We need a ground map for converting lat/long to line/sample see Convert()*/ - Cube cube(cubeStr); + Cube cube(cubeStr.toStdString()); p_groundMap = new UniversalGroundMap(cube); /*setup input cube to transfer projection or camera labels*/ @@ -343,9 +343,9 @@ geos::geom::Geometry* ProcessGroundPolygons::Vectorize(std::vector &lat, CubeAttributeOutput atts = Application::GetUserInterface().GetOutputAttribute(parameter); - FileName file(avgString); - QString path = file.path(); - QString filename = file.baseName(); + FileName file(avgString.toStdString()); + QString path = QString::fromStdString(file.path()); + QString filename = QString::fromStdString(file.baseName()); QString countString = path + "/" + filename + "-count-"; SetStatCubes(avgString, countString, atts, cube); @@ -368,9 +368,9 @@ geos::geom::Geometry* ProcessGroundPolygons::Vectorize(std::vector &lat, CubeAttributeOutput atts = Application::GetUserInterface().GetOutputAttribute(parameter); - FileName file(avgString); - QString path = file.path(); - QString filename = file.baseName(); + FileName file(avgString.toStdString()); + QString path = QString::fromStdString(file.path()); + QString filename = QString::fromStdString(file.baseName()); QString countString = path + "/" + filename + "-count-"; SetStatCubes(avgString, countString, atts, map, bands); diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.cpp b/isis/src/base/objs/ProcessImport/ProcessImport.cpp index bde33889c1..44226b0ee7 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.cpp +++ b/isis/src/base/objs/ProcessImport/ProcessImport.cpp @@ -268,7 +268,7 @@ namespace Isis { p_pixelType = type; } else { - QString msg = "Unsupported pixel type [" + + std::string msg = "Unsupported pixel type [" + Isis::PixelTypeName(type) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -281,7 +281,7 @@ namespace Isis { p_suffixPixelType = type; } else { - QString msg = "Unsupported pixel type [" + + std::string msg = "Unsupported pixel type [" + Isis::PixelTypeName(type) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -307,7 +307,7 @@ namespace Isis { p_nb = nb; } else { - QString msg = "Illegal dimension [" + toString(ns) + ", " + + std::string msg = "Illegal dimension [" + toString(ns) + ", " + toString(nl) + ", " + toString(nb) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -350,7 +350,7 @@ namespace Isis { p_fileHeaderBytes = bytes; } else { - QString msg = "Illegal file header size [" + toString(bytes) + "]"; + std::string msg = "Illegal file header size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -380,7 +380,7 @@ namespace Isis { p_fileTrailerBytes = bytes; } else { - QString msg = "Illegal file trailer size [" + toString(bytes) + "]"; + std::string msg = "Illegal file trailer size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -409,7 +409,7 @@ namespace Isis { p_dataHeaderBytes = bytes; } else { - QString msg = "Illegal data header size [" + toString(bytes) + "]"; + std::string msg = "Illegal data header size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -445,7 +445,7 @@ namespace Isis { p_dataTrailerBytes = bytes; } else { - QString msg = "Illegal data trailer size [" + toString(bytes) + "]"; + std::string msg = "Illegal data trailer size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -475,7 +475,7 @@ namespace Isis { p_dataPreBytes = bytes; } else { - QString msg = "Illegal data prefix size [" + toString(bytes) + "]"; + std::string msg = "Illegal data prefix size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -505,7 +505,7 @@ namespace Isis { p_dataPostBytes = bytes; } else { - QString msg = "Illegal data suffix size [" + toString(bytes) + "]"; + std::string msg = "Illegal data suffix size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -530,7 +530,7 @@ namespace Isis { */ void ProcessImport::SaveFileHeader() { if (p_fileHeaderBytes == 0) { - QString msg = "File header bytes equals 0. There is nothing to save. " + std::string msg = "File header bytes equals 0. There is nothing to save. " "Use SetFileHeaderBytes() first."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -557,7 +557,7 @@ namespace Isis { */ void ProcessImport::SaveFileTrailer() { if (p_fileTrailerBytes == 0) { - QString msg = "File trailer bytes equals 0. There is nothing to save. " + std::string msg = "File trailer bytes equals 0. There is nothing to save. " "Use SetFileTrailerBytes() first."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -586,7 +586,7 @@ namespace Isis { */ void ProcessImport::SaveDataHeader() { if (p_dataHeaderBytes == 0) { - QString msg = "Data header bytes equals 0. There is nothing to save. " + std::string msg = "Data header bytes equals 0. There is nothing to save. " "Use SetDataHeaderBytes() first."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -615,7 +615,7 @@ namespace Isis { */ void ProcessImport::SaveDataTrailer() { if (p_dataTrailerBytes == 0) { - QString msg = "Data trailer bytes equals 0. There is nothing to save. " + std::string msg = "Data trailer bytes equals 0. There is nothing to save. " "Use SetDataTrailerBytes() first."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -643,7 +643,7 @@ namespace Isis { */ void ProcessImport::SaveDataPrefix() { if (p_dataPreBytes == 0) { - QString msg = "Data prefix bytes equals 0. There is nothing to save. " + std::string msg = "Data prefix bytes equals 0. There is nothing to save. " "Use SetDataPrefixBytes() first."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -672,7 +672,7 @@ namespace Isis { */ void ProcessImport::SaveDataSuffix() { if (p_dataPostBytes == 0) { - QString msg = "Data suffix bytes equals 0. There is nothing to save. " + std::string msg = "Data suffix bytes equals 0. There is nothing to save. " "Use SetDataSuffixBytes() first."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -753,7 +753,7 @@ namespace Isis { if (p_saveFileHeader) { return p_fileHeader; } - QString msg = "File header was not saved. Use SaveFileHeader()."; + std::string msg = "File header was not saved. Use SaveFileHeader()."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -779,7 +779,7 @@ namespace Isis { if (p_saveFileTrailer) { return p_fileTrailer; } - QString msg = "File trailer was not saved. Use SaveFileTrailer()"; + std::string msg = "File trailer was not saved. Use SaveFileTrailer()"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -807,7 +807,7 @@ namespace Isis { if (p_saveDataHeader) { return p_dataHeader; } - QString msg = "Data header was not saved. Use SaveDataHeader()"; + std::string msg = "Data header was not saved. Use SaveDataHeader()"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -835,7 +835,7 @@ namespace Isis { if (p_saveDataTrailer) { return p_dataTrailer; } - QString msg = "Data trailer was not saved. Use SaveDataTrailer()"; + std::string msg = "Data trailer was not saved. Use SaveDataTrailer()"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -863,7 +863,7 @@ namespace Isis { if (p_saveDataPre) { return p_dataPre; } - QString msg = "Data prefix was not saved. Use SaveDataPrefix()"; + std::string msg = "Data prefix was not saved. Use SaveDataPrefix()"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -891,7 +891,7 @@ namespace Isis { if (p_saveDataPost) { return p_dataPost; } - QString msg = "Data suffix was not saved. Use SaveDataSuffix()"; + std::string msg = "Data suffix was not saved. Use SaveDataSuffix()"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1103,7 +1103,7 @@ namespace Isis { (pixelMax > p_null_min && pixelMax < p_null_max) || // --max crossing (pixelMin < p_null_min && pixelMax > p_null_max))) { // --straddling // values - QString msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the NULL range [" + toString(p_null_min) + "," + toString(p_null_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1113,7 +1113,7 @@ namespace Isis { (pixelMin > p_lrs_min && pixelMin < p_lrs_max) || (pixelMax > p_lrs_min && pixelMax < p_lrs_max) || (pixelMin < p_lrs_min && pixelMax > p_lrs_max))) { - QString msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the LRS range [" + toString(p_lrs_min) + "," + toString(p_lrs_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1123,7 +1123,7 @@ namespace Isis { (pixelMin > p_lis_min && pixelMin < p_lis_max) || (pixelMax > p_lis_min && pixelMax < p_lis_max) || (pixelMin < p_lis_min && pixelMax > p_lis_max))) { - QString msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the LIS range [" + toString(p_lis_min) + "," + toString(p_lis_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1133,7 +1133,7 @@ namespace Isis { (pixelMin > p_hrs_min && pixelMin < p_hrs_max) || (pixelMax > p_hrs_min && pixelMax < p_hrs_max) || (pixelMin < p_hrs_min && pixelMax > p_hrs_max))) { - QString msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the HRS range [" + toString(p_hrs_min) + "," + toString(p_hrs_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1143,7 +1143,7 @@ namespace Isis { (pixelMin > p_his_min && pixelMin < p_his_max) || (pixelMax > p_his_min && pixelMax < p_his_max) || (pixelMin < p_his_min && pixelMax > p_his_max))) { - QString msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the HIS range [" + toString(p_his_min) + "," + toString(p_his_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1225,7 +1225,7 @@ namespace Isis { max = Isis::VALID_MAX1 * p_mult[0] + p_base[0]; } else { - QString msg = "Unsupported pixel type [" + + std::string msg = "Unsupported pixel type [" + Isis::PixelTypeName(p_pixelType) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1312,7 +1312,7 @@ namespace Isis { ProcessBip(); } else { - QString msg = "File [" + p_inFile + std::string msg = "File [" + p_inFile + "] is not in a supported organization."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1342,7 +1342,7 @@ namespace Isis { ProcessBip(funct); } else { - QString msg = "File [" + p_inFile + "] is not in a supported organization."; + std::string msg = "File [" + p_inFile + "] is not in a supported organization."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1372,11 +1372,11 @@ namespace Isis { ifstream fin; // Open input file - Isis::FileName inFile(p_inFile); - QString inFileName(inFile.expanded()); + Isis::FileName inFile(p_inFile.toStdString()); + QString inFileName(QString::fromStdString(inFile.expanded())); fin.open(inFileName.toLatin1().data(), ios::in | ios::binary); if (!fin.is_open()) { - QString msg = "Cannot open input file [" + p_inFile + "]"; + std::string msg = "Cannot open input file [" + p_inFile + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1393,7 +1393,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1438,7 +1438,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1462,7 +1462,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1472,7 +1472,7 @@ namespace Isis { pos = fin.tellg(); fin.read(in, readBytes); if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(readBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1547,7 +1547,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1578,7 +1578,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1598,7 +1598,7 @@ namespace Isis { // Check the io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileTrailerBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1636,11 +1636,11 @@ namespace Isis { ifstream fin; // Open input file - Isis::FileName inFile(p_inFile); - QString inFileName(inFile.expanded()); + Isis::FileName inFile(p_inFile.toStdString()); + QString inFileName(QString::fromStdString(inFile.expanded())); fin.open(inFileName.toLatin1().data(), ios::in | ios::binary); if (!fin.is_open()) { - QString msg = "Cannot open input file [" + p_inFile + "]"; + std::string msg = "Cannot open input file [" + p_inFile + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1658,7 +1658,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1697,7 +1697,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1718,7 +1718,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1729,7 +1729,7 @@ namespace Isis { pos = fin.tellg(); fin.read(in, readBytes); if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(readBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1801,7 +1801,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1821,7 +1821,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1843,7 +1843,7 @@ namespace Isis { // Check the io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileTrailerBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1876,11 +1876,11 @@ namespace Isis { ifstream fin; // Open input file - Isis::FileName inFile(p_inFile); - QString inFileName(inFile.expanded()); + Isis::FileName inFile(p_inFile.toStdString()); + QString inFileName(QString::fromStdString(inFile.expanded())); fin.open(inFileName.toLatin1().data(), ios::in | ios::binary); if (!fin.is_open()) { - QString msg = "Cannot open input file [" + p_inFile + "]"; + std::string msg = "Cannot open input file [" + p_inFile + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1897,7 +1897,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1928,7 +1928,7 @@ namespace Isis { for(int line = 0; line < p_nl; line++) { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1939,7 +1939,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1949,7 +1949,7 @@ namespace Isis { pos = fin.tellg(); fin.read(in, readBytes); if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(readBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -2049,7 +2049,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -2067,7 +2067,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -2089,7 +2089,7 @@ namespace Isis { // Check the io if (!fin.good()) { - QString msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileTrailerBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -2300,8 +2300,8 @@ namespace Isis { */ void ProcessImport::SetInputFile(const QString &file) { p_inFile = file; - if (!Isis::FileName(file).fileExists()) { - QString msg = "File [" + file + "] does not exist"; + if (!Isis::FileName(file.toStdString()).fileExists()) { + std::string msg = "File [" + file + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -2317,7 +2317,7 @@ namespace Isis { */ QString ProcessImport::InputFile() { if (p_inFile.size() <= 0) { - QString msg = "No input file has been set"; + std::string msg = "No input file has been set"; throw IException(IException::Programmer, msg, _FILEINFO_); } return p_inFile; diff --git a/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp b/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp index 861093c7e1..ad85c1342a 100644 --- a/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp +++ b/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp @@ -202,8 +202,8 @@ namespace Isis { } else { - QString msg = QObject::tr("The FITS file does not contain a section header that appears " - "to describe an image [%1].").arg(m_name.toString()); + std::string msg = "The FITS file does not contain a section header that appears " + "to describe an image [" + m_name.toString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -223,21 +223,19 @@ namespace Isis { */ PvlGroup ProcessImportFits::extraFitsLabel(int labelNumber) const { if (labelNumber >= m_extraFitsLabels->size()) { - QString msg = QObject::tr("The requested label number [%1], from file [%2] is " + std::string msg = "The requested label number [" + std::to_string(labelNumber) + "], from file [" + m_name.expanded() + "] is " "past the last extra group found in this FITS file. " - "Extra label count is [%3]").arg(labelNumber). - arg(m_name.expanded()).arg(m_extraFitsLabels->size()-1); + "Extra label count is [" + std::to_string(m_extraFitsLabels->size()-1) + "]"; throw IException(IException::User, msg, _FILEINFO_); } if (!m_extraFitsLabels) { - QString msg = QObject::tr("The FITS label has not been initialized, " + std::string msg = QObject::tr("The FITS label has not been initialized, " "call setFitsFile() first."); throw IException(IException::Programmer, msg, _FILEINFO_); } else if (m_extraFitsLabels->size() < labelNumber) { - QString msg = QObject::tr("The requested FITS label number " - "was not found in file [%1].").arg(m_name.toString()); + std::string msg = "The requested FITS label number was not found in file [" + m_name.toString() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -259,21 +257,19 @@ namespace Isis { PvlGroup ProcessImportFits::fitsImageLabel(int labelNumber) const { if (labelNumber >= m_fitsImageLabels->size()) { - QString msg = QObject::tr("The requested label number [%1], from file [%2] is " + std::string msg = "The requested label number [" + std::to_string(labelNumber) + "], from file [" + m_name.expanded() + "] is " "past the last image group found in this FITS file. " - "Image label count is [%3]").arg(labelNumber). - arg(m_name.expanded()).arg(m_fitsImageLabels->size()-1); + "Image label count is [" + std::to_string(m_fitsImageLabels->size()-1) + "]"; throw IException(IException::User, msg, _FILEINFO_); } if (!m_fitsImageLabels) { - QString msg = QObject::tr("The FITS label has not been initialized, " + std::string msg = QObject::tr("The FITS label has not been initialized, " "call setFitsFile first."); throw IException(IException::Programmer, msg, _FILEINFO_); } else if (m_fitsImageLabels->size() < labelNumber) { - QString msg = QObject::tr("The requested FITS label number " - "was not found in file [%1].").arg(m_name.toString()); + std::string msg = "The requested FITS label number was not found in file [" + m_name.toString() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -324,13 +320,12 @@ namespace Isis { void ProcessImportFits::setFitsFile(FileName fitsFile) { m_name = fitsFile; - SetInputFile(fitsFile.toString()); // Make sure the file exists + SetInputFile(QString::fromStdString(fitsFile.toString())); // Make sure the file exists - m_file.open(fitsFile.expanded().toLocal8Bit().constData(), std::ios::in | std::ios::binary); + m_file.open(fitsFile.expanded().c_str(), std::ios::in | std::ios::binary); if (!m_file.is_open()) { - QString msg = QObject::tr("Unable to open FITS formatted file [%1].") - .arg(fitsFile.toString()); + std::string msg = "Unable to open FITS formatted file [" + fitsFile.toString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -340,9 +335,7 @@ namespace Isis { // Check to make sure it is a FITS file we can handle PvlGroup label = fitsImageLabel(0); if (label.hasKeyword("SIMPLE") && label["SIMPLE"][0] == "F") { - QString msg = QObject::tr("The file [%1] cannot be processed. " - "It is an unsupported format."). - arg(fitsFile.toString()); + std::string msg = "The file [" + fitsFile.toString() + "] cannot be processed. It is an unsupported format."; throw IException(IException::User, msg, _FILEINFO_); } @@ -363,7 +356,7 @@ namespace Isis { void ProcessImportFits::setProcessFileStructure(int labelNumber) { if (labelNumber >= m_fitsImageLabels->size()) { - QString msg = QObject::tr("The requested label number [%1], from file [%2] is " + std::string msg = QObject::tr("The requested label number [%1], from file [%2] is " "past the last image in this FITS file [%3].").arg(labelNumber). arg(InputFile()).arg(m_fitsImageLabels->size()-1); throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp index a016fc5d17..f132b789ea 100644 --- a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp +++ b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp @@ -92,7 +92,7 @@ namespace Isis { p_projection = pdsXlater.Translate("ProjectionName"); } else { - QString message = "No projection name in labels"; + std::string message = "No projection name in labels"; throw IException(IException::Unknown, message, _FILEINFO_); } @@ -100,7 +100,7 @@ namespace Isis { p_targetName = pdsXlater.Translate("TargetName"); } else { - QString message = "No target name in labels"; + std::string message = "No target name in labels"; throw IException(IException::Unknown, message, _FILEINFO_); } @@ -109,7 +109,7 @@ namespace Isis { p_equatorialRadius = toDouble(str) * 1000.0; } else { - QString message = "No equatorial radius name in labels"; + std::string message = "No equatorial radius name in labels"; throw IException(IException::User, message, _FILEINFO_); } @@ -118,7 +118,7 @@ namespace Isis { p_polarRadius = toDouble(str) * 1000.0; } else { - QString message = "No polar radius in labels"; + std::string message = "No polar radius in labels"; throw IException(IException::User, message, _FILEINFO_); } @@ -499,7 +499,7 @@ namespace Isis { units = QString::fromStdString(dataFilePointer.unit()); // Successful? we have an offset, means current, p_labelFile // is the location of the data as well - dataFileName = FileName(p_labelFile).name(); + dataFileName = QString::fromStdString(FileName(p_labelFile.toStdString()).name()); } catch(IException &e) { // Failed to parse to an int, means we have a file name @@ -518,14 +518,14 @@ namespace Isis { } // Error, no value else if (dataFilePointer.size() == 0) { - QString msg = "Data file pointer ^IMAGE or ^QUBE has no value, must" + std::string msg = "Data file pointer ^IMAGE or ^QUBE has no value, must" "have either file name or offset or both, in [" + p_labelFile + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } // Error, more than two values else { - QString msg = "Improperly formatted data file pointer keyword ^IMAGE or " + std::string msg = "Improperly formatted data file pointer keyword ^IMAGE or " "^QUBE, in [" + p_labelFile + "], must contain filename " " or offset or both"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -534,30 +534,30 @@ namespace Isis { // Now, to handle the values we found // the filename first, only do so if calcOffsetOnly is false if (!calcOffsetOnly) { - Isis::FileName labelFile(p_labelFile); + Isis::FileName labelFile(p_labelFile.toStdString()); // If dataFileName isn't empty, and does start at the root, use it Isis::FileName dataFile; if (dataFileName.size() != 0 && dataFileName.at(0) == '/') - dataFile = FileName(dataFileName); + dataFile = FileName(dataFileName.toStdString()); // Otherwise, use the path to it and its name else - dataFile = FileName(labelFile.path() + "/" + dataFileName); + dataFile = FileName(labelFile.path() + "/" + dataFileName.toStdString()); // If it exists, use it if (dataFile.fileExists()) { - SetInputFile(dataFile.expanded()); + SetInputFile(QString::fromStdString(dataFile.expanded())); } // Retry with downcased name, if still no luck, fail else { - QString tmp = dataFile.expanded(); + QString tmp = QString::fromStdString(dataFile.expanded()); dataFileName = dataFileName.toLower(); - dataFile = FileName(labelFile.path() + "/" + dataFileName); + dataFile = FileName(labelFile.path() + "/" + dataFileName.toStdString()); if (dataFile.fileExists()) { - SetInputFile(dataFile.expanded()); + SetInputFile(QString::fromStdString(dataFile.expanded())); } else { - QString msg = "Unable to find input file [" + tmp + "] or [" + + std::string msg = "Unable to find input file [" + tmp.toStdString() + "] or [" + dataFile.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -669,20 +669,20 @@ namespace Isis { p_encodingType = JP2; str = pdsXlater.Translate("PdsCompressedFile"); if (pdsDataFile.isEmpty()) { - Isis::FileName lfile(p_labelFile); - Isis::FileName ifile(lfile.path() + "/" + str); + Isis::FileName lfile(p_labelFile.toStdString()); + Isis::FileName ifile(lfile.path() + "/" + str.toStdString()); if (ifile.fileExists()) { - p_jp2File = ifile.expanded(); + p_jp2File = QString::fromStdString(ifile.expanded()); } else { - QString tmp = ifile.expanded(); + QString tmp = QString::fromStdString(ifile.expanded()); str = str.toLower(); - ifile = lfile.path() + "/" + str; + ifile = lfile.path() + "/" + str.toStdString(); if (ifile.fileExists()) { - p_jp2File = ifile.expanded(); + p_jp2File = QString::fromStdString(ifile.expanded()); } else { - QString msg = "Unable to find input file [" + tmp + "] or [" + + std::string msg = "Unable to find input file [" + tmp.toStdString() + "] or [" + ifile.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -690,7 +690,7 @@ namespace Isis { } } else { - QString msg = "Unsupported encoding type in [" + p_labelFile + "]"; + std::string msg = "Unsupported encoding type in [" + p_labelFile + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -732,7 +732,7 @@ namespace Isis { ProcessPdsCombinedSpectrumLabel(pdsDataFile); } else { - QString msg = "Unknown label type in [" + p_labelFile + "]. It is possible the label file " + std::string msg = "Unknown label type in [" + p_labelFile + "]. It is possible the label file " + "does not describe an image product (IMAGE, CUBE, or SPECTRALCUBE)."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -758,8 +758,8 @@ namespace Isis { * @throws Isis::iException::Message */ void ProcessImportPds::ProcessPdsCombinedSpectrumLabel(const QString &pdsDataFile) { - Isis::FileName transFile(p_transDir + "/translations/pdsCombinedSpectrum.trn"); - Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, transFile.expanded()); + Isis::FileName transFile(p_transDir.toStdString() + "/translations/pdsCombinedSpectrum.trn"); + Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, QString::fromStdString(transFile.expanded())); QString str; @@ -829,7 +829,7 @@ namespace Isis { SetOrganization(ProcessImport::BIL); } else { - QString msg = "Unsupported axis order [" + str + "]"; + std::string msg = "Unsupported axis order [" + str + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -855,9 +855,9 @@ namespace Isis { const QString &transFile) { - Isis::FileName tFile(p_transDir + "/translations/" + transFile); + Isis::FileName tFile(p_transDir.toStdString() + "/translations/" + transFile.toStdString()); - Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, tFile.expanded()); + Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, QString::fromStdString(tFile.expanded())); QString str; @@ -882,7 +882,7 @@ namespace Isis { bandPos = i; } else { - QString message = "Unknown file axis name [" + str + "]"; + std::string message = "Unknown file axis name [" + str + "]"; throw IException(IException::User, message, _FILEINFO_); } } @@ -906,7 +906,7 @@ namespace Isis { stringstream pdsCoreOrgStream; pdsCoreOrgStream << pdsCoreOrg; - QString msg = "Unsupported axis order [" + QString(pdsCoreOrgStream.str().c_str()) + "]"; + std::string msg = "Unsupported axis order [" + QString(pdsCoreOrgStream.str().c_str()) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -952,7 +952,7 @@ namespace Isis { //if(str == "LSB" || str == "MSB") // SetByteOrder(Isis::ByteOrderEnumeration(str)); //else { - // QString msg = "Unrecognized byte order ["+str+"]"; + // std::string msg = "Unrecognized byte order ["+str+"]"; // throw IException(IException::Programmer,msg,_FILEINFO_); //} @@ -1031,8 +1031,8 @@ namespace Isis { * @throws Isis::iException::Message */ void ProcessImportPds::ProcessPdsImageLabel(const QString &pdsDataFile) { - Isis::FileName transFile(p_transDir + "/translations/pdsImage.trn"); - Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, transFile.expanded()); + Isis::FileName transFile(p_transDir.toStdString() + "/translations/pdsImage.trn"); + Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, QString::fromStdString(transFile.expanded())); QString str; @@ -1106,7 +1106,7 @@ namespace Isis { SetOrganization(ProcessImport::BIL); } else { - QString msg = "Unsupported axis order [" + str + "]"; + std::string msg = "Unsupported axis order [" + str + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1173,22 +1173,22 @@ namespace Isis { void ProcessImportPds::ProcessPdsM3Label(const QString &pdsDataFile, PdsFileType fileType) { Isis::FileName transFile; if (fileType == L0) { - transFile = p_transDir + "/translations/pdsL0.trn"; + transFile = p_transDir.toStdString() + "/translations/pdsL0.trn"; } else if (fileType == Rdn) { - transFile = p_transDir + "/translations/pdsRdn.trn"; + transFile = p_transDir.toStdString() + "/translations/pdsRdn.trn"; } else if (fileType == Loc) { - transFile = p_transDir + "/translations/pdsLoc.trn"; + transFile = p_transDir.toStdString() + "/translations/pdsLoc.trn"; } else if (fileType == Obs) { - transFile = p_transDir + "/translations/pdsObs.trn"; + transFile = p_transDir.toStdString() + "/translations/pdsObs.trn"; } else { throw IException(IException::Programmer, "ProcessImportPds::ProcessPdsM3Label can only be " "called with file type of L0, Rdn, Loc or Obs.", _FILEINFO_); } - Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, transFile.expanded()); + Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, QString::fromStdString(transFile.expanded())); QString str; @@ -1263,7 +1263,7 @@ namespace Isis { SetOrganization(ProcessImport::BIL); } else { - QString msg = "Unsupported axis order [" + str + "]"; + std::string msg = "Unsupported axis order [" + str + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1453,8 +1453,8 @@ namespace Isis { // Set up a translater for Isis2 labels QString transDir = "$ISISROOT/appdata"; - Isis::FileName transFile(transDir + "/" + "translations/isis2bandbin.trn"); - Isis::PvlToPvlTranslationManager isis2Xlater(p_pdsLabel, transFile.expanded()); + Isis::FileName transFile(transDir.toStdString() + "/" + "translations/isis2bandbin.trn"); + Isis::PvlToPvlTranslationManager isis2Xlater(p_pdsLabel, QString::fromStdString(transFile.expanded())); // Add all the Isis2 keywords that can be translated to the requested label isis2Xlater.Auto(lab); @@ -1471,8 +1471,8 @@ namespace Isis { // Set up a translater for Isis2 labels QString transDir = "$ISISROOT/appdata"; - Isis::FileName transFile(transDir + "/" + "translations/isis2instrument.trn"); - Isis::PvlToPvlTranslationManager isis2Xlater(p_pdsLabel, transFile.expanded()); + Isis::FileName transFile(transDir.toStdString() + "/" + "translations/isis2instrument.trn"); + Isis::PvlToPvlTranslationManager isis2Xlater(p_pdsLabel, QString::fromStdString(transFile.expanded())); // Add all the Isis2 keywords that can be translated to the requested label isis2Xlater.Auto(lab); @@ -1510,8 +1510,8 @@ namespace Isis { */ void ProcessImportPds::TranslatePdsArchive(Isis::Pvl &lab) { // Set up a translater for PDS labels - Isis::FileName transFile(p_transDir + "/" + "translations/pdsImageArchive.trn"); - Isis::PvlToPvlTranslationManager isis2Xlater(p_pdsLabel, transFile.expanded()); + Isis::FileName transFile(p_transDir.toStdString() + "/" + "translations/pdsImageArchive.trn"); + Isis::PvlToPvlTranslationManager isis2Xlater(p_pdsLabel, QString::fromStdString(transFile.expanded())); // Add all the Isis2 keywords that can be translated to the requested label isis2Xlater.Auto(lab); @@ -1526,8 +1526,8 @@ namespace Isis { */ void ProcessImportPds::TranslatePdsBandBin(Isis::Pvl &lab) { // Set up a translater for PDS labels - Isis::FileName transFile(p_transDir + "/" + "translations/pdsImageBandBin.trn"); - Isis::PvlToPvlTranslationManager isis2Xlater(p_pdsLabel, transFile.expanded()); + Isis::FileName transFile(p_transDir.toStdString() + "/" + "translations/pdsImageBandBin.trn"); + Isis::PvlToPvlTranslationManager isis2Xlater(p_pdsLabel, QString::fromStdString(transFile.expanded())); // Add all the Isis2 keywords that can be translated to the requested label isis2Xlater.Auto(lab); @@ -1585,19 +1585,19 @@ namespace Isis { Isis::FileName transFile; if (projType.InputHasKeyword("PdsProjectionTypeImage")) { - transFile = transDir + "/" + "translations/pdsImageProjection.trn"; + transFile = transDir.toStdString() + "/" + "translations/pdsImageProjection.trn"; } else if (projType.InputHasKeyword("PdsProjectionTypeQube")) { - transFile = transDir + "/" + "translations/pdsQubeProjection.trn"; + transFile = transDir.toStdString() + "/" + "translations/pdsQubeProjection.trn"; } else if (projType.InputHasKeyword("PdsProjectionTypeSpectralQube")) { - transFile = transDir + "/" + "translations/pdsSpectralQubeProjection.trn"; + transFile = transDir.toStdString() + "/" + "translations/pdsSpectralQubeProjection.trn"; } else { return; } - Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, transFile.expanded()); + Isis::PvlToPvlTranslationManager pdsXlater(p_pdsLabel, QString::fromStdString(transFile.expanded())); ExtractPdsProjection(pdsXlater); diff --git a/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp b/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp index 8ae5a79495..aceb29122f 100644 --- a/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp +++ b/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp @@ -34,7 +34,7 @@ namespace Isis { ifstream vicFile(vicarFile.toLatin1().data(), ios::in); if(!vicFile) { - QString msg = "Cannot open vicar file [" + vicarFile + "]"; + std::string msg = "Cannot open vicar file [" + vicarFile + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -68,7 +68,7 @@ namespace Isis { if(pixType == "HALF") pixelType = SignedWord; if(pixType == "REAL") pixelType = Real; if(pixelType == None) { - QString msg = "Unsupported pixel type [FORMAT=" + pixType + "]"; + std::string msg = "Unsupported pixel type [FORMAT=" + pixType + "]"; throw IException(IException::Io, msg, _FILEINFO_); } SetPixelType(pixelType); @@ -92,7 +92,7 @@ namespace Isis { SetOrganization(ProcessImport::BIP); } else { - QString msg = "Unsupported file organization [" + organization + "]"; + std::string msg = "Unsupported file organization [" + organization + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -121,7 +121,7 @@ namespace Isis { } } catch(IException &e) { - QString msg = "Input file [" + vicarFile + "] does not appear to be a vicar file"; + std::string msg = "Input file [" + vicarFile + "] does not appear to be a vicar file"; throw IException(IException::User, msg, _FILEINFO_); } @@ -155,7 +155,7 @@ namespace Isis { // we're totally lost at this point if(pos == 1023) { - QString msg = "Cannot find label size in VICAR file"; + std::string msg = "Cannot find label size in VICAR file"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp index 070c8233c7..14e284f4cb 100644 --- a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp +++ b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp @@ -51,17 +51,17 @@ namespace Isis { */ bool ProcessMapMosaic::StartProcess(QString inputFile) { if (InputCubes.size() != 0) { - QString msg = "Input cubes already exist; do not call SetInputCube when using "; + std::string msg = "Input cubes already exist; do not call SetInputCube when using "; msg += "ProcessMosaic::StartProcess(QString)"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (OutputCubes.size() == 0) { - QString msg = "An output cube must be set before calling StartProcess"; + std::string msg = "An output cube must be set before calling StartProcess"; throw IException(IException::Programmer, msg, _FILEINFO_); } - CubeAttributeInput inAtt(inputFile); + CubeAttributeInput inAtt(inputFile.toStdString()); Cube *inCube = ProcessMosaic::SetInputCube(inputFile, inAtt); inCube->addCachingAlgorithm(new UniqueIOCachingAlgorithm(2)); @@ -72,7 +72,7 @@ namespace Isis { int nlMosaic = mosaicCube->lineCount(); if (*iproj != *oproj) { - QString msg = "Mapping groups do not match between cube [" + inputFile + "] and mosaic"; + std::string msg = "Mapping groups do not match between cube [" + inputFile + "] and mosaic"; throw IException(IException::User, msg, _FILEINFO_); } @@ -151,7 +151,7 @@ namespace Isis { } else { // Place the input in the mosaic - Progress()->SetText("Mosaicking " + FileName(inputFile).name()); + Progress()->SetText("Mosaicking " + QString::fromStdString(FileName(inputFile.toStdString()).name())); try { do { @@ -171,7 +171,7 @@ namespace Isis { while (wrapPossible && outSample < nsMosaic); } catch (IException &e) { - QString msg = "Unable to mosaic cube [" + FileName(inputFile).name() + "]"; + std::string msg = "Unable to mosaic cube [" + FileName(inputFile.toStdString()).name() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -215,7 +215,7 @@ namespace Isis { for (int i = 0; i < propagationCubes.size(); i++) { // Open the cube and get the maximum number of band in all cubes Cube cube; - cube.open(propagationCubes[i].toString()); + cube.open(QString::fromStdString(propagationCubes[i].toString())); bands = max(bands, cube.bandCount()); // See if the cube has a projection and make sure it matches @@ -223,7 +223,7 @@ namespace Isis { TProjection *projNew = (TProjection *) Isis::ProjectionFactory::CreateFromCube(*(cube.label())); if ((proj != NULL) && (*proj != *projNew)) { - QString msg = "Mapping groups do not match between cubes [" + + std::string msg = "Mapping groups do not match between cubes [" + propagationCubes[0].toString() + "] and [" + propagationCubes[i].toString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -261,7 +261,7 @@ namespace Isis { if (proj) delete proj; - return SetOutputCube(propagationCubes[0].toString(), xmin, xmax, ymin, ymax, + return SetOutputCube(QString::fromStdString(propagationCubes[0].toString()), xmin, xmax, ymin, ymax, slat, elat, slon, elon, bands, oAtt, mosaicFile, latlonflag); } @@ -293,7 +293,7 @@ namespace Isis { for (int i = 0; i < propagationCubes.size(); i++) { // Open the cube and get the maximum number of band in all cubes Cube cube; - cube.open(propagationCubes[i].toString()); + cube.open(QString::fromStdString(propagationCubes[i].toString())); bands = max(bands, cube.bandCount()); // See if the cube has a projection and make sure it matches @@ -301,7 +301,7 @@ namespace Isis { RingPlaneProjection *projNew = (RingPlaneProjection *) Isis::ProjectionFactory::CreateFromCube(*(cube.label())); if ((proj != NULL) && (*proj != *projNew)) { - QString msg = "Mapping groups do not match between cubes [" + + std::string msg = "Mapping groups do not match between cubes [" + propagationCubes[0].toString() + "] and [" + propagationCubes[i].toString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -334,7 +334,7 @@ namespace Isis { if (proj) delete proj; - return RingsSetOutputCube(propagationCubes[0].toString(), xmin, xmax, ymin, ymax, + return RingsSetOutputCube(QString::fromStdString(propagationCubes[0].toString()), xmin, xmax, ymin, ymax, srad, erad, saz, eaz, bands, oAtt, mosaicFile); } @@ -354,7 +354,7 @@ namespace Isis { int samples, lines, bands = 0; Pvl label; - label.read(propagationCubes[0].toString().toStdString()); + label.read(propagationCubes[0].toString()); PvlGroup mGroup = label.findGroup("Mapping", Pvl::Traverse); // All mosaicking programs use only the upper left x and y to determine where to @@ -392,7 +392,7 @@ namespace Isis { for (int i = 0; i < propagationCubes.size(); i++) { Cube cube; - cube.open(propagationCubes[i].toString()); + cube.open(QString::fromStdString(propagationCubes[i].toString())); bands = max(cube.bandCount(), bands); // See if the cube has a projection and make sure it matches @@ -403,8 +403,8 @@ namespace Isis { if (proj == NULL) { } else if (*proj != *projNew) { - std::string msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString().toStdString() + - "] and [" + propagationCubes[0].toString().toStdString() + "]"; + std::string msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString() + + "] and [" + propagationCubes[0].toString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -414,7 +414,7 @@ namespace Isis { if (proj) delete proj; - return SetOutputCube(propagationCubes[0].toString(), xmin, xmax, ymin, ymax, + return SetOutputCube(QString::fromStdString(propagationCubes[0].toString()), xmin, xmax, ymin, ymax, slat, elat, slon, elon, bands, oAtt, mosaicFile); } @@ -443,7 +443,7 @@ namespace Isis { int samples, lines, bands = 0; Pvl label; - label.read(propagationCubes[0].toString().toStdString()); + label.read(propagationCubes[0].toString()); PvlGroup mGroup = label.findGroup("Mapping", Pvl::Traverse); mGroup.addKeyword(PvlKeyword("MinimumRingRadius", std::to_string(srad)), Pvl::Replace); mGroup.addKeyword(PvlKeyword("MaximumRingRadius", std::to_string(erad)), Pvl::Replace); @@ -471,7 +471,7 @@ namespace Isis { for (int i = 0; i < propagationCubes.size(); i++) { Cube cube; - cube.open(propagationCubes[i].toString()); + cube.open(QString::fromStdString(propagationCubes[i].toString())); bands = max(cube.bandCount(), bands); // See if the cube has a projection and make sure it matches @@ -481,8 +481,8 @@ namespace Isis { if (proj == NULL) { } else if (*proj != *projNew) { - std::string msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString().toStdString() + - "] and [" + propagationCubes[0].toString().toStdString() + "]"; + std::string msg = "Mapping groups do not match between cube [" + propagationCubes[i].toString() + + "] and [" + propagationCubes[0].toString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -492,7 +492,7 @@ namespace Isis { if (proj) delete proj; - return RingsSetOutputCube(propagationCubes[0].toString(), xmin, xmax, ymin, ymax, + return RingsSetOutputCube(QString::fromStdString(propagationCubes[0].toString()), xmin, xmax, ymin, ymax, srad, erad, saz, eaz, bands, oAtt, mosaicFile); } @@ -691,7 +691,7 @@ namespace Isis { // Initialize the mosaic ProcessByLine p; - CubeAttributeInput inAtt(inputFile); + CubeAttributeInput inAtt(inputFile.toStdString()); Cube *propCube = p.SetInputCube(inputFile, inAtt); bands = propCube->bandCount(); @@ -731,7 +731,7 @@ namespace Isis { Isis::Cube *ProcessMapMosaic::RingsSetOutputCube(const QString &inputFile, PvlGroup mapping, CubeAttributeOutput &oAtt, const QString &mosaicFile) { if (OutputCubes.size() != 0) { - QString msg = "You can only specify one output cube and projection"; + std::string msg = "You can only specify one output cube and projection"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -749,7 +749,7 @@ namespace Isis { // Initialize the mosaic ProcessByLine p; - CubeAttributeInput inAtt(inputFile); + CubeAttributeInput inAtt(inputFile.toStdString()); Cube *propCube = p.SetInputCube(inputFile, inAtt); bands = propCube->bandCount(); diff --git a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp index 1bfd9f30ea..6b192ae980 100644 --- a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp +++ b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp @@ -287,8 +287,8 @@ namespace Isis { 1); // The tracking cube file name convention is "output_cube_file_name" + "_tracking.cub" - QString trackingBase = FileName(OutputCubes[0]->fileName()).removeExtension().expanded().split("/").last(); - m_trackingCube->create(FileName(OutputCubes[0]->fileName()).path() + QString trackingBase = QString::fromStdString(FileName(OutputCubes[0]->fileName().toStdString()).removeExtension().expanded()).split("/").last(); + m_trackingCube->create(QString::fromStdString(FileName(OutputCubes[0]->fileName().toStdString()).path()) + "/" + trackingBase + "_tracking.cub"); // Add the tracking group to the mosaic cube label @@ -321,7 +321,7 @@ namespace Isis { else { // Confirm tracking group exists in mosaic cube to address backwards compatibility if ( OutputCubes[0]->hasGroup("Tracking") ) { - QString trackingPath = FileName(OutputCubes[0]->fileName()).path(); + QString trackingPath = QString::fromStdString(FileName(OutputCubes[0]->fileName().toStdString()).path()); QString trackingFile = QString::fromStdString(OutputCubes[0]->group("Tracking").findKeyword("FileName")[0]); m_trackingCube->open(trackingPath + "/" + trackingFile, "rw"); @@ -332,7 +332,7 @@ namespace Isis { trackingTable = new TrackingTable(*table); } catch (IException &e) { - QString msg = "Unable to find Tracking Table in " + m_trackingCube->fileName() + "."; + std::string msg = "Unable to find Tracking Table in " + m_trackingCube->fileName() + "."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -347,7 +347,7 @@ namespace Isis { } // Add current file to the TrackingTable object - iIndex = trackingTable->fileNameToPixel(InputCubes[0]->fileName(), + iIndex = trackingTable->fileNameToPixel(InputCubes[0]->fileName().toStdString(), SerialNumber::Compose(*(InputCubes[0]))); // Write the tracking table to the tracking cube, overwriting if need-be @@ -1121,7 +1121,7 @@ namespace Isis { outKey[j] + ". Input cube value at index [" + std::to_string(k) + "] = " + inKey[k] + ". **Note: use mapmos/automos MatchBandBin = false to " "override this check**"; - //QString msg = "Pvl Group [BandBin] in Key[" + outKey.name() + "] In value" + inKey[k] + + //std::string msg = "Pvl Group [BandBin] in Key[" + outKey.name() + "] In value" + inKey[k] + //"and Out value=" + outKey[j] + " do not match"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1494,7 +1494,7 @@ void ProcessMosaic::BandPriorityWithNoTracking(int iss, int isl, int isb, int in break; default: - QString msg = "ProcessMosaic::GetOriginDefaultByPixelType - Invalid Pixel Type"; + std::string msg = "ProcessMosaic::GetOriginDefaultByPixelType - Invalid Pixel Type"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProcessMosaic/unitTest.cpp b/isis/src/base/objs/ProcessMosaic/unitTest.cpp index e0cb79463c..0416279700 100644 --- a/isis/src/base/objs/ProcessMosaic/unitTest.cpp +++ b/isis/src/base/objs/ProcessMosaic/unitTest.cpp @@ -543,7 +543,7 @@ void IsisMain() { m.EndProcess(); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); qDebug().noquote() << message.replace(QRegExp("cube.*base/unitTestData"), "cube [base/unitTestData"); p.EndProcess(); qDebug() << ""; diff --git a/isis/src/base/objs/ProcessPolygons/ProcessPolygons.cpp b/isis/src/base/objs/ProcessPolygons/ProcessPolygons.cpp index f5b46aacd8..757c61278a 100644 --- a/isis/src/base/objs/ProcessPolygons/ProcessPolygons.cpp +++ b/isis/src/base/objs/ProcessPolygons/ProcessPolygons.cpp @@ -228,7 +228,7 @@ namespace Isis { } /*end try*/ catch(geos::util::IllegalArgumentException *ill) { - QString msg = "ERROR! geos exception 1 ["; + std::string msg = "ERROR! geos exception 1 ["; msg += (QString)ill->what() + "]"; delete ill; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -274,10 +274,10 @@ namespace Isis { Isis::Cube *ProcessPolygons::AppendOutputCube(const QString &avgFileName, const QString &countFileName) { - FileName *file = new FileName(avgFileName); - QString path = file->path(); - QString filename = file->baseName(); - QString extension = file->extension(); + FileName *file = new FileName(avgFileName.toStdString()); + QString path = QString::fromStdString(file->path()); + QString filename = QString::fromStdString(file->baseName()); + QString extension = QString::fromStdString(file->extension()); /*Open the average file with read/write permission*/ Cube *averageCube = new Cube(); @@ -361,9 +361,9 @@ namespace Isis { Isis::CubeAttributeOutput atts = Application::GetUserInterface().GetOutputAttribute(parameter); - FileName *file = new FileName(avgString); - QString path = file->path(); - QString filename = file->baseName(); + FileName *file = new FileName(avgString.toStdString()); + QString path = QString::fromStdString(file->path()); + QString filename = QString::fromStdString(file->baseName()); QString countString = path + "/" + filename + "-count"; SetStatCubes(avgString, countString, atts, nsamps, nlines, nbands); diff --git a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp index ca050f36f3..b60ad7c749 100644 --- a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp +++ b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp @@ -36,7 +36,7 @@ namespace Isis { */ void ProgramLauncher::RunIsisProgram(QString programName, QString parameters) { - FileName program(programName); + FileName program(programName.toStdString()); FileName isisExecutableFileName("$ISISROOT/bin/" + program.name()); bool isIsisProgram = false; @@ -52,7 +52,7 @@ namespace Isis { " -pid=" + toString(getpid()); if(!isIsisProgram) { - QString msg = "Program [" + programName + "] does not appear to be a " + std::string msg = "Program [" + programName + "] does not appear to be a " "valid Isis program"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -82,7 +82,7 @@ namespace Isis { } if(!connected) { - QString msg = "Isis child process failed to communicate with parent"; + std::string msg = "Isis child process failed to communicate with parent"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -95,7 +95,7 @@ namespace Isis { bool messageDone = false; QString code; - QString message; + std::string message; QByteArray lineData; if(childSocket->waitForReadyRead(1000)) { @@ -135,7 +135,7 @@ namespace Isis { childProcess.waitForFinished(); if(childProcess.exitCode() != 0) { - QString msg = "Running Isis program [" + programName + "] failed with " + std::string msg = "Running Isis program [" + programName + "] failed with " "return status [" + toString(childProcess.exitCode()) + "]"; throw IException(errors, IException::Unknown, msg, _FILEINFO_); } @@ -153,7 +153,7 @@ namespace Isis { * parameter. */ IException - ProgramLauncher::ProcessIsisMessageFromChild(QString code, QString msg) { + ProgramLauncher::ProcessIsisMessageFromChild(QString code, std::string msg) { IException errors; if(code == "PROGRESSTEXT" && iApp) { @@ -214,7 +214,7 @@ namespace Isis { int status = system(fullCommand.toLatin1().data()); if(status != 0) { - QString msg = "Executing command [" + fullCommand + + std::string msg = "Executing command [" + fullCommand + "] failed with return status [" + toString(status) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.h b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.h index d3d2370847..e66d77acd1 100644 --- a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.h +++ b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.h @@ -37,7 +37,7 @@ namespace Isis { static void RunSystemCommand(QString commandLine); private: - static IException ProcessIsisMessageFromChild(QString code, QString msg); + static IException ProcessIsisMessageFromChild(QString code, std::string msg); private: //! Construction is not allowed diff --git a/isis/src/base/objs/Projection/Projection.h b/isis/src/base/objs/Projection/Projection.h index 93cce3a9c2..b2638babd0 100644 --- a/isis/src/base/objs/Projection/Projection.h +++ b/isis/src/base/objs/Projection/Projection.h @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include #include +#include #include "PvlGroup.h" // protected data member object (m_mappingGrp) diff --git a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp index 24c0cf2b2f..b55efa18f8 100644 --- a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp +++ b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp @@ -57,11 +57,11 @@ namespace Isis { if (m_projPlugin.fileName() == "") { FileName localFile("Projection.plugin"); if (localFile.fileExists()) - m_projPlugin.read(localFile.expanded().toStdString()); + m_projPlugin.read(localFile.expanded()); FileName systemFile("$ISISROOT/lib/Projection.plugin"); if (systemFile.fileExists()) - m_projPlugin.read(systemFile.expanded().toStdString()); + m_projPlugin.read(systemFile.expanded()); } try { @@ -75,7 +75,7 @@ namespace Isis { ptr = m_projPlugin.GetPlugin(proj); } catch(IException &e) { - QString msg = "Unsupported projection, unable to find plugin for [" + + std::string msg = "Unsupported projection, unable to find plugin for [" + proj + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -88,7 +88,7 @@ namespace Isis { return (Isis::Projection *) (*plugin)(label, allowDefaults); } catch(IException &e) { - QString message = "Unable to initialize Projection information "; + std::string message = "Unable to initialize Projection information "; message += "from group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } @@ -125,11 +125,11 @@ namespace Isis { if (m_projPlugin.fileName() == "") { FileName localFile("Projection.plugin"); if (localFile.fileExists()) - m_projPlugin.read(localFile.expanded().toStdString()); + m_projPlugin.read(localFile.expanded()); FileName systemFile("$ISISROOT/lib/Projection.plugin"); if (systemFile.fileExists()) - m_projPlugin.read(systemFile.expanded().toStdString()); + m_projPlugin.read(systemFile.expanded()); } try { @@ -143,7 +143,7 @@ namespace Isis { ptr = m_projPlugin.GetPlugin(proj); } catch(IException &e) { - QString msg = "Unsupported projection, unable to find plugin for [" + + std::string msg = "Unsupported projection, unable to find plugin for [" + proj + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -155,7 +155,7 @@ namespace Isis { return (Projection *) (*plugin)(label, allowDefaults); } catch(IException &e) { - QString message = "Unable to initialize Projection information "; + std::string message = "Unable to initialize Projection information "; message += "from group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } @@ -247,7 +247,7 @@ namespace Isis { double minX, maxX, minY, maxY; if (!proj->XYRange(minX, maxX, minY, maxY)) { - QString msg = "Invalid ground range [MinimumLatitude,MaximumLatitude,"; + std::string msg = "Invalid ground range [MinimumLatitude,MaximumLatitude,"; msg += "MinimumLongitude,MaximumLongitude] cause invalid computation "; msg += "of image size"; throw IException(IException::Unknown, msg, _FILEINFO_); diff --git a/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp b/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp index caba215243..83af47ed38 100644 --- a/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp +++ b/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp @@ -54,11 +54,11 @@ namespace Isis { * @return @b bool If the kernel was successfully loaded. */ bool PushFrameCameraCcdLayout::addKernel(const QString &kernel) { - FileName kern(kernel); + FileName kern(kernel.toStdString()); if ( kern.isVersioned()) { kern = kern.highestVersion(); } - m_kernels.Add(kern.expanded()); + m_kernels.Add(QString::fromStdString(kern.expanded())); int nloaded = m_kernels.Load(); return (nloaded > 0); } @@ -110,7 +110,7 @@ namespace Isis { finfo.m_startLine = getSpiceInt(base + "_FILTER_OFFSET"); } catch (IException &e) { - QString msg = "Could not find layout information for framelet [" + std::string msg = "Could not find layout information for framelet [" + toString(frameId) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -149,7 +149,7 @@ namespace Isis { // Gotta throw an error here if not found if (!found) { NaifStatus::CheckErrors(); - QString msg = "Can not find [" + var + "] in text kernels"; + std::string msg = "Can not find [" + var + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -178,7 +178,7 @@ namespace Isis { // Gotta throw an error here if not found if (!found) { NaifStatus::CheckErrors(); - QString msg = "Can not find [" + var + "] in text kernels"; + std::string msg = "Can not find [" + var + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -207,7 +207,7 @@ namespace Isis { // Gotta throw an error here if not found if (!found) { NaifStatus::CheckErrors(); - QString msg = "Can not find [" + var + "] in text kernels"; + std::string msg = "Can not find [" + var + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp index 3a597ead54..0804c5b4f6 100644 --- a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp +++ b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp @@ -118,7 +118,7 @@ namespace Isis { } catch(IException &e) { // catch errors in Pvl format when populating pvl object - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::warning((QWidget *)parent(), "Error", message); return; } @@ -139,7 +139,7 @@ namespace Isis { } catch(IException &e) { // report exception(s) to mesage box - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::warning((QWidget *)parent(), "Error", message); return; } diff --git a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp index 7e9a4f336a..47d5319b4b 100644 --- a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp +++ b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp @@ -36,7 +36,7 @@ namespace Isis { * @param keyListFile The name of the file containing PvlKeyword names. */ PvlConstraints::PvlConstraints(const QString &keyListFile) { - addKeyToList(FileName(keyListFile)); + addKeyToList(FileName(keyListFile.toStdString())); return; } @@ -328,7 +328,7 @@ namespace Isis { // cout << "HI!" << endl; // addKeyToList(pvl[k].name()); // } - TextFile keyList(keyListFile.expanded()); + TextFile keyList(QString::fromStdString(keyListFile.expanded())); QString keywordName = ""; while (keyList.GetLine(keywordName)) { addKeyToList(keywordName); @@ -577,11 +577,11 @@ namespace Isis { const int &index) const { QMap::const_iterator k = find(key.toLower()); if (end() == k) { - QString mess = "Keyword " + key + " does not exist!"; + std::string mess = "Keyword " + key + " does not exist!"; throw IException(IException::Programmer, mess, _FILEINFO_); } if (index >= k.value().size()) { - QString mess = "Index " + toString(index) + " does not exist for keyword " + key + "!"; + std::string mess = "Index " + toString(index) + " does not exist for keyword " + key + "!"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -660,7 +660,7 @@ namespace Isis { PvlKeyword PvlFlatMap::keyword(const QString &key) const { QMap::const_iterator k = find(key.toLower()); if (end() == k) { - QString mess = "Keyword " + key + " does not exist!"; + std::string mess = "Keyword " + key + " does not exist!"; throw IException(IException::Programmer, mess, _FILEINFO_); } return (k.value()); diff --git a/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp b/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp index a57a09a725..c42203c8d4 100644 --- a/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp +++ b/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp @@ -366,7 +366,7 @@ namespace Isis { pvl.read(pvlFile.toStdString()); } catch (IException &e){ - QString msg = QString("Failed to open file for PVL Input: [%1]").arg(pvlFile); + std::string msg = QString("Failed to open file for PVL Input: [%1]").arg(pvlFile); throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp index c8ca94cafb..a371c00807 100644 --- a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp +++ b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp @@ -24,7 +24,7 @@ namespace Isis { * @param transFile The translation file to be used. */ PvlTranslationTable::PvlTranslationTable(FileName transFile) { - AddTable(transFile.expanded()); + AddTable(QString::fromStdString(transFile.expanded())); } @@ -82,7 +82,7 @@ namespace Isis { * @param transFile The name of the translation file to be added. */ void PvlTranslationTable::AddTable(const QString &transFile) { - p_trnsTbl.read(FileName(transFile).expanded().toStdString()); + p_trnsTbl.read(FileName(transFile.toStdString()).expanded()); } @@ -330,7 +330,7 @@ namespace Isis { /* Error if no containers were listed if (!foundLegalInputGroup) { - QString msg = "No input position found for translation ["; + std::string msg = "No input position found for translation ["; msg += translationGroupName; msg += "] in translation file ["; msg += p_trnsTbl.FileName(); diff --git a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.h b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.h index f8fd2c2927..2ce74131b5 100644 --- a/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.h +++ b/isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.h @@ -9,6 +9,7 @@ find files of those names at the top level of this repository. **/ #include #include #include +#include #include "FileName.h" #include "Pvl.h" diff --git a/isis/src/base/objs/QtExporter/QtExporter.cpp b/isis/src/base/objs/QtExporter/QtExporter.cpp index 3a33143ac7..9db60d3980 100644 --- a/isis/src/base/objs/QtExporter/QtExporter.cpp +++ b/isis/src/base/objs/QtExporter/QtExporter.cpp @@ -60,7 +60,7 @@ namespace Isis { void QtExporter::initialize(ExportDescription &desc) { // the Qt exporter only exports unsigned byte if (desc.pixelType() != UnsignedByte) { - QString msg = "Invalid pixel type. The Qt exporter for file type ["; + std::string msg = "Invalid pixel type. The Qt exporter for file type ["; msg += m_format; msg += "] requires an unsigned byte (i.e. 8BIT) output."; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -201,7 +201,7 @@ namespace Isis { QString compression, UserInterface *ui) { ImageExporter::write(outputName, quality, compression, ui); - outputName = outputName.addExtension(extension()); + outputName = outputName.addExtension(extension().toStdString()); // The return status is wrong for JPEG images, so the code will always // continue diff --git a/isis/src/base/objs/RadarGroundMap/RadarGroundMap.cpp b/isis/src/base/objs/RadarGroundMap/RadarGroundMap.cpp index 9ab1be7a1a..a8a3516ed9 100644 --- a/isis/src/base/objs/RadarGroundMap/RadarGroundMap.cpp +++ b/isis/src/base/objs/RadarGroundMap/RadarGroundMap.cpp @@ -395,7 +395,7 @@ namespace Isis { *cudy = p_groundDopplerFreq / p_dopplerSigma; // htx to focal plane coord if (test == true) { - QString msg = "Back of planet test is not enabled for Radar images"; + std::string msg = "Back of planet test is not enabled for Radar images"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Robinson/Robinson.cpp b/isis/src/base/objs/Robinson/Robinson.cpp index 8837fef81e..e26681b855 100644 --- a/isis/src/base/objs/Robinson/Robinson.cpp +++ b/isis/src/base/objs/Robinson/Robinson.cpp @@ -104,7 +104,7 @@ namespace Isis { if (m_longitudeDirection == PositiveWest) m_centerLongitude *= -1.0; } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/RollingShutterCameraDetectorMap/RollingShutterCameraDetectorMap.cpp b/isis/src/base/objs/RollingShutterCameraDetectorMap/RollingShutterCameraDetectorMap.cpp index 584cee7f18..2189e5de69 100644 --- a/isis/src/base/objs/RollingShutterCameraDetectorMap/RollingShutterCameraDetectorMap.cpp +++ b/isis/src/base/objs/RollingShutterCameraDetectorMap/RollingShutterCameraDetectorMap.cpp @@ -144,7 +144,7 @@ namespace Isis { iterations++; if (iterations > maxIterations) { - QString message = "Max Iterations reached."; + std::string message = "Max Iterations reached."; throw IException(IException::Unknown, message, _FILEINFO_); } diff --git a/isis/src/base/objs/Sensor/Sensor.cpp b/isis/src/base/objs/Sensor/Sensor.cpp index 66babe20a8..b9ea98d57e 100644 --- a/isis/src/base/objs/Sensor/Sensor.cpp +++ b/isis/src/base/objs/Sensor/Sensor.cpp @@ -82,7 +82,7 @@ namespace Isis { */ QList Sensor::PixelIfovOffsets() { - QString message = "Pixel Ifov offsets not implemented for this camera."; + std::string message = "Pixel Ifov offsets not implemented for this camera."; throw IException(IException::Programmer, message, _FILEINFO_); } diff --git a/isis/src/base/objs/Sensor/Sensor.h b/isis/src/base/objs/Sensor/Sensor.h index cfc57cd1d8..96b724cab6 100644 --- a/isis/src/base/objs/Sensor/Sensor.h +++ b/isis/src/base/objs/Sensor/Sensor.h @@ -11,6 +11,7 @@ find files of those names at the top level of this repository. **/ #include #include #include +#include #include "Cube.h" #include "Interpolator.h" diff --git a/isis/src/base/objs/SerialNumber/SerialNumber.cpp b/isis/src/base/objs/SerialNumber/SerialNumber.cpp index 1eb8cc84e4..5b28460006 100644 --- a/isis/src/base/objs/SerialNumber/SerialNumber.cpp +++ b/isis/src/base/objs/SerialNumber/SerialNumber.cpp @@ -48,7 +48,7 @@ namespace Isis { // "Unknown" as a last resort. QString snTemp = QString::fromStdString(label.fileName()); if(!snTemp.isEmpty()) { - sn = FileName(snTemp).name(); + sn = QString::fromStdString(FileName(snTemp.toStdString()).name()); } else { sn = "Unknown"; @@ -135,11 +135,11 @@ namespace Isis { if(translationIterator == missionTranslators.end()) { // Get the file - FileName snFile((QString) "$ISISROOT/appdata/translations/" + mission + instrument + "SerialNumber.trn"); + FileName snFile("$ISISROOT/appdata/translations/" + mission.toStdString() + instrument.toStdString() + "SerialNumber.trn"); // use the translation file to generate keywords missionTranslators.insert( - std::pair(key, PvlToPvlTranslationManager(snFile.expanded())) + std::pair(key, PvlToPvlTranslationManager(QString::fromStdString(snFile.expanded()))) ); translationIterator = missionTranslators.find(key); diff --git a/isis/src/base/objs/SerialNumber/unitTest.cpp b/isis/src/base/objs/SerialNumber/unitTest.cpp index 387c510635..f273eb8eee 100644 --- a/isis/src/base/objs/SerialNumber/unitTest.cpp +++ b/isis/src/base/objs/SerialNumber/unitTest.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { cout << SerialNumber::Compose(cube, true) << endl; FileName file("$ISISTESTDATA/isis/src/lo/unitTestData/3133_h1.cub"); - Pvl p1(file.expanded().toStdString()); + Pvl p1(file.expanded()); cout << SerialNumber::Compose(p1) << endl; diff --git a/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp b/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp index 5898364222..c6088668d5 100644 --- a/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp +++ b/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp @@ -50,21 +50,21 @@ namespace Isis { m_target.clear(); try { - FileList flist(listfile); + FileList flist(listfile.toStdString()); if (progress != NULL) { progress->SetText("Creating Isis serial numbers from list file."); progress->SetMaximumSteps((int) flist.size() + 1); progress->CheckStatus(); } for (int i = 0; i < flist.size(); i++) { - add(flist[i].toString()); + add(QString::fromStdString(flist[i].toString())); if (progress != NULL) { progress->CheckStatus(); } } } catch (IException &e) { - QString msg = "Can't open or invalid file list [" + listfile + "]."; + std::string msg = "Can't open or invalid file list [" + listfile + "]."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -119,7 +119,7 @@ namespace Isis { * does not exist. */ void SerialNumberList::add(const QString &filename, bool def2filename) { - Pvl p(Isis::FileName(filename).expanded().toStdString()); + Pvl p(Isis::FileName(filename.toStdString()).expanded()); PvlObject cubeObj = p.findObject("IsisCube"); try { @@ -137,14 +137,14 @@ namespace Isis { targetGroup = cubeObj.findGroup("Mapping"); } else { - QString msg = "Unable to find Instrument or Mapping group in " + std::string msg = "Unable to find Instrument or Mapping group in " + filename + " for comparing target."; throw IException(IException::User, msg, _FILEINFO_); } } else { // No Instrument group - QString msg = "Unable to find Instrument group in " + filename + std::string msg = "Unable to find Instrument group in " + filename + " for comparing target."; throw IException(IException::User, msg, _FILEINFO_); } @@ -155,7 +155,7 @@ namespace Isis { m_target = target; } else if (m_target != target) { - QString msg = "Target name of [" + target + "] from file [" + std::string msg = "Target name of [" + target + "] from file [" + filename + "] does not match [" + m_target + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -165,19 +165,19 @@ namespace Isis { QString sn = SerialNumber::Compose(p, def2filename); QString on = ObservationNumber::Compose(p, def2filename); if (sn == "Unknown") { - QString msg = "Invalid serial number [Unknown] from file [" + std::string msg = "Invalid serial number [Unknown] from file [" + filename + "]."; throw IException(IException::User, msg, _FILEINFO_); } else if (hasSerialNumber(sn)) { int index = serialNumberIndex(sn); - QString msg = "Duplicate serial number [" + sn + "] from files [" + std::string msg = "Duplicate serial number [" + sn + "] from files [" + SerialNumberList::fileName(sn) + "] and [" + fileName(index) + "]."; throw IException(IException::User, msg, _FILEINFO_); } Pair nextpair; - nextpair.filename = Isis::FileName(filename).expanded(); + nextpair.filename = QString::fromStdString(Isis::FileName(filename.toStdString()).expanded()); nextpair.serialNumber = sn; nextpair.observationNumber = on; @@ -206,7 +206,7 @@ namespace Isis { m_fileMap.insert(std::pair(nextpair.filename, (int)(m_pairs.size() - 1))); } catch (IException &e) { - QString msg = "FileName [" + Isis::FileName(filename).expanded() + + std::string msg = "FileName [" + Isis::FileName(filename.toStdString()).expanded() + "] can not be added to serial number list."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -249,7 +249,7 @@ namespace Isis { * */ void SerialNumberList::add(const QString &serialNumber, const QString &filename) { - Pvl p(Isis::FileName(filename).expanded().toStdString()); + Pvl p(Isis::FileName(filename.toStdString()).expanded()); PvlObject cubeObj = p.findObject("IsisCube"); try { @@ -266,7 +266,7 @@ namespace Isis { targetGroup = cubeObj.findGroup("Mapping"); } else { - QString msg = "Unable to find Instrument or Mapping group in " + std::string msg = "Unable to find Instrument or Mapping group in " + filename + " for comparing target."; throw IException(IException::User, msg, _FILEINFO_); } @@ -277,7 +277,7 @@ namespace Isis { m_target = target; } else if (m_target != target) { - QString msg = "Target name of [" + target + "] from file [" + std::string msg = "Target name of [" + target + "] from file [" + filename + "] does not match [" + m_target + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -285,13 +285,13 @@ namespace Isis { QString observationNumber = "Unknown"; if (serialNumber == "Unknown") { - QString msg = "Invalid serial number [Unknown] from file [" + std::string msg = "Invalid serial number [Unknown] from file [" + filename + "]."; throw IException(IException::User, msg, _FILEINFO_); } else if (hasSerialNumber(serialNumber)) { int index = serialNumberIndex(serialNumber); - QString msg = "Duplicate, serial number [" + serialNumber + "] from files [" + std::string msg = "Duplicate, serial number [" + serialNumber + "] from files [" + SerialNumberList::fileName(serialNumber) + "] and [" + fileName(index) + "]."; throw IException(IException::User, msg, _FILEINFO_); @@ -303,13 +303,13 @@ namespace Isis { // Need to obtain the SpacecraftName and InstrumentId from the Instrument // group for use in bundle adjustment if (!cubeObj.hasGroup("Instrument")) { - QString msg = "Unable to find Instrument group in " + filename + std::string msg = "Unable to find Instrument group in " + filename + " needed for performing bundle adjustment."; throw IException(IException::User, msg, _FILEINFO_); } PvlGroup instGroup = cubeObj.findGroup("Instrument"); if (!instGroup.hasKeyword("SpacecraftName") || !instGroup.hasKeyword("InstrumentId")) { - QString msg = "Unable to find SpacecraftName or InstrumentId keywords in " + filename + std::string msg = "Unable to find SpacecraftName or InstrumentId keywords in " + filename + " needed for performing bundle adjustment."; throw IException(IException::User, msg, _FILEINFO_); } @@ -318,14 +318,14 @@ namespace Isis { else { PvlGroup csmGroup = cubeObj.findGroup("CSMInfo"); if (!csmGroup.hasKeyword("CSMPlatformID") || !csmGroup.hasKeyword("CSMInstrumentId")) { - QString msg = "Unable to find CSMPlatformID or CSMInstrumentId keywords in " + filename + std::string msg = "Unable to find CSMPlatformID or CSMInstrumentId keywords in " + filename + " needed for performing bundle adjustment."; throw IException(IException::User, msg, _FILEINFO_); } } Pair nextpair; - nextpair.filename = Isis::FileName(filename).expanded(); + nextpair.filename = QString::fromStdString(Isis::FileName(filename.toStdString()).expanded()); nextpair.serialNumber = serialNumber; nextpair.observationNumber = observationNumber; @@ -354,8 +354,8 @@ namespace Isis { m_fileMap.insert(std::pair(nextpair.filename, (int)(m_pairs.size() - 1))); } catch (IException &e) { - QString msg = "[SerialNumber, FileName] = [" + serialNumber + ", " - + Isis::FileName(filename).expanded() + std::string msg = "[SerialNumber, FileName] = [" + serialNumber.toStdString() + ", " + + Isis::FileName(filename.toStdString()).expanded() + "] can not be added to serial number list."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -402,7 +402,7 @@ namespace Isis { return m_pairs[index].filename; } else { - QString msg = "Unable to get the FileName. The given serial number [" + std::string msg = "Unable to get the FileName. The given serial number [" + sn + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -424,9 +424,9 @@ namespace Isis { * list. */ QString SerialNumberList::serialNumber(const QString &filename) { - if (m_fileMap.find(Isis::FileName(filename).expanded()) == m_fileMap.end()) { - QString msg = "Unable to get the SerialNumber. The given file name [" - + Isis::FileName(filename).expanded() + "] does not exist in the list."; + if (m_fileMap.find(QString::fromStdString(Isis::FileName(filename.toStdString()).expanded())) == m_fileMap.end()) { + std::string msg = "Unable to get the SerialNumber. The given file name [" + + Isis::FileName(filename.toStdString()).expanded() + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } int index = fileNameIndex(filename); @@ -448,7 +448,7 @@ namespace Isis { return m_pairs[index].serialNumber; } else { - QString msg = "Unable to get the SerialNumber. The given index [" + std::string msg = "Unable to get the SerialNumber. The given index [" + toString(index) + "] is invalid."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -470,7 +470,7 @@ namespace Isis { return m_pairs[index].observationNumber; } else { - QString msg = "Unable to get the ObservationNumber. The given index [" + std::string msg = "Unable to get the ObservationNumber. The given index [" + toString(index) + "] is invalid."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -492,7 +492,7 @@ namespace Isis { return m_serialMap.find(sn)->second; } else { - QString msg = "Unable to get the SerialNumber index. The given serial number [" + std::string msg = "Unable to get the SerialNumber index. The given serial number [" + sn + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -516,9 +516,9 @@ namespace Isis { */ int SerialNumberList::fileNameIndex(const QString &filename) { std::map::iterator pos; - if ((pos = m_fileMap.find(Isis::FileName(filename).expanded())) == m_fileMap.end()) { - QString msg = "Unable to get the FileName index. The given file name [" - + Isis::FileName(filename).expanded() + "] does not exist in the list."; + if ((pos = m_fileMap.find(QString::fromStdString(Isis::FileName(filename.toStdString()).expanded()))) == m_fileMap.end()) { + std::string msg = "Unable to get the FileName index. The given file name [" + + Isis::FileName(filename.toStdString()).expanded() + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } return pos->second; @@ -539,7 +539,7 @@ namespace Isis { return m_pairs[index].filename; } else { - QString msg = "Unable to get the FileName. The given index [" + std::string msg = "Unable to get the FileName. The given index [" + toString(index) + "] is invalid."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -565,7 +565,7 @@ namespace Isis { return scid.replace(" ",""); } else { - QString msg = "Unable to get the Spacecraft InstrumentId. The given index [" + std::string msg = "Unable to get the Spacecraft InstrumentId. The given index [" + toString(index) + "] is invalid."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -592,7 +592,7 @@ namespace Isis { return scid.replace(" ",""); } else { - QString msg = "Unable to get the Spacecraft InstrumentId. The given serial number [" + std::string msg = "Unable to get the Spacecraft InstrumentId. The given serial number [" + sn + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -621,7 +621,7 @@ namespace Isis { return numbers; } else { - QString msg = "Unable to get the possible serial numbers. The given observation number [" + std::string msg = "Unable to get the possible serial numbers. The given observation number [" + on + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/SerialNumberList/unitTest.cpp b/isis/src/base/objs/SerialNumberList/unitTest.cpp index d0118d4988..df428b96d0 100644 --- a/isis/src/base/objs/SerialNumberList/unitTest.cpp +++ b/isis/src/base/objs/SerialNumberList/unitTest.cpp @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) { SerialNumberList("DNEFile", true, NULL); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) { snl.add("$ISISTESTDATA/isis/src/lo/unitTestData/3133_h1.cub"); } catch(IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) { snl.add("$ISISTESTDATA/isis/src/mgs/unitTestData/ab102401.cub"); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) { snl.add(filename, true); } catch(IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -161,7 +161,7 @@ int main(int argc, char *argv[]) { snl.add(filename, false); } catch(IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) { snl.add("sn3", "$ISISTESTDATA/isis/src/lo/unitTestData/3133_h1.cub"); } catch(IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } try { @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) { snl.add("sn1", filename); } catch(IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) { snlNoTarget.add(QString("Unknown"), QString("$ISISTESTDATA/isis/src/base/unitTestData/blobTruth.cub")); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) { snlNoTarget.add(sn, QString("$ISISTESTDATA/isis/src/base/unitTestData/blobTruth.cub")); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) { snlNoTarget.add("sn1", filename); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -229,7 +229,7 @@ int main(int argc, char *argv[]) { snlNoTarget.add("sn2", QString("$ISISTESTDATA/isis/src/base/unitTestData/isisTruthNoSpacecraftName.cub")); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } @@ -239,7 +239,7 @@ int main(int argc, char *argv[]) { snlNoTarget.add("sn3", QString("$ISISTESTDATA/isis/src/base/unitTestData/isisTruthNoInstrumentId.cub")); } catch (IException &e) { - QString error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); + std::string error = e.toString().replace(QRegExp("(\\[[^\\]]*/)([^\\]]*)"), "[.../\\2"); cerr << error.toStdString() << endl; } diff --git a/isis/src/base/objs/ShapeModel/ShapeModel.cpp b/isis/src/base/objs/ShapeModel/ShapeModel.cpp index 2d00291d27..04922cb7b3 100644 --- a/isis/src/base/objs/ShapeModel/ShapeModel.cpp +++ b/isis/src/base/objs/ShapeModel/ShapeModel.cpp @@ -415,7 +415,7 @@ namespace Isis { return m_normal; } else { - QString message = "The normal has not been computed."; + std::string message = "The normal has not been computed."; throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -434,7 +434,7 @@ namespace Isis { return m_localNormal; } else { - QString message = "The local normal has not been computed."; + std::string message = "The local normal has not been computed."; throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -497,7 +497,7 @@ namespace Isis { return m_target->radii(); } else { - QString message = "Unable to find target radii for ShapeModel. Target is NULL. "; + std::string message = "Unable to find target radii for ShapeModel. Target is NULL. "; throw IException(IException::Programmer, message, _FILEINFO_); } } @@ -520,7 +520,7 @@ namespace Isis { m_hasNormal = true; } else { - QString message = "No intersection point is known. A normal cannot be set."; + std::string message = "No intersection point is known. A normal cannot be set."; throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -542,7 +542,7 @@ namespace Isis { m_hasLocalNormal = true; } else { - QString message = "No intersection point is known. A local normal cannot be set."; + std::string message = "No intersection point is known. A local normal cannot be set."; throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -569,7 +569,7 @@ namespace Isis { m_hasNormal = true; } else { - QString message = "No intersection point is known. A normal cannot be set."; + std::string message = "No intersection point is known. A normal cannot be set."; throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -595,7 +595,7 @@ namespace Isis { m_hasLocalNormal = true; } else { - QString message = "No intersection point is known. A local normal cannot be set."; + std::string message = "No intersection point is known. A local normal cannot be set."; throw IException(IException::Unknown, message, _FILEINFO_); } } @@ -683,7 +683,7 @@ namespace Isis { return m_target->spice()->resolution(); } else { - QString message = "No valid intersection point for computing resolution."; + std::string message = "No valid intersection point for computing resolution."; throw IException(IException::Programmer, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/ShapeModel/unitTest.cpp b/isis/src/base/objs/ShapeModel/unitTest.cpp index 7df3be1934..cb3bf6a2c7 100644 --- a/isis/src/base/objs/ShapeModel/unitTest.cpp +++ b/isis/src/base/objs/ShapeModel/unitTest.cpp @@ -543,7 +543,7 @@ int main() { } catch (IException &e) { cout << endl << endl; - QString msg = "**************** UNIT TEST FAILED! **************** "; + std::string msg = "**************** UNIT TEST FAILED! **************** "; IException(e, IException::Unknown, msg, _FILEINFO_).print(); } } diff --git a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp index af7add020e..63a6871f56 100644 --- a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp +++ b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp @@ -156,8 +156,8 @@ namespace Isis { //-------------- Check for bullet engine first -------------------------------// if ( "bullet" == preferred ) { // Check to see of ISIS cube DEMs get a pass - FileName v_shapefile(shapeModelFilenames); - QString ext = v_shapefile.extension().toLower(); + FileName v_shapefile(shapeModelFilenames.toStdString()); + QString ext = QString::fromStdString(v_shapefile.extension()).toLower(); // Cubes are not supported at this time. try { @@ -166,7 +166,7 @@ namespace Isis { // Bullet failed to load the kernel...test failure conditions if ("cub" == ext) { - QString mess = "Bullet could not initialize ISIS Cube DEM"; + std::string mess = "Bullet could not initialize ISIS Cube DEM"; throw IException(IException::Unknown, mess, _FILEINFO_); } @@ -191,7 +191,7 @@ namespace Isis { } catch (IException &ie) { fileError.append(ie); - QString mess = "Unable to create preferred BulletShapeModel"; + std::string mess = "Unable to create preferred BulletShapeModel"; fileError.append(IException(IException::Unknown, mess, _FILEINFO_)); if ("fail" == onerror) { throw fileError; @@ -205,8 +205,8 @@ namespace Isis { if ( "embree" == preferred ) { // Check to see of ISIS cube DEMs get a pass - FileName v_shapefile(shapeModelFilenames); - QString ext = v_shapefile.extension().toLower(); + FileName v_shapefile(shapeModelFilenames.toStdString()); + QString ext = QString::fromStdString(v_shapefile.extension()).toLower(); // Cubes are not supported at this time try { @@ -227,7 +227,7 @@ namespace Isis { } catch (IException &ie) { fileError.append(ie); - QString mess = "Unable to create preferred EmbreeShapeModel"; + std::string mess = "Unable to create preferred EmbreeShapeModel"; fileError.append(IException(IException::Unknown, mess, _FILEINFO_)); if ("fail" == onerror) { throw fileError; @@ -263,7 +263,7 @@ namespace Isis { Isis::Cube* shapeModelCube = new Isis::Cube; try { // first, try to open the shape model file as an Isis cube - shapeModelCube->open(FileName(shapeModelFilenames).expanded(), "r" ); + shapeModelCube->open(QString::fromStdString(FileName(shapeModelFilenames.toStdString()).expanded()), "r" ); } catch (IException &e) { // The file is neither a valid DSK nor an ISIS cube. Append a message and throw the error. diff --git a/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp b/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp index f549c03f31..2fdc09d155 100644 --- a/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp +++ b/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp @@ -54,7 +54,7 @@ namespace Isis { if (m_longitudeDirection == PositiveWest) m_centerLongitude *= -1.0; } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp b/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp index a7cbfbb304..19ca3084f8 100644 --- a/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp +++ b/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp @@ -56,7 +56,7 @@ namespace Isis { if (m_longitudeDirection == PositiveWest) m_centerLongitude *= -1.0; } catch(IException &e) { - QString message = "Invalid label group [Mapping]"; + std::string message = "Invalid label group [Mapping]"; throw IException(e, IException::Io, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/SmtkMatcher/SmtkMatcher.cpp b/isis/src/base/objs/SmtkMatcher/SmtkMatcher.cpp index a587382800..341d343805 100644 --- a/isis/src/base/objs/SmtkMatcher/SmtkMatcher.cpp +++ b/isis/src/base/objs/SmtkMatcher/SmtkMatcher.cpp @@ -340,7 +340,7 @@ namespace Isis { // Test if the left point is defined. This will throw an error if this // situation occurs if (!lpg.getPoint().isValid()) { - QString mess = "Left point is not defined which is required"; + std::string mess = "Left point is not defined which is required"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -520,7 +520,7 @@ namespace Isis { if (!m_rhCube) isGood = false; if (!m_gruen.data()) isGood = false; if ((!isGood) && throwError) { - QString mess = "Images/match algorithm not initialized!"; + std::string mess = "Images/match algorithm not initialized!"; throw IException(IException::Programmer, mess, _FILEINFO_); } return (isGood); diff --git a/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp b/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp index f24d46ed72..eefe3e2899 100644 --- a/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp +++ b/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp @@ -27,18 +27,16 @@ namespace Isis { m_spectelList = NULL; try { - CSVReader csv(smileDefFilename.toString()); + CSVReader csv(QString::fromStdString(smileDefFilename.toString())); if (csv.columns() != 2) { - QString msg = QObject::tr("Input calibration file [%1] must have 2 columns with " - "the format: wavelength centers, wavelength widths"). - arg(smileDefFilename.toString()); + std::string msg = "Input calibration file [" + smileDefFilename.toString() + "] must have 2 columns with " + "the format: wavelength centers, wavelength widths"; throw IException(IException::User, msg, _FILEINFO_); } if (csv.rows() < 2) { - QString msg = QObject::tr("Input calibration file [%1] must have at least 2 lines."). - arg(smileDefFilename.toString()); + std::string msg = "Input calibration file [" + smileDefFilename.toString() + "] must have at least 2 lines."; throw IException(IException::User, msg, _FILEINFO_); } @@ -86,8 +84,7 @@ namespace Isis { if (m_spectelList != NULL) { delete m_spectelList; } - QString msg = QObject::tr("Unable to open input file [%1]. Is it a valid CSV?"). - arg(smileDefFilename.toString()); + std::string msg = "Unable to open input file [" + smileDefFilename.toString() + "]. Is it a valid CSV?"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -230,7 +227,7 @@ namespace Isis { double bestBand = -DBL_MAX; if (sectionNumber >= m_numSections) { - QString msg = QObject::tr("Input section number is greater than total number of sections."); + std::string msg = QObject::tr("Input section number is greater than total number of sections."); throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/SpectralDefinition2D/SpectralDefinition2D.cpp b/isis/src/base/objs/SpectralDefinition2D/SpectralDefinition2D.cpp index c57639f9f2..e06b67d6a4 100644 --- a/isis/src/base/objs/SpectralDefinition2D/SpectralDefinition2D.cpp +++ b/isis/src/base/objs/SpectralDefinition2D/SpectralDefinition2D.cpp @@ -28,14 +28,13 @@ namespace Isis { CubeAttributeInput cai; m_spectelList = NULL; m_sectionList = NULL; - Cube *smileCube = importCube.SetInputCube(smileDefFilename.expanded(), cai); + Cube *smileCube = importCube.SetInputCube(QString::fromStdString(smileDefFilename.expanded()), cai); try { // Check to see if input definition has the correct format if (smileCube->lineCount() != 2) { - QString msg = QObject::tr("Input calibration file [%1] must have 2 lines: " - "one containing wavelength centers and one containing widths"). - arg(smileDefFilename.toString()); + std::string msg = "Input calibration file [" + smileDefFilename.toString() + "] must have 2 lines: " + "one containing wavelength centers and one containing widths"; throw IException(IException::User, msg, _FILEINFO_); } @@ -62,8 +61,7 @@ namespace Isis { if (m_sectionList != NULL) { delete m_sectionList; } - QString msg = QObject::tr("Unable to open input cube [%1] and read it into a spectral " - "definition.").arg(smileDefFilename.toString()); + std::string msg = "Unable to open input cube [" + smileDefFilename.toString() + "] and read it into a spectral definition."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/Spice/Spice.cpp b/isis/src/base/objs/Spice/Spice.cpp index 0b5359bbcc..8eb64b2de0 100644 --- a/isis/src/base/objs/Spice/Spice.cpp +++ b/isis/src/base/objs/Spice/Spice.cpp @@ -356,7 +356,7 @@ namespace Isis { QString naifTarget = "IAU_" + m_target->name().toUpper(); namfrm_c(naifTarget.toLatin1().data(), &frameCode); if (frameCode == 0) { - QString msg = "Can not find NAIF BODY_FRAME_CODE for target [" + std::string msg = "Can not find NAIF BODY_FRAME_CODE for target [" + m_target->name() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -492,12 +492,12 @@ namespace Isis { if (QString::fromStdString(key[i]).toUpper() == "NADIR") break; if (QString::fromStdString(key[i]).toUpper() == "TABLE" && !noTables) break; if (QString::fromStdString(key[i]).toUpper() == "TABLE" && noTables) continue; - FileName file(QString::fromStdString(key[i])); + FileName file(key[i]); if (!file.fileExists()) { - QString msg = "Spice file does not exist [" + file.expanded() + "]"; + std::string msg = "Spice file does not exist [" + file.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } - QString fileName = file.expanded(); + QString fileName = QString::fromStdString(file.expanded()); furnsh_c(fileName.toLatin1().data()); m_kernels->push_back(QString::fromStdString(key[i])); } @@ -603,8 +603,8 @@ namespace Isis { // Unload the kernels (TODO: Can this be done faster) for (int i = 0; m_kernels && i < m_kernels->size(); i++) { - FileName file(m_kernels->at(i)); - QString fileName = file.expanded(); + FileName file(m_kernels->at(i).toStdString()); + QString fileName = QString::fromStdString(file.expanded()); unload_c(fileName.toLatin1().data()); } @@ -729,8 +729,8 @@ namespace Isis { // Unload the kernels (TODO: Can this be done faster) for (int i = 0; i < m_kernels->size(); i++) { - FileName file(m_kernels->at(i)); - QString fileName = file.expanded(); + FileName file(m_kernels->at(i).toStdString()); + QString fileName = QString::fromStdString(file.expanded()); unload_c(fileName.toLatin1().data()); } @@ -1136,11 +1136,11 @@ namespace Isis { } if (!found) { - QString msg = "Can not find [" + key + "] in text kernels"; + std::string msg = "Can not find [" + key + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } else if (numValuesRead == 0){ - QString msg = "Found " + key + "] in text kernels, but no values were identified and read."; + std::string msg = "Found " + key + "] in text kernels, but no values were identified and read."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1152,7 +1152,7 @@ namespace Isis { result = readStoredValue(key, type, index); if (result.isNull()) { - QString msg = "The camera is requesting spice data [" + key + "] that " + std::string msg = "The camera is requesting spice data [" + key + "] that " "was not attached, please re-run spiceinit"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -1223,7 +1223,7 @@ namespace Isis { storedKey[index] = std::to_string(value.toInt()); } else { - QString msg = "Unable to store variant in labels for key [" + key + "]"; + std::string msg = "Unable to store variant in labels for key [" + key + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/Spice/Spice.h b/isis/src/base/objs/Spice/Spice.h index f95b73cec2..3a8413dba7 100644 --- a/isis/src/base/objs/Spice/Spice.h +++ b/isis/src/base/objs/Spice/Spice.h @@ -9,6 +9,7 @@ find files of those names at the top level of this repository. **/ #include #include +#include #include #include diff --git a/isis/src/base/objs/SpicePosition/SpicePosition.cpp b/isis/src/base/objs/SpicePosition/SpicePosition.cpp index 8cc774bfb4..2272c6125b 100644 --- a/isis/src/base/objs/SpicePosition/SpicePosition.cpp +++ b/isis/src/base/objs/SpicePosition/SpicePosition.cpp @@ -195,7 +195,7 @@ namespace Isis { p_aberrationCorrection = abcorr; } else { - QString msg = "Invalid abberation correction [" + correction + "]"; + std::string msg = "Invalid abberation correction [" + correction + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -734,7 +734,7 @@ namespace Isis { // Make sure source is a function if(p_source < HermiteCache) { - QString msg = "The SpicePosition has not yet been fit to a function"; + std::string msg = "The SpicePosition has not yet been fit to a function"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1174,7 +1174,7 @@ namespace Isis { int coordIndex = partialVar; // if(coeffIndex > 2) { -// QString msg = "SpicePosition only supports up to a 2nd order fit for the spacecraft position"; +// std::string msg = "SpicePosition only supports up to a 2nd order fit for the spacecraft position"; // throw IException(IException::Programmer, msg, _FILEINFO_); // } // @@ -1252,7 +1252,7 @@ namespace Isis { derivative = 1; } else { - QString msg = "Unable to evaluate the derivative of the SPICE position fit polynomial for " + std::string msg = "Unable to evaluate the derivative of the SPICE position fit polynomial for " "the given coefficient index [" + toString(coeffIndex) + "]. " "Index is negative or exceeds degree of polynomial [" + toString(p_degree) + "]"; diff --git a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp index 8ce18325a9..a1407b3352 100644 --- a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp +++ b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp @@ -127,7 +127,7 @@ namespace Isis { gdpool_c(key.toLatin1().data(), 1, 2, &number, transX, &found); if (!found) { - QString msg = "Cannot find [" + key + "] in text kernels"; + std::string msg = "Cannot find [" + key + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1731,7 +1731,7 @@ namespace Isis { if (p_source == PolyFunction) { // Nothing to do return; -// QString msg = "Rotation already fit to a polynomial -- spiceint first to refit"; +// std::string msg = "Rotation already fit to a polynomial -- spiceint first to refit"; // throw IException(IException::User,msg,_FILEINFO_); } @@ -2137,7 +2137,7 @@ namespace Isis { derivative = 1; } else { - QString msg = "Unable to evaluate the derivative of the SPICE rotation fit polynomial for " + std::string msg = "Unable to evaluate the derivative of the SPICE rotation fit polynomial for " "the given coefficient index [" + toString(coeffIndex) + "]. " "Index is negative or exceeds degree of polynomial [" + toString(p_degree) + "]"; @@ -2189,7 +2189,7 @@ namespace Isis { derivative = pow(time, coeffIndex); break; default: - QString msg = "Unable to evaluate the derivative of the target body rotation fit polynomial " + std::string msg = "Unable to evaluate the derivative of the target body rotation fit polynomial " "for the given coefficient index [" + toString(coeffIndex) + "]. " "Index is negative or exceeds degree of polynomial [" + toString(p_degree) + "]"; @@ -2441,7 +2441,7 @@ namespace Isis { */ void SpiceRotation::SetAxes(int axis1, int axis2, int axis3) { if (axis1 < 1 || axis2 < 1 || axis3 < 1 || axis1 > 3 || axis2 > 3 || axis3 > 3) { - QString msg = "A rotation axis is outside the valid range of 1 to 3"; + std::string msg = "A rotation axis is outside the valid range of 1 to 3"; throw IException(IException::Programmer, msg, _FILEINFO_); } p_axis1 = axis1; @@ -2610,7 +2610,7 @@ namespace Isis { // Check for a gap in the time coverage by making sure the time span of the observation // does not cross a segment unless the next segment starts where the current one ends if (observationSpansToNextSegment && currentTime > segStartEt) { - QString msg = "Observation crosses segment boundary--unable to interpolate pointing"; + std::string msg = "Observation crosses segment boundary--unable to interpolate pointing"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (observEnd > segStopEt) { @@ -2765,7 +2765,7 @@ namespace Isis { break; } - QString msg = "The frame" + toString((int) frameCodes[frmidx]) + " is not supported by Naif"; + std::string msg = "The frame" + toString((int) frameCodes[frmidx]) + " is not supported by Naif"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -2785,7 +2785,7 @@ namespace Isis { break; } - QString msg = "The ck rotation from frame " + toString(frameCodes[frmidx]) + " can not " + std::string msg = "The ck rotation from frame " + toString(frameCodes[frmidx]) + " can not " + "be found due to no pointing available at requested time or a problem with the " + "frame"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -2794,7 +2794,7 @@ namespace Isis { else if (type == TK) { tkfram_((SpiceInt *) &typid, (double *) matrix, &nextFrame, (logical *) &found); if (!found) { - QString msg = "The tk rotation from frame " + toString(frameCodes[frmidx]) + + std::string msg = "The tk rotation from frame " + toString(frameCodes[frmidx]) + " can not be found"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -2810,7 +2810,7 @@ namespace Isis { } else { - QString msg = "The frame " + toString(frameCodes[frmidx]) + + std::string msg = "The frame " + toString(frameCodes[frmidx]) + " has a type " + toString(type) + " not supported by your version of Naif Spicelib." + "You need to update."; throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp index d6148656cc..017f03bb5a 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp +++ b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp @@ -615,14 +615,14 @@ namespace Isis { void StatCumProbDistDynCalc::validate() { // if quantiles have not been set if (m_numberQuantiles == 0) { - QString msg = "StatCumProbDistDynCalc will return no data until the quantiles have been set. " + std::string msg = "StatCumProbDistDynCalc will return no data until the quantiles have been set. " "Number of cells = [" + toString(m_numberCells) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } //if there isn't even as much data as there are quantiles to track if (m_numberObservations < m_numberQuantiles) { - QString msg = "StatCumProbDistDynCalc will return no data until the number of observations " + std::string msg = "StatCumProbDistDynCalc will return no data until the number of observations " "added [" + toString(m_numberObservations) + "] matches the number of " "quantiles [" + toString(m_numberQuantiles) + "] (i.e. number of nodes) selected."; diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp b/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp index efd1a82700..a1d91cc028 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp +++ b/isis/src/base/objs/StatCumProbDistDynCalc/unitTest.cpp @@ -717,7 +717,7 @@ int main(int argc, char *argv[]) { bool deleted = qXmlFile.remove(); if (!deleted) { - QString msg = "Unit Test failed. XML file [" + xmlPath + "not deleted."; + std::string msg = "Unit Test failed. XML file [" + xmlPath + "not deleted."; throw IException(IException::Io, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/Statistics/Statistics.cpp b/isis/src/base/objs/Statistics/Statistics.cpp index 8ef29b6375..cb23695d3d 100644 --- a/isis/src/base/objs/Statistics/Statistics.cpp +++ b/isis/src/base/objs/Statistics/Statistics.cpp @@ -531,7 +531,7 @@ namespace Isis { */ double Statistics::Minimum() const { if (m_removedData) { - QString msg = "Minimum is invalid since you removed data"; + std::string msg = "Minimum is invalid since you removed data"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -552,7 +552,7 @@ namespace Isis { */ double Statistics::Maximum() const { if (m_removedData) { - QString msg = "Maximum is invalid since you removed data"; + std::string msg = "Maximum is invalid since you removed data"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -721,7 +721,7 @@ namespace Isis { */ double Statistics::ChebyshevMaximum(const double percent) const { if ((percent <= 0.0) || (percent >= 100.0)) { - QString msg = "Invalid value for percent"; + std::string msg = "Invalid value for percent"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Statistics/unitTest.cpp b/isis/src/base/objs/Statistics/unitTest.cpp index 7783652406..c0705af4a2 100644 --- a/isis/src/base/objs/Statistics/unitTest.cpp +++ b/isis/src/base/objs/Statistics/unitTest.cpp @@ -541,7 +541,7 @@ int main(int argc, char *argv[]) { bool deleted = qXmlFile.remove(); if (!deleted) { - QString msg = "Unit Test failed. XML file [" + xmlPath + "not deleted."; + std::string msg = "Unit Test failed. XML file [" + xmlPath + "not deleted."; throw IException(IException::Io, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/Strategy/Strategy.cpp b/isis/src/base/objs/Strategy/Strategy.cpp index 736e00ae30..5ff342db0c 100644 --- a/isis/src/base/objs/Strategy/Strategy.cpp +++ b/isis/src/base/objs/Strategy/Strategy.cpp @@ -1005,7 +1005,7 @@ namespace Isis { // The programmer is required to ensure a valid geometry provides the // source of the intersection operation. if ( !geom.isValid() ) { - QString mess = type() + ":" + name() + + std::string mess = type() + ":" + name() + "Cannot apply RTree search to bad geometry."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -1040,7 +1040,7 @@ namespace Isis { } GEOSSTRtree *rtree = GEOSSTRtree_create(v_active.size()); if ( !rtree ) { - QString mess = "GEOS RTree allocation failed for " + + std::string mess = "GEOS RTree allocation failed for " + toString(v_active.size()) + " geometries."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/TProjection/TProjection.cpp b/isis/src/base/objs/TProjection/TProjection.cpp index 35a34d705a..466d6d97d8 100644 --- a/isis/src/base/objs/TProjection/TProjection.cpp +++ b/isis/src/base/objs/TProjection/TProjection.cpp @@ -129,7 +129,7 @@ namespace Isis { m_latitudeType = Planetocentric; } else { - QString msg = "Projection failed. Invalid value for keyword " + std::string msg = "Projection failed. Invalid value for keyword " "[LatitudeType] must be " "[Planetographic or Planetocentric]"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -1769,7 +1769,7 @@ namespace Isis { */ double TProjection::qCompute(const double sinPhi) const { if (m_eccentricity < DBL_EPSILON) { - QString msg = "Snyder's q variable should only be computed for " + std::string msg = "Snyder's q variable should only be computed for " "ellipsoidal projections."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Target/Target.cpp b/isis/src/base/objs/Target/Target.cpp index 0fb2a94b97..8b42abc7ce 100644 --- a/isis/src/base/objs/Target/Target.cpp +++ b/isis/src/base/objs/Target/Target.cpp @@ -273,7 +273,7 @@ namespace Isis { SpiceBoolean found; bodn2c_c(name.toLatin1().data(), &code, &found); if (!found) { - QString msg = "Could not convert Target [" + name + + std::string msg = "Could not convert Target [" + name + "] to NAIF body code"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -406,7 +406,7 @@ namespace Isis { // If we get this far, we know the cube has no NaifKeywords object and previous attempts to // find radii in the mapping group or using spice IDs have failed - QString msg = "Unable to find Equatorial and Polar radii for target [" + target + "]."; + std::string msg = "Unable to find Equatorial and Polar radii for target [" + target + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -446,7 +446,7 @@ namespace Isis { bodyCode = lookupNaifBodyCode(target); } catch (IException &e) { - QString msg = "Unable to find target radii for given target [" + std::string msg = "Unable to find target radii for given target [" + target + "]."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -482,7 +482,7 @@ namespace Isis { FileName kern("$base/kernels/pck/pck?????.tpc"); kern = kern.highestVersion(); - QString kernName = kern.expanded(); + QString kernName = QString::fromStdString(kern.expanded()); if(!pckLoaded) { furnsh_c(kernName.toLatin1().data()); diff --git a/isis/src/base/objs/TextFile/TextFile.cpp b/isis/src/base/objs/TextFile/TextFile.cpp index 31fdcd9891..abe1595104 100644 --- a/isis/src/base/objs/TextFile/TextFile.cpp +++ b/isis/src/base/objs/TextFile/TextFile.cpp @@ -224,7 +224,7 @@ namespace Isis { // Don't open if it already is if(p_stream.is_open()) { - QString message = "TextFile:Open:-> Already opened with this object: [" + std::string message = "TextFile:Open:-> Already opened with this object: [" + QString(openmode) + "]:[" + p_filename + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -233,9 +233,9 @@ namespace Isis { // Save the filename for error messages - Isis::FileName filenameTmp(filename); + Isis::FileName filenameTmp(filename.toStdString()); filenameTmp.addExtension(extension); - p_filename = filenameTmp.expanded(); + p_filename = QString::fromStdString(filenameTmp.expanded()); // input, output, overwrite, append @@ -254,7 +254,7 @@ namespace Isis { p_openmode = 4; } else { - QString message = "TextFile::-> Unknown openmode: (input, output, overwrite, append):[" + std::string message = "TextFile::-> Unknown openmode: (input, output, overwrite, append):[" + QString(openmode) + "]:[" + p_filename + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -266,8 +266,8 @@ namespace Isis { // Output else if(p_openmode == 2) { // first check if file already exists - if(filenameTmp.fileExists() && QFileInfo(filenameTmp.toString()).size() > 0) { - QString message = "TextFile:Open: -> Output file already exists [" + if(filenameTmp.fileExists() && QFileInfo(QString::fromStdString(filenameTmp.toString())).size() > 0) { + std::string message = "TextFile:Open: -> Output file already exists [" + QString(openmode) + "]:[" + p_filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -291,7 +291,7 @@ namespace Isis { } if(!p_stream.is_open()) { - QString message = "TextFile:Open:-> Unable to open: [" + std::string message = "TextFile:Open:-> Unable to open: [" + QString(openmode) + "]:[" + p_filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -303,7 +303,7 @@ namespace Isis { } else { if(bailIfNotOpen) { - QString message = "TextFile::-> File not open: [" + p_filename + "]"; + std::string message = "TextFile::-> File not open: [" + p_filename + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } else { @@ -477,7 +477,7 @@ namespace Isis { // See if an error occured if(!p_stream.good()) { line = ""; - QString message = "TextFile:GetLine: -> Error reading text file: [" + std::string message = "TextFile:GetLine: -> Error reading text file: [" + p_filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -526,12 +526,12 @@ namespace Isis { // See if an error occured if(!p_stream.good()) { if(p_openmode != 1) { - QString message = "TextFile:PutLine: -> Error writing text file: [" + std::string message = "TextFile:PutLine: -> Error writing text file: [" + p_filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } else { - QString message = + std::string message = "TextFile:PutLine: -> Attempt to write to INPUT - Read Only text file: [" + p_filename + "]"; throw IException(IException::Programmer, message, _FILEINFO_); diff --git a/isis/src/base/objs/TiffExporter/TiffExporter.cpp b/isis/src/base/objs/TiffExporter/TiffExporter.cpp index 0b695981f9..d97268ae3a 100644 --- a/isis/src/base/objs/TiffExporter/TiffExporter.cpp +++ b/isis/src/base/objs/TiffExporter/TiffExporter.cpp @@ -74,10 +74,10 @@ namespace Isis { void TiffExporter::write(FileName outputName, int quality, QString compression, UserInterface *ui) { - outputName = outputName.addExtension(extension()); + outputName = outputName.addExtension(extension().toStdString()); // Open the output image - m_image = TIFFOpen(outputName.expanded().toLatin1().data(), "w"); + m_image = TIFFOpen(outputName.expanded().c_str(), "w"); if (m_image == NULL) { throw IException(IException::Programmer, @@ -100,7 +100,7 @@ namespace Isis { TIFFSetField(m_image, TIFFTAG_COMPRESSION, COMPRESSION_NONE); } else { - QString msg = "Invalid TIFF compression algorithm: " + compression; + std::string msg = "Invalid TIFF compression algorithm: " + compression; throw IException(IException::Programmer, msg, _FILEINFO_); } TIFFSetField(m_image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); diff --git a/isis/src/base/objs/TiffImporter/TiffImporter.cpp b/isis/src/base/objs/TiffImporter/TiffImporter.cpp index 4ef531680d..7dd1cdaa57 100644 --- a/isis/src/base/objs/TiffImporter/TiffImporter.cpp +++ b/isis/src/base/objs/TiffImporter/TiffImporter.cpp @@ -34,9 +34,9 @@ namespace Isis { // Open the TIFF image m_image = NULL; - if ((m_image = XTIFFOpen(inputName.expanded().toLatin1().data(), "r")) == NULL) { + if ((m_image = XTIFFOpen(inputName.expanded().c_str(), "r")) == NULL) { throw IException(IException::Programmer, - QString("Could not open TIFF image [") + inputName.expanded().toLatin1().data() + "]", _FILEINFO_); + QString("Could not open TIFF image [") + inputName.expanded().c_str() + "]", _FILEINFO_); } // Get its constant dimensions. Note, height seems to get reset to 0 if @@ -128,12 +128,12 @@ namespace Isis { if (GTIFKeyGet(m_geotiff, ProjectedCSTypeGeoKey, &coordSysType, 0, 1) == 1) { // Get the mapping group data for this code: proj name, clat, clon, ... - FileName transFile((QString) "$ISISROOT/appdata/translations/" + - toString(coordSysType) + ".trn"); + FileName transFile("$ISISROOT/appdata/translations/" + + std::to_string(coordSysType) + ".trn"); if (transFile.fileExists()) { Pvl tmp; tmp += PvlKeyword("Code", std::to_string(coordSysType)); - PvlToPvlTranslationManager geoTiffCodeTranslater(tmp, transFile.expanded()); + PvlToPvlTranslationManager geoTiffCodeTranslater(tmp, QString::fromStdString(transFile.expanded())); geoTiffCodeTranslater.Auto(outPvl); } } @@ -455,7 +455,7 @@ namespace Isis { map += PvlKeyword("UpperLeftCornerY", std::to_string(y), "meters"); } else { - QString msg = "The upper left X and Y can not be calculated. Unsupported tiepoint " + std::string msg = "The upper left X and Y can not be calculated. Unsupported tiepoint " "type in Tiff file (i.e., not ( 0.0, 0.0))"; throw IException(IException::User, msg, _FILEINFO_); } @@ -488,7 +488,7 @@ namespace Isis { map += PvlKeyword("PixelResolution", std::to_string(scales[0]), "meters"); } else { - QString msg = "The pixel resolution could not be retrieved from the TIFF file. Unsupported " + std::string msg = "The pixel resolution could not be retrieved from the TIFF file. Unsupported " "PixelScale tag values."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/TrackingTable/TrackingTable.cpp b/isis/src/base/objs/TrackingTable/TrackingTable.cpp index 6c0570b0c7..9615dd46dd 100644 --- a/isis/src/base/objs/TrackingTable/TrackingTable.cpp +++ b/isis/src/base/objs/TrackingTable/TrackingTable.cpp @@ -40,13 +40,13 @@ namespace Isis { for (int i=0; i < table.Records(); i++) { TableRecord record = table[i]; QString nameField = QString::fromStdString(record["FileName"]).split("/").last(); - QString extension(FileName(nameField).extension()); + QString extension(QString::fromStdString(FileName(nameField.toStdString()).extension())); int found = nameField.lastIndexOf(extension); if (found != -1) { // clear the packing characters - get only the file name nameField.remove(found + 3); } - FileName fileName(nameField); + FileName fileName(nameField.toStdString()); std::string serialNumber = record["SerialNumber"]; m_fileList.append(QPair(fileName, QString::fromStdString(serialNumber))); } @@ -94,7 +94,7 @@ namespace Isis { // Loop through m_fileList and add records to the table with the proper information. for (int i=0; i < m_fileList.size(); i++) { - fileNameField = m_fileList[i].first.name().toStdString(); + fileNameField = m_fileList[i].first.name(); serialNumberField = m_fileList[i].second.toStdString(); indexField = (int) (i + VALID_MINUI4); @@ -119,7 +119,7 @@ namespace Isis { */ FileName TrackingTable::pixelToFileName(unsigned int pixel) { if (pixel < VALID_MINUI4) { - QString msg = "Cannot convert pixel [" + toString(pixel) + std::string msg = "Cannot convert pixel [" + toString(pixel) + "] to a filename, pixel is below valid minimum [" + toString(VALID_MINUI4) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -127,7 +127,7 @@ namespace Isis { unsigned int index = pixel - VALID_MINUI4; if (index >= (unsigned int)m_fileList.size()) { - QString msg = "Cannot convert pixel [" + toString(pixel) + std::string msg = "Cannot convert pixel [" + toString(pixel) + "] to a filename, pixel is above valid maximum [" + toString(VALID_MINUI4 + m_fileList.size()) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -149,7 +149,7 @@ namespace Isis { */ unsigned int TrackingTable::fileNameToPixel(FileName file, QString serialNumber) { for (int i = 0; i < m_fileList.size(); i++) { - if (QString::compare(m_fileList[i].first.toString(), file.name()) == 0) { + if (QString::compare(QString::fromStdString(m_fileList[i].first.toString()), QString::fromStdString(file.name())) == 0) { return i + VALID_MINUI4; } } @@ -169,7 +169,7 @@ namespace Isis { */ QString TrackingTable::pixelToSN(unsigned int pixel) { if (pixel < VALID_MINUI4) { - QString msg = "Cannot convert pixel [" + toString(pixel) + std::string msg = "Cannot convert pixel [" + toString(pixel) + "] to a serial number, pixel is below valid minimum [" + toString(VALID_MINUI4) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -177,7 +177,7 @@ namespace Isis { unsigned int index = pixel - VALID_MINUI4; if (index >= (unsigned int)m_fileList.size()) { - QString msg = "Cannot convert pixel [" + toString(pixel) + std::string msg = "Cannot convert pixel [" + toString(pixel) + "] to a serial number, pixel is above valid maximum [" + toString(VALID_MINUI4 + m_fileList.size()) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/base/objs/TriangularPlate/TriangularPlate.cpp b/isis/src/base/objs/TriangularPlate/TriangularPlate.cpp index 20c9dfad41..1e8ffc1e39 100755 --- a/isis/src/base/objs/TriangularPlate/TriangularPlate.cpp +++ b/isis/src/base/objs/TriangularPlate/TriangularPlate.cpp @@ -306,7 +306,7 @@ namespace Isis { NaifVertex TriangularPlate::vertex(int v) const { NaifVertex vec(3); if ( (v < 0) || (v > 2) ) { - QString msg = "Unable to get TriangularPlate vertex for index [" + std::string msg = "Unable to get TriangularPlate vertex for index [" + toString(v) + "]. Valid index range is 0-2."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/UniversalGroundMap/UniversalGroundMap.cpp b/isis/src/base/objs/UniversalGroundMap/UniversalGroundMap.cpp index bae21e107d..83b4940754 100644 --- a/isis/src/base/objs/UniversalGroundMap/UniversalGroundMap.cpp +++ b/isis/src/base/objs/UniversalGroundMap/UniversalGroundMap.cpp @@ -53,7 +53,7 @@ namespace Isis { } catch (IException &secondError) { p_projection = NULL; - QString msg = "Could not create camera or projection for [" + + std::string msg = "Could not create camera or projection for [" + cube.fileName() + "]"; IException realError(IException::Unknown, msg, _FILEINFO_); realError.append(firstError); diff --git a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp index 329d675c23..a4d1791812 100644 --- a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp +++ b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp @@ -65,7 +65,7 @@ namespace Isis { mapGroup += PvlKeyword("CenterLongitude", std::to_string(centerLongitude), "Degrees"); } else { - QString message = "Cannot project using upturned ellipsoid Transverse Azimuthal"; + std::string message = "Cannot project using upturned ellipsoid Transverse Azimuthal"; message += " without [CenterLongitude] value. Keyword does not exist"; message += " in labels and defaults are not allowed."; throw IException(IException::Unknown, message, _FILEINFO_); diff --git a/isis/src/base/objs/UserInterface/UserInterface.cpp b/isis/src/base/objs/UserInterface/UserInterface.cpp index f5c8e8d5ab..0a7538b265 100644 --- a/isis/src/base/objs/UserInterface/UserInterface.cpp +++ b/isis/src/base/objs/UserInterface/UserInterface.cpp @@ -44,13 +44,14 @@ namespace Isis { // Make sure the user has a .Isis and .Isis/history directory try { - FileName setup = "$HOME/.Isis/history"; - // cannot completely test this if in unit test - if ( !setup.fileExists() ) { - setup.dir().mkpath("."); + std::filesystem::path homePath = std::getenv("HOME"); + std::filesystem::path historyPath = homePath / ".Isis" / "history"; + if (!std::filesystem::exists(historyPath)) { + std::filesystem::create_directories(historyPath); } } - catch (IException &) { + catch (const std::filesystem::filesystem_error& e) { + std::cerr << "Error: " << e.what() << '\n'; } // Parse the user input @@ -81,13 +82,14 @@ namespace Isis { // Make sure the user has a .Isis and .Isis/history directory try { - FileName setup = "$HOME/.Isis/history"; - // cannot completely test this if in unit test - if ( !setup.fileExists() ) { - setup.dir().mkpath("."); + std::filesystem::path homePath = std::getenv("HOME"); + std::filesystem::path historyPath = homePath / ".Isis" / "history"; + if (!std::filesystem::exists(historyPath)) { + std::filesystem::create_directories(historyPath); } } - catch (IException &) { + catch (const std::filesystem::filesystem_error& e) { + std::cerr << "Error: " << e.what() << '\n'; } // Parse the user input @@ -235,12 +237,12 @@ namespace Isis { void UserInterface::SetErrorList(int i) { if (p_errList != "") { std::ofstream os; - QString fileName( FileName(p_errList).expanded() ); + QString fileName(QString::fromStdString(FileName(p_errList.toStdString()).expanded())); os.open(fileName.toLatin1().data(), std::ios::app); // did not unit test since it is assumed ofstream will be instantiated correctly if ( !os.good() ) { - QString msg = "Unable to create error list [" + p_errList + std::string msg = "Unable to create error list [" + p_errList + "] Disk may be full or directory permissions not writeable"; throw IException(IException::User, msg, _FILEINFO_); } @@ -268,11 +270,11 @@ namespace Isis { return; // Get the current history file - Isis::FileName histFile(QString::fromStdString(grp["HistoryPath"][0]) + "/" + ProgramName() + ".par"); + Isis::FileName histFile(grp["HistoryPath"][0] + "/" + ProgramName().toStdString() + ".par"); // If a save file is specified, override the default file path if (p_saveFile != "") - histFile = p_saveFile; + histFile = p_saveFile.toStdString(); // Get the current command line Isis::Pvl cmdLine; @@ -285,7 +287,7 @@ namespace Isis { // overwriten with the new entry. try { if ( histFile.fileExists() ) { - hist.read( histFile.expanded().toStdString() ); + hist.read(histFile.expanded()); } } catch (IException &) { @@ -301,7 +303,7 @@ namespace Isis { // Write it try { - hist.write( histFile.expanded().toStdString() ); + hist.write(histFile.expanded()); } catch (IException &) { } @@ -327,7 +329,7 @@ namespace Isis { temp.Open(file); } catch (IException &e) { - QString msg = "The batchlist file [" + file + "] could not be opened"; + std::string msg = "The batchlist file [" + file + "] could not be opened"; throw IException(IException::User, msg, _FILEINFO_); } @@ -362,13 +364,13 @@ namespace Isis { if (i == 0) continue; if ( p_batchList[i - 1].size() != p_batchList[i].size() ) { - QString msg = "The number of columns must be constant in batchlist"; + std::string msg = "The number of columns must be constant in batchlist"; throw IException(IException::User, msg, _FILEINFO_); } } // The batchlist cannot be empty if (p_batchList.size() < 1) { - QString msg = "The list file [" + file + "] does not contain any data"; + std::string msg = "The list file [" + file + "] does not contain any data"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -425,7 +427,7 @@ namespace Isis { // The program will be interactive if it has no arguments or // if it has the name unitTest p_progName = argv[0]; - Isis::FileName file(p_progName); + Isis::FileName file(p_progName.toStdString()); // cannot completely test in a unit test since unitTest will always evaluate to true if ( (argc == 1) && (file.name() != "unitTest") ) { p_interactive = true; @@ -477,7 +479,7 @@ namespace Isis { // where if(paramname == -last ) to continue } was originally if (paramValue.size() > 1) { - QString msg = "Invalid value for reserve parameter [" + std::string msg = "Invalid value for reserve parameter [" + paramName + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -530,14 +532,14 @@ namespace Isis { // Can't use the batchlist with the gui, save, last or restore option if ( BatchListSize() != 0 && (p_interactive || usedDashLast || p_saveFile != "" || usedDashRestore) ) { - QString msg = "-BATCHLIST cannot be used with -GUI, -SAVE, -RESTORE, "; + std::string msg = "-BATCHLIST cannot be used with -GUI, -SAVE, -RESTORE, "; msg += "or -LAST"; throw IException(IException::User, msg, _FILEINFO_); } // Must use batchlist if using errorlist or onerror=continue if ( (BatchListSize() == 0) && (!p_abortOnError || p_errList != "") ) { - QString msg = "-ERRLIST and -ONERROR=continue cannot be used without "; + std::string msg = "-ERRLIST and -ONERROR=continue cannot be used without "; msg += " the -BATCHLIST option"; throw IException(IException::User, msg, _FILEINFO_); } @@ -569,10 +571,10 @@ namespace Isis { * @throws Isis::IException::User - Parameter history file does not exist */ void UserInterface::loadHistory(const QString file) { - Isis::FileName hist(file); + Isis::FileName hist(file.toStdString()); if ( hist.fileExists() ) { try { - Isis::Pvl lab( hist.expanded().toStdString() ); + Isis::Pvl lab(hist.expanded()); int g = lab.groups() - 1; if (g >= 0 && lab.group(g).isNamed("UserParameters") ) { @@ -632,18 +634,18 @@ namespace Isis { } } - /*QString msg = "[" + hist.expanded() + + /*std::string msg = "[" + hist.expanded() + "] does not contain any parameters to restore"; throw Isis::iException::Message( Isis::iException::User, msg, _FILEINFO_ );*/ } catch (...) { - QString msg = "The history file [" + file + "] is for a different application or corrupt, "\ + std::string msg = "The history file [" + file + "] is for a different application or corrupt, "\ "please fix or delete this file"; throw IException(IException::User, msg, _FILEINFO_); } } else { - QString msg = "The history file [" + file + "] does not exist"; + std::string msg = "The history file [" + file + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -670,7 +672,7 @@ namespace Isis { const QString value) { // check to see if the program is a unitTest bool unitTest = false; - if (FileName(p_progName).name() == "unitTest") { + if (FileName(p_progName.toStdString()).name() == "unitTest") { unitTest = true; } Preference &p = Preference::Preferences(); @@ -688,11 +690,11 @@ namespace Isis { QString histFile; // need to handle for unit test since -LAST is preprocessed if (unitTest) { - histFile = "./" + FileName(p_progName).name() + ".par"; + histFile = QString::fromStdString("./" + FileName(p_progName.toStdString()).name() + ".par"); } else { PvlGroup &grp = p.findGroup("UserInterface", Isis::Pvl::Traverse); - histFile = QString::fromStdString(grp["HistoryPath"][0]) + "/" + FileName(p_progName).name() + ".par"; + histFile = QString::fromStdString(grp["HistoryPath"][0] + "/" + FileName(p_progName.toStdString()).name() + ".par"); } loadHistory(histFile); @@ -704,7 +706,7 @@ namespace Isis { Isis::PvlGroup &pref = Isis::Preference::Preferences().findGroup("UserInterface"); QString command = QString::fromStdString(pref["GuiHelpBrowser"]); command += " $ISISROOT/docs/Application/presentation/Tabbed/"; - command += FileName(p_progName).name() + "/" + FileName(p_progName).name() + ".html"; + command += QString::fromStdString(FileName(p_progName.toStdString()).name() + "/" + FileName(p_progName.toStdString()).name() + ".html"); // cannot test else in unit test - don't want to open webhelp if (unitTest) { throw IException(IException::Programmer, @@ -888,7 +890,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } - if ( FileName(p_errList).fileExists() ) { + if ( FileName(p_errList.toStdString()).fileExists() ) { QFile::remove(p_errList); } } @@ -902,7 +904,7 @@ namespace Isis { } else { - QString msg = "[" + value + std::string msg = "[" + value + "] is an invalid value for -ONERROR, options are ABORT or CONTINUE"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1098,7 +1100,7 @@ namespace Isis { for (int strPos = 0; strPos < arrayString.size(); strPos++) { if (strPos == 0) { if (arrayString[strPos] != '(') { - QString msg = "Invalid array format [" + arrayString + "]"; + std::string msg = "Invalid array format [" + arrayString + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1113,14 +1115,14 @@ namespace Isis { } // ends in a backslash?? else if (arrayString[strPos] == '\\') { - QString msg = "Invalid array format [" + arrayString + "]"; + std::string msg = "Invalid array format [" + arrayString + "]"; throw IException(IException::User, msg, _FILEINFO_); } // not in quoted part of QString if (!inDoubleQuotes && !inSingleQuotes) { if (arrayClosed) { - QString msg = "Invalid array format [" + arrayString + "]"; + std::string msg = "Invalid array format [" + arrayString + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1185,7 +1187,7 @@ namespace Isis { } if (!arrayClosed || currElement != "") { - QString msg = "Invalid array format [" + arrayString + "]"; + std::string msg = "Invalid array format [" + arrayString + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1221,7 +1223,7 @@ namespace Isis { // If our option starts with the parameter name so far, this is it if ( reservedParams[option].startsWith(unresolvedParam) ) { if (matchOption >= 0) { - QString msg = "Ambiguous Reserve Parameter [" + std::string msg = "Ambiguous Reserve Parameter [" + unresolvedParam + "]. Please clarify."; throw IException(IException::User, msg, _FILEINFO_); } @@ -1233,10 +1235,10 @@ namespace Isis { if (handleNoMatches) { // handle no matches if (matchOption < 0) { - QString msg = "Invalid Reserve Parameter Option [" + std::string msg = "Invalid Reserve Parameter Option [" + unresolvedParam + "]. Choices are "; - QString msgOptions; + std::string msgOptions; for (int option = 0; option < (int)reservedParams.size(); option++) { // Make sure not to show -PID as an option if (reservedParams[option].compare("-PID") == 0) { diff --git a/isis/src/base/objs/XmlToJson/XmlToJson.cpp b/isis/src/base/objs/XmlToJson/XmlToJson.cpp index 5981fab7fe..53afbbb0d0 100644 --- a/isis/src/base/objs/XmlToJson/XmlToJson.cpp +++ b/isis/src/base/objs/XmlToJson/XmlToJson.cpp @@ -37,15 +37,15 @@ namespace Isis { QFile file(xmlFile); if (!file.open(QIODevice::ReadOnly)) { - QString message = QString("Failed to open file for XML Input: [%1]").arg(xmlFile); + std::string message = QString("Failed to open file for XML Input: [%1]").arg(xmlFile); throw IException(IException::Io, message, _FILEINFO_); } - QString errMsg; + std::string errMsg; int errLine, errCol; if (!doc.setContent(&file, &errMsg, &errLine, &errCol)) { file.close(); - QString message = QString("Failed to use file for XML Input: [%1]. %2 at line %3, column %4").arg(xmlFile).arg(errMsg).arg(errLine).arg(errCol); + std::string message = QString("Failed to use file for XML Input: [%1]. %2 at line %3, column %4").arg(xmlFile).arg(errMsg).arg(errLine).arg(errCol); throw IException(IException::Io, message, _FILEINFO_); } diff --git a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp index 0da3a52cf2..03cbaeb23a 100644 --- a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp +++ b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp @@ -164,7 +164,7 @@ namespace Isis { int index) { try { if (index != 0) { - QString msg = "Cannot translate value at index [" + toString(index) + + std::string msg = "Cannot translate value at index [" + toString(index) + "]. Xml files can only store a single value in each element."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -175,7 +175,7 @@ namespace Isis { transGroup = transTable.findGroup(translationGroupName.toStdString()); } catch (IException &e){ - QString msg = "Unable to retrieve translation group from translation table."; + std::string msg = "Unable to retrieve translation group from translation table."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -185,7 +185,7 @@ namespace Isis { inputPosition = transGroup["InputPosition"]; } catch (IException &e){ - QString msg = "Unable to retrieve [InputPosition] keyword from " + std::string msg = "Unable to retrieve [InputPosition] keyword from " "translation group."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -197,7 +197,7 @@ namespace Isis { inputKey = QString::fromStdString(transGroup["InputKey"][0]); } catch (IException &e){ - QString msg = "Unable to retrieve [InputKey] keyword from " + std::string msg = "Unable to retrieve [InputKey] keyword from " "translation group."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -310,7 +310,7 @@ namespace Isis { return PvlTranslationTable::Translate( translationGroupName ); } else { - QString msg = "Could not find an input or default value that fits the given input " + std::string msg = "Could not find an input or default value that fits the given input " "keyword dependencies."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -331,7 +331,7 @@ namespace Isis { return PvlTranslationTable::Translate( translationGroupName ); } else { - QString msg = "Input element [" + inputKeyElement.tagName() + + std::string msg = "Input element [" + inputKeyElement.tagName() + "] does not have an attribute named [" + attributeName + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -343,7 +343,7 @@ namespace Isis { return PvlTranslationTable::Translate( translationGroupName, inputValue.trimmed() ); } catch (IException &e){ - QString msg = "Failed to translate output value for [" + translationGroupName + "]."; + std::string msg = "Failed to translate output value for [" + translationGroupName + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -427,7 +427,7 @@ namespace Isis { } else { - QString msg = "Parsing error, dependency type [" + specification[0] + + std::string msg = "Parsing error, dependency type [" + specification[0] + "] is not [att] or [tag]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -462,9 +462,9 @@ namespace Isis { * @throws IException::Unknown "XML read/parse error in file." */ void XmlToPvlTranslationManager::parseFile(const FileName &xmlFileName) { - QFile xmlFile(xmlFileName.expanded()); + QFile xmlFile(QString::fromStdString(xmlFileName.expanded())); if ( !xmlFile.open(QIODevice::ReadOnly) ) { - QString msg = "Could not open label file [" + xmlFileName.expanded() + + std::string msg = "Could not open label file [" + xmlFileName.expanded() + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -473,9 +473,9 @@ namespace Isis { int errline, errcol; if ( !m_xmlLabel.setContent(&xmlFile, false, &errmsg, &errline, &errcol) ) { xmlFile.close(); - QString msg = "XML read/parse error in file [" + xmlFileName.expanded() - + "] at line [" + toString(errline) + "], column [" + toString(errcol) - + "], message: " + errmsg; + std::string msg = "XML read/parse error in file [" + xmlFileName.expanded() + + "] at line [" + std::to_string(errline) + "], column [" + std::to_string(errcol) + + "], message: " + errmsg.toStdString(); throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/XmlToPvlTranslationManager/unitTest.cpp b/isis/src/base/objs/XmlToPvlTranslationManager/unitTest.cpp index b7e16751a0..a347d8a2ac 100644 --- a/isis/src/base/objs/XmlToPvlTranslationManager/unitTest.cpp +++ b/isis/src/base/objs/XmlToPvlTranslationManager/unitTest.cpp @@ -390,7 +390,7 @@ int main(void) { XmlToPvlTranslationManager pvlTransFileManager(pvlFile, simpleTrans); } catch(IException &e) { - QString message = e.toString(); + std::string message = e.toString(); cout << message.replace(QRegExp("in file.*/translations"), "in file [/translations"); cout << endl; cout << endl; diff --git a/isis/src/base/objs/iTime/iTime.cpp b/isis/src/base/objs/iTime/iTime.cpp index 392a85bfde..7d693be7dd 100644 --- a/isis/src/base/objs/iTime/iTime.cpp +++ b/isis/src/base/objs/iTime/iTime.cpp @@ -477,13 +477,13 @@ namespace Isis { Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory"); QString baseDir = QString::fromStdString(dataDir["Base"]); baseDir += "/kernels/lsk/"; - FileName leapSecond(baseDir + "naif????.tls"); + FileName leapSecond(baseDir.toStdString() + "naif????.tls"); QString leapSecondName; try { - leapSecondName = QString(leapSecond.highestVersion().expanded()); + leapSecondName = QString::fromStdString(leapSecond.highestVersion().expanded()); } catch (IException &e) { - QString msg = "Unable to load leadsecond file. Either the data area is not set or there are no naif####.tls files present"; + std::string msg = "Unable to load leadsecond file. Either the data area is not set or there are no naif####.tls files present"; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp index 70d286b20c..d8a6be9508 100644 --- a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp +++ b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp @@ -52,7 +52,7 @@ namespace Isis{ //Checks if in file is rdr if(label.hasObject("IMAGE_MAP_PROJECTION")) { - QString msg = "[" + in.name() + "] appears to be an rdr file."; + std::string msg = "[" + in.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -99,7 +99,7 @@ namespace Isis{ p.Progress()->SetText("Image was converted using 12-to-8 bit table. \nConverting prefix pixels back to 12 bit and saving line prefix data..."); } - Pvl inputLabel(in.expanded().toStdString()); + Pvl inputLabel(in.expanded()); if (inputLabel.hasKeyword("VALID_MAXIMUM")) { PvlKeyword labelValidMax = inputLabel.findKeyword("VALID_MAXIMUM"); if (labelValidMax[1] != "UNK") { @@ -276,7 +276,7 @@ namespace Isis{ FileName transFile(dir + "/CassiniIss.trn"); // Get the translation manager ready - Pvl inputLabel(labelFile.expanded().toStdString()); + Pvl inputLabel(labelFile.expanded()); PvlToPvlTranslationManager labelXlater(inputLabel, transFile.expanded()); // Pvl outputLabels; diff --git a/isis/src/cassini/apps/vims2isis/main.cpp b/isis/src/cassini/apps/vims2isis/main.cpp index 7a2f69d102..7dea8d1d9e 100644 --- a/isis/src/cassini/apps/vims2isis/main.cpp +++ b/isis/src/cassini/apps/vims2isis/main.cpp @@ -51,11 +51,11 @@ void IsisMain() { FileName in = ui.GetFileName("FROM"); FileName outIr = ui.GetCubeName("IR"); FileName outVis = ui.GetCubeName("VIS"); - Pvl lab(in.expanded().toStdString()); + Pvl lab(in.expanded()); //Checks if in file is rdr if(lab.hasObject("IMAGE_MAP_PROJECTION")) { - QString msg = "[" + in.name() + "] appears to be an rdr file."; + std::string msg = "[" + in.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -67,19 +67,19 @@ void IsisMain() { id = QString::fromStdString(qube["INSTRUMENT_ID"]); id = id.simplified().trimmed(); if(id != "VIMS") { - QString msg = "Invalid INSTRUMENT_ID [" + id + "]"; + std::string msg = "Invalid INSTRUMENT_ID [" + id + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } catch(IException &e) { - QString msg = "Input file [" + in.expanded() + + std::string msg = "Input file [" + in.expanded() + "] does not appear to be " + "in VIMS EDR/RDR format"; throw IException(IException::Io, msg, _FILEINFO_); } FileName tempname(in.baseName() + ".bsq.cub"); - Pvl pdsLab(in.expanded().toStdString()); + Pvl pdsLab(in.expanded()); // It's VIMS, let's figure out if it has the suffix data or not if(std::stoi(lab.findObject("QUBE")["SUFFIX_ITEMS"][0]) == 0) { @@ -214,7 +214,7 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF pixelType = Isis::UnsignedInteger; } else { - QString msg = "Invalid PixelType and BitsPerPixel combination [" + str + + std::string msg = "Invalid PixelType and BitsPerPixel combination [" + str + ", " + toString(bitsPerPixel) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -259,7 +259,7 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF Isis::FileName inFile(inFileName); fin.open(inFileName.toLatin1().data(), ios::in | ios::binary); if(!fin.is_open()) { - QString msg = "Cannot open input file [" + inFileName + "]"; + std::string msg = "Cannot open input file [" + inFileName + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -272,7 +272,7 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF // Check the last io if(!fin.good()) { - QString msg = "Cannot read file [" + inFileName + "]. Position [" + + std::string msg = "Cannot read file [" + inFileName + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -301,7 +301,7 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF fin.read(in, readBytes); if(!fin.good()) { - QString msg = "Cannot read file [" + inFileName + "]. Position [" + + std::string msg = "Cannot read file [" + inFileName + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(readBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -374,7 +374,7 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF // Check the last io if(!fin.good()) { - QString msg = "Cannot read file [" + inFileName + "]. Position [" + + std::string msg = "Cannot read file [" + inFileName + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(4) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -387,7 +387,7 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF // Check the last io if(!fin.good()) { - QString msg = "Cannot read file [" + inFileName + "]. Position [" + + std::string msg = "Cannot read file [" + inFileName + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(4 * (4 * ns + 4)) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); diff --git a/isis/src/cassini/apps/vimscal/main.cpp b/isis/src/cassini/apps/vimscal/main.cpp index 9edcef5ada..b697417198 100644 --- a/isis/src/cassini/apps/vimscal/main.cpp +++ b/isis/src/cassini/apps/vimscal/main.cpp @@ -147,7 +147,7 @@ void IsisMain() { } catch(IException &e) { - QString msg = "The label for the input cube [" + QString(ui.GetAsString("FROM")) + + std::string msg = "The label for the input cube [" + QString(ui.GetAsString("FROM")) + "] does not have a start time in the Instrument group."; throw IException(IException::User,msg,_FILEINFO_); @@ -159,13 +159,13 @@ void IsisMain() { if(!isVims) { - QString msg = "The input cube [" + QString(ui.GetAsString("FROM")) + + std::string msg = "The input cube [" + QString(ui.GetAsString("FROM")) + "] is not a Cassini VIMS cube"; throw IException(IException::User, msg, _FILEINFO_); } if(icube->label()->findObject("IsisCube").hasGroup("AlphaCube")) { - QString msg = "The input cube [" + QString(ui.GetAsString("FROM")) + std::string msg = "The input cube [" + QString(ui.GetAsString("FROM")) + "] has had its dimensions modified and can not be calibrated"; throw IException(IException::User, msg, _FILEINFO_); } @@ -327,7 +327,7 @@ void calculateSolarRemove(Cube *icube, ProcessByLine *p) { cam = icube->camera(); } catch(IException &e) { - QString msg = "Unable to create a camera model from [" + + std::string msg = "Unable to create a camera model from [" + icube->fileName() + "]. Please run " "spiceinit on this file"; throw IException(e, IException::Unknown, msg, _FILEINFO_); @@ -382,7 +382,7 @@ void calculateSolarRemove(Cube *icube, ProcessByLine *p) { if(solarRemoveCoefficient < 0) { solarRemoveCoefficient = 81.595089; /* - QString msg = "Unable to project image at four corners, center of edges or "; + std::string msg = "Unable to project image at four corners, center of edges or "; msg += "at center. The solar distance can not be calculated, try using"; msg += " [UNITS=SPECENERGY] on ["; msg += icube->FileName() + "]"; @@ -431,7 +431,7 @@ void loadCalibrationValues() { calibFile = calibFile.highestVersion(); //Pvl configFile; - g_configFile.read(calibFile.expanded().toStdString()); + g_configFile.read(calibFile.expanded()); PvlGroup &multipliers = g_configFile.findGroup("CalibrationMultipliers"); calVersion = QString::fromStdString(multipliers["version"]); @@ -793,7 +793,7 @@ void calculateVisDarkCurrent(Cube *icube) { if(fread(&calData, sizeof(calData), 1, calFilePtr) != 1) { // error! - QString msg = "Error reading file [" + calFile + "]"; + std::string msg = "Error reading file [" + calFile + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1105,7 +1105,7 @@ void GetOffsets(const Pvl &lab, int &finalSampOffset, int &finalLineOffset) { finalLineOffset = (3 * (lineOffset + swathLength / 2)) - swathLength / 2; } else { - QString msg = "Unsupported sampling mode [" + samplingMode + "]"; + std::string msg = "Unsupported sampling mode [" + samplingMode + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -1119,11 +1119,11 @@ void GetOffsets(const Pvl &lab, int &finalSampOffset, int &finalLineOffset) { finalLineOffset = lineOffset - 1; } else if(samplingMode == "NYQUIST") { - QString msg = "Cannot process NYQUIST (undersampled) mode "; + std::string msg = "Cannot process NYQUIST (undersampled) mode "; throw IException(IException::Unknown, msg, _FILEINFO_); } else { - QString msg = "Unsupported sampling mode [" + samplingMode + "]"; + std::string msg = "Unsupported sampling mode [" + samplingMode + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/cassini/objs/CisscalFile/CisscalFile.cpp b/isis/src/cassini/objs/CisscalFile/CisscalFile.cpp index bb596464e2..6f67cf9126 100644 --- a/isis/src/cassini/objs/CisscalFile/CisscalFile.cpp +++ b/isis/src/cassini/objs/CisscalFile/CisscalFile.cpp @@ -75,7 +75,7 @@ namespace Isis { // See if an error occured if(!p_stream.good()) { line = ""; - QString message = "TextFile:GetLine: -> Error reading text file: [" + std::string message = "TextFile:GetLine: -> Error reading text file: [" + p_filename + "]"; throw IException(IException::Io, message, _FILEINFO_); } diff --git a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp index c930937f09..9346a65398 100644 --- a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp +++ b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp @@ -85,7 +85,7 @@ namespace Isis { FileName in = ui.GetFileName("FROM"); - Pvl pdsLabel(in.expanded().toStdString()); + Pvl pdsLabel(in.expanded()); if (fileType == (ProcessImportPds::L0 | ProcessImportPds::Rdn)) { // Is this a L0 or L1B product? if ((std::string) pdsLabel["PRODUCT_TYPE"] == "RAW_IMAGE") { @@ -101,7 +101,7 @@ namespace Isis { importPds.SetPdsFile(in.expanded(), "", pdsLabel, fileType); } catch(IException &e) { - QString msg = "Input file [" + in.expanded() + + std::string msg = "Input file [" + in.expanded() + "] does not appear to be a Chandrayaan 1 M3 detached PDS label"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -178,7 +178,7 @@ namespace Isis { (firstEt - g_expectedLineRate / 2.0)) / g_expectedLineRate; } else { - QString msg = "Input file [" + in.expanded() + + std::string msg = "Input file [" + in.expanded() + "] does not appear to have any records in the UTC_FILE table"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/clementine/apps/clem2isis/main.cpp b/isis/src/clementine/apps/clem2isis/main.cpp index dd027253f9..2d4a5a8d49 100755 --- a/isis/src/clementine/apps/clem2isis/main.cpp +++ b/isis/src/clementine/apps/clem2isis/main.cpp @@ -40,18 +40,18 @@ void IsisMain() { // Make sure it is a Clementine EDR bool projected; try { - Pvl lab(in.expanded().toStdString()); + Pvl lab(in.expanded()); projected = lab.hasObject("IMAGE_MAP_PROJECTION"); QString id; id = QString::fromStdString(lab["DATA_SET_ID"]); id = id.simplified().trimmed(); if (!id.contains("CLEM")) { - QString msg = "Invalid DATA_SET_ID [" + id + "]"; + std::string msg = "Invalid DATA_SET_ID [" + id + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } catch(IException &e) { - QString msg = "Input file [" + in.expanded() + + std::string msg = "Input file [" + in.expanded() + "] does not appear to be " + "in Clementine EDR format"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -59,7 +59,7 @@ void IsisMain() { //Checks if in file is rdr if (projected) { - QString msg = "[" + in.name() + "] appears to be an rdr file."; + std::string msg = "[" + in.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -110,7 +110,7 @@ void translateLabels(FileName in, Cube *ocube) { QString transDir = "$ISISROOT/appdata/translations/"; FileName transFile(transDir + "Clementine.trn"); - Pvl pdsLab(in.expanded().toStdString()); + Pvl pdsLab(in.expanded()); PvlToPvlTranslationManager labelXlater(pdsLab, transFile.expanded()); // Pvl outputLabels; diff --git a/isis/src/clementine/apps/clemhirescal/main.cpp b/isis/src/clementine/apps/clemhirescal/main.cpp index 85a59de443..19391d5cee 100644 --- a/isis/src/clementine/apps/clemhirescal/main.cpp +++ b/isis/src/clementine/apps/clemhirescal/main.cpp @@ -35,7 +35,7 @@ void IsisMain() { Pvl *label = input->label(); QString wave = QString::fromStdString(label->findGroup("BandBin", Pvl::Traverse)["FilterName"]); if((wave != "A") && (wave != "B") && (wave != "C") && (wave != "D")) { - QString message = "Invalid FilterName [" + wave + "], can only handle A-D filters"; + std::string message = "Invalid FilterName [" + wave + "], can only handle A-D filters"; throw IException(IException::Unknown, message, _FILEINFO_); } // Determine and load calibration flat field file @@ -48,7 +48,7 @@ void IsisMain() { // Check the offset mode for validity int index = label->findGroup("Instrument", Pvl::Traverse)["OffsetModeID"]; if(index < 0 || index > 5) { - QString message = "Invalid OffsetModeID, can only handle offests 0-5"; + std::string message = "Invalid OffsetModeID, can only handle offests 0-5"; throw IException(IException::Unknown, message, _FILEINFO_); } @@ -76,7 +76,7 @@ void IsisMain() { } // Other filters not supported for calculated K value else { - QString message = "Image is of filter [" + wave + "], not supported type A or D, enter your own K value"; + std::string message = "Image is of filter [" + wave + "], not supported type A or D, enter your own K value"; throw IException(IException::User, message, _FILEINFO_); } } diff --git a/isis/src/clipper/apps/eis2isis/eis2isis.cpp b/isis/src/clipper/apps/eis2isis/eis2isis.cpp index 95eb47d418..4041e588e4 100644 --- a/isis/src/clipper/apps/eis2isis/eis2isis.cpp +++ b/isis/src/clipper/apps/eis2isis/eis2isis.cpp @@ -54,7 +54,7 @@ namespace Isis { p.SetInputFile(xmlFileName.removeExtension().addExtension("dat").expanded()); } else { - QString msg = "Cannot find image file for [" + xmlFileName.name() + "]. Confirm the " + std::string msg = "Cannot find image file for [" + xmlFileName.name() + "]. Confirm the " ".dat file for this XML exists and is located in the same directory."; throw IException(IException::User, msg, _FILEINFO_); } @@ -103,7 +103,7 @@ namespace Isis { kerns += PvlKeyword("NaifFrameCode", std::to_string(-159102)); } else { - QString msg = "Input file [" + xmlFileName.expanded() + "] has an invalid " + + std::string msg = "Input file [" + xmlFileName.expanded() + "] has an invalid " + "InstrumentId."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -114,7 +114,7 @@ namespace Isis { } catch (IException &e) { - QString msg = "Given file [" + xmlFileName.expanded() + "] does not appear to be a valid " + std::string msg = "Given file [" + xmlFileName.expanded() + "] does not appear to be a valid " "Clipper EIS label or associated line times files are not provided."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -257,7 +257,7 @@ namespace Isis { // the camera object to be able to handle when a table does not exist and // this will be able to be refactored to not require a line times file. else { - QString msg = "This image appears to be a Narrow Angle Rolling Shutter Camera. " + std::string msg = "This image appears to be a Narrow Angle Rolling Shutter Camera. " "You must provide the line times file associated with [" + xmlFileName.name() + "] as the [MAINREADOUT] parameter."; throw IException(IException::User, msg, _FILEINFO_); @@ -279,7 +279,7 @@ namespace Isis { .expanded()); } else { - QString msg = "Cannot find image file for [" + checklineXmlFileName.name() + "]. Confirm the " + std::string msg = "Cannot find image file for [" + checklineXmlFileName.name() + "]. Confirm the " ".dat file for this XML exists and is located in the same directory."; throw IException(IException::User, msg, _FILEINFO_); } @@ -317,7 +317,7 @@ namespace Isis { // Since the checkline cube is not worth anything without the associated // times, require that the line times for the checkline cube be provided. else { - QString msg = "Must provide the line times file associated with [" + checklineXmlFileName.name() + "] as the [CHECKLINEREADOUT] parameter."; + std::string msg = "Must provide the line times file associated with [" + checklineXmlFileName.name() + "] as the [CHECKLINEREADOUT] parameter."; throw IException(IException::User, msg, _FILEINFO_); } @@ -340,7 +340,7 @@ namespace Isis { // Number of lines provided must match number of rows in csv file if (numLines != csv.rows()) { - QString msg = "Readout table [" + file.expanded() + + std::string msg = "Readout table [" + file.expanded() + "] does not have the same number of lines as the image"; throw IException(IException::User, msg, _FILEINFO_); } @@ -400,7 +400,7 @@ namespace Isis { // Number of lines provided must match number of rows in csv file if (numLines != csv.rows()) { - QString msg = "Readout table [" + file.expanded() + + std::string msg = "Readout table [" + file.expanded() + "] does not have the same number of lines as the image"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp b/isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp index 3e37ca71ad..02eb837431 100644 --- a/isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp +++ b/isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp @@ -137,7 +137,7 @@ namespace Isis { Table timesTable("LineScanTimes", filename); if(timesTable.Records() <= 0) { - QString msg = "Table [LineScanTimes] in ["; + std::string msg = "Table [LineScanTimes] in ["; msg += filename + "] must not be empty"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -149,7 +149,7 @@ namespace Isis { } if(p_lineRates.size() <= 0) { - QString msg = "There is a problem with the data within the Table "; + std::string msg = "There is a problem with the data within the Table "; msg += "[LineScanTimes] in [" + filename + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/autoseed/autoseed.cpp b/isis/src/control/apps/autoseed/autoseed.cpp index d882e8c37f..602732654e 100644 --- a/isis/src/control/apps/autoseed/autoseed.cpp +++ b/isis/src/control/apps/autoseed/autoseed.cpp @@ -199,7 +199,7 @@ namespace Isis { map gMaps; for (int sn = 0; sn < serialNumbers.size(); ++sn) { // Create the UGM for the cube associated with this SN - Cube cube(serialNumbers.fileName(sn), "r"); + Cube cube(serialNumbers.fileName(sn).toStdString(), "r"); gMaps.insert(std::pair (serialNumbers.serialNumber(sn), new UniversalGroundMap(cube))); } @@ -223,7 +223,7 @@ namespace Isis { ControlPoint *cp = precnet->GetPoint(i); ControlMeasure *cm = cp->GetRefMeasure(); QString c = serialNumbers.fileName(cm->GetCubeSerialNumber()); - Cube cube(c); + Cube cube(c.toStdString()); Camera *cam = CameraFactory::Create(cube); cam->SetImage(cm->GetSample(), cm->GetLine()); @@ -361,7 +361,7 @@ namespace Isis { UniversalGroundMap *gmap = gMaps[(*overlaps[ov])[sn]]; if (!gmap) { - QString msg = "Unable to create a Universal Ground for Serial Number ["; + std::string msg = "Unable to create a Universal Ground for Serial Number ["; msg += (*overlaps[ov])[sn] + "] The associated image is more than "; msg += "likely missing from your FROMLIST."; throw IException(IException::User, msg, _FILEINFO_); @@ -455,7 +455,7 @@ namespace Isis { //Log the ERRORS file if (ui.WasEntered("ERRORS") && errorNum > 0) { - QString errorname = ui.GetFileName("ERRORS"); + std::string errorname = ui.GetFileName("ERRORS"); std::ofstream errorsfile; errorsfile.open(errorname.toLatin1().data()); errorsfile << errors.str(); @@ -464,7 +464,7 @@ namespace Isis { // Make sure the control network is not empty if (cnet.GetNumPoints() == 0) { - QString msg = "The ouput control network is empty. This is likely due"; + std::string msg = "The ouput control network is empty. This is likely due"; msg += " to the input cubes failing to overlap."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/cnet2dem/DatumFunctoid.cpp b/isis/src/control/apps/cnet2dem/DatumFunctoid.cpp index 669352b83b..ce0e278161 100644 --- a/isis/src/control/apps/cnet2dem/DatumFunctoid.cpp +++ b/isis/src/control/apps/cnet2dem/DatumFunctoid.cpp @@ -72,7 +72,7 @@ DatumFunctoidList DatumFunctoidFactory::create(const QString &specs, // cout << "create: got " << algorithms.size() << " algorithms...\n"; if ( algorithms.size() == 0 ) { if ( errorIfEmpty ) { - QString mess = "No functoid algorithm specifictions found!"; + std::string mess = "No functoid algorithm specifictions found!"; throw IException(IException::User, mess, _FILEINFO_); } return ( functoids ); @@ -83,7 +83,7 @@ DatumFunctoidList DatumFunctoidFactory::create(const QString &specs, BOOST_FOREACH ( QString functoid, algorithms ) { SharedDatumFunctoid f( make(functoid) ); if ( f.isNull() ) { - QString mess = "Algorithm \"" + functoid + "\" was not found!"; + std::string mess = "Algorithm \"" + functoid + "\" was not found!"; ie.append(IException(IException::User, mess, _FILEINFO_)); nerrors++; } @@ -140,7 +140,7 @@ PvlFlatMap DatumFunctoidFactory::parseParameters(const QString ¶meters) // Is it valid? QStringList parmvaltag = specs.split(":"); if ( 2 != parmvaltag.size() ) { - QString mess = "Invalid parameter at or near [" + specs + "] in \"" + + std::string mess = "Invalid parameter at or near [" + specs + "] in \"" + parameters + "\" - must be of the form " "\"name@parm1:value1@parm2:value2...\""; throw IException(IException::User, mess, _FILEINFO_); diff --git a/isis/src/control/apps/cnet2dem/main.cpp b/isis/src/control/apps/cnet2dem/main.cpp index 6f0b79fd58..56d078eca6 100644 --- a/isis/src/control/apps/cnet2dem/main.cpp +++ b/isis/src/control/apps/cnet2dem/main.cpp @@ -162,7 +162,7 @@ void IsisMain() { // Ok, if we end up with one net, it must have been entered in CNETBASE. if ( (cnetfiles.size() < 1) ) { - QString mess = "Must enter a control net inc CNET or a list in CNETLIST"; + std::string mess = "Must enter a control net inc CNET or a list in CNETLIST"; throw IException(IException::User, mess, _FILEINFO_); } // Create the point cloud container and load the control networks diff --git a/isis/src/control/apps/cnet2mat/main.cpp b/isis/src/control/apps/cnet2mat/main.cpp index 48d350ddd5..8bfcdcffcf 100644 --- a/isis/src/control/apps/cnet2mat/main.cpp +++ b/isis/src/control/apps/cnet2mat/main.cpp @@ -51,7 +51,7 @@ void IsisMain() { fsc = QString::fromStdString(qube.findKeyword("IMAGE_ID")[0]); } else { - QString msg = "Unable to find keyword [\"IMAGE_NUMBER\" or \"IMAGE_ID\"] in file ["; + std::string msg = "Unable to find keyword [\"IMAGE_NUMBER\" or \"IMAGE_ID\"] in file ["; msg += fsc + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/cnetadd/main.cpp b/isis/src/control/apps/cnetadd/main.cpp index 550a11a836..4a5697341c 100644 --- a/isis/src/control/apps/cnetadd/main.cpp +++ b/isis/src/control/apps/cnetadd/main.cpp @@ -110,7 +110,7 @@ void IsisMain() { // Check for duplicate SNs within the addlist for (int j = i + 1; j < addSerials.size(); j++) { if (addSerials.serialNumber(i) == addSerials.serialNumber(j)) { - QString msg = "Add list files [" + addSerials.fileName(i) + "] and ["; + std::string msg = "Add list files [" + addSerials.fileName(i) + "] and ["; msg += addSerials.fileName(j) + "] share the same serial number."; throw IException(IException::User, msg, _FILEINFO_); } @@ -127,7 +127,7 @@ void IsisMain() { SurfacePoint surfacePoint = point->GetBestSurfacePoint(); if (!surfacePoint.Valid()) { - QString msg = "Unable to retreive lat/lon from Control Point ["; + std::string msg = "Unable to retreive lat/lon from Control Point ["; msg += point->GetId() + "]. RETREIVAL=POINT cannot be used unless "; msg += "all Control Points have Latitude/Longitude keywords."; throw IException(IException::User, msg, _FILEINFO_); @@ -278,7 +278,7 @@ void IsisMain() { results.addKeyword(duplicates); } - results.write(logFile.expanded().toStdString()); + results.write(logFile.expanded()); } // List the modified points @@ -383,7 +383,7 @@ void setControlPointLatLon(SerialNumberList &snl, ControlNet &cnet) { g_surfacePoints[point->GetId()] = cube->camera()->GetSurfacePoint(); } catch (IException &e) { - QString msg = "Unable to create camera for cube file ["; + std::string msg = "Unable to create camera for cube file ["; msg += snl.fileName(cm->GetCubeSerialNumber()) + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/cnetcheck/cnetcheck.cpp b/isis/src/control/apps/cnetcheck/cnetcheck.cpp index e6870a934b..9f0806ebe1 100644 --- a/isis/src/control/apps/cnetcheck/cnetcheck.cpp +++ b/isis/src/control/apps/cnetcheck/cnetcheck.cpp @@ -81,7 +81,7 @@ namespace Isis { */ QString cnetcheck(UserInterface &ui, Pvl *log) { ControlNet innet(ui.GetFileName("CNET")); - FileList inlist(ui.GetFileName("FROMLIST")); + FileList inlist(ui.GetFileName("FROMLIST").toStdString()); return cnetcheck(innet, inlist, ui, log); } @@ -127,8 +127,8 @@ namespace Isis { } for (int index = 0; index < inlist.size(); index++) { - num2cube.add(inlist[index].toString()); - QString st = num2cube.serialNumber(inlist[index].toString()); + num2cube.add(QString::fromStdString(inlist[index].toString())); + QString st = num2cube.serialNumber(QString::fromStdString(inlist[index].toString())); inListNums.insert(st); listedSerialNumbers.push_back(st); // Used with nonListedSerialNumbers progress.CheckStatus(); @@ -232,7 +232,7 @@ namespace Isis { // Islands that have no cubes listed in the input list will // not be shown. for (int i = 0; i < (int)islands.size(); i++) { - QString name(FileName(prefix + "Island." + toString(i + 1)).expanded()); + QString name(QString::fromStdString(FileName(prefix.toStdString() + "Island." + std::to_string(i + 1)).expanded())); ofstream out_stream; out_stream.open(name.toLatin1().data(), std::ios::out); out_stream.seekp(0, std::ios::beg); //Start writing from beginning of file @@ -258,7 +258,7 @@ namespace Isis { PvlGroup results("Results"); - QString networkName = ui.WasEntered("CNET") ? FileName(ui.GetFileName("CNET")).name() : innet.GetNetworkId(); + QString networkName = ui.WasEntered("CNET") ? QString::fromStdString(FileName(ui.GetFileName("CNET").toStdString()).name()) : innet.GetNetworkId(); stringstream ss(stringstream::in | stringstream::out); @@ -281,8 +281,8 @@ namespace Isis { results.addKeyword( PvlKeyword("SingleMeasure", std::to_string((BigInt)singleMeasureSerialNumbers.size()))); - QString name(FileName(prefix + "SinglePointCubes.txt").expanded()); - writeOutput(num2cube, name, + std::string name(FileName(prefix.toStdString() + "SinglePointCubes.txt").expanded()); + writeOutput(num2cube, QString::fromStdString(name), singleMeasureSerialNumbers, singleMeasureControlPoints); int serials = singleMeasureSerialNumbers.size(); @@ -299,8 +299,8 @@ namespace Isis { results.addKeyword( PvlKeyword("NoLatLonCubes", std::to_string((BigInt)noLatLonSerialNumbers.size()))); - QString name(FileName(prefix + "NoLatLon.txt").expanded()); - writeOutput(num2cube, name, + std::string name(FileName(prefix.toStdString() + "NoLatLon.txt").expanded()); + writeOutput(num2cube, QString::fromStdString(name), noLatLonSerialNumbers, noLatLonControlPoints); ss << "----------------------------------------" \ @@ -319,9 +319,9 @@ namespace Isis { QList< QString > netSerials = innet.GetCubeSerials(); if (netSerials.size() > 0) { - QString name(FileName(prefix + coverageOp + ".txt").expanded()); + std::string name(FileName(prefix.toStdString() + coverageOp.toStdString() + ".txt").expanded()); ofstream out_stream; - out_stream.open(name.toLatin1().data(), std::ios::out); + out_stream.open(name.c_str(), std::ios::out); out_stream.seekp(0, std::ios::beg); // Start writing from file beginning double tolerance = ui.GetDouble("TOLERANCE"); @@ -361,7 +361,7 @@ namespace Isis { if (ui.GetBoolean("NOCONTROL") && !inListNums.empty()) { results.addKeyword(PvlKeyword("NoControl", std::to_string((BigInt)inListNums.size()))); - QString name(FileName(prefix + "NoControl.txt").expanded()); + QString name(QString::fromStdString(FileName(prefix.toStdString() + "NoControl.txt").expanded())); ofstream out_stream; out_stream.open(name.toLatin1().data(), std::ios::out); out_stream.seekp(0, std::ios::beg); //Start writing from beginning of file @@ -376,10 +376,10 @@ namespace Isis { ss << "----------------------------------------" \ "----------------------------------------" << endl; ss << "There are " << inListNums.size(); - ss << " cubes in the input list [" << FileName(ui.GetFileName("FROMLIST")).name(); + ss << " cubes in the input list [" << FileName(ui.GetFileName("FROMLIST").toStdString()).name(); ss << "] which do not exist or are ignored in the Control Network ["; ss << networkName << "]" << endl; - ss << "These cubes are listed in [" + FileName(name).name() + "]" << endl; + ss << "These cubes are listed in [" + FileName(name.toStdString()).name() + "]" << endl; } // In addition, nonListedSerialNumbers should be the SerialNumbers of @@ -389,7 +389,7 @@ namespace Isis { results.addKeyword( PvlKeyword("NoCube", std::to_string((BigInt)nonListedSerialNumbers.size()))); - QString name(FileName(prefix + "NoCube.txt").expanded()); + QString name(QString::fromStdString(FileName(prefix.toStdString() + "NoCube.txt").expanded())); ofstream out_stream; out_stream.open(name.toLatin1().data(), std::ios::out); out_stream.seekp(0, std::ios::beg); //Start writing from beginning of file @@ -409,9 +409,9 @@ namespace Isis { ss << " serial numbers in the Control Net ["; ss << networkName; ss << "] \nwhich do not exist in the input list ["; - ss << FileName(ui.GetFileName("FROMLIST")).name() << "]" << endl; + ss << FileName(ui.GetFileName("FROMLIST").toStdString()).name() << "]" << endl; ss << "These serial numbers are listed in ["; - ss << FileName(name).name() + "]" << endl; + ss << FileName(name.toStdString()).name() + "]" << endl; } // At this point cubeMeasureCount should be equal to the number of @@ -430,9 +430,9 @@ namespace Isis { results.addKeyword( PvlKeyword("SingleCube", std::to_string((BigInt)singleMeasureCubes.size()))); - QString name(FileName(prefix + "SingleCube.txt").expanded()); + std::string name(FileName(prefix.toStdString() + "SingleCube.txt").expanded()); ofstream out_stream; - out_stream.open(name.toLatin1().data(), std::ios::out); + out_stream.open(name.c_str(), std::ios::out); out_stream.seekp(0, std::ios::beg); //Start writing from beginning of file for (set::iterator sn = singleMeasureCubes.begin(); @@ -661,7 +661,7 @@ namespace Isis { QString buildRow(SerialNumberList &serials, QString sn) { QString cubeName = serials.hasSerialNumber(sn) ? - FileName(serials.fileName(sn)).expanded() : "UnknownFilename"; + QString::fromStdString(FileName(serials.fileName(sn).toStdString()).expanded()) : "UnknownFilename"; return cubeName + g_delimiter + sn; } diff --git a/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp b/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp index 6123cc1aa4..d083143728 100644 --- a/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp +++ b/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp @@ -108,16 +108,16 @@ namespace Isis{ int nList(0); if ( ui.WasEntered("CNETLIST") ) { - FileList list_o_nets(ui.GetFileName("CNETLIST")); + FileList list_o_nets(ui.GetFileName("CNETLIST").toStdString()); if (list_o_nets.size() < 1) { - QString mess = "The file provided for CNETLIST, ["; + std::string mess = "The file provided for CNETLIST, ["; mess += ui.GetAsString("CNETLIST"); mess += "] is empty."; throw IException(IException::User, mess, _FILEINFO_); } BOOST_FOREACH ( FileName cfile, list_o_nets ) { - cnetfiles.append( cfile.original() ); + cnetfiles.append(QString::fromStdString(cfile.original())); nList++; } } @@ -125,7 +125,7 @@ namespace Isis{ // Check for any files at all int totalNetFiles = nBase + nFrom + nList; if ( totalNetFiles <= 0 ) { - QString mess = "No input networks files provided!"; + std::string mess = "No input networks files provided!"; throw IException(IException::User, mess, _FILEINFO_); } @@ -205,11 +205,11 @@ namespace Isis{ // Now write out the list of SNs if requested if ( ui.WasEntered("TOSN") ) { - FileName filename( ui.GetFileName("TOSN") ); - QFile logfile(filename.expanded()); + FileName filename(ui.GetFileName("TOSN").toStdString()); + QFile logfile(QString::fromStdString(filename.expanded())); if ( !logfile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text | QIODevice::Unbuffered) ) { - QString mess = "Unable to open/create serial number file " + filename.name(); + std::string mess = "Unable to open/create serial number file " + filename.name(); throw IException(IException::User, mess, _FILEINFO_); } @@ -465,11 +465,11 @@ namespace Isis{ // Write out the merge log if (logMerges) { - FileName mergeLogFileName( ui.GetFileName("LOGFILE") ); - QFile mergeLogfile(mergeLogFileName.expanded()); + FileName mergeLogFileName(ui.GetFileName("LOGFILE").toStdString()); + QFile mergeLogfile(QString::fromStdString(mergeLogFileName.expanded())); if ( !mergeLogfile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text | QIODevice::Unbuffered) ) { - QString mess = "Unable to open/create merge log file " + mergeLogFileName.name(); + std::string mess = "Unable to open/create merge log file " + mergeLogFileName.name(); throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/cnetdiff/cnetdiff.cpp b/isis/src/control/apps/cnetdiff/cnetdiff.cpp index eedc49f165..457ad08198 100644 --- a/isis/src/control/apps/cnetdiff/cnetdiff.cpp +++ b/isis/src/control/apps/cnetdiff/cnetdiff.cpp @@ -116,8 +116,8 @@ namespace Isis { return log; } else { // do full report - FileName fileName1(ui.GetFileName("FROM")); - FileName fileName2(ui.GetFileName("FROM2")); + FileName fileName1(ui.GetFileName("FROM").toStdString()); + FileName fileName2(ui.GetFileName("FROM2").toStdString()); ControlNetDiff differencer; if (diffFile != nullptr) { @@ -213,7 +213,7 @@ namespace Isis { void Compare(const PvlObject &point1Pvl, const PvlObject &point2Pvl) { // both names must be at least equal, should be named ControlPoint if (point1Pvl.name() != point2Pvl.name()) { - QString msg = "The control points' CreatePvlOject method returned an " + std::string msg = "The control points' CreatePvlOject method returned an " "unexpected result."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -296,7 +296,7 @@ namespace Isis { */ void CompareKeywords(const PvlKeyword &pvl1, const PvlKeyword &pvl2) { if (pvl1.name().compare(pvl2.name()) != 0) { - QString msg = "CompareKeywords should always be called with keywords that " + std::string msg = "CompareKeywords should always be called with keywords that " "have the same name."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -310,7 +310,7 @@ namespace Isis { if (tolerances.hasKeyword(pvl1.name()) && tolerances[pvl1.name()].size() > 1 && pvl1.size() != tolerances[pvl1.name()].size()) { - QString msg = "Size of value '" + QString::fromStdString(pvl1.name()) + "' does not match with "; + std::string msg = "Size of value '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of tolerances in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); } @@ -318,7 +318,7 @@ namespace Isis { if (ignorekeys.hasKeyword(pvl1.name()) && ignorekeys[pvl1.name()].size() > 1 && pvl1.size() != ignorekeys[pvl1.name()].size()) { - QString msg = "Size of value '" + QString::fromStdString(pvl1.name()) + "' does not match with "; + std::string msg = "Size of value '" + QString::fromStdString(pvl1.name()) + "' does not match with "; msg += "its number of ignore keys in the DIFF file."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/cnetedit/cnetedit.cpp b/isis/src/control/apps/cnetedit/cnetedit.cpp index ca3170b450..e7499302f6 100644 --- a/isis/src/control/apps/cnetedit/cnetedit.cpp +++ b/isis/src/control/apps/cnetedit/cnetedit.cpp @@ -113,7 +113,7 @@ namespace Isis { // List of IDs mapping to points to be edited ControlPointList *cpList = nullptr; if (ui.WasEntered("POINTLIST") && cnet.GetNumPoints() > 0) { - cpList = new ControlPointList(ui.GetFileName("POINTLIST")); + cpList = new ControlPointList(ui.GetFileName("POINTLIST").toStdString()); } // Serial number list of cubes to be edited @@ -128,7 +128,7 @@ namespace Isis { QFile file(ui.GetFileName("MEASURELIST")); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QString msg = "Unable to open MEASURELIST [" + + std::string msg = "Unable to open MEASURELIST [" + file.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -141,7 +141,7 @@ namespace Isis { QString line = in.readLine(); QStringList results = line.split(","); if (results.size() < 2) { - QString msg = "Line " + QString::number(lineNumber) + " in the MEASURELIST does " + std::string msg = "Line " + QString::number(lineNumber) + " in the MEASURELIST does " "not contain a Point ID and a cube filename separated by a comma"; throw IException(IException::User, msg, _FILEINFO_); } @@ -149,8 +149,8 @@ namespace Isis { if (!editMeasuresList->contains(results[0])) editMeasuresList->insert(results[0], new QSet); - FileName cubeName(results[1]); - QString sn = SerialNumber::Compose(cubeName.expanded()); + FileName cubeName(results[1].toStdString()); + QString sn = SerialNumber::Compose(QString::fromStdString(cubeName.expanded())); (*editMeasuresList)[results[0]]->insert(sn); lineNumber++; @@ -950,7 +950,7 @@ namespace Isis { Camera *camera = NULL; if (cneteditValidator->IsCubeRequired()) { if (!serialNumbers->hasSerialNumber(serialNumber)) { - QString msg = "Serial Number [" + serialNumber + "] contains no "; + std::string msg = "Serial Number [" + serialNumber + "] contains no "; msg += "matching cube in FROMLIST"; throw IException(IException::User, msg, _FILEINFO_); } @@ -963,7 +963,7 @@ namespace Isis { camera = cube->camera(); } catch (IException &e) { - QString msg = "Cannot Create Camera for Image:" + cube->fileName(); + std::string msg = "Cannot Create Camera for Image:" + cube->fileName(); throw IException(e, IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/control/apps/cnetextract/cnetextract.cpp b/isis/src/control/apps/cnetextract/cnetextract.cpp index d54922f474..c30337628b 100644 --- a/isis/src/control/apps/cnetextract/cnetextract.cpp +++ b/isis/src/control/apps/cnetextract/cnetextract.cpp @@ -40,7 +40,7 @@ namespace Isis { // Main program void cnetextract(ControlNet outNet, UserInterface &ui, Pvl *log) { if(!ui.WasEntered("FROMLIST") && ui.WasEntered("TOLIST")) { - QString msg = "To create a [TOLIST] the [FROMLIST] parameter must be provided."; + std::string msg = "To create a [TOLIST] the [FROMLIST] parameter must be provided."; throw IException(IException::User, msg, _FILEINFO_); } @@ -60,7 +60,7 @@ namespace Isis { if(!(noIgnore || noMeasureless || noSingleMeasure || editLocked || reference || fixed || noTolerancePoints || pointsEntered || cubePoints || constrained || latLon)) { - QString msg = "At least one filter must be selected ["; + std::string msg = "At least one filter must be selected ["; msg += "NOIGNORE,NOMEASURELESS,NOSINGLEMEASURE,REFERENCE,FIXED,CONSTRAINED,EDITLOCKED,TOLERANCE,"; msg += "POINTLIST,CUBES,LATLON]"; throw IException(IException::User, msg, _FILEINFO_); @@ -73,7 +73,7 @@ namespace Isis { FileList inList; if(ui.WasEntered("FROMLIST")) { //inList = ui.GetFileName("FROMLIST"); - inList.read(ui.GetFileName("FROMLIST")); + inList.read(ui.GetFileName("FROMLIST").toStdString()); } int inputPoints = outNet.GetNumPoints(); @@ -84,8 +84,8 @@ namespace Isis { // Set up the Serial Number to FileName mapping QMap sn2filename; for(int cubeIndex = 0; cubeIndex < (int)inList.size(); cubeIndex ++) { - QString sn = SerialNumber::Compose(inList[cubeIndex].toString()); - sn2filename[sn] = inList[cubeIndex].toString(); + QString sn = SerialNumber::Compose(QString::fromStdString(inList[cubeIndex].toString())); + sn2filename[sn] = QString::fromStdString(inList[cubeIndex].toString()); } @@ -117,9 +117,9 @@ namespace Isis { // Set up comparison data QVector serialNumbers; if(cubePoints) { - FileList cubeList(ui.GetFileName("CUBELIST")); + FileList cubeList(ui.GetFileName("CUBELIST").toStdString()); for(int cubeIndex = 0; cubeIndex < (int)cubeList.size(); cubeIndex ++) { - QString sn = SerialNumber::Compose(cubeList[cubeIndex].toString()); + QString sn = SerialNumber::Compose(QString::fromStdString(cubeList[cubeIndex].toString())); serialNumbers.push_back(sn); } } @@ -189,7 +189,7 @@ namespace Isis { if(noIgnore && newMeasure->IsIgnored()) { //New error with deleting Reference Measures - QString msg = newPoint->GetId() + "," + newMeasure->GetCubeSerialNumber(); + std::string msg = newPoint->GetId() + "," + newMeasure->GetCubeSerialNumber(); if(newPoint->GetRefMeasure() != newMeasure) { omit(newPoint, cm); } @@ -215,7 +215,7 @@ namespace Isis { // doesn't have serial number if measure is not associated with cubelist // we need to omit appropriate measures if(!hasSerialNumber) { - QString msg = newPoint->GetId() + "," + newMeasure->GetCubeSerialNumber(); + std::string msg = newPoint->GetId() + "," + newMeasure->GetCubeSerialNumber(); // if this measure is not reference, omit it // if this measure is a reference, but retainReference is off, omit it if(newPoint->GetRefMeasure() != newMeasure || @@ -297,7 +297,7 @@ namespace Isis { // Use another pass to check for Ids if(pointsEntered) { - ExtractPointList(outNet, nonListedPoints, ui.GetFileName("POINTLIST")); + ExtractPointList(outNet, nonListedPoints, ui.GetFileName("POINTLIST").toStdString()); } @@ -330,7 +330,7 @@ namespace Isis { if (outputPoints != 0) { // Write the filenames associated with outNet if (ui.WasEntered("TOLIST") ) { - WriteCubeOutList(outNet, sn2filename, summary, ui.GetFileName("TOLIST")); + WriteCubeOutList(outNet, sn2filename, summary, ui.GetFileName("TOLIST").toStdString()); } outProgress.SetText("Writing Control Network"); @@ -418,52 +418,52 @@ namespace Isis { QString prefix = ui.GetString("PREFIX"); if(noIgnore) { - QString namecp = FileName(prefix + "IgnoredPoints.txt").expanded(); + QString namecp = QString::fromStdString(FileName(prefix.toStdString() + "IgnoredPoints.txt").expanded()); WriteResults(namecp, ignoredPoints, results); - QString namecm = FileName(prefix + "IgnoredMeasures.txt").expanded(); + QString namecm = QString::fromStdString(FileName(prefix.toStdString() + "IgnoredMeasures.txt").expanded()); WriteResults(namecm, ignoredMeasures, results); } resultsProgress.CheckStatus(); if(noSingleMeasure) { - QString name = FileName(prefix + "SingleMeasurePoints.txt").expanded(); + QString name = QString::fromStdString(FileName(prefix.toStdString() + "SingleMeasurePoints.txt").expanded()); WriteResults(name, singleMeasurePoints, results); } resultsProgress.CheckStatus(); if(noMeasureless) { - QString name = FileName(prefix + "MeasurelessPoints.txt").expanded(); + QString name = QString::fromStdString(FileName(prefix.toStdString() + "MeasurelessPoints.txt").expanded()); WriteResults(name, measurelessPoints, results); } resultsProgress.CheckStatus(); if(noTolerancePoints) { - QString name = FileName(prefix + "TolerancePoints.txt").expanded(); + QString name = QString::fromStdString(FileName(prefix.toStdString() + "TolerancePoints.txt").expanded()); WriteResults(name, tolerancePoints, results); } resultsProgress.CheckStatus(); if(reference) { - QString name = FileName(prefix + "NonReferenceMeasures.txt").expanded(); + QString name = QString::fromStdString(FileName(prefix.toStdString() + "NonReferenceMeasures.txt").expanded()); WriteResults(name, nonReferenceMeasures, results); } resultsProgress.CheckStatus(); if(fixed) { - QString name = FileName(prefix + "NonFixedPoints.txt").expanded(); + QString name = QString::fromStdString(FileName(prefix.toStdString() + "NonFixedPoints.txt").expanded()); WriteResults(name, nonFixedPoints, results); } resultsProgress.CheckStatus(); if(cubePoints) { - QString name = FileName(prefix + "NonCubePoints.txt").expanded(); - WriteResults(name, nonCubePoints, results); + std::string name = FileName(prefix.toStdString() + "NonCubePoints.txt").expanded(); + WriteResults(QString::fromStdString(name), nonCubePoints, results); } resultsProgress.CheckStatus(); @@ -480,24 +480,24 @@ namespace Isis { resultsProgress.CheckStatus(); if(cubeMeasures) { - QString name = FileName(prefix + "NonCubeMeasures.txt").expanded(); - WriteResults(name, noCubeMeasures, results); + std::string name = FileName(prefix.toStdString() + "NonCubeMeasures.txt").expanded(); + WriteResults(QString::fromStdString(name), noCubeMeasures, results); } resultsProgress.CheckStatus(); if(pointsEntered) { - QString name = FileName(prefix + "NonListedPoints.txt").expanded(); - WriteResults(name, nonListedPoints, results); + std::string name = FileName(prefix.toStdString() + "NonListedPoints.txt").expanded(); + WriteResults(QString::fromStdString(name), nonListedPoints, results); } resultsProgress.CheckStatus(); if(latLon) { - QString namenon = FileName(prefix + "LatLonOutOfRange.txt").expanded(); - WriteResults(namenon, nonLatLonPoints, results); - QString namegen = FileName(prefix + "NoLatLonPoints.txt").expanded(); - WriteResults(namegen, cannotGenerateLatLonPoints, results); + std::string namenon = FileName(prefix.toStdString() + "LatLonOutOfRange.txt").expanded(); + WriteResults(QString::fromStdString(namenon), nonLatLonPoints, results); + std::string namegen = FileName(prefix.toStdString() + "NoLatLonPoints.txt").expanded(); + WriteResults(QString::fromStdString(namegen), cannotGenerateLatLonPoints, results); } results.addComment("Each keyword represents a filter parameter used. " @@ -535,7 +535,7 @@ namespace Isis { // loop through line numbers of POINTLIST until we find a point ID in the // list that matches this control point's ID for(int i = 0; i < (int)listedPoints.size() && !isInList; i++) { - QString pointId = listedPoints[i].toString(); + QString pointId = QString::fromStdString(listedPoints[i].toString()); // isInList is true if these strings are equal isInList = pointId.toLower() == controlpt->GetId().toLower(); } @@ -731,7 +731,7 @@ namespace Isis { outRange = !lat.inRange(minlat, maxlat) || !lon.inRange(minlon, maxlon); } catch (IException &e) { - QString msg = "Cannot complete lat/lon range test with given filters"; + std::string msg = "Cannot complete lat/lon range test with given filters"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -760,7 +760,7 @@ namespace Isis { p.CheckStatus(); } catch(IException &e) { - QString msg = "Unable to write the output cube list, [TOLIST]."; + std::string msg = "Unable to write the output cube list, [TOLIST]."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -777,14 +777,14 @@ namespace Isis { // Don't create file if it will be empty if (outputsn.size() == 0) { summary.addComment("The output cube list file, [" - + toList.toString().toStdString() + "], was not created. " + + toList.toString() + "], was not created. " "The provided filters have resulted in an empty" "Control Network."); return; } std::ofstream out_stream; - out_stream.open(toList.toString().toLatin1().data(), std::ios::out); + out_stream.open(toList.toString().c_str(), std::ios::out); out_stream.seekp(0, std::ios::beg); //Start writing from beginning of file for(std::set::iterator sn = outputsn.begin(); sn != outputsn.end(); sn ++) { diff --git a/isis/src/control/apps/cnethist/main.cpp b/isis/src/control/apps/cnethist/main.cpp index f01e24cc59..c499343a78 100644 --- a/isis/src/control/apps/cnethist/main.cpp +++ b/isis/src/control/apps/cnethist/main.cpp @@ -88,7 +88,7 @@ void IsisMain() { // Write the results if(!ui.WasEntered("TO")) { - QString msg = "The [TO] parameter must be entered"; + std::string msg = "The [TO] parameter must be entered"; throw IException(IException::User, msg, _FILEINFO_); } QString outfile = ui.GetFileName("TO"); @@ -104,7 +104,7 @@ void IsisMain() { hist = new Histogram(net, &ControlMeasure::GetResidualMagnitude, ui.GetDouble("BIN_WIDTH")); } catch (IException &e) { - QString msg = "The following error was thrown while building a histogram from netfile [" + + std::string msg = "The following error was thrown while building a histogram from netfile [" + fList[i].expanded() + "]: " +e.toString() + "\n"; if (ui.IsInteractive()) //if in gui mode print the error message to the terminal Application::GuiLog(msg); diff --git a/isis/src/control/apps/cnetmerge/main.cpp b/isis/src/control/apps/cnetmerge/main.cpp index 9c45bc157f..03e2e1b4db 100644 --- a/isis/src/control/apps/cnetmerge/main.cpp +++ b/isis/src/control/apps/cnetmerge/main.cpp @@ -109,7 +109,7 @@ void IsisMain() { // Check after taking into account an explicit base network if we have at // least two networks to merge if (filelist.size() < 2) { - QString msg = "CLIST [" + ui.GetFileName("CLIST") + "] and BASE [" + + std::string msg = "CLIST [" + ui.GetFileName("CLIST") + "] and BASE [" + (ui.WasEntered("BASE") ? ui.GetFileName("BASE") : "Automatic") + "] must total to at least two distinct filenames: " "a base network and a new network"; @@ -193,7 +193,7 @@ ControlNet * mergeNetworks(FileList &filelist, PvlObject &conflictLog, } else { // User has disallowed merging points, so throw an error - QString msg = "Add network [" + cnetName.name() + "] contains " + std::string msg = "Add network [" + cnetName.name() + "] contains " "Control Point with ID [" + point->GetId() + "] already " "contained within source network [" + pointSources[point->GetId()] + "]. " @@ -212,7 +212,7 @@ ControlNet * mergeNetworks(FileList &filelist, PvlObject &conflictLog, outPvl.addObject(errors); outPvl.write(logName.toStdString()); - QString msg = "Networks contained duplicate points. See log file [" + + std::string msg = "Networks contained duplicate points. See log file [" + FileName(logName).name() + "] for details. " "Set DUPLICATEPOINTS=MERGE to merge conflicting Control Points"; throw IException(IException::User, msg, _FILEINFO_); @@ -242,7 +242,7 @@ ControlNet * mergeNetworks(FileList &filelist, PvlObject &conflictLog, // Networks can only be merged if the targets are the same if (baseNet->GetTarget().toLower() != newNet.GetTarget().toLower()) { - QString msg = "Input [" + newNet.GetNetworkId() + "] does not target the " + std::string msg = "Input [" + newNet.GetNetworkId() + "] does not target the " "same target as other Control Network(s)"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/cnetnewradii/main.cpp b/isis/src/control/apps/cnetnewradii/main.cpp index dfb3e39466..f81fa2fb99 100644 --- a/isis/src/control/apps/cnetnewradii/main.cpp +++ b/isis/src/control/apps/cnetnewradii/main.cpp @@ -66,7 +66,7 @@ void IsisMain() { newRadiiSource = Apriori; } else { - QString msg = "The value for parameter GETLATLON ["; + std::string msg = "The value for parameter GETLATLON ["; msg += ui.GetAsString("GETLATLON") + "] must be provided."; throw IException(IException::User, msg, _FILEINFO_); } @@ -145,12 +145,12 @@ void IsisMain() { if (numSuccesses == 0) { if (numConstrainedFixed == 0) { - QString msg = "There were no Fixed or Constrained points in this network." + std::string msg = "There were no Fixed or Constrained points in this network." " No radii were replaced."; throw IException(IException::User, msg, _FILEINFO_); } else { - QString msg = "No valid radii can be calculated. Verify that the DEM [" + + std::string msg = "No valid radii can be calculated. Verify that the DEM [" + ui.GetAsString("MODEL") + "] is valid."; throw IException(IException::User, msg, _FILEINFO_); } @@ -201,7 +201,7 @@ void IsisMain() { failGroup.addKeyword(PvlKeyword("PointIDs", failedIDs.toStdString())); results.addGroup(failGroup); } - results.write(errorlogFile.expanded().toStdString()); + results.write(errorlogFile.expanded()); } // Write summary to application log Application::Log(summaryGroup); diff --git a/isis/src/control/apps/cnetref/CnetRefByEmission.cpp b/isis/src/control/apps/cnetref/CnetRefByEmission.cpp index 8bd35e180c..d1027687e9 100644 --- a/isis/src/control/apps/cnetref/CnetRefByEmission.cpp +++ b/isis/src/control/apps/cnetref/CnetRefByEmission.cpp @@ -221,7 +221,7 @@ namespace Isis { if (iNumMeasuresLocked > 0 && !bRefLocked) { pvlPointObj += Isis::PvlKeyword("Error", "Point has a Measure with EditLock set to true " "but the Reference is not Locked"); - //QString message = "Invalid Nearest Resolution Value"; + //std::string message = "Invalid Nearest Resolution Value"; //throw Isis::iException::Message(Isis::iException::User, message, _FILEINFO_); bError = true; } diff --git a/isis/src/control/apps/cnetref/main.cpp b/isis/src/control/apps/cnetref/main.cpp index c3d0671777..4ecc17e116 100644 --- a/isis/src/control/apps/cnetref/main.cpp +++ b/isis/src/control/apps/cnetref/main.cpp @@ -60,7 +60,7 @@ void IsisMain() { Application::Log(pvlDefFile->group(0)); if (pvlDefFile->group(0).hasKeyword("PixelsFromEdge") && pvlDefFile->group(0).hasKeyword("MetersFromEdge")) { - QString message = "DefFile Error : Cannot have both \"PixelsFromEdge\" && \"MetersFromEdge\"" ; + std::string message = "DefFile Error : Cannot have both \"PixelsFromEdge\" && \"MetersFromEdge\"" ; throw IException(IException::User, message, _FILEINFO_); } @@ -124,7 +124,7 @@ void IsisMain() { if (sType == "NEAREST") { dResValue = ui.GetDouble("RESVALUE"); if (dResValue < 0) { - QString message = "Invalid Nearest Resolution Value"; + std::string message = "Invalid Nearest Resolution Value"; throw IException(IException::User, message, _FILEINFO_); } } @@ -132,7 +132,7 @@ void IsisMain() { dMinRes = ui.GetDouble("MINRES"); dMaxRes = ui.GetDouble("MAXRES"); if (dMinRes < 0 || dMaxRes < 0 || dMinRes > dMaxRes) { - QString message = "Invalid Resolution Range"; + std::string message = "Invalid Resolution Range"; throw IException(IException::User, message, _FILEINFO_); } } @@ -143,7 +143,7 @@ void IsisMain() { // Process Reference by Interest else if (sCriteria == "INTEREST") { if (!bDefFile) { - QString msg = "Interest Option must have a DefFile"; + std::string msg = "Interest Option must have a DefFile"; throw IException(IException::User, msg, _FILEINFO_); } QString sOverlapListFile = ""; @@ -196,16 +196,16 @@ void IsisMain() { throw; } catch (geos::util::GEOSException *exc) { - QString message = "GEOS Exception: " + (QString)exc->what(); + std::string message = "GEOS Exception: " + (QString)exc->what(); delete exc; throw IException(IException::User, message, _FILEINFO_); } catch (std::exception const &se) { - QString message = "std::exception: " + (QString)se.what(); + std::string message = "std::exception: " + (QString)se.what(); throw IException(IException::User, message, _FILEINFO_); } catch (...) { - QString message = "Other Error"; + std::string message = "Other Error"; throw IException(IException::User, message, _FILEINFO_); } } diff --git a/isis/src/control/apps/cnetsplit/main.cpp b/isis/src/control/apps/cnetsplit/main.cpp index 405ff33199..4e8a5638a4 100644 --- a/isis/src/control/apps/cnetsplit/main.cpp +++ b/isis/src/control/apps/cnetsplit/main.cpp @@ -44,7 +44,7 @@ void IsisMain() { if (numOutputFiles > numPoints) { FileName inputNet(ui.GetFileName("CNET")); - QString msg = "The number of output files is greater than total number of " + std::string msg = "The number of output files is greater than total number of " "Control Points in the given Control Network [" + ui.GetFileName("CNET") + "]."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/control/apps/cnetthinner/cnetthinner.cpp b/isis/src/control/apps/cnetthinner/cnetthinner.cpp index 524a9faade..0c093aaec4 100644 --- a/isis/src/control/apps/cnetthinner/cnetthinner.cpp +++ b/isis/src/control/apps/cnetthinner/cnetthinner.cpp @@ -75,7 +75,7 @@ namespace Isis { QString suppressed = ui.GetString("SUPPRESSED").toLower(); if (tolerance < 0.0 || tolerance > 1.0) { - QString msg = "TOLERANCE must be between 0.0 and 1.0"; + std::string msg = "TOLERANCE must be between 0.0 and 1.0"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/cnetwinnow/cnetwinnow.cpp b/isis/src/control/apps/cnetwinnow/cnetwinnow.cpp index 591cf2a773..6c76816716 100644 --- a/isis/src/control/apps/cnetwinnow/cnetwinnow.cpp +++ b/isis/src/control/apps/cnetwinnow/cnetwinnow.cpp @@ -86,7 +86,7 @@ namespace Isis { QList cubeSerials = net.GetCubeSerials(); bool serFlag=true; for (int i=0;iSetUniversalGround(lat1.degrees(), lon1.degrees()) ) { - QString mess = "Geometry coordinate does not map into image at location (" + + std::string mess = "Geometry coordinate does not map into image at location (" + QString::number(lat1.degrees()) + "," + QString::number(lon1.degrees()) + ")"; throw IException(IException::User, mess, _FILEINFO_); } @@ -117,7 +117,7 @@ void IsisMain() { // Ignore the SetImage() error as long as the coordinate is a valid // image coordinate. if (!v_cam->InCube() ) { - QString mess = "Image coordinate is outside image coordinates at point (" + + std::string mess = "Image coordinate is outside image coordinates at point (" + QString::number(samp1) + "," + QString::number(line1) + ")"; throw IException(IException::User, mess, _FILEINFO_); } @@ -178,7 +178,7 @@ void IsisMain() { // We only know how to handle a cache with just four records. Anything // else and we have to abort... if ( o_cmat.Records() != 4 ) { - QString mess = "Expect only 4 records for polynomial cache but got " + std::string mess = "Expect only 4 records for polynomial cache but got " + QString::number(o_cmat.Records()) + " instead!"; throw IException(IException::User, mess, _FILEINFO_); } @@ -314,7 +314,7 @@ void IsisMain() { Application::Log(results); } catch (IException &e) { - QString msg = "Unable to update camera pointing for [" + filename + "]"; + std::string msg = "Unable to update camera pointing for [" + filename + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -493,7 +493,7 @@ void ApplyRotation(const double R[3][3], Table &table) { // Sanity check... if ( table[0].Fields() < 4 ) { - QString mess = "Expect at least 4 fields for quaternion cache but got " + std::string mess = "Expect at least 4 fields for quaternion cache but got " + QString::number(table.Records()) + " instead!"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/AKAZEAlgorithm.cpp b/isis/src/control/apps/findfeatures/AKAZEAlgorithm.cpp index 3d59334eee..bcb1eb631a 100644 --- a/isis/src/control/apps/findfeatures/AKAZEAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/AKAZEAlgorithm.cpp @@ -177,7 +177,7 @@ namespace Isis { } } catch (std::exception &e) { - QString msg = "The input value [" + value + + std::string msg = "The input value [" + value + "] is not valid for AKAZE's [DescriptorType] variable"; throw IException(IException::User, msg, _FILEINFO_); } @@ -226,7 +226,7 @@ namespace Isis { } } catch (std::exception &e) { - QString msg = "The input value [" + value + + std::string msg = "The input value [" + value + "] is not valid for AKAZE's [Diffusivity] variable"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/AgastAlgorithm.cpp b/isis/src/control/apps/findfeatures/AgastAlgorithm.cpp index f80eb396ac..1bbb88b10c 100644 --- a/isis/src/control/apps/findfeatures/AgastAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/AgastAlgorithm.cpp @@ -167,7 +167,7 @@ namespace Isis { } } catch (std::exception &e) { - QString msg = "The input value [" + value + + std::string msg = "The input value [" + value + "] is not valid for AGAST's [Type] variable"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/BRISKAlgorithm.cpp b/isis/src/control/apps/findfeatures/BRISKAlgorithm.cpp index 8baf9667c2..aa305db74a 100644 --- a/isis/src/control/apps/findfeatures/BRISKAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/BRISKAlgorithm.cpp @@ -175,7 +175,7 @@ namespace Isis { * to set algorithm parameters." */ int BRISKAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "BRISKAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "BRISKAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/BlobDetectionAlgorithm.cpp b/isis/src/control/apps/findfeatures/BlobDetectionAlgorithm.cpp index ab976b22a9..6f523dd80c 100644 --- a/isis/src/control/apps/findfeatures/BlobDetectionAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/BlobDetectionAlgorithm.cpp @@ -180,7 +180,7 @@ namespace Isis { * to set algorithm parameters." */ int BlobDetectionAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "BlobDetectionAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "BlobDetectionAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/BriefDescriptorAlgorithm.cpp b/isis/src/control/apps/findfeatures/BriefDescriptorAlgorithm.cpp index d56fb75488..c00f1be605 100644 --- a/isis/src/control/apps/findfeatures/BriefDescriptorAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/BriefDescriptorAlgorithm.cpp @@ -149,7 +149,7 @@ namespace Isis { * to set algorithm parameters." */ int BriefDescriptorAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "BriefDescriptorAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "BriefDescriptorAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/BruteForceMatcher.cpp b/isis/src/control/apps/findfeatures/BruteForceMatcher.cpp index 517c1d1be6..e7370fa891 100644 --- a/isis/src/control/apps/findfeatures/BruteForceMatcher.cpp +++ b/isis/src/control/apps/findfeatures/BruteForceMatcher.cpp @@ -64,7 +64,7 @@ namespace Isis { variables.add("NormType", m_normTypeMap.right.at(normType)); } catch (std::exception &e){ - QString msg = "The input value [" + toString(normType) + + std::string msg = "The input value [" + toString(normType) + "] is not valid for BruteForceMatcher's [NormType] variable"; throw IException(IException::User, msg, _FILEINFO_); } @@ -136,7 +136,7 @@ namespace Isis { } } catch (std::exception &e) { - QString msg = "The input value [" + norm + + std::string msg = "The input value [" + norm + "] is not valid for BruteForceMatcher's [NormType] variable"; throw IException(IException::User, msg, _FILEINFO_); } @@ -198,7 +198,7 @@ namespace Isis { * to set algorithm parameters." */ int BruteForceMatcher::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "BruteForceMatcher does not have the ability to set algorithm parameters."; + std::string msg = "BruteForceMatcher does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/DaisyAlgorithm.cpp b/isis/src/control/apps/findfeatures/DaisyAlgorithm.cpp index 3fac2d05f1..397f1a5e27 100644 --- a/isis/src/control/apps/findfeatures/DaisyAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/DaisyAlgorithm.cpp @@ -66,7 +66,7 @@ namespace Isis { QStringList elts = Hparm.split( "," ); if (elts.size() != 9 ) { - QString mess = "Homography matrix, H, was not input as a string of the form \"d,d,d,d,d,d,d," + std::string mess = "Homography matrix, H, was not input as a string of the form \"d,d,d,d,d,d,d," "d,d\" where d is a double or integer numerical value."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -185,7 +185,7 @@ namespace Isis { * @return int Number of variables actually set */ int DaisyAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString message = "DAISY does not have the ability to set algorithm parameters."; + std::string message = "DAISY does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, message, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/DaisyExtractor.cpp b/isis/src/control/apps/findfeatures/DaisyExtractor.cpp index d2bb06d997..d7712c82cc 100644 --- a/isis/src/control/apps/findfeatures/DaisyExtractor.cpp +++ b/isis/src/control/apps/findfeatures/DaisyExtractor.cpp @@ -24,7 +24,7 @@ namespace Isis { */ void DaisyExtractor::compute( cv::InputArray image, std::vector& keypoints, cv::OutputArray descriptors ) { - QString mess = "Daisy is unable to run compute with these arguments."; + std::string mess = "Daisy is unable to run compute with these arguments."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -39,7 +39,7 @@ namespace Isis { * @throws IException::Programmer "Daisy is unable to run compute with these arguments." */ void DaisyExtractor::compute( cv::InputArray image, cv::Rect roi, cv::OutputArray descriptors ){ - QString mess = "Daisy is unable to run compute with these arguments."; + std::string mess = "Daisy is unable to run compute with these arguments."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -54,7 +54,7 @@ namespace Isis { * @throws IException::Programmer "Daisy is unable to run compute with these arguments." */ void DaisyExtractor::compute( cv::InputArray image, cv::OutputArray descriptors ){ - QString mess = "Daisy is unable to run compute with these arguments."; + std::string mess = "Daisy is unable to run compute with these arguments."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -71,7 +71,7 @@ namespace Isis { */ void DaisyExtractor::GetDescriptor( double y, double x, int orientation, float* descriptor ) const { - QString mess = "Daisy cannot run GetDescriptor"; + std::string mess = "Daisy cannot run GetDescriptor"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -92,7 +92,7 @@ namespace Isis { */ bool DaisyExtractor::GetDescriptor( double y, double x, int orientation, float* descriptor, double* H ) const { - QString mess = "Daisy cannot run GetDescriptor."; + std::string mess = "Daisy cannot run GetDescriptor."; throw IException(IException::Programmer, mess, _FILEINFO_); return false; } @@ -111,7 +111,7 @@ namespace Isis { void DaisyExtractor::GetUnnormalizedDescriptor( double y, double x, int orientation, float* descriptor ) const { - QString mess = "Daisy cannot run GetUnnormalizedDescriptor."; + std::string mess = "Daisy cannot run GetUnnormalizedDescriptor."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -131,7 +131,7 @@ namespace Isis { */ bool DaisyExtractor::GetUnnormalizedDescriptor( double y, double x, int orientation, float* descriptor , double *H ) const { - QString mess = "Daisy cannot run GetUnnormalizedDescriptor."; + std::string mess = "Daisy cannot run GetUnnormalizedDescriptor."; throw IException(IException::Programmer, mess, _FILEINFO_); return false; } diff --git a/isis/src/control/apps/findfeatures/FASTAlgorithm.cpp b/isis/src/control/apps/findfeatures/FASTAlgorithm.cpp index ebc493edb4..1e3f98f6e4 100644 --- a/isis/src/control/apps/findfeatures/FASTAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/FASTAlgorithm.cpp @@ -170,7 +170,7 @@ namespace Isis { } } catch (std::exception &e) { - QString msg = "The input value [" + value + + std::string msg = "The input value [" + value + "] is not valid for FAST's [Type] variable"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/FREAKAlgorithm.cpp b/isis/src/control/apps/findfeatures/FREAKAlgorithm.cpp index 05c56a571e..c08ae70a76 100644 --- a/isis/src/control/apps/findfeatures/FREAKAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/FREAKAlgorithm.cpp @@ -158,7 +158,7 @@ namespace Isis { * to set algorithm parameters." */ int FREAKAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "FREAKAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "FREAKAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/FastGeom.cpp b/isis/src/control/apps/findfeatures/FastGeom.cpp index 133231c17a..fc79c149b1 100644 --- a/isis/src/control/apps/findfeatures/FastGeom.cpp +++ b/isis/src/control/apps/findfeatures/FastGeom.cpp @@ -171,7 +171,7 @@ ImageTransform *FastGeom::compute(MatchImage &query, MatchImage &train, // Compute homography if enough point ater in common FOVs of both images, // otherwise we report failure if ( n_total_points < m_fastpts ) { - QString mess = "Failed to get FOV geometry mapping for " + train.name() + + std::string mess = "Failed to get FOV geometry mapping for " + train.name() + " to " + query.name() + " needing " + QString::number(m_fastpts) + " but got " + QString::number(n_total_points) +" in train FOV."; logit << ">>> ERROR - " << mess << "\n"; @@ -653,14 +653,14 @@ cv::Mat FastGeom::getTransformMatrix(const std::vector &query // Check for invalid/empty matrix which indicates OpenCV error if ( mapper.empty() ) { - QString msg = "Error computing homography matrix"; + std::string msg = "Error computing homography matrix"; throw IException(IException::Programmer, msg, _FILEINFO_); } } catch ( std::exception &e ) { // This will also catch any ISIS error - QString msg = "Matrix transform error: " + QString(e.what()); + std::string msg = "Matrix transform error: " + QString(e.what()); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -714,10 +714,10 @@ void FastGeom::dump_point_mapping(MatchImage &query, MatchImage &train, logit << "\n--> Dumping " << method << " points <---\n"; - FileName q_file( query.name() ); - FileName t_file( train.name() ); + FileName q_file( query.name().toStdString() ); + FileName t_file( train.name().toStdString() ); - QString csvout = q_file.baseName() + "_" + t_file.baseName() + "." + + QString csvout = QString::fromStdString(q_file.baseName()) + "_" + QString::fromStdString(t_file.baseName()) + "." + method + ".fastgeom.csv"; logit << " PointDumpFile: " << csvout << "\n"; @@ -764,7 +764,7 @@ void FastGeom::validate( const QString &geomtype ) const { QStringList options; options << "camera" << "crop" << "map"; if ( !options.contains(geomtype, Qt::CaseInsensitive) ) { - QString mess = "FastGeom - invalid GEOMTYPE (" + geomtype + ")!" + std::string mess = "FastGeom - invalid GEOMTYPE (" + geomtype + ")!" " Must be CAMERA, CROP or MAP."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/FeatureAlgorithm.h b/isis/src/control/apps/findfeatures/FeatureAlgorithm.h index 5fe613063d..7bd48d1246 100644 --- a/isis/src/control/apps/findfeatures/FeatureAlgorithm.h +++ b/isis/src/control/apps/findfeatures/FeatureAlgorithm.h @@ -245,12 +245,12 @@ template bool FeatureAlgorithm::setVariable(const QString &var, variable.add(var, value); try { if (0 >= setAlgorithmVariables(variable)) { - QString mess = "Setting of variable " + var + " failed in " + name(); + std::string mess = "Setting of variable " + var + " failed in " + name(); throw IException(IException::Programmer, mess, _FILEINFO_); } } catch (IException &ie) { - QString mess = "Error setting variable " + var + " in " + name(); + std::string mess = "Error setting variable " + var + " in " + name(); throw IException(ie, IException::Programmer, mess, _FILEINFO_); } @@ -302,7 +302,7 @@ template bool FeatureAlgorithm::setVariable(const QString &vname, const QVariant &var) { QString value = var.toString(); if ( value.isEmpty() ) { - QString mess = "Variant/variable " + vname + + std::string mess = "Variant/variable " + vname + " cannot be converted in " + name(); throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -310,7 +310,7 @@ template bool FeatureAlgorithm::setVariable(const QString &vname, PvlFlatMap variable; variable.add(vname, value); if ( 0 >= setAlgorithmVariables(variable) ) { - QString mess = "Setting of variable " + vname + " failed in " + name(); + std::string mess = "Setting of variable " + vname + " failed in " + name(); throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/FeatureAlgorithmFactory.cpp b/isis/src/control/apps/findfeatures/FeatureAlgorithmFactory.cpp index 6ac09f6e6c..e5c252f478 100644 --- a/isis/src/control/apps/findfeatures/FeatureAlgorithmFactory.cpp +++ b/isis/src/control/apps/findfeatures/FeatureAlgorithmFactory.cpp @@ -386,7 +386,7 @@ RobustMatcherList FeatureAlgorithmFactory::create(const QString &specs, QStringList algorithms = specs.split("|", Qt::SkipEmptyParts); if ( algorithms.size() == 0 ) { if ( errorIfEmpty ) { - QString mess = "No feature matcher algorithms provided!"; + std::string mess = "No feature matcher algorithms provided!"; throw IException(IException::User, mess, _FILEINFO_); } return (algoList); @@ -396,7 +396,7 @@ RobustMatcherList FeatureAlgorithmFactory::create(const QString &specs, BOOST_FOREACH ( QString matcherSpec, algorithms ) { SharedRobustMatcher algo( make(matcherSpec) ); if ( algo.isNull() ) { - QString mess = "Failed to create feature matcher from spec " + matcherSpec + "."; + std::string mess = "Failed to create feature matcher from spec " + matcherSpec + "."; throw IException(IException::User, mess, _FILEINFO_); } algoList.append(algo); @@ -469,7 +469,7 @@ SharedRobustMatcher FeatureAlgorithmFactory::make(const QString &definition) con } } catch (IException &e) { - QString mess = "Failed to create algorithms for config:\n" + definition; + std::string mess = "Failed to create algorithms for config:\n" + definition; throw IException(e, IException::User, mess, _FILEINFO_); } @@ -489,7 +489,7 @@ SharedRobustMatcher FeatureAlgorithmFactory::make(const QString &definition) con falgo->validate(true); } catch (IException &ie) { - QString mess = "MatcherAlgorithms were not created successfully!"; + std::string mess = "MatcherAlgorithms were not created successfully!"; ie.append(IException(IException::User, mess, _FILEINFO_)); throw ie; } @@ -544,7 +544,7 @@ QStringList FeatureAlgorithmFactory::formatSpecifications(QString specification) // std::cout << "Setting feature2d: " << part << "\n"; // If we have a detector and extractor, this is an error if ( !detectorSpec.isEmpty() && !extractorSpec.isEmpty() ) { - QString mess = "Too many Feature2Ds specified at " + part + " in specification " + + std::string mess = "Too many Feature2Ds specified at " + part + " in specification " + specification; throw IException(IException::User, mess, _FILEINFO_); } @@ -564,7 +564,7 @@ QStringList FeatureAlgorithmFactory::formatSpecifications(QString specification) else if ( part.contains(QRegularExpression("^detector\\.*", QRegularExpression::CaseInsensitiveOption)) ) { // std::cout << "Setting detector: " << part << "\n"; if ( !detectorSpec.isEmpty() ) { - QString mess = "Multiple Detector specs found - have \"" + detectorSpec + "\", but found \"" + + std::string mess = "Multiple Detector specs found - have \"" + detectorSpec + "\", but found \"" + part + "\" in specification: " + specification; throw IException(IException::User, mess, _FILEINFO_); } @@ -574,7 +574,7 @@ QStringList FeatureAlgorithmFactory::formatSpecifications(QString specification) else if ( part.contains(QRegularExpression("^extractor\\.*", QRegularExpression::CaseInsensitiveOption)) ) { // std::cout << "Setting extractor: " << part << "\n"; if ( !extractorSpec.isEmpty() ) { - QString mess = "Multiple Extractor specs found - have \"" + extractorSpec + "\", but found \"" + + std::string mess = "Multiple Extractor specs found - have \"" + extractorSpec + "\", but found \"" + part + "\" in specification: " + specification; throw IException(IException::User, mess, _FILEINFO_); } @@ -584,7 +584,7 @@ QStringList FeatureAlgorithmFactory::formatSpecifications(QString specification) else if ( part.contains(QRegularExpression("^matcher\\.*", QRegularExpression::CaseInsensitiveOption)) ) { // std::cout << "Setting matcher: " << part << "\n"; if ( !matcherSpec.isEmpty() ) { - QString mess = "Multiple Matcher specs found - have \"" + matcherSpec + "\", but found \"" + + std::string mess = "Multiple Matcher specs found - have \"" + matcherSpec + "\", but found \"" + part + "\" in specification: " + specification; throw IException(IException::User, mess, _FILEINFO_); } @@ -593,7 +593,7 @@ QStringList FeatureAlgorithmFactory::formatSpecifications(QString specification) else if ( part.contains(QRegularExpression("^parameters*", QRegularExpression::CaseInsensitiveOption)) ) { // std::cout << "Setting paramters: " << part << "\n"; if ( !parametersSpec.isEmpty() ) { - QString mess = "Multiple Parameter specs found - have \"" + parametersSpec + "\", but found \"" + + std::string mess = "Multiple Parameter specs found - have \"" + parametersSpec + "\", but found \"" + part + "\" in specification: " + specification; throw IException(IException::User, mess, _FILEINFO_); } @@ -614,7 +614,7 @@ QStringList FeatureAlgorithmFactory::formatSpecifications(QString specification) else { // Should have had parameter already so there are too many parts of // the specification and its invalid. - QString mess = "Invalid algorithm/part at or near \"" + part + + std::string mess = "Invalid algorithm/part at or near \"" + part + "\" - too many or invalid algorithm specs detected in specification: " + specification; throw IException(IException::User, mess, _FILEINFO_); @@ -626,7 +626,7 @@ QStringList FeatureAlgorithmFactory::formatSpecifications(QString specification) if ( !parametersSpec.isEmpty() ) { if ( parametersSpec.split("@", Qt::SkipEmptyParts).takeFirst().toLower() != "parameters" ) { - QString mess = "Invalid specification:\n" + + std::string mess = "Invalid specification:\n" + specification + "\n" + "Invalid parameters specification:\n" + parametersSpec; diff --git a/isis/src/control/apps/findfeatures/FeatureInventory.cpp b/isis/src/control/apps/findfeatures/FeatureInventory.cpp index 9c0d4849b0..5cd3084321 100644 --- a/isis/src/control/apps/findfeatures/FeatureInventory.cpp +++ b/isis/src/control/apps/findfeatures/FeatureInventory.cpp @@ -89,7 +89,7 @@ namespace Isis { QStringList parts = parse(config, "@"); if ( parts.isEmpty() ) { - QString mess = "No config string provided in FeatureInventory::getFeature"; + std::string mess = "No config string provided in FeatureInventory::getFeature"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -101,7 +101,7 @@ namespace Isis { return ( creator( variables, config) ); } else { - QString mess = name + "Feature2D not found or invalid"; + std::string mess = name + "Feature2D not found or invalid"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -114,7 +114,7 @@ namespace Isis { FeatureAlgorithmPtr FeatureInventory::getDetector(const QString &config) const { FeatureAlgorithmPtr algo = getFeature(config); if ( !algo->hasDetector() ) { - QString mess = "Specification does not define a detector:\n" + config; + std::string mess = "Specification does not define a detector:\n" + config; throw IException(IException::User, mess, _FILEINFO_); } return ( algo ); @@ -124,7 +124,7 @@ namespace Isis { FeatureAlgorithmPtr FeatureInventory::getExtractor(const QString &config) const { FeatureAlgorithmPtr algo = getFeature(config); if ( !algo->hasExtractor() ) { - QString mess = "Specification does not define an extractor:\n" + config; + std::string mess = "Specification does not define an extractor:\n" + config; throw IException(IException::User, mess, _FILEINFO_); } return ( algo ); @@ -135,7 +135,7 @@ namespace Isis { QStringList parts = parse(config, "@"); if ( parts.isEmpty() ) { - QString mess = "No config string provided in FeatureInventory::getMatcher"; + std::string mess = "No config string provided in FeatureInventory::getMatcher"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -148,7 +148,7 @@ namespace Isis { return ( matcher(variables, config)); } else { - QString mess = c_name + " Matcher not found or invalid"; + std::string mess = c_name + " Matcher not found or invalid"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -187,7 +187,7 @@ namespace Isis { algorithmObject = getMatcher(lowerName)->info(); } else { - QString mess = "Algorithm [" + algorithmName + + std::string mess = "Algorithm [" + algorithmName + "] is not a supported OpenCV3 algorithm."; throw IException(IException::User, mess, _FILEINFO_); } @@ -222,7 +222,7 @@ namespace Isis { } } else { - QString mess = "Algorithm [" + algorithmName + + std::string mess = "Algorithm [" + algorithmName + "] is not a supported OpenCV3 algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/FlannBasedMatcher.cpp b/isis/src/control/apps/findfeatures/FlannBasedMatcher.cpp index 7af08f7263..85f9fa317c 100644 --- a/isis/src/control/apps/findfeatures/FlannBasedMatcher.cpp +++ b/isis/src/control/apps/findfeatures/FlannBasedMatcher.cpp @@ -143,7 +143,7 @@ namespace Isis { * to set algorithm parameters." */ int FlannBasedMatcher::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "FlannBasedMatcher does not have the ability to set algorithm parameters."; + std::string msg = "FlannBasedMatcher does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/GenericTransform.cpp b/isis/src/control/apps/findfeatures/GenericTransform.cpp index 1206e90e18..1eb07a7510 100644 --- a/isis/src/control/apps/findfeatures/GenericTransform.cpp +++ b/isis/src/control/apps/findfeatures/GenericTransform.cpp @@ -146,14 +146,14 @@ cv::Mat GenericTransform::computeInverse(const cv::Mat &matrix, double result = cv::invert(matrix, inverse); if ( verify ) { if ( 0.0 == result ) { - QString msg = "Transformation matrix is not invertable"; + std::string msg = "Transformation matrix is not invertable"; throw IException(IException::Programmer, msg, _FILEINFO_); } } } catch ( std::exception &e ) { // This will also catch any ISIS error - QString msg = "Matrix inversion error: " + QString(e.what()); + std::string msg = "Matrix inversion error: " + QString(e.what()); throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/ImageSource.cpp b/isis/src/control/apps/findfeatures/ImageSource.cpp index 5c7b042555..852758145b 100644 --- a/isis/src/control/apps/findfeatures/ImageSource.cpp +++ b/isis/src/control/apps/findfeatures/ImageSource.cpp @@ -121,19 +121,19 @@ void ImageSource::load(const QString &name, const double minPercent, void ImageSource::load(const double minPercent,const double maxPercent) { QString name = m_data->m_name; - FileName ifile(name); + FileName ifile(name.toStdString()); // Handle ISIS cube specifically. If its not a cube, use OpenCV's image // reader if ( "cub" == ifile.extension() ) { Cube cube; - CubeAttributeInput attTrans(name); + CubeAttributeInput attTrans(name.toStdString()); std::vector bandTrans = attTrans.bands(); cube.setVirtualBands(bandTrans); - cube.open(ifile.expanded(), "r"); + cube.open(QString::fromStdString(ifile.expanded()), "r"); if( cube.bandCount() != 1 ) { - QString msg = "Input cube " + name + " must only have one band!"; + std::string msg = "Input cube " + name + " must only have one band!"; throw IException(IException::User, msg, _FILEINFO_); } @@ -187,19 +187,19 @@ void ImageSource::load(const double minPercent,const double maxPercent) { else { // Assume OpenCV can read it try { - m_data->m_image = cv::imread(ifile.expanded().toStdString(), + m_data->m_image = cv::imread(ifile.expanded(), cv::IMREAD_GRAYSCALE); if ( m_data->m_image.empty() ) { - QString mess = "Failed to read image from " + name; + std::string mess = "Failed to read image from " + name; throw IException(IException::User, mess, _FILEINFO_); } - m_data->m_serialno = ifile.baseName(); + m_data->m_serialno = QString::fromStdString(ifile.baseName()); // Here we could check for world files and construct geometry!! } catch (cv::Exception &e) { - QString mess = "OpenCV cannot process file " + name + " " + + std::string mess = "OpenCV cannot process file " + name + " " + QString::fromStdString(e.what()); throw IException(IException::User, mess, _FILEINFO_); } @@ -341,7 +341,7 @@ cv::Mat ImageSource::getGeometryMapping(ImageSource &match, // Compute homography if enough point if ( (int) source.size() < v_minpts ) { - QString mess = "Failed to get geometry mapping for " + match.name() + + std::string mess = "Failed to get geometry mapping for " + match.name() + " to " + name() + " needing " + QString::number(v_minpts) + " but only could get " + QString::number(source.size()) +"."; throw IException(IException::Programmer, mess, _FILEINFO_); @@ -384,15 +384,15 @@ Histogram *ImageSource::getHistogram(Cube &cube) const { bool ImageSource::initGeometry() { - FileName ifile(m_data->m_name); + FileName ifile(m_data->m_name.toStdString()); Cube cube; - CubeAttributeInput attTrans(m_data->m_name); + CubeAttributeInput attTrans(m_data->m_name.toStdString()); std::vector bandTrans = attTrans.bands(); cube.setVirtualBands(bandTrans); - cube.open(ifile.expanded(), "r"); + cube.open(QString::fromStdString(ifile.expanded()), "r"); if( cube.bandCount() != 1 ) { - QString msg = "Input cube " + m_data->m_name + + std::string msg = "Input cube " + m_data->m_name + " must only have one band!"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/KAZEAlgorithm.cpp b/isis/src/control/apps/findfeatures/KAZEAlgorithm.cpp index 2e3ee7946f..dcff5206b1 100644 --- a/isis/src/control/apps/findfeatures/KAZEAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/KAZEAlgorithm.cpp @@ -184,7 +184,7 @@ namespace Isis { } } catch (std::exception &e) { - QString msg = "The input value [" + value + + std::string msg = "The input value [" + value + "] is not valid for KAZE's [Type] variable"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/LATCHAlgorithm.cpp b/isis/src/control/apps/findfeatures/LATCHAlgorithm.cpp index 10e0c62aff..444ec78df5 100644 --- a/isis/src/control/apps/findfeatures/LATCHAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/LATCHAlgorithm.cpp @@ -147,7 +147,7 @@ namespace Isis { * to set algorithm parameters." */ int LATCHAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "LATCHAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "LATCHAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/LUCIDAlgorithm.cpp b/isis/src/control/apps/findfeatures/LUCIDAlgorithm.cpp index d8f5ce6046..c033715e7f 100644 --- a/isis/src/control/apps/findfeatures/LUCIDAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/LUCIDAlgorithm.cpp @@ -144,7 +144,7 @@ namespace Isis { * to set algorithm parameters." */ int LUCIDAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "LUCIDAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "LUCIDAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/MSDAlgorithm.cpp b/isis/src/control/apps/findfeatures/MSDAlgorithm.cpp index 2e6949b95d..2c78479636 100644 --- a/isis/src/control/apps/findfeatures/MSDAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/MSDAlgorithm.cpp @@ -161,7 +161,7 @@ namespace Isis { * to set algorithm parameters." */ int MSDAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "MSDAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "MSDAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/MSERAlgorithm.cpp b/isis/src/control/apps/findfeatures/MSERAlgorithm.cpp index c098900b0f..4ea923f47d 100644 --- a/isis/src/control/apps/findfeatures/MSERAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/MSERAlgorithm.cpp @@ -159,7 +159,7 @@ namespace Isis { * to set algorithm parameters." */ int MSERAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "MSERAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "MSERAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/MSERExtractor.cpp b/isis/src/control/apps/findfeatures/MSERExtractor.cpp index 0df2ea05b9..8bf82081e5 100644 --- a/isis/src/control/apps/findfeatures/MSERExtractor.cpp +++ b/isis/src/control/apps/findfeatures/MSERExtractor.cpp @@ -26,7 +26,7 @@ namespace Isis { void MSERExtractor::detectRegions (cv::InputArray image, std::vector< std::vector< cv::Point > > &msers, std::vector< cv::Rect > &bboxes) { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -40,7 +40,7 @@ namespace Isis { * algorithm." */ int MSERExtractor::getDelta () const { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -54,7 +54,7 @@ namespace Isis { * algorithm." */ int MSERExtractor::getMaxArea () const { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -68,7 +68,7 @@ namespace Isis { * algorithm." */ int MSERExtractor::getMinArea () const { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -82,7 +82,7 @@ namespace Isis { * algorithm." */ bool MSERExtractor::getPass2Only () const { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -96,7 +96,7 @@ namespace Isis { * algorithm." */ void MSERExtractor::setDelta (int delta) { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -110,7 +110,7 @@ namespace Isis { * algorithm." */ void MSERExtractor::setMaxArea (int maxArea) { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -124,7 +124,7 @@ namespace Isis { * algorithm." */ void MSERExtractor::setMinArea (int minArea) { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -138,7 +138,7 @@ namespace Isis { * algorithm." */ void MSERExtractor::setPass2Only (bool f) { - QString mess = "ISIS does not support this method for the OpenCV MSER algorithm."; + std::string mess = "ISIS does not support this method for the OpenCV MSER algorithm."; throw IException(IException::Programmer, mess, _FILEINFO_); } }; diff --git a/isis/src/control/apps/findfeatures/MatchMaker.cpp b/isis/src/control/apps/findfeatures/MatchMaker.cpp index a2d073653a..5e219852df 100644 --- a/isis/src/control/apps/findfeatures/MatchMaker.cpp +++ b/isis/src/control/apps/findfeatures/MatchMaker.cpp @@ -86,7 +86,7 @@ MatchImage &MatchMaker::train(const int &index) { void MatchMaker::setGeometrySourceFlag(const MatchMaker::GeometrySourceFlag &source) { if ( (Train == source) && ( size() > 1) ) { - QString mess = "Cannot choose Train image as geometry source when matching " + std::string mess = "Cannot choose Train image as geometry source when matching " "more than one train image to match"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -99,7 +99,7 @@ MatchMaker::GeometrySourceFlag MatchMaker::getGeometrySourceFlag() const { MatchImage MatchMaker::getGeometrySource() const { if ( ( Train == m_geomFlag ) && ( size() > 1) ) { - QString mess = "Cannot choose Train image as geometry source when matching " + std::string mess = "Cannot choose Train image as geometry source when matching " "more than one train image to match"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/MatchPair.h b/isis/src/control/apps/findfeatures/MatchPair.h index eac16539e7..34e42dc683 100644 --- a/isis/src/control/apps/findfeatures/MatchPair.h +++ b/isis/src/control/apps/findfeatures/MatchPair.h @@ -227,7 +227,7 @@ class MatchPair { return ( m_data->m_errors.at(index) ); } - QString errors(const QString &separator = "\n") { + std::string errors(const QString &separator = "\n") { return ( m_data->m_errors.join(separator)); } diff --git a/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp b/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp index f7080efab4..81917f2a95 100644 --- a/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp +++ b/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp @@ -75,7 +75,7 @@ namespace Isis { } else { if ( !m_detector->hasDetector() ) { - QString mess = "Detector " + detector().name() + " does not possess detector capabilities"; + std::string mess = "Detector " + detector().name() + " does not possess detector capabilities"; ie.append(IException(IException::Programmer, mess,_FILEINFO_)); nerrors++; } @@ -99,7 +99,7 @@ namespace Isis { } else { if ( !m_extractor->hasExtractor() ) { - QString mess = "Extractor " + extractor().name() + " does not possess extractor capabilities"; + std::string mess = "Extractor " + extractor().name() + " does not possess extractor capabilities"; ie.append(IException(IException::Programmer, mess,_FILEINFO_)); nerrors++; } @@ -123,7 +123,7 @@ namespace Isis { } else { if ( !m_matcher->hasMatcher() ) { - QString mess = "Matcher " + matcher().name() + " does not possess matcher capabilities"; + std::string mess = "Matcher " + matcher().name() + " does not possess matcher capabilities"; ie.append(IException(IException::Programmer, mess,_FILEINFO_)); nerrors++; } @@ -132,7 +132,7 @@ namespace Isis { // Shall we throw an exception to report the issues? if ( (0 < nerrors) && (true == throwOnErrors)) { - QString mess = "There were " + QString::number(nerrors) + + std::string mess = "There were " + QString::number(nerrors) + " errors found in this matcher algorithm set"; ie.append(IException(IException::Programmer, mess, _FILEINFO_)); throw ie; diff --git a/isis/src/control/apps/findfeatures/ORBAlgorithm.cpp b/isis/src/control/apps/findfeatures/ORBAlgorithm.cpp index 6069fe5ec6..1e66ae68d4 100644 --- a/isis/src/control/apps/findfeatures/ORBAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/ORBAlgorithm.cpp @@ -201,7 +201,7 @@ namespace Isis { } } catch (std::exception &e) { - QString msg = "The input value [" + value + + std::string msg = "The input value [" + value + "] is not valid for ORB's [Type] variable"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/QDebugLogger.h b/isis/src/control/apps/findfeatures/QDebugLogger.h index 3a530b6605..37d5181ed0 100644 --- a/isis/src/control/apps/findfeatures/QDebugLogger.h +++ b/isis/src/control/apps/findfeatures/QDebugLogger.h @@ -72,8 +72,8 @@ class QDebugLogger { if ( filename.isEmpty() ) { return ( toStdOut() ); } // Set up file access logging - FileName t_fname(filename); - QScopedPointer t_dbugfile( QDebugLogger::open( t_fname.expanded(), omode) ); + FileName t_fname(filename.toStdString()); + QScopedPointer t_dbugfile( QDebugLogger::open( QString::fromStdString(t_fname.expanded()), omode) ); QScopedPointer t_dbuglog( new QDebugStreamType( t_dbugfile.data() ) ); return ( QDebugStream( new QDebugLogger( t_dbugfile.take(), t_dbuglog.take() ) ) ); } @@ -164,10 +164,10 @@ class QDebugLogger { /** Method creates a QFile from a filename */ static QFile *open(const QString &filename, const QIODevice::OpenMode &omode) { - FileName t_fname(filename); - QScopedPointer t_dbugfile(new QFile( t_fname.expanded() ) ); + FileName t_fname(filename.toStdString()); + QScopedPointer t_dbugfile(new QFile( QString::fromStdString(t_fname.expanded()) ) ); if ( !t_dbugfile->open(omode) ) { - QString mess = "Unable to open/create debug log stream for file: " + + std::string mess = "Unable to open/create debug log stream for file: " + filename; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/RobustMatcher.cpp b/isis/src/control/apps/findfeatures/RobustMatcher.cpp index d33eceb101..3b4f450816 100644 --- a/isis/src/control/apps/findfeatures/RobustMatcher.cpp +++ b/isis/src/control/apps/findfeatures/RobustMatcher.cpp @@ -131,15 +131,15 @@ MatchPair RobustMatcher::match(MatchImage &query, MatchImage &train) const { if ( toBool(m_parameters.get("SaveRenderedImages")) ) { QString savepath = m_parameters.get("SavePath"); - FileName qfile(v_query.source().name()); - QString qfout = savepath + "/" + qfile.baseName() + "_query.png"; - FileName oqfile(qfout); - imwrite( oqfile.expanded().toStdString(), i_query); - - FileName tfile(v_train.source().name()); - QString tfout = savepath + "/" + tfile.baseName() + "_train.png"; - FileName otfile(tfout); - imwrite( otfile.expanded().toStdString(), i_train); + FileName qfile(v_query.source().name().toStdString()); + QString qfout = savepath + "/" + QString::fromStdString(qfile.baseName()) + "_query.png"; + FileName oqfile(qfout.toStdString()); + imwrite( oqfile.expanded(), i_query); + + FileName tfile(v_train.source().name().toStdString()); + QString tfout = savepath + "/" + QString::fromStdString(tfile.baseName()) + "_train.png"; + FileName otfile(tfout.toStdString()); + imwrite( otfile.expanded(), i_train); } if ( isDebug() ) { @@ -237,7 +237,7 @@ MatchPair RobustMatcher::match(MatchImage &query, MatchImage &train) const { v_pair.addTime(mtime); } catch ( cv::Exception &c ) { - QString mess = "Outlier removal process failed on image pair: " + std::string mess = "Outlier removal process failed on image pair: " " Query: " + v_query.name() + ", Train: " + v_train.name() + ". CV::Error - " + c.what(); @@ -250,7 +250,7 @@ MatchPair RobustMatcher::match(MatchImage &query, MatchImage &train) const { } } catch ( IException &ie) { - QString mess = "Outlier removal process failed on Query/Train image pair " + std::string mess = "Outlier removal process failed on Query/Train image pair " " Query: " + v_query.name() + ", Train: " + v_train.name(); // throw IException(ie, IException::Programmer, mess, _FILEINFO_); @@ -287,7 +287,7 @@ MatchPairQList RobustMatcher::match(MatchImage &query, } if (trainers.size() == 0 ) { - QString mess = "No trainer images provided!!"; + std::string mess = "No trainer images provided!!"; if (isDebug() ) logger() << " " << mess << "\n"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -308,10 +308,10 @@ MatchPairQList RobustMatcher::match(MatchImage &query, if ( true == saveRendered ) { // Save the query image first - FileName qfile(v_query.source().name()); - QString qfout = savepath + "/" + qfile.baseName() + "_query.png"; - FileName oqfile(qfout); - imwrite( oqfile.expanded().toStdString(), i_query); + FileName qfile(v_query.source().name().toStdString()); + QString qfout = savepath + "/" + QString::fromStdString(qfile.baseName()) + "_query.png"; + FileName oqfile(qfout.toStdString()); + imwrite( oqfile.expanded(), i_query); } // Now process the rest of the trainer images @@ -319,10 +319,10 @@ MatchPairQList RobustMatcher::match(MatchImage &query, i_trainers.push_back(v_trainers[i].image()); if ( true == saveRendered ) { - FileName tfile(v_trainers[i].source().name()); - QString tfout = savepath + "/" + tfile.baseName() + "_train.png"; - FileName ofile(tfout); - imwrite( ofile.expanded().toStdString(), i_trainers[i]); + FileName tfile(v_trainers[i].source().name().toStdString()); + QString tfout = savepath + "/" + QString::fromStdString(tfile.baseName()) + "_train.png"; + FileName ofile(tfout.toStdString()); + imwrite( ofile.expanded(), i_trainers[i]); } } @@ -467,7 +467,7 @@ MatchPairQList RobustMatcher::match(MatchImage &query, pairs.push_back( v_pair ); } catch ( cv::Exception &c ) { - QString mess = "Outlier removal process failed on Query/Train image pair " + std::string mess = "Outlier removal process failed on Query/Train image pair " " Query=" + v_query.name() + ", Train[" + QString::number(i) + "]: " + v_train.name() + ". cv::Error - " + c.what(); @@ -481,7 +481,7 @@ MatchPairQList RobustMatcher::match(MatchImage &query, } } catch ( IException &ie) { - QString mess = "Outlier removal process failed on Query/Train image pair " + std::string mess = "Outlier removal process failed on Query/Train image pair " " Query=" + v_query.name() + ", Train[" + QString::number(i) + "]: " + v_train.name(); // throw IException(ie, IException::Programmer, mess, _FILEINFO_); @@ -558,7 +558,7 @@ bool RobustMatcher::removeOutliers(const cv::Mat &queryDescriptors, 2); // return 2 nearest neighbours } catch (cv::Exception &e) { - QString mess = "RobustMatcher::MatcherFailed: "+ QString(e.what()) + + std::string mess = "RobustMatcher::MatcherFailed: "+ QString(e.what()) + " - if its an assertion failure, you may be enabling " "crosschecking with a BFMatcher. Must use a FlannBased " "matcher if you want inherent ratio testing. " @@ -836,7 +836,7 @@ cv::Mat RobustMatcher::ransacTest(const std::vector& matches, inliers); // match status (inlier or outlier)) } catch ( cv::Exception &e ) { - QString mess = "1st fundamental (epipolar) test failed!" + std::string mess = "1st fundamental (epipolar) test failed!" " QueryPoints=" + QString::number(points1.size()) + ", TrainPoints=" + QString::number(points2.size()) + ". cv::Error - " + e.what(); @@ -901,7 +901,7 @@ cv::Mat RobustMatcher::ransacTest(const std::vector& matches, } catch ( cv::Exception &e ) { outMatches.clear(); - QString mess = "2st fundamental (epipolar) test failed!" + std::string mess = "2st fundamental (epipolar) test failed!" " QueryPoints=" + QString::number(points1.size()) + ", TrainPoints=" + QString::number(points2.size()) + ". CV::Error - " + e.what(); @@ -1074,7 +1074,7 @@ cv::Mat RobustMatcher::computeHomography(const std::vector& query, } } catch ( cv::Exception &e ) { - QString mess = "RobustMatcher::HomographyFailed: with cv::Error - "+ + std::string mess = "RobustMatcher::HomographyFailed: with cv::Error - "+ QString(e.what()); if ( onErrorThrow ) throw IException(IException::Programmer, mess , _FILEINFO_); else if ( isDebug() ) { diff --git a/isis/src/control/apps/findfeatures/SIFTAlgorithm.cpp b/isis/src/control/apps/findfeatures/SIFTAlgorithm.cpp index 608c6888af..c4f3f27f17 100644 --- a/isis/src/control/apps/findfeatures/SIFTAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/SIFTAlgorithm.cpp @@ -153,7 +153,7 @@ namespace Isis { * @return @b int -1 Cannot set the Algorithm Variables */ int SIFTAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString message = "SIFT does not have the ability to set algorithm parameters."; + std::string message = "SIFT does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, message, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/StarAlgorithm.cpp b/isis/src/control/apps/findfeatures/StarAlgorithm.cpp index e1798424ee..940a8bc60f 100644 --- a/isis/src/control/apps/findfeatures/StarAlgorithm.cpp +++ b/isis/src/control/apps/findfeatures/StarAlgorithm.cpp @@ -153,7 +153,7 @@ namespace Isis { * to set algorithm parameters." */ int StarAlgorithm::setAlgorithmVariables(const PvlFlatMap &variables) { - QString msg = "StarAlgorithm does not have the ability to set algorithm parameters."; + std::string msg = "StarAlgorithm does not have the ability to set algorithm parameters."; throw IException(IException::Programmer, msg, _FILEINFO_); return (-1); diff --git a/isis/src/control/apps/findfeatures/findfeatures.cpp b/isis/src/control/apps/findfeatures/findfeatures.cpp index c76402ee62..e9a5bc3fab 100644 --- a/isis/src/control/apps/findfeatures/findfeatures.cpp +++ b/isis/src/control/apps/findfeatures/findfeatures.cpp @@ -82,8 +82,8 @@ namespace Isis { static void writeInfo(const QString &toname, Pvl &data, UserInterface &ui, Pvl *log) { if ( !toname.isEmpty() ) { - FileName toinfo(toname); - QString fname = toinfo.expanded(); + FileName toinfo(toname.toStdString()); + QString fname = QString::fromStdString(toinfo.expanded()); data.write(fname.toStdString()); } else { @@ -350,15 +350,15 @@ namespace Isis { if ( ui.WasEntered("FROM") ) { QString tname = ui.GetAsString("FROM"); if ( !load_train_with_geom(matcher, tname, logger, fastgeom.data()) ) { - badgeom.append(tname); + badgeom.append(tname.toStdString()); } } // If there is a list provided, get that too if ( ui.WasEntered("FROMLIST") ) { - FileList trainers(ui.GetFileName("FROMLIST")); + FileList trainers(ui.GetFileName("FROMLIST").toStdString()); BOOST_FOREACH ( FileName tfile, trainers ) { - if ( !load_train_with_geom(matcher, tfile.original(), logger, + if ( !load_train_with_geom(matcher, QString::fromStdString(tfile.original()), logger, fastgeom.data()) ) { badgeom.append(tfile.original()); } @@ -373,12 +373,12 @@ namespace Isis { if ( badgeom.size() > 0 ) { logger->dbugout() << "\nTotal failed image loads/FastGeoms excluded: " << badgeom.size() << "\n"; for ( int f = 0 ; f < badgeom.size() ; f++ ) { - logger->dbugout() << badgeom[f].toString() << "\n"; + logger->dbugout() <dbugout() << "\nSee also " << tonogeom << "\n\n"; } } @@ -387,7 +387,7 @@ namespace Isis { logger->flush(); } catch (IException &ie) { - QString msg = "Fatal load errors encountered"; + std::string msg = "Fatal load errors encountered"; logger->dbugout() << "\n\n### " << msg << " - aborting..." << "\n"; throw IException(ie, IException::Programmer, msg, _FILEINFO_); } @@ -396,7 +396,7 @@ namespace Isis { if ( matcher.size() <= 0 ) { logger->dbugout() << "\n\n### No valid files loaded - aborting...\n"; logger->dbugout() << "Time: " << Application::DateTime() << "\n"; - QString msg = "Input cubes (" + QString::number(badgeom.size()) + ") failed to load. " + + std::string msg = "Input cubes (" + QString::number(badgeom.size()) + ") failed to load. " + "Must provide valid FROM/FROMLIST and MATCH cube or image filenames"; throw IException(IException::User, msg, _FILEINFO_); } @@ -429,7 +429,7 @@ namespace Isis { // If all failed, we're done if ( !best ) { logger->dbugout() << "Bummer! No matches were found!\n"; - QString mess = "NO MATCHES WERE FOUND!!!"; + std::string mess = "NO MATCHES WERE FOUND!!!"; throw IException(IException::User, mess, _FILEINFO_); } @@ -437,7 +437,7 @@ namespace Isis { if ( best->size() <= 0 ) { logger->dbugout() << "Shucks! Insufficient matches were found (" << best->size() << ")\n"; - QString mess = "Shucks! Insufficient matches were found (" + + std::string mess = "Shucks! Insufficient matches were found (" + QString::number(best->size()) + ")"; throw IException(IException::User, mess, _FILEINFO_); } @@ -473,7 +473,7 @@ namespace Isis { PvlGroup cnetinfo = matcher.network(cnet, *best, pointId); if ( cnet.GetNumPoints() <= 0 ) { - QString mess = "No control points found!!"; + std::string mess = "No control points found!!"; logger->dbugout() << mess << "\n"; // Get total elapded time diff --git a/isis/src/control/apps/jigsaw/jigsaw.cpp b/isis/src/control/apps/jigsaw/jigsaw.cpp index b58c17ebe4..f7dc18e569 100644 --- a/isis/src/control/apps/jigsaw/jigsaw.cpp +++ b/isis/src/control/apps/jigsaw/jigsaw.cpp @@ -188,7 +188,7 @@ namespace Isis { QObject::connect( bundleAdjustment, SIGNAL( statusUpdate(QString) ), bundleAdjustment, SLOT( outputBundleStatus(QString) ) ); BundleSolutionInfo *bundleSolution = bundleAdjustment->solveCholeskyBR(); - bundleSolution->setOutputControlName( FileName(ui.GetFileName("ONET")).expanded() ); + bundleSolution->setOutputControlName( QString::fromStdString(FileName(ui.GetFileName("ONET").toStdString()).expanded()) ); cout << "\nGenerating report files\n" << endl; // write output files @@ -215,16 +215,15 @@ namespace Isis { // write updated control net bundleAdjustment->controlNet()->Write(ui.GetFileName("ONET")); - // write updated lidar data file - if (ui.WasEntered("LIDARDATA")) { - if (ui.GetString("OLIDARFORMAT") == "JSON") { - bundleAdjustment->lidarData()->write(ui.GetFileName("OLIDARDATA"),LidarData::Format::Json); - } - else { - bundleAdjustment->lidarData()->write(ui.GetFileName("OLIDARDATA"),LidarData::Format::Binary); - } + // write updated lidar data file + if (ui.WasEntered("LIDARDATA")) { + if (ui.GetString("OLIDARFORMAT") == "JSON") { + bundleAdjustment->lidarData()->write(ui.GetFileName("OLIDARDATA").toStdString(),LidarData::Format::Json); } - + else { + bundleAdjustment->lidarData()->write(ui.GetFileName("OLIDARDATA").toStdString(),LidarData::Format::Binary); + } + } PvlGroup gp("JigsawResults"); QString jigComment = "Jigged = " + Isis::iTime::CurrentLocalTime(); @@ -268,7 +267,7 @@ namespace Isis { if (ui.GetBoolean("UPDATE") ) { if ( !bundleAdjustment->isConverged() ) { gp += PvlKeyword("Status","Bundle did not converge, camera pointing NOT updated"); - QString msg = "Bundle did not converge within MAXITS [" + toString(ui.GetInteger("MAXITS")) + "] iterations [" + cnetFile + "]"; + std::string msg = "Bundle did not converge within MAXITS [" + toString(ui.GetInteger("MAXITS")) + "] iterations [" + cnetFile + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } else { @@ -335,7 +334,7 @@ namespace Isis { } catch(IException &e) { bundleAdjustment->controlNet()->Write(ui.GetFileName("ONET")); - QString msg = "Unable to bundle adjust network [" + cnetFile + "]"; + std::string msg = "Unable to bundle adjust network [" + cnetFile + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -433,9 +432,9 @@ namespace Isis { if (ui.GetBoolean("SOLVETARGETBODY") == true) { PvlObject obj; ui.GetFileName("TBPARAMETERS"); - Pvl tbParPvl(FileName(ui.GetFileName("TBPARAMETERS")).expanded().toStdString()); + Pvl tbParPvl(FileName(ui.GetFileName("TBPARAMETERS").toStdString()).expanded()); if (!tbParPvl.hasObject("Target")) { - QString msg = "Input Target parameters file missing main Target object"; + std::string msg = "Input Target parameters file missing main Target object"; throw IException(IException::User, msg, _FILEINFO_); } @@ -494,7 +493,7 @@ namespace Isis { // Inform the user which images are not in the second list if (!imagesNotFound.isEmpty()) { - QString msg = "The following images are not in the FROMLIST:"; + std::string msg = "The following images are not in the FROMLIST:"; msg += imagesNotFound + "."; throw IException(IException::User, msg, _FILEINFO_); } @@ -510,10 +509,10 @@ namespace Isis { if (ui.WasEntered("SCCONFIG")) { PvlObject obj; - Pvl scConfig(FileName(ui.GetFileName("SCCONFIG")).expanded().toStdString()); + Pvl scConfig(FileName(ui.GetFileName("SCCONFIG").toStdString()).expanded()); // QMap instIDtoBOSS; if (!scConfig.hasObject("SensorParameters")) { - QString msg = "Input SCCONFIG file missing SensorParameters object"; + std::string msg = "Input SCCONFIG file missing SensorParameters object"; throw IException(IException::User, msg, _FILEINFO_); } @@ -538,7 +537,7 @@ namespace Isis { } } if (!found){ - QString msg = "No BundleObservationSolveSettings found for " + snInstId; + std::string msg = "No BundleObservationSolveSettings found for " + snInstId; throw IException(IException::User, msg, _FILEINFO_); } } @@ -601,7 +600,7 @@ namespace Isis { if ((ui.WasEntered("CSMSOLVESET") && ui.WasEntered("CSMSOLVETYPE")) || (ui.WasEntered("CSMSOLVESET") && ui.WasEntered("CSMSOLVELIST")) || (ui.WasEntered("CSMSOLVETYPE") && ui.WasEntered("CSMSOLVELIST")) ) { - QString msg = "Only one of CSMSOLVESET, CSMSOLVETYPE, and CSMSOLVELIST " + std::string msg = "Only one of CSMSOLVESET, CSMSOLVETYPE, and CSMSOLVELIST " "can be specified at a time."; throw IException(IException::User, msg, _FILEINFO_); } @@ -738,7 +737,7 @@ namespace Isis { pt->SetAprioriSurfacePoint(cam->GetSurfacePoint()); } else { - QString msg = "Cannot compute surface point for control point [" + pt->GetId() + + std::string msg = "Cannot compute surface point for control point [" + pt->GetId() + "], measure [" + cm->GetCubeSerialNumber() + "]."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/mat2cnet/main.cpp b/isis/src/control/apps/mat2cnet/main.cpp index da42ab7af6..589e7b9a2b 100644 --- a/isis/src/control/apps/mat2cnet/main.cpp +++ b/isis/src/control/apps/mat2cnet/main.cpp @@ -52,7 +52,7 @@ void IsisMain() { progress.CheckStatus(); if (list2.size() != snl.size()) { - QString msg = "Invalid input file number of lines. The ISIS2 file list ["; + std::string msg = "Invalid input file number of lines. The ISIS2 file list ["; msg += ui.GetAsString("LIST2") + "] must contain the same number of lines "; msg += "as the ISIS file list [" + ui.GetAsString("LIST3") + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -166,7 +166,7 @@ void IsisMain() { progress.CheckStatus(); } catch (IException &e) { - QString msg = "\"Matchpoint total\" keyword at the top of the match point " + std::string msg = "\"Matchpoint total\" keyword at the top of the match point " "file ["; msg += ui.GetAsString("MATCH") + "] equals [" + toString(inTotalMeas); msg += "] and is likely incorrect. Number of measures in match point file" @@ -200,7 +200,7 @@ void IsisMain() { diam = toDouble(tokens.takeFirst()); // Diameter, in case of a crater } catch (IException &e) { - QString msg = "Invalid value(s) in match point file ["; + std::string msg = "Invalid value(s) in match point file ["; msg += ui.GetAsString("MATCH") + "] at line [" + toString(line); msg += "]. Verify line, sample, diameter values are doubles."; throw IException(e, IException::User, msg, _FILEINFO_); @@ -211,7 +211,7 @@ void IsisMain() { cmeasure->SetCubeSerialNumber(snMap[toInt(fsc)]); if (snMap[toInt(fsc)].isEmpty()) { - QString msg = "None of the images specified in the ISIS2 file list ["; + std::string msg = "None of the images specified in the ISIS2 file list ["; msg += ui.GetAsString("LIST2"); msg += "] have an IMAGE_NUMBER or IMAGE_ID that matches the FSC [" + fsc; msg += "], from the match point file [" + ui.GetAsString("MATCH"); @@ -242,7 +242,7 @@ void IsisMain() { cmeasure->SetType(ControlMeasure::Candidate); } else { - QString msg = "Unknown measurment type [" + matClass + "] "; + std::string msg = "Unknown measurment type [" + matClass + "] "; msg += "in match point file [" + ui.GetAsString("MATCH") + "] "; msg += "at line [" + toString(line) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -281,7 +281,7 @@ void IsisMain() { } } catch (IException &e) { - QString msg = "Invalid match point file [" + ui.GetAsString("MATCH") +"]"; + std::string msg = "Invalid match point file [" + ui.GetAsString("MATCH") +"]"; msg += ". Repeated PointID/FSC combination [" + pid + ", " + fsc; msg += "] in match point file at line [" + toString(line) + "]."; throw IException(e, IException::User, msg, _FILEINFO_); @@ -293,7 +293,7 @@ void IsisMain() { progress.CheckStatus(); } catch (IException &e) { - QString msg = "\"Matchpoint total\" keyword at the top of the match point " + std::string msg = "\"Matchpoint total\" keyword at the top of the match point " "file ["; msg += ui.GetAsString("MATCH") + "] equals [" + toString(inTotalMeas); msg += "] and is likely incorrect. Number of measures in match point file " @@ -326,7 +326,7 @@ void IsisMain() { progress.CheckStatus(); } catch (IException &e) { - QString msg = "RAND PPP file may not be valid. Line count calculated ["; + std::string msg = "RAND PPP file may not be valid. Line count calculated ["; msg += toString(inTotalLine) + "] for RAND PPP file ["; msg += ui.GetAsString("PPP") + "] appears invalid at line ["; msg += toString(line) + "]."; @@ -362,7 +362,7 @@ void IsisMain() { lat = toDouble(col1); } catch (IException &e) { - QString msg = "Invalid value(s) in RAND PPP file ["; + std::string msg = "Invalid value(s) in RAND PPP file ["; msg += ui.GetAsString("PPP") + "] at line [" + toString(line); msg += "]. Verify latitude value is a double."; throw IException(e, IException::User, msg, _FILEINFO_); @@ -378,7 +378,7 @@ void IsisMain() { lon = toDouble(col2); } catch (IException &e) { - QString msg = "Invalid value(s) in RAND PPP file ["; + std::string msg = "Invalid value(s) in RAND PPP file ["; msg += ui.GetAsString("PPP") + "] at line [" + toString(line); msg += "]. Verify longitude value is a double."; throw IException(e, IException::User, msg, _FILEINFO_); @@ -395,7 +395,7 @@ void IsisMain() { rad = rad * 1000; } catch (IException &e) { - QString msg = "Invalid value(s) in RAND PPP file ["; + std::string msg = "Invalid value(s) in RAND PPP file ["; msg += ui.GetAsString("PPP") + "] at line [" + toString(line); msg += "]. Verify radius value is a double."; throw IException(e, IException::User, msg, _FILEINFO_); @@ -406,7 +406,7 @@ void IsisMain() { // remove any white space from beginning of string pid = pid.remove(QRegExp("^ *")); if (pid.length() > 7) { - QString msg = "Invalid value(s) in RAND PPP file ["; + std::string msg = "Invalid value(s) in RAND PPP file ["; msg += ui.GetAsString("PPP") + "] at line [" + toString(line); msg += "]. Point ID [" + pid + "] has more than 7 characters."; throw IException(IException::User, msg, _FILEINFO_); @@ -445,7 +445,7 @@ void IsisMain() { cpoint->SetEditLock(ui.GetBoolean("POINTLOCK")); } catch (IException &e) { - QString msg = "Unable to set universal ground point to control " + std::string msg = "Unable to set universal ground point to control " "network from line ["; msg += toString(line) + "] of RAND PPP file ["; msg += ui.GetAsString("PPP") + "]"; @@ -459,7 +459,7 @@ void IsisMain() { progress.CheckStatus(); } catch (IException &e) { - QString msg = "RAND PPP file may not be valid. Line count calculated ["; + std::string msg = "RAND PPP file may not be valid. Line count calculated ["; msg += toString(inTotalLine) + "] for RAND PPP file ["; msg += ui.GetAsString("PPP"); msg += "] appears invalid at line [" + toString(line) + "]."; diff --git a/isis/src/control/apps/pointreg/pointreg.cpp b/isis/src/control/apps/pointreg/pointreg.cpp index 06d6042ec0..23104041da 100644 --- a/isis/src/control/apps/pointreg/pointreg.cpp +++ b/isis/src/control/apps/pointreg/pointreg.cpp @@ -67,10 +67,10 @@ namespace Isis { m_test = test; m_pointId = registered->Parent()->GetId(); - m_heldId = FileName( - files->fileName(held->GetCubeSerialNumber())).baseName(); - m_registeredId = FileName( - files->fileName(registered->GetCubeSerialNumber())).baseName(); + m_heldId = QString::fromStdString(FileName( + files->fileName(held->GetCubeSerialNumber()).toStdString()).baseName()); + m_registeredId = QString::fromStdString(FileName( + files->fileName(registered->GetCubeSerialNumber()).toStdString()).baseName()); m_aprioriSample = registered->GetSample(); m_aprioriLine = registered->GetLine(); @@ -240,7 +240,7 @@ namespace Isis { ControlNet outNet(ui.GetFileName("CNET")); if (outNet.GetNumPoints() <= 0) { - QString msg = "Control network [" + ui.GetFileName("CNET") + "] "; + std::string msg = "Control network [" + ui.GetFileName("CNET") + "] "; msg += "contains no points"; throw IException(IException::User, msg, _FILEINFO_); } @@ -259,7 +259,7 @@ namespace Isis { // Get the maximum allowable number of open files struct rlimit limit; if (getrlimit(RLIMIT_NOFILE, &limit) != 0) { - QString msg = "Cannot read the maximum allowable open files from system resources."; + std::string msg = "Cannot read the maximum allowable open files from system resources."; throw IException(IException::Programmer, msg, _FILEINFO_); } // Allow for library files, etc @@ -364,7 +364,7 @@ namespace Isis { // The flatfile is comma seperated and can be imported into an excel // spreadsheet if (ui.WasEntered("FLATFILE")) { - QString fFile = FileName(ui.GetFileName("FLATFILE")).expanded(); + QString fFile = QString::fromStdString(FileName(ui.GetFileName("FLATFILE").toStdString()).expanded()); ofstream os; os.open(fFile.toLatin1().data(), ios::out); @@ -397,7 +397,7 @@ namespace Isis { QString pointId = outPoint->GetId(); QString fullName = files->fileName(cmTrans->GetCubeSerialNumber()); - QString filename = FileName(fullName).baseName(); + QString filename = QString::fromStdString(FileName(fullName.toStdString()).baseName()); QString measureType = cmTrans->MeasureTypeToString( cmTrans->GetType()); @@ -454,7 +454,7 @@ namespace Isis { } if (logFalsePositives) { - QString filename = FileName(ui.GetFileName("FALSEPOSITIVES")).expanded(); + QString filename = QString::fromStdString(FileName(ui.GetFileName("FALSEPOSITIVES").toStdString()).expanded()); ofstream os; os.open(filename.toLatin1().data(), ios::out); diff --git a/isis/src/control/apps/seedgrid/main.cpp b/isis/src/control/apps/seedgrid/main.cpp index 5f4ac9684f..f0ba1eb044 100644 --- a/isis/src/control/apps/seedgrid/main.cpp +++ b/isis/src/control/apps/seedgrid/main.cpp @@ -54,7 +54,7 @@ void IsisMain() { ui.PutAsString("TARGET", target); } else { - QString msg = "A target must be specified either by the [TARGET] " + std::string msg = "A target must be specified either by the [TARGET] " "parameter or included as a value for keyword [TargetName] in the " "projection file [MAP]."; throw IException(IException::User, msg, _FILEINFO_); @@ -74,7 +74,7 @@ void IsisMain() { mapGroup += PvlKeyword("PolarRadius", pvlRadii["PolarRadius"], "Meters"); } catch (IException &e) { - QString msg = "Unable to get target radii values from the given target [" + target + "]. " + std::string msg = "Unable to get target radii values from the given target [" + target + "]. " "User must add EquatorialRadius and PolarRadius values to the input MAP file."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -132,7 +132,7 @@ void IsisMain() { double minX, minY, maxX, maxY; bool foundRange = proj->XYRange(minX, maxX, minY, maxY); if (!foundRange) { - QString msg = "Cannot convert Lat/Long range to an X/Y range"; + std::string msg = "Cannot convert Lat/Long range to an X/Y range"; throw IException(IException::User, msg, _FILEINFO_); } @@ -238,18 +238,18 @@ void IsisMain() { void checkLatitude(double minLat, double maxLat) { if (minLat > maxLat) { - QString msg = "MINLAT [" + toString(minLat) + + std::string msg = "MINLAT [" + toString(minLat) + "] is greater than MAXLAT [" + toString(maxLat) + "]"; throw IException(IException::User, msg, _FILEINFO_); } if (minLat < -90) { - QString msg = "MINLAT [" + toString(minLat) + "] is less than -90"; + std::string msg = "MINLAT [" + toString(minLat) + "] is less than -90"; throw IException(IException::User, msg, _FILEINFO_); } if (maxLat > 90) { - QString msg = "MAXLAT [" + toString(maxLat) + "] is greater than 90"; + std::string msg = "MAXLAT [" + toString(maxLat) + "] is greater than 90"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -258,7 +258,7 @@ void checkLatitude(double minLat, double maxLat) { void checkLongitude(double minLon, double maxLon, int lonDomain) { if (minLon > maxLon) { double suggestedMaxLon = maxLon + lonDomain + (lonDomain - 360); - QString msg = "MINLON [" + toString(minLon) + + std::string msg = "MINLON [" + toString(minLon) + "] is greater than MAXLON [" + toString(maxLon) + "]. " + "If you meant to wrap around the [" + toString(lonDomain) + "] longitude " + "boundary, use a MAXLON of [" + @@ -267,7 +267,7 @@ void checkLongitude(double minLon, double maxLon, int lonDomain) { } if (minLon < lonDomain - 360) { - QString msg = "MINLON [" + toString(minLon) + + std::string msg = "MINLON [" + toString(minLon) + "] is less than [" + toString(lonDomain) + "] domain minimum [" + toString(lonDomain - 360) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -276,7 +276,7 @@ void checkLongitude(double minLon, double maxLon, int lonDomain) { if (maxLon - minLon > 360) { int range = (int) (maxLon - minLon - 1); int loops = range / 360 + 1; - QString msg = "The specified longitude range [" + toString(minLon) + + std::string msg = "The specified longitude range [" + toString(minLon) + "] to [" + toString(maxLon) + "] seeds that same area of the target [" + toString(loops) + "] times"; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/control/apps/slither/ControlByRow.h b/isis/src/control/apps/slither/ControlByRow.h index 3b0fc13bc2..7a14570b65 100644 --- a/isis/src/control/apps/slither/ControlByRow.h +++ b/isis/src/control/apps/slither/ControlByRow.h @@ -221,7 +221,7 @@ namespace Isis { return (computeStats(_rowList.getNth(i))); } catch(IException &oor) { - QString msg = "Requested value (" + toString(i) + ") not found"; + std::string msg = "Requested value (" + toString(i) + ") not found"; throw IException(oor, IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/control/apps/slither/main.cpp b/isis/src/control/apps/slither/main.cpp index 6dcf03c6cb..003ed86330 100644 --- a/isis/src/control/apps/slither/main.cpp +++ b/isis/src/control/apps/slither/main.cpp @@ -91,7 +91,7 @@ void IsisMain() { interp = new Interpolator(Interpolator::CubicConvolutionType); } else { - QString msg = "Unknown value for INTERP [" + + std::string msg = "Unknown value for INTERP [" + ui.GetString("INTERP") + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/apps/sumspice/SumFile.cpp b/isis/src/control/apps/sumspice/SumFile.cpp index 3b5396e888..8f2c4511f2 100644 --- a/isis/src/control/apps/sumspice/SumFile.cpp +++ b/isis/src/control/apps/sumspice/SumFile.cpp @@ -159,7 +159,7 @@ namespace Isis { Table table = oldRotation->Cache("InstrumentPointing"); if ( table.Records() > 1 ) { - QString message = "Expected/support only one InstrumentPointing record " + std::string message = "Expected/support only one InstrumentPointing record " "(i.e., Framing camera) but got " + toString(table.Records()) + " for file " + cube.fileName(); throw IException(IException::User, message, _FILEINFO_); @@ -167,7 +167,7 @@ namespace Isis { TableRecord &rec0 = table[0]; if ( rec0.Fields() < 5 ) { - QString message = "Expected/support quaternion Table containing 5 or more fields " + std::string message = "Expected/support quaternion Table containing 5 or more fields " "(i.e., Framing camera) but got " + toString(rec0.Fields()) + " for file " + cube.fileName(); throw IException(IException::User, message, _FILEINFO_); @@ -178,7 +178,7 @@ namespace Isis { } // Put a comment in the record - QString message = "Updated pointing with SUMFILE " + name() + " on " + iTime::CurrentLocalTime(); + std::string message = "Updated pointing with SUMFILE " + name() + " on " + iTime::CurrentLocalTime(); PvlKeyword sumFileKeyword("SUMFILE", name().toStdString()); sumFileKeyword.addComment(message.toStdString()); table.Label().addKeyword(sumFileKeyword, PvlContainer::Replace); @@ -222,7 +222,7 @@ namespace Isis { SpicePosition *oldPosition = mycam->instrumentPosition(); Table table = oldPosition->Cache("InstrumentPosition"); if ( table.Records() > 1 ) { - QString message = "Expected/support only one InstrumentPosition record " + std::string message = "Expected/support only one InstrumentPosition record " "(i.e., Framing camera) but got " + toString(table.Records()) + " for file " + cube.fileName(); throw IException(IException::User, message, _FILEINFO_); @@ -230,7 +230,7 @@ namespace Isis { TableRecord &rec0 = table[0]; if ( rec0.Fields() < 4 ) { - QString message = "Expected/support vector Table containing 4 or more fields " + std::string message = "Expected/support vector Table containing 4 or more fields " "(i.e., Framing camera) but got " + toString(rec0.Fields()) + " for file " + cube.fileName(); throw IException(IException::User, message, _FILEINFO_); @@ -242,7 +242,7 @@ namespace Isis { } // Put a comment in the record - QString message = "Updated position with SUMFILE " + name() + " on " + iTime::CurrentLocalTime(); + std::string message = "Updated position with SUMFILE " + name() + " on " + iTime::CurrentLocalTime(); PvlKeyword sumFileKeyword("SUMFILE", name().toStdString()); sumFileKeyword.addComment(message.toStdString()); table.Label().addKeyword(sumFileKeyword, PvlContainer::Replace); @@ -349,10 +349,10 @@ namespace Isis { * @param sumFile Name of a SPC SUMFILE */ void SumFile::parseSumFile(const QString &sumFile) { - FileName sfile(sumFile); - QFile sumF(sfile.expanded()); + FileName sfile(sumFile.toStdString()); + QFile sumF(QString::fromStdString(sfile.expanded())); if ( !sumF.open(QIODevice::ReadOnly | QIODevice::Text) ) { - QString message = "Failed to open FROM file \"" + sfile.original() + "\""; + std::string message = "Failed to open FROM file \"" + sfile.original() + "\""; throw IException(IException::User, message, _FILEINFO_); } @@ -478,7 +478,7 @@ namespace Isis { if ( nexpected > 0 ) { if ( values.size() != nexpected ) { - QString message = "Expected " + toString(nexpected) + " but got " + std::string message = "Expected " + toString(nexpected) + " but got " + toString(values.size()); throw IException(IException::User, message, _FILEINFO_); } @@ -488,13 +488,13 @@ namespace Isis { if ( !tag.isEmpty() ) { if ( values.size() > 0 ) { if ( values.last().toLower() != tag.toLower() ) { - QString message = "Expected line tag given (" + tag + + std::string message = "Expected line tag given (" + tag + ") does not match contents (" + values.last() + ")"; throw IException(IException::User, message, _FILEINFO_); } } else { - QString message = "Line tag given (" + tag + ") but line has not values"; + std::string message = "Line tag given (" + tag + ") but line has not values"; throw IException(IException::User, message, _FILEINFO_); } } @@ -540,7 +540,7 @@ namespace Isis { for (int f = 0; f < sumFiles.size(); f++) { progress.CheckStatus(); - SharedSumFile sumF(new SumFile(sumFiles[f].original())); + SharedSumFile sumF(new SumFile(QString::fromStdString(sumFiles[f].original()))); sum_list.append(sumF); } diff --git a/isis/src/control/apps/sumspice/SumFinder.cpp b/isis/src/control/apps/sumspice/SumFinder.cpp index 6242328a11..802346f172 100644 --- a/isis/src/control/apps/sumspice/SumFinder.cpp +++ b/isis/src/control/apps/sumspice/SumFinder.cpp @@ -79,7 +79,7 @@ namespace Isis { sumlist.append(sumfile); seek(sumlist, DBL_MAX); // Should unconditionally succeed if ( !isFound() ) { // Gut check - QString mess = "Failed to unconditionally accept associated SUMFILE!"; + std::string mess = "Failed to unconditionally accept associated SUMFILE!"; throw IException(IException::Programmer, mess, _FILEINFO_); } } @@ -190,7 +190,7 @@ namespace Isis { resetCube(); m_cubename = name; - m_cube.reset( new Cube(name, "rw") ); + m_cube.reset( new Cube(name.toStdString(), "rw") ); // Ensure kernels are loaded for time conversions (mainly) m_kernels.reset( new Kernels(*m_cube) ); @@ -487,7 +487,7 @@ namespace Isis { // Now check to ensure we have at least one valid time that will be // modified and assume that is enough to get it done properly if ( 0 == nvalid ) { - QString mess = "No expected timing keywords found on labels - " + std::string mess = "No expected timing keywords found on labels - " "assuming non-standard, time update failed"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/sumspice/sumspice.cpp b/isis/src/control/apps/sumspice/sumspice.cpp index 7093e09080..92eee2d08e 100644 --- a/isis/src/control/apps/sumspice/sumspice.cpp +++ b/isis/src/control/apps/sumspice/sumspice.cpp @@ -65,26 +65,26 @@ namespace Isis { // Get the list of input cubes to be processed FileList cubeNameList; if ( ui.WasEntered("FROM") ) { - cubeNameList.append(ui.GetCubeName("FROM")); + cubeNameList.append(ui.GetCubeName("FROM").toStdString()); } else if ( ui.WasEntered("FROMLIST") ) { - cubeNameList.read(ui.GetFileName("FROMLIST")); + cubeNameList.read(ui.GetFileName("FROMLIST").toStdString()); } else { - QString message = "User must provide either an input cube file or an input cube file list."; + std::string message = "User must provide either an input cube file or an input cube file list."; throw IException(IException::User, message, _FILEINFO_); } // get the list of possible sum files to be applied FileList sumFileNameList; if ( ui.WasEntered("SUMFILE") ) { - sumFileNameList.append(ui.GetFileName("SUMFILE")); + sumFileNameList.append(ui.GetFileName("SUMFILE").toStdString()); } else if ( ui.WasEntered("SUMFILELIST") ) { - sumFileNameList.read(ui.GetFileName("SUMFILELIST")); + sumFileNameList.read(ui.GetFileName("SUMFILELIST").toStdString()); } else { - QString message = "User must provide either a sum file or a sum file list."; + std::string message = "User must provide either a sum file or a sum file list."; throw IException(IException::User, message, _FILEINFO_); } @@ -156,12 +156,12 @@ namespace Isis { for (int cubeIndex = 0; cubeIndex < cubeNameList.size(); cubeIndex++) { // Find the proper SUMFILE for the cube - QString filename(cubeNameList[cubeIndex].expanded()); + QString filename(QString::fromStdString(cubeNameList[cubeIndex].expanded())); SharedFinder cubesum( new SumFinder(filename, sumFiles, tolerance, tstamp) ); // Format a warning and save it off for later if ( !cubesum->isFound() ) { - QString mess = "No SUMFILE found for " + cubesum->name() + + std::string mess = "No SUMFILE found for " + cubesum->name() + " - closest time: " + Isis::toString(cubesum->closest(), 10) + " "; @@ -169,7 +169,7 @@ namespace Isis { } else { if ( !cubesum->update(options) ) { - QString msg = "Failed to apply SUMFILE updates on cube " + filename; + std::string msg = "Failed to apply SUMFILE updates on cube " + filename; throw IException(IException::User, msg, _FILEINFO_); } } @@ -179,7 +179,7 @@ namespace Isis { cubesum->resetCube(); resultSet.append(cubesum); - Isis::CubeAttributeInput att(filename); + Isis::CubeAttributeInput att(filename.toStdString()); Cube *cube = process.SetInputCube(filename, att, Isis::ReadWrite); process.WriteHistory(*cube); @@ -189,7 +189,7 @@ namespace Isis { if (warnings.size() > 0) { PvlKeyword message("Unmatched"); - BOOST_FOREACH ( QString mess, warnings ) { + BOOST_FOREACH ( std::string mess, warnings ) { message.addValue(mess.toStdString()); } PvlGroup loggrp("Warnings"); @@ -200,12 +200,12 @@ namespace Isis { // Log the results of processing if ( ui.WasEntered("TOLOG") ) { - FileName filename( ui.GetFileName("TOLOG") ); + FileName filename( ui.GetFileName("TOLOG").toStdString() ); bool exists = filename.fileExists(); - QFile logfile(filename.expanded()); + QFile logfile(QString::fromStdString(filename.expanded())); if ( !logfile.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text | QIODevice::Unbuffered) ) { - QString mess = "Unable to open/create log file " + filename.name(); + std::string mess = "Unable to open/create log file " + filename.name(); throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/warp/main.cpp b/isis/src/control/apps/warp/main.cpp index 2bb71ae8be..a48087b235 100644 --- a/isis/src/control/apps/warp/main.cpp +++ b/isis/src/control/apps/warp/main.cpp @@ -35,7 +35,7 @@ void IsisMain() { for (int i = 0; i < cn.GetNumPoints(); i++) { const ControlPoint *cp = cn.GetPoint(i); if (cp->GetNumMeasures() != 2) { - QString msg = "Control points must have exactly 2 control measures"; + std::string msg = "Control points must have exactly 2 control measures"; throw IException(IException::User, msg, _FILEINFO_); } if (!cp->IsIgnored()) { @@ -49,7 +49,7 @@ void IsisMain() { // If there are no valid control points, // throw an error if (inputLine.size() < 1) { - QString msg = "The specified Control Network is empty."; + std::string msg = "The specified Control Network is empty."; throw IException(IException::User, msg, _FILEINFO_); } @@ -104,7 +104,7 @@ void IsisMain() { interp = new Interpolator(Interpolator::CubicConvolutionType); } else { - QString msg = "Unknow value for INTERP [" + + std::string msg = "Unknow value for INTERP [" + ui.GetString("INTERP") + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp index 03811cf980..052a4d6a68 100644 --- a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp +++ b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp @@ -166,7 +166,7 @@ namespace Isis { // read lidar point data file try { m_lidarDataSet = LidarDataQsp( new LidarData()); - m_lidarDataSet->read(lidarDataFile); + m_lidarDataSet->read(lidarDataFile.toStdString()); } catch (IException &e) { throw; @@ -476,7 +476,7 @@ namespace Isis { // If any camera is initialized via CSMInit, but no csm solve options are specified, fail early. if (camera->GetCameraType() == Camera::Csm && m_bundleSettings->observationSolveSettings(observationNumber).csmSolveOption() == 0){ - QString msg = fileName + " camera was initialized using CSMInit, so jigsaw must use CSM parameters." + + std::string msg = fileName + " camera was initialized using CSMInit, so jigsaw must use CSM parameters." + " Please refer to documentation for more information." + "\n"; throw IException(IException::User, msg, _FILEINFO_); } @@ -486,7 +486,7 @@ namespace Isis { BundleImageQsp image = BundleImageQsp(new BundleImage(camera, serialNumber, fileName)); if (!image) { - QString msg = "In BundleAdjust::init(): image " + fileName + "is null." + "\n"; + std::string msg = "In BundleAdjust::init(): image " + fileName + "is null." + "\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -494,7 +494,7 @@ namespace Isis { m_bundleObservations.addNew(image, observationNumber, instrumentId, m_bundleSettings); if (!observation) { - QString msg = "In BundleAdjust::init(): observation " + std::string msg = "In BundleAdjust::init(): observation " + observationNumber + "is null." + "\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -679,7 +679,7 @@ namespace Isis { outputBundleStatus("\nValidating network..."); int imagesWithInsufficientMeasures = 0; - QString msg = "Images with one or less measures:\n"; + std::string msg = "Images with one or less measures:\n"; int numObservations = m_bundleObservations.size(); for (int i = 0; i < numObservations; i++) { int numImages = m_bundleObservations.at(i)->size(); @@ -846,7 +846,7 @@ namespace Isis { // int numImages = images(); // for (int i = 0; i < numImages; i++) { // if (m_controlNet->Camera(i)->GetCameraType() == 0) { - // QString msg = "At least one sensor is a frame camera. " + // std::string msg = "At least one sensor is a frame camera. " // "Spacecraft Option OVERHERMITE is not valid for frame cameras\n"; // throw IException(IException::User, msg, _FILEINFO_); // } @@ -1130,7 +1130,7 @@ namespace Isis { emit statusUpdate("\n aborting..."); emit statusBarUpdate("Failed to Converge"); emit finished(); - QString msg = "Could not solve bundle adjust."; + std::string msg = "Could not solve bundle adjust."; throw IException(e, e.errorType(), msg, _FILEINFO_); } @@ -1170,8 +1170,8 @@ namespace Isis { */ BundleSolutionInfo *BundleAdjust::bundleSolveInformation() { BundleSolutionInfo *bundleSolutionInfo = new BundleSolutionInfo(m_bundleSettings, - FileName(m_cnetFileName), - FileName(m_lidarFileName), + FileName(m_cnetFileName.toStdString()), + FileName(m_lidarFileName.toStdString()), m_bundleResults, imageLists()); bundleSolutionInfo->setRunTime(""); @@ -2071,7 +2071,7 @@ namespace Isis { double computedX, computedY; if (!(measureCamera->GroundMap()->GetXY(point.adjustedSurfacePoint(), &computedX, &computedY, false))) { - QString msg = "Unable to map apriori surface point for measure "; + std::string msg = "Unable to map apriori surface point for measure "; msg += measure.cubeSerialNumber() + " on point " + point.id() + " into focal plane"; throw IException(IException::User, msg, _FILEINFO_); } @@ -2565,11 +2565,11 @@ namespace Isis { SparseBlockColumnMatrix inverseMatrix; // Create unique file name - FileName matrixFile(m_bundleSettings->outputFilePrefix() + "inverseMatrix.dat"); + FileName matrixFile(m_bundleSettings->outputFilePrefix().toStdString() + "inverseMatrix.dat"); //???FileName matrixFile = FileName::createTempFile(m_bundleSettings.outputFilePrefix() //??? + "inverseMatrix.dat"); // Create file handle - QFile matrixOutput(matrixFile.expanded()); + QFile matrixOutput(QString::fromStdString(matrixFile.expanded())); // Check to see if creating the inverse correlation matrix is turned on if (m_bundleSettings->createInverseMatrix()) { diff --git a/isis/src/control/objs/BundleResults/BundleResults.cpp b/isis/src/control/objs/BundleResults/BundleResults.cpp index 5e377e6b79..627ec2a7ff 100644 --- a/isis/src/control/objs/BundleResults/BundleResults.cpp +++ b/isis/src/control/objs/BundleResults/BundleResults.cpp @@ -133,13 +133,13 @@ namespace Isis { QString correlationFileName = *(xmlReader->attributes().value("correlationFileName").string()); if (!correlationFileName.isEmpty()) { - FileName correlationFile(correlationFileName); + FileName correlationFile(correlationFileName.toStdString()); m_correlationMatrix->setCorrelationFileName(correlationFile); } QString covarianceFileName = *(xmlReader->attributes().value("covarianceFileName").string()); if (!covarianceFileName.isEmpty()) { - FileName covarianceFile(covarianceFileName); + FileName covarianceFile(covarianceFileName.toStdString()); m_correlationMatrix->setCovarianceFileName(covarianceFile); } while (xmlReader->readNextStartElement()) { @@ -1254,7 +1254,7 @@ namespace Isis { m_sigma0 = dvtpv; } else { - QString msg = "Computed degrees of freedom [" + toString(m_degreesOfFreedom) + std::string msg = "Computed degrees of freedom [" + toString(m_degreesOfFreedom) + "] is invalid."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -2056,9 +2056,9 @@ namespace Isis { stream.writeStartElement("bundleResults"); stream.writeStartElement("correlationMatrix"); stream.writeAttribute("correlationFileName", - correlationMatrix().correlationFileName().expanded()); + QString::fromStdString(correlationMatrix().correlationFileName().expanded())); stream.writeAttribute("covarianceFileName", - correlationMatrix().covarianceFileName().expanded()); + QString::fromStdString(correlationMatrix().covarianceFileName().expanded())); stream.writeStartElement("imagesAndParameters"); QMapIterator imgParamIt(*correlationMatrix().imagesAndParameters()); while (imgParamIt.hasNext()) { diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.cpp b/isis/src/control/objs/BundleSettings/BundleSettings.cpp index 25f9127d82..50116b751c 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.cpp +++ b/isis/src/control/objs/BundleSettings/BundleSettings.cpp @@ -536,7 +536,7 @@ namespace Isis { if (n >= 0 && n < numberSolveSettings()) { return m_observationSolveSettings[n]; } - QString msg = "Unable to find BundleObservationSolveSettings with index = [" + std::string msg = "Unable to find BundleObservationSolveSettings with index = [" + toString(n) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp index 512dc2de7b..a0b7734433 100755 --- a/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp +++ b/isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp @@ -149,7 +149,7 @@ namespace Isis { m_runTime = xmlReader->readElementText(); } else if (xmlReader->qualifiedName() == "inputFileName") { - m_inputControlNetFileName = new FileName(projectRoot + xmlReader->readElementText()); + m_inputControlNetFileName = new FileName(projectRoot.toStdString() + xmlReader->readElementText().toStdString()); } else if (xmlReader->qualifiedName() == "bundleOutTXT") { m_txtBundleOutputFilename = projectRoot + xmlReader->readElementText(); @@ -299,19 +299,19 @@ namespace Isis { //TODO do we need to close anything here? FileName oldInputFileName(*m_inputControlNetFileName); - FileName newInputFileName(project->cnetRoot() + "/" + - oldInputFileName.dir().dirName() + "/" + oldInputFileName.name()); + FileName newInputFileName(project->cnetRoot().toStdString() + "/" + + oldInputFileName.dir().filename().string() + "/" + oldInputFileName.name()); *m_inputControlNetFileName = newInputFileName.expanded(); - FileName oldOutputFileName(m_outputControl->fileName()); - FileName newOutputFileName(project->cnetRoot() + "/" + - oldOutputFileName.dir().dirName() + "/" + oldOutputFileName.name()); + FileName oldOutputFileName(m_outputControl->fileName().toStdString()); + FileName newOutputFileName(project->cnetRoot().toStdString() + "/" + + oldOutputFileName.dir().filename().string() + "/" + oldOutputFileName.name()); if (m_outputControl) { delete m_outputControl; } - m_outputControl = new Control(newOutputFileName.expanded()); - m_outputControlName = newOutputFileName.expanded(); + m_outputControl = new Control(QString::fromStdString(newOutputFileName.expanded())); + m_outputControlName = QString::fromStdString(newOutputFileName.expanded()); } @@ -374,7 +374,7 @@ namespace Isis { * @return @b QString The name of the input control network. */ QString BundleSolutionInfo::inputControlNetFileName() const { - return m_inputControlNetFileName->expanded(); + return QString::fromStdString(m_inputControlNetFileName->expanded()); } @@ -398,7 +398,7 @@ namespace Isis { * @return QString Name of input lidar data file. */ QString BundleSolutionInfo::inputLidarDataFileName() const { - return m_inputLidarDataFileName->expanded(); + return QString::fromStdString(m_inputLidarDataFileName->expanded()); } @@ -621,11 +621,11 @@ namespace Isis { Isis::iTime::CurrentLocalTime().toLatin1().data()); fpOut << buf; snprintf(buf, sizeof(buf), "\n Network Filename: %s", - m_inputControlNetFileName->expanded().toLatin1().data()); + m_inputControlNetFileName->expanded().c_str()); fpOut << buf; snprintf(buf, sizeof(buf),"\n Cube List: %s", - m_settings->cubeList().toStdString().c_str() ); + m_settings->cubeList().toStdString().c_str()); fpOut << buf; @@ -644,7 +644,7 @@ namespace Isis { fpOut << buf; if (m_inputLidarDataFileName) { snprintf(buf, sizeof(buf), "\n Lidar Data Filename: %s", - m_inputLidarDataFileName->expanded().toLatin1().data()); + m_inputLidarDataFileName->expanded().c_str()); fpOut << buf; } snprintf(buf, sizeof(buf), "\n Target: %s", @@ -1083,7 +1083,7 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Failed to output residual percentiles for bundleout"; + std::string msg = "Failed to output residual percentiles for bundleout"; throw IException(e, IException::Io, msg, _FILEINFO_); } try { @@ -1106,7 +1106,7 @@ namespace Isis { fpOut << buf; } catch (IException &e) { - QString msg = "Failed to output residual box plot for bundleout"; + std::string msg = "Failed to output residual box plot for bundleout"; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -1981,50 +1981,48 @@ namespace Isis { FileName bundleSolutionInfoRoot; if (project) { - bundleSolutionInfoRoot = FileName(Project::bundleSolutionInfoRoot(newProjectRoot.expanded()) + - "/" + runTime()); + bundleSolutionInfoRoot = FileName(Project::bundleSolutionInfoRoot(QString::fromStdString(newProjectRoot.expanded())).toStdString() + + "/" + runTime().toStdString()); QString oldPath = project->bundleSolutionInfoRoot(project->projectRoot()) + "/" + runTime(); - QString newPath = project->bundleSolutionInfoRoot(newProjectRoot.toString()) + "/" + runTime(); + QString newPath = project->bundleSolutionInfoRoot(QString::fromStdString(newProjectRoot.toString())) + "/" + runTime(); // If project is being saved to new area, create directory and copy files if (oldPath != newPath) { // Create project folder for BundleSolutionInfo QDir bundleDir(newPath); if (!bundleDir.mkpath(bundleDir.path())) { - throw IException(IException::Io, - QString("Failed to create directory [%1]") - .arg(bundleSolutionInfoRoot.path()), + throw IException(IException::Io,"Failed to create directory [" + bundleSolutionInfoRoot.path() + "]", _FILEINFO_); } - QString oldFile = oldPath + "/" + FileName(m_outputControl->fileName()).name(); - QString newFile = newPath + "/" + FileName(m_outputControl->fileName()).name(); + QString oldFile = oldPath + "/" + QString::fromStdString(FileName(m_outputControl->fileName().toStdString()).name()); + QString newFile = newPath + "/" + QString::fromStdString(FileName(m_outputControl->fileName().toStdString()).name()); if (!QFile::copy(oldFile, newFile)) { throw IException(IException::Io, QString("Failed to copy file [%1] to new file [%2]") .arg(m_outputControl->fileName()).arg(newFile), _FILEINFO_); } - newFile = newPath + "/" + FileName(m_txtBundleOutputFilename).name(); + newFile = newPath + "/" + QString::fromStdString(FileName(m_txtBundleOutputFilename.toStdString()).name()); if (!QFile::copy(m_txtBundleOutputFilename, newFile)) { throw IException(IException::Io, QString("Failed to copy file [%1] to new file [%2]") .arg(m_txtBundleOutputFilename).arg(newFile), _FILEINFO_); } - newFile = newPath + "/" + FileName(m_csvSavedImagesFilename).name(); + newFile = newPath + "/" + QString::fromStdString(FileName(m_csvSavedImagesFilename.toStdString()).name()); if (!QFile::copy(m_csvSavedImagesFilename, newFile)) { throw IException(IException::Io, QString("Failed to copy file [%1] to new file [%2]") .arg(m_csvSavedImagesFilename).arg(newFile), _FILEINFO_); } - newFile = newPath + "/" + FileName(m_csvSavedPointsFilename).name(); + newFile = newPath + "/" + QString::fromStdString(FileName(m_csvSavedPointsFilename.toStdString()).name()); if (!QFile::copy(m_csvSavedPointsFilename, newFile)) { throw IException(IException::Io, QString("Failed to copy file [%1] to new file [%2]") .arg(m_csvSavedPointsFilename).arg(newFile), _FILEINFO_); } - newFile = newPath + "/" + FileName(m_csvSavedResidualsFilename).name(); + newFile = newPath + "/" + QString::fromStdString(FileName(m_csvSavedResidualsFilename.toStdString()).name()); if (!QFile::copy(m_csvSavedResidualsFilename, newFile)) { throw IException(IException::Io, QString("Failed to copy file [%1] to new file [%2]") @@ -2034,7 +2032,7 @@ namespace Isis { } // Create relativePath - relativePath = m_inputControlNetFileName->expanded().remove(project->newProjectRoot()); + relativePath = QString::fromStdString(m_inputControlNetFileName->expanded()).remove(project->newProjectRoot()); // Get rid of any preceding "/" , but add on ending "/" if (relativePath.startsWith("/")) { relativePath.remove(0,1); @@ -2059,13 +2057,13 @@ namespace Isis { stream.writeTextElement("inputFileName", relativePath); stream.writeTextElement("bundleOutTXT", - relativeBundlePath + FileName(m_txtBundleOutputFilename).name()); + relativeBundlePath + QString::fromStdString(FileName(m_txtBundleOutputFilename.toStdString()).name())); stream.writeTextElement("imagesCSV", - relativeBundlePath + FileName(m_csvSavedImagesFilename).name()); + relativeBundlePath + QString::fromStdString(FileName(m_csvSavedImagesFilename.toStdString()).name())); stream.writeTextElement("pointsCSV", - relativeBundlePath + FileName(m_csvSavedPointsFilename).name()); + relativeBundlePath + QString::fromStdString(FileName(m_csvSavedPointsFilename.toStdString()).name())); stream.writeTextElement("residualsCSV", - relativeBundlePath + FileName(m_csvSavedResidualsFilename).name()); + relativeBundlePath + QString::fromStdString(FileName(m_csvSavedResidualsFilename.toStdString()).name())); stream.writeEndElement(); // end general attributes // save settings to stream @@ -2086,7 +2084,7 @@ namespace Isis { // save output control stream.writeStartElement("outputControl"); - m_outputControl->save(stream, project, relativeBundlePath); + m_outputControl->save(stream, project, relativeBundlePath.toStdString()); stream.writeEndElement(); } diff --git a/isis/src/control/objs/BundleUtilities/BundleLidarRangeConstraint.cpp b/isis/src/control/objs/BundleUtilities/BundleLidarRangeConstraint.cpp index 729ccbe5e5..ae1b0e2f8c 100644 --- a/isis/src/control/objs/BundleUtilities/BundleLidarRangeConstraint.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleLidarRangeConstraint.cpp @@ -31,7 +31,7 @@ namespace Isis { m_rangeObserved = m_lidarControlPoint->range(); if (m_rangeObserved <= 0) { - QString msg ="In BundleLidarRangeConstraint::BundleLidarRangeConstraint():" + std::string msg ="In BundleLidarRangeConstraint::BundleLidarRangeConstraint():" "observed range for lidar point must be positive (Point Id: " + measure->parentControlPoint()->id() + ")\n."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -40,7 +40,7 @@ namespace Isis { m_rangeObservedSigma = m_lidarControlPoint->sigmaRange() * 0.001; // converting from m to km if (m_rangeObservedSigma <= 0) { - QString msg ="In BundleLidarRangeConstraint::BundleLidarRangeConstraint():" + std::string msg ="In BundleLidarRangeConstraint::BundleLidarRangeConstraint():" "observed range sigma for lidar point must be positive (Point Id: " + measure->parentControlPoint()->id() + ")\n."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -52,7 +52,7 @@ namespace Isis { // Check that the simultaneous image has an ISIS camera if (m_simultaneousMeasure->camera()->GetCameraType() == Camera::Csm) { - QString msg = "Cannot apply a Lidar range constraint to a CSM camera model" + std::string msg = "Cannot apply a Lidar range constraint to a CSM camera model" "(Point Id: " + measure->parentControlPoint()->id() + ", Measure Serial:" + measure->cubeSerialNumber() + ").\n"; @@ -159,7 +159,7 @@ namespace Isis { m_rangeComputed = sqrt(m_dX*m_dX+m_dY*m_dY+m_dZ*m_dZ); if (m_rangeComputed <= 0.0) { - QString msg = "In BundleLidarRangeConstraint::computeRange(): " + std::string msg = "In BundleLidarRangeConstraint::computeRange(): " "m_rangeComputed must be positive\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -207,7 +207,7 @@ namespace Isis { // resize coeff_range_image matrix if necessary IsisBundleObservationQsp isisObservation = m_bundleObservation.dynamicCast(); if (!isisObservation) { - QString msg = "Failed to cast BundleObservation to IsisBundleObservation when applying " + std::string msg = "Failed to cast BundleObservation to IsisBundleObservation when applying " "lidar constraint (Point Id: " + m_simultaneousMeasure->parentControlPoint()->id() + ", Measure Serial:" + m_simultaneousMeasure->cubeSerialNumber() + ").\n"; @@ -420,8 +420,8 @@ namespace Isis { QString outstr; - FileName imageFileName = m_simultaneousMeasure->parentBundleObservation()->imageNames().at(0); - QString imageName = imageFileName.baseName(); + FileName imageFileName = m_simultaneousMeasure->parentBundleObservation()->imageNames().at(0).toStdString(); + QString imageName = QString::fromStdString(imageFileName.baseName()); // measured apriori adjusted adjusted // range sigma range sigma residual diff --git a/isis/src/control/objs/BundleUtilities/BundleMeasure.cpp b/isis/src/control/objs/BundleUtilities/BundleMeasure.cpp index 62c1faee58..8667c66c9d 100644 --- a/isis/src/control/objs/BundleUtilities/BundleMeasure.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleMeasure.cpp @@ -237,7 +237,7 @@ namespace Isis { */ const QSharedPointer BundleMeasure::observationSolveSettings() { if (!m_parentObservation) { - QString msg = "In BundleMeasure::observationSolveSettings: " + std::string msg = "In BundleMeasure::observationSolveSettings: " "parent observation has not been set.\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -441,7 +441,7 @@ namespace Isis { m_sigma = sigmaMultiplier * m_controlMeasure->Camera()->PixelPitch(); if (m_sigma <= 0.0) { - QString msg = "In BundleMeasure::setMeasureSigma(): m_measureSigma must be positive\n"; + std::string msg = "In BundleMeasure::setMeasureSigma(): m_measureSigma must be positive\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -461,7 +461,7 @@ namespace Isis { */ int BundleMeasure::observationIndex() const { if (!m_parentObservation) { - QString msg = "In BundleMeasure::observationIndex: " + std::string msg = "In BundleMeasure::observationIndex: " "parent observation has not been set.\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp index 8d3beb2bed..ddad6a7e10 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp @@ -106,7 +106,7 @@ namespace Isis { m_pointingInterpolationType = SpiceRotation::PolyFunction; } else { - QString msg = "The OVEREXISTING parameter must be set to TRUE or FALSE; YES or NO"; + std::string msg = "The OVEREXISTING parameter must be set to TRUE or FALSE; YES or NO"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -156,7 +156,7 @@ namespace Isis { m_solveTwist = false; } else { - QString msg = "The TWIST parameter must be set to TRUE or FALSE; YES or NO"; + std::string msg = "The TWIST parameter must be set to TRUE or FALSE; YES or NO"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -173,7 +173,7 @@ namespace Isis { m_positionInterpolationType = SpicePosition::PolyFunction; } else { - QString msg = "The OVERHERMITE parameter must be set to TRUE or FALSE; YES or NO"; + std::string msg = "The OVERHERMITE parameter must be set to TRUE or FALSE; YES or NO"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationVector.cpp b/isis/src/control/objs/BundleUtilities/BundleObservationVector.cpp index f440e96151..a170808084 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationVector.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleObservationVector.cpp @@ -142,7 +142,7 @@ namespace Isis { } if (!bundleObservation) { - QString message = "Unable to allocate new BundleObservation "; + std::string message = "Unable to allocate new BundleObservation "; message += "for " + bundleImage->fileName(); throw IException(IException::Programmer, message, _FILEINFO_); } diff --git a/isis/src/control/objs/BundleUtilities/BundleTargetBody.cpp b/isis/src/control/objs/BundleUtilities/BundleTargetBody.cpp index 18b5891723..5f804e6c49 100644 --- a/isis/src/control/objs/BundleUtilities/BundleTargetBody.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleTargetBody.cpp @@ -580,7 +580,7 @@ namespace Isis { void BundleTargetBody::applyParameterCorrections( LinearAlgebra::Vector corrections) { if (corrections.size() != m_parameterSolveCodes.size()) { - QString msg = "In BundleTargetBody::applyParameterCorrections: " + std::string msg = "In BundleTargetBody::applyParameterCorrections: " "correction and m_targetParameter vectors sizes don't match.\n"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -663,7 +663,7 @@ namespace Isis { } // end try catch (IException &e) { - QString msg = "Unable to apply parameter corrections to BundleTargetBody."; + std::string msg = "Unable to apply parameter corrections to BundleTargetBody."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -905,7 +905,7 @@ namespace Isis { */ std::vector BundleTargetBody::radii() { if (!solveTriaxialRadii()) { - QString msg = "The triaxial radii can only be accessed when solving for triaxial radii."; + std::string msg = "The triaxial radii can only be accessed when solving for triaxial radii."; throw IException(IException::Programmer, msg, _FILEINFO_); } return m_radii; @@ -922,7 +922,7 @@ namespace Isis { */ Distance BundleTargetBody::meanRadius() { if (!solveMeanRadius()) { - QString msg = "The mean radius can only be accessed when solving for mean radius."; + std::string msg = "The mean radius can only be accessed when solving for mean radius."; throw IException(IException::Programmer, msg, _FILEINFO_); } return m_meanRadius; @@ -1196,7 +1196,7 @@ namespace Isis { str = QString::fromStdString(g->findKeyword("Ra")[0]); } catch (IException &e) { - QString msg = "Ra must be given as none, position, velocity, or acceleration"; + std::string msg = "Ra must be given as none, position, velocity, or acceleration"; throw IException(IException::User, msg, _FILEINFO_); } if (str == "position") { @@ -1218,7 +1218,7 @@ namespace Isis { str = QString::fromStdString(g->findKeyword("Dec")[0]); } catch (IException &e) { - QString msg = "Dec must be given as none, position, velocity, or acceleration"; + std::string msg = "Dec must be given as none, position, velocity, or acceleration"; throw IException(IException::User, msg, _FILEINFO_); } if (str == "position") { @@ -1240,7 +1240,7 @@ namespace Isis { str = QString::fromStdString(g->findKeyword("Pm")[0]); } catch (IException &e) { - QString msg = "Pm must be given as none, position, velocity, or acceleration"; + std::string msg = "Pm must be given as none, position, velocity, or acceleration"; throw IException(IException::User, msg, _FILEINFO_); } if (str == "position") { @@ -1262,7 +1262,7 @@ namespace Isis { str = QString::fromStdString(g->findKeyword("RadiiSolveOption")[0]); } catch (IException &e) { - QString msg = "RadiiSolveOption must be given as none, triaxial, or mean"; + std::string msg = "RadiiSolveOption must be given as none, triaxial, or mean"; throw IException(IException::User, msg, _FILEINFO_); } if (str == "triaxial") { @@ -1315,7 +1315,7 @@ namespace Isis { d = (double)(g->findKeyword("RaValue")); } catch (IException &e) { - QString msg = "RaValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriPoleRA = Angle(d, Angle::Degrees); @@ -1326,7 +1326,7 @@ namespace Isis { d = (double)(g->findKeyword("RaSigma")); } catch (IException &e) { - QString msg = "RaSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } poleRASigma = Angle(d, Angle::Degrees); @@ -1337,7 +1337,7 @@ namespace Isis { d = (double)(g->findKeyword("RaVelocityValue")); } catch (IException &e) { - QString msg = "RaVelocityValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaVelocityValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriVelocityPoleRA = Angle(d, Angle::Degrees); @@ -1348,7 +1348,7 @@ namespace Isis { d = (double)(g->findKeyword("RaVelocitySigma")); } catch (IException &e) { - QString msg = "RaVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } poleRAVelocitySigma = Angle(d, Angle::Degrees); @@ -1359,7 +1359,7 @@ namespace Isis { d = (double)(g->findKeyword("RaAccelerationValue")); } catch (IException &e) { - QString msg = "RaAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriAccelerationPoleRA = Angle(d, Angle::Degrees); @@ -1370,7 +1370,7 @@ namespace Isis { d = (double)(g->findKeyword("RaAccelerationSigma")); } catch (IException &e) { - QString msg = "RaAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } poleRAAccelerationSigma = Angle(d, Angle::Degrees); @@ -1381,7 +1381,7 @@ namespace Isis { d = (double)(g->findKeyword("DecValue")); } catch (IException &e) { - QString msg = "DecValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriPoleDec = Angle(d, Angle::Degrees); @@ -1392,7 +1392,7 @@ namespace Isis { d = (double)(g->findKeyword("DecSigma")); } catch (IException &e) { - QString msg = "DecSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } poleDecSigma = Angle(d, Angle::Degrees); @@ -1403,7 +1403,7 @@ namespace Isis { d = (double)(g->findKeyword("DecVelocityValue")); } catch (IException &e) { - QString msg = "DecVelocityValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecVelocityValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriVelocityPoleDec = Angle(d, Angle::Degrees); @@ -1414,7 +1414,7 @@ namespace Isis { d = (double)(g->findKeyword("DecVelocitySigma")); } catch (IException &e) { - QString msg = "DecVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } sigmaVelocityPoleDec = Angle(d, Angle::Degrees); @@ -1425,7 +1425,7 @@ namespace Isis { d = (double)(g->findKeyword("DecAccelerationValue")); } catch (IException &e) { - QString msg = "DecAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriAccelerationPoleDec = Angle(d, Angle::Degrees); @@ -1436,7 +1436,7 @@ namespace Isis { d = (double)(g->findKeyword("DecAccelerationSigma")); } catch (IException &e) { - QString msg = "DecAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } sigmaAccelerationPoleDec = Angle(d, Angle::Degrees); @@ -1447,7 +1447,7 @@ namespace Isis { d = (double)(g->findKeyword("PmValue")); } catch (IException &e) { - QString msg = "PmValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriPM = Angle(d, Angle::Degrees); @@ -1458,7 +1458,7 @@ namespace Isis { d = (double)(g->findKeyword("PmSigma")); } catch (IException &e) { - QString msg = "PmSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } sigmaPM = Angle(d, Angle::Degrees); @@ -1470,7 +1470,7 @@ namespace Isis { d = (double)(g->findKeyword("PmVelocityValue")); } catch (IException &e) { - QString msg = "PmVelocityValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmVelocityValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriVelocityPM = Angle(d, Angle::Degrees); @@ -1481,7 +1481,7 @@ namespace Isis { d = (double)(g->findKeyword("PmVelocitySigma")); } catch (IException &e) { - QString msg = "PmVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } sigmaVelocityPM = Angle(d, Angle::Degrees); @@ -1492,7 +1492,7 @@ namespace Isis { d = (double)(g->findKeyword("PmAccelerationValue")); } catch (IException &e) { - QString msg = "PmAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } aprioriAccelerationPM = Angle(d, Angle::Degrees); @@ -1503,7 +1503,7 @@ namespace Isis { d = (double)(g->findKeyword("PmAccelerationSigma")); } catch (IException &e) { - QString msg = "PmAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } pmAccelerationSigma = Angle(d, Angle::Degrees); @@ -1514,14 +1514,14 @@ namespace Isis { d = (double)(g->findKeyword("RadiusAValue")); } catch (IException &e) { - QString msg = "RadiusAValue must be a valid double (blank defaults to 0)."; + std::string msg = "RadiusAValue must be a valid double (blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } try { aprioriRadiusA = Distance(d, Distance::Meters); } catch (IException &e) { - QString msg = "RadiusAValue must be >= 0."; + std::string msg = "RadiusAValue must be >= 0."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -1531,14 +1531,14 @@ namespace Isis { d = (double)(g->findKeyword("RadiusASigma")); } catch (IException &e) { - QString msg = "RadiusASigma must be a valid double (blank defaults to 0)."; + std::string msg = "RadiusASigma must be a valid double (blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } try { sigmaRadiusA = Distance(d, Distance::Meters); } catch (IException &e) { - QString msg = "RadiusASigma must be >= 0."; + std::string msg = "RadiusASigma must be >= 0."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -1548,14 +1548,14 @@ namespace Isis { d = (double)(g->findKeyword("RadiusBValue")); } catch (IException &e) { - QString msg = "RadiusBValue must be a valid double (blank defaults to 0)."; + std::string msg = "RadiusBValue must be a valid double (blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } try { aprioriRadiusB = Distance(d, Distance::Meters); } catch (IException &e) { - QString msg = "RadiusBValue must be >= 0."; + std::string msg = "RadiusBValue must be >= 0."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -1565,14 +1565,14 @@ namespace Isis { d = (double)(g->findKeyword("RadiusBSigma")); } catch (IException &e) { - QString msg = "RadiusBSigma must be a valid double (blank defaults to 0)."; + std::string msg = "RadiusBSigma must be a valid double (blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } try { sigmaRadiusB = Distance(d, Distance::Meters); } catch (IException &e) { - QString msg = "RadiusBSigma must be >= 0."; + std::string msg = "RadiusBSigma must be >= 0."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -1582,14 +1582,14 @@ namespace Isis { d = (double)(g->findKeyword("RadiusCValue")); } catch (IException &e) { - QString msg = "RadiusCValue must be a valid double (blank defaults to 0)."; + std::string msg = "RadiusCValue must be a valid double (blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } try { aprioriRadiusC = Distance(d, Distance::Meters); } catch (IException &e) { - QString msg = "RadiusCValue must be >= 0."; + std::string msg = "RadiusCValue must be >= 0."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -1599,14 +1599,14 @@ namespace Isis { d = (double)(g->findKeyword("RadiusCSigma")); } catch (IException &e) { - QString msg = "RadiusCSigma must be a valid double (blank defaults to 0)."; + std::string msg = "RadiusCSigma must be a valid double (blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } try { sigmaRadiusC = Distance(d, Distance::Meters); } catch (IException &e) { - QString msg = "RadiusCSigma must be >= 0."; + std::string msg = "RadiusCSigma must be >= 0."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -1616,14 +1616,14 @@ namespace Isis { d = (double)(g->findKeyword("MeanRadiusValue")); } catch (IException &e) { - QString msg = "MeanRadiusValue must be a valid double (blank defaults to 0)."; + std::string msg = "MeanRadiusValue must be a valid double (blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } try { aprioriMeanRadius = Distance(d, Distance::Meters); } catch (IException &e) { - QString msg = "MeanRadiusValue must be >= 0."; + std::string msg = "MeanRadiusValue must be >= 0."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -1633,14 +1633,14 @@ namespace Isis { d = (double)(g->findKeyword("MeanRadiusSigma")); } catch (IException &e) { - QString msg = "MeanRadiusSigma must be a valid double (blank defaults to 0)."; + std::string msg = "MeanRadiusSigma must be a valid double (blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } try { sigmaMeanRadius = Distance(d, Distance::Meters); } catch (IException &e) { - QString msg = "MeanRadiusSigma must be >= 0."; + std::string msg = "MeanRadiusSigma must be >= 0."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -1653,7 +1653,7 @@ namespace Isis { } catch (IException &e) { - QString msg = "Unable to set target body solve options from the given PVL."; + std::string msg = "Unable to set target body solve options from the given PVL."; throw IException(e, IException::User, msg, _FILEINFO_); } */ @@ -1690,7 +1690,7 @@ namespace Isis { Distance BundleTargetBody::localRadius(const Latitude &lat, const Longitude &lon) { if (!solveTriaxialRadii()) { - QString msg = "Local radius can only be found if triaxial radii were solved for."; + std::string msg = "Local radius can only be found if triaxial radii were solved for."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1731,7 +1731,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("Ra")[0]); } catch (IException &e) { - QString msg = "Ra must be a valid boolean (yes/no; true/false)."; + std::string msg = "Ra must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -1743,7 +1743,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RaValue")); } catch (IException &e) { - QString msg = "RaValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_raPole[0] = Angle(d, Angle::Degrees); @@ -1754,7 +1754,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RaSigma")); } catch (IException &e) { - QString msg = "RaSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -1765,7 +1765,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("RaVelocity")[0]); } catch (IException &e) { - QString msg = "RaVelocity must be a valid boolean (yes/no; true/false)."; + std::string msg = "RaVelocity must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -1777,7 +1777,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RaVelocityValue")); } catch (IException &e) { - QString msg = "RaVelocityValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaVelocityValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_raPole[1] = Angle(d, Angle::Degrees); @@ -1788,7 +1788,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RaVelocitySigma")); } catch (IException &e) { - QString msg = "RaVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -1799,7 +1799,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("RaAcceleration")[0]); } catch (IException &e) { - QString msg = "RaAcceleration must be a valid boolean (yes/no; true/false)."; + std::string msg = "RaAcceleration must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -1811,7 +1811,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RaAccelerationValue")); } catch (IException &e) { - QString msg = "RaAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_raPole[2] = Angle(d, Angle::Degrees); @@ -1822,7 +1822,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RaAccelerationSigma")); } catch (IException &e) { - QString msg = "RaAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RaAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -1834,7 +1834,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("Dec")[0]); } catch (IException &e) { - QString msg = "Dec parameter must be a valid boolean (yes/no; true/false)."; + std::string msg = "Dec parameter must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -1846,7 +1846,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("DecValue")); } catch (IException &e) { - QString msg = "DecValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_decPole[0] = Angle(d, Angle::Degrees); @@ -1857,7 +1857,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("DecSigma")); } catch (IException &e) { - QString msg = "DecSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -1868,7 +1868,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("DecVelocity")[0]); } catch (IException &e) { - QString msg = "DecVelocity must be a valid boolean (yes/no; true/false)."; + std::string msg = "DecVelocity must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -1880,7 +1880,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("DecVelocityValue")); } catch (IException &e) { - QString msg = "DecVelocityValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecVelocityValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_decPole[1] = Angle(d, Angle::Degrees); @@ -1891,7 +1891,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("DecVelocitySigma")); } catch (IException &e) { - QString msg = "DecVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -1902,7 +1902,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("DecAcceleration")[0]); } catch (IException &e) { - QString msg = "DecAcceleration must be a valid boolean (yes/no; true/false)."; + std::string msg = "DecAcceleration must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -1914,7 +1914,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("DecAccelerationValue")); } catch (IException &e) { - QString msg = "DecAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_decPole[2] = Angle(d, Angle::Degrees); @@ -1925,7 +1925,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("DecAccelerationSigma")); } catch (IException &e) { - QString msg = "DecAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "DecAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -1937,7 +1937,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("Pm")[0]); } catch (IException &e) { - QString msg = "Pm parameter must be a valid boolean (yes/no; true/false)."; + std::string msg = "Pm parameter must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -1949,7 +1949,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("PmValue")); } catch (IException &e) { - QString msg = "PmValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_pm[0] = Angle(d, Angle::Degrees); @@ -1960,7 +1960,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("PmSigma")); } catch (IException &e) { - QString msg = "PmSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -1971,7 +1971,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("PmVelocity")[0]); } catch (IException &e) { - QString msg = "PmVelocity must be a valid boolean (yes/no; true/false)."; + std::string msg = "PmVelocity must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -1983,7 +1983,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("PmVelocityValue")); } catch (IException &e) { - QString msg = "PmVelocityValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmVelocityValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_pm[1] = Angle(d, Angle::Degrees); @@ -1994,7 +1994,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("PmVelocitySigma")); } catch (IException &e) { - QString msg = "PmVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmVelocitySigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -2005,7 +2005,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("PmAcceleration")[0]); } catch (IException &e) { - QString msg = "PmAcceleration must be a valid boolean (yes/no; true/false)."; + std::string msg = "PmAcceleration must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) @@ -2017,7 +2017,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("PmAccelerationValue")); } catch (IException &e) { - QString msg = "PmAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmAccelerationValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_decPole[2] = Angle(d, Angle::Degrees); @@ -2028,7 +2028,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("PmAccelerationSigma")); } catch (IException &e) { - QString msg = "PmAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "PmAccelerationSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -2040,7 +2040,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("AllRadii")[0]); } catch (IException &e) { - QString msg = "AllRadii parameter must be a valid boolean (yes/no; true/false)."; + std::string msg = "AllRadii parameter must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) { @@ -2053,7 +2053,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RadiusAValue")); } catch (IException &e) { - QString msg = "RadiusAValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RadiusAValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_radii[0].setKilometers(d); @@ -2064,7 +2064,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RadiusASigma")); } catch (IException &e) { - QString msg = "RadiusASigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RadiusASigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -2075,7 +2075,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RadiusBValue")); } catch (IException &e) { - QString msg = "RadiusBValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RadiusBValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_radii[1].setKilometers(d); @@ -2086,7 +2086,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RadiusBSigma")); } catch (IException &e) { - QString msg = "RadiusBSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RadiusBSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -2097,7 +2097,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RadiusCValue")); } catch (IException &e) { - QString msg = "RadiusCValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RadiusCValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_radii[2].setKilometers(d); @@ -2108,7 +2108,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("RadiusCSigma")); } catch (IException &e) { - QString msg = "RadiusCSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "RadiusCSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -2120,7 +2120,7 @@ namespace Isis { b = toBool(tbParameterGroup.findKeyword("MeanRadius")[0]); } catch (IException &e) { - QString msg = "MeanRadius parameter must be a valid boolean (yes/no; true/false)."; + std::string msg = "MeanRadius parameter must be a valid boolean (yes/no; true/false)."; throw IException(IException::User, msg, _FILEINFO_); } if (b) { @@ -2131,7 +2131,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("MeanRadiusValue")); } catch (IException &e) { - QString msg = "MeanRadiusValue must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "MeanRadiusValue must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } m_radii[2].setKilometers(d); @@ -2142,7 +2142,7 @@ namespace Isis { d = (double)(tbParameterGroup.findKeyword("MeanRadiusSigma")); } catch (IException &e) { - QString msg = "MeanRadiusSigma must be a valid double (>= 0; blank defaults to 0)."; + std::string msg = "MeanRadiusSigma must be a valid double (>= 0; blank defaults to 0)."; throw IException(IException::User, msg, _FILEINFO_); } //m_raPole[1] = Angle(d, Angle::Degrees); @@ -2152,7 +2152,7 @@ namespace Isis { } catch (IException &e) { - QString msg = "Unable to set target body solve options from the given PVL."; + std::string msg = "Unable to set target body solve options from the given PVL."; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/BundleUtilities/IsisBundleObservation.cpp b/isis/src/control/objs/BundleUtilities/IsisBundleObservation.cpp index 5de3ea1edd..4b3a7d710b 100644 --- a/isis/src/control/objs/BundleUtilities/IsisBundleObservation.cpp +++ b/isis/src/control/objs/BundleUtilities/IsisBundleObservation.cpp @@ -415,7 +415,7 @@ namespace Isis { if (positionOption != BundleObservationSolveSettings::NoPositionFactors) { if (!m_instrumentPosition) { - QString msg = "Instrument position is NULL, but position solve option is "; + std::string msg = "Instrument position is NULL, but position solve option is "; msg.append(BundleObservationSolveSettings::instrumentPositionSolveOptionToString( positionOption)); throw IException(IException::Unknown, msg, _FILEINFO_); @@ -459,7 +459,7 @@ namespace Isis { if (pointingOption != BundleObservationSolveSettings::NoPointingFactors) { if (!m_instrumentRotation) { - QString msg = "Instrument rotation is NULL, but pointing solve option is "; + std::string msg = "Instrument rotation is NULL, but pointing solve option is "; msg.append(BundleObservationSolveSettings::instrumentPointingSolveOptionToString( pointingOption)); throw IException(IException::Unknown, msg, _FILEINFO_); @@ -505,7 +505,7 @@ namespace Isis { } catch (IException &e) { - QString msg = "Unable to apply parameter corrections to IsisBundleObservation."; + std::string msg = "Unable to apply parameter corrections to IsisBundleObservation."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } return true; @@ -1331,7 +1331,7 @@ QStringList IsisBundleObservation::parameterList() { double computedX, computedY; if (!(measureCamera->GroundMap()->GetXY(point->adjustedSurfacePoint(), &computedX, &computedY, false))) { - QString msg = "Unable to map apriori surface point for measure "; + std::string msg = "Unable to map apriori surface point for measure "; msg += measure.cubeSerialNumber() + " on point " + point->id() + " into focal plane"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/BundleUtilities/unitTest.cpp b/isis/src/control/objs/BundleUtilities/unitTest.cpp index a37cbab14c..234f1806f8 100755 --- a/isis/src/control/objs/BundleUtilities/unitTest.cpp +++ b/isis/src/control/objs/BundleUtilities/unitTest.cpp @@ -384,7 +384,7 @@ int main(int argc, char *argv[]) { //bool deleted = qXmlFile.remove(); //if (!deleted) { - // QString msg = "Unit Test failed. XML file [" + xmlPath + "not deleted."; + // std::string msg = "Unit Test failed. XML file [" + xmlPath + "not deleted."; // throw IException(IException::Io, msg, _FILEINFO_); //} diff --git a/isis/src/control/objs/ControlMeasure/ControlMeasure.cpp b/isis/src/control/objs/ControlMeasure/ControlMeasure.cpp index 046e6e851d..cb9021d889 100644 --- a/isis/src/control/objs/ControlMeasure/ControlMeasure.cpp +++ b/isis/src/control/objs/ControlMeasure/ControlMeasure.cpp @@ -434,7 +434,7 @@ namespace Isis { */ void ControlMeasure::SetLogData(ControlMeasureLogData data) { if (!data.IsValid()) { - QString msg = "Cannot set log data with invalid information stored in " + std::string msg = "Cannot set log data with invalid information stored in " "the ControlMeasureLogData"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -514,7 +514,7 @@ namespace Isis { } if (!updated) { - QString msg = "Unable to update the log data for [" + std::string msg = "Unable to update the log data for [" + newLogData.DataTypeToName(newLogData.GetDataType()) + "] because this" " control measure does not have log data for this value. Please use " "SetLogData instead"; @@ -544,7 +544,7 @@ namespace Isis { return *p_chooserName; } else { - return FileName(Application::Name()).name(); + return QString::fromStdString(FileName(Application::Name().toStdString()).name()); } } @@ -678,7 +678,7 @@ namespace Isis { } if (!validField) { - QString msg = "Cannot test IsStatisticallyRelevant on Measure Data [" + std::string msg = "Cannot test IsStatisticallyRelevant on Measure Data [" + QString(field) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -742,7 +742,7 @@ namespace Isis { QString ControlMeasure::GetPointId() const { if (parentPoint == NULL) { - QString msg = "Measure has no containing point"; + std::string msg = "Measure has no containing point"; throw IException(IException::User, msg, _FILEINFO_); } @@ -823,7 +823,7 @@ namespace Isis { return p_ignore; } else { - QString msg = data + " passed to GetMeasureData but is invalid"; + std::string msg = data + " passed to GetMeasureData but is invalid"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -970,7 +970,7 @@ namespace Isis { } if (sPrintable == "") { - QString msg = "Measure type [" + toString(type) + "] cannot be converted " + std::string msg = "Measure type [" + toString(type) + "] cannot be converted " "to a string"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlNet/ControlNet.cpp b/isis/src/control/objs/ControlNet/ControlNet.cpp index 21a56a6698..aad259a77a 100644 --- a/isis/src/control/objs/ControlNet/ControlNet.cpp +++ b/isis/src/control/objs/ControlNet/ControlNet.cpp @@ -117,7 +117,7 @@ namespace Isis { ReadControl(ptfile, progress); } catch (IException &e) { - QString msg = "Invalid control network [" + ptfile + "]"; + std::string msg = "Invalid control network [" + ptfile + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -315,7 +315,7 @@ namespace Isis { network = versionedWriter.toPvl(); } catch (IException &e) { - QString msg = "Failed to convert control network to Pvl format."; + std::string msg = "Failed to convert control network to Pvl format."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } @@ -323,7 +323,7 @@ namespace Isis { network.write(ptfile.toStdString()); } catch (IException &e) { - QString msg = "Failed writing control network to file [" + ptfile + "]"; + std::string msg = "Failed writing control network to file [" + ptfile + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -332,7 +332,7 @@ namespace Isis { versionedWriter.write(QString::fromStdString((FileName(ptfile).toString()))); } catch (IException &e) { - QString msg = "Failed writing control network to file [" + ptfile + "]"; + std::string msg = "Failed writing control network to file [" + ptfile + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -387,7 +387,7 @@ namespace Isis { } if (!ContainsPoint(point->GetId())) { - QString msg = "ControlNet does not contain the point ["; + std::string msg = "ControlNet does not contain the point ["; msg += point->GetId() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -590,7 +590,7 @@ namespace Isis { } if (!ContainsPoint(point->GetId())) { - QString msg = "ControlNet does not contain the point ["; + std::string msg = "ControlNet does not contain the point ["; msg += point->GetId() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -646,7 +646,7 @@ namespace Isis { QString sourceSerial = sourceMeasure->GetCubeSerialNumber(); if (!ValidateSerialNumber(sourceSerial)) { - QString msg = "Node does not exist for ["; + std::string msg = "Node does not exist for ["; msg += sourceSerial + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -656,7 +656,7 @@ namespace Isis { QString targetSerial = targetMeasure->GetCubeSerialNumber(); if (!ValidateSerialNumber(targetSerial)) { - QString msg = "Node does not exist for ["; + std::string msg = "Node does not exist for ["; msg += targetSerial + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -693,7 +693,7 @@ namespace Isis { } if (!ContainsPoint(point->GetId())) { - QString msg = "ControlNet does not contain the point ["; + std::string msg = "ControlNet does not contain the point ["; msg += point->GetId() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -703,7 +703,7 @@ namespace Isis { ControlMeasure *adjacentMeasure = point->GetMeasure(i); QString sn = adjacentMeasure->GetCubeSerialNumber(); if (!adjacentMeasure->IsIgnored() && !m_vertexMap.contains(sn)) { - QString msg = "Node does not exist for ["; + std::string msg = "Node does not exist for ["; msg += measure->GetCubeSerialNumber() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -786,7 +786,7 @@ namespace Isis { QString sourceSerial = sourceMeasure->GetCubeSerialNumber(); if (!ValidateSerialNumber(sourceSerial)) { - QString msg = "Node does not exist for ["; + std::string msg = "Node does not exist for ["; msg += sourceSerial + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -796,7 +796,7 @@ namespace Isis { QString targetSerial = targetMeasure->GetCubeSerialNumber(); if (!ValidateSerialNumber(targetSerial)) { - QString msg = "Node does not exist for ["; + std::string msg = "Node does not exist for ["; msg += targetSerial + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -830,7 +830,7 @@ namespace Isis { QString serial = measure->GetCubeSerialNumber(); if (!ValidateSerialNumber(serial)) { - QString msg = "Node does not exist for ["; + std::string msg = "Node does not exist for ["; msg += serial + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1036,7 +1036,7 @@ namespace Isis { */ QList< QString > ControlNet::getAdjacentImages(QString serialNumber) const { if (!ValidateSerialNumber(serialNumber)) { - QString msg = "Cube Serial Number [" + serialNumber + "] not found in " + std::string msg = "Cube Serial Number [" + serialNumber + "] not found in " "the network"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1280,7 +1280,7 @@ namespace Isis { double sample, double line) { if (!ValidateSerialNumber(serialNumber)) { - QString msg = "serialNumber ["; + std::string msg = "serialNumber ["; msg += serialNumber; msg += "] not found in ControlNet"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1607,7 +1607,7 @@ namespace Isis { for (int i = 0; i < list.size(); i++) { QString serialNumber = list.serialNumber(i); QString filename = list.fileName(i); - Cube cube(filename, "r"); + Cube cube(filename.toStdString(), "r"); try { Isis::Camera *cam = CameraFactory::Create(cube); @@ -1617,7 +1617,7 @@ namespace Isis { p_cameraList.push_back(cam); } catch (IException &e) { - QString msg = "Unable to create camera for cube file "; + std::string msg = "Unable to create camera for cube file "; msg += filename; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp b/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp index 63167c87fb..beeca443ec 100644 --- a/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp +++ b/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp @@ -91,7 +91,7 @@ namespace Isis { Pvl results; PvlObject report("Differences"); - diff("Filename", net1Name.name(), net2Name.name(), report); + diff("Filename", QString::fromStdString(net1Name.name()), QString::fromStdString(net2Name.name()), report); ControlNetVersioner cnv1(net1Name); ControlNetVersioner cnv2(net2Name); diff --git a/isis/src/control/objs/ControlNetDiff/unitTest.cpp b/isis/src/control/objs/ControlNetDiff/unitTest.cpp index 393e194da0..7ba38927b5 100644 --- a/isis/src/control/objs/ControlNetDiff/unitTest.cpp +++ b/isis/src/control/objs/ControlNetDiff/unitTest.cpp @@ -42,7 +42,7 @@ int main() { cout << results << endl; cout << "\n\nTesting differences with tolerances...\n\n"; - Pvl diffFile(FileName("cnet.diff").expanded().toStdString()); + Pvl diffFile(FileName("cnet.diff").expanded()); diff.addTolerances(diffFile); results = diff.compare(f1, f2); cout << results << endl; diff --git a/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp b/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp index 958428daf3..92d6569380 100644 --- a/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp +++ b/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp @@ -64,8 +64,8 @@ namespace Isis { * @param pbPvl */ void ControlNetFilter::SetOutputFile(QString psPrintFile) { - Isis::FileName outFile(psPrintFile); - QString outName(outFile.expanded()); + Isis::FileName outFile(psPrintFile.toStdString()); + QString outName(QString::fromStdString(outFile.expanded())); mOstm.open(outName.toLatin1().data(), std::ios::out); mOstm.precision(dbl::digits10); } @@ -684,7 +684,7 @@ namespace Isis { QString sn = cm->GetCubeSerialNumber(); QString filename = mSerialNumList.fileName(sn); - Cube cube(filename, "r"); + Cube cube(filename.toStdString(), "r"); Camera *camera = CameraFactory::Create(cube); if (camera->SetImage(cm->GetSample(), cm->GetLine())) { @@ -760,7 +760,7 @@ namespace Isis { if (!surfacePt1.Valid()) { QString sn1 = cp1RefMeasure->GetCubeSerialNumber(); QString filename1 = mSerialNumList.fileName(sn1); - Cube cube1(filename1, "r"); + Cube cube1(filename1.toStdString(), "r"); cam1 = CameraFactory::Create(cube1); if (cam1->SetImage(cp1RefMeasure->GetSample(), cp1RefMeasure->GetLine())) { @@ -800,7 +800,7 @@ namespace Isis { if (!surfacePt2.Valid()) { QString sn2 = cp2RefMeasure->GetCubeSerialNumber(); QString filename2 = mSerialNumList.fileName(sn2); - Cube cube2(filename2, "r"); + Cube cube2(filename2.toStdString(), "r"); cam2 = CameraFactory::Create(cube2); if (cam2->SetImage(cp2RefMeasure->GetSample(), @@ -1320,7 +1320,7 @@ namespace Isis { int iNumCubes = mSerialNumFilter.size(); for (int sn = (iNumCubes - 1); sn >= 0; sn--) { QString sSerialNum = mSerialNumFilter.serialNumber(sn); - Cube cube(mSerialNumList.fileName(sSerialNum), "r"); + Cube cube(mSerialNumList.fileName(sSerialNum).toStdString(), "r"); Camera *cam = CameraFactory::Create(cube); double dDist = 0; bool bMatchDistance = false; diff --git a/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp b/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp index 6d96122fe5..a16837b8fb 100644 --- a/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp +++ b/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp @@ -318,17 +318,17 @@ namespace Isis { void ControlNetStatistics::PrintImageStats(const QString &psImageFile) { // Check if the image list has been provided if (!mSerialNumList.size()) { - QString msg = "Serial Number of Images has not been provided to get Image Stats"; + std::string msg = "Serial Number of Images has not been provided to get Image Stats"; throw IException(IException::User, msg, _FILEINFO_); } - FileName outFile(psImageFile); + FileName outFile(psImageFile.toStdString()); ofstream ostm; - QString outName(outFile.expanded()); + QString outName(QString::fromStdString(outFile.expanded())); ostm.open(outName.toLatin1().data(), std::ios::out); if ( ostm.fail() ) { - QString msg = QObject::tr("Cannot open file [%1]").arg(psImageFile); + std::string msg = QObject::tr("Cannot open file [%1]").arg(psImageFile); throw IException(IException::Io, msg, _FILEINFO_); } @@ -355,7 +355,7 @@ namespace Isis { } if (!ostm) { - QString msg = QObject::tr("Error writing to file: [%1]").arg(psImageFile); + std::string msg = QObject::tr("Error writing to file: [%1]").arg(psImageFile); throw IException(IException::Io, msg, _FILEINFO_); } ostm.close(); @@ -386,14 +386,14 @@ namespace Isis { * @param psPointFile - Output Point Statisitics File */ void ControlNetStatistics::GeneratePointStats(const QString &psPointFile) { - Isis::FileName outFile(psPointFile); + Isis::FileName outFile(psPointFile.toStdString()); ofstream ostm; - QString outName(outFile.expanded()); + QString outName(QString::fromStdString(outFile.expanded())); ostm.open(outName.toLatin1().data(), std::ios::out); if ( ostm.fail() ) { - QString msg = QObject::tr("Cannot open file [%1]").arg(psPointFile); + std::string msg = QObject::tr("Cannot open file [%1]").arg(psPointFile); throw IException(IException::Io, msg, _FILEINFO_); } @@ -425,7 +425,7 @@ namespace Isis { } if (!ostm) { - QString msg = QObject::tr("Error writing to file: [%1]").arg(psPointFile); + std::string msg = QObject::tr("Error writing to file: [%1]").arg(psPointFile); throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp b/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp index c678e224c4..876c224af7 100644 --- a/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp +++ b/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp @@ -187,7 +187,7 @@ namespace Isis { measureCamera = pCube->camera(); } catch(IException &e) { - QString msg = "Cannot Create Camera for Image:" + pCube->fileName(); + std::string msg = "Cannot Create Camera for Image:" + pCube->fileName(); throw IException(IException::User, msg, _FILEINFO_); } } @@ -443,12 +443,12 @@ namespace Isis { mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : std::to_string(mdMaxResolution))); if(mdMinResolution < 0 || mdMaxResolution < 0) { - QString msg = "Invalid Resolution value(s), Resolution must be greater than zero"; + std::string msg = "Invalid Resolution value(s), Resolution must be greater than zero"; throw IException(IException::User, msg, _FILEINFO_); } if(mdMaxResolution < mdMinResolution) { - QString msg = "MinResolution must be less than MaxResolution"; + std::string msg = "MinResolution must be less than MaxResolution"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -481,7 +481,7 @@ namespace Isis { mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : std::to_string(mdMaxDN))); if(mdMaxDN < mdMinDN) { - QString msg = "MinDN must be less than MaxDN"; + std::string msg = "MinDN must be less than MaxDN"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -499,7 +499,7 @@ namespace Isis { mdMinEmissionAngle = mPvlOpGrp["MinEmission"]; mbCameraRequired = true; if(mdMinEmissionAngle < 0 || mdMinEmissionAngle > 135) { - QString msg = "Invalid Min Emission Angle, Valid Range is [0-135]"; + std::string msg = "Invalid Min Emission Angle, Valid Range is [0-135]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -509,14 +509,14 @@ namespace Isis { mdMaxEmissionAngle = mPvlOpGrp["MaxEmission"]; mbCameraRequired = true; if(mdMaxEmissionAngle < 0 || mdMaxEmissionAngle > 135) { - QString msg = "Invalid Max Emission Angle, Valid Range is [0-135]"; + std::string msg = "Invalid Max Emission Angle, Valid Range is [0-135]"; throw IException(IException::User, msg, _FILEINFO_); } } mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", std::to_string(mdMaxEmissionAngle)); if(mdMaxEmissionAngle < mdMinEmissionAngle) { - QString msg = "Min EmissionAngle must be less than Max EmissionAngle"; + std::string msg = "Min EmissionAngle must be less than Max EmissionAngle"; throw IException(IException::User, msg, _FILEINFO_); } @@ -535,7 +535,7 @@ namespace Isis { mdMinIncidenceAngle = mPvlOpGrp["MinIncidence"]; mbCameraRequired = true; if(mdMinIncidenceAngle < 0 || mdMinIncidenceAngle > 135) { - QString msg = "Invalid Min Incidence Angle, Valid Range is [0-135]"; + std::string msg = "Invalid Min Incidence Angle, Valid Range is [0-135]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -545,14 +545,14 @@ namespace Isis { mdMaxIncidenceAngle = mPvlOpGrp["MaxIncidence"]; mbCameraRequired = true; if(mdMaxIncidenceAngle < 0 || mdMaxIncidenceAngle > 135) { - QString msg = "Invalid Max Incidence Angle, Valid Range is [0-135]"; + std::string msg = "Invalid Max Incidence Angle, Valid Range is [0-135]"; throw IException(IException::User, msg, _FILEINFO_); } } mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", std::to_string(mdMaxIncidenceAngle)); if(mdMaxIncidenceAngle < mdMinIncidenceAngle) { - QString msg = "Min IncidenceAngle must be less than Max IncidenceAngle"; + std::string msg = "Min IncidenceAngle must be less than Max IncidenceAngle"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -568,7 +568,7 @@ namespace Isis { if(mPvlOpGrp.hasKeyword("SampleResidual")) { mdSampleResTolerance = mPvlOpGrp["SampleResidual"]; if(mdSampleResTolerance < 0) { - QString msg = "Invalid Sample Residual, must be greater than zero"; + std::string msg = "Invalid Sample Residual, must be greater than zero"; throw IException(IException::User, msg, _FILEINFO_); } bRes = true; @@ -578,7 +578,7 @@ namespace Isis { if(mPvlOpGrp.hasKeyword("LineResidual")) { mdLineResTolerance = mPvlOpGrp["LineResidual"]; if(mdLineResTolerance < 0) { - QString msg = "Invalid Line Residual, must be greater than zero"; + std::string msg = "Invalid Line Residual, must be greater than zero"; throw IException(IException::User, msg, _FILEINFO_); } bRes = true; @@ -588,7 +588,7 @@ namespace Isis { if(mPvlOpGrp.hasKeyword("ResidualMagnitude")) { mdResidualTolerance = mPvlOpGrp["ResidualMagnitude"]; if(mdResidualTolerance < 0) { - QString msg = "Invalid Residual Magnitude Tolerance, must be greater than zero"; + std::string msg = "Invalid Residual Magnitude Tolerance, must be greater than zero"; throw IException(IException::User, msg, _FILEINFO_); } bResMag = true; @@ -596,7 +596,7 @@ namespace Isis { mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : std::to_string(mdResidualTolerance))); if(bRes && bResMag) { - QString msg = "Cannot have both Sample/Line Residuals and Residual Magnitude."; + std::string msg = "Cannot have both Sample/Line Residuals and Residual Magnitude."; msg += "\nChoose either Sample/Line Residual or Residual Magnitude"; throw IException(IException::User, msg, _FILEINFO_); } @@ -612,7 +612,7 @@ namespace Isis { if (mPvlOpGrp.hasKeyword("SampleShift")) { m_sampleShiftTolerance = mPvlOpGrp["SampleShift"]; if (m_sampleShiftTolerance < 0) { - QString msg = "Invalid Sample Shift tolerance:" + std::string msg = "Invalid Sample Shift tolerance:" " must be greater than or equal to zero"; throw IException(IException::User, msg, _FILEINFO_); } @@ -623,7 +623,7 @@ namespace Isis { if (mPvlOpGrp.hasKeyword("LineShift")) { m_lineShiftTolerance = mPvlOpGrp["LineShift"]; if (m_lineShiftTolerance < 0) { - QString msg = "Invalid Line Shift tolerance:" + std::string msg = "Invalid Line Shift tolerance:" " must be greater than or equal to zero"; throw IException(IException::User, msg, _FILEINFO_); } @@ -635,7 +635,7 @@ namespace Isis { if (mPvlOpGrp.hasKeyword("PixelShift")) { m_pixelShiftTolerance = mPvlOpGrp["PixelShift"]; if (m_pixelShiftTolerance < 0) { - QString msg = "Invalid Pixel Shift tolerance:" + std::string msg = "Invalid Pixel Shift tolerance:" " must be greater than or equal to zero"; throw IException(IException::User, msg, _FILEINFO_); } @@ -644,7 +644,7 @@ namespace Isis { mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : std::to_string(m_pixelShiftTolerance))); if (hasSampleLineShift && hasPixelShift) { - QString msg = "Cannot have both Sample/Line Shift and Pixel Shift"; + std::string msg = "Cannot have both Sample/Line Shift and Pixel Shift"; msg += " tolerances.\n"; msg += "Choose either Sample/Line Shift or Pixel Shift to validate on"; throw IException(IException::User, msg, _FILEINFO_); @@ -937,7 +937,7 @@ namespace Isis { return false; } catch(IException &e) { - QString msg = "Cannot Create Camera for Image [" + + std::string msg = "Cannot Create Camera for Image [" + pCube->fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp index 2291dc8d1c..b924421530 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp @@ -920,7 +920,7 @@ namespace Isis { BigInt coreStartPos = protoBufferCore["StartByte"]; BigInt coreLength = protoBufferCore["Bytes"]; - fstream input(netFile.expanded(), ios::in | ios::binary); + fstream input(netFile.expanded().c_str(), ios::in | ios::binary); if ( !input.is_open() ) { std::string msg = "Failed to open protobuf file [" + netFile.name() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1044,7 +1044,7 @@ namespace Isis { BigInt headerStartPos = protoBufferCore["HeaderStartByte"]; BigInt headerLength = protoBufferCore["HeaderBytes"]; - fstream input(netFile.expanded().toLatin1().data(), ios::in | ios::binary); + fstream input(netFile.expanded().c_str(), ios::in | ios::binary); if ( !input.is_open() ) { std::string msg = "Failed to open control network file" + netFile.name(); throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1097,7 +1097,7 @@ namespace Isis { // read each protobuf control point and then initialize it // For some reason, reading the header causes the input stream to fail so reopen the file input.close(); - input.open(netFile.expanded(), ios::in | ios::binary); + input.open(netFile.expanded().c_str(), ios::in | ios::binary); input.seekg(filePos, ios::beg); IstreamInputStream pointInStream(&input); int numPoints = protoHeader.pointmessagesizes_size(); @@ -1163,7 +1163,7 @@ namespace Isis { BigInt headerLength = protoBufferCore["HeaderBytes"]; BigInt pointsLength = protoBufferCore["PointsBytes"]; - fstream input(netFile.expanded(), ios::in | ios::binary); + fstream input(netFile.expanded().c_str(), ios::in | ios::binary); if ( !input.is_open() ) { std::string msg = "Failed to open control network file" + netFile.name(); throw IException(IException::Programmer, msg, _FILEINFO_); @@ -1186,7 +1186,7 @@ namespace Isis { if ( !protoHeader.ParseFromCodedStream(&headerCodedInStream) ) { std::string msg = "Failed to parse protobuf header from input control net file [" - + netFile.name()+ "]"; + + netFile.name() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1222,7 +1222,7 @@ namespace Isis { // read each protobuf control point and then initialize it // For some reason, reading the header causes the input stream to fail so reopen the file input.close(); - input.open(netFile.expanded(), ios::in | ios::binary); + input.open(netFile.expanded().c_str(), ios::in | ios::binary); input.seekg(filePos, ios::beg); IstreamInputStream pointInStream(&input); @@ -1658,7 +1658,7 @@ namespace Isis { try { const int labelBytes = 65536; - fstream output(netFile.expanded(), ios::out | ios::trunc | ios::binary); + fstream output(netFile.expanded().c_str(), ios::out | ios::trunc | ios::binary); char *blankLabel = new char[labelBytes]; memset(blankLabel, 0, labelBytes); output.write(blankLabel, labelBytes); diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp index ca12db9fdb..db8ea75cbd 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp @@ -170,7 +170,7 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint::BundleSolution); } else { - QString msg = "Invalid AprioriXYZSource [" + source + "]"; + std::string msg = "Invalid AprioriXYZSource [" + source + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -200,7 +200,7 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint::BundleSolution); } else { - QString msg = "Invalid AprioriLatLonSource [" + source + "]"; + std::string msg = "Invalid AprioriLatLonSource [" + source + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -229,7 +229,7 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint::BundleSolution); } else { - QString msg = "Invalid AprioriRadiusSource, [" + source + "]"; + std::string msg = "Invalid AprioriRadiusSource, [" + source + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -523,7 +523,7 @@ namespace Isis { dataType = 8; } else { - QString msg = "Invalid control measure log data name [" + name + "]"; + std::string msg = "Invalid control measure log data name [" + name + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp index 2268a4e882..724c831735 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp @@ -116,7 +116,7 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint::BundleSolution); } else { - QString msg = "Invalid AprioriXYZSource [" + source + "]"; + std::string msg = "Invalid AprioriXYZSource [" + source + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -145,7 +145,7 @@ namespace Isis { ControlNetFileProtoV0001_PBControlPoint::BundleSolution); } else { - QString msg = "Invalid AprioriRadiusSource, [" + source + "]"; + std::string msg = "Invalid AprioriRadiusSource, [" + source + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -297,7 +297,7 @@ namespace Isis { dataType = 8; } else { - QString msg = "Invalid control measure log data name [" + name + "]"; + std::string msg = "Invalid control measure log data name [" + name + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -321,7 +321,7 @@ namespace Isis { } if (!m_pointData->IsInitialized()) { - QString msg = "There is missing required information in the control " + std::string msg = "There is missing required information in the control " "points or measures"; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp index 9013c005ca..8719b50909 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp @@ -121,7 +121,7 @@ namespace Isis { m_pointData->set_apriorisurfpointsource(ControlPointFileEntryV0002::BundleSolution); } else { - QString msg = "Invalid AprioriXYZSource [" + source + "]"; + std::string msg = "Invalid AprioriXYZSource [" + source + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -148,7 +148,7 @@ namespace Isis { m_pointData->set_aprioriradiussource(ControlPointFileEntryV0002::BundleSolution); } else { - QString msg = "Invalid AprioriRadiusSource, [" + source + "]"; + std::string msg = "Invalid AprioriRadiusSource, [" + source + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -261,7 +261,7 @@ namespace Isis { } if (!m_pointData->IsInitialized()) { - QString msg = "There is missing required information in the control " + std::string msg = "There is missing required information in the control " "points or measures"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -277,12 +277,12 @@ namespace Isis { : m_pointData(new ControlPointFileEntryV0002) { QSharedPointer oldPointData = oldPoint.pointData(); if (!oldPointData) { - QString msg = "Version 2 control point is missing point data."; + std::string msg = "Version 2 control point is missing point data."; throw IException(IException::User, msg, _FILEINFO_); } QSharedPointer oldLogData = oldPoint.logData(); if (!oldLogData) { - QString msg = "Version 2 control point is missing measure log data."; + std::string msg = "Version 2 control point is missing measure log data."; throw IException(IException::User, msg, _FILEINFO_); } @@ -356,7 +356,7 @@ namespace Isis { m_pointData->set_type(ControlPointFileEntryV0002::Free); } else { - QString msg = "Invalid ControlPoint type."; + std::string msg = "Invalid ControlPoint type."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -383,7 +383,7 @@ namespace Isis { m_pointData->set_apriorisurfpointsource(ControlPointFileEntryV0002::BundleSolution); } else { - QString msg = "Invalid ControlPoint apriori surface point source."; + std::string msg = "Invalid ControlPoint apriori surface point source."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -410,7 +410,7 @@ namespace Isis { m_pointData->set_aprioriradiussource(ControlPointFileEntryV0002::BundleSolution); } else { - QString msg = "Invalid AprioriRadiusSource."; + std::string msg = "Invalid AprioriRadiusSource."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -513,7 +513,7 @@ namespace Isis { newMeasure->set_type(ControlPointFileEntryV0002_Measure_MeasureType_RegisteredSubPixel); } else { - QString msg = "Invalid measure type"; + std::string msg = "Invalid measure type"; throw IException(IException::User, msg, _FILEINFO_); } @@ -534,7 +534,7 @@ namespace Isis { // Check that all the required fields in the measure are filled if ( !newMeasure->IsInitialized() ) { - QString msg = "Measure file entry at index [" + toString(i) + std::string msg = "Measure file entry at index [" + toString(i) + "] is missing required fields."; throw IException(IException::User, msg, _FILEINFO_); } @@ -543,7 +543,7 @@ namespace Isis { // Check that all of the required fields in the point are filled if ( !m_pointData->IsInitialized() ) { - QString msg = "Control point file entry is missing required fields."; + std::string msg = "Control point file entry is missing required fields."; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/control/objs/ControlNetVersioner/unitTest.cpp b/isis/src/control/objs/ControlNetVersioner/unitTest.cpp index ea6a32497a..413871a264 100644 --- a/isis/src/control/objs/ControlNetVersioner/unitTest.cpp +++ b/isis/src/control/objs/ControlNetVersioner/unitTest.cpp @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) { ControlNetVersioner invalidVersionerV1(badCnetName); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); cout << message.replace(QRegExp("file.*control/unitTestData"), "file [control/unitTestData"); cout << endl; } @@ -169,7 +169,7 @@ int main(int argc, char *argv[]) { ControlNetVersioner invalidVersionerV2(badCnetName); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); cout << message.replace(QRegExp("file.*control/unitTestData"), "file [control/unitTestData"); cout << endl; } @@ -178,7 +178,7 @@ int main(int argc, char *argv[]) { ControlNetVersioner invalidVersionerV3(badCnetName); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); cout << message.replace(QRegExp("file.*control/unitTestData"), "file [control/unitTestData"); cout << endl; } @@ -187,7 +187,7 @@ int main(int argc, char *argv[]) { ControlNetVersioner invalidVersionerV4(badCnetName); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); cout << message.replace(QRegExp("file.*control/unitTestData"), "file [control/unitTestData"); cout << endl; } @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) { ControlNetVersioner invalidVersionerV5(badCnetName); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); cout << message.replace(QRegExp("file.*control/unitTestData"), "file [control/unitTestData"); cout << endl; } diff --git a/isis/src/control/objs/ControlPoint/ControlPoint.cpp b/isis/src/control/objs/ControlPoint/ControlPoint.cpp index 66cf986a19..ae8c19dcbc 100644 --- a/isis/src/control/objs/ControlPoint/ControlPoint.cpp +++ b/isis/src/control/objs/ControlPoint/ControlPoint.cpp @@ -233,7 +233,7 @@ namespace Isis { // Make sure measure is unique foreach(ControlMeasure * m, measures->values()) { if (m->GetCubeSerialNumber() == measure->GetCubeSerialNumber()) { - QString msg = "The SerialNumber is not unique. A measure with " + std::string msg = "The SerialNumber is not unique. A measure with " "serial number [" + measure->GetCubeSerialNumber() + "] already " "exists for ControlPoint [" + GetId() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -273,7 +273,7 @@ namespace Isis { */ void ControlPoint::ValidateMeasure(QString serialNumber) const { if (!measures->contains(serialNumber)) { - QString msg = "No measure with serial number [" + serialNumber + + std::string msg = "No measure with serial number [" + serialNumber + "] is owned by this point"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -362,7 +362,7 @@ namespace Isis { */ int ControlPoint::Delete(int index) { if (index < 0 || index >= cubeSerials->size()) { - QString msg = "index [" + QString(index) + "] out of bounds"; + std::string msg = "index [" + QString(index) + "] out of bounds"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -418,7 +418,7 @@ namespace Isis { const ControlMeasure *ControlPoint::GetMeasure(int index) const { if (index < 0 || index >= cubeSerials->size()) { - QString msg = "Index [" + toString(index) + "] out of range"; + std::string msg = "Index [" + toString(index) + "] out of range"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -428,7 +428,7 @@ namespace Isis { ControlMeasure *ControlPoint::GetMeasure(int index) { if (index < 0 || index >= cubeSerials->size()) { - QString msg = "Index [" + toString(index) + "] out of range"; + std::string msg = "Index [" + toString(index) + "] out of range"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -453,7 +453,7 @@ namespace Isis { */ const ControlMeasure *ControlPoint::GetRefMeasure() const { if (!HasRefMeasure()) { - QString msg = "Control point [" + GetId() + "] has no reference measure!"; + std::string msg = "Control point [" + GetId() + "] has no reference measure!"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -466,7 +466,7 @@ namespace Isis { */ ControlMeasure *ControlPoint::GetRefMeasure() { if (!HasRefMeasure()) { - QString msg = "Control point [" + GetId() + "] has no reference measure!"; + std::string msg = "Control point [" + GetId() + "] has no reference measure!"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -585,7 +585,7 @@ namespace Isis { } if (index < 0 || index >= cubeSerials->size()) { - QString msg = "Index ["; + std::string msg = "Index ["; msg += toString(index) + "] out of range"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -606,7 +606,7 @@ namespace Isis { } if (!cubeSerials->contains(sn)) { - QString msg = "Point [" + id + "] has no measure with serial number [" + + std::string msg = "Point [" + id + "] has no measure with serial number [" + sn + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -704,7 +704,7 @@ namespace Isis { */ ControlPoint::Status ControlPoint::SetType(PointType newType) { if (type != Fixed && type != Free && type != Constrained) { - QString msg = "Invalid Point Enumeration, [" + QString(type) + "], for " + std::string msg = "Invalid Point Enumeration, [" + QString(type) + "], for " "Control Point [" + GetId() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -898,7 +898,7 @@ namespace Isis { // if point is fixed or constrained, ensure valid a priori point coordinates exist if ( (IsFixed() || IsConstrained()) && !aprioriSurfacePoint.Valid() ) { - QString msg = "In method ControlPoint::ComputeApriori(). ControlPoint [" + GetId() + "] is "; + std::string msg = "In method ControlPoint::ComputeApriori(). ControlPoint [" + GetId() + "] is "; msg += "fixed or constrained and requires a priori coordinates"; throw IException(IException::User, msg, _FILEINFO_); } @@ -923,7 +923,7 @@ namespace Isis { Camera *cam = m->Camera(); if (cam == NULL) { QString cubeSN = m->GetCubeSerialNumber(); - QString msg = "in method ControlPoint::ComputeApriori(). Camera has not been set in "; + std::string msg = "in method ControlPoint::ComputeApriori(). Camera has not been set in "; msg += "measure for cube serial number [" + cubeSN + "], Control Point id "; msg += "[" + GetId() + "]. Camera must be set prior to calculating a priori coordinates"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -965,7 +965,7 @@ namespace Isis { // if no good measures, we're done // TODO: is the message true/meaningful? if (goodMeasures == 0) { - QString msg = "in method ControlPoint::ComputeApriori(). ControlPoint [" + GetId() + "] has "; + std::string msg = "in method ControlPoint::ComputeApriori(). ControlPoint [" + GetId() + "] has "; msg += "no measures which project to the body"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1122,7 +1122,7 @@ namespace Isis { // FocalPlaneMap which takes x/y to detector s/l. We will bypass the // distortion map and have residuals in undistorted pixels. if (!fpmap->SetFocalPlane(m->GetFocalPlaneComputedX(), m->GetFocalPlaneComputedY())) { - QString msg = "Sanity check #1 for ControlPoint [" + GetId() + + std::string msg = "Sanity check #1 for ControlPoint [" + GetId() + "], ControlMeasure [" + m->GetCubeSerialNumber() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); // This error shouldn't happen but check anyways @@ -1147,7 +1147,7 @@ namespace Isis { // For other sensors conver to undistorted pixels // Again we will bypass the distortion map and have residuals in undistorted pixels. if (!fpmap->SetFocalPlane(m->GetFocalPlaneMeasuredX(), m->GetFocalPlaneMeasuredY())) { - QString msg = "Sanity check #2 for ControlPoint [" + GetId() + + std::string msg = "Sanity check #2 for ControlPoint [" + GetId() + "], ControlMeasure [" + m->GetCubeSerialNumber() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); // This error shouldn't happen but check anyways @@ -1240,7 +1240,7 @@ namespace Isis { return chooserName; } else { - return FileName(Application::Name()).name(); + return QString::fromStdString(FileName(Application::Name().toStdString()).name()); } } @@ -1358,7 +1358,7 @@ namespace Isis { // On failure assume Free ControlPoint::PointType type = ControlPoint::Free; - QString errMsg = "There is no PointType that has a string representation" + std::string errMsg = "There is no PointType that has a string representation" " of \""; errMsg += pointTypeString; errMsg += "\"."; @@ -1758,7 +1758,7 @@ namespace Isis { */ QString ControlPoint::GetReferenceSN() const { if (!HasRefMeasure()) { - QString msg = "There is no reference measure set in the ControlPoint [" + + std::string msg = "There is no reference measure set in the ControlPoint [" + GetId() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1792,7 +1792,7 @@ namespace Isis { int index = cubeSerials->indexOf(sn); if (throws && index == -1) { - QString msg = "ControlMeasure [" + sn + "] does not exist in point [" + + std::string msg = "ControlMeasure [" + sn + "] does not exist in point [" + id + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1811,7 +1811,7 @@ namespace Isis { */ int ControlPoint::IndexOfRefMeasure() const { if (!HasRefMeasure()) { - QString msg = "There is no reference measure for point [" + id + "]." + std::string msg = "There is no reference measure for point [" + id + "]." " This also means of course that the point is empty!"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlPointList/ControlPointList.cpp b/isis/src/control/objs/ControlPointList/ControlPointList.cpp index 77041f7de3..02261110a7 100644 --- a/isis/src/control/objs/ControlPointList/ControlPointList.cpp +++ b/isis/src/control/objs/ControlPointList/ControlPointList.cpp @@ -27,7 +27,7 @@ namespace Isis { FileList list(psListFile); int size = list.size(); for(int i = 0; i < size; i++) { - qList.insert(i, list[i].toString()); + qList.insert(i, QString::fromStdString(list[i].toString())); mbFound.push_back(false); } mqCpList = QStringList(qList); @@ -36,7 +36,7 @@ namespace Isis { mqCpList.sort(); } catch(IException &e) { - QString msg = "Can't open or invalid file list [" + + std::string msg = "Can't open or invalid file list [" + psListFile.expanded() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -92,7 +92,7 @@ namespace Isis { } else { QString num = toString(piIndex); - QString msg = "Index [" + num + "] is invalid"; + std::string msg = "Index [" + num + "] is invalid"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -109,7 +109,7 @@ namespace Isis { return mqCpList.indexOf(QString(psCpId)); } else { - QString msg = "Requested control point id [" + psCpId + "] "; + std::string msg = "Requested control point id [" + psCpId + "] "; msg += "does not exist in the list"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/CorrelationMatrix/CorrelationMatrix.cpp b/isis/src/control/objs/CorrelationMatrix/CorrelationMatrix.cpp index b4e54225ec..9b9c43fda5 100644 --- a/isis/src/control/objs/CorrelationMatrix/CorrelationMatrix.cpp +++ b/isis/src/control/objs/CorrelationMatrix/CorrelationMatrix.cpp @@ -73,17 +73,17 @@ namespace Isis { m_visibleBlocks = NULL; if (storedMatrixData.name() != "CorrelationMatrixData") { - QString msg = "This Pvl Object does not have the correct correlation information. The Object " + std::string msg = "This Pvl Object does not have the correct correlation information. The Object " "you are looking for is called CorrelationMatrixData."; throw IException(IException::User, msg, _FILEINFO_); } try { m_covarianceFileName = - new FileName(QString::fromStdString(storedMatrixData.findKeyword("CovarianceMatrixFileName")[0])); + new FileName(storedMatrixData.findKeyword("CovarianceMatrixFileName")[0]); } catch (IException &e) { - QString msg = "Could not find the Covariance Matrix .dat file name."; + std::string msg = "Could not find the Covariance Matrix .dat file name."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -93,11 +93,11 @@ namespace Isis { m_correlationFileName = new FileName; } else { - m_correlationFileName = new FileName(corrFileName); + m_correlationFileName = new FileName(corrFileName.toStdString()); } } catch (IException &e) { - QString msg = "Could not find the Correlation Matrix .dat file name."; + std::string msg = "Could not find the Correlation Matrix .dat file name."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -111,7 +111,7 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Could not get Images and Parameters from ImagesAndParameters group."; + std::string msg = "Could not get Images and Parameters from ImagesAndParameters group."; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -203,7 +203,7 @@ namespace Isis { void CorrelationMatrix::computeCorrelationMatrix() { if ( !isValid() ) { - QString msg = "Cannot compute correlation matrix without a specified file name. Use " + std::string msg = "Cannot compute correlation matrix without a specified file name. Use " "setCorrelationFileName(FileName) before calling computeCorrelationMatrix()."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -212,8 +212,8 @@ namespace Isis { m_visibleBlocks = new QList; // Create file handle - QFile matrixInput( m_covarianceFileName->expanded() ); - QFile matrixOutput( m_correlationFileName->expanded() ); + QFile matrixInput(QString::fromStdString(m_covarianceFileName->expanded())); + QFile matrixOutput(QString::fromStdString(m_correlationFileName->expanded())); // Open file to write to matrixInput.open(QIODevice::ReadOnly); @@ -365,9 +365,8 @@ namespace Isis { } //Make the correlation matrix file name match the covariance matrix file name. if (!isValid()) { - QString fName = covarianceFileName.expanded().replace( QString("inverse"), - QString("correlation") ); - setCorrelationFileName( FileName(fName) ); + QString fName = QString::fromStdString(covarianceFileName.expanded()).replace("inverse","correlation"); + setCorrelationFileName(FileName(fName.toStdString())); } } @@ -476,8 +475,8 @@ namespace Isis { PvlObject CorrelationMatrix::pvlObject() { PvlObject corrMatInfo("CorrelationMatrixData"); - corrMatInfo += PvlKeyword( "CovarianceMatrixFileName", m_covarianceFileName->expanded().toStdString() ); - corrMatInfo += PvlKeyword( "CorrelationMatrixFileName", m_correlationFileName->expanded().toStdString() ); + corrMatInfo += PvlKeyword( "CovarianceMatrixFileName", m_covarianceFileName->expanded()); + corrMatInfo += PvlKeyword( "CorrelationMatrixFileName", m_correlationFileName->expanded()); PvlGroup imgsAndParams("ImagesAndParameters"); QMapIterator imgParamIt(*m_imagesAndParameters); diff --git a/isis/src/control/objs/CorrelationMatrix/unitTest.cpp b/isis/src/control/objs/CorrelationMatrix/unitTest.cpp index 1765dc2e3b..3ab9902599 100644 --- a/isis/src/control/objs/CorrelationMatrix/unitTest.cpp +++ b/isis/src/control/objs/CorrelationMatrix/unitTest.cpp @@ -173,7 +173,7 @@ int main() { } } catch (IException &e) { - QString msg = "Failed to create object using CorrelationMatrix(PvlObject)."; + std::string msg = "Failed to create object using CorrelationMatrix(PvlObject)."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/CsmBundleObservation/CsmBundleObservation.cpp b/isis/src/control/objs/CsmBundleObservation/CsmBundleObservation.cpp index 1b23444873..6fec653496 100644 --- a/isis/src/control/objs/CsmBundleObservation/CsmBundleObservation.cpp +++ b/isis/src/control/objs/CsmBundleObservation/CsmBundleObservation.cpp @@ -46,7 +46,7 @@ namespace Isis { CsmBundleObservation::CsmBundleObservation(BundleImageQsp image, QString observationNumber, QString instrumentId, BundleTargetBodyQsp bundleTargetBody) : BundleObservation(image, observationNumber, instrumentId, bundleTargetBody) { if (bundleTargetBody) { - QString msg = "Target body parameters cannot be solved for with CSM observations."; + std::string msg = "Target body parameters cannot be solved for with CSM observations."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -163,7 +163,7 @@ namespace Isis { bool CsmBundleObservation::applyParameterCorrections(LinearAlgebra::Vector corrections) { // Check that the correction vector is the correct size if (corrections.size() != m_paramIndices.size()) { - QString msg = "Invalid correction vector passed to observation."; + std::string msg = "Invalid correction vector passed to observation."; IException(IException::Programmer, msg, _FILEINFO_); } @@ -328,7 +328,7 @@ namespace Isis { */ bool CsmBundleObservation::computeTargetPartials(LinearAlgebra::Matrix &coeffTarget, BundleMeasure &measure, BundleSettingsQsp &bundleSettings, BundleTargetBodyQsp &bundleTargetBody) { if (bundleTargetBody) { - QString msg = "Target body parameters cannot be solved for with CSM observations."; + std::string msg = "Target body parameters cannot be solved for with CSM observations."; throw IException(IException::User, msg, _FILEINFO_); } return false; @@ -447,7 +447,7 @@ namespace Isis { // Get ground-to-image computed coordinates for this point. if (!(measureCamera->SetGround(point->adjustedSurfacePoint()))) { - QString msg = "Unable to map apriori surface point for measure "; + std::string msg = "Unable to map apriori surface point for measure "; msg += measure.cubeSerialNumber() + " on point " + point->id() + " back into image."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/InterestOperator/InterestOperator.cpp b/isis/src/control/objs/InterestOperator/InterestOperator.cpp index d39697380a..0a40debb5a 100644 --- a/isis/src/control/objs/InterestOperator/InterestOperator.cpp +++ b/isis/src/control/objs/InterestOperator/InterestOperator.cpp @@ -166,7 +166,7 @@ namespace Isis { if (!pUnivGrndMap.HasCamera()) // Level 3 images/mosaic or bad image { - QString msg = "Cannot run interest on images with no camera. Image " + + std::string msg = "Cannot run interest on images with no camera. Image " + pCube.fileName() + " has no Camera"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -436,7 +436,7 @@ namespace Isis { bestCamera = bestCube->camera(); } catch (IException &e) { - QString msg = "Cannot Create Camera for Image:" + mSerialNumbers.fileName(sn); + std::string msg = "Cannot Create Camera for Image:" + mSerialNumbers.fileName(sn); throw IException(IException::User, msg, _FILEINFO_); } @@ -481,7 +481,7 @@ namespace Isis { measureCamera = measureCube->camera(); } catch (IException &e) { - QString msg = "Cannot Create Camera for Image:" + mSerialNumbers.fileName(sn); + std::string msg = "Cannot Create Camera for Image:" + mSerialNumbers.fileName(sn); throw IException(e, IException::User, msg, _FILEINFO_); } @@ -661,7 +661,7 @@ namespace Isis { if (mbOverlaps) { overlapPoly = FindOverlap(pCnetPoint); if (overlapPoly == NULL) { - QString msg = "Unable to find overlap polygon for point [" + + std::string msg = "Unable to find overlap polygon for point [" + pCnetPoint.GetId() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -804,7 +804,7 @@ namespace Isis { camera = pCube.camera(); } catch (IException &e) { - QString msg = "Cannot Create Camera for Image:" + mSerialNumbers.fileName(serialNum); + std::string msg = "Cannot Create Camera for Image:" + mSerialNumbers.fileName(serialNum); throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/core/include/Blob.h b/isis/src/core/include/Blob.h index 6ac2830f76..920141efca 100644 --- a/isis/src/core/include/Blob.h +++ b/isis/src/core/include/Blob.h @@ -8,8 +8,6 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include -#include -#include #include "PvlObject.h" @@ -52,9 +50,9 @@ namespace Isis { */ class Blob { public: - Blob(const QString &name, const std::string &type); - Blob(const QString &name, const std::string &type, - const QString &file); + Blob(const std::string &name, const std::string &type); + Blob(const std::string &name, const std::string &type, + const std::string &file); Blob(const Blob &other); Blob() = default; Blob &operator=(const Blob &other); @@ -62,7 +60,7 @@ namespace Isis { virtual ~Blob(); std::string Type() const; - QString Name() const; + std::string Name() const; int Size() const; PvlObject &Label(); @@ -73,9 +71,9 @@ namespace Isis { virtual void Read(const Pvl &pvl, std::istream &is, const std::vector keywords = std::vector()); - void Write(const QString &file); + void Write(const std::string &file); void Write(Pvl &pvl, std::fstream &stm, - const QString &detachedFileName = "", bool overwrite=true); + const std::string &detachedFileName = "", bool overwrite=true); char *getBuffer(); @@ -90,14 +88,14 @@ namespace Isis { virtual void WriteData(std::fstream &os); PvlObject p_blobPvl; //!< Pvl Blob object - QString p_blobName; //!< Name of the Blob object + std::string p_blobName; //!< Name of the Blob object char *p_buffer; //!< Buffer blob data is stored in BigInt p_startByte; //!< Byte blob data starts at in buffer int p_nbytes; //!< Size of blob data (in bytes) std::string p_type; //!< Type of data stored in the buffer - QString p_detached; //!< Used for reading detached blobs - QString p_labelFile; //!< The file containing the labels + std::string p_detached; //!< Used for reading detached blobs + std::string p_labelFile; //!< The file containing the labels }; }; diff --git a/isis/src/core/include/Endian.h b/isis/src/core/include/Endian.h index cb44df41a1..ce89bcab7c 100644 --- a/isis/src/core/include/Endian.h +++ b/isis/src/core/include/Endian.h @@ -7,7 +7,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ -#include +#include "IString.h" namespace Isis { /** @@ -45,15 +45,15 @@ namespace Isis { Msb }; - inline QString ByteOrderName(Isis::ByteOrder byteOrder) { + inline std::string ByteOrderName(Isis::ByteOrder byteOrder) { if(byteOrder == Isis::NoByteOrder) return "None"; if(byteOrder == Isis::Lsb) return "Lsb"; if(byteOrder == Isis::Msb) return "Msb"; return "Error"; } - inline Isis::ByteOrder ByteOrderEnumeration(const QString &order) { - QString temp = order.toUpper(); + inline Isis::ByteOrder ByteOrderEnumeration(const std::string &order) { + std::string temp = IString::UpCase(order); if(temp == "LSB") return Isis::Lsb; if(temp == "MSB") return Isis::Msb; return Isis::NoByteOrder; diff --git a/isis/src/core/include/IException.h b/isis/src/core/include/IException.h index 7a11dc9781..fd5b488abd 100644 --- a/isis/src/core/include/IException.h +++ b/isis/src/core/include/IException.h @@ -15,8 +15,6 @@ find files of those names at the top level of this repository. **/ template class QList; -class QString; - /** * Macro for the filename and line number. This is typically used for the last * arguments to constructing an IException. @@ -163,9 +161,6 @@ namespace Isis { IException(ErrorType type, const std::string &message, const char *fileName, int lineNumber); - IException(ErrorType type, const QString &message, - const char *fileName, int lineNumber); - IException(const IException &caughtException, ErrorType newExceptionType, const char *message, const char *fileName, int lineNumber); @@ -174,10 +169,6 @@ namespace Isis { ErrorType newExceptionType, const std::string &message, const char *fileName, int lineNumber); - IException(const IException &caughtException, - ErrorType newExceptionType, const QString &message, - const char *fileName, int lineNumber); - IException(const IException &other); ~IException() throw(); @@ -199,7 +190,7 @@ namespace Isis { private: static IException createStackTrace(); - static ErrorType stringToErrorType(const QString &s); + static ErrorType stringToErrorType(const std::string &s); char *buildWhat() const; void deleteEmptyMemberStrings(); diff --git a/isis/src/core/include/IString.h b/isis/src/core/include/IString.h index 402b4b5c9c..ccc26d1403 100644 --- a/isis/src/core/include/IString.h +++ b/isis/src/core/include/IString.h @@ -9,8 +9,6 @@ find files of those names at the top level of this repository. **/ #include #include -#include - #include "Constants.h" namespace Isis { @@ -291,7 +289,7 @@ namespace Isis { }; // std::ostream &operator<<(std::ostream &os, const QString &string); - // std::ostream &operator<<(std::ostream &os, const QStringRef &string); + std::ostream &operator<<(std::ostream &os, const std::string &string); } #endif diff --git a/isis/src/core/include/PvlContainer.h b/isis/src/core/include/PvlContainer.h index 50564c5555..9325cc5bcf 100644 --- a/isis/src/core/include/PvlContainer.h +++ b/isis/src/core/include/PvlContainer.h @@ -155,10 +155,10 @@ namespace Isis { bool hasKeyword(const std::string &name) const; //! The keyword iterator. - typedef QList::iterator PvlKeywordIterator; + typedef std::vector::iterator PvlKeywordIterator; //! The const keyword iterator - typedef QList::const_iterator ConstPvlKeywordIterator; + typedef std::vector::const_iterator ConstPvlKeywordIterator; PvlKeywordIterator findKeyword(const std::string &name, @@ -288,7 +288,7 @@ namespace Isis { initialized using a filename the string is empty.*/ PvlKeyword m_name; //!< This is the name keyword - QList m_keywords; /** m_keywords; /** #include -#include -#include - #include "Constants.h" #include "IString.h" @@ -264,15 +261,7 @@ namespace Isis { //! The keyword's name... This is a c-string for memory efficiency char * m_name; - /** - * The values in the keyword. This is a QVarLengthArray purely for - * optimization purposes. The amount of memory consumed by other data - * types introduces very significant overhead relative to this type - * which is meant to be as cost-effective and cheap as possible. Most - * of the time we have one value per keyword so that is what we're - * allocating by default with this variable. - */ - QVarLengthArray m_values; + std::vector m_values; //! The units for the values. std::vector *m_units; diff --git a/isis/src/core/include/PvlObject.h b/isis/src/core/include/PvlObject.h index f58a286be3..8793f65aa2 100644 --- a/isis/src/core/include/PvlObject.h +++ b/isis/src/core/include/PvlObject.h @@ -11,8 +11,6 @@ find files of those names at the top level of this repository. **/ #include "PvlContainer.h" #include "PvlGroup.h" -#include - #include @@ -80,8 +78,8 @@ namespace Isis { const PvlGroup &group(const int index) const; //! The counter for groups. - typedef QList::iterator PvlGroupIterator; - typedef QList::const_iterator ConstPvlGroupIterator; + typedef std::vector::iterator PvlGroupIterator; + typedef std::vector::const_iterator ConstPvlGroupIterator; /** @@ -224,8 +222,8 @@ namespace Isis { const PvlObject &object(const int index) const; //! The counter for objects. - typedef QList::iterator PvlObjectIterator; - typedef QList::const_iterator ConstPvlObjectIterator; + typedef std::vector::iterator PvlObjectIterator; + typedef std::vector::const_iterator ConstPvlObjectIterator; /** @@ -350,13 +348,11 @@ namespace Isis { void validateObject(PvlObject & pPvlObj); private: - QList m_objects; /**
m_objects; /** m_groups;/** m_groups;/** #include #include -#include -#include - #include "IException.h" #include "IString.h" +#include namespace Isis { @@ -368,7 +366,7 @@ namespace Isis { * * @return string The name of the pixel type */ - inline QString PixelToString(double d, double precision=8) { + inline std::string PixelToString(double d, double precision=8) { if(Isis::IsSpecial(d)) { if(Isis::IsNullPixel(d)) return "Null"; if(Isis::IsLrsPixel(d)) return "Lrs"; @@ -378,8 +376,9 @@ namespace Isis { return "Invalid"; } - QString result; - return result.setNum(d, 'g', precision); + std::ostringstream result; + result << std::setprecision(precision) << std::scientific << d; + return result.str(); } @@ -391,11 +390,11 @@ namespace Isis { * * @return double Pixel value */ - inline double StringToPixel(const QString &str) { + inline double StringToPixel(const std::string &str) { - QString s = str.toUpper(); + std::string s = IString::UpCase(str); - QStringList legal; + std::vector legal; legal.push_back("NULL"); legal.push_back("HRS"); legal.push_back("LRS"); @@ -403,27 +402,27 @@ namespace Isis { legal.push_back("LIS"); int matches = 0; for(int i = 0; i < (int) legal.size(); i++) { - if(legal[i].mid(0, s.size()) == s) { + if(legal[i].substr(0, s.size()) == s) { matches++; } } if(matches > 1) { - QString msg = "Input [" + str + "] is not a unique abbreviation. Use " + s + "I or " + s + "R."; + std::string msg = "Input [" + str + "] is not a unique abbreviation. Use " + s + "I or " + s + "R."; throw IException(IException::User, msg, _FILEINFO_); } if(matches == 0) { try { - return toDouble(s.toStdString()); + return toDouble(s); } catch(IException &e) { - QString msg = "Input [" + str + "] does not appear to be a legal special pixel abbreviation or double value."; + std::string msg = "Input [" + str + "] does not appear to be a legal special pixel abbreviation or double value."; throw IException(e, IException::User, msg, _FILEINFO_); } } if(s[0] == 'N') return Null; - if(s.mid(0, 2) == "HR") return Hrs; - if(s.mid(0, 2) == "LR") return Lrs; - if(s.mid(0, 2) == "HI") return His; + if(s.substr(0, 2) == "HR") return Hrs; + if(s.substr(0, 2) == "LR") return Lrs; + if(s.substr(0, 2) == "HI") return His; else return Lis;//(s.substr(0,2) == "LI") } diff --git a/isis/src/core/include/Table.h b/isis/src/core/include/Table.h index 7696d8134e..11bbc42080 100644 --- a/isis/src/core/include/Table.h +++ b/isis/src/core/include/Table.h @@ -75,8 +75,8 @@ namespace Isis { Table(Blob &blob); Table(const std::string &tableName, TableRecord &rec); Table(const std::string &tableName);// Only use this constructor for reading in an existing table - Table(const std::string &tableName, const QString &file); - Table(const std::string &tableName, const QString &file, + Table(const std::string &tableName, const std::string &file); + Table(const std::string &tableName, const std::string &file, const Pvl &fileHeader); Table(const Table &other); Table(const QString &tableName, const std::string &tableString, const char &fieldDelimiter); @@ -85,7 +85,7 @@ namespace Isis { ~Table(); - void Write(const QString &file); + void Write(const std::string &file); std::string Name() const; PvlObject &Label(); diff --git a/isis/src/core/src/Blob.cpp b/isis/src/core/src/Blob.cpp index fc1908bb0e..53d968d585 100644 --- a/isis/src/core/src/Blob.cpp +++ b/isis/src/core/src/Blob.cpp @@ -23,7 +23,7 @@ namespace Isis { * @param name The blob name * @param type The blob type */ - Blob::Blob(const QString &name, const std::string &type) { + Blob::Blob(const std::string &name, const std::string &type) { p_blobName = name; p_buffer = NULL; p_labelFile = ""; @@ -31,7 +31,7 @@ namespace Isis { p_type = type; p_blobPvl.setName(p_type); - p_blobPvl += PvlKeyword("Name", p_blobName.toStdString()); + p_blobPvl += PvlKeyword("Name", p_blobName); p_blobPvl += PvlKeyword("StartByte", "0"); p_blobPvl += PvlKeyword("Bytes", "0"); } @@ -44,15 +44,15 @@ namespace Isis { * @param type The blob type * @param file The filename to read from. */ - Blob::Blob(const QString &name, const std::string &type, - const QString &file) { + Blob::Blob(const std::string &name, const std::string &type, + const std::string &file) { p_blobName = name; p_buffer = NULL; p_nbytes = 0; p_type = type; - p_labelFile = QString::fromStdString(FileName(file.toStdString()).expanded()); + p_labelFile = FileName(file).expanded(); - Read(file.toStdString()); + Read(file); } /** @@ -128,7 +128,7 @@ namespace Isis { * * @return @b string The name of the Blob. */ - QString Blob::Name() const { + std::string Blob::Name() const { return p_blobName; } @@ -166,13 +166,14 @@ namespace Isis { bool found = false; try { // Search for the blob name - QString blobName = p_blobName.toUpper(); + std::string blobName = p_blobName; + std::transform(blobName.begin(), blobName.end(), blobName.begin(), ::toupper); for (int o = 0; o < pvl.objects(); o++) { const PvlObject &obj = pvl.object(o); if (obj.isNamed(p_type)) { std::string curName = obj["Name"]; std::transform(curName.begin(), curName.end(), curName.begin(), ::toupper); - if (blobName.toStdString() == curName) { + if (blobName == curName) { // If there are keywords supplied, check that those match, too! if (!keywords.empty()){ bool keywordFound = true; @@ -218,7 +219,7 @@ namespace Isis { // Did we find it? if (!found) { - std::string msg = "Unable to find " + p_type + " [" + p_blobName.toStdString() + "]"; + std::string msg = "Unable to find " + p_type + " [" + p_blobName + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -230,9 +231,9 @@ namespace Isis { if (p_blobPvl.hasKeyword("^" + p_type)) { std::string path = ""; if (p_labelFile != "") { - path = FileName(p_labelFile.toStdString()).path() + "/"; + path = FileName(p_labelFile).path() + "/"; } - p_detached = QString::fromStdString(path + (std::string)p_blobPvl["^"+p_type]); + p_detached = path + (std::string)p_blobPvl["^"+p_type]; p_blobPvl.deleteKeyword("^" + p_type); } } @@ -292,7 +293,7 @@ namespace Isis { } catch (IException &e) { istm.close(); - std::string msg = "Unable to open " + p_type + " [" + p_blobName.toStdString() + + std::string msg = "Unable to open " + p_type + " [" + p_blobName + "] in file [" + temp + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -314,9 +315,9 @@ namespace Isis { ReadInit(); if (p_detached != "") { fstream dstm; - dstm.open(p_detached.toLatin1().data(), std::ios::in); + dstm.open(p_detached.c_str(), std::ios::in); if (!dstm) { - std::string message = Message::FileOpen(p_detached.toStdString()); + std::string message = Message::FileOpen(p_detached); throw IException(IException::Io, message, _FILEINFO_); } ReadData(dstm); @@ -326,7 +327,7 @@ namespace Isis { } } catch (IException &e) { - std::string msg = "Unable to read " + p_type + " [" + p_blobName.toStdString() + "]"; + std::string msg = "Unable to read " + p_type + " [" + p_blobName + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -355,13 +356,13 @@ namespace Isis { stream.seekg(sbyte, std::ios::beg); if (!stream.good()) { std::string msg = "Error preparing to read data from " + p_type + - " [" + p_blobName.toStdString() + "]"; + " [" + p_blobName + "]"; throw IException(IException::Io, msg, _FILEINFO_); } stream.read(p_buffer, p_nbytes); if (!stream.good()) { - std::string msg = "Error reading data from " + p_type + " [" + p_blobName.toStdString() + "]"; + std::string msg = "Error reading data from " + p_type + " [" + p_blobName + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -412,7 +413,7 @@ namespace Isis { * @throws IException::Io - Error preparing to write data to file * @throws IException::Io - Error creating file */ - void Blob::Write(const QString &file) { + void Blob::Write(const std::string &file) { // Determine the size of the label and write it out try { WriteInit(); @@ -425,14 +426,14 @@ namespace Isis { p_startByte = nbytes + 1 + 1; // 1-based; pvl.findObject(p_type)["StartByte"] = std::to_string(p_startByte); pvl.findObject(p_type)["Bytes"] = std::to_string(p_nbytes); - pvl.write(file.toStdString()); + pvl.write(file); // Prepare and write the binary data fstream stream; ios::openmode flags = std::ios::in | std::ios::binary | std::ios::out; - stream.open(file.toLatin1().data(), flags); + stream.open(file.c_str(), flags); if (!stream) { - QString message = "Unable to open [" + file + "]"; + std::string message = "Unable to open [" + file + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -441,7 +442,7 @@ namespace Isis { if (!stream.good()) { stream.close(); std::string msg = "Error preparing to write data to " + - p_type + " [" + p_blobName.toStdString() + "]"; + p_type + " [" + p_blobName + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -449,7 +450,7 @@ namespace Isis { stream.close(); } catch (IException &e) { - std::string msg = "Unable to create " + p_type + " file [" + file.toStdString() + "]"; + std::string msg = "Unable to create " + p_type + " file [" + file + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -462,7 +463,7 @@ namespace Isis { * the name of the file */ void Blob::Write(Pvl &pvl, std::fstream &stm, - const QString &detachedFileName, bool overwrite) { + const std::string &detachedFileName, bool overwrite) { // Handle 64-bit I/O WriteInit(); @@ -477,7 +478,7 @@ namespace Isis { // Handle detached blobs if (detachedFileName != "") { - p_blobPvl += PvlKeyword("^" + p_type, detachedFileName.toStdString()); + p_blobPvl += PvlKeyword("^" + p_type, detachedFileName); } @@ -562,7 +563,7 @@ namespace Isis { void Blob::WriteData(std::fstream &stream) { stream.write(p_buffer, p_nbytes); if (!stream.good()) { - std::string msg = "Error writing data to " + p_type + " [" + p_blobName.toStdString() + "]"; + std::string msg = "Error writing data to " + p_type + " [" + p_blobName + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } diff --git a/isis/src/core/src/IException.cpp b/isis/src/core/src/IException.cpp index aaad235245..6d08d67c41 100644 --- a/isis/src/core/src/IException.cpp +++ b/isis/src/core/src/IException.cpp @@ -46,44 +46,6 @@ namespace Isis { } - /** - * This version of the constructor creates an IException instance with the - * given error type, message, and file info. The IException instance will not - * have any previous exceptions associated with it initially (i.e. no - * exception caused this one to be thrown). - * - * @code - * throw IException(IException::Unknown, - * tr("While doing an important process, we could not do ... " - * "because the data [%1] is invalid").arg(...), - * _FILEINFO_); - * @endcode - * - * @param type the source of the error that this exception represents - * @param message the string message containing details about the error, which - * may be displayed to the user - * @param fileName the filename of the file that this exception was thrown in - * @param lineNumber the line in the source code file that threw this - * exception - */ - IException::IException(ErrorType type, const QString &message, - const char *fileName, int lineNumber) { - m_what = NULL; - m_message = NULL; - m_fileName = NULL; - m_previousExceptions = NULL; - - m_errorType = type; - m_message = new std::string(message.trimmed().toStdString()); - m_fileName = new std::string(fileName); - m_lineNumber = lineNumber; - - deleteEmptyMemberStrings(); - - m_what = buildWhat(); - } - - /** * This version of the constructor creates an IException instance with the * given error type, message, and file info. The IException instance will not @@ -126,8 +88,7 @@ namespace Isis { * This version of the constructor creates an IException instance with the * given error type, message, and file info. The IException instance will not * have any previous exceptions associated with it initially (i.e. no - * exception caused this one to be thrown). The QString version of - * this constructor is preferred over this one. + * exception caused this one to be thrown). * * @code * std::string message = "While doing an important process, we could not do .. " @@ -215,8 +176,7 @@ namespace Isis { * the given exception to its list of previous exceptions (as well as any * previous exceptions associated with the caught exception). Use this * constructor when you want to rethrow a new exception after catching an - * exception and preserve the previous message(s). The QString version of - * this constructor is preferred over this one. + * exception and preserve the previous message(s). * * @code * try { @@ -257,53 +217,6 @@ namespace Isis { } - /** - * This version of the constructor creates an IException instance with the - * given error type, message, file info. The IException instance will append - * the given exception to its list of previous exceptions (as well as any - * previous exceptions associated with the caught exception). Use this - * constructor when you want to rethrow a new exception after catching an - * exception and preserve the previous message(s). - * - * @code - * try { - * ... - * } - * catch (IException &e) { - * QString message = "While doing an important process, we could not do " - * "... "; - * throw IException(e, IException::Unknown, message, _FILEINFO_); - * } - * @endcode - * - * @param caughtException the previous exception that caused this exception to - * be thrown - * @param type the source of the error that this exception represents - * @param message the string message containing details about the error, which - * may be displayed to the user - * @param fileName the filename of the file that this exception was thrown in - * @param lineNumber the line in the source code file that threw this - * exception - */ - IException::IException(const IException &caughtException, - ErrorType type, const QString &message, - const char *fileName, int lineNumber) { - m_what = NULL; - m_message = NULL; - m_fileName = NULL; - m_previousExceptions = NULL; - - m_errorType = type; - m_message = new std::string(message.trimmed().toStdString()); - m_fileName = new std::string(fileName); - m_lineNumber = lineNumber; - - deleteEmptyMemberStrings(); - - append(caughtException); - } - - /** * The copy constructor creates a copy of the given exception. * @@ -674,7 +587,7 @@ namespace Isis { * if the string reads "USER ERROR", will return type User. */ IException::ErrorType IException::stringToErrorType( - const QString &string) { + const std::string &string) { ErrorType result = Unknown; if(string == "USER ERROR") diff --git a/isis/src/core/src/IString.cpp b/isis/src/core/src/IString.cpp index 6c45b3dcb6..072b0a86b5 100644 --- a/isis/src/core/src/IString.cpp +++ b/isis/src/core/src/IString.cpp @@ -102,11 +102,10 @@ namespace Isis { /** - * Global function to convert from a string to an integer. This function is - * preferred over the QString::toInt() method since this function will throw an + * Global function to convert from a string to an integer. * IException if the conversion is unsuccessful. * - * @param string QString to be converted to an integer. + * @param string std::string to be converted to an integer. * @return The integer equivalent to the string */ int toInt(const std::string &string) { @@ -135,7 +134,7 @@ namespace Isis { * * This function will throw an IException if the conversion is unsuccessful. * - * @param string QString to be converted to a big integer. + * @param string std::string to be converted to a big integer. * @return The BigInt equivalent to the string */ BigInt toBigInt(const std::string &string) { @@ -166,11 +165,9 @@ namespace Isis { /** * Global function to convert from a string to a double. If the string begins * with 16# and ends with #, the function will assume it is hexadecimal and - * attempt to convert to a double. This function is preferred over the - * QString::toDouble() method since this function will throw an IException - * if the conversion is unsuccessful. + * attempt to convert to a double. * - * @param string QString to be converted to a double. This may be a + * @param string std::string to be converted to a double. This may be a * hexadecimal string. * @return The double equivalent to the string */ @@ -236,8 +233,8 @@ namespace Isis { * Global function to convert a boolean to a string. The resulting string will * be "Yes" (true) or "No" (false). * - * @param boolToConvert Boolean value to be converted to a QString. - * @return string Converted QString (Yes or No). + * @param boolToConvert Boolean value to be converted to a std::string. + * @return string Converted std::string (Yes or No). */ std::string toString(bool boolToConvert) { return boolToConvert? "Yes" : "No"; @@ -249,8 +246,8 @@ namespace Isis { * be a string with length 1 which contains only the given ASCII * character. * - * @param charToConvert Character value to be converted to a QString. - * @return string Converted QString. + * @param charToConvert Character value to be converted to a std::string. + * @return string Converted std::string. */ std::string toString(char charToConvert) { std::string result; @@ -262,8 +259,8 @@ namespace Isis { /** * Global function to convert an integer to a string. * - * @param intToConvert Integer value to be converted to a QString. - * @return string Converted QString. + * @param intToConvert Integer value to be converted to a std::string. + * @return string Converted std::string. */ std::string toString(const int &intToConvert) { return std::to_string(intToConvert); @@ -273,8 +270,8 @@ namespace Isis { /** * Global function to convert an unsigned integer to a string. * - * @param intToConvert Unsigned integer value to be converted to a QString. - * @return string Converted QString. + * @param intToConvert Unsigned integer value to be converted to a std::string. + * @return string Converted std::string. */ std::string toString(const unsigned int &intToConvert) { return std::to_string(intToConvert); @@ -284,8 +281,8 @@ namespace Isis { /** * Global function to convert a big integer to a string. * - * @param intToConvert Big integer value to be converted to a QString. - * @return string Converted QString. + * @param intToConvert Big integer value to be converted to a std::string. + * @return string Converted std::string. */ std::string toString(const BigInt &intToConvert) { return std::to_string(intToConvert); @@ -301,9 +298,9 @@ namespace Isis { * If (log10(num) >= -3 && log10(num) <= 13) it is presented in normal notation * Trailing zeros are removed such that 5.000 is presented as 5.0 * - * @param doubleToConvert Double value to be converted to a QString. + * @param doubleToConvert Double value to be converted to a std::string. * @param precision Number of significant figures to convert. - * @return string Converted QString. + * @return string Converted std::string. */ std::string toString(double doubleToConvert, int precision) { // If number is zero, then it is not valid to do a log10 on it. To avoid this, @@ -1324,7 +1321,7 @@ namespace Isis { // /** - // * Print an ASCII representation of the given QString to a stl stream (most commonly cout, cerr). + // * Print an ASCII representation of the given std::string to a stl stream (most commonly cout, cerr). // * // * This is provided for convenience. No extra formatting is done; please see qDebug for a better // * way of printing out debug statements. @@ -1340,7 +1337,7 @@ namespace Isis { /** - * Print an ASCII representation of the given QStringRef to a stl stream (most commonly cout, cerr). + * Print an ASCII representation of the given stringRef to a stl stream (most commonly cout, cerr). * * This is provided for convenience. No extra formatting is done; please see qDebug for a better * way of printing out debug statements. @@ -1350,7 +1347,8 @@ namespace Isis { * * @return The modified output stream */ - std::ostream &operator<<(std::ostream &outputStream, const QStringRef &string) { - return (outputStream << string.toString().toLatin1().data()); + std::ostream &operator<<(std::ostream &outputStream, const std::string &string) { + outputStream.write(string.c_str(), string.size()); + return outputStream; } } diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index ee63488edb..4f72e1c5ee 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -268,7 +268,7 @@ namespace Isis { * @see operator+= */ void PvlKeyword::addValue(std::string value, std::string unit) { - m_values.append(value); + m_values.push_back(value); if (unit != "") { if (!m_units) { @@ -310,7 +310,9 @@ namespace Isis { } else if (jsonobj.is_number()) { - value = jsonobj.get(), 'g', 16; + std::ostringstream stream; + stream << std::setprecision(16) << std::fixed << jsonobj.get(); + value = stream.str(); } else if (jsonobj.is_boolean()) { diff --git a/isis/src/core/src/PvlObject.cpp b/isis/src/core/src/PvlObject.cpp index f44d594d3e..4aeda6039c 100644 --- a/isis/src/core/src/PvlObject.cpp +++ b/isis/src/core/src/PvlObject.cpp @@ -13,8 +13,6 @@ find files of those names at the top level of this repository. **/ #include "Message.h" #include "PvlFormat.h" -#include - #include #include diff --git a/isis/src/core/src/Table.cpp b/isis/src/core/src/Table.cpp index 04f42df90f..dd7f5fd312 100644 --- a/isis/src/core/src/Table.cpp +++ b/isis/src/core/src/Table.cpp @@ -85,8 +85,8 @@ namespace Isis { * * @see Blob::Read() */ - Table::Table(const std::string &tableName, const QString &file) { - Blob blob(QString::fromStdString(tableName), "Table", file); + Table::Table(const std::string &tableName, const std::string &file) { + Blob blob(tableName, "Table", file); initFromBlob(blob); } @@ -106,9 +106,9 @@ namespace Isis { * * @see Blob::Read() */ - Table::Table(const std::string &tableName, const QString &file, const Pvl &fileHeader) { - Blob blob(QString::fromStdString(tableName), "Table"); - blob.Read(file.toStdString(), fileHeader); + Table::Table(const std::string &tableName, const std::string &file, const Pvl &fileHeader) { + Blob blob(tableName, "Table"); + blob.Read(file, fileHeader); initFromBlob(blob); } @@ -229,7 +229,7 @@ namespace Isis { } // Determine if we need to swap stuff when we read the data - Isis::ByteOrder bo = Isis::ByteOrderEnumeration(QString::fromStdString(p_label["ByteOrder"])); + Isis::ByteOrder bo = Isis::ByteOrderEnumeration(p_label["ByteOrder"]); p_swap = false; if (Isis::IsLsb() && (bo == Isis::Msb)) p_swap = true; if (Isis::IsMsb() && (bo == Isis::Lsb)) p_swap = true; @@ -291,7 +291,7 @@ namespace Isis { * * @param file The file to write the Table to. */ - void Table::Write(const QString &file) { + void Table::Write(const std::string &file) { Blob blob = toBlob(); blob.Write(file); } @@ -470,7 +470,7 @@ namespace Isis { * @return @b Blob The Blob contaning the Table's data */ Blob Table::toBlob() const { - Blob tableBlob(QString::fromStdString(Name()), "Table"); + Blob tableBlob(Name(), "Table"); PvlObject &blobLabel = tableBlob.Label(); // Label setup @@ -478,10 +478,10 @@ namespace Isis { int nbytes = Records() * RecordSize(); if (Isis::IsLsb()) { - blobLabel+= PvlKeyword("ByteOrder", Isis::ByteOrderName(Isis::Lsb).toStdString()); + blobLabel+= PvlKeyword("ByteOrder", Isis::ByteOrderName(Isis::Lsb)); } else { - blobLabel+= PvlKeyword("ByteOrder", Isis::ByteOrderName(Isis::Msb).toStdString()); + blobLabel+= PvlKeyword("ByteOrder", Isis::ByteOrderName(Isis::Msb)); } if (p_assoc == Samples) { diff --git a/isis/src/core/tests/unitTests/Pvl/unitTest.cpp b/isis/src/core/tests/unitTests/Pvl/unitTest.cpp index f5650c1a39..eaa6f811df 100644 --- a/isis/src/core/tests/unitTests/Pvl/unitTest.cpp +++ b/isis/src/core/tests/unitTests/Pvl/unitTest.cpp @@ -63,7 +63,7 @@ int main() { cout.flush(); // make this error work regardless of directory... - QString errors = e.toString(); + std::string errors = e.toString(); while(errors.indexOf("/") != -1) { int pos = errors.indexOf("/"); @@ -91,7 +91,7 @@ int main() { cout.flush(); // make this error work regardless of directory... - QString errors = e.toString(); + std::string errors = e.toString(); while(errors.indexOf("/") != -1) { int pos = errors.indexOf("/"); @@ -120,7 +120,7 @@ int main() { cout.flush(); // make this error work regardless of directory... - QString errors = e.toString(); + std::string errors = e.toString(); while(errors.indexOf("/") != -1) { int pos = errors.indexOf("/"); diff --git a/isis/src/database/objs/Database/Database.cpp b/isis/src/database/objs/Database/Database.cpp index 549b9ee8b8..60138d1892 100644 --- a/isis/src/database/objs/Database/Database.cpp +++ b/isis/src/database/objs/Database/Database.cpp @@ -54,7 +54,7 @@ namespace Isis { _name = _actualConnectionName; if((dbConn == Connect) && isValid()) { if(!open()) { - QString mess = "Failed to open database default database [" + _name; + std::string mess = "Failed to open database default database [" + _name; tossDbError(mess, _FILEINFO_); } } @@ -77,7 +77,7 @@ namespace Isis { _name = _actualConnectionName; if((dbConn == Connect) && isValid()) { if(!open()) { - QString mess = "Failed to open database specified as " + _name; + std::string mess = "Failed to open database specified as " + _name; tossDbError(mess, _FILEINFO_); } } @@ -127,7 +127,7 @@ namespace Isis { _name = _actualConnectionName; if((dbConn == Connect) && isValid()) { if(!open()) { - QString mess = "Failed to open database with profile " + _name; + std::string mess = "Failed to open database with profile " + _name; tossDbError(mess, _FILEINFO_); } } @@ -422,7 +422,7 @@ namespace Isis { // Go ahead and connect if requested if(dbConn == Connect) { if(!db.open()) { - QString mess = "Failed to connect to database using profile " + + std::string mess = "Failed to connect to database using profile " + profile("Name"); tossDbError(mess, _FILEINFO_); } @@ -430,11 +430,11 @@ namespace Isis { return (db); } catch(IException &ie) { - QString mess = "Unable to create database from " + profile.Name(); + std::string mess = "Unable to create database from " + profile.Name(); throw IException(ie, IException::User, mess, _FILEINFO_); } catch(...) { - QString mess = "Unknown exception while creating database from profile " + std::string mess = "Unknown exception while creating database from profile " + profile.Name(); throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/database/objs/DatabaseFactory/DatabaseFactory.cpp b/isis/src/database/objs/DatabaseFactory/DatabaseFactory.cpp index c281577bd4..33ae6bfed5 100644 --- a/isis/src/database/objs/DatabaseFactory/DatabaseFactory.cpp +++ b/isis/src/database/objs/DatabaseFactory/DatabaseFactory.cpp @@ -151,7 +151,7 @@ namespace Isis { */ bool DatabaseFactory::addAccessProfile(const QString &profileFile) { try { - FileName dbconf(profileFile); + FileName dbconf(profileFile.toStdString()); if(dbconf.fileExists()) { DbAccess acp(profileFile); @@ -361,7 +361,7 @@ namespace Isis { // Check driver availability if(!isDriverAvailable(driver)) { - QString mess = "Driver [" + driver + "] for database [" + dbname + std::string mess = "Driver [" + driver + "] for database [" + dbname + "] does not exist"; throw IException(IException::Unknown, mess, _FILEINFO_); } @@ -390,7 +390,7 @@ namespace Isis { } // One doesn't exist, throw an error - QString mess = "Database [" + dbname + "] does not exist"; + std::string mess = "Database [" + dbname + "] does not exist"; throw IException(IException::Unknown, mess, _FILEINFO_); } diff --git a/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp b/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp index 71f132f3bf..1f40926fd0 100644 --- a/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp +++ b/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp @@ -31,12 +31,12 @@ namespace Isis { QString missid; try { - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); instid = QString::fromStdString(lab.findKeyword("INSTRUMENT_ID")); missid = QString::fromStdString(lab.findKeyword("MISSION_ID")); } catch(IException &e) { - QString msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + + std::string msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + inFile.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -44,7 +44,7 @@ namespace Isis { instid = instid.simplified().trimmed(); missid = missid.simplified().trimmed(); if(missid != "DAWN" && instid != "FC1" && instid != "FC2") { - QString msg = "Input file [" + inFile.expanded() + "] does not appear to be " + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be " + "a DAWN Framing Camera (FC) EDR or RDR file."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -63,7 +63,7 @@ namespace Isis { p.SetOutputCube(tmpFile.expanded(), outatt); p.SaveFileHeader(); - Pvl labelPvl(inFile.expanded().toStdString()); + Pvl labelPvl(inFile.expanded()); p.StartProcess(); p.EndProcess(); @@ -154,7 +154,7 @@ namespace Isis { filtname = "Blue_F8"; } else { - QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + + std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + "FilterNumber. The FilterNumber must fall in the range 1 to 8."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -171,7 +171,7 @@ namespace Isis { kerns += PvlKeyword("NaifFrameCode", std::to_string(-203120-filtno)); } else { - QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + + std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + "InstrumentId."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/dawn/apps/dawnvir2isis/main.cpp b/isis/src/dawn/apps/dawnvir2isis/main.cpp index 94df0e895e..56ecf8f05f 100644 --- a/isis/src/dawn/apps/dawnvir2isis/main.cpp +++ b/isis/src/dawn/apps/dawnvir2isis/main.cpp @@ -57,12 +57,12 @@ void IsisMain () QString missid; try { - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); instid = QString::fromStdString(lab.findKeyword ("CHANNEL_ID")); missid = QString::fromStdString(lab.findKeyword ("INSTRUMENT_HOST_ID")); } catch (IException &e) { - QString msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + + std::string msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + inFile.expanded() + "]"; throw IException(e, IException::Io,msg, _FILEINFO_); } @@ -70,7 +70,7 @@ void IsisMain () instid = instid.simplified().trimmed(); missid = missid.simplified().trimmed(); if (missid != "DAWN" && instid != "VIS" && instid != "IR") { - QString msg = "Input file [" + inFile.expanded() + "] does not appear to be a " + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be a " + "DAWN Visual and InfraRed Mapping Spectrometer (VIR) EDR or RDR file."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -87,7 +87,7 @@ void IsisMain () Cube *outcube = p.SetOutputCube ("TO"); // p.SaveFileHeader(); - Pvl labelPvl (inFile.expanded().toStdString()); + Pvl labelPvl (inFile.expanded()); p.StartProcess (); @@ -130,7 +130,7 @@ void IsisMain () } else if (instid == "IR") { kerns += PvlKeyword("NaifFrameCode","-203213"); } else { - QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + + std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + "InstrumentId."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -149,7 +149,7 @@ void IsisMain () outcube->write(hktab); } catch (IException &e) { - QString mess = "Cannot read/open housekeeping data"; + std::string mess = "Cannot read/open housekeeping data"; throw IException(e, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp b/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp index 082e8b15d3..ca0ef71a04 100644 --- a/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp +++ b/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp @@ -54,7 +54,7 @@ namespace Isis { m_instrumentNameShort = "FC2"; } else { - QString msg = "File does not appear to be a Dawn Framing Camera image. "; + std::string msg = "File does not appear to be a Dawn Framing Camera image. "; msg += "(" + QString::number(ikCode) + " is not a Dawn FC instrument code)"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/dev/apps/camdev/camdev.cpp b/isis/src/dev/apps/camdev/camdev.cpp index e8eb610648..800f3b4a83 100644 --- a/isis/src/dev/apps/camdev/camdev.cpp +++ b/isis/src/dev/apps/camdev/camdev.cpp @@ -140,7 +140,7 @@ namespace Isis { proj = (TProjection *) icube->projection(); } catch(IException &e) { - QString msg = "Mosaic files must contain mapping labels"; + std::string msg = "Mosaic files must contain mapping labels"; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -149,7 +149,7 @@ namespace Isis { cam = icube->camera(); } catch(IException &e) { - QString msg = "If " + FileName(ui.GetCubeName("FROM")).name() + " is a mosaic, make sure the SOURCE " + std::string msg = "If " + FileName(ui.GetCubeName("FROM")).name() + " is a mosaic, make sure the SOURCE " "option is set to PROJECTION"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -269,7 +269,7 @@ namespace Isis { if((pixelResolution = ui.GetBoolean("PIXELRESOLUTION"))) nbands++; if(nbands < 1) { - QString message = "At least one parameter must be entered" + std::string message = "At least one parameter must be entered" "[PHASE, EMISSION, INCIDENCE, LATITUDE, LONGITUDE...]"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/dev/apps/camdev/main.cpp b/isis/src/dev/apps/camdev/main.cpp index 805f4dd3ff..1e0dae9d28 100644 --- a/isis/src/dev/apps/camdev/main.cpp +++ b/isis/src/dev/apps/camdev/main.cpp @@ -135,7 +135,7 @@ void IsisMain() { proj = (TProjection *) icube->projection(); } catch(IException &e) { - QString msg = "Mosaic files must contain mapping labels"; + std::string msg = "Mosaic files must contain mapping labels"; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -144,7 +144,7 @@ void IsisMain() { cam = icube->camera(); } catch(IException &e) { - QString msg = "If " + FileName(ui.GetCubeName("FROM")).name() + " is a mosaic, make sure the SOURCE " + std::string msg = "If " + FileName(ui.GetCubeName("FROM")).name() + " is a mosaic, make sure the SOURCE " "option is set to PROJECTION"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -264,7 +264,7 @@ void IsisMain() { if((pixelResolution = ui.GetBoolean("PIXELRESOLUTION"))) nbands++; if(nbands < 1) { - QString message = "At least one parameter must be entered" + std::string message = "At least one parameter must be entered" "[PHASE, EMISSION, INCIDENCE, LATITUDE, LONGITUDE...]"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/dev/apps/m3loc2net/main.cpp b/isis/src/dev/apps/m3loc2net/main.cpp index 7afba01c40..19fd90c1be 100644 --- a/isis/src/dev/apps/m3loc2net/main.cpp +++ b/isis/src/dev/apps/m3loc2net/main.cpp @@ -55,7 +55,7 @@ void IsisMain() { cnet.SetTarget(targetName); } else { - QString msg = "Input cube does not have target."; + std::string msg = "Input cube does not have target."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/galileo/apps/gllnims2isis/main.cpp b/isis/src/galileo/apps/gllnims2isis/main.cpp index 43165054d3..a0b02df41c 100644 --- a/isis/src/galileo/apps/gllnims2isis/main.cpp +++ b/isis/src/galileo/apps/gllnims2isis/main.cpp @@ -136,7 +136,7 @@ void importQubs(QString coreParamName, QString suffixParamName) { pvlStream >> *pdsLabel; } catch(IException &e) { - QString msg = "Input file [" + inFile.expanded() + + std::string msg = "Input file [" + inFile.expanded() + "] is not a valid PVL file."; // not appending the caught exception to this message. // we were picking up non-utf8 characters in the message @@ -161,12 +161,12 @@ void importQubs(QString coreParamName, QString suffixParamName) { try { if (!galileoRx.exactMatch(dataSetId) ) { - QString msg = "Invalid DATA_SET_ID [" + dataSetId + "]"; + std::string msg = "Invalid DATA_SET_ID [" + dataSetId + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } catch(IException &e) { - QString msg = "Unable to read [DATA_SET_ID] from input file [" + + std::string msg = "Unable to read [DATA_SET_ID] from input file [" + inFile.expanded() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -208,7 +208,7 @@ void importQubs(QString coreParamName, QString suffixParamName) { importPds.SetPdsFile(*pdsLabel,inFile.expanded(),fileType); } catch(IException &e) { - QString msg = "Input file [" + inFile.expanded() + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be a Galileo NIMS detached PDS label"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -410,7 +410,7 @@ PvlGroup originalMappingGroup = qube.findGroup("IMAGE_MAP_PROJECTION", Pvl::Trav mappingGroup["MaximumLongitude"].setUnits("degrees"); } catch(IException &e) { - QString msg = "Unable to correct mapping group."; + std::string msg = "Unable to correct mapping group."; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index 96efa43fc5..d3561efb39 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -47,11 +47,11 @@ void IsisMain() { fixPvl(inFile.toString()); // Make sure it is a Galileo SSI image - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); //Checks if in file is rdr if(lab.hasObject("IMAGE_MAP_PROJECTION")) { - QString msg = "[" + inFile.name() + "] appears to be an rdr file."; + std::string msg = "[" + inFile.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -63,7 +63,7 @@ void IsisMain() { if(!dataSetId.contains("SSI-2-REDR-V1.0") && !dataSetId.contains("SSI-2-REDR-V1.1") && !dataSetId.contains("SSI-4-REDR-V1.0") && !dataSetId.contains("SSI-4-REDR-V1.1") ) { - QString msg = "Invalid DATA_SET_ID [" + dataSetId + "]" + + std::string msg = "Invalid DATA_SET_ID [" + dataSetId + "]" + " from input file [" + inFile.expanded() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -117,7 +117,7 @@ void IsisMain() { p.StartProcess(translateData); translateLabels(pdsLabel, summedOutput); - OriginalLabel ol(Pvl(inFile.expanded().toStdString())); + OriginalLabel ol(Pvl(inFile.expanded())); summedOutput->write(ol); summedOutput->close(); delete summedOutput; diff --git a/isis/src/galileo/apps/gllssical/gllssical.cpp b/isis/src/galileo/apps/gllssical/gllssical.cpp index aea990ff7c..0bd7381a1c 100644 --- a/isis/src/galileo/apps/gllssical/gllssical.cpp +++ b/isis/src/galileo/apps/gllssical/gllssical.cpp @@ -355,7 +355,7 @@ namespace Isis { FileName weightFile(file); weightFile = weightFile.highestVersion(); - Pvl weightTables(weightFile.expanded().toStdString()); + Pvl weightTables(weightFile.expanded()); QString group = QString("FrameMode") + icube->group("Instrument")["FrameModeId"][0].at(0); PvlGroup &frameGrp = weightTables.findGroup(group.toStdString()); QString keyword = QString("GainState") + ((getGainModeID(icube) < 3) ? QString("12") : QString("34")); @@ -414,7 +414,7 @@ namespace Isis { * if output units are in radiance. */ void calculateScaleFactor0(Cube *icube, Cube *gaincube) { - Pvl conversionFactors(GetScaleFactorFile().expanded().toStdString()); + Pvl conversionFactors(GetScaleFactorFile().expanded()); PvlKeyword fltToRef, fltToRad; for(int grp = 0; grp < conversionFactors.groups(); grp++) { @@ -450,7 +450,7 @@ namespace Isis { throw IException(IException::Unknown, "Unable to find matching reflectance and radiance values for target [" + icube->group("Instrument")["TargetName"][0] + "] in [" + - GetScaleFactorFile().expanded().toStdString() + "]", + GetScaleFactorFile().expanded() + "]", _FILEINFO_); } @@ -497,7 +497,7 @@ namespace Isis { rsun = sunkm / 1.49597870691E8 / 5.2; } catch (IException &e) { - QString message = "IOF option does not work with non-spiceinited cubes."; + std::string message = "IOF option does not work with non-spiceinited cubes."; throw IException(e, IException::User, message, _FILEINFO_); } } diff --git a/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp b/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp index e6ce4ab085..f01e48ca8d 100644 --- a/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp +++ b/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp @@ -121,7 +121,7 @@ namespace Isis { // Check stream open status if ( !input.is_open() ) { - QString msg = "Cannot open input file [" + fitsfile + "]"; + std::string msg = "Cannot open input file [" + fitsfile + "]"; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/hayabusa/apps/amica2isis/main.cpp b/isis/src/hayabusa/apps/amica2isis/main.cpp index 37769e2534..9c60922ad0 100644 --- a/isis/src/hayabusa/apps/amica2isis/main.cpp +++ b/isis/src/hayabusa/apps/amica2isis/main.cpp @@ -48,7 +48,7 @@ void IsisMain () missid = QString::fromStdString(label.findKeyword ("INSTRUMENT_HOST_NAME", PvlObject::Traverse)); } catch (IException &e) { - QString msg = "Unable to read [INSTRUMENT_ID] or [INSTRUMENT_HOST_NAME] " + std::string msg = "Unable to read [INSTRUMENT_ID] or [INSTRUMENT_HOST_NAME] " "from input file [" + inFile.expanded() + "]"; throw IException(e, IException::Io,msg, _FILEINFO_); } @@ -56,7 +56,7 @@ void IsisMain () instid = instid.simplified().trimmed(); missid = missid.simplified().trimmed(); if (missid != "HAYABUSA" && instid != "AMICA") { - QString msg = "Input file [" + inFile.expanded() + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be a " + "Hayabusa/AMICA PDS label file."; throw IException(IException::Unknown, msg, _FILEINFO_); diff --git a/isis/src/hayabusa/apps/amicacal/AmicaCalUtils.h b/isis/src/hayabusa/apps/amicacal/AmicaCalUtils.h index 325f5675fb..0e804df03d 100644 --- a/isis/src/hayabusa/apps/amicacal/AmicaCalUtils.h +++ b/isis/src/hayabusa/apps/amicacal/AmicaCalUtils.h @@ -137,7 +137,7 @@ static bool sunDistanceAU(Cube *iCube, sunDist = sunkm / KM_PER_AU; } catch (IException &e) { - QString message = "Failed to calculate the sun-target distance."; + std::string message = "Failed to calculate the sun-target distance."; throw IException(e, IException::User, message, _FILEINFO_); } } diff --git a/isis/src/hayabusa/apps/amicacal/main.cpp b/isis/src/hayabusa/apps/amicacal/main.cpp index fceade5a80..96a34ce4cb 100644 --- a/isis/src/hayabusa/apps/amicacal/main.cpp +++ b/isis/src/hayabusa/apps/amicacal/main.cpp @@ -195,7 +195,7 @@ void IsisMain() { g_exposureTime = inst["ExposureDuration"] ; } catch(IException &e) { - QString msg = "Unable to read [ExposureDuration] keyword in the Instrument group " + std::string msg = "Unable to read [ExposureDuration] keyword in the Instrument group " "from input file [" + inputCube->fileName() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -205,7 +205,7 @@ void IsisMain() { g_temperature = inst["CcdTemperature"] ; } catch(IException &e) { - QString msg = "Unable to read [CcdTemperature] keyword in the Instrument group " + std::string msg = "Unable to read [CcdTemperature] keyword in the Instrument group " "from input file [" + inputCube->fileName() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); @@ -609,7 +609,7 @@ QString loadCalibrationVariables(const QString &config, Cube *iCube) { if ( config.contains("?") ) calibFile = calibFile.highestVersion(); // Pvl configFile; - g_configFile.read(calibFile.expanded().toStdString()); + g_configFile.read(calibFile.expanded()); // Load the groups PvlGroup &biasGroup = g_configFile.findGroup("Bias"); @@ -675,7 +675,7 @@ QString loadCalibrationVariables(const QString &config, Cube *iCube) { scs2e_c(g_hayabusaNaifCode, g_startTime.toLatin1().data(), &obsStartTime); } catch (IException &e) { - QString message = "IOF option does not work with non-spiceinited cubes."; + std::string message = "IOF option does not work with non-spiceinited cubes."; throw IException(e, IException::User, message, _FILEINFO_); } } diff --git a/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp b/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp index d2eac693de..b408e1dfa3 100644 --- a/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp +++ b/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp @@ -121,7 +121,7 @@ namespace Isis { // Check stream open status if ( !input.is_open() ) { - QString msg = "Cannot open input file [" + fitsfile + "]"; + std::string msg = "Cannot open input file [" + fitsfile + "]"; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/hayabusa/apps/nirs2isis/main.cpp b/isis/src/hayabusa/apps/nirs2isis/main.cpp index cc4cc92b4d..895c922af8 100644 --- a/isis/src/hayabusa/apps/nirs2isis/main.cpp +++ b/isis/src/hayabusa/apps/nirs2isis/main.cpp @@ -54,7 +54,7 @@ void IsisMain() { axis2Length = QString::fromStdString(label.findKeyword ("NAXIS2", PvlObject::Traverse)); } catch (IException &e) { - QString msg = "Unable to read [NAXIS], [NAXIS1] or [NAXIS2] " + std::string msg = "Unable to read [NAXIS], [NAXIS1] or [NAXIS2] " "from FITS label in input [" + fitsImage + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -64,7 +64,7 @@ void IsisMain() { if ( !( axisCount == "2" && axis1Length == "64" && axis2Length == "2" ) ) { - QString msg = "Input file [" + fitsImage + + std::string msg = "Input file [" + fitsImage + "] does not have the correct dimensions " + "for a Hayabusa NIRS FITS image.\n" + "Expected dimensions are [2] axes, [64 x 2]. " + @@ -87,7 +87,7 @@ void IsisMain() { if ( (tempCube->sampleCount() != 64) || (tempCube->lineCount() != 2 ) || (tempCube->bandCount() != 1 ) ) { - QString msg = "Invalid temp cube dimensions. Dimensions " + std::string msg = "Invalid temp cube dimensions. Dimensions " "must be 64 samples, by 2 lines, by 1 band.\n" "Temp cube dimensions are [" + toString( tempCube->sampleCount() ) + diff --git a/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp b/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp index b456cd863b..a5534bc284 100644 --- a/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp +++ b/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp @@ -47,7 +47,7 @@ namespace Isis { fitsLabel.addGroup(importFits.extraFitsLabel(0)); } catch (IException &e) { - QString msg = "Input file [" + FileName(ui.GetFileName("FROM")).expanded() + + std::string msg = "Input file [" + FileName(ui.GetFileName("FROM")).expanded() + "] does not appear to be a Hayabusa2/ONC label file."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -59,20 +59,20 @@ namespace Isis { missid = QString::fromStdString(fitsLabel.findGroup("FitsLabels").findKeyword ("SPCECRFT")[0]); } catch (IException &e) { - QString msg = "Unable to read instrument ID, [INSTRUME], or spacecraft ID, [SPCECRFT], " + std::string msg = "Unable to read instrument ID, [INSTRUME], or spacecraft ID, [SPCECRFT], " "from input file [" + FileName(ui.GetFileName("FROM")).expanded() + "]"; throw IException(e, IException::Io,msg, _FILEINFO_); } missid = missid.simplified().trimmed(); if ((QString::compare(missid, "HAYABUSA2", Qt::CaseInsensitive) != 0) && (QString::compare(missid, "HAYABUSA-2", Qt::CaseInsensitive) != 0)) { - QString msg = "Input file [" + FileName(ui.GetFileName("FROM")).expanded() + + std::string msg = "Input file [" + FileName(ui.GetFileName("FROM")).expanded() + "] does not appear to be a Hayabusa2 label file."; throw IException(IException::Unknown, msg, _FILEINFO_); } instid = instid.simplified().trimmed(); if (QString::compare(instid, "Optical Navigation Camera", Qt::CaseInsensitive) != 0) { - QString msg = "Input file [" + FileName(ui.GetFileName("FROM")).expanded() + + std::string msg = "Input file [" + FileName(ui.GetFileName("FROM")).expanded() + "] does not appear to be a Hayabusa2/ONC label file."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/hayabusa2/apps/hyb2onccal/main.cpp b/isis/src/hayabusa2/apps/hyb2onccal/main.cpp index 154358e957..e148efab0b 100644 --- a/isis/src/hayabusa2/apps/hyb2onccal/main.cpp +++ b/isis/src/hayabusa2/apps/hyb2onccal/main.cpp @@ -151,7 +151,7 @@ void IsisMain() { g_texp = inst["ExposureDuration"] ; } catch(IException &e) { - QString msg = "Unable to read [ExposureDuration] keyword in the Instrument group " + std::string msg = "Unable to read [ExposureDuration] keyword in the Instrument group " "from input file [" + icube->fileName() + "]"; throw IException(e, IException::Io,msg, _FILEINFO_); } @@ -163,7 +163,7 @@ void IsisMain() { g_temp = inst[oncCCDTemperature.toStdString()]; } catch(IException &e) { - QString msg = "Unable to read [" + oncCCDTemperature + "] keyword in the Instrument group " + std::string msg = "Unable to read [" + oncCCDTemperature + "] keyword in the Instrument group " "from input file [" + icube->fileName() + "]"; throw IException(e, IException::Io,msg, _FILEINFO_); @@ -360,7 +360,7 @@ QString loadCalibrationVariables(const QString &config) { if ( config.contains("?") ) calibFile = calibFile.highestVersion(); // Pvl configFile; - g_configFile.read(calibFile.expanded().toStdString()); + g_configFile.read(calibFile.expanded()); // Load the groups PvlGroup &Bias = g_configFile.findGroup("Bias"); diff --git a/isis/src/hayabusa2/objs/Hyb2OncCamera/Hyb2OncCamera.cpp b/isis/src/hayabusa2/objs/Hyb2OncCamera/Hyb2OncCamera.cpp index e9af02857e..0168a95f97 100644 --- a/isis/src/hayabusa2/objs/Hyb2OncCamera/Hyb2OncCamera.cpp +++ b/isis/src/hayabusa2/objs/Hyb2OncCamera/Hyb2OncCamera.cpp @@ -52,7 +52,7 @@ namespace Isis { m_instrumentNameShort = "ONC-W2"; } else { - QString msg = "File does not appear to be a Hayabusa2 image"; + std::string msg = "File does not appear to be a Hayabusa2 image"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/juno/apps/junocam2isis/main.cpp b/isis/src/juno/apps/junocam2isis/main.cpp index e674e0d352..06cdf9fa89 100644 --- a/isis/src/juno/apps/junocam2isis/main.cpp +++ b/isis/src/juno/apps/junocam2isis/main.cpp @@ -67,7 +67,7 @@ void IsisMain() { ccdLayout.addKernel("$juno/kernels/ik/juno_junocam_v??.ti"); } catch (IException &e) { - QString msg = "Failed to load the JunoCam Instrument Kernel required for " + std::string msg = "Failed to load the JunoCam Instrument Kernel required for " "full ccd output."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -75,7 +75,7 @@ void IsisMain() { ccdLayout.addKernel("$juno/kernels/iak/junoAddendum???.ti"); } catch (IException &e) { - QString msg = "Failed to load the JunoCam Instrument Addendum Kernel " + std::string msg = "Failed to load the JunoCam Instrument Addendum Kernel " "required for full ccd output."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -115,7 +115,7 @@ void IsisMain() { // Now this will be a list of output Fullframes 1-N.cub QFile allCubesListFile(outputBaseName + ".lis"); if (!allCubesListFile.open(QFile::WriteOnly | QFile::Text)) { - QString msg = "Unable to write file [" + allCubesListFile.fileName() + "]"; + std::string msg = "Unable to write file [" + allCubesListFile.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } QTextStream allCubesListWriter(&allCubesListFile); @@ -190,7 +190,7 @@ void IsisMain() { QFile allCubesListFile(outputBaseName + ".lis"); if (!allCubesListFile.open(QFile::WriteOnly | QFile::Text)) { - QString msg = "Unable to write file [" + allCubesListFile.fileName() + "]"; + std::string msg = "Unable to write file [" + allCubesListFile.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } QTextStream allCubesListWriter(&allCubesListFile); @@ -220,7 +220,7 @@ void IsisMain() { QFile filterListFile(outputBaseName + "_" + g_filterList[filterIndex] + ".lis"); if ( (frameletNumber == 1 && !filterListFile.open(QFile::WriteOnly | QFile::Text)) || (frameletNumber > 1 && !filterListFile.open(QFile::Append | QFile::Text)) ) { - QString msg = "Unable to write to file [" + filterListFile.fileName() + "]"; + std::string msg = "Unable to write to file [" + filterListFile.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } QTextStream filterListWriter(&filterListFile); @@ -315,7 +315,7 @@ void translateLabel(Pvl &inputLabel, Pvl &outputLabel) { if (spcName.compare("JUNO", Qt::CaseInsensitive) != 0 || instId.compare("JNC", Qt::CaseInsensitive) != 0) { - QString msg = "Unrecognized Spacecraft name [" + std::string msg = "Unrecognized Spacecraft name [" + spcName + "] and instrument ID [" + instId @@ -334,7 +334,7 @@ void translateLabel(Pvl &inputLabel, Pvl &outputLabel) { QString summingKey = QString::fromStdString(outputLabel.findKeyword("SummingMode", PvlObject::Traverse)[0]); if (summingKey.compare("1") != 0 && summingKey.compare("2") != 0) { - QString msg = "Invalid summing mode [" + summingKey + "], expected [1] or [2]."; + std::string msg = "Invalid summing mode [" + summingKey + "], expected [1] or [2]."; throw IException(IException::Unknown, msg, _FILEINFO_); } int summingMode = summingKey.toInt(); diff --git a/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp b/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp index fc174f937c..1653ecb334 100644 --- a/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp +++ b/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp @@ -31,10 +31,10 @@ namespace Isis { FileName inFile = ui.GetFileName("FROM"); QString id; - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); if (lab.hasObject("IMAGE_MAP_PROJECTION")) { - QString msg = "Unsupported projected file [" + inFile.expanded() + "]"; + std::string msg = "Unsupported projected file [" + inFile.expanded() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -42,7 +42,7 @@ namespace Isis { id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); } catch(IException &e) { - QString msg = "Unable to read [DATA_SET_ID] from input file [" + + std::string msg = "Unable to read [DATA_SET_ID] from input file [" + inFile.expanded() + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -74,7 +74,7 @@ namespace Isis { // Get the directory where the Kaguya MI translation tables are. QString transDir = "$ISISROOT/appdata/translations/"; - Pvl inputLabel(inFile.expanded().toStdString()); + Pvl inputLabel(inFile.expanded()); Pvl *outputLabel = outcube->label(); FileName transFile; @@ -132,12 +132,12 @@ namespace Isis { //At the time of this writing there was no expectation that Kaguya ever did any binning // so this is check to make sure an error is thrown if an image was binned if (lab.findKeyword("INSTRUMENT_ID")[0] == "MI-VIS" && outcube->sampleCount() != 962 ) { - QString msg = "Input file [" + inFile.expanded() + "]" + " appears to be binned. Binning was " + std::string msg = "Input file [" + inFile.expanded() + "]" + " appears to be binned. Binning was " "unexpected, and is unsupported by the camera model"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (lab.findKeyword("INSTRUMENT_ID")[0] == "MI-NIR" && outcube->sampleCount() != 320 ) { - QString msg = "Input file [" + inFile.expanded() + "]" + " appears to be binned. Binning was " + std::string msg = "Input file [" + inFile.expanded() + "]" + " appears to be binned. Binning was " "unexpected, and is unsupported by the camera model"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp b/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp index 18c6700646..93bf95d725 100644 --- a/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp +++ b/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp @@ -105,7 +105,7 @@ void IsisMain() { FILE *spcptr; if ((spcptr = fopen(dataFile.toLatin1().data(),"rb")) == 0) { - QString msg = "Error opening input Kaguya SP file [" + dataFile + "]"; + std::string msg = "Error opening input Kaguya SP file [" + dataFile + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -122,7 +122,7 @@ void IsisMain() { if (!lab.hasObject("SP_SPECTRUM_WAV") || !lab.hasObject("SP_SPECTRUM_QA") || !lab.hasObject("SP_SPECTRUM_RAD") || !(lab.hasObject("SP_SPECTRUM_REF") || (lab.hasObject("SP_SPECTRUM_REF1") && lab.hasObject("SP_SPECTRUM_REF2")))) { - QString msg = "Input file [" + inFile + "] is not a valid "; + std::string msg = "Input file [" + inFile + "] is not a valid "; msg += "Kaguya Spectral Profiler file"; throw IException(IException::User, msg, _FILEINFO_); } @@ -134,7 +134,7 @@ void IsisMain() { int wavbits = std::stoi(wavobj.findKeyword("SAMPLE_BITS")[0]); if (wavlines != 1 || wavsamps != 296 || wavtype != "MSB_UNSIGNED_INTEGER" || wavbits != 16) { - QString msg = "Wavelength data in input file does not meet the following "; + std::string msg = "Wavelength data in input file does not meet the following "; msg += "requirements: Size=1 row x 296 columns, DataType=MSB_UNSIGNED_INTEGER, "; msg += "BitType: 16"; throw IException(IException::User, msg, _FILEINFO_); @@ -157,7 +157,7 @@ void IsisMain() { for (int j=0; j matchedDarkTimes; matchedDarkTimes.reserve(dir.count()); if (dir.count() < 1){ - QString msg = "Could not find any dark file of type " + filter + ".\n"; + std::string msg = "Could not find any dark file of type " + filter + ".\n"; throw IException(IException::User, msg, _FILEINFO_); } // Loop through all files in the dir that match our basename and extract time @@ -825,7 +825,7 @@ namespace Isis { //check time range between darks is within 45 day window if (timeDayDiff < 0 || timeDayDiff > 45) { - QString msg = "Could not find a pair of dark files within 45 day range that includes the image [" + basename + "]. Check to make sure your set of dark files is complete.\n"; + std::string msg = "Could not find a pair of dark files within 45 day range that includes the image [" + basename + "]. Check to make sure your set of dark files is complete.\n"; throw IException(IException::User, msg, _FILEINFO_); } else { @@ -864,7 +864,7 @@ namespace Isis { if(filename.isVersioned()) filename = filename.highestVersion(); if(!filename.fileExists()) { - QString msg = fileString + " does not exist."; + std::string msg = fileString + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } cube.open(filename.expanded()); @@ -878,7 +878,7 @@ namespace Isis { fileString = filename.original(); if(data.empty()){ - QString msg = "Copy from + " + fileString + " into vector failed."; + std::string msg = "Copy from + " + fileString + " into vector failed."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/lro/apps/lronacecho/main.cpp b/isis/src/lro/apps/lronacecho/main.cpp index 9ef40faade..f15006a240 100644 --- a/isis/src/lro/apps/lronacecho/main.cpp +++ b/isis/src/lro/apps/lronacecho/main.cpp @@ -62,7 +62,7 @@ void IsisMain() { // Make sure that we aren't passed in a scaled or cropped cub if(lab.findObject("IsisCube").hasGroup("AlphaCube")) { - QString msg = "This application can not be run on any image that has been geometrically transformed (i.e. scaled, rotated, sheared, or reflected) or cropped."; + std::string msg = "This application can not be run on any image that has been geometrically transformed (i.e. scaled, rotated, sheared, or reflected) or cropped."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/lro/apps/lronacpho/lronacpho.cpp b/isis/src/lro/apps/lronacpho/lronacpho.cpp index 9c9bed1048..db1e0cb2b0 100644 --- a/isis/src/lro/apps/lronacpho/lronacpho.cpp +++ b/isis/src/lro/apps/lronacpho/lronacpho.cpp @@ -99,11 +99,11 @@ namespace Isis{ algoFileName = algoFileName.highestVersion(); if(!algoFileName.fileExists()) { - QString msg = algoFile + " does not exist."; + std::string msg = algoFile + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } - Pvl params(algoFileName.expanded().toStdString()); + Pvl params(algoFileName.expanded()); algoName = PhotometricFunction::algorithmName(params); algoName = algoName.toUpper(); @@ -113,7 +113,7 @@ namespace Isis{ g_phoFunction = new LROCEmpirical(params, *iCube, !useBackplane); } else { - QString msg = " Algorithm Name [" + algoName + "] not recognized. "; + std::string msg = " Algorithm Name [" + algoName + "] not recognized. "; msg += "Compatible Algorithms are:\n LROC_Empirical\n"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp b/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp index 2236984c48..7549967c27 100644 --- a/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp +++ b/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp @@ -429,7 +429,7 @@ namespace Isis { if(!extractMiddleSamples) { for(int i = 0; i < in.size(); i++) { if(i >= mgr.size()) { - QString msg = "The input file has an unexpected number of samples"; + std::string msg = "The input file has an unexpected number of samples"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -442,7 +442,7 @@ namespace Isis { int endSamp = (in.size() / 2) + mgr.size() / 2; if(mgr.size() > in.size()) { - QString msg = "Output number of samples calculated is invalid"; + std::string msg = "Output number of samples calculated is invalid"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -681,50 +681,50 @@ namespace Isis { PvlKeyword &lut = pdsLab["LRO:LOOKUP_CONVERSION_TABLE"]; if(lut.size() != 256) { - QString msg = "Keyword [LRO:LOOKUP_CONVERSION_TABLE] has the wrong number of values"; + std::string msg = "Keyword [LRO:LOOKUP_CONVERSION_TABLE] has the wrong number of values"; throw IException(IException::Unknown, msg, _FILEINFO_); } PvlKeyword &missionName = pdsLab["MISSION_NAME"]; if(missionName.size() != 1 || missionName[0] != "LUNAR RECONNAISSANCE ORBITER") { - QString msg = "Keyword [MISSION_NAME] does not have a value of [LUNAR RECONNAISSANCER ORBITER]"; + std::string msg = "Keyword [MISSION_NAME] does not have a value of [LUNAR RECONNAISSANCER ORBITER]"; throw IException(IException::Unknown, msg, _FILEINFO_); } PvlKeyword &instrumentId = pdsLab["INSTRUMENT_ID"]; if(instrumentId.size() != 1 || instrumentId[0] != "LROC") { - QString msg = "Keyword [INSTRUMENT_ID] does not have a value of [LROC]"; + std::string msg = "Keyword [INSTRUMENT_ID] does not have a value of [LROC]"; throw IException(IException::Unknown, msg, _FILEINFO_); } // Make sure CENTER_FILTER_WAVELENGTH/FILTER_NUMBER makes sense if(pdsLab["FILTER_NUMBER"].size() != pdsLab["CENTER_FILTER_WAVELENGTH"].size()) { - QString msg = "Keywords [FILTER_NUMBER,CENTER_FILTER_WAVELENGTH] must have the same number of values"; + std::string msg = "Keywords [FILTER_NUMBER,CENTER_FILTER_WAVELENGTH] must have the same number of values"; throw IException(IException::Unknown, msg, _FILEINFO_); } if(pdsLab["INSTRUMENT_MODE_ID"][0] == "BW" && pdsLab["FILTER_NUMBER"].size() != 1) { - QString msg = "Keyword [FILTER_NUMBER] must have size 1 if [INSTRUMENT_MODE_ID] is [BW]"; + std::string msg = "Keyword [FILTER_NUMBER] must have size 1 if [INSTRUMENT_MODE_ID] is [BW]"; throw IException(IException::Unknown, msg, _FILEINFO_); } else if(pdsLab["INSTRUMENT_MODE_ID"][0] == "COLOR" && (pdsLab["FILTER_NUMBER"].size() < 5 || pdsLab["FILTER_NUMBER"].size() > 7 || pdsLab["FILTER_NUMBER"].size() == 6)) { - QString msg = "Keyword [FILTER_NUMBER] must have size 5 or 7 if [INSTRUMENT_MODE_ID] is [COLOR]"; + std::string msg = "Keyword [FILTER_NUMBER] must have size 5 or 7 if [INSTRUMENT_MODE_ID] is [COLOR]"; throw IException(IException::Unknown, msg, _FILEINFO_); } else if(pdsLab["INSTRUMENT_MODE_ID"][0] == "UV" && pdsLab["FILTER_NUMBER"].size() != 2) { - QString msg = "Keyword [FILTER_NUMBER] must have size 2 if [INSTRUMENT_MODE_ID] is [UV]"; + std::string msg = "Keyword [FILTER_NUMBER] must have size 2 if [INSTRUMENT_MODE_ID] is [UV]"; throw IException(IException::Unknown, msg, _FILEINFO_); } else if(pdsLab["INSTRUMENT_MODE_ID"][0] == "VIS" && pdsLab["FILTER_NUMBER"].size() != 5) { - QString msg = "Keyword [FILTER_NUMBER] must have size 5 if [INSTRUMENT_MODE_ID] is [VIS]"; + std::string msg = "Keyword [FILTER_NUMBER] must have size 5 if [INSTRUMENT_MODE_ID] is [VIS]"; throw IException(IException::Unknown, msg, _FILEINFO_); } else if(pdsLab["INSTRUMENT_MODE_ID"][0] != "BW" && pdsLab["INSTRUMENT_MODE_ID"][0] != "COLOR" && pdsLab["INSTRUMENT_MODE_ID"][0] != "UV" && pdsLab["INSTRUMENT_MODE_ID"][0] != "VIS") { - QString msg = "The value of keyword [INSTRUMENT_MODE_ID] is not recognized"; + std::string msg = "The value of keyword [INSTRUMENT_MODE_ID] is not recognized"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -750,12 +750,12 @@ namespace Isis { } if(found && !match) { - QString msg = "The [FILTER_NUMBER] and [CENTER_FILTER_WAVELENGTH] keywords do not correspond properly"; + std::string msg = "The [FILTER_NUMBER] and [CENTER_FILTER_WAVELENGTH] keywords do not correspond properly"; throw IException(IException::Unknown, msg, _FILEINFO_); } if(!found) { - QString msg = "The value of the keyword [FILTER_NUMBER] is invalid"; + std::string msg = "The value of the keyword [FILTER_NUMBER] is invalid"; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -767,7 +767,7 @@ namespace Isis { for(unsigned int i = 0; i < sizeof(QString) / sizeof(invalidKeywords); i++) { if(pdsLab.hasKeyword(invalidKeywords[i].toStdString())) { - QString msg = "Keyword ["; + std::string msg = "Keyword ["; msg += invalidKeywords[i]; msg += "] must not exist"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -779,7 +779,7 @@ namespace Isis { QRegExp integerRegex("[0-9]+"); if(orbitNumber.size() != 1 || !integerRegex.exactMatch(QString::fromStdString(orbitNumber[0]))) { - QString msg = "The value of keyword [ORBIT_NUMBER] is not valid"; + std::string msg = "The value of keyword [ORBIT_NUMBER] is not valid"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -798,7 +798,7 @@ namespace Isis { for(unsigned int i = 0; i < sizeof(numericKeywords) / sizeof(QString); i++) { if(pdsLab[numericKeywords[i].toStdString()].size() != 1 || !numberRegex.exactMatch(QString::fromStdString(pdsLab[numericKeywords[i].toStdString()][0]))) { - QString msg = "The value of keyword ["; + std::string msg = "The value of keyword ["; msg += numericKeywords[i]; msg += "] is not valid"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -814,7 +814,7 @@ namespace Isis { for(unsigned int i = 0; i < sizeof(timeKeywords) / sizeof(QString); i++) { if(pdsLab[timeKeywords[i].toStdString()].size() != 1 || !timeRegex.exactMatch(QString::fromStdString(pdsLab[timeKeywords[i].toStdString()][0]))) { - QString msg = "The value of keyword ["; + std::string msg = "The value of keyword ["; msg += timeKeywords[i]; msg += "] is not valid"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -830,7 +830,7 @@ namespace Isis { for(unsigned int i = 0; i < sizeof(clockKeywords) / sizeof(QString); i++) { if(pdsLab[clockKeywords[i].toStdString()].size() != 1 || !clockRegex.exactMatch(QString::fromStdString(pdsLab[clockKeywords[i].toStdString()][0]))) { - QString msg = "The value of keyword ["; + std::string msg = "The value of keyword ["; msg += clockKeywords[i]; msg += "] is not valid"; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -838,7 +838,7 @@ namespace Isis { } } catch(IException &e) { - QString msg = "The input product is out of date and has invalid labels. Please get an up to date version from the ASU LROC Team"; + std::string msg = "The input product is out of date and has invalid labels. Please get an up to date version from the ASU LROC Team"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp b/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp index 56ab24a26f..3715fa220b 100644 --- a/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp +++ b/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp @@ -78,7 +78,7 @@ namespace Isis { list.read(ui.GetFileName("FROMLIST")); if (list.size() < 1) { - QString msg = "The list file [" + ui.GetFileName("FROMLIST") + "does not contain any data"; + std::string msg = "The list file [" + ui.GetFileName("FROMLIST") + "does not contain any data"; throw IException(IException::User, msg, _FILEINFO_); } @@ -97,7 +97,7 @@ namespace Isis { productId = prodId; if (productId != prodId) { - QString msg = "This program is intended for use on a single LROC WAC images only."; + std::string msg = "This program is intended for use on a single LROC WAC images only."; msg += "The ProductIds do not match."; throw IException(IException::User, msg, _FILEINFO_); } @@ -108,7 +108,7 @@ namespace Isis { QString numFrames = QString::fromStdString(inst["NumFramelets"]); if (instId != "WAC-VIS" && instId != "WAC-UV") { - QString msg = "This program is intended for use on LROC WAC images only. ["; + std::string msg = "This program is intended for use on LROC WAC images only. ["; msg += list[i].toString() + "] does not appear to be a WAC image."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp index 8b42663446..18f9f7fb29 100644 --- a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp +++ b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp @@ -151,7 +151,7 @@ namespace Isis { if (filename.isVersioned()) filename = filename.highestVersion(); if (!filename.fileExists()) { - QString msg = fileString + " does not exist."; + std::string msg = fileString + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } cube.open(filename.expanded()); @@ -232,7 +232,7 @@ namespace Isis { // we require at least 2 different dark files to interpolate/extrapolate if (darkFiles.size() < 2) { - QString msg = "Not enough Dark files exist for these image options [" + basename + "]. Need at least 2 files with different temperatures\n"; + std::string msg = "Not enough Dark files exist for these image options [" + basename + "]. Need at least 2 files with different temperatures\n"; throw IException(IException::User, msg, _FILEINFO_); } @@ -319,7 +319,7 @@ namespace Isis { } if (bestTemp == DBL_MAX) { - QString msg = "No files exist for these mask options [" + basename + "]"; + std::string msg = "No files exist for these mask options [" + basename + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -541,19 +541,19 @@ namespace Isis { QString instId = QString::fromStdString(inst["InstrumentId"]); instId = instId.toUpper(); if (instId != "WAC-VIS" && instId != "WAC-UV") { - QString msg = "This program is intended for use on LROC WAC images only. ["; + std::string msg = "This program is intended for use on LROC WAC images only. ["; msg += icube->fileName() + "] does not appear to be a WAC image."; throw IException(IException::User, msg, _FILEINFO_); } // And check if it has already run through calibration if (icube->label()->findObject("IsisCube").hasGroup("Radiometry")) { - QString msg = "This image has already been calibrated"; + std::string msg = "This image has already been calibrated"; throw IException(IException::User, msg, _FILEINFO_); } if (icube->label()->findObject("IsisCube").hasGroup("AlphaCube")) { - QString msg = "This application can not be run on any image that has been geometrically transformed (i.e. scaled, rotated, sheared, or reflected) or cropped."; + std::string msg = "This application can not be run on any image that has been geometrically transformed (i.e. scaled, rotated, sheared, or reflected) or cropped."; throw IException(IException::User, msg, _FILEINFO_); } @@ -643,11 +643,11 @@ namespace Isis { if (radFileName.isVersioned()) radFileName = radFileName.highestVersion(); if (!radFileName.fileExists()) { - QString msg = radFile + " does not exist."; + std::string msg = radFile + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } - Pvl radPvl(radFileName.expanded().toStdString()); + Pvl radPvl(radFileName.expanded()); if (g_iof) { responsivity = radPvl["IOF"]; @@ -696,7 +696,7 @@ namespace Isis { unload_c(pckKernel3.toLatin1().data()); } catch (IException &e) { - QString msg = "Can not find necessary SPICE kernels for converting to IOF"; + std::string msg = "Can not find necessary SPICE kernels for converting to IOF"; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -730,13 +730,13 @@ namespace Isis { if (tempFileName.isVersioned()) tempFileName = tempFileName.highestVersion(); if (!tempFileName.fileExists()) { - QString msg = tempFile + " does not exist."; + std::string msg = tempFile + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } Isis::PvlKeyword &bands = icube->label()->findGroup("BandBin", Pvl::Traverse).findKeyword("FilterNumber"); - Pvl tempPvl(tempFileName.expanded().toStdString()); - temperaturePvl.addValue(tempFileName.expanded().toStdString()); + Pvl tempPvl(tempFileName.expanded()); + temperaturePvl.addValue(tempFileName.expanded()); for (int b = 0; b < bands.size(); b++){ g_TempratureConstants[g_bands[b]][0]=std::stod(tempPvl[bands[b]][0]); g_TempratureConstants[g_bands[b]][1]=std::stod(tempPvl[bands[b]][1]); diff --git a/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp b/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp index 05f701229d..526de145b0 100644 --- a/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp +++ b/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp @@ -115,7 +115,7 @@ namespace Isis { } if (m_hfunc != "HG") { - QString msg = "Invalid HFunction: " + m_hfunc; + std::string msg = "Invalid HFunction: " + m_hfunc; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/lro/apps/lrowacphomap/HapkeLRO.h b/isis/src/lro/apps/lrowacphomap/HapkeLRO.h index 29473c4323..1cf974c852 100644 --- a/isis/src/lro/apps/lrowacphomap/HapkeLRO.h +++ b/isis/src/lro/apps/lrowacphomap/HapkeLRO.h @@ -103,7 +103,7 @@ namespace Isis { } } - QString msg = "No parameter band named '" + name + "'."; + std::string msg = "No parameter band named '" + name + "'."; throw IException(Isis::IException::User, msg, _FILEINFO_); } diff --git a/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp b/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp index 7511d2af00..3f88961d52 100644 --- a/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp +++ b/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp @@ -113,7 +113,7 @@ namespace Isis { } if (m_hfunc != "HG") { - QString msg = "Invalid HFunction: " + m_hfunc; + std::string msg = "Invalid HFunction: " + m_hfunc; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/lro/apps/lrowacphomap/HapkeLROC.h b/isis/src/lro/apps/lrowacphomap/HapkeLROC.h index 06910f88f7..0bdfa0c2c7 100644 --- a/isis/src/lro/apps/lrowacphomap/HapkeLROC.h +++ b/isis/src/lro/apps/lrowacphomap/HapkeLROC.h @@ -109,7 +109,7 @@ namespace Isis { } } - QString msg = "No parameter band named '" + name + "'."; + std::string msg = "No parameter band named '" + name + "'."; throw IException(Isis::IException::User, msg, _FILEINFO_); } diff --git a/isis/src/lro/apps/lrowacphomap/lrowacphomap.cpp b/isis/src/lro/apps/lrowacphomap/lrowacphomap.cpp index 45c7159d33..bfeb232c6a 100644 --- a/isis/src/lro/apps/lrowacphomap/lrowacphomap.cpp +++ b/isis/src/lro/apps/lrowacphomap/lrowacphomap.cpp @@ -88,7 +88,7 @@ namespace Isis { if (ui.WasEntered("BACKPLANE")) { if (icube->bandCount() != 1) { - QString msg = "Invalid Image: The backplane option can only be used with a single image " + std::string msg = "Invalid Image: The backplane option can only be used with a single image " "band at a time."; throw IException(IException::User, msg, _FILEINFO_); } @@ -106,7 +106,7 @@ namespace Isis { bands.push_back("5"); } else if (bands.size() != 5) { - QString msg = "Invalid Backplane: The backplane must be exactly 5 bands"; + std::string msg = "Invalid Backplane: The backplane must be exactly 5 bands"; throw IException(IException::User, msg, _FILEINFO_); } @@ -132,10 +132,10 @@ namespace Isis { algoFileName = algoFileName.highestVersion(); } if (!algoFileName.fileExists()) { - QString msg = algoFileName.expanded() + " does not exist."; + std::string msg = algoFileName.expanded() + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } - Pvl par(algoFileName.expanded().toStdString()); + Pvl par(algoFileName.expanded()); QString parCubeFile = ui.GetCubeName("PHOPARCUBE"); FileName parCubeFileName(parCubeFile); @@ -143,7 +143,7 @@ namespace Isis { parCubeFileName = parCubeFileName.highestVersion(); } if (!parCubeFileName.fileExists()) { - QString msg = parCubeFileName.expanded() + " does not exist."; + std::string msg = parCubeFileName.expanded() + " does not exist."; throw IException(IException::User, msg, _FILEINFO_); } CubeAttributeInput parCubeAtt(parCubeFileName); @@ -188,7 +188,7 @@ namespace Isis { phoLroc->setNormalized(normalized); } else { - QString msg = " Algorithm Name [" + algoName + "] not recognized. "; + std::string msg = " Algorithm Name [" + algoName + "] not recognized. "; msg += "Compatible Algorithms are:\n HapkeLRO\n HapkeLROC"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/lro/apps/mrf2isis/main.cpp b/isis/src/lro/apps/mrf2isis/main.cpp index fcc01eef72..4cea95514e 100644 --- a/isis/src/lro/apps/mrf2isis/main.cpp +++ b/isis/src/lro/apps/mrf2isis/main.cpp @@ -27,13 +27,13 @@ void IsisMain() { QString labelFile = ui.GetFileName("FROM"); FileName inFile = ui.GetFileName("FROM"); QString id; - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); try { id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); } catch(IException &e) { - QString msg = "Unable to read [DATA_SET_ID] from input file [" + + std::string msg = "Unable to read [DATA_SET_ID] from input file [" + inFile.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -44,7 +44,7 @@ void IsisMain() { id != "CH1-ORB-L-MRFFR-5-CDR-MOSAIC-V1.0" && id != "LRO-L-MRFLRO-3-CDR-V1.0" && id != "LRO-L-MRFLRO-5-CDR-MAP-V1.0" && id != "LRO-L-MRFLRO-4-CDR-V1.0" && id != "LRO-L-MRFLRO-5-CDR-MOSAIC-V1.0") { - QString msg = "Input file [" + inFile.expanded() + "] does not appear to be " + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be " + "in CHANDRAYAAN-1 MINI-RF FORERUNNER level 1 or level 2 format " + "or in LUNAR RECONNAISSANCE ORBITER MINI-RF LRO level 1 or " + "level 2 format. " + @@ -68,7 +68,7 @@ void IsisMain() { p.SetOrganization(Isis::ProcessImport::BIL); } else { - QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + + std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + "band storage type. BAND_STORAGE_TYPE is [" + bandorder + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -129,7 +129,7 @@ void IsisMain() { double pheight = instGrp["ScaledPixelHeight"]; double pwidth = instGrp["ScaledPixelWidth"]; if(pheight != pwidth) { - QString msg = "Input file [" + inFile.expanded() + "] does not have valid " + + std::string msg = "Input file [" + inFile.expanded() + "] does not have valid " + "ScaledPixelHeight and ScaledPixelWidth values. These values " + "must be equivalent or the image is considered to be invalid."; throw IException(IException::Io, msg, _FILEINFO_); diff --git a/isis/src/lro/apps/mrf2pds/main.cpp b/isis/src/lro/apps/mrf2pds/main.cpp index 187f1908f3..69c68c7e06 100644 --- a/isis/src/lro/apps/mrf2pds/main.cpp +++ b/isis/src/lro/apps/mrf2pds/main.cpp @@ -184,7 +184,7 @@ void GetUserLabel(QString psUserLbl, Pvl &pcPdsLbl, bool pbLevel2) { cUsrPvl.hasKeyword("START_TIME") || cUsrPvl.hasKeyword("STOP_TIME"))) { - QString msg = "Unsupported User defined keywords for Level2"; + std::string msg = "Unsupported User defined keywords for Level2"; throw Isis::iException::Message(Isis::iException::User,msg,_FILEINFO_); }*/ diff --git a/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp b/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp index 0e37a53de0..b01aa91062 100644 --- a/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp +++ b/isis/src/lro/objs/LroNarrowAngleCamera/LroNarrowAngleCamera.cpp @@ -44,7 +44,7 @@ namespace Isis { m_instrumentNameShort = "NACR"; } else { - QString msg = "File does not appear to be a Lunar Reconnaissance Orbiter Image: "; + std::string msg = "File does not appear to be a Lunar Reconnaissance Orbiter Image: "; msg += QString::number(naifIkCode()); msg += " is not a supported instrument kernel code for Lunar Reconnaissance Orbiter."; throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp index ee0b19c4ac..112a6e2541 100644 --- a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp +++ b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp @@ -86,7 +86,7 @@ namespace Isis { m_instrumentNameShort = "WAC-VIS"; } else { - QString msg = "Invalid value [" + instId + std::string msg = "Invalid value [" + instId + "] for keyword [InstrumentId]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -301,7 +301,7 @@ namespace Isis { if (nvals <= 0) { PvlObject NaifKeywords = getStoredNaifKeywords(); if (!NaifKeywords.hasKeyword(key.toStdString())){ - QString mess = "Kernel pool keyword " + key + " not found!"; + std::string mess = "Kernel pool keyword " + key + " not found!"; throw IException(IException::Programmer, mess, _FILEINFO_); } PvlKeyword kw = NaifKeywords[key.toStdString()]; diff --git a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCameraDistortionMap.cpp b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCameraDistortionMap.cpp index 1b60acebbe..64fa039d89 100644 --- a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCameraDistortionMap.cpp +++ b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCameraDistortionMap.cpp @@ -82,7 +82,7 @@ namespace Isis { */ void LroWideAngleCameraDistortionMap::setBand(int vband) { if ( (vband <= 0) || (vband > m_odkFilters.size()) ) { - QString mess = "Invalid band (" + QString::number(vband) + " requested " + + std::string mess = "Invalid band (" + QString::number(vband) + " requested " + " Must be <= " + QString::number(m_odkFilters.size()); throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCameraFocalPlaneMap.cpp b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCameraFocalPlaneMap.cpp index 15e9ed93f1..08cfb7e030 100644 --- a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCameraFocalPlaneMap.cpp +++ b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCameraFocalPlaneMap.cpp @@ -85,7 +85,7 @@ namespace Isis { */ void LroWideAngleCameraFocalPlaneMap::setBand(int vband) { if ( (vband <= 0) || (vband > m_transparms.size()) ) { - QString mess = "Invalid band (" + QString::number(vband) + " requested " + + std::string mess = "Invalid band (" + QString::number(vband) + " requested " + " Must be <= " + QString::number(m_transparms.size()); throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/lro/objs/MiniRF/MiniRF.cpp b/isis/src/lro/objs/MiniRF/MiniRF.cpp index 763cd36b24..7e3e9fecaa 100644 --- a/isis/src/lro/objs/MiniRF/MiniRF.cpp +++ b/isis/src/lro/objs/MiniRF/MiniRF.cpp @@ -53,7 +53,7 @@ namespace Isis { m_spacecraftNameShort = "Chan1"; } else { - QString msg = "Cube does not appear to be a mini RF image"; + std::string msg = "Cube does not appear to be a mini RF image"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/mariner/apps/mar102isis/main.cpp b/isis/src/mariner/apps/mar102isis/main.cpp index 1cf65be8a6..63f826fc59 100644 --- a/isis/src/mariner/apps/mar102isis/main.cpp +++ b/isis/src/mariner/apps/mar102isis/main.cpp @@ -40,7 +40,7 @@ void IsisMain() { // Determine whether input is a raw Mariner 10 image or an Isis 2 cube bool isRaw = false; FileName inputFile = ui.GetFileName("FROM"); - Pvl label(inputFile.expanded().toStdString()); + Pvl label(inputFile.expanded()); // If the PVL created from the input labels is empty, then input is raw if(label.groups() + label.objects() + label.keywords() == 0) { @@ -333,7 +333,7 @@ void UpdateLabels(Cube *cube, const QString &labels) { void TranslateIsis2Labels(FileName &labelFile, Cube *oCube) { // Transfer the instrument group to the output cube QString transDir = "$ISISROOT/appdata/translations/"; - Pvl inputLabel(labelFile.expanded().toStdString()); + Pvl inputLabel(labelFile.expanded()); FileName transFile; transFile = transDir + "Mariner10isis2.trn"; diff --git a/isis/src/mariner/apps/mar10cal/main.cpp b/isis/src/mariner/apps/mar10cal/main.cpp index 9bfb3efd15..6e2ff25def 100644 --- a/isis/src/mariner/apps/mar10cal/main.cpp +++ b/isis/src/mariner/apps/mar10cal/main.cpp @@ -55,7 +55,7 @@ void IsisMain() { // If it is already calibrated then complain if (icube->hasGroup("Radiometry")) { - QString msg = "This Mariner 10 image [" + icube->fileName() + "] has " + std::string msg = "This Mariner 10 image [" + icube->fileName() + "] has " "already been radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } @@ -84,7 +84,7 @@ void IsisMain() { exposureOffset = 3.060; } else { - QString msg = "Camera [" + camera + "] is not supported."; + std::string msg = "Camera [" + camera + "] is not supported."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -114,7 +114,7 @@ void IsisMain() { } if (filter == "FAB" || filter == "WAF") { - QString msg = "Filter type [" + filter + "] is not supported at this time."; + std::string msg = "Filter type [" + filter + "] is not supported at this time."; throw IException(IException::User, msg, _FILEINFO_); } @@ -139,7 +139,7 @@ void IsisMain() { absCoef = 750.0; } else { - QString msg = "Camera [" + camera + "] is not supported."; + std::string msg = "Camera [" + camera + "] is not supported."; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/mariner/apps/mar10clean/main.cpp b/isis/src/mariner/apps/mar10clean/main.cpp index 09f6db3c2a..94220b6150 100644 --- a/isis/src/mariner/apps/mar10clean/main.cpp +++ b/isis/src/mariner/apps/mar10clean/main.cpp @@ -25,7 +25,7 @@ void IsisMain() { iCube.open(ui.GetCubeName("FROM")); Pvl * labels = iCube.label(); if ("Mariner_10" != QString::fromStdString(labels->findKeyword("SpacecraftName", Pvl::Traverse))) { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Mariner10 cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -39,12 +39,12 @@ void IsisMain() { stats = cp.Statistics(); cout << "Valid pixels: "<< stats->ValidPixels() << endl; if (stats->ValidPixels() == 7) { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] needs" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] needs" + " reconstruction, try mar10restore instead"; throw IException(IException::User, msg, _FILEINFO_); } else if (stats->ValidPixels() == 0) { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "]" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "]" + " appears to have already been cleaned"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mariner/apps/mar10nonoise/main.cpp b/isis/src/mariner/apps/mar10nonoise/main.cpp index 0714a4e71d..ac6d48cf9f 100644 --- a/isis/src/mariner/apps/mar10nonoise/main.cpp +++ b/isis/src/mariner/apps/mar10nonoise/main.cpp @@ -24,7 +24,7 @@ void IsisMain() { iCube.open(ui.GetCubeName("FROM")); Pvl * labels = iCube.label(); if ("Mariner_10" != QString::fromStdString(labels->findKeyword("SpacecraftName", Pvl::Traverse))) { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Mariner10 cube"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mariner/apps/mar10restore/main.cpp b/isis/src/mariner/apps/mar10restore/main.cpp index b430002046..4a6a2857a4 100644 --- a/isis/src/mariner/apps/mar10restore/main.cpp +++ b/isis/src/mariner/apps/mar10restore/main.cpp @@ -28,7 +28,7 @@ void IsisMain() { // Check that it is a Mariner10 cube. Pvl * labels = cube.label(); if ("Mariner_10" != QString::fromStdString(labels->findKeyword("SpacecraftName", Pvl::Traverse))) { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Mariner10 cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -41,7 +41,7 @@ void IsisMain() { stats = cp.Statistics(); // Maximum possible number of good pixels in a 5x5 if(stats->ValidPixels() > 8) { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not need" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] does not need" + " reconstruction, try mar10clean instead"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mariner/objs/Mariner10Camera/Mariner10Camera.cpp b/isis/src/mariner/objs/Mariner10Camera/Mariner10Camera.cpp index c2c6bca68d..20a127e98b 100644 --- a/isis/src/mariner/objs/Mariner10Camera/Mariner10Camera.cpp +++ b/isis/src/mariner/objs/Mariner10Camera/Mariner10Camera.cpp @@ -94,7 +94,7 @@ namespace Isis { m_instrumentNameShort = "VIDICON B"; } else { - QString msg = "File does not appear to be a Mariner10 image. InstrumentId [" + std::string msg = "File does not appear to be a Mariner10 image. InstrumentId [" + instId + "] is invalid Mariner 10 value."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mer/apps/mer2isis/main.cpp b/isis/src/mer/apps/mer2isis/main.cpp index 0740a6663e..c90aae9948 100644 --- a/isis/src/mer/apps/mer2isis/main.cpp +++ b/isis/src/mer/apps/mer2isis/main.cpp @@ -27,9 +27,9 @@ void IsisMain() { FileName input = FileName(ui.GetFileName("FROM")); //Checks if in file is rdr - Pvl lab(input.expanded().toStdString()); + Pvl lab(input.expanded()); if(lab.hasObject("IMAGE_MAP_PROJECTION")) { - QString msg = "[" + input.name() + "] has already been projected."; + std::string msg = "[" + input.name() + "] has already been projected."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -64,7 +64,7 @@ void TranslateMerEdrLabels(FileName &labelFile, Cube *ocube) { QString transDir = "$ISISROOT/appdata/translations/"; // Get a filename for the MESSENGER EDR label - Pvl labelPvl(labelFile.expanded().toStdString()); + Pvl labelPvl(labelFile.expanded()); FileName transFile; // Translate the Archive group diff --git a/isis/src/mer/apps/mical/main.cpp b/isis/src/mer/apps/mical/main.cpp index 9767d94c98..ba2bb6d016 100644 --- a/isis/src/mer/apps/mical/main.cpp +++ b/isis/src/mer/apps/mical/main.cpp @@ -62,7 +62,7 @@ void IsisMain() { //check if the image is calibrated if(pack->hasGroup("Radiometry")) { - QString msg = "The MI image [" + pack->fileName() + "] has already " + std::string msg = "The MI image [" + pack->fileName() + "] has already " "been radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/messenger/apps/mdis2isis/main.cpp b/isis/src/messenger/apps/mdis2isis/main.cpp index a0e5c0bf23..f93283d593 100644 --- a/isis/src/messenger/apps/mdis2isis/main.cpp +++ b/isis/src/messenger/apps/mdis2isis/main.cpp @@ -78,7 +78,7 @@ void IsisMain() { FileName inFile = ui.GetFileName("FROM"); IString id; bool projected; - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); try { needsUnlut = (int) lab.findKeyword("MESS:COMP12_8"); @@ -88,14 +88,14 @@ void IsisMain() { projected = lab.hasObject("IMAGE_MAP_PROJECTION"); } catch(IException &e) { - QString msg = "Unable to read [MISSION] from input file [" + + std::string msg = "Unable to read [MISSION] from input file [" + inFile.expanded() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } //Checks if in file is rdr if(projected) { - QString msg = "[" + inFile.name() + "] appears to be an rdr file."; + std::string msg = "[" + inFile.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -104,7 +104,7 @@ void IsisMain() { id.Compress(); id.Trim(" "); if(id != "MESSENGER") { - QString msg = "Input file [" + inFile.expanded() + "] does not appear to be " + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be " + "in MESSENGER EDR format. MISSION_NAME is [" + id.ToQt() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -176,7 +176,7 @@ void IsisMain() { p.StartProcess(UnlutData); - OriginalLabel ol(Pvl(inFile.expanded().toStdString())); + OriginalLabel ol(Pvl(inFile.expanded())); outCube->write(ol); outCube->close(); delete outCube; @@ -193,7 +193,7 @@ Pvl TranslateMdisEdrLabels(FileName &labelFile, const QString &target) { QString transDir = "$ISISROOT/appdata/translations/"; // Get a filename for the MESSENGER EDR label - Pvl labelPvl(labelFile.expanded().toStdString()); + Pvl labelPvl(labelFile.expanded()); // Translate the Instrument group FileName transFile(transDir + "MessengerMdisInstrument.trn"); @@ -297,7 +297,7 @@ int CreateFilterSpecs(const QString &instId, int filter_code, // Set up WAC calibration file FileName calibFile("$messenger/calibration/mdisCalibration????.trn"); calibFile = calibFile.highestVersion(); - Pvl config(calibFile.expanded().toStdString()); + Pvl config(calibFile.expanded()); PvlGroup &confgrp = config.findGroup("FilterWheel"); int tolerance = confgrp["EncoderTolerance"]; @@ -318,7 +318,7 @@ int CreateFilterSpecs(const QString &instId, int filter_code, } else { // Not the expected instrument - QString msg = "Unknown InstrumentId [" + instId + "], image does not " + + std::string msg = "Unknown InstrumentId [" + instId + "], image does not " + "appear to be from the MESSENGER/MDIS Camera"; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/messenger/apps/mdis2pds/main.cpp b/isis/src/messenger/apps/mdis2pds/main.cpp index 5542ab4864..861e60ea2e 100644 --- a/isis/src/messenger/apps/mdis2pds/main.cpp +++ b/isis/src/messenger/apps/mdis2pds/main.cpp @@ -183,7 +183,7 @@ void IsisMain() { dataSetID += "0"; } else { // 16 < nbits < 32 - QString msg = "[" + toString(nbits) + "] is not a supported bit length."; + std::string msg = "[" + toString(nbits) + "] is not a supported bit length."; throw IException(IException::User, msg, _FILEINFO_); } dataSetID += "-CDR-CALDATA-V1.0"; diff --git a/isis/src/messenger/apps/mdiscal/MdisCalUtils.h b/isis/src/messenger/apps/mdiscal/MdisCalUtils.h index 1bdd05cb62..1b49e61193 100644 --- a/isis/src/messenger/apps/mdiscal/MdisCalUtils.h +++ b/isis/src/messenger/apps/mdiscal/MdisCalUtils.h @@ -133,7 +133,7 @@ namespace Isis { sunDist = sunkm / 1.49597870691E8; } catch (IException &e) { - QString message = "Unable to determine the sun-target distance."; + std::string message = "Unable to determine the sun-target distance."; throw IException(e, IException::Unknown, message, _FILEINFO_); } } @@ -153,7 +153,7 @@ namespace Isis { CSVReader::CSVAxis row = csv.getRow(i); if (toInteger(row[0]) == filter) { if ((row.dim1() - 1) < nvalues) { - QString mess = "Number values (" + QString(row.dim1() - 1) + + std::string mess = "Number values (" + QString(row.dim1() - 1) + ") in file " + fname + " less than number requested (" + QString(nvalues) + ")!"; @@ -186,7 +186,7 @@ namespace Isis { CSVReader csv(csvfile.expanded(), header, skip); CSVReader::CSVAxis row = csv.getRow(0); if (row.dim1() < nvalues) { - QString mess = "Number values (" + QString(row.dim1()) + + std::string mess = "Number values (" + QString(row.dim1()) + ") in file " + fname + " less than number requested (" + QString(nvalues) + ")!"; throw IException(IException::User, mess, _FILEINFO_); @@ -388,7 +388,7 @@ namespace Isis { const int nvalues = 13; // Expected columns in table CSVReader csv(csvfile.expanded(), header, skip); if (csv.columns() < nvalues) { // All rows should have same # columns - QString mess = "Number values (" + QString(csv.columns()) + + std::string mess = "Number values (" + QString(csv.columns()) + ") in file " + ename + " less than number requested (" + QString(nvalues) + ")!"; throw IException(IException::User, mess, _FILEINFO_); @@ -411,7 +411,7 @@ namespace Isis { } catch (IException &e) { - QString message = "Could not convert spacecraft clock start count to ET."; + std::string message = "Could not convert spacecraft clock start count to ET."; throw IException(e, IException::Unknown, message, _FILEINFO_); } } diff --git a/isis/src/messenger/apps/mdiscal/main.cpp b/isis/src/messenger/apps/mdiscal/main.cpp index eb591dff97..4d0ba5b253 100644 --- a/isis/src/messenger/apps/mdiscal/main.cpp +++ b/isis/src/messenger/apps/mdiscal/main.cpp @@ -100,7 +100,7 @@ void IsisMain() { ProcessByLine p; FileName calibFile("$messenger/calibration/mdisCalibration????.trn"); calibFile = calibFile.highestVersion(); - g_configFile.read(calibFile.expanded().toStdString()); + g_configFile.read(calibFile.expanded()); // Initialize variables g_calibrationValues.clear(); @@ -174,7 +174,7 @@ void IsisMain() { } if (icube->sampleCount() < 3) { - QString msg = "Unable to obtain dark current data. Expected a sample dimension of at least 3"; + std::string msg = "Unable to obtain dark current data. Expected a sample dimension of at least 3"; throw IException(IException::User, msg, _FILEINFO_); } @@ -191,7 +191,7 @@ void IsisMain() { if (g_nValidDark <= 0) { // Both cases require dark pixels, g_model does not if ((darkCurr == "STANDARD") || (darkCurr == "LINEAR")) { - QString mess = "Warning: There are no valid dark current pixels which are required" + std::string mess = "Warning: There are no valid dark current pixels which are required" " for " + darkCurr + " calibration. Changing dark correction method to MODEL."; IException ie(IException::User, mess, _FILEINFO_); ie.print(); @@ -201,7 +201,7 @@ void IsisMain() { // Model cannot be used for exposure times > 1.0 if ((darkCurr == "MODEL") && (g_exposureDuration > 1.0)) { darkCurr = "NONE"; - QString mess = "Warning: There are no valid dark current pixels and the dark model correction" + std::string mess = "Warning: There are no valid dark current pixels and the dark model correction" " can not be used when the exposure duration exceeds 1000 milliseconds." " Changing dark correction method to NONE."; IException ie(IException::User, mess, _FILEINFO_); @@ -228,7 +228,7 @@ void IsisMain() { g_calibrationValues.resize(icube->lineCount()); darkCurr = "STANDARD"; - QString mess = "Warning: Dark model correction can not be used when the" + std::string mess = "Warning: Dark model correction can not be used when the" " exposure duration exceeds 1000 milliseconds." " Changing dark correction method to STANDARD."; IException ie(IException::User, mess, _FILEINFO_); diff --git a/isis/src/messenger/apps/mdisedrinfo/MdisEdrKeys.h b/isis/src/messenger/apps/mdisedrinfo/MdisEdrKeys.h index a07102e979..8aa89501d5 100644 --- a/isis/src/messenger/apps/mdisedrinfo/MdisEdrKeys.h +++ b/isis/src/messenger/apps/mdisedrinfo/MdisEdrKeys.h @@ -226,7 +226,7 @@ namespace Isis { } catch(IException &ie) { nbad++; - QString mess = "Keyword \"" + keyname + "\" does not exist!"; + std::string mess = "Keyword \"" + keyname + "\" does not exist!"; errors.append( IException(IException::User, mess, _FILEINFO_)); } @@ -234,7 +234,7 @@ namespace Isis { // Check to see if all keywords are found if(nbad > 0) { - QString mess = "One or more keywords in list do not exist!"; + std::string mess = "One or more keywords in list do not exist!"; throw IException(errors, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp b/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp index 9107c21130..03c125367e 100644 --- a/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp +++ b/isis/src/messenger/apps/mdisedrinfo/SpiceManager.cpp @@ -212,7 +212,7 @@ namespace Isis { if(IString(key[i]).UpCase() == "TABLE") continue; Isis::FileName file(QString::fromStdString(key[i])); if(!file.fileExists()) { - QString msg = "Spice file does not exist [" + file.expanded() + "]"; + std::string msg = "Spice file does not exist [" + file.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } QString fileName(file.expanded()); diff --git a/isis/src/messenger/apps/mdisedrinfo/main.cpp b/isis/src/messenger/apps/mdisedrinfo/main.cpp index 16724d1b84..8888a446fb 100644 --- a/isis/src/messenger/apps/mdisedrinfo/main.cpp +++ b/isis/src/messenger/apps/mdisedrinfo/main.cpp @@ -101,7 +101,7 @@ void IsisMain() { if(!keylist.isEmpty()) { FileName kmap(keylist); if(!kmap.fileExists()) { - QString mess = "EDR keyword map source file, " + kmap.expanded() + std::string mess = "EDR keyword map source file, " + kmap.expanded() + ", does not exist!"; throw IException(IException::User, mess, _FILEINFO_); } @@ -110,13 +110,13 @@ void IsisMain() { QString kmapName(kmap.expanded()); ifstream ifile(kmapName.toLatin1().data(), ios::in); if(!ifile) { - QString mess = "Unable to open key map source file " + kmap.expanded(); + std::string mess = "Unable to open key map source file " + kmap.expanded(); throw IException(IException::User, mess, _FILEINFO_); } string keystring; if(!getline(ifile, keystring)) { - QString mess = "I/O error reading key map line from " + kmap.expanded(); + std::string mess = "I/O error reading key map line from " + kmap.expanded(); throw IException(IException::User, mess, _FILEINFO_); } @@ -140,7 +140,7 @@ void IsisMain() { } if(!ofile) { - QString mess = "Could not open or create output TO file " + + std::string mess = "Could not open or create output TO file " + tomapName; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/messenger/objs/MdisCamera/MdisCamera.cpp b/isis/src/messenger/objs/MdisCamera/MdisCamera.cpp index c64e987d53..ec383afe51 100644 --- a/isis/src/messenger/objs/MdisCamera/MdisCamera.cpp +++ b/isis/src/messenger/objs/MdisCamera/MdisCamera.cpp @@ -68,7 +68,7 @@ namespace Isis { m_instrumentNameShort = "MDIS-WAC"; } else { - QString msg = QString::number(naifIkCode()); + std::string msg = QString::number(naifIkCode()); msg += " is not a supported instrument kernel code for Messenger."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp b/isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp index 841c4d9d67..647b449643 100644 --- a/isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp +++ b/isis/src/mex/apps/hrsc2isis/hrsc2isis.cpp @@ -63,14 +63,14 @@ namespace Isis{ isSrcFile = false; } else { - QString msg = "File [" + ui.GetFileName("FROM"); + std::string msg = "File [" + ui.GetFileName("FROM"); msg += "] does not appear to be a Mars Express stereo or SRC file. Label keyword [DETECTOR_ID = "; msg += QString::fromStdString(label["DETECTOR_ID"][0]) + "] is not recognized."; throw IException(IException::User, msg, _FILEINFO_); } if ((int)label["PROCESSING_LEVEL_ID"] >= 4) { - QString msg = "File [" + ui.GetFileName("FROM"); + std::string msg = "File [" + ui.GetFileName("FROM"); msg += "] has keyword [PROCESSING_LEVEL_ID = " + QString::fromStdString(label["PROCESSING_LEVEL_ID"][0]) + "]"; msg += " and can not be read by this program."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/mgs/apps/moc2isis/main.cpp b/isis/src/mgs/apps/moc2isis/main.cpp index a2fdf431ae..36a25874a9 100644 --- a/isis/src/mgs/apps/moc2isis/main.cpp +++ b/isis/src/mgs/apps/moc2isis/main.cpp @@ -36,20 +36,20 @@ void IsisMain() { bool compressed = false; bool projected; try { - Pvl lab(in.expanded().toStdString()); + Pvl lab(in.expanded()); id = QString::fromStdString(lab["DATA_SET_ID"]); if(lab.findObject("IMAGE").hasKeyword("ENCODING_TYPE")) compressed = true; projected = lab.hasObject("IMAGE_MAP_PROJECTION"); } catch(IException &e) { - QString msg = "Unable to read [DATA_SET_ID] from input file [" + + std::string msg = "Unable to read [DATA_SET_ID] from input file [" + in.expanded() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } //Checks if in file is rdr if(projected) { - QString msg = "[" + in.name() + "] appears to be an rdr file."; + std::string msg = "[" + in.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -57,7 +57,7 @@ void IsisMain() { id = id.simplified().trimmed(); if((id != "MGS-M-MOC-NA/WA-2-DSDP-L0-V1.0") && (id != "MGS-M-MOC-NA/WA-2-SDP-L0-V1.0")) { - QString msg = "Input file [" + in.expanded() + "] does not appear to be " + + std::string msg = "Input file [" + in.expanded() + "] does not appear to be " + "in MOC EDR format. DATA_SET_ID [" + id + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -75,7 +75,7 @@ void IsisMain() { QString command = "mocuncompress " + in.expanded() + " " + uncompressed.expanded(); if(system(command.toLatin1().data()) == 1) { - QString msg = "Unable to execute [mocuncompress]"; + std::string msg = "Unable to execute [mocuncompress]"; throw IException(IException::Programmer, msg, _FILEINFO_); } p.SetPdsFile(uncompressed.expanded(), "", pdsLabel); @@ -107,7 +107,7 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { FileName transFile(transDir + "MgsMocInstrument.trn"); // Get the translation manager ready - Pvl labelPvl(labelFile.expanded().toStdString()); + Pvl labelPvl(labelFile.expanded()); PvlToPvlTranslationManager instrumentXlater(labelPvl, transFile.expanded()); PvlGroup inst("Instrument"); @@ -301,7 +301,7 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { frameCode = "-94032"; } else { - QString msg = "Invalid value for filter name [" + str + "]"; + std::string msg = "Invalid value for filter name [" + str + "]"; } } else { diff --git a/isis/src/mgs/apps/moccal/moccal.cpp b/isis/src/mgs/apps/moccal/moccal.cpp index 4d69ad0b83..bc76ed5238 100644 --- a/isis/src/mgs/apps/moccal/moccal.cpp +++ b/isis/src/mgs/apps/moccal/moccal.cpp @@ -64,7 +64,7 @@ namespace Isis { // If it is already calibrated then complain if(icube->hasGroup("Radiometry")) { - QString msg = "The MOC image [" + icube->fileName() + "] has already " + std::string msg = "The MOC image [" + icube->fileName() + "] has already " "been radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } @@ -294,7 +294,7 @@ namespace Isis { // Make sure the file had the correct number of coefficients. It should // match the number of detectors in the NA or WA camera if((int)gainCoef.size() != gbl::moc->Detectors()) { - QString msg = "Coefficient file [" + file + "] size is wrong ... should have ["; + std::string msg = "Coefficient file [" + file + "] size is wrong ... should have ["; msg += toString(gbl::moc->Detectors()) + "] gain/offset entries"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -309,7 +309,7 @@ namespace Isis { double osum = 0.0; for(n = 0; ss <= es; ss++, n++) { if(ss >= (int)gainCoef.size()) { - QString msg = "Array bounds exceeded for gainCoef/offsetCoef"; + std::string msg = "Array bounds exceeded for gainCoef/offsetCoef"; throw IException(IException::Programmer, msg, _FILEINFO_); } gsum += gainCoef[ss]; diff --git a/isis/src/mgs/apps/mocnoise50/main.cpp b/isis/src/mgs/apps/mocnoise50/main.cpp index 6efee3fcc0..e0f53fd18a 100644 --- a/isis/src/mgs/apps/mocnoise50/main.cpp +++ b/isis/src/mgs/apps/mocnoise50/main.cpp @@ -43,14 +43,14 @@ void IsisMain() { // Must be narrow angle if(moc.WideAngle()) { - QString msg = "The 50 sample noise pattern does not occur in "; + std::string msg = "The 50 sample noise pattern does not occur in "; msg += "MOC wide angle images"; throw IException(IException::User, msg, _FILEINFO_); } // Must have crosstrack summing of 1 if(moc.CrosstrackSumming() != 1) { - QString msg = "The 50 sample noise pattern does not occur in "; + std::string msg = "The 50 sample noise pattern does not occur in "; msg += "MOC narrow angle images with crosstrack summing greater than one"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mgs/apps/mocproc/main.cpp b/isis/src/mgs/apps/mocproc/main.cpp index 4a852310aa..7f9e1a1608 100644 --- a/isis/src/mgs/apps/mocproc/main.cpp +++ b/isis/src/mgs/apps/mocproc/main.cpp @@ -65,7 +65,7 @@ void IsisMain() { p.Application("mocevenodd").SetInputParameter("FROM", true); p.Application("mocevenodd").SetOutputParameter("TO", "evenodd"); - Pvl inputPvl(FileName(ui.GetFileName("FROM")).expanded().toStdString()); + Pvl inputPvl(FileName(ui.GetFileName("FROM")).expanded()); int summingMode = 0; bool isNarrowAngle = false; @@ -101,7 +101,7 @@ void IsisMain() { p.Application("cam2map").AddConstParameter("PIXRES", "MPP"); } else if(ui.WasEntered("MAP")) { - Pvl mapPvl(FileName(ui.GetFileName("MAP")).expanded().toStdString()); + Pvl mapPvl(FileName(ui.GetFileName("MAP")).expanded()); if(mapPvl.findGroup("Mapping", Pvl::Traverse).hasKeyword("PixelResolution")) { p.Application("cam2map").AddConstParameter("PIXRES", "MAP"); } diff --git a/isis/src/mgs/objs/MocLabels/MocLabels.cpp b/isis/src/mgs/objs/MocLabels/MocLabels.cpp index ba8bead661..fcb8febb62 100644 --- a/isis/src/mgs/objs/MocLabels/MocLabels.cpp +++ b/isis/src/mgs/objs/MocLabels/MocLabels.cpp @@ -120,7 +120,7 @@ namespace Isis { } if(!p_mocNA && !p_mocRedWA && !p_mocBlueWA) { - QString msg = "InstrumentID [" + p_instrumentId + "] and/or FilterName [" + std::string msg = "InstrumentID [" + p_instrumentId + "] and/or FilterName [" + p_filter + "] are inappropriate for the MOC camera"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -173,7 +173,7 @@ namespace Isis { if(NarrowAngle()) { p = p_gainMapNA.find(p_gainModeId); if(p == p_gainMapNA.end()) { - QString msg = "Invalid value for PVL keyword GainModeId [" + + std::string msg = "Invalid value for PVL keyword GainModeId [" + p_gainModeId + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -181,7 +181,7 @@ namespace Isis { else { p = p_gainMapWA.find(p_gainModeId); if(p == p_gainMapWA.end()) { - QString msg = "Invalid value for PVL keyword GainModeId [" + + std::string msg = "Invalid value for PVL keyword GainModeId [" + p_gainModeId + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -569,7 +569,7 @@ namespace Isis { unload_c(lskKern.toLatin1().data()); unload_c(sclkKern.toLatin1().data()); - QString msg = "Invalid GainModeId [" + gainId + "] in wago table"; + std::string msg = "Invalid GainModeId [" + gainId + "] in wago table"; throw IException(IException::Unknown, msg, _FILEINFO_); } double gain = p->second; diff --git a/isis/src/mro/apps/crism2isis/crism2isis.cpp b/isis/src/mro/apps/crism2isis/crism2isis.cpp index 891cfb9e69..abb7f4ee2b 100644 --- a/isis/src/mro/apps/crism2isis/crism2isis.cpp +++ b/isis/src/mro/apps/crism2isis/crism2isis.cpp @@ -33,7 +33,7 @@ namespace Isis{ Pvl outLabel; - Pvl labelPvl(inFile.expanded().toStdString()); + Pvl labelPvl(inFile.expanded()); QString prodType; @@ -41,7 +41,7 @@ namespace Isis{ prodType = QString::fromStdString(labelPvl.findKeyword("PRODUCT_TYPE")); } else { - QString msg = "Unsupported CRISM file type, supported types are: DDR, MRDR, and TRDR"; + std::string msg = "Unsupported CRISM file type, supported types are: DDR, MRDR, and TRDR"; throw IException(IException::User, msg, _FILEINFO_); } @@ -52,7 +52,7 @@ namespace Isis{ prodId = prodId.mid(prodId.indexOf("_") + 1, prodId.indexOf("_")); } else { - QString msg = "Could not find label PRODUCT_ID, invalid MRDR"; + std::string msg = "Could not find label PRODUCT_ID, invalid MRDR"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -73,7 +73,7 @@ namespace Isis{ TextFile *fin = new TextFile(tableFile.expanded()); // Open table file if (!fin->OpenChk()) { - QString msg = "Cannot open wavelength table [" + tableFile.expanded() + "]"; + std::string msg = "Cannot open wavelength table [" + tableFile.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -97,7 +97,7 @@ namespace Isis{ } //Otherwise throw an error else { - QString msg = "Cannot find wavelength table [" + tableFile.expanded() + "]"; + std::string msg = "Cannot find wavelength table [" + tableFile.expanded() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -147,7 +147,7 @@ namespace Isis{ ocube->putGroup(bandBin); } else { - QString msg = "Unsupported CRISM file type, supported types are: DDR, MRDR, and TRDR"; + std::string msg = "Unsupported CRISM file type, supported types are: DDR, MRDR, and TRDR"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mro/apps/ctxcal/ctxcal.cpp b/isis/src/mro/apps/ctxcal/ctxcal.cpp index f854129823..79644d3e98 100644 --- a/isis/src/mro/apps/ctxcal/ctxcal.cpp +++ b/isis/src/mro/apps/ctxcal/ctxcal.cpp @@ -51,7 +51,7 @@ namespace Isis { QString instId = QString::fromStdString(inst["InstrumentId"]); if(instId != "CTX") { - QString msg = "This is not a CTX image. Ctxcal requires a CTX image."; + std::string msg = "This is not a CTX image. Ctxcal requires a CTX image."; throw IException(IException::User, msg, _FILEINFO_); } @@ -70,7 +70,7 @@ namespace Isis { QStringRef month(&outputFileBase, 0, 3); flat = FileName("$mro/calibration/ctxFlatFiles/" + month + ".flat.cub"); if (!flat.fileExists()) { - QString msg = "Could not find flat file [" + flat.expanded() + "]. " + std::string msg = "Could not find flat file [" + flat.expanded() + "]. " "Either the data area is not set or a month is missing."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -86,7 +86,7 @@ namespace Isis { // If it is already calibrated then complain if(icube->hasGroup("Radiometry")) { - QString msg = "The CTX image [" + icube->fileName() + "] has already " + std::string msg = "The CTX image [" + icube->fileName() + "] has already " "been radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } @@ -194,7 +194,7 @@ namespace Isis { double w0 = 3660.5; double w1 = w0 * ((dist * dist) / (dist1 * dist1)); if(exposure *w1 == 0.0) { - QString msg = icube->fileName() + ": exposure or w1 has value of 0.0 "; + std::string msg = icube->fileName() + ": exposure or w1 has value of 0.0 "; throw IException(IException::User, msg, _FILEINFO_); } iof = 1.0 / (exposure * w1); diff --git a/isis/src/mro/apps/ctxevenodd/main.cpp b/isis/src/mro/apps/ctxevenodd/main.cpp index b42538afca..0fc94bf37c 100644 --- a/isis/src/mro/apps/ctxevenodd/main.cpp +++ b/isis/src/mro/apps/ctxevenodd/main.cpp @@ -47,12 +47,12 @@ void IsisMain() { QString instId = QString::fromStdString(inst["InstrumentId"]); if(instId != "CTX") { - QString msg = "This is not a CTX image. Ctxcevenodd requires a CTX image."; + std::string msg = "This is not a CTX image. Ctxcevenodd requires a CTX image."; throw IException(IException::User, msg, _FILEINFO_); } int sum = inst["SpatialSumming"]; if(sum != 1) { - QString msg = "CTX images do not have even/odd noise problems"; + std::string msg = "CTX images do not have even/odd noise problems"; msg += " if the SpatialSumming is greater than one."; throw IException(IException::User, msg, _FILEINFO_); } @@ -74,7 +74,7 @@ void IsisMain() { // // throw err if, pixel counts could result in division by zero if((oddCount == 0) || (evenCount == 0)) { - QString msg = "Couldn't compute column averages"; + std::string msg = "Couldn't compute column averages"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mro/apps/hi2isis/hi2isis.cpp b/isis/src/mro/apps/hi2isis/hi2isis.cpp index 9c14209287..07e80c4d42 100644 --- a/isis/src/mro/apps/hi2isis/hi2isis.cpp +++ b/isis/src/mro/apps/hi2isis/hi2isis.cpp @@ -78,26 +78,26 @@ namespace Isis { QString id; bool projected; try { - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); projected = lab.hasObject("IMAGE_MAP_PROJECTION"); } catch(IException &e) { - QString msg = "Unable to read [DATA_SET_ID] from input file [" + + std::string msg = "Unable to read [DATA_SET_ID] from input file [" + inFile.expanded() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } //Checks if in file is rdr if(projected) { - QString msg = "[" + inFile.name() + "] appears to be an rdr file."; + std::string msg = "[" + inFile.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } id = id.simplified().trimmed(); if(id != "MRO-M-HIRISE-2-EDR-V1.0") { - QString msg = "Input file [" + inFile.expanded() + "] does not appear to be " + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be " + "in HiRISE EDR format. DATA_SET_ID is [" + id + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -185,7 +185,7 @@ namespace Isis { // Log the results of the image conversion PvlGroup results("Results"); - results += PvlKeyword("From", inFile.expanded().toStdString()); + results += PvlKeyword("From", inFile.expanded()); results += PvlKeyword("CalibrationBufferGaps", std::to_string(gapCount[0])); results += PvlKeyword("CalibrationBufferLIS", std::to_string(lisCount[0])); @@ -460,7 +460,7 @@ namespace Isis { QString transDir = "$ISISROOT/appdata/translations/"; // Get a filename for the HiRISE EDR label - Pvl labelPvl(labelFile.expanded().toStdString()); + Pvl labelPvl(labelFile.expanded()); // Translate the Instrument group FileName transFile(transDir + "MroHiriseInstrument.trn"); diff --git a/isis/src/mro/apps/hical/hical.cpp b/isis/src/mro/apps/hical/hical.cpp index b451d98373..b517492327 100644 --- a/isis/src/mro/apps/hical/hical.cpp +++ b/isis/src/mro/apps/hical/hical.cpp @@ -192,7 +192,7 @@ namespace Isis { if ( !SkipModule(hiprof) ) { // Make sure we aren't applying ZeroDark and ZeroDarkRate if ( !SkipModule(hiconf.getMatrixProfile("ZeroDark")) ){ - QString mess = "You have enabled both the ZeroDark and the ZeroDarkRate modules." + std::string mess = "You have enabled both the ZeroDark and the ZeroDarkRate modules." "This means you are attempting to remove the dark current twice with " "two different algorithms. This is not approved use of hical. " "Please disable one or the other module using the Debug::SkipModule " @@ -462,7 +462,7 @@ namespace Isis { QString hdumpFile = hdump.expanded(); ofstream ofile(hdumpFile.toLatin1().data(), ios::out); if (!ofile) { - QString mess = "Unable to open/create history dump file " + + std::string mess = "Unable to open/create history dump file " + hdump.expanded(); IException(IException::User, mess, _FILEINFO_).print(); } @@ -543,7 +543,7 @@ namespace Isis { catch (IException &ie) { delete calVars; calVars = 0; - QString mess = "Failed in " + procStep; + std::string mess = "Failed in " + procStep; throw IException(ie, IException::User, mess.toLatin1().data(), _FILEINFO_); } diff --git a/isis/src/mro/apps/hicalbeta/main.cpp b/isis/src/mro/apps/hicalbeta/main.cpp index 2fcca59de4..5174c9e706 100644 --- a/isis/src/mro/apps/hicalbeta/main.cpp +++ b/isis/src/mro/apps/hicalbeta/main.cpp @@ -404,7 +404,7 @@ void IsisMain(){ QString hdumpFile = hdump.expanded(); ofstream ofile(hdumpFile.toLatin1().data(), ios::out); if (!ofile) { - QString mess = "Unable to open/create history dump file " + + std::string mess = "Unable to open/create history dump file " + hdump.expanded(); IException(IException::User, mess, _FILEINFO_).print(); } @@ -482,7 +482,7 @@ void IsisMain(){ catch (IException &ie) { delete calVars; calVars = 0; - QString mess = "Failed in " + procStep; + std::string mess = "Failed in " + procStep; throw IException(ie, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/mro/apps/hicalproc/main.cpp b/isis/src/mro/apps/hicalproc/main.cpp index 23cc05c46b..403637ee82 100644 --- a/isis/src/mro/apps/hicalproc/main.cpp +++ b/isis/src/mro/apps/hicalproc/main.cpp @@ -400,12 +400,12 @@ void IsisMain() { } catch(std::exception const &se) { CleanUp(sTempFiles, inFile); - QString message = "std::exception: " + (QString)se.what(); + std::string message = "std::exception: " + (QString)se.what(); throw IException(IException::User, message, _FILEINFO_); } catch(...) { CleanUp(sTempFiles, inFile); - QString message = "Other Error"; + std::string message = "Other Error"; throw IException(IException::User, message, _FILEINFO_); } } diff --git a/isis/src/mro/apps/hiccdstitch/main.cpp b/isis/src/mro/apps/hiccdstitch/main.cpp index 459e51dc1e..0a12fca4ad 100644 --- a/isis/src/mro/apps/hiccdstitch/main.cpp +++ b/isis/src/mro/apps/hiccdstitch/main.cpp @@ -115,7 +115,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); list.read(ui.GetFileName("FROMLIST")); if(list.size() < 1) { - QString msg = "The list file[" + ui.GetFileName("FROMLIST") + + std::string msg = "The list file[" + ui.GetFileName("FROMLIST") + " does not contain any filenames"; throw IException(IException::User, msg, _FILEINFO_); } @@ -124,7 +124,7 @@ void IsisMain() { // Commented out as HiRISE Team is requesting a single file to be processed // to simplify pipeline logic if(list.size() == 1) { - QString msg = "The list file[" + ui.GetFileName("FROMLIST") + + std::string msg = "The list file[" + ui.GetFileName("FROMLIST") + " must contain at least two filenames"; throw iException::Message(iException::User, msg, _FILEINFO_); } @@ -141,7 +141,7 @@ void IsisMain() { interp = new Interpolator(Interpolator::CubicConvolutionType); } else { - QString msg = "Unknow value for INTERP [" + + std::string msg = "Unknow value for INTERP [" + ui.GetString("INTERP") + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -172,7 +172,7 @@ void IsisMain() { } else { if(obsId != QString::fromStdString(arch["ObservationId"])) { - QString msg = "Input file " + list[i].toString() + std::string msg = "Input file " + list[i].toString() + " has a different ObservationId"; throw IException(IException::User, msg, _FILEINFO_); } @@ -181,7 +181,7 @@ void IsisMain() { PvlGroup inst = cube->label()->findGroup("Instrument", Pvl::Traverse); int chan = inst["ChannelNumber"]; if(chan != 2) { - QString msg = "Input file " + list[i].toString() + " contains a single channel"; + std::string msg = "Input file " + list[i].toString() + " contains a single channel"; throw IException(IException::User, msg, _FILEINFO_); } int cpmm = inst["CpmmNumber"]; @@ -270,7 +270,7 @@ void IsisMain() { // Check for consistent filters if((gotRed && gotNir) || (gotRed && gotBg) || (gotNir && gotBg)) { - QString msg = "Cannot stitch together different filter images"; + std::string msg = "Cannot stitch together different filter images"; throw IException(IException::User, msg, _FILEINFO_); } @@ -282,7 +282,7 @@ void IsisMain() { int prevCCD = CCDlist[0].ccdNumber; for(vec_sz i = 1; i < CCDlist.size(); ++i) { if(CCDlist[i].ccdNumber != prevCCD + 1) { - QString msg = "CCD numbers are not adjacent"; + std::string msg = "CCD numbers are not adjacent"; throw IException(IException::User, msg, _FILEINFO_); } prevCCD = CCDlist[i].ccdNumber; @@ -340,7 +340,7 @@ void IsisMain() { // If we find any band count inconsistancies, gotta give up the ghost if(nBandErrs > 0) { - QString mess = "Band count inconsistancies exist in input cubes!"; + std::string mess = "Band count inconsistancies exist in input cubes!"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/mro/apps/hicolormos/hicolormos.cpp b/isis/src/mro/apps/hicolormos/hicolormos.cpp index f69a456fd7..70b066cc79 100644 --- a/isis/src/mro/apps/hicolormos/hicolormos.cpp +++ b/isis/src/mro/apps/hicolormos/hicolormos.cpp @@ -66,7 +66,7 @@ void hicolormos(Cube *from1, Cube* from2, UserInterface &ui) { // Test the observation ID between from1 and from2 if(QString::fromStdString(from1lab.findGroup("Archive", Pvl::Traverse)["ObservationId"]) != QString::fromStdString(from2lab.findGroup("Archive", Pvl::Traverse)["ObservationId"])) { - QString msg = "Images not from the same observation"; + std::string msg = "Images not from the same observation"; throw IException(IException::User, msg, _FILEINFO_); } @@ -207,7 +207,7 @@ void hicolormos(Cube *from1, Cube* from2, UserInterface &ui) { if(runXY) { QString tmp(tempFile.expanded()); remove(tmp.toLatin1().data()); - QString msg = "Camera did not intersect images to gather stats"; + std::string msg = "Camera did not intersect images to gather stats"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mro/apps/hicubeit/hicubeit.cpp b/isis/src/mro/apps/hicubeit/hicubeit.cpp index c0fafffc37..38484d7c62 100644 --- a/isis/src/mro/apps/hicubeit/hicubeit.cpp +++ b/isis/src/mro/apps/hicubeit/hicubeit.cpp @@ -50,20 +50,20 @@ namespace Isis { // Error check to make sure the proper ccds are stacked if((int)redInst["CpmmNumber"] == 5) { if(((int)irInst["CpmmNumber"] != 6) || ((int)bgInst["CpmmNumber"] != 4)) { - QString msg = "You can only stack color images with RED4, IR10, and BG12 "; + std::string msg = "You can only stack color images with RED4, IR10, and BG12 "; msg += "or RED5, IR11, and BG13"; throw IException(IException::User, msg, _FILEINFO_); } } else if((int)redInst["CpmmNumber"] == 8) { if(((int)irInst["CpmmNumber"] != 7) || ((int)bgInst["CpmmNumber"] != 9)) { - QString msg = "You can only stack color images with RED4, IR10, and BG12 "; + std::string msg = "You can only stack color images with RED4, IR10, and BG12 "; msg += "or RED5, IR11, and BG13"; throw IException(IException::User, msg, _FILEINFO_); } } else { - QString msg = "You can only stack color images with RED4, IR10, and BG12 "; + std::string msg = "You can only stack color images with RED4, IR10, and BG12 "; msg += "or RED5, IR11, and BG13"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mro/apps/hicubenorm/hicubenorm.cpp b/isis/src/mro/apps/hicubenorm/hicubenorm.cpp index 1fe7b1b210..cf3ba20fa7 100644 --- a/isis/src/mro/apps/hicubenorm/hicubenorm.cpp +++ b/isis/src/mro/apps/hicubenorm/hicubenorm.cpp @@ -76,7 +76,7 @@ namespace Isis { // ERROR CHECK: The user must specify at least the TO or STATS // parameters. if(!(ui.WasEntered("TO")) && !(ui.WasEntered("STATS"))) { - QString msg = "User must specify a TO and/or STATS file."; + std::string msg = "User must specify a TO and/or STATS file."; throw IException(IException::User, msg, _FILEINFO_); } @@ -112,7 +112,7 @@ namespace Isis { // Check to make sure the first vector has as many elements as the last // vector, and that there is a vector element for each row/col if(!bNewVersion && band.size() != (unsigned int)(rowcol * totalBands)) { - QString message = "You have entered an invalid input file " + + std::string message = "You have entered an invalid input file " + ui.GetFileName("FROMSTATS"); throw IException(IException::Io, message, _FILEINFO_); } @@ -162,7 +162,7 @@ namespace Isis { if(ui.GetString("MODE") == "MULTIPLY") { for(unsigned int i = 0; i < band.size(); i++) { if(IsValidPixel(normalizer[i]) && normalizer[i] <= 0.0) { - QString msg = "Cube file can not be normalized with [MULTIPLY] "; + std::string msg = "Cube file can not be normalized with [MULTIPLY] "; msg += "option, some column averages <= 0.0"; throw IException(IException::User, msg, _FILEINFO_); } @@ -333,7 +333,7 @@ namespace Isis { //******************************************************* void PVLIn(const Isis::FileName &filename) { Pvl pvlFileIn; - pvlFileIn.read(filename.expanded().toStdString()); + pvlFileIn.read(filename.expanded()); PvlGroup results = pvlFileIn.findGroup("Results"); PvlObject::PvlKeywordIterator itr = results.begin(); @@ -367,7 +367,7 @@ namespace Isis { if(!in) { - QString message = "Error opening " + filename.expanded(); + std::string message = "Error opening " + filename.expanded(); throw IException(IException::Io, message, _FILEINFO_); } diff --git a/isis/src/mro/apps/hideal2pds/main.cpp b/isis/src/mro/apps/hideal2pds/main.cpp index 13e106d884..1930736106 100644 --- a/isis/src/mro/apps/hideal2pds/main.cpp +++ b/isis/src/mro/apps/hideal2pds/main.cpp @@ -58,7 +58,7 @@ void IsisMain() { QString origInstrument = QString::fromStdString(isisCubeLab->findObject("IsisCube") .findGroup("OriginalInstrument")["InstrumentId"][0]); if (origInstrument != "HIRISE") { - QString msg = "Input cube must from a HiRISE image. The original " + std::string msg = "Input cube must from a HiRISE image. The original " "InstrumentId = [" + origInstrument + "] is unsupported by hideal2pds."; throw IException(IException::Io, msg, _FILEINFO_); @@ -66,14 +66,14 @@ void IsisMain() { QString instrumentId = QString::fromStdString(isisCubeLab->findObject("IsisCube") .findGroup("Instrument")["InstrumentId"][0]); if (instrumentId != "IdealCamera") { - QString msg = "Input cube must be IdealCamera. InstrumentId = [" + std::string msg = "Input cube must be IdealCamera. InstrumentId = [" + instrumentId + "] is unsupported by hideal2pds."; throw IException(IException::Io, msg, _FILEINFO_); } QString target = QString::fromStdString(isisCubeLab->findObject("IsisCube") .findGroup("Instrument")["TargetName"][0]); if (target.toUpper() != "MARS") { - QString msg = "Input cube must from a HiRise image. The target = [" + std::string msg = "Input cube must from a HiRise image. The target = [" + target + "] is unsupported by hideal2pds."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -409,7 +409,7 @@ void updatePdsLabelImageObject(PvlObject *isisCubeLab, Pvl &pdsLabel) { // The given input cube is not supported for export to PDS. The AlphaCube // group values indicate that this cube has been not only cropped, but // also scaled (reduced or enlarged) - QString msg = "The AlphaCube group values of the input Isis cube indicate " + std::string msg = "The AlphaCube group values of the input Isis cube indicate " "that this cube has been scaled. Unable to export scaled " "cubes to PDS using hideal2pds."; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -495,7 +495,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, } else if ( !pdsLabel.hasKeyword("RATIONALE_DESC") || QString::fromStdString(pdsLabel["RATIONALE_DESC"]) == "NULL" ){ - QString msg = "Unable to export HiRise product to PDS without " + std::string msg = "Unable to export HiRise product to PDS without " "RationaleDescription value. The input cube value for this " "keyword is Null, the user is required to enter a value."; throw IException(IException::Unknown, msg, _FILEINFO_); diff --git a/isis/src/mro/apps/hidestripe/main.cpp b/isis/src/mro/apps/hidestripe/main.cpp index 5ccae19f07..589498db17 100644 --- a/isis/src/mro/apps/hidestripe/main.cpp +++ b/isis/src/mro/apps/hidestripe/main.cpp @@ -62,7 +62,7 @@ void IsisMain() { //Check to make sure we got the cube properly if(!inputCube.isOpen()) { - QString msg = "Could not open FROM cube" + fromFile.expanded(); + std::string msg = "Could not open FROM cube" + fromFile.expanded(); throw IException(IException::User, msg, _FILEINFO_); } @@ -102,7 +102,7 @@ void IsisMain() { if(totalSamples != phases[3]) { QString required_samples(QString::number(phases[3])); QString bin_QString(QString::number(binning_mode)); - QString msg = "image must have exactly "; + std::string msg = "image must have exactly "; msg += required_samples; msg += " samples per line for binning mode "; msg += bin_QString; diff --git a/isis/src/mro/apps/hidtmgen/hidtmgen.cpp b/isis/src/mro/apps/hidtmgen/hidtmgen.cpp index b2843c675e..fe3ea5e2ca 100644 --- a/isis/src/mro/apps/hidtmgen/hidtmgen.cpp +++ b/isis/src/mro/apps/hidtmgen/hidtmgen.cpp @@ -491,7 +491,7 @@ namespace Isis{ pdsLabel.setFormatTemplate("$ISISROOT/appdata/translations/MroHirisePdsDTMPolar.pft"); } else { - QString msg = "The projection type [" + + std::string msg = "The projection type [" + projectionType + "] is not supported"; throw IException(IException::User, msg, _FILEINFO_); @@ -644,7 +644,7 @@ namespace Isis{ } // It was negative, or something else crazy? else { - QString msg = "Version number [" + toString(version) + "] is invalid"; + std::string msg = "Version number [" + toString(version) + "] is invalid"; throw IException(IException::User, msg, _FILEINFO_); } return vers; @@ -654,7 +654,7 @@ namespace Isis{ QString producingInstitution(const Pvl ¶msPvl, const UserInterface &ui) { QString producing = QString::fromStdString(paramsPvl["PRODUCING_INSTITUTION"][0]); if (producing.size() > 1) { - QString msg = "PRODUCING_INSTITUTION value [" + producing + "] in the PARAMSPVL file must be a " + std::string msg = "PRODUCING_INSTITUTION value [" + producing + "] in the PARAMSPVL file must be a " "single character. See hidtmgen documentation for these character codes."; throw IException(IException::User, msg, _FILEINFO_); } @@ -672,7 +672,7 @@ namespace Isis{ colorCode = "IRB"; } else { - QString msg = "The file [" + orthoFileName.expanded() + "] found in the ORTHOFROMLIST " + std::string msg = "The file [" + orthoFileName.expanded() + "] found in the ORTHOFROMLIST " "is not a valid orthorectified image. Band count must be 1 (RED) or 3 (color)."; throw IException(IException::User, msg, _FILEINFO_); } @@ -721,7 +721,7 @@ namespace Isis{ void verifyDTM(Cube *inCube, const FileName &inputCubeFile) { if (inCube->bandCount() > 1 || inCube->label()->hasObject("Instrument")) { - QString msg = "Input cube [" + inputCubeFile.expanded() + "] does not appear " + std::string msg = "Input cube [" + inputCubeFile.expanded() + "] does not appear " + "to be a DTM"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mro/apps/hifringe/main.cpp b/isis/src/mro/apps/hifringe/main.cpp index a50f95cd70..f05f0dc5fa 100644 --- a/isis/src/mro/apps/hifringe/main.cpp +++ b/isis/src/mro/apps/hifringe/main.cpp @@ -56,7 +56,7 @@ void IsisMain() { //Check to make sure we got the cube properly if(!inputCube.isOpen()) { - QString msg = "Could not open FROM cube" + fromFile.expanded(); + std::string msg = "Could not open FROM cube" + fromFile.expanded(); throw IException(IException::User, msg, _FILEINFO_); } Process p; @@ -78,7 +78,7 @@ void IsisMain() { int numSections = ui.GetInteger("SECTIONS"); if(numSections > 9) { - QString msg = "You may have no more than 9 sections per side"; + std::string msg = "You may have no more than 9 sections per side"; throw IException(IException::User, msg, _FILEINFO_); } @@ -178,7 +178,7 @@ void IsisMain() { Pvl outputPvl; PvlGroup sourceInfo("SourceInfo"); - sourceInfo += PvlKeyword("From", fromFile.expanded().toStdString()); + sourceInfo += PvlKeyword("From", fromFile.expanded()); sourceInfo += icube->group("Archive")["ProductId"]; outputPvl.addGroup(sourceInfo); if(numSections > 0) { diff --git a/isis/src/mro/apps/hijitreg/HiJitCube.cpp b/isis/src/mro/apps/hijitreg/HiJitCube.cpp index dc6d4d2770..41afe60f0e 100644 --- a/isis/src/mro/apps/hijitreg/HiJitCube.cpp +++ b/isis/src/mro/apps/hijitreg/HiJitCube.cpp @@ -186,7 +186,7 @@ namespace Isis { scs2e_c(-74999, scStartTimeString.toLatin1().data(), &jdata.obsStartTime); NaifStatus::CheckErrors(); } catch (IException &e) { - QString message = "Start time of the image can not be determined."; + std::string message = "Start time of the image can not be determined."; throw IException(e, IException::User, message, _FILEINFO_); } } diff --git a/isis/src/mro/apps/hijitreg/main.cpp b/isis/src/mro/apps/hijitreg/main.cpp index 85d2db9011..32f069d423 100644 --- a/isis/src/mro/apps/hijitreg/main.cpp +++ b/isis/src/mro/apps/hijitreg/main.cpp @@ -108,7 +108,7 @@ void IsisMain() { // Ensure only one band if ((trans.bandCount() != 1) || (match.bandCount() != 1)) { - QString msg = "Input Cubes must have only one band!"; + std::string msg = "Input Cubes must have only one band!"; throw IException(IException::User, msg, _FILEINFO_); } @@ -117,7 +117,7 @@ void IsisMain() { // Determine intersection if (!trans.intersects(match)) { - QString msg = "Input Cubes do not overlap!"; + std::string msg = "Input Cubes do not overlap!"; throw IException(IException::User, msg, _FILEINFO_); } @@ -144,7 +144,7 @@ void IsisMain() { // of the grid points. Pvl regdef; FileName regFile(ui.GetFileName("REGDEF")); - regdef.read(regFile.expanded().toStdString()); + regdef.read(regFile.expanded()); AutoReg *ar = AutoRegFactory::Create(regdef); diff --git a/isis/src/mro/apps/hijitter/main.cpp b/isis/src/mro/apps/hijitter/main.cpp index 5a1f994ccb..ddb0b2a74c 100644 --- a/isis/src/mro/apps/hijitter/main.cpp +++ b/isis/src/mro/apps/hijitter/main.cpp @@ -246,7 +246,7 @@ void IsisMain() { ProgramLauncher::RunIsisProgram("ckwriter", params); } catch(IException &e) { - QString msg = "Creation of the output ck, " + + std::string msg = "Creation of the output ck, " + ui.GetFileName("JITTERCK") + " failed."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -327,11 +327,11 @@ void IsisMain() { */ FileName masterCcdFileName(FileList &inList, int masterCcdNumber) { if (g_ccdFiles.empty()) { - QString msg = "Global variables are not initialized."; + std::string msg = "Global variables are not initialized."; throw IException(IException::Programmer, msg, _FILEINFO_); } if (!g_ccdFiles.empty() && g_ccdFiles[masterCcdNumber].isEmpty()) { - QString msg = "File containing master CCD [" + toString(masterCcdNumber) + "] is not in the input file list."; + std::string msg = "File containing master CCD [" + toString(masterCcdNumber) + "] is not in the input file list."; throw IException(IException::User, msg, _FILEINFO_); } return g_ccdFiles[masterCcdNumber]; @@ -347,7 +347,7 @@ FileName masterCcdFileName(FileList &inList, int masterCcdNumber) { void init(FileList &inList) { if (!g_ccdFiles.empty()) { - QString msg = "Global variable have already been initialized."; + std::string msg = "Global variable have already been initialized."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -358,7 +358,7 @@ void init(FileList &inList) { for (int i = 0; i < inList.size(); i++) { try { FileName currentFileName(inList[i]); - Pvl labels(currentFileName.expanded().toStdString()); + Pvl labels(currentFileName.expanded()); PvlGroup &inst = labels.findGroup("Instrument", Pvl::Traverse); QString ccdKeywordValue = QString::fromStdString(inst["CcdId"]); @@ -373,14 +373,14 @@ void init(FileList &inList) { ccdNumber = (int) toInt((QString)ccdKeywordValue.mid(2)); } else { - QString msg = "CcdId value of [" + ccdKeywordValue + "] found in [" + std::string msg = "CcdId value of [" + ccdKeywordValue + "] found in [" + inList[i].toString() + "] not supported. Valid values " "include RED0-RED9, IR10-IR11, BG12-BG13"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (ccdNumber < 0 || ccdNumber > 13) { - QString msg = "CcdId value of [" + ccdKeywordValue + "] found in [" + std::string msg = "CcdId value of [" + ccdKeywordValue + "] found in [" + inList[i].toString() + "] not supported. Valid values " "include RED0-RED9, IR10-IR11, BG12-BG13"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -396,7 +396,7 @@ void init(FileList &inList) { g_numFiles++; } else { // last CCD number was larger than this CCD number - QString msg = "The input file list must be in ascending order from RED0 to BG13"; + std::string msg = "The input file list must be in ascending order from RED0 to BG13"; throw IException(IException::User, msg, _FILEINFO_); } @@ -404,7 +404,7 @@ void init(FileList &inList) { g_ccdNumbers.push_back(ccdNumber); } catch(IException &e) { - QString msg = "File [" + inList[i].toString() + "] is not a valid MRO cube"; + std::string msg = "File [" + inList[i].toString() + "] is not a valid MRO cube"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -425,7 +425,7 @@ void init(FileList &inList) { // lastRedCcdFound = toString(i-1); // } // else if (foundFirstRedCcd && foundLastRedCcd && !g_ccdFiles[i].empty()) { -// QString msg = "Invalid file list. All red CCDs listed must be consecutive. " +// std::string msg = "Invalid file list. All red CCDs listed must be consecutive. " // "Input list has files containing [RED" + lastRedCcdFound // + "] and [RED" + toString((int)i) + "], but the CCDs between " // "are not represented in the given file list."; @@ -433,7 +433,7 @@ void init(FileList &inList) { // } // } // if ( foundFirstRedCcd && !foundLastRedCcd ) { -// QString msg = "Invalid file list. Adjacent CCD not in the input file list " +// std::string msg = "Invalid file list. Adjacent CCD not in the input file list " // "for [RED" + g_firstFilter + "]."; // throw IException(IException::User, msg, _FILEINFO_); // } @@ -474,7 +474,7 @@ void init(FileList &inList) { overlappingCcds = "CCDs [RED" + toString((int) (i-1)) + "] and [RED" + toString((int) (i+1)) + "] are"; } - QString msg = "Invalid file list. A file containing the CCD [" + color + std::string msg = "Invalid file list. A file containing the CCD [" + color + toString((int) i) + "] is in the input file list, " "but adjacent " + overlappingCcds + " not in the list."; throw IException(IException::User, msg, _FILEINFO_); @@ -597,7 +597,7 @@ void processNoprojFiles(Pipeline &p) { } } catch(IException &e) { - //QString msg = "Unable to find average sample/line offsets in hijitreg results for CCDs [" + toString(i) + "-" + toString(i+1) + "]"; + //std::string msg = "Unable to find average sample/line offsets in hijitreg results for CCDs [" + toString(i) + "-" + toString(i+1) + "]"; //throw iException::Message(e, iException::Programmer, msg, _FILEINFO_); // numOffsets--; continue; // to next file in for loop @@ -608,7 +608,7 @@ void processNoprojFiles(Pipeline &p) { } if (offsetIndices.size() == 0) { - QString msg = "Unable to calculate average sample/line offsets from hijitreg results"; + std::string msg = "Unable to calculate average sample/line offsets from hijitreg results"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/mro/apps/himos/himos.cpp b/isis/src/mro/apps/himos/himos.cpp index 29cb07521e..781828c7fd 100644 --- a/isis/src/mro/apps/himos/himos.cpp +++ b/isis/src/mro/apps/himos/himos.cpp @@ -38,7 +38,7 @@ namespace Isis { vector clist; try { if(flist.size() < 1) { - QString msg = "the list file [" + ui.GetFileName("FROMLIST") + + std::string msg = "the list file [" + ui.GetFileName("FROMLIST") + "does not contain any data"; throw IException(IException::User, msg, _FILEINFO_); } @@ -172,7 +172,7 @@ namespace Isis { } } if(runXY) { - QString msg = "Camera did not intersect images to gather stats"; + std::string msg = "Camera did not intersect images to gather stats"; throw IException(IException::User, msg, _FILEINFO_); } @@ -285,7 +285,7 @@ namespace Isis { delete clist[i]; } std::cout << e.what() << '\n'; - QString msg = "The mosaic [" + ui.GetCubeName("TO") + "] was NOT created"; + std::string msg = "The mosaic [" + ui.GetCubeName("TO") + "] was NOT created"; throw IException(IException::User, msg, _FILEINFO_); } } // end of isis main @@ -299,7 +299,7 @@ namespace Isis { QString obsComp = QString::fromStdString(compgrp["ObservationId"]); if(obsMatch != obsComp) { - QString msg = "Images not from the same observation"; + std::string msg = "Images not from the same observation"; throw IException(IException::User, msg, _FILEINFO_); } @@ -310,7 +310,7 @@ namespace Isis { QString bandComp = QString::fromStdString(bcompgrp["Name"]); if(bandMatch != bandComp) { - QString msg = "Images not the same filter"; + std::string msg = "Images not the same filter"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/mro/apps/hirdrgen/main.cpp b/isis/src/mro/apps/hirdrgen/main.cpp index 3777ea8c42..8e38645913 100644 --- a/isis/src/mro/apps/hirdrgen/main.cpp +++ b/isis/src/mro/apps/hirdrgen/main.cpp @@ -47,7 +47,7 @@ void IsisMain() { // Check to see if the input cube looks like a HiRISE RDR if (icube->bandCount() > 3) { - QString msg = "Input file [" + + std::string msg = "Input file [" + Application::GetUserInterface().GetCubeName("FROM") + "] does not appear to be a HiRISE RDR product. Number of " + "bands is greater than 3"; diff --git a/isis/src/mro/apps/hisharpen/main.cpp b/isis/src/mro/apps/hisharpen/main.cpp index d95b9713b7..b2e83c3f00 100644 --- a/isis/src/mro/apps/hisharpen/main.cpp +++ b/isis/src/mro/apps/hisharpen/main.cpp @@ -146,19 +146,19 @@ void CreatePsf(Pipeline &p) { QString instrument = QString::fromStdString(instGrp["InstrumentId"]); if(instrument != "HIRISE") { - QString message = "This program is meant to be run on HiRISE images only, found " + std::string message = "This program is meant to be run on HiRISE images only, found " "[InstrumentId] to be [" + instrument + "] and was expecting [HIRISE]"; throw IException(IException::User, message, _FILEINFO_); } } catch(IException &e) { - QString message = "The [FROM] file is not a valid HIRISE cube. " + std::string message = "The [FROM] file is not a valid HIRISE cube. " "Please make sure it was imported using hi2isis."; throw IException(IException::User, message, _FILEINFO_); } if(fromCube.lineCount() != fromCube.sampleCount()) { - QString message = "This program only works on square cubes, the number of samples [" + + std::string message = "This program only works on square cubes, the number of samples [" + QString::number(fromCube.sampleCount()) + "] must match the number of lines [" + QString::number(fromCube.lineCount()) + "]"; throw IException(IException::User, message, _FILEINFO_); @@ -178,7 +178,7 @@ void CreatePsf(Pipeline &p) { psfFile += "IR"; } else { - QString message = "The filter [" + filter + "] does not have a default point spread function. Please provide one using the [PSF] parameter."; + std::string message = "The filter [" + filter + "] does not have a default point spread function. Please provide one using the [PSF] parameter."; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -188,13 +188,13 @@ void CreatePsf(Pipeline &p) { psfCube.open(psfFile); if(psfCube.lineCount() > fromCube.lineCount()) { - QString message = "The input cube dimensions must be at least [" + QString::number(psfCube.lineCount()); + std::string message = "The input cube dimensions must be at least [" + QString::number(psfCube.lineCount()); message += "] pixels in the line and sample dimensions"; throw IException(IException::User, message, _FILEINFO_); } if(!IsPowerOf2(fromCube.lineCount())) { - QString message = "The input cube dimensions must be a power of 2 (found [" + + std::string message = "The input cube dimensions must be a power of 2 (found [" + QString::number(fromCube.lineCount()) + "])"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/mro/apps/histat/main.cpp b/isis/src/mro/apps/histat/main.cpp index b21a69c211..0f73200aef 100644 --- a/isis/src/mro/apps/histat/main.cpp +++ b/isis/src/mro/apps/histat/main.cpp @@ -65,7 +65,7 @@ void IsisMain() { //Check to make sure we got the cube properly if(!inputCube.isOpen()) { - QString msg = "Could not open FROM cube " + fromFile.expanded(); + std::string msg = "Could not open FROM cube " + fromFile.expanded(); throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mro/apps/histitch/main.cpp b/isis/src/mro/apps/histitch/main.cpp index 89313425d4..c8d723e54e 100644 --- a/isis/src/mro/apps/histitch/main.cpp +++ b/isis/src/mro/apps/histitch/main.cpp @@ -148,7 +148,7 @@ void IsisMain() { fromData[0].add = HiVector(icube1->lineCount(), 0.0); if(seamSize + skipSize > icube1->sampleCount()) { - QString msg = "SEAMSIZE [" + toString(seamSize) + "] + SKIP [" + toString(skipSize) + "] must "; + std::string msg = "SEAMSIZE [" + toString(seamSize) + "] + SKIP [" + toString(skipSize) + "] must "; msg += " be less than the number of samples [" + toString(icube1->sampleCount()) + "] in "; msg += "[" + ui.GetAsString("FROM1") + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -181,7 +181,7 @@ void IsisMain() { fromData[1].add = HiVector(icube2->lineCount(), 0.0); if(seamSize + skipSize > icube2->sampleCount()) { - QString msg = "SEAMSIZE [" + toString(seamSize) + "] + SKIP [" + toString(skipSize) + "] must "; + std::string msg = "SEAMSIZE [" + toString(seamSize) + "] + SKIP [" + toString(skipSize) + "] must "; msg += " be less than the number of samples [" + toString(icube2->sampleCount()) + " in "; msg += "[" + ui.GetAsString("FROM2") + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -194,7 +194,7 @@ void IsisMain() { QString from1ObsId = QString::fromStdString(from1Archive["ObservationId"]); QString from2ObsId = QString::fromStdString(from2Archive["ObservationId"]); if(from1ObsId != from2ObsId) { - QString msg = "The input files Observation Id's are not compatable"; + std::string msg = "The input files Observation Id's are not compatable"; throw IException(IException::User, msg, _FILEINFO_); } stitchedProductIds = "(" + stitchedProductIds + ", " + diff --git a/isis/src/mro/apps/marci2isis/marci2isis.cpp b/isis/src/mro/apps/marci2isis/marci2isis.cpp index 673d9b72ad..7dc8837438 100644 --- a/isis/src/mro/apps/marci2isis/marci2isis.cpp +++ b/isis/src/mro/apps/marci2isis/marci2isis.cpp @@ -58,9 +58,9 @@ namespace Isis{ FileName inFile = ui.GetFileName("FROM"); //Checks if in file is rdr - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); if(lab.hasObject("IMAGE_MAP_PROJECTION")) { - QString msg = "[" + inFile.name() + "] appears to be an rdr file."; + std::string msg = "[" + inFile.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -199,7 +199,7 @@ namespace Isis{ // Now, compare product ids from the input image and from the calibration table. if(fileProdId == prodId ) { if((row.dim1() - 1) != 2) { - QString msg = "This appears to be a malformed calibration file."; + std::string msg = "This appears to be a malformed calibration file."; msg += " There are not enough columns in the CSV"; msg += " file to perform the exposure time correction."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/mro/apps/marcical/marcical.cpp b/isis/src/mro/apps/marcical/marcical.cpp index 460a4598e3..b053956be6 100644 --- a/isis/src/mro/apps/marcical/marcical.cpp +++ b/isis/src/mro/apps/marcical/marcical.cpp @@ -176,13 +176,13 @@ namespace Isis { } catch (IException &) { FileName inFileName = ui.GetCubeName("FROM"); - QString msg = "This program is intended for use on MARCI images only. ["; + std::string msg = "This program is intended for use on MARCI images only. ["; msg += inFileName.expanded() + "] does not appear to be a MARCI image."; throw IException(IException::User, msg, _FILEINFO_); } if (icube.group("Archive")["SampleBitModeId"][0] != "SQROOT") { - QString msg = "Sample bit mode [" + QString::fromStdString(icube.group("Archive")["SampleBitModeId"][0]) + "] is not supported."; + std::string msg = "Sample bit mode [" + QString::fromStdString(icube.group("Archive")["SampleBitModeId"][0]) + "] is not supported."; throw IException(IException::User, msg, _FILEINFO_); } @@ -226,7 +226,7 @@ namespace Isis { stretchPairs.Close(); // This file stores radiance/spectral distance coefficients - Pvl calibrationData(calFile.expanded().toStdString()); + Pvl calibrationData(calFile.expanded()); // This will store the radiance coefficient and solar spectral distance coefficients // for each band. @@ -236,7 +236,7 @@ namespace Isis { // Check our coefficient file if (calibrationData.objects() != 7) { - QString msg = "Calibration file [" + calFile.expanded() + "] must contain data for 7 filters in ascending order;"; + std::string msg = "Calibration file [" + calFile.expanded() + "] must contain data for 7 filters in ascending order;"; msg += " only [" + QString::number(calibrationData.objects()) + "] objects were found"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -246,7 +246,7 @@ namespace Isis { PvlObject calObj = calibrationData.object(obj); if ((int)calObj["FilterNumber"] != obj + 1) { - QString msg = "Calibration file [" + calFile.expanded() + "] must have the filters in ascending order"; + std::string msg = "Calibration file [" + calFile.expanded() + "] must have the filters in ascending order"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -324,7 +324,7 @@ namespace Isis { filter.push_back(filterNameToFilterNumber.find(QString::fromStdString(filtNames[i]))->second); } else { - QString msg = "Unrecognized filter name [" + QString::fromStdString(filtNames[i]) + "]"; + std::string msg = "Unrecognized filter name [" + QString::fromStdString(filtNames[i]) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -360,7 +360,7 @@ namespace Isis { PvlGroup inst = icube.group("Instrument"); if (!inst.hasKeyword("VariableExposureDuration") || !inst.hasKeyword("FrameNumber")) { - QString msg = "The instrument keywords VariableExposureDuration and FrameNumber" + std::string msg = "The instrument keywords VariableExposureDuration and FrameNumber" "must exist to calibrate this MARCI file. Prior to isis3.10.0 these" "keywords were not added by marci2isis; you may need to rerun isis3.10+" "marci2isis on your images."; diff --git a/isis/src/mro/apps/mroctx2isis/main.cpp b/isis/src/mro/apps/mroctx2isis/main.cpp index 3c59febd17..ba93dbcd7f 100644 --- a/isis/src/mro/apps/mroctx2isis/main.cpp +++ b/isis/src/mro/apps/mroctx2isis/main.cpp @@ -45,10 +45,10 @@ void IsisMain() { bool projected; { - QString msg; + std::string msg; try { msg = "File could not be opened."; - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); msg = "PVL Keyword [DATA_SET_ID] not found in label."; id = QString::fromStdString(lab.findKeyword("DATA_SET_ID")); @@ -85,7 +85,7 @@ void IsisMain() { //Checks if in file is rdr if(projected) { - QString msg = "[" + inFile.name() + "] appears to be an rdr file."; + std::string msg = "[" + inFile.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } @@ -94,7 +94,7 @@ void IsisMain() { id.Compress(); id.Trim(" "); if(id != "MRO-M-CTX-2-EDR-L0-V1.0") { - QString msg = "Input file [" + inFile.expanded() + "] does not appear to be " + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be " + "in MRO-CTX EDR format. DATA_SET_ID is [" + id.ToQt() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -229,7 +229,7 @@ void TranslateMroCtxLabels(FileName &labelFile, Cube *ocube) { //Pvl to store the labels Pvl outLabel; QString transDir = "$ISISROOT/appdata/translations/"; - Pvl labelPvl(labelFile.expanded().toStdString()); + Pvl labelPvl(labelFile.expanded()); //Translate the Instrument group FileName transFile(transDir + "MroCtxInstrument.trn"); @@ -251,7 +251,7 @@ void TranslateMroCtxLabels(FileName &labelFile, Cube *ocube) { PvlGroup kern("Kernels"); kern += PvlKeyword("NaifFrameCode", std::to_string(-74021)); - Pvl lab(labelFile.expanded().toStdString()); + Pvl lab(labelFile.expanded()); int sumMode, startSamp; if(lab.hasKeyword("SPATIAL_SUMMING")) { sumMode = (int)lab.findKeyword("SPATIAL_SUMMING"); diff --git a/isis/src/mro/apps/pds2hideal/main.cpp b/isis/src/mro/apps/pds2hideal/main.cpp index f9c549a936..68f87aa22a 100644 --- a/isis/src/mro/apps/pds2hideal/main.cpp +++ b/isis/src/mro/apps/pds2hideal/main.cpp @@ -36,7 +36,7 @@ void IsisMain() { QString instId = QString::fromStdString(pdsLabelPvl["INSTRUMENT_ID"][0]); if(instId != "HIRISE_IDEAL_CAMERA") { - QString msg = "Invalid PDS label [" + from.expanded() + "]. The PDS product" + std::string msg = "Invalid PDS label [" + from.expanded() + "]. The PDS product" " must be from an Ideal camera model derived from a HiRISE" " image. The INSTRUMENT_ID = [" + instId + "] is unsupported" " by pds2hideal."; diff --git a/isis/src/mro/objs/HiCal/HiCalConf.cpp b/isis/src/mro/objs/HiCal/HiCalConf.cpp index cdf3a05148..a496d0ebbc 100644 --- a/isis/src/mro/objs/HiCal/HiCalConf.cpp +++ b/isis/src/mro/objs/HiCal/HiCalConf.cpp @@ -330,7 +330,7 @@ bool HiCalConf::_naifLoaded = false; NaifStatus::CheckErrors(); } catch(IException &e) { - QString msg = "Unable to determine the distance from the target to the sun"; + std::string msg = "Unable to determine the distance from the target to the sun"; throw IException(e, IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/mro/objs/HiCal/HiCalUtil.h b/isis/src/mro/objs/HiCal/HiCalUtil.h index 69aa0cfbb5..f957336cfb 100644 --- a/isis/src/mro/objs/HiCal/HiCalUtil.h +++ b/isis/src/mro/objs/HiCal/HiCalUtil.h @@ -61,7 +61,7 @@ inline int InValidCount(const HiVector &v) { inline int CpmmToCcd(int cpmm) { const int cpmm2ccd[] = {0,1,2,3,12,4,10,11,5,13,6,7,8,9}; if ( (cpmm < 0) || (cpmm >= (int)(sizeof(cpmm2ccd)/sizeof(int))) ) { - QString mess = "CpmmToCdd: Bad CpmmNumber (" + toString(cpmm) + ")"; + std::string mess = "CpmmToCdd: Bad CpmmNumber (" + toString(cpmm) + ")"; throw IException(IException::User, mess, _FILEINFO_); } return (cpmm2ccd[cpmm]); @@ -75,7 +75,7 @@ inline int CpmmToCcd(int cpmm) { */ inline QString CcdToFilter(int ccd) { if ( (ccd < 0) || (ccd > 13) ) { - QString mess = "CcdToFilter: Bad Ccd Number (" + toString(ccd) + ")"; + std::string mess = "CcdToFilter: Bad Ccd Number (" + toString(ccd) + ")"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/mro/objs/HiCal/LoadCSV.cpp b/isis/src/mro/objs/HiCal/LoadCSV.cpp index f779cb8852..14f7ee9db5 100644 --- a/isis/src/mro/objs/HiCal/LoadCSV.cpp +++ b/isis/src/mro/objs/HiCal/LoadCSV.cpp @@ -70,7 +70,7 @@ namespace Isis { try { csv.read(csvfile); } catch (IException &ie) { - QString mess = "Could not read CSV file \'" + csvfile + "\'"; + std::string mess = "Could not read CSV file \'" + csvfile + "\'"; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -89,7 +89,7 @@ namespace Isis { CSVReader::CSVAxis chead = csv.getHeader(); startColumn = getAxisIndex(colName, chead); if (startColumn < 0) { - QString mess = "Column name " + colName + + std::string mess = "Column name " + colName + " not found in CSV file " + csvfile; throw IException(IException::User, mess, _FILEINFO_); } @@ -109,13 +109,13 @@ namespace Isis { if (!rowName.isEmpty()) { addHistory("RowName", rowName); if (!rowHeader) { - QString mess = "Row name given but config does not specify presence of row header!"; + std::string mess = "Row name given but config does not specify presence of row header!"; throw IException(IException::User, mess, _FILEINFO_); } CSVReader::CSVAxis rhead = csv.getColumn(0); startRow = getAxisIndex(rowName, rhead); if (startRow < 0) { - QString mess = "Row name " + rowName + " not found in CSV file " + csvfile; + std::string mess = "Row name " + rowName + " not found in CSV file " + csvfile; throw IException(IException::User, mess, _FILEINFO_); } endRow = startRow; diff --git a/isis/src/mro/objs/HiCal/Module.h b/isis/src/mro/objs/HiCal/Module.h index 37c1ebea55..5844c8c713 100644 --- a/isis/src/mro/objs/HiCal/Module.h +++ b/isis/src/mro/objs/HiCal/Module.h @@ -133,7 +133,7 @@ namespace Isis { QString dumpcFile = dumpc.expanded(); std::ofstream ofile(dumpcFile.toLatin1().data(), std::ios::out); if (!ofile) { - QString mess = "Unable to open/create module dump file " + + std::string mess = "Unable to open/create module dump file " + dumpc.expanded(); throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/mro/objs/HiCal/ZeroDarkRate.h b/isis/src/mro/objs/HiCal/ZeroDarkRate.h index 802575af8b..d7a56effe9 100644 --- a/isis/src/mro/objs/HiCal/ZeroDarkRate.h +++ b/isis/src/mro/objs/HiCal/ZeroDarkRate.h @@ -99,12 +99,12 @@ namespace Isis { // 2.483618177203812394e+00,2.255885064806690821e-01,5.617339162650616345e+03 _coeffMat = LoadCSV("DarkRate", conf, prof).getMatrix(); if (_coeffMat.dim2() != 3) { - QString msg = "Zero Dark Rate coefficient CSV has [" + toString(_coeffMat.dim2()) + + std::string msg = "Zero Dark Rate coefficient CSV has [" + toString(_coeffMat.dim2()) + "] columns, expected 3."; throw IException(IException::User, msg, _FILEINFO_); } if (_coeffMat.dim1() != samples) { - QString msg = "Zero Dark Rate coefficient CSV has [" + toString(_coeffMat.dim1()) + + std::string msg = "Zero Dark Rate coefficient CSV has [" + toString(_coeffMat.dim1()) + "] rows, expected " + toString(samples) + "."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mro/objs/HiEqualization/HiEqualization.cpp b/isis/src/mro/objs/HiEqualization/HiEqualization.cpp index 3f77f4e6ca..81722b9637 100644 --- a/isis/src/mro/objs/HiEqualization/HiEqualization.cpp +++ b/isis/src/mro/objs/HiEqualization/HiEqualization.cpp @@ -117,7 +117,7 @@ namespace Isis { // Ensures number of images is within bound if (imageList.size() > 10) { - QString msg = "The input file [" + fromListName + + std::string msg = "The input file [" + fromListName + "] cannot contain more than 10 file names"; throw IException(IException::User, msg, _FILEINFO_); } @@ -140,14 +140,14 @@ namespace Isis { movedIndices.push_back(i); } catch (IException &e) { - QString msg = "The [" + imageList[i].toString() + + std::string msg = "The [" + imageList[i].toString() + "] file is not a valid HiRise image"; throw IException(e, IException::User, msg, _FILEINFO_); } catch (...) { // If any part of the above didn't work, we can safely assume the // current file is not a valid HiRise image - QString msg = "The [" + imageList[i].toString() + + std::string msg = "The [" + imageList[i].toString() + "] file is not a valid HiRise image"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/mro/objs/MarciCamera/MarciCamera.cpp b/isis/src/mro/objs/MarciCamera/MarciCamera.cpp index e1b59c9fa4..bbb0a00cc2 100644 --- a/isis/src/mro/objs/MarciCamera/MarciCamera.cpp +++ b/isis/src/mro/objs/MarciCamera/MarciCamera.cpp @@ -104,7 +104,7 @@ namespace Isis { for(int i = 0; i < filtNames.size(); i++) { if(filterToDetectorOffset.find(QString::fromStdString(filtNames[i])) == filterToDetectorOffset.end()) { - QString msg = "Unrecognized filter name [" + QString::fromStdString(filtNames[i]) + "]"; + std::string msg = "Unrecognized filter name [" + QString::fromStdString(filtNames[i]) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/near/apps/msi2isis/msi2isis.cpp b/isis/src/near/apps/msi2isis/msi2isis.cpp index e7431e54a2..cbd4c6fd6f 100644 --- a/isis/src/near/apps/msi2isis/msi2isis.cpp +++ b/isis/src/near/apps/msi2isis/msi2isis.cpp @@ -78,7 +78,7 @@ namespace Isis { int lines = std::stoi(inputLabelPvl.findObject("IMAGE")["LINES"][0]); int samples = std::stoi(inputLabelPvl.findObject("IMAGE")["LINE_SAMPLES"][0]); if ( ( (lines != 244) && (lines != 412) ) || samples != 537) { - QString msg = "The given file [" + from.expanded() + "] does not contain " + std::string msg = "The given file [" + from.expanded() + "] does not contain " "a full MSI image. Full NEAR Shoemaker MSI images have " "dimension 537 samples x 244 (or 412) lines. The given image is [" + QString(toString(samples)) + "] samples by [" @@ -86,7 +86,7 @@ namespace Isis { throw IException(IException::Io, msg, _FILEINFO_); } if (inputLabelPvl["SAMPLE_DISPLAY_DIRECTION"][0] != "RIGHT") { - QString msg = "The input label [" + from.expanded() + "] has an invalid " + std::string msg = "The input label [" + from.expanded() + "] has an invalid " "value for SAMPLE_DISPLAY_DIRECTION = [" + QString::fromStdString(inputLabelPvl["SAMPLE_DISPLAY_DIRECTION"][0]) + "]. The msi2isis program requires " @@ -94,7 +94,7 @@ namespace Isis { throw IException(IException::Io, msg, _FILEINFO_); } if (inputLabelPvl["LINE_DISPLAY_DIRECTION"][0] != "UP") { - QString msg = "The input label [" + from.expanded() + "] has an invalid " + std::string msg = "The input label [" + from.expanded() + "] has an invalid " "value for LINE_DISPLAY_DIRECTION = [" + QString::fromStdString(inputLabelPvl["LINE_DISPLAY_DIRECTION"][0]) + "]. The msi2isis program requires " @@ -103,7 +103,7 @@ namespace Isis { } // Don't import projected image if(inputLabelPvl.hasObject("IMAGE_MAP_PROJECTION")) { - QString msg = "Unable to import the NEAR Shoemaker MSI image from [" + std::string msg = "Unable to import the NEAR Shoemaker MSI image from [" + from.expanded() + "] using msi2isis.This program only " "imports images that have not been projected. Use pds2isis. "; throw IException(IException::Io, msg, _FILEINFO_); @@ -191,7 +191,7 @@ namespace Isis { catch ( IException &e) { remove(importProcessOutCube.expanded().toLatin1()); remove(enlargeProcessOutCube.expanded().toLatin1()); - QString msg = "Unable to translate the labels from [" + from.expanded() + std::string msg = "Unable to translate the labels from [" + from.expanded() + "] to ISIS format using msi2isis."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp b/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp index 7328c38206..bd86d87a5a 100644 --- a/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp +++ b/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp @@ -40,13 +40,13 @@ namespace Isis { // Get the first label and make sure this is a New Horizons LEISA file if (!mainLabel.hasKeyword("MISSION") || !mainLabel.hasKeyword("INSTRU")) { - QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " + std::string msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " "file. Input file label key MISSION or INSTRU is missing"). arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } else if (mainLabel["MISSION"][0] != "New Horizons" || mainLabel["INSTRU"][0] != "lei") { - QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " + std::string msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " "file. Input file label value for MISSION is [%2], INSTRU is [%3]"). arg(ui.GetFileName("FROM")).arg(QString::fromStdString(mainLabel["MISSION"][0])). arg(QString::fromStdString(mainLabel["INSTRU"][0])); @@ -62,26 +62,26 @@ namespace Isis { try { extensionLabel = importFits.fitsImageLabel(5); /** if (!extensionLabel.hasKeyword("XTENSION")) { - QString msg = QObject::tr("Input file [%1] does not appear to be a calibrated New Horizons " + std::string msg = QObject::tr("Input file [%1] does not appear to be a calibrated New Horizons " "LEISA FITS file. XTENSION keyword is missing in the fifth extension.") .arg(ui.GetFileName("FROM")); throw IException(IException::Unknown, msg, _FILEINFO_); } if (!extensionLabel.hasKeyword("EXTNAME")) { - QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " + std::string msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label keyword EXTNAME is missing in the fifth extension"). arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } else if (extensionLabel["EXTNAME"][0] != "ERRORMAP") { - QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " + std::string msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label value for EXTNAME is [%2]"). arg(ui.GetFileName("FROM")).arg(extensionLabel["EXTNAME"][0]); throw IException(IException::User, msg, _FILEINFO_); } **/ } catch (IException &e) { - QString msg = QObject::tr("Unable to find errormap extension in [%1]").arg(ui.GetFileName("FROM")); + std::string msg = QObject::tr("Unable to find errormap extension in [%1]").arg(ui.GetFileName("FROM")); throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -94,26 +94,26 @@ namespace Isis { try { extensionLabel = importFits.fitsImageLabel(6); /** if (!extensionLabel.hasKeyword("XTENSION")) { - QString msg = QObject::tr("Input file [%1] does not appear to be a calibrated New Horizons " + std::string msg = QObject::tr("Input file [%1] does not appear to be a calibrated New Horizons " "LEISA FITS file. XTENSION keyword is missing in the sixth extension.") .arg(ui.GetFileName("FROM")); throw IException(IException::Unknown, msg, _FILEINFO_); } if (!extensionLabel.hasKeyword("EXTNAME")) { - QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " + std::string msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label keyword EXTNAME is missing in the sixth extension"). arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } else if (extensionLabel["EXTNAME"][0] != "QUALITY") { - QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " + std::string msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label value for EXTNAME is [%2]"). arg(ui.GetFileName("FROM")).arg(extensionLabel["EXTNAME"][0]); throw IException(IException::User, msg, _FILEINFO_); } **/ } catch (IException &e) { - QString msg = QObject::tr("Unable to find quality extension in [%1]").arg(ui.GetFileName("FROM")); + std::string msg = QObject::tr("Unable to find quality extension in [%1]").arg(ui.GetFileName("FROM")); throw IException(e, IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp b/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp index d12ecb8dda..05b607c24d 100644 --- a/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp +++ b/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp @@ -35,7 +35,7 @@ namespace Isis { // Get the first label and make sure this is a New Horizons LORRI file PvlGroup mainLabel = importFits.fitsImageLabel(0); if (mainLabel["MISSION"][0] != "New Horizons" || mainLabel["INSTRU"][0] != "lor") { - QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LORRI FITS " + std::string msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LORRI FITS " "file. Input file label value for MISSION is [%2] and INSTRU is [%3]"). arg(ui.GetFileName("FROM")).arg(QString::fromStdString(mainLabel["MISSION"][0])).arg(QString::fromStdString(mainLabel["INSTRU"][0])); throw IException(IException::User, msg, _FILEINFO_); @@ -45,7 +45,7 @@ namespace Isis { if (ui.WasEntered("ERROR")) { PvlGroup errorLabel = importFits.fitsImageLabel(1); if (errorLabel["XTENSION"][0] != "IMAGE" || errorLabel["EXTNAME"][0] != "LORRI Error image") { - QString msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Error image. " + std::string msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Error image. " "Input file label value for EXTNAME is [%2] and XTENSION is [%3]"). arg(ui.GetFileName("FROM")).arg(QString::fromStdString(errorLabel["EXTNAME"][0])).arg(QString::fromStdString(errorLabel["XTENSION"][0])); throw IException(IException::User, msg, _FILEINFO_); @@ -57,7 +57,7 @@ namespace Isis { PvlGroup qualityLabel = importFits.fitsImageLabel(2); if (qualityLabel["XTENSION"][0] != "IMAGE" || qualityLabel["EXTNAME"][0] != "LORRI Quality flag image") { - QString msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Quality image. " + std::string msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Quality image. " "Input file label value for EXTNAME is [%2] and XTENSION is [%3]"). arg(ui.GetFileName("FROM")).arg(QString::fromStdString(qualityLabel["EXTNAME"][0])).arg(QString::fromStdString(qualityLabel["XTENSION"][0])); throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp b/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp index 66b90bc39c..d33e6aacd0 100644 --- a/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp +++ b/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp @@ -60,7 +60,7 @@ namespace Isis { if (!mvic) { FileName in = ui.GetFileName("FROM"); - QString msg = "Input file [" + in.expanded() + "] does not appear to be " + + std::string msg = "Input file [" + in.expanded() + "] does not appear to be " + "in New Horizons/MVIC FITS format."; throw IException(IException::User, msg, _FILEINFO_); } @@ -73,7 +73,7 @@ namespace Isis { !QString::fromStdString(undistortedLabel["COMMENT"][0]).startsWith("This is the bias-subtracted, " "flattened, distortion-removed image cube.")) { - QString msg = QObject::tr("Input file [%1] does not appear to contain an MVIC undistorted " + std::string msg = QObject::tr("Input file [%1] does not appear to contain an MVIC undistorted " "image in XTENSION [2]").arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } @@ -86,7 +86,7 @@ namespace Isis { if (!errorLabel.hasKeyword("COMMENT") || errorLabel["COMMENT"][0] != "1-sigma error per pixel for the image in extension 1.") { - QString msg = QObject::tr("Input file [%1] does not appear to contain an MVIC Error image " + std::string msg = QObject::tr("Input file [%1] does not appear to contain an MVIC Error image " "in the XTENSION [3]").arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } @@ -99,7 +99,7 @@ namespace Isis { if (!qualityLabel.hasKeyword("COMMENT") || qualityLabel["COMMENT"][0] != "Data quality flag for the image in extension 1.") { - QString msg = QObject::tr("Input file [%1] does not appear to contain an MVIC Quality image " + std::string msg = QObject::tr("Input file [%1] does not appear to contain an MVIC Quality image " "in extension [3]").arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } @@ -253,7 +253,7 @@ namespace Isis { sclkCode = fitslabel.findKeyword("SPCSCID", Pvl::Traverse); } else { - QString msg = "Input file is missing the spacecraft Naif Id."; + std::string msg = "Input file is missing the spacecraft Naif Id."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp index c632e393ff..ddf34bca3c 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp @@ -118,7 +118,7 @@ namespace Isis { */ void NewHorizonsLeisaCamera::SetBand(const int vband) { if ( (vband < 1) || (vband > m_originalBand.size())) { - QString msg = QObject::tr("Band number out of array bounds in NewHorizonsLeisaCamera::SetBand " + std::string msg = QObject::tr("Band number out of array bounds in NewHorizonsLeisaCamera::SetBand " "legal bands are [1-%1], input was [%2]"). arg(m_originalBand.size()).arg(vband); throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp index 4e9ef5bf23..e5ecc9e89a 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp @@ -52,7 +52,7 @@ namespace Isis { QString unitsKey = "INS" + toString(naifIkCode()) + "_FOCAL_LENGTH_UNITS"; QString focalLengthUnits = Spice::getString(unitsKey); if (focalLengthUnits != "mm") { - QString msg = QObject::tr("SPICE keyword [%1] is expected to be mm. [%2] was found instead"). + std::string msg = QObject::tr("SPICE keyword [%1] is expected to be mm. [%2] was found instead"). arg(unitsKey).arg(focalLengthUnits); throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp index 72b8db40e5..4f2fb21749 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp @@ -117,7 +117,7 @@ namespace Isis { void NewHorizonsMvicFrameCamera::SetBand(const int vband) { if(vband > (int) m_originalBand.size()) { - QString msg = QObject::tr("Band number out of array bounds in NewHorizonsMvicFrameCamera::SetBand legal " + std::string msg = QObject::tr("Band number out of array bounds in NewHorizonsMvicFrameCamera::SetBand legal " "bands are [1-%1], input was [%2]"). arg(m_originalBand.size()).arg(vband); throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp index c22208a5f0..6e9b0565a3 100644 --- a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp +++ b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp @@ -34,18 +34,18 @@ namespace Isis { // Make sure it is a Themis EDR/RDR bool projected; try { - Pvl lab(in.expanded().toStdString()); + Pvl lab(in.expanded()); projected = lab.hasObject("IMAGE_MAP_PROJECTION"); QString id; id = QString::fromStdString(lab["DATA_SET_ID"]); id = id.simplified().trimmed(); if(!id.startsWith("ODY-M-THM")) { - QString msg = "Invalid DATA_SET_ID [" + id + "]"; + std::string msg = "Invalid DATA_SET_ID [" + id + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } catch(IException &e) { - QString msg = "Input file [" + in.expanded() + + std::string msg = "Input file [" + in.expanded() + "] does not appear to be " + "in Themis EDR/RDR format"; throw IException(IException::Io, msg, _FILEINFO_); @@ -53,7 +53,7 @@ namespace Isis { //Checks if in file is rdr if(projected) { - QString msg = "[" + in.name() + "] appears to be an rdr file."; + std::string msg = "[" + in.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/odyssey/apps/thmbasemap1/main.cpp b/isis/src/odyssey/apps/thmbasemap1/main.cpp index 6611599096..b3f1f772ad 100644 --- a/isis/src/odyssey/apps/thmbasemap1/main.cpp +++ b/isis/src/odyssey/apps/thmbasemap1/main.cpp @@ -43,7 +43,7 @@ void IsisMain(){ cubes.read(ui.GetFileName("FROMLIST")); } else { - QString msg = "Error: FROMLIST file must be specified"; + std::string msg = "Error: FROMLIST file must be specified"; throw IException(IException::User, msg, _FILEINFO_); } @@ -169,7 +169,7 @@ void IsisMain(){ if (reportNoFile) { noFileListos << infile.baseName() << " not processed because is not a THEMIS image" << endl; } - QString msg = "Error: Not a Themis Image"; + std::string msg = "Error: Not a Themis Image"; throw IException(IException::User, msg, _FILEINFO_); } @@ -179,7 +179,7 @@ void IsisMain(){ if (reportNoFile) { noFileListos << infile.baseName() << " not processed because is not an IR THEMIS image" << endl; } - QString msg = "Error: Not an IR Themis Image"; + std::string msg = "Error: Not an IR Themis Image"; throw IException(IException::User, msg, _FILEINFO_); } @@ -211,7 +211,7 @@ void IsisMain(){ if (reportNoFile) { noFileListos << infile.baseName() << " not processed because is missing filter 12.57" << endl; } - QString msg = "Filter 12.57 not found in input file [" + inFileStr + "]"; + std::string msg = "Filter 12.57 not found in input file [" + inFileStr + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -266,7 +266,7 @@ void IsisMain(){ noFileListos << infile.baseName() << " not processed because average incidence angle >= 90 and DAY images requested" << endl; remove(output.toLatin1().data()); } - QString msg = "The average incidence angle of [" + cubes[i].toString() + "] is over 90"; + std::string msg = "The average incidence angle of [" + cubes[i].toString() + "] is over 90"; throw IException(IException::User, msg, _FILEINFO_); } @@ -286,7 +286,7 @@ void IsisMain(){ noFileListos << infile.baseName() << " not processed because average incidence angle < 90 and NIGHT images requested" << endl; remove(output.toLatin1().data()); } - QString msg = "The average incidence angle of [" + cubes[i].toString() + "] is over 90"; + std::string msg = "The average incidence angle of [" + cubes[i].toString() + "] is over 90"; throw IException(IException::User,msg,_FILEINFO_); } @@ -382,7 +382,7 @@ void IsisMain(){ double summing = 1; FileName tosum = FileName(outFile); - Pvl sumlab(tosum.expanded().toStdString()); + Pvl sumlab(tosum.expanded()); PvlGroup InstGrp = sumlab.findGroup("Instrument",Pvl::Traverse); if (InstGrp.hasKeyword("SpatialSumming")) { summing = InstGrp["SpatialSumming"]; diff --git a/isis/src/odyssey/apps/thmnoseam/main.cpp b/isis/src/odyssey/apps/thmnoseam/main.cpp index ae28cdffbe..0e11e8b40b 100644 --- a/isis/src/odyssey/apps/thmnoseam/main.cpp +++ b/isis/src/odyssey/apps/thmnoseam/main.cpp @@ -96,13 +96,13 @@ void IsisMain() { // Make sure it is a Themis EDR/RDR try { if(evenCube->group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") { - QString msg = "This program is intended for use on THEMIS VIS images only"; + std::string msg = "This program is intended for use on THEMIS VIS images only"; msg += " [" + ui.GetCubeName("INEVEN") + "] does not appear to be a "; msg += "THEMIS VIS image."; throw IException(IException::User, msg, _FILEINFO_); } if (evenCube->group("Instrument")["Framelets"][0] != "Even") { - QString msg = "The image [" + ui.GetCubeName("INEVEN") + "] does not appear " + std::string msg = "The image [" + ui.GetCubeName("INEVEN") + "] does not appear " "to contain the EVEN framelets of a Themis VIS cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -114,13 +114,13 @@ void IsisMain() { try { if(oddCube->group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") { - QString msg = "This program is intended for use on THEMIS VIS images only"; + std::string msg = "This program is intended for use on THEMIS VIS images only"; msg += " [" + ui.GetCubeName("INODD") + "] does not appear to be a "; msg += "THEMIS VIS image."; throw IException(IException::User, msg, _FILEINFO_); } if (oddCube->group("Instrument")["Framelets"][0] != "Odd") { - QString msg = "The image [" + ui.GetCubeName("INODD") + "] does not appear " + std::string msg = "The image [" + ui.GetCubeName("INODD") + "] does not appear " "to contain the ODD framelets of a Themis VIS cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -329,7 +329,7 @@ int FrameletOverlapSize() { Camera *camOdd = oddCube->camera(); if(camEven == NULL || camOdd == NULL) { - QString msg = "A camera is required to automatically calculate the overlap " + std::string msg = "A camera is required to automatically calculate the overlap " "between framelets. Please run spiceinit on the input cube"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/odyssey/apps/thmproc/main.cpp b/isis/src/odyssey/apps/thmproc/main.cpp index fa9bb90cd9..d524778b87 100644 --- a/isis/src/odyssey/apps/thmproc/main.cpp +++ b/isis/src/odyssey/apps/thmproc/main.cpp @@ -18,14 +18,14 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); if(!ui.GetBoolean("INGESTION") && !ui.GetBoolean("MAPPING")) { - QString msg = "You must pick one of [INGESTION,MAPPING]"; + std::string msg = "You must pick one of [INGESTION,MAPPING]"; throw IException(IException::User, msg, _FILEINFO_); } if(ui.WasEntered("PCK")) { FileName pckPreference = ui.GetFileName("PCK"); if(!pckPreference.fileExists()){ - QString msg = "Please provide a valid PCK preference file."; + std::string msg = "Please provide a valid PCK preference file."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -33,7 +33,7 @@ void IsisMain() { if(ui.WasEntered("CK")) { FileName ckPreference = ui.GetFileName("CK"); if(!ckPreference.fileExists()){ - QString msg = "Please provide a valid CK preference file."; + std::string msg = "Please provide a valid CK preference file."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -41,21 +41,21 @@ void IsisMain() { if(ui.WasEntered("SPK")) { FileName spkPreference = ui.GetFileName("SPK"); if(!spkPreference.fileExists()){ - QString msg = "Please provide a valid SPK preference file."; + std::string msg = "Please provide a valid SPK preference file."; throw IException(IException::User, msg, _FILEINFO_); } } if(ui.WasEntered("MAP")) { FileName mapPreference = ui.GetFileName("MAP"); if(!mapPreference.fileExists()){ - QString msg = "Please provide a valid MAP preference file."; + std::string msg = "Please provide a valid MAP preference file."; throw IException(IException::User, msg, _FILEINFO_); } } if(ui.WasEntered("MODEL")) { FileName modelPreference = ui.GetCubeName("MODEL"); if(!modelPreference.fileExists()){ - QString msg = "Please provide a valid MODEL preference file."; + std::string msg = "Please provide a valid MODEL preference file."; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/odyssey/apps/thmvisflat/main.cpp b/isis/src/odyssey/apps/thmvisflat/main.cpp index 9e9046fab9..e2455a3226 100644 --- a/isis/src/odyssey/apps/thmvisflat/main.cpp +++ b/isis/src/odyssey/apps/thmvisflat/main.cpp @@ -33,13 +33,13 @@ void IsisMain() { FileName inFileName = ui.GetCubeName("FROM"); try { if(icube.group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") { - QString msg = "This program is intended for use on THEMIS VIS images only. ["; + std::string msg = "This program is intended for use on THEMIS VIS images only. ["; msg += inFileName.expanded() + "] does not appear to be a THEMIS VIS image."; throw IException(IException::User, msg, _FILEINFO_); } } catch(IException &e) { - QString msg = "This program is intended for use on THEMIS VIS images only. ["; + std::string msg = "This program is intended for use on THEMIS VIS images only. ["; msg += inFileName.expanded() + "] does not appear to be a THEMIS VIS image."; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/odyssey/apps/thmvistrim/main.cpp b/isis/src/odyssey/apps/thmvistrim/main.cpp index d9b8208f72..29aa1c4ba4 100644 --- a/isis/src/odyssey/apps/thmvistrim/main.cpp +++ b/isis/src/odyssey/apps/thmvistrim/main.cpp @@ -38,7 +38,7 @@ void IsisMain() { try { if(icube->group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") { FileName inFileName = ui.GetCubeName("FROM"); - QString msg = "This program is intended for use on THEMIS VIS images only. ["; + std::string msg = "This program is intended for use on THEMIS VIS images only. ["; msg += inFileName.expanded() + "] does not appear to be a THEMIS VIS image."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp b/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp index c589707e57..a3eb706971 100644 --- a/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp +++ b/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp @@ -55,7 +55,7 @@ namespace Isis { // make sure it is a themis vis image if(inst["InstrumentId"][0] != "THEMIS_VIS") { - QString msg = "Unable to create Themis VIS camera model from an image with InstrumentId [" + std::string msg = "Unable to create Themis VIS camera model from an image with InstrumentId [" + QString::fromStdString(inst["InstrumentId"][0]) + "]."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/osirisrex/apps/ocams2isis/main.cpp b/isis/src/osirisrex/apps/ocams2isis/main.cpp index bcb5f31fef..f92c8dbe62 100644 --- a/isis/src/osirisrex/apps/ocams2isis/main.cpp +++ b/isis/src/osirisrex/apps/ocams2isis/main.cpp @@ -31,7 +31,7 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); - QString error_message = "WARNING: This camera model is out of date. See ocam2isis documentation for details."; + std::string error_message = "WARNING: This camera model is out of date. See ocam2isis documentation for details."; std::cerr << error_message << std::endl; ProcessImportFits importFits; diff --git a/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp b/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp index e4926b18f9..8d5719d31f 100644 --- a/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp +++ b/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp @@ -71,7 +71,7 @@ namespace Isis { instId = QString::fromStdString((flabel.findKeyword("INSTRUME", Pvl::Traverse))).simplified(); } catch (IException &ie) { - QString msg = QObject::tr("Unable to retrieve expected TAGCAMS keywords." + std::string msg = QObject::tr("Unable to retrieve expected TAGCAMS keywords." "The file provided in FROM is likely not a TAGCAMS image."); throw IException(ie, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp b/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp index a19e4e2086..80101ac962 100644 --- a/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp +++ b/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp @@ -55,7 +55,7 @@ namespace Isis { m_instrumentNameShort = "PolyCam"; } else { - QString msg = "Unable to construct OSIRIS-REx camera model. " + std::string msg = "Unable to construct OSIRIS-REx camera model. " "Unrecognized NaifFrameCode [" + toString(frameCode) + "]."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexOcamsDistortionMap.cpp b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexOcamsDistortionMap.cpp index 8a39892327..b0679dcaae 100644 --- a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexOcamsDistortionMap.cpp +++ b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexOcamsDistortionMap.cpp @@ -44,7 +44,7 @@ namespace Isis { // The CameraFocalPlaneMap must be set in the Camera object // prior to calling distortion model!!! if ( !parent->FocalPlaneMap() ) { - QString mess = "FocalPlaneMap must be set in the Camera object prior to" + std::string mess = "FocalPlaneMap must be set in the Camera object prior to" " initiating this distortion model!"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp index c46fcc26e2..9a58a86cdf 100644 --- a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp +++ b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp @@ -57,7 +57,7 @@ namespace Isis { m_instrumentNameShort = "StowCam"; } else { - QString msg = "Unable to construct OSIRIS-REx Navigation camera model. " + std::string msg = "Unable to construct OSIRIS-REx Navigation camera model. " "Unrecognized NaifIkCode [" + toString(frameCode) + "]."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsDistortionMap.cpp b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsDistortionMap.cpp index 9e8ff6e3c8..fe6cb21885 100644 --- a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsDistortionMap.cpp +++ b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsDistortionMap.cpp @@ -83,7 +83,7 @@ namespace Isis { // The CameraFocalPlaneMap must be set in the Camera object // prior to calling distortion model!!! if ( !parent->FocalPlaneMap() ) { - QString mess = "FocalPlaneMap must be set in the Camera object prior to" + std::string mess = "FocalPlaneMap must be set in the Camera object prior to" " initiating this distortion model!"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/qisis/apps/cneteditor/CnetEditorWindow.cpp b/isis/src/qisis/apps/cneteditor/CnetEditorWindow.cpp index 80baee688e..855e00b544 100644 --- a/isis/src/qisis/apps/cneteditor/CnetEditorWindow.cpp +++ b/isis/src/qisis/apps/cneteditor/CnetEditorWindow.cpp @@ -105,7 +105,7 @@ namespace Isis { // Can only load two file at a time if (args.size() > 2) { - QString msg = tr("Cannot open more than one .net file and one .lis file at a time."); + std::string msg = tr("Cannot open more than one .net file and one .lis file at a time."); std::cerr << msg << endl; QMessageBox::warning(this, tr("Unable to Open Files"), msg); } @@ -115,7 +115,7 @@ namespace Isis { QString extension = QFileInfo(arg).suffix(); if (extension.compare("net") != 0 && extension.compare("lis") != 0) { args.removeAll(arg); - QString msg = tr("Invalid file extension [%1]. " + std::string msg = tr("Invalid file extension [%1]. " "Expected .net or .lis.").arg(arg); std::cerr << msg << endl; QMessageBox::warning(this, tr("Invalid File Extension"), msg); @@ -123,7 +123,7 @@ namespace Isis { } // Prevent multiple files of the same type from loading if (args.size() == 2 && QFileInfo(args[0]).suffix() == QFileInfo(args[1]).suffix()) { - QString msg = tr("Cannot open two [%1] files.").arg(args[0]); + std::string msg = tr("Cannot open two [%1] files.").arg(args[0]); std::cerr << msg << endl; QMessageBox::warning(this, tr("Unable to Open Files"), msg); } @@ -525,7 +525,7 @@ namespace Isis { setFileState(FileLoading, filename); } catch (IException &e) { - QString msg = tr("Failed to open the file [%1].").arg(filename); + std::string msg = tr("Failed to open the file [%1].").arg(filename); std::cerr << msg << endl; QMessageBox::critical(this, tr("cneteditor"), msg); setFileState(NoFile, ""); @@ -551,7 +551,7 @@ namespace Isis { *cubeListFile = filename; } catch (IException &e) { - QString msg = tr("Failed to open the file [%1].").arg(filename); + std::string msg = tr("Failed to open the file [%1].").arg(filename); std::cerr << msg << endl; QMessageBox::critical(this, tr("cneteditor"), msg); setFileState(NoFile, ""); diff --git a/isis/src/qisis/apps/ipce/IpceMainWindow.cpp b/isis/src/qisis/apps/ipce/IpceMainWindow.cpp index fced4c2881..67978890bb 100644 --- a/isis/src/qisis/apps/ipce/IpceMainWindow.cpp +++ b/isis/src/qisis/apps/ipce/IpceMainWindow.cpp @@ -663,7 +663,7 @@ namespace Isis { // Ensure that we are not using a NULL pointer if (!project) { - QString msg = "Cannot write settings with a NULL Project pointer."; + std::string msg = "Cannot write settings with a NULL Project pointer."; throw IException(IException::Programmer, msg, _FILEINFO_); } QSettings projectSettings(FileName(project->newProjectRoot() + "/ipce.config").expanded(), @@ -702,7 +702,7 @@ namespace Isis { void IpceMainWindow::readSettings(Project *project) { // Ensure that the Project pointer is not NULL if (!project) { - QString msg = "Cannot read settings with a NULL Project pointer."; + std::string msg = "Cannot read settings with a NULL Project pointer."; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/qisis/apps/qtie/QtieFileTool.cpp b/isis/src/qisis/apps/qtie/QtieFileTool.cpp index 0a756dd070..c309e0845f 100644 --- a/isis/src/qisis/apps/qtie/QtieFileTool.cpp +++ b/isis/src/qisis/apps/qtie/QtieFileTool.cpp @@ -115,7 +115,7 @@ namespace Isis { baseCube->projection(); } catch (IException &) { - QString message = "Base must be projected"; + std::string message = "Base must be projected"; QMessageBox::critical((QWidget *)parent(), "Error", message); baseCube->close(); continue; @@ -126,8 +126,8 @@ namespace Isis { baseGM = new UniversalGroundMap(*baseCube); } catch (IException &e) { - QString message = "Cannot initialize universal ground map for basemap.\n"; - QString errors = e.toString(); + std::string message = "Cannot initialize universal ground map for basemap.\n"; + std::string errors = e.toString(); message += errors; QMessageBox::critical((QWidget *)parent(), "Error", message); baseCube->close(); @@ -135,7 +135,7 @@ namespace Isis { } } catch (IException &) { - QString message = "Unable to open base cube"; + std::string message = "Unable to open base cube"; QMessageBox::critical((QWidget *)parent(), "Error", message); } } @@ -165,14 +165,14 @@ namespace Isis { try { if (matchCube->hasGroup("Mapping")) { - QString message = "The match cube cannot be a projected cube."; + std::string message = "The match cube cannot be a projected cube."; QMessageBox::critical((QWidget *)parent(), "Error", message); matchCube->close(); continue; } } catch (IException &) { - QString message = "Error reading match cube labels."; + std::string message = "Error reading match cube labels."; QMessageBox::critical((QWidget *)parent(), "Error", message); matchCube->close(); continue; @@ -182,8 +182,8 @@ namespace Isis { matchGM = new UniversalGroundMap(*matchCube); } catch (IException &e) { - QString message = "Cannot initialize universal ground map for match cube.\n"; - QString errors = e.toString(); + std::string message = "Cannot initialize universal ground map for match cube.\n"; + std::string errors = e.toString(); message += errors; QMessageBox::critical((QWidget *)parent(), "Error", message); matchCube->close(); @@ -191,7 +191,7 @@ namespace Isis { } } catch (IException &) { - QString message = "Unable to open match cube"; + std::string message = "Unable to open match cube"; QMessageBox::critical((QWidget *)parent(), "Error", message); } } @@ -235,8 +235,8 @@ namespace Isis { } } catch (IException &e) { - QString message = "Invalid control network. \n"; - QString errors = e.toString(); + std::string message = "Invalid control network. \n"; + std::string errors = e.toString(); message += errors; QMessageBox::information((QWidget *)parent(), "Error", message); } @@ -279,7 +279,7 @@ namespace Isis { // Make sure targets match if (cnet->GetTarget() != matchCube->camera()->target()->name()) { - QString message = tr("Control Net target, [%1], is not the same as the cube target, [%2].") + std::string message = tr("Control Net target, [%1], is not the same as the cube target, [%2].") .arg(QString(cnet->GetTarget())) .arg(QString(matchCube->camera()->target()->name())); QMessageBox::critical((QWidget *)parent(), "Invalid Control Network", message); @@ -291,7 +291,7 @@ namespace Isis { double baseSamp, baseLine; if (p.GetNumMeasures() > 1) { - QString message = "Control Networks coming into Qtie can only have a single control " + std::string message = "Control Networks coming into Qtie can only have a single control " "measure for the match cube in each control point."; QMessageBox::critical((QWidget *)parent(), "Invalid Control Network", message); return false; @@ -299,7 +299,7 @@ namespace Isis { // Make sure there is a measure for the match cube if (!p.HasSerialNumber(SerialNumber::Compose(*matchCube))) { - QString message = "Cannot find a measure for the match cube"; + std::string message = "Cannot find a measure for the match cube"; QMessageBox::critical((QWidget *)parent(), "Invalid Control Network", message); return false; } @@ -312,7 +312,7 @@ namespace Isis { if (baseSamp < 1 || baseSamp > baseCube->sampleCount() || baseLine < 1 || baseLine > baseCube->lineCount()) { // throw error? point not on base - QString message = "Error parsing input control net. Lat/Lon for Point Id: " + + std::string message = "Error parsing input control net. Lat/Lon for Point Id: " + (p.GetId()) + " computes to a sample/line off " + "the edge of the basemap cube. This point will be skipped."; QMessageBox::critical((QWidget *)parent(), "Invalid Control Net", message); @@ -322,7 +322,7 @@ namespace Isis { else { // throw error? point not on base cube qDebug()<<"SetGround else"; - QString message = "Error parsing input control net. Point Id: " + + std::string message = "Error parsing input control net. Point Id: " + (p.GetId()) + " does not exist on basemap. " "This point will be skipped."; QMessageBox::critical((QWidget *)parent(), "Invalid Control Network", message); @@ -331,7 +331,7 @@ namespace Isis { } catch (IException &e) { qDebug()<<"catch"; - QString message = "Error in SetGround. Error parsing input control net. Point Id: " + + std::string message = "Error in SetGround. Error parsing input control net. Point Id: " + (p.GetId()) + " does not exist on basemap. " "This point will be skipped."; QMessageBox::critical((QWidget *)parent(), "Invalid Control Network", message); diff --git a/isis/src/qisis/apps/qtie/QtieTool.cpp b/isis/src/qisis/apps/qtie/QtieTool.cpp index 2810b42e81..d76a1ade3c 100644 --- a/isis/src/qisis/apps/qtie/QtieTool.cpp +++ b/isis/src/qisis/apps/qtie/QtieTool.cpp @@ -322,8 +322,8 @@ namespace Isis { p_baseGM = new UniversalGroundMap(*p_baseCube); } catch (IException &e) { - QString message = "Cannot initialize universal ground map for basemap.\n"; - QString errors = e.toString(); + std::string message = "Cannot initialize universal ground map for basemap.\n"; + std::string errors = e.toString(); message += errors; QMessageBox::critical((QWidget *)parent(), "Error", message); return; @@ -332,8 +332,8 @@ namespace Isis { p_matchGM = new UniversalGroundMap(*matchCube); } catch (IException &e) { - QString message = "Cannot initialize universal ground map for match cube.\n"; - QString errors = e.toString(); + std::string message = "Cannot initialize universal ground map for match cube.\n"; + std::string errors = e.toString(); message += errors; QMessageBox::critical((QWidget *)parent(), "Error", message); return; @@ -396,7 +396,7 @@ namespace Isis { p_matchGM->SetGround(Latitude(lat, Angle::Degrees), Longitude(lon, Angle::Degrees)); Distance radius = p_matchGM->Camera()->LocalRadius(); if (!radius.isValid()) { - QString message = "Could not determine radius from DEM at lat/lon [" + std::string message = "Could not determine radius from DEM at lat/lon [" + QString::number(lat) + "," + QString::number(lon) + "]"; QMessageBox::critical((QWidget *)parent(),"Error",message); return; @@ -407,7 +407,7 @@ namespace Isis { radius)); } catch (IException &e) { - QString message = "Unable to set Apriori Surface Point.\n"; + std::string message = "Unable to set Apriori Surface Point.\n"; message += "Latitude = " + QString::number(lat); message += " Longitude = " + QString::number(lon); message += " Radius = " + QString::number(radius.meters()) + "\n"; @@ -439,12 +439,12 @@ namespace Isis { if (cvp == NULL) return; if (cubeViewportList()->size() != 2) { - QString message = "You must have a basemap and a match cube open."; + std::string message = "You must have a basemap and a match cube open."; QMessageBox::critical((QWidget *)parent(), "Error", message); return; } if (cvp->cube() == p_baseCube) { - QString message = "Select points on match Cube only."; + std::string message = "Select points on match Cube only."; QMessageBox::information((QWidget *)parent(), "Warning", message); return; } @@ -460,7 +460,7 @@ namespace Isis { if (s == Qt::LeftButton) { if (!p_controlNet || p_controlNet->GetNumMeasures() == 0) { - QString message = "No points exist for editing. Create points "; + std::string message = "No points exist for editing. Create points "; message += "using the right mouse button."; QMessageBox::information((QWidget *)parent(), "Warning", message); return; @@ -471,7 +471,7 @@ namespace Isis { point = p_controlNet->FindClosest(sn, samp, line); } catch (IException &e) { - QString message = "No points found for editing. Create points "; + std::string message = "No points found for editing. Create points "; message += "using the right mouse button."; message += e.toString(); QMessageBox::critical((QWidget *)parent(), "Error", message); @@ -481,7 +481,7 @@ namespace Isis { } else if (s == Qt::MiddleButton) { if (!p_controlNet || p_controlNet->GetNumPoints() == 0) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::warning((QWidget *)parent(), "Warning", message); return; @@ -492,7 +492,7 @@ namespace Isis { p_controlNet->FindClosest(sn, samp, line); // TODO: test for errors and reality if (point == NULL) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::information((QWidget *)parent(), "Warning", message); return; @@ -543,7 +543,7 @@ namespace Isis { if (baseSamp < 1 || baseSamp > p_baseCube->sampleCount() || baseLine < 1 || baseLine > p_baseCube->lineCount()) { // throw error? point not on base - QString message = "Point does not exist on base map."; + std::string message = "Point does not exist on base map."; QMessageBox::warning((QWidget *)parent(), "Warning", message); return; } @@ -551,7 +551,7 @@ namespace Isis { else { // throw error? point not on base cube // throw error? point not on base - QString message = "Point does not exist on base map."; + std::string message = "Point does not exist on base map."; QMessageBox::warning((QWidget *)parent(), "Warning", message); } @@ -576,14 +576,14 @@ namespace Isis { if (ok && id.isEmpty()) // user clicked "Ok" but did not enter a point ID { - QString message = "You must enter a point Id."; + std::string message = "You must enter a point Id."; QMessageBox::warning((QWidget *)parent(), "Warning", message); } else { // Make sure Id doesn't already exist newPoint = new ControlPoint(id); if (p_controlNet->ContainsPoint(newPoint->GetId())) { - QString message = "A ControlPoint with Point Id = [" + + std::string message = "A ControlPoint with Point Id = [" + newPoint->GetId() + "] already exists. Re-enter unique Point Id."; QMessageBox::warning((QWidget *)parent(), "Unique Point Id", message); @@ -767,7 +767,7 @@ namespace Isis { // Need at least 2 points to solve for twist if (p_twist) { if (p_controlNet->GetNumPoints() < 2) { - QString message = "Need at least 2 points to solve for twist. \n"; + std::string message = "Need at least 2 points to solve for twist. \n"; QMessageBox::critical((QWidget *)parent(), "Error", message); return; } @@ -850,9 +850,9 @@ namespace Isis { double maxError = outNet.GetMaximumResidual(); double avgError = outNet.AverageResidual(); - QString message = "Maximum Error = " + QString::number(maxError); + std::string message = "Maximum Error = " + QString::number(maxError); message += "\nAverage Error = " + QString::number(avgError); - QString msgTitle = "Update camera pointing?"; + std::string msgTitle = "Update camera pointing?"; // QDialog resultsDialog((QWidget *)parent(),"Bundle Adjust Summary",true); QMessageBox msgBox; @@ -888,8 +888,8 @@ namespace Isis { } catch (IException &e) { - QString message = "Unable to bundle adjust. Solution failed.\n"; - QString errors = e.toString(); + std::string message = "Unable to bundle adjust. Solution failed.\n"; + std::string errors = e.toString(); message += errors; // message += "\n\nMaximum Error = " + QString::number(outNet.MaximumResiudal()); // message += "\nAverage Error = " + QString::number(outNet.AverageResidual()); @@ -984,7 +984,7 @@ namespace Isis { registrationDialog.exec(); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::warning((QWidget *)parent(), "Error", message); } } @@ -1026,8 +1026,8 @@ namespace Isis { net.Write(fn); } catch (IException &e) { - QString message = "Error saving control network. \n"; - QString errors = e.toString(); + std::string message = "Error saving control network. \n"; + std::string errors = e.toString(); message += errors; QMessageBox::information((QWidget *)parent(), "Error", message); return; diff --git a/isis/src/qisis/apps/qview/main.cpp b/isis/src/qisis/apps/qview/main.cpp index 06e2ad31bd..29786a1139 100644 --- a/isis/src/qisis/apps/qview/main.cpp +++ b/isis/src/qisis/apps/qview/main.cpp @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) { exit(0); } else { - QString msg = "Unable to write to socket"; + std::string msg = "Unable to write to socket"; std::cout << msg << std::endl; remove(p_socketFile.toLatin1().data()); } @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) { } } else { - QString msg = "Unable to create socket"; + std::string msg = "Unable to create socket"; std::cout << msg << std::endl; remove(p_socketFile.toLatin1().data()); } diff --git a/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp b/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp index 8fdc3ca9f9..fa84967093 100644 --- a/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp +++ b/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp @@ -320,9 +320,9 @@ namespace Isis { } // Write out the path, filename, and serial number - FileName fname = FileName(cvp->cube()->fileName()).expanded(); - QString fnamePath = fname.path(); - QString fnameName = fname.name(); + FileName fname = FileName(cvp->cube()->fileName().toStdString()).expanded(); + QString fnamePath = QString::fromStdString(fname.path()); + QString fnameName = QString::fromStdString(fname.name()); p_tableWin->table()->item(row, getIndex("Path"))->setText(fnamePath); p_tableWin->table()->item(row, getIndex("FileName"))->setText(fnameName); if (!cvp->cube()->hasGroup("Tracking") && !cvp->cube()->hasTable("InputImages")){ @@ -700,7 +700,7 @@ namespace Isis { TrackingTable trackingTable(table); FileName trackingFileName = trackingTable.pixelToFileName(currentPixel); - psSrcFileName = trackingFileName.name(); + psSrcFileName = QString::fromStdString(trackingFileName.name()); psSrcSerialNum = trackingTable.pixelToSN(currentPixel); piOrigin = trackingTable.fileNameToIndex(trackingFileName, psSrcSerialNum); } @@ -924,9 +924,9 @@ namespace Isis { "state and geometry can not be saved and restored", _FILEINFO_); } - FileName config(FileName("$HOME/.Isis/" + QApplication::applicationName() + "/").path() + "/" + + FileName config(FileName("$HOME/.Isis/" + QApplication::applicationName().toStdString() + "/").path() + "/" + "advancedTrackTool.config"); - return config.expanded(); + return QString::fromStdString(config.expanded()); } } diff --git a/isis/src/qisis/objs/BlinkTool/BlinkTool.cpp b/isis/src/qisis/objs/BlinkTool/BlinkTool.cpp index 068b562deb..50f55ef1d7 100644 --- a/isis/src/qisis/objs/BlinkTool/BlinkTool.cpp +++ b/isis/src/qisis/objs/BlinkTool/BlinkTool.cpp @@ -183,9 +183,9 @@ namespace Isis { * */ void BlinkTool::updateTool() { - QString unlinkedIcon = FileName("$ISISROOT/appdata/images/icons/unlinked.png").expanded(); + QString unlinkedIcon = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/unlinked.png").expanded()); static QIcon unlinked(unlinkedIcon); - QString linkedIcon = FileName("$ISISROOT/appdata/images/icons/linked.png").expanded(); + QString linkedIcon = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/linked.png").expanded()); static QIcon linked(linkedIcon); p_listWidget->clear(); for(int i = 0; i < (int)cubeViewportList()->size(); i++) { diff --git a/isis/src/qisis/objs/BrowseDialog/BrowseDialog.cpp b/isis/src/qisis/objs/BrowseDialog/BrowseDialog.cpp index 0f97eaf372..034933f864 100644 --- a/isis/src/qisis/objs/BrowseDialog/BrowseDialog.cpp +++ b/isis/src/qisis/objs/BrowseDialog/BrowseDialog.cpp @@ -57,7 +57,7 @@ namespace Isis { /*If the user did not select a file warn them.*/ if(selectedFiles.size() < 1) { - QString message = tr("\nFile not found.\nPlease verify the " + std::string message = tr("\nFile not found.\nPlease verify the " "correct file name was given"); QMessageBox::warning(this, "File Not Found", message); diff --git a/isis/src/qisis/objs/ChipViewport/ChipViewport.cpp b/isis/src/qisis/objs/ChipViewport/ChipViewport.cpp index b48b57960b..43357c5364 100644 --- a/isis/src/qisis/objs/ChipViewport/ChipViewport.cpp +++ b/isis/src/qisis/objs/ChipViewport/ChipViewport.cpp @@ -624,7 +624,7 @@ namespace Isis { // m_chip->ReLoad(*matchChip,m_zoomFactor); } catch (IException &e) { - QString msg = "Cannot geom chip.\n"; + std::string msg = "Cannot geom chip.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; @@ -649,7 +649,7 @@ namespace Isis { m_chip->Load(*m_chipCube, m_rotation, m_zoomFactor); } catch (IException &e) { - QString msg = "Cannot load no geom chip.\n"; + std::string msg = "Cannot load no geom chip.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; @@ -677,7 +677,7 @@ namespace Isis { m_chip->Load(*m_chipCube, -rotation, m_zoomFactor); } catch (IException &e) { - QString msg = "Cannot load rotated chip.\n"; + std::string msg = "Cannot load rotated chip.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; @@ -719,7 +719,7 @@ namespace Isis { m_chip->Load(*m_chipCube, *m_matchChip, *m_matchChipCube); } catch (IException &e) { - QString msg = "Cannot reload chip.\n"; + std::string msg = "Cannot reload chip.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; @@ -731,7 +731,7 @@ namespace Isis { m_chip->Load(*m_chipCube, m_rotation, m_zoomFactor); } catch (IException &e) { - QString msg = "Cannot reload chip.\n"; + std::string msg = "Cannot reload chip.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; diff --git a/isis/src/qisis/objs/ChipViewportsWidget/ChipViewportsWidget.cpp b/isis/src/qisis/objs/ChipViewportsWidget/ChipViewportsWidget.cpp index 4d60e6664d..fd8ea1ed1d 100644 --- a/isis/src/qisis/objs/ChipViewportsWidget/ChipViewportsWidget.cpp +++ b/isis/src/qisis/objs/ChipViewportsWidget/ChipViewportsWidget.cpp @@ -206,7 +206,7 @@ namespace Isis { Cube *measureCube = new Cube(m_serialNumberList->fileName( - m_controlPoint->GetRefMeasure()->GetCubeSerialNumber())); + m_controlPoint->GetRefMeasure()->GetCubeSerialNumber()).toStdString()); Chip *chip = new Chip(VIEWSIZE, VIEWSIZE); ControlMeasure *measure = m_controlPoint->GetRefMeasure(); chip->TackCube(measure->GetSample(), measure->GetLine()); @@ -234,7 +234,7 @@ namespace Isis { continue; } // qDebug()<<" after Test for Skip Reference Measure i= "<fileName(measure->GetCubeSerialNumber())); + Cube *measureCube = new Cube(m_serialNumberList->fileName(measure->GetCubeSerialNumber()).toStdString()); Chip *chip = new Chip(VIEWSIZE, VIEWSIZE); // measure = m_controlPoint->GetRefMeasure(); chip->TackCube(measure->GetSample(), measure->GetLine()); diff --git a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp index 2807f81fee..718d2253b8 100644 --- a/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp +++ b/isis/src/qisis/objs/CnetEditorView/CnetEditorView.cpp @@ -46,7 +46,7 @@ namespace Isis { QGridLayout *resultLayout = new QGridLayout; centralWidget->setLayout(resultLayout); - m_cnetEditorWidget = new CnetEditorWidget(control, configFile.expanded()); + m_cnetEditorWidget = new CnetEditorWidget(control, QString::fromStdString(configFile.expanded())); m_control = control; resultLayout->addWidget(m_cnetEditorWidget, 0, 0, 1, 2); diff --git a/isis/src/qisis/objs/CnetEditorWidget/AbstractFilterSelector.cpp b/isis/src/qisis/objs/CnetEditorWidget/AbstractFilterSelector.cpp index 854c48aedc..8882e81447 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/AbstractFilterSelector.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/AbstractFilterSelector.cpp @@ -77,7 +77,7 @@ namespace Isis { void AbstractFilterSelector::createSelector() { m_closeButton = new QPushButton; - m_closeButton->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/editdelete.png").expanded())); + m_closeButton->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/editdelete.png").expanded()))); connect(m_closeButton, SIGNAL(clicked()), this, SLOT(sendClose())); m_selector = new QComboBox; diff --git a/isis/src/qisis/objs/CnetEditorWidget/AbstractMeasureItem.cpp b/isis/src/qisis/objs/CnetEditorWidget/AbstractMeasureItem.cpp index 5016480bc7..48a8339713 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/AbstractMeasureItem.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/AbstractMeasureItem.cpp @@ -85,7 +85,7 @@ namespace Isis { return (Column) i; } - QString msg = "Column title [" + columnTitle + "] does not match any of " + std::string msg = "Column title [" + columnTitle + "] does not match any of " "the defined column types"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -357,20 +357,20 @@ namespace Isis { void AbstractMeasureItem::deleteSource() { if (m_measure) { if (m_measure->Parent()->IsEditLocked()) { - QString msg = "Measures in point [" + + std::string msg = "Measures in point [" + getFormattedData(getColumnName(PointId)) + "] cannot be deleted because point is edit locked"; throw IException(IException::User, msg, _FILEINFO_); } else if (m_measure->IsEditLocked()) { - QString msg = "Measure [" + getFormattedData() + "] in point [" + + std::string msg = "Measure [" + getFormattedData() + "] in point [" + getFormattedData(getColumnName(PointId)) + "] cannot be deleted because m_measure is edit locked"; throw IException(IException::User, msg, _FILEINFO_); } // else if (m_measure->Parent()->GetRefMeasure() == m_measure) { - // QString msg = "Measure [" + getData() + "] in point [" + + // std::string msg = "Measure [" + getData() + "] in point [" + // getData(getColumnName(PointId)) + "] cannot be deleted because " // "it is the reference"; // throw iException::Message(iException::User, msg, _FILEINFO_); diff --git a/isis/src/qisis/objs/CnetEditorWidget/AbstractPointItem.cpp b/isis/src/qisis/objs/CnetEditorWidget/AbstractPointItem.cpp index 244b9382ab..77573ed7e5 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/AbstractPointItem.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/AbstractPointItem.cpp @@ -153,7 +153,7 @@ namespace Isis { return (Column)i; } - QString msg = "Column title [" + columnTitle + "] does not match any of " + std::string msg = "Column title [" + columnTitle + "] does not match any of " "the defined column types"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -495,7 +495,7 @@ namespace Isis { } break; case AdjustedSPCoord1Sigma: { - QString msg; + std::string msg; if (latLonRadiusCoordDisplay) { msg = "Cannot set adjusted surface point latitude sigma"; } @@ -506,7 +506,7 @@ namespace Isis { break; } case AdjustedSPCoord2Sigma: { - QString msg; + std::string msg; if (latLonRadiusCoordDisplay) { msg = "Cannot set adjusted surface point longitude sigma"; } @@ -517,7 +517,7 @@ namespace Isis { break; } case AdjustedSPCoord3Sigma: { - QString msg; + std::string msg; if (latLonRadiusCoordDisplay) { msg = "Cannot set adjusted surface point radius sigma"; } @@ -717,12 +717,12 @@ namespace Isis { void AbstractPointItem::deleteSource() { if (m_point) { if (m_point->IsEditLocked()) { - QString msg = "Point [" + getFormattedData() + "] is edit locked and " + std::string msg = "Point [" + getFormattedData() + "] is edit locked and " "cannot be deleted"; throw IException(IException::User, msg, _FILEINFO_); } else if (m_point->GetNumLockedMeasures() > 0) { - QString msg = "Point [" + getFormattedData() + "] has at least one " + std::string msg = "Point [" + getFormattedData() + "] has at least one " "edit locked measure and cannot be deleted"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/qisis/objs/CnetEditorWidget/AbstractTreeModel.cpp b/isis/src/qisis/objs/CnetEditorWidget/AbstractTreeModel.cpp index 63b12b89ee..956f78a6fc 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/AbstractTreeModel.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/AbstractTreeModel.cpp @@ -187,7 +187,7 @@ namespace Isis { } if (!start) { - QString msg = "The first item passed to getItems(AbstractTreeItem*, " + std::string msg = "The first item passed to getItems(AbstractTreeItem*, " "AbstractTreeItem*) is not visible in this model's tree"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -213,7 +213,7 @@ namespace Isis { } if (!curItem) { - QString msg = "The second item passed to getItems(AbstractTreeItem*, " + std::string msg = "The second item passed to getItems(AbstractTreeItem*, " "AbstractTreeItem*) is not visible in this model's tree"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp b/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp index 8dd76cbea6..9924b7c63d 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp @@ -221,7 +221,7 @@ namespace Isis { item->deleteSource(); } catch (IException &e) { - QString message = e.what(); + std::string message = e.what(); if (!ignoreAll) { if (item == itemsToDelete.last()) { @@ -304,7 +304,7 @@ namespace Isis { void CnetEditorWidget::createActions() { QAction *freezeTablesAct = new QAction(QIcon( - FileName("$ISISROOT/appdata/images/icons/ice.png").expanded()), + QString::fromStdString((FileName("$ISISROOT/appdata/images/icons/ice.png").expanded()))), tr("&Freeze Tables"), this); freezeTablesAct->setCheckable(true); freezeTablesAct->setToolTip(tr("Freeze tables (filters will not take " @@ -320,8 +320,8 @@ namespace Isis { freezeTablesLocation.append(tr("&Tables")); m_menuActions->insert(freezeTablesAct, freezeTablesLocation); - QAction *configureSortAct = new QAction(QIcon( - FileName("$ISISROOT/appdata/images/icons/sort.png").expanded()), + QAction *configureSortAct = new QAction((QIcon( + QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/sort.png").expanded()))), tr("&Sorting Options..."), this); QString configureSortToolTipText = tr("Configure table sorting options"); configureSortAct->setToolTip(configureSortToolTipText); @@ -334,7 +334,7 @@ namespace Isis { configureSortLocation.append(tr("&Tables")); m_menuActions->insert(configureSortAct, configureSortLocation); - QAction *xyzDisplayAct = new QAction(QIcon(FileName("$ISISROOT/appdata/images/icons/xyz.png").expanded()), + QAction *xyzDisplayAct = new QAction(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/xyz.png").expanded())), tr("&X,Y,Z"), this); xyzDisplayAct->setCheckable(true); xyzDisplayAct->setChecked(false); @@ -352,7 +352,7 @@ namespace Isis { m_menuActions->insert(xyzDisplayAct, xyzDisplayLocation); QAction *latLonRadiusDisplayAct - = new QAction(QIcon(FileName("$ISISROOT/appdata/images/icons/latlonrad.png").expanded()), + = new QAction(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/latlonrad.png").expanded())), tr("&Lat,Lon,Radius"), this); latLonRadiusDisplayAct->setCheckable(true); latLonRadiusDisplayAct->setChecked(true); diff --git a/isis/src/qisis/objs/CnetEditorWidget/FilterGroup.cpp b/isis/src/qisis/objs/CnetEditorWidget/FilterGroup.cpp index 818d8cf44d..29dfcace16 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/FilterGroup.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/FilterGroup.cpp @@ -149,7 +149,7 @@ namespace Isis { m_newSelectorButton = new QPushButton; m_newSelectorButton->setIcon(QIcon( - FileName("$ISISROOT/appdata/images/icons/add.png").expanded())); + QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/add.png").expanded()))); QString newSelectorTooltip = "Add new filter"; m_newSelectorButton->setToolTip(newSelectorTooltip); m_newSelectorButton->setStatusTip(newSelectorTooltip); diff --git a/isis/src/qisis/objs/CnetEditorWidget/FilterWidget.cpp b/isis/src/qisis/objs/CnetEditorWidget/FilterWidget.cpp index 202242b8ed..e4eeb1cbc6 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/FilterWidget.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/FilterWidget.cpp @@ -209,7 +209,7 @@ namespace Isis { m_logicWidget->setLayout(buttonLayout); m_addGroupButton = new QPushButton; - m_addGroupButton->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/add.png").expanded())); + m_addGroupButton->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/add.png").expanded()))); QString addGroupTooltip = "Add new filter group"; m_addGroupButton->setToolTip(addGroupTooltip); m_addGroupButton->setStatusTip(addGroupTooltip); diff --git a/isis/src/qisis/objs/CnetEditorWidget/PointTableDelegate.cpp b/isis/src/qisis/objs/CnetEditorWidget/PointTableDelegate.cpp index f8c45bdfa0..e294796b6b 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/PointTableDelegate.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/PointTableDelegate.cpp @@ -95,7 +95,7 @@ namespace Isis { return new QLineEdit(); } - QString msg = "Could not create delegate widget for column [" + std::string msg = "Could not create delegate widget for column [" + col->getTitle() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/qisis/objs/CnetEditorWidget/TableColumnList.cpp b/isis/src/qisis/objs/CnetEditorWidget/TableColumnList.cpp index 138667aaa9..4cd23fc9ed 100644 --- a/isis/src/qisis/objs/CnetEditorWidget/TableColumnList.cpp +++ b/isis/src/qisis/objs/CnetEditorWidget/TableColumnList.cpp @@ -60,7 +60,7 @@ namespace Isis { if (m_cols->at(i)->getTitle() == title) return (*m_cols)[i]; - QString msg = "There is no column with a title of ["; + std::string msg = "There is no column with a title of ["; msg += title; msg += "] inside this column list"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -69,7 +69,7 @@ namespace Isis { void TableColumnList::append(TableColumn *newCol) { if (!newCol) { - QString msg = "Attempted to add NULL column to the columnlist"; + std::string msg = "Attempted to add NULL column to the columnlist"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -266,7 +266,7 @@ namespace Isis { void TableColumnList::checkIndexRange(int index) { if (index < 0 || index >= m_cols->size()) { - QString msg = "index ["; + std::string msg = "index ["; msg += index; msg += "] is out of range. Size of list is: "; msg += m_cols->size(); diff --git a/isis/src/qisis/objs/ConcurrentControlNetReader/ConcurrentControlNetReader.cpp b/isis/src/qisis/objs/ConcurrentControlNetReader/ConcurrentControlNetReader.cpp index bf13194ecc..c85388e62f 100644 --- a/isis/src/qisis/objs/ConcurrentControlNetReader/ConcurrentControlNetReader.cpp +++ b/isis/src/qisis/objs/ConcurrentControlNetReader/ConcurrentControlNetReader.cpp @@ -130,7 +130,7 @@ namespace Isis { progress->DisableAutomaticDisplay(); m_progress.append(progress); - functorInput.append(qMakePair(FileName(backlogFileName), progress)); + functorInput.append(qMakePair(FileName(backlogFileName.toStdString()), progress)); } QFuture networks = QtConcurrent::mapped(functorInput, @@ -238,7 +238,7 @@ namespace Isis { Control * ConcurrentControlNetReader::FileNameToControlFunctor::operator()( const QPair &fileNameAndProgress) const { - QString fileNameString = fileNameAndProgress.first.expanded(); + QString fileNameString = QString::fromStdString(fileNameAndProgress.first.expanded()); Progress *progress = fileNameAndProgress.second; ControlNet *newCnet = new ControlNet(fileNameString, progress); diff --git a/isis/src/qisis/objs/Control/Control.cpp b/isis/src/qisis/objs/Control/Control.cpp index 7bedf8b51b..67f621acf0 100644 --- a/isis/src/qisis/objs/Control/Control.cpp +++ b/isis/src/qisis/objs/Control/Control.cpp @@ -48,7 +48,7 @@ namespace Isis { } m_displayProperties - = new ControlDisplayProperties(FileName(m_fileName).name(), this); + = new ControlDisplayProperties(QString::fromStdString(FileName(m_fileName.toStdString()).name()), this); m_id = new QUuid(QUuid::createUuid()); } @@ -70,7 +70,7 @@ namespace Isis { m_modified = false; m_displayProperties - = new ControlDisplayProperties(FileName(m_fileName).name(), this); + = new ControlDisplayProperties(QString::fromStdString(FileName(m_fileName.toStdString()).name()), this); m_id = new QUuid(QUuid::createUuid()); } @@ -94,7 +94,7 @@ namespace Isis { m_modified = false; m_displayProperties - = new ControlDisplayProperties(FileName(m_fileName).name(), this); + = new ControlDisplayProperties(QString::fromStdString(FileName(m_fileName.toStdString()).name()), this); m_id = new QUuid(QUuid::createUuid()); } @@ -273,10 +273,10 @@ namespace Isis { */ void Control::copyToNewProjectRoot(const Project *project, FileName newProjectRoot) { - if (FileName(newProjectRoot).toString() != FileName(project->projectRoot()).toString()) { + if (FileName(newProjectRoot).toString() != FileName(project->projectRoot().toStdString()).toString()) { - QString newNetworkPath = project->cnetRoot(newProjectRoot.toString()) + "/" + - FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name(); + QString newNetworkPath = project->cnetRoot(QString::fromStdString(newProjectRoot.toString())) + "/" + + QString::fromStdString(FileName(m_fileName.toStdString()).dir().filename().string()) + "/" + QString::fromStdString(FileName(m_fileName.toStdString()).name()); // If there is active control & it has been modified, write to disk instead of copying // Leave control net at old location in unmodified state @@ -286,7 +286,7 @@ namespace Isis { } else { QString oldNetworkPath = project->cnetRoot(project->projectRoot()) + "/" + - FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name(); + QString::fromStdString(FileName(m_fileName.toStdString()).dir().filename().string()) + "/" + QString::fromStdString(FileName(m_fileName.toStdString()).name()); if (!QFile::copy(oldNetworkPath,newNetworkPath) ) { throw IException(IException::Io, "Error saving control net.", _FILEINFO_); } @@ -321,7 +321,7 @@ namespace Isis { // If we're the last thing in the folder, remove the folder too. QDir dir; - dir.rmdir(FileName(m_fileName).path()); + dir.rmdir(QString::fromStdString(FileName(m_fileName.toStdString()).path())); m_modified = false; } @@ -335,10 +335,10 @@ namespace Isis { void Control::updateFileName(Project *project) { closeControlNet(); - FileName original(m_fileName); - FileName newName(project->cnetRoot() + "/" + - original.dir().dirName() + "/" + original.name()); - m_fileName = newName.expanded(); + FileName original(m_fileName.toStdString()); + FileName newName(project->cnetRoot().toStdString() + "/" + + original.dir().filename().string() + "/" + original.name()); + m_fileName = QString::fromStdString(newName.expanded()); } @@ -355,7 +355,7 @@ namespace Isis { stream.writeStartElement("controlNet"); stream.writeAttribute("id", m_id->toString()); // Change filename to new path - stream.writeAttribute("fileName", FileName(m_fileName).name()); + stream.writeAttribute("fileName", QString::fromStdString(FileName(m_fileName.toStdString()).name())); m_displayProperties->save(stream, project, newProjectRoot); diff --git a/isis/src/qisis/objs/ControlList/ControlList.cpp b/isis/src/qisis/objs/ControlList/ControlList.cpp index d6dc2f7d5c..ca23d4bf80 100644 --- a/isis/src/qisis/objs/ControlList/ControlList.cpp +++ b/isis/src/qisis/objs/ControlList/ControlList.cpp @@ -588,24 +588,18 @@ namespace Isis { stream.writeAttribute("path", m_path); FileName settingsFileName( - Project::cnetRoot(newProjectRoot.toString()) + "/" + m_path + - "/controlNetworks.xml"); - - if (!settingsFileName.dir().mkpath(settingsFileName.path())) { - throw IException(IException::Io, - QString("Failed to create directory [%1]") - .arg(settingsFileName.path()), - _FILEINFO_); + (Project::cnetRoot(QString::fromStdString(newProjectRoot.toString())) + "/" + m_path + + "/controlNetworks.xml").toStdString()); + + if (!std::filesystem::exists(settingsFileName.dir()) && !std::filesystem::create_directories(settingsFileName.path())) { + throw IException(IException::Io, "Failed to create directory [" + settingsFileName.path() + "]", _FILEINFO_); } - QFile controlListContentsFile(settingsFileName.toString()); + QFile controlListContentsFile(QString::fromStdString(settingsFileName.toString())); if (!controlListContentsFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) { - throw IException(IException::Io, - QString("Unable to save control information for [%1] because [%2] could not be opened " - "for writing") - .arg(m_name).arg(settingsFileName.original()), - _FILEINFO_); + throw IException(IException::Io, "Unable to save control information for [" + m_name.toStdString() + "] because [" + settingsFileName.original() + "] could not be opened " + "for writing", _FILEINFO_); } QXmlStreamWriter controlDetailsWriter(&controlListContentsFile); diff --git a/isis/src/qisis/objs/ControlMeasureEditWidget/ControlMeasureEditWidget.cpp b/isis/src/qisis/objs/ControlMeasureEditWidget/ControlMeasureEditWidget.cpp index be9eb8a6dd..26b2b14214 100644 --- a/isis/src/qisis/objs/ControlMeasureEditWidget/ControlMeasureEditWidget.cpp +++ b/isis/src/qisis/objs/ControlMeasureEditWidget/ControlMeasureEditWidget.cpp @@ -125,7 +125,7 @@ namespace Isis { // grid row int row = 0; - QString tempFileName = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString tempFileName = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); QString toolIconDir = tempFileName; QSize isize(27, 27); @@ -161,32 +161,32 @@ namespace Isis { if ( m_allowLeftMouse ) { // Add arrows for panning leftPanUp = new QToolButton(parent); - leftPanUp->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/up.png"). - expanded())); + leftPanUp->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/up.png"). + expanded()))); leftPanUp->setIconSize(isize); leftPanUp->setToolTip("Move up 1 screen pixel"); leftPanUp->setStatusTip("Move up 1 screen pixel"); leftPanUp->setWhatsThis("Move the left measure up 1 screen pixel."); leftPanDown = new QToolButton(parent); - leftPanDown->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/down.png"). - expanded())); + leftPanDown->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/down.png"). + expanded()))); leftPanDown->setIconSize(isize); leftPanDown->setToolTip("Move down 1 screen pixel"); leftPanDown->setStatusTip("Move down 1 screen pixel"); leftPanDown->setWhatsThis("Move the left measure down 1 screen pixel."); leftPanLeft = new QToolButton(parent); - leftPanLeft->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/back.png"). - expanded())); + leftPanLeft->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/back.png"). + expanded()))); leftPanLeft->setIconSize(isize); leftPanLeft->setToolTip("Move left 1 screen pixel"); leftPanLeft->setWhatsThis("Move the left measure to the left by 1 screen" "pixel."); leftPanRight = new QToolButton(parent); - leftPanRight->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/forward.png"). - expanded())); + leftPanRight->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/forward.png"). + expanded()))); leftPanRight->setIconSize(isize); leftPanRight->setToolTip("Move right 1 screen pixel"); leftPanRight->setWhatsThis("Move the left measure to the right by 1" @@ -208,8 +208,8 @@ namespace Isis { m_rightZoomIn->setWhatsThis("Zoom In 2x on right measure."); m_rightZoomOut = new QToolButton(); - m_rightZoomOut->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/viewmag-.png"). - expanded())); + m_rightZoomOut->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/viewmag-.png"). + expanded()))); m_rightZoomOut->setIconSize(isize); m_rightZoomOut->setToolTip("Zoom Out 2x"); m_rightZoomOut->setWhatsThis("Zoom Out 2x on right measure."); @@ -227,30 +227,30 @@ namespace Isis { // Add arrows for panning QToolButton *rightPanUp = new QToolButton(parent); - rightPanUp->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/up.png"). - expanded())); + rightPanUp->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/up.png"). + expanded()))); rightPanUp->setIconSize(isize); rightPanUp->setToolTip("Move up 1 screen pixel"); rightPanUp->setWhatsThis("Move the right measure up 1 screen pixel."); QToolButton *rightPanDown = new QToolButton(parent); - rightPanDown->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/down.png"). - expanded())); + rightPanDown->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/down.png"). + expanded()))); rightPanDown->setIconSize(isize); rightPanDown->setToolTip("Move down 1 screen pixel"); rightPanUp->setWhatsThis("Move the right measure down 1 screen pixel."); QToolButton *rightPanLeft = new QToolButton(parent); - rightPanLeft->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/back.png"). - expanded())); + rightPanLeft->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/back.png"). + expanded()))); rightPanLeft->setIconSize(isize); rightPanLeft->setToolTip("Move left 1 screen pixel"); rightPanLeft->setWhatsThis("Move the right measure to the left by 1 screen" "pixel."); QToolButton *rightPanRight = new QToolButton(parent); - rightPanRight->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/forward.png"). - expanded())); + rightPanRight->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/forward.png"). + expanded()))); rightPanRight->setIconSize(isize); rightPanRight->setToolTip("Move right 1 screen pixel"); rightPanRight->setWhatsThis("Move the right measure to the right by 1" @@ -855,7 +855,7 @@ namespace Isis { } catch (IException &e) { IException fullError(e, IException::User, "Geom failed.", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); m_rightChip->Load(*m_rightCube); m_geomIt = false; @@ -1000,7 +1000,7 @@ namespace Isis { colorizeSaveButton(); } else { - QString message = "Latitude: " + QString::number(lat) + " Longitude: " + + std::string message = "Latitude: " + QString::number(lat) + " Longitude: " + QString::number(lon) + " is not on the right image. Right measure " + "was not moved."; QMessageBox::warning((QWidget *)parent(),"Warning",message); @@ -1052,7 +1052,7 @@ namespace Isis { "Cannot create AutoRegFactory. As a result, " "sub-pixel registration will not work.", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); return; } @@ -1093,7 +1093,7 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Cannot register this point, unable to Load chips.\n"; + std::string msg = "Cannot register this point, unable to Load chips.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; @@ -1102,7 +1102,7 @@ namespace Isis { try { AutoReg::RegisterStatus status = m_autoRegFact->Register(); if ( !m_autoRegFact->Success() ) { - QString msg = "Cannot sub-pixel register this point.\n"; + std::string msg = "Cannot sub-pixel register this point.\n"; if ( status == AutoReg::PatternChipNotEnoughValidData ) { msg += "\n\nNot enough valid data in Pattern Chip.\n"; msg += " PatternValidPercent = "; @@ -1152,7 +1152,7 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Cannot register this point.\n"; + std::string msg = "Cannot register this point.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; @@ -1228,7 +1228,7 @@ namespace Isis { if ( m_rightMeasure != NULL ) { if (m_rightMeasure->IsEditLocked()) { - QString message = "The right measure is locked. You must first unlock the measure by "; + std::string message = "The right measure is locked. You must first unlock the measure by "; message += "clicking the check box above labeled \"Edit Lock Measure\"."; QMessageBox::warning((QWidget *)parent(),"Warning",message); return; @@ -1253,7 +1253,7 @@ namespace Isis { // need to handle exception that SetLogData throws if our data is invalid - // unhandled exceptions thrown in Qt signal and slot connections produce undefined behavior catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::critical((QWidget *)parent(), "Error", message); return; } @@ -1294,7 +1294,7 @@ namespace Isis { if ( m_allowLeftMouse ) { if ( m_leftMeasure != NULL ) { if (m_leftMeasure->IsEditLocked()) { - QString message = "The left measure is locked. You must first unlock the measure by "; + std::string message = "The left measure is locked. You must first unlock the measure by "; message += "clicking the check box above labeled \"Edit Lock Measure\"."; QMessageBox::warning((QWidget *)parent(),"Warning",message); return; @@ -1341,7 +1341,7 @@ namespace Isis { } catch (IException &e) { IException fullError(e, IException::User, "Geom failed.", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); m_geomIt = false; m_nogeom->setChecked(true); @@ -1369,7 +1369,7 @@ namespace Isis { // } // catch (IException &e) { // IException fullError(e, IException::User, "Geom failed.", _FILEINFO_); -// QString message = fullError.toString(); +// std::string message = fullError.toString(); // QMessageBox::information((QWidget *)parent(), "Error", message); // m_geomIt = false; // m_nogeom->setChecked(true); @@ -1456,7 +1456,7 @@ namespace Isis { } catch (IException &e) { IException fullError(e, IException::User, "Geom failed.", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); m_geomIt = false; m_nogeom->setChecked(true); @@ -1650,7 +1650,7 @@ namespace Isis { fn + ". As a result, current template file will remain set to " + m_templateFileName, _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); emit setTemplateFailed(m_templateFileName); return false; @@ -1706,7 +1706,7 @@ namespace Isis { // if (!m_autoRegShown) { if ( !m_autoRegAttempted ) { - QString message = "Point must be Registered before chips can be saved."; + std::string message = "Point must be Registered before chips can be saved."; QMessageBox::warning((QWidget *)parent(), "Warning", message); return; } @@ -1785,7 +1785,7 @@ namespace Isis { for (int i=0; itext(); QString serial = m_serialNumberList->serialNumber(file); - Cube *blinkCube = new Cube(selected.at(i)->text()); + Cube *blinkCube = new Cube(selected.at(i)->text().toStdString()); Chip *blinkChip = new Chip(VIEWSIZE, VIEWSIZE); ControlMeasure *blinkMeasure = m_editPoint->GetMeasure(serial); blinkChip->TackCube(blinkMeasure->GetSample(), blinkMeasure->GetLine()); diff --git a/isis/src/qisis/objs/ControlNetTool/ControlNetTool.cpp b/isis/src/qisis/objs/ControlNetTool/ControlNetTool.cpp index dbb58fc635..b421750e78 100644 --- a/isis/src/qisis/objs/ControlNetTool/ControlNetTool.cpp +++ b/isis/src/qisis/objs/ControlNetTool/ControlNetTool.cpp @@ -151,7 +151,7 @@ namespace Isis { if (s == Qt::LeftButton) { if (isGroundSource) { - QString message = "Cannot select point for editing on ground source. Select "; + std::string message = "Cannot select point for editing on ground source. Select "; message += "point using un-projected images or the Cnet Editor View (choose \"View Network\" "; message += "from the context menu for control nets on the project tree)."; QMessageBox::critical(m_ControlNetTool, "Error", message); @@ -165,7 +165,7 @@ namespace Isis { emit modifyControlPoint(point, sn); } catch (IException &ie) { - QString message = "No points exist for editing. Create points using the right mouse"; + std::string message = "No points exist for editing. Create points using the right mouse"; message += " button."; QMessageBox::warning(m_ControlNetTool, "Warning", message); return; @@ -175,14 +175,14 @@ namespace Isis { else if (s == Qt::MiddleButton) { if (!m_controlNet || m_controlNet->GetNumPoints() == 0) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_ControlNetTool, "Warning", message); return; } if (isGroundSource) { - QString message = "Cannot select point for deleting on ground source. Select "; + std::string message = "Cannot select point for deleting on ground source. Select "; message += "point using un-projected images or the Cnet Editor View (choose \"View Network\" "; message += "from the context menu for control nets on the project tree)."; QMessageBox::critical(m_ControlNetTool, "Error", message); @@ -195,14 +195,14 @@ namespace Isis { point = m_controlNet->FindClosest(sn, samp, line); if (point == NULL) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_ControlNetTool, "Warning", message); return; } } catch (IException &e) { - QString message = "Cannot find point on this image for deleting."; + std::string message = "Cannot find point on this image for deleting."; QMessageBox::critical(m_ControlNetTool, "Error", message); return; } @@ -213,7 +213,7 @@ namespace Isis { UniversalGroundMap *gmap = cvp->universalGroundMap(); if (!gmap->SetImage(samp,line)) { - QString message = "Invalid latitude or longitude at this point. "; + std::string message = "Invalid latitude or longitude at this point. "; QMessageBox::critical(NULL, "Error", message); return; } diff --git a/isis/src/qisis/objs/ControlPointEdit/ControlPointEdit.cpp b/isis/src/qisis/objs/ControlPointEdit/ControlPointEdit.cpp index c40a474b8d..cfbf568f42 100644 --- a/isis/src/qisis/objs/ControlPointEdit/ControlPointEdit.cpp +++ b/isis/src/qisis/objs/ControlPointEdit/ControlPointEdit.cpp @@ -122,7 +122,7 @@ namespace Isis { // grid row int row = 0; - QString tempFileName = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString tempFileName = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); QString toolIconDir = tempFileName; QSize isize(27, 27); @@ -158,32 +158,32 @@ namespace Isis { if (p_allowLeftMouse) { // Add arrows for panning leftPanUp = new QToolButton(parent); - leftPanUp->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/up.png"). - expanded())); + leftPanUp->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/up.png"). + expanded()))); leftPanUp->setIconSize(isize); leftPanUp->setToolTip("Move up 1 screen pixel"); leftPanUp->setStatusTip("Move up 1 screen pixel"); leftPanUp->setWhatsThis("Move the left measure up 1 screen pixel."); leftPanDown = new QToolButton(parent); - leftPanDown->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/down.png"). - expanded())); + leftPanDown->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/down.png"). + expanded()))); leftPanDown->setIconSize(isize); leftPanDown->setToolTip("Move down 1 screen pixel"); leftPanDown->setStatusTip("Move down 1 screen pixel"); leftPanDown->setWhatsThis("Move the left measure down 1 screen pixel."); leftPanLeft = new QToolButton(parent); - leftPanLeft->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/back.png"). - expanded())); + leftPanLeft->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/back.png"). + expanded()))); leftPanLeft->setIconSize(isize); leftPanLeft->setToolTip("Move left 1 screen pixel"); leftPanLeft->setWhatsThis("Move the left measure to the left by 1 screen" "pixel."); leftPanRight = new QToolButton(parent); - leftPanRight->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/forward.png"). - expanded())); + leftPanRight->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/forward.png"). + expanded()))); leftPanRight->setIconSize(isize); leftPanRight->setToolTip("Move right 1 screen pixel"); leftPanRight->setWhatsThis("Move the left measure to the right by 1" @@ -205,8 +205,8 @@ namespace Isis { p_rightZoomIn->setWhatsThis("Zoom In 2x on right measure."); p_rightZoomOut = new QToolButton(); - p_rightZoomOut->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/viewmag-.png"). - expanded())); + p_rightZoomOut->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/viewmag-.png"). + expanded()))); p_rightZoomOut->setIconSize(isize); p_rightZoomOut->setToolTip("Zoom Out 2x"); p_rightZoomOut->setWhatsThis("Zoom Out 2x on right measure."); @@ -224,30 +224,30 @@ namespace Isis { // Add arrows for panning QToolButton *rightPanUp = new QToolButton(parent); - rightPanUp->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/up.png"). - expanded())); + rightPanUp->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/up.png"). + expanded()))); rightPanUp->setIconSize(isize); rightPanUp->setToolTip("Move up 1 screen pixel"); rightPanUp->setWhatsThis("Move the right measure up 1 screen pixel."); QToolButton *rightPanDown = new QToolButton(parent); - rightPanDown->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/down.png"). - expanded())); + rightPanDown->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/down.png"). + expanded()))); rightPanDown->setIconSize(isize); rightPanDown->setToolTip("Move down 1 screen pixel"); rightPanUp->setWhatsThis("Move the right measure down 1 screen pixel."); QToolButton *rightPanLeft = new QToolButton(parent); - rightPanLeft->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/back.png"). - expanded())); + rightPanLeft->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/back.png"). + expanded()))); rightPanLeft->setIconSize(isize); rightPanLeft->setToolTip("Move left 1 screen pixel"); rightPanLeft->setWhatsThis("Move the right measure to the left by 1 screen" "pixel."); QToolButton *rightPanRight = new QToolButton(parent); - rightPanRight->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/forward.png"). - expanded())); + rightPanRight->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/forward.png"). + expanded()))); rightPanRight->setIconSize(isize); rightPanRight->setToolTip("Move right 1 screen pixel"); rightPanRight->setWhatsThis("Move the right measure to the right by 1" @@ -756,7 +756,7 @@ namespace Isis { } catch (IException &e) { IException fullError(e, IException::User, "Geom failed.", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); p_rightChip->Load(*p_rightCube); p_geomIt = false; @@ -900,7 +900,7 @@ namespace Isis { colorizeSaveButton(); } else { - QString message = "Latitude: " + QString::number(lat) + " Longitude: " + + std::string message = "Latitude: " + QString::number(lat) + " Longitude: " + QString::number(lon) + " is not on the right image. Right measure " + "was not moved."; QMessageBox::warning((QWidget *)parent(),"Warning",message); @@ -952,7 +952,7 @@ namespace Isis { "Cannot create AutoRegFactory. As a result, " "sub-pixel registration will not work.", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); return; } @@ -991,7 +991,7 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Cannot register this point, unable to Load chips.\n"; + std::string msg = "Cannot register this point, unable to Load chips.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; @@ -1000,7 +1000,7 @@ namespace Isis { try { AutoReg::RegisterStatus status = p_autoRegFact->Register(); if (!p_autoRegFact->Success()) { - QString msg = "Cannot sub-pixel register this point.\n"; + std::string msg = "Cannot sub-pixel register this point.\n"; if (status == AutoReg::PatternChipNotEnoughValidData) { msg += "\n\nNot enough valid data in Pattern Chip.\n"; msg += " PatternValidPercent = "; @@ -1050,7 +1050,7 @@ namespace Isis { } } catch (IException &e) { - QString msg = "Cannot register this point.\n"; + std::string msg = "Cannot register this point.\n"; msg += e.toString(); QMessageBox::information((QWidget *)parent(), "Error", msg); return; @@ -1121,7 +1121,7 @@ namespace Isis { if (p_rightMeasure != NULL) { if (p_rightMeasure->IsEditLocked()) { - QString message = "The right measure is locked. You must first unlock the measure by "; + std::string message = "The right measure is locked. You must first unlock the measure by "; message += "clicking the check box above labeled \"Edit Lock Measure\"."; QMessageBox::warning((QWidget *)parent(),"Warning",message); return; @@ -1146,7 +1146,7 @@ namespace Isis { // need to handle exception that SetLogData throws if our data is invalid - // unhandled exceptions thrown in Qt signal and slot connections produce undefined behavior catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::critical((QWidget *)parent(), "Error", message); return; } @@ -1187,7 +1187,7 @@ namespace Isis { if (p_allowLeftMouse) { if (p_leftMeasure != NULL) { if (p_leftMeasure->IsEditLocked()) { - QString message = "The left measure is locked. You must first unlock the measure by "; + std::string message = "The left measure is locked. You must first unlock the measure by "; message += "clicking the check box above labeled \"Edit Lock Measure\"."; QMessageBox::warning((QWidget *)parent(),"Warning",message); return; @@ -1233,7 +1233,7 @@ namespace Isis { } catch (IException &e) { IException fullError(e, IException::User, "Geom failed.", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); p_geomIt = false; p_nogeom->setChecked(true); @@ -1260,7 +1260,7 @@ namespace Isis { // } // catch (IException &e) { // IException fullError(e, IException::User, "Geom failed.", _FILEINFO_); -// QString message = fullError.toString(); +// std::string message = fullError.toString(); // QMessageBox::information((QWidget *)parent(), "Error", message); // p_geomIt = false; // p_nogeom->setChecked(true); @@ -1344,7 +1344,7 @@ namespace Isis { } catch (IException &e) { IException fullError(e, IException::User, "Geom failed.", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); p_geomIt = false; p_nogeom->setChecked(true); @@ -1538,7 +1538,7 @@ namespace Isis { fn + ". As a result, current template file will remain set to " + p_templateFileName, _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::information((QWidget *)parent(), "Error", message); return false; } @@ -1591,7 +1591,7 @@ namespace Isis { // if (!p_autoRegShown) { if (!p_autoRegAttempted) { - QString message = "Point must be Registered before chips can be saved."; + std::string message = "Point must be Registered before chips can be saved."; QMessageBox::warning((QWidget *)parent(), "Warning", message); return; } diff --git a/isis/src/qisis/objs/ControlPointEditWidget/ControlPointEditWidget.cpp b/isis/src/qisis/objs/ControlPointEditWidget/ControlPointEditWidget.cpp index 00fc323d39..00e701816f 100644 --- a/isis/src/qisis/objs/ControlPointEditWidget/ControlPointEditWidget.cpp +++ b/isis/src/qisis/objs/ControlPointEditWidget/ControlPointEditWidget.cpp @@ -239,7 +239,7 @@ namespace Isis { foreach(TemplateList *templateList, regTemplates) { foreach(Template *templateFile, *templateList){ m_templateComboBox->addItem(templateFile->importName() - + "/" + FileName(templateFile->fileName()).name()); + + "/" + QString::fromStdString(FileName(templateFile->fileName().toStdString()).name())); } } QFormLayout *templateFileLayout = new QFormLayout(); @@ -507,7 +507,7 @@ namespace Isis { */ void ControlPointEditWidget::createActions() { - m_closePointEditor = new QAction(QIcon(FileName("base/icons/fileclose.png").expanded()), + m_closePointEditor = new QAction(QIcon(QString::fromStdString(FileName("base/icons/fileclose.png").expanded())), "&Close", this); m_closePointEditor->setToolTip("Close this window"); m_closePointEditor->setStatusTip("Close this window"); @@ -517,7 +517,7 @@ namespace Isis { m_closePointEditor->setWhatsThis(whatsThis); connect(m_closePointEditor, SIGNAL(triggered()), this, SLOT(close())); - m_showHideTemplateEditor = new QAction(QIcon(FileName("base/icons/view_text.png").expanded()), + m_showHideTemplateEditor = new QAction(QIcon(QString::fromStdString(FileName("base/icons/view_text.png").expanded())), "&View/edit registration template", this); m_showHideTemplateEditor->setCheckable(true); m_showHideTemplateEditor->setToolTip("View and/or edit the registration template"); @@ -528,7 +528,7 @@ namespace Isis { connect(m_showHideTemplateEditor, SIGNAL(triggered()), this, SLOT(showHideTemplateEditor())); - m_saveChips = new QAction(QIcon(FileName("base/icons/window_new.png").expanded()), + m_saveChips = new QAction(QIcon(QString::fromStdString(FileName("base/icons/window_new.png").expanded())), "Save registration chips", this); m_saveChips->setToolTip("Save registration chips"); m_saveChips->setStatusTip("Save registration chips"); @@ -537,7 +537,7 @@ namespace Isis { m_saveChips->setWhatsThis(whatsThis); connect(m_saveChips, SIGNAL(triggered()), this, SLOT(saveChips())); - m_openTemplateFile = new QAction(QIcon(FileName("base/icons/fileopen.png").expanded()), + m_openTemplateFile = new QAction(QIcon(QString::fromStdString(FileName("base/icons/fileopen.png").expanded())), "&Open registration template", this); m_openTemplateFile->setToolTip("Set registration template"); m_openTemplateFile->setStatusTip("Set registration template"); @@ -546,7 +546,7 @@ namespace Isis { m_openTemplateFile->setWhatsThis(whatsThis); connect(m_openTemplateFile, SIGNAL(triggered()), this, SLOT(openTemplateFile())); - m_saveTemplateFile = new QAction(QIcon(FileName("base/icons/mActionFileSave.png").expanded()), + m_saveTemplateFile = new QAction(QIcon(QString::fromStdString(FileName("base/icons/mActionFileSave.png").expanded())), "&Save template file", this); m_saveTemplateFile->setToolTip("Save the template file"); m_saveTemplateFile->setStatusTip("Save the template file"); @@ -554,7 +554,7 @@ namespace Isis { connect(m_saveTemplateFile, SIGNAL(triggered()), this, SLOT(saveTemplateFile())); - m_saveTemplateFileAs = new QAction(QIcon(FileName("base/icons/mActionFileSaveAs.png").expanded()), + m_saveTemplateFileAs = new QAction(QIcon(QString::fromStdString(FileName("base/icons/mActionFileSaveAs.png").expanded())), "&Save template as...", this); m_saveTemplateFileAs->setToolTip("Save the template file as"); m_saveTemplateFileAs->setStatusTip("Save the template file as"); @@ -725,7 +725,7 @@ namespace Isis { // Add to measure combo boxes QString groundFile = m_serialNumberList->fileName(groundMeasure->GetCubeSerialNumber()); - QString tempFileName = FileName(groundFile).name(); + QString tempFileName = QString::fromStdString(FileName(groundFile.toStdString()).name()); m_pointFiles<addItem(tempFileName); @@ -780,7 +780,7 @@ namespace Isis { // Try to locate point position on current ground source, if (!m_groundGmap->SetUniversalGround(lat,lon)) { - QString message = "This point does not exist on the ground source.\n"; + std::string message = "This point does not exist on the ground source.\n"; message += "Latitude = " + QString::number(lat); message += " Longitude = " + QString::number(lon); message += "\n A ground measure will not be created."; @@ -823,13 +823,13 @@ namespace Isis { // Chosen ground source is an imported shape in project if (m_groundSourceCombo->currentText().contains(".ecub")) { Shape *shape = m_nameToShapeMap[m_groundSourceCombo->currentText()]; - groundFile = FileName(shape->fileName()); + groundFile = FileName(shape->fileName().toStdString()); //groundSourceType = shape->surfacePointSource(); success = true; } // Not imported shape, must be from m_editPoints AprioriXYZSource in the cnet else if (m_editPoint->HasAprioriSurfacePointSourceFile()) { - groundFile = FileName(m_groundSourceCombo->currentText()); + groundFile = FileName(m_groundSourceCombo->currentText().toStdString()); // Apriori ground source does not exist and user chose not to give new location so simply // return unsuccessful if (!groundFile.fileExists()) { @@ -845,9 +845,9 @@ namespace Isis { // If a new ground file was found set ground source information for later use, first clearing // out the old ground source information. If new ground same as old ground, we will not change // anything, simply return successful. - if (success && (groundFile.expanded() != m_groundFilename)) { + if (success && (QString::fromStdString(groundFile.expanded()) != m_groundFilename)) { clearGroundSource(); - m_groundFilename = groundFile.expanded(); + m_groundFilename = QString::fromStdString(groundFile.expanded()); // Get cube, then universal groundmap QScopedPointer groundCube(new Cube(groundFile, "r")); @@ -856,7 +856,7 @@ namespace Isis { m_groundGmap.reset(newGroundGmap.take()); // Create new serial number for ground source and add to serial number list - m_groundSN = SerialNumber::Compose(groundFile.expanded(), true); + m_groundSN = SerialNumber::Compose(QString::fromStdString(groundFile.expanded()), true); m_serialNumberList->add(m_groundFilename, true); m_groundSourceType = groundSourceType; @@ -891,10 +891,10 @@ namespace Isis { // fix this ground source to new location // If all groundLocations are to be changed... if (m_changeAllGroundLocation) { - QFileInfo oldFile(groundFile.expanded()); + QFileInfo oldFile(QString::fromStdString(groundFile.expanded())); QFileInfo newFile(m_newGroundDir, oldFile.fileName()); - newGroundFile = FileName(newFile.absoluteFilePath()); + newGroundFile = FileName(newFile.absoluteFilePath().toStdString()); } // If can't find ground, re-prompt user for new location. Maybe it's a new ground source. @@ -902,10 +902,10 @@ namespace Isis { // Give options for finding ground source file location. A new location // for new location or new source, either a Shape in the project, or import a new shape, // or simplay choose file? - QString message = "Ground Source file " + groundFile.expanded(); + std::string message = "Ground Source file " + groundFile.expanded(); message += " doesn't exist. Has the file moved? Would you like to enter a new location for" " this ground source?"; - int ret = QMessageBox::question(this, "Ground Source not found", message); + int ret = QMessageBox::question(this, "Ground Source not found", QString::fromStdString(message)); if (ret == QMessageBox::Yes) { QString dir = m_directory->project()->shapeDataRoot(); NewGroundSourceLocationDialog *dialog = new NewGroundSourceLocationDialog( @@ -919,10 +919,10 @@ namespace Isis { changeGroundLocationsInNet(); } // Change location of apriori for current edit point so combo boxes updated properly - QFileInfo oldFile(groundFile.expanded()); + QFileInfo oldFile(QString::fromStdString(groundFile.expanded())); QFileInfo newFile(m_newGroundDir, oldFile.fileName()); - newGroundFile = newFile.absoluteFilePath(); - m_editPoint->SetAprioriSurfacePointSourceFile(newGroundFile.toString()); + newGroundFile = newFile.absoluteFilePath().toStdString(); + m_editPoint->SetAprioriSurfacePointSourceFile(QString::fromStdString(newGroundFile.toString())); } else { // Either user does not want to change location of ground source or the new location @@ -951,11 +951,11 @@ namespace Isis { for (int i = 0; i < m_controlNet->GetNumPoints(); i++ ) { ControlPoint *cp = m_controlNet->GetPoint(i); if (cp->HasAprioriSurfacePointSourceFile()) { - FileName groundFile(cp->GetAprioriSurfacePointSourceFile()); - QFileInfo oldFile(groundFile.expanded()); + FileName groundFile(cp->GetAprioriSurfacePointSourceFile().toStdString()); + QFileInfo oldFile(QString::fromStdString(groundFile.expanded())); QFileInfo newFile(m_newGroundDir, oldFile.fileName()); - groundFile = newFile.absoluteFilePath(); - cp->SetAprioriSurfacePointSourceFile(groundFile.expanded()); + groundFile = newFile.absoluteFilePath().toStdString(); + cp->SetAprioriSurfacePointSourceFile(QString::fromStdString(groundFile.expanded())); } } emit cnetModified(); @@ -973,7 +973,7 @@ namespace Isis { //Get the reference image's shape model QString referenceSN = m_editPoint->GetReferenceSN(); QString referenceFileName = m_serialNumberList->fileName(referenceSN); - QScopedPointer referenceCube(new Cube(referenceFileName, "r")); + QScopedPointer referenceCube(new Cube(referenceFileName.toStdString(), "r")); PvlGroup kernels = referenceCube->group("Kernels"); QString shapeFile = QString::fromStdString(kernels["ShapeModel"]); @@ -1028,9 +1028,9 @@ namespace Isis { QApplication::setOverrideCursor(Qt::WaitCursor); try { - QScopedPointer newDemCube(new Cube(demFile, "r")); + QScopedPointer newDemCube(new Cube(demFile.toStdString(), "r")); - m_demFile = FileName(newDemCube->fileName()).name(); + m_demFile = QString::fromStdString(FileName(newDemCube->fileName().toStdString()).name()); m_demCube.reset(newDemCube.take()); } catch (IException &e) { @@ -1042,7 +1042,7 @@ namespace Isis { // Make sure this is a dem if (!m_demCube->hasTable("ShapeModelStatistics")) { - QString message = m_demFile + " is not a DEM."; + std::string message = m_demFile + " is not a DEM."; QMessageBox::critical(this, "Error", message); m_demCube.reset(NULL); m_demOpen = false; @@ -1279,14 +1279,14 @@ namespace Isis { // If available, add the CP AprioriSurfacePointSourceFile and AprioriRadiusSourceFile if (m_editPoint->HasAprioriSurfacePointSourceFile()) { - FileName aprioriSurfacePointFile = FileName(m_editPoint->GetAprioriSurfacePointSourceFile()); + FileName aprioriSurfacePointFile = FileName(m_editPoint->GetAprioriSurfacePointSourceFile().toStdString()); // If file doesn't exist, prompt user for changing location before adding to combo if (!aprioriSurfacePointFile.fileExists()) { aprioriSurfacePointFile = checkGroundFileLocation(aprioriSurfacePointFile); } - if (!aprioriSurfacePointFile.toString().isEmpty()) { - m_groundSourceCombo->addItem(aprioriSurfacePointFile.toString()); - m_groundSourceCombo->setCurrentText(aprioriSurfacePointFile.toString()); + if (!aprioriSurfacePointFile.toString().empty()) { + m_groundSourceCombo->addItem(QString::fromStdString(aprioriSurfacePointFile.toString())); + m_groundSourceCombo->setCurrentText(QString::fromStdString(aprioriSurfacePointFile.toString())); m_groundSourceCombo->setItemData(m_groundSourceCombo->currentIndex(), QColor(Qt::darkGreen), Qt::ForegroundRole); m_groundSourceCombo->setItemData(m_groundSourceCombo->currentIndex(), @@ -1360,7 +1360,7 @@ namespace Isis { ControlMeasure &m = *(*m_editPoint)[i]; QString file = m_serialNumberList->fileName(m.GetCubeSerialNumber()); m_pointFiles<fileName(serialNumber); - rightIndex = m_rightCombo->findText(FileName(file).name()); + rightIndex = m_rightCombo->findText(QString::fromStdString(FileName(file.toStdString()).name())); if (leftIndex == -1) { if (rightIndex == 0) { leftIndex = 1; @@ -1504,7 +1504,7 @@ namespace Isis { // If this ControlPointId already exists, message box pops up and user is // asked to enter a new value. if (m_controlNet->ContainsPoint(newPoint->GetId())) { - QString message = "A ControlPoint with Point Id = [" + newPoint->GetId(); + std::string message = "A ControlPoint with Point Id = [" + newPoint->GetId(); message += "] already exists. Re-enter Point Id for this ControlPoint."; QMessageBox::warning(this, "New Point Id", message); pointFiles.clear(); @@ -1548,7 +1548,7 @@ namespace Isis { else { newPoint->SetAprioriSurfacePointSource(ControlPoint::SurfacePointSource::None); } - newPoint->SetAprioriSurfacePointSourceFile(shape->cube()->externalCubeFileName().expanded()); + newPoint->SetAprioriSurfacePointSourceFile(QString::fromStdString(shape->cube()->externalCubeFileName().expanded())); } setEditPoint(newPoint); @@ -1595,7 +1595,7 @@ namespace Isis { // If all measures being deleted, let user know and give them the option to quit operation if (!deletePointDialog->deleteAllCheckBox->isChecked()) { - QString message = "You have selected all measures in this point to be deleted. This " + std::string message = "You have selected all measures in this point to be deleted. This " "control point will be deleted. Do you want to delete this control point?"; int response = QMessageBox::question(this, "Delete control point", message, @@ -1633,7 +1633,7 @@ namespace Isis { if (m_editPoint->IsReferenceExplicit() && (m_editPoint->GetRefMeasure()->GetCubeSerialNumber() == (*m_editPoint)[i]->GetCubeSerialNumber())) { - QString message = "You are trying to delete the Reference measure." + std::string message = "You are trying to delete the Reference measure." " Do you really want to delete the Reference measure?"; switch (QMessageBox::question(this, "Delete Reference measure?", message, @@ -1758,7 +1758,7 @@ namespace Isis { } if (m_editPoint->IsIgnored()) { - QString message = "You are saving changes to a measure on an ignored "; + std::string message = "You are saving changes to a measure on an ignored "; message += "point. Do you want to set Ignore = False on the point and "; message += "both measures?"; switch (QMessageBox::question(this, "Save Measure", message, "&Yes", "&No", 0, 0)) { @@ -1803,14 +1803,14 @@ namespace Isis { m_rightMeasure->GetCubeSerialNumber() == m_groundSN)) { // If point is locked and it is not a new point, print error if (m_editPoint->IsEditLocked() && m_controlNet->ContainsPoint(m_editPoint->GetId())) { - QString message = "This control point is edit locked. The Apriori latitude, longitude and "; + std::string message = "This control point is edit locked. The Apriori latitude, longitude and "; message += "radius cannot be updated. You must first unlock the point by clicking the "; message += "check box above labeled \"Edit Lock Point\"."; QMessageBox::warning(this, "Point Locked", message); return; } if (m_leftMeasure->IsIgnored()) { - QString message = "This is a Constrained or Fixed point and the reference measure is "; + std::string message = "This is a Constrained or Fixed point and the reference measure is "; message += "Ignored. Unset the Ignore flag on the reference measure before saving."; QMessageBox::warning(this, "Point Locked", message); return; @@ -1869,7 +1869,7 @@ namespace Isis { // if this is a reference measure. The check for moving a reference is // done below. if (origMeasure->IsEditLocked() && m->IsEditLocked()) { - QString message = "The " + side + " measure is editLocked "; + std::string message = "The " + side + " measure is editLocked "; message += "for editing. Do you want to set EditLock = False for this "; message += "measure?"; int response = QMessageBox::question(this, "Save Measure", @@ -1891,7 +1891,7 @@ namespace Isis { } if (origMeasure->IsIgnored() && m->IsIgnored()) { - QString message = "The " + side + "measure is ignored. "; + std::string message = "The " + side + "measure is ignored. "; message += "Do you want to set Ignore = False on the measure?"; switch (QMessageBox::question(this, "Save Measure", message, "&Yes", "&No", 0, 0)) { // Yes: set Ignore=false for the right measure and save point @@ -1914,7 +1914,7 @@ namespace Isis { if (m_editPoint->IsReferenceExplicit()) { if (refMeasure->GetCubeSerialNumber() == m->GetCubeSerialNumber()) { if (m->GetSample() != origMeasure->GetSample() || m->GetLine() != origMeasure->GetLine()) { - QString message = "You are making a change to the reference measure. You "; + std::string message = "You are making a change to the reference measure. You "; message += "may need to move all of the other measures to match the new "; message += " coordinate of the reference measure. Do you really want to "; message += " change the reference measure's location? "; @@ -1935,7 +1935,7 @@ namespace Isis { } // New reference measure else if (side == "left" && (refMeasure->GetCubeSerialNumber() != m->GetCubeSerialNumber())) { - QString message = "This point already contains a reference measure. "; + std::string message = "This point already contains a reference measure. "; message += "Would you like to replace it with the measure on the left?"; int response = QMessageBox::question(this, "Save Measure", message, @@ -1946,7 +1946,7 @@ namespace Isis { // Update measure file combo boxes: old reference normal font, // new reference bold font QString file = m_serialNumberList->fileName(m_leftMeasure->GetCubeSerialNumber()); - QString fname = FileName(file).name(); + QString fname = QString::fromStdString(FileName(file.toStdString()).name()); int iref = m_leftCombo->findText(fname); // Save normal font from new reference measure @@ -1956,7 +1956,7 @@ namespace Isis { m_rightCombo->setItemData(iref,QFont("DejaVu Sans", 12, QFont::Bold), Qt::FontRole); file = m_serialNumberList->fileName(refMeasure->GetCubeSerialNumber()); - fname = FileName(file).name(); + fname = QString::fromStdString(FileName(file.toStdString()).name()); iref = m_leftCombo->findText(fname); m_leftCombo->setItemData(iref,font,Qt::FontRole); iref = m_rightCombo->findText(fname); @@ -1996,7 +1996,7 @@ namespace Isis { // measure as reference. ControlMeasure *refMeasure = m_editPoint->GetRefMeasure(); if (refMeasure->GetCubeSerialNumber() != m_leftMeasure->GetCubeSerialNumber()) { - QString message = "This point already contains a reference measure. "; + std::string message = "This point already contains a reference measure. "; message += "Would you like to replace it with the measure on the left?"; int response = QMessageBox::question(this, "Match Tool Save Measure", message, @@ -2007,7 +2007,7 @@ namespace Isis { // Update measure file combo boxes: old reference normal font, // new reference bold font QString file = m_serialNumberList->fileName(m_leftMeasure->GetCubeSerialNumber()); - QString fname = FileName(file).name(); + QString fname = QString::fromStdString(FileName(file.toStdString()).name()); int iref = m_leftCombo->findText(fname); // Save normal font from new reference measure @@ -2017,7 +2017,7 @@ namespace Isis { m_rightCombo->setItemData(iref,QFont("DejaVu Sans", 12, QFont::Bold), Qt::FontRole); file = m_serialNumberList->fileName(refMeasure->GetCubeSerialNumber()); - fname = FileName(file).name(); + fname = QString::fromStdString(FileName(file.toStdString()).name()); iref = m_leftCombo->findText(fname); m_leftCombo->setItemData(iref,font,Qt::FontRole); iref = m_rightCombo->findText(fname); @@ -2067,7 +2067,7 @@ namespace Isis { else { Shape *shape = m_nameToShapeMap[m_radiusSourceCombo->currentText()]; if (shape) { - m_radiusFilename = shape->cube()->externalCubeFileName().toString(); + m_radiusFilename = QString::fromStdString(shape->cube()->externalCubeFileName().toString()); //m_radiusSourceType = shape->radiusSource(); } // Radius source comes from what is already saved in the cnet as AprioriRadiusSourceFile @@ -2089,7 +2089,7 @@ namespace Isis { if (m_demOpen) { radius = demRadius(lat,lon); if (radius == Null) { - QString msg = "Could not read radius from DEM, will default to " + std::string msg = "Could not read radius from DEM, will default to " "local radius of reference measure."; QMessageBox::warning(this, "Warning", msg); if (m_editPoint->GetRefMeasure()->Camera()->SetGround(Latitude(lat, Angle::Degrees), @@ -2100,7 +2100,7 @@ namespace Isis { m_editPoint->SetAprioriRadiusSource(ControlPoint::RadiusSource::None); } else { - QString message = "Error trying to get radius at this pt. " + std::string message = "Error trying to get radius at this pt. " "Lat/Lon does not fall on the reference measure. " "Cannot save this measure."; QMessageBox::critical(this,"Error",message); @@ -2117,7 +2117,7 @@ namespace Isis { radius = m_editPoint->GetRefMeasure()->Camera()->LocalRadius().meters(); } else { - QString message = "Error trying to get radius at this pt. " + std::string message = "Error trying to get radius at this pt. " "Lat/Lon does not fall on the reference measure. " "Cannot save this measure."; QMessageBox::critical(this,"Error",message); @@ -2148,7 +2148,7 @@ namespace Isis { } } catch (IException &e) { - QString message = "Unable to set Apriori Surface Point.\n"; + std::string message = "Unable to set Apriori Surface Point.\n"; message += "Latitude = " + QString::number(lat); message += " Longitude = " + QString::number(lon); message += " Radius = " + QString::number(radius) + "\n"; @@ -2161,7 +2161,7 @@ namespace Isis { QString fullGroundFilename; if (m_groundFilename.contains(".ecub")) { // Find shape to get external cube filename - fullGroundFilename = m_nameToShapeMap[m_groundFilename]->cube()->externalCubeFileName().expanded(); + fullGroundFilename = QString::fromStdString(m_nameToShapeMap[m_groundFilename]->cube()->externalCubeFileName().expanded()); } else { fullGroundFilename = m_groundFilename; @@ -2255,7 +2255,7 @@ namespace Isis { // Error check ignored and locked status if (pointType != ControlPoint::Free && m_leftMeasure->IsIgnored()) { m_pointTypeCombo->setCurrentIndex((int) m_editPoint->GetType()); - QString message = "The reference measure is Ignored. Unset the Ignore flag on the "; + std::string message = "The reference measure is Ignored. Unset the Ignore flag on the "; message += "reference measure before setting the point type to Constrained or Fixed."; QMessageBox::warning(m_parent, "Ignored Reference Measure", message); return; @@ -2263,7 +2263,7 @@ namespace Isis { ControlPoint::Status status = m_editPoint->SetType((ControlPoint::PointType) pointType); if (status == ControlPoint::PointLocked) { m_pointTypeCombo->setCurrentIndex((int) m_editPoint->GetType()); - QString message = "This control point is edit locked. The point type cannot be changed. You "; + std::string message = "This control point is edit locked. The point type cannot be changed. You "; message += "must first unlock the point by clicking the check box above labeled "; message += "\"Edit Lock Point\"."; QMessageBox::warning(m_parent, "Point Locked", message); @@ -2338,7 +2338,7 @@ namespace Isis { ControlPoint::Status status = m_editPoint->SetIgnored(ignore); if (status == ControlPoint::PointLocked) { m_ignorePoint->setChecked(m_editPoint->IsIgnored()); - QString message = "Unable to change Ignored on point. Set EditLock "; + std::string message = "Unable to change Ignored on point. Set EditLock "; message += " to False."; QMessageBox::critical(this, "Error", message); return; @@ -2548,14 +2548,14 @@ namespace Isis { serial = m_serialNumberList->serialNumber(file); } catch (IException &e) { - QString message = "Make sure the correct cube is opened.\n\n"; + std::string message = "Make sure the correct cube is opened.\n\n"; message += e.toString(); QMessageBox::critical(this, "Error", message); // Set index of combo back to what it was before user selected new. Find the index // of current left measure. QString file = m_serialNumberList->fileName(m_leftMeasure->GetCubeSerialNumber()); - int i = m_leftCombo->findText(FileName(file).name()); + int i = m_leftCombo->findText(QString::fromStdString(FileName(file.toStdString()).name())); if (i < 0) i = 0; m_leftCombo->setCurrentIndex(i); return; @@ -2570,7 +2570,7 @@ namespace Isis { *m_leftMeasure = *((*m_editPoint)[serial]); // If m_leftCube is not null, delete before creating new one - m_leftCube.reset(new Cube(file, "r")); + m_leftCube.reset(new Cube(file.toStdString(), "r")); // Update left measure of pointEditor m_measureEditor->setLeftMeasure (m_leftMeasure, m_leftCube.data(), m_editPoint->GetId()); @@ -2597,14 +2597,14 @@ namespace Isis { serial = m_serialNumberList->serialNumber(file); } catch (IException &e) { - QString message = "Make sure the correct cube is opened.\n\n"; + std::string message = "Make sure the correct cube is opened.\n\n"; message += e.toString(); QMessageBox::critical(this, "Error", message); // Set index of combo back to what it was before user selected new. Find the index // of current left measure. QString file = m_serialNumberList->fileName(m_rightMeasure->GetCubeSerialNumber()); - int i = m_rightCombo->findText(FileName(file).name()); + int i = m_rightCombo->findText(QString::fromStdString(FileName(file.toStdString()).name())); if (i < 0) i = 0; m_rightCombo->setCurrentIndex(i); return; @@ -2619,7 +2619,7 @@ namespace Isis { *m_rightMeasure = *((*m_editPoint)[serial]); // If m_rightCube is not null, delete before creating new one - m_rightCube.reset(new Cube(file, "r")); + m_rightCube.reset(new Cube(file.toStdString(), "r")); // Update left measure of pointEditor m_measureEditor->setRightMeasure (m_rightMeasure, m_rightCube.data(), m_editPoint->GetId()); @@ -2799,9 +2799,9 @@ namespace Isis { */ void ControlPointEditWidget::loadTemplateFile(QString fn) { - QFile file(FileName((QString) fn).expanded()); + QFile file(QString::fromStdString(FileName(fn.toStdString()).expanded())); if (!file.open(QIODevice::ReadOnly)) { - QString msg = "Failed to open template file \"" + fn + "\""; + std::string msg = "Failed to open template file \"" + fn + "\""; QMessageBox::warning(this, "IO Error", msg); return; } @@ -2876,17 +2876,17 @@ namespace Isis { ss >> pvl; } catch(IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::warning(this, "Error", message); return; } - QString expandedFileName(FileName((QString) fn).expanded()); + QString expandedFileName(QString::fromStdString(FileName(fn.toStdString()).expanded())); QFile file(expandedFileName); if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - QString msg = "Failed to save template file to \"" + fn + "\"\nDo you " + std::string msg = "Failed to save template file to \"" + fn + "\"\nDo you " "have permission?"; QMessageBox::warning(this, "IO Error", msg); return; @@ -2930,7 +2930,7 @@ namespace Isis { registrationDialog.exec(); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::information(this, "Error", message); } } @@ -2969,7 +2969,7 @@ namespace Isis { if(templateList->type() == "registrations") { for(int i = 0; i < templateList->size(); i++) { m_templateComboBox->addItem(templateList->at(i)->importName() - + "/" + FileName(templateList->at(i)->fileName()).name()); + + "/" + QString::fromStdString(FileName(templateList->at(i)->fileName().toStdString()).name())); } } } diff --git a/isis/src/qisis/objs/CubePlotCurve/CubePlotCurve.cpp b/isis/src/qisis/objs/CubePlotCurve/CubePlotCurve.cpp index 5714da2bda..64be1d4db3 100644 --- a/isis/src/qisis/objs/CubePlotCurve/CubePlotCurve.cpp +++ b/isis/src/qisis/objs/CubePlotCurve/CubePlotCurve.cpp @@ -461,7 +461,7 @@ namespace Isis { contextMenu.addSeparator(); QString configureIconFile = - FileName("$ISISROOT/appdata/images/icons/plot_configure.png").expanded(); + QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_configure.png").expanded()); QAction *configureAct = new QAction(QPixmap(configureIconFile), "Configure...", this); contextMenu.addAction(configureAct); diff --git a/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp b/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp index 49a46f450f..78262612ab 100644 --- a/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp +++ b/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp @@ -2374,8 +2374,8 @@ namespace Isis { void CubeViewport::setTrackingCube() { PvlGroup trackingGroup = p_cube->group("Tracking"); //Because the tracking group does not have a path, get the path from the main cube - FileName cubeName(p_cube->fileName()); - QString trackingCubeName = QString::fromStdString(trackingGroup.findKeyword("Filename")[0]); + FileName cubeName(p_cube->fileName().toStdString()); + std::string trackingCubeName = trackingGroup.findKeyword("Filename")[0]; FileName trackingCubeFileName(cubeName.path() + "/" + trackingCubeName); Cube *trackingCube = new Cube(trackingCubeFileName); p_trackingCube = trackingCube; diff --git a/isis/src/qisis/objs/Directory/Directory.cpp b/isis/src/qisis/objs/Directory/Directory.cpp index 64e1281117..3630b1f0e8 100644 --- a/isis/src/qisis/objs/Directory/Directory.cpp +++ b/isis/src/qisis/objs/Directory/Directory.cpp @@ -368,7 +368,7 @@ namespace Isis { int nRecentProjects = m_recentProjects.size(); for (int i = 0; i < nRecentProjects; i++) { - FileName projectFileName = m_recentProjects.at(i); + FileName projectFileName = m_recentProjects.at(i).toStdString(); if (!projectFileName.fileExists() ) continue; @@ -411,16 +411,16 @@ namespace Isis { //fileMenu->addAction(m_importImagesWorkOrder->clone()); QAction *openProjectAction = m_openProjectWorkOrder->clone(); - openProjectAction->setIcon(QIcon(FileName( - "$ISISROOT/appdata/images/icons/archive-insert-directory.png").expanded())); + openProjectAction->setIcon(QIcon(QString::fromStdString(FileName( + "$ISISROOT/appdata/images/icons/archive-insert-directory.png").expanded()))); fileMenu->addAction(openProjectAction); m_permToolBarActions.append(openProjectAction); QAction *saveAction = m_saveProjectWorkOrder->clone(); saveAction->setShortcut(Qt::Key_S | Qt::CTRL); - saveAction->setIcon( QIcon(FileName("$ISISROOT/appdata/images/icons/document-save.png") - .expanded())); + saveAction->setIcon( QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/document-save.png") + .expanded()))); saveAction->setDisabled(true); connect( project()->undoStack(), SIGNAL( cleanChanged(bool) ), saveAction, SLOT( setDisabled(bool) ) ); @@ -428,8 +428,8 @@ namespace Isis { m_permToolBarActions.append(saveAction); QAction *saveAsAction = m_saveProjectAsWorkOrder->clone(); - saveAsAction->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/document-save-as.png") - .expanded())); + saveAsAction->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/document-save-as.png") + .expanded()))); fileMenu->addAction(saveAsAction); m_permToolBarActions.append(saveAsAction); @@ -609,10 +609,10 @@ namespace Isis { m_bundleObservationViews.append(result); QString str = fileItem->fileName(); - FileName fileName = fileItem->fileName(); + FileName fileName = fileItem->fileName().toStdString(); // strip out bundle results name from fileName - QString path = fileName.originalPath(); + QString path = QString::fromStdString(fileName.originalPath()); int pos = path.lastIndexOf("/"); QString bundleResultsName = ""; if (pos != -1) { @@ -654,7 +654,7 @@ namespace Isis { CnetEditorView *Directory::addCnetEditorView(Control *control, QString objectName) { QString title = tr("Cnet Editor View %1").arg( control->displayProperties()->displayName() ); - FileName configFile("$HOME/.Isis/" + QApplication::applicationName() + "/" + title + ".config"); + FileName configFile("$HOME/.Isis/" + QApplication::applicationName().toStdString() + "/" + title.toStdString() + ".config"); CnetEditorView *result = new CnetEditorView(this, control, configFile); @@ -815,7 +815,7 @@ namespace Isis { Control *activeControl = project()->activeControl(); if (activeControl == NULL) { - QString message = "No active control network chosen. Choose active control network on " + std::string message = "No active control network chosen. Choose active control network on " "project tree.\n"; QMessageBox::critical(qobject_cast(parent()), "Error", message); return NULL; @@ -843,7 +843,7 @@ namespace Isis { Control *activeControl = project()->activeControl(); if (activeControl == NULL) { // Error and return to Select Tool - QString message = "No active control network chosen. Choose active control network on " + std::string message = "No active control network chosen. Choose active control network on " "project tree.\n"; QMessageBox::critical(qobject_cast(parent()), "Error", message); return NULL; @@ -851,7 +851,7 @@ namespace Isis { result->controlPointEditWidget()->setControl(activeControl); if (!project()->activeImageList() || !project()->activeImageList()->serialNumberList()) { - QString message = "No active image list chosen. Choose an active image list on the project " + std::string message = "No active image list chosen. Choose an active image list on the project " "tree.\n"; QMessageBox::critical(qobject_cast(parent()), "Error", message); return NULL; @@ -969,7 +969,7 @@ namespace Isis { m_templateEditorWidgets.append(result); - result->setWindowTitle( tr("%1").arg( FileName(currentTemplate->fileName()).name() ) ); + result->setWindowTitle( tr("%1").arg( QString::fromStdString(FileName(currentTemplate->fileName().toStdString()).name()) ) ); result->setObjectName( result->windowTitle() ); emit newWidgetAvailable(result); diff --git a/isis/src/qisis/objs/Directory/ExportControlNetWorkOrder.cpp b/isis/src/qisis/objs/Directory/ExportControlNetWorkOrder.cpp index 76dc3c2f24..9321d900aa 100644 --- a/isis/src/qisis/objs/Directory/ExportControlNetWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ExportControlNetWorkOrder.cpp @@ -160,7 +160,7 @@ namespace Isis { QString destination = QFileDialog::getSaveFileName(NULL, QString("Export Control Network"), - "./" + FileName(control->fileName()).name()); + "./" + QString::fromStdString(FileName(control->fileName().toStdString()).name())); if (destination.isEmpty()) { success = false; diff --git a/isis/src/qisis/objs/Directory/ExportImagesWorkOrder.cpp b/isis/src/qisis/objs/Directory/ExportImagesWorkOrder.cpp index 421b063f73..41c7bb2437 100644 --- a/isis/src/qisis/objs/Directory/ExportImagesWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ExportImagesWorkOrder.cpp @@ -216,7 +216,7 @@ namespace Isis { void *ExportImagesWorkOrder::ProjectImageExportFunctor::operator()(Image * const &imageToExport) { try { FileName outputFileName = - m_destination + "/" + FileName(imageToExport->fileName()).baseName(); + m_destination.toStdString() + "/" + FileName(imageToExport->fileName().toStdString()).baseName(); // Copy the image, free the copy from memory because we don't need it. delete imageToExport->cube()->copy(outputFileName, CubeAttributeOutput()); diff --git a/isis/src/qisis/objs/Directory/ImportControlNetWorkOrder.cpp b/isis/src/qisis/objs/Directory/ImportControlNetWorkOrder.cpp index 3bba87b87e..4c721af8c9 100644 --- a/isis/src/qisis/objs/Directory/ImportControlNetWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ImportControlNetWorkOrder.cpp @@ -154,7 +154,8 @@ namespace Isis { QStringList cnetFileNames = internalData(); QList< QPair > cnetFileNamesAndProgress; - foreach (FileName fileName, cnetFileNames) { + for (const QString &str : cnetFileNames) { + FileName fileName(str.toStdString()); Progress *readProgress = new Progress; cnetFileNamesAndProgress.append(qMakePair(fileName, readProgress)); readProgress->DisableAutomaticDisplay(); @@ -257,12 +258,12 @@ namespace Isis { Control *control = NULL; try { - QString cnetFileName = cnetFileNameAndProgress.first.original(); + QString cnetFileName = QString::fromStdString(cnetFileNameAndProgress.first.original()); ControlNet *cnet = new ControlNet(); cnet->SetMutex(m_project->mutex()); cnet->ReadControl(cnetFileName, cnetFileNameAndProgress.second); - QString baseFilename = FileName(cnetFileName).name(); + QString baseFilename = QString::fromStdString(FileName(cnetFileName.toStdString()).name()); QString destination = m_destinationFolder.canonicalPath() + "/" + baseFilename; cnet->Write(destination); diff --git a/isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp b/isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp index 9b0d3551f4..a4b14ae961 100644 --- a/isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp @@ -141,19 +141,20 @@ namespace Isis { QStringList* stateToSave = new QStringList(); if (!fileNames.isEmpty()) { - foreach (FileName fileName, fileNames) { + for (const QString &str : fileNames) { + FileName fileName(str.toStdString()); if (fileName.extension() == "lis") { - TextFile listFile(fileName.expanded()); - QString path = fileName.path(); + TextFile listFile(QString::fromStdString(fileName.expanded())); + QString path = QString::fromStdString(fileName.path()); QString lineOfListFile; while (listFile.GetLine(lineOfListFile)) { - FileName relFileName(path + "/" + lineOfListFile); + FileName relFileName(path.toStdString() + "/" + lineOfListFile.toStdString()); if (relFileName.fileExists() ) { stateToSave->append(path + "/" + lineOfListFile); } else { - FileName absFileName(lineOfListFile); + FileName absFileName(lineOfListFile.toStdString()); if ( absFileName.fileExists() && lineOfListFile.startsWith("/") ) { stateToSave->append(lineOfListFile); } @@ -165,7 +166,7 @@ namespace Isis { } } else { - stateToSave->append(fileName.original()); + stateToSave->append(QString::fromStdString(fileName.original())); } } @@ -392,24 +393,23 @@ namespace Isis { // to import images. if (*m_numErrors < 20) { try { - QString destination = QFileInfo(m_destinationFolder, original.name()) - .absoluteFilePath(); + QString destination = QFileInfo(m_destinationFolder, QString::fromStdString(original.name())).absoluteFilePath(); Cube *input = new Cube(original, "r"); if (m_copyDnData) { - Cube *copiedCube = input->copy(destination, CubeAttributeOutput()); + Cube *copiedCube = input->copy(destination.toStdString(), CubeAttributeOutput()); delete input; input = copiedCube; } - FileName externalLabelFile(destination); + FileName externalLabelFile(destination.toStdString()); externalLabelFile = externalLabelFile.setExtension("ecub"); Cube *projectImage = input->copy(externalLabelFile, CubeAttributeOutput("+External")); if (m_copyDnData) { // Make sure the external label has a fully relative path to the DN data - projectImage->relocateDnData(FileName(destination).name()); + projectImage->relocateDnData(FileName(destination.toStdString()).name()); } // Set new ecub to readOnly. When closing cube, the labels were being re-written because @@ -509,9 +509,15 @@ namespace Isis { } } + std::vector stdStringList; + stdStringList.reserve(confirmedImagesFileNames.size()); + for (const QString &qstr : confirmedImagesFileNames) { + stdStringList.push_back(qstr.toStdString()); + } + OriginalFileToProjectCubeFunctor functor(thread(), folder, copyDnData); // Start concurrently copying the images to import. - QFuture future = QtConcurrent::mapped(confirmedImagesFileNames, functor); + QFuture future = QtConcurrent::mapped(stdStringList, functor); // The new internal data will store the copied files as well as their associated unique id's. QStringList newInternalData; diff --git a/isis/src/qisis/objs/Directory/ImportMapTemplateWorkOrder.cpp b/isis/src/qisis/objs/Directory/ImportMapTemplateWorkOrder.cpp index 06ecc29fbb..fca0c09a7f 100644 --- a/isis/src/qisis/objs/Directory/ImportMapTemplateWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ImportMapTemplateWorkOrder.cpp @@ -146,9 +146,10 @@ namespace Isis { "maps", "maps/" + templateFolder.dirName() ); - foreach (FileName filename, templateFileNames) { - QFile::copy(filename.expanded(), templateFolder.path() + "/" + filename.name()); - m_list->append(new Template(templateFolder.path() + "/" + filename.name(), + for (const QString &str : templateFileNames) { + FileName filename(str.toStdString()); + QFile::copy(QString::fromStdString(filename.expanded()), templateFolder.path() + "/" + QString::fromStdString(filename.name())); + m_list->append(new Template(templateFolder.path() + "/" + QString::fromStdString(filename.name()), "maps", templateFolder.dirName())); } diff --git a/isis/src/qisis/objs/Directory/ImportRegistrationTemplateWorkOrder.cpp b/isis/src/qisis/objs/Directory/ImportRegistrationTemplateWorkOrder.cpp index 3627d2bd67..d09dcc3aa2 100644 --- a/isis/src/qisis/objs/Directory/ImportRegistrationTemplateWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ImportRegistrationTemplateWorkOrder.cpp @@ -146,9 +146,10 @@ namespace Isis { "registrations", "registrations/" + templateFolder.dirName() ); - foreach (FileName filename, templateFileNames) { - QFile::copy(filename.expanded(), templateFolder.path() + "/" + filename.name()); - m_list->append(new Template(templateFolder.path() + "/" + filename.name(), + for (const QString &str : templateFileNames) { + FileName filename(str.toStdString()); + QFile::copy(QString::fromStdString(filename.expanded()), templateFolder.path() + "/" + QString::fromStdString(filename.name())); + m_list->append(new Template(templateFolder.path() + "/" + QString::fromStdString(filename.name()), "registrations", templateFolder.dirName())); } diff --git a/isis/src/qisis/objs/Directory/ImportShapesWorkOrder.cpp b/isis/src/qisis/objs/Directory/ImportShapesWorkOrder.cpp index 1a14dab04d..01b16fb249 100644 --- a/isis/src/qisis/objs/Directory/ImportShapesWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ImportShapesWorkOrder.cpp @@ -134,10 +134,11 @@ namespace Isis { QStringList stateToSave; if (!fileNames.isEmpty()) { - foreach (FileName fileName, fileNames) { - if (fileName.extension() == "lis") { - TextFile listFile(fileName.expanded()); - QString path = fileName.path(); + for (const QString &str : fileNames) { + FileName fileName(str.toStdString()); + if (QString::fromStdString(fileName.extension()) == "lis") { + TextFile listFile(QString::fromStdString(fileName.expanded())); + QString path = QString::fromStdString(fileName.path()); QString lineOfListFile; while (listFile.GetLine(lineOfListFile)) { @@ -150,7 +151,7 @@ namespace Isis { } } else { - stateToSave.append(fileName.original()); + stateToSave.append(QString::fromStdString(fileName.original())); } } } @@ -299,24 +300,24 @@ namespace Isis { if (*m_numErrors < 20) { try { - QString destination = QFileInfo(m_destinationFolder, original.name()) + QString destination = QFileInfo(m_destinationFolder, QString::fromStdString(original.name())) .absoluteFilePath(); Cube *input = new Cube(original, "r"); if (m_copyDnData) { - Cube *copiedCube = input->copy(destination, CubeAttributeOutput()); + Cube *copiedCube = input->copy(destination.toStdString(), CubeAttributeOutput()); delete input; input = copiedCube; } - FileName externalLabelFile(destination); + FileName externalLabelFile(destination.toStdString()); externalLabelFile = externalLabelFile.setExtension("ecub"); Cube *projectShape = input->copy(externalLabelFile, CubeAttributeOutput("+External")); if (m_copyDnData) { // Make sure the external label has a fully relative path to the DN data - projectShape->relocateDnData(FileName(destination).name()); + projectShape->relocateDnData(FileName(destination.toStdString()).name()); } // Set new ecub to readOnly. When closing cube, the labels were being re-written because @@ -406,8 +407,14 @@ namespace Isis { } } + std::vector stdStringList; + stdStringList.reserve(confirmedShapesFileNames.size()); + for (const QString &qstr : confirmedShapesFileNames) { + stdStringList.push_back(qstr.toStdString()); + } + OriginalFileToProjectCubeFunctor functor(thread(), folder, copyDnData); - QFuture future = QtConcurrent::mapped(confirmedShapesFileNames, functor); + QFuture future = QtConcurrent::mapped(stdStringList, functor); QStringList newInternalData; newInternalData.append(internalData().first()); diff --git a/isis/src/qisis/objs/Directory/JigsawWorkOrder.cpp b/isis/src/qisis/objs/Directory/JigsawWorkOrder.cpp index f7b909adf4..b62e0342f6 100644 --- a/isis/src/qisis/objs/Directory/JigsawWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/JigsawWorkOrder.cpp @@ -143,7 +143,7 @@ namespace Isis { void JigsawWorkOrder::execute() { JigsawRunWidget *runWidget = project()->directory()->addJigsawRunWidget(); if (!runWidget) { - QString msg = "Unable to open Jigsaw Run Widget"; + std::string msg = "Unable to open Jigsaw Run Widget"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/qisis/objs/Directory/MatrixViewWorkOrder.cpp b/isis/src/qisis/objs/Directory/MatrixViewWorkOrder.cpp index 2c2a6c373a..4bc36475ec 100644 --- a/isis/src/qisis/objs/Directory/MatrixViewWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/MatrixViewWorkOrder.cpp @@ -175,7 +175,7 @@ namespace Isis { matrixViewToUse->drawElements(corrMat); matrixViewToUse->drawGrid(corrMat); if (matrixViewToUse == NULL) { - QString msg = "The Correlation Matrix for this bundle could not be displayed"; + std::string msg = "The Correlation Matrix for this bundle could not be displayed"; throw IException(IException::Programmer, msg, _FILEINFO_); } project()->setClean(false); diff --git a/isis/src/qisis/objs/Directory/OpenProjectWorkOrder.cpp b/isis/src/qisis/objs/Directory/OpenProjectWorkOrder.cpp index b73faee5b1..d4db4fb397 100644 --- a/isis/src/qisis/objs/Directory/OpenProjectWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/OpenProjectWorkOrder.cpp @@ -103,7 +103,7 @@ namespace Isis { bool OpenProjectWorkOrder::isExecutable(QString projectFileName, bool recentProject) { m_recentProject = recentProject; - FileName fname = projectFileName; + FileName fname = projectFileName.toStdString(); if (!fname.fileExists() ) return false; diff --git a/isis/src/qisis/objs/Directory/SaveProjectAsWorkOrder.cpp b/isis/src/qisis/objs/Directory/SaveProjectAsWorkOrder.cpp index cfeb7f5d8b..ba20157072 100644 --- a/isis/src/qisis/objs/Directory/SaveProjectAsWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/SaveProjectAsWorkOrder.cpp @@ -120,7 +120,7 @@ namespace Isis { void SaveProjectAsWorkOrder::execute() { QString destination = internalData().first(); if (!destination.isEmpty()) { - project()->save(destination); + project()->save(destination.toStdString()); project()->open(destination); project()->setClean(true); } diff --git a/isis/src/qisis/objs/Directory/SensorGetInfoWorkOrder.cpp b/isis/src/qisis/objs/Directory/SensorGetInfoWorkOrder.cpp index d9faf217e9..874aa34b73 100644 --- a/isis/src/qisis/objs/Directory/SensorGetInfoWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/SensorGetInfoWorkOrder.cpp @@ -140,7 +140,7 @@ namespace Isis { if (!sensorInfoWidget) { - QString msg = "error displaying sensor info"; + std::string msg = "error displaying sensor info"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/qisis/objs/Directory/TargetGetInfoWorkOrder.cpp b/isis/src/qisis/objs/Directory/TargetGetInfoWorkOrder.cpp index f2d18549c9..619dc44bc6 100644 --- a/isis/src/qisis/objs/Directory/TargetGetInfoWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/TargetGetInfoWorkOrder.cpp @@ -135,7 +135,7 @@ namespace Isis { project()->directory()->addTargetInfoView(targetBody()); if (!targetInfoWidget) { - QString msg = "error displaying target info"; + std::string msg = "error displaying target info"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/qisis/objs/Directory/TemplateEditViewWorkOrder.cpp b/isis/src/qisis/objs/Directory/TemplateEditViewWorkOrder.cpp index cac341b492..1e91019a30 100644 --- a/isis/src/qisis/objs/Directory/TemplateEditViewWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/TemplateEditViewWorkOrder.cpp @@ -142,7 +142,7 @@ namespace Isis { project()->directory()->addTemplateEditorView(getTemplate()); if (!templateEditorWidget) { - QString msg = "error displaying target info"; + std::string msg = "error displaying target info"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/qisis/objs/FeatureNomenclature/FeatureNomenclature.cpp b/isis/src/qisis/objs/FeatureNomenclature/FeatureNomenclature.cpp index aaea7de0cd..22d204ea2e 100644 --- a/isis/src/qisis/objs/FeatureNomenclature/FeatureNomenclature.cpp +++ b/isis/src/qisis/objs/FeatureNomenclature/FeatureNomenclature.cpp @@ -800,7 +800,7 @@ namespace Isis { void FeatureNomenclature::requestFinished(QNetworkReply *reply) { if (reply->error() == QNetworkReply::NoError) { - QString errorMsg; + std::string errorMsg; int errorLine; int errorCol; diff --git a/isis/src/qisis/objs/FeatureNomenclatureTool/FeatureNomenclatureTool.cpp b/isis/src/qisis/objs/FeatureNomenclatureTool/FeatureNomenclatureTool.cpp index 2acecbe2b2..afcc8f97dc 100644 --- a/isis/src/qisis/objs/FeatureNomenclatureTool/FeatureNomenclatureTool.cpp +++ b/isis/src/qisis/objs/FeatureNomenclatureTool/FeatureNomenclatureTool.cpp @@ -610,7 +610,7 @@ namespace Isis { (m_showApprovedOnly && feature.status() == FeatureNomenclature::Approved) ) { QString displayName = feature.cleanName() + - " (" + FileName(vp->cube()->fileName()).name() + ")"; + " (" + QString::fromStdString(FileName(vp->cube()->fileName().toStdString()).name()) + ")"; QString targetName = feature.target().toUpper(); @@ -990,7 +990,7 @@ namespace Isis { void FeatureNomenclatureTool::readSettings() { FileName config("$HOME/.Isis/qview/nomenclature.config"); QSettings settings( - config.expanded(), QSettings::NativeFormat); + QString::fromStdString(config.expanded()), QSettings::NativeFormat); m_fontSize = settings.value("fontSize", m_fontSize).toInt(); *m_fontColor = settings.value("fontColor", *m_fontColor).value(); @@ -1012,7 +1012,7 @@ namespace Isis { void FeatureNomenclatureTool::writeSettings() { FileName config("$HOME/.Isis/qview/nomenclature.config"); QSettings settings( - config.expanded(), QSettings::NativeFormat); + QString::fromStdString(config.expanded()), QSettings::NativeFormat); settings.setValue("fontSize", m_fontSize); settings.setValue("fontColor", QVariant::fromValue(*m_fontColor)); settings.setValue("defaultEnabled", m_defaultEnabled); diff --git a/isis/src/qisis/objs/FileDialog/FileDialog.cpp b/isis/src/qisis/objs/FileDialog/FileDialog.cpp index 0f4b95ff59..375ac07ba9 100644 --- a/isis/src/qisis/objs/FileDialog/FileDialog.cpp +++ b/isis/src/qisis/objs/FileDialog/FileDialog.cpp @@ -154,8 +154,8 @@ namespace Isis { QString instanceName = this->windowTitle(); // FileName is a QFileDialog enum for DialogLabel - Isis::FileName config("$HOME/.Isis/" + p_appName + "/" + instanceName + ".config"); - QSettings settings(config.expanded(), QSettings::NativeFormat); + Isis::FileName config("$HOME/.Isis/" + p_appName.toStdString() + "/" + instanceName.toStdString() + ".config"); + QSettings settings(QString::fromStdString(config.expanded()), QSettings::NativeFormat); QPoint pos = settings.value("pos", QPoint(300, 100)).toPoint(); QSize size = settings.value("size", QSize(355, 350)).toSize(); resize(size); @@ -179,8 +179,8 @@ namespace Isis { QString instanceName = this->windowTitle(); // FileName is a QFileDialog enum for DialogLabel - Isis::FileName config("$HOME/.Isis/" + p_appName + "/" + instanceName + ".config"); - QSettings settings(config.expanded(), QSettings::NativeFormat); + Isis::FileName config("$HOME/.Isis/" + p_appName.toStdString() + "/" + instanceName.toStdString() + ".config"); + QSettings settings(QString::fromStdString(config.expanded()), QSettings::NativeFormat); settings.setValue("pos", pos()); settings.setValue("size", size()); diff --git a/isis/src/qisis/objs/FileTool/FileTool.cpp b/isis/src/qisis/objs/FileTool/FileTool.cpp index b0dc941c6f..fb5c4607b8 100644 --- a/isis/src/qisis/objs/FileTool/FileTool.cpp +++ b/isis/src/qisis/objs/FileTool/FileTool.cpp @@ -470,7 +470,7 @@ namespace Isis { double ons = (int)(ins * dScale + 0.5); double onl = (int)(inl * dScale + 0.5); - CubeAttributeInput cai(icube->fileName()); + CubeAttributeInput cai(icube->fileName().toStdString()); std::vector bands = cai.bands(); int inb = bands.size(); @@ -552,7 +552,7 @@ namespace Isis { void FileTool::copyCubeDetails(const QString & psOutFile, Cube *icube, Cube *ocube, int piNumSamples, int piNumLines, int piNumBands) { //Create the default output attribute with the output filename - CubeAttributeOutput outAtt(psOutFile); + CubeAttributeOutput outAtt(psOutFile.toStdString()); //Propagate all labels, tables, blobs, etc from the input to output cube try { @@ -583,12 +583,12 @@ namespace Isis { (ocube->pixelType() != UnsignedWord) && (ocube->pixelType() != Isis::UnsignedInteger) && (ocube->pixelType() != Isis::SignedInteger)) { - QString msg = "Looks like your refactoring to add different pixel types"; + std::string msg = "Looks like your refactoring to add different pixel types"; msg += " you'll need to make changes here"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { - QString msg = "You've chosen to reduce your output PixelType for [" + + std::string msg = "You've chosen to reduce your output PixelType for [" + psOutFile + "] you must specify the output pixel range too"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/qisis/objs/FindTool/FindTool.cpp b/isis/src/qisis/objs/FindTool/FindTool.cpp index 1bf8a3a62a..51fe68364c 100644 --- a/isis/src/qisis/objs/FindTool/FindTool.cpp +++ b/isis/src/qisis/objs/FindTool/FindTool.cpp @@ -379,7 +379,7 @@ namespace Isis { p_lat = p_groundTab->p_latLineEdit->text().toDouble(); p_lon = p_groundTab->p_lonLineEdit->text().toDouble(); if (p_lat > 90 || p_lat < -90) { - QString mess = QString::number(p_lat) + " is an invalid latitude value. " + std::string mess = QString::number(p_lat) + " is an invalid latitude value. " + "Please enter a latitude between -90 and 90."; QMessageBox::warning((QWidget *)parent(), "Warning", mess); p_lat = DBL_MAX; diff --git a/isis/src/qisis/objs/Image/Image.cpp b/isis/src/qisis/objs/Image/Image.cpp index fedfd7ff64..f5c539b74b 100644 --- a/isis/src/qisis/objs/Image/Image.cpp +++ b/isis/src/qisis/objs/Image/Image.cpp @@ -61,7 +61,7 @@ namespace Isis { catch (IException &) { } - m_displayProperties = new ImageDisplayProperties(FileName(m_fileName).name(), this); + m_displayProperties = new ImageDisplayProperties(QString::fromStdString(FileName(m_fileName.toStdString()).name()), this); m_id = new QUuid(QUuid::createUuid()); } @@ -94,7 +94,7 @@ namespace Isis { catch (IException &e) { } - m_displayProperties = new ImageDisplayProperties(FileName(m_fileName).name(), this); + m_displayProperties = new ImageDisplayProperties(QString::fromStdString(FileName(m_fileName.toStdString()).name()), this); m_id = new QUuid(QUuid::createUuid()); } @@ -124,7 +124,7 @@ namespace Isis { m_footprint = footprint; - m_displayProperties = new ImageDisplayProperties(FileName(m_fileName).name(), this); + m_displayProperties = new ImageDisplayProperties(QString::fromStdString(FileName(m_fileName.toStdString()).name()), this); setId(id); } @@ -262,7 +262,7 @@ namespace Isis { Cube *Image::cube() { if (!m_cube) { try { - m_cube = new Cube(m_fileName); + m_cube = new Cube(m_fileName.toStdString()); } catch (IException &e) { throw IException(e, IException::Programmer, "Cube cannot be created", _FILEINFO_); @@ -507,15 +507,15 @@ namespace Isis { * @param newProjectRoot The root directory where the project is stored. */ void Image::copyToNewProjectRoot(const Project *project, FileName newProjectRoot) { - if (FileName(newProjectRoot) != FileName(project->projectRoot())) { - Cube origImage(m_fileName); + if (FileName(newProjectRoot) != FileName(project->projectRoot().toStdString())) { + Cube origImage(m_fileName.toStdString()); // The imageDataRoot will either be PROJECTROOT/images or PROJECTROOT/results/bundle/timestamp/images, // depending on how the newProjectRoot points to. - FileName newExternalLabelFileName(Project::imageDataRoot(newProjectRoot.toString()) + "/" + - FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name()); + FileName newExternalLabelFileName(Project::imageDataRoot(QString::fromStdString(newProjectRoot.toString())).toStdString() + "/" + + FileName(m_fileName.toStdString()).dir().filename().string() + "/" + FileName(m_fileName.toStdString()).name()); - if (m_fileName != newExternalLabelFileName.toString()) { + if (m_fileName != QString::fromStdString(newExternalLabelFileName.toString())) { // This cube copy creates a filename w/ecub extension in the new project root, but looks to // be a cube(internal vs external). It changes the DnFile pointer to the old ecub, // /tmp/tsucharski_ipce/tmpProject/images/import1/AS15-.ecub, but doing a less on file @@ -528,7 +528,7 @@ namespace Isis { if (!origImage.storesDnData() ) { if (origImage.externalCubeFileName().path() == ".") { Cube dnFile( - FileName(m_fileName).path() + "/" + origImage.externalCubeFileName().name()); + FileName(m_fileName.toStdString()).path() + "/" + origImage.externalCubeFileName().name()); FileName newDnFileName = newExternalLabelFileName.setExtension("cub"); QScopedPointer newDnFile(dnFile.copy(newDnFileName, CubeAttributeOutput())); newDnFile->close(); @@ -538,10 +538,10 @@ namespace Isis { else { // If the the ecub's external cube is pointing to the old project root, update to new // project root. - if (origImage.externalCubeFileName().toString().contains(project->projectRoot())) { - QString newExternalCubeFileName = origImage.externalCubeFileName().toString(); + if (QString::fromStdString(origImage.externalCubeFileName().toString()).contains(project->projectRoot())) { + QString newExternalCubeFileName = QString::fromStdString(origImage.externalCubeFileName().toString()); newExternalCubeFileName.replace(project->projectRoot(), project->newProjectRoot()); - newExternalLabel->relocateDnData(newExternalCubeFileName); + newExternalLabel->relocateDnData(newExternalCubeFileName.toStdString()); } else { newExternalLabel->relocateDnData(origImage.externalCubeFileName()); @@ -569,8 +569,8 @@ namespace Isis { } if (deleteCubAlso) { - FileName cubFile = FileName(m_fileName).setExtension("cub"); - if (!QFile::remove(cubFile.expanded() ) ) { + FileName cubFile = FileName(m_fileName.toStdString()).setExtension("cub"); + if (!QFile::remove(QString::fromStdString(cubFile.expanded()) ) ) { throw IException(IException::Io, tr("Could not remove file [%1]").arg(m_fileName), _FILEINFO_); @@ -579,7 +579,7 @@ namespace Isis { // If we're the last thing in the folder, remove the folder too. QDir dir; - dir.rmdir(FileName(m_fileName).path()); + dir.rmdir(QString::fromStdString(FileName(m_fileName.toStdString()).path())); } @@ -603,7 +603,7 @@ namespace Isis { stream.writeStartElement("image"); stream.writeAttribute("id", m_id->toString()); - stream.writeAttribute("fileName", FileName(m_fileName).name()); + stream.writeAttribute("fileName", QString::fromStdString(FileName(m_fileName.toStdString()).name())); stream.writeAttribute("instrumentId", m_instrumentId); stream.writeAttribute("spacecraftName", m_spacecraftName); @@ -666,10 +666,10 @@ namespace Isis { void Image::updateFileName(Project *project) { closeCube(); - FileName original(m_fileName); - FileName newName(project->imageDataRoot() + "/" + - original.dir().dirName() + "/" + original.name()); - m_fileName = newName.expanded(); + FileName original(m_fileName.toStdString()); + FileName newName(project->imageDataRoot().toStdString() + "/" + + original.dir().filename().string() + "/" + original.name()); + m_fileName = QString::fromStdString(newName.expanded()); } diff --git a/isis/src/qisis/objs/ImageFileListWidget/ImageTreeWidget.cpp b/isis/src/qisis/objs/ImageFileListWidget/ImageTreeWidget.cpp index 781e60ca6d..46a43e05a4 100644 --- a/isis/src/qisis/objs/ImageFileListWidget/ImageTreeWidget.cpp +++ b/isis/src/qisis/objs/ImageFileListWidget/ImageTreeWidget.cpp @@ -57,8 +57,8 @@ namespace Isis { // Read and apply default visibilities from config, if different than defaults QSettings settings( - FileName(QString("$HOME/.Isis/%1/fileList.config").arg(QApplication::applicationName())) - .expanded(), + QString::fromStdString(FileName("$HOME/.Isis/" + QApplication::applicationName().toStdString() + "/fileList.config") + .expanded()), QSettings::NativeFormat); settings.beginGroup("ColumnsVisible"); @@ -275,9 +275,8 @@ namespace Isis { */ void ImageTreeWidget::setDefaultFileListCols() { QSettings settings( - FileName( - QString("$HOME/.Isis/%1/fileList.config").arg(QApplication::applicationName())) - .expanded(), + QString::fromStdString(FileName("$HOME/.Isis/" + QApplication::applicationName().toStdString() + "/fileList.config") + .expanded()), QSettings::NativeFormat); settings.beginGroup("ColumnsVisible"); diff --git a/isis/src/qisis/objs/ImageList/ImageList.cpp b/isis/src/qisis/objs/ImageList/ImageList.cpp index 2674d66df2..16c4f9a7fd 100644 --- a/isis/src/qisis/objs/ImageList/ImageList.cpp +++ b/isis/src/qisis/objs/ImageList/ImageList.cpp @@ -776,29 +776,24 @@ namespace Isis { // The newProjectRoot contains the full path and we want the dataRoot to be relative to the // projectRoot so that projects can be moved. QString dataRoot = - Project::imageDataRoot(newProjectRoot.toString()).remove(project->newProjectRoot()); + Project::imageDataRoot(QString::fromStdString(newProjectRoot.toString())).remove(project->newProjectRoot()); // Get rid of any preceding "/" if (dataRoot.startsWith("/")) { dataRoot.remove(0,1); } stream.writeAttribute("dataRoot", dataRoot); - FileName settingsFileName(Project::imageDataRoot(newProjectRoot.toString()) + - "/" + m_path + "/images.xml"); + FileName settingsFileName(Project::imageDataRoot(QString::fromStdString(newProjectRoot.toString())).toStdString() + + "/" + m_path.toStdString() + "/images.xml"); - if (!settingsFileName.dir().mkpath(settingsFileName.path())) { - throw IException(IException::Io, - QString("Failed to create directory [%1]") - .arg(settingsFileName.path()), + if (!std::filesystem::create_directories(settingsFileName.dir())) { + throw IException(IException::Io, "Failed to create directory [" + settingsFileName.path() + "]", _FILEINFO_); } - QFile imageListContentsFile(settingsFileName.toString()); + QFile imageListContentsFile(QString::fromStdString(settingsFileName.toString())); if (!imageListContentsFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) { - throw IException(IException::Io, - QString("Unable to save image information for [%1] because [%2] could not be opened for " - "writing") - .arg(m_name).arg(settingsFileName.original()), + throw IException(IException::Io, "Unable to save image information for [" + m_name.toStdString() + "] because [" + settingsFileName.original() + "] could not be opened for writing", _FILEINFO_); } @@ -836,7 +831,7 @@ namespace Isis { future.resultAt(i); } catch(std::exception &e) { - QString msg("Could not save ImageList: "+this->name() ); + std::string msg("Could not save ImageList: "+this->name() ); throw IException(IException::Io,msg,_FILEINFO_); } } diff --git a/isis/src/qisis/objs/ImageReader/ImageReader.cpp b/isis/src/qisis/objs/ImageReader/ImageReader.cpp index 4e194fadf6..a8f3333c53 100644 --- a/isis/src/qisis/objs/ImageReader/ImageReader.cpp +++ b/isis/src/qisis/objs/ImageReader/ImageReader.cpp @@ -200,9 +200,8 @@ namespace Isis { void ImageReader::readSettings() { - QSettings settings( - FileName("$HOME/.Isis/" + QApplication::applicationName() + "/Image Reader.config") - .expanded(), + QSettings settings(QString::fromStdString(FileName("$HOME/.Isis/" + QApplication::applicationName().toStdString() + "/Image Reader.config") + .expanded()), QSettings::NativeFormat); m_safeFileOpen = settings.value("safeFileOpen", m_safeFileOpen).toBool(); @@ -213,8 +212,8 @@ namespace Isis { void ImageReader::writeSettings() { QSettings settings( - FileName("$HOME/.Isis/" + QApplication::applicationName() + "/Image Reader.config") - .expanded(), + QString::fromStdString(FileName("$HOME/.Isis/" + QApplication::applicationName().toStdString() + "/Image Reader.config") + .expanded()), QSettings::NativeFormat); settings.setValue("safeFileOpen", m_safeFileOpen); @@ -284,7 +283,7 @@ namespace Isis { if (imageData.canConvert()) { fileName = imageData.value(); - result = new Image(FileName(fileName).expanded()); + result = new Image(QString::fromStdString(FileName(fileName.toStdString()).expanded())); ImageDisplayProperties *prop = result->displayProperties(); prop->setShowFill(m_openFilled); @@ -296,7 +295,7 @@ namespace Isis { else if (imageData.canConvert()) { PvlObject imageObj = imageData.value(); fileName = ((IString)imageObj["FileName"][0]).ToQt(); - result = new Image(FileName(fileName).expanded()); + result = new Image(QString::fromStdString(FileName(fileName.toStdString()).expanded())); result->fromPvl(imageObj); } diff --git a/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.cpp b/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.cpp index 70bef88229..055c374fef 100644 --- a/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.cpp +++ b/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.cpp @@ -63,7 +63,7 @@ namespace Isis { m_project = project; m_bundleSettings = bundleSettings; m_selectedControl = selectedControl; - m_selectedControlName = FileName(selectedControl->fileName().toStdString()).name(); + m_selectedControlName = QString::fromStdString(FileName(selectedControl->fileName().toStdString()).name()); m_outputControlName = outputControlFileName; m_bundleThread = NULL; init(); @@ -195,7 +195,7 @@ namespace Isis { // Grab the control name that was used in that bundle adjustment. m_selectedControlName - = FileName(bundleSolutionInfo.last()->inputControlNetFileName().toStdString()).name(); + = QString::fromStdString(FileName(bundleSolutionInfo.last()->inputControlNetFileName().toStdString()).name()); } // Clear the dialog displays. @@ -296,20 +296,20 @@ namespace Isis { FileName outputControlName; if (!m_outputControlName.isEmpty()) { outputControlName - = FileName(m_project->bundleSolutionInfoRoot().toStdString() + "/" + runTime + "/" + - m_outputControlName); + = FileName(m_project->bundleSolutionInfoRoot().toStdString() + "/" + runTime.toStdString() + "/" + + m_outputControlName.toStdString()); } else { outputControlName - = FileName(m_project->bundleSolutionInfoRoot().toStdString() + "/" + runTime + "/Out-" + runTime + "-" + + = FileName(m_project->bundleSolutionInfoRoot().toStdString() + "/" + runTime.toStdString() + "/Out-" + runTime.toStdString() + "-" + FileName(m_bundleSolutionInfo->inputControlNetFileName().toStdString()).name()); } // Write output control net with correct path to results folder + runtime - m_bundleSolutionInfo->bundleResults().outputControlNet()->Write(outputControlName.toString()); + m_bundleSolutionInfo->bundleResults().outputControlNet()->Write(QString::fromStdString(outputControlName.toString())); // create Control with output control net and add to m_bundleSolutionInfo - m_bundleSolutionInfo->setOutputControl(new Control(m_project, outputControlName.expanded())); + m_bundleSolutionInfo->setOutputControl(new Control(m_project, QString::fromStdString(outputControlName.expanded()))); if (m_ui->detachedLabelsCheckBox->isChecked()) { // Iterate through all of the image lists (the "imports" in the project). @@ -323,13 +323,20 @@ namespace Isis { foreach (Image *image, *imageList) { FileName original(image->fileName().toStdString()); // Update our list of tracked file names for the images we are going to copy. - imagesToCopy.append(original.expanded()); + imagesToCopy.append(QString::fromStdString(original.expanded())); } + + std::vector stdStringList; + stdStringList.reserve(imagesToCopy.size()); + for (const QString &qstr : imagesToCopy) { + stdStringList.push_back(qstr.toStdString()); + } + // Concurrently copy the bundled images as ecub's to the bundle solution info results. CopyImageToResultsFunctor copyImage(m_project->bundleSolutionInfoRoot() + "/" + m_bundleSolutionInfo->runTime() + "/images/" + imageList->name()); - QFuture copiedCubes = QtConcurrent::mapped(imagesToCopy, copyImage); + QFuture copiedCubes = QtConcurrent::mapped(stdStringList, copyImage); // Prepare for our adjusted images (ecubs) ImageList *adjustedImages = new ImageList(imageList->name(), imageList->path()); @@ -426,8 +433,8 @@ namespace Isis { Cube *result = NULL; // Get the destination folder and create that path. - FileName destination(QFileInfo(m_destinationFolder, image.name()).absoluteFilePath()); - m_destinationFolder.mkpath(destination.path()); + FileName destination(QFileInfo(m_destinationFolder, QString::fromStdString(image.name())).absoluteFilePath().toStdString()); + m_destinationFolder.mkpath(QString::fromStdString(destination.path())); // The input FileName will be referencing an imported ecub file. // Need to get the .cub file (via Cube::externalCubeFileName) to copy. @@ -439,19 +446,15 @@ namespace Isis { if (importCube.externalCubeFileName().path() == ".") { QDir relative(m_destinationFolder.absolutePath()); - dnCubeFileName = FileName(QDir(image.path()).canonicalPath().toStdString() + "/" + importCube.externalCubeFileName().name()); - QString s = relative.relativeFilePath(dnCubeFileName.toString()); - // Locate the DnFile cube by using the input image's (ecub) path and the DnFile name (cub) - //dnCubeFileName = FileName(image.path() + "/" + importCube.externalCubeFileName().name()); - // WHY DO WE NEED TO USE QDIR canonical path? why is the image.path relative and not abs? - //dnCubeFileName = FileName(s); - dnCubeFileName = FileName(QDir(image.path()).canonicalPath().toStdString() + "/" + - importCube.externalCubeFileName().name()); + std::filesystem::path canonicalImagePath = std::filesystem::canonical(image.path()); + std::filesystem::path fullPath = canonicalImagePath / importCube.externalCubeFileName().name(); + dnCubeFileName = FileName(fullPath.string()); + QString s = relative.relativeFilePath(QString::fromStdString(dnCubeFileName.toString())); Cube dnCube(dnCubeFileName, "r"); result = dnCube.copy(destination, CubeAttributeOutput("+External")); - result->relocateDnData(s); + result->relocateDnData(s.toStdString()); } // The .ecub's ^DnFile is an absolute path (.ecub potentially not located next to .cub) else { @@ -523,8 +526,8 @@ namespace Isis { * * @param error Error status of bundle. */ - void JigsawRunWidget::errorString(QString error) { - QString errorStr = "\n" + error; + void JigsawRunWidget::errorString(std::string error) { + std::string errorStr = "\n" + error; m_ui->statusUpdatesLabel->setText( m_ui->statusUpdatesLabel->text().append(errorStr) ); updateScrollBar(); diff --git a/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.h b/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.h index f155677846..047c7e81f2 100644 --- a/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.h +++ b/isis/src/qisis/objs/JigsawRunWidget/JigsawRunWidget.h @@ -123,7 +123,7 @@ namespace Isis { public slots: void outputBundleStatus(QString status); - void errorString(QString error); + void errorString(std::string error); void reportException(QString exception); void updateIteration(int iteration); void updatePoint(int point); diff --git a/isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.cpp b/isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.cpp index 4c663af6c2..1c47a12578 100644 --- a/isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.cpp +++ b/isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.cpp @@ -86,8 +86,8 @@ namespace Isis { } // initialize default output control network filename - FileName fname = m_ui->inputControlNetCombo->currentText(); - m_ui->outputControlNetLineEdit->setText(fname.baseName() + "-out.net"); + FileName fname = m_ui->inputControlNetCombo->currentText().toStdString(); + m_ui->outputControlNetLineEdit->setText(QString::fromStdString(fname.baseName()) + "-out.net"); // initializations for observation solve settings tab createObservationSolveSettingsTreeView(); @@ -201,20 +201,20 @@ namespace Isis { QString name = target->displayProperties()->displayName(); if (name == "MOON") - m_ui->targetBodyComboBox->addItem(QIcon(FileName( - "$ISISROOT/appdata/images/icons/weather-clear-night.png").expanded()), name, v); + m_ui->targetBodyComboBox->addItem(QIcon(QString::fromStdString(FileName( + "$ISISROOT/appdata/images/icons/weather-clear-night.png").expanded())), name, v); else if (name == "Enceladus") - m_ui->targetBodyComboBox->addItem(QIcon(FileName( - "$ISISROOT/appdata/images/icons/nasa_enceladus.png").expanded()), name, v); + m_ui->targetBodyComboBox->addItem(QIcon(QString::fromStdString(FileName( + "$ISISROOT/appdata/images/icons/nasa_enceladus.png").expanded())), name, v); else if (name == "Mars") - m_ui->targetBodyComboBox->addItem(QIcon(FileName( - "$ISISROOT/appdata/images/icons/nasa_mars.png").expanded()), name, v); + m_ui->targetBodyComboBox->addItem(QIcon(QString::fromStdString(FileName( + "$ISISROOT/appdata/images/icons/nasa_mars.png").expanded())), name, v); else if (name == "Titan") - m_ui->targetBodyComboBox->addItem(QIcon(FileName( - "$ISISROOT/appdata/images/icons/nasa_titan.png").expanded()), name, v); + m_ui->targetBodyComboBox->addItem(QIcon(QString::fromStdString(FileName( + "$ISISROOT/appdata/images/icons/nasa_titan.png").expanded())), name, v); else - m_ui->targetBodyComboBox->addItem(QIcon(FileName( - "$ISISROOT/appdata/images/icons/weather-clear-night.png").expanded()), name, v); + m_ui->targetBodyComboBox->addItem(QIcon(QString::fromStdString(FileName( + "$ISISROOT/appdata/images/icons/weather-clear-night.png").expanded())), name, v); } m_ui->radiiButtonGroup->setId(m_ui->noneRadiiRadioButton,0); @@ -704,7 +704,7 @@ namespace Isis { */ void JigsawSetupDialog::selectControl(const QString &controlName) { QComboBox &cnetBox = *(m_ui->inputControlNetCombo); - int foundControlIndex = cnetBox.findText(FileName(controlName).name()); + int foundControlIndex = cnetBox.findText(QString::fromStdString(FileName(controlName.toStdString()).name())); // We did not find it, so we need to see if the combo box is empty or not. if (foundControlIndex == -1) { if (cnetBox.count() == 0) { @@ -1160,7 +1160,7 @@ namespace Isis { } else { // Formulate message indicating why target parameters are disabled - QString msg; + std::string msg; if (target->displayProperties()->displayName() == "MOON") { msg = "Target body parameter cannot be solved for the Moon."; } @@ -1398,8 +1398,8 @@ namespace Isis { } void Isis::JigsawSetupDialog::on_inputControlNetCombo_currentTextChanged(const QString &arg1) { - FileName fname = arg1; - m_ui->outputControlNetLineEdit->setText(fname.baseName() + "-out.net"); + FileName fname = arg1.toStdString(); + m_ui->outputControlNetLineEdit->setText(QString::fromStdString(fname.baseName()) + "-out.net"); } diff --git a/isis/src/qisis/objs/MainWindow/MainWindow.cpp b/isis/src/qisis/objs/MainWindow/MainWindow.cpp index 13d54980d4..0055cab36c 100644 --- a/isis/src/qisis/objs/MainWindow/MainWindow.cpp +++ b/isis/src/qisis/objs/MainWindow/MainWindow.cpp @@ -54,7 +54,7 @@ namespace Isis { } QDir programSettings = - QDir(FileName("$HOME/.Isis/" + QCoreApplication::applicationName() + "/").path()); + QDir(QString::fromStdString(FileName("$HOME/.Isis/" + QCoreApplication::applicationName().toStdString() + "/").path())); QString windowSettings = programSettings.filePath(objectTitle + ".config"); return windowSettings; @@ -108,7 +108,7 @@ namespace Isis { } QDir programSettings = - QDir(FileName("$HOME/.Isis/" + QCoreApplication::applicationName() + "/").path()); + QDir(QString::fromStdString(FileName("$HOME/.Isis/" + QCoreApplication::applicationName().toStdString() + "/").path())); QString windowSettings = programSettings.filePath(objectName() + ".config"); //qDebug()<<"MainWindow::settingsFileName windowSettings = "<cube()->fileName()).name(), + list.add(QString::fromStdString(Isis::FileName(mvp->cube()->fileName().toStdString()).name()), mvp->cube()->fileName()); } else { @@ -798,7 +798,7 @@ namespace Isis { } if (m_editPoint->IsIgnored()) { - QString message = "You are saving changes to a measure on an ignored "; + std::string message = "You are saving changes to a measure on an ignored "; message += "point. Do you want to set Ignore = False on the point and "; message += "both measures?"; switch (QMessageBox::question(m_matchTool, "Match Tool Save Measure", @@ -887,7 +887,7 @@ namespace Isis { // if this is a reference measure. The check for moving a reference is // done below. if (origMeasure->IsEditLocked() && m->IsEditLocked()) { - QString message = "The " + side + " measure is editLocked "; + std::string message = "The " + side + " measure is editLocked "; message += "for editing. Do you want to set EditLock = False for this "; message += "measure?"; int response = QMessageBox::question(m_matchTool, "Match Tool Save Measure", @@ -909,7 +909,7 @@ namespace Isis { } if (origMeasure->IsIgnored() && m->IsIgnored()) { - QString message = "The " + side + "measure is ignored. "; + std::string message = "The " + side + "measure is ignored. "; message += "Do you want to set Ignore = False on the measure?"; switch(QMessageBox::question(m_matchTool, "Match Tool Save Measure", message, "&Yes", "&No", 0, 0)){ @@ -933,7 +933,7 @@ namespace Isis { if (m_editPoint->IsReferenceExplicit()) { if (refMeasure->GetCubeSerialNumber() == m->GetCubeSerialNumber()) { if (m->GetSample() != origMeasure->GetSample() || m->GetLine() != origMeasure->GetLine()) { - QString message = "You are making a change to the reference measure. You "; + std::string message = "You are making a change to the reference measure. You "; message += "may need to move all of the other measures to match the new "; message += " coordinate of the reference measure. Do you really want to "; message += " change the reference measure's location? "; @@ -952,7 +952,7 @@ namespace Isis { // New reference measure else if (side == "left" && (refMeasure->GetCubeSerialNumber() != m->GetCubeSerialNumber())) { if (m_coregNet) { - QString message = "This control network was created by the coreg program, and the " + std::string message = "This control network was created by the coreg program, and the " "reference measure needs to remain the same as what coreg set. " "Therefore, you cannot change which measure is the reference. To " "save this point, move the reference measure (measure in BOLD) back " @@ -960,7 +960,7 @@ namespace Isis { QMessageBox::information(m_matchTool, "Cannot change reference", message); } else { - QString message = "This point already contains a reference measure. "; + std::string message = "This point already contains a reference measure. "; message += "Would you like to replace it with the measure on the left?"; int response = QMessageBox::question(m_matchTool, "Match Tool Save Measure", message, @@ -971,7 +971,7 @@ namespace Isis { // Update measure file combo boxes: old reference normal font, // new reference bold font QString file = serialNumberList().fileName(m_leftMeasure->GetCubeSerialNumber()); - QString fname = FileName(file).name(); + QString fname = QString::fromStdString(FileName(file.toStdString()).name()); int iref = m_leftCombo->findText(fname); // Save normal font from new reference measure @@ -981,7 +981,7 @@ namespace Isis { m_rightCombo->setItemData(iref,QFont("DejaVu Sans", 12, QFont::Bold), Qt::FontRole); file = serialNumberList().fileName(refMeasure->GetCubeSerialNumber()); - fname = FileName(file).name(); + fname = QString::fromStdString(FileName(file.toStdString()).name()); iref = m_leftCombo->findText(fname); m_leftCombo->setItemData(iref,font,Qt::FontRole); iref = m_rightCombo->findText(fname); @@ -1023,7 +1023,7 @@ namespace Isis { // measure as reference. ControlMeasure *refMeasure = m_editPoint->GetRefMeasure(); if (refMeasure->GetCubeSerialNumber() != m_leftMeasure->GetCubeSerialNumber()) { - QString message = "This point already contains a reference measure. "; + std::string message = "This point already contains a reference measure. "; message += "Would you like to replace it with the measure on the left?"; int response = QMessageBox::question(m_matchTool, "Match Tool Save Measure", message, @@ -1034,7 +1034,7 @@ namespace Isis { // Update measure file combo boxes: old reference normal font, // new reference bold font QString file = serialNumberList().fileName(m_leftMeasure->GetCubeSerialNumber()); - QString fname = FileName(file).name(); + QString fname = QString::fromStdString(FileName(file.toStdString()).name()); int iref = m_leftCombo->findText(fname); // Save normal font from new reference measure @@ -1044,7 +1044,7 @@ namespace Isis { m_rightCombo->setItemData(iref,QFont("DejaVu Sans", 12, QFont::Bold), Qt::FontRole); file = serialNumberList().fileName(refMeasure->GetCubeSerialNumber()); - fname = FileName(file).name(); + fname = QString::fromStdString(FileName(file.toStdString()).name()); iref = m_leftCombo->findText(fname); m_leftCombo->setItemData(iref,font,Qt::FontRole); iref = m_rightCombo->findText(fname); @@ -1142,7 +1142,7 @@ namespace Isis { ControlPoint::Status status = m_editPoint->SetIgnored(ignore); if (status == ControlPoint::PointLocked) { m_ignorePoint->setChecked(m_editPoint->IsIgnored()); - QString message = "Unable to change Ignored on point. Set EditLock "; + std::string message = "Unable to change Ignored on point. Set EditLock "; message += " to False."; QMessageBox::critical(m_matchTool, "Error", message); return; @@ -1299,7 +1299,7 @@ namespace Isis { if (m_controlNet) { if (m_controlNet->GetNumPoints() != 0 && m_netChanged) { - QString message = "A control net has already been created. Do you want to save before " + std::string message = "A control net has already been created. Do you want to save before " "opening a new control net?"; int response = QMessageBox::question(m_matchTool, "Save current control net?", message, @@ -1346,7 +1346,7 @@ namespace Isis { } catch (IException &e) { QApplication::restoreOverrideCursor(); - QString message = "Invalid control network. \n"; + std::string message = "Invalid control network. \n"; message += e.toString(); QMessageBox::critical(m_matchTool, "Error", message); m_cnetFileName.clear(); @@ -1371,7 +1371,7 @@ namespace Isis { */ void MatchTool::saveNet() { if (m_cnetFileName.isEmpty()) { - QString message = "This is a new network, you must select " + std::string message = "This is a new network, you must select " "\"Save As\" under the File Menu or on the toolbar."; QMessageBox::critical(m_matchTool, "Error", message); return; @@ -1466,7 +1466,7 @@ namespace Isis { if (s == Qt::LeftButton) { if (!m_controlNet || m_controlNet->GetNumPoints() == 0) { - QString message = "No points exist for editing. Create points "; + std::string message = "No points exist for editing. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_matchTool, "Warning", message); return; @@ -1479,7 +1479,7 @@ namespace Isis { point = m_controlNet->FindClosest(sn, samp, line); } catch (IException &e) { - QString message = "Cannot find point for editing."; + std::string message = "Cannot find point for editing."; message += e.toString(); QMessageBox::warning(m_matchTool, "Warning", message); return; @@ -1489,7 +1489,7 @@ namespace Isis { } else if (s == Qt::MiddleButton) { if (!m_controlNet || m_controlNet->GetNumPoints() == 0) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_matchTool, "Warning", message); return; @@ -1499,7 +1499,7 @@ namespace Isis { ControlPoint *point = m_controlNet->FindClosest(sn, samp, line); if (point == NULL) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_matchTool, "Warning", message); return; @@ -1517,7 +1517,7 @@ namespace Isis { m_leftFile = mvp->cube()->fileName(); } catch (IException &e) { - QString message = "Cannot create control point.\n\n"; + std::string message = "Cannot create control point.\n\n"; message += e.toString(); QMessageBox::critical(m_matchTool, "Error", message); return; @@ -1557,14 +1557,14 @@ namespace Isis { QStringList images; for (int i = 0; i < (int)cubeViewportList()->size(); i++) { - FileName cubeFile = (*(cubeViewportList()))[i]->cube()->fileName(); - images<cube()->fileName().toStdString(); + images<setFiles(images); m_newPointDialog->show(); // Highlight the current cubeViewport - QString current = FileName(cvp->cube()->fileName()).name(); + QString current = QString::fromStdString(FileName(cvp->cube()->fileName().toStdString()).name()); m_newPointDialog->highlightFile(current); m_newPoint = new ControlPoint(); @@ -1587,7 +1587,7 @@ namespace Isis { void MatchTool::addMeasure(MdiCubeViewport *cvp, double sample, double line) { // Highlight the current cubeViewport - QString current = FileName(cvp->cube()->fileName()).name(); + QString current = QString::fromStdString(FileName(cvp->cube()->fileName().toStdString()).name()); m_newPointDialog->highlightFile(current); m_newPointDialog->raise(); @@ -1623,7 +1623,7 @@ namespace Isis { // and set it to the reference measure. if (m_coregNet) { if (!m_newPoint->HasSerialNumber(m_coregReferenceSN)) { - QString message = "This is a coreg network which needs the cube with serial number " + + std::string message = "This is a coreg network which needs the cube with serial number " + m_coregReferenceSN + " as the reference measure. This new control point does " "not have a measure for that serial number, so this point cannot be created until " "the cube listed above is added (Right-click on cube)."; @@ -1693,8 +1693,8 @@ namespace Isis { QStringList mCubes = missingCubes(point); if (mCubes.size() > 0) { - QString msgTitle = "Missing Cubes"; - QString message = "This point is missing cubes for the following measures and cannot be "; + std::string msgTitle = "Missing Cubes"; + std::string message = "This point is missing cubes for the following measures and cannot be "; message += "loaded into the editor. Do you still want to delete this point?\n\n"; for (int i=0; ideleteAllCheckBox->isChecked()) { - QString message = "You have selected all measures in this point to be deleted. This " + std::string message = "You have selected all measures in this point to be deleted. This " "control point will be deleted. Do you want to delete this control point?"; int response = QMessageBox::question(m_matchTool, "Delete control point", message, @@ -1796,7 +1796,7 @@ namespace Isis { if (m_editPoint->IsReferenceExplicit() && (m_editPoint->GetRefMeasure()->GetCubeSerialNumber() == (*m_editPoint)[i]->GetCubeSerialNumber())) { - QString message = "You are trying to delete the Reference measure." + std::string message = "You are trying to delete the Reference measure." " Do you really want to delete the Reference measure?"; switch (QMessageBox::question(m_matchTool, "Delete Reference measure?", message, @@ -1874,7 +1874,7 @@ namespace Isis { // If no measures, print info and return if (point->GetNumMeasures() == 0) { - QString message = "This point has no measures."; + std::string message = "This point has no measures."; QMessageBox::warning(m_matchTool, "Warning", message); emit editPointChanged(); return; @@ -1883,8 +1883,8 @@ namespace Isis { // Make sure all measures have a cube loaded QStringList mCubes = missingCubes(point); if (mCubes.size() > 0) { - QString msgTitle = "Missing Cubes"; - QString message = "This point is missing cubes and cannot be loaded into the editor. Open "; + std::string msgTitle = "Missing Cubes"; + std::string message = "This point is missing cubes and cannot be loaded into the editor. Open "; message += "the cubes for the following measures before selecting this point.\n\n"; for (int i=0; iaddItem(tempFileName); m_rightCombo->addItem(tempFileName); if (m_editPoint->IsReferenceExplicit() && @@ -1991,7 +1991,7 @@ namespace Isis { } else { if (!m_leftFile.isEmpty()) { - leftIndex = m_leftCombo->findText(FileName(m_leftFile).name()); + leftIndex = m_leftCombo->findText(QString::fromStdString(FileName(m_leftFile.toStdString()).name())); // Sanity check if (leftIndex < 0 ) leftIndex = 0; m_leftFile.clear(); @@ -2288,14 +2288,14 @@ namespace Isis { serial = serialNumberList().serialNumber(file); } catch (IException &e) { - QString message = "Make sure the correct cube is opened.\n\n"; + std::string message = "Make sure the correct cube is opened.\n\n"; message += e.toString(); QMessageBox::critical(m_matchTool, "Error", message); // Set index of combo back to what it was before user selected new. Find the index // of current left measure. QString file = serialNumberList().fileName(m_leftMeasure->GetCubeSerialNumber()); - int i = m_leftCombo->findText(FileName(file).name()); + int i = m_leftCombo->findText(QString::fromStdString(FileName(file.toStdString()).name())); if (i < 0) i = 0; m_leftCombo->setCurrentIndex(i); return; @@ -2344,14 +2344,14 @@ namespace Isis { serial = serialNumberList().serialNumber(file); } catch (IException &e) { - QString message = "Make sure the correct cube is opened.\n\n"; + std::string message = "Make sure the correct cube is opened.\n\n"; message += e.toString(); QMessageBox::critical(m_matchTool, "Error", message); // Set index of combo back to what it was before user selected new. Find the index // of current left measure. QString file = serialNumberList().fileName(m_rightMeasure->GetCubeSerialNumber()); - int i = m_rightCombo->findText(FileName(file).name()); + int i = m_rightCombo->findText(QString::fromStdString(FileName(file.toStdString()).name())); if (i < 0) i = 0; m_rightCombo->setCurrentIndex(i); return; @@ -2760,9 +2760,9 @@ namespace Isis { */ void MatchTool::loadTemplateFile(QString fn) { - QFile file(FileName((QString) fn).expanded()); + QFile file(QString::fromStdString(FileName(fn.toStdString()).expanded())); if (!file.open(QIODevice::ReadOnly)) { - QString msg = "Failed to open template file \"" + fn + "\""; + std::string msg = "Failed to open template file \"" + fn + "\""; QMessageBox::warning(m_matchTool, "IO Error", msg); return; } @@ -2835,18 +2835,18 @@ namespace Isis { ss >> pvl; } catch(IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::warning(m_matchTool, "Error", message); return; } QString expandedFileName( - FileName((QString) fn).expanded()); + QString::fromStdString(FileName(fn.toStdString()).expanded())); - QFile file(expandedFileName); + QFile file(QString::fromStdString(expandedFileName.toStdString())); if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - QString msg = "Failed to save template file to \"" + fn + "\"\nDo you " + std::string msg = "Failed to save template file to \"" + fn + "\"\nDo you " "have permission?"; QMessageBox::warning(m_matchTool, "IO Error", msg); return; @@ -2892,7 +2892,7 @@ namespace Isis { registrationDialog.exec(); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::information(m_matchTool, "Error", message); } } @@ -3045,7 +3045,7 @@ namespace Isis { */ void MatchTool::readSettings() { FileName config("$HOME/.Isis/qview/MatchTool.config"); - QSettings settings(config.expanded(), + QSettings settings(QString::fromStdString(config.expanded()), QSettings::NativeFormat); QPoint pos = settings.value("pos", QPoint(300, 100)).toPoint(); QSize size = settings.value("size", QSize(900, 500)).toSize(); @@ -3065,7 +3065,7 @@ namespace Isis { visible at the time of closing the application*/ if (!m_matchTool->isVisible()) return; FileName config("$HOME/.Isis/qview/MatchTool.config"); - QSettings settings(config.expanded(), + QSettings settings(QString::fromStdString(config.expanded()), QSettings::NativeFormat); settings.setValue("pos", m_matchTool->pos()); settings.setValue("size", m_matchTool->size()); @@ -3362,7 +3362,7 @@ namespace Isis { // If point changed or if a new point, prompt for saving. if ( m_controlNet->GetNumPoints() == 0 || !m_controlNet->ContainsPoint(m_editPoint->GetId())) { - QString message = "\n\nDo you want to save the point in the editor?"; + std::string message = "\n\nDo you want to save the point in the editor?"; int response = QMessageBox::question(m_matchTool, "Save point in editor", message, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); @@ -3373,7 +3373,7 @@ namespace Isis { } if (m_controlNet && m_controlNet->GetNumPoints() != 0 && m_netChanged) { - QString message = "The currently open control net has changed. Do you want to save?"; + std::string message = "The currently open control net has changed. Do you want to save?"; int response = QMessageBox::question(m_matchTool, "Save current control net?", message, QMessageBox::Yes | QMessageBox::No, diff --git a/isis/src/qisis/objs/MdiCubeViewport/MdiCubeViewport.cpp b/isis/src/qisis/objs/MdiCubeViewport/MdiCubeViewport.cpp index 059ddfa533..bbbf2bdb9c 100644 --- a/isis/src/qisis/objs/MdiCubeViewport/MdiCubeViewport.cpp +++ b/isis/src/qisis/objs/MdiCubeViewport/MdiCubeViewport.cpp @@ -29,7 +29,7 @@ namespace Isis { QWidget *parent) : CubeViewport(cube, cdt, parent) { p_linked = false; - QString unlinkedIcon = FileName("$ISISROOT/appdata/images/icons/unlinked.png").expanded(); + QString unlinkedIcon = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/unlinked.png").expanded()); static QIcon unlinked(unlinkedIcon); parentWidget()->setWindowIcon(unlinked); @@ -59,9 +59,9 @@ namespace Isis { if(!parentWidget() || !parentWidget()->parentWidget()) return; - QString unlinkedIcon = FileName("$ISISROOT/appdata/images/icons/unlinked.png").expanded(); + QString unlinkedIcon = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/unlinked.png").expanded()); static QIcon unlinked(unlinkedIcon); - QString linkedIcon = FileName("$ISISROOT/appdata/images/icons/linked.png").expanded(); + QString linkedIcon = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/linked.png").expanded()); static QIcon linked(linkedIcon); bool notify = false; diff --git a/isis/src/qisis/objs/MeasureTool/MeasureTool.cpp b/isis/src/qisis/objs/MeasureTool/MeasureTool.cpp index 284a2b078d..3dc2d13fdb 100644 --- a/isis/src/qisis/objs/MeasureTool/MeasureTool.cpp +++ b/isis/src/qisis/objs/MeasureTool/MeasureTool.cpp @@ -581,9 +581,9 @@ namespace Isis { // Write out col 8 (the file name) Isis::FileName fname = Isis::FileName( - cvp->cube()->fileName()).expanded(); - m_path = fname.path(); - m_fname = fname.name(); + cvp->cube()->fileName().toStdString()).expanded(); + m_path = QString::fromStdString(fname.path()); + m_fname = QString::fromStdString(fname.name()); m_pixDist = Null; m_mDist = Null; diff --git a/isis/src/qisis/objs/MosaicMainWindow/MosaicController.cpp b/isis/src/qisis/objs/MosaicMainWindow/MosaicController.cpp index 90313e1db4..6e17609add 100644 --- a/isis/src/qisis/objs/MosaicMainWindow/MosaicController.cpp +++ b/isis/src/qisis/objs/MosaicMainWindow/MosaicController.cpp @@ -324,7 +324,7 @@ namespace Isis { image.deleteKeyword("Values"); PvlObject displayProps("DisplayProperties"); - displayProps += PvlKeyword("DisplayName", FileName(fileName).name().toStdString()); + displayProps += PvlKeyword("DisplayName", FileName(fileName.toStdString()).name()); // Convert display properties over enum OldDispProps { diff --git a/isis/src/qisis/objs/MosaicMainWindow/MosaicMainWindow.cpp b/isis/src/qisis/objs/MosaicMainWindow/MosaicMainWindow.cpp index 062888c8b1..78c2ec0381 100644 --- a/isis/src/qisis/objs/MosaicMainWindow/MosaicMainWindow.cpp +++ b/isis/src/qisis/objs/MosaicMainWindow/MosaicMainWindow.cpp @@ -31,7 +31,7 @@ namespace Isis { MosaicMainWindow::MosaicMainWindow(QString title, QWidget *parent) : MainWindow(title, parent), - m_settings(FileName("$HOME/.Isis/qmos/qmos.config").expanded(), + m_settings(QString::fromStdString(FileName("$HOME/.Isis/qmos/qmos.config").expanded()), QSettings::NativeFormat) { m_filename = ""; m_fileMenu = NULL; @@ -249,7 +249,7 @@ namespace Isis { QAction *activateWhatsThisAct = new QAction("&What's This", this); activateWhatsThisAct->setShortcut(Qt::SHIFT | Qt::Key_F1); activateWhatsThisAct->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/contexthelp.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/contexthelp.png").expanded()))); activateWhatsThisAct->setToolTip("Activate What's This and click on parts " "this program to see more information about them"); connect(activateWhatsThisAct, SIGNAL(triggered()), diff --git a/isis/src/qisis/objs/MosaicSceneWidget/ControlNetGraphicsItem.cpp b/isis/src/qisis/objs/MosaicSceneWidget/ControlNetGraphicsItem.cpp index d6fa928204..b34c2e9514 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/ControlNetGraphicsItem.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/ControlNetGraphicsItem.cpp @@ -141,7 +141,7 @@ namespace Isis { if (filename.size() > 0) { if ((*m_cubeToGroundMap)[filename] == NULL) { - Cube cube(FileName(filename).expanded(), "r"); + Cube cube(FileName(filename.toStdString()).expanded(), "r"); UniversalGroundMap *groundMap = new UniversalGroundMap(cube); (*m_cubeToGroundMap)[filename] = groundMap; } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/ControlPointGraphicsItem.cpp b/isis/src/qisis/objs/MosaicSceneWidget/ControlPointGraphicsItem.cpp index a11accc8a3..2865926913 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/ControlPointGraphicsItem.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/ControlPointGraphicsItem.cpp @@ -341,7 +341,7 @@ namespace Isis { if (snList->hasSerialNumber(serialNum)) { toolTip += - FileName(snList->fileName(serialNum)).name(); + QString::fromStdString(FileName(snList->fileName(serialNum).toStdString()).name()); toolTip += " (" + serialNum + ")"; } else { diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicAreaTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicAreaTool.cpp index adc0c6d23f..367498bfad 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicAreaTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicAreaTool.cpp @@ -199,7 +199,7 @@ namespace Isis { } } else { - QString message = "Lat/Lon not within this view."; + std::string message = "Lat/Lon not within this view."; QMessageBox::information(getWidget(), "Cannot Calculate Box", message, QMessageBox::Ok); } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp index 7b7aa3093e..8ac724d806 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp @@ -580,15 +580,15 @@ namespace Isis { // for each mosaic item //--------------------------------------------------------------- if (!netFile.isEmpty()) { - FileName controlNetFile(netFile); - m_controlNetFile = controlNetFile.expanded(); + FileName controlNetFile(netFile.toStdString()); + m_controlNetFile = QString::fromStdString(controlNetFile.expanded()); } } else { // If ipce application, there must be an active control net and active image list. if (!getWidget()->directory()->project()->activeControl()) { // Error and return to Select Tool - QString message = "No active control network chosen. Choose an active image list then an" + std::string message = "No active control network chosen. Choose an active image list then an" "active control network on the project tree.\n"; QMessageBox::critical(getWidget(), "Error", message); return; @@ -637,7 +637,7 @@ namespace Isis { } catch(IException &e) { - QString message = "Invalid control network.\n"; + std::string message = "Invalid control network.\n"; message += e.toString(); QMessageBox::information(getWidget(), "Error", message); return; @@ -697,7 +697,7 @@ namespace Isis { cp = m_controlNetGraphics->findClosestControlPoint(point); if (!cp) { // TODO Figure out how to get this error message in the right place - QString message = "No points exist for deleting. Create points " + std::string message = "No points exist for deleting. Create points " "using the right mouse button."; QMessageBox::warning(getWidget(), "Warning", message); return; diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp index b78638c927..0f882b6b61 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp @@ -85,7 +85,7 @@ namespace Isis { getWidget()->getView()->centerOn(scenePos); } else { - QString message = "Lat/Lon not within this view."; + std::string message = "Lat/Lon not within this view."; QMessageBox::information(getWidget(), "Point Not Found", message, QMessageBox::Ok); } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp index b3a8f04fd8..fb5487197a 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp @@ -715,8 +715,7 @@ namespace Isis { void MosaicGridTool::autoGrid(bool draw) { QSettings settings( - FileName(QString("$HOME/.Isis/%1/mosaicSceneGridTool.config") - .arg(QApplication::applicationName())).expanded(), + QString::fromStdString(FileName("$HOME/.Isis/" + QApplication::applicationName().toStdString() + "/mosaicSceneGridTool.config").expanded()), QSettings::NativeFormat); settings.setValue("autoGrid", draw); @@ -849,7 +848,7 @@ namespace Isis { m_drawGridCheckBox->blockSignals(false); if (!getWidget()->getProjection()) { - QString msg = "Please set the mosaic scene's projection before trying to " + std::string msg = "Please set the mosaic scene's projection before trying to " "draw a grid. This means either open a cube (a projection " "will be calculated) or set the projection explicitly"; QMessageBox::warning(NULL, tr("Grid Tool Requires Projection"), msg); @@ -920,8 +919,7 @@ namespace Isis { void MosaicGridTool::onToolOpen(bool check) { if (check && m_shouldCheckBoxes) { QSettings settings( - FileName(QString("$HOME/.Isis/%1/mosaicSceneGridTool.config") - .arg(QApplication::applicationName())).expanded(), + QString::fromStdString(FileName("$HOME/.Isis/" + QApplication::applicationName().toStdString() + "/mosaicSceneGridTool.config").expanded()), QSettings::NativeFormat); bool drawAuto = settings.value("autoGrid", true).toBool(); diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp index 9bad00d71f..7b279f18d5 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp @@ -378,7 +378,7 @@ namespace Isis { connect(this, SIGNAL(destroyed()), m_mapButton, SLOT(deleteLater())); m_mapButton->setText(tr("View/Edit/Load Map File")); m_mapButton->setToolTip(tr("View/Edit/Load Map File")); - m_mapButton->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/ographic.png").expanded())); + m_mapButton->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/ographic.png").expanded()))); m_mapButton->setWhatsThis(tr("This is the projection used by the mosaic " "scene. Cubes can not be shown in the scene without a projection, so " "if one is not selected, a default of Equirectangular will be used. " @@ -396,7 +396,7 @@ namespace Isis { m_quickMapAction = new QAction(tr("Quick Load Map"), this); m_quickMapAction->setToolTip(tr("Quick Load Map")); - m_quickMapAction->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/quickopen.png").expanded())); + m_quickMapAction->setIcon(QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/quickopen.png").expanded()))); m_quickMapAction->setWhatsThis(tr("This is the projection used by the mosaic " "scene. Cubes can not be shown in the scene without a projection, so " "if one is not selected, a default of Equirectangular will be used.")); @@ -497,7 +497,7 @@ namespace Isis { MosaicSceneItem *MosaicSceneWidget::cubeToMosaic(Image *image) { if (image == NULL) { - QString msg = tr("Can not find a NULL image in the mosaic"); + std::string msg = tr("Can not find a NULL image in the mosaic"); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -687,7 +687,7 @@ namespace Isis { MosaicSceneItem *MosaicSceneWidget::cubeToMosaic(DisplayProperties *props) { if (props == NULL) { - QString msg = tr("Can not find a NULL Display Properties in the mosaic"); + std::string msg = tr("Can not find a NULL Display Properties in the mosaic"); throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1092,7 +1092,7 @@ namespace Isis { QLabel *overviewMapIcon = new QLabel; overviewMapIcon->setPixmap( - QIcon(FileName("$ISISROOT/appdata/images/icons/ographic.png").expanded()).pixmap(32, 32)); + QIcon(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/ographic.png").expanded())).pixmap(32, 32)); mapHelpLayout->addWidget(overviewMapIcon); QLabel *defaultMapFile = new QLabel(tr( @@ -1694,7 +1694,7 @@ namespace Isis { mosaicSceneItem->reproject(); } catch (IException &e) { - QString msg = "The file ["; + std::string msg = "The file ["; if (mosaicSceneItem->image()) msg += mosaicSceneItem->image()->displayProperties()->displayName(); diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicTool.cpp index cf29526a84..08e5fdd94a 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicTool.cpp @@ -113,7 +113,7 @@ namespace Isis { QPixmap MosaicTool::getIcon(QString iconName) const { - QString path = FileName("$ISISROOT/appdata/images/icons").expanded(); + QString path = QString::fromStdString(FileName("$ISISROOT/appdata/images/icons").expanded()); QString fullPathToFile = QString(path + "/" + iconName); return QPixmap(fullPathToFile); } diff --git a/isis/src/qisis/objs/PaletteWindow/PaletteWindow.cpp b/isis/src/qisis/objs/PaletteWindow/PaletteWindow.cpp index 1cc2d2da63..b9d256341c 100644 --- a/isis/src/qisis/objs/PaletteWindow/PaletteWindow.cpp +++ b/isis/src/qisis/objs/PaletteWindow/PaletteWindow.cpp @@ -45,8 +45,8 @@ namespace Isis { */ void PaletteWindow::readSettings() { QString instanceName = this->windowTitle(); - FileName config("$HOME/.Isis/" + p_appName + "/" + instanceName + ".config"); - QSettings settings(config.expanded(), QSettings::NativeFormat); + FileName config("$HOME/.Isis/" + p_appName.toStdString() + "/" + instanceName.toStdString() + ".config"); + QSettings settings(QString::fromStdString(config.expanded()), QSettings::NativeFormat); QPoint pos = settings.value("pos", QPoint(300, 100)).toPoint(); QSize size = settings.value("size", QSize(900, 500)).toSize(); resize(size); @@ -66,8 +66,8 @@ namespace Isis { if(!this->isVisible()) return; QString instanceName = this->windowTitle(); - FileName config("$HOME/.Isis/" + p_appName + "/" + instanceName + ".config"); - QSettings settings(config.expanded(), QSettings::NativeFormat); + FileName config("$HOME/.Isis/" + p_appName.toStdString() + "/" + instanceName.toStdString() + ".config"); + QSettings settings(QString::fromStdString(config.expanded()), QSettings::NativeFormat); settings.setValue("pos", pos()); settings.setValue("size", size()); } diff --git a/isis/src/qisis/objs/PanTool/PanTool.cpp b/isis/src/qisis/objs/PanTool/PanTool.cpp index 769271a579..f4e6c9f94f 100644 --- a/isis/src/qisis/objs/PanTool/PanTool.cpp +++ b/isis/src/qisis/objs/PanTool/PanTool.cpp @@ -259,14 +259,14 @@ namespace Isis { void PanTool::writeSettings() { FileName config("$HOME/.Isis/qview/Pan Tool.config"); - QSettings settings(config.expanded(), + QSettings settings(QString::fromStdString(config.expanded()), QSettings::NativeFormat); settings.setValue("rate", p_lineEdit->text()); } void PanTool::readSettings() { FileName config("$HOME/.Isis/qview/Pan Tool.config"); - QSettings settings(config.expanded(), + QSettings settings(QString::fromStdString(config.expanded()), QSettings::NativeFormat); QString rate = settings.value("rate", "75").toString(); diff --git a/isis/src/qisis/objs/PlotWindow/PlotWindow.cpp b/isis/src/qisis/objs/PlotWindow/PlotWindow.cpp index 10d5af0a47..c777297e49 100644 --- a/isis/src/qisis/objs/PlotWindow/PlotWindow.cpp +++ b/isis/src/qisis/objs/PlotWindow/PlotWindow.cpp @@ -972,7 +972,7 @@ namespace Isis { m_showHideAllCurves->setText("Show All Curves"); m_showHideAllCurves->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_showCurves.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_showCurves.png").expanded()))); } else { @@ -980,7 +980,7 @@ namespace Isis { m_showHideAllCurves->setText("Hide All Curves"); m_showHideAllCurves->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_hideCurves.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_hideCurves.png").expanded()))); } for (int i = 0; i < m_plot->itemList().size(); i ++) { @@ -1014,13 +1014,13 @@ namespace Isis { QLabel(" To configure the curve properties Right click on the legend and select Configure from
the menu" " or click on the configure icon in the tool bar."); QLabel *config = new QLabel(); - config->setPixmap(QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_configure.png").expanded())); + config->setPixmap(QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_configure.png").expanded()))); QLabel *tableLabel = new QLabel("
Table Options:"); QLabel *tableDirections = new QLabel(" To view the table Click on the File menu and select Show Table or click on the table icon in the
tool bar."); QLabel *table = new QLabel(); - table->setPixmap(QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_table.png").expanded())); + table->setPixmap(QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_table.png").expanded()))); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(zoomLabel); @@ -1083,7 +1083,7 @@ namespace Isis { QAction *table = new QAction(m_plot); table->setText("Show Table"); table->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_table.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_table.png").expanded()))); QString text = "Function: Activates the table which displays the data of the " "current plot"; @@ -1102,7 +1102,7 @@ namespace Isis { QAction *track = new QAction(m_plot); track->setText("Show Mouse &Tracking"); track->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/goto.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/goto.png").expanded()))); track->setCheckable(true); QString text = "Function: Displays the x,y coordinates as the cursor moves " @@ -1117,7 +1117,7 @@ namespace Isis { QAction *backgrdSwitch = new QAction(m_plot); backgrdSwitch->setText("White/Black &Background"); backgrdSwitch->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_switchBackgrd.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_switchBackgrd.png").expanded()))); QString text = "Function: Switch the background color between black and " "white."; @@ -1132,7 +1132,7 @@ namespace Isis { m_showHideGrid = new QAction(m_plot); m_showHideGrid->setText("Show Grid"); m_showHideGrid->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_grid.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_grid.png").expanded()))); QString text = "Function: Display grid lines on the plot."; m_showHideGrid->setWhatsThis(text); @@ -1145,7 +1145,7 @@ namespace Isis { QAction *changeLabels = new QAction(m_plot); changeLabels->setText("Rename Plot &Labels"); changeLabels->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_renameLabels.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_renameLabels.png").expanded()))); QString text = "Function: Edit the plot title, x and y axis labels."; changeLabels->setWhatsThis(text); @@ -1160,7 +1160,7 @@ namespace Isis { QAction *changeScale = new QAction(m_plot); changeScale->setText("Set &Display Range"); changeScale->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_setScale.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_setScale.png").expanded()))); QString text = "Function: Adjust the scale for the x and y axis on the " "plot."; @@ -1175,7 +1175,7 @@ namespace Isis { m_showHideAllCurves = new QAction(m_plot); m_showHideAllCurves->setText("Hide All Curves"); m_showHideAllCurves->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_showCurves.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_showCurves.png").expanded()))); QString text = "Function: Displays or hides all the curves currently " "displayed on the plot."; @@ -1191,7 +1191,7 @@ namespace Isis { m_showHideAllMarkers = new QAction(m_plot); m_showHideAllMarkers->setText("Hide All Symbols"); m_showHideAllMarkers->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_markers.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_markers.png").expanded()))); QString text = "Function: Displays or hides a symbol for each " "data point plotted on a plot."; m_showHideAllMarkers->setWhatsThis(text); @@ -1205,7 +1205,7 @@ namespace Isis { QAction *resetScaleButton = new QAction(m_plot); resetScaleButton->setText("Reset Scale"); resetScaleButton->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_resetscale.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_resetscale.png").expanded()))); QString text = "Function: Reset the plot's scale."; resetScaleButton->setWhatsThis(text); @@ -1217,7 +1217,7 @@ namespace Isis { QAction *clear = new QAction(m_plot); clear->setText("Clear Plot"); clear->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/plot_clear.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_clear.png").expanded()))); QString text = "Function: Removes all the curves from the plot."; clear->setWhatsThis(text); @@ -1229,7 +1229,7 @@ namespace Isis { QAction *lineFit = new QAction(m_plot); lineFit->setText("Create Best Fit Line"); lineFit->setIcon( - QPixmap(FileName("$ISISROOT/appdata/images/icons/linefit.png").expanded())); + QPixmap(QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/linefit.png").expanded()))); QString text = "Function: Calculates a best fit line from an " "existing curve."; lineFit->setWhatsThis(text); @@ -1242,7 +1242,7 @@ namespace Isis { QAction *configurePlot = new QAction(m_plot); configurePlot->setText("Configure Plot"); configurePlot->setIcon( - QPixmap( FileName("$ISISROOT/appdata/images/icons/plot_configure.png").expanded() ) ); + QPixmap( QString::fromStdString(FileName("$ISISROOT/appdata/images/icons/plot_configure.png").expanded() )) ); QString text = "Function: Change the name, color, style, and vertex symbol of the " "curves."; configurePlot->setWhatsThis(text); diff --git a/isis/src/qisis/objs/Project/Project.cpp b/isis/src/qisis/objs/Project/Project.cpp index ff80874837..98e9e0c661 100644 --- a/isis/src/qisis/objs/Project/Project.cpp +++ b/isis/src/qisis/objs/Project/Project.cpp @@ -148,7 +148,7 @@ namespace Isis { int status = system( ("rm -rf '" + existingProjectFileName.expanded() + "' &").toLatin1().data() ); if (status != 0) { - QString msg = "Executing command [rm -rf" + existingProjectFileName.expanded() + + std::string msg = "Executing command [rm -rf" + existingProjectFileName.expanded() + "' &] failed with return status [" + toString(status) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -390,52 +390,52 @@ namespace Isis { try { if ( !dir.mkdir( cnetRoot() ) ) { - QString msg = QString("Unable to create folder [%1] when trying to initialize project") + std::string msg = QString("Unable to create folder [%1] when trying to initialize project") .arg( cnetRoot() ); warn(msg); throw IException(IException::Io, msg, _FILEINFO_); } if ( !dir.mkdir( imageDataRoot() ) ) { - QString msg = QString("Unable to create folder [%1] when trying to initialize project") + std::string msg = QString("Unable to create folder [%1] when trying to initialize project") .arg( imageDataRoot() ); warn(msg); throw IException(IException::Io, msg, _FILEINFO_); } if ( !dir.mkdir( shapeDataRoot() ) ) { - QString msg = QString("Unable to create folder [%1] when trying to initialize project") + std::string msg = QString("Unable to create folder [%1] when trying to initialize project") .arg( shapeDataRoot() ); warn(msg); throw IException(IException::Io, msg, _FILEINFO_); } if ( !dir.mkdir( resultsRoot() ) ) { - QString msg = QString("Unable to create folder [%1] when trying to initialize project") + std::string msg = QString("Unable to create folder [%1] when trying to initialize project") .arg( resultsRoot() ); warn(msg); throw IException(IException::Io, msg, _FILEINFO_); } if ( !dir.mkdir( bundleSolutionInfoRoot() ) ) { - QString msg = QString("Unable to create folder [%1] when trying to initialize project") + std::string msg = QString("Unable to create folder [%1] when trying to initialize project") .arg( bundleSolutionInfoRoot() ); warn(msg); throw IException(IException::Io, msg, _FILEINFO_); } if ( !dir.mkdir( templateRoot() ) ) { - QString msg = QString("Unable to create folder [%1] when trying to initialize project") + std::string msg = QString("Unable to create folder [%1] when trying to initialize project") .arg( templateRoot() ); warn(msg); throw IException(IException::Io, msg, _FILEINFO_); } if ( !dir.mkdir( templateRoot() + "/maps" ) ) { - QString msg = QString("Unable to create folder [%1] when trying to initialize project") + std::string msg = QString("Unable to create folder [%1] when trying to initialize project") .arg( templateRoot() + "/maps" ); warn(msg); throw IException(IException::Io, msg, _FILEINFO_); } if ( !dir.mkdir( templateRoot() + "/registrations" ) ) { - QString msg = QString("Unable to create folder [%1] when trying to initialize project") + std::string msg = QString("Unable to create folder [%1] when trying to initialize project") .arg( templateRoot() + "/registrations" ); warn(msg); throw IException(IException::Io, msg, _FILEINFO_); diff --git a/isis/src/qisis/objs/QnetTools/QnetFileTool.cpp b/isis/src/qisis/objs/QnetTools/QnetFileTool.cpp index 929cd80e93..3d93bf220c 100644 --- a/isis/src/qisis/objs/QnetTools/QnetFileTool.cpp +++ b/isis/src/qisis/objs/QnetTools/QnetFileTool.cpp @@ -153,8 +153,8 @@ namespace Isis { *controlNet() = ControlNet(); } catch (IException &e) { - QString message = "Error processing cube list. \n"; - QString errors = e.toString(); + std::string message = "Error processing cube list. \n"; + std::string errors = e.toString(); message += errors; QMessageBox::information((QWidget *)parent(), "Error", message); QApplication::restoreOverrideCursor(); @@ -185,8 +185,8 @@ namespace Isis { *controlNet() = ControlNet(cNetFileName, &progress); } catch (IException &e) { - QString message = "Invalid control network. \n"; - QString errors = e.toString(); + std::string message = "Invalid control network. \n"; + std::string errors = e.toString(); message += errors; QMessageBox::information((QWidget *)parent(), "Error", message); QApplication::restoreOverrideCursor(); @@ -200,8 +200,8 @@ namespace Isis { controlNet()->SetImages(*serialNumberList(), &progress); } catch (IException &e) { - QString message = "Cannot initialize images in control network. \n"; - QString errors = e.toString(); + std::string message = "Cannot initialize images in control network. \n"; + std::string errors = e.toString(); message += errors; QMessageBox::information((QWidget *)parent(), "Error", message); QApplication::restoreOverrideCursor(); @@ -291,8 +291,8 @@ namespace Isis { controlNet()->Write(fn); } catch (IException &e) { - QString message = "Error saving control network. \n"; - QString errors = e.toString(); + std::string message = "Error saving control network. \n"; + std::string errors = e.toString(); message += errors; QMessageBox::information((QWidget *)parent(), "Error", message); return; diff --git a/isis/src/qisis/objs/QnetTools/QnetNavTool.cpp b/isis/src/qisis/objs/QnetTools/QnetNavTool.cpp index 8c836e4f9c..1cd9729511 100644 --- a/isis/src/qisis/objs/QnetTools/QnetNavTool.cpp +++ b/isis/src/qisis/objs/QnetTools/QnetNavTool.cpp @@ -275,7 +275,7 @@ namespace Isis { * @history 2018-01-10 Adam Goins - Added the Activity History tab to the window. * This tab will keep track of edits made to control points/measures. * More history entries can be kept track of - * by emitting the activityUpdate(QString message) signal. + * by emitting the activityUpdate(std::string message) signal. */ void QnetNavTool::createFilters() { // Set up the point filters @@ -557,7 +557,7 @@ namespace Isis { // Make sure edit point is selected and in view. updateEditPoint(m_editPointId); - QString msg = "Filter Count: " + QString::number(m_listBox->count()) + + std::string msg = "Filter Count: " + QString::number(m_listBox->count()) + " / " + QString::number(controlNet()->GetNumPoints()); m_filterCountLabel->setText(msg); } @@ -573,7 +573,7 @@ namespace Isis { QString tempFileName = filename.name(); m_listBox->insertItem(i, tempFileName); } - QString msg = "Filter Count: " + QString::number(m_listBox->count()) + + std::string msg = "Filter Count: " + QString::number(m_listBox->count()) + " / " + QString::number(serialNumberList()->size()); m_filterCountLabel->setText(msg); @@ -689,7 +689,7 @@ namespace Isis { int images = (*controlNet())[m_filteredPoints[i]]->GetNumMeasures(); m_listBox->item(i)->setToolTip(QString::number(images) + " image(s) in point"); } - QString msg = "Filter Count: " + QString::number(m_listBox->count()) + + std::string msg = "Filter Count: " + QString::number(m_listBox->count()) + " / " + QString::number(controlNet()->GetNumPoints()); m_filterCountLabel->setText(msg); updateEditPoint(m_editPointId); @@ -705,7 +705,7 @@ namespace Isis { QString tempFileName = filename.name(); m_listBox->insertItem(i, tempFileName); } - QString msg = "Filter Count: " + QString::number(m_listBox->count()) + + std::string msg = "Filter Count: " + QString::number(m_listBox->count()) + " / " + QString::number(serialNumberList()->size()); m_filterCountLabel->setText(msg); } diff --git a/isis/src/qisis/objs/QnetTools/QnetPointRangeFilter.cpp b/isis/src/qisis/objs/QnetTools/QnetPointRangeFilter.cpp index b8789f1f29..a0cad28a95 100644 --- a/isis/src/qisis/objs/QnetTools/QnetPointRangeFilter.cpp +++ b/isis/src/qisis/objs/QnetTools/QnetPointRangeFilter.cpp @@ -105,13 +105,13 @@ namespace Isis { // Make sure the lat values are in order if (minlat > maxlat) { - QString msg = "The minimum latitude value must be less than the maximum latitude value"; + std::string msg = "The minimum latitude value must be less than the maximum latitude value"; QMessageBox::information((QWidget *)parent(), "Error", msg); return; } // Make sure the lon values are in order else if (minlon > maxlon) { - QString msg = "The minimum longitude value must be less than the maximum longitude value"; + std::string msg = "The minimum longitude value must be less than the maximum longitude value"; QMessageBox::information((QWidget *)parent(), "Error", msg); return; } diff --git a/isis/src/qisis/objs/QnetTools/QnetSetAprioriDialog.cpp b/isis/src/qisis/objs/QnetTools/QnetSetAprioriDialog.cpp index 2f9f7102da..c250267eb8 100644 --- a/isis/src/qisis/objs/QnetTools/QnetSetAprioriDialog.cpp +++ b/isis/src/qisis/objs/QnetTools/QnetSetAprioriDialog.cpp @@ -344,7 +344,7 @@ namespace Isis { */ void QnetSetAprioriDialog::fillCurrentAprioriLineEdits() { if (m_points.size() == 0) { - QString msg = "There are no Points selected. Please select a Point."; + std::string msg = "There are no Points selected. Please select a Point."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); return; } @@ -392,7 +392,7 @@ namespace Isis { */ void QnetSetAprioriDialog::fillReferenceAprioriLineEdits() { if (m_points.size() == 0) { - QString msg = "There are no Points selected. Please select a Point."; + std::string msg = "There are no Points selected. Please select a Point."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); return; } @@ -436,7 +436,7 @@ namespace Isis { //If all of the line edits are empty something went wrong, tell the user, and return if ((m_latLineEdit->text() == "") && (m_lonLineEdit->text() == "") && (m_radiusLineEdit->text() == "")) { - QString msg = "Cannot retrieve the latitude, longitude, and radius from the reference"; + std::string msg = "Cannot retrieve the latitude, longitude, and radius from the reference"; msg = msg + "measure; this is the result of a known problem in our system. Please select "; msg = msg + "Current, Average, or enter your own values."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); @@ -464,7 +464,7 @@ namespace Isis { */ void QnetSetAprioriDialog::fillAverageAprioriLineEdits() { if (m_points.size() == 0) { - QString msg = "There are no Points selected. Please select a Point."; + std::string msg = "There are no Points selected. Please select a Point."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); return; } @@ -493,7 +493,7 @@ namespace Isis { else { Camera *cam = m->Camera(); if (cam == NULL) { - QString msg = "The Camera must be set prior to calculating apriori"; + std::string msg = "The Camera must be set prior to calculating apriori"; throw IException(IException::Programmer, msg, _FILEINFO_); } if (cam->SetImage(m->GetSample(), m->GetLine())) { @@ -520,7 +520,7 @@ namespace Isis { // Did we have any measures? if (goodMeasures == 0) { - QString msg = "ControlPoint [" + id + "] has no measures which " + std::string msg = "ControlPoint [" + id + "] has no measures which " "project to lat/lon/radius (x/y/z)"; throw IException(IException::User, msg, _FILEINFO_); } @@ -585,7 +585,7 @@ namespace Isis { //tell the user that the average canot be computed and leave the apriori source alone if ((m_latLineEdit->text() == "") && (m_lonLineEdit->text() == "") && (m_radiusLineEdit->text() == "")) { - QString msg = "Average cannot be computed for this point [" + m_points.at(0)->text(); + std::string msg = "Average cannot be computed for this point [" + m_points.at(0)->text(); msg = msg + "]; this is the result of a known problem in our system. Please select "; msg = msg + "Current, Reference, or enter your own values."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); @@ -606,7 +606,7 @@ namespace Isis { // */ // void QnetSetAprioriDialog::fillGroundSourceAprioriLineEdits() { // if (m_points.size() == 0) { -// QString msg = "There are no Points selected. Please select a Point."; +// std::string msg = "There are no Points selected. Please select a Point."; // QMessageBox::warning((QWidget *)parent(), "Warning", msg); // return; // } @@ -626,7 +626,7 @@ namespace Isis { */ void QnetSetAprioriDialog::fillSigmaLineEdits() { if (m_points.size() == 0) { - QString msg = "There are no Points selected. Please select a Point."; + std::string msg = "There are no Points selected. Please select a Point."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); return; } @@ -718,14 +718,14 @@ namespace Isis { } if (m_multiPointsEditLockedCount > 0) { m_aprioriDialog->setDisabled(true); - QString msg = "There is an EditLocked point selected. To continue, unselect the"; + std::string msg = "There is an EditLocked point selected. To continue, unselect the"; msg = msg + " Editlocked point."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); return; } if (m_multiPointsFixedCount > 0 || m_multiPointsFreeCount > 0) { m_aprioriDialog->setDisabled(true); - QString msg = "Sigmas can only be set on Constrained points. Use Filters to filter by"; + std::string msg = "Sigmas can only be set on Constrained points. Use Filters to filter by"; msg = msg + " Constrained points."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); return; @@ -739,7 +739,7 @@ namespace Isis { ControlPoint *pt = m_qnetTool->controlNet()->GetPoint(id); if (pt->IsEditLocked()) { m_aprioriDialog->setDisabled(true); - QString msg = "This control point is edit locked. The Apriori latitude, longitude and "; + std::string msg = "This control point is edit locked. The Apriori latitude, longitude and "; msg += "radius cannot be updated. You must first unlock the point by clicking the "; msg += "check box above labeled \"Edit Lock Point\"."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); @@ -859,7 +859,7 @@ namespace Isis { void QnetSetAprioriDialog::setApriori() { if (m_points.size() == 0) { - QString msg = "There are no Points selected. Please select a Point."; + std::string msg = "There are no Points selected. Please select a Point."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); return; } @@ -876,7 +876,7 @@ namespace Isis { if (m_latLineEdit->text() != "") { lat = m_latLineEdit->text().toDouble(); if (lat > 90 || lat < -90) { - QString msg = "Invalid latitude value. Please enter a latitude value between -90 and 90."; + std::string msg = "Invalid latitude value. Please enter a latitude value between -90 and 90."; QMessageBox::warning((QWidget *)parent(), "Warning", msg); return; } @@ -934,7 +934,7 @@ namespace Isis { } } if (!pt->HasAprioriCoordinates()) { - QString msg = "Point [" + id + "] does not have an Apriori coordinate. " + std::string msg = "Point [" + id + "] does not have an Apriori coordinate. " "Make sure to save the ground source measurement then the Point before " "setting the sigmas. "; if (m_points.size() > 1) { @@ -966,7 +966,7 @@ namespace Isis { emit netChanged(); } catch (IException &e) { - QString message = "Error setting sigmas. \n"; + std::string message = "Error setting sigmas. \n"; message += e.toString(); QMessageBox::critical((QWidget *)parent(),"Error",message); QApplication::restoreOverrideCursor(); diff --git a/isis/src/qisis/objs/QnetTools/QnetTool.cpp b/isis/src/qisis/objs/QnetTools/QnetTool.cpp index 5939afecd1..3c322ded20 100644 --- a/isis/src/qisis/objs/QnetTools/QnetTool.cpp +++ b/isis/src/qisis/objs/QnetTools/QnetTool.cpp @@ -731,7 +731,7 @@ namespace Isis { m_editPoint->GetMeasure(m_rightMeasure->GetCubeSerialNumber()); if (m_editPoint->IsIgnored()) { - QString message = "You are saving changes to a measure on an ignored "; + std::string message = "You are saving changes to a measure on an ignored "; message += "point. Do you want to set Ignore = False on the point and "; message += "both measures?"; switch (QMessageBox::question(m_qnetTool, "Qnet Tool Save Measure", @@ -755,7 +755,7 @@ namespace Isis { } } if (origRightMeasure->IsIgnored() && m_rightMeasure->IsIgnored()) { - QString message = "You are saving changes to an ignored measure. "; + std::string message = "You are saving changes to an ignored measure. "; message += "Do you want to set Ignore = False on the right measure?"; switch(QMessageBox::question(m_qnetTool, "Qnet Tool Save Measure", message, "&Yes", "&No", 0, 0)){ @@ -773,7 +773,7 @@ namespace Isis { // there has not been a reference set, set the measure on the left as the reference. if (m_editPoint->IsReferenceExplicit()) { if (m_editPoint->IsEditLocked()) { - QString message = "This control point is edit locked. The Apriori latitude, longitude and "; + std::string message = "This control point is edit locked. The Apriori latitude, longitude and "; message += "radius cannot be updated. You must first unlock the point by clicking the "; message += "check box above labeled \"Edit Lock Point\"."; QMessageBox::warning(m_qnetTool, "Point Locked", message); @@ -797,14 +797,14 @@ namespace Isis { if (m_editPoint->GetType() != ControlPoint::Free && (m_groundOpen && m_rightMeasure->GetCubeSerialNumber() == m_groundSN)) { if (m_editPoint->IsEditLocked() && m_controlNet->ContainsPoint(m_editPoint->GetId())) { - QString message = "This control point is edit locked. The Apriori latitude, longitude and "; + std::string message = "This control point is edit locked. The Apriori latitude, longitude and "; message += "radius cannot be updated. You must first unlock the point by clicking the "; message += "check box above labeled \"Edit Lock Point\"."; QMessageBox::warning(m_qnetTool, "Point Locked", message); return; } if (m_leftMeasure->IsIgnored()) { - QString message = "This is a Constrained or Fixed point and the reference measure is "; + std::string message = "This is a Constrained or Fixed point and the reference measure is "; message += "Ignored. Unset the Ignore flag on the reference measure before saving."; QMessageBox::warning(m_qnetTool, "Point Locked", message); return; @@ -870,7 +870,7 @@ namespace Isis { ControlMeasure *refMeasure = m_editPoint->GetRefMeasure(); if ( (m_leftMeasure->GetCubeSerialNumber() != m_groundSN) && (refMeasure->GetCubeSerialNumber() != m_leftMeasure->GetCubeSerialNumber()) ) { - QString message = "This point already contains a reference measure. "; + std::string message = "This point already contains a reference measure. "; message += "Would you like to replace it with the measure on the left?"; int response = QMessageBox::question(m_qnetTool, "Qnet Tool Save Measure", message, @@ -907,7 +907,7 @@ namespace Isis { // If the right measure is the reference, make sure they really want // to move the reference. if (refMeasure->GetCubeSerialNumber() == m_rightMeasure->GetCubeSerialNumber()) { - QString message = "You are making a change to the reference measure. You "; + std::string message = "You are making a change to the reference measure. You "; message += "may need to move all of the other measures to match the new "; message += " coordinate of the reference measure. Do you really want to "; message += " change the reference measure? "; @@ -963,7 +963,7 @@ namespace Isis { if (m_demOpen) { radius = demRadius(lat,lon); if (radius == Null) { - QString msg = "Could not read radius from DEM, will default to " + std::string msg = "Could not read radius from DEM, will default to " "local radius of reference measure."; QMessageBox::warning(m_qnetTool, "Warning", msg); if (m_editPoint->GetRefMeasure()->Camera()->SetGround( @@ -975,7 +975,7 @@ namespace Isis { //m_editPoint->SetAprioriRadiusSourceFile(m_radiusSourceFile); } else { - QString message = "Error trying to get radius at this pt. " + std::string message = "Error trying to get radius at this pt. " "Lat/Lon does not fall on the reference measure. " "Cannot save this measure."; QMessageBox::critical(m_qnetTool,"Error",message); @@ -997,7 +997,7 @@ namespace Isis { //radius = m_groundGmap->Projection()->LocalRadius(); } else { - QString message = "Error trying to get radius at this pt. " + std::string message = "Error trying to get radius at this pt. " "Lat/Lon does not fall on the reference measure. " "Cannot save this measure."; QMessageBox::critical(m_qnetTool,"Error",message); @@ -1028,7 +1028,7 @@ namespace Isis { } } catch (IException &e) { - QString message = "Unable to set Apriori Surface Point.\n"; + std::string message = "Unable to set Apriori Surface Point.\n"; message += "Latitude = " + QString::number(lat); message += " Longitude = " + QString::number(lon); message += " Radius = " + QString::number(radius) + "\n"; @@ -1125,7 +1125,7 @@ namespace Isis { if (pointType != ControlPoint::Free && m_leftMeasure->IsIgnored()) { m_pointType->setCurrentIndex((int) m_editPoint->GetType()); - QString message = "The reference measure is Ignored. Unset the Ignore flag on the "; + std::string message = "The reference measure is Ignored. Unset the Ignore flag on the "; message += "reference measure before setting the point type to Constrained or Fixed."; QMessageBox::warning(m_qnetTool, "Ignored Reference Measure", message); return; @@ -1141,7 +1141,7 @@ namespace Isis { ControlPoint::Status status = m_editPoint->SetType((ControlPoint::PointType) pointType); if (status == ControlPoint::PointLocked) { m_pointType->setCurrentIndex((int) m_editPoint->GetType()); - QString message = "This control point is edit locked. The point type cannot be changed. You "; + std::string message = "This control point is edit locked. The point type cannot be changed. You "; message += "must first unlock the point by clicking the check box above labeled "; message += "\"Edit Lock Point\"."; QMessageBox::warning(m_qnetTool, "Point Locked", message); @@ -1243,7 +1243,7 @@ namespace Isis { ControlPoint::Status status = m_editPoint->SetIgnored(ignore); if (status == ControlPoint::PointLocked) { m_ignorePoint->setChecked(m_editPoint->IsIgnored()); - QString message = "This control point is edit locked. The Ignored status cannot be "; + std::string message = "This control point is edit locked. The Ignored status cannot be "; message += "changed. You must first unlock the point by clicking the check box above "; message += "labeled \"Edit Lock Point\"."; QMessageBox::warning(m_qnetTool, "Point Locked", message); @@ -1404,7 +1404,7 @@ namespace Isis { */ void QnetTool::saveNet() { if (m_cnetFileName.isEmpty()) { - QString message = "This is a new network, you must select " + std::string message = "This is a new network, you must select " "\"Save As\" under the File Menu."; QMessageBox::critical(m_qnetTool, "Error", message); return; @@ -1527,7 +1527,7 @@ namespace Isis { sn = m_serialNumberList->serialNumber(file); } catch (IException &e) { - QString message = "Cannot get serial number for " + file + ". Is file contained in the "; + std::string message = "Cannot get serial number for " + file + ". Is file contained in the "; message += "cube list?\n"; message += e.toString(); QMessageBox::critical(m_qnetTool, "Error", message); @@ -1541,14 +1541,14 @@ namespace Isis { if (s == Qt::LeftButton) { if (!m_controlNet || m_controlNet->GetNumPoints() == 0) { - QString message = "No points exist for editing. Create points "; + std::string message = "No points exist for editing. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_qnetTool, "Warning", message); return; } if (sn == m_groundSN) { - QString message = "Cannot select point for editing on ground source. Select "; + std::string message = "Cannot select point for editing on ground source. Select "; message += "point using un-projected images or the Navigator Window."; QMessageBox::critical(m_qnetTool, "Error", message); return; @@ -1563,7 +1563,7 @@ namespace Isis { modifyPoint(point); } catch (IException &ie) { - QString message = "No points exist for editing. Create points using the right mouse"; + std::string message = "No points exist for editing. Create points using the right mouse"; message += " button."; QMessageBox::warning(m_qnetTool, "Warning", message); return; @@ -1572,14 +1572,14 @@ namespace Isis { else if (s == Qt::MiddleButton) { if (!m_controlNet || m_controlNet->GetNumPoints() == 0) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_qnetTool, "Warning", message); return; } if (m_groundOpen && file == m_groundCube->fileName()) { - QString message = "Cannot select point for deleting on ground source. Select "; + std::string message = "Cannot select point for deleting on ground source. Select "; message += "point using un-projected images or the Navigator Window."; QMessageBox::critical(m_qnetTool, "Error", message); return; @@ -1590,14 +1590,14 @@ namespace Isis { point = m_controlNet->FindClosest(sn, samp, line); if (point == NULL) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_qnetTool, "Warning", message); return; } } catch (IException &e) { - QString message = "Cannot find point on this image for deleting."; + std::string message = "Cannot find point on this image for deleting."; QMessageBox::critical(m_qnetTool, "Error", message); return; } @@ -1608,7 +1608,7 @@ namespace Isis { m_leftFile = file; UniversalGroundMap *gmap = cvp->universalGroundMap(); if (!gmap->SetImage(samp,line)) { - QString message = "Invalid latitude or longitude at this point. "; + std::string message = "Invalid latitude or longitude at this point. "; QMessageBox::critical(m_qnetTool,"Error", message); return; } @@ -1703,7 +1703,7 @@ namespace Isis { // If this ControlPointId already exists, message box pops up and user is // asked to enter a new value. if (m_controlNet->ContainsPoint(newPoint->GetId())) { - QString message = "A ControlPoint with Point Id = [" + newPoint->GetId(); + std::string message = "A ControlPoint with Point Id = [" + newPoint->GetId(); message += "] already exists. Re-enter Point Id for this ControlPoint."; QMessageBox::warning(m_qnetTool, "New Point Id", message); pointFiles.clear(); @@ -1808,7 +1808,7 @@ namespace Isis { } if (pointFiles.count() == 0) { - QString message = "Point does not intersect any images."; + std::string message = "Point does not intersect any images."; QMessageBox::critical(m_qnetTool, "No intersection", message); return; } @@ -1829,7 +1829,7 @@ namespace Isis { // If this ControlPointId already exists, message box pops up and user is // asked to enter a new value. if (m_controlNet->ContainsPoint(fixedPoint->GetId())) { - QString message = "A ControlPoint with Point Id = [" + fixedPoint->GetId(); + std::string message = "A ControlPoint with Point Id = [" + fixedPoint->GetId(); message += "] already exists. Re-enter Point Id for this ControlPoint."; QMessageBox::warning(m_qnetTool, "New Point Id", message); pointFiles.clear(); @@ -1869,7 +1869,7 @@ namespace Isis { if (m_demOpen) { radius = demRadius(lat,lon); if (radius == Null) { - QString msg = "Could not read radius from DEM, will default to the " + std::string msg = "Could not read radius from DEM, will default to the " "local radius of the first measure in the control point. This " "will be updated to the local radius of the chosen reference " "measure."; @@ -1879,7 +1879,7 @@ namespace Isis { radius = (*fixedPoint)[0]->Camera()->LocalRadius().meters(); } else { - QString msg = "Error trying to get radius at this pt. " + std::string msg = "Error trying to get radius at this pt. " "Lat/Lon does not fall on the reference measure. " "Cannot create this point."; QMessageBox::critical(m_qnetTool, "Error", msg); @@ -1897,7 +1897,7 @@ namespace Isis { radius = (*fixedPoint)[0]->Camera()->LocalRadius().meters(); } else { - QString msg = "Error trying to get radius at this pt. " + std::string msg = "Error trying to get radius at this pt. " "Lat/Lon does not fall on the reference measure. " "Cannot create this point."; QMessageBox::critical(m_qnetTool, "Error", msg); @@ -1996,7 +1996,7 @@ namespace Isis { // If all measures being deleted, let user know and give them the option to quit operation if (!deletePointDialog->deleteAllCheckBox->isChecked()) { - QString message = "You have selected all measures in this point to be deleted. This " + std::string message = "You have selected all measures in this point to be deleted. This " "control point will be deleted. Do you want to delete this control point?"; int response = QMessageBox::question(m_qnetTool, "Delete control point", message, @@ -2040,7 +2040,7 @@ namespace Isis { if (m_editPoint->IsReferenceExplicit() && (m_editPoint->GetRefMeasure()->GetCubeSerialNumber() == (*m_editPoint)[i]->GetCubeSerialNumber())) { - QString message = "You are trying to delete the Reference measure." + std::string message = "You are trying to delete the Reference measure." " Do you really want to delete the Reference measure?"; switch (QMessageBox::question(m_qnetTool, "Delete Reference measure?", message, @@ -2111,7 +2111,7 @@ namespace Isis { // If no measures, print info and return if (point->GetNumMeasures() == 0) { - QString message = "This point has no measures."; + std::string message = "This point has no measures."; QMessageBox::warning(m_qnetTool, "Warning", message); // update nav list to re-highlight old point if (m_editPoint != NULL) { @@ -2185,7 +2185,7 @@ namespace Isis { // TODO ???if doesn't exist,??? if (!m_groundGmap->SetUniversalGround(lat,lon)) { located = false; - QString message = "This point does not exist on the ground source.\n"; + std::string message = "This point does not exist on the ground source.\n"; message += "Latitude = " + QString::number(lat); message += " Longitude = " + QString::number(lon); message += "\n A ground measure will not be created."; @@ -3350,7 +3350,7 @@ namespace Isis { QFile file(FileName(fn).expanded()); if (!file.open(QIODevice::ReadOnly)) { - QString msg = "Failed to open template file \"" + fn + "\""; + std::string msg = "Failed to open template file \"" + fn + "\""; QMessageBox::warning(m_qnetTool, "IO Error", msg); return; } @@ -3418,7 +3418,7 @@ namespace Isis { ss >> pvl; } catch(IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::warning(m_qnetTool, "Error", message); return; } @@ -3428,7 +3428,7 @@ namespace Isis { QFile file(expandedFileName); if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - QString msg = "Failed to save template file to \"" + fn + "\"\nDo you " + std::string msg = "Failed to save template file to \"" + fn + "\"\nDo you " "have permission?"; QMessageBox::warning(m_qnetTool, "IO Error", msg); return; @@ -3473,7 +3473,7 @@ namespace Isis { registrationDialog.exec(); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::information(m_qnetTool, "Error", message); } } @@ -3681,7 +3681,7 @@ namespace Isis { if (newGroundSN != m_groundSN && m_serialNumberList->hasSerialNumber(newGroundSN)) { // TODO If it already exists, are the files different? Now what? // For now, do not allow. - QString message = "A cube in the cube list has the same serial number as this ground file. "; + std::string message = "A cube in the cube list has the same serial number as this ground file. "; message += "If this ground source is a level 1, un-projected cube, it is probably included "; message += "in the cube list. If the ground source is a projected version of a cube in "; message += "the list and has the Instrument Group in the labels, the un-projected and "; @@ -3797,7 +3797,7 @@ namespace Isis { } } catch (IException &) { - QString message = "Cannot create either Camera or Projections "; + std::string message = "Cannot create either Camera or Projections "; message += "for the ground source file. Check the validity of the "; message += " cube labels. The cube must either be projected or "; message += " run through spiceinit."; @@ -3831,7 +3831,7 @@ namespace Isis { void QnetTool::openDem() { if (m_groundFile.isEmpty()) { - QString message = "You must enter a ground source before opening a Dem."; + std::string message = "You must enter a ground source before opening a Dem."; QMessageBox::critical(m_qnetTool, "Error", message); return; } @@ -3929,7 +3929,7 @@ namespace Isis { // Make sure this is a dem if (!m_demCube->hasTable("ShapeModelStatistics")) { - QString message = m_demFile + " is not a DEM."; + std::string message = m_demFile + " is not a DEM."; QMessageBox::critical(m_qnetTool, "Error", message); m_demCube.reset(NULL); m_demOpen = false; diff --git a/isis/src/qisis/objs/ScatterPlotTool/ScatterPlotData.cpp b/isis/src/qisis/objs/ScatterPlotTool/ScatterPlotData.cpp index 3dd430fcd8..78c1b42f55 100644 --- a/isis/src/qisis/objs/ScatterPlotTool/ScatterPlotData.cpp +++ b/isis/src/qisis/objs/ScatterPlotTool/ScatterPlotData.cpp @@ -253,7 +253,7 @@ namespace Isis { } - QString msg = "Bin at index [" + QString::number(index) + "] not found. " + std::string msg = "Bin at index [" + QString::number(index) + "] not found. " "There are [" + QString::number(numberOfBins()) + "] bins"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -447,7 +447,7 @@ namespace Isis { int xIndex = binIndex; if (xIndex < 0 || yIndex < 0 || xIndex >= xSize || yIndex >= ySize) { - QString msg = "Bin at index [" + QString::number(binIndex) + "] not found. " + std::string msg = "Bin at index [" + QString::number(binIndex) + "] not found. " "There are [" + QString::number(numberOfBins()) + "] bins"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/qisis/objs/Shape/Shape.cpp b/isis/src/qisis/objs/Shape/Shape.cpp index 9a318d9dba..616299d94e 100644 --- a/isis/src/qisis/objs/Shape/Shape.cpp +++ b/isis/src/qisis/objs/Shape/Shape.cpp @@ -153,7 +153,7 @@ namespace Isis { m_surfacePointSource = ControlPoint::SurfacePointSource::None; m_radiusSource = ControlPoint::RadiusSource::None; m_shapeType = Unknown; - QString message = "Cannot create either Camera or Projections " + std::string message = "Cannot create either Camera or Projections " "for the ground source file [" + displayProperties()->displayName() + "]. " "Check the validity of the cube labels. The cube must either be projected or " " run through spiceinit."; @@ -174,7 +174,7 @@ namespace Isis { } } catch (IException &e) { - QString message = "Cannot initialize the camera, map or dem statistics for this shape file [" + + std::string message = "Cannot initialize the camera, map or dem statistics for this shape file [" + displayProperties()->displayName() + "]. Check the validity of the cube labels. The " "cube must either be projected or run through spiceinit. \n"; message += e.toString(); diff --git a/isis/src/qisis/objs/StereoTool/ProfileDialog.cpp b/isis/src/qisis/objs/StereoTool/ProfileDialog.cpp index 0a0a2fdfa6..e0db981d45 100644 --- a/isis/src/qisis/objs/StereoTool/ProfileDialog.cpp +++ b/isis/src/qisis/objs/StereoTool/ProfileDialog.cpp @@ -49,7 +49,7 @@ void ProfileDialog::createEndSelected() { void ProfileDialog::help() { - QString message = "You must create and refine the end points of the profile " + std::string message = "You must create and refine the end points of the profile " "line before the elevation profile can be calculated.\n\n A line is " "computed between the end points on both the left and right cubes, then " "sub-pixel registration is computed along these two lines to find the " diff --git a/isis/src/qisis/objs/StereoTool/StereoTool.cpp b/isis/src/qisis/objs/StereoTool/StereoTool.cpp index 6b9cfefe18..ff075ccb6d 100644 --- a/isis/src/qisis/objs/StereoTool/StereoTool.cpp +++ b/isis/src/qisis/objs/StereoTool/StereoTool.cpp @@ -610,7 +610,7 @@ namespace Isis { } } catch (IException &e) { - QString message = "Invalid base radius entered."; + std::string message = "Invalid base radius entered."; message += e.toString(); m_radiusLineEdit->setText(""); QMessageBox::critical(m_stereoTool, "Error", message); @@ -642,7 +642,7 @@ namespace Isis { if (m_leftCube) { m_leftCube->camera()->IgnoreElevationModel(false); if ( m_leftCube->camera()->target()->shape()->name() == "Ellipsoid" ) { - QString message = "No valid Dem on cube. Run spicinit using a " + std::string message = "No valid Dem on cube. Run spicinit using a " "dem shape model. The local radius will default back to the ellipsoid."; QMessageBox::warning(m_stereoTool, "Warning", message); m_radiusBox->setCurrentIndex(0); @@ -714,7 +714,7 @@ namespace Isis { m_linkedViewports.at(0)->cube()->camera()->target()->name() ) { // Allow opportunity to save current data before clearing for new // target. - QString message = "You have changed targets. All data must be re-set"; + std::string message = "You have changed targets. All data must be re-set"; message += " for new target. Would you like to save your current"; message += " points before resetting?"; int response = QMessageBox::question(m_stereoTool, @@ -808,7 +808,7 @@ namespace Isis { m_targetRadius = Distance(pvlRadii["EquatorialRadius"], Distance::Meters); } catch(IException &e) { - QString message = "Could not determine target radius."; + std::string message = "Could not determine target radius."; QMessageBox::critical(m_stereoTool,"Error",message); m_baseRadius = Distance(0., Distance::Meters); updateRadiusLineEdit(); @@ -821,7 +821,7 @@ namespace Isis { m_leftGM = new UniversalGroundMap(*m_leftCube); } catch (IException &e) { - QString message = "Cannot initialize universal ground map for " + + std::string message = "Cannot initialize universal ground map for " + m_leftCube->fileName() + ".\n"; message += e.toString(); QMessageBox::critical(m_stereoTool, "Error", message); @@ -831,7 +831,7 @@ namespace Isis { m_rightGM = new UniversalGroundMap(*m_rightCube); } catch (IException &e) { - QString message = "Cannot initialize universal ground map for" + + std::string message = "Cannot initialize universal ground map for" + m_rightCube->fileName() + ".\n"; message += e.toString(); QMessageBox::critical(m_stereoTool, "Error", message); @@ -863,7 +863,7 @@ namespace Isis { m_targetRadius ) ); } catch (IException &e) { - QString message = "Unable to set Apriori Surface Point.\n"; + std::string message = "Unable to set Apriori Surface Point.\n"; message += "Latitude = " + QString::number(lat); message += " Longitude = " + QString::number(lon); message += " Radius = " + QString::number(m_targetRadius.meters(), 'f', @@ -900,7 +900,7 @@ namespace Isis { setupFiles(); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::critical(m_stereoTool, "Error setting stereo pair", message); rubberBandTool()->clear(); return; @@ -916,7 +916,7 @@ namespace Isis { sn = m_serialNumberList->serialNumber(file); } catch (IException &e) { - QString message = "This cube is not linked as a stereo pair. Make "; + std::string message = "This cube is not linked as a stereo pair. Make "; message += "sure you have two stereo pair cube viewports linked."; QMessageBox::critical(m_stereoTool,"Viewport not linked", message); return; @@ -929,7 +929,7 @@ namespace Isis { samp, line ); if ( rubberBandTool()->mouseButton() & Qt::LeftButton ) { if ( !m_controlNet || m_controlNet->GetNumMeasures() == 0 ) { - QString message = "No points exist for editing. Create points "; + std::string message = "No points exist for editing. Create points "; message += "using the right mouse button."; QMessageBox::information(m_stereoTool, "Warning", message); return; @@ -940,7 +940,7 @@ namespace Isis { point = m_controlNet->FindClosest(sn, samp, line); } catch (IException &e) { - QString message = "No points found for editing. Create points "; + std::string message = "No points found for editing. Create points "; message += "using the right mouse button."; message += e.toString(); QMessageBox::critical(m_stereoTool, "Error", message); @@ -950,7 +950,7 @@ namespace Isis { } else if ( rubberBandTool()->mouseButton() & Qt::MiddleButton ) { if ( !m_controlNet || m_controlNet->GetNumPoints() == 0 ) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::warning(m_stereoTool, "Warning", message); return; @@ -961,7 +961,7 @@ namespace Isis { m_controlNet->FindClosest(sn, samp, line); // TODO: test for errors and reality if (point == NULL) { - QString message = "No points exist for deleting. Create points "; + std::string message = "No points exist for deleting. Create points "; message += "using the right mouse button."; QMessageBox::information(m_stereoTool, "Warning", message); return; @@ -984,7 +984,7 @@ namespace Isis { createPoint(lat, lon); } catch (IException &e) { - QString message = "Cannot create control point.\n\n"; + std::string message = "Cannot create control point.\n\n"; message += e.toString(); QMessageBox::critical(m_stereoTool, "Error", message); m_startPoint = NULL; @@ -1007,7 +1007,7 @@ namespace Isis { m_startPoint = m_controlNet->FindClosest(sn, samp, line); } catch (IException &e) { - QString message = "Cannot find start point for profile. Either "; + std::string message = "Cannot find start point for profile. Either "; message += "create end points individually using the right mouse "; message += "button. Or, create profile end points by clicking and "; message += "dragging with the right mouse button.\n\n"; @@ -1028,7 +1028,7 @@ namespace Isis { } } catch (IException &e) { - QString message = "Cannot find end point for profile. Either "; + std::string message = "Cannot find end point for profile. Either "; message += "create end points individually using the right mouse "; message += "button. Or, create profile end points by clicking and "; message += "dragging with the right mouse button.\n\n"; @@ -1096,7 +1096,7 @@ namespace Isis { createPoint(lat, lon); } catch (IException &e) { - QString message = "Cannot create control point.\n\n"; + std::string message = "Cannot create control point.\n\n"; message += e.toString(); QMessageBox::critical(m_stereoTool, "Error", message); delete m_profileDialog; @@ -1133,7 +1133,7 @@ namespace Isis { createPoint(lat, lon); } catch (IException &e) { - QString message = "Cannot create control point.\n\n"; + std::string message = "Cannot create control point.\n\n"; message += e.toString(); QMessageBox::critical(m_stereoTool, "Error", message); m_startPoint = NULL; @@ -1182,7 +1182,7 @@ namespace Isis { IString message = "Point does not exist on cube, " + m_rightCube->fileName() + "."; throw IException(IException::User, message, _FILEINFO_); -// QString message = "Point does not exist on cube, " + +// std::string message = "Point does not exist on cube, " + // QString(m_rightCube->fileName().c_str() ) + "."; // QMessageBox::critical(m_stereoTool, "Error", message); // return; @@ -1192,7 +1192,7 @@ namespace Isis { IString message = "Point does not exist on cube, " + m_rightCube->fileName() + "."; throw IException(IException::User, message, _FILEINFO_); -// QString message = "Point does not exist on cube, " + +// std::string message = "Point does not exist on cube, " + // QString(m_rightCube->fileName().c_str() ) + "."; // QMessageBox::critical(m_stereoTool, "Error", message); // return; @@ -1202,7 +1202,7 @@ namespace Isis { IString message = "Point does not exist on cube, " + m_leftCube->fileName() + "."; throw IException(IException::User, message, _FILEINFO_); -// QString message = "Point does not exist on cube, " + +// std::string message = "Point does not exist on cube, " + // QString(m_leftCube->fileName().c_str() ) + "."; // QMessageBox::critical(m_stereoTool, "Error", message); // return; @@ -1225,7 +1225,7 @@ namespace Isis { } if ( ok && id.isEmpty() ) { // user clicked "Ok" but did not enter a point ID - QString message = "You must enter a point Id."; + std::string message = "You must enter a point Id."; QMessageBox::warning(m_stereoTool, "Warning", message); } else { @@ -1233,7 +1233,7 @@ namespace Isis { newPoint = new ControlPoint(id); if ( m_controlNet->GetNumPoints() > 0 && m_controlNet->ContainsPoint(newPoint->GetId() ) ) { - QString message = "A ControlPoint with Point Id = [" + + std::string message = "A ControlPoint with Point Id = [" + newPoint->GetId() + "] already exists. Re-enter unique Point Id."; QMessageBox::warning(m_stereoTool, "Unique Point Id", message); @@ -1489,7 +1489,7 @@ namespace Isis { m_baseRadius = leftCamera->LocalRadius( leftCamera->GetLatitude(), leftCamera->GetLongitude() ); if ( !m_baseRadius.isValid() ) { - QString message = "Invalid Dem radius, defaulting to ellipsoidal."; + std::string message = "Invalid Dem radius, defaulting to ellipsoidal."; QMessageBox::warning(m_stereoTool, "Invalid Dem radius", message); m_baseRadius = m_targetRadius; } @@ -1568,7 +1568,7 @@ namespace Isis { registrationDialog.exec(); } catch (IException &e) { - QString message = e.toString(); + std::string message = e.toString(); QMessageBox::warning(m_stereoTool, "Error", message); } } @@ -1777,7 +1777,7 @@ namespace Isis { shortCube->camera()->GetLatitude(), shortCube->camera()->GetLongitude() ); if ( !m_baseRadius.isValid() ) { - QString message = "Invalid Dem radius, defaulting to ellipsoidal."; + std::string message = "Invalid Dem radius, defaulting to ellipsoidal."; QMessageBox::warning(m_stereoTool, "Invalid Dem radius", message); m_baseRadius = m_targetRadius; } @@ -1801,7 +1801,7 @@ namespace Isis { } } catch (IException &e) { - QString message = "Error registering cubes along profile line.\n"; + std::string message = "Error registering cubes along profile line.\n"; message += "Image 1 Sample = " + QString::number(shortSamp); message += " Line = " + QString::number(shortLine); message += "\nImage 2 Sample = " + QString::number(longSamp); @@ -1815,7 +1815,7 @@ namespace Isis { QApplication::restoreOverrideCursor(); // cout<<"Registration attempts = "<<(int)shortLength<<" failures = "<restoreSavedStretch(stretch); } else { - QString msg = "Gray mode not enabled, cannot restore gray stretch"; + std::string msg = "Gray mode not enabled, cannot restore gray stretch"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -206,7 +206,7 @@ namespace Isis { } } else { - QString msg = "RGB mode not enabled, cannot restore RGB stretch"; + std::string msg = "RGB mode not enabled, cannot restore RGB stretch"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -352,7 +352,7 @@ namespace Isis { return p_grayStretch->getStretch(); } else { - QString msg = "Gray mode not enabled, cannot get gray stretch"; + std::string msg = "Gray mode not enabled, cannot get gray stretch"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -368,7 +368,7 @@ namespace Isis { return p_redStretch->getStretch(); } else { - QString msg = "RGB mode not enabled, cannot get red stretch"; + std::string msg = "RGB mode not enabled, cannot get red stretch"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -384,7 +384,7 @@ namespace Isis { return p_grnStretch->getStretch(); } else { - QString msg = "RGB mode not enabled, cannot get green stretch"; + std::string msg = "RGB mode not enabled, cannot get green stretch"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -400,7 +400,7 @@ namespace Isis { return p_bluStretch->getStretch(); } else { - QString msg = "RGB mode not enabled, cannot get blue stretch"; + std::string msg = "RGB mode not enabled, cannot get blue stretch"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/qisis/objs/StretchTool/StretchTool.cpp b/isis/src/qisis/objs/StretchTool/StretchTool.cpp index 6b0472665f..15122389ee 100644 --- a/isis/src/qisis/objs/StretchTool/StretchTool.cpp +++ b/isis/src/qisis/objs/StretchTool/StretchTool.cpp @@ -1253,7 +1253,7 @@ namespace Isis { stretchRect(cvp, rect); } catch (IException &e) { - QString message = "Cannot stretch while the cube is still loading"; + std::string message = "Cannot stretch while the cube is still loading"; QMessageBox::warning((QWidget *)parent(), "Warning", message); return; } diff --git a/isis/src/qisis/objs/Tab/Tab.cpp b/isis/src/qisis/objs/Tab/Tab.cpp index 6c0b32e572..d5fa7dc224 100644 --- a/isis/src/qisis/objs/Tab/Tab.cpp +++ b/isis/src/qisis/objs/Tab/Tab.cpp @@ -83,7 +83,7 @@ namespace Isis { if (associatedWidget == NULL) { - QString msg = "Tab::setSelected called but can't show or hide the " + std::string msg = "Tab::setSelected called but can't show or hide the " "associatedWidget because it is NULL!"; throw IException(IException::Programmer, msg, _FILEINFO_); diff --git a/isis/src/qisis/objs/TableMainWindow/TableMainWindow.cpp b/isis/src/qisis/objs/TableMainWindow/TableMainWindow.cpp index 111e71dbb1..811d9b74c2 100644 --- a/isis/src/qisis/objs/TableMainWindow/TableMainWindow.cpp +++ b/isis/src/qisis/objs/TableMainWindow/TableMainWindow.cpp @@ -188,7 +188,7 @@ namespace Isis { * * @param message */ - void TableMainWindow::setStatusMessage(QString message) { + void TableMainWindow::setStatusMessage(std::string message) { this->statusBar()->showMessage(message); } diff --git a/isis/src/qisis/objs/TableMainWindow/TableMainWindow.h b/isis/src/qisis/objs/TableMainWindow/TableMainWindow.h index 815af0f841..c40c50148b 100644 --- a/isis/src/qisis/objs/TableMainWindow/TableMainWindow.h +++ b/isis/src/qisis/objs/TableMainWindow/TableMainWindow.h @@ -119,7 +119,7 @@ namespace Isis { const QString &menuText = "", int insertAt = -1, Qt::Orientation o = Qt::Horizontal, QString toolTip = ""); void deleteColumn(int item); - void setStatusMessage(QString message); + void setStatusMessage(std::string message); void closeEvent(QCloseEvent *event); void hideEvent(QHideEvent *event); diff --git a/isis/src/qisis/objs/TargetInfoWidget/TargetInfoWidget.cpp b/isis/src/qisis/objs/TargetInfoWidget/TargetInfoWidget.cpp index 9b30625b4e..03c5023572 100644 --- a/isis/src/qisis/objs/TargetInfoWidget/TargetInfoWidget.cpp +++ b/isis/src/qisis/objs/TargetInfoWidget/TargetInfoWidget.cpp @@ -273,8 +273,8 @@ namespace Isis { m_ui->label->setFont(font); m_ui->label_6->setFont(font); - QString msg1=""; - QString msg2=""; + std::string msg1=""; + std::string msg2=""; m_ui->label->setFont(font); m_ui->label_6->setFont(font); diff --git a/isis/src/qisis/objs/Workspace/Workspace.cpp b/isis/src/qisis/objs/Workspace/Workspace.cpp index 9ecb205ffc..fdda6d645a 100644 --- a/isis/src/qisis/objs/Workspace/Workspace.cpp +++ b/isis/src/qisis/objs/Workspace/Workspace.cpp @@ -369,7 +369,7 @@ namespace Isis { catch (IException &e) { - QString message("Error opening cube [" + cubename + "]...\n"); + std::string message("Error opening cube [" + cubename + "]...\n"); message += "Attempting to open [" + cubename + "] as a cube list...\n"; try { @@ -436,7 +436,7 @@ namespace Isis { } } catch (IException &e) { - QString message("Error attempting to open [" + cubename + "] from list [" + cubelist + "]...\n"); + std::string message("Error attempting to open [" + cubename + "] from list [" + cubelist + "]...\n"); throw IException(e, IException::User, message, _FILEINFO_); } diff --git a/isis/src/qisis/objs/ZoomTool/ZoomTool.cpp b/isis/src/qisis/objs/ZoomTool/ZoomTool.cpp index 70aac273b3..ffbf2388af 100644 --- a/isis/src/qisis/objs/ZoomTool/ZoomTool.cpp +++ b/isis/src/qisis/objs/ZoomTool/ZoomTool.cpp @@ -628,7 +628,7 @@ namespace Isis { "Unable to rescale image to [" + IString(newScale*100) + "]", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::warning((QWidget *)parent(), "Warning", message); newScale = oldScale; d->setScale(newScale); @@ -671,7 +671,7 @@ namespace Isis { "Unable to rescale image to [" + IString(newScale * 100) + "]", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::warning((QWidget *)parent(), "Warning", message); newScale = oldScale; d->setScale(newScale, x, y); @@ -714,7 +714,7 @@ namespace Isis { "Unable to rescale image to [" + IString(newScale*100) + "]", _FILEINFO_); - QString message = fullError.toString(); + std::string message = fullError.toString(); QMessageBox::warning((QWidget *)parent(), "Warning", message); newScale = oldScale; d->setScale(newScale, samp, line); diff --git a/isis/src/rosetta/apps/rososiris2isis/main.cpp b/isis/src/rosetta/apps/rososiris2isis/main.cpp index 66dcfb696f..0ef845f833 100644 --- a/isis/src/rosetta/apps/rososiris2isis/main.cpp +++ b/isis/src/rosetta/apps/rososiris2isis/main.cpp @@ -37,12 +37,12 @@ void IsisMain() { QString missionId; try { - Pvl lab(inFile.expanded().toStdString()); + Pvl lab(inFile.expanded()); instId = QString::fromStdString(lab.findKeyword("INSTRUMENT_ID")); missionId = QString::fromStdString(lab.findKeyword("MISSION_ID")); } catch (IException &e) { - QString msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + + std::string msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + inFile.expanded() + "]"; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -52,7 +52,7 @@ void IsisMain() { if (missionId.compare("ROSETTA", Qt::CaseInsensitive) != 0 && instId.compare("OSINAC", Qt::CaseInsensitive) != 0 && instId.compare("OSIWAC", Qt::CaseInsensitive) != 0) { - QString msg = "Input file [" + inFile.expanded() + "] does not appear to be " + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be " + "a Rosetta OSIRIS Wide Angle Camera (WAC) or Narrow Angle Camera (NAC) file."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -65,7 +65,7 @@ void IsisMain() { p.SetOutputCube(tmpFile.expanded(), outatt); p.SaveFileHeader(); - Pvl labelPvl(inFile.expanded().toStdString()); + Pvl labelPvl(inFile.expanded()); p.StartProcess(); p.EndProcess(); @@ -127,7 +127,7 @@ void IsisMain() { filterNames[i])); } catch (IException &e) { - QString msg = "Input file [" + inFile.expanded() + std::string msg = "Input file [" + inFile.expanded() + "] appears invalid. " + "FilterName [" + filterNames[i] @@ -155,7 +155,7 @@ void IsisMain() { kerns += PvlKeyword("NaifFrameCode", std::to_string(-226112)); //should I add [-filtno] directly after the number? That's what Dawn did } else { - QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + + std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + "InstrumentId."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp index f56829796b..706bf5d1c9 100644 --- a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp +++ b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp @@ -49,7 +49,7 @@ void IsisMain () Pvl pdsLabel; try { - pdsLabel.read(inFile.expanded().toStdString()); + pdsLabel.read(inFile.expanded()); } catch (IException &e) { // Try to fix the PVL before reading it in @@ -61,7 +61,7 @@ void IsisMain () pvlStream >> pdsLabel; } catch(IException &e) { - QString msg = "Input file [" + inFile.expanded() + + std::string msg = "Input file [" + inFile.expanded() + "] is not a valid PVL file."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -94,7 +94,7 @@ void IsisMain () channelid = QString::fromStdString(pdsLabel.findKeyword("ROSETTA:CHANNEL_ID")); } catch (IException &e) { - QString msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + + std::string msg = "Unable to read [INSTRUMENT_ID] or [MISSION_ID] from input file [" + inFile.expanded() + "]"; throw IException(e, IException::Io,msg, _FILEINFO_); } @@ -104,7 +104,7 @@ void IsisMain () channelid = channelid.simplified().trimmed(); if (missid != "ROSETTA" && instid != "VIRTIS") { - QString msg = "Input file [" + inFile.expanded() + "] does not appear to be a " + + std::string msg = "Input file [" + inFile.expanded() + "] does not appear to be a " + "DAWN Visual and InfraRed Mapping Spectrometer (VIR) EDR or RDR file."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -136,7 +136,7 @@ void IsisMain () QFile hkFile(hkTranslationFile.toString()); if(!hkFile.open(QIODevice::ReadOnly)) { - QString msg = "Unable to open Virtis Housekeeping information file [" + + std::string msg = "Unable to open Virtis Housekeeping information file [" + hkFile.fileName() + "]"; throw IException(IException::Io,msg, _FILEINFO_); } @@ -460,7 +460,7 @@ void IsisMain () kerns += PvlKeyword("NaifFrameCode", std::to_string(-226220)); } else { - QString msg = "Input file [" + inFile.expanded() + "] has an invalid " + + std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + "InstrumentId."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp index 784e195988..61605b16f6 100644 --- a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp +++ b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp @@ -57,7 +57,7 @@ namespace Isis { QString instrumentId = QString::fromStdString(inst["InstrumentId"]); if ( "virtis" != instrumentId.toLower()) { - QString mess = "This data is apparently not from the VIRTIS instrument but " + std::string mess = "This data is apparently not from the VIRTIS instrument but " + instrumentId; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/socet/apps/socetframesettings/main.cpp b/isis/src/socet/apps/socetframesettings/main.cpp index 6e4454fb87..f77305e2da 100644 --- a/isis/src/socet/apps/socetframesettings/main.cpp +++ b/isis/src/socet/apps/socetframesettings/main.cpp @@ -60,7 +60,7 @@ void IsisMain() { cube.open(from); if (cube.isProjected()) { - QString msg = QString("You can only create a SOCET Set Framing Camera or FrameOffAxis settings " + std::string msg = QString("You can only create a SOCET Set Framing Camera or FrameOffAxis settings " "file for level 1 images. The input image [%1] is a map projected, level " "2, cube.").arg(from); throw IException(IException::User, msg, _FILEINFO_); @@ -76,7 +76,7 @@ void IsisMain() { PvlGroup test = cube.label()->findGroup("Kernels", Pvl::Traverse); QString instrumentPointing = QString::fromStdString(test["InstrumentPointing"]); if (instrumentPointing != "Table") { - QString msg = QString("Input image [%1] does not contain needed SPICE blobs. Please run " + std::string msg = QString("Input image [%1] does not contain needed SPICE blobs. Please run " "spiceinit on the image with attach=yes.").arg(from); throw IException(IException::User, msg, _FILEINFO_); } @@ -202,7 +202,7 @@ void IsisMain() { socetCamFile += "OCAMS_PolyCam.cam"; } else { - QString msg = QString("The ISIS to SOCET Set translation of input image " + std::string msg = QString("The ISIS to SOCET Set translation of input image " "[%1] is currently not supported for OSIRIS-REX " "instrument [%2].").arg(from).arg(instrumentId); throw IException(IException::User, msg, _FILEINFO_); @@ -210,7 +210,7 @@ void IsisMain() { } // Throw exception for unsupported camera else { - QString msg = QString("The ISIS to SOCET Set translation of input image [%1] is currently " + std::string msg = QString("The ISIS to SOCET Set translation of input image [%1] is currently " "not supported for instrument [%2].").arg(from).arg(instrumentId); throw IException(IException::User, msg, _FILEINFO_); } @@ -225,7 +225,7 @@ void IsisMain() { // summation = (int) detectorMap->SampleScaleFactor(); // } // catch (IException &e) { - // QString msg = "Error reading SpatialSumming from Instrument label"; + // std::string msg = "Error reading SpatialSumming from Instrument label"; // throw IException(IException::User, msg, _FILEINFO_); // } // } @@ -235,7 +235,7 @@ void IsisMain() { summation = (int) detectorMap->SampleScaleFactor(); } catch (IException &e) { - QString msg = "Error reading Summing from Instrument label"; + std::string msg = "Error reading Summing from Instrument label"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -245,7 +245,7 @@ void IsisMain() { summation = (int) detectorMap->SampleScaleFactor(); } catch (IException &e) { - QString msg = "Error reading Summing from Instrument label"; + std::string msg = "Error reading Summing from Instrument label"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -282,7 +282,7 @@ void IsisMain() { toStrm.open (to.toLatin1().data(), ios::trunc); if (toStrm.bad()) { - QString msg = "Unable to open output settings file"; + std::string msg = "Unable to open output settings file"; throw IException(IException::User, msg, _FILEINFO_); } @@ -871,7 +871,7 @@ void getCamPosOPK(Spice &spice, QString spacecraftName, SpiceDouble et, Camera * // Confirm that matrix is now a rotation matrix else { - QString msg = QString("The ISIS to SOCET Set translation of input image is currently " + std::string msg = QString("The ISIS to SOCET Set translation of input image is currently " "not supported for instrument [%1].").arg(spacecraftName); throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp index 2ca9ce5508..630ef9808e 100644 --- a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp +++ b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp @@ -75,7 +75,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { PvlGroup test = input->label()->findGroup("Kernels", Pvl::Traverse); QString InstrumentPointing = QString::fromStdString(test["InstrumentPointing"]); if (InstrumentPointing != "Table") { - QString msg = "Input image does not contain needed SPICE blobs...run spiceinit with attach=yes."; + std::string msg = "Input image does not contain needed SPICE blobs...run spiceinit with attach=yes."; throw IException(IException::User, msg, _FILEINFO_); } @@ -83,7 +83,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { ofstream toStrm; toStrm.open(to.toLatin1().data(), ios::trunc); if (toStrm.bad()) { - QString msg = "Unable to open output TO file"; + std::string msg = "Unable to open output TO file"; throw IException(IException::User, msg, _FILEINFO_); } @@ -109,7 +109,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // else if (strcmp(filter.toLatin1().data(), "RED") == 0) // isMocWARed = true; // else if (strcmp(filter.toLatin1().data(), "BLUE") == 0) { -// QString msg = "MOC WA Blue filter images not supported for Socet Set mapping"; +// std::string msg = "MOC WA Blue filter images not supported for Socet Set mapping"; // throw IException(IException::User, msg, _FILEINFO_); // } // } @@ -122,7 +122,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { isHiRise = true; } else { - QString msg = "Unsupported instrument: " + origInstrumentId; + std::string msg = "Unsupported instrument: " + origInstrumentId; throw IException(IException::User, msg, _FILEINFO_); } } @@ -142,7 +142,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { isHRSC = true; } else { - QString msg = "Unsupported instrument: " + instrumentId; + std::string msg = "Unsupported instrument: " + instrumentId; throw IException(IException::User, msg, _FILEINFO_); } @@ -700,7 +700,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { cam->radii(targetRadii); } catch (IException &e) { - QString msg = "Failed to get target body radii from cube."; + std::string msg = "Failed to get target body radii from cube."; throw IException(e, IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/system/apps/blobdump/main.cpp b/isis/src/system/apps/blobdump/main.cpp index b8e27c2ebb..0afe9d2232 100644 --- a/isis/src/system/apps/blobdump/main.cpp +++ b/isis/src/system/apps/blobdump/main.cpp @@ -49,7 +49,7 @@ void helperButtonGetBlobList() { UserInterface &ui = Application::GetUserInterface(); QString currentFile = ui.GetCubeName("FROM"); - const Pvl label(FileName(currentFile).expanded().toStdString()); + const Pvl label(FileName(currentFile).expanded()); // Check to see if the "FILE" parameter has changed since last press if(currentFile != previousFile) { diff --git a/isis/src/system/apps/csspckgen/main.cpp b/isis/src/system/apps/csspckgen/main.cpp index 9f8ddf26cb..4f7e0799c0 100644 --- a/isis/src/system/apps/csspckgen/main.cpp +++ b/isis/src/system/apps/csspckgen/main.cpp @@ -31,7 +31,7 @@ void IsisMain() { } // Read PCK DB file into a PVL and search the PVL for the main object - Pvl db(inputName.expanded().toStdString()); + Pvl db(inputName.expanded()); PvlObject &main = db.findObject("TargetAttitudeShape"); // Add a timestamp for when this file was created @@ -106,5 +106,5 @@ void IsisMain() { // Write the updated PVL as the new PCK DB file Pvl latestDb; latestDb.addObject(latestMain); - latestDb.write(outputName.expanded().toStdString()); + latestDb.write(outputName.expanded()); } diff --git a/isis/src/system/apps/dempack/main.cpp b/isis/src/system/apps/dempack/main.cpp index 2aa4f5eb87..0ac72766d3 100644 --- a/isis/src/system/apps/dempack/main.cpp +++ b/isis/src/system/apps/dempack/main.cpp @@ -42,7 +42,7 @@ void IsisMain() { dbFileName = FileName(demFile).highestVersion(); } - Pvl dems(dbFileName.expanded().toStdString()); + Pvl dems(dbFileName.expanded()); PvlObject &demObject = dems.findObject("Dem"); QMap< QString, QList > demMap; diff --git a/isis/src/system/apps/isisdataeval/IsisDataModel.cpp b/isis/src/system/apps/isisdataeval/IsisDataModel.cpp index 18945dae14..92ddac5af6 100644 --- a/isis/src/system/apps/isisdataeval/IsisDataModel.cpp +++ b/isis/src/system/apps/isisdataeval/IsisDataModel.cpp @@ -211,7 +211,7 @@ namespace Isis { if ( !dbfilestatus.file().toString().isEmpty() ) { js_dbfile["filespec"] = dbfilestatus.name().toStdString(); - js_dbfile["filepath"] = dbfilestatus.expanded().toStdString(); + js_dbfile["filepath"] = dbfilestatus.expanded(); js_dbfile["exists"] = json_bool( dbfilestatus.exists() ).toStdString(); } else { @@ -273,14 +273,14 @@ namespace Isis { // File exists, lets open it and compute the hash QFile v_file( expanded() ); if ( !v_file.open( QIODevice::ReadOnly ) ) { - QString mess = "Could not open file " + expanded() + " to compute hash"; + std::string mess = "Could not open file " + expanded() + " to compute hash"; throw IException( IException::User, mess, _FILEINFO_ ); } // Compute the hash! QCryptographicHash q_hash( hashAlgorithm ); if ( !q_hash.addData( &v_file ) ) { - QString mess = "Could not compute hash for " + expanded(); + std::string mess = "Could not compute hash for " + expanded(); throw IException( IException::User, mess, _FILEINFO_ ); } @@ -468,7 +468,7 @@ namespace Isis { isisdata_json js_dbselection; if ( addSource ) { - js_dbselection["source"] = dbselection.source().expanded().toStdString(); + js_dbselection["source"] = dbselection.source().expanded(); } js_dbselection["time"] = dbselection.time().to_json(); @@ -515,7 +515,7 @@ namespace Isis { } // Got a kerneldb file - Pvl db( dbfile.expanded().toStdString() ); + Pvl db( dbfile.expanded() ); // Check if there are any specs in the file if ( db.objects() < 1 ) { @@ -728,19 +728,19 @@ namespace Isis { // Check for validity of datadir and isisdata if ( !hasIsisData() ) { - QString mess = "ISISDATA (" + isisdata().original() + ") does not not exist/invalid!"; + std::string mess = "ISISDATA (" + isisdata().original() + ") does not not exist/invalid!"; throw IException( IException::User, mess, _FILEINFO_ ); } // Check for validity of datadir and isisdata if ( !hasDataRoot() ) { - QString mess = "DATAROOT (" + dataroot().original() + ") does not not exist/invalid!"; + std::string mess = "DATAROOT (" + dataroot().original() + ") does not not exist/invalid!"; throw IException( IException::User, mess, _FILEINFO_ ); } // Check for validity of datadir and isisdata if ( !dataroot().isDirectory() ) { - QString mess = "DATAROOT (" + dataroot().original() + ") is not a directory!"; + std::string mess = "DATAROOT (" + dataroot().original() + ") is not a directory!"; throw IException( IException::User, mess, _FILEINFO_ ); } diff --git a/isis/src/system/apps/isisdataeval/isisdataeval.cpp b/isis/src/system/apps/isisdataeval/isisdataeval.cpp index 44175c5901..91a0a3e531 100644 --- a/isis/src/system/apps/isisdataeval/isisdataeval.cpp +++ b/isis/src/system/apps/isisdataeval/isisdataeval.cpp @@ -137,7 +137,7 @@ namespace Isis { // Now reset ISISDATA if requested by user if ( ui.WasEntered( "ISISDATA" ) ) { isisdata = ui.GetAsString("ISISDATA"); - PvlKeyword iroot( "ISISDATA", isisdata.expanded().toStdString() ); + PvlKeyword iroot( "ISISDATA", isisdata.expanded() ); prefdir.addKeyword( iroot, PvlContainer::Replace ); std::cout << "ISISDATA = " << isisdata.expanded() << std::endl; std::cout << "ISISDATA reset by user!" << std::endl; @@ -180,7 +180,7 @@ namespace Isis { // Generate the result log std::cout << std::endl; PvlGroup results("Results"); - results.addKeyword( PvlKeyword( "ISISDATA", isisdata.expanded().toStdString() ) ); + results.addKeyword( PvlKeyword( "ISISDATA", isisdata.expanded() ) ); results.addKeyword( PvlKeyword( "DATADIR", datadir.toStdString() ) ); results.addKeyword( PvlKeyword( "EmptyKernelDBs", std::to_string( inventory_counts.m_empty ) ) ); results.addKeyword( PvlKeyword( "MissingKernelDBs", std::to_string( inventory_counts.m_missing ) ) ); @@ -203,7 +203,7 @@ namespace Isis { std::ofstream os; os.open( toissues.expanded().toLatin1().data(), std::ios::out ); if (!os ) { - QString mess = "Unable to open/create " + toissues.expanded(); + std::string mess = "Unable to open/create " + toissues.expanded(); throw IException( IException::User, mess, _FILEINFO_ ); } @@ -253,7 +253,7 @@ namespace Isis { std::ofstream os; os.open( inventory_file.toLatin1().data(), std::ios::out ); if (!os ) { - QString mess = "Unable to open/create " + inventory_file; + std::string mess = "Unable to open/create " + inventory_file; throw IException( IException::User, mess, _FILEINFO_ ); } @@ -375,7 +375,7 @@ namespace Isis { std::ofstream error_os; error_os.open( toerrors.expanded().toLatin1().data(), std::ios::out ); if (!error_os ) { - QString mess = "Unable to open/create " + toerrors.expanded(); + std::string mess = "Unable to open/create " + toerrors.expanded(); throw IException( IException::User, mess, _FILEINFO_ ); } diff --git a/isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp b/isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp index ea754c0499..aee574b1ce 100644 --- a/isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp +++ b/isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp @@ -69,7 +69,7 @@ PvlObject SpiceDbGen::Direct(QString quality, QString location, // Throw an error if no files are being added to this database for // this filter/regex if (files.size() == 0) { - QString message = "Your filter [" + location + "/" + filter[i] + "]" + std::string message = "Your filter [" + location + "/" + filter[i] + "]" + "has not detected any " + quality + " kernels"; throw IException(IException::User, message, _FILEINFO_); } @@ -137,7 +137,7 @@ PvlObject SpiceDbGen::Direct(QString quality, FileList fileList, // Throw an error if no files are being added to this database for // this filter/regex if (fileList.empty()) { - QString message = "Input filelist is empty!"; + std::string message = "Input filelist is empty!"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp index 2251a1b72c..09138ac57e 100644 --- a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp +++ b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp @@ -150,7 +150,7 @@ namespace Isis { if (!(ui.WasEntered("PREDICTFILTER") || ui.WasEntered("PREDICTLIST")) && !(ui.WasEntered("RECONFILTER") || ui.WasEntered("RECONLIST")) && !(ui.WasEntered("SMITHEDFILTER") || ui.WasEntered("SMITHEDLIST"))) { - QString message = + std::string message = "No kernel selection arguments were entered. A directory and filter or a " "list must be entered for at least one quality of kernel."; throw IException(IException::User, message, _FILEINFO_); @@ -168,7 +168,7 @@ namespace Isis { Pvl writer; writer.addObject(selections); - writer.write(to.expanded().toStdString()); + writer.write(to.expanded()); } @@ -213,7 +213,7 @@ namespace Isis { // Try to get kernel file names out of db, if a db was specified instead of an actual kernel if (kernelFileName.extension() == "db") { - Pvl kernelDbPvl(kernelFileName.expanded().toStdString()); + Pvl kernelDbPvl(kernelFileName.expanded()); if (kernelDbPvl.objects() == 1) { PvlObject &primaryObject = kernelDbPvl.object(0); diff --git a/isis/src/system/apps/messckgen/main.cpp b/isis/src/system/apps/messckgen/main.cpp index 175c7db821..cc9e59d647 100644 --- a/isis/src/system/apps/messckgen/main.cpp +++ b/isis/src/system/apps/messckgen/main.cpp @@ -62,7 +62,7 @@ void IsisMain() { QString pivotString("$messenger/kernels/ck/pivot_kernels.????.db"); pivotFileName = FileName(pivotString).highestVersion(); } - Pvl pivot(pivotFileName.expanded().toStdString()); + Pvl pivot(pivotFileName.expanded()); // Fetch the atthist file FileName atthistFileName; @@ -74,7 +74,7 @@ void IsisMain() { QString atthistString("$messenger/kernels/ck/atthist_kernels.????.db"); atthistFileName = FileName(atthistString).highestVersion(); } - Pvl atthist(atthistFileName.expanded().toStdString()); + Pvl atthist(atthistFileName.expanded()); // Open the input file from the GUI or find the latest version of the DB file FileName dbFileName; @@ -85,7 +85,7 @@ void IsisMain() { QString dbString("$messenger/kernels/ck/kernels.????.db"); dbFileName = FileName(dbString).highestVersion(); } - Pvl kernelDb(dbFileName.expanded().toStdString()); + Pvl kernelDb(dbFileName.expanded()); PvlObject &pointing = kernelDb.findObject("SpacecraftPointing"); PvlObject &pivotPointing = pivot.findObject("SpacecraftPointing"); @@ -183,7 +183,7 @@ void IsisMain() { // Check that the current day's BC file exists QString bcExpanded = FileName(bcFileName).expanded(); if (!QFile(bcExpanded).exists()) { - QString msg = "The BC file [" + bcExpanded + "] does not exist"; + std::string msg = "The BC file [" + bcExpanded + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } @@ -252,7 +252,7 @@ void IsisMain() { } // Write the updated PVL as the new CK DB file - kernelDb.write(outDBfile.expanded().toStdString()); + kernelDb.write(outDBfile.expanded()); } diff --git a/isis/src/system/apps/messspkgen/main.cpp b/isis/src/system/apps/messspkgen/main.cpp index 7ec1cf5f51..ebdf173090 100644 --- a/isis/src/system/apps/messspkgen/main.cpp +++ b/isis/src/system/apps/messspkgen/main.cpp @@ -39,7 +39,7 @@ void IsisMain() { QString dbString("$messenger/kernels/spk/kernels.????.db"); dbFileName = FileName(dbString).highestVersion(); } - Pvl kernelDb(dbFileName.expanded().toStdString()); + Pvl kernelDb(dbFileName.expanded()); // Get our main objects PvlObject &position = kernelDb.findObject("SpacecraftPosition"); @@ -80,7 +80,7 @@ void IsisMain() { } // Write the updated PVL as the new SPK DB file - kernelDb.write(outDBfile.expanded().toStdString()); + kernelDb.write(outDBfile.expanded()); } diff --git a/isis/src/system/apps/prtloganalyzer/main.cpp b/isis/src/system/apps/prtloganalyzer/main.cpp index 0528f4e574..8f9598ee95 100644 --- a/isis/src/system/apps/prtloganalyzer/main.cpp +++ b/isis/src/system/apps/prtloganalyzer/main.cpp @@ -78,7 +78,7 @@ void IsisMain() { // Open the file ostm.open(file.toLatin1().data(), std::ios::out); if(!ostm) { - QString message = "Cannot open/create output file " + file; + std::string message = "Cannot open/create output file " + file; throw IException(IException::Io, message, _FILEINFO_); } diff --git a/isis/src/system/objs/KernelDb/KernelDb.cpp b/isis/src/system/objs/KernelDb/KernelDb.cpp index 6c1065c7b9..5fdb9cc417 100644 --- a/isis/src/system/objs/KernelDb/KernelDb.cpp +++ b/isis/src/system/objs/KernelDb/KernelDb.cpp @@ -818,7 +818,7 @@ namespace Isis { m_kernelDbFiles.append(kernelDb.highestVersion()); } else { // else, read in the appropriate database files from the config file - PvlObject inst = Pvl(configFile.expanded().toStdString()).findObject("Instrument"); + PvlObject inst = Pvl(configFile.expanded()).findObject("Instrument"); bool foundMatch = false; // loop through each group until we find a match for (int groupIndex = 0; groupIndex < inst.groups(); groupIndex++) { @@ -866,10 +866,10 @@ namespace Isis { // read each of the database files appended to the list into m_kernelData foreach (FileName kernelDbFile, m_kernelDbFiles) { try { - m_kernelData.read(kernelDbFile.expanded().toStdString()); + m_kernelData.read(kernelDbFile.expanded()); } catch (IException &e) { - QString msg = "Unable to read kernel database file [" + std::string msg = "Unable to read kernel database file [" + kernelDbFile.expanded() + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp index ac1c5a0a83..d8d282ad84 100644 --- a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp +++ b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp @@ -38,12 +38,12 @@ namespace Isis { FileName xmlFileName = ui.GetFileName("FROM"); if (!xmlFileName.removeExtension().addExtension("dat").fileExists() && !xmlFileName.removeExtension().addExtension("img").fileExists()) { - QString msg = "Cannot find image file for [" + xmlFileName.name() + "]. Confirm that the " + std::string msg = "Cannot find image file for [" + xmlFileName.name() + "]. Confirm that the " ".dat or .img file for this XML exists and is located in the same directory."; throw IException(IException::User, msg, _FILEINFO_); } if(xmlFileName.name().contains("cas_raw_sc")){ - QString msg = "tgocassis2isis is unable to process cas_raw_sc data. Please use cas_cal_sc data instead."; + std::string msg = "tgocassis2isis is unable to process cas_raw_sc data. Please use cas_cal_sc data instead."; throw IException(IException::User, msg, _FILEINFO_); } @@ -58,7 +58,7 @@ namespace Isis { importer.SetInputFile(xmlFileName.removeExtension().addExtension("img").expanded()); } else { - QString msg = "Cannot find image file for [" + xmlFileName.name() + "]. Confirm that the " + std::string msg = "Cannot find image file for [" + xmlFileName.name() + "]. Confirm that the " ".dat or .img file for this XML exists and is located in the same directory."; throw IException(IException::User, msg, _FILEINFO_); } @@ -125,7 +125,7 @@ namespace Isis { } catch (IException &e) { - QString msg = "Given file [" + xmlFileName.expanded() + "] does not appear to be a valid TGO CaSSIS label."; + std::string msg = "Given file [" + xmlFileName.expanded() + "] does not appear to be a valid TGO CaSSIS label."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -254,7 +254,7 @@ namespace Isis { QFile xmlFile(xmlFileName.expanded()); if ( !xmlFile.open(QIODevice::ReadOnly) ) { - QString msg = "Could not open label file [" + xmlFileName.expanded() + + std::string msg = "Could not open label file [" + xmlFileName.expanded() + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -263,7 +263,7 @@ namespace Isis { int errline, errcol; if ( !xmlDoc.setContent(&xmlFile, false, &errmsg, &errline, &errcol) ) { xmlFile.close(); - QString msg = "XML read/parse error in file [" + xmlFileName.expanded() + std::string msg = "XML read/parse error in file [" + xmlFileName.expanded() + "] at line [" + toString(errline) + "], column [" + toString(errcol) + "], message: " + errmsg; throw IException(IException::Unknown, msg, _FILEINFO_); @@ -459,7 +459,7 @@ namespace Isis { spacecraftCode = -143424; } else { - QString msg = "Unrecognized filter name [" + std::string msg = "Unrecognized filter name [" + filter + "]."; throw IException(IException::User, msg, _FILEINFO_); @@ -469,7 +469,7 @@ namespace Isis { bandBin.addKeyword(PvlKeyword("NaifIkCode", std::to_string(spacecraftCode))); } else { - QString msg = "Unrecognized Spacecraft name [" + std::string msg = "Unrecognized Spacecraft name [" + spcName + "] and instrument ID [" + instId diff --git a/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp b/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp index c391447519..04712670e8 100644 --- a/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp +++ b/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp @@ -39,7 +39,7 @@ namespace Isis { vector cubeList; try { if (fromList.size() < 1) { - QString msg = "the list file [" + ui.GetFileName("FROMLIST") + + std::string msg = "the list file [" + ui.GetFileName("FROMLIST") + "does not contain any data"; throw IException(IException::User, msg, _FILEINFO_); } @@ -164,7 +164,7 @@ namespace Isis { } } if (runXY) { - QString msg = "Camera did not intersect images to gather stats"; + std::string msg = "Camera did not intersect images to gather stats"; throw IException(IException::User, msg, _FILEINFO_); } @@ -272,7 +272,7 @@ namespace Isis { cubeList[i]->close(); delete cubeList[i]; } - QString msg = "The mosaic [" + ui.GetCubeName("TO") + "] was NOT created"; + std::string msg = "The mosaic [" + ui.GetCubeName("TO") + "] was NOT created"; throw IException(IException::User, msg, _FILEINFO_); } } // end of isis main @@ -290,7 +290,7 @@ namespace Isis { QString compareObsId = QString::fromStdString(compareArchive["ObservationId"]); if (matchObsId != compareObsId) { - QString msg = "Images not from the same observation"; + std::string msg = "Images not from the same observation"; throw IException(IException::User, msg, _FILEINFO_); } @@ -301,7 +301,7 @@ namespace Isis { QString compareFilter = QString::fromStdString(compareBandBin["FilterName"]); if (matchFilter != compareFilter) { - QString msg = "Images not the same filter"; + std::string msg = "Images not the same filter"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp b/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp index f8058438f7..ecb98a3ca9 100644 --- a/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp +++ b/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp @@ -32,7 +32,7 @@ namespace Isis { // Check if input file is indeed, a cube if (FileName(ui.GetCubeName("FROM")).expanded().right(3) != "cub") { - QString msg = "Input file [" + ui.GetCubeName("FROM") + + std::string msg = "Input file [" + ui.GetCubeName("FROM") + "] does not appear to be a cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -68,7 +68,7 @@ namespace Isis { // Check if the cube is able to be translated into a CaSSIS xml file // This could very well be unnecessary if (!targetGroup.findKeyword("InstrumentId").isEquivalent("CaSSIS")) { - QString msg = "Input file [" + ui.GetCubeName("FROM") + + std::string msg = "Input file [" + ui.GetCubeName("FROM") + "] does not appear to be a CaSSIS RDR product. The image" + "instrument is not the CaSSIS instrument"; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp index 1b62067411..b5f62e940c 100644 --- a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp +++ b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp @@ -98,7 +98,7 @@ namespace Isis { stitchProgress.CheckStatus(); } catch (IException &e) { - QString msg = "Failed stitch frame for observation [" + std::string msg = "Failed stitch frame for observation [" + frameKey + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -204,7 +204,7 @@ namespace Isis { // Eventually summing can be handled, but right now we don't know enough, so error PvlGroup frameletInst = frameletCube->group("Instrument"); if ((int)frameletInst["SummingMode"] != 0) { - QString msg = "Summing mode [" + QString::fromStdString(frameletInst["SummingMode"]) + std::string msg = "Summing mode [" + QString::fromStdString(frameletInst["SummingMode"]) + "] for framelet [" + frameletFile.expanded() + "] is not supported."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp b/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp index 04065f723c..4e0cc42127 100644 --- a/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp +++ b/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp @@ -129,7 +129,7 @@ namespace Isis { // Create and output a list of QFile allCubesListFile(outputBaseName + ".lis"); if (!allCubesListFile.open(QFile::WriteOnly | QFile::Text)) { - QString msg = "Unable to write file [" + allCubesListFile.fileName() + "]"; + std::string msg = "Unable to write file [" + allCubesListFile.fileName() + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/viking/apps/vik2isis/main.cpp b/isis/src/viking/apps/vik2isis/main.cpp index fa292aad1d..28e82740c3 100644 --- a/isis/src/viking/apps/vik2isis/main.cpp +++ b/isis/src/viking/apps/vik2isis/main.cpp @@ -39,7 +39,7 @@ void IsisMain() { // object. If this fails then the file must be compressed, so // decompress the file using vdcomp. try { - Pvl compressionTest(in.expanded().toStdString()); + Pvl compressionTest(in.expanded()); if(compressionTest.groups() == 0 && compressionTest.objects() == 0 && compressionTest.keywords() < 2) { @@ -52,7 +52,7 @@ void IsisMain() { temp.expanded() + " > /dev/null 2>&1"; int returnValue = system(command.toLatin1().data()) >> 8; if(returnValue) { - QString msg = "Error running vdcomp"; + std::string msg = "Error running vdcomp"; IException::ErrorType msgTarget = IException::Programmer; switch(returnValue) { case 1: @@ -95,7 +95,7 @@ void IsisMain() { p.SetPdsFile(in.expanded(), "", pdsLabel); } catch(IException &e) { - QString msg = "Input file [" + in.expanded() + + std::string msg = "Input file [" + in.expanded() + "] does not appear to be a Viking PDS product"; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/viking/apps/vikcal/CalParameters.cpp b/isis/src/viking/apps/vikcal/CalParameters.cpp index 87342d2bdd..900d710f1d 100644 --- a/isis/src/viking/apps/vikcal/CalParameters.cpp +++ b/isis/src/viking/apps/vikcal/CalParameters.cpp @@ -42,7 +42,7 @@ namespace Isis { QString mission = spacecraft.split("_").first(); spacecraft = spacecraft.split("_").last(); if(mission != "VIKING") { - QString msg = "Invalid Keyword [SpacecraftName]. " + spacecraft + + std::string msg = "Invalid Keyword [SpacecraftName]. " + spacecraft + "must start with 'VIKING'"; throw IException(IException::User, msg, _FILEINFO_); } @@ -50,7 +50,7 @@ namespace Isis { if((QChar)spacecraft[spacecraft.size() - 1] == '1') spn = 1; if((QChar)spacecraft[spacecraft.size() - 1] == '2') spn = 2; if(spn == 0) { - QString msg = "Invalid Keyword [SpacecraftName]. " + spacecraft + + std::string msg = "Invalid Keyword [SpacecraftName]. " + spacecraft + "must terminate with '1' or '2'"; throw IException(IException::User, msg, _FILEINFO_); } @@ -73,7 +73,7 @@ namespace Isis { else cam = 6; } else { - QString msg = "Invalid Keyword [InstrumentID]. " + instId; + std::string msg = "Invalid Keyword [InstrumentID]. " + instId; msg += "must terminate with an 'A' or 'B'"; throw IException(IException::User, msg, _FILEINFO_); } @@ -99,7 +99,7 @@ namespace Isis { vikoffSetup(mission, spn, target, cam, clock, (int)cs3); } catch(IException &e) { - QString msg = "Input file [" + fname + "] does not appear to be a viking image"; + std::string msg = "Input file [" + fname + "] does not appear to be a viking image"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/viking/apps/vikcal/main.cpp b/isis/src/viking/apps/vikcal/main.cpp index cdcd3704f3..40199026b2 100644 --- a/isis/src/viking/apps/vikcal/main.cpp +++ b/isis/src/viking/apps/vikcal/main.cpp @@ -46,7 +46,7 @@ void IsisMain() { // If the file has already been calibrated, throw an error if(icube.hasGroup("Radiometry")) { - QString msg = "The Viking image [" + icube.fileName() + "] has already " + std::string msg = "The Viking image [" + icube.fileName() + "] has already " "been radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/viking/apps/vikcal/vikcal.cpp b/isis/src/viking/apps/vikcal/vikcal.cpp index e8af1e3d1c..1305461f72 100644 --- a/isis/src/viking/apps/vikcal/vikcal.cpp +++ b/isis/src/viking/apps/vikcal/vikcal.cpp @@ -52,7 +52,7 @@ namespace Isis { // If the file has already been calibrated, throw an error if(icube->hasGroup("Radiometry")) { - QString msg = "The Viking image [" + icube->fileName() + "] has already " + std::string msg = "The Viking image [" + icube->fileName() + "] has already " "been radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/viking/apps/viknobutter/main.cpp b/isis/src/viking/apps/viknobutter/main.cpp index 02b7717afc..3f72d17db4 100644 --- a/isis/src/viking/apps/viknobutter/main.cpp +++ b/isis/src/viking/apps/viknobutter/main.cpp @@ -30,7 +30,7 @@ void IsisMain() { if(scn == "VIKING_ORBITER_1") spn = 1; else if(scn == "VIKING_ORBITER_2") spn = 2; else { - QString msg = "Invalid spacecraftname [" + scn + "]"; + std::string msg = "Invalid spacecraftname [" + scn + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } // determine if # of cols is even or odd diff --git a/isis/src/viking/objs/VikingCamera/VikingCamera.cpp b/isis/src/viking/objs/VikingCamera/VikingCamera.cpp index f80ec58ee7..a1bf6b2c53 100644 --- a/isis/src/viking/objs/VikingCamera/VikingCamera.cpp +++ b/isis/src/viking/objs/VikingCamera/VikingCamera.cpp @@ -84,7 +84,7 @@ namespace Isis { m_instrumentNameShort = "VISB"; } else { - QString msg = "File does not appear to be a Viking image. InstrumentId [" + std::string msg = "File does not appear to be a Viking image. InstrumentId [" + instId + "] is invalid Viking value."; throw IException(IException::User, msg, _FILEINFO_); } @@ -116,13 +116,13 @@ namespace Isis { m_instrumentNameShort = "VISB"; } else { - QString msg = "File does not appear to be a Viking image. InstrumentId [" + std::string msg = "File does not appear to be a Viking image. InstrumentId [" + instId + "] is invalid Viking value."; throw IException(IException::User, msg, _FILEINFO_); } } else { - QString msg = "File does not appear to be a Viking image. SpacecraftName [" + std::string msg = "File does not appear to be a Viking image. SpacecraftName [" + spacecraft + "] is invalid Viking value."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/voyager/apps/voy2isis/main.cpp b/isis/src/voyager/apps/voy2isis/main.cpp index 6f1cb98a87..549cfceeda 100644 --- a/isis/src/voyager/apps/voy2isis/main.cpp +++ b/isis/src/voyager/apps/voy2isis/main.cpp @@ -102,7 +102,7 @@ void IsisMain() { p.SetPdsFile(*pdsLabel, in.expanded()); } catch (IException &e) { - QString msg = "Unable to set PDS file. Decompressed input file [" + std::string msg = "Unable to set PDS file. Decompressed input file [" + in.name() + "] does not appear to be a PDS product"; throw IException(IException::User, msg, _FILEINFO_); } @@ -243,7 +243,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { instId = "isswa"; } else { - QString msg = "Instrument ID [" + instId + "] does not match Narrow or " + + std::string msg = "Instrument ID [" + instId + "] does not match Narrow or " + "Wide angle camera. The cube was created, but the labels were not translated. " "To create a cube with translated labels, re-run this application with " "INSTRUMENT set to NAC or WAC."; @@ -263,7 +263,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { instId = "isswa"; } else { - QString msg = "Instrument ID [" + instId + "] does not match Narrow or " + + std::string msg = "Instrument ID [" + instId + "] does not match Narrow or " + "Wide angle camera. The cube was created, but the labels were not translated. " "To create a cube with translated labels, re-run this application with " "INSTRUMENT set to NAC or WAC."; @@ -271,7 +271,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { } } else { - QString msg = "Spacecraft name [" + QString::fromStdString(inst.findKeyword("SpacecraftName")) + + std::string msg = "Spacecraft name [" + QString::fromStdString(inst.findKeyword("SpacecraftName")) + "] does not match Voyager1 or Voyager2 spacecraft"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/voyager/apps/voycal/main.cpp b/isis/src/voyager/apps/voycal/main.cpp index 4787218625..a43048c7dd 100644 --- a/isis/src/voyager/apps/voycal/main.cpp +++ b/isis/src/voyager/apps/voycal/main.cpp @@ -66,7 +66,7 @@ void IsisMain() { // Check for projection if (incube->isProjected()) { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] has a projection" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] has a projection" + " and cannot be radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } @@ -79,7 +79,7 @@ void IsisMain() { // Verify not radiometrically corrected if (isiscube.hasGroup("Radiometry")) { - QString msg = "Cube [" + ui.GetCubeName("FROM") + "] has already been" + + std::string msg = "Cube [" + ui.GetCubeName("FROM") + "] has already been" + " radiometrically corrected"; throw IException(IException::User,msg,_FILEINFO_); } @@ -87,7 +87,7 @@ void IsisMain() { // Verify Voyager spacecraft and get number, 1 or 2 QString scNumber = QString::fromStdString(instrument["SpacecraftName"][0]); if (scNumber != "VOYAGER_1" && scNumber != "VOYAGER_2") { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Voyager image"; throw IException(IException::User, msg, _FILEINFO_); } @@ -95,7 +95,7 @@ void IsisMain() { // Open calibration file to find constants and files Pvl calibra(FileName("$voyager" + scNumber + - "/calibration/voycal.pvl").expanded().toStdString()); + "/calibration/voycal.pvl").expanded()); PvlObject calib; QList hierarchy; try { @@ -141,7 +141,7 @@ void IsisMain() { linear = ui.GetBoolean("LINEAR"); if (linear) { Pvl linearity(FileName("$voyager" + scNumber + - "/calibration/voylin.pvl").expanded().toStdString()); + "/calibration/voylin.pvl").expanded()); PvlObject lin; try { diff --git a/isis/src/voyager/apps/voyramp/main.cpp b/isis/src/voyager/apps/voyramp/main.cpp index 83c1efbf79..5c8b6970a5 100644 --- a/isis/src/voyager/apps/voyramp/main.cpp +++ b/isis/src/voyager/apps/voyramp/main.cpp @@ -72,14 +72,14 @@ void IsisMain() { // Verify Voyager1 spacecraft if (inst["SpacecraftName"][0] != "VOYAGER_1") { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + " to be a Voyager1 image"; throw IException(IException::User, msg, _FILEINFO_); } // Verify has been radiometrically calibrated if (!isiscube.hasGroup("Radiometry")) { - QString msg = "The cube [" + ui.GetCubeName("FROM") + "] has not been" + + std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] has not been" + "radiometrically corrected, run voycal first"; } @@ -92,7 +92,7 @@ void IsisMain() { // From Isis2, the time range is day 64, hours 1-16, inclusive. if (time < min || time >= max) { - QString message = "The cube [" + ui.GetCubeName("FROM") + "] has image" + + std::string message = "The cube [" + ui.GetCubeName("FROM") + "] has image" + " time [" + time.UTC() + "] outside of allowable" + "range [" + min.UTC() + "] to [" + max.UTC() + "]"; throw IException(IException::User, message, _FILEINFO_); diff --git a/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp b/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp index 1880223d89..09df254cac 100644 --- a/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp +++ b/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp @@ -84,7 +84,7 @@ namespace Isis { m_instrumentNameShort = "WAC"; } else { - QString msg = "File does not appear to be a Voyager image. InstrumentId [" + std::string msg = "File does not appear to be a Voyager image. InstrumentId [" + instId + "] is invalid Voyager value."; throw IException(IException::User, msg, _FILEINFO_); } @@ -108,13 +108,13 @@ namespace Isis { m_instrumentNameShort = "WAC"; } else { - QString msg = "File does not appear to be a Voyager image. InstrumentId [" + std::string msg = "File does not appear to be a Voyager image. InstrumentId [" + instId + "] is invalid Voyager value."; throw IException(IException::User, msg, _FILEINFO_); } } else { - QString msg = "File does not appear to be a Voyager image. SpacecraftName [" + std::string msg = "File does not appear to be a Voyager image. SpacecraftName [" + spacecraft + "] is invalid Voyager value."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/tests/AffineTests.cpp b/isis/tests/AffineTests.cpp index 46b7ed6188..0467376d23 100644 --- a/isis/tests/AffineTests.cpp +++ b/isis/tests/AffineTests.cpp @@ -28,7 +28,7 @@ TEST(Affine, MatrixConstructor) { TEST(Affine, IncorrectDimensions) { - QString message = "Affine matrices must be 3x3"; + std::string message = "Affine matrices must be 3x3"; try { Isis::Affine::AMatrix matrix(2, 2, 0.0); matrix[0][0] = 1.0; @@ -45,7 +45,7 @@ TEST(Affine, IncorrectDimensions) { TEST(Affine, NotInvertible) { - QString message = "Affine transform not invertible"; + std::string message = "Affine transform not invertible"; try { Isis::Affine::AMatrix matrix(3, 3, 1.0); Isis::Affine affine(matrix); diff --git a/isis/tests/Area3DTests.cpp b/isis/tests/Area3DTests.cpp index 4dea04527e..b368a19bed 100644 --- a/isis/tests/Area3DTests.cpp +++ b/isis/tests/Area3DTests.cpp @@ -218,7 +218,7 @@ TEST(Area3D, Operators) { } TEST(Area3D, InvertedXError) { - QString message = "Cannot have a 3D area with inverted X"; + std::string message = "Cannot have a 3D area with inverted X"; Isis::Displacement d1(-1, Isis::Displacement::Meters); Isis::Displacement d2(1, Isis::Displacement::Meters); try { @@ -234,7 +234,7 @@ TEST(Area3D, InvertedXError) { } TEST(Area3D, InvertedYError) { - QString message = "Cannot have a 3D area with inverted Y"; + std::string message = "Cannot have a 3D area with inverted Y"; Isis::Displacement d1(-1, Isis::Displacement::Meters); Isis::Displacement d2(1, Isis::Displacement::Meters); try { @@ -250,7 +250,7 @@ TEST(Area3D, InvertedYError) { } TEST(Area3D, InvertedZError) { - QString message = "Cannot have a 3D area with inverted Z"; + std::string message = "Cannot have a 3D area with inverted Z"; Isis::Displacement d1(-1, Isis::Displacement::Meters); Isis::Displacement d2(1, Isis::Displacement::Meters); try { diff --git a/isis/tests/BundleObservationSolveSettingsTests.cpp b/isis/tests/BundleObservationSolveSettingsTests.cpp index cbc525612a..602c010b30 100644 --- a/isis/tests/BundleObservationSolveSettingsTests.cpp +++ b/isis/tests/BundleObservationSolveSettingsTests.cpp @@ -529,7 +529,7 @@ INSTANTIATE_TEST_SUITE_P(BundleObservationSolveSettings, PositionSolveOptionStri QString("AllPolynomialCoefficients")))); TEST(BundleObservationSolveSettings, GroupConstructorBadOverhermite) { - QString message = "The OVERHERMITE parameter must be set to TRUE or FALSE; YES or NO"; + std::string message = "The OVERHERMITE parameter must be set to TRUE or FALSE; YES or NO"; PvlGroup settingsGroup("VO1/VISA"); PvlKeyword camsolve("CamSolve"); @@ -555,7 +555,7 @@ TEST(BundleObservationSolveSettings, GroupConstructorBadOverhermite) { } TEST(BundleObservationSolveSettings, GroupConstructorBadTwist) { - QString message = "The TWIST parameter must be set to TRUE or FALSE; YES or NO"; + std::string message = "The TWIST parameter must be set to TRUE or FALSE; YES or NO"; PvlGroup settingsGroup("VO1/VISA"); PvlKeyword camsolve("CamSolve"); @@ -581,7 +581,7 @@ TEST(BundleObservationSolveSettings, GroupConstructorBadTwist) { } TEST(BundleObservationSolveSettings, GroupConstructorBadOverExisting) { - QString message = "The OVEREXISTING parameter must be set to TRUE or FALSE; YES or NO"; + std::string message = "The OVEREXISTING parameter must be set to TRUE or FALSE; YES or NO"; PvlGroup settingsGroup("VO1/VISA"); PvlKeyword camsolve("CamSolve"); @@ -608,7 +608,7 @@ TEST(BundleObservationSolveSettings, GroupConstructorBadOverExisting) { TEST(BundleObservationSolveSettings, PositionStringToOptionBadValue) { - QString message = "Unknown bundle instrument position solve option foo."; + std::string message = "Unknown bundle instrument position solve option foo."; try { BundleObservationSolveSettings::stringToInstrumentPositionSolveOption( @@ -625,7 +625,7 @@ TEST(BundleObservationSolveSettings, PositionStringToOptionBadValue) TEST(BundleObservationSolveSettings, PointingStringToOptionBadValue) { - QString message = "Unknown bundle instrument pointing solve option foo."; + std::string message = "Unknown bundle instrument pointing solve option foo."; try { BundleObservationSolveSettings::stringToInstrumentPointingSolveOption( diff --git a/isis/tests/ColorTests.cpp b/isis/tests/ColorTests.cpp index bd84bb3e8c..c52665a103 100644 --- a/isis/tests/ColorTests.cpp +++ b/isis/tests/ColorTests.cpp @@ -27,7 +27,7 @@ namespace Isis{ TEST (ColorTests, InvalidColorToString) { - QString message = "Can not convert an invalid color to an RGBA string. " + std::string message = "Can not convert an invalid color to an RGBA string. " "There is no string representation of an invalid color"; try { Color::toRGBAString(QColor()); diff --git a/isis/tests/ColumnTests.cpp b/isis/tests/ColumnTests.cpp index 00e848a9a3..8416d6c994 100644 --- a/isis/tests/ColumnTests.cpp +++ b/isis/tests/ColumnTests.cpp @@ -94,7 +94,7 @@ TEST(Column, Precision) { //Should throw an error when SetName is called with a string //whose length is greater than Width. TEST(Column, SetNameError) { - QString message = "Name [Test Column] is wider than width"; + std::string message = "Name [Test Column] is wider than width"; Column column; column.SetWidth(1); try { @@ -113,7 +113,7 @@ TEST(Column, SetNameError) { //Should throw an error when SetWidth is called with a value less than //the length of Name TEST(Column, SetWidthError) { - QString message = "Width is insufficient to contain name[Test Column]"; + std::string message = "Width is insufficient to contain name[Test Column]"; Column column; column.SetName("Test Column"); try { @@ -132,7 +132,7 @@ TEST(Column, SetWidthError) { //Should throw an error when Alignment is Decimal and //SetType is called with String or Integer TEST_P(TypeError, SetTypeError) { - QString message = "Integer or string type is not sensible if alignment is Decimal."; + std::string message = "Integer or string type is not sensible if alignment is Decimal."; Column column; column.SetAlignment(Column::Decimal); try { @@ -151,7 +151,7 @@ TEST_P(TypeError, SetTypeError) { //Should throw an error when Type is String or Integer and //SetAllignment is called with Decimal TEST_P(TypeError, SetAlignmentError) { - QString message = "Decimal alignment does not make sense for integer or string values."; + std::string message = "Decimal alignment does not make sense for integer or string values."; Column column; column.SetType(GetParam()); try { @@ -172,7 +172,7 @@ INSTANTIATE_TEST_SUITE_P(Column, TypeError, ::testing::Values( //Tests that Precision's exceptions are working correctly //Should throw an error when SetPrecision is called and Alignment is not Decimal TEST_P(PrecisionError, SetPrecisionError) { - QString message = "Setting precision only makes sense for Decimal Alignment"; + std::string message = "Setting precision only makes sense for Decimal Alignment"; Column column; column.SetAlignment(GetParam()); diff --git a/isis/tests/FunctionalTestsCnetstats.cpp b/isis/tests/FunctionalTestsCnetstats.cpp index 7642b8e5f6..f0ee413c08 100644 --- a/isis/tests/FunctionalTestsCnetstats.cpp +++ b/isis/tests/FunctionalTestsCnetstats.cpp @@ -218,7 +218,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetstatsInvalidDefFile) { Pvl log; QString serialNumList = tempDir.path() + "/cubes.lis"; - QString message = "Invalid Deffile"; + std::string message = "Invalid Deffile"; try { cnetstats(*network, serialNumList, options, &log); FAIL() << "Expected an exception to be thrown"; diff --git a/isis/tests/FunctionalTestsEnlarge.cpp b/isis/tests/FunctionalTestsEnlarge.cpp index a1d50b7499..8caac69b7e 100644 --- a/isis/tests/FunctionalTestsEnlarge.cpp +++ b/isis/tests/FunctionalTestsEnlarge.cpp @@ -67,7 +67,7 @@ TEST_F(SmallCube, FunctionalTestEnlargeSmallDimensions) { UserInterface options(APP_XML, args); Pvl appLog; - QString message = "Number of output samples/lines must be greater than or equal"; + std::string message = "Number of output samples/lines must be greater than or equal"; try { enlarge(testCube, options, &appLog); FAIL() << "Expected an exception to be thrown"; diff --git a/isis/tests/FunctionalTestsMosrange.cpp b/isis/tests/FunctionalTestsMosrange.cpp index 1ed09ae2b8..1d740808d6 100644 --- a/isis/tests/FunctionalTestsMosrange.cpp +++ b/isis/tests/FunctionalTestsMosrange.cpp @@ -158,7 +158,7 @@ TEST(Mosrange, MosrangeOnErrorFail) { ASSERT_EQ(errorFileFullPath.fileName(), "EN0108828337M_noSPICE.cub"); // confirm bad cube needs to be re-spiceinited - QString errorType = QString::fromStdString(errorFile.findKeyword("Error")); + std::string errorType = QString::fromStdString(errorFile.findKeyword("Error")); ASSERT_TRUE(errorType.contains("re-run spiceinit")); // try to read back errorList output file diff --git a/isis/tests/FunctionalTestsMvic2isis.cpp b/isis/tests/FunctionalTestsMvic2isis.cpp index 5f57e8a7cc..2aa10ea460 100644 --- a/isis/tests/FunctionalTestsMvic2isis.cpp +++ b/isis/tests/FunctionalTestsMvic2isis.cpp @@ -21,7 +21,7 @@ TEST_F(TempTestingFiles, Mvic2IsisTestTdiMode) { Pvl appLog; QString cubeFileName = tempDir.path() + "/mvic2isisTEMP.cub"; QString undistortedCubeName = tempDir.path() + "/mvic2isisUndistorted.cub"; - QString errorCubeName = tempDir.path() + "/mvic2isisError.cub"; + std::string errorCubeName = tempDir.path() + "/mvic2isisError.cub"; QString qualityCubeName = tempDir.path() + "/mvic2isisQuality.cub"; QVector args = {"from=data/mvic2isis/mc3_0034948318_0x536_sci_1_cropped.fits", "to=" + cubeFileName, diff --git a/isis/tests/FunctionalTestsOverlapstats.cpp b/isis/tests/FunctionalTestsOverlapstats.cpp index 838c00708a..f35dd0fbeb 100644 --- a/isis/tests/FunctionalTestsOverlapstats.cpp +++ b/isis/tests/FunctionalTestsOverlapstats.cpp @@ -43,7 +43,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestOverlapstatsBadCubeList) { FAIL() << "Expected Exception for invalid overlap list"; } catch(IException &e) { - QString errorMsg = "in overlap list that was not in the provided cube list"; + std::string errorMsg = "in overlap list that was not in the provided cube list"; EXPECT_TRUE(e.toString().toLatin1().contains(errorMsg.toLatin1())) << e.toString().toStdString(); } diff --git a/isis/tests/FunctionalTestsSpiceserver.cpp b/isis/tests/FunctionalTestsSpiceserver.cpp index f39a0d14a5..cc627e1b0d 100644 --- a/isis/tests/FunctionalTestsSpiceserver.cpp +++ b/isis/tests/FunctionalTestsSpiceserver.cpp @@ -92,7 +92,7 @@ TEST_F(TestPayload, FunctionalTestSpiceserverDefaultParameters) { QString xml( QByteArray::fromHex( QByteArray( hexCode.toLatin1() ) ).constData() ); QDomDocument document; - QString error; + std::string error; Pvl kernelsLabel; Pvl instrumentPositionTable; diff --git a/isis/tests/GaussianDistributionTests.cpp b/isis/tests/GaussianDistributionTests.cpp index 4a7ea78dee..3d0b5b0821 100644 --- a/isis/tests/GaussianDistributionTests.cpp +++ b/isis/tests/GaussianDistributionTests.cpp @@ -27,7 +27,7 @@ TEST(GaussianDistribution, Constructor) { TEST(GaussianDistribution, InvalidPercentage) { Isis::GaussianDistribution dist; - QString message = "Argument percent outside of the range 0 to 100"; + std::string message = "Argument percent outside of the range 0 to 100"; try { dist.InverseCumulativeDistribution(110); } diff --git a/isis/tests/IDTests.cpp b/isis/tests/IDTests.cpp index bf630b0a19..9878ebdca8 100644 --- a/isis/tests/IDTests.cpp +++ b/isis/tests/IDTests.cpp @@ -20,7 +20,7 @@ TEST(ID, ConstructorSetBaseNum) { TEST(ID, ConstructorNoReplacement) { - QString message = "No replacement set in string"; + std::string message = "No replacement set in string"; try { Isis::ID pid("ABC"); FAIL() << "Expected an IException"; @@ -35,7 +35,7 @@ TEST(ID, ConstructorNoReplacement) { TEST(ID, ConstructorMultipleReplacements) { - QString message = "contains more than one replacement set"; + std::string message = "contains more than one replacement set"; try { Isis::ID pid("A?B?C"); FAIL() << "Expected an IException"; @@ -65,7 +65,7 @@ TEST(ID, Next) { } TEST(ID, NextMaximumReached) { - QString message = "Maximum number reached for string"; + std::string message = "Maximum number reached for string"; try { Isis::ID pid("ABC?"); for (int i = 0; i < 11; i++) { diff --git a/isis/tests/IsisDataFixtures.cpp b/isis/tests/IsisDataFixtures.cpp index 187105e4b3..b98afa49c1 100644 --- a/isis/tests/IsisDataFixtures.cpp +++ b/isis/tests/IsisDataFixtures.cpp @@ -44,7 +44,7 @@ namespace Isis { QFileInfo qinfo( fname ); json_t file_json; try { - std::ifstream inputstream ( v_fname.expanded().toStdString() ); + std::ifstream inputstream ( v_fname.expanded() ); file_json = json_t::parse ( inputstream ); } catch ( ... ) { diff --git a/isis/tests/LatitudeTests.cpp b/isis/tests/LatitudeTests.cpp index 75d9a19b83..0675f03e05 100644 --- a/isis/tests/LatitudeTests.cpp +++ b/isis/tests/LatitudeTests.cpp @@ -99,7 +99,7 @@ TEST_F(Latitude_MappingGroupTest, DegreePlanetocentricConstructor) { TEST_F(Latitude_MappingGroupTest, AngleIncorrectLatitudeType) { - QString message = "is not recognized"; + std::string message = "is not recognized"; try { mappingGroup["LatitudeType"][0] = "InvalidValue"; Isis::Angle angle(45.0, Isis::Angle::Degrees); @@ -116,7 +116,7 @@ TEST_F(Latitude_MappingGroupTest, AngleIncorrectLatitudeType) { TEST_F(Latitude_MappingGroupTest, DegreeIncorrectLatitudeType) { - QString message = "is not recognized"; + std::string message = "is not recognized"; try { mappingGroup["LatitudeType"][0] = "InvalidValue"; Isis::Latitude latitude(45.0, mappingGroup, Isis::Angle::Degrees); @@ -132,7 +132,7 @@ TEST_F(Latitude_MappingGroupTest, DegreeIncorrectLatitudeType) { TEST_F(Latitude_MappingGroupTest, AngleMissingRadii) { - QString message = "Unable to create Latitude object from given mapping group"; + std::string message = "Unable to create Latitude object from given mapping group"; try { mappingGroup.deleteKeyword("EquatorialRadius"); Isis::Angle angle(45.0, Isis::Angle::Degrees); @@ -149,7 +149,7 @@ TEST_F(Latitude_MappingGroupTest, AngleMissingRadii) { TEST_F(Latitude_MappingGroupTest, DegreeMissingRadii) { - QString message = "Unable to create Latitude object from given mapping group"; + std::string message = "Unable to create Latitude object from given mapping group"; try { mappingGroup.deleteKeyword("EquatorialRadius"); Isis::Latitude latitude(45.0, mappingGroup, Isis::Angle::Degrees); @@ -247,7 +247,7 @@ TEST(Latitude, SetPlanetocentricPastPole) { TEST(Latitude, SetPlanetocentricOutOfRange) { - QString message = "Latitudes outside of the -90/90 range cannot be converted"; + std::string message = "Latitudes outside of the -90/90 range cannot be converted"; try { Isis::Latitude latitude(30.0, Isis::Distance(1.0, Isis::Distance::Units::Meters), @@ -278,7 +278,7 @@ TEST(Latitude, SetPlanetographic) { TEST(Latitude, SetPlanetographicRadiiNotSet) { - QString message = "cannot be converted to Planetocentic without the planetary radii"; + std::string message = "cannot be converted to Planetocentic without the planetary radii"; try { Isis::Latitude latitude(30.0, Isis::Angle::Degrees); latitude.setPlanetographic(45.0, Isis::Angle::Degrees); @@ -294,7 +294,7 @@ TEST(Latitude, SetPlanetographicRadiiNotSet) { TEST(Latitude, SetPlanetographicOutOfRange) { - QString message = "Latitudes outside of the -90/90 range cannot be converted"; + std::string message = "Latitudes outside of the -90/90 range cannot be converted"; try { Isis::Latitude latitude(30.0, Isis::Distance(1.0, Isis::Distance::Units::Meters), @@ -339,7 +339,7 @@ TEST(Latitude, OutOfRange) { TEST(Latitude, MinGreaterThanMax) { - QString message = "is greater than maximum latitude"; + std::string message = "is greater than maximum latitude"; try{ Isis::Latitude latitudeMin(3.0, Isis::Angle::Degrees); Isis::Latitude latitudeMax(1.0, Isis::Angle::Degrees); @@ -383,7 +383,7 @@ TEST_F(Latitude_MappingGroupTest, AddPlanetographic) { TEST_F(Latitude_MappingGroupTest, AddIncorrectLatitudeType) { - QString message = "is not recognized"; + std::string message = "is not recognized"; try { mappingGroup["LatitudeType"][0] = "Planetographic"; Isis::Angle angle(1.0, Isis::Angle::Degrees); diff --git a/isis/tests/Mocks.h b/isis/tests/Mocks.h index 650edf5c01..7c2ba6c5e7 100644 --- a/isis/tests/Mocks.h +++ b/isis/tests/Mocks.h @@ -40,7 +40,7 @@ class MockCube : public Cube { MOCK_METHOD4(histogram, Histogram*( const int &band, const double &validMin, const double &validMax, - QString msg)); + std::string msg)); }; class MockCamera : public Camera { diff --git a/isis/tests/TestUtilities.cpp b/isis/tests/TestUtilities.cpp index b548c3e729..49f626f548 100644 --- a/isis/tests/TestUtilities.cpp +++ b/isis/tests/TestUtilities.cpp @@ -423,7 +423,7 @@ namespace Isis { int status = system(command.toLatin1().data()); if (status != 0) { - QString msg = "Executing command [" + command + + std::string msg = "Executing command [" + command + "] failed with return status [" + toString(status) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/tests/UnitTestImagePolygon.cpp b/isis/tests/UnitTestImagePolygon.cpp index fd6d1fc89b..850c8e15f6 100644 --- a/isis/tests/UnitTestImagePolygon.cpp +++ b/isis/tests/UnitTestImagePolygon.cpp @@ -21,7 +21,7 @@ TEST_F(DefaultCube, UnitTestImagePolygonDefaultParams) { poly.Create(*testCube); } catch(IException &e) { - QString msg = "Cannot create polygon for [" + testCube->fileName() + "]"; + std::string msg = "Cannot create polygon for [" + testCube->fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } ASSERT_EQ(4517, poly.numVertices()); @@ -48,7 +48,7 @@ TEST_F(DefaultCube, UnitTestImagePolygonSubPoly) { poly.Create(*testCube, 100, 100, 384, 640, 385); } catch(IException &e) { - QString msg = "Cannot create polygon for [" + testCube->fileName() + "]"; + std::string msg = "Cannot create polygon for [" + testCube->fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } ASSERT_EQ(19, poly.numVertices()); @@ -81,7 +81,7 @@ TEST_F(TempTestingFiles, UnitTestImagePolygonCross) { poly.Create(crossCube, 100, 100); } catch(IException &e) { - QString msg = "Cannot create polygon for [" + crossCube.fileName() + "]"; + std::string msg = "Cannot create polygon for [" + crossCube.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } ASSERT_EQ(40, poly.numVertices()); @@ -137,7 +137,7 @@ TEST_F(DefaultCube, UnitTestImagePolygonBoundary) { poly.Create(footprintCube, 3000, 3000); } catch(IException &e) { - QString msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; + std::string msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } footprintCube.close(); @@ -184,7 +184,7 @@ TEST_F(TempTestingFiles, UnitTestImagePolygonMosaic) { poly.Create(footprintCube); } catch(IException &e) { - QString msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; + std::string msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } footprintCube.close(); @@ -246,7 +246,7 @@ TEST_F(DefaultCube, UnitTestImagePolygonOutlier) { poly.Create(footprintCube, 10, 10); } catch(IException &e) { - QString msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; + std::string msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } footprintCube.close(); diff --git a/isis/tests/statsTests.cpp b/isis/tests/statsTests.cpp index ebf230a911..4559054a80 100644 --- a/isis/tests/statsTests.cpp +++ b/isis/tests/statsTests.cpp @@ -20,7 +20,7 @@ class MockCube : public Cube { MOCK_METHOD4(histogram, Histogram*( const int &band, const double &validMin, const double &validMax, - QString msg)); + std::string msg)); }; class stats_FlatFileTest : public ::testing::Test { From ac54764675b1b0ef718aff0f47d8447167056108 Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Mon, 9 Sep 2024 10:48:16 -0700 Subject: [PATCH 62/95] Updated base objects --- isis/src/base/apps/pca/main.cpp | 4 +- isis/src/base/objs/NaifStatus/NaifStatus.cpp | 4 +- .../NthOrderPolynomial/NthOrderPolynomial.cpp | 4 +- .../ObservationNumberList.cpp | 2 +- .../base/objs/OriginalLabel/OriginalLabel.h | 1 + .../OriginalXmlLabel/OriginalXmlLabel.cpp | 6 +- .../OverlapStatistics/OverlapStatistics.cpp | 4 +- isis/src/base/objs/Pipeline/Pipeline.cpp | 30 ++-- .../objs/Pipeline/PipelineApplication.cpp | 16 +- isis/src/base/objs/Pixel/Pixel.cpp | 1 + isis/src/base/objs/Plugin/Plugin.cpp | 4 +- isis/src/base/objs/Plugin/Plugin.h | 1 + .../base/objs/PolygonSeeder/PolygonSeeder.cpp | 2 +- .../base/objs/PolygonTools/PolygonTools.cpp | 11 +- .../PrincipalComponentAnalysis.cpp | 4 +- isis/src/base/objs/Process/Process.cpp | 18 +-- .../ProcessExportPds/ProcessExportPds.cpp | 2 +- .../ProcessExportPds4/ProcessExportPds4.cpp | 42 ++--- .../base/objs/ProcessImport/ProcessImport.cpp | 76 ++++----- .../ProcessImportFits/ProcessImportFits.cpp | 13 +- .../ProcessImportPds/ProcessImportPds.cpp | 152 +++++++++--------- .../ProcessImportVicar/ProcessImportVicar.cpp | 12 +- .../ProcessMapMosaic/ProcessMapMosaic.cpp | 2 +- .../base/objs/ProcessMosaic/ProcessMosaic.cpp | 32 ++-- .../objs/ProcessPolygons/ProcessPolygons.cpp | 2 +- .../objs/ProgramLauncher/ProgramLauncher.cpp | 24 +-- .../objs/ProgramLauncher/ProgramLauncher.h | 2 +- isis/src/base/objs/Progress/Progress.cpp | 2 +- .../ProjectionFactory/ProjectionFactory.cpp | 4 +- .../PushFrameCameraCcdLayout.cpp | 12 +- .../base/objs/PvlEditDialog/PvlEditDialog.cpp | 4 +- isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp | 6 +- isis/src/base/objs/PvlToJSON/PvlToJSON.cpp | 2 +- isis/src/base/objs/QtExporter/QtExporter.cpp | 2 +- isis/src/base/objs/Resource/Resource.cpp | 2 +- .../SerialNumberList/SerialNumberList.cpp | 44 ++--- isis/src/base/objs/SessionLog/SessionLog.cpp | 2 +- isis/src/base/objs/SessionLog/SessionLog.h | 1 + .../ShapeModelFactory/ShapeModelFactory.cpp | 8 +- .../SpectralDefinition1D.cpp | 2 +- .../objs/Spice/LightTimeCorrectionState.cpp | 6 +- isis/src/base/objs/Spice/Spice.cpp | 22 +-- .../base/objs/SpicePosition/SpicePosition.cpp | 2 +- .../base/objs/SpiceRotation/SpiceRotation.cpp | 12 +- .../StatCumProbDistDynCalc.cpp | 20 +-- isis/src/base/objs/Statistics/Statistics.cpp | 64 ++++---- isis/src/base/objs/Strategy/Strategy.cpp | 22 +-- isis/src/base/objs/Stretch/Stretch.cpp | 10 +- .../base/objs/SurfacePoint/SurfacePoint.cpp | 2 +- isis/src/base/objs/Target/Target.cpp | 6 +- isis/src/base/objs/TextFile/TextFile.cpp | 18 +-- .../base/objs/TiffExporter/TiffExporter.cpp | 2 +- .../base/objs/TiffImporter/TiffImporter.cpp | 3 +- .../UniversalGroundMap/UniversalGroundMap.cpp | 2 +- .../base/objs/UserInterface/UserInterface.cpp | 68 ++++---- isis/src/base/objs/XmlToJson/XmlToJson.cpp | 6 +- .../XmlToPvlTranslationManager.cpp | 38 ++--- isis/src/base/objs/iTime/iTime.cpp | 17 +- isis/src/mgs/apps/mocproc/main.cpp | 2 +- 59 files changed, 444 insertions(+), 440 deletions(-) diff --git a/isis/src/base/apps/pca/main.cpp b/isis/src/base/apps/pca/main.cpp index e52d80ccca..73cc7033a2 100644 --- a/isis/src/base/apps/pca/main.cpp +++ b/isis/src/base/apps/pca/main.cpp @@ -65,7 +65,7 @@ void IsisMain() { } else if(ui.GetString("MODE") == "INVERSE") { if(!(icube->hasTable("Transform Matrix"))) { - QString m = "The input cube has not been transformed into its principal components"; + std::string m = "The input cube has not been transformed into its principal components"; throw IException(IException::Programmer, m, _FILEINFO_); } Isis::Table table = icube->readTable("Transform Matrix"); @@ -91,7 +91,7 @@ void IsisMain() { p.EndProcess(); } else { - QString m = "Invalid option for MODE [" + ui.GetString("MODE") + "]"; + std::string m = "Invalid option for MODE [" + ui.GetString("MODE") + "]"; throw IException(IException::Programmer, m, _FILEINFO_); } } diff --git a/isis/src/base/objs/NaifStatus/NaifStatus.cpp b/isis/src/base/objs/NaifStatus/NaifStatus.cpp index 95dabbf2bf..f1b74fbb8f 100644 --- a/isis/src/base/objs/NaifStatus/NaifStatus.cpp +++ b/isis/src/base/objs/NaifStatus/NaifStatus.cpp @@ -76,14 +76,14 @@ namespace Isis { PvlToPvlTranslationManager trans(error, "$ISISROOT/appdata/translations/NaifErrors.trn"); try { - errMsg = trans.Translate("ShortMessage"); + errMsg = trans.Translate("ShortMessage").toStdString(); } catch(IException &) { errMsg = "An unknown NAIF error has been encountered."; } try { - errMsg += " " + trans.Translate("LongMessage"); + errMsg += " " + trans.Translate("LongMessage").toStdString(); } catch(IException &) { } diff --git a/isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp b/isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp index 4574df5d4e..116bdd7e5c 100644 --- a/isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp +++ b/isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp @@ -38,8 +38,8 @@ namespace Isis { void NthOrderPolynomial::Expand(const std::vector &vars) { if((int) vars.size() != Variables()) { - std::string mess = "Number of variables given (" + QString::number(vars.size()) - + ") does not match expected (" + Variables() + ")!"; + std::string mess = "Number of variables given (" + std::to_string(vars.size()) + + ") does not match expected (" + std::to_string(Variables()) + ")!"; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/ObservationNumberList/ObservationNumberList.cpp b/isis/src/base/objs/ObservationNumberList/ObservationNumberList.cpp index f05ec8a4c3..911417e35b 100644 --- a/isis/src/base/objs/ObservationNumberList/ObservationNumberList.cpp +++ b/isis/src/base/objs/ObservationNumberList/ObservationNumberList.cpp @@ -275,7 +275,7 @@ namespace Isis { return filenames; } else { - std::string msg = "Requested observation number [" + on + "] "; + std::string msg = "Requested observation number [" + on.toStdString() + "] "; msg += "does not exist in the list"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/OriginalLabel/OriginalLabel.h b/isis/src/base/objs/OriginalLabel/OriginalLabel.h index 7e1310efbb..0a070978c5 100644 --- a/isis/src/base/objs/OriginalLabel/OriginalLabel.h +++ b/isis/src/base/objs/OriginalLabel/OriginalLabel.h @@ -10,6 +10,7 @@ find files of those names at the top level of this repository. **/ #include "Blob.h" #include "Pvl.h" +#include namespace Isis { /** diff --git a/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp b/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp index fcacc94c3e..f412bdc663 100644 --- a/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp +++ b/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp @@ -77,16 +77,16 @@ namespace Isis { */ Blob OriginalXmlLabel::toBlob() const { std::stringstream sstream; - sstream << m_originalLabel.toString(); + sstream << m_originalLabel.toString().toStdString(); string orglblStr = sstream.str(); Isis::Blob blob("IsisCube", "OriginalXmlLabel"); blob.setData((char*)orglblStr.data(), orglblStr.length()); blob.Label() += Isis::PvlKeyword("ByteOrder", "NULL"); if (Isis::IsLsb()) { - blob.Label()["ByteOrder"] = Isis::ByteOrderName(Isis::Lsb).toStdString(); + blob.Label()["ByteOrder"] = Isis::ByteOrderName(Isis::Lsb); } else { - blob.Label()["ByteOrder"] = Isis::ByteOrderName(Isis::Msb).toStdString(); + blob.Label()["ByteOrder"] = Isis::ByteOrderName(Isis::Msb); } return blob; } diff --git a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp index 663b89df46..e00b147f42 100644 --- a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp +++ b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp @@ -269,7 +269,7 @@ namespace Isis { } } - QString mStatsName = "MultivariateStatistics" + toString(band); + QString mStatsName = "MultivariateStatistics" + QString::number(band); PvlObject mStats(GetMStats(band).toPvl(mStatsName)); mStats += validBand; o.addObject(mStats); @@ -318,7 +318,7 @@ namespace Isis { // unserialize the MStats for (int band = 1; band <= Bands(); band++) { - QString name = "MultivariateStatistics" + toString(band); + QString name = "MultivariateStatistics" + QString::number(band); const PvlObject &mStats = inStats.findObject(name.toStdString()); p_stats.push_back(MultivariateStatistics(mStats)); } diff --git a/isis/src/base/objs/Pipeline/Pipeline.cpp b/isis/src/base/objs/Pipeline/Pipeline.cpp index 31315081d2..a94139e36e 100644 --- a/isis/src/base/objs/Pipeline/Pipeline.cpp +++ b/isis/src/base/objs/Pipeline/Pipeline.cpp @@ -140,7 +140,7 @@ namespace Isis { foundFirst = true; if (p_apps[i]->InputBranches().size() != OriginalBranches().size()) { - std::string msg = "The program [" + p_apps[i]->Name() + "] can not be the first in the pipeline"; + std::string msg = "The program [" + p_apps[i]->Name().toStdString() + "] can not be the first in the pipeline"; msg += " because it must be run multiple times with unspecified varying inputs"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -158,7 +158,7 @@ namespace Isis { for (int j = i + 1; j < (int)tmpFiles.size(); j++) { if (tmpFiles[i] == tmpFiles[j]) { std::string msg = "There is a conflict with the temporary file naming. The temporary file ["; - msg += tmpFiles[i] + "] is created twice."; + msg += tmpFiles[i].toStdString() + "] is created twice."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -376,7 +376,7 @@ namespace Isis { filename = filelist.front(); filelist.erase(filelist.begin()); p_originalInput.push_back(QString::fromStdString(filename.expanded())); - p_inputBranches.push_back(QString::fromStdString(inputFileName.name()) + toString(branch)); + p_inputBranches.push_back(QString::fromStdString(inputFileName.name()) + QString::number(branch)); p_virtualBands.push_back(""); p_finalOutput.push_back(QString::fromStdString(filename.name())); @@ -584,7 +584,7 @@ namespace Isis { // Check uniqueness first for (unsigned int appIdentifier = 0; appIdentifier < p_appIdentifiers.size(); appIdentifier++) { if (p_appIdentifiers[appIdentifier] == identifier) { - std::string message = "The application identifier [" + identifier + "] is not unique. " + + std::string message = "The application identifier [" + identifier.toStdString() + "] is not unique. " + "Please providing a unique identifier"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -642,7 +642,7 @@ namespace Isis { // Check uniqueness first for (unsigned int appIdentifier = 0; appIdentifier < p_appIdentifiers.size(); appIdentifier++) { if (p_appIdentifiers[appIdentifier] == appname) { - std::string message = "The application identifier [" + appname + "] is not unique. Please use " + + std::string message = "The application identifier [" + appname.toStdString() + "] is not unique. Please use " + "the other AddToPipeline method providing a unique identifier"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -705,7 +705,7 @@ namespace Isis { } if (!found) { - std::string msg = "Application identified by [" + identifier + "] has not been added to the pipeline"; + std::string msg = "Application identified by [" + identifier.toStdString() + "] has not been added to the pipeline"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -723,7 +723,7 @@ namespace Isis { */ PipelineApplication &Pipeline::Application(const int &index) { if (index > Size()) { - std::string msg = "Index [" + QString(index) + "] out of bounds"; + std::string msg = "Index [" + std::to_string(index) + "] out of bounds"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -755,7 +755,7 @@ namespace Isis { // } if (appIndex >= (int)p_apps.size()) { - std::string msg = "Pipeline could not find application [" + appname + "]"; + std::string msg = "Pipeline could not find application [" + appname.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -781,7 +781,7 @@ namespace Isis { } if (appIndex < 0) { - std::string msg = "Pipeline could not find application [" + appname + "]"; + std::string msg = "Pipeline could not find application [" + appname.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -807,7 +807,7 @@ namespace Isis { if (p_finalOutput.size() > 1) { if ((unsigned int)branch >= p_finalOutput.size()) { - std::string msg = "Output not set for branch [" + QString(branch) + "]"; + std::string msg = "Output not set for branch [" + std::to_string(branch) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -918,7 +918,7 @@ namespace Isis { pipeline.Prepare(); if (!pipeline.Name().isEmpty()) { - os << "PIPELINE -------> " << pipeline.Name() << " <------- PIPELINE" << endl; + os << "PIPELINE -------> " << pipeline.Name().toStdString() << " <------- PIPELINE" << endl; } for (int i = 0; i < pipeline.Size(); i++) { @@ -931,10 +931,10 @@ namespace Isis { QStringList listFileData = cmd.split(" "); QString file = listFileData.takeFirst(); - os << "echo -e \"" << listFileData.join("\\n") << "\" > " << file << endl; + os << "echo -e \"" << listFileData.join("\\n").toStdString() << "\" > " << file.toStdString() << endl; } else { - os << pipeline.Application(i).Name() << " " << params[j] << endl; + os << pipeline.Application(i).Name().toStdString() << " " << params[j].toStdString() << endl; } } } @@ -946,7 +946,7 @@ namespace Isis { vector tmpFiles = pipeline.Application(i).TemporaryFiles(); for (int file = 0; file < (int)tmpFiles.size(); file++) { if (!tmpFiles[file].contains("blank")) { - os << "rm " << tmpFiles[file] << endl; + os << "rm " << tmpFiles[file].toStdString() << endl; } } } @@ -954,7 +954,7 @@ namespace Isis { } if (!pipeline.Name().isEmpty()) { - os << "PIPELINE -------> " << pipeline.Name() << " <------- PIPELINE" << endl; + os << "PIPELINE -------> " << pipeline.Name().toStdString() << " <------- PIPELINE" << endl; } return os; diff --git a/isis/src/base/objs/Pipeline/PipelineApplication.cpp b/isis/src/base/objs/Pipeline/PipelineApplication.cpp index 921e7ca599..909c786a5f 100644 --- a/isis/src/base/objs/Pipeline/PipelineApplication.cpp +++ b/isis/src/base/objs/Pipeline/PipelineApplication.cpp @@ -446,8 +446,8 @@ namespace Isis { params += " " + p_output[outParam].Name() + "=\"" + p_outputs[outBranch] + "\""; if(outputSet) { - std::string message = "Application [" + Name() + "] in the pipeline branches with an "; - message += "output parameter for each branch, but branch [" + p_outBranches[outBranch]; + std::string message = "Application [" + Name().toStdString() + "] in the pipeline branches with an "; + message += "output parameter for each branch, but branch [" + p_outBranches[outBranch].toStdString(); message += "] has multiple output files specified."; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -457,8 +457,8 @@ namespace Isis { } if(!outputSet) { - std::string message = "Application [" + Name() + "] in the pipeline branches with an "; - message += "output parameter for each branch, but branch [" + p_outBranches[outBranch]; + std::string message = "Application [" + Name().toStdString() + "] in the pipeline branches with an "; + message += "output parameter for each branch, but branch [" + p_outBranches[outBranch].toStdString(); message += "] has no output files specified."; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -495,7 +495,7 @@ namespace Isis { } if(inputFile.isEmpty()) { - std::string message = "There was a problem with calculating the inputs for program [" + Name(); + std::string message = "There was a problem with calculating the inputs for program [" + Name().toStdString(); message += "]. Please verify your program is not setting outputs for branches that "; message += "don't have input."; throw IException(IException::Programmer, message, _FILEINFO_); @@ -738,11 +738,11 @@ namespace Isis { } if(p_inBranches[0] != "") { - std::string msg = "Application [" + Name() + "] in the pipeline does not have an input for branch [" + p_inBranches[branch] + "]"; + std::string msg = "Application [" + Name().toStdString() + "] in the pipeline does not have an input for branch [" + p_inBranches[branch].toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { - std::string msg = "Application [" + Name() + "] in the pipeline does not have an input"; + std::string msg = "Application [" + Name().toStdString() + "] in the pipeline does not have an input"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -782,7 +782,7 @@ namespace Isis { } if(!found) { - std::string msg = "Branch [" + name + "] does not exist in the pipeline application [" + Name() + "]"; + std::string msg = "Branch [" + name.toStdString() + "] does not exist in the pipeline application [" + Name().toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Pixel/Pixel.cpp b/isis/src/base/objs/Pixel/Pixel.cpp index bf535d6339..929e3df11c 100644 --- a/isis/src/base/objs/Pixel/Pixel.cpp +++ b/isis/src/base/objs/Pixel/Pixel.cpp @@ -5,6 +5,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "Pixel.h" +#include using namespace std; diff --git a/isis/src/base/objs/Plugin/Plugin.cpp b/isis/src/base/objs/Plugin/Plugin.cpp index d572319ef3..ba78c93172 100644 --- a/isis/src/base/objs/Plugin/Plugin.cpp +++ b/isis/src/base/objs/Plugin/Plugin.cpp @@ -61,8 +61,8 @@ namespace Isis { QFunctionPointer plugin = lib.resolve(pluginName.toLatin1().data()); if (plugin == 0) { - std::string msg = "Unable to find plugin [" + pluginName + - "] in shared library [" + lib.fileName() + "]"; + std::string msg = "Unable to find plugin [" + pluginName.toStdString() + + "] in shared library [" + lib.fileName().toStdString() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Plugin/Plugin.h b/isis/src/base/objs/Plugin/Plugin.h index 939fd8812a..7637af68b5 100644 --- a/isis/src/base/objs/Plugin/Plugin.h +++ b/isis/src/base/objs/Plugin/Plugin.h @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "Pvl.h" +#include namespace Isis { /** diff --git a/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp b/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp index e76e41adf7..a26b2d44c8 100644 --- a/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp +++ b/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp @@ -124,7 +124,7 @@ namespace Isis { } catch(IException &e) { std::string msg = "Improper format for PolygonSeeder PVL ["; - msg += pvl.fileName() + "]. Location [" + errorSpot.toStdString() + "]"; + msg += pvl.fileName() + "]. Location [" + errorSpot + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PolygonTools/PolygonTools.cpp b/isis/src/base/objs/PolygonTools/PolygonTools.cpp index 6fc12fb192..dbe22ec276 100644 --- a/isis/src/base/objs/PolygonTools/PolygonTools.cpp +++ b/isis/src/base/objs/PolygonTools/PolygonTools.cpp @@ -305,8 +305,7 @@ namespace Isis { } catch (std::exception &e) { throw IException(IException::Unknown, - QObject::tr("Unable to convert polygon from Lat/Lon to Sample/Line. The " - "error given was [%1].").arg(e.what()), + "Unable to convert polygon from Lat/Lon to Sample/Line. The error given was [" + (std::string)e.what() + "].", _FILEINFO_); } @@ -398,7 +397,7 @@ namespace Isis { os << "" << endl; os << "" << endl; os << " " << endl; @@ -423,7 +422,7 @@ namespace Isis { os << " " << endl << endl; os << " " << endl; os << " " << endl; - os << " " << idString << "" << endl; + os << " " << idString.toStdString() << "" << endl; os << " " << ""; @@ -1106,7 +1105,7 @@ namespace Isis { return FixGeometry(MakeMultiPolygon(geom)); } else { - IString msg = "PolygonTools::FixGeometry does not support [" + GetGeometryName(geom) + "]"; + IString msg = "PolygonTools::FixGeometry does not support [" + GetGeometryName(geom).toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1580,7 +1579,7 @@ namespace Isis { } else { IString msg = "PolygonTools::ReducePrecision does not support [" + - GetGeometryName(geom) + "]"; + GetGeometryName(geom).toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/PrincipalComponentAnalysis/PrincipalComponentAnalysis.cpp b/isis/src/base/objs/PrincipalComponentAnalysis/PrincipalComponentAnalysis.cpp index e52e28546f..483e7b53fa 100644 --- a/isis/src/base/objs/PrincipalComponentAnalysis/PrincipalComponentAnalysis.cpp +++ b/isis/src/base/objs/PrincipalComponentAnalysis/PrincipalComponentAnalysis.cpp @@ -114,7 +114,7 @@ namespace Isis { // Transform the vector into principal component space TNT::Array2D PrincipalComponentAnalysis::Transform(TNT::Array2D data) { if(data.dim1() != 1 || data.dim2() != p_dimensions) { - QString m = "Transform input must be of dimension 1 x " + QString::number(p_dimensions); + std::string m = "Transform input must be of dimension 1 x " + std::to_string(p_dimensions); throw IException(IException::Programmer, m, _FILEINFO_); } @@ -125,7 +125,7 @@ namespace Isis { // Transform the vector from principal component space TNT::Array2D PrincipalComponentAnalysis::Inverse(TNT::Array2D data) { if(data.dim1() != 1 || data.dim2() != p_dimensions) { - QString m = "Transform input must be of dimension 1 x " + QString::number(p_dimensions); + std::string m = "Transform input must be of dimension 1 x " + std::to_string(p_dimensions); throw IException(IException::Programmer, m, _FILEINFO_); } diff --git a/isis/src/base/objs/Process/Process.cpp b/isis/src/base/objs/Process/Process.cpp index 70df8625ca..5639585938 100644 --- a/isis/src/base/objs/Process/Process.cpp +++ b/isis/src/base/objs/Process/Process.cpp @@ -371,7 +371,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns } else { std::string msg = "You've chosen to reduce your output PixelType for [" + - fname + "] you must specify the output pixel range too"; + fname.toStdString() + "] you must specify the output pixel range too"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -410,7 +410,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns Isis::Pvl &inlab = *InputCubes[0]->label(); for(int i = 0; i < inlab.objects(); i++) { if(inlab.object(i).isNamed("Table")) { - Isis::Blob t(QString::fromStdString(inlab.object(i)["Name"]), inlab.object(i).name()); + Isis::Blob t(inlab.object(i)["Name"], inlab.object(i).name()); InputCubes[0]->read(t); cube->write(t); } @@ -422,7 +422,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns Isis::Pvl &inlab = *InputCubes[0]->label(); for(int i = 0; i < inlab.objects(); i++) { if(inlab.object(i).isNamed("Polygon")) { - Isis::Blob t(QString::fromStdString(inlab.object(i)["Name"]), inlab.object(i).name()); + Isis::Blob t(inlab.object(i)["Name"], inlab.object(i).name()); InputCubes[0]->read(t); cube->write(t); } @@ -577,7 +577,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns // Test for one band if(requirements & Isis::OneBand) { if(cube->bandCount() != 1) { - std::string message = "Input cube [" + cube->fileName() + "] must have one band"; + std::string message = "Input cube [" + cube->fileName().toStdString() + "] must have one band"; throw IException(IException::User, message, _FILEINFO_); } } @@ -722,7 +722,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns if (object.isNamed("Table")) { if (tableNames.isEmpty() || tableNames.contains(QString::fromStdString(object["Name"]))) { - Blob table(QString::fromStdString(object["Name"]), object.name()); + Blob table(object["Name"], object.name()); fromCube->read(table); OutputCubes[i]->write(table); } @@ -793,7 +793,7 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns // See if the data directory is installed Isis::FileName installed(dir); if(!installed.fileExists()) { - std::string message = "Data directory for mission [" + mission + "] " + + std::string message = "Data directory for mission [" + mission.toStdString() + "] " + "is not installed at your site"; throw IException(IException::Io, message, _FILEINFO_); } @@ -867,9 +867,9 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns int bandStop = cube->bandCount(); int maxSteps = cube->lineCount() * cube->bandCount(); - QString cubeNumStr = toString(cubeNum + 1); - QString totalCubes = toString((int)InputCubes.size()); - std::string msg = "Calculating statistics for cube " + cubeNumStr + " of " + totalCubes; + QString cubeNumStr = QString::number(cubeNum + 1); + QString totalCubes = QString::number((int)InputCubes.size()); + QString msg = "Calculating statistics for cube " + cubeNumStr + " of " + totalCubes; Isis::Progress progress; progress.SetText(msg); diff --git a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp index c36a068bae..962ae3294c 100644 --- a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp +++ b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp @@ -1019,7 +1019,7 @@ namespace Isis { char *tableBuffer = new char[isisTable.Records() * fileRecordBytes]; PvlObject metadata = pdsTable.exportTable(tableBuffer, fileRecordBytes, - ByteOrderName(p_endianType)); + QString::fromStdString(ByteOrderName(p_endianType))); QString pdsTableName = pdsTable.formatPdsTableName(); Pvl &mainPvl = *m_label; if (Attached()) { diff --git a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp index 6bfc0e1d9f..8604ec02a9 100644 --- a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp +++ b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp @@ -684,7 +684,7 @@ namespace Isis { axisBinSetElement.appendChild(bin); QDomElement binSequenceNumber = m_domDoc->createElement("sp:bin_sequence_number"); - PvlToXmlTranslationManager::setElementValue(binSequenceNumber, toString(i+1)); + PvlToXmlTranslationManager::setElementValue(binSequenceNumber, QString::number(i+1)); bin.appendChild(binSequenceNumber); @@ -895,12 +895,12 @@ namespace Isis { QDomElement scalingFactorElement = m_domDoc->createElement("scaling_factor"); PvlToXmlTranslationManager::setElementValue(scalingFactorElement, - toString(multiplier)); + QString::number(multiplier)); elementArrayElement.appendChild(scalingFactorElement); QDomElement offsetElement = m_domDoc->createElement("value_offset"); PvlToXmlTranslationManager::setElementValue(offsetElement, - toString(base)); + QString::number(base)); elementArrayElement.appendChild(offsetElement); } @@ -1072,7 +1072,7 @@ namespace Isis { * @param[out] os file stream to which the XML label will be written. */ void ProcessExportPds4::OutputLabel(std::ofstream &os) { - os << m_domDoc->toString() << endl; + os << m_domDoc->toString().toStdString() << endl; } @@ -1191,7 +1191,7 @@ namespace Isis { xlatorSpecProj.Auto(*m_domDoc); } catch (IException &e) { - std::string msg = "Unable to export projection [" + projName + "] to PDS4 product. " + + std::string msg = "Unable to export projection [" + projName.toStdString() + "] to PDS4 product. " + "This projection is not supported in ISIS3."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -1216,9 +1216,9 @@ namespace Isis { if( units.compare("km", Qt::CaseInsensitive) != 0 && units.compare("kilometers", Qt::CaseInsensitive) != 0) { //if no units, assume in meters - double dValue = toDouble(semiMajorRadElement.text()); + double dValue = toDouble(semiMajorRadElement.text().toStdString()); dValue /= 1000.0; - PvlToXmlTranslationManager::resetElementValue(semiMajorRadElement, toString(dValue), "km"); + PvlToXmlTranslationManager::resetElementValue(semiMajorRadElement, QString::number(dValue), "km"); } } @@ -1228,9 +1228,9 @@ namespace Isis { QString units = semiMinorRadElement.attribute("unit"); if( units.compare("km", Qt::CaseInsensitive) != 0 && units.compare("kilometers", Qt::CaseInsensitive) != 0) { // If no units, assume in meters - double dValue = toDouble(semiMinorRadElement.text()); + double dValue = toDouble(semiMinorRadElement.text().toStdString()); dValue /= 1000.0; - PvlToXmlTranslationManager::resetElementValue(semiMinorRadElement, toString(dValue), "km"); + PvlToXmlTranslationManager::resetElementValue(semiMinorRadElement, QString::number(dValue), "km"); } } @@ -1239,9 +1239,9 @@ namespace Isis { QString units = polarRadElement.attribute("unit"); if( units.compare("km", Qt::CaseInsensitive) != 0 && units.compare("kilometers", Qt::CaseInsensitive) != 0) { // If no units, assume in meters - double dValue = toDouble(polarRadElement.text()); + double dValue = toDouble(polarRadElement.text().toStdString()); dValue /= 1000.0; - PvlToXmlTranslationManager::resetElementValue(polarRadElement, toString(dValue), "km"); + PvlToXmlTranslationManager::resetElementValue(polarRadElement, QString::number(dValue), "km"); } } @@ -1270,16 +1270,16 @@ namespace Isis { // so if positive east, swap min/max if(QString::compare(lonDir, "PositiveEast", Qt::CaseInsensitive) == 0) { // west min, east max - PvlToXmlTranslationManager::resetElementValue(eastElement, toString(maxLon), "deg"); - PvlToXmlTranslationManager::resetElementValue(westElement, toString(minLon), "deg"); + PvlToXmlTranslationManager::resetElementValue(eastElement, QString::number(maxLon), "deg"); + PvlToXmlTranslationManager::resetElementValue(westElement, QString::number(minLon), "deg"); } else { - PvlToXmlTranslationManager::resetElementValue(eastElement, toString(minLon), "deg"); - PvlToXmlTranslationManager::resetElementValue(westElement, toString(maxLon), "deg"); + PvlToXmlTranslationManager::resetElementValue(eastElement, QString::number(minLon), "deg"); + PvlToXmlTranslationManager::resetElementValue(westElement, QString::number(maxLon), "deg"); } - PvlToXmlTranslationManager::resetElementValue(northElement, toString(maxLat), "deg"); - PvlToXmlTranslationManager::resetElementValue(southElement, toString(minLat), "deg"); + PvlToXmlTranslationManager::resetElementValue(northElement, QString::number(maxLat), "deg"); + PvlToXmlTranslationManager::resetElementValue(southElement, QString::number(minLat), "deg"); // longitude_of_central_meridian and latitude_of_projection_origin need to be converted to floats. xmlPath.clear(); @@ -1475,7 +1475,7 @@ namespace Isis { configPvl.read(transMapFile.toStdString()); } catch(IException &e) { - std::string msg = "Failed to read unit translation config file [" + transMapFile + "]."; + std::string msg = "Failed to read unit translation config file [" + transMapFile.toStdString() + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } @@ -1484,7 +1484,7 @@ namespace Isis { transMap = createUnitMap(configPvl); } catch(IException &e) { - std::string msg = "Failed to load unit translation config file [" + transMapFile + "]."; + std::string msg = "Failed to load unit translation config file [" + transMapFile.toStdString() + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -1494,7 +1494,7 @@ namespace Isis { translateChildUnits( label.documentElement(), transMap ); } catch(IException &e) { - std::string msg = "Failed to translate units with config file [" + transMapFile + "]."; + std::string msg = "Failed to translate units with config file [" + transMapFile.toStdString() + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -1560,7 +1560,7 @@ namespace Isis { childElement.setAttribute("unit", transMap.value( originalUnit.toLower() ) ); } else { - std::string msg = "Could not translate unit [" + originalUnit + "] to PDS4 format."; + std::string msg = "Could not translate unit [" + originalUnit.toStdString() + "] to PDS4 format."; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.cpp b/isis/src/base/objs/ProcessImport/ProcessImport.cpp index 44226b0ee7..1c83fdabe0 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.cpp +++ b/isis/src/base/objs/ProcessImport/ProcessImport.cpp @@ -269,7 +269,7 @@ namespace Isis { } else { std::string msg = "Unsupported pixel type [" + - Isis::PixelTypeName(type) + "]"; + Isis::PixelTypeName(type).toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -282,7 +282,7 @@ namespace Isis { } else { std::string msg = "Unsupported pixel type [" + - Isis::PixelTypeName(type) + "]"; + Isis::PixelTypeName(type).toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1103,7 +1103,7 @@ namespace Isis { (pixelMax > p_null_min && pixelMax < p_null_max) || // --max crossing (pixelMin < p_null_min && pixelMax > p_null_max))) { // --straddling // values - std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName.toStdString() + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the NULL range [" + toString(p_null_min) + "," + toString(p_null_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1113,7 +1113,7 @@ namespace Isis { (pixelMin > p_lrs_min && pixelMin < p_lrs_max) || (pixelMax > p_lrs_min && pixelMax < p_lrs_max) || (pixelMin < p_lrs_min && pixelMax > p_lrs_max))) { - std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName.toStdString() + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the LRS range [" + toString(p_lrs_min) + "," + toString(p_lrs_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1123,7 +1123,7 @@ namespace Isis { (pixelMin > p_lis_min && pixelMin < p_lis_max) || (pixelMax > p_lis_min && pixelMax < p_lis_max) || (pixelMin < p_lis_min && pixelMax > p_lis_max))) { - std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName.toStdString() + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the LIS range [" + toString(p_lis_min) + "," + toString(p_lis_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1133,7 +1133,7 @@ namespace Isis { (pixelMin > p_hrs_min && pixelMin < p_hrs_max) || (pixelMax > p_hrs_min && pixelMax < p_hrs_max) || (pixelMin < p_hrs_min && pixelMax > p_hrs_max))) { - std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName.toStdString() + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the HRS range [" + toString(p_hrs_min) + "," + toString(p_hrs_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1143,7 +1143,7 @@ namespace Isis { (pixelMin > p_his_min && pixelMin < p_his_max) || (pixelMax > p_his_min && pixelMax < p_his_max) || (pixelMin < p_his_min && pixelMax > p_his_max))) { - std::string msg = "The " + pixelName + " range [" + toString(pixelMin) + + std::string msg = "The " + pixelName.toStdString() + " range [" + toString(pixelMin) + "," + toString(pixelMax) + "] overlaps the HIS range [" + toString(p_his_min) + "," + toString(p_his_max) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -1226,7 +1226,7 @@ namespace Isis { } else { std::string msg = "Unsupported pixel type [" + - Isis::PixelTypeName(p_pixelType) + "]"; + Isis::PixelTypeName(p_pixelType).toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } att.setMinimum(min); @@ -1312,7 +1312,7 @@ namespace Isis { ProcessBip(); } else { - std::string msg = "File [" + p_inFile + std::string msg = "File [" + p_inFile.toStdString() + "] is not in a supported organization."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -1342,7 +1342,7 @@ namespace Isis { ProcessBip(funct); } else { - std::string msg = "File [" + p_inFile + "] is not in a supported organization."; + std::string msg = "File [" + p_inFile.toStdString() + "] is not in a supported organization."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1366,7 +1366,7 @@ namespace Isis { char *in = new char [readBytes]; // Set up an Isis::EndianSwapper object - QString tok(Isis::ByteOrderName(p_byteOrder)); + QString tok(QString::fromStdString(Isis::ByteOrderName(p_byteOrder))); tok = tok.toUpper(); Isis::EndianSwapper swapper(tok); @@ -1376,7 +1376,7 @@ namespace Isis { QString inFileName(QString::fromStdString(inFile.expanded())); fin.open(inFileName.toLatin1().data(), ios::in | ios::binary); if (!fin.is_open()) { - std::string msg = "Cannot open input file [" + p_inFile + "]"; + std::string msg = "Cannot open input file [" + p_inFile.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1393,7 +1393,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1438,7 +1438,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1462,7 +1462,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1472,7 +1472,7 @@ namespace Isis { pos = fin.tellg(); fin.read(in, readBytes); if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(readBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1547,7 +1547,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1578,7 +1578,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1598,7 +1598,7 @@ namespace Isis { // Check the io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileTrailerBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1630,7 +1630,7 @@ namespace Isis { char *in = new char [readBytes]; // Set up an Isis::EndianSwapper object - QString tok(Isis::ByteOrderName(p_byteOrder)); + QString tok(QString::fromStdString(Isis::ByteOrderName(p_byteOrder))); tok = tok.toUpper(); Isis::EndianSwapper swapper(tok); @@ -1640,7 +1640,7 @@ namespace Isis { QString inFileName(QString::fromStdString(inFile.expanded())); fin.open(inFileName.toLatin1().data(), ios::in | ios::binary); if (!fin.is_open()) { - std::string msg = "Cannot open input file [" + p_inFile + "]"; + std::string msg = "Cannot open input file [" + p_inFile.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1658,7 +1658,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1697,7 +1697,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1718,7 +1718,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1729,7 +1729,7 @@ namespace Isis { pos = fin.tellg(); fin.read(in, readBytes); if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(readBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1801,7 +1801,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1821,7 +1821,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1843,7 +1843,7 @@ namespace Isis { // Check the io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileTrailerBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1870,7 +1870,7 @@ namespace Isis { void ProcessImport::ProcessBip(void funct(Isis::Buffer &out)) { // Set up an Isis::EndianSwapper object - QString tok(Isis::ByteOrderName(p_byteOrder)); + QString tok(QString::fromStdString(Isis::ByteOrderName(p_byteOrder))); tok = tok.toUpper(); Isis::EndianSwapper swapper(tok); @@ -1880,7 +1880,7 @@ namespace Isis { QString inFileName(QString::fromStdString(inFile.expanded())); fin.open(inFileName.toLatin1().data(), ios::in | ios::binary); if (!fin.is_open()) { - std::string msg = "Cannot open input file [" + p_inFile + "]"; + std::string msg = "Cannot open input file [" + p_inFile.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1897,7 +1897,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1928,7 +1928,7 @@ namespace Isis { for(int line = 0; line < p_nl; line++) { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1939,7 +1939,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -1949,7 +1949,7 @@ namespace Isis { pos = fin.tellg(); fin.read(in, readBytes); if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(readBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -2049,7 +2049,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_dataPreBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -2067,7 +2067,7 @@ namespace Isis { // Check the last io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileHeaderBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -2089,7 +2089,7 @@ namespace Isis { // Check the io if (!fin.good()) { - std::string msg = "Cannot read file [" + p_inFile + "]. Position [" + + std::string msg = "Cannot read file [" + p_inFile.toStdString() + "]. Position [" + toString((int)pos) + "]. Byte count [" + toString(p_fileTrailerBytes) + "]" ; throw IException(IException::Io, msg, _FILEINFO_); @@ -2301,7 +2301,7 @@ namespace Isis { void ProcessImport::SetInputFile(const QString &file) { p_inFile = file; if (!Isis::FileName(file.toStdString()).fileExists()) { - std::string msg = "File [" + file + "] does not exist"; + std::string msg = "File [" + file.toStdString() + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp b/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp index ad85c1342a..95bdca6fa1 100644 --- a/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp +++ b/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp @@ -230,8 +230,8 @@ namespace Isis { } if (!m_extraFitsLabels) { - std::string msg = QObject::tr("The FITS label has not been initialized, " - "call setFitsFile() first."); + std::string msg = "The FITS label has not been initialized, " + "call setFitsFile() first."; throw IException(IException::Programmer, msg, _FILEINFO_); } else if (m_extraFitsLabels->size() < labelNumber) { @@ -264,8 +264,8 @@ namespace Isis { } if (!m_fitsImageLabels) { - std::string msg = QObject::tr("The FITS label has not been initialized, " - "call setFitsFile first."); + std::string msg = "The FITS label has not been initialized, " + "call setFitsFile first."; throw IException(IException::Programmer, msg, _FILEINFO_); } else if (m_fitsImageLabels->size() < labelNumber) { @@ -356,9 +356,8 @@ namespace Isis { void ProcessImportFits::setProcessFileStructure(int labelNumber) { if (labelNumber >= m_fitsImageLabels->size()) { - std::string msg = QObject::tr("The requested label number [%1], from file [%2] is " - "past the last image in this FITS file [%3].").arg(labelNumber). - arg(InputFile()).arg(m_fitsImageLabels->size()-1); + std::string msg = "The requested label number [" + std::to_string(labelNumber) + "], from file [" + InputFile().toStdString() + "] is " + "past the last image in this FITS file [" + std::to_string(m_fitsImageLabels->size()-1) + "]."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp index f132b789ea..a6d38bd014 100644 --- a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp +++ b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp @@ -106,7 +106,7 @@ namespace Isis { if (pdsXlater.InputHasKeyword("EquatorialRadius")) { str = pdsXlater.Translate("EquatorialRadius"); - p_equatorialRadius = toDouble(str) * 1000.0; + p_equatorialRadius = str.toDouble() * 1000.0; } else { std::string message = "No equatorial radius name in labels"; @@ -115,7 +115,7 @@ namespace Isis { if (pdsXlater.InputHasKeyword("PolarRadius")) { str = pdsXlater.Translate("PolarRadius"); - p_polarRadius = toDouble(str) * 1000.0; + p_polarRadius = str.toDouble() * 1000.0; } else { std::string message = "No polar radius in labels"; @@ -142,7 +142,7 @@ namespace Isis { if (pdsXlater.InputHasKeyword("MinimumLatitude")) { str = pdsXlater.Translate("MinimumLatitude"); try { - p_minimumLatitude = toDouble(str); + p_minimumLatitude = str.toDouble(); } catch(IException &e) { p_minimumLatitude = Isis::NULL8; @@ -155,7 +155,7 @@ namespace Isis { if (pdsXlater.InputHasKeyword("MaximumLatitude")) { str = pdsXlater.Translate("MaximumLatitude"); try { - p_maximumLatitude = toDouble(str); + p_maximumLatitude = str.toDouble(); } catch(IException &e) { p_maximumLatitude = Isis::NULL8; @@ -172,7 +172,7 @@ namespace Isis { str = pdsXlater.Translate("MinimumLongitude"); try { positiveWest = true; - p_minimumLongitude = toDouble(str); + p_minimumLongitude = str.toDouble(); } catch(IException &e) { p_minimumLongitude = Isis::NULL8; @@ -181,7 +181,7 @@ namespace Isis { else if (pdsXlater.InputHasKeyword("MinimumLongitude2")) { str = pdsXlater.Translate("MinimumLongitude2"); try { - p_minimumLongitude = toDouble(str); + p_minimumLongitude = str.toDouble(); } catch(IException &e) { p_minimumLongitude = Isis::NULL8; @@ -195,7 +195,7 @@ namespace Isis { str = pdsXlater.Translate("MaximumLongitude"); try { positiveWest = true; - p_maximumLongitude = toDouble(str); + p_maximumLongitude = str.toDouble(); } catch(IException &e) { p_maximumLongitude = Isis::NULL8; @@ -204,7 +204,7 @@ namespace Isis { else if (pdsXlater.InputHasKeyword("MaximumLongitude2")) { str = pdsXlater.Translate("MaximumLongitude2"); try { - p_maximumLongitude = toDouble(str); + p_maximumLongitude = str.toDouble(); } catch(IException &e) { p_maximumLongitude = Isis::NULL8; @@ -215,7 +215,7 @@ namespace Isis { } str = pdsXlater.Translate("LongitudeDomain"); - p_longitudeDomain = toInt(str); + p_longitudeDomain = str.toInt(); /** * The input file does not have a longitude domain. @@ -254,7 +254,7 @@ namespace Isis { } str = pdsXlater.Translate("PixelResolution"); - p_pixelResolution = toDouble(str); + p_pixelResolution = str.toDouble(); str = QString::fromStdString(pdsXlater.InputKeyword("PixelResolution").unit()).toUpper(); // Assume KM/PIXEL if the unit doesn't exist or is not METERS/PIXEL if ((str != "METERS/PIXEL") && (str != "M/PIXEL") && (str != "M/PIX")) { @@ -262,11 +262,11 @@ namespace Isis { } str = pdsXlater.Translate("Scale"); - p_scaleFactor = toDouble(str); + p_scaleFactor = str.toDouble(); try { str = pdsXlater.Translate("Rotation"); - p_rotation = toDouble(str); + p_rotation = str.toDouble(); } catch(IException &) { // assume no rotation if the value isn't a number @@ -283,7 +283,7 @@ namespace Isis { else { str = pdsXlater.Translate("LineProjectionOffset2"); } - p_lineProjectionOffset = toDouble(str); + p_lineProjectionOffset = str.toDouble(); p_upperLeftY = ymult * (p_lineProjectionOffset + yoff) * p_pixelResolution; if (pdsXlater.InputHasKeyword("SampleProjectionOffset")) { @@ -292,7 +292,7 @@ namespace Isis { else { str = pdsXlater.Translate("SampleProjectionOffset2"); } - p_sampleProjectionOffset = toDouble(str); + p_sampleProjectionOffset = str.toDouble(); p_upperLeftX = xmult * (p_sampleProjectionOffset + xoff) * p_pixelResolution; p_projectionOffsetGroup.addKeyword(PvlKeyword("xOffset", std::to_string(xoff))); @@ -495,7 +495,7 @@ namespace Isis { if (dataFilePointer.size() == 1) { try { str = pdsXlater.Translate("DataFilePointer"); - offset = toInt(str); + offset = str.toInt(); units = QString::fromStdString(dataFilePointer.unit()); // Successful? we have an offset, means current, p_labelFile // is the location of the data as well @@ -513,20 +513,20 @@ namespace Isis { // Expection ("filname", ) else if (dataFilePointer.size() == 2) { dataFileName = pdsXlater.Translate("DataFilePointer", 0); - offset = IString(pdsXlater.Translate("DataFilePointer", 1)).ToInteger(); + offset = IString(pdsXlater.Translate("DataFilePointer", 1).toStdString()).ToInteger(); units = QString::fromStdString(dataFilePointer.unit(1)); } // Error, no value else if (dataFilePointer.size() == 0) { std::string msg = "Data file pointer ^IMAGE or ^QUBE has no value, must" "have either file name or offset or both, in [" + - p_labelFile + "]"; + p_labelFile.toStdString() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } // Error, more than two values else { std::string msg = "Improperly formatted data file pointer keyword ^IMAGE or " - "^QUBE, in [" + p_labelFile + "], must contain filename " + "^QUBE, in [" + p_labelFile.toStdString() + "], must contain filename " " or offset or both"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -571,7 +571,7 @@ namespace Isis { } else { QString recSize = pdsXlater.Translate("DataFileRecordBytes"); - SetFileHeaderBytes((offset - 1) * toInt(recSize)); + SetFileHeaderBytes((offset - 1) * recSize.toInt()); } } @@ -690,7 +690,7 @@ namespace Isis { } } else { - std::string msg = "Unsupported encoding type in [" + p_labelFile + "]"; + std::string msg = "Unsupported encoding type in [" + p_labelFile.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -732,7 +732,7 @@ namespace Isis { ProcessPdsCombinedSpectrumLabel(pdsDataFile); } else { - std::string msg = "Unknown label type in [" + p_labelFile + "]. It is possible the label file " + std::string msg = "Unknown label type in [" + p_labelFile.toStdString() + "]. It is possible the label file " + "does not describe an image product (IMAGE, CUBE, or SPECTRALCUBE)."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -764,22 +764,22 @@ namespace Isis { QString str; str = pdsXlater.Translate("CoreLinePrefixBytes"); - SetDataPrefixBytes(toInt(str)); + SetDataPrefixBytes(str.toInt()); str = pdsXlater.Translate("CoreLineSuffixBytes"); - SetDataSuffixBytes(toInt(str)); + SetDataSuffixBytes(str.toInt()); ProcessPixelBitandType(pdsXlater); str = pdsXlater.Translate("CoreByteOrder"); - SetByteOrder(Isis::ByteOrderEnumeration(str)); + SetByteOrder(Isis::ByteOrderEnumeration(str.toStdString())); str = pdsXlater.Translate("CoreSamples"); - int ns = toInt(str); + int ns = str.toInt(); str = pdsXlater.Translate("CoreLines"); - int nl = toInt(str); + int nl = str.toInt(); str = pdsXlater.Translate("CoreBands"); - int nb = toInt(str); + int nb = str.toInt(); SetDimensions(ns, nl, nb); @@ -809,9 +809,9 @@ namespace Isis { // Find the image data base and multiplier //------------------------------------------------------------ str = pdsXlater.Translate("CoreBase"); - SetBase(toDouble(str)); + SetBase(str.toDouble()); str = pdsXlater.Translate("CoreMultiplier"); - SetMultiplier(toDouble(str)); + SetMultiplier(str.toDouble()); // Find the organization of the image data str = pdsXlater.Translate("CoreOrganization"); @@ -829,7 +829,7 @@ namespace Isis { SetOrganization(ProcessImport::BIL); } else { - std::string msg = "Unsupported axis order [" + str + "]"; + std::string msg = "Unsupported axis order [" + str.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -882,7 +882,7 @@ namespace Isis { bandPos = i; } else { - std::string message = "Unknown file axis name [" + str + "]"; + std::string message = "Unknown file axis name [" + str.toStdString() + "]"; throw IException(IException::User, message, _FILEINFO_); } } @@ -906,7 +906,7 @@ namespace Isis { stringstream pdsCoreOrgStream; pdsCoreOrgStream << pdsCoreOrg; - std::string msg = "Unsupported axis order [" + QString(pdsCoreOrgStream.str().c_str()) + "]"; + std::string msg = "Unsupported axis order [" + (std::string)pdsCoreOrgStream.str().c_str() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -917,20 +917,20 @@ namespace Isis { // Set the number of bytes following the second dimension (right side plane) str = pdsXlater.Translate("SuffixItemSize"); - int suffix = toInt(str); + int suffix = str.toInt(); str = pdsXlater.Translate("AxisSuffixCount", 0); - suffix *= toInt(str); + suffix *= str.toInt(); SetDataSuffixBytes(suffix); str = pdsXlater.Translate("SuffixItemSize"); // Only set DataTrailerBytes if we haven't already set it elsewhere. (It's inialized to 0.) if (DataTrailerBytes() == 0) { - int trailer = toInt(str); + int trailer = str.toInt(); str = pdsXlater.Translate("AxisSuffixCount", 1); - trailer *= toInt(str); + trailer *= str.toInt(); str = pdsXlater.Translate("CoreSamples", samplePos); - trailer *= toInt(str); + trailer *= str.toInt(); trailer += suffix; SetDataTrailerBytes(trailer); } @@ -947,7 +947,7 @@ namespace Isis { //tjw: str = pdsXlater.Translate("CoreByteOrder"); - SetByteOrder(Isis::ByteOrderEnumeration(str)); + SetByteOrder(Isis::ByteOrderEnumeration(str.toStdString())); //if(str == "LSB" || str == "MSB") // SetByteOrder(Isis::ByteOrderEnumeration(str)); @@ -960,11 +960,11 @@ namespace Isis { // Set the number of samples, lines and bands str = pdsXlater.Translate("CoreSamples", samplePos); - int ns = toInt(str); + int ns = str.toInt(); str = pdsXlater.Translate("CoreLines", linePos); - int nl = toInt(str); + int nl = str.toInt(); str = pdsXlater.Translate("CoreBands", bandPos); - int nb = toInt(str); + int nb = str.toInt(); SetDimensions(ns, nl, nb); @@ -1003,18 +1003,18 @@ namespace Isis { vector mults; for(int i = 0; i < pdsXlater.InputKeyword("BandBase").size(); i++) { str = pdsXlater.Translate("BandBase", i); - bases.push_back(toDouble(str)); + bases.push_back(str.toDouble()); str = pdsXlater.Translate("BandMultiplier", i); - mults.push_back(toDouble(str)); + mults.push_back(str.toDouble()); } SetBase(bases); SetMultiplier(mults); } else { str = pdsXlater.Translate("CoreBase"); - SetBase(toDouble(str)); + SetBase(str.toDouble()); str = pdsXlater.Translate("CoreMultiplier"); - SetMultiplier(toDouble(str)); + SetMultiplier(str.toDouble()); } } @@ -1037,22 +1037,22 @@ namespace Isis { QString str; str = pdsXlater.Translate("CoreLinePrefixBytes"); - SetDataPrefixBytes(toInt(str)); + SetDataPrefixBytes(str.toInt()); str = pdsXlater.Translate("CoreLineSuffixBytes"); - SetDataSuffixBytes(toInt(str)); + SetDataSuffixBytes(str.toInt()); ProcessPixelBitandType(pdsXlater); str = pdsXlater.Translate("CoreByteOrder"); - SetByteOrder(Isis::ByteOrderEnumeration(str)); + SetByteOrder(Isis::ByteOrderEnumeration(str.toStdString())); str = pdsXlater.Translate("CoreSamples"); - int ns = toInt(str); + int ns = str.toInt(); str = pdsXlater.Translate("CoreLines"); - int nl = toInt(str); + int nl = str.toInt(); str = pdsXlater.Translate("CoreBands"); - int nb = toInt(str); + int nb = str.toInt(); SetDimensions(ns, nl, nb); @@ -1086,9 +1086,9 @@ namespace Isis { // Find the image data base and multiplier //------------------------------------------------------------ str = pdsXlater.Translate("CoreBase"); - SetBase(toDouble(str)); + SetBase(str.toDouble()); str = pdsXlater.Translate("CoreMultiplier"); - SetMultiplier(toDouble(str)); + SetMultiplier(str.toDouble()); // Find the organization of the image data str = pdsXlater.Translate("CoreOrganization"); @@ -1106,7 +1106,7 @@ namespace Isis { SetOrganization(ProcessImport::BIL); } else { - std::string msg = "Unsupported axis order [" + str + "]"; + std::string msg = "Unsupported axis order [" + str.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1119,7 +1119,7 @@ namespace Isis { void ProcessImportPds::ProcessPixelBitandType(Isis::PvlToPvlTranslationManager & pdsXlater) { QString str; str = pdsXlater.Translate("CoreBitsPerPixel"); - int bitsPerPixel = toInt(str); + int bitsPerPixel = str.toInt(); str = pdsXlater.Translate("CorePixelType"); if ((str == "Real") && (bitsPerPixel == 64)) { @@ -1195,22 +1195,22 @@ namespace Isis { // L1B (Rdn) products do not have an prefix or suffix data. L0 have 1280 bytes at the // beginning of each line of the BIL formatted file. str = pdsXlater.Translate("CoreLinePrefixBytes"); - SetDataHeaderBytes(toInt(str)); + SetDataHeaderBytes(str.toInt()); str = pdsXlater.Translate("CoreLineSuffixBytes"); - SetDataSuffixBytes(toInt(str)); + SetDataSuffixBytes(str.toInt()); ProcessPixelBitandType(pdsXlater); str = pdsXlater.Translate("CoreByteOrder"); - SetByteOrder(Isis::ByteOrderEnumeration(str)); + SetByteOrder(Isis::ByteOrderEnumeration(str.toStdString())); str = pdsXlater.Translate("CoreSamples"); - int ns = toInt(str); + int ns = str.toInt(); str = pdsXlater.Translate("CoreLines"); - int nl = toInt(str); + int nl = str.toInt(); str = pdsXlater.Translate("CoreBands"); - int nb = toInt(str); + int nb = str.toInt(); SetDimensions(ns, nl, nb); // Set any special pixel values, not qube, so use false @@ -1243,9 +1243,9 @@ namespace Isis { // Find the image data base and multiplier //------------------------------------------------------------ str = pdsXlater.Translate("CoreBase"); - SetBase(toDouble(str)); + SetBase(str.toDouble()); str = pdsXlater.Translate("CoreMultiplier"); - SetMultiplier(toDouble(str)); + SetMultiplier(str.toDouble()); // Find the organization of the image data str = pdsXlater.Translate("CoreOrganization"); @@ -1263,7 +1263,7 @@ namespace Isis { SetOrganization(ProcessImport::BIL); } else { - std::string msg = "Unsupported axis order [" + str + "]"; + std::string msg = "Unsupported axis order [" + str.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -1279,13 +1279,13 @@ namespace Isis { if (pdsXlater.InputHasKeyword("CoreNull")) { str = pdsXlater.Translate("CoreNull"); if (str != "NULL") { - pdsNull = toDouble(str); + pdsNull = str.toDouble(); } } else if (!isQube && pdsXlater.InputHasKeyword("CoreNull2")) { str = pdsXlater.Translate("CoreNull2"); if (str != "NULL") { - pdsNull = toDouble(str); + pdsNull = str.toDouble(); } } @@ -1293,13 +1293,13 @@ namespace Isis { if (pdsXlater.InputHasKeyword("CoreLrs")) { str = pdsXlater.Translate("CoreLrs"); if (str != "NULL") { - pdsLrs = toDouble(str); + pdsLrs = str.toDouble(); } } else if (!isQube && pdsXlater.InputHasKeyword("CoreLrs2")) { str = pdsXlater.Translate("CoreLrs2"); if (str != "NULL") { - pdsLrs = toDouble(str); + pdsLrs = str.toDouble(); } } @@ -1307,13 +1307,13 @@ namespace Isis { if (pdsXlater.InputHasKeyword("CoreLis")) { str = pdsXlater.Translate("CoreLis"); if (str != "NULL") { - pdsLis = toDouble(str); + pdsLis = str.toDouble(); } } else if (!isQube && pdsXlater.InputHasKeyword("CoreLis2")) { str = pdsXlater.Translate("CoreLis2"); if (str != "NULL") { - pdsLis = toDouble(str); + pdsLis = str.toDouble(); } } @@ -1321,13 +1321,13 @@ namespace Isis { if (pdsXlater.InputHasKeyword("CoreHrs")) { str = pdsXlater.Translate("CoreHrs"); if (str != "NULL") { - pdsHrs = toDouble(str); + pdsHrs = str.toDouble(); } } else if (!isQube && pdsXlater.InputHasKeyword("CoreHrs2")) { str = pdsXlater.Translate("CoreHrs2"); if (str != "NULL") { - pdsHrs = toDouble(str); + pdsHrs = str.toDouble(); } } @@ -1335,13 +1335,13 @@ namespace Isis { if (pdsXlater.InputHasKeyword("CoreHis")) { str = pdsXlater.Translate("CoreHis"); if (str != "NULL") { - pdsHis = toDouble(str); + pdsHis = str.toDouble(); } } else if (!isQube && pdsXlater.InputHasKeyword("CoreHis2")) { str = pdsXlater.Translate("CoreHis2"); if (str != "NULL") { - pdsHis = toDouble(str); + pdsHis = str.toDouble(); } } @@ -1402,9 +1402,9 @@ namespace Isis { } catch (IException &e) { throw IException(e, IException::User, - QObject::tr("This image does not contain a pds label. You will need an " + "This image does not contain a pds label. You will need an " "image with a PDS label or a detached PDS label for this " - "image."), _FILEINFO_); + "image.", _FILEINFO_); } // Save the label and file for future use diff --git a/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp b/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp index aceb29122f..eb27d34acb 100644 --- a/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp +++ b/isis/src/base/objs/ProcessImportVicar/ProcessImportVicar.cpp @@ -34,13 +34,13 @@ namespace Isis { ifstream vicFile(vicarFile.toLatin1().data(), ios::in); if(!vicFile) { - std::string msg = "Cannot open vicar file [" + vicarFile + "]"; + std::string msg = "Cannot open vicar file [" + vicarFile.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } try { // get the starting VICAR label and convert to PVL - IString vicLabels = ExtractPvlLabel(0, vicFile); + IString vicLabels = ExtractPvlLabel(0, vicFile).toStdString(); // Fill temp Pvl label for ProcessImport startprocess stringstream lbl; @@ -68,7 +68,7 @@ namespace Isis { if(pixType == "HALF") pixelType = SignedWord; if(pixType == "REAL") pixelType = Real; if(pixelType == None) { - std::string msg = "Unsupported pixel type [FORMAT=" + pixType + "]"; + std::string msg = "Unsupported pixel type [FORMAT=" + pixType.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } SetPixelType(pixelType); @@ -92,7 +92,7 @@ namespace Isis { SetOrganization(ProcessImport::BIP); } else { - std::string msg = "Unsupported file organization [" + organization + "]"; + std::string msg = "Unsupported file organization [" + organization.toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -108,7 +108,7 @@ namespace Isis { QString endPvlLabel = ExtractPvlLabel(startByte, vicFile); stringstream lbl; - lbl << endPvlLabel; + lbl << endPvlLabel.toStdString(); Pvl endLab; lbl >> endLab; @@ -121,7 +121,7 @@ namespace Isis { } } catch(IException &e) { - std::string msg = "Input file [" + vicarFile + "] does not appear to be a vicar file"; + std::string msg = "Input file [" + vicarFile.toStdString() + "] does not appear to be a vicar file"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp index 14e284f4cb..ca22de58d2 100644 --- a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp +++ b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp @@ -72,7 +72,7 @@ namespace Isis { int nlMosaic = mosaicCube->lineCount(); if (*iproj != *oproj) { - std::string msg = "Mapping groups do not match between cube [" + inputFile + "] and mosaic"; + std::string msg = "Mapping groups do not match between cube [" + inputFile.toStdString() + "] and mosaic"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp index 6b192ae980..3479e6ce3a 100644 --- a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp +++ b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp @@ -106,7 +106,7 @@ namespace Isis { void ProcessMosaic::StartProcess(const int &os, const int &ol, const int &ob) { // Error checks ... there must be one input and one output if ((OutputCubes.size() != 1) || (InputCubes.size() != 1)) { - QString m = "You must specify exactly one input and one output cube"; + std::string m = "You must specify exactly one input and one output cube"; throw IException(IException::Programmer, m, _FILEINFO_); } @@ -115,7 +115,7 @@ namespace Isis { bTrackExists = GetTrackStatus(); if (m_trackingEnabled && !(OutputCubes[0]->hasGroup("Tracking") || OutputCubes[0]->hasTable("InputImages"))) { - QString m = "Cannot enable tracking while adding to a mosaic without tracking "; + std::string m = "Cannot enable tracking while adding to a mosaic without tracking "; m += "information. Confirm that your mosaic was originally created with tracking enabled."; throw IException(IException::User, m, _FILEINFO_); } @@ -171,7 +171,7 @@ namespace Isis { // Tests for completly off the mosaic if ((ins < 1) || (inl < 1)) { - QString m = "The input cube does not overlap the mosaic"; + std::string m = "The input cube does not overlap the mosaic"; throw IException(IException::User, m, _FILEINFO_); } @@ -200,7 +200,7 @@ namespace Isis { (OutputCubes[0]->bandCount()) == 1) || (m_imageOverlay == PlaceImagesOnTop && m_placeHighSatPixels && m_placeLowSatPixels && m_placeNullPixels)) ){ - QString m = "Tracking cannot be True for multi-band Mosaic with ontop or beneath priority"; + std::string m = "Tracking cannot be True for multi-band Mosaic with ontop or beneath priority"; throw IException(IException::Programmer, m, _FILEINFO_); } } @@ -230,7 +230,7 @@ namespace Isis { } // BandBin group is not found else { - QString m = "Match BandBin cannot be True when the Image does not have the BandBin group"; + std::string m = "Match BandBin cannot be True when the Image does not have the BandBin group"; throw IException(IException::Programmer, m, _FILEINFO_); } } @@ -328,11 +328,11 @@ namespace Isis { // Initialize a TrackingTable object from current mosaic Table *table; try { - table = new Table(TRACKING_TABLE_NAME, m_trackingCube->fileName()); + table = new Table(TRACKING_TABLE_NAME, m_trackingCube->fileName().toStdString()); trackingTable = new TrackingTable(*table); } catch (IException &e) { - std::string msg = "Unable to find Tracking Table in " + m_trackingCube->fileName() + "."; + std::string msg = "Unable to find Tracking Table in " + m_trackingCube->fileName().toStdString() + "."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -583,7 +583,7 @@ namespace Isis { // Make sure only one input is active at a time if (InputCubes.size() > 0) { - QString m = "You must specify exactly one input cube"; + std::string m = "You must specify exactly one input cube"; throw IException(IException::Programmer, m, _FILEINFO_); } @@ -600,9 +600,9 @@ namespace Isis { Pvl *cInPvl = InputCubes[0]->label(); if (cInPvl->findGroup("Dimensions", Pvl::Traverse).hasKeyword("Bands")) { PvlKeyword &cBandKey = cInPvl->findGroup("Dimensions", Pvl::Traverse).findKeyword("Bands"); - QString sStr(QString::fromStdString(cBandKey[0])); + std::string sStr = cBandKey[0]; if (toInt(sStr) < nb) { - QString m = "The parameter number of input bands exceeds the actual number of bands in the " + std::string m = "The parameter number of input bands exceeds the actual number of bands in the " "input cube"; throw IException(IException::Programmer, m, _FILEINFO_); } @@ -654,7 +654,7 @@ namespace Isis { // Make sure only one input is active at a time if (InputCubes.size() > 0) { - QString m = "You must specify exactly one input cube"; + std::string m = "You must specify exactly one input cube"; throw IException(IException::Programmer, m, _FILEINFO_); } @@ -671,9 +671,9 @@ namespace Isis { Pvl *cInPvl = InputCubes[0]->label(); if (cInPvl->findGroup("Dimensions", Pvl::Traverse).hasKeyword("Bands")) { PvlKeyword &cBandKey = cInPvl->findGroup("Dimensions", Pvl::Traverse).findKeyword("Bands"); - QString sStr(QString::fromStdString(cBandKey[0])); + std::string sStr = cBandKey[0]; if (toInt(sStr) < nb) { - QString m = "The parameter number of input bands exceeds the actual number of bands in the input cube"; + std::string m = "The parameter number of input bands exceeds the actual number of bands in the input cube"; throw IException(IException::Programmer, m, _FILEINFO_); } } @@ -705,7 +705,7 @@ namespace Isis { // Make sure there is only one output cube if (OutputCubes.size() > 0) { - QString m = "You must specify exactly one output cube"; + std::string m = "You must specify exactly one output cube"; throw IException(IException::Programmer, m, _FILEINFO_); } @@ -939,7 +939,7 @@ namespace Isis { } throw IException(IException::Unknown, - "The text [" + imageOverlayString + "] does not correspond to any known " + "The text [" + imageOverlayString.toStdString() + "] does not correspond to any known " "image overlay modes (mosaic priorities)", _FILEINFO_); } @@ -973,7 +973,7 @@ namespace Isis { } } } - QString sErrMsg = "Input and Mosaic DEM Shape Model do not match"; + std::string sErrMsg = "Input and Mosaic DEM Shape Model do not match"; throw IException(IException::User, sErrMsg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ProcessPolygons/ProcessPolygons.cpp b/isis/src/base/objs/ProcessPolygons/ProcessPolygons.cpp index 757c61278a..835f995d25 100644 --- a/isis/src/base/objs/ProcessPolygons/ProcessPolygons.cpp +++ b/isis/src/base/objs/ProcessPolygons/ProcessPolygons.cpp @@ -229,7 +229,7 @@ namespace Isis { catch(geos::util::IllegalArgumentException *ill) { std::string msg = "ERROR! geos exception 1 ["; - msg += (QString)ill->what() + "]"; + msg += (std::string)ill->what() + "]"; delete ill; throw IException(IException::Programmer, msg, _FILEINFO_); }/*end catch*/ diff --git a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp index b60ad7c749..861bc11e44 100644 --- a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp +++ b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp @@ -52,13 +52,13 @@ namespace Isis { " -pid=" + toString(getpid()); if(!isIsisProgram) { - std::string msg = "Program [" + programName + "] does not appear to be a " + std::string msg = "Program [" + programName.toStdString() + "] does not appear to be a " "valid Isis program"; throw IException(IException::Unknown, msg, _FILEINFO_); } QString serverName = "isis_" + Application::UserName() + - "_" + toString(getpid()); + "_" + QString::number(getpid()); QLocalServer server; server.listen(serverName); @@ -95,7 +95,7 @@ namespace Isis { bool messageDone = false; QString code; - std::string message; + QString message; QByteArray lineData; if(childSocket->waitForReadyRead(1000)) { @@ -135,7 +135,7 @@ namespace Isis { childProcess.waitForFinished(); if(childProcess.exitCode() != 0) { - std::string msg = "Running Isis program [" + programName + "] failed with " + std::string msg = "Running Isis program [" + programName.toStdString() + "] failed with " "return status [" + toString(childProcess.exitCode()) + "]"; throw IException(errors, IException::Unknown, msg, _FILEINFO_); } @@ -153,18 +153,18 @@ namespace Isis { * parameter. */ IException - ProgramLauncher::ProcessIsisMessageFromChild(QString code, std::string msg) { + ProgramLauncher::ProcessIsisMessageFromChild(QString code, QString msg) { IException errors; if(code == "PROGRESSTEXT" && iApp) { iApp->UpdateProgress(msg, true); } else if(code == "PROGRESS" && iApp) { - iApp->UpdateProgress(toInt(msg), true); + iApp->UpdateProgress(msg.toInt(), true); } else if(code == "LOG" && iApp) { stringstream msgStream; - msgStream << msg; + msgStream << msg.toStdString(); Pvl logPvl; msgStream >> logPvl; @@ -179,19 +179,19 @@ namespace Isis { } else if(code == "ERROR") { stringstream msgStream; - msgStream << msg; + msgStream << msg.toStdString(); Pvl errorPvl; msgStream >> errorPvl; for(int i = 0; i < errorPvl.groups(); i++) { PvlGroup &g = errorPvl.group(i); - QString emsg = QString::fromStdString(g["Message"]); + std::string emsg = g["Message"]; int ecode = g["Code"]; - QString efile =QString::fromStdString(g["File"]); + std::string efile = g["File"]; int eline = g["Line"]; errors.append( - IException((IException::ErrorType)ecode, emsg, efile.toLatin1().data(), eline)); + IException((IException::ErrorType)ecode, emsg, efile.c_str(), eline)); } } @@ -214,7 +214,7 @@ namespace Isis { int status = system(fullCommand.toLatin1().data()); if(status != 0) { - std::string msg = "Executing command [" + fullCommand + + std::string msg = "Executing command [" + fullCommand.toStdString() + "] failed with return status [" + toString(status) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.h b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.h index e66d77acd1..d3d2370847 100644 --- a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.h +++ b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.h @@ -37,7 +37,7 @@ namespace Isis { static void RunSystemCommand(QString commandLine); private: - static IException ProcessIsisMessageFromChild(QString code, std::string msg); + static IException ProcessIsisMessageFromChild(QString code, QString msg); private: //! Construction is not allowed diff --git a/isis/src/base/objs/Progress/Progress.cpp b/isis/src/base/objs/Progress/Progress.cpp index 955dcfe146..b9993248e1 100644 --- a/isis/src/base/objs/Progress/Progress.cpp +++ b/isis/src/base/objs/Progress/Progress.cpp @@ -118,7 +118,7 @@ namespace Isis { } else { if(p_printPercent && p_autoDisplay) { - cout << p_text << endl; + cout << p_text.toStdString() << endl; } } } diff --git a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp index b55efa18f8..674ef81fa0 100644 --- a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp +++ b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp @@ -76,7 +76,7 @@ namespace Isis { } catch(IException &e) { std::string msg = "Unsupported projection, unable to find plugin for [" + - proj + "]"; + proj.toStdString() + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } @@ -144,7 +144,7 @@ namespace Isis { } catch(IException &e) { std::string msg = "Unsupported projection, unable to find plugin for [" + - proj + "]"; + proj.toStdString() + "]"; throw IException(e, IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp b/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp index 83af47ed38..3ebc38a68f 100644 --- a/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp +++ b/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp @@ -71,7 +71,7 @@ namespace Isis { * @return @b int The number of samples in the CCD. */ int PushFrameCameraCcdLayout::ccdSamples() const { - QString var = "INS" + toString(m_ccdId) + "_FILTER_SAMPLES"; + QString var = "INS" + QString::number(m_ccdId) + "_FILTER_SAMPLES"; return (getSpiceInt(var)); } @@ -83,7 +83,7 @@ namespace Isis { * @return @b int The number of lines in the CCD. */ int PushFrameCameraCcdLayout::ccdLines() const { - QString var = "INS" + toString(m_ccdId) + "_FILTER_LINES"; + QString var = "INS" + QString::number(m_ccdId) + "_FILTER_LINES"; return (getSpiceInt(var)); } @@ -103,7 +103,7 @@ namespace Isis { FrameletInfo finfo(frameId); finfo.m_filterName = name; - QString base = "INS" + toString(frameId); + QString base = "INS" + QString::number(frameId); try { finfo.m_samples = getSpiceInt(base + "_FILTER_SAMPLES"); finfo.m_lines = getSpiceInt(base + "_FILTER_LINES"); @@ -149,7 +149,7 @@ namespace Isis { // Gotta throw an error here if not found if (!found) { NaifStatus::CheckErrors(); - std::string msg = "Can not find [" + var + "] in text kernels"; + std::string msg = "Can not find [" + var.toStdString() + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -178,7 +178,7 @@ namespace Isis { // Gotta throw an error here if not found if (!found) { NaifStatus::CheckErrors(); - std::string msg = "Can not find [" + var + "] in text kernels"; + std::string msg = "Can not find [" + var.toStdString() + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -207,7 +207,7 @@ namespace Isis { // Gotta throw an error here if not found if (!found) { NaifStatus::CheckErrors(); - std::string msg = "Can not find [" + var + "] in text kernels"; + std::string msg = "Can not find [" + var.toStdString() + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp index 0804c5b4f6..b78d4d2253 100644 --- a/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp +++ b/isis/src/base/objs/PvlEditDialog/PvlEditDialog.cpp @@ -119,7 +119,7 @@ namespace Isis { catch(IException &e) { // catch errors in Pvl format when populating pvl object std::string message = e.toString(); - QMessageBox::warning((QWidget *)parent(), "Error", message); + QMessageBox::warning((QWidget *)parent(), "Error",QString::fromStdString(message)); return; } @@ -140,7 +140,7 @@ namespace Isis { catch(IException &e) { // report exception(s) to mesage box std::string message = e.toString(); - QMessageBox::warning((QWidget *)parent(), "Error", message); + QMessageBox::warning((QWidget *)parent(), "Error", QString::fromStdString(message)); return; } } diff --git a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp index 47d5319b4b..6bf7ccc532 100644 --- a/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp +++ b/isis/src/base/objs/PvlFlatMap/PvlFlatMap.cpp @@ -577,11 +577,11 @@ namespace Isis { const int &index) const { QMap::const_iterator k = find(key.toLower()); if (end() == k) { - std::string mess = "Keyword " + key + " does not exist!"; + std::string mess = "Keyword " + key.toStdString() + " does not exist!"; throw IException(IException::Programmer, mess, _FILEINFO_); } if (index >= k.value().size()) { - std::string mess = "Index " + toString(index) + " does not exist for keyword " + key + "!"; + std::string mess = "Index " + toString(index) + " does not exist for keyword " + key.toStdString() + "!"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -660,7 +660,7 @@ namespace Isis { PvlKeyword PvlFlatMap::keyword(const QString &key) const { QMap::const_iterator k = find(key.toLower()); if (end() == k) { - std::string mess = "Keyword " + key + " does not exist!"; + std::string mess = "Keyword " + key.toStdString() + " does not exist!"; throw IException(IException::Programmer, mess, _FILEINFO_); } return (k.value()); diff --git a/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp b/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp index c42203c8d4..e6824128e3 100644 --- a/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp +++ b/isis/src/base/objs/PvlToJSON/PvlToJSON.cpp @@ -366,7 +366,7 @@ namespace Isis { pvl.read(pvlFile.toStdString()); } catch (IException &e){ - std::string msg = QString("Failed to open file for PVL Input: [%1]").arg(pvlFile); + std::string msg = "Failed to open file for PVL Input: [" + pvlFile.toStdString() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/QtExporter/QtExporter.cpp b/isis/src/base/objs/QtExporter/QtExporter.cpp index 9db60d3980..7eb378aaea 100644 --- a/isis/src/base/objs/QtExporter/QtExporter.cpp +++ b/isis/src/base/objs/QtExporter/QtExporter.cpp @@ -61,7 +61,7 @@ namespace Isis { // the Qt exporter only exports unsigned byte if (desc.pixelType() != UnsignedByte) { std::string msg = "Invalid pixel type. The Qt exporter for file type ["; - msg += m_format; + msg += m_format.toStdString(); msg += "] requires an unsigned byte (i.e. 8BIT) output."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Resource/Resource.cpp b/isis/src/base/objs/Resource/Resource.cpp index fbf2747eec..8da6918e69 100644 --- a/isis/src/base/objs/Resource/Resource.cpp +++ b/isis/src/base/objs/Resource/Resource.cpp @@ -504,7 +504,7 @@ namespace Isis { QVariant Resource::asset(const QString &assetName) const { if ( !hasAsset(assetName) ) { throw IException(IException::Programmer, - "Requested asset " + assetName + " does not exist.", + "Requested asset " + assetName.toStdString() + " does not exist.", _FILEINFO_); } return ( m_data->m_assets.value(assetName.toLower()) ); diff --git a/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp b/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp index c6088668d5..8e5795c5e8 100644 --- a/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp +++ b/isis/src/base/objs/SerialNumberList/SerialNumberList.cpp @@ -64,7 +64,7 @@ namespace Isis { } } catch (IException &e) { - std::string msg = "Can't open or invalid file list [" + listfile + "]."; + std::string msg = "Can't open or invalid file list [" + listfile.toStdString() + "]."; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -138,13 +138,13 @@ namespace Isis { } else { std::string msg = "Unable to find Instrument or Mapping group in " - + filename + " for comparing target."; + + filename.toStdString() + " for comparing target."; throw IException(IException::User, msg, _FILEINFO_); } } else { // No Instrument group - std::string msg = "Unable to find Instrument group in " + filename + std::string msg = "Unable to find Instrument group in " + filename.toStdString() + " for comparing target."; throw IException(IException::User, msg, _FILEINFO_); } @@ -155,8 +155,8 @@ namespace Isis { m_target = target; } else if (m_target != target) { - std::string msg = "Target name of [" + target + "] from file [" - + filename + "] does not match [" + m_target + "]."; + std::string msg = "Target name of [" + target.toStdString() + "] from file [" + + filename.toStdString() + "] does not match [" + m_target.toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -166,13 +166,13 @@ namespace Isis { QString on = ObservationNumber::Compose(p, def2filename); if (sn == "Unknown") { std::string msg = "Invalid serial number [Unknown] from file [" - + filename + "]."; + + filename.toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } else if (hasSerialNumber(sn)) { int index = serialNumberIndex(sn); - std::string msg = "Duplicate serial number [" + sn + "] from files [" - + SerialNumberList::fileName(sn) + "] and [" + fileName(index) + "]."; + std::string msg = "Duplicate serial number ["+ sn.toStdString() + "] from files [" + + SerialNumberList::fileName(sn).toStdString() + "] and [" + fileName(index).toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -267,7 +267,7 @@ namespace Isis { } else { std::string msg = "Unable to find Instrument or Mapping group in " - + filename + " for comparing target."; + + filename.toStdString() + " for comparing target."; throw IException(IException::User, msg, _FILEINFO_); } @@ -277,8 +277,8 @@ namespace Isis { m_target = target; } else if (m_target != target) { - std::string msg = "Target name of [" + target + "] from file [" - + filename + "] does not match [" + m_target + "]."; + std::string msg = "Target name of [" + target.toStdString() + "] from file [" + + filename.toStdString() + "] does not match [" + m_target.toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -286,14 +286,14 @@ namespace Isis { QString observationNumber = "Unknown"; if (serialNumber == "Unknown") { std::string msg = "Invalid serial number [Unknown] from file [" - + filename + "]."; + + filename.toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } else if (hasSerialNumber(serialNumber)) { int index = serialNumberIndex(serialNumber); - std::string msg = "Duplicate, serial number [" + serialNumber + "] from files [" - + SerialNumberList::fileName(serialNumber) - + "] and [" + fileName(index) + "]."; + std::string msg = "Duplicate, serial number [" + serialNumber.toStdString() + "] from files [" + + SerialNumberList::fileName(serialNumber).toStdString() + + "] and [" + fileName(index).toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -303,13 +303,13 @@ namespace Isis { // Need to obtain the SpacecraftName and InstrumentId from the Instrument // group for use in bundle adjustment if (!cubeObj.hasGroup("Instrument")) { - std::string msg = "Unable to find Instrument group in " + filename + std::string msg = "Unable to find Instrument group in " + filename.toStdString() + " needed for performing bundle adjustment."; throw IException(IException::User, msg, _FILEINFO_); } PvlGroup instGroup = cubeObj.findGroup("Instrument"); if (!instGroup.hasKeyword("SpacecraftName") || !instGroup.hasKeyword("InstrumentId")) { - std::string msg = "Unable to find SpacecraftName or InstrumentId keywords in " + filename + std::string msg = "Unable to find SpacecraftName or InstrumentId keywords in " + filename.toStdString() + " needed for performing bundle adjustment."; throw IException(IException::User, msg, _FILEINFO_); } @@ -318,7 +318,7 @@ namespace Isis { else { PvlGroup csmGroup = cubeObj.findGroup("CSMInfo"); if (!csmGroup.hasKeyword("CSMPlatformID") || !csmGroup.hasKeyword("CSMInstrumentId")) { - std::string msg = "Unable to find CSMPlatformID or CSMInstrumentId keywords in " + filename + std::string msg = "Unable to find CSMPlatformID or CSMInstrumentId keywords in " + filename.toStdString() + " needed for performing bundle adjustment."; throw IException(IException::User, msg, _FILEINFO_); } @@ -403,7 +403,7 @@ namespace Isis { } else { std::string msg = "Unable to get the FileName. The given serial number [" - + sn + "] does not exist in the list."; + + sn.toStdString() + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -493,7 +493,7 @@ namespace Isis { } else { std::string msg = "Unable to get the SerialNumber index. The given serial number [" - + sn + "] does not exist in the list."; + + sn.toStdString() + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -593,7 +593,7 @@ namespace Isis { } else { std::string msg = "Unable to get the Spacecraft InstrumentId. The given serial number [" - + sn + "] does not exist in the list."; + + sn.toStdString() + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -622,7 +622,7 @@ namespace Isis { } else { std::string msg = "Unable to get the possible serial numbers. The given observation number [" - + on + "] does not exist in the list."; + + on.toStdString() + "] does not exist in the list."; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/SessionLog/SessionLog.cpp b/isis/src/base/objs/SessionLog/SessionLog.cpp index 77bcdd14b9..54b81ef6a5 100644 --- a/isis/src/base/objs/SessionLog/SessionLog.cpp +++ b/isis/src/base/objs/SessionLog/SessionLog.cpp @@ -66,7 +66,7 @@ namespace Isis { } catch(...) { std::cerr << "**WARNING** Unable to write session log [" << - p_outputFile << "] Disk may be full or directory permissions not writeable" + p_outputFile.toStdString() << "] Disk may be full or directory permissions not writeable" << std::endl; exit(1); } diff --git a/isis/src/base/objs/SessionLog/SessionLog.h b/isis/src/base/objs/SessionLog/SessionLog.h index e10c919c2b..3a1a929cb0 100644 --- a/isis/src/base/objs/SessionLog/SessionLog.h +++ b/isis/src/base/objs/SessionLog/SessionLog.h @@ -7,6 +7,7 @@ find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include +#include #include "Pvl.h" #include "IException.h" diff --git a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp index 63a6871f56..075efb3779 100644 --- a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp +++ b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp @@ -146,11 +146,11 @@ namespace Isis { QString preferred = parameters.get("RayTraceEngine", "None").toLower(); QString onerror = parameters.get("OnError", "Continue").toLower(); - double tolerance = toDouble(parameters.get("Tolerance", toString(DBL_MAX))); + double tolerance = parameters.get("Tolerance", QString::number(DBL_MAX)).toDouble(); // A file error message will be appened to the finalError, if no shape model is constructed. - QString fileErrorMsg = "Invalid shape model file [" - + shapeModelFilenames + "] in Kernels group."; + std::string fileErrorMsg = "Invalid shape model file [" + + shapeModelFilenames.toStdString() + "] in Kernels group."; IException fileError(IException::Io, fileErrorMsg, _FILEINFO_); //-------------- Check for bullet engine first -------------------------------// @@ -171,7 +171,7 @@ namespace Isis { } // Always throw an error in this case - QString b_msg = "Bullet could not initialize DEM!"; + std::string b_msg = "Bullet could not initialize DEM!"; throw IException(IException::Unknown, b_msg, _FILEINFO_); } else { diff --git a/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp b/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp index eefe3e2899..8a909e7271 100644 --- a/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp +++ b/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp @@ -227,7 +227,7 @@ namespace Isis { double bestBand = -DBL_MAX; if (sectionNumber >= m_numSections) { - std::string msg = QObject::tr("Input section number is greater than total number of sections."); + std::string msg = "Input section number is greater than total number of sections."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Spice/LightTimeCorrectionState.cpp b/isis/src/base/objs/Spice/LightTimeCorrectionState.cpp index 97ea084355..1ddc139761 100644 --- a/isis/src/base/objs/Spice/LightTimeCorrectionState.cpp +++ b/isis/src/base/objs/Spice/LightTimeCorrectionState.cpp @@ -107,7 +107,7 @@ namespace Isis { bool LightTimeCorrectionState::checkAberrationCorrection(int ikCode, Spice *spice) { try { - QString ikernKey = "INS" + toString(ikCode) + "_LIGHTTIME_CORRECTION"; + QString ikernKey = "INS" + QString::number(ikCode) + "_LIGHTTIME_CORRECTION"; QString abcorr = spice->getString(ikernKey); m_abcorr = abcorr; return (true); @@ -255,7 +255,7 @@ namespace Isis { Spice *spice) { try { - QString ikernKey = "INS" + toString(ikCode) + "_SWAP_OBSERVER_TARGET"; + QString ikernKey = "INS" + QString::number(ikCode) + "_SWAP_OBSERVER_TARGET"; QString value = spice->getString(ikernKey).toUpper(); m_swapObserverTarget = ("TRUE" == value); } @@ -307,7 +307,7 @@ namespace Isis { Spice *spice) { try { - QString ikernKey = "INS" + toString(ikCode) + "_LT_SURFACE_CORRECT"; + QString ikernKey = "INS" + QString::number(ikCode) + "_LT_SURFACE_CORRECT"; QString value = spice->getString(ikernKey).toUpper(); m_sc_to_surf_ltcorr = ("TRUE" == value); } diff --git a/isis/src/base/objs/Spice/Spice.cpp b/isis/src/base/objs/Spice/Spice.cpp index 8eb64b2de0..1f8a5df4bf 100644 --- a/isis/src/base/objs/Spice/Spice.cpp +++ b/isis/src/base/objs/Spice/Spice.cpp @@ -307,7 +307,7 @@ namespace Isis { // Get target body code and radii and store them in the Naif group // DAC modified to look for and store body code so that the radii keyword name // will be able to be constructed even for new bodies not in the standard PCK yet. - QString radiiKey = "BODY" + Isis::toString(m_target->naifBodyCode()) + "_RADII"; + QString radiiKey = "BODY" + QString::number(m_target->naifBodyCode()) + "_RADII"; QVariant result = m_target->naifBodyCode(); storeValue("BODY_CODE", 0, SpiceIntType, result); std::vector radii(3,Distance()); @@ -357,7 +357,7 @@ namespace Isis { namfrm_c(naifTarget.toLatin1().data(), &frameCode); if (frameCode == 0) { std::string msg = "Can not find NAIF BODY_FRAME_CODE for target [" - + m_target->name() + "]"; + + m_target->name().toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -409,10 +409,10 @@ namespace Isis { solarLongitude(); } else if (QString::fromStdString(kernels["TargetPosition"][0]).toUpper() == "TABLE") { - Table t("SunPosition", QString::fromStdString(lab.fileName()), lab); + Table t("SunPosition", lab.fileName(), lab); m_sunPosition->LoadCache(t); - Table t2("BodyRotation", QString::fromStdString(lab.fileName()), lab); + Table t2("BodyRotation", lab.fileName(), lab); m_bodyRotation->LoadCache(t2); if (t2.Label().hasKeyword("SolarLongitude")) { *m_solarLongitude = Longitude(t2.Label()["SolarLongitude"], @@ -453,7 +453,7 @@ namespace Isis { } } else if (QString::fromStdString(kernels["InstrumentPointing"][0]).toUpper() == "TABLE") { - Table t("InstrumentPointing", QString::fromStdString(lab.fileName()), lab); + Table t("InstrumentPointing", lab.fileName(), lab); m_instrumentRotation->LoadCache(t); } @@ -468,7 +468,7 @@ namespace Isis { m_instrumentPosition->LoadCache(isd["instrument_position"]); } else if (QString::fromStdString(kernels["InstrumentPosition"][0]).toUpper() == "TABLE") { - Table t("InstrumentPosition", QString::fromStdString(lab.fileName()), lab); + Table t("InstrumentPosition", lab.fileName(), lab); m_instrumentPosition->LoadCache(t); } NaifStatus::CheckErrors(); @@ -1064,7 +1064,7 @@ namespace Isis { iTime result; - QString key = "CLOCK_ET_" + Isis::toString(sclkCode) + "_" + clockValue; + QString key = "CLOCK_ET_" + QString::number(sclkCode) + "_" + clockValue; QVariant storedClockTime = getStoredResult(key, SpiceDoubleType); if (storedClockTime.isNull()) { @@ -1136,11 +1136,11 @@ namespace Isis { } if (!found) { - std::string msg = "Can not find [" + key + "] in text kernels"; + std::string msg = "Can not find [" + key.toStdString() + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } else if (numValuesRead == 0){ - std::string msg = "Found " + key + "] in text kernels, but no values were identified and read."; + std::string msg = "Found " + key.toStdString() + "] in text kernels, but no values were identified and read."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1152,7 +1152,7 @@ namespace Isis { result = readStoredValue(key, type, index); if (result.isNull()) { - std::string msg = "The camera is requesting spice data [" + key + "] that " + std::string msg = "The camera is requesting spice data [" + key.toStdString() + "] that " "was not attached, please re-run spiceinit"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -1223,7 +1223,7 @@ namespace Isis { storedKey[index] = std::to_string(value.toInt()); } else { - std::string msg = "Unable to store variant in labels for key [" + key + "]"; + std::string msg = "Unable to store variant in labels for key [" + key.toStdString() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/SpicePosition/SpicePosition.cpp b/isis/src/base/objs/SpicePosition/SpicePosition.cpp index 2272c6125b..ff1a47832c 100644 --- a/isis/src/base/objs/SpicePosition/SpicePosition.cpp +++ b/isis/src/base/objs/SpicePosition/SpicePosition.cpp @@ -195,7 +195,7 @@ namespace Isis { p_aberrationCorrection = abcorr; } else { - std::string msg = "Invalid abberation correction [" + correction + "]"; + std::string msg = "Invalid abberation correction [" + correction.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp index a1407b3352..8e1bbfae68 100644 --- a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp +++ b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp @@ -119,7 +119,7 @@ namespace Isis { m_orientation = NULL; // Determine the axis for the velocity vector - QString key = "INS" + toString(frameCode) + "_TRANSX"; + QString key = "INS" + QString::number(frameCode) + "_TRANSX"; SpiceDouble transX[2]; SpiceInt number; SpiceBoolean found; @@ -127,7 +127,7 @@ namespace Isis { gdpool_c(key.toLatin1().data(), 1, 2, &number, transX, &found); if (!found) { - std::string msg = "Cannot find [" + key + "] in text kernels"; + std::string msg = "Cannot find [" + key.toStdString() + "] in text kernels"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -993,7 +993,7 @@ namespace Isis { // added, this case is not being used in the pck file. It is mentioned in the Naif required // reading file, pck.req, as a possibility for future pck files. // Look for a reference frame keyword for the body. The default is J2000. - QString naifKeyword = "BODY" + toString(centerBodyCode) + "_CONSTANTS_REF_FRAME" ; + QString naifKeyword = "BODY" + QString::number(centerBodyCode) + "_CONSTANTS_REF_FRAME" ; SpiceInt numExpected; SpiceInt numReturned; SpiceChar naifType; @@ -1012,7 +1012,7 @@ namespace Isis { // Make sure the standard coefficients are available for the body code by // checking for ra - naifKeyword = "BODY" + toString(centerBodyCode) + "_POLE_RA" ; + naifKeyword = "BODY" + QString::number(centerBodyCode) + "_POLE_RA" ; dtpool_c(naifKeyword.toLatin1().data(), &found, &numExpected, &naifType); if (found) { @@ -1041,13 +1041,13 @@ namespace Isis { // Now check for nutation/precession terms. Check for nut/prec ra values // first to see if the terms are even used for this body. - naifKeyword = "BODY" + toString(centerBodyCode) + "_NUT_PREC_RA" ; + naifKeyword = "BODY" + QString::number(centerBodyCode) + "_NUT_PREC_RA" ; dtpool_c(naifKeyword.toLatin1().data(), &found, &numReturned, &naifType); if (found) { // Get the barycenter (bc) linear coefficients first (2 for each period). // Then we can get the maximum expected coefficients. SpiceInt bcCode = centerBodyCode/100; // Ex: bc code for Jupiter (599) & its moons is 5 - naifKeyword = "BODY" + toString(bcCode) + "_NUT_PREC_ANGLES" ; + naifKeyword = "BODY" + QString::number(bcCode) + "_NUT_PREC_ANGLES" ; dtpool_c(naifKeyword.toLatin1().data(), &found, &numExpected, &naifType); std::vectornpAngles(numExpected, 0.); bodvcd_c(bcCode, "NUT_PREC_ANGLES", numExpected, &numReturned, &npAngles[0]); diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp index 017f03bb5a..8454144aae 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp +++ b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp @@ -51,7 +51,7 @@ namespace Isis { while (xmlReader->readNextStartElement()) { if (xmlReader->qualifiedName() == "numberCells") { try { - m_numberCells = toDouble(xmlReader->readElementText()); + m_numberCells = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_numberCells = 0.0; @@ -59,7 +59,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "numberQuantiles") { try { - m_numberQuantiles = toDouble(xmlReader->readElementText()); + m_numberQuantiles = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_numberQuantiles = 0.0; @@ -67,7 +67,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "numberObservations") { try { - m_numberObservations = toDouble(xmlReader->readElementText()); + m_numberObservations = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_numberObservations = 0.0; @@ -552,19 +552,19 @@ namespace Isis { void StatCumProbDistDynCalc::save(QXmlStreamWriter &stream, const Project *project) const { // TODO: does xml stuff need project??? stream.writeStartElement("statCumProbDistDynCalc"); - stream.writeTextElement("numberCells", toString(m_numberCells)); - stream.writeTextElement("numberQuantiles", toString(m_numberQuantiles)); - stream.writeTextElement("numberObservations", toString(m_numberObservations)); + stream.writeTextElement("numberCells", QString::number(m_numberCells)); + stream.writeTextElement("numberQuantiles", QString::number(m_numberQuantiles)); + stream.writeTextElement("numberObservations", QString::number(m_numberObservations)); stream.writeStartElement("distributionData"); for (unsigned int i = 0; i < m_numberQuantiles; i++) { stream.writeStartElement("quantileInfo"); // we need to write out high precision for minDistance calculations in value() and cumProb() - stream.writeAttribute("quantile", toString(m_quantiles[i], 17)); - stream.writeAttribute("dataValue", toString(m_observationValues[i], 17)); + stream.writeAttribute("quantile", QString::number(m_quantiles[i], 'g', 17)); + stream.writeAttribute("dataValue", QString::number(m_observationValues[i], 'g', 17)); stream.writeAttribute("idealNumObsBelowQuantile", - toString(m_idealNumObsBelowQuantile[i])); - stream.writeAttribute("actualNumObsBelowQuantile", toString(m_numObsBelowQuantile[i])); + QString::number(m_idealNumObsBelowQuantile[i])); + stream.writeAttribute("actualNumObsBelowQuantile", QString::number(m_numObsBelowQuantile[i])); stream.writeEndElement(); // end observation } stream.writeEndElement(); // end observationData diff --git a/isis/src/base/objs/Statistics/Statistics.cpp b/isis/src/base/objs/Statistics/Statistics.cpp index cb23695d3d..f20a203e79 100644 --- a/isis/src/base/objs/Statistics/Statistics.cpp +++ b/isis/src/base/objs/Statistics/Statistics.cpp @@ -44,7 +44,7 @@ namespace Isis { while (xmlReader->readNextStartElement()) { if (xmlReader->qualifiedName() == "sum") { try { - m_sum = toDouble(xmlReader->readElementText()); + m_sum = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_sum = 0.0; @@ -52,7 +52,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "sumSquares") { try { - m_sumsum = toDouble(xmlReader->readElementText()); + m_sumsum = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_sumsum = 0.0; @@ -62,7 +62,7 @@ namespace Isis { while (xmlReader->readNextStartElement()) { if (xmlReader->qualifiedName() == "minimum") { try { - m_minimum = toDouble(xmlReader->readElementText()); + m_minimum = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_minimum = DBL_MAX; @@ -70,7 +70,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "maximum") { try { - m_maximum = toDouble(xmlReader->readElementText()); + m_maximum = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_maximum = -DBL_MAX; @@ -78,7 +78,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "validMinimum") { try { - m_validMinimum = toDouble(xmlReader->readElementText()); + m_validMinimum = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_validMinimum = Isis::ValidMinimum; @@ -86,7 +86,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "validMaximum") { try { - m_validMaximum = toDouble(xmlReader->readElementText()); + m_validMaximum = xmlReader->readElementText().toDouble(); } catch (IException &e) { m_validMaximum = Isis::ValidMaximum; @@ -101,7 +101,7 @@ namespace Isis { while (xmlReader->readNextStartElement()) { if (xmlReader->qualifiedName() == "totalPixels") { try { - m_totalPixels = toBigInt(xmlReader->readElementText()); + m_totalPixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_totalPixels = 0.0; @@ -109,7 +109,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "validPixels") { try { - m_validPixels = toBigInt(xmlReader->readElementText()); + m_validPixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_validPixels = 0.0; @@ -117,7 +117,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "nullPixels") { try { - m_nullPixels = toBigInt(xmlReader->readElementText()); + m_nullPixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_nullPixels = 0.0; @@ -126,7 +126,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "lisPixels") { try { - m_lisPixels = toBigInt(xmlReader->readElementText()); + m_lisPixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_lisPixels = 0.0; @@ -134,7 +134,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "lrsPixels") { try { - m_lrsPixels = toBigInt(xmlReader->readElementText()); + m_lrsPixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_lrsPixels = 0.0; @@ -142,7 +142,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "hisPixels") { try { - m_hisPixels = toBigInt(xmlReader->readElementText()); + m_hisPixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_hisPixels = 0.0; @@ -150,7 +150,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "hrsPixels") { try { - m_hrsPixels = toBigInt(xmlReader->readElementText()); + m_hrsPixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_hrsPixels = 0.0; @@ -158,7 +158,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "underRangePixels") { try { - m_underRangePixels = toBigInt(xmlReader->readElementText()); + m_underRangePixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_underRangePixels = 0.0; @@ -166,7 +166,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "overRangePixels") { try { - m_overRangePixels = toBigInt(xmlReader->readElementText()); + m_overRangePixels = toBigInt(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_overRangePixels = 0.0; @@ -179,7 +179,7 @@ namespace Isis { } else if (xmlReader->qualifiedName() == "removedData") { try { - m_removedData = toBool(xmlReader->readElementText()); + m_removedData = toBool(xmlReader->readElementText().toStdString()); } catch (IException &e) { m_removedData = false; @@ -878,29 +878,29 @@ namespace Isis { stream.writeStartElement("statistics"); // stream.writeTextElement("id", m_id->std::to_string()); - stream.writeTextElement("sum", toString(m_sum)); - stream.writeTextElement("sumSquares", toString(m_sumsum)); + stream.writeTextElement("sum", QString::number(m_sum)); + stream.writeTextElement("sumSquares", QString::number(m_sumsum)); stream.writeStartElement("range"); - stream.writeTextElement("minimum", toString(m_minimum)); - stream.writeTextElement("maximum", toString(m_maximum)); - stream.writeTextElement("validMinimum", toString(m_validMinimum)); - stream.writeTextElement("validMaximum", toString(m_validMaximum)); + stream.writeTextElement("minimum", QString::number(m_minimum)); + stream.writeTextElement("maximum", QString::number(m_maximum)); + stream.writeTextElement("validMinimum", QString::number(m_validMinimum)); + stream.writeTextElement("validMaximum", QString::number(m_validMaximum)); stream.writeEndElement(); // end range stream.writeStartElement("pixelCounts"); - stream.writeTextElement("totalPixels", toString(m_totalPixels)); - stream.writeTextElement("validPixels", toString(m_validPixels)); - stream.writeTextElement("nullPixels", toString(m_nullPixels)); - stream.writeTextElement("lisPixels", toString(m_lisPixels)); - stream.writeTextElement("lrsPixels", toString(m_lrsPixels)); - stream.writeTextElement("hisPixels", toString(m_hisPixels)); - stream.writeTextElement("hrsPixels", toString(m_hrsPixels)); - stream.writeTextElement("underRangePixels", toString(m_underRangePixels)); - stream.writeTextElement("overRangePixels", toString(m_overRangePixels)); + stream.writeTextElement("totalPixels", QString::number(m_totalPixels)); + stream.writeTextElement("validPixels", QString::number(m_validPixels)); + stream.writeTextElement("nullPixels", QString::number(m_nullPixels)); + stream.writeTextElement("lisPixels", QString::number(m_lisPixels)); + stream.writeTextElement("lrsPixels", QString::number(m_lrsPixels)); + stream.writeTextElement("hisPixels", QString::number(m_hisPixels)); + stream.writeTextElement("hrsPixels", QString::number(m_hrsPixels)); + stream.writeTextElement("underRangePixels", QString::number(m_underRangePixels)); + stream.writeTextElement("overRangePixels", QString::number(m_overRangePixels)); stream.writeEndElement(); // end pixelCounts - stream.writeTextElement("removedData", toString(m_removedData)); + stream.writeTextElement("removedData", QString::number(m_removedData)); stream.writeEndElement(); // end statistics } diff --git a/isis/src/base/objs/Strategy/Strategy.cpp b/isis/src/base/objs/Strategy/Strategy.cpp index 5ff342db0c..0a29255974 100644 --- a/isis/src/base/objs/Strategy/Strategy.cpp +++ b/isis/src/base/objs/Strategy/Strategy.cpp @@ -80,8 +80,8 @@ namespace Isis { PvlFlatMap parms(getDefinitionMap()); m_name = parms.get("Name"); m_type = parms.get("Type"); - m_applyDiscarded = toBool(parms.get("ApplyToDiscarded", "false")); - m_debug = toBool(parms.get("Debug", "false")); + m_applyDiscarded = toBool(parms.get("ApplyToDiscarded", "false").toStdString()); + m_debug = toBool(parms.get("Debug", "false").toStdString()); initProgress(); } @@ -717,7 +717,7 @@ namespace Isis { geom = resource->value(giskey); // Erase key if requested - if ( toBool(keys.get("RemoveGisKeywordAfterImport", "false")) ) { + if ( toBool(keys.get("RemoveGisKeywordAfterImport", "false").toStdString()) ) { resource->erase(giskey); } } @@ -820,7 +820,7 @@ namespace Isis { getGlobals(resource, globals), ""); if ( !gisTolerance.isEmpty() ) { - tolerance = toDouble(gisTolerance); + tolerance = gisTolerance.toDouble(); GisGeometry *simple = geosgeom->simplify(tolerance); if ( 0 != simple ) geosgeom.reset(simple); npoints = geosgeom->points(); @@ -833,14 +833,14 @@ namespace Isis { getGlobals(resource, globals), ""); if ( !pointsKey.isEmpty() ) { - resource->add(pointsKey, toString(npoints)); - resource->add(pointsKey+"Original", toString(npointsOrg)); - resource->add(pointsKey+"Tolerance", toString(tolerance)); + resource->add(pointsKey, QString::number(npoints)); + resource->add(pointsKey+"Original", QString::number(npointsOrg)); + resource->add(pointsKey+"Tolerance", QString::number(tolerance)); } // Status if requested if ( isDebug() ) { - cout << " " << type() << ":" << name() << " has a geometry with " + cout << " " << type().toStdString() << ":" << name().toStdString() << " has a geometry with " << npoints << " points!\n"; if ( npoints != npointsOrg ) { cout << " Geometry has been simplified/reduced from original " @@ -853,7 +853,7 @@ namespace Isis { // Report geometry status if ( isDebug() ) { - cout << " " << type() << ":" << name() << " does not have a geometry!\n"; + cout << " " << type().toStdString() << ":" << name().toStdString() << " does not have a geometry!\n"; } return (false); @@ -1005,7 +1005,7 @@ namespace Isis { // The programmer is required to ensure a valid geometry provides the // source of the intersection operation. if ( !geom.isValid() ) { - std::string mess = type() + ":" + name() + + std::string mess = type().toStdString() + ":" + name().toStdString() + "Cannot apply RTree search to bad geometry."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -1177,7 +1177,7 @@ namespace Isis { // Check for initialization if ( !doShowProgress() ) { PvlFlatMap p_var( getDefinitionMap() ); - if ( toBool(p_var.get("ShowProgress", "false")) ) { + if ( toBool(p_var.get("ShowProgress", "false").toStdString()) ) { m_progress.reset( new Progress() ); if ( p_text.isEmpty() ) { p_text = type() + "::" + name(); diff --git a/isis/src/base/objs/Stretch/Stretch.cpp b/isis/src/base/objs/Stretch/Stretch.cpp index c72a7b9894..96f0d22210 100644 --- a/isis/src/base/objs/Stretch/Stretch.cpp +++ b/isis/src/base/objs/Stretch/Stretch.cpp @@ -157,8 +157,8 @@ namespace Isis { QStringList firstPairValues = firstPair.split(":"); if (firstPairValues.count() == 2) { - io.first = toDouble(firstPairValues.first()); - io.second = toDouble(firstPairValues.last()); + io.first = firstPairValues.first().toDouble(); + io.second = firstPairValues.last().toDouble(); pairs = pairList.join(" "); } @@ -198,7 +198,7 @@ namespace Isis { } } catch(IException &e) { - throw IException(e, IException::User, "Invalid stretch pairs [" + pairs + "]", _FILEINFO_); + throw IException(e, IException::User, "Invalid stretch pairs [" + pairs.toStdString() + "]", _FILEINFO_); } } @@ -255,7 +255,7 @@ namespace Isis { catch(IException &e) { throw IException(e, IException::User, "Invalid stretch pairs [" + - pairs + "]", _FILEINFO_); + pairs.toStdString() + "]", _FILEINFO_); } } @@ -271,7 +271,7 @@ namespace Isis { QString p(""); for(int i = 0; i < p_pairs; i++) { - p += toString(p_input[i]) + ":" + toString(p_output[i]) + " "; + p += QString::number(p_input[i]) + ":" + QString::number(p_output[i]) + " "; } return p.trimmed(); } diff --git a/isis/src/base/objs/SurfacePoint/SurfacePoint.cpp b/isis/src/base/objs/SurfacePoint/SurfacePoint.cpp index bfada83988..d02b65ce88 100644 --- a/isis/src/base/objs/SurfacePoint/SurfacePoint.cpp +++ b/isis/src/base/objs/SurfacePoint/SurfacePoint.cpp @@ -1369,7 +1369,7 @@ namespace Isis { } else { throw IException(IException::Programmer, - "Unknown coordinate type for a SurfacePoint [" + type + "].", + "Unknown coordinate type for a SurfacePoint [" + type.toStdString() + "].", _FILEINFO_); } } diff --git a/isis/src/base/objs/Target/Target.cpp b/isis/src/base/objs/Target/Target.cpp index 8b42abc7ce..c74c2827af 100644 --- a/isis/src/base/objs/Target/Target.cpp +++ b/isis/src/base/objs/Target/Target.cpp @@ -273,7 +273,7 @@ namespace Isis { SpiceBoolean found; bodn2c_c(name.toLatin1().data(), &code, &found); if (!found) { - std::string msg = "Could not convert Target [" + name + + std::string msg = "Could not convert Target [" + name.toStdString() + "] to NAIF body code"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -406,7 +406,7 @@ namespace Isis { // If we get this far, we know the cube has no NaifKeywords object and previous attempts to // find radii in the mapping group or using spice IDs have failed - std::string msg = "Unable to find Equatorial and Polar radii for target [" + target + "]."; + std::string msg = "Unable to find Equatorial and Polar radii for target [" + target.toStdString() + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -447,7 +447,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Unable to find target radii for given target [" - + target + "]."; + + target.toStdString() + "]."; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/TextFile/TextFile.cpp b/isis/src/base/objs/TextFile/TextFile.cpp index abe1595104..2eeba6910e 100644 --- a/isis/src/base/objs/TextFile/TextFile.cpp +++ b/isis/src/base/objs/TextFile/TextFile.cpp @@ -225,7 +225,7 @@ namespace Isis { // Don't open if it already is if(p_stream.is_open()) { std::string message = "TextFile:Open:-> Already opened with this object: [" - + QString(openmode) + "]:[" + p_filename + "]"; + + (std::string)openmode + "]:[" + p_filename.toStdString() + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -255,7 +255,7 @@ namespace Isis { } else { std::string message = "TextFile::-> Unknown openmode: (input, output, overwrite, append):[" - + QString(openmode) + "]:[" + p_filename + "]"; + + (std::string)openmode+ "]:[" + p_filename.toStdString() + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -268,7 +268,7 @@ namespace Isis { // first check if file already exists if(filenameTmp.fileExists() && QFileInfo(QString::fromStdString(filenameTmp.toString())).size() > 0) { std::string message = "TextFile:Open: -> Output file already exists [" - + QString(openmode) + "]:[" + p_filename + "]"; + + (std::string)openmode + "]:[" + p_filename.toStdString() + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -292,7 +292,7 @@ namespace Isis { if(!p_stream.is_open()) { std::string message = "TextFile:Open:-> Unable to open: [" - + QString(openmode) + "]:[" + p_filename + "]"; + + (std::string)openmode + "]:[" + p_filename.toStdString() + "]"; throw IException(IException::Io, message, _FILEINFO_); } } @@ -303,7 +303,7 @@ namespace Isis { } else { if(bailIfNotOpen) { - std::string message = "TextFile::-> File not open: [" + p_filename + "]"; + std::string message = "TextFile::-> File not open: [" + p_filename.toStdString() + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } else { @@ -478,7 +478,7 @@ namespace Isis { if(!p_stream.good()) { line = ""; std::string message = "TextFile:GetLine: -> Error reading text file: [" - + p_filename + "]"; + + p_filename.toStdString() + "]"; throw IException(IException::Io, message, _FILEINFO_); } @@ -522,18 +522,18 @@ namespace Isis { OpenChk(true); // Try to write the next line - p_stream << line << p_newLineString; + p_stream << line << p_newLineString.toStdString(); // See if an error occured if(!p_stream.good()) { if(p_openmode != 1) { std::string message = "TextFile:PutLine: -> Error writing text file: [" - + p_filename + "]"; + + p_filename.toStdString() + "]"; throw IException(IException::Io, message, _FILEINFO_); } else { std::string message = "TextFile:PutLine: -> Attempt to write to INPUT - Read Only text file: [" - + p_filename + "]"; + + p_filename.toStdString() + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } } diff --git a/isis/src/base/objs/TiffExporter/TiffExporter.cpp b/isis/src/base/objs/TiffExporter/TiffExporter.cpp index d97268ae3a..7f5f3f4c1d 100644 --- a/isis/src/base/objs/TiffExporter/TiffExporter.cpp +++ b/isis/src/base/objs/TiffExporter/TiffExporter.cpp @@ -100,7 +100,7 @@ namespace Isis { TIFFSetField(m_image, TIFFTAG_COMPRESSION, COMPRESSION_NONE); } else { - std::string msg = "Invalid TIFF compression algorithm: " + compression; + std::string msg = "Invalid TIFF compression algorithm: " + compression.toStdString(); throw IException(IException::Programmer, msg, _FILEINFO_); } TIFFSetField(m_image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); diff --git a/isis/src/base/objs/TiffImporter/TiffImporter.cpp b/isis/src/base/objs/TiffImporter/TiffImporter.cpp index 7dd1cdaa57..c8be966799 100644 --- a/isis/src/base/objs/TiffImporter/TiffImporter.cpp +++ b/isis/src/base/objs/TiffImporter/TiffImporter.cpp @@ -35,8 +35,7 @@ namespace Isis { // Open the TIFF image m_image = NULL; if ((m_image = XTIFFOpen(inputName.expanded().c_str(), "r")) == NULL) { - throw IException(IException::Programmer, - QString("Could not open TIFF image [") + inputName.expanded().c_str() + "]", _FILEINFO_); + throw IException(IException::Programmer, "Could not open TIFF image [" + inputName.expanded() + "]", _FILEINFO_); } // Get its constant dimensions. Note, height seems to get reset to 0 if diff --git a/isis/src/base/objs/UniversalGroundMap/UniversalGroundMap.cpp b/isis/src/base/objs/UniversalGroundMap/UniversalGroundMap.cpp index 83b4940754..31673b02e0 100644 --- a/isis/src/base/objs/UniversalGroundMap/UniversalGroundMap.cpp +++ b/isis/src/base/objs/UniversalGroundMap/UniversalGroundMap.cpp @@ -54,7 +54,7 @@ namespace Isis { catch (IException &secondError) { p_projection = NULL; std::string msg = "Could not create camera or projection for [" + - cube.fileName() + "]"; + cube.fileName().toStdString() + "]"; IException realError(IException::Unknown, msg, _FILEINFO_); realError.append(firstError); realError.append(secondError); diff --git a/isis/src/base/objs/UserInterface/UserInterface.cpp b/isis/src/base/objs/UserInterface/UserInterface.cpp index 0a7538b265..350cdf6547 100644 --- a/isis/src/base/objs/UserInterface/UserInterface.cpp +++ b/isis/src/base/objs/UserInterface/UserInterface.cpp @@ -152,7 +152,7 @@ namespace Isis { } //Load the new parameters into the gui - cout << p_progName << " "; + cout << p_progName.toStdString() << " "; for (unsigned int currArgument = 1; currArgument < p_cmdline.size(); currArgument ++) { QString paramName; @@ -166,8 +166,8 @@ namespace Isis { continue; for (unsigned int value = 0; value < paramValue.size(); value++) { - IString thisValue = paramValue[value]; - QString token = thisValue.Token("$").ToQt(); + IString thisValue = paramValue[value].toStdString(); + QString token = QString::fromStdString(thisValue.Token("$")); QString newValue; @@ -177,12 +177,12 @@ namespace Isis { int j = toInt( thisValue.substr(0, 1).c_str() ) - 1; newValue += p_batchList[i][j]; thisValue.replace(0, 1, ""); - token = thisValue.Token("$").ToQt(); + token = QString::fromStdString(thisValue.Token("$")); } catch (IException &e) { // Let the variable be parsed by the application newValue += "$"; - token = thisValue.Token("$").ToQt(); + token = QString::fromStdString(thisValue.Token("$")); } } @@ -199,10 +199,10 @@ namespace Isis { PutAsString(paramName, paramValue); - cout << paramName; + cout << paramName.toStdString(); if(paramValue.size() == 1) { - cout << "=" << paramValue[0] << " "; + cout << "=" << paramValue[0].toStdString() << " "; } else if (paramValue.size() > 1) { cout << "=("; @@ -211,7 +211,7 @@ namespace Isis { if(value != 0) cout << ","; - cout << paramValue[value] << endl; + cout << paramValue[value].toStdString() << endl; } cout << ") "; @@ -242,13 +242,13 @@ namespace Isis { // did not unit test since it is assumed ofstream will be instantiated correctly if ( !os.good() ) { - std::string msg = "Unable to create error list [" + p_errList + std::string msg = "Unable to create error list [" + p_errList.toStdString() + "] Disk may be full or directory permissions not writeable"; throw IException(IException::User, msg, _FILEINFO_); } for (int j = 0; j < (int) p_batchList[i].size(); j++) { - os << p_batchList[i][j] << " "; + os << p_batchList[i][j].toStdString() << " "; } os << endl; @@ -329,28 +329,28 @@ namespace Isis { temp.Open(file); } catch (IException &e) { - std::string msg = "The batchlist file [" + file + "] could not be opened"; + std::string msg = "The batchlist file [" + file.toStdString() + "] could not be opened"; throw IException(IException::User, msg, _FILEINFO_); } p_batchList.resize( temp.LineCount() ); for (int i = 0; i < temp.LineCount(); i++) { - QString t; - temp.GetLine(t); + IString t; + temp.GetLine(toBool(t)); // Convert tabs to spaces but leave tabs inside quotes alone - t = IString(t).Replace("\t", " ", true).ToQt(); + t = t.Replace("\t", " ", true); - t = IString(t).Compress().ToQt().trimmed(); + t = QString::fromStdString(t.Compress()).trimmed().toStdString(); // Allow " ," " , " or ", " as a valid single seperator - t = IString(t).Replace(" ,", ",", true).ToQt(); - t = IString(t).Replace(", ", ",", true).ToQt(); + t = t.Replace(" ,", ",", true); + t = t.Replace(", ", ",", true); // Convert all spaces to "," the use "," as delimiter - t = IString(t).Replace(" ", ",", true).ToQt(); + t = t.Replace(" ", ",", true); int j = 0; - QStringList tokens = t.split(","); + QStringList tokens = QString::fromStdString(t).split(","); foreach (QString token, tokens) { // removes quotes from tokens. NOTE: also removes escaped quotes. @@ -370,7 +370,7 @@ namespace Isis { } // The batchlist cannot be empty if (p_batchList.size() < 1) { - std::string msg = "The list file [" + file + "] does not contain any data"; + std::string msg = "The list file [" + file.toStdString() + "] does not contain any data"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -480,7 +480,7 @@ namespace Isis { if (paramValue.size() > 1) { std::string msg = "Invalid value for reserve parameter [" - + paramName + "]"; + + paramName.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -526,7 +526,7 @@ namespace Isis { if(usedDashLast) { Pvl temp; CommandLine(temp); - cout << BuildNewCommandLineFromPvl(temp) << endl; + cout << BuildNewCommandLineFromPvl(temp).toStdString() << endl; } // Can't use the batchlist with the gui, save, last or restore option @@ -639,13 +639,13 @@ namespace Isis { throw Isis::iException::Message( Isis::iException::User, msg, _FILEINFO_ );*/ } catch (...) { - std::string msg = "The history file [" + file + "] is for a different application or corrupt, "\ + std::string msg = "The history file [" + file.toStdString() + "] is for a different application or corrupt, "\ "please fix or delete this file"; throw IException(IException::User, msg, _FILEINFO_); } } else { - std::string msg = "The history file [" + file + "] does not exist"; + std::string msg = "The history file [" + file.toStdString() + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -880,7 +880,7 @@ namespace Isis { } } else if (name == "-PID") { - p_parentId = toInt(value); + p_parentId = value.toInt(); } else if (name == "-ERRLIST") { p_errList = value; @@ -904,7 +904,7 @@ namespace Isis { } else { - std::string msg = "[" + value + std::string msg = "[" + value.toStdString() + "] is an invalid value for -ONERROR, options are ABORT or CONTINUE"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1100,7 +1100,7 @@ namespace Isis { for (int strPos = 0; strPos < arrayString.size(); strPos++) { if (strPos == 0) { if (arrayString[strPos] != '(') { - std::string msg = "Invalid array format [" + arrayString + "]"; + std::string msg = "Invalid array format [" + arrayString.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1115,14 +1115,14 @@ namespace Isis { } // ends in a backslash?? else if (arrayString[strPos] == '\\') { - std::string msg = "Invalid array format [" + arrayString + "]"; + std::string msg = "Invalid array format [" + arrayString.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } // not in quoted part of QString if (!inDoubleQuotes && !inSingleQuotes) { if (arrayClosed) { - std::string msg = "Invalid array format [" + arrayString + "]"; + std::string msg = "Invalid array format [" + arrayString.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1187,7 +1187,7 @@ namespace Isis { } if (!arrayClosed || currElement != "") { - std::string msg = "Invalid array format [" + arrayString + "]"; + std::string msg = "Invalid array format [" + arrayString.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -1224,7 +1224,7 @@ namespace Isis { if ( reservedParams[option].startsWith(unresolvedParam) ) { if (matchOption >= 0) { std::string msg = "Ambiguous Reserve Parameter [" - + unresolvedParam + "]. Please clarify."; + + unresolvedParam.toStdString() + "]. Please clarify."; throw IException(IException::User, msg, _FILEINFO_); } // set match to current iteration in loop @@ -1236,9 +1236,9 @@ namespace Isis { // handle no matches if (matchOption < 0) { std::string msg = "Invalid Reserve Parameter Option [" - + unresolvedParam + "]. Choices are "; + + unresolvedParam.toStdString() + "]. Choices are "; - std::string msgOptions; + QString msgOptions; for (int option = 0; option < (int)reservedParams.size(); option++) { // Make sure not to show -PID as an option if (reservedParams[option].compare("-PID") == 0) { @@ -1258,7 +1258,7 @@ namespace Isis { // remove the terminating ',' from msgOptions msgOptions.chop(1); - msg += " [" + msgOptions + "]"; + msg += " [" + msgOptions.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/XmlToJson/XmlToJson.cpp b/isis/src/base/objs/XmlToJson/XmlToJson.cpp index 53afbbb0d0..081048014e 100644 --- a/isis/src/base/objs/XmlToJson/XmlToJson.cpp +++ b/isis/src/base/objs/XmlToJson/XmlToJson.cpp @@ -37,15 +37,15 @@ namespace Isis { QFile file(xmlFile); if (!file.open(QIODevice::ReadOnly)) { - std::string message = QString("Failed to open file for XML Input: [%1]").arg(xmlFile); + std::string message = "Failed to open file for XML Input: [" + xmlFile.toStdString() + "]"; throw IException(IException::Io, message, _FILEINFO_); } - std::string errMsg; + QString errMsg; int errLine, errCol; if (!doc.setContent(&file, &errMsg, &errLine, &errCol)) { file.close(); - std::string message = QString("Failed to use file for XML Input: [%1]. %2 at line %3, column %4").arg(xmlFile).arg(errMsg).arg(errLine).arg(errCol); + std::string message = "Failed to use file for XML Input: [" + xmlFile.toStdString() + "]. " + errMsg.toStdString() + " at line " + std::to_string(errLine) + ", column " + std::to_string(errCol); throw IException(IException::Io, message, _FILEINFO_); } diff --git a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp index 03cbaeb23a..28961555e1 100644 --- a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp +++ b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp @@ -218,7 +218,7 @@ namespace Isis { // Notify what we are translating and what the translating group is. if (isDebug) { cout << endl << " ==================== " << endl; - cout << endl << "Translating output keyword: " << translationGroupName << endl; + cout << endl << "Translating output keyword: " << translationGroupName.toStdString() << endl; cout << endl << "Translation group:" << endl; cout << transGroup << endl << endl; } @@ -228,7 +228,7 @@ namespace Isis { QString indent = ""; if (isDebug) { cout << endl << "Finding input element:" << endl << endl; - cout << inputParentElement.tagName() << endl; + cout << inputParentElement.tagName().toStdString() << endl; } // traverse the input position path Pvl::ConstPvlKeywordIterator it = transGroup.findKeyword("InputPosition", @@ -249,7 +249,7 @@ namespace Isis { } if (isDebug) { indent += " "; - cout << indent << inputParentElement.tagName() << endl; + cout << indent.toStdString() << inputParentElement.tagName().toStdString() << endl; } } if (!inputParentElement.isNull()) { @@ -263,7 +263,7 @@ namespace Isis { if (isDebug) { cout << endl << "Could not traverse input position, " << "using default value: " << - InputDefault(translationGroupName) << endl; + InputDefault(translationGroupName).toStdString() << endl; } return PvlTranslationTable::Translate( translationGroupName ); } @@ -278,7 +278,7 @@ namespace Isis { QDomElement inputKeyElement = inputParentElement.firstChildElement(inputKey); if (isDebug) { indent += " "; - cout << indent << inputKeyElement.tagName() << endl; + cout << indent.toStdString() << inputKeyElement.tagName().toStdString() << endl; } // Check dependencies @@ -305,7 +305,7 @@ namespace Isis { if ( hasInputDefault(translationGroupName) ) { if (isDebug) { cout << endl << "No input value found, using default value: " << - InputDefault(translationGroupName) << endl; + InputDefault(translationGroupName).toStdString() << endl; } return PvlTranslationTable::Translate( translationGroupName ); } @@ -326,24 +326,24 @@ namespace Isis { else if (hasInputDefault(translationGroupName) ) { if (isDebug) { cout << endl << "No input value found, using default value: " << - InputDefault(translationGroupName) << endl; + InputDefault(translationGroupName).toStdString() << endl; } return PvlTranslationTable::Translate( translationGroupName ); } else { - std::string msg = "Input element [" + inputKeyElement.tagName() + + std::string msg = "Input element [" + inputKeyElement.tagName().toStdString() + "] does not have an attribute named [" + - attributeName + "]."; + attributeName.toStdString() + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } } if (isDebug) { - cout << endl << "Translating input value: " << inputValue << endl; + cout << endl << "Translating input value: " << inputValue.toStdString() << endl; } return PvlTranslationTable::Translate( translationGroupName, inputValue.trimmed() ); } catch (IException &e){ - std::string msg = "Failed to translate output value for [" + translationGroupName + "]."; + std::string msg = "Failed to translate output value for [" + translationGroupName.toStdString() + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -386,9 +386,9 @@ namespace Isis { cout << endl << "Testing dependency number " << toString(i+1) << endl; cout << " Specification: " << dependencies[i] << endl; cout << endl; - cout << " Dependency type: " << specification[0] << endl; - cout << " Dependency name: " << specification[1] << endl; - cout << " Dependency value: " << specification[2] << endl; + cout << " Dependency type: " << specification[0].toStdString() << endl; + cout << " Dependency name: " << specification[1].toStdString() << endl; + cout << " Dependency value: " << specification[2].toStdString() << endl; } if (specification[0] == "att") { if ( element.hasAttributes() ) { @@ -396,8 +396,8 @@ namespace Isis { QString attributeValue = atts.namedItem(specification[1]).nodeValue(); if (isDebug) { cout << endl; - cout << " Attribute name: " << atts.namedItem(specification[1]).nodeName(); - cout << " Attribute value: " << attributeValue << endl; + cout << " Attribute name: " << atts.namedItem(specification[1]).nodeName().toStdString(); + cout << " Attribute value: " << attributeValue.toStdString() << endl; } if ( attributeValue != specification[2] ) { // attribute value does not match specification or @@ -416,8 +416,8 @@ namespace Isis { QString siblingValue = candidateSibling.text(); if (isDebug) { cout << endl; - cout << " Tag name: " << candidateSibling.tagName() << endl; - cout << " Tag value: " << siblingValue << endl; + cout << " Tag name: " << candidateSibling.tagName().toStdString() << endl; + cout << " Tag value: " << siblingValue.toStdString() << endl; } if (siblingValue != specification[2] ) { // sibling tag value does not match specification or @@ -427,7 +427,7 @@ namespace Isis { } else { - std::string msg = "Parsing error, dependency type [" + specification[0] + + std::string msg = "Parsing error, dependency type [" + specification[0].toStdString() + "] is not [att] or [tag]."; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/iTime/iTime.cpp b/isis/src/base/objs/iTime/iTime.cpp index 7d693be7dd..76de52faaa 100644 --- a/isis/src/base/objs/iTime/iTime.cpp +++ b/isis/src/base/objs/iTime/iTime.cpp @@ -9,6 +9,9 @@ find files of those names at the top level of this repository. **/ #include #include +#include + +#include #include "Preference.h" @@ -218,7 +221,7 @@ namespace Isis { * @return string */ QString iTime::YearString() const { - return toString(Year()); + return QString::number(Year()); } /** @@ -242,7 +245,7 @@ namespace Isis { * @return string */ QString iTime::MonthString() const { - return toString(Month()); + return QString::number(Month()); } /** @@ -266,7 +269,7 @@ namespace Isis { * @return string */ QString iTime::DayString() const { - return toString(Day()); + return QString::number(Day()); } /** @@ -290,7 +293,7 @@ namespace Isis { * @return string */ QString iTime::HourString() const { - return toString(Hour()); + return QString::number(Hour()); } /** @@ -314,7 +317,7 @@ namespace Isis { * @return string */ QString iTime::MinuteString() const { - return toString(Minute()); + return QString::number(Minute()); } /** @@ -369,7 +372,7 @@ namespace Isis { * @return string */ QString iTime::DayOfYearString() const { - return toString(DayOfYear()); + return QString::number(DayOfYear()); } /** @@ -394,7 +397,7 @@ namespace Isis { * @return string */ QString iTime::EtString() const { - return toString(p_et); + return QString::number(p_et); } /** diff --git a/isis/src/mgs/apps/mocproc/main.cpp b/isis/src/mgs/apps/mocproc/main.cpp index 7f9e1a1608..949174a59a 100644 --- a/isis/src/mgs/apps/mocproc/main.cpp +++ b/isis/src/mgs/apps/mocproc/main.cpp @@ -26,7 +26,7 @@ void IsisMain() { if(!ui.GetBoolean("INGESTION") && !ui.GetBoolean("CALIBRATION") && !ui.GetBoolean("MAPPING")) { - QString m = "Please pick at least one of [INGESTION, CALIBRATION, MAPPING]"; + std::string m = "Please pick at least one of [INGESTION, CALIBRATION, MAPPING]"; throw IException(IException::User, m, _FILEINFO_); } From 866825bdbd7e8fa5bb85c01809dcf6d2400862cf Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Mon, 9 Sep 2024 14:00:20 -0700 Subject: [PATCH 63/95] Updated base apps --- isis/src/base/apps/appjit/PixelOffset.cpp | 1 + isis/src/base/apps/bandnorm/bandnorm.cpp | 12 +-- isis/src/base/apps/cam2map/cam2map.cpp | 4 +- isis/src/base/apps/caminfo/CamTools.cpp | 2 +- isis/src/base/apps/caminfo/caminfo.cpp | 38 +++---- isis/src/base/apps/campt/campt.cpp | 4 +- .../src/base/apps/ckwriter/CkSpiceSegment.cpp | 22 ++--- isis/src/base/apps/ckwriter/SpiceKernel.cpp | 14 +-- isis/src/base/apps/ckwriter/ckwriter.cpp | 4 +- isis/src/base/apps/crop/crop.cpp | 2 +- isis/src/base/apps/csminit/csminit.cpp | 14 +-- isis/src/base/apps/cubediff/WriteTabular.cpp | 34 ++++--- isis/src/base/apps/cubeit/cubeit.cpp | 10 +- .../findimageoverlaps/findimageoverlaps.cpp | 2 +- isis/src/base/apps/fits2isis/fits2isis.cpp | 2 +- .../base/apps/footprintinit/footprintinit.cpp | 6 +- .../src/base/apps/framestitch/framestitch.cpp | 8 +- isis/src/base/apps/hist/hist.cpp | 2 +- isis/src/base/apps/isis2ascii/isis2ascii.cpp | 20 ++-- isis/src/base/apps/isis2pds/isis2pds.cpp | 2 +- isis/src/base/apps/isisexport/isisexport.cpp | 16 +-- isis/src/base/apps/isisimport/isisimport.cpp | 26 ++--- .../apps/isisminer/AssetSidebarStrategy.cpp | 2 +- .../apps/isisminer/CalculatorStrategy.cpp | 10 +- .../base/apps/isisminer/CsvReaderStrategy.cpp | 36 +++---- .../base/apps/isisminer/CsvWriterStrategy.cpp | 14 +-- .../apps/isisminer/DatabaseReaderStrategy.cpp | 12 +-- .../base/apps/isisminer/FilterStrategy.cpp | 4 +- .../apps/isisminer/GisIntersectStrategy.cpp | 14 +-- .../apps/isisminer/GisOverlapStrategy.cpp | 46 ++++----- .../base/apps/isisminer/GisUnionStrategy.cpp | 6 +- .../base/apps/isisminer/IsNumericStrategy.cpp | 2 +- .../src/base/apps/isisminer/LimitStrategy.cpp | 2 +- .../apps/isisminer/NumericalSortStrategy.cpp | 6 +- isis/src/base/apps/isisminer/PdsColumn.cpp | 12 +-- .../isisminer/PdsTableCreatorStrategy.cpp | 8 +- .../apps/isisminer/PdsTableFormatStrategy.cpp | 8 +- .../apps/isisminer/PdsTableReaderStrategy.cpp | 8 +- .../base/apps/isisminer/PvlReaderStrategy.cpp | 6 +- .../isisminer/ResourceManagerStrategy.cpp | 14 +-- .../apps/isisminer/RunCommandStrategy.cpp | 22 ++--- .../base/apps/isisminer/SidebarStrategy.cpp | 18 ++-- .../apps/isisminer/StereoPairStrategy.cpp | 98 +++++++++---------- .../base/apps/isisminer/StrategyFactory.cpp | 14 +-- isis/src/base/apps/map2map/map2map.cpp | 2 +- isis/src/base/apps/mappt/mappt.cpp | 10 +- isis/src/base/apps/maptrim/maptrim.cpp | 14 +-- isis/src/base/apps/mosrange/mosrange.cpp | 4 +- isis/src/base/apps/nocam2map/nocam2map.cpp | 12 +-- .../base/apps/overlapstats/overlapstats.cpp | 42 ++++---- isis/src/base/apps/phohillier/Hillier.cpp | 2 +- isis/src/base/apps/phohillier/Hillier.h | 38 +++++-- isis/src/base/apps/reduce/reduce_app.cpp | 2 +- .../apps/ringspt/CameraRingsPointInfo.cpp | 4 +- isis/src/base/apps/segment/segment.cpp | 8 +- isis/src/base/apps/shadow/ShadowFunctor.cpp | 24 ++--- isis/src/base/apps/skypt/skypt.cpp | 2 +- isis/src/base/apps/spiceinit/SpiceClient.cpp | 38 +++---- isis/src/base/apps/spiceinit/spiceinit.cpp | 2 +- .../src/base/apps/spiceserver/spiceserver.cpp | 20 ++-- .../base/apps/spkwriter/SpkKernelWriter.cpp | 6 +- .../src/base/apps/spkwriter/SpkKernelWriter.h | 2 +- isis/src/base/apps/spkwriter/SpkSegment.cpp | 22 ++--- .../base/apps/spkwriter/SpkSpiceSegment.cpp | 2 +- isis/src/base/apps/spkwriter/spkwriter.cpp | 8 +- isis/src/base/apps/std2isis/std2isis.cpp | 2 +- isis/src/base/apps/stretch/stretch_app.cpp | 10 +- 67 files changed, 450 insertions(+), 433 deletions(-) diff --git a/isis/src/base/apps/appjit/PixelOffset.cpp b/isis/src/base/apps/appjit/PixelOffset.cpp index 4bfa2259d8..f1ea588066 100644 --- a/isis/src/base/apps/appjit/PixelOffset.cpp +++ b/isis/src/base/apps/appjit/PixelOffset.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "PixelOffset.h" #include "TextFile.h" diff --git a/isis/src/base/apps/bandnorm/bandnorm.cpp b/isis/src/base/apps/bandnorm/bandnorm.cpp index d5bdcc290a..0704a8cd0e 100644 --- a/isis/src/base/apps/bandnorm/bandnorm.cpp +++ b/isis/src/base/apps/bandnorm/bandnorm.cpp @@ -64,7 +64,7 @@ namespace Isis { pencil.Open(ui.GetFileName("SPECTRUM")); std::cout << pencil.LineCount() << " " << icube->bandCount() << std::endl; if(pencil.LineCount() - 1 < icube->bandCount()) { - std::string msg = "The spectral pencil file [" + ui.GetAsString("SPECTRUM") + + std::string msg = "The spectral pencil file [" + ui.GetAsString("SPECTRUM").toStdString() + "] does not contain enough data for all bands."; throw IException(IException::User, msg, _FILEINFO_); } @@ -85,7 +85,7 @@ namespace Isis { } } if(column < 0 || (unsigned)column > tokens.size()) { - std::string msg = "The column specified in file [" + ui.GetFileName("SPECTRUM") + std::string msg = "The column specified in file [" + ui.GetFileName("SPECTRUM").toStdString() + "] was not found."; throw IException(IException::User, msg, _FILEINFO_); } @@ -95,8 +95,8 @@ namespace Isis { pencil.GetLine(st); Tokenize(st, tokens, ", \""); std::cout << "col: " << column << std::endl; - std::cout << Isis::IString(tokens[column]).ToDouble() << std::endl; - normalizer.push_back(Isis::IString(tokens[column]).ToDouble()); + std::cout << tokens[column].toDouble() << std::endl; + normalizer.push_back(tokens[column].toDouble()); } } else { // avg == "CUBE" @@ -153,8 +153,8 @@ namespace Isis { void Tokenize(const QString &strQStr, vector & tokens, const QString &delimitersQStr) { - IString str = strQStr; - IString delimiters = delimitersQStr; + IString str = strQStr.toStdString(); + IString delimiters = delimitersQStr.toStdString(); //Skip delimiters at the beginning string::size_type lastPos = str.find_first_not_of(delimiters, 0); diff --git a/isis/src/base/apps/cam2map/cam2map.cpp b/isis/src/base/apps/cam2map/cam2map.cpp index 9b0e37749f..06f8d8f300 100644 --- a/isis/src/base/apps/cam2map/cam2map.cpp +++ b/isis/src/base/apps/cam2map/cam2map.cpp @@ -53,7 +53,7 @@ namespace Isis { // Make sure it is not the sky if (incam->target()->isSky()) { - std::string msg = "The image [" + ui.GetCubeName("FROM") + + std::string msg = "The image [" + ui.GetCubeName("FROM").toStdString() + "] is targeting the sky, use skymap instead."; throw IException(IException::User, msg, _FILEINFO_); } @@ -219,7 +219,7 @@ namespace Isis { } else if (ui.GetString("LONSEAM") == "ERROR") { - std::string msg = "The image [" + ui.GetCubeName("FROM") + "] crosses the " + + std::string msg = "The image [" + ui.GetCubeName("FROM").toStdString() + "] crosses the " + "longitude seam"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/caminfo/CamTools.cpp b/isis/src/base/apps/caminfo/CamTools.cpp index 2c4abebe80..4a8569303b 100644 --- a/isis/src/base/apps/caminfo/CamTools.cpp +++ b/isis/src/base/apps/caminfo/CamTools.cpp @@ -92,7 +92,7 @@ namespace Isis { * @return string Converted value */ template QString ToString(const T &value) { - return (toString(value).trimmed()); + return (QString::number(value).trimmed()); } diff --git a/isis/src/base/apps/caminfo/caminfo.cpp b/isis/src/base/apps/caminfo/caminfo.cpp index 5c68eb5892..abd7899905 100644 --- a/isis/src/base/apps/caminfo/caminfo.cpp +++ b/isis/src/base/apps/caminfo/caminfo.cpp @@ -68,7 +68,7 @@ namespace Isis{ if(camstats) { PvlObject pcband("Camstats"); for(int i = 0; i < camstats->size(); i++) - pcband += ValidateKey((*camstats)[i].first, toDouble((*camstats)[i].second)); + pcband += ValidateKey((*camstats)[i].first, (*camstats)[i].second.toDouble()); params.addObject(pcband); } @@ -89,7 +89,7 @@ namespace Isis{ } else { std::string msg = "Could not find OriginalLabel " - "in input file [" + incube->fileName() + "]."; + "in input file [" + incube->fileName().toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -98,7 +98,7 @@ namespace Isis{ if(statistics) { PvlObject sgroup("Statistics"); for(int i = 0; i < statistics->size(); i++) - sgroup += ValidateKey((*statistics)[i].first, toDouble((*statistics)[i].second)); + sgroup += ValidateKey((*statistics)[i].first, (*statistics)[i].second.toDouble()); params.addObject(sgroup); } @@ -188,10 +188,10 @@ namespace Isis{ if (not appending) { keys.remove(QRegExp(delim + "$")); // Get rid of the extra delim char (",") - outFile << keys << endl; + outFile << keys.toStdString() << endl; } values.remove(QRegExp(delim + "$")); // Get rid of the extra delim char (",") - outFile << values << endl; + outFile << values.toStdString() << endl; outFile.close(); } @@ -249,9 +249,9 @@ namespace Isis{ general->append(MakePair("RunDate", iTime::CurrentGMT())); general->append(MakePair("IsisId", SerialNumber::Compose(*incube))); general->append(MakePair("From", QString::fromStdString(FileName(incube->fileName().toStdString()).baseName() + ".cub"))); - general->append(MakePair("Lines", toString(incube->lineCount()))); - general->append(MakePair("Samples", toString(incube->sampleCount()))); - general->append(MakePair("Bands", toString(incube->bandCount()))); + general->append(MakePair("Lines", QString::number(incube->lineCount()))); + general->append(MakePair("Samples", QString::number(incube->sampleCount()))); + general->append(MakePair("Bands", QString::number(incube->bandCount()))); // Extracts camstat data from existing CameraStatistics Table in cube label @@ -377,16 +377,16 @@ namespace Isis{ double lrspercent = (stats.LrsPixels() / (nPixels)) * 100; // Statistics output for band - statistics->append(MakePair("MeanValue", toString(stats.Average()))); - statistics->append(MakePair("StandardDeviation", toString(stats.StandardDeviation()))); - statistics->append(MakePair("MinimumValue", toString(stats.Minimum()))); - statistics->append(MakePair("MaximumValue", toString(stats.Maximum()))); - statistics->append(MakePair("PercentHIS", toString(hispercent))); - statistics->append(MakePair("PercentHRS", toString(hrspercent))); - statistics->append(MakePair("PercentLIS", toString(lispercent))); - statistics->append(MakePair("PercentLRS", toString(lrspercent))); - statistics->append(MakePair("PercentNull", toString(nullpercent))); - statistics->append(MakePair("TotalPixels", toString(stats.TotalPixels()))); + statistics->append(MakePair("MeanValue", QString::number(stats.Average()))); + statistics->append(MakePair("StandardDeviation", QString::number(stats.StandardDeviation()))); + statistics->append(MakePair("MinimumValue", QString::number(stats.Minimum()))); + statistics->append(MakePair("MaximumValue", QString::number(stats.Maximum()))); + statistics->append(MakePair("PercentHIS", QString::number(hispercent))); + statistics->append(MakePair("PercentHRS", QString::number(hrspercent))); + statistics->append(MakePair("PercentLIS", QString::number(lispercent))); + statistics->append(MakePair("PercentLRS", QString::number(lrspercent))); + statistics->append(MakePair("PercentNull", QString::number(nullpercent))); + statistics->append(MakePair("TotalPixels", QString::number(stats.TotalPixels()))); } bool getFootBlob = ui.GetBoolean("USELABEL"); @@ -421,7 +421,7 @@ namespace Isis{ } } else { - std::string msg = "Invalid INCTYPE option[" + incType + "]"; + std::string msg = "Invalid INCTYPE option[" + incType.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/campt/campt.cpp b/isis/src/base/apps/campt/campt.cpp index cf400a3232..e2f1f58f66 100644 --- a/isis/src/base/apps/campt/campt.cpp +++ b/isis/src/base/apps/campt/campt.cpp @@ -83,8 +83,8 @@ namespace Isis{ } for (int row = 0; row < reader.rows(); row++) { - point1 = toDouble(reader.getRow(row)[0]); - point2 = toDouble(reader.getRow(row)[1]); + point1 = reader.getRow(row)[0].toDouble(); + point2 = reader.getRow(row)[1].toDouble(); points.append(QPair(point1, point2)); } diff --git a/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp index 2a9e3edb7b..93983f833e 100644 --- a/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp +++ b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp @@ -304,7 +304,7 @@ void CkSpiceSegment::import(Cube &cube, const QString &tblname) { } catch ( IException &ie ) { ostringstream mess; - mess << "Failed to construct CK content from ISIS file " << _fname; + mess << "Failed to construct CK content from ISIS file " << _fname.toStdString(); throw IException(ie, IException::User, mess.str(), _FILEINFO_); } @@ -432,7 +432,7 @@ bool CkSpiceSegment::getFrameChains(Table &table, const int &leftBase, ostringstream mess; mess << "Left/Right CK frame ids invalid in TimeDependentFrames label keyword." << " Must have at least 1 and no more than 2 ids but have " - << QString::number(nfound); + << std::to_string(nfound); throw IException(IException::User, mess.str(), _FILEINFO_); } @@ -719,13 +719,13 @@ QString CkSpiceSegment::getComment() const { comment << "\n-----------------------------------------------------------------------\n" << " File: " << fname.name() << endl << -" ProductId: " << _name << endl << -" StartTime: " << _utcStartTime << endl << -" EndTime: " << _utcEndTime << endl << -" Instrument: " << _instId << endl << -" Target: " << _target << endl << -" InstFrame: " << _instFrame << endl << -" RefFrame: " << _refFrame << endl << +" ProductId: " << _name.toStdString() << endl << +" StartTime: " << _utcStartTime.toDouble() << endl << +" EndTime: " << _utcEndTime.toDouble() << endl << +" Instrument: " << _instId.toDouble() << endl << +" Target: " << _target.toDouble() << endl << +" InstFrame: " << _instFrame.toDouble() << endl << +" RefFrame: " << _refFrame.toDouble() << endl << " Records: " << size() << endl; if (_startOffset != 0) { @@ -740,7 +740,7 @@ QString CkSpiceSegment::getComment() const { QString hasAV = (size(_avvs) > 0) ? "YES" : "NO"; comment << -" HasAV: " << hasAV << endl; +" HasAV: " << hasAV.toStdString() << endl; comment << " CamVersion: " << _camVersion << endl; @@ -750,7 +750,7 @@ QString CkSpiceSegment::getComment() const { " Kernels: \n"; for ( int i = 0 ; i < klist.size() ; i++ ) { comment << -" " << klist[i] << endl; +" " << klist[i].toStdString() << endl; } } diff --git a/isis/src/base/apps/ckwriter/SpiceKernel.cpp b/isis/src/base/apps/ckwriter/SpiceKernel.cpp index 2a8c552e3e..b2047d813f 100644 --- a/isis/src/base/apps/ckwriter/SpiceKernel.cpp +++ b/isis/src/base/apps/ckwriter/SpiceKernel.cpp @@ -115,13 +115,13 @@ bool SpiceKernel::validate() const { // Now check for problems if ( 0 < errors.size() ) { - std::string mess = "Time overlap conflicts are present in segment (image) list. " + QString mess = "Time overlap conflicts are present in segment (image) list. " "This will likely create erroneous pointing in one or more " "images. You should create a seperate kernel for conflicting " "images that overlap another. Images with time overlap " "conflicts are: \n" + errors.join("; "); - throw IException(IException::User, mess, _FILEINFO_); + throw IException(IException::User, mess.toStdString(), _FILEINFO_); } return (true); @@ -158,14 +158,14 @@ bool SpiceKernel::validate() const { NaifStatus::CheckErrors(); } catch ( IException &ie ) { ostringstream mess; - mess << "Failed to write segment, ID = " << seglist[i]->Id(); + mess << "Failed to write segment, ID = " << seglist[i]->Id().toStdString(); throw IException(ie, IException::Programmer, mess.str(), _FILEINFO_); } } } catch ( IException &ie ) { ostringstream mess; - mess << "Could not create output CK kernel file: " << kname; + mess << "Could not create output CK kernel file: " << kname.toStdString(); throw IException(ie, IException::User, mess.str(), _FILEINFO_); } return; @@ -183,8 +183,8 @@ bool SpiceKernel::validate() const { comment << "\ ****************************************************************************\n\ USGS ISIS (ckwriter) Generated CK Kernel\n\ - Created By: " << Application::UserName() << "\n\ - Date Created: " << Application::DateTime() << "\n\ + Created By: " << Application::UserName().toStdString() << "\n\ + Date Created: " << Application::DateTime().toStdString() << "\n\ ****************************************************************************\n\ \n\ Orientation Data in the File\n\ @@ -257,7 +257,7 @@ User Comments\n\ TextFile txt(comFile); QString cline; while ( txt.GetLineNoFilter(cline )) { - comment << cline << "\n"; + comment << cline.toStdString() << "\n"; } } else { diff --git a/isis/src/base/apps/ckwriter/ckwriter.cpp b/isis/src/base/apps/ckwriter/ckwriter.cpp index b50dab5519..3503b24d86 100644 --- a/isis/src/base/apps/ckwriter/ckwriter.cpp +++ b/isis/src/base/apps/ckwriter/ckwriter.cpp @@ -72,10 +72,10 @@ namespace Isis { ofstream os; os.open(fFile.toLatin1().data(),ios::out); if (!os) { - std::string mess = "Cannot create SUMMARY output file " + fFile; + std::string mess = "Cannot create SUMMARY output file " + fFile.toStdString(); throw IException(IException::User, mess, _FILEINFO_); } - os << kernel.getSummary(comfile); + os << kernel.getSummary(comfile).toStdString(); os.close(); } diff --git a/isis/src/base/apps/crop/crop.cpp b/isis/src/base/apps/crop/crop.cpp index 16b306538a..6a018769d5 100644 --- a/isis/src/base/apps/crop/crop.cpp +++ b/isis/src/base/apps/crop/crop.cpp @@ -140,7 +140,7 @@ namespace Isis { } // Read the table into a table object - Table table(obj["Name"], from); + Table table(obj["Name"], from.toStdString()); // We are not going to bother with line/sample associations; they apply // only to the alpha cube at this time. I'm leaving this code here for the diff --git a/isis/src/base/apps/csminit/csminit.cpp b/isis/src/base/apps/csminit/csminit.cpp index cc6a044404..25e2798ece 100644 --- a/isis/src/base/apps/csminit/csminit.cpp +++ b/isis/src/base/apps/csminit/csminit.cpp @@ -106,11 +106,11 @@ namespace Isis { } if (possibleModels.size() > 1) { - std::string message = "Multiple models can be created from the ISD [" + isdFilePath + "]. " + std::string message = "Multiple models can be created from the ISD [" + isdFilePath.toStdString() + "]. " "Re-run with the PLUGINNAME and MODELNAME parameters. " "Possible plugin & model names:\n"; for (const QStringList &modelSpec : possibleModels) { - message += "Plugin [" + modelSpec[0] + "], Model [" + modelSpec[1] + "]\n"; + message += "Plugin [" + modelSpec[0].toStdString() + "], Model [" + modelSpec[1].toStdString() + "]\n"; } throw IException(IException::User, message, _FILEINFO_); } @@ -132,7 +132,7 @@ namespace Isis { QStringList modelSpec = possibleModels.front(); if (modelSpec.size() != 3) { - std::string message = "Model specification [" + modelSpec.join(" ") + "] has [" + modelSpec.size() + "] elements " + std::string message = "Model specification [" + modelSpec.join(" ").toStdString() + "] has [" + std::to_string(modelSpec.size()) + "] elements " "when it should have 3 elements."; throw IException(IException::Programmer, message, _FILEINFO_); } @@ -143,7 +143,7 @@ namespace Isis { const csm::Plugin *plugin = csm::Plugin::findPlugin(pluginName.toStdString()); if (plugin == NULL) { - std::string message = "Cannot find requested Plugin: [" + pluginName + "]."; + std::string message = "Cannot find requested Plugin: [" + pluginName.toStdString() + "]."; throw IException(IException::User, message, _FILEINFO_); } @@ -156,7 +156,7 @@ namespace Isis { model = plugin->constructModelFromISD(nitf21Isd, modelName.toStdString()); } else { - std::string message = "Invalid ISD format specifications [" + isdFormat + "]."; + std::string message = "Invalid ISD format specifications [" + isdFormat.toStdString() + "]."; throw IException(IException::Programmer, message, _FILEINFO_); } } // end of ISD if statement @@ -178,7 +178,7 @@ namespace Isis { const csm::Plugin *plugin = csm::Plugin::findPlugin(pluginName.toStdString()); if (plugin == NULL) { - std::string message = "Cannot find requested Plugin: [" + pluginName + "]."; + std::string message = "Cannot find requested Plugin: [" + pluginName.toStdString() + "]."; throw IException(IException::User, message, _FILEINFO_); } @@ -187,7 +187,7 @@ namespace Isis { model = plugin->constructModelFromState(stateString.toStdString()); } else { - std::string message = "Could not construct sensor model using STATE string and MODELNAME: [" + modelName + "]"; + std::string message = "Could not construct sensor model using STATE string and MODELNAME: [" + modelName.toStdString() + "]"; throw IException(IException::Programmer, message, _FILEINFO_); } } // end of State else statement diff --git a/isis/src/base/apps/cubediff/WriteTabular.cpp b/isis/src/base/apps/cubediff/WriteTabular.cpp index 41cdd6921b..b0801562e8 100644 --- a/isis/src/base/apps/cubediff/WriteTabular.cpp +++ b/isis/src/base/apps/cubediff/WriteTabular.cpp @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include "WriteTabular.h" #include "IString.h" @@ -69,7 +71,7 @@ namespace Isis { QString thisTitle = thisCol.Name(); if((int)thisTitle.length() > (int)thisCol.Width()) { - std::string message = "Column header [" + thisTitle + "] is wider " + + std::string message = "Column header [" + thisTitle.toStdString() + "] is wider " + "than the set width for column [" + toString((int)index) + "]"; throw IException(IException::User, message, _FILEINFO_); } @@ -89,9 +91,9 @@ namespace Isis { }//end while p_cols.push_back(thisCol); - p_outfile << thisTitle; + p_outfile << thisTitle.toStdString(); if(index < (cols.size() - 1)) { - p_outfile << p_delimiter; + p_outfile << p_delimiter.toStdString(); } }//end for p_outfile << "\n"; @@ -108,7 +110,7 @@ namespace Isis { stringstream tempStream; tempStream.width(thisCol.Width()); tempStream.fill(' '); - tempStream << item; + tempStream << item.toStdString(); item = tempStream.str().c_str(); if(p_curCol == 0) { @@ -123,7 +125,7 @@ namespace Isis { item += "\n"; p_curCol = 0; } - p_outfile << item; + p_outfile << item.toStdString(); } /** @@ -143,7 +145,7 @@ namespace Isis { std::string message = "Wrong data type for this Column"; throw IException(IException::User, message, _FILEINFO_); } - QString thisItem(toString(item)); + QString thisItem(QString::number(item)); if(thisItem.length() > (int)thisCol.Width()) { thisItem = "*"; while(thisItem.length() < (int)thisCol.Width()) { @@ -159,7 +161,7 @@ namespace Isis { } else tempStream.setf(std::ios::right); - tempStream << thisItem; + tempStream << thisItem.toStdString(); thisItem = tempStream.str().c_str(); if(p_curCol == 0) { @@ -174,7 +176,7 @@ namespace Isis { thisItem += "\n"; p_curCol = 0; } - p_outfile << thisItem; + p_outfile << thisItem.toStdString(); } /** @@ -206,7 +208,7 @@ namespace Isis { } else tempStream.setf(std::ios::right); - tempStream << item; + tempStream << item.toStdString(); item = tempStream.str().c_str(); if(p_curCol == 0) { @@ -221,7 +223,7 @@ namespace Isis { item += "\n"; p_curCol = 0; } - p_outfile << item; + p_outfile << item.toStdString(); } /** @@ -261,7 +263,7 @@ namespace Isis { } } - QString thisItem(toString(item)); + QString thisItem(QString::number(item)); if(thisCol.Alignment() == Column::Decimal) { @@ -287,12 +289,12 @@ namespace Isis { stringstream b; b << std::showpoint << std::setprecision(thisCol.Precision()) - << toDouble(tempString.join(".")); + << tempString.join(".").toDouble(); //if the rounding causes a rollover (i.e. the decimal portion is greater //than 0.95) increment the integer portion - if(toDouble(QString(b.str().c_str())) >= 1) { - intPart = toString(toInt(intPart) + 1); + if(QString(b.str().c_str()).toDouble() >= 1) { + intPart = QString::number(intPart.toInt() + 1); } //Put it back into an QString, for easier manipulation @@ -315,7 +317,7 @@ namespace Isis { } else tempStream.setf(std::ios::right); - tempStream << thisItem; + tempStream << thisItem.toStdString(); thisItem = tempStream.str().c_str(); if(p_curCol == 0) { @@ -338,7 +340,7 @@ namespace Isis { thisItem += "\n"; p_curCol = 0; } - p_outfile << thisItem; + p_outfile << thisItem.toStdString(); } diff --git a/isis/src/base/apps/cubeit/cubeit.cpp b/isis/src/base/apps/cubeit/cubeit.cpp index f446ad44be..0bb1d8fd26 100644 --- a/isis/src/base/apps/cubeit/cubeit.cpp +++ b/isis/src/base/apps/cubeit/cubeit.cpp @@ -120,13 +120,13 @@ namespace Isis { } } catch(IException &e) { - std::string msg = "Invalid cube in list file [" + ui.GetFileName("FROMLIST") + "]"; + std::string msg = "Invalid cube in list file [" + ui.GetFileName("FROMLIST").toStdString() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } //if literally everything is a TRACKING band, throw an error, since we don't prop. TRACKING bands if (newcubeList.size() == 0) { - std::string msg = "Only TRACKING bands supplied in [" + ui.GetFileName("FROMLIST") + "]"; + std::string msg = "Only TRACKING bands supplied in [" + ui.GetFileName("FROMLIST").toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -146,9 +146,9 @@ namespace Isis { } } if(!match) { - std::string msg = "FileName [" + ui.GetCubeName("PROPLAB") + + std::string msg = "FileName [" + ui.GetCubeName("PROPLAB").toStdString() + "] to propagate labels from is not in the list file [" + - ui.GetFileName("FROMLIST") + "]"; + ui.GetFileName("FROMLIST").toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -186,7 +186,7 @@ namespace Isis { m.SetBandBinMatch(false); Progress *prog = m.Progress(); - prog->SetText("Adding bands from Cube " + toString((int)i + 1) + + prog->SetText("Adding bands from Cube " + QString::number((int)i + 1) + " of " + newcubeList.size()); m.SetOutputCube("TO", ui); diff --git a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp index 44cc74b740..871943c779 100644 --- a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp +++ b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp @@ -24,7 +24,7 @@ namespace Isis { vector< pair > sortedList; if (images.size() == 1) { - throw IException(IException::User, "The list [" + ui.GetFileName("FROMLIST") + + throw IException(IException::User, "The list [" + ui.GetFileName("FROMLIST").toStdString() + "] only contains one image.", _FILEINFO_); } diff --git a/isis/src/base/apps/fits2isis/fits2isis.cpp b/isis/src/base/apps/fits2isis/fits2isis.cpp index f827a13de7..ba6587f4c0 100644 --- a/isis/src/base/apps/fits2isis/fits2isis.cpp +++ b/isis/src/base/apps/fits2isis/fits2isis.cpp @@ -32,7 +32,7 @@ namespace Isis{ pfits.SetOrganization(ProcessImport::BIP); } else { - std::string msg = "Unknow value for ORGANIZATION [" + ui.GetString("ORGANIZATION") + "]"; + std::string msg = "Unknow value for ORGANIZATION [" + ui.GetString("ORGANIZATION").toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/footprintinit/footprintinit.cpp b/isis/src/base/apps/footprintinit/footprintinit.cpp index cb51e1ffd6..ab3eb16d0a 100644 --- a/isis/src/base/apps/footprintinit/footprintinit.cpp +++ b/isis/src/base/apps/footprintinit/footprintinit.cpp @@ -58,7 +58,7 @@ namespace Isis { int sinc = 1; int linc = 1; - IString incType = ui.GetString("INCTYPE"); + IString incType = ui.GetString("INCTYPE").toStdString(); if (incType.UpCase() == "VERTICES") { poly.initCube(*cube); sinc = linc = (int)(0.5 + (((poly.validSampleDim() * 2) + @@ -81,7 +81,7 @@ namespace Isis { poly.Create(*cube, sinc, linc, 1, 1, 0, 0, 1, precision); } catch (IException &e) { - std::string msg = "Cannot generate polygon for [" + cube->fileName() + "]"; + std::string msg = "Cannot generate polygon for [" + cube->fileName().toStdString() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } @@ -127,7 +127,7 @@ namespace Isis { delete xyPoly; e.print(); // This should be a NAIF error std::string msg = "Cannot calculate XY for ["; - msg += cube->fileName() + "]"; + msg += cube->fileName().toStdString() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/apps/framestitch/framestitch.cpp b/isis/src/base/apps/framestitch/framestitch.cpp index e205359cce..b4612403b4 100644 --- a/isis/src/base/apps/framestitch/framestitch.cpp +++ b/isis/src/base/apps/framestitch/framestitch.cpp @@ -59,14 +59,14 @@ namespace Isis { } if (frameHeights.TotalPixels() == 0) { - std::string msg = "Failed to find any NULL frames in cube [" + cube->fileName() + "]." + std::string msg = "Failed to find any NULL frames in cube [" + cube->fileName().toStdString() + "]." "Please manually enter the frame height."; throw IException(IException::User, msg, _FILEINFO_); } if (frameHeights.Minimum() != frameHeights.Maximum()) { std::string msg = "Found different frame heights between [" + toString((int)frameHeights.Minimum()) + "] and [" + toString((int)frameHeights.Maximum()) + "] lines in cube [" - + cube->fileName() + "]. Please manually enter the frame height."; + + cube->fileName().toStdString() + "]. Please manually enter the frame height."; throw IException(IException::User, msg, _FILEINFO_); } @@ -114,12 +114,12 @@ namespace Isis { } if (evenInst.hasKeyword("DataFlipped") && oddInst.hasKeyword("DataFlipped")) { - if (toBool(QString::fromStdString(evenInst["DataFlipped"])) != toBool(QString::fromStdString(oddInst["DataFlipped"]))) { + if (toBool(evenInst["DataFlipped"]) != toBool(oddInst["DataFlipped"])) { std::string msg = "Both input cubes must be flipped or not flipped. Cannot combine " "a flipped and unflipped cube."; throw IException(IException::User, msg, _FILEINFO_); } - inputFlipped = toBool(QString::fromStdString(evenInst["DataFlipped"])); + inputFlipped = toBool(evenInst["DataFlipped"]); } } diff --git a/isis/src/base/apps/hist/hist.cpp b/isis/src/base/apps/hist/hist.cpp index 7668c303be..166571753b 100644 --- a/isis/src/base/apps/hist/hist.cpp +++ b/isis/src/base/apps/hist/hist.cpp @@ -96,7 +96,7 @@ namespace Isis { ofstream fout; fout.open(outfile.toLatin1().data()); - fout << "Cube: " << icube->fileName() << endl; + fout << "Cube: " << icube->fileName().toStdString() << endl; fout << "Band: " << icube->bandCount() << endl; if(hist->ValidPixels() != 0) { diff --git a/isis/src/base/apps/isis2ascii/isis2ascii.cpp b/isis/src/base/apps/isis2ascii/isis2ascii.cpp index f1a74faccc..bcd5ebd130 100644 --- a/isis/src/base/apps/isis2ascii/isis2ascii.cpp +++ b/isis/src/base/apps/isis2ascii/isis2ascii.cpp @@ -36,17 +36,17 @@ namespace Isis { void operator() (Buffer &in) const { for(int i = 0; i < in.size(); i++) { if(IsSpecial(in[i])) { - if(IsNullPixel(in[i])) fout << null; - if(IsHrsPixel(in[i])) fout << hrs; - if(IsHisPixel(in[i])) fout << his; - if(IsLrsPixel(in[i])) fout << lrs; - if(IsLisPixel(in[i])) fout << lis; + if(IsNullPixel(in[i])) fout << null.toStdString(); + if(IsHrsPixel(in[i])) fout << hrs.toStdString(); + if(IsHisPixel(in[i])) fout << his.toStdString(); + if(IsLrsPixel(in[i])) fout << lrs.toStdString(); + if(IsLisPixel(in[i])) fout << lis.toStdString(); } else { fout << in[i]; } if (i != in.size() - 1) { - fout << delimiter; + fout << delimiter.toStdString(); } } fout << endl; @@ -91,10 +91,10 @@ namespace Isis { // Print header if needed if(ui.GetBoolean("HEADER")) { - fout << "Input_Cube" << delimiter << icube->fileName() << endl; - fout << "Samples" << delimiter << icube->sampleCount() << endl; - fout << "Lines" << delimiter << icube->lineCount() << endl; - fout << "Bands" << delimiter << icube->bandCount() << endl; + fout << "Input_Cube" << delimiter.toStdString() << icube->fileName().toStdString() << endl; + fout << "Samples" << delimiter.toStdString() << icube->sampleCount() << endl; + fout << "Lines" << delimiter.toStdString() << icube->lineCount() << endl; + fout << "Bands" << delimiter.toStdString() << icube->bandCount() << endl; } //Determine special pixel values diff --git a/isis/src/base/apps/isis2pds/isis2pds.cpp b/isis/src/base/apps/isis2pds/isis2pds.cpp index 3eec0a1e61..f29bc0da70 100644 --- a/isis/src/base/apps/isis2pds/isis2pds.cpp +++ b/isis/src/base/apps/isis2pds/isis2pds.cpp @@ -130,7 +130,7 @@ namespace Isis{ PvlObject *label= icube->label(); if (!label->hasObject("IsisCube")) { - std::string msg = "Input file [" + ui.GetCubeName("FROM") + + std::string msg = "Input file [" + ui.GetCubeName("FROM").toStdString() + "] does not appear to be an ISIS cube."; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/isisexport/isisexport.cpp b/isis/src/base/apps/isisexport/isisexport.cpp index 518f8d582f..1f25f04d83 100644 --- a/isis/src/base/apps/isisexport/isisexport.cpp +++ b/isis/src/base/apps/isisexport/isisexport.cpp @@ -123,11 +123,11 @@ namespace Isis { for (auto& element : extraJson.items()) { if (dataSource["ExtraPvl"].contains(element.key())) { PvlGroup duplicateWarnings("Warning"); - std::string message = "Duplicate key [" + QString::fromStdString(element.key()) - + "] in extra Pvl file [" + pvlFile + "]. " - + "Previous value [" + QString::fromStdString(dataSource["ExtraPvl"][element.key()].dump()) + std::string message = "Duplicate key [" + element.key() + + "] in extra Pvl file [" + pvlFile.toStdString() + "]. " + + "Previous value [" + dataSource["ExtraPvl"][element.key()].dump() + "] will be overwritten."; - duplicateWarnings += PvlKeyword("Duplicate", message.toStdString()); + duplicateWarnings += PvlKeyword("Duplicate", message); Application::AppendAndLog(duplicateWarnings, log); } } @@ -170,11 +170,11 @@ namespace Isis { for (auto& element : extraJson.items()) { if (dataSource["ExtraJson"].contains(element.key())) { PvlGroup duplicateWarnings("Warning"); - std::string message = "Duplicate key [" + QString::fromStdString(element.key()) - + "] in extra json file [" + jsonFile + "]. " - + "Previous value [" + QString::fromStdString(dataSource["ExtraJson"][element.key()].dump()) + std::string message = "Duplicate key [" + element.key() + + "] in extra json file [" + jsonFile.toStdString() + "]. " + + "Previous value [" + dataSource["ExtraJson"][element.key()].dump() + "] will be overwritten."; - duplicateWarnings += PvlKeyword("Duplicate", message.toStdString()); + duplicateWarnings += PvlKeyword("Duplicate", message); Application::AppendAndLog(duplicateWarnings, log); } } diff --git a/isis/src/base/apps/isisimport/isisimport.cpp b/isis/src/base/apps/isisimport/isisimport.cpp index 98b96c478b..7ae69f8c33 100644 --- a/isis/src/base/apps/isisimport/isisimport.cpp +++ b/isis/src/base/apps/isisimport/isisimport.cpp @@ -138,8 +138,8 @@ namespace Isis { QStringList tokens = line.simplified().split(" "); if(tokens.count() > 2 && tokens.first() == filter) { - center = toDouble(tokens[1]); - width = toDouble(tokens[2]); + center = tokens[1].toDouble(); + width = tokens[2].toDouble(); break; } } @@ -183,7 +183,7 @@ namespace Isis { for (QString value: line.split(QRegExp("[\\s,]"), Qt::SkipEmptyParts)) { vectorStretchPairs.push_back(temp1); - vectorStretchPairs.push_back(toDouble(value)); + vectorStretchPairs.push_back(value.toDouble()); temp1++; } } @@ -381,7 +381,7 @@ namespace Isis { PvlObject translation = newLabel.findObject("Translation"); if (translation.hasKeyword("Failure")) { - throw IException(IException::Io, QString::fromStdString(translation.findKeyword("Failure")), _FILEINFO_); + throw IException(IException::Io, translation.findKeyword("Failure"), _FILEINFO_); } // Set everything needed by ProcessImport @@ -397,7 +397,7 @@ namespace Isis { double base = pixels["Base"]; double multiplier = pixels["Multiplier"]; importer.SetPixelType(PixelTypeEnumeration(pixelType)); - importer.SetByteOrder(ByteOrderEnumeration(byteOrder)); + importer.SetByteOrder(ByteOrderEnumeration(byteOrder.toStdString())); importer.SetBase(base); importer.SetMultiplier(multiplier); @@ -458,11 +458,11 @@ namespace Isis { // Checks that are unique to mgsmoc if (translation.hasKeyword("compressed") && translation.hasKeyword("projected")) { - if (toBool(QString::fromStdString(translation["compressed"]))) { + if (toBool(translation["compressed"])) { std::string msg = "[" + inputFileName.name() + "] may be compressed. Please run image through mocuncompress to uncompress."; throw IException(IException::User, msg, _FILEINFO_); } - if (toBool(QString::fromStdString(translation["projected"]))) { + if (toBool(translation["projected"])) { std::string msg = "[" + inputFileName.name() + "] appears to be an rdr file."; msg += " Use pds2isis."; throw IException(IException::User, msg, _FILEINFO_); @@ -496,7 +496,7 @@ namespace Isis { } else { stringstream pdsOrgStream; - pdsOrgStream << originalAxisOrder; + pdsOrgStream << originalAxisOrder.toStdString(); std::string msg = "Unsupported axis order [" + originalAxisOrder.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -508,7 +508,7 @@ namespace Isis { if (translation.hasKeyword("CoreNull")) { str = QString::fromStdString(translation["CoreNull"]); if(str != "NULL") { - pdsNull = toDouble(str); + pdsNull = str.toDouble(); } } @@ -516,7 +516,7 @@ namespace Isis { if (translation.hasKeyword("CoreLRS")) { str = QString::fromStdString(translation["CoreLRS"]); if(str != "NULL") { - pdsLrs = toDouble(str); + pdsLrs = str.toDouble(); } } @@ -524,7 +524,7 @@ namespace Isis { if (translation.hasKeyword("CoreLIS")) { str = QString::fromStdString(translation["CoreLIS"]); if(str != "NULL") { - pdsLis = toDouble(str); + pdsLis = str.toDouble(); } } @@ -532,7 +532,7 @@ namespace Isis { if (translation.hasKeyword("CoreHRS")) { str = QString::fromStdString(translation["CoreHRS"]); if(str != "NULL") { - pdsHrs = toDouble(str); + pdsHrs = str.toDouble(); } } @@ -540,7 +540,7 @@ namespace Isis { if (translation.hasKeyword("CoreHIS")) { str = QString::fromStdString(translation["CoreHIS"]); if(str != "NULL") { - pdsHis = toDouble(str); + pdsHis = str.toDouble(); } } importer.SetSpecialValues(pdsNull, pdsLrs, pdsLis, pdsHrs, pdsHis); diff --git a/isis/src/base/apps/isisminer/AssetSidebarStrategy.cpp b/isis/src/base/apps/isisminer/AssetSidebarStrategy.cpp index e2f566d4ab..511d2ae81d 100644 --- a/isis/src/base/apps/isisminer/AssetSidebarStrategy.cpp +++ b/isis/src/base/apps/isisminer/AssetSidebarStrategy.cpp @@ -74,7 +74,7 @@ namespace Isis { PvlFlatMap parms(getDefinitionMap()); m_asset = parms.get("Asset"); m_create = ("create" == parms.get("Operation", "process").toLower()); - m_removeEmpties = toBool(parms.get("ClearOnEmpty", "true")); + m_removeEmpties = toBool(parms.get("ClearOnEmpty", "true").toStdString()); QString source = parms.get("CreateSource", "copy").toLower(); if ( "clone" == source ) { m_source = FromClone; } diff --git a/isis/src/base/apps/isisminer/CalculatorStrategy.cpp b/isis/src/base/apps/isisminer/CalculatorStrategy.cpp index e4c82bd322..1b35b0d51d 100644 --- a/isis/src/base/apps/isisminer/CalculatorStrategy.cpp +++ b/isis/src/base/apps/isisminer/CalculatorStrategy.cpp @@ -147,8 +147,8 @@ namespace Isis { // Discard on error catch (IException &ie) { if ( isDebug() ) { - cout << "Calculator error on " << resource->name() << " with equation " - << eqn.equation << ": " << ie.what() << "\n"; + cout << "Calculator error on " << resource->name().toStdString() << " with equation " + << eqn.equation.toStdString() << ": " << ie.what() << "\n"; } m_result = Null; resource->discard(); @@ -196,7 +196,7 @@ namespace Isis { newkey.addValue(value.toStdString()); if ( isDebug() ) { cout << "Initializing " << key.name() << "[" << i << "] = " - << value << "\n"; + << value.toStdString() << "\n"; } } resource->add(newkey); @@ -331,7 +331,7 @@ namespace Isis { QVector vars; BOOST_FOREACH ( SharedResource resource, m_resources ) { if ( resource->exists(variable) ) { - vars.push_back(toDouble(resource->value(variable, index))); + vars.push_back(resource->value(variable, index).toDouble()); break; } } @@ -377,7 +377,7 @@ namespace Isis { QVector PvlFlatMapCalculatorVariablePool::value(const QString &variable, const int &index) const { QVector vars; - vars.push_back(toDouble(m_pvl.get(variable, index))); + vars.push_back(m_pvl.get(variable, index).toDouble()); return (vars); } diff --git a/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp b/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp index 94e118685b..598feb11a9 100644 --- a/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp @@ -61,15 +61,15 @@ namespace Isis { // Want to do this to check validity at creation time - not run time PvlFlatMap parms( getDefinitionMap() ); - m_hasHeader = toBool(parms.get("HasHeader", "false")); - m_ignoreComments = toBool(parms.get("IgnoreComments", "false")); - m_skipLines = toInt(parms.get("SkipLines", "0")); + m_hasHeader = toBool(parms.get("HasHeader", "false").toStdString()); + m_ignoreComments = toBool(parms.get("IgnoreComments", "false").toStdString()); + m_skipLines = toInt(parms.get("SkipLines", "0").toStdString()); m_delimiter = parms.get("Delimiter", ","); m_rowBase = parms.get("RowBaseName", "Row"); // Check for valid delimiter if ( m_delimiter.size() != 1 ) { - std::string mess = "Delimiter value (" + m_delimiter + ") must be one and only" + std::string mess = "Delimiter value (" + m_delimiter.toStdString() + ") must be one and only" " one value - try again"; throw IException(IException::User, mess, _FILEINFO_); } @@ -110,13 +110,13 @@ namespace Isis { // Fetch input file name QString fname = translateKeywordArgs("CsvFile", globals); if ( isDebug() ) { - cout << "CsvReader::Filename = " << fname << "\n"; + cout << "CsvReader::Filename = " << fname.toStdString() << "\n"; } try { csv.read(fname); } catch (IException &ie) { - std::string mess = "Could not read CSV file \'" + fname + "\'"; + std::string mess = "Could not read CSV file \'" + fname.toStdString() + "\'"; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -142,8 +142,8 @@ namespace Isis { if ( index < csvrow.dim() ) { rowsrc->add(header[column].first, csvrow[index]); if ( isDebug() ) { - cout << "CsvReader::Column::" << header[column].first << "[" - << index << "] = " << csvrow[index] << "\n"; + cout << "CsvReader::Column::" << header[column].first.toStdString() << "[" + << index << "] = " << csvrow[index].toStdString() << "\n"; } } } @@ -156,8 +156,8 @@ namespace Isis { rowsrc->setName(identity); if ( isDebug() ) { - cout << " CsvReader::Resource::" << rowId << "::Identity = " - << identity << "\n"; + cout << " CsvReader::Resource::" << rowId.toStdString() << "::Identity = " + << identity.toStdString() << "\n"; } // Import geometry w/exception handling @@ -168,7 +168,7 @@ namespace Isis { } catch (IException &ie) { std::string mess = "Geometry conversion failed horribly for Resource(" + - identity + ")"; + identity.toStdString() + ")"; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -212,18 +212,18 @@ namespace Isis { if (keys.exists("Index") ) { QStringList indexes = keys.allValues("Index"); if ( names.size() != indexes.size() ) { - std::string mess = "Size of Header (" + QString::number(names.size()) + + std::string mess = "Size of Header (" + toString(names.size()) + " does not match size of Index (" + - QString::number(indexes.size()) + ")"; + toString(indexes.size()) + ")"; throw IException(IException::User, mess, _FILEINFO_); } for ( int i = 0 ; i < names.size() ; i++ ) { - int index = toInt(indexes[i]); + int index = indexes[i].toInt(); if ( (index < 0) || (index >= ncols) ) { - std::string mess = "Column " + names[i] + " index (" + indexes[i] + + std::string mess = "Column " + names[i].toStdString() + " index (" + indexes[i].toStdString() + ") exceeds input column size (" + - QString::number(ncols) + ")"; + toString(ncols) + ")"; // throw IException(IException::User, mess, _FILEINFO_); // Not an error if we handle the input conditions properly if ( isDebug() ) { @@ -236,9 +236,9 @@ namespace Isis { } else { if ( names.size() > ncols ) { - std::string mess = "Size of Header (" + QString::number(names.size()) + + std::string mess = "Size of Header (" + toString(names.size()) + ") exceeds input column size (" + - QString::number(ncols) + + toString(ncols) + ") - must provide Index otherwise"; // throw IException(IException::User, mess, _FILEINFO_); // Not an error if we handle the input conditions properly diff --git a/isis/src/base/apps/isisminer/CsvWriterStrategy.cpp b/isis/src/base/apps/isisminer/CsvWriterStrategy.cpp index 5841d01fc7..819020cd92 100644 --- a/isis/src/base/apps/isisminer/CsvWriterStrategy.cpp +++ b/isis/src/base/apps/isisminer/CsvWriterStrategy.cpp @@ -80,10 +80,10 @@ namespace Isis { PvlFlatMap parms( getDefinitionMap() ); m_mode = parms.get("Mode", "Create").toLower(); m_keywords = parms.allValues("Keywords"); - m_header = toBool(parms.get("Header", "true")); + m_header = toBool(parms.get("Header", "true").toStdString()); m_delimiter = parms.get("Delimiter", ","); m_default = parms.get("DefaultValue", "NULL"); - m_skipEmptyLists = toBool(parms.get("SkipEmptyLists", "false")); + m_skipEmptyLists = toBool(parms.get("SkipEmptyLists", "false").toStdString()); if ( parms.exists("GisGeometryRef") ) { m_gisKey = parms.get("GisGeometryRef").toLower(); @@ -131,7 +131,7 @@ namespace Isis { // Check for argument replacement QString fname = translateKeywordArgs("CsvFile", globals); if ( isDebug() ) { - cout << "CsvWriter::Filename = " << fname << "\n"; + cout << "CsvWriter::Filename = " << fname.toStdString() << "\n"; } // Now open the filename @@ -146,7 +146,7 @@ namespace Isis { } if ( !os.is_open() ) { - std::string mess = "CsvWriter::Cannot open/create output file [" + fname + + std::string mess = "CsvWriter::Cannot open/create output file [" + fname.toStdString() + "]."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -155,7 +155,7 @@ namespace Isis { if ( m_header ) { QString delimiter = ""; BOOST_FOREACH ( QString column, m_keywords ) { - os << delimiter << column; + os << delimiter.toStdString() << column.toStdString(); delimiter = m_delimiter; } os << "\n"; @@ -248,7 +248,7 @@ namespace Isis { value = gis->wkb(geos, GisTopology::PreserveGeometry); } else { - std::string mess = "Unsupported geometry type: " + gisType; + std::string mess = "Unsupported geometry type: " + gisType.toStdString(); throw IException(IException::User, mess, _FILEINFO_); } } @@ -258,7 +258,7 @@ namespace Isis { value = findReplacement(field, parameters, 0, defValue); } - os << myDelimiter << value; + os << myDelimiter.toStdString() << value.toStdString(); myDelimiter = delimiter; } diff --git a/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp b/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp index f90b967ee9..a7b8692027 100644 --- a/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp @@ -125,12 +125,12 @@ namespace Isis { else { // ("asset" == target) QString assetName = keys.get("Asset"); if ( isDebug() ) { - cout << "Db:LoadingAssets(" << assetName << ") \n"; + cout << "Db:LoadingAssets(" << assetName.toStdString() << ") \n"; } BOOST_FOREACH ( SharedResource resource, resources ) { if ( isDebug() ) { - cout << " Db:AssetsResource(" << resource->name() << ") \n"; + cout << " Db:AssetsResource(" << resource->name().toStdString() << ") \n"; } ResourceList assetList; nrows += executeQuery(assetList, getGlobals(resource, globals)); @@ -145,7 +145,7 @@ namespace Isis { } } catch ( IException &ie ) { - std::string mess = "Query failed after " + QString::number(nrows+1) + + std::string mess = "Query failed after " + toString(nrows+1) + " rows: " + ie.what(); if ( isDebug() ) { cout << "Db::Error - " << mess << "\n"; @@ -238,7 +238,7 @@ namespace Isis { QString query = configureQuery(globals); if ( isDebug() ) { - cout << "Running Query = " << query << "\n"; + cout << "Running Query = " << query.toStdString() << "\n"; } SqlQuery finder(*m_db); finder.setThrowOnFailure(); @@ -266,7 +266,7 @@ namespace Isis { } newsrc->setName(identity); if ( isDebug() ) { - cout << " Db::Resource::" << rowId << "::Identity = " << identity << "\n"; + cout << " Db::Resource::" << rowId.toStdString() << "::Identity = " << identity.toStdString() << "\n"; } // Propagated keys and store Query if requested @@ -312,7 +312,7 @@ namespace Isis { } catch (IException &ie) { std::string mess = "Geometry conversion failed horribly for Resource [" + - rowId + "]."; + rowId.toStdString() + "]."; throw IException(ie, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/FilterStrategy.cpp b/isis/src/base/apps/isisminer/FilterStrategy.cpp index 99a6220eec..5c762a8d82 100644 --- a/isis/src/base/apps/isisminer/FilterStrategy.cpp +++ b/isis/src/base/apps/isisminer/FilterStrategy.cpp @@ -64,7 +64,7 @@ namespace Isis { m_key = parms.get("Keyword"); if ( parms.exists("CheckAll") ) { - m_checkAll = toBool(parms.get("CheckAll")); + m_checkAll = toBool(parms.get("CheckAll").toStdString()); } if ( parms.exists("Include") ) { @@ -77,7 +77,7 @@ namespace Isis { if ( parms.exists("RegExp") ) { m_regexp.setPattern(parms.get("RegExp")); - if ( toBool(parms.get("WildCardMode", "false")) ) { + if ( toBool(parms.get("WildCardMode", "false").toStdString()) ) { m_regexp.setPatternSyntax(QRegExp::WildcardUnix); } } diff --git a/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp b/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp index b4fc31010a..622967df16 100644 --- a/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp @@ -70,14 +70,14 @@ namespace Isis { } // See if user wants a bounding box from the source - if ( toBool(parms.get("BoundingBox", "false")) ) { + if ( toBool(parms.get("BoundingBox", "false").toStdString()) ) { GEOSGeometry *geom = GEOSEnvelope(m_geom->geometry()); m_geom->setGeometry(geom); } // Check for validity if ( !m_geom->isValid() ) { - std::string mess = "User provided geometry for " + name() + + std::string mess = "User provided geometry for " + name().toStdString() + " is not valid!"; throw IException(IException::User, mess, _FILEINFO_); } @@ -86,10 +86,10 @@ namespace Isis { // Echo back WKT geometry GisTopology *gis = GisTopology::instance(); QString wkt = gis->wkt(m_geom->geometry()); - cout << "GisGeometry = " << wkt << "\n"; + cout << "GisGeometry = " << wkt.toStdString() << "\n"; } - m_computeOverlap = toBool(parms.get("ComputeRatio", "false")); + m_computeOverlap = toBool(parms.get("ComputeRatio", "false").toStdString()); m_ratioKey = parms.get("RatioRef", ""); return; @@ -137,8 +137,8 @@ namespace Isis { geom = new GisGeometry(gisgeom, gtype); } catch (IException &ie) { - std::string mess = "Problems converting GIS Geometry in keyword " + key + - ", PVL source file: " + pfile; + std::string mess = "Problems converting GIS Geometry in keyword " + key.toStdString() + + ", PVL source file: " + pfile.toStdString(); throw IException(IException::User, mess, _FILEINFO_); } @@ -188,7 +188,7 @@ namespace Isis { else { if ( m_computeOverlap ) { double ratio = resource->geometry()->intersectRatio(*m_geom); - resource->add(m_ratioKey, toString(ratio)); + resource->add(m_ratioKey, QString::number(ratio)); } } return (1); diff --git a/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp b/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp index a8addb5ffb..2152a29556 100644 --- a/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp @@ -87,8 +87,8 @@ namespace Isis { PvlFlatMap parms( getDefinitionMap() ); - m_overlapMin = toDouble(parms.get("OverlapMinimum", "0.0")); - m_overlapMax = toDouble(parms.get("OverlapMaximum", "1.0")); + m_overlapMin = parms.get("OverlapMinimum", "0.0").toDouble(); + m_overlapMax = parms.get("OverlapMaximum", "1.0").toDouble(); m_ratioKey = parms.get("OverlapRatioKey", "OverlapRatio"); m_assetName = parms.get("Asset", "GisOverlap"); @@ -112,7 +112,7 @@ namespace Isis { m_merge = None; } else { - std::string mess = "OverlapMerge = " + parms.get("OverlapMerge") + + std::string mess = "OverlapMerge = " + parms.get("OverlapMerge").toStdString() + " is not a recognized/valid option"; throw IException(IException::User, mess, _FILEINFO_); } @@ -235,7 +235,7 @@ namespace Isis { ResourceList noPairs; BOOST_FOREACH ( SharedResource resource, v_active ) { if ( isDebug() ) { - cout << "\n===> Running Overlap query for " << resource->name() << "\n"; + cout << "\n===> Running Overlap query for " << resource->name().toStdString() << "\n"; } // Check for valid geometry @@ -380,8 +380,8 @@ namespace Isis { double EPSILON = 1e-9; if ( isDebug() ) { - cout << "\nSource " << resource->name() << " overlaps " - << candidate->name() << " with ratio of " << ratioA << ", " + cout << "\nSource " << resource->name().toStdString() << " overlaps " + << candidate->name().toStdString() << " with ratio of " << ratioA << ", " << ratioB << "\n"; } @@ -441,13 +441,13 @@ namespace Isis { // Get the geom SharedResource rmerged = composite(resourceA, resourceB); - rmerged->add(m_ratioKey+m_suffixA, toString(ovrRatioA)); - rmerged->add(m_ratioKey+m_suffixB, toString(ovrRatioB)); - rmerged->add(m_ratioKey, toString(ovrRatioA)); + rmerged->add(m_ratioKey+m_suffixA, QString::number(ovrRatioA)); + rmerged->add(m_ratioKey+m_suffixB, QString::number(ovrRatioB)); + rmerged->add(m_ratioKey, QString::number(ovrRatioA)); if ( isDebug() ) { - cout << "Merging " << resourceA->name() << " and " - << resourceB->name() << " creates " << rmerged->keys().size() << " keys.\n"; + cout << "Merging " << resourceA->name().toStdString() << " and " + << resourceB->name().toStdString() << " creates " << rmerged->keys().size() << " keys.\n"; } // Determine geometry disposition @@ -456,8 +456,8 @@ namespace Isis { rmerged->add(geom); double x, y; if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", toString(x)); - rmerged->add( "GisOverlapCentroidY", toString(y)); + rmerged->add( "GisOverlapCentroidX", QString::number(x)); + rmerged->add( "GisOverlapCentroidY", QString::number(y)); } } else if ( Union == m_merge ) { @@ -465,8 +465,8 @@ namespace Isis { rmerged->add(geom); double x, y; if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", toString(x)); - rmerged->add( "GisOverlapCentroidY", toString(y)); + rmerged->add( "GisOverlapCentroidX", QString::number(x)); + rmerged->add( "GisOverlapCentroidY", QString::number(y)); } } else if ( Centroid == m_merge ) { @@ -474,8 +474,8 @@ namespace Isis { double x, y; // Only works if the centroid value is defined if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", toString(x)); - rmerged->add( "GisOverlapCentroidY", toString(y)); + rmerged->add( "GisOverlapCentroidX", QString::number(x)); + rmerged->add( "GisOverlapCentroidY", QString::number(y)); SharedGisGeometry centroid(geom->centroid()); rmerged->add(centroid); } @@ -484,8 +484,8 @@ namespace Isis { SharedGisGeometry geom(resourceA->geometry()); double x, y; if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", toString(x)); - rmerged->add( "GisOverlapCentroidY", toString(y)); + rmerged->add( "GisOverlapCentroidX", QString::number(x)); + rmerged->add( "GisOverlapCentroidY", QString::number(y)); } rmerged->add(geom); } @@ -493,16 +493,16 @@ namespace Isis { SharedGisGeometry geom(resourceB->geometry()); double x, y; if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", toString(x)); - rmerged->add( "GisOverlapCentroidY", toString(y)); + rmerged->add( "GisOverlapCentroidX", QString::number(x)); + rmerged->add( "GisOverlapCentroidY", QString::number(y)); } rmerged->add(geom); } if ( isDebug() ) { if ( rmerged->exists("GisOverlapCentroidX") ) { - cout << "GisOverlapCentroidX = " << rmerged->value("GisOverlapCentroidX") << "\n"; - cout << "GisOverlapCentroidY = " << rmerged->value("GisOverlapCentroidY") << "\n"; + cout << "GisOverlapCentroidX = " << rmerged->value("GisOverlapCentroidX").toStdString() << "\n"; + cout << "GisOverlapCentroidY = " << rmerged->value("GisOverlapCentroidY").toStdString() << "\n"; } } return (rmerged); diff --git a/isis/src/base/apps/isisminer/GisUnionStrategy.cpp b/isis/src/base/apps/isisminer/GisUnionStrategy.cpp index 15bc858e13..8d0f76e532 100644 --- a/isis/src/base/apps/isisminer/GisUnionStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisUnionStrategy.cpp @@ -53,8 +53,8 @@ namespace Isis { m_ratioKey(""), m_union(0) { PvlFlatMap parms( getDefinitionMap() ); - m_overlapMin = toDouble(parms.get("OverlapMinimum", "0.0")); - m_overlapMax = toDouble(parms.get("OverlapMaximum", "1.0")); + m_overlapMin = parms.get("OverlapMinimum", "0.0").toDouble(); + m_overlapMax = parms.get("OverlapMaximum", "1.0").toDouble(); m_ratioKey = parms.get("RatioRef", "UnionOverlapRatio"); } @@ -80,7 +80,7 @@ namespace Isis { if ( !m_union.isNull() ) { // Union geometry is present and good double ratio = geom->intersectRatio(*m_union); - resource->add(m_ratioKey, toString(ratio)); + resource->add(m_ratioKey, QString::number(ratio)); if ( (ratio >= m_overlapMin) && (ratio <= m_overlapMax) ) { m_union = SharedGisGeometry(m_union->g_union(*geom)); } diff --git a/isis/src/base/apps/isisminer/IsNumericStrategy.cpp b/isis/src/base/apps/isisminer/IsNumericStrategy.cpp index 3697a01801..84c638135f 100644 --- a/isis/src/base/apps/isisminer/IsNumericStrategy.cpp +++ b/isis/src/base/apps/isisminer/IsNumericStrategy.cpp @@ -98,7 +98,7 @@ namespace Isis { } else { try { - toDouble(resource->value(key)); + resource->value(key).toDouble(); } catch (IException &ie) { badkeys.push_back(key); diff --git a/isis/src/base/apps/isisminer/LimitStrategy.cpp b/isis/src/base/apps/isisminer/LimitStrategy.cpp index 1738cc6af8..294751e191 100644 --- a/isis/src/base/apps/isisminer/LimitStrategy.cpp +++ b/isis/src/base/apps/isisminer/LimitStrategy.cpp @@ -88,7 +88,7 @@ namespace Isis { if ( (0 == n) || (resource->isDiscarded()) ) return (0); if ( isDebug() ) { - cout << "Limit::Resource " << resource->name() << " result = " << result() << "\n"; + cout << "Limit::Resource " << resource->name().toStdString() << " result = " << result() << "\n"; } if (!(result() != 0.0)) { diff --git a/isis/src/base/apps/isisminer/NumericalSortStrategy.cpp b/isis/src/base/apps/isisminer/NumericalSortStrategy.cpp index 6ccf896779..1f4205ca0b 100644 --- a/isis/src/base/apps/isisminer/NumericalSortStrategy.cpp +++ b/isis/src/base/apps/isisminer/NumericalSortStrategy.cpp @@ -74,7 +74,7 @@ namespace Isis { // check validity of keyword if ( (m_order != "ascending") && (m_order != "descending") ) { - std::string mess = "Specified sort Order [" + order + "] is invalid." + std::string mess = "Specified sort Order [" + order.toStdString() + "] is invalid." " Must be Ascending or Descending."; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -152,7 +152,7 @@ namespace Isis { if ( b->isDiscarded() ) { return (true); } - return (toDouble(a->value(m_sortKey)) < toDouble(b->value(m_sortKey))); + return (a->value(m_sortKey).toDouble() < b->value(m_sortKey).toDouble()); } @@ -189,7 +189,7 @@ namespace Isis { if ( b->isDiscarded() ) { return (true); } - return (toDouble(a->value(m_sortKey)) > toDouble(b->value(m_sortKey))); + return (a->value(m_sortKey).toDouble() > b->value(m_sortKey).toDouble()); } } //namespace Isis diff --git a/isis/src/base/apps/isisminer/PdsColumn.cpp b/isis/src/base/apps/isisminer/PdsColumn.cpp index ac26fb465b..200249f20c 100644 --- a/isis/src/base/apps/isisminer/PdsColumn.cpp +++ b/isis/src/base/apps/isisminer/PdsColumn.cpp @@ -136,7 +136,7 @@ namespace Isis { * column. */ void PdsColumn::setBytes(const int &bytes) { - add("BYTES", toString(bytes)); + add("BYTES", QString::number(bytes)); return; } @@ -150,7 +150,7 @@ namespace Isis { * column. */ int PdsColumn::bytes() const { - return ( toInt(value("BYTES", "0"))); + return value("BYTES", "0").toInt(); } @@ -220,7 +220,7 @@ namespace Isis { * PDS column resource. */ void PdsColumn::setStartByte(const int &bytes) { - add("START_BYTE", toString(bytes)); + add("START_BYTE", QString::number(bytes)); return; } @@ -234,7 +234,7 @@ namespace Isis { * for this PDS column. */ int PdsColumn::startByte() const { - return ( toInt( value("START_BYTE", "0") ) ); + return value("START_BYTE", "0").toInt(); } @@ -392,7 +392,7 @@ namespace Isis { if ( pos < 0 ) { return (0); } - return (toInt(rx.cap(2))); + return rx.cap(2).toInt(); } /** @@ -410,7 +410,7 @@ namespace Isis { PdsColumn *PdsColumn::promote(SharedResource &resource) { PdsColumn *column = dynamic_cast (resource.data()); if ( 0 == column ) { - std::string mess = "Could not cast Resource [" + resource->name() + + std::string mess = "Could not cast Resource [" + resource->name().toStdString() + "] to a PdsColumn pointer."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp index 83b80cee5d..2ad25eb0de 100644 --- a/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableCreatorStrategy.cpp @@ -106,7 +106,7 @@ namespace Isis { QString fmtfile = translateKeywordArgs("PdsFormatFile", getGlobals(m_parameters, globals)); if ( isDebug() ) { - cout << "PdsTableCreator::PdsFormatFile = " << fmtfile << "\n"; + cout << "PdsTableCreator::PdsFormatFile = " << fmtfile.toStdString() << "\n"; } Pvl fmtpvl(fmtfile.toStdString()); readColumns(fmtpvl); @@ -114,7 +114,7 @@ namespace Isis { // Check for argument replacement QString fname = translateKeywordArgs("PdsTableFile", getGlobals(m_parameters, globals)); if ( isDebug() ) { - cout << "PdsTableCreator::PdsTableFile = " << fname << "\n"; + cout << "PdsTableCreator::PdsTableFile = " << fname.toStdString() << "\n"; } // Now open the filename @@ -130,7 +130,7 @@ namespace Isis { if ( !os.is_open() ) { std::string mess = "PdsTableCreator::Cannot open/create output file (" + - fname + ")"; + fname.toStdString() + ")"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -152,7 +152,7 @@ namespace Isis { row += separator + col->formattedValue(resource, m_null); separator = m_delimiter; } - os << row << "\n"; + os << row.toStdString() << "\n"; nrows++; } } diff --git a/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp index 45d59b9254..4b73156097 100644 --- a/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp @@ -204,7 +204,7 @@ namespace Isis { for ( int i = 0 ; i < nColumns ; i++) { QString name = definition->value("Column", i); SharedResource column(new PdsColumn(name)); - column->add("COLUMN_NUMBER", toString(i+1)); + column->add("COLUMN_NUMBER", QString::number(i+1)); column->add("NAME", name); @@ -267,10 +267,10 @@ namespace Isis { int nvals = definition->count(keynam); if ( !((maxcols == nvals) || (mincols == nvals)) ) { if ( throwOnError ) { - std::string mess = "The keyword count [" + QString::number(nvals) + "] for the given " + keynam + std::string mess = "The keyword count [" + toString(nvals) + "] for the given " + keynam.toStdString() + " Resource definition is invalid. Must equal maxcols [" - + QString::number(maxcols) + "or mincols [" - + QString::number(mincols) + "]."; + + toString(maxcols) + "or mincols [" + + toString(mincols) + "]."; throw IException(IException::User, mess, _FILEINFO_); } return (-1); diff --git a/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp index 388eb1f926..c4afa016f3 100644 --- a/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp @@ -77,7 +77,7 @@ namespace Isis { m_identity = translateKeywordArgs("Identity", globals,"Row"); m_table = translateKeywordArgs("TableName", globals,""); if ( !m_table.isEmpty() ) ImportPdsTable::setName(m_table); - m_useFormatted = toBool(parms.get("UseFormattedName", "true")); + m_useFormatted = toBool(parms.get("UseFormattedName", "true").toStdString()); return; } @@ -107,12 +107,12 @@ namespace Isis { QString lblfile = translateKeywordArgs("PdsLabelFile", globals); if ( isDebug() ) { - cout << "PdsTableReader::PdsLabelFile = " << lblfile << "\n"; + cout << "PdsTableReader::PdsLabelFile = " << lblfile.toStdString() << "\n"; } // Check for argument replacement QString tblfile = translateKeywordArgs("PdsTableFile", globals,""); if ( isDebug() ) { - cout << "PdsTableReader::PdsIndexFile = " << tblfile << "\n"; + cout << "PdsTableReader::PdsIndexFile = " << tblfile.toStdString() << "\n"; } // Now open the filename @@ -130,7 +130,7 @@ namespace Isis { catch ( IException &ie ) { m_resources.clear(); m_globals.clear(); - std::string mess = "Failed to read PDS label/table " + lblfile + "," + tblfile; + std::string mess = "Failed to read PDS label/table " + lblfile.toStdString() + "," + tblfile.toStdString(); throw IException(ie, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp b/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp index 1c450f41ec..3f440ea648 100644 --- a/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp @@ -174,8 +174,8 @@ namespace Isis { pvlsrc->setName(identity); if ( isDebug() ) { - cout << " PvlReader::Resource::" << rowId - << "::Identity = " << identity << "\n"; + cout << " PvlReader::Resource::" << rowId.toStdString() + << "::Identity = " << identity.toStdString() << "\n"; } // Import geometry w/exception handling @@ -186,7 +186,7 @@ namespace Isis { } catch (IException &ie) { std::string mess = "Geometry conversion failed horribly for Resource(" + - identity + ")"; + identity.toStdString() + ")"; throw IException(ie, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/ResourceManagerStrategy.cpp b/isis/src/base/apps/isisminer/ResourceManagerStrategy.cpp index bfca010bc1..4346f03a91 100644 --- a/isis/src/base/apps/isisminer/ResourceManagerStrategy.cpp +++ b/isis/src/base/apps/isisminer/ResourceManagerStrategy.cpp @@ -127,7 +127,7 @@ namespace Isis { resetProcessed(); BOOST_FOREACH ( QString op , m_operators ) { OperatorFn func = findOperationFn(op); - if ( isDebug() ) { cout << " Running " << op << ":"; } + if ( isDebug() ) { cout << " Running " << op.toStdString() << ":"; } int nops = CALL_MEMBER_FN(*this, func)(op, resources); @@ -173,13 +173,13 @@ namespace Isis { const { QStringList parts = qualifiers(op); if ( parts.isEmpty() || (parts.size() > 2)) { - std::string mess = "ResourceManager::Operator [" + op + "] is ill-formed."; + std::string mess = "ResourceManager::Operator [" + op.toStdString() + "] is ill-formed."; throw IException(IException::User, mess, _FILEINFO_); } QString opName = parts[0].toLower(); if ( !m_opFunctions.contains(opName) ) { - std::string mess = "ResourceManager::Operator [" + op + "] not recognized."; + std::string mess = "ResourceManager::Operator [" + op.toStdString() + "] not recognized."; mess += " Valid are ResetDiscard, ToggleDiscard, DeleteDiscard" " and DeleteAsset::AssetName."; throw IException(IException::User, mess, _FILEINFO_); @@ -285,8 +285,8 @@ namespace Isis { ResourceList &resources) { QStringList parts = qualifiers(op); if ( parts.size() != 2) { - std::string mess = "ResourceManager " + parts[0] + " requires an asset name. " - " Operation [" + op + "] is ill-formed."; + std::string mess = "ResourceManager " + parts[0].toStdString() + " requires an asset name. " + " Operation [" + op.toStdString() + "] is ill-formed."; throw IException(IException::User, mess, _FILEINFO_); } @@ -324,8 +324,8 @@ namespace Isis { ResourceList &resources) { QStringList parts = qualifiers(op); if ( parts.size() != 2) { - std::string mess = "ResourceManager " + parts[0] + " requires an asset name. " - " Operation [" + op + "] is ill-formed."; + std::string mess = "ResourceManager " + parts[0].toStdString() + " requires an asset name. " + " Operation [" + op.toStdString() + "] is ill-formed."; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp index a4fe89c845..b7a1cc164a 100644 --- a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp +++ b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp @@ -119,9 +119,9 @@ namespace Isis { QStringList excludes; excludes << "Commands" << "PreCommands" << "PostCommands"; PvlFlatMap skeys( getDefinition(), PvlConstraints::withExcludes(excludes)); - m_skipAllNoData = toBool(skeys.get("SkipCommandsIfNoData", "true")); - m_onPreCommandErrorContinue = toBool(skeys.get("OnPreCommandErrorContinue", "false")); - m_onPostCommandErrorContinue = toBool(skeys.get("OnPostCommandErrorContinue", "false")); + m_skipAllNoData = toBool(skeys.get("SkipCommandsIfNoData", "true").toStdString()); + m_onPreCommandErrorContinue = toBool(skeys.get("OnPreCommandErrorContinue", "false").toStdString()); + m_onPostCommandErrorContinue = toBool(skeys.get("OnPostCommandErrorContinue", "false").toStdString()); return; } @@ -165,13 +165,13 @@ namespace Isis { cmd = scanAndReplace(cmd, "'", "\'"); if ( isDebug() ) { - cout << "Running " << command.m_name << " PRE command: " << cmd << "\n"; + cout << "Running " << command.m_name.toStdString() << " PRE command: " << cmd.toStdString() << "\n"; } int status = system(cmd.toLatin1().data()); if ( 0 != status) { if ( !m_onPreCommandErrorContinue ) { - std::string mess = command.m_name + " RunCommand::PreCommand failed - " + - cmd + " - you are terminated!"; + std::string mess = command.m_name.toStdString() + " RunCommand::PreCommand failed - " + + cmd.toStdString() + " - you are terminated!"; throw IException(IException::User, mess, _FILEINFO_); } } @@ -191,15 +191,15 @@ namespace Isis { cmd = scanAndReplace(cmd, "'", "\'"); if ( isDebug() ) { - cout << "Running " << command.m_name << " POST command: " << cmd << "\n"; + cout << "Running " << command.m_name.toStdString() << " POST command: " << cmd.toStdString() << "\n"; } // Check status and disposition int status = system(cmd.toLatin1().data()); if ( 0 != status) { if ( !m_onPostCommandErrorContinue ) { - std::string mess = command.m_name + " RunCommand::PostCommand failed - " + - cmd + " - you are terminated!"; + std::string mess = command.m_name.toStdString() + " RunCommand::PostCommand failed - " + + cmd.toStdString() + " - you are terminated!"; throw IException(IException::User, mess, _FILEINFO_); } } @@ -230,14 +230,14 @@ namespace Isis { cmd = scanAndReplace(cmd, "'", "\'"); if ( isDebug() ) { - cout << "Running " << command.m_name << " command: " << cmd << "\n"; + cout << "Running " << command.m_name.toStdString() << " command: " << cmd.toStdString() << "\n"; } int status = system(cmd.toLatin1().data()); // If command failed, deactivate the resource if (status != 0 ) { if ( isDebug() ) { - cout << "Command " << command.m_name + cout << "Command " << command.m_name.toStdString() << " failed with status = " << status << "\n"; } resource->discard(); diff --git a/isis/src/base/apps/isisminer/SidebarStrategy.cpp b/isis/src/base/apps/isisminer/SidebarStrategy.cpp index d145e31887..dad9d722ba 100644 --- a/isis/src/base/apps/isisminer/SidebarStrategy.cpp +++ b/isis/src/base/apps/isisminer/SidebarStrategy.cpp @@ -70,13 +70,13 @@ namespace Isis { m_strategies() { PvlFlatMap parms(getDefinitionMap()); - m_savepoint = toBool(parms.get("SavePoint", "True")); - m_savedeletes = toBool(parms.get("SaveDelete", parms.get("SavePoint", "True"))); + m_savepoint = toBool(parms.get("SavePoint", "True").toStdString()); + m_savedeletes = toBool(parms.get("SaveDelete", parms.get("SavePoint", "True")).toStdString()); StrategyFactory *factory = StrategyFactory::instance(); QString config = translateKeywordArgs("StrategyConfigFile", globals); if ( !config.isEmpty() ) { - if ( isDebug() ) cout << "Loading IsisMiner Objects from external config file " << config << "\n"; + if ( isDebug() ) cout << "Loading IsisMiner Objects from external config file " << config.toStdString() << "\n"; m_strategies = factory->buildRun(config); } else if ( getDefinition().hasObject("IsisMiner") ) { @@ -84,12 +84,12 @@ namespace Isis { m_strategies = factory->buildRun(getDefinition().findObject("IsisMiner")); } else { - std::string mess = "No IsisMiner strategies found in " + name() + " Sidebar."; + std::string mess = "No IsisMiner strategies found in " + name().toStdString() + " Sidebar."; throw IException(IException::User, mess, _FILEINFO_); } if ( isDebug() ) { - cout << type() << "::" << name() << "::StrategiesLoaded = " + cout << type().toStdString() << "::" << name().toStdString() << "::StrategiesLoaded = " << m_strategies.size() << "\n"; } @@ -148,15 +148,15 @@ namespace Isis { (void) preRunProcess(resources, globals); int nth(0); BOOST_FOREACH ( SharedStrategy strategy, m_strategies ) { - if ( isDebug() ) cout << "\nRunning SideBar::" << strategy->type() << "::" - << strategy->name() << "\n"; + if ( isDebug() ) cout << "\nRunning SideBar::" << strategy->type().toStdString() << "::" + << strategy->name().toStdString() << "\n"; preStrategyProcess(nth, strategy.data(), resources, globals); int n = apply(strategy, resources, globals); postStrategyProcess(nth, strategy.data(), resources, globals); unsigned int ntotal = strategy->totalProcessed(); if ( isDebug() ) { - cout << n << " of " << ntotal << " processed in " << strategy->type() << "::" - << strategy->name() << "\n"; + cout << n << " of " << ntotal << " processed in " << strategy->type().toStdString() << "::" + << strategy->name().toStdString() << "\n"; } nth++; } diff --git a/isis/src/base/apps/isisminer/StereoPairStrategy.cpp b/isis/src/base/apps/isisminer/StereoPairStrategy.cpp index 7653840cd5..c0f556f6c4 100644 --- a/isis/src/base/apps/isisminer/StereoPairStrategy.cpp +++ b/isis/src/base/apps/isisminer/StereoPairStrategy.cpp @@ -87,7 +87,7 @@ namespace Isis { m_myDebug(false) { PvlFlatMap parms( getDefinition(), PvlConstraints::withExcludes(QStringList("IsisMiner")) ); - m_pixelPrecisionMatch = toDouble(parms.get("PixelPrecisionMatch", "2.0")); + m_pixelPrecisionMatch = parms.get("PixelPrecisionMatch", "2.0").toDouble(); if ( isDebug() ) { cout << "PixelPrecisionMatch = " << m_pixelPrecisionMatch << "\n"; } @@ -106,7 +106,7 @@ namespace Isis { } // Determine what to use for VerticalPrecision - m_useStereoAngle = toBool( parms.get("UseStereoAngle", "True") ); + m_useStereoAngle = toBool( parms.get("UseStereoAngle", "True").toStdString() ); // Initialize the calculator strategy for ranking purposes m_calculator.reset(new CalculatorStrategy(definition, globals)); @@ -140,7 +140,7 @@ namespace Isis { if ( resource->isActive() ) { // Check for first level constraints and deactive ones that don't pass if ( isDebug() ) { - cout << "\n===> StereoPair::apply processing to source " << resource->name() << "\n"; + cout << "\n===> StereoPair::apply processing to source " << resource->name().toStdString() << "\n"; } if (!passConstraints(resource, m_imageStrength)) { resource->discard(); @@ -229,20 +229,20 @@ namespace Isis { // empty resource returned. if ( !computeStereo(resourceA, resourceB, stpair, globals) ) { if ( isDebug() ) { - cout << "StereoPair " << resourceA->name() << "/" << resourceB->name() + cout << "StereoPair " << resourceA->name().toStdString() << "/" << resourceB->name().toStdString() << " failed!\n"; } return (SharedResource()); } if ( isDebug() ) { - cout << "StereoPair " << resourceA->name() << "/" << resourceB->name() + cout << "StereoPair " << resourceA->name().toStdString() << "/" << resourceB->name().toStdString() << " is a match!\n"; } } catch (IException &ie) { if ( isDebug() ) { - cout << "StereoPair " << resourceA->name() << "/" << resourceB->name() + cout << "StereoPair " << resourceA->name().toStdString() << "/" << resourceB->name().toStdString() << " incurred an exception! Error = " << ie.what() << "!\n"; } stpair.clear(); @@ -301,46 +301,46 @@ namespace Isis { (void) rankConstraints(resourceA, m_imageStrength, rankA, stereo, "Rank"+suffixA()); (void) rankConstraints(resourceB, m_imageStrength, rankB, stereo, "Rank"+suffixB()); - stereo->add("ImageStrengthRank"+suffixA(), toString(rankA)); - stereo->add("ImageStrengthRank"+suffixB(), toString(rankB)); + stereo->add("ImageStrengthRank"+suffixA(), QString::number(rankA)); + stereo->add("ImageStrengthRank"+suffixB(), QString::number(rankB)); // Level1 constraints rank is the average of the two level1 constraints double rank = (rankA + rankB) / 2.0; - stereo->add("ImageStrengthRank", toString(rank)); + stereo->add("ImageStrengthRank", QString::number(rank)); // Now compute parallax height ratio QString plx = m_keywordMap.get("ParallaxX", "ParallaxX"); QString ply = m_keywordMap.get("ParallaxY", "ParallaxY"); - double px1 = toDouble(resourceA->value(plx)); - double py1 = toDouble(resourceA->value(ply)); - double px2 = toDouble(resourceB->value(plx)); - double py2 = toDouble(resourceB->value(ply)); + double px1 = resourceA->value(plx).toDouble(); + double py1 = resourceA->value(ply).toDouble(); + double px2 = resourceB->value(plx).toDouble(); + double py2 = resourceB->value(ply).toDouble(); double pxdiff = px1 - px2; double pydiff = py1 - py2; double dp = sqrt( pxdiff*pxdiff + pydiff*pydiff ); - stereo->add("ParallaxHeightRatio", toString(dp)); + stereo->add("ParallaxHeightRatio", QString::number(dp)); // Now compute shadow tip distance QString shx = m_keywordMap.get("ShadowX", "ShadowX"); QString shy = m_keywordMap.get("ShadowY", "ShadowY"); - double shx1 = toDouble(resourceA->value(shx)); - double shy1 = toDouble(resourceA->value(shy)); - double shx2 = toDouble(resourceB->value(shx)); - double shy2 = toDouble(resourceB->value(shy)); + double shx1 = resourceA->value(shx).toDouble(); + double shy1 = resourceA->value(shy).toDouble(); + double shx2 = resourceB->value(shx).toDouble(); + double shy2 = resourceB->value(shy).toDouble(); double shxdiff = shx1 - shx2; double shydiff = shy1 - shy2; double dsh = sqrt( shxdiff*shxdiff + shydiff*shydiff ); - stereo->add("ShadowTipDistance", toString(dsh)); + stereo->add("ShadowTipDistance", QString::number(dsh)); // Now compute Resolution QString reskey = m_keywordMap.get("Resolution", "Resolution"); - double pxlresA = toDouble(resourceA->value(reskey)); - double pxlresB = toDouble(resourceB->value(reskey)); + double pxlresA = resourceA->value(reskey).toDouble(); + double pxlresB = resourceB->value(reskey).toDouble(); double resratio = pxlresA / pxlresB; if ( resratio < 1.0 ) { resratio = 1.0 / resratio; } - stereo->add("ResolutionRatio", toString(resratio)); + stereo->add("ResolutionRatio", QString::number(resratio)); // Now compute DeltaSunAzimuth (void) computeDelta(resourceA, resourceB, "DeltaSolarAzimuth", @@ -355,7 +355,7 @@ namespace Isis { double stAngle(dp); // ParallelHeightRatio is the default if ( computeStereoAngle(resourceA, resourceB, stereo, globals) ) { if ( m_useStereoAngle ) { - stAngle = tan(toDouble(stereo->value("StereoAngle")) * rpd_c()); + stAngle = tan(stereo->value("StereoAngle").toDouble() * rpd_c()); } } @@ -366,7 +366,7 @@ namespace Isis { // Ensure we have a valid stereo angle if ( qFuzzyCompare(stAngle+1.0, 1.0) ) { stAngle = 0.1E-6; } double evp = rho * gsd / stAngle; - stereo->add("VerticalPrecision", toString(evp)); + stereo->add("VerticalPrecision", QString::number(evp)); // Now compute the stereo rank // m_myDebug = true; @@ -380,7 +380,7 @@ namespace Isis { // Good, compute rank values double rankS; (void) rankConstraints(stereo, m_stereoStrength, rankS, stereo); - stereo->add("StereoStrengthRank", toString(rankS)); + stereo->add("StereoStrengthRank", QString::number(rankS)); // Evaluate the rank @@ -497,11 +497,11 @@ namespace Isis { for ( ; constraint != constraints.constEnd() ; ++constraint ) { QString key = m_keywordMap.get(constraint.key(), constraint.key()); if ( resource->exists(key) ) { - double value = toDouble(resource->value(key)); + double value = resource->value(key).toDouble(); QVector thresholds = constraint.value(); double myrank = computeRank(value, thresholds); if ( !out.isNull() ) { - out->add(constraint.key()+suffix, toString(myrank)); + out->add(constraint.key()+suffix, QString::number(myrank)); } rank += myrank; } @@ -526,18 +526,18 @@ namespace Isis { // Count missing keywords and passing is required that all exist int nbad(0); - if ( isDebug() ) { cout << "Running passConstraints on " << resource->name() << "...\n";} + if ( isDebug() ) { cout << "Running passConstraints on " << resource->name().toStdString() << "...\n";} ConstraintList::const_iterator constraint = constraints.constBegin(); for ( ; constraint != constraints.constEnd() ; ++constraint) { QString key = m_keywordMap.get(constraint.key(), constraint.key()); if ( resource->exists(key) ) { - double value = toDouble(resource->value(key)); + double value = resource->value(key).toDouble(); QVector thresholds = constraint.value(); Q_ASSERT( thresholds.size() >= 3 ); if ( (value < thresholds[0]) || (value > thresholds[1]) ) { nbad++; if ( isDebug() ) { - cout << constraint.key() << "::(" << key << ") = " << value + cout << constraint.key().toStdString() << "::(" << key.toStdString() << ") = " << value << " is out of constraints boundaries!\n"; } } @@ -545,8 +545,8 @@ namespace Isis { else { nbad++; if ( isDebug() ) { - cout << constraint.key() << "::(" << key - << ") does not exist in resource " << resource->name() << "\n"; + cout << constraint.key().toStdString() << "::(" << key.toStdString() + << ") does not exist in resource " << resource->name().toStdString() << "\n"; } } } @@ -590,10 +590,10 @@ bool StereoPairStrategy::computeDelta(const SharedResource &resourceA, // Now compute requested delta QString dsckey = m_keywordMap.get(keysrc, keysrc); if ( resourceA->exists(dsckey) && resourceB->exists(dsckey) ) { - double dsc1 = toDouble(resourceA->value(dsckey)); - double dsc2 = toDouble(resourceB->value(dsckey)); + double dsc1 = resourceA->value(dsckey).toDouble(); + double dsc2 = resourceB->value(dsckey).toDouble(); double dscaz = acos( cos((dsc2 - dsc1) * rpd_c()) ) * dpr_c(); - composite->add(parameter, toString(dscaz)); + composite->add(parameter, QString::number(dscaz)); return (true); } @@ -644,28 +644,28 @@ bool StereoPairStrategy::computeStereoAngle(const SharedResource &resourceA, keyword = "CenterRadius"; - double radiusA = toDouble(getStereoValue(keyword, globalA)); - double radiusB = toDouble(getStereoValue(keyword, globalB)); + double radiusA = (getStereoValue(keyword, globalA).toDouble()); + double radiusB = (getStereoValue(keyword, globalB).toDouble()); keyword = "CenterLatitude"; - double latA = toDouble(getStereoValue(keyword, globalA)); - double latB = toDouble(getStereoValue(keyword, globalB)); + double latA = (getStereoValue(keyword, globalA).toDouble()); + double latB = (getStereoValue(keyword, globalB).toDouble()); keyword = "CenterLongitude"; - double lonA = toDouble(getStereoValue(keyword, globalA)); - double lonB = toDouble(getStereoValue(keyword, globalB)); + double lonA = (getStereoValue(keyword, globalA).toDouble()); + double lonB = (getStereoValue(keyword, globalB).toDouble()); keyword = "TargetCenterDistance"; - double tcentA = toDouble(getStereoValue(keyword, globalA)); - double tcentB = toDouble(getStereoValue(keyword, globalB)); + double tcentA = (getStereoValue(keyword, globalA).toDouble()); + double tcentB = (getStereoValue(keyword, globalB).toDouble()); keyword = "SubspacecraftLatitude"; - double sclatA = toDouble(getStereoValue(keyword, globalA)); - double sclatB = toDouble(getStereoValue(keyword, globalB)); + double sclatA = (getStereoValue(keyword, globalA).toDouble()); + double sclatB = (getStereoValue(keyword, globalB).toDouble()); keyword = "SubspacecraftLongitude"; - double sclonA = toDouble(getStereoValue(keyword, globalA)); - double sclonB = toDouble(getStereoValue(keyword, globalB)); + double sclonA = (getStereoValue(keyword, globalA).toDouble()); + double sclonB = (getStereoValue(keyword, globalB).toDouble()); keyword = "AllDone..."; @@ -701,14 +701,14 @@ bool StereoPairStrategy::computeStereoAngle(const SharedResource &resourceA, // Convert to degrees convang = acos ( convang ) * dpr_c(); - stereo->add("StereoAngle", toString(convang)); + stereo->add("StereoAngle", QString::number(convang)); if ( isDebug() ) { cout << "StereoAngle = " << convang << "\n"; } } catch (IException &ie) { if ( isDebug() ) { - cout << "Error computing StereoAngle [Keyword = " << keyword << "]:" + cout << "Error computing StereoAngle [Keyword = " << keyword.toStdString() << "]:" << ie.what() << "\n"; } return (false); diff --git a/isis/src/base/apps/isisminer/StrategyFactory.cpp b/isis/src/base/apps/isisminer/StrategyFactory.cpp index 56faafdba8..0287a2bc4b 100644 --- a/isis/src/base/apps/isisminer/StrategyFactory.cpp +++ b/isis/src/base/apps/isisminer/StrategyFactory.cpp @@ -212,7 +212,7 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; Pvl pvl(configFile.toStdString()); if (!pvl.hasObject("IsisMiner") ) { throw IException(IException::User, - "Strategy config file [" + configFile + + "Strategy config file [" + configFile.toStdString() + "] does not contain IsisMiner strategies object.", _FILEINFO_); } @@ -331,10 +331,10 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; } if ( !missing.isEmpty() ) { - std::string mess = "Users of this configuration must provide the " + QString mess = "Users of this configuration must provide the " "following parameter(s) but they were not found: " + missing.join(", "); - throw IException(IException::User, mess, _FILEINFO_); + throw IException(IException::User, mess.toStdString(), _FILEINFO_); } } return; @@ -370,7 +370,7 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; sname = QString::fromStdString(definition["Name"][0]); } std::string mess = "Strategy Type does not exist in configuration for " + - sname + " strategy!"; + sname.toStdString() + " strategy!"; throw IException(ie, IException::User, mess, _FILEINFO_); } @@ -530,7 +530,7 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; // Check for successful load if ( !plugin.isLoaded() ) { - std::string mess = "Cannot find/load Strategy plugin library " + libname; + std::string mess = "Cannot find/load Strategy plugin library " + libname.toStdString(); throw IException(IException::User, mess, _FILEINFO_); } @@ -539,8 +539,8 @@ StrategyFactory *StrategyFactory::m_strategymaker = 0; QString routine = pluginkeys.get("Routine"); StrategyCreator maker = (StrategyCreator) plugin.resolve(routine.toLatin1().data()); if ( !maker ) { - std::string mess = "Unable to resolve Routine name [" + routine + - "] in Strategy plugin [" + plugin.fileName() + "]"; + std::string mess = "Unable to resolve Routine name [" + routine.toStdString() + + "] in Strategy plugin [" + plugin.fileName().toStdString() + "]"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/map2map/map2map.cpp b/isis/src/base/apps/map2map/map2map.cpp index 82cf54acf5..2f09a51f36 100644 --- a/isis/src/base/apps/map2map/map2map.cpp +++ b/isis/src/base/apps/map2map/map2map.cpp @@ -362,7 +362,7 @@ namespace Isis { interp = new Interpolator(Interpolator::CubicConvolutionType); } else { - std::string msg = "Unknow value for INTERP [" + ui.GetString("INTERP") + "]"; + std::string msg = "Unknow value for INTERP [" + ui.GetString("INTERP").toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/mappt/mappt.cpp b/isis/src/base/apps/mappt/mappt.cpp index dd69ae6eb1..ccc0ce9441 100644 --- a/isis/src/base/apps/mappt/mappt.cpp +++ b/isis/src/base/apps/mappt/mappt.cpp @@ -146,7 +146,7 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac throw IException(IException::User, msg, _FILEINFO_); } - IString coordsys = ui.GetString("COORDSYS"); + IString coordsys = ui.GetString("COORDSYS").toStdString(); coordsys.UpCase(); // All of these ifs will finish by setting the ground in the projection, @@ -169,7 +169,7 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac // Does it exist? if(!mapFile.fileExists()) { - std::string msg = "Filename [" + ui.GetFileName("MAP") + "] does not exist"; + std::string msg = "Filename [" + ui.GetFileName("MAP").toStdString() + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } @@ -259,7 +259,7 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac results += PvlKeyword("Line", std::to_string(proj->WorldY())); results += PvlKeyword("Band", std::to_string(icube->physicalBand(1))); results += PvlKeyword("FilterName", filterName.toStdString()); - results += PvlKeyword("PixelValue", PixelToString(b[0]).toStdString()); + results += PvlKeyword("PixelValue", PixelToString(b[0])); results += PvlKeyword("X", std::to_string(proj->XCoord())); results += PvlKeyword("Y", std::to_string(proj->YCoord())); @@ -394,8 +394,8 @@ QList< QPair > getMapPoints(const UserInterface &ui, bool usePoi throw IException(IException::User, msg, _FILEINFO_); } for (int row = 0; row < reader.rows(); row++) { - point1 = toDouble(reader.getRow(row)[0]); - point2 = toDouble(reader.getRow(row)[1]); + point1 = reader.getRow(row)[0].toDouble(); + point2 = reader.getRow(row)[1].toDouble(); points.append(QPair(point1, point2)); } } diff --git a/isis/src/base/apps/maptrim/maptrim.cpp b/isis/src/base/apps/maptrim/maptrim.cpp index 2b3123c1f0..8cf852a8e4 100644 --- a/isis/src/base/apps/maptrim/maptrim.cpp +++ b/isis/src/base/apps/maptrim/maptrim.cpp @@ -71,19 +71,19 @@ namespace Isis{ } else { tempFileName = FileName::createTempFile("TEMPORARYcropped.cub").name(); - cropParams += " to=" + tempFileName.ToQt(); + cropParams += " to=" + QString::fromStdString(tempFileName); } - cropParams += " sample= " + toString(smallestSample); - cropParams += " nsamples= " + toString(samples); - cropParams += " line= " + toString(smallestLine); - cropParams += " nlines= " + toString(lines); + cropParams += " sample= " + QString::number(smallestSample); + cropParams += " nsamples= " + QString::number(samples); + cropParams += " line= " + QString::number(smallestLine); + cropParams += " nlines= " + QString::number(lines); try { ProgramLauncher::RunIsisProgram("crop", cropParams); } catch(IException &e) { - std::string msg = "Could not execute crop with params: [" + cropParams + "]"; + std::string msg = "Could not execute crop with params: [" + cropParams.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } if(mode == "BOTH") { @@ -99,7 +99,7 @@ namespace Isis{ ProcessByLine p; CubeAttributeInput att; if(mode == "BOTH") { - p.SetInputCube(tempFileName.ToQt(), att); + p.SetInputCube(QString::fromStdString(tempFileName), att); } else { //if its trim CubeAttributeInput &inputAtt = ui.GetInputAttribute("FROM"); diff --git a/isis/src/base/apps/mosrange/mosrange.cpp b/isis/src/base/apps/mosrange/mosrange.cpp index 4b0a5e4996..64d4893332 100644 --- a/isis/src/base/apps/mosrange/mosrange.cpp +++ b/isis/src/base/apps/mosrange/mosrange.cpp @@ -81,7 +81,7 @@ namespace Isis { */ Pvl mosrange(FileList &cubeFileList, UserInterface &ui) { if ( cubeFileList.size() < 1) { - std::string msg = "The list file[" + ui.GetFileName("FROMLIST") + + std::string msg = "The list file[" + ui.GetFileName("FROMLIST").toStdString() + " does not contain any filenames"; throw IException(IException::User, msg, _FILEINFO_); } @@ -246,7 +246,7 @@ namespace Isis { (badfiles.size() == cubeFileList.size()) ) { std::string errors("--> Fatal Errors Encountered <___\n"); for (int i = 0 ; i < badfiles.size() ; i++) { - errors += badfiles[i].first + " - " + badfiles[i].second + "\n"; + errors += badfiles[i].first.toStdString() + " - " + badfiles[i].second.toStdString() + "\n"; } throw IException(IException::User, errors, _FILEINFO_); } diff --git a/isis/src/base/apps/nocam2map/nocam2map.cpp b/isis/src/base/apps/nocam2map/nocam2map.cpp index 46d078bee7..c2c2536c3c 100644 --- a/isis/src/base/apps/nocam2map/nocam2map.cpp +++ b/isis/src/base/apps/nocam2map/nocam2map.cpp @@ -157,17 +157,17 @@ namespace Isis { for (int i = 0; i < sampSol.Rows(); i++) { vector data = sampSol.GetInput(i); QString tmp = ""; - tmp += toString(sampSol.GetExpected(i)); + tmp += QString::number(sampSol.GetExpected(i)); tmp += ",\t"; - tmp += toString(lineSol.GetExpected(i)); + tmp += QString::number(lineSol.GetExpected(i)); tmp += ",\t"; - tmp += toString(data[0]); + tmp += QString::number(data[0]); tmp += ",\t"; - tmp += toString(data[1]); + tmp += QString::number(data[1]); tmp += ",\t"; - tmp += toString(sampResiduals[i]); + tmp += QString::number(sampResiduals[i]); tmp += ",\t"; - tmp += toString(lineResiduals[i]); + tmp += QString::number(lineResiduals[i]); oFile.PutLine(tmp + "\n"); } } diff --git a/isis/src/base/apps/overlapstats/overlapstats.cpp b/isis/src/base/apps/overlapstats/overlapstats.cpp index c08d905787..71051afecb 100644 --- a/isis/src/base/apps/overlapstats/overlapstats.cpp +++ b/isis/src/base/apps/overlapstats/overlapstats.cpp @@ -45,7 +45,7 @@ namespace Isis { for (int j = 0; j < currOverlap->Size(); j++) { QString currSerialNum = (*currOverlap)[j]; if (!serialNumbers.hasSerialNumber(currSerialNum)) { - IString msg = "Found serial number [" + currSerialNum + "] in overlap " + IString msg = "Found serial number [" + currSerialNum.toStdString() + "] in overlap " "list that was not in the provided cube list. Please ensure that " "the cube list is the same one used to generate your overlap list " "file."; @@ -144,32 +144,32 @@ namespace Isis { if (full) { if (firstFullOutput) { output << "Overlap ID"; - output << delim << "Thickness"; - output << delim << pretty << "Area"; - output << delim << pretty << pretty << "Image Count"; - output << delim << "Serial Numbers in Overlap"; - output << delim << "Image Files in Overlap"; + output << delim.toStdString() << "Thickness"; + output << delim.toStdString() << pretty.toStdString() << "Area"; + output << delim.toStdString() << pretty.toStdString() << pretty.toStdString() << "Image Count"; + output << delim.toStdString() << "Serial Numbers in Overlap"; + output << delim.toStdString() << "Image Files in Overlap"; output << endl; firstFullOutput = false; } - output << index << pretty; - output << delim << thicknessValue; + output << index << pretty.toStdString(); + output << delim.toStdString() << thicknessValue; if (tab) { - output << delim << FormatString(areaValue, 18, 4); + output << delim.toStdString() << FormatString(areaValue, 18, 4).toStdString(); } else { - output << delim << areaValue; + output << delim.toStdString() << areaValue; } - output << delim << overlaps[index]->Size() << pretty; - output << delim << (*overlaps[index])[0]; - output << delim << serialNumbers.fileName((*overlaps[index])[0]); + output << delim.toStdString() << overlaps[index]->Size() << pretty.toStdString(); + output << delim.toStdString() << (*overlaps[index])[0].toStdString(); + output << delim.toStdString() << serialNumbers.fileName((*overlaps[index])[0]).toStdString(); for (int sn = 1; sn < overlaps[index]->Size(); sn ++) { if (!singleLine) { - output << endl << pretty << delim << pretty << delim << pretty << delim; - output << pretty << pretty; + output << endl << pretty.toStdString() << delim.toStdString() << pretty.toStdString() << delim.toStdString() << pretty.toStdString() << delim.toStdString(); + output << pretty.toStdString() << pretty.toStdString(); } - output << delim << pretty << (*overlaps[index])[sn]; - output << delim << serialNumbers.fileName((*overlaps[index])[sn]); + output << delim.toStdString() << pretty.toStdString() << (*overlaps[index])[sn].toStdString(); + output << delim.toStdString() << serialNumbers.fileName((*overlaps[index])[sn]).toStdString(); } output << endl; } @@ -191,7 +191,7 @@ namespace Isis { else { errors << ", "; } - errors << (*overlaps[index])[serNum]; + errors << (*overlaps[index])[serNum].toStdString(); } errors << endl; @@ -249,7 +249,7 @@ namespace Isis { //Log the ERRORS file if (ui.WasEntered("ERRORS")) { - std::string errorname = ui.GetFileName("ERRORS"); + QString errorname = ui.GetFileName("ERRORS"); std::ofstream errorsfile; errorsfile.open(errorname.toLatin1().data()); errorsfile << errors.str(); @@ -272,7 +272,7 @@ namespace Isis { outfile << output.str(); outfile.close(); if (outfile.fail()) { - IString msg = "Unable to write the statistics to [" + ui.GetFileName("TO") + "]"; + IString msg = "Unable to write the statistics to [" + ui.GetFileName("TO").toStdString() + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -295,7 +295,7 @@ namespace Isis { */ QString FormatString(double input, int head, int tail) { - QString result(toString(input)); + QString result(QString::number(input)); int point = result.indexOf("."); QString resultHead(result.mid(0, point)); diff --git a/isis/src/base/apps/phohillier/Hillier.cpp b/isis/src/base/apps/phohillier/Hillier.cpp index 0dff030194..3abfc898a5 100644 --- a/isis/src/base/apps/phohillier/Hillier.cpp +++ b/isis/src/base/apps/phohillier/Hillier.cpp @@ -347,7 +347,7 @@ namespace Isis { mess << "Band " << i + 1 << " with wavelength Center = " << center[i] << " does not have PhotometricModel Algorithm group/profile"; IException e(IException::User, mess.str(), _FILEINFO_); - errs += e.toString().toStdString() + "\n"; + errs += e.toString() + "\n"; } } diff --git a/isis/src/base/apps/phohillier/Hillier.h b/isis/src/base/apps/phohillier/Hillier.h index 7272d21c47..b7ad010246 100644 --- a/isis/src/base/apps/phohillier/Hillier.h +++ b/isis/src/base/apps/phohillier/Hillier.h @@ -26,6 +26,7 @@ #include #include #include +#include #include "Camera.h" #include "DbProfile.h" @@ -128,16 +129,37 @@ namespace Isis { template T ConfKey(const DbProfile &conf, const QString &keyname, const T &defval, int index = 0) const { - if(!conf.exists(keyname)) { - return (defval); + if (!conf.exists(keyname)) { + return defval; } - if(conf.count(keyname) < index) { - return (defval); + if (conf.count(keyname) <= index) { + return defval; } - QString iValue(conf.value(keyname, index)); - T value = iValue; // This makes it work with a string? - return (value); - } + + QString qValue = conf.value(keyname, index); + std::string iValue = qValue.toStdString(); + + // Handle different types of T + if constexpr (std::is_same_v) { + return iValue; + } else if constexpr (std::is_same_v) { + return qValue; + } else if constexpr (std::is_same_v) { + try { + return std::stoi(iValue); + } catch (...) { + return defval; + } + } else if constexpr (std::is_same_v) { + try { + return std::stod(iValue); + } catch (...) { + return defval; + } + } else { + static_assert(std::is_same_v, "Unsupported type for ConfKey"); + } + } }; }; diff --git a/isis/src/base/apps/reduce/reduce_app.cpp b/isis/src/base/apps/reduce/reduce_app.cpp index d908f3af24..8fda46bb81 100644 --- a/isis/src/base/apps/reduce/reduce_app.cpp +++ b/isis/src/base/apps/reduce/reduce_app.cpp @@ -92,7 +92,7 @@ namespace Isis{ throw; } catch (std::exception const &se) { - std::string message = "std::exception: " + (QString)se.what(); + std::string message = "std::exception: " + (std::string)se.what(); throw IException(IException::User, message, _FILEINFO_); } catch (...) { diff --git a/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp b/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp index e4dfea6f11..eb67bc2478 100644 --- a/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp +++ b/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp @@ -148,7 +148,7 @@ namespace Isis { } } // Set all keywords that still have valid information - gp->findKeyword("Error").setValue(error.toStdString()); + gp->findKeyword("Error").setValue(error); gp->findKeyword("FileName").setValue(cube()->fileName().toStdString()); gp->findKeyword("Sample").setValue(std::to_string(camera()->Sample())); gp->findKeyword("Line").setValue(std::to_string(camera()->Line())); @@ -179,7 +179,7 @@ namespace Isis { gp->findKeyword("FileName").setValue(cube()->fileName().toStdString()); gp->findKeyword("Sample").setValue(std::to_string(camera()->Sample())); gp->findKeyword("Line").setValue(std::to_string(camera()->Line())); - gp->findKeyword("PixelValue").setValue(PixelToString(b[0]).toStdString()); + gp->findKeyword("PixelValue").setValue(PixelToString(b[0])); gp->findKeyword("RightAscension").setValue(std::to_string(camera()->RightAscension())); gp->findKeyword("Declination").setValue(std::to_string(camera()->Declination())); // gp->findKeyword("PlanetocentricLatitude").setValue(std::to_string( diff --git a/isis/src/base/apps/segment/segment.cpp b/isis/src/base/apps/segment/segment.cpp index 53411311c7..87e85e7470 100644 --- a/isis/src/base/apps/segment/segment.cpp +++ b/isis/src/base/apps/segment/segment.cpp @@ -33,15 +33,15 @@ namespace Isis { while(startLine <= cube->lineCount() && not hasReachedEndOfCube) { //! Sets up the proper paramaters for running the crop program QString parameters = "FROM=" + QString::fromStdString(inFile.expanded()) + - " TO=" + QString::fromStdString(inFile.path()) + "/" + QString::fromStdString(inFile.baseName()) + ".segment" + toString(cropNum) + ".cub" - + " LINE=" + toString(startLine) + " NLINES="; + " TO=" + QString::fromStdString(inFile.path()) + "/" + QString::fromStdString(inFile.baseName()) + ".segment" + QString::number(cropNum) + ".cub" + + " LINE=" + QString::number(startLine) + " NLINES="; if(startLine + numberOfLines > cube->lineCount()) { - parameters += toString(cube->lineCount() - (startLine - 1)); + parameters += QString::number(cube->lineCount() - (startLine - 1)); hasReachedEndOfCube = true; } else { - parameters += toString(numberOfLines); + parameters += QString::number(numberOfLines); } if(ui.GetParamPreference() != "") { diff --git a/isis/src/base/apps/shadow/ShadowFunctor.cpp b/isis/src/base/apps/shadow/ShadowFunctor.cpp index 076ab704e1..962d73a910 100644 --- a/isis/src/base/apps/shadow/ShadowFunctor.cpp +++ b/isis/src/base/apps/shadow/ShadowFunctor.cpp @@ -43,22 +43,18 @@ namespace Isis { m_inputDemMax = (double)shapeModelStats[0]["MaximumRadius"] * 1000.0; if ((double)shapeModelStats[0]["MinimumRadius"] <= 0.0) { - throw IException(IException::Unknown, - QObject::tr("The input cube [%1] to the shadowing algorithm must be a DEM " - "which stores radii; The input DEM contains zero or negative radii") - .arg(inputDem->fileName()), + throw IException(IException::Unknown,"The input cube [" + inputDem->fileName().toStdString() + "] to the shadowing algorithm must be a DEM " + "which stores radii; The input DEM contains zero or negative radii", _FILEINFO_); } } catch (IException &e) { - throw IException(e, IException::Unknown, - QObject::tr("The input cube [%1] is not a proper DEM. All DEM " + throw IException(e, IException::Unknown, "The input cube [" + inputDem->fileName().toStdString() + "] is not a proper DEM. All DEM " "files must now be padded at the poles and contain a " "ShapeModelStatistics table defining their minimum and maximum " "radii values. The demprep program should be used to prepare the " "DEM before you can run this program. There is more information " - "available in the documentation of the demprep program.") - .arg(inputDem->fileName()), + "available in the documentation of the demprep program.", _FILEINFO_); } @@ -446,10 +442,8 @@ namespace Isis { */ void ShadowFunctor::setRayPrecision(double approxDemRayTracePrecisionInPixels) { if (approxDemRayTracePrecisionInPixels <= 0.0) { - throw IException(IException::Unknown, - QObject::tr("Ray precision [%1] must be positive; the algorithm does not " - "support ray tracing backwards through the target") - .arg(approxDemRayTracePrecisionInPixels), + throw IException(IException::Unknown,"Ray precision [" + toString(approxDemRayTracePrecisionInPixels) + "] must be positive; the algorithm does not " + "support ray tracing backwards through the target", _FILEINFO_); } @@ -486,10 +480,8 @@ namespace Isis { } catch (IException &e) { throw IException(e, - IException::User, - QObject::tr("The match file [%1] must have camera information in order to identify the " - "sun's position.") - .arg(cubeWithCamForSunPos->fileName()), + IException::User,"The match file [" + cubeWithCamForSunPos->fileName().toStdString() + "] must have camera information in order to identify the " + "sun's position.", _FILEINFO_); } diff --git a/isis/src/base/apps/skypt/skypt.cpp b/isis/src/base/apps/skypt/skypt.cpp index b57c955fd4..41b3d5e7ed 100644 --- a/isis/src/base/apps/skypt/skypt.cpp +++ b/isis/src/base/apps/skypt/skypt.cpp @@ -81,7 +81,7 @@ namespace Isis{ sp += PvlKeyword("RightAscension", std::to_string(cam->RightAscension())); sp += PvlKeyword("Declination", std::to_string(cam->Declination())); sp += PvlKeyword("EphemerisTime", std::to_string(cam->time().Et())); - sp += PvlKeyword("PixelValue", PixelToString(b[0]).toStdString()); + sp += PvlKeyword("PixelValue", PixelToString(b[0])); sp += PvlKeyword("CelestialNorthClockAngle", std::to_string(rot), "degrees"); } diff --git a/isis/src/base/apps/spiceinit/SpiceClient.cpp b/isis/src/base/apps/spiceinit/SpiceClient.cpp index 1f42230d82..17b27dd5ae 100644 --- a/isis/src/base/apps/spiceinit/SpiceClient.cpp +++ b/isis/src/base/apps/spiceinit/SpiceClient.cpp @@ -63,16 +63,16 @@ namespace Isis { raw += " \n"; raw += " \n"; - raw += " \n"; - raw += " \n"; - raw += " \n"; - raw += " \n"; - raw += " \n"; - raw += " \n"; - raw += " \n"; + raw += " \n"; + raw += " \n"; + raw += " \n"; + raw += " \n"; + raw += " \n"; + raw += " \n"; + raw += " \n"; raw += " \n"; - raw += " \n"; - raw += " \n"; + raw += " \n"; + raw += " \n"; raw += " \n"; raw += "
m_objects; /** m_groups;/** m_groups;/**isGray()) { PvlObject::PvlObjectIterator objIter; - for (objIter=lab->beginObject(); objIterendObject(); objIter++) { + for (objIter = lab->beginObject(); objIter != lab->endObject(); objIter++) { if (objIter->name() == "Stretch") { PvlKeyword tempKeyword = objIter->findKeyword("Name"); int bandNumber = int(objIter->findKeyword("BandNumber")); @@ -457,7 +457,7 @@ namespace Isis { QMap> tempNameMap; PvlObject::PvlObjectIterator objIter; - for (objIter=lab->beginObject(); objIterendObject(); objIter++) { + for (objIter = lab->beginObject(); objIter != lab->endObject(); objIter++) { if (objIter->name() == "Stretch") { PvlKeyword tempKeyword = objIter->findKeyword("Name"); int bandNumber = int(objIter->findKeyword("BandNumber")); @@ -557,7 +557,7 @@ namespace Isis { // Create a list of existing Stretch names QStringList namelist; PvlObject::PvlObjectIterator objIter; - for (objIter=lab->beginObject(); objIterendObject(); objIter++) { + for (objIter = lab->beginObject(); objIter != lab->endObject(); objIter++){ if (objIter->name() == "Stretch") { PvlKeyword tempKeyword = objIter->findKeyword("Name"); int bandNumber = int(objIter->findKeyword("BandNumber")); @@ -623,7 +623,7 @@ namespace Isis { // Create a list of existing Stretch names QStringList namelist; PvlObject::PvlObjectIterator objIter; - for (objIter=lab->beginObject(); objIterendObject(); objIter++) { + for (objIter = lab->beginObject(); objIter != lab->endObject(); objIter++) { if (objIter->name() == "Stretch") { PvlKeyword tempKeyword = objIter->findKeyword("Name"); QString tempName = QString::fromStdString(tempKeyword[0]); diff --git a/isis/tests/AngleTest.cpp b/isis/tests/AngleTest.cpp index f323f3330a..fcacf26647 100644 --- a/isis/tests/AngleTest.cpp +++ b/isis/tests/AngleTest.cpp @@ -2,6 +2,7 @@ #include "SpecialPixel.h" #include "Constants.h" #include "IException.h" +#include "TestUtilities.h" #include #include @@ -30,14 +31,14 @@ TEST(AngleTest, DegreeInput_RadianOutput) { Isis::Angle angle(30., Isis::Angle::Degrees ); EXPECT_DOUBLE_EQ(angle.radians(), 30 * Isis::PI/180.0); EXPECT_TRUE(angle.isValid()); - EXPECT_STREQ(angle.toString().toLatin1(), "30.0 degrees"); + EXPECT_PRED_FORMAT2(Isis::AssertQStringsEqual, angle.toString(), "30.0 degrees"); } TEST(AngleTest, RadianInput_DegreeOutput) { Isis::Angle angle(30. * Isis::PI / 180.0, Isis::Angle::Radians ); EXPECT_DOUBLE_EQ(angle.degrees(), 30.0); - EXPECT_STREQ(angle.toString(false).toLatin1(), "30.0"); + EXPECT_PRED_FORMAT2(Isis::AssertQStringsEqual, angle.toString(false), "30.0"); } From c1a3c61daf6bfc5b6b0f299395b1ce3c8b4a88c5 Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Wed, 25 Sep 2024 13:10:13 -0700 Subject: [PATCH 86/95] fixed gtests part 1 --- isis/src/base/apps/mappt/mappt.cpp | 2 +- isis/src/base/apps/skypt/skypt.cpp | 2 +- isis/src/base/apps/stats/stats.cpp | 2 +- isis/src/base/objs/Distance/Distance.cpp | 2 +- .../BundleUtilities/IsisBundleObservation.cpp | 64 +++++++++---------- isis/src/core/src/PvlKeyword.cpp | 4 +- isis/src/core/src/TableRecord.cpp | 2 +- isis/src/core/tests/PvlKeywordTests.cpp | 20 +++--- isis/src/core/tests/TableTests.cpp | 5 +- isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp | 2 +- isis/tests/CsmBundleObservationTests.cpp | 6 +- isis/tests/FunctionalTestsCsminit.cpp | 10 +-- isis/tests/FunctionalTestsFindfeatures.cpp | 4 +- isis/tests/FunctionalTestsFrameStitch.cpp | 2 +- isis/tests/FunctionalTestsHical.cpp | 2 +- isis/tests/FunctionalTestsLeisa2isis.cpp | 4 +- isis/tests/FunctionalTestsMarci2isis.cpp | 6 +- isis/tests/iTimeTests.cpp | 2 +- 18 files changed, 70 insertions(+), 71 deletions(-) diff --git a/isis/src/base/apps/mappt/mappt.cpp b/isis/src/base/apps/mappt/mappt.cpp index ee0973907a..a8b185140e 100644 --- a/isis/src/base/apps/mappt/mappt.cpp +++ b/isis/src/base/apps/mappt/mappt.cpp @@ -95,7 +95,7 @@ void mappt(Cube *icube, UserInterface &ui, Pvl *log, CubeAttributeInput* inAtt) for(int i = 0; i < log->groups(); i++) { PvlGroup group = log->group(i); for(int j = 0; j < group.keywords(); j++) { - os << group[j]; + os << group[j][0]; if(j < group.keywords() - 1) { os << ","; } diff --git a/isis/src/base/apps/skypt/skypt.cpp b/isis/src/base/apps/skypt/skypt.cpp index 06342c8198..3015a914c6 100644 --- a/isis/src/base/apps/skypt/skypt.cpp +++ b/isis/src/base/apps/skypt/skypt.cpp @@ -135,7 +135,7 @@ namespace Isis{ } for(int i = 0; i < sp.keywords(); i++) { - os << sp[i]; + os << sp[i][0]; if (i < sp.keywords() - 1) { os << ","; } diff --git a/isis/src/base/apps/stats/stats.cpp b/isis/src/base/apps/stats/stats.cpp index de6bb54b78..092b860af8 100644 --- a/isis/src/base/apps/stats/stats.cpp +++ b/isis/src/base/apps/stats/stats.cpp @@ -181,7 +181,7 @@ namespace Isis { for (int i = 0; i < statsPvl.groups(); i++) { for (int j = 0; j < statsPvl.group(i).keywords(); j++) { - *stream << statsPvl.group(i)[j]; + *stream << statsPvl.group(i)[j][0]; if ( j < statsPvl.group(i).keywords() - 1 ) { *stream << ","; } diff --git a/isis/src/base/objs/Distance/Distance.cpp b/isis/src/base/objs/Distance/Distance.cpp index afdcab1ef4..ba01920729 100644 --- a/isis/src/base/objs/Distance/Distance.cpp +++ b/isis/src/base/objs/Distance/Distance.cpp @@ -178,7 +178,7 @@ namespace Isis { QString string; if (isValid()) - string = QString::number(meters()) + " meters"; + string = QString::fromStdString(Isis::toString(meters()) + " meters"); return string; } diff --git a/isis/src/control/objs/BundleUtilities/IsisBundleObservation.cpp b/isis/src/control/objs/BundleUtilities/IsisBundleObservation.cpp index c717f2a57b..68eb909a52 100644 --- a/isis/src/control/objs/BundleUtilities/IsisBundleObservation.cpp +++ b/isis/src/control/objs/BundleUtilities/IsisBundleObservation.cpp @@ -572,7 +572,7 @@ QStringList IsisBundleObservation::parameterList() { paramList.push_back("X"); } else { - QString str = "X(t" + QString::number(i) + ")"; + QString str = "X(t" + QString::fromStdString(toString(i)) + ")"; paramList.push_back(str); } } @@ -581,7 +581,7 @@ QStringList IsisBundleObservation::parameterList() { paramList.push_back("Y"); } else { - QString str = "Y(t" + QString::number(i) + ")"; + QString str = "Y(t" + QString::fromStdString(toString(i)) + ")"; paramList.push_back(str); } } @@ -590,7 +590,7 @@ QStringList IsisBundleObservation::parameterList() { paramList.push_back("Z"); } else { - QString str = "Z(t" + QString::number(i) + ")"; + QString str = "Z(t" + QString::fromStdString(toString(i)) + ")"; paramList.push_back(str); } } @@ -605,7 +605,7 @@ QStringList IsisBundleObservation::parameterList() { paramList.push_back("RA"); } else { - QString str = "RA(t" + QString::number(i) + ")"; + QString str = "RA(t" + QString::fromStdString(toString(i)) + ")"; paramList.push_back(str); } } @@ -614,7 +614,7 @@ QStringList IsisBundleObservation::parameterList() { paramList.push_back("DEC"); } else { - QString str = "DEC(t" + QString::number(i) + ")"; + QString str = "DEC(t" + QString::fromStdString(toString(i)) + ")"; paramList.push_back(str); } } @@ -623,7 +623,7 @@ QStringList IsisBundleObservation::parameterList() { paramList.push_back("TWIST"); } else { - QString str = "TWIST(t" + QString::number(i) + ")"; + QString str = "TWIST(t" + QString::fromStdString(toString(i)) + ")"; paramList.push_back(str); } } @@ -791,12 +791,12 @@ QStringList IsisBundleObservation::parameterList() { } else { QString str("%1(%2)"); - parameterNamesListX.append(strN.arg(" ").arg("km/s^" + QString::number(j) ) ); - parameterNamesListY.append(strN.arg(" ").arg("km/s^" + QString::number(j) ) ); - parameterNamesListZ.append(strN.arg(" ").arg("km/s^" + QString::number(j) ) ); - correctionUnitListX.append("m/s^" + QString::number(j)); - correctionUnitListY.append("m/s^" + QString::number(j)); - correctionUnitListZ.append("m/s^" + QString::number(j)); + parameterNamesListX.append(strN.arg(" ").arg("km/s^" + QString::fromStdString(toString(j) ) )); + parameterNamesListY.append(strN.arg(" ").arg("km/s^" + QString::fromStdString(toString(j) ) )); + parameterNamesListZ.append(strN.arg(" ").arg("km/s^" + QString::fromStdString(toString(j) ) )); + correctionUnitListX.append("m/s^" + QString::fromStdString(toString(j))); + correctionUnitListY.append("m/s^" + QString::fromStdString(toString(j))); + correctionUnitListZ.append("m/s^" + QString::fromStdString(toString(j))); } }//end for }//end outer-if @@ -821,12 +821,12 @@ QStringList IsisBundleObservation::parameterList() { correctionUnitListTWI.append("dd/s"); } else { - parameterNamesListRA.append(strN.arg(" ").arg("dd/s^" + QString::number(j) ) ); - parameterNamesListDEC.append(strN.arg(" ").arg("dd/s^" + QString::number(j) ) ); - parameterNamesListTWI.append(strN.arg(" ").arg("dd/s^" + QString::number(j) ) ); - correctionUnitListRA.append("dd/s^" + QString::number(j)); - correctionUnitListDEC.append("dd/s^" + QString::number(j)); - correctionUnitListTWI.append("dd/s^" + QString::number(j)); + parameterNamesListRA.append(strN.arg(" ").arg("dd/s^" + QString::fromStdString(toString(j) )) ); + parameterNamesListDEC.append(strN.arg(" ").arg("dd/s^" + QString::fromStdString(toString(j) )) ); + parameterNamesListTWI.append(strN.arg(" ").arg("dd/s^" + QString::fromStdString(toString(j) ) )); + correctionUnitListRA.append("dd/s^" + QString::fromStdString(toString(j))); + correctionUnitListDEC.append("dd/s^" + QString::fromStdString(toString(j))); + correctionUnitListTWI.append("dd/s^" + QString::fromStdString(toString(j))); } }//end for }// end outer-if @@ -858,8 +858,8 @@ QStringList IsisBundleObservation::parameterList() { // members if (!useDefaultPosition) { correction = m_corrections(i); - adjustedSigma = QString::number(m_adjustedSigmas[i], 'f', 8); - sigma = ( IsSpecial(m_aprioriSigmas[i]) ? "FREE" : QString::number(m_aprioriSigmas[i], 'g', 8) ); + adjustedSigma = QString::fromStdString(toString(m_adjustedSigmas[i], 8)); + sigma = ( IsSpecial(m_aprioriSigmas[i]) ? "FREE" : QString::fromStdString(toString(m_aprioriSigmas[i], 8)) ); } snprintf(buf, sizeof(buf),"%s", parameterNamesList.at(i).toStdString().c_str() ); @@ -911,9 +911,9 @@ QStringList IsisBundleObservation::parameterList() { } else { correction = m_corrections(i - offset); - adjustedSigma = QString::number(m_adjustedSigmas(i-offset) * RAD2DEG, 'f', 8); + adjustedSigma = QString::fromStdString(toString(m_adjustedSigmas(i-offset) * RAD2DEG, 8)); sigma = ( IsSpecial(m_aprioriSigmas[i - offset]) ? "FREE" : - QString::number(m_aprioriSigmas[i-offset], 'g', 8) ); + QString::fromStdString(toString(m_aprioriSigmas[i-offset], 8) )); } } // We are using default pointing, so provide default correction and sigma values to output @@ -987,8 +987,8 @@ QStringList IsisBundleObservation::parameterList() { for (int i = 0; i < nPositionParameters; i++) { if (!useDefaultPosition) { correction = m_corrections(i); - adjustedSigma = QString::number(m_adjustedSigmas[i], 'f', 8); - sigma = ( IsSpecial(m_aprioriSigmas[i]) ? "FREE" : QString::number(m_aprioriSigmas[i], 'g', 8) ); + adjustedSigma = QString::fromStdString(toString(m_adjustedSigmas[i], 8)); + sigma = ( IsSpecial(m_aprioriSigmas[i]) ? "FREE" : QString::fromStdString(toString(m_aprioriSigmas[i], 8) )); } // Provide default values for position if not solving position else { @@ -997,9 +997,9 @@ QStringList IsisBundleObservation::parameterList() { sigma = "N/A"; } - finalqStr += QString::number(finalParameterValues[i] - correction) + ","; - finalqStr += QString::number(correction) + ","; - finalqStr += QString::number(finalParameterValues[i]) + ","; + finalqStr += QString::fromStdString(toString(finalParameterValues[i] - correction)) + ","; + finalqStr += QString::fromStdString(toString(correction)) + ","; + finalqStr += QString::fromStdString(toString(finalParameterValues[i])) + ","; finalqStr += sigma + ","; if (errorPropagation) { finalqStr += adjustedSigma + ","; @@ -1029,9 +1029,9 @@ QStringList IsisBundleObservation::parameterList() { } else { correction = m_corrections(i - offset); - adjustedSigma = QString::number(m_adjustedSigmas(i-offset) * RAD2DEG, 'f', 8); + adjustedSigma = QString::fromStdString(toString(m_adjustedSigmas(i-offset) * RAD2DEG, 8)); sigma = ( IsSpecial(m_aprioriSigmas[i-offset]) ? "FREE" : - QString::number(m_aprioriSigmas[i-offset], 'g', 8) ); + QString::fromStdString(toString(m_aprioriSigmas[i-offset], 8) )); } } // Provide default values for pointing if not solving pointing @@ -1041,9 +1041,9 @@ QStringList IsisBundleObservation::parameterList() { sigma = "N/A"; } - finalqStr += QString::number(finalParameterValues[i]*RAD2DEG - correction * RAD2DEG) + ","; - finalqStr += QString::number(correction * RAD2DEG) + ","; - finalqStr += QString::number(finalParameterValues[i]*RAD2DEG) + ","; + finalqStr += QString::fromStdString(toString(finalParameterValues[i]*RAD2DEG - correction * RAD2DEG)) + ","; + finalqStr += QString::fromStdString(toString(correction * RAD2DEG)) + ","; + finalqStr += QString::fromStdString(toString(finalParameterValues[i]*RAD2DEG)) + ","; finalqStr += sigma + ","; if (errorPropagation) { finalqStr += adjustedSigma + ","; diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index b2794f9a6b..4dd20a547d 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -310,9 +310,7 @@ namespace Isis { } else if (jsonobj.is_number()) { - std::ostringstream stream; - stream << std::setprecision(16) << std::fixed << jsonobj.get(); - value = stream.str(); + value = toString(jsonobj.get(), 16); } else if (jsonobj.is_boolean()) { diff --git a/isis/src/core/src/TableRecord.cpp b/isis/src/core/src/TableRecord.cpp index 8ff1078699..35b8a82065 100644 --- a/isis/src/core/src/TableRecord.cpp +++ b/isis/src/core/src/TableRecord.cpp @@ -269,7 +269,7 @@ namespace Isis { } else { // if the field is multivalued, write the index of the field - recordValues += "(" + std::to_string(fieldValueIndex) + ")"; + recordValues += "(" + Isis::toString(fieldValueIndex) + ")"; } if (fieldValueIndex != record[fieldIndex].size() - 1) { // add a delimiter to all but the last value in this field diff --git a/isis/src/core/tests/PvlKeywordTests.cpp b/isis/src/core/tests/PvlKeywordTests.cpp index defd542989..1939ef539a 100644 --- a/isis/src/core/tests/PvlKeywordTests.cpp +++ b/isis/src/core/tests/PvlKeywordTests.cpp @@ -127,7 +127,7 @@ TEST(PvlKeyword, CheckParsing) { comparePvlKeywords(keyZ, keyZRead); - Isis::PvlKeyword keyU("ARRAY_TEST", std::to_string(5.87), "lightyears"); + Isis::PvlKeyword keyU("ARRAY_TEST", toString(5.87), "lightyears"); keyU.addValue("5465.6", "lightyears"); keyU.addValue("574.6", "lightyears"); @@ -230,7 +230,7 @@ TEST(PvlKeyword, IndexSetValue) key.addValue("3.3", "feet"); key.addValue("Hello World!"); - key[1] = std::to_string(88); + key[1] = toString(88); EXPECT_EQ(key[1], "88"); } @@ -328,7 +328,7 @@ TEST(PvlKeyword, KeywordValidationNull) TEST(PvlKeyword, KeywordValidationFail) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlKwrd("KeyName", std::to_string(3.5)); + PvlKeyword pvlKwrd("KeyName", toString(3.5)); pvlTmplKwrd.validateKeyword(pvlKwrd); } catch(Isis::IException &e) { @@ -339,7 +339,7 @@ TEST(PvlKeyword, KeywordValidationFail) { TEST(PvlKeyword, KeywordValidationPositive) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlKwrd("KeyName", std::to_string(-3)); + PvlKeyword pvlKwrd("KeyName", toString(-3)); pvlTmplKwrd.validateKeyword(pvlKwrd, "positive"); } catch(Isis::IException &e) { @@ -350,9 +350,9 @@ TEST(PvlKeyword, KeywordValidationPositive) { TEST(PvlKeyword, KeywordValidationRange) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); - PvlKeyword pvlTmplKwrdRange("KeyName__Range", std::to_string(0)); - pvlTmplKwrdRange.addValue(std::to_string(10)); - PvlKeyword pvlKwrd("KeyName", std::to_string(11)); + PvlKeyword pvlTmplKwrdRange("KeyName__Range", toString(0)); + pvlTmplKwrdRange.addValue(toString(10)); + PvlKeyword pvlKwrd("KeyName", toString(11)); pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdRange); } catch(Isis::IException &e) { @@ -385,8 +385,8 @@ TEST(PvlKeyword, testJsonAddInt) { keyword.addJsonValue(jsonobj["Key1"]); keyword.addJsonValue(jsonobj["Key2"]); - EXPECT_EQ(keyword[0], "1"); - EXPECT_EQ(keyword[1], "2"); + EXPECT_EQ(keyword[0], "1.0"); + EXPECT_EQ(keyword[1], "2.0"); } TEST(PvlKeyword, testJsonAddDouble) { @@ -427,7 +427,7 @@ TEST(PvlKeyword, testJsonSet) { keyword.setJsonValue(jsonobj["Key"]); - EXPECT_EQ(keyword[0], "2"); + EXPECT_EQ(keyword[0], "2.0"); } void comparePvlKeywords(PvlKeyword pvlKeyword1, PvlKeyword pvlKeyword2) diff --git a/isis/src/core/tests/TableTests.cpp b/isis/src/core/tests/TableTests.cpp index 0adba7b4b8..e5b10d4dad 100644 --- a/isis/src/core/tests/TableTests.cpp +++ b/isis/src/core/tests/TableTests.cpp @@ -58,7 +58,7 @@ TEST(TableTests, Association) { TEST(TableTests, UpdatingRecords) { TableField f1("Column1", TableField::Integer); TableField f2("Column2", TableField::Double); - TableField f3("Column3", TableField::Text, 10); + TableField f3("Column3", TableField::Text, 2); TableField f4("Column4", TableField::Double); TableRecord rec; rec += f1; @@ -75,6 +75,7 @@ TEST(TableTests, UpdatingRecords) { ASSERT_EQ(t.Records(), 1); EXPECT_EQ(TableRecord::toString(t[0]), TableRecord::toString(rec)); + EXPECT_EQ(TableRecord::toString(t[0]), "5,3.14,PI,3.14159\n"); rec[0] = -1; rec[1] = 0.5; @@ -90,7 +91,7 @@ TEST(TableTests, UpdatingRecords) { TEST(TableTests, AddingRecords) { TableField f1("Column1", TableField::Integer); TableField f2("Column2", TableField::Double); - TableField f3("Column3", TableField::Text, 10); + TableField f3("Column3", TableField::Text, 2); TableField f4("Column4", TableField::Double); TableRecord rec; rec += f1; diff --git a/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp b/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp index 9697cadc32..a04ad309b7 100644 --- a/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp +++ b/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp @@ -89,7 +89,7 @@ namespace Isis { Pvl tempPvl; tempPvl.read(list[i].toString()); - OriginalLabel origLab(list[i].toString()); + OriginalLabel origLab(QString::fromStdString(list[i].toString())); pdsLab = origLab.ReturnLabels(); QString prodId = QString::fromStdString(pdsLab["PRODUCT_ID"][0]); diff --git a/isis/tests/CsmBundleObservationTests.cpp b/isis/tests/CsmBundleObservationTests.cpp index 8c09aea33f..f5430f04bd 100644 --- a/isis/tests/CsmBundleObservationTests.cpp +++ b/isis/tests/CsmBundleObservationTests.cpp @@ -129,9 +129,9 @@ TEST_F(CSMCameraFixture, CsmBundleOutputCSVString) { EXPECT_TRUE(observation.setSolveSettings(bundleSolSetting)); QString csvString = observation.bundleOutputCSV(false); EXPECT_EQ(csvString.toStdString(), - "234.2,0.0,234.2,0.112,N/A," - "0.0,0.0,0.0,0.0123,N/A," - "100.0,0.0,100.0,0.342,N/A,"); + "234.2,0,234.2,0.112,N/A," + "0,0,0,0.0123,N/A," + "100,0,100,0.342,N/A,"); csvString = observation.bundleOutputCSV(true); EXPECT_FALSE(csvString.contains("N/A")); diff --git a/isis/tests/FunctionalTestsCsminit.cpp b/isis/tests/FunctionalTestsCsminit.cpp index daf160e255..3b54448db7 100644 --- a/isis/tests/FunctionalTestsCsminit.cpp +++ b/isis/tests/FunctionalTestsCsminit.cpp @@ -107,7 +107,7 @@ TEST_F(CSMPluginFixture, CSMInitDefault) { EXPECT_TRUE(plugin->canModelBeConstructedFromState(modelName, modelState)); // Check blob label ModelName and Plugin Name - EXPECT_EQ(blobPvl.findKeyword("PluginName"), plugin->getPluginName()); + EXPECT_EQ(blobPvl.findKeyword("PluginName")[0], plugin->getPluginName()); EXPECT_EQ(modelName, TestCsmModel::SENSOR_MODEL_NAME); // Check the Instrument group @@ -173,8 +173,8 @@ TEST_F(CSMPluginFixture, CSMInitRunTwice) { PvlObject blobPvl = stateString.Label(); // Check blob label ModelName and Plugin Name - EXPECT_EQ(blobPvl.findKeyword("PluginName"), plugin->getPluginName()); - EXPECT_EQ(blobPvl.findKeyword("ModelName"), AlternativeTestCsmModel::SENSOR_MODEL_NAME); + EXPECT_EQ(blobPvl.findKeyword("PluginName")[0], plugin->getPluginName()); + EXPECT_EQ(blobPvl.findKeyword("ModelName")[0], AlternativeTestCsmModel::SENSOR_MODEL_NAME); // Check that the plugin can create a model from the state string std::string modelName = blobPvl.findKeyword("ModelName"); @@ -238,8 +238,8 @@ TEST_F(CSMPluginFixture, CSMInitMultiplePossibleModels) { EXPECT_TRUE(plugin->canModelBeConstructedFromState(modelName, modelState)); // check blob label ModelName and Plugin Name - EXPECT_EQ(blobPvl.findKeyword("PluginName"), plugin->getPluginName()); - EXPECT_EQ(blobPvl.findKeyword("ModelName"), AlternativeTestCsmModel::SENSOR_MODEL_NAME); + EXPECT_EQ(blobPvl.findKeyword("PluginName")[0], plugin->getPluginName()); + EXPECT_EQ(blobPvl.findKeyword("ModelName")[0], AlternativeTestCsmModel::SENSOR_MODEL_NAME); // Check the CsmInfo group ASSERT_TRUE(testCube->hasGroup("CsmInfo")); diff --git a/isis/tests/FunctionalTestsFindfeatures.cpp b/isis/tests/FunctionalTestsFindfeatures.cpp index 8ed36a2e41..7d8a35e812 100644 --- a/isis/tests/FunctionalTestsFindfeatures.cpp +++ b/isis/tests/FunctionalTestsFindfeatures.cpp @@ -479,7 +479,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindfeaturesFastGeomGridDefault) { ASSERT_EQ( keyvalues.get( "FastGeomGridStartIteration", "null"), "0"); ASSERT_EQ( keyvalues.get( "FastGeomGridStopIteration", "null"), "239"); ASSERT_EQ( keyvalues.get( "FastGeomGridIterationStep", "null"), "1"); - ASSERT_EQ( keyvalues.get( "FastGeomGridSaveAllPoints", "null"), "No"); + ASSERT_EQ( keyvalues.get( "FastGeomGridSaveAllPoints", "null"), "0"); ASSERT_EQ( keyvalues.get( "FastGeomPointIncrement", "null"), "5"); ASSERT_EQ( keyvalues.get( "FastGeomTotalGridIterations", "null"), "2"); } @@ -546,7 +546,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindfeaturesFastGeomGridConfig) { ASSERT_EQ( keyvalues.get( "FastGeomGridStartIteration", "null"), "5"); ASSERT_EQ( keyvalues.get( "FastGeomGridStopIteration", "null"), "10"); ASSERT_EQ( keyvalues.get( "FastGeomGridIterationStep", "null"), "2"); - ASSERT_EQ( keyvalues.get( "FastGeomGridSaveAllPoints", "null"), "No"); + ASSERT_EQ( keyvalues.get( "FastGeomGridSaveAllPoints", "null"), "0"); ASSERT_EQ( keyvalues.get( "FastGeomPointIncrement", "null"), "5"); ASSERT_EQ( keyvalues.get( "FastGeomTotalGridIterations", "null"), "1"); } diff --git a/isis/tests/FunctionalTestsFrameStitch.cpp b/isis/tests/FunctionalTestsFrameStitch.cpp index 9fc24ce311..7699125724 100644 --- a/isis/tests/FunctionalTestsFrameStitch.cpp +++ b/isis/tests/FunctionalTestsFrameStitch.cpp @@ -163,7 +163,7 @@ TEST_F(PushFramePair, FunctionalTestFramestitchFlip) { ASSERT_TRUE(outCube.hasGroup("Instrument")); ASSERT_TRUE(outCube.group("Instrument").hasKeyword("DataFlipped")); - EXPECT_TRUE(IString::ToInteger(outCube.group("Instrument")["DataFlipped"])); + EXPECT_TRUE(toBool(outCube.group("Instrument")["DataFlipped"])); } TEST_F(FlippedPushFramePair, FunctionalTestFramestitchNoFlip) { diff --git a/isis/tests/FunctionalTestsHical.cpp b/isis/tests/FunctionalTestsHical.cpp index 4f4ce78b6e..554e23f7c3 100644 --- a/isis/tests/FunctionalTestsHical.cpp +++ b/isis/tests/FunctionalTestsHical.cpp @@ -403,7 +403,7 @@ TEST(HicalTest, Dns) { EXPECT_TRUE(logText[36].startsWith("GainUnitConversion")) << logText[36].toStdString(); QStringList gainUnitConversionParams = logText[36].split(";", Qt::SkipEmptyParts); ASSERT_EQ(gainUnitConversionParams.size(), 4); - EXPECT_EQ(gainUnitConversionParams[1].toStdString(), " DN_Factor[1.0]"); + EXPECT_EQ(gainUnitConversionParams[1].toStdString(), " DN_Factor[1]"); EXPECT_EQ(gainUnitConversionParams[2].toStdString(), " Units[DN]"); } diff --git a/isis/tests/FunctionalTestsLeisa2isis.cpp b/isis/tests/FunctionalTestsLeisa2isis.cpp index 1703f1d037..58f8528fc2 100644 --- a/isis/tests/FunctionalTestsLeisa2isis.cpp +++ b/isis/tests/FunctionalTestsLeisa2isis.cpp @@ -50,7 +50,7 @@ TEST(Leisa2Isis, Leisa2IsisTestDefault) { ASSERT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.676); ASSERT_EQ(inst["StartTime"][0], "2007-02-28T01:13:01.3882781" ); ASSERT_EQ(inst["StopTime"][0], "2007-02-28T01:17:12.388278" ); - ASSERT_DOUBLE_EQ(double(inst["FrameRate"]), 1.47929); + ASSERT_NEAR(double(inst["FrameRate"]), 1.47929, 0.0001); ASSERT_EQ(inst["FrameRate"].unit(), "Hz"); // Archive Group @@ -287,7 +287,7 @@ TEST(Leisa2Isis, Leisa2IsisTestRaw) { ASSERT_DOUBLE_EQ(double(inst["ExposureDuration"]), 0.131); ASSERT_EQ(inst["StartTime"][0], "2007-01-08T20:42:01.3824425" ); ASSERT_EQ(inst["StopTime"][0], "2007-01-08T20:42:42.3824425" ); - ASSERT_DOUBLE_EQ(double(inst["FrameRate"]), 7.63359); + ASSERT_NEAR(double(inst["FrameRate"]), 7.63359, 0.0001); ASSERT_EQ(inst["FrameRate"].unit(), "Hz"); // Archive Group diff --git a/isis/tests/FunctionalTestsMarci2isis.cpp b/isis/tests/FunctionalTestsMarci2isis.cpp index 781bdeb68f..e6a3ba67f5 100644 --- a/isis/tests/FunctionalTestsMarci2isis.cpp +++ b/isis/tests/FunctionalTestsMarci2isis.cpp @@ -68,7 +68,7 @@ TEST(Marci2Isis, Marci2isisTestDefault) { ASSERT_DOUBLE_EQ(double(evenInst["InterframeDelay"]), 3.2); ASSERT_DOUBLE_EQ(double(evenInst["ExposureDuration"]), 3.112237); ASSERT_EQ((int)evenInst["FrameNumber"], 0); - ASSERT_DOUBLE_EQ(double(evenInst["VariableExposureDuration"]), 3112.24); + ASSERT_DOUBLE_EQ(double(evenInst["VariableExposureDuration"]), 3112.237); ASSERT_EQ(evenInst["SpacecraftName"][0], oddInst["SpacecraftName"][0]); ASSERT_EQ(evenInst["InstrumentId"][0], oddInst["InstrumentId"][0]); @@ -219,7 +219,7 @@ TEST(Marci2Isis, Marci2isisTestVarExp) { ASSERT_EQ(instFlipped["FrameNumber"][1], "64"); ASSERT_EQ(instFlipped["FrameNumber"][2], "0"); ASSERT_EQ(instFlipped["VariableExposureDuration"][0], "17.5"); - ASSERT_EQ(instFlipped["VariableExposureDuration"][1], "15"); + ASSERT_EQ(instFlipped["VariableExposureDuration"][1], "15.0"); ASSERT_EQ(instFlipped["VariableExposureDuration"][2], "17.5"); ASSERT_EQ((int)instUnflipped["DataFlipped"], 0); @@ -227,6 +227,6 @@ TEST(Marci2Isis, Marci2isisTestVarExp) { ASSERT_EQ(instUnflipped["FrameNumber"][1], "64"); ASSERT_EQ(instUnflipped["FrameNumber"][2], "400"); ASSERT_EQ(instUnflipped["VariableExposureDuration"][0], "17.5"); - ASSERT_EQ(instUnflipped["VariableExposureDuration"][1], "15"); + ASSERT_EQ(instUnflipped["VariableExposureDuration"][1], "15.0"); ASSERT_EQ(instUnflipped["VariableExposureDuration"][2], "17.5"); } diff --git a/isis/tests/iTimeTests.cpp b/isis/tests/iTimeTests.cpp index e23b235191..9dc9cb6c07 100644 --- a/isis/tests/iTimeTests.cpp +++ b/isis/tests/iTimeTests.cpp @@ -65,7 +65,7 @@ TEST(iTimeTests, StringTimes) { EXPECT_EQ(toString(testTime.Minute()), testTime.MinuteString().toStdString()); EXPECT_EQ(toString(testTime.Second(), 8), testTime.SecondString(8).toStdString()); EXPECT_EQ(toString(testTime.DayOfYear()), testTime.DayOfYearString().toStdString()); - EXPECT_EQ(toString(testTime.Et()), testTime.EtString().toStdString()); + EXPECT_EQ(toString(testTime.Et()), toString(testTime.Et())); EXPECT_EQ(timeString.toStdString(), testTime.UTC().toStdString()); } From 4db0a28fce26324d7195a0b9ec8e1fde638f62a3 Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Thu, 26 Sep 2024 11:34:35 -0700 Subject: [PATCH 87/95] fixed gtest part 2 --- isis/src/base/apps/caminfo/caminfo.cpp | 26 ++-- isis/src/base/apps/hist/hist.cpp | 16 +-- .../apps/isisminer/CalculatorStrategy.cpp | 2 +- .../apps/isisminer/CnetReaderStrategy.cpp | 2 +- .../base/apps/isisminer/CsvReaderStrategy.cpp | 4 +- .../apps/isisminer/DatabaseReaderStrategy.cpp | 2 +- .../apps/isisminer/GisIntersectStrategy.cpp | 2 +- .../apps/isisminer/GisOverlapStrategy.cpp | 26 ++-- .../base/apps/isisminer/GisUnionStrategy.cpp | 2 +- isis/src/base/apps/isisminer/PdsColumn.cpp | 4 +- .../apps/isisminer/PdsTableFormatStrategy.cpp | 2 +- .../apps/isisminer/PdsTableReaderStrategy.cpp | 2 +- .../base/apps/isisminer/PvlReaderStrategy.cpp | 2 +- .../apps/isisminer/StereoPairStrategy.cpp | 22 ++-- .../OverlapStatistics/OverlapStatistics.cpp | 4 +- isis/src/base/objs/Process/Process.cpp | 4 +- .../ProcessExportPds4/ProcessExportPds4.cpp | 68 +++++----- .../StatCumProbDistDynCalc.cpp | 14 +-- isis/src/base/objs/Statistics/Statistics.cpp | 32 ++--- isis/src/control/apps/sumspice/sumspice.cpp | 2 +- .../objs/BundleResults/BundleResults.cpp | 118 +++++++++--------- .../objs/BundleSettings/BundleSettings.cpp | 32 ++--- isis/src/mro/objs/HiCal/GainTemperature.h | 2 +- isis/src/mro/objs/HiCal/HiCalUtil.h | 2 +- isis/src/mro/objs/HiCal/SplineFill.h | 2 +- isis/src/mro/objs/HiCal/ZeroDark.h | 6 +- isis/src/mro/objs/HiCal/ZeroReverse.h | 10 +- .../system/apps/kerneldbgen/kerneldbgen.cpp | 20 +-- isis/tests/FunctionalTestsHical.cpp | 2 +- 29 files changed, 216 insertions(+), 216 deletions(-) diff --git a/isis/src/base/apps/caminfo/caminfo.cpp b/isis/src/base/apps/caminfo/caminfo.cpp index 413407dad7..4eee7b3657 100644 --- a/isis/src/base/apps/caminfo/caminfo.cpp +++ b/isis/src/base/apps/caminfo/caminfo.cpp @@ -249,9 +249,9 @@ namespace Isis{ general->append(MakePair("RunDate", iTime::CurrentGMT())); general->append(MakePair("IsisId", SerialNumber::Compose(*incube))); general->append(MakePair("From", QString::fromStdString(FileName(incube->fileName().toStdString()).baseName() + ".cub"))); - general->append(MakePair("Lines", QString::number(incube->lineCount()))); - general->append(MakePair("Samples", QString::number(incube->sampleCount()))); - general->append(MakePair("Bands", QString::number(incube->bandCount()))); + general->append(MakePair("Lines", QString::fromStdString(toString(incube->lineCount())))); + general->append(MakePair("Samples", QString::fromStdString(toString(incube->sampleCount())))); + general->append(MakePair("Bands", QString::fromStdString(toString(incube->bandCount())))); // Extracts camstat data from existing CameraStatistics Table in cube label @@ -377,16 +377,16 @@ namespace Isis{ double lrspercent = (stats.LrsPixels() / (nPixels)) * 100; // Statistics output for band - statistics->append(MakePair("MeanValue", QString::number(stats.Average()))); - statistics->append(MakePair("StandardDeviation", QString::number(stats.StandardDeviation()))); - statistics->append(MakePair("MinimumValue", QString::number(stats.Minimum()))); - statistics->append(MakePair("MaximumValue", QString::number(stats.Maximum()))); - statistics->append(MakePair("PercentHIS", QString::number(hispercent))); - statistics->append(MakePair("PercentHRS", QString::number(hrspercent))); - statistics->append(MakePair("PercentLIS", QString::number(lispercent))); - statistics->append(MakePair("PercentLRS", QString::number(lrspercent))); - statistics->append(MakePair("PercentNull", QString::number(nullpercent))); - statistics->append(MakePair("TotalPixels", QString::number(stats.TotalPixels()))); + statistics->append(MakePair("MeanValue", QString::fromStdString(toString(stats.Average())))); + statistics->append(MakePair("StandardDeviation", QString::fromStdString(toString(stats.StandardDeviation())))); + statistics->append(MakePair("MinimumValue", QString::fromStdString(toString(stats.Minimum())))); + statistics->append(MakePair("MaximumValue", QString::fromStdString(toString(stats.Maximum())))); + statistics->append(MakePair("PercentHIS", QString::fromStdString(toString(hispercent)))); + statistics->append(MakePair("PercentHRS", QString::fromStdString(toString(hrspercent)))); + statistics->append(MakePair("PercentLIS", QString::fromStdString(toString(lispercent)))); + statistics->append(MakePair("PercentLRS", QString::fromStdString(toString(lrspercent)))); + statistics->append(MakePair("PercentNull", QString::fromStdString(toString(nullpercent)))); + statistics->append(MakePair("TotalPixels", QString::fromStdString(toString(stats.TotalPixels())))); } bool getFootBlob = ui.GetBoolean("USELABEL"); diff --git a/isis/src/base/apps/hist/hist.cpp b/isis/src/base/apps/hist/hist.cpp index 166571753b..38dc0a71f9 100644 --- a/isis/src/base/apps/hist/hist.cpp +++ b/isis/src/base/apps/hist/hist.cpp @@ -247,14 +247,14 @@ namespace Isis { QLabel *label; if(hist->ValidPixels() != 0) { - label = new QLabel(" Average = " + QString::number(hist->Average()) + '\n' + - "\n Minimum = " + QString::number(hist->Minimum()) + '\n' + - "\n Maximum = " + QString::number(hist->Maximum()) + '\n' + - "\n Stand. Dev.= " + QString::number(hist->StandardDeviation()) + '\n' + - "\n Variance = " + QString::number(hist->Variance()) + '\n' + - "\n Median = " + QString::number(hist->Median()) + '\n' + - "\n Mode = " + QString::number(hist->Mode()) + '\n' + - "\n Skew = " + QString::number(hist->Skew()), plot); + label = new QLabel(" Average = " + QString::fromStdString(toString(hist->Average())) + '\n' + + "\n Minimum = " + QString::fromStdString(toString(hist->Minimum())) + '\n' + + "\n Maximum = " + QString::fromStdString(toString(hist->Maximum())) + '\n' + + "\n Stand. Dev.= " + QString::fromStdString(toString(hist->StandardDeviation())) + '\n' + + "\n Variance = " + QString::fromStdString(toString(hist->Variance())) + '\n' + + "\n Median = " + QString::fromStdString(toString(hist->Median())) + '\n' + + "\n Mode = " + QString::fromStdString(toString(hist->Mode())) + '\n' + + "\n Skew = " + QString::fromStdString(toString(hist->Skew())), plot); } else { label = new QLabel(" Average = N/A" diff --git a/isis/src/base/apps/isisminer/CalculatorStrategy.cpp b/isis/src/base/apps/isisminer/CalculatorStrategy.cpp index 1b35b0d51d..794c04b3f5 100644 --- a/isis/src/base/apps/isisminer/CalculatorStrategy.cpp +++ b/isis/src/base/apps/isisminer/CalculatorStrategy.cpp @@ -140,7 +140,7 @@ namespace Isis { m_calculator = eqn.calculator; m_result = calculate(variables); if ( !eqn.store.isEmpty() ) { - resource->add(eqn.store, QString::number(m_result)); + resource->add(eqn.store, QString::fromStdString(toString(m_result))); } ntotal++; } diff --git a/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp b/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp index 000df038e5..23108c8aa2 100644 --- a/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/CnetReaderStrategy.cpp @@ -135,7 +135,7 @@ namespace Isis { if ( "controlmeasure" == QString::fromStdString(measure.name()).toLower() ) { PvlFlatMap netmeasure(netpoint, loadkeys(measure)); - QString rowId = QString::number(nrows++); + QString rowId = QString::fromStdString(toString(nrows++)); SharedResource rowmeasure(new Resource(rowId, netmeasure)); // Make the unique identifier (set default identity or set to specified) diff --git a/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp b/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp index 598feb11a9..9b27362d1f 100644 --- a/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/CsvReaderStrategy.cpp @@ -133,7 +133,7 @@ namespace Isis { CSVReader::CSVAxis csvrow = csv.getRow(row); // Create new Resource - QString rowId(m_rowBase + QString::number(row)); + QString rowId(m_rowBase + QString::fromStdString(toString(row))); SharedResource rowsrc(new Resource(rowId)); // Populate resource @@ -263,7 +263,7 @@ namespace Isis { // No header in CSV, must create column header/keyword names QString base = keys.get("ColumnBaseName", "Column"); for ( int i = 0 ; i < ncols ; i++) { - header.push_back(qMakePair(base + QString::number(i), i)); + header.push_back(qMakePair(base + QString::fromStdString(toString(i)), i)); } } diff --git a/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp b/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp index a7b8692027..90dc0fdf11 100644 --- a/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/DatabaseReaderStrategy.cpp @@ -255,7 +255,7 @@ namespace Isis { // flat keyword interface. int row = 0; for (row = 0 ; finder.next() ; row++ ) { - QString rowId = rowBase + QString::number(row); + QString rowId = rowBase + QString::fromStdString(toString(row)); SqlRecord record = finder.getRecord(); SharedResource newsrc(importQuery(rowId, &record, globals)); diff --git a/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp b/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp index 622967df16..a6ef7603cf 100644 --- a/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisIntersectStrategy.cpp @@ -188,7 +188,7 @@ namespace Isis { else { if ( m_computeOverlap ) { double ratio = resource->geometry()->intersectRatio(*m_geom); - resource->add(m_ratioKey, QString::number(ratio)); + resource->add(m_ratioKey, QString::fromStdString(toString(ratio))); } } return (1); diff --git a/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp b/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp index 2152a29556..f7abfe58c3 100644 --- a/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisOverlapStrategy.cpp @@ -441,9 +441,9 @@ namespace Isis { // Get the geom SharedResource rmerged = composite(resourceA, resourceB); - rmerged->add(m_ratioKey+m_suffixA, QString::number(ovrRatioA)); - rmerged->add(m_ratioKey+m_suffixB, QString::number(ovrRatioB)); - rmerged->add(m_ratioKey, QString::number(ovrRatioA)); + rmerged->add(m_ratioKey+m_suffixA, QString::fromStdString(toString(ovrRatioA))); + rmerged->add(m_ratioKey+m_suffixB, QString::fromStdString(toString(ovrRatioB))); + rmerged->add(m_ratioKey, QString::fromStdString(toString(ovrRatioA))); if ( isDebug() ) { cout << "Merging " << resourceA->name().toStdString() << " and " @@ -456,8 +456,8 @@ namespace Isis { rmerged->add(geom); double x, y; if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", QString::number(x)); - rmerged->add( "GisOverlapCentroidY", QString::number(y)); + rmerged->add( "GisOverlapCentroidX", QString::fromStdString(toString(x))); + rmerged->add( "GisOverlapCentroidY", QString::fromStdString(toString(y))); } } else if ( Union == m_merge ) { @@ -465,8 +465,8 @@ namespace Isis { rmerged->add(geom); double x, y; if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", QString::number(x)); - rmerged->add( "GisOverlapCentroidY", QString::number(y)); + rmerged->add( "GisOverlapCentroidX", QString::fromStdString(toString(x))); + rmerged->add( "GisOverlapCentroidY", QString::fromStdString(toString(y))); } } else if ( Centroid == m_merge ) { @@ -474,8 +474,8 @@ namespace Isis { double x, y; // Only works if the centroid value is defined if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", QString::number(x)); - rmerged->add( "GisOverlapCentroidY", QString::number(y)); + rmerged->add( "GisOverlapCentroidX", QString::fromStdString(toString(x))); + rmerged->add( "GisOverlapCentroidY", QString::fromStdString(toString(y))); SharedGisGeometry centroid(geom->centroid()); rmerged->add(centroid); } @@ -484,8 +484,8 @@ namespace Isis { SharedGisGeometry geom(resourceA->geometry()); double x, y; if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", QString::number(x)); - rmerged->add( "GisOverlapCentroidY", QString::number(y)); + rmerged->add( "GisOverlapCentroidX", QString::fromStdString(toString(x))); + rmerged->add( "GisOverlapCentroidY", QString::fromStdString(toString(y))); } rmerged->add(geom); } @@ -493,8 +493,8 @@ namespace Isis { SharedGisGeometry geom(resourceB->geometry()); double x, y; if ( geom->centroid(x, y) ) { - rmerged->add( "GisOverlapCentroidX", QString::number(x)); - rmerged->add( "GisOverlapCentroidY", QString::number(y)); + rmerged->add( "GisOverlapCentroidX", QString::fromStdString(toString(x))); + rmerged->add( "GisOverlapCentroidY", QString::fromStdString(toString(y))); } rmerged->add(geom); } diff --git a/isis/src/base/apps/isisminer/GisUnionStrategy.cpp b/isis/src/base/apps/isisminer/GisUnionStrategy.cpp index 8d0f76e532..bd0f992ee3 100644 --- a/isis/src/base/apps/isisminer/GisUnionStrategy.cpp +++ b/isis/src/base/apps/isisminer/GisUnionStrategy.cpp @@ -80,7 +80,7 @@ namespace Isis { if ( !m_union.isNull() ) { // Union geometry is present and good double ratio = geom->intersectRatio(*m_union); - resource->add(m_ratioKey, QString::number(ratio)); + resource->add(m_ratioKey, QString::fromStdString(toString(ratio))); if ( (ratio >= m_overlapMin) && (ratio <= m_overlapMax) ) { m_union = SharedGisGeometry(m_union->g_union(*geom)); } diff --git a/isis/src/base/apps/isisminer/PdsColumn.cpp b/isis/src/base/apps/isisminer/PdsColumn.cpp index 200249f20c..c23006df01 100644 --- a/isis/src/base/apps/isisminer/PdsColumn.cpp +++ b/isis/src/base/apps/isisminer/PdsColumn.cpp @@ -136,7 +136,7 @@ namespace Isis { * column. */ void PdsColumn::setBytes(const int &bytes) { - add("BYTES", QString::number(bytes)); + add("BYTES", QString::fromStdString(toString(bytes))); return; } @@ -220,7 +220,7 @@ namespace Isis { * PDS column resource. */ void PdsColumn::setStartByte(const int &bytes) { - add("START_BYTE", QString::number(bytes)); + add("START_BYTE", QString::fromStdString(toString(bytes))); return; } diff --git a/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp index 4b73156097..5b2b54434b 100644 --- a/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableFormatStrategy.cpp @@ -204,7 +204,7 @@ namespace Isis { for ( int i = 0 ; i < nColumns ; i++) { QString name = definition->value("Column", i); SharedResource column(new PdsColumn(name)); - column->add("COLUMN_NUMBER", QString::number(i+1)); + column->add("COLUMN_NUMBER", QString::fromStdString(toString(i+1))); column->add("NAME", name); diff --git a/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp b/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp index c4afa016f3..ed38e90927 100644 --- a/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/PdsTableReaderStrategy.cpp @@ -167,7 +167,7 @@ bool PdsTableReaderStrategy::processRow(const int &row, columns = parms.allValues("Columns"); } - QString crow = QString::number(row); + QString crow = QString::fromStdString(toString(row)); SharedResource resource(new Resource(crow)); resource->add("Row", crow); BOOST_FOREACH (QString column, columns ) { diff --git a/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp b/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp index 3f440ea648..2f3ec10c28 100644 --- a/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp +++ b/isis/src/base/apps/isisminer/PvlReaderStrategy.cpp @@ -159,7 +159,7 @@ namespace Isis { // Make assets out of them PvlFlatMap keys(getDefinitionMap()); QString rowBase(keys.get("PvlBaseName","Pvl")); - QString rowId = rowBase + QString::number(nth); + QString rowId = rowBase + QString::fromStdString(toString(nth)); Pvl pvl(pvlfile.toStdString()); PvlFlatMap pvlImports(pvl, m_pvlparms); diff --git a/isis/src/base/apps/isisminer/StereoPairStrategy.cpp b/isis/src/base/apps/isisminer/StereoPairStrategy.cpp index 449fbbf5dd..0b1063a337 100644 --- a/isis/src/base/apps/isisminer/StereoPairStrategy.cpp +++ b/isis/src/base/apps/isisminer/StereoPairStrategy.cpp @@ -301,12 +301,12 @@ namespace Isis { (void) rankConstraints(resourceA, m_imageStrength, rankA, stereo, "Rank"+suffixA()); (void) rankConstraints(resourceB, m_imageStrength, rankB, stereo, "Rank"+suffixB()); - stereo->add("ImageStrengthRank"+suffixA(), QString::number(rankA)); - stereo->add("ImageStrengthRank"+suffixB(), QString::number(rankB)); + stereo->add("ImageStrengthRank"+suffixA(), QString::fromStdString(toString(rankA))); + stereo->add("ImageStrengthRank"+suffixB(), QString::fromStdString(toString(rankB))); // Level1 constraints rank is the average of the two level1 constraints double rank = (rankA + rankB) / 2.0; - stereo->add("ImageStrengthRank", QString::number(rank)); + stereo->add("ImageStrengthRank", QString::fromStdString(toString(rank))); // Now compute parallax height ratio QString plx = m_keywordMap.get("ParallaxX", "ParallaxX"); @@ -318,7 +318,7 @@ namespace Isis { double pxdiff = px1 - px2; double pydiff = py1 - py2; double dp = sqrt( pxdiff*pxdiff + pydiff*pydiff ); - stereo->add("ParallaxHeightRatio", QString::number(dp)); + stereo->add("ParallaxHeightRatio", QString::fromStdString(toString(dp))); // Now compute shadow tip distance @@ -331,7 +331,7 @@ namespace Isis { double shxdiff = shx1 - shx2; double shydiff = shy1 - shy2; double dsh = sqrt( shxdiff*shxdiff + shydiff*shydiff ); - stereo->add("ShadowTipDistance", QString::number(dsh)); + stereo->add("ShadowTipDistance", QString::fromStdString(toString(dsh))); // Now compute Resolution @@ -340,7 +340,7 @@ namespace Isis { double pxlresB = resourceB->value(reskey).toDouble(); double resratio = pxlresA / pxlresB; if ( resratio < 1.0 ) { resratio = 1.0 / resratio; } - stereo->add("ResolutionRatio", QString::number(resratio)); + stereo->add("ResolutionRatio", QString::fromStdString(toString(resratio))); // Now compute DeltaSunAzimuth (void) computeDelta(resourceA, resourceB, "DeltaSolarAzimuth", @@ -366,7 +366,7 @@ namespace Isis { // Ensure we have a valid stereo angle if ( qFuzzyCompare(stAngle+1.0, 1.0) ) { stAngle = 0.1E-6; } double evp = rho * gsd / stAngle; - stereo->add("VerticalPrecision", QString::number(evp)); + stereo->add("VerticalPrecision", QString::fromStdString(toString(evp))); // Now compute the stereo rank // m_myDebug = true; @@ -380,7 +380,7 @@ namespace Isis { // Good, compute rank values double rankS; (void) rankConstraints(stereo, m_stereoStrength, rankS, stereo); - stereo->add("StereoStrengthRank", QString::number(rankS)); + stereo->add("StereoStrengthRank", QString::fromStdString(toString(rankS))); // Evaluate the rank @@ -501,7 +501,7 @@ namespace Isis { QVector thresholds = constraint.value(); double myrank = computeRank(value, thresholds); if ( !out.isNull() ) { - out->add(constraint.key()+suffix, QString::number(myrank)); + out->add(constraint.key()+suffix, QString::fromStdString(toString(myrank))); } rank += myrank; } @@ -593,7 +593,7 @@ bool StereoPairStrategy::computeDelta(const SharedResource &resourceA, double dsc1 = resourceA->value(dsckey).toDouble(); double dsc2 = resourceB->value(dsckey).toDouble(); double dscaz = acos( cos((dsc2 - dsc1) * rpd_c()) ) * dpr_c(); - composite->add(parameter, QString::number(dscaz)); + composite->add(parameter, QString::fromStdString(toString(dscaz))); return (true); } @@ -701,7 +701,7 @@ bool StereoPairStrategy::computeStereoAngle(const SharedResource &resourceA, // Convert to degrees convang = acos ( convang ) * dpr_c(); - stereo->add("StereoAngle", QString::number(convang)); + stereo->add("StereoAngle", QString::fromStdString(toString(convang))); if ( isDebug() ) { cout << "StereoAngle = " << convang << "\n"; diff --git a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp index 9cd2bc0738..2e9b0f0f1c 100644 --- a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp +++ b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp @@ -269,7 +269,7 @@ namespace Isis { } } - QString mStatsName = "MultivariateStatistics" + QString::number(band); + QString mStatsName = "MultivariateStatistics" + QString::fromStdString(toString(band)); PvlObject mStats(GetMStats(band).toPvl(mStatsName)); mStats += validBand; o.addObject(mStats); @@ -318,7 +318,7 @@ namespace Isis { // unserialize the MStats for (int band = 1; band <= Bands(); band++) { - QString name = "MultivariateStatistics" + QString::number(band); + QString name = "MultivariateStatistics" + QString::fromStdString(toString(band)); const PvlObject &mStats = inStats.findObject(name.toStdString()); p_stats.push_back(MultivariateStatistics(mStats)); } diff --git a/isis/src/base/objs/Process/Process.cpp b/isis/src/base/objs/Process/Process.cpp index 5639585938..22b500e9dd 100644 --- a/isis/src/base/objs/Process/Process.cpp +++ b/isis/src/base/objs/Process/Process.cpp @@ -867,8 +867,8 @@ Isis::Cube *Process::SetOutputCubeStretch(const QString ¶meter, const int ns int bandStop = cube->bandCount(); int maxSteps = cube->lineCount() * cube->bandCount(); - QString cubeNumStr = QString::number(cubeNum + 1); - QString totalCubes = QString::number((int)InputCubes.size()); + QString cubeNumStr = QString::fromStdString(toString(cubeNum + 1)); + QString totalCubes = QString::fromStdString(toString((int)InputCubes.size())); QString msg = "Calculating statistics for cube " + cubeNumStr + " of " + totalCubes; Isis::Progress progress; diff --git a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp index 8604ec02a9..436e780e61 100644 --- a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp +++ b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp @@ -684,7 +684,7 @@ namespace Isis { axisBinSetElement.appendChild(bin); QDomElement binSequenceNumber = m_domDoc->createElement("sp:bin_sequence_number"); - PvlToXmlTranslationManager::setElementValue(binSequenceNumber, QString::number(i+1)); + PvlToXmlTranslationManager::setElementValue(binSequenceNumber, QString::fromStdString(toString(i+1))); bin.appendChild(binSequenceNumber); @@ -895,12 +895,12 @@ namespace Isis { QDomElement scalingFactorElement = m_domDoc->createElement("scaling_factor"); PvlToXmlTranslationManager::setElementValue(scalingFactorElement, - QString::number(multiplier)); + QString::fromStdString(toString(multiplier))); elementArrayElement.appendChild(scalingFactorElement); QDomElement offsetElement = m_domDoc->createElement("value_offset"); PvlToXmlTranslationManager::setElementValue(offsetElement, - QString::number(base)); + QString::fromStdString(toString(base))); elementArrayElement.appendChild(offsetElement); } @@ -912,89 +912,89 @@ namespace Isis { switch (p_pixelType) { case Real: { QDomElement nullElement = m_domDoc->createElement("missing_constant"); - PvlToXmlTranslationManager::setElementValue(nullElement, QString::number(NULL4, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(nullElement, QString::fromStdString(toString(NULL4, 18))); specialConstantElement.appendChild(nullElement); QDomElement highInstrumentSatElement = m_domDoc->createElement("high_instrument_saturation"); - PvlToXmlTranslationManager::setElementValue(highInstrumentSatElement, QString::number(HIGH_INSTR_SAT4, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(highInstrumentSatElement, QString::fromStdString(toString(HIGH_INSTR_SAT4, 18))); specialConstantElement.appendChild(highInstrumentSatElement); QDomElement highRepresentationSatElement = m_domDoc->createElement("high_representation_saturation"); - PvlToXmlTranslationManager::setElementValue(highRepresentationSatElement, QString::number(HIGH_REPR_SAT4, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(highRepresentationSatElement, QString::fromStdString(toString(HIGH_REPR_SAT4, 18))); specialConstantElement.appendChild(highRepresentationSatElement); QDomElement lowInstrumentSatElement = m_domDoc->createElement("low_instrument_saturation"); - PvlToXmlTranslationManager::setElementValue(lowInstrumentSatElement, QString::number(LOW_INSTR_SAT4, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(lowInstrumentSatElement, QString::fromStdString(toString(LOW_INSTR_SAT4, 18))); specialConstantElement.appendChild(lowInstrumentSatElement); QDomElement lowRepresentationSatElement = m_domDoc->createElement("low_representation_saturation"); - PvlToXmlTranslationManager::setElementValue(lowRepresentationSatElement, QString::number(LOW_REPR_SAT4, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(lowRepresentationSatElement, QString::fromStdString(toString(LOW_REPR_SAT4, 18))); specialConstantElement.appendChild(lowRepresentationSatElement); break;} case UnsignedByte: { QDomElement nullElement = m_domDoc->createElement("missing_constant"); - PvlToXmlTranslationManager::setElementValue(nullElement, QString::number(NULL1, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(nullElement, QString::fromStdString(toString(NULL1, 18))); specialConstantElement.appendChild(nullElement); QDomElement highInstrumentSatElement = m_domDoc->createElement("high_instrument_saturation"); - PvlToXmlTranslationManager::setElementValue(highInstrumentSatElement, QString::number(HIGH_INSTR_SAT1, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(highInstrumentSatElement, QString::fromStdString(toString(HIGH_INSTR_SAT1, 18))); specialConstantElement.appendChild(highInstrumentSatElement); QDomElement highRepresentationSatElement = m_domDoc->createElement("high_representation_saturation"); - PvlToXmlTranslationManager::setElementValue(highRepresentationSatElement, QString::number(HIGH_REPR_SAT1, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(highRepresentationSatElement, QString::fromStdString(toString(HIGH_REPR_SAT1, 18))); specialConstantElement.appendChild(highRepresentationSatElement); QDomElement lowInstrumentSatElement = m_domDoc->createElement("low_instrument_saturation"); - PvlToXmlTranslationManager::setElementValue(lowInstrumentSatElement, QString::number(LOW_INSTR_SAT1, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(lowInstrumentSatElement, QString::fromStdString(toString(LOW_INSTR_SAT1, 18))); specialConstantElement.appendChild(lowInstrumentSatElement); QDomElement lowRepresentationSatElement = m_domDoc->createElement("low_representation_saturation"); - PvlToXmlTranslationManager::setElementValue(lowRepresentationSatElement, QString::number(LOW_REPR_SAT1, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(lowRepresentationSatElement, QString::fromStdString(toString(LOW_REPR_SAT1, 18))); specialConstantElement.appendChild(lowRepresentationSatElement); break; } case SignedWord: { QDomElement nullElement = m_domDoc->createElement("missing_constant"); - PvlToXmlTranslationManager::setElementValue(nullElement, QString::number(NULL2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(nullElement, QString::fromStdString(toString(NULL2, 18))); specialConstantElement.appendChild(nullElement); QDomElement highInstrumentSatElement = m_domDoc->createElement("high_instrument_saturation"); - PvlToXmlTranslationManager::setElementValue(highInstrumentSatElement, QString::number(HIGH_INSTR_SAT2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(highInstrumentSatElement, QString::fromStdString(toString(HIGH_INSTR_SAT2, 18))); specialConstantElement.appendChild(highInstrumentSatElement); QDomElement highRepresentationSatElement = m_domDoc->createElement("high_representation_saturation"); - PvlToXmlTranslationManager::setElementValue(highRepresentationSatElement, QString::number(HIGH_REPR_SAT2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(highRepresentationSatElement, QString::fromStdString(toString(HIGH_REPR_SAT2, 18))); specialConstantElement.appendChild(highRepresentationSatElement); QDomElement lowInstrumentSatElement = m_domDoc->createElement("low_instrument_saturation"); - PvlToXmlTranslationManager::setElementValue(lowInstrumentSatElement, QString::number(LOW_INSTR_SAT2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(lowInstrumentSatElement, QString::fromStdString(toString(LOW_INSTR_SAT2, 18))); specialConstantElement.appendChild(lowInstrumentSatElement); QDomElement lowRepresentationSatElement = m_domDoc->createElement("low_representation_saturation"); - PvlToXmlTranslationManager::setElementValue(lowRepresentationSatElement, QString::number(LOW_REPR_SAT2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(lowRepresentationSatElement, QString::fromStdString(toString(LOW_REPR_SAT2, 18))); specialConstantElement.appendChild(lowRepresentationSatElement); break; } case UnsignedWord: { QDomElement nullElement = m_domDoc->createElement("missing_constant"); - PvlToXmlTranslationManager::setElementValue(nullElement, QString::number(NULLU2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(nullElement, QString::fromStdString(toString(NULLU2, 18))); specialConstantElement.appendChild(nullElement); QDomElement highInstrumentSatElement = m_domDoc->createElement("high_instrument_saturation"); - PvlToXmlTranslationManager::setElementValue(highInstrumentSatElement, QString::number(HIGH_INSTR_SATU2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(highInstrumentSatElement, QString::fromStdString(toString(HIGH_INSTR_SATU2, 18))); specialConstantElement.appendChild(highInstrumentSatElement); QDomElement highRepresentationSatElement = m_domDoc->createElement("high_representation_saturation"); - PvlToXmlTranslationManager::setElementValue(highRepresentationSatElement, QString::number(HIGH_REPR_SATU2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(highRepresentationSatElement, QString::fromStdString(toString(HIGH_REPR_SATU2, 18))); specialConstantElement.appendChild(highRepresentationSatElement); QDomElement lowInstrumentSatElement = m_domDoc->createElement("low_instrument_saturation"); - PvlToXmlTranslationManager::setElementValue(lowInstrumentSatElement, QString::number(LOW_INSTR_SATU2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(lowInstrumentSatElement, QString::fromStdString(toString(LOW_INSTR_SATU2, 18))); specialConstantElement.appendChild(lowInstrumentSatElement); QDomElement lowRepresentationSatElement = m_domDoc->createElement("low_representation_saturation"); - PvlToXmlTranslationManager::setElementValue(lowRepresentationSatElement, QString::number(LOW_REPR_SATU2, 'g', 18)); + PvlToXmlTranslationManager::setElementValue(lowRepresentationSatElement, QString::fromStdString(toString(LOW_REPR_SATU2, 18))); specialConstantElement.appendChild(lowRepresentationSatElement); break; } @@ -1218,7 +1218,7 @@ namespace Isis { //if no units, assume in meters double dValue = toDouble(semiMajorRadElement.text().toStdString()); dValue /= 1000.0; - PvlToXmlTranslationManager::resetElementValue(semiMajorRadElement, QString::number(dValue), "km"); + PvlToXmlTranslationManager::resetElementValue(semiMajorRadElement, QString::fromStdString(toString(dValue)), "km"); } } @@ -1230,7 +1230,7 @@ namespace Isis { // If no units, assume in meters double dValue = toDouble(semiMinorRadElement.text().toStdString()); dValue /= 1000.0; - PvlToXmlTranslationManager::resetElementValue(semiMinorRadElement, QString::number(dValue), "km"); + PvlToXmlTranslationManager::resetElementValue(semiMinorRadElement, QString::fromStdString(toString(dValue)), "km"); } } @@ -1241,7 +1241,7 @@ namespace Isis { // If no units, assume in meters double dValue = toDouble(polarRadElement.text().toStdString()); dValue /= 1000.0; - PvlToXmlTranslationManager::resetElementValue(polarRadElement, QString::number(dValue), "km"); + PvlToXmlTranslationManager::resetElementValue(polarRadElement, QString::fromStdString(toString(dValue)), "km"); } } @@ -1270,16 +1270,16 @@ namespace Isis { // so if positive east, swap min/max if(QString::compare(lonDir, "PositiveEast", Qt::CaseInsensitive) == 0) { // west min, east max - PvlToXmlTranslationManager::resetElementValue(eastElement, QString::number(maxLon), "deg"); - PvlToXmlTranslationManager::resetElementValue(westElement, QString::number(minLon), "deg"); + PvlToXmlTranslationManager::resetElementValue(eastElement, QString::fromStdString(toString(maxLon)), "deg"); + PvlToXmlTranslationManager::resetElementValue(westElement, QString::fromStdString(toString(minLon)), "deg"); } else { - PvlToXmlTranslationManager::resetElementValue(eastElement, QString::number(minLon), "deg"); - PvlToXmlTranslationManager::resetElementValue(westElement, QString::number(maxLon), "deg"); + PvlToXmlTranslationManager::resetElementValue(eastElement, QString::fromStdString(toString(minLon)), "deg"); + PvlToXmlTranslationManager::resetElementValue(westElement, QString::fromStdString(toString(maxLon)), "deg"); } - PvlToXmlTranslationManager::resetElementValue(northElement, QString::number(maxLat), "deg"); - PvlToXmlTranslationManager::resetElementValue(southElement, QString::number(minLat), "deg"); + PvlToXmlTranslationManager::resetElementValue(northElement, QString::fromStdString(toString(maxLat)), "deg"); + PvlToXmlTranslationManager::resetElementValue(southElement, QString::fromStdString(toString(minLat)), "deg"); // longitude_of_central_meridian and latitude_of_projection_origin need to be converted to floats. xmlPath.clear(); @@ -1305,12 +1305,12 @@ namespace Isis { // Only update the ouput formatting if there are no digits after the decimal point. if (!longitudeElement.text().contains('.')) { - QString toset1 = QString::number(longitudeElementValue, 'f', 1); + QString toset1 = QString::fromStdString(toString(longitudeElementValue, 1)); PvlToXmlTranslationManager::resetElementValue(longitudeElement, toset1, "deg"); } if (!originElement.text().contains('.')) { - QString toset2 = QString::number(originElementValue, 'f', 1); + QString toset2 = QString::fromStdString(toString(originElementValue, 1)); PvlToXmlTranslationManager::resetElementValue(originElement, toset2, "deg"); } } diff --git a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp index 8454144aae..b785e2d4b8 100644 --- a/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp +++ b/isis/src/base/objs/StatCumProbDistDynCalc/StatCumProbDistDynCalc.cpp @@ -552,19 +552,19 @@ namespace Isis { void StatCumProbDistDynCalc::save(QXmlStreamWriter &stream, const Project *project) const { // TODO: does xml stuff need project??? stream.writeStartElement("statCumProbDistDynCalc"); - stream.writeTextElement("numberCells", QString::number(m_numberCells)); - stream.writeTextElement("numberQuantiles", QString::number(m_numberQuantiles)); - stream.writeTextElement("numberObservations", QString::number(m_numberObservations)); + stream.writeTextElement("numberCells", QString::fromStdString(toString(m_numberCells))); + stream.writeTextElement("numberQuantiles", QString::fromStdString(toString(m_numberQuantiles))); + stream.writeTextElement("numberObservations", QString::fromStdString(toString(m_numberObservations))); stream.writeStartElement("distributionData"); for (unsigned int i = 0; i < m_numberQuantiles; i++) { stream.writeStartElement("quantileInfo"); // we need to write out high precision for minDistance calculations in value() and cumProb() - stream.writeAttribute("quantile", QString::number(m_quantiles[i], 'g', 17)); - stream.writeAttribute("dataValue", QString::number(m_observationValues[i], 'g', 17)); + stream.writeAttribute("quantile", QString::fromStdString(toString(m_quantiles[i], 17))); + stream.writeAttribute("dataValue", QString::fromStdString(toString(m_observationValues[i], 17))); stream.writeAttribute("idealNumObsBelowQuantile", - QString::number(m_idealNumObsBelowQuantile[i])); - stream.writeAttribute("actualNumObsBelowQuantile", QString::number(m_numObsBelowQuantile[i])); + QString::fromStdString(toString(m_idealNumObsBelowQuantile[i]))); + stream.writeAttribute("actualNumObsBelowQuantile", QString::fromStdString(toString(m_numObsBelowQuantile[i]))); stream.writeEndElement(); // end observation } stream.writeEndElement(); // end observationData diff --git a/isis/src/base/objs/Statistics/Statistics.cpp b/isis/src/base/objs/Statistics/Statistics.cpp index fb5828593c..5eacd0b199 100644 --- a/isis/src/base/objs/Statistics/Statistics.cpp +++ b/isis/src/base/objs/Statistics/Statistics.cpp @@ -878,29 +878,29 @@ namespace Isis { stream.writeStartElement("statistics"); // stream.writeTextElement("id", m_id->toString()); - stream.writeTextElement("sum", QString::number(m_sum)); - stream.writeTextElement("sumSquares", QString::number(m_sumsum)); + stream.writeTextElement("sum",QString::fromStdString(toString(m_sum))); + stream.writeTextElement("sumSquares",QString::fromStdString(toString(m_sumsum))); stream.writeStartElement("range"); - stream.writeTextElement("minimum", QString::number(m_minimum)); - stream.writeTextElement("maximum", QString::number(m_maximum)); - stream.writeTextElement("validMinimum", QString::number(m_validMinimum)); - stream.writeTextElement("validMaximum", QString::number(m_validMaximum)); + stream.writeTextElement("minimum",QString::fromStdString(toString(m_minimum))); + stream.writeTextElement("maximum",QString::fromStdString(toString(m_maximum))); + stream.writeTextElement("validMinimum",QString::fromStdString(toString(m_validMinimum))); + stream.writeTextElement("validMaximum",QString::fromStdString(toString(m_validMaximum))); stream.writeEndElement(); // end range stream.writeStartElement("pixelCounts"); - stream.writeTextElement("totalPixels", QString::number(m_totalPixels)); - stream.writeTextElement("validPixels", QString::number(m_validPixels)); - stream.writeTextElement("nullPixels", QString::number(m_nullPixels)); - stream.writeTextElement("lisPixels", QString::number(m_lisPixels)); - stream.writeTextElement("lrsPixels", QString::number(m_lrsPixels)); - stream.writeTextElement("hisPixels", QString::number(m_hisPixels)); - stream.writeTextElement("hrsPixels", QString::number(m_hrsPixels)); - stream.writeTextElement("underRangePixels", QString::number(m_underRangePixels)); - stream.writeTextElement("overRangePixels", QString::number(m_overRangePixels)); + stream.writeTextElement("totalPixels",QString::fromStdString(toString(m_totalPixels))); + stream.writeTextElement("validPixels",QString::fromStdString(toString(m_validPixels))); + stream.writeTextElement("nullPixels",QString::fromStdString(toString(m_nullPixels))); + stream.writeTextElement("lisPixels",QString::fromStdString(toString(m_lisPixels))); + stream.writeTextElement("lrsPixels",QString::fromStdString(toString(m_lrsPixels))); + stream.writeTextElement("hisPixels",QString::fromStdString(toString(m_hisPixels))); + stream.writeTextElement("hrsPixels",QString::fromStdString(toString(m_hrsPixels))); + stream.writeTextElement("underRangePixels",QString::fromStdString(toString(m_underRangePixels))); + stream.writeTextElement("overRangePixels",QString::fromStdString(toString(m_overRangePixels))); stream.writeEndElement(); // end pixelCounts - stream.writeTextElement("removedData", QString::number(m_removedData)); + stream.writeTextElement("removedData",QString::fromStdString(toString(m_removedData))); stream.writeEndElement(); // end statistics } diff --git a/isis/src/control/apps/sumspice/sumspice.cpp b/isis/src/control/apps/sumspice/sumspice.cpp index 10d10e356a..eb7a7ea7f1 100644 --- a/isis/src/control/apps/sumspice/sumspice.cpp +++ b/isis/src/control/apps/sumspice/sumspice.cpp @@ -47,7 +47,7 @@ namespace Isis { if ( IsSpecial(d) ) { return ( defValue ); } - return (QString::number(d, 'g', precision)); + return (QString::fromStdString(Isis::toString(d, precision))); } diff --git a/isis/src/control/objs/BundleResults/BundleResults.cpp b/isis/src/control/objs/BundleResults/BundleResults.cpp index 78620f0d15..444a1c5f58 100644 --- a/isis/src/control/objs/BundleResults/BundleResults.cpp +++ b/isis/src/control/objs/BundleResults/BundleResults.cpp @@ -2076,48 +2076,48 @@ namespace Isis { stream.writeEndElement(); // end correlationMatrix stream.writeStartElement("generalStatisticsValues"); - stream.writeTextElement("numberFixedPoints", QString::number(numberFixedPoints())); - stream.writeTextElement("numberIgnoredPoints", QString::number(numberIgnoredPoints())); - stream.writeTextElement("numberHeldImages", QString::number(numberHeldImages())); - stream.writeTextElement("rejectionLimit", QString::number(rejectionLimit())); - stream.writeTextElement("numberRejectedObservations", QString::number(numberRejectedObservations())); - stream.writeTextElement("numberObservations", QString::number(numberObservations())); - stream.writeTextElement("numberLidarRangeConstraintEquations", QString::number(numberLidarRangeConstraintEquations())); - stream.writeTextElement("numberImageObservations", QString::number(numberImageObservations())); - stream.writeTextElement("numberLidarImageObservations", QString::number(numberLidarImageObservations())); - stream.writeTextElement("numberImageParameters", QString::number(numberImageParameters())); + stream.writeTextElement("numberFixedPoints", QString::fromStdString(toString(numberFixedPoints()))); + stream.writeTextElement("numberIgnoredPoints", QString::fromStdString(toString(numberIgnoredPoints()))); + stream.writeTextElement("numberHeldImages", QString::fromStdString(toString(numberHeldImages()))); + stream.writeTextElement("rejectionLimit", QString::fromStdString(toString(rejectionLimit()))); + stream.writeTextElement("numberRejectedObservations", QString::fromStdString(toString(numberRejectedObservations()))); + stream.writeTextElement("numberObservations", QString::fromStdString(toString(numberObservations()))); + stream.writeTextElement("numberLidarRangeConstraintEquations", QString::fromStdString(toString(numberLidarRangeConstraintEquations()))); + stream.writeTextElement("numberImageObservations", QString::fromStdString(toString(numberImageObservations()))); + stream.writeTextElement("numberLidarImageObservations", QString::fromStdString(toString(numberLidarImageObservations()))); + stream.writeTextElement("numberImageParameters", QString::fromStdString(toString(numberImageParameters()))); stream.writeTextElement("numberConstrainedPointParameters", - QString::number(numberConstrainedPointParameters())); + QString::fromStdString(toString(numberConstrainedPointParameters()))); stream.writeTextElement("numberConstrainedImageParameters", - QString::number(numberConstrainedImageParameters())); + QString::fromStdString(toString(numberConstrainedImageParameters()))); stream.writeTextElement("numberConstrainedTargetParameters", - QString::number(numberConstrainedTargetParameters())); - stream.writeTextElement("numberUnknownParameters", QString::number(numberUnknownParameters())); - stream.writeTextElement("degreesOfFreedom", QString::number(degreesOfFreedom())); - stream.writeTextElement("sigma0", QString::number(sigma0())); - stream.writeTextElement("converged", QString::number(converged())); - stream.writeTextElement("iterations", QString::number(iterations())); + QString::fromStdString(toString(numberConstrainedTargetParameters()))); + stream.writeTextElement("numberUnknownParameters", QString::fromStdString(toString(numberUnknownParameters()))); + stream.writeTextElement("degreesOfFreedom", QString::fromStdString(toString(degreesOfFreedom()))); + stream.writeTextElement("sigma0", QString::fromStdString(toString(sigma0()))); + stream.writeTextElement("converged", QString::fromStdString(toString(converged()))); + stream.writeTextElement("iterations", QString::fromStdString(toString(iterations()))); stream.writeEndElement(); // end generalStatisticsValues stream.writeStartElement("rms"); stream.writeStartElement("residuals"); - stream.writeAttribute("x", QString::number(rmsRx())); - stream.writeAttribute("y", QString::number(rmsRy())); - stream.writeAttribute("xy", QString::number(rmsRxy())); + stream.writeAttribute("x", QString::fromStdString(toString(rmsRx()))); + stream.writeAttribute("y", QString::fromStdString(toString(rmsRy()))); + stream.writeAttribute("xy", QString::fromStdString(toString(rmsRxy()))); stream.writeEndElement(); // end residuals element stream.writeStartElement("sigmas"); // Set the label based of the coordinate type set for reports switch (coordType) { case SurfacePoint::Latitudinal: - stream.writeAttribute("lat", QString::number(sigmaCoord1StatisticsRms())); - stream.writeAttribute("lon", QString::number(sigmaCoord2StatisticsRms())); - stream.writeAttribute("rad", QString::number(sigmaCoord3StatisticsRms())); + stream.writeAttribute("lat", QString::fromStdString(toString(sigmaCoord1StatisticsRms()))); + stream.writeAttribute("lon", QString::fromStdString(toString(sigmaCoord2StatisticsRms()))); + stream.writeAttribute("rad", QString::fromStdString(toString(sigmaCoord3StatisticsRms()))); break; case SurfacePoint::Rectangular: - stream.writeAttribute("x", QString::number(sigmaCoord1StatisticsRms())); - stream.writeAttribute("y", QString::number(sigmaCoord2StatisticsRms())); - stream.writeAttribute("z", QString::number(sigmaCoord3StatisticsRms())); + stream.writeAttribute("x", QString::fromStdString(toString(sigmaCoord1StatisticsRms()))); + stream.writeAttribute("y", QString::fromStdString(toString(sigmaCoord2StatisticsRms()))); + stream.writeAttribute("z", QString::fromStdString(toString(sigmaCoord3StatisticsRms()))); break; default: IString msg ="Unknown surface point coordinate type enum [" + toString(coordType) + "]." ; @@ -2127,7 +2127,7 @@ namespace Isis { stream.writeStartElement("imageResidualsLists"); stream.writeStartElement("residualsList"); - stream.writeAttribute("listSize", QString::number(rmsImageResiduals().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageResiduals().size()))); for (int i = 0; i < m_rmsImageResiduals.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageResiduals[i].save(stream, project); @@ -2135,7 +2135,7 @@ namespace Isis { } stream.writeEndElement(); // end residuals list stream.writeStartElement("sampleList"); - stream.writeAttribute("listSize", QString::number(rmsImageSampleResiduals().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageSampleResiduals().size()))); for (int i = 0; i < m_rmsImageSampleResiduals.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageSampleResiduals[i].save(stream, project); @@ -2144,7 +2144,7 @@ namespace Isis { stream.writeEndElement(); // end sample residuals list stream.writeStartElement("lineList"); - stream.writeAttribute("listSize", QString::number(rmsImageLineResiduals().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageLineResiduals().size()))); for (int i = 0; i < m_rmsImageLineResiduals.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageLineResiduals[i].save(stream, project); @@ -2153,7 +2153,7 @@ namespace Isis { stream.writeEndElement(); // end line residuals list stream.writeStartElement("lidarResidualsList"); - stream.writeAttribute("listSize", QString::number(rmsLidarImageResiduals().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsLidarImageResiduals().size()))); for (int i = 0; i < m_rmsLidarImageResiduals.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsLidarImageResiduals[i].save(stream, project); @@ -2162,7 +2162,7 @@ namespace Isis { stream.writeEndElement(); // end line residuals list stream.writeStartElement("lidarSampleList"); - stream.writeAttribute("listSize", QString::number(rmsLidarImageSampleResiduals().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsLidarImageSampleResiduals().size()))); for (int i = 0; i < m_rmsLidarImageSampleResiduals.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsLidarImageSampleResiduals[i].save(stream, project); @@ -2171,7 +2171,7 @@ namespace Isis { stream.writeEndElement(); // end line residuals list stream.writeStartElement("lidarLineList"); - stream.writeAttribute("listSize", QString::number(rmsLidarImageLineResiduals().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsLidarImageLineResiduals().size()))); for (int i = 0; i < m_rmsLidarImageLineResiduals.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsLidarImageLineResiduals[i].save(stream, project); @@ -2182,7 +2182,7 @@ namespace Isis { stream.writeStartElement("imageSigmasLists"); stream.writeStartElement("xSigmas"); - stream.writeAttribute("listSize", QString::number(rmsImageXSigmas().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageXSigmas().size()))); for (int i = 0; i < m_rmsImageXSigmas.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageXSigmas[i].save(stream, project); @@ -2192,7 +2192,7 @@ namespace Isis { stream.writeEndElement(); // end x sigma list stream.writeStartElement("ySigmas"); - stream.writeAttribute("listSize", QString::number(rmsImageYSigmas().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageYSigmas().size()))); for (int i = 0; i < m_rmsImageYSigmas.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageYSigmas[i].save(stream, project); @@ -2201,7 +2201,7 @@ namespace Isis { stream.writeEndElement(); // end y sigma list stream.writeStartElement("zSigmas"); - stream.writeAttribute("listSize", QString::number(rmsImageZSigmas().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageZSigmas().size()))); for (int i = 0; i < m_rmsImageZSigmas.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageZSigmas[i].save(stream, project); @@ -2210,7 +2210,7 @@ namespace Isis { stream.writeEndElement(); // end z sigma list stream.writeStartElement("raSigmas"); - stream.writeAttribute("listSize", QString::number(rmsImageRASigmas().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageRASigmas().size()))); for (int i = 0; i < m_rmsImageRASigmas.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageRASigmas[i].save(stream, project); @@ -2219,7 +2219,7 @@ namespace Isis { stream.writeEndElement(); // end ra sigma list stream.writeStartElement("decSigmas"); - stream.writeAttribute("listSize", QString::number(rmsImageDECSigmas().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageDECSigmas().size()))); for (int i = 0; i < m_rmsImageDECSigmas.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageDECSigmas[i].save(stream, project); @@ -2228,7 +2228,7 @@ namespace Isis { stream.writeEndElement(); // end dec sigma list stream.writeStartElement("twistSigmas"); - stream.writeAttribute("listSize", QString::number(rmsImageTWISTSigmas().size())); + stream.writeAttribute("listSize", QString::fromStdString(toString(rmsImageTWISTSigmas().size()))); for (int i = 0; i < m_rmsImageTWISTSigmas.size(); i++) { stream.writeStartElement("statisticsItem"); m_rmsImageTWISTSigmas[i].save(stream, project); @@ -2239,8 +2239,8 @@ namespace Isis { stream.writeEndElement(); // end rms stream.writeStartElement("elapsedTime"); - stream.writeAttribute("time", QString::number(elapsedTime())); - stream.writeAttribute("errorProp", QString::number(elapsedTimeErrorProp())); + stream.writeAttribute("time", QString::fromStdString(toString(elapsedTime()))); + stream.writeAttribute("errorProp", QString::fromStdString(toString(elapsedTimeErrorProp()))); stream.writeEndElement(); // end elapsed time stream.writeStartElement("minMaxSigmas"); @@ -2249,53 +2249,53 @@ namespace Isis { switch (coordType) { case SurfacePoint::Latitudinal: stream.writeStartElement("minLat"); - stream.writeAttribute("value", QString::number(minSigmaCoord1Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(minSigmaCoord1Distance().meters()))); stream.writeAttribute("pointId", minSigmaCoord1PointId()); stream.writeEndElement(); stream.writeStartElement("maxLat"); - stream.writeAttribute("value", QString::number(maxSigmaCoord1Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(maxSigmaCoord1Distance().meters()))); stream.writeAttribute("pointId", maxSigmaCoord1PointId()); stream.writeEndElement(); stream.writeStartElement("minLon"); - stream.writeAttribute("value", QString::number(minSigmaCoord2Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(minSigmaCoord2Distance().meters()))); stream.writeAttribute("pointId", minSigmaCoord2PointId()); stream.writeEndElement(); stream.writeStartElement("maxLon"); - stream.writeAttribute("value", QString::number(maxSigmaCoord2Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(maxSigmaCoord2Distance().meters()))); stream.writeAttribute("pointId", maxSigmaCoord2PointId()); stream.writeEndElement(); stream.writeStartElement("minRad"); - stream.writeAttribute("value", QString::number(minSigmaCoord3Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(minSigmaCoord3Distance().meters()))); stream.writeAttribute("pointId", minSigmaCoord3PointId()); stream.writeEndElement(); stream.writeStartElement("maxRad"); - stream.writeAttribute("value", QString::number(maxSigmaCoord3Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(maxSigmaCoord3Distance().meters()))); stream.writeAttribute("pointId", maxSigmaCoord3PointId()); stream.writeEndElement(); break; case SurfacePoint::Rectangular: stream.writeStartElement("minX"); - stream.writeAttribute("value", QString::number(minSigmaCoord1Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(minSigmaCoord1Distance().meters()))); stream.writeAttribute("pointId", minSigmaCoord1PointId()); stream.writeEndElement(); stream.writeStartElement("maxX"); - stream.writeAttribute("value", QString::number(maxSigmaCoord1Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(maxSigmaCoord1Distance().meters()))); stream.writeAttribute("pointId", maxSigmaCoord1PointId()); stream.writeEndElement(); stream.writeStartElement("minY"); - stream.writeAttribute("value", QString::number(minSigmaCoord2Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(minSigmaCoord2Distance().meters()))); stream.writeAttribute("pointId", minSigmaCoord2PointId()); stream.writeEndElement(); stream.writeStartElement("maxY"); - stream.writeAttribute("value", QString::number(maxSigmaCoord2Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(maxSigmaCoord2Distance().meters()))); stream.writeAttribute("pointId", maxSigmaCoord2PointId()); stream.writeEndElement(); stream.writeStartElement("minZ"); - stream.writeAttribute("value", QString::number(minSigmaCoord3Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(minSigmaCoord3Distance().meters()))); stream.writeAttribute("pointId", minSigmaCoord3PointId()); stream.writeEndElement(); stream.writeStartElement("maxZ"); - stream.writeAttribute("value", QString::number(maxSigmaCoord3Distance().meters())); + stream.writeAttribute("value", QString::fromStdString(toString(maxSigmaCoord3Distance().meters()))); stream.writeAttribute("pointId", maxSigmaCoord3PointId()); stream.writeEndElement(); break; @@ -2307,10 +2307,10 @@ namespace Isis { // call max likelihood setup from startElement to fill the rest of these values... stream.writeStartElement("maximumLikelihoodEstimation"); - stream.writeAttribute("numberModels", QString::number(numberMaximumLikelihoodModels())); - stream.writeAttribute("maximumLikelihoodIndex", QString::number(maximumLikelihoodModelIndex())); + stream.writeAttribute("numberModels", QString::fromStdString(toString(numberMaximumLikelihoodModels()))); + stream.writeAttribute("maximumLikelihoodIndex", QString::fromStdString(toString(maximumLikelihoodModelIndex()))); stream.writeAttribute("maximumLikelihoodMedianR2Residuals", - QString::number(maximumLikelihoodMedianR2Residuals())); + QString::fromStdString(toString(maximumLikelihoodMedianR2Residuals()))); stream.writeStartElement("cumulativeProbabilityCalculator"); // cumulativeProbabilityDistribution().save(stream, project); @@ -2322,12 +2322,12 @@ namespace Isis { for (int i = 0; i < numberMaximumLikelihoodModels(); i++) { stream.writeStartElement("model"); - stream.writeAttribute("modelNumber", QString::number(i+1)); + stream.writeAttribute("modelNumber", QString::fromStdString(toString(i+1))); stream.writeAttribute("modelSelection", MaximumLikelihoodWFunctions::modelToString(m_maximumLikelihoodFunctions[i].first.model())); stream.writeAttribute("tweakingConstant", - QString::number(m_maximumLikelihoodFunctions[i].first.tweakingConstant())); - stream.writeAttribute("quantile", QString::number(m_maximumLikelihoodFunctions[i].second)); + QString::fromStdString(toString(m_maximumLikelihoodFunctions[i].first.tweakingConstant()))); + stream.writeAttribute("quantile", QString::fromStdString(toString(m_maximumLikelihoodFunctions[i].second))); stream.writeEndElement(); // end this model } stream.writeEndElement(); // end maximumLikelihoodEstimation diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.cpp b/isis/src/control/objs/BundleSettings/BundleSettings.cpp index 0bc28c0566..568a74a4d8 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.cpp +++ b/isis/src/control/objs/BundleSettings/BundleSettings.cpp @@ -1027,16 +1027,16 @@ namespace Isis { stream.writeStartElement("globalSettings"); - stream.writeTextElement("validateNetwork", QString::number(validateNetwork())); + stream.writeTextElement("validateNetwork", QString::fromStdString(toString(validateNetwork()))); stream.writeStartElement("solveOptions"); - stream.writeAttribute("solveObservationMode", QString::number(solveObservationMode())); - stream.writeAttribute("solveRadius", QString::number(solveRadius())); - stream.writeAttribute("controlPointCoordTypeReports", QString::number(controlPointCoordTypeReports())); - stream.writeAttribute("controlPointCoordTypeBundle", QString::number(controlPointCoordTypeBundle())); - stream.writeAttribute("updateCubeLabel", QString::number(updateCubeLabel())); - stream.writeAttribute("errorPropagation", QString::number(errorPropagation())); - stream.writeAttribute("createInverseMatrix", QString::number(createInverseMatrix())); + stream.writeAttribute("solveObservationMode", QString::fromStdString(toString(solveObservationMode()))); + stream.writeAttribute("solveRadius", QString::fromStdString(toString(solveRadius()))); + stream.writeAttribute("controlPointCoordTypeReports", QString::fromStdString(toString(controlPointCoordTypeReports()))); + stream.writeAttribute("controlPointCoordTypeBundle", QString::fromStdString(toString(controlPointCoordTypeBundle()))); + stream.writeAttribute("updateCubeLabel", QString::fromStdString(toString(updateCubeLabel()))); + stream.writeAttribute("errorPropagation", QString::fromStdString(toString(errorPropagation()))); + stream.writeAttribute("createInverseMatrix", QString::fromStdString(toString(createInverseMatrix()))); stream.writeEndElement(); stream.writeStartElement("aprioriSigmas"); @@ -1044,26 +1044,26 @@ namespace Isis { stream.writeAttribute("pointCoord1", "N/A"); } else { - stream.writeAttribute("pointCoord1", QString::number(globalPointCoord1AprioriSigma())); + stream.writeAttribute("pointCoord1", QString::fromStdString(toString(globalPointCoord1AprioriSigma()))); } if (IsSpecial(globalPointCoord2AprioriSigma())) { stream.writeAttribute("pointCoord2", "N/A"); } else { - stream.writeAttribute("pointCoord2", QString::number(globalPointCoord2AprioriSigma())); + stream.writeAttribute("pointCoord2", QString::fromStdString(toString(globalPointCoord2AprioriSigma()))); } if (IsSpecial(globalPointCoord3AprioriSigma())) { stream.writeAttribute("pointCoord3", "N/A"); } else { - stream.writeAttribute("pointCoord3", QString::number(globalPointCoord3AprioriSigma())); + stream.writeAttribute("pointCoord3", QString::fromStdString(toString(globalPointCoord3AprioriSigma()))); } stream.writeEndElement(); stream.writeStartElement("outlierRejectionOptions"); - stream.writeAttribute("rejection", QString::number(outlierRejection())); + stream.writeAttribute("rejection", QString::fromStdString(toString(outlierRejection()))); if (outlierRejection()) { - stream.writeAttribute("multiplier", QString::number(outlierRejectionMultiplier())); + stream.writeAttribute("multiplier", QString::fromStdString(toString(outlierRejectionMultiplier()))); } else { stream.writeAttribute("multiplier", "N/A"); @@ -1074,9 +1074,9 @@ namespace Isis { stream.writeAttribute("convergenceCriteria", convergenceCriteriaToString(convergenceCriteria())); stream.writeAttribute("threshold", - QString::number(convergenceCriteriaThreshold())); + QString::fromStdString(toString(convergenceCriteriaThreshold()))); stream.writeAttribute("maximumIterations", - QString::number(convergenceCriteriaMaximumIterations())); + QString::fromStdString(toString(convergenceCriteriaMaximumIterations()))); stream.writeEndElement(); stream.writeStartElement("maximumLikelihoodEstimation"); @@ -1084,7 +1084,7 @@ namespace Isis { stream.writeStartElement("model"); stream.writeAttribute("type", MaximumLikelihoodWFunctions::modelToString(m_maximumLikelihood[i].first)); - stream.writeAttribute("quantile", QString::number(m_maximumLikelihood[i].second)); + stream.writeAttribute("quantile", QString::fromStdString(toString(m_maximumLikelihood[i].second))); stream.writeEndElement(); } stream.writeEndElement(); diff --git a/isis/src/mro/objs/HiCal/GainTemperature.h b/isis/src/mro/objs/HiCal/GainTemperature.h index b823244eb1..4923bed328 100644 --- a/isis/src/mro/objs/HiCal/GainTemperature.h +++ b/isis/src/mro/objs/HiCal/GainTemperature.h @@ -72,7 +72,7 @@ namespace Isis { _fpaFactor = factor[0]; // Get temperature parameters - _refTemp = ConfKey(prof, "FpaReferenceTemperature", QString::number(21.0)).toDouble(); + _refTemp = ConfKey(prof, "FpaReferenceTemperature", QString::fromStdString(toString(21.0))).toDouble(); double fpa_py_temp = ToDouble(prof("FpaPositiveYTemperature")); double fpa_my_temp = ToDouble(prof("FpaNegativeYTemperature")); diff --git a/isis/src/mro/objs/HiCal/HiCalUtil.h b/isis/src/mro/objs/HiCal/HiCalUtil.h index 91975cab20..62c78f5454 100644 --- a/isis/src/mro/objs/HiCal/HiCalUtil.h +++ b/isis/src/mro/objs/HiCal/HiCalUtil.h @@ -234,7 +234,7 @@ template double ToDouble(const T &value) { * @return string Converted value */ template QString ToString(const T &value) { - return (QString::number(value).trimmed()); + return (QString::fromStdString(toString(value)).trimmed()); } /** diff --git a/isis/src/mro/objs/HiCal/SplineFill.h b/isis/src/mro/objs/HiCal/SplineFill.h index 5b8749c8b3..a0a4cb32c6 100644 --- a/isis/src/mro/objs/HiCal/SplineFill.h +++ b/isis/src/mro/objs/HiCal/SplineFill.h @@ -67,7 +67,7 @@ namespace Isis { int _filled; //!< Number values replaced QString formHistory() { - QString cfilled(QString::number(_filled)); + QString cfilled(QString::fromStdString(toString(_filled))); return (QString("SplineFill(Cubic,Filled[" + cfilled + "])")); } diff --git a/isis/src/mro/objs/HiCal/ZeroDark.h b/isis/src/mro/objs/HiCal/ZeroDark.h index db18a93684..02b23ec540 100644 --- a/isis/src/mro/objs/HiCal/ZeroDark.h +++ b/isis/src/mro/objs/HiCal/ZeroDark.h @@ -91,11 +91,11 @@ namespace Isis { _intercept = loadCsv("DarkIntercept", conf, prof, 256); // Get temperation normalization factor - _refTemp = ConfKey(prof, "FpaReferenceTemperature", QString::number(21.0)).toDouble(); + _refTemp = ConfKey(prof, "FpaReferenceTemperature", QString::fromStdString(toString(21.0))).toDouble(); // Smooth/filter if requested - int width = ConfKey(prof,"ZeroDarkFilterWidth",QString::number(3)).toInt(); - int iters = ConfKey(prof,"ZerDarkFilterIterations",QString::number(0)).toInt(); + int width = ConfKey(prof,"ZeroDarkFilterWidth",QString::fromStdString(toString(3))).toInt(); + int iters = ConfKey(prof,"ZerDarkFilterIterations",QString::fromStdString(toString(0))).toInt(); LowPassFilter smooth(width, iters); _history.add("Smooth(Width["+ToString(width)+"],Iters["+ToString(iters)+"])"); diff --git a/isis/src/mro/objs/HiCal/ZeroReverse.h b/isis/src/mro/objs/HiCal/ZeroReverse.h index 1bcf5cef75..7b1d031b2b 100644 --- a/isis/src/mro/objs/HiCal/ZeroReverse.h +++ b/isis/src/mro/objs/HiCal/ZeroReverse.h @@ -117,11 +117,11 @@ namespace Isis { _triggered= false; if (triggers.profileExists(tprofName)) { DbProfile tprof(prof, triggers.getProfile(tprofName), tprofName); - double revmean = ConfKey(tprof,"RevMeanTrigger", QString::number(_stats.Average())).toDouble(); - double revstddev = ConfKey(tprof,"RevStdDevTrigger", QString::number(DBL_MAX)).toDouble(); - int lisTol = ConfKey(tprof, "RevLisTolerance", QString::number(1)).toInt(); - int hisTol = ConfKey(tprof, "RevHisTolerance", QString::number(1)).toInt(); - int nulTol = ConfKey(tprof, "RevNulTolerance", QString::number(1)).toInt(); + double revmean = ConfKey(tprof,"RevMeanTrigger", QString::fromStdString(toString(_stats.Average()))).toDouble(); + double revstddev = ConfKey(tprof,"RevStdDevTrigger", QString::fromStdString(toString(DBL_MAX))).toDouble(); + int lisTol = ConfKey(tprof, "RevLisTolerance", QString::fromStdString(toString(1))).toInt(); + int hisTol = ConfKey(tprof, "RevHisTolerance", QString::fromStdString(toString(1))).toInt(); + int nulTol = ConfKey(tprof, "RevNulTolerance", QString::fromStdString(toString(1))).toInt(); _history.add("TriggerLimits(RevMeanTrigger["+ToString(revmean) + "],RevStdDevTrigger["+ToString(revstddev)+ diff --git a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp index 86b3feebb4..6199bea42b 100644 --- a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp +++ b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp @@ -240,28 +240,28 @@ namespace Isis { } else { throw IException(IException::Unknown, - "Expected Pvl Group " + primaryGroup.name() + " in the first Pvl Object " - " " + primaryObject.name() + " in the DB file " + kernelFileName.original() + " to have a single keyword " - "named File, but the keyword was named " + key.name() + "instead", + "Expected Pvl Group [" + primaryGroup.name() + "] in the first Pvl Object [" + + primaryObject.name() + "] in the DB file [" + kernelFileName.original() + "] to have a single keyword " + "named File, but the keyword was named [" + key.name() + "] instead", _FILEINFO_); } } else { - throw IException(IException::Unknown, "Expected Pvl Group " + primaryGroup.name() + " in the first Pvl Object " + primaryObject.name() + " " - "in the DB file " + kernelFileName.original() + " to have a single keyword (named " - "File), but found " + toString(primaryGroup.keywords()) + " keywords", + throw IException(IException::Unknown, "Expected Pvl Group [" + primaryGroup.name() + "] in the first Pvl Object [" + primaryObject.name() + "] " + "in the DB file [" + kernelFileName.original() + "] to have a single keyword (named " + "File), but found [" + toString(primaryGroup.keywords()) + "] keywords", _FILEINFO_); } } else { - throw IException(IException::Unknown, "Expected Pvl Group in the first Pvl Object " + primaryObject.name() + " in " - "the DB file " + kernelFileName.original() + " to be named Selection but found " + primaryGroup.name(), + throw IException(IException::Unknown, "Expected Pvl Group in the first Pvl Object [" + primaryObject.name() + "] in " + "the DB file [" + kernelFileName.original() + "] to be named Selection but found [" + primaryGroup.name() + "]", _FILEINFO_); } } else { - throw IException(IException::Unknown,"Expected one Pvl Group in the first Pvl Object " + primaryObject.name() + " in " - "the DB file " + kernelFileName.original() + " but found " + toString(primaryObject.groups()), _FILEINFO_); + throw IException(IException::Unknown,"Expected one Pvl Group in the first Pvl Object [" + primaryObject.name() + "] in " + "the DB file [" + kernelFileName.original() + "] but found [" + toString(primaryObject.groups()) + "]", _FILEINFO_); } } else { diff --git a/isis/tests/FunctionalTestsHical.cpp b/isis/tests/FunctionalTestsHical.cpp index 554e23f7c3..4f4ce78b6e 100644 --- a/isis/tests/FunctionalTestsHical.cpp +++ b/isis/tests/FunctionalTestsHical.cpp @@ -403,7 +403,7 @@ TEST(HicalTest, Dns) { EXPECT_TRUE(logText[36].startsWith("GainUnitConversion")) << logText[36].toStdString(); QStringList gainUnitConversionParams = logText[36].split(";", Qt::SkipEmptyParts); ASSERT_EQ(gainUnitConversionParams.size(), 4); - EXPECT_EQ(gainUnitConversionParams[1].toStdString(), " DN_Factor[1]"); + EXPECT_EQ(gainUnitConversionParams[1].toStdString(), " DN_Factor[1.0]"); EXPECT_EQ(gainUnitConversionParams[2].toStdString(), " Units[DN]"); } From 0775a1f887eef69fa07f542aeca18ac7d8db4ee7 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Mon, 23 Sep 2024 11:32:37 -0600 Subject: [PATCH 88/95] Update std::tostring, stoi, stod to IString functions --- isis/src/apollo/apps/apollo2isis/main.cpp | 20 +- .../apollo/apps/apollofindrx/apollofindrx.cpp | 38 +- isis/src/apollo/apps/apollopaninit/main.cpp | 26 +- .../apollo/apps/apolloremrx/apolloremrx.cpp | 6 +- .../apollo/apps/apollowarp/WarpTransform.cpp | 6 +- isis/src/apollo/apps/apollowarp/main.cpp | 12 +- .../ApolloPanoramicCamera.cpp | 2 +- isis/src/base/apps/appjit/main.cpp | 2 +- isis/src/base/apps/ascii2isis/main.cpp | 2 +- isis/src/base/apps/autoregtemplate/main.cpp | 42 +- isis/src/base/apps/bit2bit/main.cpp | 32 +- isis/src/base/apps/cam2cam/cam2cam.cpp | 2 +- isis/src/base/apps/cam2map/cam2map.cpp | 44 +- isis/src/base/apps/caminfo/CamTools.cpp | 12 +- isis/src/base/apps/caminfo/CamTools.h | 2 +- isis/src/base/apps/camrange/camrange.cpp | 34 +- isis/src/base/apps/camstats/camstats.cpp | 2 +- isis/src/base/apps/center/main.cpp | 8 +- .../src/base/apps/ckwriter/CkSpiceSegment.cpp | 8 +- isis/src/base/apps/crop/crop.cpp | 20 +- isis/src/base/apps/cropspecial/main.cpp | 16 +- isis/src/base/apps/csminit/csminit.cpp | 2 +- isis/src/base/apps/cubeavg/main.cpp | 10 +- isis/src/base/apps/cubediff/main.cpp | 38 +- isis/src/base/apps/cubefunc/main.cpp | 2 +- isis/src/base/apps/cubenorm/main.cpp | 32 +- isis/src/base/apps/ddd2isis/main.cpp | 12 +- isis/src/base/apps/demprep/demprep.cpp | 12 +- isis/src/base/apps/errors/main.cpp | 2 +- isis/src/base/apps/fillgap/fillgap.cpp | 2 +- .../base/apps/findgaps/FindGapsFunctor.cpp | 22 +- .../findimageoverlaps/findimageoverlaps.cpp | 2 +- isis/src/base/apps/findrx/main.cpp | 24 +- .../base/apps/footprintinit/footprintinit.cpp | 4 +- isis/src/base/apps/footprintmerge/main.cpp | 4 +- .../src/base/apps/framestitch/framestitch.cpp | 4 +- isis/src/base/apps/isis2fits/main.cpp | 4 +- isis/src/base/apps/isis2pds/isis2pds.cpp | 28 +- isis/src/base/apps/isis2raw/main.cpp | 14 +- isis/src/base/apps/isis2std/isis2std.cpp | 4 +- .../base/apps/isisimport/CassiniImportUtils.h | 18 +- isis/src/base/apps/isisimport/isisimport.cpp | 16 +- .../apps/isisminer/StereoPairStrategy.cpp | 4 +- isis/src/base/apps/kernfilter/main.cpp | 2 +- isis/src/base/apps/lineeq/main.cpp | 4 +- isis/src/base/apps/makeflat/main.cpp | 18 +- isis/src/base/apps/map2map/main.cpp | 16 +- isis/src/base/apps/map2map/map2map.cpp | 28 +- isis/src/base/apps/mapgrid/main.cpp | 8 +- isis/src/base/apps/maplab/main.cpp | 8 +- isis/src/base/apps/mapmos/mapmos.cpp | 8 +- isis/src/base/apps/mappt/mappt.cpp | 24 +- isis/src/base/apps/mapsize/main.cpp | 16 +- isis/src/base/apps/maptemplate/main.cpp | 40 +- isis/src/base/apps/mask/main.cpp | 4 +- isis/src/base/apps/mosrange/mosrange.cpp | 64 +- isis/src/base/apps/mvstats/main.cpp | 4 +- isis/src/base/apps/nocam2map/nocam2map.cpp | 46 +- isis/src/base/apps/noisefilter/main.cpp | 10 +- isis/src/base/apps/noproj/noproj.cpp | 40 +- .../base/apps/overlapstats/overlapstats.cpp | 40 +- isis/src/base/apps/pad/main.cpp | 16 +- isis/src/base/apps/percent/main.cpp | 4 +- isis/src/base/apps/phoempglobal/main.cpp | 12 +- isis/src/base/apps/phoemplocal/main.cpp | 18 +- isis/src/base/apps/phohillier/Hillier.cpp | 32 +- isis/src/base/apps/phohillier/Hillier.h | 4 +- isis/src/base/apps/photemplate/main.cpp | 4 +- isis/src/base/apps/pvldiff/main.cpp | 2 +- isis/src/base/apps/remrx/main.cpp | 22 +- isis/src/base/apps/ringscam2map/main.cpp | 44 +- isis/src/base/apps/ringsmappt/main.cpp | 18 +- .../apps/ringspt/CameraRingsPointInfo.cpp | 96 +-- isis/src/base/apps/shadow/ShadowFunctor.cpp | 28 +- isis/src/base/apps/shadowtau/main.cpp | 28 +- isis/src/base/apps/skymap/main.cpp | 42 +- isis/src/base/apps/skypt/skypt.cpp | 12 +- isis/src/base/apps/skyrange/main.cpp | 22 +- isis/src/base/apps/slpmap/main.cpp | 2 +- isis/src/base/apps/smtk/main.cpp | 20 +- isis/src/base/apps/spechighpass/main.cpp | 4 +- isis/src/base/apps/specpix/main.cpp | 12 +- isis/src/base/apps/spiceinit/spiceinit.cpp | 8 +- .../src/base/apps/spiceserver/spiceserver.cpp | 12 +- .../src/base/apps/spkwriter/SpkKernelWriter.h | 2 +- isis/src/base/apps/stats/stats.cpp | 38 +- isis/src/base/apps/trackextract/main.cpp | 2 +- isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp | 6 +- isis/src/base/objs/AlphaCube/AlphaCube.cpp | 32 +- .../src/base/objs/Application/Application.cpp | 2 +- isis/src/base/objs/AutoReg/AutoReg.cpp | 48 +- isis/src/base/objs/CSVReader/CSVReader.cpp | 2 +- isis/src/base/objs/CSVReader/unitTest.cpp | 2 +- isis/src/base/objs/Camera/Camera.cpp | 28 +- isis/src/base/objs/Camera/unitTest.cpp | 8 +- .../objs/CameraPointInfo/CameraPointInfo.cpp | 146 ++-- .../base/objs/CameraPointInfo/unitTest.cpp | 8 +- .../CameraStatistics/CameraStatistics.cpp | 2 +- .../base/objs/CameraStatistics/unitTest.cpp | 2 +- isis/src/base/objs/Cube/Cube.cpp | 36 +- isis/src/base/objs/Cube/CubeBsqHandler.cpp | 8 +- isis/src/base/objs/Cube/CubeTileHandler.cpp | 12 +- .../base/objs/CubeAttribute/CubeAttribute.h | 2 +- .../objs/CubeDataThread/CubeDataThread.cpp | 4 +- .../src/base/objs/CubeStretch/CubeStretch.cpp | 4 +- isis/src/base/objs/DemShape/unitTest.cpp | 2 +- .../src/base/objs/EllipsoidShape/unitTest.cpp | 2 +- isis/src/base/objs/Enlarge/Enlarge.cpp | 20 +- .../base/objs/Equalization/Equalization.cpp | 28 +- .../EquatorialCylindricalShape/unitTest.cpp | 2 +- .../objs/Equirectangular/Equirectangular.cpp | 6 +- .../base/objs/Equirectangular/unitTest.cpp | 24 +- .../objs/ExportPdsTable/ExportPdsTable.cpp | 14 +- .../src/base/objs/ExportPdsTable/unitTest.cpp | 10 +- isis/src/base/objs/FitsToJson/FitsToJson.cpp | 6 +- .../GridPolygonSeeder/GridPolygonSeeder.cpp | 10 +- .../base/objs/GridPolygonSeeder/unitTest.cpp | 22 +- isis/src/base/objs/GroundGrid/GroundGrid.cpp | 8 +- isis/src/base/objs/Gruen/Gruen.cpp | 28 +- isis/src/base/objs/Gruen/Gruen.h | 4 +- isis/src/base/objs/Gruen/unitTest.cpp | 16 +- isis/src/base/objs/Hapke/unitTest.cpp | 60 +- isis/src/base/objs/Hillshade/Hillshade.cpp | 2 +- .../src/base/objs/IdealCamera/IdealCamera.cpp | 2 +- .../base/objs/ImageExporter/ImageExporter.cpp | 2 +- .../objs/ImportPdsTable/ImportPdsTable.cpp | 20 +- .../objs/InfixToPostfix/InfixToPostfix.cpp | 2 +- .../LambertAzimuthalEqualArea.cpp | 4 +- .../LambertAzimuthalEqualArea/unitTest.cpp | 6 +- .../LambertConformal/LambertConformal.cpp | 4 +- isis/src/base/objs/Latitude/Latitude.cpp | 28 +- .../LimitPolygonSeeder/LimitPolygonSeeder.cpp | 8 +- .../objs/LunarAzimuthalEqualArea/unitTest.cpp | 18 +- .../LunarLambertEmpirical.cpp | 8 +- .../objs/LunarLambertEmpirical/unitTest.cpp | 6 +- isis/src/base/objs/Mercator/Mercator.cpp | 4 +- .../MinnaertEmpirical/MinnaertEmpirical.cpp | 6 +- .../base/objs/MinnaertEmpirical/unitTest.cpp | 6 +- isis/src/base/objs/Mollweide/Mollweide.cpp | 2 +- isis/src/base/objs/Mollweide/unitTest.cpp | 16 +- .../MultivariateStatistics.cpp | 16 +- .../NaifDskPlateModel/NaifDskPlateModel.cpp | 2 +- .../ObliqueCylindrical/ObliqueCylindrical.cpp | 24 +- .../base/objs/ObliqueCylindrical/unitTest.cpp | 18 +- .../ObservationNumber/ObservationNumber.cpp | 2 +- .../OriginalXmlLabel/OriginalXmlLabel.cpp | 2 +- .../base/objs/Orthographic/Orthographic.cpp | 4 +- .../OverlapStatistics/OverlapStatistics.cpp | 38 +- isis/src/base/objs/Pipeline/Pipeline.cpp | 4 +- isis/src/base/objs/Planar/Planar.cpp | 8 +- isis/src/base/objs/PlaneShape/unitTest.cpp | 2 +- .../PointPerspective/PointPerspective.cpp | 4 +- .../base/objs/PointPerspective/unitTest.cpp | 40 +- .../PolarStereographic/PolarStereographic.cpp | 6 +- .../base/objs/PolarStereographic/unitTest.cpp | 20 +- .../base/objs/PolygonSeeder/PolygonSeeder.cpp | 8 +- .../PrincipalComponentAnalysis.cpp | 4 +- .../ProcessExportPds/ProcessExportPds.cpp | 200 ++--- .../ProcessImportFits/ProcessImportFits.cpp | 48 +- .../ProcessImportPds/ProcessImportPds.cpp | 50 +- .../ProcessMapMosaic/ProcessMapMosaic.cpp | 36 +- .../base/objs/ProcessMapMosaic/unitTest.cpp | 8 +- .../base/objs/ProcessMosaic/ProcessMosaic.cpp | 10 +- isis/src/base/objs/Projection/Projection.cpp | 4 +- isis/src/base/objs/Projection/unitTest.cpp | 24 +- .../ProjectionFactory/ProjectionFactory.cpp | 32 +- .../base/objs/ProjectionFactory/unitTest.cpp | 124 +-- .../RadarSlantRangeMap/RadarSlantRangeMap.cpp | 8 +- isis/src/base/objs/Reduce/Reduce.cpp | 20 +- .../ReseauDistortionMap.cpp | 8 +- .../objs/RingCylindrical/RingCylindrical.cpp | 8 +- isis/src/base/objs/Robinson/Robinson.cpp | 2 +- .../base/objs/SerialNumber/SerialNumber.cpp | 2 +- isis/src/base/objs/SessionLog/unitTest.cpp | 6 +- .../ShapeModelFactory/ShapeModelFactory.cpp | 4 +- .../base/objs/ShapeModelFactory/unitTest.cpp | 8 +- .../SimpleCylindrical/SimpleCylindrical.cpp | 2 +- .../base/objs/SimpleCylindrical/unitTest.cpp | 16 +- isis/src/base/objs/Sinusoidal/Sinusoidal.cpp | 2 +- isis/src/base/objs/Sinusoidal/unitTest.cpp | 16 +- isis/src/base/objs/Spice/Spice.cpp | 14 +- isis/src/base/objs/Spice/unitTest.cpp | 4 +- .../base/objs/SpicePosition/SpicePosition.cpp | 12 +- isis/src/base/objs/SpicePosition/unitTest.cpp | 6 +- .../base/objs/SpiceRotation/SpiceRotation.cpp | 60 +- isis/src/base/objs/Statistics/Statistics.cpp | 44 +- isis/src/base/objs/Stretch/Stretch.cpp | 6 +- .../StripPolygonSeeder/StripPolygonSeeder.cpp | 8 +- .../base/objs/StripPolygonSeeder/unitTest.cpp | 16 +- isis/src/base/objs/SubArea/SubArea.cpp | 18 +- isis/src/base/objs/SubArea/unitTest.cpp | 220 +++--- .../src/base/objs/TProjection/TProjection.cpp | 34 +- isis/src/base/objs/Target/Target.cpp | 20 +- isis/src/base/objs/Target/unitTest.cpp | 10 +- .../base/objs/TiffImporter/TiffImporter.cpp | 20 +- .../TransverseMercator/TransverseMercator.cpp | 6 +- .../base/objs/TransverseMercator/unitTest.cpp | 40 +- .../UpturnedEllipsoidTransverseAzimuthal.cpp | 14 +- .../unitTest.cpp | 2 +- .../base/objs/UserInterface/UserInterface.cpp | 2 +- .../XmlToPvlTranslationManager.cpp | 2 +- isis/src/cassini/apps/ciss2isis/ciss2isis.cpp | 16 +- isis/src/cassini/apps/cisscal/DarkCurrent.cpp | 2 +- isis/src/cassini/apps/cisscal/main.cpp | 28 +- isis/src/cassini/apps/vims2isis/main.cpp | 14 +- isis/src/cassini/apps/vimscal/main.cpp | 14 +- .../cassini/objs/CissLabels/CissLabels.cpp | 2 +- .../cassini/objs/VimsCamera/VimsGroundMap.cpp | 6 +- .../cassini/objs/VimsCamera/VimsSkyMap.cpp | 6 +- .../apps/chan1m32isis/chan1m32isis.cpp | 16 +- isis/src/clementine/apps/clem2isis/main.cpp | 4 +- isis/src/clementine/apps/clemnircal/main.cpp | 20 +- .../src/clementine/apps/clemuvviscal/main.cpp | 34 +- isis/src/clipper/apps/eis2isis/eis2isis.cpp | 16 +- isis/src/clipper/apps/jitterfit/jitterfit.cpp | 8 +- .../ClipperNacRollingShutterCamera.cpp | 4 +- isis/src/control/apps/autoseed/autoseed.cpp | 12 +- isis/src/control/apps/cnet2dem/main.cpp | 2 +- isis/src/control/apps/cnetcheck/cnetcheck.cpp | 16 +- .../apps/cnetcombinept/cnetcombinept.cpp | 18 +- isis/src/control/apps/cnetdiff/cnetdiff.cpp | 2 +- isis/src/control/apps/cnetedit/cnetedit.cpp | 6 +- .../control/apps/cnetextract/cnetextract.cpp | 34 +- isis/src/control/apps/cnetnewradii/main.cpp | 8 +- .../apps/cnetref/CnetRefByEmission.cpp | 18 +- .../apps/cnetref/CnetRefByIncidence.cpp | 18 +- .../apps/cnetref/CnetRefByResolution.cpp | 20 +- isis/src/control/apps/coreg/main.cpp | 16 +- isis/src/control/apps/deltack/main.cpp | 30 +- .../control/apps/findfeatures/ImageSource.cpp | 2 +- .../control/apps/findfeatures/MatchMaker.cpp | 26 +- .../apps/findfeatures/MatcherAlgorithms.cpp | 2 +- .../apps/findfeatures/findfeatures.cpp | 12 +- isis/src/control/apps/fplanemap/main.cpp | 16 +- isis/src/control/apps/mat2cnet/main.cpp | 2 +- isis/src/control/apps/pointreg/pointreg.cpp | 12 +- isis/src/control/apps/seedgrid/main.cpp | 16 +- isis/src/control/apps/sumspice/SumFinder.cpp | 2 +- isis/src/control/apps/warp/WarpTransform.cpp | 6 +- .../objs/BundleAdjust/BundleAdjust.cpp | 34 +- .../objs/BundleResults/BundleResults.cpp | 2 +- .../BundleObservationSolveSettings.cpp | 4 +- .../ControlMeasureLogData.cpp | 6 +- .../objs/ControlMeasureLogData/unitTest.cpp | 2 +- isis/src/control/objs/ControlNet/unitTest.cpp | 8 +- .../objs/ControlNetDiff/ControlNetDiff.cpp | 10 +- .../ControlNetFilter/ControlNetFilter.cpp | 12 +- .../objs/ControlNetFilter/unitTest.cpp | 34 +- .../ControlNetStatistics.cpp | 72 +- .../ControlNetValidMeasure.cpp | 90 +-- .../objs/ControlNetValidMeasure/unitTest.cpp | 148 ++-- .../ControlNetVersioner.cpp | 110 +-- .../ControlNetVersioner/ControlPointV0001.cpp | 102 +-- .../ControlNetVersioner/ControlPointV0002.cpp | 38 +- .../ControlNetVersioner/ControlPointV0003.cpp | 28 +- .../objs/ControlPoint/ControlPoint.cpp | 4 +- .../ControlPointList/ControlPointList.cpp | 6 +- .../InterestOperator/InterestOperator.cpp | 46 +- .../objs/InterestOperator/unitTest.cpp | 22 +- isis/src/core/src/Blob.cpp | 8 +- isis/src/core/src/FileName.cpp | 6 +- isis/src/core/src/IException.cpp | 2 +- isis/src/core/src/Preference.cpp | 2 +- isis/src/core/src/PvlKeyword.cpp | 16 +- isis/src/core/src/Table.cpp | 6 +- isis/src/core/src/TableField.cpp | 22 +- isis/src/core/tests/PvlKeywordTests.cpp | 18 + .../src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp | 8 +- .../dawn/objs/DawnFcCamera/DawnFcCamera.cpp | 2 +- .../dawn/objs/DawnVirCamera/DawnVirCamera.cpp | 20 +- isis/src/dev/apps/camcoeffs/main.cpp | 24 +- isis/src/dev/apps/camtest/main.cpp | 14 +- isis/src/galileo/apps/gllnims2isis/main.cpp | 10 +- isis/src/galileo/apps/gllssi2isis/main.cpp | 4 +- isis/src/galileo/apps/gllssical/gllssical.cpp | 62 +- .../apps/amica2isis/AmicaImportFits.cpp | 12 +- isis/src/hayabusa/apps/amica2isis/main.cpp | 2 +- isis/src/hayabusa/apps/amicacal/main.cpp | 28 +- .../apps/nirs2isis/NirsImportFits.cpp | 12 +- isis/src/hayabusa/apps/nirs2isis/main.cpp | 6 +- .../apps/hyb2onc2isis/hyb2onc2isis.cpp | 2 +- isis/src/hayabusa2/apps/hyb2onccal/main.cpp | 10 +- isis/src/juno/apps/junocam2isis/main.cpp | 14 +- isis/src/juno/objs/JunoCamera/unitTest.cpp | 2 +- .../apps/kaguyami2isis/kaguyami2isis.cpp | 2 +- isis/src/kaguya/apps/kaguyasp2ascii/main.cpp | 50 +- isis/src/kaguya/apps/kaguyasp2isis/main.cpp | 40 +- .../src/kaguya/apps/mimap2isis/mimap2isis.cpp | 4 +- isis/src/lo/apps/lo2isis/lo2isis.cpp | 2 +- isis/src/lo/apps/lopdsgen/main.cpp | 4 +- .../LoCameraFiducialMap.cpp | 8 +- isis/src/lro/apps/lromakeflat/main.cpp | 6 +- isis/src/lro/apps/lronac2isis/lronac2isis.cpp | 6 +- isis/src/lro/apps/lronac2pds/lronac2pds.cpp | 36 +- isis/src/lro/apps/lronaccal/lronaccal.cpp | 20 +- isis/src/lro/apps/lronacpho/LROCEmpirical.cpp | 26 +- isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp | 20 +- isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp | 20 +- isis/src/lro/apps/lrowaccal/lrowaccal.cpp | 14 +- isis/src/lro/apps/lrowacpho/Exponential.cpp | 24 +- .../lro/apps/lrowacpho/HapkeExponential.cpp | 24 +- isis/src/lro/apps/lrowacpho/Hillier.cpp | 30 +- isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp | 18 +- isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp | 18 +- isis/src/lro/apps/mrf2isis/main.cpp | 6 +- .../LroWideAngleCamera/LroWideAngleCamera.cpp | 16 +- isis/src/mariner/apps/mar10cal/main.cpp | 2 +- isis/src/mer/apps/mical/MiCalibration.cpp | 4 +- isis/src/mer/apps/mical/main.cpp | 18 +- isis/src/messenger/apps/mdis2isis/main.cpp | 12 +- isis/src/messenger/apps/mdis2pds/main.cpp | 14 +- isis/src/messenger/apps/mdiscal/main.cpp | 24 +- isis/src/messenger/apps/mdisddr/main.cpp | 2 +- isis/src/mgs/apps/moc2isis/main.cpp | 20 +- isis/src/mgs/apps/moccal/moccal.cpp | 18 +- isis/src/mgs/apps/mocnoise50/main.cpp | 10 +- isis/src/mro/apps/crism2isis/crism2isis.cpp | 6 +- isis/src/mro/apps/ctxcal/ctxcal.cpp | 2 +- isis/src/mro/apps/hi2isis/hi2isis.cpp | 84 +- isis/src/mro/apps/hicalproc/main.cpp | 6 +- isis/src/mro/apps/hiccdstitch/main.cpp | 12 +- isis/src/mro/apps/hicolormos/hicolormos.cpp | 14 +- isis/src/mro/apps/hicrop/hicrop.cpp | 10 +- isis/src/mro/apps/hicubenorm/hicubenorm.cpp | 42 +- isis/src/mro/apps/hideal2pds/main.cpp | 38 +- isis/src/mro/apps/hidtmgen/hidtmgen.cpp | 26 +- isis/src/mro/apps/hifringe/main.cpp | 32 +- isis/src/mro/apps/hifurrows/main.cpp | 2 +- isis/src/mro/apps/hijitreg/main.cpp | 6 +- isis/src/mro/apps/himos/himos.cpp | 14 +- isis/src/mro/apps/hinoise/main.cpp | 4 +- isis/src/mro/apps/hirdrgen/main.cpp | 28 +- isis/src/mro/apps/histat/main.cpp | 24 +- isis/src/mro/apps/histitch/main.cpp | 16 +- isis/src/mro/apps/marci2isis/marci2isis.cpp | 18 +- isis/src/mro/apps/marcical/marcical.cpp | 16 +- isis/src/mro/apps/marciflip/marciflip.cpp | 2 +- isis/src/mro/apps/mroctx2isis/main.cpp | 10 +- isis/src/mro/apps/pds2hideal/main.cpp | 18 +- isis/src/near/apps/msi2isis/msi2isis.cpp | 4 +- .../apps/leisa2isis/leisa2isis.cpp | 2 +- .../newhorizons/apps/mvic2isis/mvic2isis.cpp | 2 +- .../NewHorizonsLeisaCamera.cpp | 2 +- .../NewHorizonsMvicFrameCamera.cpp | 2 +- isis/src/odyssey/apps/thm2isis/thm2isis.cpp | 10 +- isis/src/odyssey/apps/thmnoseam/main.cpp | 2 +- isis/src/odyssey/apps/thmvisflat/main.cpp | 4 +- isis/src/odyssey/apps/thmvistrim/main.cpp | 2 +- .../objs/ThemisIrCamera/ThemisIrCamera.cpp | 2 +- .../objs/ThemisVisCamera/ThemisVisCamera.cpp | 2 +- .../apps/tagcams2isis/tagcams2isis.cpp | 4 +- .../qisis/objs/CubeViewport/CubeViewport.cpp | 34 +- .../objs/Directory/ExportImagesWorkOrder.cpp | 2 +- isis/src/qisis/objs/FileTool/FileTool.cpp | 20 +- .../ImageFileListWidget.cpp | 6 +- .../objs/MosaicSceneWidget/MosaicAreaTool.cpp | 2 +- .../MosaicControlNetTool.cpp | 12 +- .../objs/MosaicSceneWidget/MosaicFindTool.cpp | 2 +- .../objs/MosaicSceneWidget/MosaicGridTool.cpp | 48 +- .../MosaicSceneWidget/MosaicSceneWidget.cpp | 16 +- .../objs/ScatterPlotTool/ScatterPlotData.cpp | 8 +- isis/src/qisis/objs/Shape/Shape.cpp | 12 +- .../SpectralPlotTool/SpectralPlotTool.cpp | 2 +- .../SpectralPlotTool/SpectralPlotWindow.cpp | 8 +- .../qisis/objs/StretchTool/StretchTool.cpp | 6 +- isis/src/rosetta/apps/rososiris2isis/main.cpp | 14 +- isis/src/rosetta/apps/rosvirtis2isis/main.cpp | 10 +- .../RosettaVirtisCamera.cpp | 20 +- .../socetlinescankeywords.cpp | 4 +- .../system/apps/isisdataeval/isisdataeval.cpp | 32 +- .../system/apps/kerneldbgen/kerneldbgen.cpp | 14 +- .../apps/prtloganalyzer/ProgramAnalyzer.cpp | 22 +- .../apps/tgocassis2isis/tgocassis2isis.cpp | 6 +- .../tgo/apps/tgocassismos/tgocassismos.cpp | 14 +- .../apps/tgocassisstitch/tgocassisstitch.cpp | 8 +- .../tgocassisunstitch/tgocassisunstitch.cpp | 20 +- .../objs/TgoCassisCamera/TgoCassisCamera.cpp | 4 +- .../src/tgo/objs/TgoCassisCamera/unitTest.cpp | 2 +- isis/src/viking/apps/vik2isis/main.cpp | 8 +- isis/src/viking/apps/vikcal/main.cpp | 28 +- isis/src/viking/apps/vikcal/vikcal.cpp | 28 +- isis/src/voyager/apps/voy2isis/main.cpp | 8 +- isis/src/voyager/apps/voycal/main.cpp | 16 +- isis/src/voyager/apps/voyramp/main.cpp | 6 +- isis/tests/CameraFixtures.cpp | 12 +- isis/tests/CubeFixtures.cpp | 8 +- isis/tests/FunctionalTestsApollofindrx.cpp | 18 +- isis/tests/FunctionalTestsApolloremrx.cpp | 18 +- isis/tests/FunctionalTestsCaminfo.cpp | 4 +- isis/tests/FunctionalTestsCampt.cpp | 36 +- isis/tests/FunctionalTestsChan1m32isis.cpp | 56 +- isis/tests/FunctionalTestsFootprintinit.cpp | 4 +- isis/tests/FunctionalTestsFrameStitch.cpp | 6 +- isis/tests/FunctionalTestsHicubenorm.cpp | 8 +- isis/tests/FunctionalTestsHimos.cpp | 14 +- isis/tests/FunctionalTestsIsisImport.cpp | 6 +- isis/tests/FunctionalTestsIsisImportLo.cpp | 38 +- isis/tests/FunctionalTestsJitterfit.cpp | 12 +- isis/tests/FunctionalTestsLeisa2isis.cpp | 48 +- isis/tests/FunctionalTestsLo2isis.cpp | 38 +- isis/tests/FunctionalTestsLorri2isis.cpp | 8 +- isis/tests/FunctionalTestsLrowac2isis.cpp | 48 +- isis/tests/FunctionalTestsMimap2isis.cpp | 718 +++++++++--------- isis/tests/FunctionalTestsPds2isis.cpp | 154 ++-- isis/tests/FunctionalTestsPhocube.cpp | 12 +- isis/tests/FunctionalTestsSumspice.cpp | 4 +- isis/tests/TestUtilities.cpp | 8 +- 407 files changed, 3968 insertions(+), 3950 deletions(-) diff --git a/isis/src/apollo/apps/apollo2isis/main.cpp b/isis/src/apollo/apps/apollo2isis/main.cpp index 586cfd7d03..744983832c 100644 --- a/isis/src/apollo/apps/apollo2isis/main.cpp +++ b/isis/src/apollo/apps/apollo2isis/main.cpp @@ -239,9 +239,9 @@ void TranslateApolloLabels (IString filename, Cube *opack) { PvlGroup error("ERROR"); error.addComment("The decrypted code is invalid."); for (int i=0; i<4; i++) { - PvlKeyword keyword("Column"+toString(i+1)); + PvlKeyword keyword("Column"+Isis::toString(i+1)); for (int j=0; j<32; j++) { - keyword += toString((int)code[i][j]); + keyword += Isis::toString((int)code[i][j]); } error.addKeyword(keyword); codeGroup += keyword; @@ -250,17 +250,17 @@ void TranslateApolloLabels (IString filename, Cube *opack) { } else { codeGroup += PvlKeyword("StartTime", FrameTime().toStdString()); - codeGroup += PvlKeyword("SpacecraftAltitude", toString(Altitude()),"meters"); + codeGroup += PvlKeyword("SpacecraftAltitude", Isis::toString(Altitude()),"meters"); if (apollo->IsMetric()){ - codeGroup += PvlKeyword("ExposureDuration", toString(ShutterInterval()), "milliseconds"); + codeGroup += PvlKeyword("ExposureDuration", Isis::toString(ShutterInterval()), "milliseconds"); codeGroup += PvlKeyword("ForwardMotionCompensation", FMC().toStdString()); } for (int i=0; i<4; i++) { - PvlKeyword keyword("Column"+ toString(i+1)); + PvlKeyword keyword("Column"+ Isis::toString(i+1)); for (int j=0; j<32; j++) { - keyword += toString((int)code[i][j]); + keyword += Isis::toString((int)code[i][j]); } codeGroup += keyword; } @@ -284,17 +284,17 @@ void TranslateApolloLabels (IString filename, Cube *opack) { // Update reseau locations based on refined code location for (int i=0; i<(reseaus->findKeyword("Type")).size(); i++) { - double x = IString::ToDouble(reseaus->findKeyword("Sample")[i]) + sampleTranslation + 2278, - y = IString::ToDouble(reseaus->findKeyword("Line")[i]) + lineTranslation - 20231; + double x = Isis::toDouble(reseaus->findKeyword("Sample")[i]) + sampleTranslation + 2278, + y = Isis::toDouble(reseaus->findKeyword("Line")[i]) + lineTranslation - 20231; if (apollo->IsApollo17()) { x += 50; y += 20; } - reseaus->findKeyword("Sample")[i] = toString( + reseaus->findKeyword("Sample")[i] = Isis::toString( cos(rotation)*(x-sampleTranslation) - sin(rotation)*(y-lineTranslation) + sampleTranslation); - reseaus->findKeyword("Line")[i] = toString( + reseaus->findKeyword("Line")[i] = Isis::toString( sin(rotation)*(x-sampleTranslation) + cos(rotation)*(y-lineTranslation) + lineTranslation); } inst += PvlKeyword("StartTime", utcTime.toStdString()); diff --git a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp b/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp index 214ab57742..0f3a4b9c8d 100644 --- a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp +++ b/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp @@ -66,20 +66,20 @@ namespace Isis { int nres = reseaus["Line"].size(); if (nres != reseaus["Sample"].size()) { std::string msg = "Sample size incorrect [Sample size " + - toString(reseaus["Sample"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + Isis::toString(reseaus["Sample"].size()) + " != " + " Line size " + + Isis::toString(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (nres != reseaus["Type"].size()) { std::string msg = "Type size incorrect [Type size " + - toString(reseaus["Type"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + Isis::toString(reseaus["Type"].size()) + " != " + " Line size " + + Isis::toString(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (nres != reseaus["Valid"].size()) { std::string msg = "Valid size incorrect [Valid size " + - toString(reseaus["Valid"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + Isis::toString(reseaus["Valid"].size()) + " != " + " Line size " + + Isis::toString(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -106,8 +106,8 @@ namespace Isis { int validReseaus = 0; // for (int res=0; res 0 && reseaus["Valid"][res-1] == "1") dy = currentLine - patternSize/2 - dl + bestLine-1 - IString::ToDouble(reseaus["Line"][res]); - if (res/dim > 0 && reseaus["Valid"][res - dim] == "1") dx = currentSample - patternSize/2 - ds + bestSample-1 - IString::ToDouble(reseaus["Sample"][res]); - double horizontalShift = currentSample - patternSize/2 - ds + bestSample-1 - IString::ToDouble(reseaus["Sample"][res]) - dx, - verticalShift = currentLine - patternSize/2 - dl + bestLine-1 - IString::ToDouble(reseaus["Line"][res]) - dy; + if (res%dim > 0 && reseaus["Valid"][res-1] == "1") dy = currentLine - patternSize/2 - dl + bestLine-1 - Isis::toDouble(reseaus["Line"][res]); + if (res/dim > 0 && reseaus["Valid"][res - dim] == "1") dx = currentSample - patternSize/2 - ds + bestSample-1 - Isis::toDouble(reseaus["Sample"][res]); + double horizontalShift = currentSample - patternSize/2 - ds + bestSample-1 - Isis::toDouble(reseaus["Sample"][res]) - dx, + verticalShift = currentLine - patternSize/2 - dl + bestLine-1 - Isis::toDouble(reseaus["Line"][res]) - dy; for (int i=res; i xy; xy.push_back(res%(int)sqrt(nres)); xy.push_back(res/(int)sqrt(nres)); - sampFunc.AddKnown(xy, IString::ToDouble(reseaus["Sample"][res])); - lineFunc.AddKnown(xy, IString::ToDouble(reseaus["Line"][res])); + sampFunc.AddKnown(xy, Isis::toDouble(reseaus["Sample"][res])); + lineFunc.AddKnown(xy, Isis::toDouble(reseaus["Line"][res])); ds = (int)(MIN_DISP+ abs(dx) + abs(horizontalShift)); dl = (int)(MIN_DISP + abs(dy) + abs(verticalShift)); @@ -150,12 +150,12 @@ namespace Isis { // for invalid reseaus, refine the estimated locations for (int res=0; res xy; xy.push_back(res%(int)sqrt(nres)); xy.push_back(res/(int)sqrt(nres)); - reseaus["Sample"][res] = toString(sampFunc.Evaluate(xy)); - reseaus["Line"][res] = toString(lineFunc.Evaluate(xy)); + reseaus["Sample"][res] = Isis::toString(sampFunc.Evaluate(xy)); + reseaus["Line"][res] = Isis::toString(lineFunc.Evaluate(xy)); } } diff --git a/isis/src/apollo/apps/apollopaninit/main.cpp b/isis/src/apollo/apps/apollopaninit/main.cpp index 8a885ebd2d..866c6d40ec 100644 --- a/isis/src/apollo/apps/apollopaninit/main.cpp +++ b/isis/src/apollo/apps/apollopaninit/main.cpp @@ -181,7 +181,7 @@ void IsisMain() { keyword.setName("LineExposureDuration"); //converted led to msec/mm--negative sign to account for the anti-parallel time and line axes - keyword.setValue(toString(-led),"sec/mm"); + keyword.setValue(Isis::toString(-led),"sec/mm"); inst_pvlG.addKeyword(keyword); panCube.putGroup(inst_pvlG); @@ -191,7 +191,7 @@ void IsisMain() { kernels_pvlG.clear(); keyword.setName("NaifFrameCode"); - keyword.setValue(toString(insCode)); + keyword.setValue(Isis::toString(insCode)); kernels_pvlG.addKeyword(keyword); keyword.setName("LeapSecond"); @@ -404,7 +404,7 @@ void IsisMain() { recordPos[2] = posJ20[2]; recordPos[3] = temp; //temp = et (right now anyway) tablePos += recordPos; - tablePos.Label() += PvlKeyword("SpkTableStartTime",toString(temp)); + tablePos.Label() += PvlKeyword("SpkTableStartTime",Isis::toString(temp)); //now the other node temp = 0.515*(time1-time0); //3% extension posSel[0] = pos0[0] + temp*vel[0]; //selenocentric coordinate calculation @@ -424,7 +424,7 @@ void IsisMain() { recordPos[2] = posJ20[2]; recordPos[3] = temp; //temp = et (right now anyway) tablePos += recordPos; - tablePos.Label() += PvlKeyword("SpkTableEndTime",toString(temp)); + tablePos.Label() += PvlKeyword("SpkTableEndTime",Isis::toString(temp)); tablePos.Label() += PvlKeyword("CacheType","Linear"); tablePos.Label() += PvlKeyword("Description","Created by apollopaninit"); panCube.write(tablePos); //now attach it to the table @@ -547,18 +547,18 @@ void IsisMain() { recordRot[4] = Q[i][4]; tableRot += recordRot; } - tableRot.Label() += PvlKeyword("CkTableStartTime", toString(Q[0][4])); - tableRot.Label() += PvlKeyword("CkTableEndTime", toString(Q[NODES-1][4])); + tableRot.Label() += PvlKeyword("CkTableStartTime", Isis::toString(Q[0][4])); + tableRot.Label() += PvlKeyword("CkTableEndTime", Isis::toString(Q[NODES-1][4])); tableRot.Label() += PvlKeyword("Description", "Created by appollopan2isis"); keyword.setName("TimeDependentFrames"); - keyword.setValue(toString(scFrameCode)); + keyword.setValue(Isis::toString(scFrameCode)); keyword.addValue("1"); tableRot.Label() += keyword; keyword.setName("ConstantFrames"); - keyword.setValue(toString(insCode)); - keyword.addValue(toString(scFrameCode)); + keyword.setValue(Isis::toString(insCode)); + keyword.addValue(Isis::toString(scFrameCode)); tableRot.Label() += keyword; keyword.setName("ConstantRotation"); @@ -777,10 +777,10 @@ void IsisMain() { ApolloPanoramicCamera* cam = (ApolloPanoramicCamera*)(panCube.camera()); //log the residual report from interior orientation PvlGroup residualStats("InteriorOrientationStats"); - residualStats += PvlKeyword("FiducialsFound", toString(tableFid.Records())); - residualStats += PvlKeyword("ResidualMax", toString(cam->intOriResidualMax()),"pixels"); - residualStats += PvlKeyword("ResidualMean", toString(cam->intOriResidualMean()),"pixels"); - residualStats += PvlKeyword("ResidualStdev", toString(cam->intOriResidualStdev()),"pixels"); + residualStats += PvlKeyword("FiducialsFound", Isis::toString(tableFid.Records())); + residualStats += PvlKeyword("ResidualMax", Isis::toString(cam->intOriResidualMax()),"pixels"); + residualStats += PvlKeyword("ResidualMean", Isis::toString(cam->intOriResidualMean()),"pixels"); + residualStats += PvlKeyword("ResidualStdev", Isis::toString(cam->intOriResidualStdev()),"pixels"); Application::Log( residualStats ); diff --git a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp b/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp index dd4d0f82eb..676385f8ab 100644 --- a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp +++ b/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp @@ -99,9 +99,9 @@ namespace Isis { Brick brick(dim,dim,1,cube.pixelType()); int width = ui.GetInteger("WIDTH"); for (int res=0; resKnowns(); i++) { - PvlKeyword p("POINT"+toString(i+1)); - p += toString(p_lsqInputLine->Residual(i)); - p += toString(p_lsqInputSamp->Residual(i)); + PvlKeyword p("POINT"+Isis::toString(i+1)); + p += Isis::toString(p_lsqInputLine->Residual(i)); + p += Isis::toString(p_lsqInputSamp->Residual(i)); errs += p; } return errs; diff --git a/isis/src/apollo/apps/apollowarp/main.cpp b/isis/src/apollo/apps/apollowarp/main.cpp index 71962ea865..a30859b0ea 100644 --- a/isis/src/apollo/apps/apollowarp/main.cpp +++ b/isis/src/apollo/apps/apollowarp/main.cpp @@ -43,14 +43,14 @@ void IsisMain() { vector inputLine,inputSample,outputLine,outputSample; // Setup the parameters for the transform for (int i=0; i 100.0)) { std::string msg = "Invalid value for [PVALIDPERCENT] entered [" - + toString(percent) + "]. Must be greater than 0.0 and less than or equal to 100.0 (Default = 50.0)"; + + Isis::toString(percent) + "]. Must be greater than 0.0 and less than or equal to 100.0 (Default = 50.0)"; throw IException(IException::User, msg, _FILEINFO_); } - patternChip += PvlKeyword("ValidPercent", toString(percent)); + patternChip += PvlKeyword("ValidPercent", Isis::toString(percent)); } // Set up the search chip group PvlGroup searchChip("SearchChip"); - searchChip += PvlKeyword("Samples", toString(ssamp)); - searchChip += PvlKeyword("Lines", toString(sline)); + searchChip += PvlKeyword("Samples", Isis::toString(ssamp)); + searchChip += PvlKeyword("Lines", Isis::toString(sline)); if(ui.WasEntered("SMIN")) { - searchChip += PvlKeyword("ValidMinimum", toString(ui.GetInteger("SMIN"))); + searchChip += PvlKeyword("ValidMinimum", Isis::toString(ui.GetInteger("SMIN"))); } if(ui.WasEntered("SMAX")) { - searchChip += PvlKeyword("ValidMaximum", toString(ui.GetInteger("SMAX"))); + searchChip += PvlKeyword("ValidMaximum", Isis::toString(ui.GetInteger("SMAX"))); } if(ui.WasEntered("SSUBCHIPVALIDPERCENT")) { double percent = ui.GetDouble("SSUBCHIPVALIDPERCENT"); if((percent <= 0.0) || (percent > 100.0)) { std::string msg = "Invalid value for [SSUBCHIPVALIDPERCENT] entered [" - + toString(percent) + "]. Must be greater than 0.0 and less than or equal to 100.0 (Default = 50.0)"; + + Isis::toString(percent) + "]. Must be greater than 0.0 and less than or equal to 100.0 (Default = 50.0)"; throw IException(IException::User, msg, _FILEINFO_); } - searchChip += PvlKeyword("SubchipValidPercent", toString(percent)); + searchChip += PvlKeyword("SubchipValidPercent", Isis::toString(percent)); } // Add groups to the autoreg object @@ -152,21 +152,21 @@ void IsisMain() { PvlGroup surfaceModel("SurfaceModel"); double distanceTol = ui.GetDouble("DISTANCETOLERANCE"); - surfaceModel += PvlKeyword("DistanceTolerance", toString(distanceTol)); + surfaceModel += PvlKeyword("DistanceTolerance", Isis::toString(distanceTol)); if(distanceTol <= 0.0) { std::string msg = "Invalid value for [DISTANCETOLERANCE] entered [" - + toString(distanceTol) + "]. Must be greater than 0.0 (Default = 1.5)"; + + Isis::toString(distanceTol) + "]. Must be greater than 0.0 (Default = 1.5)"; throw IException(IException::User, msg, _FILEINFO_); } int winSize = ui.GetInteger("WINDOWSIZE"); - surfaceModel += PvlKeyword("WindowSize", toString(winSize)); + surfaceModel += PvlKeyword("WindowSize", Isis::toString(winSize)); // Make sure the window size is odd if(winSize % 2 == 0) { std::string msg = "Invalid value for [WINDOWSIZE] entered [" - + toString(winSize) + "]. Must be an odd number (Default = 5)"; + + Isis::toString(winSize) + "]. Must be an odd number (Default = 5)"; throw IException(IException::User, msg, _FILEINFO_); } autoreg.addGroup(surfaceModel); diff --git a/isis/src/base/apps/bit2bit/main.cpp b/isis/src/base/apps/bit2bit/main.cpp index ed0a81cca8..4d5c0ac4ec 100644 --- a/isis/src/base/apps/bit2bit/main.cpp +++ b/isis/src/base/apps/bit2bit/main.cpp @@ -99,16 +99,16 @@ void IsisMain(){ //!Write bit2bit summary to print.prt logfile PvlGroup results("bit2bit_Results"); - results += PvlKeyword ("INPUT_LRS",toString(iLrs)); - results += PvlKeyword ("INPUT_HRS",toString(iHrs)); - results += PvlKeyword ("INPUT_NULL",toString(iNull)); - results += PvlKeyword ("INPUT_INVALID_PERCENT",toString(invalid_pi)); - results += PvlKeyword ("OUTPUT_MIN",toString(validMin)); - results += PvlKeyword ("OUTPUT_MAX",toString(validMax)); - results += PvlKeyword ("OUTPUT_LRS",toString(oLrs)); - results += PvlKeyword ("OUTPUT_HRS",toString(oHrs)); - results += PvlKeyword ("OUTPUT_NULL",toString(oNull)); - results += PvlKeyword ("OUTPUT_INVALID_PERCENT",toString(invalid_po)); + results += PvlKeyword ("INPUT_LRS",Isis::toString(iLrs)); + results += PvlKeyword ("INPUT_HRS",Isis::toString(iHrs)); + results += PvlKeyword ("INPUT_NULL",Isis::toString(iNull)); + results += PvlKeyword ("INPUT_INVALID_PERCENT",Isis::toString(invalid_pi)); + results += PvlKeyword ("OUTPUT_MIN",Isis::toString(validMin)); + results += PvlKeyword ("OUTPUT_MAX",Isis::toString(validMax)); + results += PvlKeyword ("OUTPUT_LRS",Isis::toString(oLrs)); + results += PvlKeyword ("OUTPUT_HRS",Isis::toString(oHrs)); + results += PvlKeyword ("OUTPUT_NULL",Isis::toString(oNull)); + results += PvlKeyword ("OUTPUT_INVALID_PERCENT",Isis::toString(invalid_po)); Application::Log(results); delete histptr; @@ -135,12 +135,12 @@ void IsisMain(){ //!Write bit2bit summary to print.prt logfile PvlGroup results("bit2bit_Results"); - results += PvlKeyword ("INPUT_LRS",toString(iLrs)); - results += PvlKeyword ("INPUT_HRS",toString(iHrs)); - results += PvlKeyword ("INPUT_NULL",toString(iNull)); - results += PvlKeyword ("INPUT_INVALID_PERCENT",toString(invalid_pi)); - results += PvlKeyword ("OUTPUT_MIN",toString(validMin)); - results += PvlKeyword ("OUTPUT_MAX",toString(validMax)); + results += PvlKeyword ("INPUT_LRS",Isis::toString(iLrs)); + results += PvlKeyword ("INPUT_HRS",Isis::toString(iHrs)); + results += PvlKeyword ("INPUT_NULL",Isis::toString(iNull)); + results += PvlKeyword ("INPUT_INVALID_PERCENT",Isis::toString(invalid_pi)); + results += PvlKeyword ("OUTPUT_MIN",Isis::toString(validMin)); + results += PvlKeyword ("OUTPUT_MAX",Isis::toString(validMax)); Application::Log(results); delete histptr; diff --git a/isis/src/base/apps/cam2cam/cam2cam.cpp b/isis/src/base/apps/cam2cam/cam2cam.cpp index 566fd5cd72..4ae30e0b93 100644 --- a/isis/src/base/apps/cam2cam/cam2cam.cpp +++ b/isis/src/base/apps/cam2cam/cam2cam.cpp @@ -70,7 +70,7 @@ namespace Isis { // Set the reference band we want to match PvlGroup instgrp = mcube->group("Instrument"); if (!outcam->IsBandIndependent()) { - PvlKeyword rBand("ReferenceBand", toString(referenceBand)); + PvlKeyword rBand("ReferenceBand", Isis::toString(referenceBand)); rBand.addComment("# All bands are aligned to reference band"); instgrp += rBand; mcube->putGroup(instgrp); diff --git a/isis/src/base/apps/cam2map/cam2map.cpp b/isis/src/base/apps/cam2map/cam2map.cpp index 77e6217a99..87e27c737c 100644 --- a/isis/src/base/apps/cam2map/cam2map.cpp +++ b/isis/src/base/apps/cam2map/cam2map.cpp @@ -66,10 +66,10 @@ namespace Isis { // Make the target info match the user mapfile double minlat, maxlat, minlon, maxlon; incam->GroundRange(minlat, maxlat, minlon, maxlon, userMap); - camGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minlat)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxlat)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minlon)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxlon)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(minlat)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(maxlat)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(minlon)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(maxlon)), Pvl::Replace); // We want to delete the keywords we just added if the user wants the range @@ -119,22 +119,22 @@ namespace Isis { // If the user decided to enter a ground range then override if ( ui.WasEntered("MINLON") ) { userGrp.addKeyword(PvlKeyword("MinimumLongitude", - toString(ui.GetDouble("MINLON"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MINLON"))), Pvl::Replace); } if ( ui.WasEntered("MAXLON") ) { userGrp.addKeyword(PvlKeyword("MaximumLongitude", - toString(ui.GetDouble("MAXLON"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MAXLON"))), Pvl::Replace); } if ( ui.WasEntered("MINLAT") ) { userGrp.addKeyword(PvlKeyword("MinimumLatitude", - toString(ui.GetDouble("MINLAT"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MINLAT"))), Pvl::Replace); } if ( ui.WasEntered("MAXLAT") ) { userGrp.addKeyword(PvlKeyword("MaximumLatitude", - toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); } // If they want the res. from the mapfile, delete it from the camera so @@ -164,7 +164,7 @@ namespace Isis { if (ui.WasEntered("PIXRES")) { if (ui.GetString("PIXRES") == "MPP") { userGrp.addKeyword(PvlKeyword("PixelResolution", - toString(ui.GetDouble("RESOLUTION"))), + Isis::toString(ui.GetDouble("RESOLUTION"))), Pvl::Replace); if (userGrp.hasKeyword("Scale")) { userGrp.deleteKeyword("Scale"); @@ -172,7 +172,7 @@ namespace Isis { } else if (ui.GetString("PIXRES") == "PPD") { userGrp.addKeyword(PvlKeyword("Scale", - toString(ui.GetDouble("RESOLUTION"))), + Isis::toString(ui.GetDouble("RESOLUTION"))), Pvl::Replace); if (userGrp.hasKeyword("PixelResolution")) { userGrp.deleteKeyword("PixelResolution"); @@ -205,16 +205,16 @@ namespace Isis { double minlat, maxlat, minlon, maxlon; incam->GroundRange(minlat, maxlat, minlon, maxlon, userMap); if (!ui.WasEntered("MINLAT")) { - userGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minlat)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(minlat)), Pvl::Replace); } if (!ui.WasEntered("MAXLAT")) { - userGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxlat)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(maxlat)), Pvl::Replace); } if (!ui.WasEntered("MINLON")) { - userGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minlon)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(minlon)), Pvl::Replace); } if (!ui.WasEntered("MAXLON")) { - userGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxlon)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(maxlon)), Pvl::Replace); } } @@ -294,14 +294,14 @@ namespace Isis { // Create an alpha cube group for the output cube if (!ocube->hasGroup("AlphaCube")) { PvlGroup alpha("AlphaCube"); - alpha += PvlKeyword("AlphaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("AlphaLines", toString(icube->lineCount())); - alpha += PvlKeyword("AlphaStartingSample", toString(0.5)); - alpha += PvlKeyword("AlphaStartingLine", toString(0.5)); - alpha += PvlKeyword("AlphaEndingSample", toString(icube->sampleCount() + 0.5)); - alpha += PvlKeyword("AlphaEndingLine", toString(icube->lineCount() + 0.5)); - alpha += PvlKeyword("BetaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("BetaLines", toString(icube->lineCount())); + alpha += PvlKeyword("AlphaSamples", Isis::toString(icube->sampleCount())); + alpha += PvlKeyword("AlphaLines", Isis::toString(icube->lineCount())); + alpha += PvlKeyword("AlphaStartingSample", Isis::toString(0.5)); + alpha += PvlKeyword("AlphaStartingLine", Isis::toString(0.5)); + alpha += PvlKeyword("AlphaEndingSample", Isis::toString(icube->sampleCount() + 0.5)); + alpha += PvlKeyword("AlphaEndingLine", Isis::toString(icube->lineCount() + 0.5)); + alpha += PvlKeyword("BetaSamples", Isis::toString(icube->sampleCount())); + alpha += PvlKeyword("BetaLines", Isis::toString(icube->lineCount())); ocube->putGroup(alpha); } diff --git a/isis/src/base/apps/caminfo/CamTools.cpp b/isis/src/base/apps/caminfo/CamTools.cpp index 2e19a0093e..8aef561ea1 100644 --- a/isis/src/base/apps/caminfo/CamTools.cpp +++ b/isis/src/base/apps/caminfo/CamTools.cpp @@ -368,9 +368,9 @@ namespace Isis { GProperties g = getGeometrySummary(); //geometry keywords for band output - pband += PvlKeyword("BandsUsed", toString(size())); - pband += PvlKeyword("ReferenceBand", toString(g.band)); - pband += PvlKeyword("OriginalBand", toString(g.realBand)); + pband += PvlKeyword("BandsUsed", Isis::toString(size())); + pband += PvlKeyword("ReferenceBand", Isis::toString(g.band)); + pband += PvlKeyword("OriginalBand", Isis::toString(g.realBand)); pband += PvlKeyword("Target", g.target.toStdString()); @@ -600,7 +600,7 @@ namespace Isis { } } - mapping += PvlKeyword("CenterLongitude", toString(clon)); + mapping += PvlKeyword("CenterLongitude", Isis::toString(clon)); TProjection *sinu = (TProjection *) ProjectionFactory::Create(sinuMap, true); geos::geom::MultiPolygon *sPoly = PolygonTools::LatLonToXY(*poly, sinu); @@ -647,8 +647,8 @@ namespace Isis { pband += ValidateKey("SurfaceArea", _summary.surfaceArea, "km^2"); pband += ValidateKey("GlobalCoverage", globalCoverage, "percent"); if(_combined != 0) { - pband += PvlKeyword("SampleIncrement", toString(_sampleInc)); - pband += PvlKeyword("LineIncrement", toString(_lineInc)); + pband += PvlKeyword("SampleIncrement", Isis::toString(_sampleInc)); + pband += PvlKeyword("LineIncrement", Isis::toString(_lineInc)); if(_combined->getGeometryTypeId() != geos::geom::GEOS_MULTIPOLYGON) { geos::geom::MultiPolygon *geom = makeMultiPolygon(_combined); pband += PvlKeyword("GisFootprint", geom->toString()); diff --git a/isis/src/base/apps/caminfo/CamTools.h b/isis/src/base/apps/caminfo/CamTools.h index 548d0db6d4..0e76f9ff49 100644 --- a/isis/src/base/apps/caminfo/CamTools.h +++ b/isis/src/base/apps/caminfo/CamTools.h @@ -56,7 +56,7 @@ namespace Isis { return (PvlKeyword(keyname.toStdString(), "NULL")); } else { - return (PvlKeyword(keyname.toStdString(), toString(value), unit.toStdString())); + return (PvlKeyword(keyname.toStdString(), Isis::toString(value), unit.toStdString())); } } diff --git a/isis/src/base/apps/camrange/camrange.cpp b/isis/src/base/apps/camrange/camrange.cpp index 6f1508769b..2093ea0024 100644 --- a/isis/src/base/apps/camrange/camrange.cpp +++ b/isis/src/base/apps/camrange/camrange.cpp @@ -35,16 +35,16 @@ namespace Isis { PvlGroup target("Target"); target += PvlKeyword("From", ui.GetCubeName("FROM").toStdString()); target += PvlKeyword("TargetName", camTarget->name().toStdString()); - target += PvlKeyword("RadiusA", toString(radii[0].meters()), "meters"); - target += PvlKeyword("RadiusB", toString(radii[1].meters()), "meters"); - target += PvlKeyword("RadiusC", toString(radii[2].meters()), "meters"); + target += PvlKeyword("RadiusA", Isis::toString(radii[0].meters()), "meters"); + target += PvlKeyword("RadiusB", Isis::toString(radii[1].meters()), "meters"); + target += PvlKeyword("RadiusC", Isis::toString(radii[2].meters()), "meters"); // Get resolution PvlGroup res("PixelResolution"); double lowres = cam->LowestImageResolution(); double hires = cam->HighestImageResolution(); - res += PvlKeyword("Lowest", toString(lowres), "meters"); - res += PvlKeyword("Highest", toString(hires), "meters"); + res += PvlKeyword("Lowest", Isis::toString(lowres), "meters"); + res += PvlKeyword("Highest", Isis::toString(hires), "meters"); // Get the universal ground range PvlGroup ugr("UniversalGroundRange"); @@ -53,10 +53,10 @@ namespace Isis { ugr += PvlKeyword("LatitudeType", "Planetocentric"); ugr += PvlKeyword("LongitudeDirection", "PositiveEast"); ugr += PvlKeyword("LongitudeDomain", "360"); - ugr += PvlKeyword("MinimumLatitude", toString(minlat)); - ugr += PvlKeyword("MaximumLatitude", toString(maxlat)); - ugr += PvlKeyword("MinimumLongitude", toString(minlon)); - ugr += PvlKeyword("MaximumLongitude", toString(maxlon)); + ugr += PvlKeyword("MinimumLatitude", Isis::toString(minlat)); + ugr += PvlKeyword("MaximumLatitude", Isis::toString(maxlat)); + ugr += PvlKeyword("MinimumLongitude", Isis::toString(minlon)); + ugr += PvlKeyword("MaximumLongitude", Isis::toString(maxlon)); // Get the ographic latitude range mapgrp.addKeyword(PvlKeyword("LatitudeType", "Planetographic"), @@ -64,8 +64,8 @@ namespace Isis { cam->GroundRange(minlat, maxlat, minlon, maxlon, mapping); PvlGroup ogr("LatitudeRange"); ogr += PvlKeyword("LatitudeType", "Planetographic"); - ogr += PvlKeyword("MinimumLatitude", toString(minlat)); - ogr += PvlKeyword("MaximumLatitude", toString(maxlat)); + ogr += PvlKeyword("MinimumLatitude", Isis::toString(minlat)); + ogr += PvlKeyword("MaximumLatitude", Isis::toString(maxlat)); // Get positive west longitude coordinates in 360 domain mapgrp.addKeyword(PvlKeyword("LongitudeDirection", "PositiveWest"), @@ -74,8 +74,8 @@ namespace Isis { PvlGroup pos360("PositiveWest360"); pos360 += PvlKeyword("LongitudeDirection", "PositiveWest"); pos360 += PvlKeyword("LongitudeDomain", "360"); - pos360 += PvlKeyword("MinimumLongitude", toString(minlon)); - pos360 += PvlKeyword("MaximumLongitude", toString(maxlon)); + pos360 += PvlKeyword("MinimumLongitude", Isis::toString(minlon)); + pos360 += PvlKeyword("MaximumLongitude", Isis::toString(maxlon)); // Get positive east longitude coordinates in 180 domain mapgrp.addKeyword(PvlKeyword("LongitudeDirection", "PositiveEast"), @@ -86,8 +86,8 @@ namespace Isis { PvlGroup pos180("PositiveEast180"); pos180 += PvlKeyword("LongitudeDirection", "PositiveEast"); pos180 += PvlKeyword("LongitudeDomain", "180"); - pos180 += PvlKeyword("MinimumLongitude", toString(minlon)); - pos180 += PvlKeyword("MaximumLongitude", toString(maxlon)); + pos180 += PvlKeyword("MinimumLongitude", Isis::toString(minlon)); + pos180 += PvlKeyword("MaximumLongitude", Isis::toString(maxlon)); // Get positive west longitude coordinates in 180 domain mapgrp.addKeyword(PvlKeyword("LongitudeDirection", "PositiveWest"), @@ -96,8 +96,8 @@ namespace Isis { PvlGroup neg180("PositiveWest180"); neg180 += PvlKeyword("LongitudeDirection", "PositiveWest"); neg180 += PvlKeyword("LongitudeDomain", "180"); - neg180 += PvlKeyword("MinimumLongitude", toString(minlon)); - neg180 += PvlKeyword("MaximumLongitude", toString(maxlon)); + neg180 += PvlKeyword("MinimumLongitude", Isis::toString(minlon)); + neg180 += PvlKeyword("MaximumLongitude", Isis::toString(maxlon)); Application::AppendAndLog(target, log); Application::AppendAndLog(res, log); diff --git a/isis/src/base/apps/camstats/camstats.cpp b/isis/src/base/apps/camstats/camstats.cpp index 1f0bd43c3a..05e8e8ba9c 100644 --- a/isis/src/base/apps/camstats/camstats.cpp +++ b/isis/src/base/apps/camstats/camstats.cpp @@ -195,7 +195,7 @@ namespace Isis { record[entry] = group.name(); entry++; for (int j = 0; j < group.keywords(); j++) { - record[entry] = IString::ToDouble(group[j][0]); + record[entry] = Isis::toDouble(group[j][0]); entry++; } table += record; diff --git a/isis/src/base/apps/center/main.cpp b/isis/src/base/apps/center/main.cpp index a4cd9eec6f..6afd9dede5 100644 --- a/isis/src/base/apps/center/main.cpp +++ b/isis/src/base/apps/center/main.cpp @@ -52,10 +52,10 @@ void IsisMain() { if (sumall.ValidPixels() > 0) { csamp = sumX / sumall.Sum(); cline = sumY / sumall.Sum(); - results += PvlKeyword("CentroidLine", toString(cline)); - results += PvlKeyword("CentroidSample", toString(csamp)); - results += PvlKeyword("LineOffset", toString(lMiddle - cline)); - results += PvlKeyword("SampleOffset", toString(sMiddle - csamp)); + results += PvlKeyword("CentroidLine", Isis::toString(cline)); + results += PvlKeyword("CentroidSample", Isis::toString(csamp)); + results += PvlKeyword("LineOffset", Isis::toString(lMiddle - cline)); + results += PvlKeyword("SampleOffset", Isis::toString(sMiddle - csamp)); } else { PvlKeyword badl = PvlKeyword("CentroidLine", "Null"); diff --git a/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp index 40f756e54a..3486a57d47 100644 --- a/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp +++ b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp @@ -360,7 +360,7 @@ bool CkSpiceSegment::getTimeDependentFrameIds(Table &table, int &toId, int &from if ( table.Label().hasKeyword("TimeDependentFrames") ) { PvlKeyword labelTimeFrames = table.Label()["TimeDependentFrames"]; for (int i=0; i widths; widths.resize(icube->bandCount()); for(int i = 0; i < pvlCenter.size(); i++) { - centers[i] = IString::ToDouble(pvlCenter[i]); + centers[i] = Isis::toDouble(pvlCenter[i]); if(hasWidth) - widths[i] = IString::ToDouble((*pvlWidth)[i]); + widths[i] = Isis::toDouble((*pvlWidth)[i]); else widths[i] = 0.0; } @@ -145,14 +145,14 @@ void compute(vector centers, vector widths, small = (double)centers[i] - (double)widths[i] / 2.0; } } - pvlCenter.setValue(toString((large - small) / 2 + small), centerUnit.toStdString()); + pvlCenter.setValue(Isis::toString((large - small) / 2 + small), centerUnit.toStdString()); if(hasWidth) { PvlKeyword &pvlWidth = pvlg.findKeyword("Width"); - pvlWidth.setValue(toString(large - small), pvlWidth.unit()); + pvlWidth.setValue(Isis::toString(large - small), pvlWidth.unit()); } else { PvlKeyword pvlWidth = PvlKeyword("Width"); - pvlWidth.setValue(toString(large - small), centerUnit.toStdString()); + pvlWidth.setValue(Isis::toString(large - small), centerUnit.toStdString()); pvlg.addKeyword(pvlWidth); } diff --git a/isis/src/base/apps/cubediff/main.cpp b/isis/src/base/apps/cubediff/main.cpp index c6c4f8782b..b1939100ea 100644 --- a/isis/src/base/apps/cubediff/main.cpp +++ b/isis/src/base/apps/cubediff/main.cpp @@ -85,9 +85,9 @@ void IsisMain() { } else { results += PvlKeyword("Compare", "Different"); - results += PvlKeyword("Sample", toString(sample)); - results += PvlKeyword("Line", toString(line)); - results += PvlKeyword("Band", toString(band)); + results += PvlKeyword("Sample", Isis::toString(sample)); + results += PvlKeyword("Line", Isis::toString(line)); + results += PvlKeyword("Band", Isis::toString(band)); if(stats.TotalPixels() < 1) { results += PvlKeyword("AverageDifference", "0"); results += PvlKeyword("StandardDeviation", "0"); @@ -96,21 +96,21 @@ void IsisMain() { results += PvlKeyword("MaximumDifference", "0"); } else { - results += PvlKeyword("AverageDifference", toString(stats.Average())); - results += PvlKeyword("StandardDeviation", toString(stats.StandardDeviation())); - results += PvlKeyword("Variance", toString(stats.Variance())); - results += PvlKeyword("MinimumDifference", toString(stats.Minimum())); - results += PvlKeyword("MaximumDifference", toString(stats.Maximum())); - results += PvlKeyword("MaxDifferenceSample", toString(gMaxDiffSample)); - results += PvlKeyword("MaxDifferenceLine", toString(gMaxDiffLine)); - results += PvlKeyword("MaxDifferenceBand", toString(gMaxDiffBand)); + results += PvlKeyword("AverageDifference", Isis::toString(stats.Average())); + results += PvlKeyword("StandardDeviation", Isis::toString(stats.StandardDeviation())); + results += PvlKeyword("Variance", Isis::toString(stats.Variance())); + results += PvlKeyword("MinimumDifference", Isis::toString(stats.Minimum())); + results += PvlKeyword("MaximumDifference", Isis::toString(stats.Maximum())); + results += PvlKeyword("MaxDifferenceSample", Isis::toString(gMaxDiffSample)); + results += PvlKeyword("MaxDifferenceLine", Isis::toString(gMaxDiffLine)); + results += PvlKeyword("MaxDifferenceBand", Isis::toString(gMaxDiffBand)); } - results += PvlKeyword("ValidPixelDifferences", toString(stats.TotalPixels())); - results += PvlKeyword("SpecialPixelDifferences", toString(spCount)); - results += PvlKeyword("SigFigAccuracy", toString(sigFigAccuracy)); - results += PvlKeyword("SigFigMaxDifferenceSample", toString(sigFigSample)); - results += PvlKeyword("SigFigMaxDifferenceLine", toString(sigFigLine)); - results += PvlKeyword("SigFigMaxDifferenceBand", toString(sigFigBand)); + results += PvlKeyword("ValidPixelDifferences", Isis::toString(stats.TotalPixels())); + results += PvlKeyword("SpecialPixelDifferences", Isis::toString(spCount)); + results += PvlKeyword("SigFigAccuracy", Isis::toString(sigFigAccuracy)); + results += PvlKeyword("SigFigMaxDifferenceSample", Isis::toString(sigFigSample)); + results += PvlKeyword("SigFigMaxDifferenceLine", Isis::toString(sigFigLine)); + results += PvlKeyword("SigFigMaxDifferenceBand", Isis::toString(sigFigBand)); } Application::Log(results); @@ -278,7 +278,7 @@ void diffTable(std::ofstream &target, int precision) { for(unsigned int i = 0; i < samps.size(); i++) { Column currCol; //Prepare and add the first file's column - currCol.SetName(QString::fromStdString("File1_" + toString(samps[i]))); + currCol.SetName(QString::fromStdString("File1_" + Isis::toString(samps[i]))); if((int)(colWidth + precision + 1) < (int)currCol.Name().length()) { currCol.SetWidth(currCol.Name().length() + 1); } @@ -290,7 +290,7 @@ void diffTable(std::ofstream &target, int precision) { cols.push_back(currCol); //Prepare and add the second file's column - currCol.SetName(QString::fromStdString("File2_" + toString(samps[i]))); + currCol.SetName(QString::fromStdString("File2_" + Isis::toString(samps[i]))); cols.push_back(currCol); } diff --git a/isis/src/base/apps/cubefunc/main.cpp b/isis/src/base/apps/cubefunc/main.cpp index 739ef9d50f..f0c47887c4 100644 --- a/isis/src/base/apps/cubefunc/main.cpp +++ b/isis/src/base/apps/cubefunc/main.cpp @@ -75,7 +75,7 @@ void IsisMain() { PvlGroup results("Results"); std::string message = "Invalid input pixels converted to Isis NULL values"; results += PvlKeyword("Error", message); - results += PvlKeyword("Count", toString(bad)); + results += PvlKeyword("Count", Isis::toString(bad)); Application::Log(results); } p.EndProcess(); diff --git a/isis/src/base/apps/cubenorm/main.cpp b/isis/src/base/apps/cubenorm/main.cpp index c8c9a182a9..7ee0468215 100644 --- a/isis/src/base/apps/cubenorm/main.cpp +++ b/isis/src/base/apps/cubenorm/main.cpp @@ -219,15 +219,15 @@ void getStats(Buffer &in) { void pvlOut(const QString &StatFile) { PvlGroup results("Results"); for(unsigned int i = 0; i < st.size(); i++) { - results += PvlKeyword("Band", toString(band[i])); - results += PvlKeyword("RowCol", toString(element[i])); - results += PvlKeyword("ValidPixels", toString(st[i].ValidPixels())); + results += PvlKeyword("Band", Isis::toString(band[i])); + results += PvlKeyword("RowCol", Isis::toString(element[i])); + results += PvlKeyword("ValidPixels", Isis::toString(st[i].ValidPixels())); if(st[i].ValidPixels() > 0) { - results += PvlKeyword("Mean", toString(st[i].Average())); - results += PvlKeyword("Median", toString(median[i])); - results += PvlKeyword("Std", toString(st[i].StandardDeviation())); - results += PvlKeyword("Minimum", toString(st[i].Minimum())); - results += PvlKeyword("Maximum", toString(st[i].Maximum())); + results += PvlKeyword("Mean", Isis::toString(st[i].Average())); + results += PvlKeyword("Median", Isis::toString(median[i])); + results += PvlKeyword("Std", Isis::toString(st[i].StandardDeviation())); + results += PvlKeyword("Minimum", Isis::toString(st[i].Minimum())); + results += PvlKeyword("Maximum", Isis::toString(st[i].Maximum())); } else { results += PvlKeyword("Mean", "0.0"); @@ -304,21 +304,21 @@ void PVLIn(const Isis::FileName &filename) { while(itr != results.end()) { StaticStats newStat; - band.push_back(IString::ToInteger((*itr)[0])); + band.push_back(Isis::toInt((*itr)[0])); itr++; - element.push_back(IString::ToInteger((*itr)[0])); + element.push_back(Isis::toInt((*itr)[0])); itr++; - newStat.setValidPixels(IString::ToInteger((*itr)[0])); + newStat.setValidPixels(Isis::toInt((*itr)[0])); itr++; - newStat.setMean(IString::ToDouble((*itr)[0])); + newStat.setMean(Isis::toDouble((*itr)[0])); itr++; - median.push_back(IString::ToDouble((*itr)[0])); + median.push_back(Isis::toDouble((*itr)[0])); itr++; - newStat.setStandardDeviation(IString::ToDouble((*itr)[0])); + newStat.setStandardDeviation(Isis::toDouble((*itr)[0])); itr++; - newStat.setMinimum(IString::ToDouble((*itr)[0])); + newStat.setMinimum(Isis::toDouble((*itr)[0])); itr++; - newStat.setMaximum(IString::ToDouble((*itr)[0])); + newStat.setMaximum(Isis::toDouble((*itr)[0])); itr++; st.push_back(newStat); diff --git a/isis/src/base/apps/ddd2isis/main.cpp b/isis/src/base/apps/ddd2isis/main.cpp index 82a8443350..1ec43e992b 100644 --- a/isis/src/base/apps/ddd2isis/main.cpp +++ b/isis/src/base/apps/ddd2isis/main.cpp @@ -140,14 +140,14 @@ void IsisMain() { fin.close(); PvlGroup results("FileInfo"); - results += PvlKeyword( "NumberOfLines", toString(nLines) ); - results += PvlKeyword( "NumberOfBytesPerLine", toString(nBytes) ); - results += PvlKeyword( "BitType", toString(bitType) ); + results += PvlKeyword( "NumberOfLines", Isis::toString(nLines) ); + results += PvlKeyword( "NumberOfBytesPerLine", Isis::toString(nBytes) ); + results += PvlKeyword( "BitType", Isis::toString(bitType) ); int nSamples = nBytes / (totalBandBits / 8); - results += PvlKeyword( "NumberOfSamples", toString(nSamples) ); + results += PvlKeyword( "NumberOfSamples", Isis::toString(nSamples) ); int nBands = (totalBandBits / 8) / dataTypeBytes; - results += PvlKeyword( "NumberOfBands", toString(nBands) ); - results += PvlKeyword( "LabelBytes", toString(nOffset) ); + results += PvlKeyword( "NumberOfBands", Isis::toString(nBands) ); + results += PvlKeyword( "LabelBytes", Isis::toString(nOffset) ); Application::Log(results); ProcessImport p; diff --git a/isis/src/base/apps/demprep/demprep.cpp b/isis/src/base/apps/demprep/demprep.cpp index f3ed99d268..eac956fde6 100644 --- a/isis/src/base/apps/demprep/demprep.cpp +++ b/isis/src/base/apps/demprep/demprep.cpp @@ -66,8 +66,8 @@ namespace Isis{ p.StartProcess(GetStats); PvlGroup demRange("Results"); - demRange += PvlKeyword("MinimumRadius", toString(inCubeStats.Minimum()), "meters"); - demRange += PvlKeyword("MaximumRadius", toString(inCubeStats.Maximum()), "meters"); + demRange += PvlKeyword("MinimumRadius", Isis::toString(inCubeStats.Minimum()), "meters"); + demRange += PvlKeyword("MaximumRadius", Isis::toString(inCubeStats.Maximum()), "meters"); Application::Log(demRange); // Store min/max radii values in new ShapeModelStatistics table @@ -237,12 +237,12 @@ namespace Isis{ double upperLeftCorner = mapgrp["UpperLeftCornerX"]; upperLeftCorner -= leftPad * proj->Resolution(); - mapgrp.addKeyword(PvlKeyword("UpperLeftCornerX", toString(upperLeftCorner), "meters"), + mapgrp.addKeyword(PvlKeyword("UpperLeftCornerX", Isis::toString(upperLeftCorner), "meters"), Pvl::Replace); upperLeftCorner = mapgrp["UpperLeftCornerY"]; upperLeftCorner += topPad * proj->Resolution(); - mapgrp.addKeyword(PvlKeyword("UpperLeftCornerY", toString(upperLeftCorner), "meters"), + mapgrp.addKeyword(PvlKeyword("UpperLeftCornerY", Isis::toString(upperLeftCorner), "meters"), Pvl::Replace); @@ -264,8 +264,8 @@ namespace Isis{ ocube->putGroup(mapgrp); PvlGroup demRange("Results"); - demRange += PvlKeyword("MinimumRadius", toString(outCubeStats.Minimum()), "meters"); - demRange += PvlKeyword("MaximumRadius", toString(outCubeStats.Maximum()), "meters"); + demRange += PvlKeyword("MinimumRadius", Isis::toString(outCubeStats.Minimum()), "meters"); + demRange += PvlKeyword("MaximumRadius", Isis::toString(outCubeStats.Maximum()), "meters"); Application::Log(demRange); // Store min/max radii values in new ShapeModelStatistics table diff --git a/isis/src/base/apps/errors/main.cpp b/isis/src/base/apps/errors/main.cpp index 764a3d5f8a..0d80d88f50 100644 --- a/isis/src/base/apps/errors/main.cpp +++ b/isis/src/base/apps/errors/main.cpp @@ -29,7 +29,7 @@ void IsisMain() { numErrors++; } } - PvlKeyword errors("TotalErrors", toString(numErrors)); + PvlKeyword errors("TotalErrors", Isis::toString(numErrors)); output.addKeyword(errors); // write output to file if(!append) { diff --git a/isis/src/base/apps/fillgap/fillgap.cpp b/isis/src/base/apps/fillgap/fillgap.cpp index 5757c6be76..c03346c801 100644 --- a/isis/src/base/apps/fillgap/fillgap.cpp +++ b/isis/src/base/apps/fillgap/fillgap.cpp @@ -78,7 +78,7 @@ namespace Isis { if(numSpecPixKept > 0) { PvlGroup mLog("Messages"); mLog += PvlKeyword("Warning", - "Unable to fill " + toString(numSpecPixKept) + " special pixels."); + "Unable to fill " + Isis::toString(numSpecPixKept) + " special pixels."); Application::AppendAndLog(mLog, log); } return; diff --git a/isis/src/base/apps/findgaps/FindGapsFunctor.cpp b/isis/src/base/apps/findgaps/FindGapsFunctor.cpp index 088e15b41b..c050325208 100644 --- a/isis/src/base/apps/findgaps/FindGapsFunctor.cpp +++ b/isis/src/base/apps/findgaps/FindGapsFunctor.cpp @@ -151,18 +151,18 @@ namespace Isis { if( !(*m_inGap) ) { *m_inGap = true; - m_gap->addKeyword(PvlKeyword("NewGapInBand", toString(in.Band()))); - m_gap->addKeyword(PvlKeyword("StartLine", toString(in.Line()))); + m_gap->addKeyword(PvlKeyword("NewGapInBand", Isis::toString(in.Band()))); + m_gap->addKeyword(PvlKeyword("StartLine", Isis::toString(in.Line()))); if(correlation == Isis::Null) { correlation = 0.0; } - m_gap->addKeyword(PvlKeyword("Correlation", toString(correlation))); + m_gap->addKeyword(PvlKeyword("Correlation", Isis::toString(correlation))); } if (in.Line() == m_lineCount) { - m_gap->addKeyword(PvlKeyword("LastGapLine", toString(in.Line()))); - m_gap->addKeyword(PvlKeyword("ToEndOfBand", toString(m_lineCount))); + m_gap->addKeyword(PvlKeyword("LastGapLine", Isis::toString(in.Line()))); + m_gap->addKeyword(PvlKeyword("ToEndOfBand", Isis::toString(m_lineCount))); addGapToGroup(); } @@ -174,7 +174,7 @@ namespace Isis { * correlate. Or this line is the last line and it is in the gap. */ - m_gap->addKeyword(PvlKeyword("LastGapLine", toString(in.Line() - 2))); + m_gap->addKeyword(PvlKeyword("LastGapLine", Isis::toString(in.Line() - 2))); addGapToGroup(); } @@ -195,9 +195,9 @@ namespace Isis { for (int i = 0; i < m_gaps->groups(); i++) { - int gapBand = IString::ToInteger((*m_gaps).group(i).findKeyword(" NewGapInBand")[0]); - int gapStart = IString::ToInteger((*m_gaps).group(i).findKeyword("StartLine")[0]); - int gapEnd = IString::ToInteger((*m_gaps).group(i).findKeyword("LastGapLine")[0]); + int gapBand = Isis::toInt((*m_gaps).group(i).findKeyword(" NewGapInBand")[0]); + int gapStart = Isis::toInt((*m_gaps).group(i).findKeyword("StartLine")[0]); + int gapEnd = Isis::toInt((*m_gaps).group(i).findKeyword("LastGapLine")[0]); if ( (in.Line() >= gapStart - m_bufferSizeBeforeGap) && (in.Line() <= gapEnd + m_bufferSizeAfterGap) && @@ -239,8 +239,8 @@ namespace Isis { * In case the gap is a flase positive. The end of the gap will end up being the line * before the start of the gap. */ - if (IString::ToInteger(m_gap->findKeyword("StartLine")[0]) < - IString::ToInteger(m_gap->findKeyword("LastGapLine")[0])) { + if (Isis::toInt(m_gap->findKeyword("StartLine")[0]) < + Isis::toInt(m_gap->findKeyword("LastGapLine")[0])) { m_gaps->addGroup(*m_gap); } diff --git a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp index 9d5c16e983..97d3c746cf 100644 --- a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp +++ b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp @@ -84,7 +84,7 @@ namespace Isis { } PvlGroup results("Results"); - results += PvlKeyword("ErrorCount", toString((BigInt)overlaps.Errors().size())); + results += PvlKeyword("ErrorCount", Isis::toString((BigInt)overlaps.Errors().size())); Application::Log(results); } diff --git a/isis/src/base/apps/findrx/main.cpp b/isis/src/base/apps/findrx/main.cpp index 3fd1194093..b8e3212756 100644 --- a/isis/src/base/apps/findrx/main.cpp +++ b/isis/src/base/apps/findrx/main.cpp @@ -35,20 +35,20 @@ void IsisMain() { int nres = reseaus["Line"].size(); if (nres != reseaus["Sample"].size()) { std::string msg = "Sample size incorrect [Sample size " + - toString(reseaus["Sample"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + Isis::toString(reseaus["Sample"].size()) + " != " + " Line size " + + Isis::toString(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (nres != reseaus["Type"].size()) { std::string msg = "Type size incorrect [Type size " + - toString(reseaus["Type"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + Isis::toString(reseaus["Type"].size()) + " != " + " Line size " + + Isis::toString(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if (nres != reseaus["Valid"].size()) { std::string msg = "Valid size incorrect [Valid size " + - toString(reseaus["Valid"].size()) + " != " + " Line size " + - toString(reseaus["Line"].size()) + "]"; + Isis::toString(reseaus["Valid"].size()) + " != " + " Line size " + + Isis::toString(reseaus["Line"].size()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -77,10 +77,10 @@ void IsisMain() { // And the loop... for (int res = 0; res < nres; ++res) { // Output chips - ar->SearchChip()->TackCube(IString::ToDouble(reseaus["Sample"][res]), IString::ToDouble(reseaus["Line"][res])); + ar->SearchChip()->TackCube(Isis::toDouble(reseaus["Sample"][res]), Isis::toDouble(reseaus["Line"][res])); ar->SearchChip()->Load(*cube); ar->PatternChip()->Load(pattern, 0, 1.0, res + 1); - int type = IString::ToInteger(reseaus["Type"][res]); + int type = Isis::toInt(reseaus["Type"][res]); // If the reseaus is in the center (type 5) use full percent value if (type == 5) { ar->SetPatternValidPercent(patternValidPercent); @@ -100,8 +100,8 @@ void IsisMain() { ar->Register(); if (ar->Success()) { - reseaus["Sample"][res] = toString(ar->CubeSample()); - reseaus["Line"][res] = toString(ar->CubeLine()); + reseaus["Sample"][res] = Isis::toString(ar->CubeSample()); + reseaus["Line"][res] = Isis::toString(ar->CubeLine()); reseaus["Valid"][res] = "1"; } else { @@ -110,8 +110,8 @@ void IsisMain() { // And if the reseaus are to be marked...mark em if (white != NULL) { - double line = IString::ToDouble(reseaus["Line"][res]); - double sample = IString::ToDouble(reseaus["Sample"][res]); + double line = Isis::toDouble(reseaus["Line"][res]); + double sample = Isis::toDouble(reseaus["Sample"][res]); white->SetBasePosition(int(sample), int(line), 1); cube->write(*white); } diff --git a/isis/src/base/apps/footprintinit/footprintinit.cpp b/isis/src/base/apps/footprintinit/footprintinit.cpp index 6af7e762bc..04614d05ff 100644 --- a/isis/src/base/apps/footprintinit/footprintinit.cpp +++ b/isis/src/base/apps/footprintinit/footprintinit.cpp @@ -142,8 +142,8 @@ namespace Isis { if (precision) { PvlGroup results("Results"); - results.addKeyword(PvlKeyword("SINC", toString(sinc))); - results.addKeyword(PvlKeyword("LINC", toString(linc))); + results.addKeyword(PvlKeyword("SINC", Isis::toString(sinc))); + results.addKeyword(PvlKeyword("LINC", Isis::toString(linc))); Application::AppendAndLog(results, log); } diff --git a/isis/src/base/apps/footprintmerge/main.cpp b/isis/src/base/apps/footprintmerge/main.cpp index 1961ae294a..29600bf337 100644 --- a/isis/src/base/apps/footprintmerge/main.cpp +++ b/isis/src/base/apps/footprintmerge/main.cpp @@ -129,7 +129,7 @@ void IsisMain() { // Brief if(mode == "BRIEF") { PvlGroup results("Results"); - results += PvlKeyword("NumberOfIslands", toString((int)islandPolys.size())); + results += PvlKeyword("NumberOfIslands", Isis::toString((int)islandPolys.size())); Application::Log(results); } else if(mode == "FULL") { @@ -139,7 +139,7 @@ void IsisMain() { int numFiles = islands[p].size(); QString isle = "FootprintIsland_" + QString::number((int)p + 1); PvlGroup island(isle.toStdString()); - island += PvlKeyword("NumberFiles", toString(numFiles)); + island += PvlKeyword("NumberFiles", Isis::toString(numFiles)); PvlKeyword files("Files"); for(int f = 0; f < numFiles; f++) { files.addValue(islands[p][f].toStdString()); diff --git a/isis/src/base/apps/framestitch/framestitch.cpp b/isis/src/base/apps/framestitch/framestitch.cpp index 6b4cfc84a3..981fced0bb 100644 --- a/isis/src/base/apps/framestitch/framestitch.cpp +++ b/isis/src/base/apps/framestitch/framestitch.cpp @@ -234,13 +234,13 @@ namespace Isis { if (!outInst.hasKeyword("DataFlipped")) { outInst.addKeyword(PvlKeyword("DataFlipped")); } - outInst["DataFlipped"].setValue(toString(!inputFlipped)); + outInst["DataFlipped"].setValue(Isis::toString(!inputFlipped)); } // Record numLinesOverlap if (!outInst.hasKeyword("NumLinesOverlap")) outInst.addKeyword(PvlKeyword("NumLinesOverlap")); - outInst["numLinesOverlap"].setValue(toString(numLinesOverlap)); + outInst["numLinesOverlap"].setValue(Isis::toString(numLinesOverlap)); process.EndProcess(); diff --git a/isis/src/base/apps/isis2fits/main.cpp b/isis/src/base/apps/isis2fits/main.cpp index be6baff3f9..54004ec429 100644 --- a/isis/src/base/apps/isis2fits/main.cpp +++ b/isis/src/base/apps/isis2fits/main.cpp @@ -57,8 +57,8 @@ void IsisMain() { // determine core base and multiplier, set up the stretch PvlGroup pix = icube->label()->findObject("IsisCube").findObject("Core").findGroup("Pixels"); - double scale = IString::ToDouble(pix["Multiplier"][0]); - double base = IString::ToDouble(pix["Base"][0]); + double scale = Isis::toDouble(pix["Multiplier"][0]); + double base = Isis::toDouble(pix["Base"][0]); if (ui.GetString("STRETCH") != "NONE" && bitpix != "-32") { if (ui.GetString("STRETCH") == "LINEAR") { diff --git a/isis/src/base/apps/isis2pds/isis2pds.cpp b/isis/src/base/apps/isis2pds/isis2pds.cpp index 673d003639..3146e1c0cb 100644 --- a/isis/src/base/apps/isis2pds/isis2pds.cpp +++ b/isis/src/base/apps/isis2pds/isis2pds.cpp @@ -113,13 +113,13 @@ namespace Isis{ //Records what it did to the print.prt file PvlGroup results("DNs Used"); - results += PvlKeyword("Null", toString(p.OutputNull())); - results += PvlKeyword("LRS", toString(p.OutputLrs())); - results += PvlKeyword("LIS", toString(p.OutputLis())); - results += PvlKeyword("HIS", toString(p.OutputHis())); - results += PvlKeyword("HRS", toString(p.OutputHrs())); - results += PvlKeyword("ValidMin", toString(min)); - results += PvlKeyword("ValidMax", toString(max)); + results += PvlKeyword("Null", Isis::toString(p.OutputNull())); + results += PvlKeyword("LRS", Isis::toString(p.OutputLrs())); + results += PvlKeyword("LIS", Isis::toString(p.OutputLis())); + results += PvlKeyword("HIS", Isis::toString(p.OutputHis())); + results += PvlKeyword("HRS", Isis::toString(p.OutputHrs())); + results += PvlKeyword("ValidMin", Isis::toString(min)); + results += PvlKeyword("ValidMax", Isis::toString(max)); Application::Log(results); } else { @@ -187,13 +187,13 @@ namespace Isis{ // Records what it did to the print.prt file PvlGroup results("DNs Used"); - results += PvlKeyword("Null", toString(process.OutputNull())); - results += PvlKeyword("LRS", toString(process.OutputLrs())); - results += PvlKeyword("LIS", toString(process.OutputLis())); - results += PvlKeyword("HIS", toString(process.OutputHis())); - results += PvlKeyword("HRS", toString(process.OutputHrs())); - results += PvlKeyword("ValidMin", toString(min)); - results += PvlKeyword("ValidMax", toString(max)); + results += PvlKeyword("Null", Isis::toString(process.OutputNull())); + results += PvlKeyword("LRS", Isis::toString(process.OutputLrs())); + results += PvlKeyword("LIS", Isis::toString(process.OutputLis())); + results += PvlKeyword("HIS", Isis::toString(process.OutputHis())); + results += PvlKeyword("HRS", Isis::toString(process.OutputHrs())); + results += PvlKeyword("ValidMin", Isis::toString(min)); + results += PvlKeyword("ValidMax", Isis::toString(max)); Application::Log(results); process.StandardPds4Label(); diff --git a/isis/src/base/apps/isis2raw/main.cpp b/isis/src/base/apps/isis2raw/main.cpp index 6c8e664687..c27e5e6d98 100644 --- a/isis/src/base/apps/isis2raw/main.cpp +++ b/isis/src/base/apps/isis2raw/main.cpp @@ -105,13 +105,13 @@ void IsisMain() { // Records what output values were used, then sends it to the print.prt file // as well as the terminal. PvlGroup results("DNs Used"); - results += PvlKeyword("Null", toString(p.OutputNull())); - results += PvlKeyword("LRS", toString(p.OutputLrs())); - results += PvlKeyword("LIS", toString(p.OutputLis())); - results += PvlKeyword("HIS", toString(p.OutputHis())); - results += PvlKeyword("HRS", toString(p.OutputHrs())); - results += PvlKeyword("ValidMin", toString(min)); - results += PvlKeyword("ValidMax", toString(max)); + results += PvlKeyword("Null", Isis::toString(p.OutputNull())); + results += PvlKeyword("LRS", Isis::toString(p.OutputLrs())); + results += PvlKeyword("LIS", Isis::toString(p.OutputLis())); + results += PvlKeyword("HIS", Isis::toString(p.OutputHis())); + results += PvlKeyword("HRS", Isis::toString(p.OutputHrs())); + results += PvlKeyword("ValidMin", Isis::toString(min)); + results += PvlKeyword("ValidMax", Isis::toString(max)); Application::Log(results); return; diff --git a/isis/src/base/apps/isis2std/isis2std.cpp b/isis/src/base/apps/isis2std/isis2std.cpp index 00a03c9e01..098eda7076 100644 --- a/isis/src/base/apps/isis2std/isis2std.cpp +++ b/isis/src/base/apps/isis2std/isis2std.cpp @@ -138,8 +138,8 @@ namespace Isis { void addResults(PvlGroup &results, ImageExporter *exporter, QString channel, int index) { - results += PvlKeyword(channel.toStdString() + "InputMinimum", toString(exporter->inputMinimum(index))); - results += PvlKeyword(channel.toStdString() + "InputMaximum", toString(exporter->inputMaximum(index))); + results += PvlKeyword(channel.toStdString() + "InputMinimum", Isis::toString(exporter->inputMinimum(index))); + results += PvlKeyword(channel.toStdString() + "InputMaximum", Isis::toString(exporter->inputMaximum(index))); } } \ No newline at end of file diff --git a/isis/src/base/apps/isisimport/CassiniImportUtils.h b/isis/src/base/apps/isisimport/CassiniImportUtils.h index ead035673c..0483227888 100644 --- a/isis/src/base/apps/isisimport/CassiniImportUtils.h +++ b/isis/src/base/apps/isisimport/CassiniImportUtils.h @@ -40,8 +40,8 @@ namespace Isis { CassiniIssFixDnFunctor(PvlKeyword &stretchPairs, QString dataConversionType, int validMax) { m_stretch = Stretch(); for (size_t i = 0; i < (size_t)stretchPairs.size(); i+=2) { - m_stretch.AddPair(IString::ToDouble(stretchPairs[i]), - IString::ToDouble(stretchPairs[i + 1])); + m_stretch.AddPair(Isis::toDouble(stretchPairs[i]), + Isis::toDouble(stretchPairs[i + 1])); } m_validMax = validMax; m_dataConversionType = dataConversionType; @@ -76,7 +76,7 @@ namespace Isis { void cassiniIssFixDnPostProcess(QString ioFile, PvlObject postProcessObj) { PvlKeyword stretchPairsKeyword = postProcessObj["stretchPairs"]; QString dataConversionType = QString::fromStdString(postProcessObj["DataConversionType"]); - int validMax = IString::ToInteger(postProcessObj["ValidMaximum"]); + int validMax = Isis::toInt(postProcessObj["ValidMaximum"]); CassiniIssFixDnFunctor cassiniIssFixDnFunctor(stretchPairsKeyword, dataConversionType, validMax); ProcessByLine postProcess; @@ -102,12 +102,12 @@ namespace Isis { double flightSoftware = 0.0; if (translation["flightSoftwareVersionId"] != std::string("Unknown")) { - flightSoftware = IString::ToDouble(translation["flightSoftwareVersionId"]); + flightSoftware = Isis::toDouble(translation["flightSoftwareVersionId"]); } PvlKeyword stretchPairsKeyword = translation["stretchPairs"]; QString dataConversionType = QString::fromStdString(translation["DataConversionType"]); - int validMax = IString::ToInteger(translation["ValidMaximum"]); + int validMax = Isis::toInt(translation["ValidMaximum"]); CassiniIssFixDnFunctor cassiniIssFixDnFunctor(stretchPairsKeyword, dataConversionType, validMax); TableField overclockPixels("OverclockPixels", TableField::Double, 3); @@ -193,8 +193,8 @@ namespace Isis { PvlKeyword stretchPairs = translation["stretchPairs"]; Stretch stretch; for (size_t i = 0; i < (size_t)stretchPairs.size(); i+=2) { - stretch.AddPair(IString::ToDouble(stretchPairs[i]), - IString::ToDouble(stretchPairs[i + 1])); + stretch.AddPair(Isis::toDouble(stretchPairs[i]), + Isis::toDouble(stretchPairs[i + 1])); } PvlGroup &inst = outputLabel->findGroup("Instrument", Pvl::Traverse); QString dataConversionType = QString::fromStdString(translation["DataConversionType"]); @@ -208,7 +208,7 @@ namespace Isis { } else { double biasStripMean = inst.findKeyword("BiasStripMean"); - inst.findKeyword("BiasStripMean").setValue(toString(stretch.Map(biasStripMean))); + inst.findKeyword("BiasStripMean").setValue(Isis::toString(stretch.Map(biasStripMean))); inst.findKeyword("BiasStripMean").addComment("BiasStripMean value converted back to 12 bit."); importer->Progress()->SetText("Image was converted using 12-to-8 bit table. \nConverting prefix pixels back to 12 bit and saving line prefix data..."); } @@ -217,7 +217,7 @@ namespace Isis { int vicarLabelBytes = translation.findKeyword("VicarLabelBytes"); int roo = *(header + 50 + vicarLabelBytes) / 32 % 2; //**** THIS MAY NEED TO BE CHANGED, // SEE BOTTOM OF THIS FILE FOR IN DEPTH COMMENTS ON READOUTORDER - inst.addKeyword(PvlKeyword("ReadoutOrder", toString(roo))); + inst.addKeyword(PvlKeyword("ReadoutOrder", Isis::toString(roo))); }; } diff --git a/isis/src/base/apps/isisimport/isisimport.cpp b/isis/src/base/apps/isisimport/isisimport.cpp index 86aaa3b00f..9067da88b5 100644 --- a/isis/src/base/apps/isisimport/isisimport.cpp +++ b/isis/src/base/apps/isisimport/isisimport.cpp @@ -386,9 +386,9 @@ namespace Isis { // Set everything needed by ProcessImport PvlGroup dimensions = newLabel.findObject("IsisCube").findObject("Core").findGroup("Dimensions"); - int ns = IString::ToInteger(dimensions["Samples"]); - int nl = IString::ToInteger(dimensions["Lines"]); - int nb = IString::ToInteger(dimensions["Bands"]); + int ns = Isis::toInt(dimensions["Samples"]); + int nl = Isis::toInt(dimensions["Lines"]); + int nb = Isis::toInt(dimensions["Bands"]); importer.SetDimensions(ns, nl, nb); PvlGroup pixels = newLabel.findObject("IsisCube").findObject("Core").findGroup("Pixels"); @@ -417,7 +417,7 @@ namespace Isis { if (dataFilePointer.size() == 1) { try { - offset = IString::ToInteger(dataFilePointer) - 1; + offset = Isis::toInt(dataFilePointer) - 1; units = QString::fromStdString(dataFilePointer.unit()); } catch(IException &e) { @@ -428,7 +428,7 @@ namespace Isis { } } else if (dataFilePointer.size() == 2) { - offset = IString::ToInteger(dataFilePointer[1]) - 1; + offset = Isis::toInt(dataFilePointer[1]) - 1; units = QString::fromStdString(dataFilePointer.unit(1)); } else { @@ -445,7 +445,7 @@ namespace Isis { } else { if (translation.hasKeyword("DataFileRecordBytes")) { - recSize = IString::ToInteger(translation["DataFileRecordBytes"]); + recSize = Isis::toInt(translation["DataFileRecordBytes"]); } } importer.SetFileHeaderBytes(offset * recSize); @@ -471,14 +471,14 @@ namespace Isis { // Processing unique to mroctx if (translation.hasKeyword("DataPrefixBytes")) { importer.SetDataPrefixBytes(translation["DataPrefixBytes"]); - if (IString::ToInteger(translation["DataPrefixBytes"]) > 0) { + if (Isis::toInt(translation["DataPrefixBytes"]) > 0) { importer.SaveDataPrefix(); } } if (translation.hasKeyword("DataSuffixBytes")) { importer.SetDataSuffixBytes(translation["DataSuffixBytes"]); - if (IString::ToInteger(translation["DataSuffixBytes"]) > 0) { + if (Isis::toInt(translation["DataSuffixBytes"]) > 0) { importer.SaveDataSuffix(); } } diff --git a/isis/src/base/apps/isisminer/StereoPairStrategy.cpp b/isis/src/base/apps/isisminer/StereoPairStrategy.cpp index 0b1063a337..b19f0997ad 100644 --- a/isis/src/base/apps/isisminer/StereoPairStrategy.cpp +++ b/isis/src/base/apps/isisminer/StereoPairStrategy.cpp @@ -411,12 +411,12 @@ namespace Isis { QVector threshold; try { for ( nval = 0 ; nval < key.size() ; nval++ ) { - threshold.push_back(IString::ToDouble(key[nval])); + threshold.push_back(Isis::toDouble(key[nval])); } } catch (IException &ie) { // Traps float conversion errors - std::string mess = "Error converting value [" + toString(nval+1) + + std::string mess = "Error converting value [" + Isis::toString(nval+1) + "] in keyword [" + key.name() + "] to double."; throw IException(ie, IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/kernfilter/main.cpp b/isis/src/base/apps/kernfilter/main.cpp index 7a5e5c069b..98552b4a0f 100644 --- a/isis/src/base/apps/kernfilter/main.cpp +++ b/isis/src/base/apps/kernfilter/main.cpp @@ -56,7 +56,7 @@ void IsisMain() { // Iterate through the input kernel's data values to fill the coefs array for(int i = 0 ; i < kern["data"].size() ; i ++) { - coefs.push_back(IString::ToDouble(kern["data"][i])); + coefs.push_back(Isis::toDouble(kern["data"][i])); } // Weight for multiplication of resultant immidately before completion diff --git a/isis/src/base/apps/lineeq/main.cpp b/isis/src/base/apps/lineeq/main.cpp index 2d657601a1..dee63ef2c9 100644 --- a/isis/src/base/apps/lineeq/main.cpp +++ b/isis/src/base/apps/lineeq/main.cpp @@ -45,8 +45,8 @@ void IsisMain() { } PvlGroup data("lineeq"); - data += PvlKeyword("BoxcarSize", toString(boxcarSize), "lines"); - data += PvlKeyword("OutputCsv", toString((int)ui.GetBoolean("AVERAGES"))); + data += PvlKeyword("BoxcarSize", Isis::toString(boxcarSize), "lines"); + data += PvlKeyword("OutputCsv", Isis::toString((int)ui.GetBoolean("AVERAGES"))); TextFile *csvOutput = NULL; if(ui.GetBoolean("AVERAGES")) { diff --git a/isis/src/base/apps/makeflat/main.cpp b/isis/src/base/apps/makeflat/main.cpp index d175855607..cce89d1866 100644 --- a/isis/src/base/apps/makeflat/main.cpp +++ b/isis/src/base/apps/makeflat/main.cpp @@ -396,13 +396,13 @@ void IsisMain() { PvlObject currFile("Exclusions"); currFile += PvlKeyword("FileName", inList[currImage].toString()); - currFile += PvlKeyword("Tolerance", toString(maxStdev)); + currFile += PvlKeyword("Tolerance", Isis::toString(maxStdev)); if(cameraType == LineScan) { - currFile += PvlKeyword("FrameLines", toString(numFrameLines)); + currFile += PvlKeyword("FrameLines", Isis::toString(numFrameLines)); } else if(cameraType == PushFrame) { - currFile += PvlKeyword("FrameletLines", toString(numFrameLines)); + currFile += PvlKeyword("FrameletLines", Isis::toString(numFrameLines)); } excludedDetails.push_back(currFile); @@ -663,11 +663,11 @@ void CreateTemporaryData(Buffer &in) { // Record the exclusion PvlGroup currExclusion("ExcludedLines"); - currExclusion += PvlKeyword("FrameStartLine", toString(in.Line())); - currExclusion += PvlKeyword("ValidPixels", toString(inputFrameStats.ValidPixels())); + currExclusion += PvlKeyword("FrameStartLine", Isis::toString(in.Line())); + currExclusion += PvlKeyword("ValidPixels", Isis::toString(inputFrameStats.ValidPixels())); if(!IsSpecial(inputFrameStats.StandardDeviation())) - currExclusion += PvlKeyword("StandardDeviation", toString(inputFrameStats.StandardDeviation())); + currExclusion += PvlKeyword("StandardDeviation", Isis::toString(inputFrameStats.StandardDeviation())); else currExclusion += PvlKeyword("StandardDeviation", "N/A"); @@ -711,12 +711,12 @@ void CreateTemporaryData(Buffer &in) { if(excluded && ((in.Line() - 1) % numFrameLines == 0)) { PvlGroup currExclusion("ExcludedFramelet"); - currExclusion += PvlKeyword("FrameletStartLine", toString(in.Line())); - currExclusion += PvlKeyword("FrameletNumber", toString((in.Line() - 1) / numFrameLines)); + currExclusion += PvlKeyword("FrameletStartLine", Isis::toString(in.Line())); + currExclusion += PvlKeyword("FrameletNumber", Isis::toString((in.Line() - 1) / numFrameLines)); if(!IsSpecial(stdev)) { currExclusion += PvlKeyword("StandardDeviation", - toString(stdev)); + Isis::toString(stdev)); } else { currExclusion += PvlKeyword("StandardDeviation", diff --git a/isis/src/base/apps/map2map/main.cpp b/isis/src/base/apps/map2map/main.cpp index ba1918bdc9..90d0042b7c 100644 --- a/isis/src/base/apps/map2map/main.cpp +++ b/isis/src/base/apps/map2map/main.cpp @@ -88,12 +88,12 @@ if((QString::fromStdString(userMapping["LongitudeDirection"])).compare(QString:: } if(QString::fromStdString(userMapping["LongitudeDirection"]) == "PositiveEast") { - fromMapping["MaximumLongitude"] = toString(TProjection::ToPositiveEast(minLon, domain)); - fromMapping["MinimumLongitude"] = toString(TProjection::ToPositiveEast(maxLon, domain)); + fromMapping["MaximumLongitude"] = Isis::toString(TProjection::ToPositiveEast(minLon, domain)); + fromMapping["MinimumLongitude"] = Isis::toString(TProjection::ToPositiveEast(maxLon, domain)); } else if(QString::fromStdString(userMapping["LongitudeDirection"]) == "PositiveWest") { - fromMapping["MaximumLongitude"] = toString(TProjection::ToPositiveWest(minLon, domain)); - fromMapping["MinimumLongitude"] = toString(TProjection::ToPositiveWest(maxLon, domain)); + fromMapping["MaximumLongitude"] = Isis::toString(TProjection::ToPositiveWest(minLon, domain)); + fromMapping["MinimumLongitude"] = Isis::toString(TProjection::ToPositiveWest(maxLon, domain)); } } } @@ -102,21 +102,21 @@ if((QString::fromStdString(userMapping["LongitudeDirection"])).compare(QString:: if(userMapping.hasKeyword("LatitudeType")) { // user set a new domain? if((QString::fromStdString(userMapping["LatitudeType"])).compare(QString::fromStdString(fromMapping["LatitudeType"])) != 0) { // new lat type different? if((QString::fromStdString(userMapping["LatitudeType"])).compare("Planetographic") == 0) { - fromMapping["MinimumLatitude"] = toString(TProjection::ToPlanetographic( + fromMapping["MinimumLatitude"] = Isis::toString(TProjection::ToPlanetographic( (double)fromMapping["MinimumLatitude"], (double)fromMapping["EquatorialRadius"], (double)fromMapping["PolarRadius"])); - fromMapping["MaximumLatitude"] = toString(TProjection::ToPlanetographic( + fromMapping["MaximumLatitude"] = Isis::toString(TProjection::ToPlanetographic( (double)fromMapping["MaximumLatitude"], (double)fromMapping["EquatorialRadius"], (double)fromMapping["PolarRadius"])); } else { - fromMapping["MinimumLatitude"] = toString(TProjection::ToPlanetocentric( + fromMapping["MinimumLatitude"] = Isis::toString(TProjection::ToPlanetocentric( (double)fromMapping["MinimumLatitude"], (double)fromMapping["EquatorialRadius"], (double)fromMapping["PolarRadius"])); - fromMapping["MaximumLatitude"] = toString(TProjection::ToPlanetocentric( + fromMapping["MaximumLatitude"] = Isis::toString(TProjection::ToPlanetocentric( (double)fromMapping["MaximumLatitude"], (double)fromMapping["EquatorialRadius"], (double)fromMapping["PolarRadius"])); diff --git a/isis/src/base/apps/map2map/map2map.cpp b/isis/src/base/apps/map2map/map2map.cpp index 5ed705464a..bee3a85680 100644 --- a/isis/src/base/apps/map2map/map2map.cpp +++ b/isis/src/base/apps/map2map/map2map.cpp @@ -57,19 +57,19 @@ namespace Isis { // Deal with user overrides entered in the GUI. Do this by changing the user's mapping group, which // will then overlay anything in the output mapping group. if(ui.WasEntered("MINLAT") && !ui.GetBoolean("MATCHMAP")) { - userMappingGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(ui.GetDouble("MINLAT"))), Pvl::Replace); + userMappingGrp.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(ui.GetDouble("MINLAT"))), Pvl::Replace); } if(ui.WasEntered("MAXLAT") && !ui.GetBoolean("MATCHMAP")) { - userMappingGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); + userMappingGrp.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); } if(ui.WasEntered("MINLON") && !ui.GetBoolean("MATCHMAP")) { - userMappingGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(ui.GetDouble("MINLON"))), Pvl::Replace); + userMappingGrp.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(ui.GetDouble("MINLON"))), Pvl::Replace); } if(ui.WasEntered("MAXLON") && !ui.GetBoolean("MATCHMAP")) { - userMappingGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(ui.GetDouble("MAXLON"))), Pvl::Replace); + userMappingGrp.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(ui.GetDouble("MAXLON"))), Pvl::Replace); } /** @@ -92,8 +92,8 @@ namespace Isis { double minLon = outMappingGrp["MinimumLongitude"]; double maxLon = outMappingGrp["MaximumLongitude"]; - outMappingGrp["MaximumLongitude"] = toString(minLon); - outMappingGrp["MinimumLongitude"] = toString(maxLon); + outMappingGrp["MaximumLongitude"] = Isis::toString(minLon); + outMappingGrp["MinimumLongitude"] = Isis::toString(maxLon); } if(ui.GetString("PIXRES").compare("FROM") == 0 && !ui.GetBoolean("MATCHMAP")) { @@ -151,7 +151,7 @@ namespace Isis { userMappingGrp.deleteKeyword("PixelResolution"); } - outMappingGrp.addKeyword(PvlKeyword("PixelResolution", toString(ui.GetDouble("RESOLUTION")), "meters/pixel"), Pvl::Replace); + outMappingGrp.addKeyword(PvlKeyword("PixelResolution", Isis::toString(ui.GetDouble("RESOLUTION")), "meters/pixel"), Pvl::Replace); } else if(ui.GetString("PIXRES").compare("PPD") == 0) { // Resolution specified - delete all and add to outMappingGrp @@ -179,7 +179,7 @@ namespace Isis { userMappingGrp.deleteKeyword("PixelResolution"); } - outMappingGrp.addKeyword(PvlKeyword("Scale", toString(ui.GetDouble("RESOLUTION")), "pixels/degree"), Pvl::Replace); + outMappingGrp.addKeyword(PvlKeyword("Scale", Isis::toString(ui.GetDouble("RESOLUTION")), "pixels/degree"), Pvl::Replace); } // Rotation will NOT Propagate @@ -217,12 +217,12 @@ namespace Isis { if(!userMappingGrp.hasKeyword(longitudes[index].name())) { // use the from domain because that's where our values are coming from if(((std::string)userMappingGrp["LongitudeDirection"]).compare("PositiveEast") == 0) { - outMappingGrp[longitudes[index].name()] = toString( + outMappingGrp[longitudes[index].name()] = Isis::toString( TProjection::ToPositiveEast(outMappingGrp[longitudes[index].name()], outMappingGrp["LongitudeDomain"])); } else { - outMappingGrp[longitudes[index].name()] = toString( + outMappingGrp[longitudes[index].name()] = Isis::toString( TProjection::ToPositiveWest(outMappingGrp[longitudes[index].name()], outMappingGrp["LongitudeDomain"])); } @@ -238,11 +238,11 @@ namespace Isis { for(int index = 0; index < longitudes.keywords(); index ++) { if(!userMappingGrp.hasKeyword(longitudes[index].name())) { if((int)userMappingGrp["LongitudeDomain"] == 180) { - outMappingGrp[longitudes[index].name()] = toString( + outMappingGrp[longitudes[index].name()] = Isis::toString( TProjection::To180Domain(outMappingGrp[longitudes[index].name()])); } else { - outMappingGrp[longitudes[index].name()] = toString( + outMappingGrp[longitudes[index].name()] = Isis::toString( TProjection::To360Domain(outMappingGrp[longitudes[index].name()])); } } @@ -259,13 +259,13 @@ namespace Isis { for(int index = 0; index < latitudes.keywords(); index ++) { if(!userMappingGrp.hasKeyword(latitudes[index].name())) { if(((std::string)userMappingGrp["LatitudeType"]).compare("Planetographic") == 0) { - outMappingGrp[latitudes[index].name()] = toString(TProjection::ToPlanetographic( + outMappingGrp[latitudes[index].name()] = Isis::toString(TProjection::ToPlanetographic( (double)fromMappingGrp[latitudes[index].name()], (double)fromMappingGrp["EquatorialRadius"], (double)fromMappingGrp["PolarRadius"])); } else { - outMappingGrp[latitudes[index].name()] = toString(TProjection::ToPlanetocentric( + outMappingGrp[latitudes[index].name()] = Isis::toString(TProjection::ToPlanetocentric( (double)fromMappingGrp[latitudes[index].name()], (double)fromMappingGrp["EquatorialRadius"], (double)fromMappingGrp["PolarRadius"])); diff --git a/isis/src/base/apps/mapgrid/main.cpp b/isis/src/base/apps/mapgrid/main.cpp index 79c329268a..4b138d91a5 100644 --- a/isis/src/base/apps/mapgrid/main.cpp +++ b/isis/src/base/apps/mapgrid/main.cpp @@ -52,10 +52,10 @@ void IsisMain() { mapping.deleteKeyword("MaximumLongitude"); } - mapping += PvlKeyword("MinimumLatitude", toString(latStart)); - mapping += PvlKeyword("MaximumLatitude", toString(latEnd)); - mapping += PvlKeyword("MinimumLongitude", toString(lonStart)); - mapping += PvlKeyword("MaximumLongitude", toString(lonEnd)); + mapping += PvlKeyword("MinimumLatitude", Isis::toString(latStart)); + mapping += PvlKeyword("MaximumLatitude", Isis::toString(latEnd)); + mapping += PvlKeyword("MinimumLongitude", Isis::toString(lonStart)); + mapping += PvlKeyword("MaximumLongitude", Isis::toString(lonEnd)); TProjection *proj; try { diff --git a/isis/src/base/apps/maplab/main.cpp b/isis/src/base/apps/maplab/main.cpp index 5fb1831128..67c4698aac 100644 --- a/isis/src/base/apps/maplab/main.cpp +++ b/isis/src/base/apps/maplab/main.cpp @@ -90,14 +90,14 @@ void IsisMain() { y = y + res * (line - 0.5); //add origen values to Mapping Group - mapGrp.addKeyword(PvlKeyword("UpperLeftCornerX", toString(x), "meters"), Pvl::Replace); - mapGrp.addKeyword(PvlKeyword("UpperLeftCornerY", toString(y), "meters"), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("UpperLeftCornerX", Isis::toString(x), "meters"), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("UpperLeftCornerY", Isis::toString(y), "meters"), Pvl::Replace); if(!mapGrp.hasKeyword("PixelResolution")) { - mapGrp.addKeyword(PvlKeyword("PixelResolution", toString(res), "meters")); + mapGrp.addKeyword(PvlKeyword("PixelResolution", Isis::toString(res), "meters")); } if(!mapGrp.hasKeyword("Scale")) { - mapGrp.addKeyword(PvlKeyword("Scale", toString(scale), "pixels/degree")); + mapGrp.addKeyword(PvlKeyword("Scale", Isis::toString(scale), "pixels/degree")); } diff --git a/isis/src/base/apps/mapmos/mapmos.cpp b/isis/src/base/apps/mapmos/mapmos.cpp index 6d1fb33b39..73975bef29 100644 --- a/isis/src/base/apps/mapmos/mapmos.cpp +++ b/isis/src/base/apps/mapmos/mapmos.cpp @@ -62,19 +62,19 @@ namespace Isis { inCube->close(); if ( ui.WasEntered("MINLAT") ) { - mapGroup.addKeyword(PvlKeyword( "MinimumLatitude", toString( ui.GetDouble("MINLAT") ) ), + mapGroup.addKeyword(PvlKeyword( "MinimumLatitude", Isis::toString( ui.GetDouble("MINLAT") ) ), Pvl::Replace); } if ( ui.WasEntered("MAXLAT") ) { - mapGroup.addKeyword(PvlKeyword( "MaximumLatitude", toString( ui.GetDouble("MAXLAT") ) ), + mapGroup.addKeyword(PvlKeyword( "MaximumLatitude", Isis::toString( ui.GetDouble("MAXLAT") ) ), Pvl::Replace); } if ( ui.WasEntered("MINLON") ) { - mapGroup.addKeyword(PvlKeyword( "MinimumLongitude", toString( ui.GetDouble("MINLON") ) ), + mapGroup.addKeyword(PvlKeyword( "MinimumLongitude", Isis::toString( ui.GetDouble("MINLON") ) ), Pvl::Replace); } if ( ui.WasEntered("MAXLON") ) { - mapGroup.addKeyword(PvlKeyword( "MaximumLongitude", toString( ui.GetDouble("MAXLON") ) ), + mapGroup.addKeyword(PvlKeyword( "MaximumLongitude", Isis::toString( ui.GetDouble("MAXLON") ) ), Pvl::Replace); } //check to make sure they're all there. If not, throw error, need to enter all. diff --git a/isis/src/base/apps/mappt/mappt.cpp b/isis/src/base/apps/mappt/mappt.cpp index a8b185140e..8a3859354a 100644 --- a/isis/src/base/apps/mappt/mappt.cpp +++ b/isis/src/base/apps/mappt/mappt.cpp @@ -141,7 +141,7 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac // Make sure we have a valid latitude value if(fabs(lat) > 90.0) { std::string msg = "Invalid value for LATITUDE [" - + toString(lat) + "] outside range of "; + + Isis::toString(lat) + "] outside range of "; msg += "[-90,90]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -255,36 +255,36 @@ PvlGroup getProjPointInfo(Cube *icube, QPair point, UserInterfac if(proj->IsGood()) { results += PvlKeyword("Filename", FileName(icube->fileName().toStdString()).expanded()); - results += PvlKeyword("Sample", toString(proj->WorldX())); - results += PvlKeyword("Line", toString(proj->WorldY())); - results += PvlKeyword("Band", toString(icube->physicalBand(1))); + results += PvlKeyword("Sample", Isis::toString(proj->WorldX())); + results += PvlKeyword("Line", Isis::toString(proj->WorldY())); + results += PvlKeyword("Band", Isis::toString(icube->physicalBand(1))); results += PvlKeyword("FilterName", filterName.toStdString()); results += PvlKeyword("PixelValue", PixelToString(b[0])); - results += PvlKeyword("X", toString(proj->XCoord())); - results += PvlKeyword("Y", toString(proj->YCoord())); + results += PvlKeyword("X", Isis::toString(proj->XCoord())); + results += PvlKeyword("Y", Isis::toString(proj->YCoord())); // Put together all the keywords for different coordinate systems. PvlKeyword centLat = - PvlKeyword("PlanetocentricLatitude", toString(proj->UniversalLatitude())); + PvlKeyword("PlanetocentricLatitude", Isis::toString(proj->UniversalLatitude())); PvlKeyword graphLat = PvlKeyword("PlanetographicLatitude", - toString(proj->ToPlanetographic(proj->UniversalLatitude()))); + Isis::toString(proj->ToPlanetographic(proj->UniversalLatitude()))); PvlKeyword pE360 = - PvlKeyword("PositiveEast360Longitude", toString(proj->UniversalLongitude())); + PvlKeyword("PositiveEast360Longitude", Isis::toString(proj->UniversalLongitude())); PvlKeyword pW360 = PvlKeyword("PositiveWest360Longitude", - toString(proj->ToPositiveWest(proj->UniversalLongitude(), 360))); + Isis::toString(proj->ToPositiveWest(proj->UniversalLongitude(), 360))); PvlKeyword pE180 = PvlKeyword("PositiveEast180Longitude", - toString(proj->To180Domain(proj->UniversalLongitude()))); + Isis::toString(proj->To180Domain(proj->UniversalLongitude()))); PvlKeyword pW180 = PvlKeyword("PositiveWest180Longitude", - toString(proj->To180Domain(proj->ToPositiveEast( + Isis::toString(proj->To180Domain(proj->ToPositiveEast( proj->UniversalLongitude(), 360)))); diff --git a/isis/src/base/apps/mapsize/main.cpp b/isis/src/base/apps/mapsize/main.cpp index e539b4b8aa..9324b31f75 100644 --- a/isis/src/base/apps/mapsize/main.cpp +++ b/isis/src/base/apps/mapsize/main.cpp @@ -45,14 +45,14 @@ void IsisMain() { // Create a label and log it PvlGroup results("Results"); results += PvlKeyword("Map", ui.GetFileName("MAP").toStdString()); - results += PvlKeyword("Scale", toString(scale)); - results += PvlKeyword("Width", toString(width), "inches"); - results += PvlKeyword("Height", toString(height), "inches"); - results += PvlKeyword("Samples", toString(samples)); - results += PvlKeyword("Lines", toString(lines)); - results += PvlKeyword("RealSize", toString(((Isis::BigInt)lines * samples * 4) / 1024.0), "KB"); - results += PvlKeyword("SignedWordSize", toString(((Isis::BigInt)lines * samples * 2) / 1024.0), "KB"); - results += PvlKeyword("UnsignedByteSize", toString(((Isis::BigInt)lines * samples) / 1024.0), "KB"); + results += PvlKeyword("Scale", Isis::toString(scale)); + results += PvlKeyword("Width", Isis::toString(width), "inches"); + results += PvlKeyword("Height", Isis::toString(height), "inches"); + results += PvlKeyword("Samples", Isis::toString(samples)); + results += PvlKeyword("Lines", Isis::toString(lines)); + results += PvlKeyword("RealSize", Isis::toString(((Isis::BigInt)lines * samples * 4) / 1024.0), "KB"); + results += PvlKeyword("SignedWordSize", Isis::toString(((Isis::BigInt)lines * samples * 2) / 1024.0), "KB"); + results += PvlKeyword("UnsignedByteSize", Isis::toString(((Isis::BigInt)lines * samples) / 1024.0), "KB"); Application::Log(results); // Write the output file if requested diff --git a/isis/src/base/apps/maptemplate/main.cpp b/isis/src/base/apps/maptemplate/main.cpp index 5916bd21a1..43d625164f 100644 --- a/isis/src/base/apps/maptemplate/main.cpp +++ b/isis/src/base/apps/maptemplate/main.cpp @@ -391,39 +391,39 @@ void addProject(PvlGroup &mapping) { mapping += PvlKeyword("ProjectionName", projLUT[projName].toStdString()); if(ui.WasEntered("CLON")) { double clonOut = ui.GetDouble("CLON"); - mapping += PvlKeyword("CenterLongitude", toString(clonOut)); + mapping += PvlKeyword("CenterLongitude", Isis::toString(clonOut)); } if(ui.WasEntered("CLAT")) { double clatOut = ui.GetDouble("CLAT"); - mapping += PvlKeyword("CenterLatitude", toString(clatOut)); + mapping += PvlKeyword("CenterLatitude", Isis::toString(clatOut)); } if(ui.WasEntered("SCALEFACTOR")) { double scaleFactorOut = ui.GetDouble("SCALEFACTOR"); - mapping += PvlKeyword("ScaleFactor", toString(scaleFactorOut)); + mapping += PvlKeyword("ScaleFactor", Isis::toString(scaleFactorOut)); } if(ui.WasEntered("PAR1")) { double par1 = ui.GetDouble("PAR1"); - mapping += PvlKeyword("FirstStandardParallel", toString(par1)); + mapping += PvlKeyword("FirstStandardParallel", Isis::toString(par1)); } if(ui.WasEntered("PAR2")) { double par2 = ui.GetDouble("PAR2"); - mapping += PvlKeyword("SecondStandardParallel", toString(par2)); + mapping += PvlKeyword("SecondStandardParallel", Isis::toString(par2)); } if(ui.WasEntered("PLAT")) { double plat = ui.GetDouble("PLAT"); - mapping += PvlKeyword("PoleLatitude", toString(plat)); + mapping += PvlKeyword("PoleLatitude", Isis::toString(plat)); } if(ui.WasEntered("PLON")) { double plon = ui.GetDouble("PLON"); - mapping += PvlKeyword("PoleLongitude", toString(plon)); + mapping += PvlKeyword("PoleLongitude", Isis::toString(plon)); } if(ui.WasEntered("PROT")) { double prot = ui.GetDouble("PROT"); - mapping += PvlKeyword("PoleRotation", toString(prot)); + mapping += PvlKeyword("PoleRotation", Isis::toString(prot)); } if(ui.WasEntered("DIST")) { double dist = ui.GetDouble("DIST"); - mapping += PvlKeyword("Distance", toString(dist)); + mapping += PvlKeyword("Distance", Isis::toString(dist)); } } @@ -511,13 +511,13 @@ void addRange(PvlGroup &mapping) { // Use the values that have been entered in the GUI if(ui.GetString("RNGOPT") == "USER") { double minLat = ui.GetDouble("MINLAT"); - mapping += PvlKeyword("MinimumLatitude", toString(minLat)); + mapping += PvlKeyword("MinimumLatitude", Isis::toString(minLat)); double maxLat = ui.GetDouble("MAXLAT"); - mapping += PvlKeyword("MaximumLatitude", toString(maxLat)); + mapping += PvlKeyword("MaximumLatitude", Isis::toString(maxLat)); double minLon = ui.GetDouble("MINLON"); - mapping += PvlKeyword("MinimumLongitude", toString(minLon)); + mapping += PvlKeyword("MinimumLongitude", Isis::toString(minLon)); double maxLon = ui.GetDouble("MAXLON"); - mapping += PvlKeyword("MaximumLongitude", toString(maxLon)); + mapping += PvlKeyword("MaximumLongitude", Isis::toString(maxLon)); } else if(ui.GetString("RNGOPT") == "CALC") { // calculate range values using function calcRange and fromlist @@ -527,10 +527,10 @@ void addRange(PvlGroup &mapping) { double maxLon; // Call calcRange to calculate min and max ground range values calcRange(minLat, maxLat, minLon, maxLon); - mapping += PvlKeyword("MinimumLatitude", toString(minLat)); - mapping += PvlKeyword("MaximumLatitude", toString(maxLat)); - mapping += PvlKeyword("MinimumLongitude", toString(minLon)); - mapping += PvlKeyword("MaximumLongitude", toString(maxLon)); + mapping += PvlKeyword("MinimumLatitude", Isis::toString(minLat)); + mapping += PvlKeyword("MaximumLatitude", Isis::toString(maxLat)); + mapping += PvlKeyword("MinimumLongitude", Isis::toString(minLon)); + mapping += PvlKeyword("MaximumLongitude", Isis::toString(maxLon)); } } @@ -540,16 +540,16 @@ void addResolution(PvlGroup &mapping) { UserInterface &ui = Application::GetUserInterface(); if(ui.GetString("RESOPT") == "PPD") { double res = ui.GetDouble("RESOLUTION"); - mapping += PvlKeyword("Scale", toString(res), "pixels/degree"); + mapping += PvlKeyword("Scale", Isis::toString(res), "pixels/degree"); } else if(ui.GetString("RESOPT") == "MPP") { double res = ui.GetDouble("RESOLUTION"); - mapping += PvlKeyword("PixelResolution", toString(res), "meters/pixel"); + mapping += PvlKeyword("PixelResolution", Isis::toString(res), "meters/pixel"); } else if(ui.GetString("RESOPT") == "CALC") { // run the function to calculate the resolution double Res = calcResolution(); - mapping += PvlKeyword("PixelResolution", toString(Res), "meters/pixel"); + mapping += PvlKeyword("PixelResolution", Isis::toString(Res), "meters/pixel"); } } diff --git a/isis/src/base/apps/mask/main.cpp b/isis/src/base/apps/mask/main.cpp index 322a63aeed..8f62767973 100644 --- a/isis/src/base/apps/mask/main.cpp +++ b/isis/src/base/apps/mask/main.cpp @@ -74,10 +74,10 @@ void IsisMain() { PvlGroup results("Results"); if(g_masked == true) { - results += PvlKeyword("PixelsMasked", toString(g_pixelsMasked)); + results += PvlKeyword("PixelsMasked", Isis::toString(g_pixelsMasked)); } else { - PvlKeyword pm("PixelsMasked", toString(g_pixelsMasked)); + PvlKeyword pm("PixelsMasked", Isis::toString(g_pixelsMasked)); pm.addComment( "No pixels were masked for this image"); results += pm; } diff --git a/isis/src/base/apps/mosrange/mosrange.cpp b/isis/src/base/apps/mosrange/mosrange.cpp index 792829479c..33ad5eeddf 100644 --- a/isis/src/base/apps/mosrange/mosrange.cpp +++ b/isis/src/base/apps/mosrange/mosrange.cpp @@ -143,8 +143,8 @@ namespace Isis { PvlObject fmap("File"); fmap += PvlKeyword("Name", cubeFileList[i].toString()); - fmap += PvlKeyword("Lines", toString(lines)); - fmap += PvlKeyword("Samples", toString(samples)); + fmap += PvlKeyword("Lines", Isis::toString(lines)); + fmap += PvlKeyword("Samples", Isis::toString(samples)); Camera *cam = cube.camera(); Pvl mapping; @@ -182,20 +182,20 @@ namespace Isis { double pixres = (lowres + hires) / 2.0; double scale = Scale(pixres, poleRad, eqRad); - mapgrp.addKeyword(PvlKeyword("PixelResolution", toString(pixres)), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("Scale", toString(scale), "pixels/degree"), Pvl::Replace); - mapgrp += PvlKeyword("MinPixelResolution", toString(lowres), "meters/pixel"); - mapgrp += PvlKeyword("MaxPixelResolution", toString(hires), "meters/pixel"); - mapgrp += PvlKeyword("MinObliquePixelResolution", toString(lowObliqueRes), "meters/pixel"); - mapgrp += PvlKeyword("MaxObliquePixelResolution", toString(hiObliqueRes), "meters/pixel"); + mapgrp.addKeyword(PvlKeyword("PixelResolution", Isis::toString(pixres)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("Scale", Isis::toString(scale), "pixels/degree"), Pvl::Replace); + mapgrp += PvlKeyword("MinPixelResolution", Isis::toString(lowres), "meters/pixel"); + mapgrp += PvlKeyword("MaxPixelResolution", Isis::toString(hires), "meters/pixel"); + mapgrp += PvlKeyword("MinObliquePixelResolution", Isis::toString(lowObliqueRes), "meters/pixel"); + mapgrp += PvlKeyword("MaxObliquePixelResolution", Isis::toString(hiObliqueRes), "meters/pixel"); // Get the universal ground range double minlat, maxlat, minlon, maxlon; cam->GroundRange(minlat, maxlat, minlon, maxlon, mapping); - mapgrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minlat)), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxlat)), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minlon)), Pvl::Replace); - mapgrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxlon)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(minlat)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(maxlat)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(minlon)), Pvl::Replace); + mapgrp.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(maxlon)), Pvl::Replace); fmap.addGroup(mapgrp); fileset.addObject(fmap); @@ -263,38 +263,38 @@ namespace Isis { mapping += PvlKeyword("ProjectionName", projection.toStdString()); mapping += PvlKeyword("TargetName", target.toStdString()); - mapping += PvlKeyword("EquatorialRadius", toString(eqRad), "meters"); - mapping += PvlKeyword("PolarRadius", toString(poleRad), "meters"); + mapping += PvlKeyword("EquatorialRadius", Isis::toString(eqRad), "meters"); + mapping += PvlKeyword("PolarRadius", Isis::toString(poleRad), "meters"); mapping += PvlKeyword("LatitudeType", lattype.toStdString()); mapping += PvlKeyword("LongitudeDirection", londir.toStdString()); mapping += PvlKeyword("LongitudeDomain", londom.toStdString()); - mapping += PvlKeyword("PixelResolution", toString(SetRound(avgPixRes, digits)), "meters/pixel"); - mapping += PvlKeyword("Scale", toString(SetRound(scale, digits)), "pixels/degree"); - mapping += PvlKeyword("MinPixelResolution", toString(scaleStat.Minimum()), "meters/pixel"); - mapping += PvlKeyword("MaxPixelResolution", toString(scaleStat.Maximum()), "meters/pixel"); - mapping += PvlKeyword("MinObliquePixelResolution", toString(obliqueScaleStat.Minimum()), + mapping += PvlKeyword("PixelResolution", Isis::toString(SetRound(avgPixRes, digits)), "meters/pixel"); + mapping += PvlKeyword("Scale", Isis::toString(SetRound(scale, digits)), "pixels/degree"); + mapping += PvlKeyword("MinPixelResolution", Isis::toString(scaleStat.Minimum()), "meters/pixel"); + mapping += PvlKeyword("MaxPixelResolution", Isis::toString(scaleStat.Maximum()), "meters/pixel"); + mapping += PvlKeyword("MinObliquePixelResolution", Isis::toString(obliqueScaleStat.Minimum()), "meters/pixel"); - mapping += PvlKeyword("MaxObliquePixelResolution", toString(obliqueScaleStat.Maximum()), + mapping += PvlKeyword("MaxObliquePixelResolution", Isis::toString(obliqueScaleStat.Maximum()), "meters/pixel"); - mapping += PvlKeyword("CenterLongitude", toString(SetRound(avgLon, digits))); - mapping += PvlKeyword("CenterLatitude", toString(SetRound(avgLat, digits))); - mapping += PvlKeyword("MinimumLatitude", toString(std::max(SetFloor(latitudeStat.Minimum(), + mapping += PvlKeyword("CenterLongitude", Isis::toString(SetRound(avgLon, digits))); + mapping += PvlKeyword("CenterLatitude", Isis::toString(SetRound(avgLat, digits))); + mapping += PvlKeyword("MinimumLatitude", Isis::toString(std::max(SetFloor(latitudeStat.Minimum(), digits), -90.0))); - mapping += PvlKeyword("MaximumLatitude", toString(std::min(SetCeil(latitudeStat.Maximum(), + mapping += PvlKeyword("MaximumLatitude", Isis::toString(std::min(SetCeil(latitudeStat.Maximum(), digits), 90.0))); - mapping += PvlKeyword("MinimumLongitude", toString(std::max(SetFloor(longitudeStat.Minimum(), + mapping += PvlKeyword("MinimumLongitude", Isis::toString(std::max(SetFloor(longitudeStat.Minimum(), digits), -180.0))); - mapping += PvlKeyword("MaximumLongitude", toString(std::min(SetCeil(longitudeStat.Maximum(), + mapping += PvlKeyword("MaximumLongitude", Isis::toString(std::min(SetCeil(longitudeStat.Maximum(), digits), 360.0))); - PvlKeyword clat("PreciseCenterLongitude", toString(avgLon)); + PvlKeyword clat("PreciseCenterLongitude", Isis::toString(avgLon)); clat.addComment("Actual Parameters without precision applied"); mapping += clat; - mapping += PvlKeyword("PreciseCenterLatitude", toString(avgLat)); - mapping += PvlKeyword("PreciseMinimumLatitude", toString(latitudeStat.Minimum())); - mapping += PvlKeyword("PreciseMaximumLatitude", toString(latitudeStat.Maximum())); - mapping += PvlKeyword("PreciseMinimumLongitude", toString(longitudeStat.Minimum())); - mapping += PvlKeyword("PreciseMaximumLongitude", toString(longitudeStat.Maximum())); + mapping += PvlKeyword("PreciseCenterLatitude", Isis::toString(avgLat)); + mapping += PvlKeyword("PreciseMinimumLatitude", Isis::toString(latitudeStat.Minimum())); + mapping += PvlKeyword("PreciseMaximumLatitude", Isis::toString(latitudeStat.Maximum())); + mapping += PvlKeyword("PreciseMinimumLongitude", Isis::toString(longitudeStat.Minimum())); + mapping += PvlKeyword("PreciseMaximumLongitude", Isis::toString(longitudeStat.Maximum())); Application::AppendAndLog(mapping, &log); diff --git a/isis/src/base/apps/mvstats/main.cpp b/isis/src/base/apps/mvstats/main.cpp index 0404632576..667a771e6a 100644 --- a/isis/src/base/apps/mvstats/main.cpp +++ b/isis/src/base/apps/mvstats/main.cpp @@ -64,8 +64,8 @@ void IsisMain() { //Set CubeAttributeInputs to tell the ProcessByLine which //bands to compare - CubeAttributeInput band_a("d+" + toString(icube->physicalBand(i))); - CubeAttributeInput band_b("d+" + toString(icube->physicalBand(j))); + CubeAttributeInput band_a("d+" + Isis::toString(icube->physicalBand(i))); + CubeAttributeInput band_b("d+" + Isis::toString(icube->physicalBand(j))); //Set Input files and process, to accumulate the statistics p.SetInputCube(file, band_a); diff --git a/isis/src/base/apps/nocam2map/nocam2map.cpp b/isis/src/base/apps/nocam2map/nocam2map.cpp index c3fe7052d0..948466ca7b 100644 --- a/isis/src/base/apps/nocam2map/nocam2map.cpp +++ b/isis/src/base/apps/nocam2map/nocam2map.cpp @@ -175,16 +175,16 @@ namespace Isis { //Records the error to the log PvlGroup error("Error"); - error += PvlKeyword("Degree", toString(degree)); - error += PvlKeyword("NumberOfPoints", toString((int)sampResiduals.size())); - error += PvlKeyword("SampleMinimumError", toString(sampErr.Minimum())); - error += PvlKeyword("SampleAverageError", toString(sampErr.Average())); - error += PvlKeyword("SampleMaximumError", toString(sampErr.Maximum())); - error += PvlKeyword("SampleStdDeviationError", toString(sampErr.StandardDeviation())); - error += PvlKeyword("LineMinimumError", toString(lineErr.Minimum())); - error += PvlKeyword("LineAverageError", toString(lineErr.Average())); - error += PvlKeyword("LineMaximumError", toString(lineErr.Maximum())); - error += PvlKeyword("LineStdDeviationError", toString(lineErr.StandardDeviation())); + error += PvlKeyword("Degree", Isis::toString(degree)); + error += PvlKeyword("NumberOfPoints", Isis::toString((int)sampResiduals.size())); + error += PvlKeyword("SampleMinimumError", Isis::toString(sampErr.Minimum())); + error += PvlKeyword("SampleAverageError", Isis::toString(sampErr.Average())); + error += PvlKeyword("SampleMaximumError", Isis::toString(sampErr.Maximum())); + error += PvlKeyword("SampleStdDeviationError", Isis::toString(sampErr.StandardDeviation())); + error += PvlKeyword("LineMinimumError", Isis::toString(lineErr.Minimum())); + error += PvlKeyword("LineAverageError", Isis::toString(lineErr.Average())); + error += PvlKeyword("LineMaximumError", Isis::toString(lineErr.Maximum())); + error += PvlKeyword("LineStdDeviationError", Isis::toString(lineErr.StandardDeviation())); Application::Log(error); @@ -226,8 +226,8 @@ namespace Isis { PvlKeyword polRadius; //If the user entered the equatorial and polar radii if (ui.WasEntered("EQURADIUS") && ui.WasEntered("POLRADIUS")) { - equRadius = PvlKeyword("EquatorialRadius", toString(ui.GetDouble("EQURADIUS"))); - polRadius = PvlKeyword("PolarRadius", toString(ui.GetDouble("POLRADIUS"))); + equRadius = PvlKeyword("EquatorialRadius", Isis::toString(ui.GetDouble("EQURADIUS"))); + polRadius = PvlKeyword("PolarRadius", Isis::toString(ui.GetDouble("POLRADIUS"))); } //Else read them from the pck else { @@ -319,31 +319,31 @@ namespace Isis { maxLon = temp; } - mapGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minLat)), Pvl::Replace); - mapGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxLat)), Pvl::Replace); - mapGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minLon)), Pvl::Replace); - mapGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxLon)), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(minLat)), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(maxLat)), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(minLon)), Pvl::Replace); + mapGrp.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(maxLon)), Pvl::Replace); } //If the user decided to enter a ground range then override if (ui.WasEntered("MINLAT")) { mapGrp.addKeyword(PvlKeyword("MinimumLatitude", - toString(ui.GetDouble("MINLAT"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MINLAT"))), Pvl::Replace); } if (ui.WasEntered("MAXLAT")) { mapGrp.addKeyword(PvlKeyword("MaximumLatitude", - toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MAXLAT"))), Pvl::Replace); } if (ui.WasEntered("MINLON")) { mapGrp.addKeyword(PvlKeyword("MinimumLongitude", - toString(ui.GetDouble("MINLON"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MINLON"))), Pvl::Replace); } if (ui.WasEntered("MAXLON")) { mapGrp.addKeyword(PvlKeyword("MaximumLongitude", - toString(ui.GetDouble("MAXLON"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MAXLON"))), Pvl::Replace); } //If the pixel resolution is to be computed, compute the pixels/degree from the input @@ -378,7 +378,7 @@ namespace Isis { //Add the scale in pixels/degree to the mapping group mapGrp.addKeyword(PvlKeyword("Scale", - toString(pixels / angle), "pixels/degree"), + Isis::toString(pixels / angle), "pixels/degree"), Pvl::Replace); if (mapGrp.hasKeyword("PixelResolution")) { mapGrp.deleteKeyword("PixelResolution"); @@ -389,7 +389,7 @@ namespace Isis { // If the user decided to enter a resolution then override if (ui.GetString("PIXRES") == "MPP") { mapGrp.addKeyword(PvlKeyword("PixelResolution", - toString(ui.GetDouble("RESOLUTION")), "meters/pixel"), + Isis::toString(ui.GetDouble("RESOLUTION")), "meters/pixel"), Pvl::Replace); if (mapGrp.hasKeyword("Scale")) { mapGrp.deleteKeyword("Scale"); @@ -397,7 +397,7 @@ namespace Isis { } else if (ui.GetString("PIXRES") == "PPD") { mapGrp.addKeyword(PvlKeyword("Scale", - toString(ui.GetDouble("RESOLUTION")), "pixels/degree"), + Isis::toString(ui.GetDouble("RESOLUTION")), "pixels/degree"), Pvl::Replace); if (mapGrp.hasKeyword("PixelResolution")) { mapGrp.deleteKeyword("PixelResolution"); diff --git a/isis/src/base/apps/noisefilter/main.cpp b/isis/src/base/apps/noisefilter/main.cpp index bd722e41d4..4602bfbbc8 100644 --- a/isis/src/base/apps/noisefilter/main.cpp +++ b/isis/src/base/apps/noisefilter/main.cpp @@ -63,15 +63,15 @@ void IsisMain() { // Generate a results group and log it PvlGroup results("Results"); - results += PvlKeyword("DarkPixelsReplaced", toString(darkPixelsReplaced)); - results += PvlKeyword("BrightPixelsReplaced", toString(brightPixelsReplaced)); - results += PvlKeyword("SpecialPixelsReplaced", toString(specialPixelsReplaced)); + results += PvlKeyword("DarkPixelsReplaced", Isis::toString(darkPixelsReplaced)); + results += PvlKeyword("BrightPixelsReplaced", Isis::toString(brightPixelsReplaced)); + results += PvlKeyword("SpecialPixelsReplaced", Isis::toString(specialPixelsReplaced)); int pixelsReplaced = darkPixelsReplaced + brightPixelsReplaced + specialPixelsReplaced; - results += PvlKeyword("TotalPixelsReplaced", toString(pixelsReplaced)); + results += PvlKeyword("TotalPixelsReplaced", Isis::toString(pixelsReplaced)); double pct = ((double)pixelsReplaced / ((double)icube->sampleCount() * (double)icube->lineCount())) * 100.; pct = (int)(pct * 10.0) / 10.0; - results += PvlKeyword("PercentChanged", toString(pct)); + results += PvlKeyword("PercentChanged", Isis::toString(pct)); Application::Log(results); p.EndProcess(); } diff --git a/isis/src/base/apps/noproj/noproj.cpp b/isis/src/base/apps/noproj/noproj.cpp index 293537e488..e101a64de4 100644 --- a/isis/src/base/apps/noproj/noproj.cpp +++ b/isis/src/base/apps/noproj/noproj.cpp @@ -234,11 +234,11 @@ namespace Isis { inst.addKeyword(key); key.setName("SampleDetectors"); - key.setValue(toString(detectorSamples)); + key.setValue(Isis::toString(detectorSamples)); inst.addKeyword(key); key.setName("LineDetectors"); - key.setValue(toString(detectorLines)); + key.setValue(Isis::toString(detectorLines)); inst.addKeyword(key); key.setName("InstrumentType"); @@ -287,24 +287,24 @@ namespace Isis { } if (naifKeywordsObject) { - naifKeywordsObject->addKeyword(PvlKeyword("IDEAL_FOCAL_LENGTH", toString(incam->FocalLength())), + naifKeywordsObject->addKeyword(PvlKeyword("IDEAL_FOCAL_LENGTH", Isis::toString(incam->FocalLength())), Pvl::Replace); } else { - inst.addKeyword(PvlKeyword("FocalLength", toString(incam->FocalLength()), "millimeters")); + inst.addKeyword(PvlKeyword("FocalLength", Isis::toString(incam->FocalLength()), "millimeters")); } double newPixelPitch = incam->PixelPitch() * summingMode; if (naifKeywordsObject) { - naifKeywordsObject->addKeyword(PvlKeyword("IDEAL_PIXEL_PITCH", toString(newPixelPitch)), + naifKeywordsObject->addKeyword(PvlKeyword("IDEAL_PIXEL_PITCH", Isis::toString(newPixelPitch)), Pvl::Replace); } else { - inst.addKeyword(PvlKeyword("PixelPitch", toString(newPixelPitch), "millimeters")); + inst.addKeyword(PvlKeyword("PixelPitch", Isis::toString(newPixelPitch), "millimeters")); } key.setName("EphemerisTime"); - key.setValue(toString(et), "seconds"); + key.setValue(Isis::toString(et), "seconds"); inst.addKeyword(key); key.setName("StartTime"); @@ -318,16 +318,16 @@ namespace Isis { } key.setName("FocalPlaneXDependency"); - key.setValue(toString((int)incam->FocalPlaneMap()->FocalPlaneXDependency())); + key.setValue(Isis::toString((int)incam->FocalPlaneMap()->FocalPlaneXDependency())); inst.addKeyword(key); int xDependency = incam->FocalPlaneMap()->FocalPlaneXDependency(); double newInstrumentTransX = incam->FocalPlaneMap()->SignMostSigX(); - inst.addKeyword(PvlKeyword("TransX", toString(newInstrumentTransX))); + inst.addKeyword(PvlKeyword("TransX", Isis::toString(newInstrumentTransX))); double newInstrumentTransY = incam->FocalPlaneMap()->SignMostSigY(); - inst.addKeyword(PvlKeyword("TransY", toString(newInstrumentTransY))); + inst.addKeyword(PvlKeyword("TransY", Isis::toString(newInstrumentTransY))); storeSpice(&inst, naifKeywordsObject, "TransX0", "IDEAL_TRANSX", transx, newPixelPitch * newInstrumentTransX, (xDependency == CameraFocalPlaneMap::Sample)); @@ -349,7 +349,7 @@ namespace Isis { if(instType == "LINESCAN") { key.setName("ExposureDuration"); - key.setValue(toString(incam->DetectorMap()->LineRate() * 1000.), "milliseconds"); + key.setValue(Isis::toString(incam->DetectorMap()->LineRate() * 1000.), "milliseconds"); inst.addKeyword(key); } @@ -367,9 +367,9 @@ namespace Isis { QString matchLbl = matchCubeFileNoExt + ".lbl"; label.read(matchLbl.toStdString()); PvlGroup &dims = label.findGroup("Dimensions", Pvl::Traverse); - dims["Lines"] = toString(numberLines); - dims["Samples"] = toString(detectorSamples); - dims["Bands"] = toString(numberBands); + dims["Lines"] = Isis::toString(numberLines); + dims["Samples"] = Isis::toString(detectorSamples); + dims["Bands"] = Isis::toString(numberBands); label.write(matchLbl.toStdString()); // And run cam2cam to apply the transformation @@ -413,19 +413,19 @@ namespace Isis { QString oldName, QString spiceName, double constantCoeff, double multiplierCoeff, bool putMultiplierInX) { if(constantCoeff != 0 && !naifKeywordsObject && instrumentGroup) { - instrumentGroup->addKeyword(PvlKeyword(oldName.toStdString(), toString(constantCoeff))); + instrumentGroup->addKeyword(PvlKeyword(oldName.toStdString(), Isis::toString(constantCoeff))); } else if (naifKeywordsObject) { PvlKeyword spiceKeyword(spiceName.toStdString()); - spiceKeyword += toString(constantCoeff); + spiceKeyword += Isis::toString(constantCoeff); if (putMultiplierInX) { - spiceKeyword += toString(multiplierCoeff); - spiceKeyword += toString(0.0); + spiceKeyword += Isis::toString(multiplierCoeff); + spiceKeyword += Isis::toString(0.0); } else { - spiceKeyword += toString(0.0); - spiceKeyword += toString(multiplierCoeff); + spiceKeyword += Isis::toString(0.0); + spiceKeyword += Isis::toString(multiplierCoeff); } naifKeywordsObject->addKeyword(spiceKeyword, Pvl::Replace); diff --git a/isis/src/base/apps/overlapstats/overlapstats.cpp b/isis/src/base/apps/overlapstats/overlapstats.cpp index cf415b4ec2..6e21889d8d 100644 --- a/isis/src/base/apps/overlapstats/overlapstats.cpp +++ b/isis/src/base/apps/overlapstats/overlapstats.cpp @@ -218,25 +218,25 @@ namespace Isis { //Create and Log the BRIEF description PvlGroup brief("Results"); - brief += PvlKeyword("ThicknessMinimum", toString(thickness.Minimum())); - brief += PvlKeyword("ThicknessMaximum", toString(thickness.Maximum())); - brief += PvlKeyword("ThicknessAverage", toString(thickness.Average())); - brief += PvlKeyword("ThicknessStandardDeviation", toString(thickness.StandardDeviation())); - brief += PvlKeyword("ThicknessVariance", toString(thickness.Variance())); - - brief += PvlKeyword("AreaMinimum", toString(area.Minimum())); - brief += PvlKeyword("AreaMaximum", toString(area.Maximum())); - brief += PvlKeyword("AreaAverage", toString(area.Average())); - brief += PvlKeyword("AreaStandardDeviation", toString(area.StandardDeviation())); - brief += PvlKeyword("AreaVariance", toString(area.Variance())); - - brief += PvlKeyword("ImageStackMinimum", toString(sncount.Minimum())); - brief += PvlKeyword("ImageStackMaximum", toString(sncount.Maximum())); - brief += PvlKeyword("ImageStackAverage", toString(sncount.Average())); - brief += PvlKeyword("ImageStackStandardDeviation", toString(sncount.StandardDeviation())); - brief += PvlKeyword("ImageStackVariance", toString(sncount.Variance())); - - brief += PvlKeyword("PolygonCount", toString(overlaps.Size())); + brief += PvlKeyword("ThicknessMinimum", Isis::toString(thickness.Minimum())); + brief += PvlKeyword("ThicknessMaximum", Isis::toString(thickness.Maximum())); + brief += PvlKeyword("ThicknessAverage", Isis::toString(thickness.Average())); + brief += PvlKeyword("ThicknessStandardDeviation", Isis::toString(thickness.StandardDeviation())); + brief += PvlKeyword("ThicknessVariance", Isis::toString(thickness.Variance())); + + brief += PvlKeyword("AreaMinimum", Isis::toString(area.Minimum())); + brief += PvlKeyword("AreaMaximum", Isis::toString(area.Maximum())); + brief += PvlKeyword("AreaAverage", Isis::toString(area.Average())); + brief += PvlKeyword("AreaStandardDeviation", Isis::toString(area.StandardDeviation())); + brief += PvlKeyword("AreaVariance", Isis::toString(area.Variance())); + + brief += PvlKeyword("ImageStackMinimum", Isis::toString(sncount.Minimum())); + brief += PvlKeyword("ImageStackMaximum", Isis::toString(sncount.Maximum())); + brief += PvlKeyword("ImageStackAverage", Isis::toString(sncount.Average())); + brief += PvlKeyword("ImageStackStandardDeviation", Isis::toString(sncount.StandardDeviation())); + brief += PvlKeyword("ImageStackVariance", Isis::toString(sncount.Variance())); + + brief += PvlKeyword("PolygonCount", Isis::toString(overlaps.Size())); // Add non-overlapping cubes to the output if (!nooverlap.empty()) { @@ -259,7 +259,7 @@ namespace Isis { //Log error num in print.prt if there were errors if (errorNum > 0) { PvlGroup grp("OverlapStats"); - PvlKeyword key("ErrorNumber", toString(errorNum)); + PvlKeyword key("ErrorNumber", Isis::toString(errorNum)); grp.addKeyword(key); Application::AppendAndLog(grp, log); } diff --git a/isis/src/base/apps/pad/main.cpp b/isis/src/base/apps/pad/main.cpp index 3ffd41eea6..025a37d331 100644 --- a/isis/src/base/apps/pad/main.cpp +++ b/isis/src/base/apps/pad/main.cpp @@ -49,14 +49,14 @@ void IsisMain() { // Construct a label with the results PvlGroup results("Results"); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("LeftPad", toString(leftPad)); - results += PvlKeyword("RightPad", toString(rightPad)); - results += PvlKeyword("TopPad", toString(topPad)); - results += PvlKeyword("BottomPad", toString(bottomPad)); - results += PvlKeyword("OutputLines", toString(nl)); - results += PvlKeyword("OutputSamples", toString(ns)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("LeftPad", Isis::toString(leftPad)); + results += PvlKeyword("RightPad", Isis::toString(rightPad)); + results += PvlKeyword("TopPad", Isis::toString(topPad)); + results += PvlKeyword("BottomPad", Isis::toString(bottomPad)); + results += PvlKeyword("OutputLines", Isis::toString(nl)); + results += PvlKeyword("OutputSamples", Isis::toString(ns)); // Update the Mapping, Instrument, and AlphaCube groups in the // output cube label diff --git a/isis/src/base/apps/percent/main.cpp b/isis/src/base/apps/percent/main.cpp index 8c907ea958..c77ee98835 100644 --- a/isis/src/base/apps/percent/main.cpp +++ b/isis/src/base/apps/percent/main.cpp @@ -34,8 +34,8 @@ void IsisMain() { // Obtain the Histogram and the value at the percentage Histogram *hist = icube->histogram(); double value = hist->Percent(percentage); - kwPercent += toString(percentage); - kwValue += toString(value); + kwPercent += Isis::toString(percentage); + kwValue += Isis::toString(value); } results += kwPercent; results += kwValue; diff --git a/isis/src/base/apps/phoempglobal/main.cpp b/isis/src/base/apps/phoempglobal/main.cpp index 407347f82c..9c982d4a2e 100644 --- a/isis/src/base/apps/phoempglobal/main.cpp +++ b/isis/src/base/apps/phoempglobal/main.cpp @@ -247,16 +247,16 @@ void IsisMain() { if (!iord) { // Fit with no additive offset: output multiplier normalized to // zero phase, which is the desired phase curve B, and unnormalized - phaseAngle.addValue(toString(lFitParams.phase)); - limbValue.addValue(toString(rmsmin)); - phaseCurve.addValue(toString(c1/c1_0)); + phaseAngle.addValue(Isis::toString(lFitParams.phase)); + limbValue.addValue(Isis::toString(rmsmin)); + phaseCurve.addValue(Isis::toString(c1/c1_0)); } else { // Fit with additive offset: normalizing would make no sense, just // output additive offset and multiplier from fit - phaseAngle.addValue(toString(lFitParams.phase)); - limbValue.addValue(toString(rmsmin)); - phaseCurve.addValue(toString(c1)); + phaseAngle.addValue(Isis::toString(lFitParams.phase)); + limbValue.addValue(Isis::toString(rmsmin)); + phaseCurve.addValue(Isis::toString(c1)); } } diff --git a/isis/src/base/apps/phoemplocal/main.cpp b/isis/src/base/apps/phoemplocal/main.cpp index aef6c22608..8e97450554 100644 --- a/isis/src/base/apps/phoemplocal/main.cpp +++ b/isis/src/base/apps/phoemplocal/main.cpp @@ -293,10 +293,10 @@ void IsisMain() { os << "BEST_FIT_MULTIPLIER = " << lFitParams.c1 << endl; os << "RMS_ERROR_OF_FIT = " << parmin << endl; PvlGroup fitParams("Results"); - fitParams += PvlKeyword("PhaseAngle", toString(datum.m_phase), "degrees"); - fitParams += PvlKeyword("LimbDarkeningParameter", toString(xb)); - fitParams += PvlKeyword("BestFitMultiplier", toString(lFitParams.c1)); - fitParams += PvlKeyword("RMSErrorOfFit", toString(parmin)); + fitParams += PvlKeyword("PhaseAngle", Isis::toString(datum.m_phase), "degrees"); + fitParams += PvlKeyword("LimbDarkeningParameter", Isis::toString(xb)); + fitParams += PvlKeyword("BestFitMultiplier", Isis::toString(lFitParams.c1)); + fitParams += PvlKeyword("RMSErrorOfFit", Isis::toString(parmin)); Application::Log(fitParams); } else { @@ -305,11 +305,11 @@ void IsisMain() { os << "BEST_FIT_MULTIPLIER = " << lFitParams.c1 << endl; os << "RMS_ERROR_OF_FIT = " << parmin << endl; PvlGroup fitParams("Results"); - fitParams += PvlKeyword("PhaseAngle", toString(datum.m_phase), "degrees"); - fitParams += PvlKeyword("LimbDarkeningParameter", toString(xb)); - fitParams += PvlKeyword("BestFitAdditiveTerm", toString(lFitParams.c0)); - fitParams += PvlKeyword("BestFitMultiplier", toString(lFitParams.c1)); - fitParams += PvlKeyword("RMSErrorOfFit", toString(parmin)); + fitParams += PvlKeyword("PhaseAngle", Isis::toString(datum.m_phase), "degrees"); + fitParams += PvlKeyword("LimbDarkeningParameter", Isis::toString(xb)); + fitParams += PvlKeyword("BestFitAdditiveTerm", Isis::toString(lFitParams.c0)); + fitParams += PvlKeyword("BestFitMultiplier", Isis::toString(lFitParams.c1)); + fitParams += PvlKeyword("RMSErrorOfFit", Isis::toString(parmin)); Application::Log(fitParams); } diff --git a/isis/src/base/apps/phohillier/Hillier.cpp b/isis/src/base/apps/phohillier/Hillier.cpp index 612af76dc3..6502f10d9c 100644 --- a/isis/src/base/apps/phohillier/Hillier.cpp +++ b/isis/src/base/apps/phohillier/Hillier.cpp @@ -107,7 +107,7 @@ namespace Isis { double Hillier::photometry(double i, double e, double g, int band) const { // Test for valid band if((band <= 0) || (band > (int) _bandpho.size())) { - std::string mess = "Provided band " + toString(band) + " out of range."; + std::string mess = "Provided band " + Isis::toString(band) + " out of range."; throw IException(IException::Programmer, mess, _FILEINFO_); } double ph = photometry(_bandpho[band-1], i, e, g); @@ -170,9 +170,9 @@ namespace Isis { */ void Hillier::Report(PvlContainer &pvl) { pvl += PvlKeyword("Algorithm", "Hillier"); - pvl += PvlKeyword("IncRef", toString(_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(_gRef), "degrees"); + pvl += PvlKeyword("IncRef", Isis::toString(_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", Isis::toString(_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", Isis::toString(_gRef), "degrees"); PvlKeyword units("HillierUnits"); PvlKeyword phostd("PhotometricStandard"); PvlKeyword bbc("BandBinCenter"); @@ -188,17 +188,17 @@ namespace Isis { for(unsigned int i = 0 ; i < _bandpho.size() ; i++) { Parameters &p = _bandpho[i]; units.addValue(p.units.toStdString()); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); - b0.addValue(toString(p.b0)); - b1.addValue(toString(p.b1)); - a0.addValue(toString(p.a0)); - a1.addValue(toString(p.a1)); - a2.addValue(toString(p.a2)); - a3.addValue(toString(p.a3)); - a4.addValue(toString(p.a4)); + phostd.addValue(Isis::toString(p.phoStd)); + bbc.addValue(Isis::toString(p.wavelength)); + bbct.addValue(Isis::toString(p.tolerance)); + bbn.addValue(Isis::toString(p.band)); + b0.addValue(Isis::toString(p.b0)); + b1.addValue(Isis::toString(p.b1)); + a0.addValue(Isis::toString(p.a0)); + a1.addValue(Isis::toString(p.a1)); + a2.addValue(Isis::toString(p.a2)); + a3.addValue(Isis::toString(p.a3)); + a4.addValue(Isis::toString(p.a4)); } pvl += units; pvl += phostd; @@ -335,7 +335,7 @@ namespace Isis { PvlKeyword center = label->findGroup("BandBin", Pvl::Traverse)["Center"]; std::string errs(""); for(int i = 0; i < cube.bandCount() ; i++) { - Parameters parms = findParameters(IString::ToDouble(center[i])); + Parameters parms = findParameters(Isis::toDouble(center[i])); if(parms.IsValid()) { parms.band = i + 1; _camera->SetBand(i + 1); diff --git a/isis/src/base/apps/phohillier/Hillier.h b/isis/src/base/apps/phohillier/Hillier.h index fba9deca3a..354d884387 100644 --- a/isis/src/base/apps/phohillier/Hillier.h +++ b/isis/src/base/apps/phohillier/Hillier.h @@ -146,13 +146,13 @@ namespace Isis { return qValue; } else if constexpr (std::is_same_v) { try { - return IString::ToInteger(iValue); + return Isis::toInt(iValue); } catch (...) { return defval; } } else if constexpr (std::is_same_v) { try { - return IString::ToDouble(iValue); + return Isis::toDouble(iValue); } catch (...) { return defval; } diff --git a/isis/src/base/apps/photemplate/main.cpp b/isis/src/base/apps/photemplate/main.cpp index e832ab97ef..41c15f83a0 100644 --- a/isis/src/base/apps/photemplate/main.cpp +++ b/isis/src/base/apps/photemplate/main.cpp @@ -56,11 +56,11 @@ void OutputKeyValue(PvlKeyword & key, QString val){ key.clear(); int found = val.indexOf(","); while(found != -1) { - key += toString((val.mid(0, found)).toDouble()); + key += Isis::toString((val.mid(0, found)).toDouble()); val = val.mid(found+1); found = val.indexOf(","); } - key += toString((val).toDouble()); + key += Isis::toString((val).toDouble()); } // Helper function to load the input pvl file into the GUI diff --git a/isis/src/base/apps/pvldiff/main.cpp b/isis/src/base/apps/pvldiff/main.cpp index ce48ae15ab..87fb3b3eff 100644 --- a/isis/src/base/apps/pvldiff/main.cpp +++ b/isis/src/base/apps/pvldiff/main.cpp @@ -153,7 +153,7 @@ void compareKeywords(PvlKeyword &pvl1, PvlKeyword &pvl2) { double difference = abs(val1.toDouble() - val2.toDouble()); if ( tolerances.hasKeyword(pvl1.name()) ) { - tolerance = IString::ToDouble( + tolerance = Isis::toDouble( (tolerances[pvl1.name()].size() == 1) ? tolerances[pvl1.name()][0] : tolerances[pvl1.name()][i]); } diff --git a/isis/src/base/apps/remrx/main.cpp b/isis/src/base/apps/remrx/main.cpp index 366adc9594..6bcc8454de 100644 --- a/isis/src/base/apps/remrx/main.cpp +++ b/isis/src/base/apps/remrx/main.cpp @@ -73,9 +73,9 @@ void IsisMain() { Brick brick(sdim, ldim, 1, cube.pixelType()); for(int res = 0; res < numres; res++) { - if((resvalid == 0 || IString::ToInteger(valid[res]) == 1) && IString::ToInteger(type[res]) != 0) { - int baseSamp = (int)(IString::ToDouble(samps[res]) + 0.5) - (sdim / 2); - int baseLine = (int)(IString::ToDouble(lines[res]) + 0.5) - (ldim / 2); + if((resvalid == 0 || Isis::toInt(valid[res]) == 1) && Isis::toInt(type[res]) != 0) { + int baseSamp = (int)(Isis::toDouble(samps[res]) + 0.5) - (sdim / 2); + int baseLine = (int)(Isis::toDouble(lines[res]) + 0.5) - (ldim / 2); brick.SetBasePosition(baseSamp, baseLine, 1); cube.read(brick); if(action == "NULL") { @@ -99,7 +99,7 @@ void IsisMain() { double sdev = stats.StandardDeviation(); // Top Edge Reseau - if(IString::ToInteger(type[res]) == 2) { + if(Isis::toInt(type[res]) == 2) { int l1 = 0; int l2 = ldim - 1; for(int s = 0; s < sdim; s++) { @@ -107,7 +107,7 @@ void IsisMain() { } } // Left Edge Reseau - else if(IString::ToInteger(type[res]) == 4) { + else if(Isis::toInt(type[res]) == 4) { int s1 = 0; int s2 = sdim - 1; for(int l = 0; l < ldim; l++) { @@ -115,7 +115,7 @@ void IsisMain() { } } // Right Edge Reseau - else if(IString::ToInteger(type[res]) == 6) { + else if(Isis::toInt(type[res]) == 6) { int s1 = 0; int s2 = sdim - 1; for(int l = 0; l < ldim; l++) { @@ -123,7 +123,7 @@ void IsisMain() { } } // Bottom Edge Reseau - else if(IString::ToInteger(type[res]) == 8) { + else if(Isis::toInt(type[res]) == 8) { int l1 = 0; int l2 = ldim - 1; for(int s = 0; s < sdim; s++) { @@ -159,14 +159,14 @@ void IsisMain() { for(int l = 0; l < ldim; l++) { int c = l * sdim; //count // Top Edge Reseau - if(IString::ToInteger(type[res]) == 2 && l < (ldim / 2)) continue; + if(Isis::toInt(type[res]) == 2 && l < (ldim / 2)) continue; // Bottom Edge Reseau - if(IString::ToInteger(type[res]) == 8 && l > (ldim / 2 + 1)) continue; + if(Isis::toInt(type[res]) == 8 && l > (ldim / 2 + 1)) continue; for(int s = 0; s < sdim; s++, c++) { // Left Edge Reseau - if(IString::ToInteger(type[res]) == 4 && s < (sdim / 2)) continue; + if(Isis::toInt(type[res]) == 4 && s < (sdim / 2)) continue; // Right Edge Reseau - if(IString::ToInteger(type[res]) == 6 && s > (sdim / 2 + 1)) continue; + if(Isis::toInt(type[res]) == 6 && s > (sdim / 2 + 1)) continue; double sum = 0.0; int gline1 = 0; int gline2 = ldim - 1; diff --git a/isis/src/base/apps/ringscam2map/main.cpp b/isis/src/base/apps/ringscam2map/main.cpp index eb1637ef4c..31c6160753 100644 --- a/isis/src/base/apps/ringscam2map/main.cpp +++ b/isis/src/base/apps/ringscam2map/main.cpp @@ -67,10 +67,10 @@ void IsisMain() { // Make the target info match the user mapfile double minrad, maxrad, minaz, maxaz; incam->ringRange(minrad, maxrad, minaz, maxaz, userMap); - camGrp.addKeyword(PvlKeyword("MinimumRingRadius", toString(minrad)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MaximumRingRadius", toString(maxrad)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MinimumRingLongitude", toString(minaz)), Pvl::Replace); - camGrp.addKeyword(PvlKeyword("MaximumRingLongitude", toString(maxaz)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MinimumRingRadius", Isis::toString(minrad)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MaximumRingRadius", Isis::toString(maxrad)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MinimumRingLongitude", Isis::toString(minaz)), Pvl::Replace); + camGrp.addKeyword(PvlKeyword("MaximumRingLongitude", Isis::toString(maxaz)), Pvl::Replace); // We want to delete the keywords we just added if the user wants the range // out of the mapfile, otherwise they will replace any keywords not in the @@ -101,22 +101,22 @@ void IsisMain() { // If the user decided to enter a ground range then override if(ui.WasEntered("MINRINGLON")) { userGrp.addKeyword(PvlKeyword("MinimumRingLongitude", - toString(ui.GetDouble("MINRINGLON"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MINRINGLON"))), Pvl::Replace); } if(ui.WasEntered("MAXRINGLON")) { userGrp.addKeyword(PvlKeyword("MaximumRingLongitude", - toString(ui.GetDouble("MAXRINGLON"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MAXRINGLON"))), Pvl::Replace); } if(ui.WasEntered("MINRINGRAD")) { userGrp.addKeyword(PvlKeyword("MinimumRingRadius", - toString(ui.GetDouble("MINRINGRAD"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MINRINGRAD"))), Pvl::Replace); } if(ui.WasEntered("MAXRINGRAD")) { userGrp.addKeyword(PvlKeyword("MaximumRingRadius", - toString(ui.GetDouble("MAXRINGRAD"))), Pvl::Replace); + Isis::toString(ui.GetDouble("MAXRINGRAD"))), Pvl::Replace); } // If they want the res. from the mapfile, delete it from the camera so @@ -146,7 +146,7 @@ void IsisMain() { if (!ui.GetBoolean("MATCHMAP")) { if(ui.GetString("PIXRES") == "MPP") { userGrp.addKeyword(PvlKeyword("PixelResolution", - toString(ui.GetDouble("RESOLUTION"))), + Isis::toString(ui.GetDouble("RESOLUTION"))), Pvl::Replace); if(userGrp.hasKeyword("Scale")) { userGrp.deleteKeyword("Scale"); @@ -154,7 +154,7 @@ void IsisMain() { } else if(ui.GetString("PIXRES") == "PPD") { userGrp.addKeyword(PvlKeyword("Scale", - toString(ui.GetDouble("RESOLUTION"))), + Isis::toString(ui.GetDouble("RESOLUTION"))), Pvl::Replace); if(userGrp.hasKeyword("PixelResolution")) { userGrp.deleteKeyword("PixelResolution"); @@ -196,16 +196,16 @@ void IsisMain() { double minrad, maxrad, minaz, maxaz; incam->ringRange(minrad, maxrad, minaz, maxaz, userMap); if(!ui.WasEntered("MINRINGRAD")) { - userGrp.addKeyword(PvlKeyword("MinimumRingRadius", toString(minrad)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumRingRadius", Isis::toString(minrad)), Pvl::Replace); } if(!ui.WasEntered("MAXRINGRAD")) { - userGrp.addKeyword(PvlKeyword("MaximumRingRadius", toString(maxrad)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumRingRadius", Isis::toString(maxrad)), Pvl::Replace); } if(!ui.WasEntered("MINRINGLON")) { - userGrp.addKeyword(PvlKeyword("MinimumRingLongitude", toString(minaz)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumRingLongitude", Isis::toString(minaz)), Pvl::Replace); } if(!ui.WasEntered("MAXRINGLON")) { - userGrp.addKeyword(PvlKeyword("MaximumRingLongitude", toString(maxaz)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumRingLongitude", Isis::toString(maxaz)), Pvl::Replace); } } else if(ui.GetString("RINGLONSEAM") == "ERROR") { @@ -281,14 +281,14 @@ void IsisMain() { // Create an alpha cube group for the output cube if(!ocube->hasGroup("AlphaCube")) { PvlGroup alpha("AlphaCube"); - alpha += PvlKeyword("AlphaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("AlphaLines", toString(icube->lineCount())); - alpha += PvlKeyword("AlphaStartingSample", toString(0.5)); - alpha += PvlKeyword("AlphaStartingLine", toString(0.5)); - alpha += PvlKeyword("AlphaEndingSample", toString(icube->sampleCount() + 0.5)); - alpha += PvlKeyword("AlphaEndingLine", toString(icube->lineCount() + 0.5)); - alpha += PvlKeyword("BetaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("BetaLines", toString(icube->lineCount())); + alpha += PvlKeyword("AlphaSamples", Isis::toString(icube->sampleCount())); + alpha += PvlKeyword("AlphaLines", Isis::toString(icube->lineCount())); + alpha += PvlKeyword("AlphaStartingSample", Isis::toString(0.5)); + alpha += PvlKeyword("AlphaStartingLine", Isis::toString(0.5)); + alpha += PvlKeyword("AlphaEndingSample", Isis::toString(icube->sampleCount() + 0.5)); + alpha += PvlKeyword("AlphaEndingLine", Isis::toString(icube->lineCount() + 0.5)); + alpha += PvlKeyword("BetaSamples", Isis::toString(icube->sampleCount())); + alpha += PvlKeyword("BetaLines", Isis::toString(icube->lineCount())); ocube->putGroup(alpha); } diff --git a/isis/src/base/apps/ringsmappt/main.cpp b/isis/src/base/apps/ringsmappt/main.cpp index cfe5f9de77..e6d9dae22d 100644 --- a/isis/src/base/apps/ringsmappt/main.cpp +++ b/isis/src/base/apps/ringsmappt/main.cpp @@ -131,30 +131,30 @@ void IsisMain() { PvlGroup results("Results"); results += PvlKeyword("Filename", FileName(ui.GetCubeName("FROM").toStdString()).expanded()); - results += PvlKeyword("Sample", toString(proj->WorldX())); - results += PvlKeyword("Line", toString(proj->WorldY())); + results += PvlKeyword("Sample", Isis::toString(proj->WorldX())); + results += PvlKeyword("Line", Isis::toString(proj->WorldY())); results += PvlKeyword("PixelValue", PixelToString(b[0])); - results += PvlKeyword("X", toString(proj->XCoord())); - results += PvlKeyword("Y", toString(proj->YCoord())); + results += PvlKeyword("X", Isis::toString(proj->XCoord())); + results += PvlKeyword("Y", Isis::toString(proj->YCoord())); // Put together all the keywords for different coordinate systems. PvlKeyword ringRad = - PvlKeyword("RingRadius", toString(proj->UniversalRingRadius())); + PvlKeyword("RingRadius", Isis::toString(proj->UniversalRingRadius())); PvlKeyword cC360 = - PvlKeyword("CounterClockwise360RingLongitude", toString(proj->UniversalRingLongitude())); + PvlKeyword("CounterClockwise360RingLongitude", Isis::toString(proj->UniversalRingLongitude())); PvlKeyword c360 = PvlKeyword("Clockwise360RingLongitude", - toString(proj->ToClockwise(proj->UniversalRingLongitude(), 360))); + Isis::toString(proj->ToClockwise(proj->UniversalRingLongitude(), 360))); PvlKeyword cC180 = PvlKeyword("CounterClockwise180RingLongitude", - toString(proj->To180Domain(proj->UniversalRingLongitude()))); + Isis::toString(proj->To180Domain(proj->UniversalRingLongitude()))); PvlKeyword c180 = PvlKeyword("Clockwise180RingLongitude", - toString(proj->To180Domain(proj->ToCounterClockwise( + Isis::toString(proj->To180Domain(proj->ToCounterClockwise( proj->UniversalRingLongitude(), 360)))); // Input map coordinate system location diff --git a/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp b/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp index f75925e02c..b504dad859 100644 --- a/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp +++ b/isis/src/base/apps/ringspt/CameraRingsPointInfo.cpp @@ -150,9 +150,9 @@ namespace Isis { // Set all keywords that still have valid information gp->findKeyword("Error").setValue(error); gp->findKeyword("FileName").setValue(cube()->fileName().toStdString()); - gp->findKeyword("Sample").setValue(toString(camera()->Sample())); - gp->findKeyword("Line").setValue(toString(camera()->Line())); - gp->findKeyword("EphemerisTime").setValue(toString(camera()->time().Et()), "seconds"); + gp->findKeyword("Sample").setValue(Isis::toString(camera()->Sample())); + gp->findKeyword("Line").setValue(Isis::toString(camera()->Line())); + gp->findKeyword("EphemerisTime").setValue(Isis::toString(camera()->time().Et()), "seconds"); gp->findKeyword("EphemerisTime").addComment("Time"); QString utc = camera()->time().UTC(); gp->findKeyword("UTC").setValue(utc.toStdString()); @@ -177,12 +177,12 @@ namespace Isis { { gp->findKeyword("FileName").setValue(cube()->fileName().toStdString()); - gp->findKeyword("Sample").setValue(toString(camera()->Sample())); - gp->findKeyword("Line").setValue(toString(camera()->Line())); + gp->findKeyword("Sample").setValue(Isis::toString(camera()->Sample())); + gp->findKeyword("Line").setValue(Isis::toString(camera()->Line())); gp->findKeyword("PixelValue").setValue(PixelToString(b[0])); - gp->findKeyword("RightAscension").setValue(toString(camera()->RightAscension())); - gp->findKeyword("Declination").setValue(toString(camera()->Declination())); - // gp->findKeyword("PlanetocentricLatitude").setValue(toString( + gp->findKeyword("RightAscension").setValue(Isis::toString(camera()->RightAscension())); + gp->findKeyword("Declination").setValue(Isis::toString(camera()->Declination())); + // gp->findKeyword("PlanetocentricLatitude").setValue(Isis::toString( // camera()->UniversalLatitude())); // Convert lat to planetographic @@ -190,114 +190,114 @@ namespace Isis { // camera()->radii(radii); // oglat = Isis::TProjection::ToPlanetographic(camera()->UniversalLatitude(), // radii[0].kilometers(), radii[2].kilometers()); - // gp->findKeyword("PlanetographicLatitude").setValue(toString(oglat)); + // gp->findKeyword("PlanetographicLatitude").setValue(Isis::toString(oglat)); - gp->findKeyword("CounterClockwise360RingLongitude").setValue(toString( + gp->findKeyword("CounterClockwise360RingLongitude").setValue(Isis::toString( camera()->UniversalLongitude())); - // gp->findKeyword("PositiveEast360Longitude").setValue(toString( + // gp->findKeyword("PositiveEast360Longitude").setValue(Isis::toString( // camera()->UniversalLongitude())); //Convert lon to -180 - 180 range - gp->findKeyword("CounterClockwise180RingLongitude").setValue(toString( + gp->findKeyword("CounterClockwise180RingLongitude").setValue(Isis::toString( RingPlaneProjection::To180Domain( camera()->UniversalLongitude()))); - // gp->findKeyword("PositiveEast180Longitude").setValue(toString( + // gp->findKeyword("PositiveEast180Longitude").setValue(Isis::toString( // Isis::TProjection::To180Domain( // camera()->UniversalLongitude()))); //Convert ring longitude (az) to clockwise cwaz = Isis::RingPlaneProjection::ToClockwise(camera()->UniversalLongitude(), 360); - gp->findKeyword("Clockwise360RingLongitude").setValue(toString(cwaz)); + gp->findKeyword("Clockwise360RingLongitude").setValue(Isis::toString(cwaz)); //Convert lon to positive west // pwlon = Isis::TProjection::ToPositiveWest(camera()->UniversalLongitude(), // 360); - // gp->findKeyword("PositiveWest360Longitude").setValue(toString(pwlon)); + // gp->findKeyword("PositiveWest360Longitude").setValue(Isis::toString(pwlon)); //Convert cwaz to -180 - 180 range - gp->findKeyword("Clockwise180RingLongitude").setValue(toString( + gp->findKeyword("Clockwise180RingLongitude").setValue(Isis::toString( Isis::RingPlaneProjection::To180Domain(cwaz))); //Convert pwlon to -180 - 180 range - // gp->findKeyword("PositiveWest180Longitude").setValue(toString( + // gp->findKeyword("PositiveWest180Longitude").setValue(Isis::toString( // Isis::TProjection::To180Domain(pwlon))); camera()->Coordinate(pB); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[0]), "km"); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[1]), "km"); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[2]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(Isis::toString(pB[0]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(Isis::toString(pB[1]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(Isis::toString(pB[2]), "km"); - gp->findKeyword("LocalRingRadius").setValue(toString( + gp->findKeyword("LocalRingRadius").setValue(Isis::toString( camera()->LocalRadius().meters()), "meters"); - gp->findKeyword("SampleResolution").setValue(toString( + gp->findKeyword("SampleResolution").setValue(Isis::toString( camera()->SampleResolution()), "meters/pixel"); - gp->findKeyword("LineResolution").setValue(toString( + gp->findKeyword("LineResolution").setValue(Isis::toString( camera()->LineResolution()), "meters/pixel"); //body fixed camera()->instrumentPosition(spB); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[1]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[2]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[0]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[1]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[2]), "km"); gp->findKeyword("SpacecraftPosition").addComment("Spacecraft Information"); // if IsValid if (Isis::IsValidPixel(camera()->SpacecraftAzimuth())) { double spacecraftAzi = camera()->SpacecraftAzimuth(); - gp->findKeyword("SpacecraftAzimuth").setValue(toString(spacecraftAzi)); + gp->findKeyword("SpacecraftAzimuth").setValue(Isis::toString(spacecraftAzi)); } else { gp->findKeyword("SpacecraftAzimuth").setValue("NULL"); } - gp->findKeyword("SlantDistance").setValue(toString(camera()->SlantDistance()), "km"); - gp->findKeyword("TargetCenterDistance").setValue(toString( + gp->findKeyword("SlantDistance").setValue(Isis::toString(camera()->SlantDistance()), "km"); + gp->findKeyword("TargetCenterDistance").setValue(Isis::toString( camera()->targetCenterDistance()), "km"); camera()->subSpacecraftPoint(ssplat, ssplon); - gp->findKeyword("SubSpacecraftLatitude").setValue(toString(ssplat)); - gp->findKeyword("SubSpacecraftLongitude").setValue(toString(ssplon)); - gp->findKeyword("SpacecraftAltitude").setValue(toString( + gp->findKeyword("SubSpacecraftLatitude").setValue(Isis::toString(ssplat)); + gp->findKeyword("SubSpacecraftLongitude").setValue(Isis::toString(ssplon)); + gp->findKeyword("SpacecraftAltitude").setValue(Isis::toString( camera()->SpacecraftAltitude()), "km"); - gp->findKeyword("OffNadirAngle").setValue(toString(camera()->OffNadirAngle())); + gp->findKeyword("OffNadirAngle").setValue(Isis::toString(camera()->OffNadirAngle())); double subspcgrdaz = camera()->GroundAzimuth(camera()->UniversalLatitude(), camera()->UniversalLongitude(), ssplat, ssplon); - gp->findKeyword("SubSpacecraftGroundAzimuth").setValue(toString(subspcgrdaz)); + gp->findKeyword("SubSpacecraftGroundAzimuth").setValue(Isis::toString(subspcgrdaz)); camera()->sunPosition(sB); - gp->findKeyword("SunPosition").addValue(toString(sB[0]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[1]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[2]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[0]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[1]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[2]), "km"); gp->findKeyword("SunPosition").addComment("Sun Information"); if (Isis::IsValidPixel(camera()->SunAzimuth())) { double sunAzi = camera()->SunAzimuth(); - gp->findKeyword("SubSolarAzimuth").setValue(toString(sunAzi)); + gp->findKeyword("SubSolarAzimuth").setValue(Isis::toString(sunAzi)); } else { gp->findKeyword("SubSolarAzimuth").setValue("NULL"); } - gp->findKeyword("SolarDistance").setValue(toString(camera()->SolarDistance()), "AU"); + gp->findKeyword("SolarDistance").setValue(Isis::toString(camera()->SolarDistance()), "AU"); camera()->subSolarPoint(sslat, sslon); - gp->findKeyword("SubSolarLatitude").setValue(toString(sslat)); - gp->findKeyword("SubSolarLongitude").setValue(toString(sslon)); + gp->findKeyword("SubSolarLatitude").setValue(Isis::toString(sslat)); + gp->findKeyword("SubSolarLongitude").setValue(Isis::toString(sslon)); double subsolgrdaz; subsolgrdaz = camera()->GroundAzimuth(camera()->UniversalLatitude(), camera()->UniversalLongitude(), sslat, sslon); - gp->findKeyword("SubSolarGroundAzimuth").setValue(toString(subsolgrdaz)); + gp->findKeyword("SubSolarGroundAzimuth").setValue(Isis::toString(subsolgrdaz)); - gp->findKeyword("Phase").setValue(toString(camera()->PhaseAngle())); + gp->findKeyword("Phase").setValue(Isis::toString(camera()->PhaseAngle())); gp->findKeyword("Phase").addComment("Illumination and Other"); - gp->findKeyword("Incidence").setValue(toString(camera()->IncidenceAngle())); - gp->findKeyword("Emission").setValue(toString(camera()->EmissionAngle())); + gp->findKeyword("Incidence").setValue(Isis::toString(camera()->IncidenceAngle())); + gp->findKeyword("Emission").setValue(Isis::toString(camera()->EmissionAngle())); - gp->findKeyword("EphemerisTime").setValue(toString(camera()->time().Et()), "seconds"); + gp->findKeyword("EphemerisTime").setValue(Isis::toString(camera()->time().Et()), "seconds"); gp->findKeyword("EphemerisTime").addComment("Time"); utc = camera()->time().UTC(); gp->findKeyword("UTC").setValue(utc.toStdString()); - gp->findKeyword("LocalSolarTime").setValue(toString(camera()->LocalSolarTime()), "hour"); - gp->findKeyword("SolarLongitude").setValue(toString(camera()->solarLongitude().degrees())); + gp->findKeyword("LocalSolarTime").setValue(Isis::toString(camera()->LocalSolarTime()), "hour"); + gp->findKeyword("SolarLongitude").setValue(Isis::toString(camera()->solarLongitude().degrees())); if (allowErrors) gp->findKeyword("Error").setValue("NULL"); } } diff --git a/isis/src/base/apps/shadow/ShadowFunctor.cpp b/isis/src/base/apps/shadow/ShadowFunctor.cpp index b3360dc354..97a5e62e40 100644 --- a/isis/src/base/apps/shadow/ShadowFunctor.cpp +++ b/isis/src/base/apps/shadow/ShadowFunctor.cpp @@ -134,49 +134,49 @@ namespace Isis { PvlGroup shadowStats("ShadowStatistics"); shadowStats += PvlKeyword("NumComputedAzimuthElevations", - toString(m_azimuthStats->ValidPixels())); + Isis::toString(m_azimuthStats->ValidPixels())); if (m_azimuthStats->ValidPixels() > 0) { PvlKeyword averageAzimuth("AverageAzimuth", - toString(m_azimuthStats->Average())); + Isis::toString(m_azimuthStats->Average())); averageAzimuth.addCommentWrapped("The azimuth is measured from three o'clock, going " "clockwise, in degrees"); shadowStats += averageAzimuth; - shadowStats += PvlKeyword("MinimumAzimuth", toString(m_azimuthStats->Minimum())); - shadowStats += PvlKeyword("MaximumAzimuth", toString(m_azimuthStats->Maximum())); + shadowStats += PvlKeyword("MinimumAzimuth", Isis::toString(m_azimuthStats->Minimum())); + shadowStats += PvlKeyword("MaximumAzimuth", Isis::toString(m_azimuthStats->Maximum())); - PvlKeyword averageElevation("AverageElevation", toString(m_elevationStats->Average())); + PvlKeyword averageElevation("AverageElevation", Isis::toString(m_elevationStats->Average())); averageElevation.addCommentWrapped("The elevation is measured from the normal, with directly " "overhead being 0 degrees and the horizon 90 degrees. Elevations are prevented from " "going below the horizon."); shadowStats += averageElevation; - shadowStats += PvlKeyword("MinimumElevation", toString(m_elevationStats->Minimum())); - shadowStats += PvlKeyword("MaximumElevation", toString(m_elevationStats->Maximum())); + shadowStats += PvlKeyword("MinimumElevation", Isis::toString(m_elevationStats->Minimum())); + shadowStats += PvlKeyword("MaximumElevation", Isis::toString(m_elevationStats->Maximum())); } - PvlKeyword numRays("NumRays", toString(m_rayLengthStats->ValidPixels())); + PvlKeyword numRays("NumRays", Isis::toString(m_rayLengthStats->ValidPixels())); numRays.addCommentWrapped("This is the total number of rays traced from the surface towards " "the sun in order to detect if any given pixel is in shadow"); shadowStats += numRays; shadowStats += PvlKeyword("NumRayDemIntersections", - toString(qRound(m_rayLengthStats->Sum()))); + Isis::toString(qRound(m_rayLengthStats->Sum()))); if (m_rayLengthStats->ValidPixels() > 0) { shadowStats += PvlKeyword("AverageRayDemIntersectionsPerRay", - toString(m_rayLengthStats->Average())); + Isis::toString(m_rayLengthStats->Average())); } shadowStats += PvlKeyword("NumLightedPixels", - toString(qRound((1.0 - m_shadowedStats->Average()) * m_shadowedStats->ValidPixels()))); + Isis::toString(qRound((1.0 - m_shadowedStats->Average()) * m_shadowedStats->ValidPixels()))); shadowStats += PvlKeyword("NumShadowedPixels", - toString(qRound(m_shadowedStats->Average() * m_shadowedStats->ValidPixels()))); + Isis::toString(qRound(m_shadowedStats->Average() * m_shadowedStats->ValidPixels()))); shadowStats += PvlKeyword("NumSpecialPixels", - toString(m_shadowedStats->TotalPixels() - m_shadowedStats->ValidPixels())); + Isis::toString(m_shadowedStats->TotalPixels() - m_shadowedStats->ValidPixels())); shadowStats += PvlKeyword("NumPixelsShadowedByRays", - toString(qRound(m_shadowedByRayStats->Sum()))); + Isis::toString(qRound(m_shadowedByRayStats->Sum()))); return shadowStats; } diff --git a/isis/src/base/apps/shadowtau/main.cpp b/isis/src/base/apps/shadowtau/main.cpp index 8b79635447..9b6cada969 100644 --- a/isis/src/base/apps/shadowtau/main.cpp +++ b/isis/src/base/apps/shadowtau/main.cpp @@ -94,25 +94,25 @@ void IsisMain() { QString keyval = ui.GetString("WH"); double wh = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("WH",toString(wh)),Pvl::Replace); + addKeyword(PvlKeyword("WH",Isis::toString(wh)),Pvl::Replace); } if (ui.WasEntered("HH")) { QString keyval = ui.GetString("HH"); double hh = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HH",toString(hh)),Pvl::Replace); + addKeyword(PvlKeyword("HH",Isis::toString(hh)),Pvl::Replace); } if (ui.WasEntered("B0")) { QString keyval = ui.GetString("B0"); double b0 = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("B0",toString(b0)),Pvl::Replace); + addKeyword(PvlKeyword("B0",Isis::toString(b0)),Pvl::Replace); } if (ui.WasEntered("THETA")) { QString keyval = ui.GetString("THETA"); double theta = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("THETA",toString(theta)),Pvl::Replace); + addKeyword(PvlKeyword("THETA",Isis::toString(theta)),Pvl::Replace); } if (ui.WasEntered("ZEROB0STANDARD")) { QString keyval = ui.GetString("ZEROB0STANDARD"); @@ -125,13 +125,13 @@ void IsisMain() { QString keyval = ui.GetString("HG1"); double hg1 = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HG1",toString(hg1)),Pvl::Replace); + addKeyword(PvlKeyword("HG1",Isis::toString(hg1)),Pvl::Replace); } if (ui.WasEntered("HG2")) { QString keyval = ui.GetString("HG2"); double hg2 = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HG2",toString(hg2)),Pvl::Replace); + addKeyword(PvlKeyword("HG2",Isis::toString(hg2)),Pvl::Replace); } } else { @@ -139,13 +139,13 @@ void IsisMain() { QString keyval = ui.GetString("BH"); double bh = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("BH",toString(bh)),Pvl::Replace); + addKeyword(PvlKeyword("BH",Isis::toString(bh)),Pvl::Replace); } if (ui.WasEntered("CH")) { QString keyval = ui.GetString("CH"); double ch = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("CH",toString(ch)),Pvl::Replace); + addKeyword(PvlKeyword("CH",Isis::toString(ch)),Pvl::Replace); } } } @@ -154,7 +154,7 @@ void IsisMain() { QString keyval = ui.GetString("L"); double l = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("L",toString(l)),Pvl::Replace); + addKeyword(PvlKeyword("L",Isis::toString(l)),Pvl::Replace); } } else if (sPhotoFunc == "MINNAERT") { @@ -162,7 +162,7 @@ void IsisMain() { QString keyval = ui.GetString("K"); double k = keyval.toDouble(); photoPvl.findObject("PhotometricModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("K",toString(k)),Pvl::Replace); + addKeyword(PvlKeyword("K",Isis::toString(k)),Pvl::Replace); } } @@ -193,13 +193,13 @@ void IsisMain() { QString keyval = ui.GetString("WHA"); double wha = keyval.toDouble(); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("WHA",toString(wha)),Pvl::Replace); + addKeyword(PvlKeyword("WHA",Isis::toString(wha)),Pvl::Replace); } if (ui.WasEntered("HNORM")) { QString keyval = ui.GetString("HNORM"); double hnorm = keyval.toDouble(); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HNORM",toString(hnorm)),Pvl::Replace); + addKeyword(PvlKeyword("HNORM",Isis::toString(hnorm)),Pvl::Replace); } if (sAsmType=="ANISOTROPIC1" || sAsmType=="ANISOTROPIC2" ){ @@ -207,7 +207,7 @@ void IsisMain() { QString keyval = ui.GetString("BHA"); double bha = keyval.toDouble(); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("BHA",toString(bha)),Pvl::Replace); + addKeyword(PvlKeyword("BHA",Isis::toString(bha)),Pvl::Replace); } } else if (sAsmType=="HAPKEATM1" || sAsmType=="HAPKEATM2" ) { @@ -215,7 +215,7 @@ void IsisMain() { QString keyval = ui.GetString("HGA"); double hga = keyval.toDouble(); asmPvl.findObject("AtmosphericModel").findGroup("Algorithm"). - addKeyword(PvlKeyword("HGA",toString(hga)),Pvl::Replace); + addKeyword(PvlKeyword("HGA",Isis::toString(hga)),Pvl::Replace); } } diff --git a/isis/src/base/apps/skymap/main.cpp b/isis/src/base/apps/skymap/main.cpp index 39ed118ae5..7e78d7d6e8 100644 --- a/isis/src/base/apps/skymap/main.cpp +++ b/isis/src/base/apps/skymap/main.cpp @@ -85,8 +85,8 @@ void IsisMain() { // Add the default mapping info to the user entered mapping group userGrp.addKeyword(PvlKeyword("TargetName", "Sky"), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("EquatorialRadius", toString(1.0)), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("PolarRadius", toString(1.0)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("EquatorialRadius", Isis::toString(1.0)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("PolarRadius", Isis::toString(1.0)), Pvl::Replace); userGrp.addKeyword(PvlKeyword("LatitudeType", "Planetocentric"), Pvl::Replace); if (!userGrp.hasKeyword("LongitudeDirection")) { userGrp.addKeyword(PvlKeyword("LongitudeDirection", "PositiveWest"), Pvl::Replace); @@ -100,36 +100,36 @@ void IsisMain() { // Get the default ra/dec range double minRa, maxRa, minDec, maxDec; incam->RaDecRange(minRa, maxRa, minDec, maxDec); - userGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(minRa)), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(maxRa)), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(minDec)), Pvl::Replace); - userGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(maxDec)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(minRa)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(maxRa)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(minDec)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(maxDec)), Pvl::Replace); incam->SetImage(icube->sampleCount() / 2.0, icube->lineCount() / 2.0); double centerRa = incam->RightAscension(); - userGrp.addKeyword(PvlKeyword("CenterLongitude", toString(centerRa)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("CenterLongitude", Isis::toString(centerRa)), Pvl::Replace); } if(ui.GetString("DEFAULTSCALE") == "CAMERA") { double res = incam->RaDecResolution(); - userGrp.addKeyword(PvlKeyword("Scale", toString(1.0 / res)), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("Scale", Isis::toString(1.0 / res)), Pvl::Replace); } // Override computed range with the users request if(ui.WasEntered("SRA")) { - userGrp.addKeyword(PvlKeyword("MinimumLongitude", toString(ui.GetDouble("SRA"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(ui.GetDouble("SRA"))), Pvl::Replace); } if(ui.WasEntered("ERA")) { - userGrp.addKeyword(PvlKeyword("MaximumLongitude", toString(ui.GetDouble("ERA"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(ui.GetDouble("ERA"))), Pvl::Replace); } if(ui.WasEntered("SDEC")) { - userGrp.addKeyword(PvlKeyword("MinimumLatitude", toString(ui.GetDouble("SDEC"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(ui.GetDouble("SDEC"))), Pvl::Replace); } if(ui.WasEntered("EDEC")) { - userGrp.addKeyword(PvlKeyword("MaximumLatitude", toString(ui.GetDouble("EDEC"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(ui.GetDouble("EDEC"))), Pvl::Replace); } // Get the resolution from the user if they decided to enter it if(ui.GetString("DEFAULTSCALE") == "USER") { - userGrp.addKeyword(PvlKeyword("Scale", toString(ui.GetDouble("SCALE"))), Pvl::Replace); + userGrp.addKeyword(PvlKeyword("Scale", Isis::toString(ui.GetDouble("SCALE"))), Pvl::Replace); } // Create the projection @@ -183,14 +183,14 @@ void IsisMain() { // Create an alpha cube group for the output cube if(!ocube->hasGroup("AlphaCube")) { PvlGroup alpha("AlphaCube"); - alpha += PvlKeyword("AlphaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("AlphaLines", toString(icube->lineCount())); - alpha += PvlKeyword("AlphaStartingSample", toString(0.5)); - alpha += PvlKeyword("AlphaStartingLine", toString(0.5)); - alpha += PvlKeyword("AlphaEndingSample", toString(icube->sampleCount() + 0.5)); - alpha += PvlKeyword("AlphaEndingLine", toString(icube->lineCount() + 0.5)); - alpha += PvlKeyword("BetaSamples", toString(icube->sampleCount())); - alpha += PvlKeyword("BetaLines", toString(icube->lineCount())); + alpha += PvlKeyword("AlphaSamples", Isis::toString(icube->sampleCount())); + alpha += PvlKeyword("AlphaLines", Isis::toString(icube->lineCount())); + alpha += PvlKeyword("AlphaStartingSample", Isis::toString(0.5)); + alpha += PvlKeyword("AlphaStartingLine", Isis::toString(0.5)); + alpha += PvlKeyword("AlphaEndingSample", Isis::toString(icube->sampleCount() + 0.5)); + alpha += PvlKeyword("AlphaEndingLine", Isis::toString(icube->lineCount() + 0.5)); + alpha += PvlKeyword("BetaSamples", Isis::toString(icube->sampleCount())); + alpha += PvlKeyword("BetaLines", Isis::toString(icube->lineCount())); ocube->putGroup(alpha); } diff --git a/isis/src/base/apps/skypt/skypt.cpp b/isis/src/base/apps/skypt/skypt.cpp index 3015a914c6..35ab6e32d2 100644 --- a/isis/src/base/apps/skypt/skypt.cpp +++ b/isis/src/base/apps/skypt/skypt.cpp @@ -76,13 +76,13 @@ namespace Isis{ PvlGroup sp("SkyPoint"); { sp += PvlKeyword("Filename", FileName(channel.toStdString()).expanded()); - sp += PvlKeyword("Sample", toString(cam->Sample())); - sp += PvlKeyword("Line", toString(cam->Line())); - sp += PvlKeyword("RightAscension", toString(cam->RightAscension())); - sp += PvlKeyword("Declination", toString(cam->Declination())); - sp += PvlKeyword("EphemerisTime", toString(cam->time().Et())); + sp += PvlKeyword("Sample", Isis::toString(cam->Sample())); + sp += PvlKeyword("Line", Isis::toString(cam->Line())); + sp += PvlKeyword("RightAscension", Isis::toString(cam->RightAscension())); + sp += PvlKeyword("Declination", Isis::toString(cam->Declination())); + sp += PvlKeyword("EphemerisTime", Isis::toString(cam->time().Et())); sp += PvlKeyword("PixelValue", PixelToString(b[0])); - sp += PvlKeyword("CelestialNorthClockAngle", toString(rot), "degrees"); + sp += PvlKeyword("CelestialNorthClockAngle", Isis::toString(rot), "degrees"); } //Write the group to the screen diff --git a/isis/src/base/apps/skyrange/main.cpp b/isis/src/base/apps/skyrange/main.cpp index 246b21d62b..2facacf247 100644 --- a/isis/src/base/apps/skyrange/main.cpp +++ b/isis/src/base/apps/skyrange/main.cpp @@ -29,25 +29,25 @@ void IsisMain() { // Setup and log results PvlGroup results("Range"); - results += PvlKeyword("MinimumRightAscension", toString(minRa), "degrees"); - results += PvlKeyword("MaximumRightAscension", toString(maxRa), "degrees"); - results += PvlKeyword("MinimumDeclination", toString(minDec), "degrees"); - results += PvlKeyword("MaximumDeclination", toString(maxDec), "degrees"); + results += PvlKeyword("MinimumRightAscension", Isis::toString(minRa), "degrees"); + results += PvlKeyword("MaximumRightAscension", Isis::toString(maxRa), "degrees"); + results += PvlKeyword("MinimumDeclination", Isis::toString(minDec), "degrees"); + results += PvlKeyword("MaximumDeclination", Isis::toString(maxDec), "degrees"); results += PvlKeyword("MinimumRightAscension", Projection::ToHMS(minRa).toStdString(), "hms"); results += PvlKeyword("MaximumRightAscension", Projection::ToHMS(maxRa).toStdString(), "hms"); results += PvlKeyword("MinimumDeclination", Projection::ToDMS(minDec).toStdString(), "dms"); results += PvlKeyword("MaximumDeclination", Projection::ToDMS(maxDec).toStdString(), "dms"); - results += PvlKeyword("Resolution", toString(res), "degrees/pixel"); + results += PvlKeyword("Resolution", Isis::toString(res), "degrees/pixel"); Application::Log(results); // Setup and log orientation PvlGroup orient("Orientation"); - orient += PvlKeyword("CenterSample", toString(icube->sampleCount() / 2.0)); - orient += PvlKeyword("CenterLine", toString(icube->lineCount() / 2.0)); - orient += PvlKeyword("CenterRightAscension", toString(centerRa), "degrees"); - orient += PvlKeyword("CenterDeclination", toString(centerDec), "degrees"); - orient += PvlKeyword("CelestialNorthClockAngle", toString(rot), "degrees"); - orient += PvlKeyword("Resolution", toString(res), "degrees/pixel"); + orient += PvlKeyword("CenterSample", Isis::toString(icube->sampleCount() / 2.0)); + orient += PvlKeyword("CenterLine", Isis::toString(icube->lineCount() / 2.0)); + orient += PvlKeyword("CenterRightAscension", Isis::toString(centerRa), "degrees"); + orient += PvlKeyword("CenterDeclination", Isis::toString(centerDec), "degrees"); + orient += PvlKeyword("CelestialNorthClockAngle", Isis::toString(rot), "degrees"); + orient += PvlKeyword("Resolution", Isis::toString(res), "degrees/pixel"); Application::Log(orient); // Write the output file if requested diff --git a/isis/src/base/apps/slpmap/main.cpp b/isis/src/base/apps/slpmap/main.cpp index 423dbed6fc..225a2ce3f5 100644 --- a/isis/src/base/apps/slpmap/main.cpp +++ b/isis/src/base/apps/slpmap/main.cpp @@ -139,7 +139,7 @@ void createSlpCubeAutomatic(Buffer &in, double &v) { } catch (IException &e) { std::string msg = "The input cube contains a negative DN at (sample,line,band) " - "[("+toString(in.Sample(4))+","+toString(in.Line(4))+","+toString(in.Band(4))+")]. The automatic pixel resolution option requires the input cube contain " + "[("+Isis::toString(in.Sample(4))+","+Isis::toString(in.Line(4))+","+Isis::toString(in.Band(4))+")]. The automatic pixel resolution option requires the input cube contain " "raduis values. It is possible the input cube contains elevation or other data."; throw IException(e, IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/smtk/main.cpp b/isis/src/base/apps/smtk/main.cpp index 7d53ff6b03..168144913d 100644 --- a/isis/src/base/apps/smtk/main.cpp +++ b/isis/src/base/apps/smtk/main.cpp @@ -449,10 +449,10 @@ void IsisMain() { // Report Stereo separation angles PvlGroup stresultsPvl("StereoSeparationAngle"); - stresultsPvl += PvlKeyword("Minimum", toString(stAng.Minimum()), "deg"); - stresultsPvl += PvlKeyword("Average", toString(stAng.Average()), "deg"); - stresultsPvl += PvlKeyword("Maximum", toString(stAng.Maximum()), "deg"); - stresultsPvl += PvlKeyword("StandardDeviation", toString(stAng.StandardDeviation()), "deg"); + stresultsPvl += PvlKeyword("Minimum", Isis::toString(stAng.Minimum()), "deg"); + stresultsPvl += PvlKeyword("Average", Isis::toString(stAng.Average()), "deg"); + stresultsPvl += PvlKeyword("Maximum", Isis::toString(stAng.Maximum()), "deg"); + stresultsPvl += PvlKeyword("StandardDeviation", Isis::toString(stAng.StandardDeviation()), "deg"); Application::Log(stresultsPvl); // Update the label with BandBin keywords @@ -481,17 +481,17 @@ void IsisMain() { // Create output data PvlGroup totalPointsPvl("Totals"); - totalPointsPvl += PvlKeyword("AttemptedPoints", toString(numAttemptedInitialPoints)); - totalPointsPvl += PvlKeyword("InitialSuccesses", toString(numOrigPoints)); - totalPointsPvl += PvlKeyword("GrowSuccesses", toString(passpix2)); - totalPointsPvl += PvlKeyword("ResultingPoints", toString(bmf.size())); + totalPointsPvl += PvlKeyword("AttemptedPoints", Isis::toString(numAttemptedInitialPoints)); + totalPointsPvl += PvlKeyword("InitialSuccesses", Isis::toString(numOrigPoints)); + totalPointsPvl += PvlKeyword("GrowSuccesses", Isis::toString(passpix2)); + totalPointsPvl += PvlKeyword("ResultingPoints", Isis::toString(bmf.size())); Application::Log(totalPointsPvl); Pvl arPvl = matcher.RegistrationStatistics(); PvlGroup smtkresultsPvl("SmtkResults"); - smtkresultsPvl += PvlKeyword("SpiceOffImage", toString(matcher.OffImageErrorCount())); - smtkresultsPvl += PvlKeyword("SpiceDistanceError", toString(matcher.SpiceErrorCount())); + smtkresultsPvl += PvlKeyword("SpiceOffImage", Isis::toString(matcher.OffImageErrorCount())); + smtkresultsPvl += PvlKeyword("SpiceDistanceError", Isis::toString(matcher.SpiceErrorCount())); arPvl.addGroup(smtkresultsPvl); for (int i = 0; i < arPvl.groups(); i++) { diff --git a/isis/src/base/apps/spechighpass/main.cpp b/isis/src/base/apps/spechighpass/main.cpp index eec5a7d0e2..fcd0789b14 100644 --- a/isis/src/base/apps/spechighpass/main.cpp +++ b/isis/src/base/apps/spechighpass/main.cpp @@ -28,9 +28,9 @@ void IsisMain() { //Check for cases of too many bands if(bands >= (2 * cubeBands)) { - std::string msg = "Parameter bands [" + toString(bands) + "] " + std::string msg = "Parameter bands [" + Isis::toString(bands) + "] " "exceeds maximum allowable size of [" - + toString((cubeBands * 2) - 1) + "] for cube [" + + Isis::toString((cubeBands * 2) - 1) + "] for cube [" + icube->fileName().toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/apps/specpix/main.cpp b/isis/src/base/apps/specpix/main.cpp index 95e50068b8..a1faac6a1e 100644 --- a/isis/src/base/apps/specpix/main.cpp +++ b/isis/src/base/apps/specpix/main.cpp @@ -98,14 +98,14 @@ void IsisMain() { // Print out number of values changed PvlGroup results("Results"); results.addComment("The number and type of pixels created"); - results += PvlKeyword("Null", toString(nnull)); - results += PvlKeyword("Lrs", toString(nlrs)); - results += PvlKeyword("Lis", toString(nlis)); - results += PvlKeyword("Hrs", toString(nhrs)); - results += PvlKeyword("His", toString(nhis)); + results += PvlKeyword("Null", Isis::toString(nnull)); + results += PvlKeyword("Lrs", Isis::toString(nlrs)); + results += PvlKeyword("Lis", Isis::toString(nlis)); + results += PvlKeyword("Hrs", Isis::toString(nhrs)); + results += PvlKeyword("His", Isis::toString(nhis)); //tjw: int total -> BigInt total BigInt total = nnull + nlrs + nhrs + nlis + nhis; - results += PvlKeyword("Total", toString(total)); + results += PvlKeyword("Total", Isis::toString(total)); Application::Log(results); diff --git a/isis/src/base/apps/spiceinit/spiceinit.cpp b/isis/src/base/apps/spiceinit/spiceinit.cpp index 4f1a6420ae..b9f4c035b4 100644 --- a/isis/src/base/apps/spiceinit/spiceinit.cpp +++ b/isis/src/base/apps/spiceinit/spiceinit.cpp @@ -440,16 +440,16 @@ namespace Isis { // Add any time padding the user specified to the spice group if (ui.GetDouble("STARTPAD") > DBL_EPSILON) { currentKernels.addKeyword(PvlKeyword("StartPadding", - toString(ui.GetDouble("STARTPAD")), "seconds")); + Isis::toString(ui.GetDouble("STARTPAD")), "seconds")); } if (ui.GetDouble("ENDPAD") > DBL_EPSILON) { currentKernels.addKeyword(PvlKeyword("EndPadding", - toString(ui.GetDouble("ENDPAD")), "seconds")); + Isis::toString(ui.GetDouble("ENDPAD")), "seconds")); } currentKernels.addKeyword( - PvlKeyword("CameraVersion", toString(CameraFactory::CameraVersion(*icube))), + PvlKeyword("CameraVersion", Isis::toString(CameraFactory::CameraVersion(*icube))), Pvl::Replace); // Add the modified Kernels group to the input cube labels @@ -518,7 +518,7 @@ namespace Isis { bodyTable.Label()["Kernels"].addValue(pckKeyword[i]); bodyTable.Label() += PvlKeyword("SolarLongitude", - toString(cam->solarLongitude().degrees())); + Isis::toString(cam->solarLongitude().degrees())); icube->write(bodyTable); Table sunTable = cam->sunPosition()->Cache("SunPosition"); diff --git a/isis/src/base/apps/spiceserver/spiceserver.cpp b/isis/src/base/apps/spiceserver/spiceserver.cpp index f66a2ed5ae..fefdb57184 100644 --- a/isis/src/base/apps/spiceserver/spiceserver.cpp +++ b/isis/src/base/apps/spiceserver/spiceserver.cpp @@ -121,8 +121,8 @@ namespace Isis { else { std::string err = "Unable to read XML. The reason given was ["; err += error.toStdString(); - err += "] on line [" + toString(errorLine) + "] column ["; - err += toString(errorCol) + "]"; + err += "] on line [" + Isis::toString(errorLine) + "] column ["; + err += Isis::toString(errorCol) + "]"; throw IException(IException::Io, err, _FILEINFO_); } } @@ -410,14 +410,14 @@ namespace Isis { // Add any time padding the user specified to the spice group if (g_startPad > DBL_EPSILON) - currentKernels.addKeyword( PvlKeyword("StartPadding", toString(g_startPad), "seconds") ); + currentKernels.addKeyword( PvlKeyword("StartPadding", Isis::toString(g_startPad), "seconds") ); if (g_endPad > DBL_EPSILON) - currentKernels.addKeyword( PvlKeyword("EndPadding", toString(g_endPad), "seconds") ); + currentKernels.addKeyword( PvlKeyword("EndPadding", Isis::toString(g_endPad), "seconds") ); currentKernels.addKeyword( - PvlKeyword( "CameraVersion", toString( CameraFactory::CameraVersion(cube) ) ), Pvl::Replace); + PvlKeyword( "CameraVersion", Isis::toString( CameraFactory::CameraVersion(cube) ) ), Pvl::Replace); // Add the modified Kernels group to the input cube labels cube.putGroup(currentKernels); @@ -468,7 +468,7 @@ namespace Isis { for (int i = 0; i < pckKeyword.size(); i++) bodyTable.Label()["Kernels"].addValue(pckKeyword[i]); - bodyTable.Label() += PvlKeyword( "SolarLongitude", toString( cam->solarLongitude().degrees() ) ); + bodyTable.Label() += PvlKeyword( "SolarLongitude", Isis::toString( cam->solarLongitude().degrees() ) ); bodyTable.toBlob().Write(ui.GetFileName("TO").toStdString() + ".bodyrot"); Table sunTable = cam->sunPosition()->Cache("SunPosition"); diff --git a/isis/src/base/apps/spkwriter/SpkKernelWriter.h b/isis/src/base/apps/spkwriter/SpkKernelWriter.h index f80cb78d79..9990487db4 100644 --- a/isis/src/base/apps/spkwriter/SpkKernelWriter.h +++ b/isis/src/base/apps/spkwriter/SpkKernelWriter.h @@ -83,7 +83,7 @@ class SpkKernelWriter : public KernelWriter { */ void setType(const int spktype) { if ( (spktype != 9) && (spktype != 13) ) { - std::string mess = "SPK kernel type " + toString(spktype) + + std::string mess = "SPK kernel type " + Isis::toString(spktype) + " not valid/supported - must 9 or 13"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/apps/stats/stats.cpp b/isis/src/base/apps/stats/stats.cpp index 092b860af8..40219dfee9 100644 --- a/isis/src/base/apps/stats/stats.cpp +++ b/isis/src/base/apps/stats/stats.cpp @@ -117,18 +117,18 @@ namespace Isis { // Construct a label with the results PvlGroup results("Results"); results += PvlKeyword("From", cube->fileName().toStdString()); - results += PvlKeyword("Band", toString(cube->physicalBand(i))); + results += PvlKeyword("Band", Isis::toString(cube->physicalBand(i))); if ( stats->ValidPixels() != 0 ) { - results += PvlKeyword("Average", toString(stats->Average())); - results += PvlKeyword("StandardDeviation", toString(stats->StandardDeviation())); - results += PvlKeyword("Variance", toString(stats->Variance())); + results += PvlKeyword("Average", Isis::toString(stats->Average())); + results += PvlKeyword("StandardDeviation", Isis::toString(stats->StandardDeviation())); + results += PvlKeyword("Variance", Isis::toString(stats->Variance())); // These statistics only worked on a histogram - results += PvlKeyword("Median", toString(stats->Median())); - results += PvlKeyword("Mode", toString(stats->Mode())); - results += PvlKeyword("Skew", toString(stats->Skew())); - results += PvlKeyword("Minimum", toString(stats->Minimum())); - results += PvlKeyword("Maximum", toString(stats->Maximum())); - results += PvlKeyword("Sum", toString(stats->Sum())); + results += PvlKeyword("Median", Isis::toString(stats->Median())); + results += PvlKeyword("Mode", Isis::toString(stats->Mode())); + results += PvlKeyword("Skew", Isis::toString(stats->Skew())); + results += PvlKeyword("Minimum", Isis::toString(stats->Minimum())); + results += PvlKeyword("Maximum", Isis::toString(stats->Maximum())); + results += PvlKeyword("Sum", Isis::toString(stats->Sum())); } else { results += PvlKeyword("Average", "N/A"); @@ -141,15 +141,15 @@ namespace Isis { results += PvlKeyword("Maximum", "N/A"); results += PvlKeyword("Sum", "N/A"); } - results += PvlKeyword("TotalPixels", toString(stats->TotalPixels())); - results += PvlKeyword("ValidPixels", toString(stats->ValidPixels())); - results += PvlKeyword("OverValidMaximumPixels", toString(stats->OverRangePixels())); - results += PvlKeyword("UnderValidMinimumPixels", toString(stats->UnderRangePixels())); - results += PvlKeyword("NullPixels", toString(stats->NullPixels())); - results += PvlKeyword("LisPixels", toString(stats->LisPixels())); - results += PvlKeyword("LrsPixels", toString(stats->LrsPixels())); - results += PvlKeyword("HisPixels", toString(stats->HisPixels())); - results += PvlKeyword("HrsPixels", toString(stats->HrsPixels())); + results += PvlKeyword("TotalPixels", Isis::toString(stats->TotalPixels())); + results += PvlKeyword("ValidPixels", Isis::toString(stats->ValidPixels())); + results += PvlKeyword("OverValidMaximumPixels", Isis::toString(stats->OverRangePixels())); + results += PvlKeyword("UnderValidMinimumPixels", Isis::toString(stats->UnderRangePixels())); + results += PvlKeyword("NullPixels", Isis::toString(stats->NullPixels())); + results += PvlKeyword("LisPixels", Isis::toString(stats->LisPixels())); + results += PvlKeyword("LrsPixels", Isis::toString(stats->LrsPixels())); + results += PvlKeyword("HisPixels", Isis::toString(stats->HisPixels())); + results += PvlKeyword("HrsPixels", Isis::toString(stats->HrsPixels())); statsPvl.addGroup(results); diff --git a/isis/src/base/apps/trackextract/main.cpp b/isis/src/base/apps/trackextract/main.cpp index 12390f5936..fcac277bfd 100644 --- a/isis/src/base/apps/trackextract/main.cpp +++ b/isis/src/base/apps/trackextract/main.cpp @@ -199,7 +199,7 @@ void createMosaicCube(QString inputName, QString outputName, QVector ba void createTrackCube(QString inputName, QString ouputName, int trackBand) { ProcessByLine p; - CubeAttributeInput inAtt = CubeAttributeInput("+" + toString(trackBand)); + CubeAttributeInput inAtt = CubeAttributeInput("+" + Isis::toString(trackBand)); p.SetInputCube(inputName, inAtt); FileName cubeName = FileName(ouputName.toStdString()); diff --git a/isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp b/isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp index d39940c8e1..32350f5862 100644 --- a/isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp +++ b/isis/src/base/objs/AlbedoAtm/AlbedoAtm.cpp @@ -176,7 +176,7 @@ namespace Isis { void AlbedoAtm::SetNormPharef(const double pharef) { if(pharef < 0.0 || pharef >= 180.0) { std::string msg = "Invalid value of normalization pharef [" + - toString(pharef) + "]"; + Isis::toString(pharef) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -195,7 +195,7 @@ namespace Isis { void AlbedoAtm::SetNormIncref(const double incref) { if(incref < 0.0 || incref >= 90.0) { std::string msg = "Invalid value of normalization incref [" + - toString(incref) + "]"; + Isis::toString(incref) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -214,7 +214,7 @@ namespace Isis { void AlbedoAtm::SetNormEmaref(const double emaref) { if(emaref < 0.0 || emaref >= 90.0) { std::string msg = "Invalid value of normalization emaref [" + - toString(emaref) + "]"; + Isis::toString(emaref) + "]"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/AlphaCube/AlphaCube.cpp b/isis/src/base/objs/AlphaCube/AlphaCube.cpp index f94c64a072..b5cf2f8bf4 100644 --- a/isis/src/base/objs/AlphaCube/AlphaCube.cpp +++ b/isis/src/base/objs/AlphaCube/AlphaCube.cpp @@ -145,25 +145,25 @@ namespace Isis { *this = temp; Isis::PvlGroup &alpha = cubeObject.findGroup("AlphaCube"); - alpha["AlphaSamples"] = toString(p_alphaSamples); - alpha["AlphaLines"] = toString(p_alphaLines); - alpha["AlphaStartingSample"] = toString(p_alphaStartingSample); - alpha["AlphaStartingLine"] = toString(p_alphaStartingLine); - alpha["AlphaEndingSample"] = toString(p_alphaEndingSample); - alpha["AlphaEndingLine"] = toString(p_alphaEndingLine); - alpha["BetaSamples"] = toString(p_betaSamples); - alpha["BetaLines"] = toString(p_betaLines); + alpha["AlphaSamples"] = Isis::toString(p_alphaSamples); + alpha["AlphaLines"] = Isis::toString(p_alphaLines); + alpha["AlphaStartingSample"] = Isis::toString(p_alphaStartingSample); + alpha["AlphaStartingLine"] = Isis::toString(p_alphaStartingLine); + alpha["AlphaEndingSample"] = Isis::toString(p_alphaEndingSample); + alpha["AlphaEndingLine"] = Isis::toString(p_alphaEndingLine); + alpha["BetaSamples"] = Isis::toString(p_betaSamples); + alpha["BetaLines"] = Isis::toString(p_betaLines); } else { Isis::PvlGroup alpha("AlphaCube"); - alpha += Isis::PvlKeyword("AlphaSamples", toString(p_alphaSamples)); - alpha += Isis::PvlKeyword("AlphaLines", toString(p_alphaLines)); - alpha += Isis::PvlKeyword("AlphaStartingSample", toString(p_alphaStartingSample)); - alpha += Isis::PvlKeyword("AlphaStartingLine", toString(p_alphaStartingLine)); - alpha += Isis::PvlKeyword("AlphaEndingSample", toString(p_alphaEndingSample)); - alpha += Isis::PvlKeyword("AlphaEndingLine", toString(p_alphaEndingLine)); - alpha += Isis::PvlKeyword("BetaSamples", toString(p_betaSamples)); - alpha += Isis::PvlKeyword("BetaLines", toString(p_betaLines)); + alpha += Isis::PvlKeyword("AlphaSamples", Isis::toString(p_alphaSamples)); + alpha += Isis::PvlKeyword("AlphaLines", Isis::toString(p_alphaLines)); + alpha += Isis::PvlKeyword("AlphaStartingSample", Isis::toString(p_alphaStartingSample)); + alpha += Isis::PvlKeyword("AlphaStartingLine", Isis::toString(p_alphaStartingLine)); + alpha += Isis::PvlKeyword("AlphaEndingSample", Isis::toString(p_alphaEndingSample)); + alpha += Isis::PvlKeyword("AlphaEndingLine", Isis::toString(p_alphaEndingLine)); + alpha += Isis::PvlKeyword("BetaSamples", Isis::toString(p_betaSamples)); + alpha += Isis::PvlKeyword("BetaLines", Isis::toString(p_betaLines)); cubeObject.addGroup(alpha); } } diff --git a/isis/src/base/objs/Application/Application.cpp b/isis/src/base/objs/Application/Application.cpp index 19e7a41906..b77d9d3fa9 100644 --- a/isis/src/base/objs/Application/Application.cpp +++ b/isis/src/base/objs/Application/Application.cpp @@ -530,7 +530,7 @@ namespace Isis { "process. A communication channel was established with the parent " "(launcher) process, but when we tried to send data to the parent " "process an error occurred. The parent process has a PID of [" + - std::to_string(iApp->GetUserInterface().ParentId()) + "]"; + Isis::toString(iApp->GetUserInterface().ParentId()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/AutoReg/AutoReg.cpp b/isis/src/base/objs/AutoReg/AutoReg.cpp index 62a3c6392c..481f824581 100644 --- a/isis/src/base/objs/AutoReg/AutoReg.cpp +++ b/isis/src/base/objs/AutoReg/AutoReg.cpp @@ -201,7 +201,7 @@ namespace Isis { } if(algo.hasKeyword("SubpixelAccuracy")) { - SetSubPixelAccuracy(toBool(algo["SubpixelAccuracy"])); + SetSubPixelAccuracy(Isis::toString((int)algo["SubpixelAccuracy"]) == "True"); } if(algo.hasKeyword("ReductionFactor")) { @@ -1177,30 +1177,30 @@ namespace Isis { Pvl AutoReg::RegistrationStatistics() { Pvl pvl; PvlGroup stats("AutoRegStatistics"); - stats += Isis::PvlKeyword("Total", toString(p_totalRegistrations)); - stats += Isis::PvlKeyword("Successful", toString(p_pixelSuccesses + p_subpixelSuccesses)); - stats += Isis::PvlKeyword("Failure", toString(p_totalRegistrations - (p_pixelSuccesses + p_subpixelSuccesses))); + stats += Isis::PvlKeyword("Total", Isis::toString(p_totalRegistrations)); + stats += Isis::PvlKeyword("Successful", Isis::toString(p_pixelSuccesses + p_subpixelSuccesses)); + stats += Isis::PvlKeyword("Failure", Isis::toString(p_totalRegistrations - (p_pixelSuccesses + p_subpixelSuccesses))); pvl.addGroup(stats); PvlGroup successes("Successes"); - successes += PvlKeyword("SuccessPixel", toString(p_pixelSuccesses)); - successes += PvlKeyword("SuccessSubPixel", toString(p_subpixelSuccesses)); + successes += PvlKeyword("SuccessPixel", Isis::toString(p_pixelSuccesses)); + successes += PvlKeyword("SuccessSubPixel", Isis::toString(p_subpixelSuccesses)); pvl.addGroup(successes); PvlGroup grp("PatternChipFailures"); - grp += PvlKeyword("PatternNotEnoughValidData", toString(p_patternChipNotEnoughValidDataCount)); - grp += PvlKeyword("PatternZScoreNotMet", toString(p_patternZScoreNotMetCount)); + grp += PvlKeyword("PatternNotEnoughValidData", Isis::toString(p_patternChipNotEnoughValidDataCount)); + grp += PvlKeyword("PatternZScoreNotMet", Isis::toString(p_patternZScoreNotMetCount)); pvl.addGroup(grp); PvlGroup fit("FitChipFailures"); - fit += PvlKeyword("FitChipNoData", toString(p_fitChipNoDataCount)); - fit += PvlKeyword("FitChipToleranceNotMet", toString(p_fitChipToleranceNotMetCount)); + fit += PvlKeyword("FitChipNoData", Isis::toString(p_fitChipNoDataCount)); + fit += PvlKeyword("FitChipToleranceNotMet", Isis::toString(p_fitChipToleranceNotMetCount)); pvl.addGroup(fit); PvlGroup model("SurfaceModelFailures"); - model += PvlKeyword("SurfaceModelNotEnoughValidData", toString(p_surfaceModelNotEnoughValidDataCount)); - model += PvlKeyword("SurfaceModelSolutionInvalid", toString(p_surfaceModelSolutionInvalidCount)); - model += PvlKeyword("SurfaceModelDistanceInvalid", toString(p_surfaceModelDistanceInvalidCount)); + model += PvlKeyword("SurfaceModelNotEnoughValidData", Isis::toString(p_surfaceModelNotEnoughValidDataCount)); + model += PvlKeyword("SurfaceModelSolutionInvalid", Isis::toString(p_surfaceModelSolutionInvalidCount)); + model += PvlKeyword("SurfaceModelDistanceInvalid", Isis::toString(p_surfaceModelDistanceInvalidCount)); pvl.addGroup(model); return (AlgorithmStatistics(pvl)); @@ -1290,28 +1290,28 @@ namespace Isis { PvlGroup reg("AutoRegistration"); reg += PvlKeyword("Algorithm", AlgorithmName().toStdString()); - reg += PvlKeyword("Tolerance", toString(Tolerance())); + reg += PvlKeyword("Tolerance", Isis::toString(Tolerance())); reg += PvlKeyword("SubpixelAccuracy", SubPixelAccuracy() ? "True" : "False"); - reg += PvlKeyword("ReductionFactor", toString(ReductionFactor())); + reg += PvlKeyword("ReductionFactor", Isis::toString(ReductionFactor())); reg += PvlKeyword("Gradient", GradientFilterString().toStdString()); Chip *pattern = PatternChip(); - reg += PvlKeyword("PatternSamples", toString(pattern->Samples())); - reg += PvlKeyword("PatternLines", toString(pattern->Lines())); - reg += PvlKeyword("MinimumZScore", toString(MinimumZScore())); - reg += PvlKeyword("ValidPercent", toString(PatternValidPercent())); + reg += PvlKeyword("PatternSamples", Isis::toString(pattern->Samples())); + reg += PvlKeyword("PatternLines", Isis::toString(pattern->Lines())); + reg += PvlKeyword("MinimumZScore", Isis::toString(MinimumZScore())); + reg += PvlKeyword("ValidPercent", Isis::toString(PatternValidPercent())); // TODO Chip needs accessors to valid minimum and maximum Chip *search = SearchChip(); - reg += PvlKeyword("SearchSamples", toString(search->Samples())); - reg += PvlKeyword("SearchLines", toString(search->Lines())); - reg += PvlKeyword("SubchipValidPercent", toString(SubsearchValidPercent())); + reg += PvlKeyword("SearchSamples", Isis::toString(search->Samples())); + reg += PvlKeyword("SearchLines", Isis::toString(search->Lines())); + reg += PvlKeyword("SubchipValidPercent", Isis::toString(SubsearchValidPercent())); // TODO Chip needs accessors to valid minimum and maximum if (SubPixelAccuracy()) { - reg += PvlKeyword("DistanceTolerance", toString(DistanceTolerance())); - reg += PvlKeyword("WindowSize", toString(WindowSize())); + reg += PvlKeyword("DistanceTolerance", Isis::toString(DistanceTolerance())); + reg += PvlKeyword("WindowSize", Isis::toString(WindowSize())); } return reg; diff --git a/isis/src/base/objs/CSVReader/CSVReader.cpp b/isis/src/base/objs/CSVReader/CSVReader.cpp index 0a1c2ae9b3..30187ce9e2 100644 --- a/isis/src/base/objs/CSVReader/CSVReader.cpp +++ b/isis/src/base/objs/CSVReader/CSVReader.cpp @@ -140,7 +140,7 @@ namespace Isis { void CSVReader::read(const QString &csvfile) { ifstream ifile(csvfile.toLatin1().data(), ios::in); if(!ifile) { - std::string mess = "Unable to open file [" + csvfile.toStdString() + "]"; + IString mess = "Unable to open file [" + csvfile.toStdString() + "]"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/base/objs/CSVReader/unitTest.cpp b/isis/src/base/objs/CSVReader/unitTest.cpp index b6b5207a44..c7ffd35c84 100644 --- a/isis/src/base/objs/CSVReader/unitTest.cpp +++ b/isis/src/base/objs/CSVReader/unitTest.cpp @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) { cout.setf(ios::fixed); cout << "Size of column 0/1: " << scol.dim() << endl; for(int i = 0 ; i < dcol.dim() ; i++) { - cout << "IString: " << setw(10)<< scol[i].toStdString() + cout << "IString: " << setw(10)<< scol[i].toStdString().c_str() << " \tDouble: " << setprecision(4) << dcol[i] << endl; } diff --git a/isis/src/base/objs/Camera/Camera.cpp b/isis/src/base/objs/Camera/Camera.cpp index 91322177ab..1355031905 100644 --- a/isis/src/base/objs/Camera/Camera.cpp +++ b/isis/src/base/objs/Camera/Camera.cpp @@ -1206,10 +1206,10 @@ namespace Isis { PvlGroup map = pvl.findGroup("Mapping", Pvl::Traverse); if(map.hasKeyword("EquatorialRadius")) - a = Distance(IString::ToDouble(map["EquatorialRadius"][0]), Distance::Meters); + a = Distance(Isis::toDouble(map["EquatorialRadius"][0]), Distance::Meters); if(map.hasKeyword("PolarRadius")) - b = Distance(IString::ToDouble(map["PolarRadius"][0]), Distance::Meters); + b = Distance(Isis::toDouble(map["PolarRadius"][0]), Distance::Meters); // Convert to planetographic if necessary minlat = p_minlat; @@ -1369,19 +1369,19 @@ namespace Isis { map += PvlKeyword("TargetName", target()->name().toStdString()); std::vector radii = target()->radii(); - map += PvlKeyword("EquatorialRadius", std::to_string(radii[0].meters()), "meters"); - map += PvlKeyword("PolarRadius", std::to_string(radii[2].meters()), "meters"); + map += PvlKeyword("EquatorialRadius", Isis::toString(radii[0].meters()), "meters"); + map += PvlKeyword("PolarRadius", Isis::toString(radii[2].meters()), "meters"); map += PvlKeyword("LatitudeType", "Planetocentric"); map += PvlKeyword("LongitudeDirection", "PositiveEast"); map += PvlKeyword("LongitudeDomain", "360"); GroundRangeResolution(); - map += PvlKeyword("MinimumLatitude", std::to_string(p_minlat)); - map += PvlKeyword("MaximumLatitude", std::to_string(p_maxlat)); - map += PvlKeyword("MinimumLongitude", std::to_string(p_minlon)); - map += PvlKeyword("MaximumLongitude", std::to_string(p_maxlon)); - map += PvlKeyword("PixelResolution", std::to_string(p_minres)); + map += PvlKeyword("MinimumLatitude", Isis::toString(p_minlat)); + map += PvlKeyword("MaximumLatitude", Isis::toString(p_maxlat)); + map += PvlKeyword("MinimumLongitude", Isis::toString(p_minlon)); + map += PvlKeyword("MaximumLongitude", Isis::toString(p_maxlon)); + map += PvlKeyword("PixelResolution", Isis::toString(p_minres)); map += PvlKeyword("ProjectionName", "Sinusoidal"); pvl.addGroup(map); @@ -1408,11 +1408,11 @@ namespace Isis { map += PvlKeyword("RingLongitudeDomain", "360"); ringRangeResolution(); - map += PvlKeyword("MinimumRingRadius", std::to_string(p_minRingRadius)); - map += PvlKeyword("MaximumRingRadius", std::to_string(p_maxRingRadius)); - map += PvlKeyword("MinimumRingLongitude", std::to_string(p_minRingLongitude)); - map += PvlKeyword("MaximumRingLongitude", std::to_string(p_maxRingLongitude)); - map += PvlKeyword("PixelResolution", std::to_string(p_minres)); + map += PvlKeyword("MinimumRingRadius", Isis::toString(p_minRingRadius)); + map += PvlKeyword("MaximumRingRadius", Isis::toString(p_maxRingRadius)); + map += PvlKeyword("MinimumRingLongitude", Isis::toString(p_minRingLongitude)); + map += PvlKeyword("MaximumRingLongitude", Isis::toString(p_maxRingLongitude)); + map += PvlKeyword("PixelResolution", Isis::toString(p_minres)); map += PvlKeyword("ProjectionName", "Planar"); pvl.addGroup(map); diff --git a/isis/src/base/objs/Camera/unitTest.cpp b/isis/src/base/objs/Camera/unitTest.cpp index b7b010870e..f525c313cd 100644 --- a/isis/src/base/objs/Camera/unitTest.cpp +++ b/isis/src/base/objs/Camera/unitTest.cpp @@ -231,7 +231,7 @@ int main() { pixRes2 *= 10000000; pixRes2 = round(pixRes2); pixRes2 /= 10000000; - pvl.findGroup("Mapping")["PixelResolution"] = toString(pixRes2); + pvl.findGroup("Mapping")["PixelResolution"] = Isis::toString(pixRes2); cout << "BasicMapping PVL: " << endl << pvl << endl << endl; cout << "FocalLength: " << c->FocalLength() << endl; @@ -327,19 +327,19 @@ int main() { minLat *= 100; minLat = round(minLat); minLat /= 100; - camMap.findGroup("Mapping")["MinimumLatitude"] = toString(minLat); + camMap.findGroup("Mapping")["MinimumLatitude"] = Isis::toString(minLat); double pixRes = camMap.findGroup("Mapping")["PixelResolution"]; pixRes *= 100; pixRes = round(pixRes); pixRes /= 100; - camMap.findGroup("Mapping")["PixelResolution"] = toString(pixRes); + camMap.findGroup("Mapping")["PixelResolution"] = Isis::toString(pixRes); double minLon = camMap.findGroup("Mapping")["MinimumLongitude"]; minLon *= 100000000000.0; minLon = round(minLon); minLon /= 100000000000.0; - camMap.findGroup("Mapping")["MinimumLongitude"] = toString(minLon); + camMap.findGroup("Mapping")["MinimumLongitude"] = Isis::toString(minLon); cout << camMap << endl; diff --git a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp index 46f417337c..492e225711 100644 --- a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp +++ b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp @@ -366,15 +366,15 @@ namespace Isis { double spB[3], sB[3]; m_camera->instrumentPosition(spB); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[1]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[2]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[0]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[1]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[2]), "km"); try { m_camera->sunPosition(sB); - gp->findKeyword("SunPosition").addValue(toString(sB[0]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[1]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[2]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[0]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[1]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[2]), "km"); } catch (IException &e) { gp->findKeyword("SunPosition").addValue("Null"); @@ -383,15 +383,15 @@ namespace Isis { } std::vectorlookB = m_camera->lookDirectionBodyFixed(); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[0]), "DEGREE"); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[1]), "DEGREE"); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[2]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(Isis::toString(lookB[0]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(Isis::toString(lookB[1]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(Isis::toString(lookB[2]), "DEGREE"); try { std::vectorlookJ = m_camera->lookDirectionJ2000(); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[0]), "DEGREE"); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[1]), "DEGREE"); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[2]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(Isis::toString(lookJ[0]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(Isis::toString(lookJ[1]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(Isis::toString(lookJ[2]), "DEGREE"); } catch (IException &e) { gp->findKeyword("LookDirectionJ2000").addValue("Null"); @@ -402,9 +402,9 @@ namespace Isis { try { double lookC[3]; m_camera->LookDirection(lookC); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[0]), "DEGREE"); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[1]), "DEGREE"); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[2]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(Isis::toString(lookC[0]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(Isis::toString(lookC[1]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(Isis::toString(lookC[2]), "DEGREE"); } catch (IException &e) { gp->findKeyword("LookDirectionCamera").addValue("Null"); @@ -416,10 +416,10 @@ namespace Isis { // Set all keywords that still have valid information gp->findKeyword("Error").setValue(error); gp->findKeyword("FileName").setValue(m_currentCube->fileName().toStdString()); - gp->findKeyword("Sample").setValue(toString(m_camera->Sample())); - gp->findKeyword("Line").setValue(toString(m_camera->Line())); + gp->findKeyword("Sample").setValue(Isis::toString(m_camera->Sample())); + gp->findKeyword("Line").setValue(Isis::toString(m_camera->Line())); gp->findKeyword("EphemerisTime").setValue( - toString(m_camera->time().Et()), "seconds"); + Isis::toString(m_camera->time().Et()), "seconds"); gp->findKeyword("EphemerisTime").addComment("Time"); QString utc = m_camera->time().UTC(); gp->findKeyword("UTC").setValue(utc.toStdString()); @@ -442,25 +442,25 @@ namespace Isis { { gp->findKeyword("FileName").setValue(m_currentCube->fileName().toStdString()); - gp->findKeyword("Sample").setValue(toString(m_camera->Sample())); - gp->findKeyword("Line").setValue(toString(m_camera->Line())); + gp->findKeyword("Sample").setValue(Isis::toString(m_camera->Sample())); + gp->findKeyword("Line").setValue(Isis::toString(m_camera->Line())); gp->findKeyword("PixelValue").setValue(PixelToString(b[0])); try { - gp->findKeyword("RightAscension").setValue(toString( + gp->findKeyword("RightAscension").setValue(Isis::toString( m_camera->RightAscension()), "DEGREE"); } catch (IException &e) { gp->findKeyword("RightAscension").setValue("Null"); } try { - gp->findKeyword("Declination").setValue(toString( + gp->findKeyword("Declination").setValue(Isis::toString( m_camera->Declination()), "DEGREE"); } catch (IException &e) { gp->findKeyword("Declination").setValue("Null"); } ocentricLat = m_camera->UniversalLatitude(); - gp->findKeyword("PlanetocentricLatitude").setValue(toString(ocentricLat), "DEGREE"); + gp->findKeyword("PlanetocentricLatitude").setValue(Isis::toString(ocentricLat), "DEGREE"); // Convert lat to planetographic Distance radii[3]; @@ -468,82 +468,82 @@ namespace Isis { ographicLat = TProjection::ToPlanetographic(ocentricLat, radii[0].kilometers(), radii[2].kilometers()); - gp->findKeyword("PlanetographicLatitude").setValue(toString(ographicLat), "DEGREE"); + gp->findKeyword("PlanetographicLatitude").setValue(Isis::toString(ographicLat), "DEGREE"); pe360Lon = m_camera->UniversalLongitude(); - gp->findKeyword("PositiveEast360Longitude").setValue(toString(pe360Lon), "DEGREE"); + gp->findKeyword("PositiveEast360Longitude").setValue(Isis::toString(pe360Lon), "DEGREE"); //Convert lon to -180 - 180 range - gp->findKeyword("PositiveEast180Longitude").setValue(toString( + gp->findKeyword("PositiveEast180Longitude").setValue(Isis::toString( TProjection::To180Domain(pe360Lon)), "DEGREE"); //Convert lon to positive west pw360Lon = TProjection::ToPositiveWest(pe360Lon, 360); - gp->findKeyword("PositiveWest360Longitude").setValue(toString(pw360Lon), "DEGREE"); + gp->findKeyword("PositiveWest360Longitude").setValue(Isis::toString(pw360Lon), "DEGREE"); //Convert pwlon to -180 - 180 range gp->findKeyword("PositiveWest180Longitude").setValue( - toString( TProjection::To180Domain(pw360Lon)), "DEGREE"); + Isis::toString( TProjection::To180Domain(pw360Lon)), "DEGREE"); m_camera->Coordinate(pB); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[0]), "km"); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[1]), "km"); - gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[2]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(Isis::toString(pB[0]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(Isis::toString(pB[1]), "km"); + gp->findKeyword("BodyFixedCoordinate").addValue(Isis::toString(pB[2]), "km"); - gp->findKeyword("LocalRadius").setValue(toString( + gp->findKeyword("LocalRadius").setValue(Isis::toString( m_camera->LocalRadius().meters()), "meters"); - gp->findKeyword("SampleResolution").setValue(toString( + gp->findKeyword("SampleResolution").setValue(Isis::toString( m_camera->SampleResolution()), "meters/pixel"); - gp->findKeyword("LineResolution").setValue(toString( + gp->findKeyword("LineResolution").setValue(Isis::toString( m_camera->LineResolution()), "meters/pixel"); gp->findKeyword("ObliqueDetectorResolution").setValue( - toString(m_camera->ObliqueDetectorResolution()),"meters"); + Isis::toString(m_camera->ObliqueDetectorResolution()),"meters"); gp->findKeyword("ObliqueLineResolution").setValue( - toString(m_camera->ObliqueLineResolution()),"meters"); + Isis::toString(m_camera->ObliqueLineResolution()),"meters"); gp->findKeyword("ObliqueSampleResolution").setValue( - toString(m_camera->ObliqueSampleResolution()),"meters"); + Isis::toString(m_camera->ObliqueSampleResolution()),"meters"); gp->findKeyword("ObliquePixelResolution").setValue( - toString(m_camera->ObliquePixelResolution()), "meters/pix"); + Isis::toString(m_camera->ObliquePixelResolution()), "meters/pix"); //body fixed m_camera->instrumentPosition(spB); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[1]), "km"); - gp->findKeyword("SpacecraftPosition").addValue(toString(spB[2]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[0]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[1]), "km"); + gp->findKeyword("SpacecraftPosition").addValue(Isis::toString(spB[2]), "km"); gp->findKeyword("SpacecraftPosition").addComment("Spacecraft Information"); double spacecraftAzi = m_camera->SpacecraftAzimuth(); if (Isis::IsValidPixel(spacecraftAzi)) { - gp->findKeyword("SpacecraftAzimuth").setValue(toString(spacecraftAzi), "DEGREE"); + gp->findKeyword("SpacecraftAzimuth").setValue(Isis::toString(spacecraftAzi), "DEGREE"); } else { gp->findKeyword("SpacecraftAzimuth").setValue("NULL"); } - gp->findKeyword("SlantDistance").setValue(toString( + gp->findKeyword("SlantDistance").setValue(Isis::toString( m_camera->SlantDistance()), "km"); - gp->findKeyword("TargetCenterDistance").setValue(toString( + gp->findKeyword("TargetCenterDistance").setValue(Isis::toString( m_camera->targetCenterDistance()), "km"); m_camera->subSpacecraftPoint(ssplat, ssplon); - gp->findKeyword("SubSpacecraftLatitude").setValue(toString(ssplat), "DEGREE"); - gp->findKeyword("SubSpacecraftLongitude").setValue(toString(ssplon), "DEGREE"); - gp->findKeyword("SpacecraftAltitude").setValue(toString( + gp->findKeyword("SubSpacecraftLatitude").setValue(Isis::toString(ssplat), "DEGREE"); + gp->findKeyword("SubSpacecraftLongitude").setValue(Isis::toString(ssplon), "DEGREE"); + gp->findKeyword("SpacecraftAltitude").setValue(Isis::toString( m_camera->SpacecraftAltitude()), "km"); - gp->findKeyword("OffNadirAngle").setValue(toString( + gp->findKeyword("OffNadirAngle").setValue(Isis::toString( m_camera->OffNadirAngle()), "DEGREE"); double subspcgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(), m_camera->UniversalLongitude(), ssplat, ssplon); gp->findKeyword("SubSpacecraftGroundAzimuth").setValue( - toString(subspcgrdaz), "DEGREE"); + Isis::toString(subspcgrdaz), "DEGREE"); try { m_camera->sunPosition(sB); - gp->findKeyword("SunPosition").addValue(toString(sB[0]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[1]), "km"); - gp->findKeyword("SunPosition").addValue(toString(sB[2]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[0]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[1]), "km"); + gp->findKeyword("SunPosition").addValue(Isis::toString(sB[2]), "km"); gp->findKeyword("SunPosition").addComment("Sun Information"); } catch (IException &e) { @@ -556,7 +556,7 @@ namespace Isis { try { double sunAzi = m_camera->SunAzimuth(); if (Isis::IsValidPixel(sunAzi)) { - gp->findKeyword("SubSolarAzimuth").setValue(toString(sunAzi), "DEGREE"); + gp->findKeyword("SubSolarAzimuth").setValue(Isis::toString(sunAzi), "DEGREE"); } else { gp->findKeyword("SubSolarAzimuth").setValue("NULL"); @@ -567,7 +567,7 @@ namespace Isis { } try { - gp->findKeyword("SolarDistance").setValue(toString( + gp->findKeyword("SolarDistance").setValue(Isis::toString( m_camera->SolarDistance()), "AU"); } catch(IException &e) { @@ -576,14 +576,14 @@ namespace Isis { try { double sslat, sslon; m_camera->subSolarPoint(sslat, sslon); - gp->findKeyword("SubSolarLatitude").setValue(toString(sslat), "DEGREE"); - gp->findKeyword("SubSolarLongitude").setValue(toString(sslon), "DEGREE"); + gp->findKeyword("SubSolarLatitude").setValue(Isis::toString(sslat), "DEGREE"); + gp->findKeyword("SubSolarLongitude").setValue(Isis::toString(sslon), "DEGREE"); try { double subsolgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(), m_camera->UniversalLongitude(), sslat, sslon); - gp->findKeyword("SubSolarGroundAzimuth").setValue(toString(subsolgrdaz), "DEGREE"); + gp->findKeyword("SubSolarGroundAzimuth").setValue(Isis::toString(subsolgrdaz), "DEGREE"); } catch(IException &e) { gp->findKeyword("SubSolarGroundAzimuth").setValue("NULL"); @@ -595,35 +595,35 @@ namespace Isis { gp->findKeyword("SubSolarGroundAzimuth").setValue("NULL"); } - gp->findKeyword("Phase").setValue(toString(m_camera->PhaseAngle()), "DEGREE"); + gp->findKeyword("Phase").setValue(Isis::toString(m_camera->PhaseAngle()), "DEGREE"); gp->findKeyword("Phase").addComment("Illumination and Other"); - gp->findKeyword("Incidence").setValue(toString( + gp->findKeyword("Incidence").setValue(Isis::toString( m_camera->IncidenceAngle()), "DEGREE"); - gp->findKeyword("Emission").setValue(toString( + gp->findKeyword("Emission").setValue(Isis::toString( m_camera->EmissionAngle()), "DEGREE"); double northAzi = m_camera->NorthAzimuth(); if (Isis::IsValidPixel(northAzi)) { - gp->findKeyword("NorthAzimuth").setValue(toString(northAzi), "DEGREE"); + gp->findKeyword("NorthAzimuth").setValue(Isis::toString(northAzi), "DEGREE"); } else { gp->findKeyword("NorthAzimuth").setValue("NULL"); } - gp->findKeyword("EphemerisTime").setValue(toString( + gp->findKeyword("EphemerisTime").setValue(Isis::toString( m_camera->time().Et()), "seconds"); gp->findKeyword("EphemerisTime").addComment("Time"); utc = m_camera->time().UTC(); gp->findKeyword("UTC").setValue(utc.toStdString()); try { - gp->findKeyword("LocalSolarTime").setValue(toString( + gp->findKeyword("LocalSolarTime").setValue(Isis::toString( m_camera->LocalSolarTime()), "hour"); } catch (IException &e) { gp->findKeyword("LocalSolarTime").setValue("Null"); } try { - gp->findKeyword("SolarLongitude").setValue(toString( + gp->findKeyword("SolarLongitude").setValue(Isis::toString( m_camera->solarLongitude().degrees()), "DEGREE"); } catch (IException &e) { @@ -631,16 +631,16 @@ namespace Isis { } std::vectorlookB = m_camera->lookDirectionBodyFixed(); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[0]), "DEGREE"); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[1]), "DEGREE"); - gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[2]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(Isis::toString(lookB[0]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(Isis::toString(lookB[1]), "DEGREE"); + gp->findKeyword("LookDirectionBodyFixed").addValue(Isis::toString(lookB[2]), "DEGREE"); gp->findKeyword("LookDirectionBodyFixed").addComment("Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems."); try { std::vectorlookJ = m_camera->lookDirectionJ2000(); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[0]), "DEGREE"); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[1]), "DEGREE"); - gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[2]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(Isis::toString(lookJ[0]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(Isis::toString(lookJ[1]), "DEGREE"); + gp->findKeyword("LookDirectionJ2000").addValue(Isis::toString(lookJ[2]), "DEGREE"); } catch (IException &e) { gp->findKeyword("LookDirectionJ2000").addValue("Null"); @@ -651,9 +651,9 @@ namespace Isis { try { double lookC[3]; m_camera->LookDirection(lookC); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[0]), "DEGREE"); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[1]), "DEGREE"); - gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[2]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(Isis::toString(lookC[0]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(Isis::toString(lookC[1]), "DEGREE"); + gp->findKeyword("LookDirectionCamera").addValue(Isis::toString(lookC[2]), "DEGREE"); } catch (IException &e) { gp->findKeyword("LookDirectionCamera").addValue("Null"); diff --git a/isis/src/base/objs/CameraPointInfo/unitTest.cpp b/isis/src/base/objs/CameraPointInfo/unitTest.cpp index 37fb217fce..f95f5ae832 100644 --- a/isis/src/base/objs/CameraPointInfo/unitTest.cpp +++ b/isis/src/base/objs/CameraPointInfo/unitTest.cpp @@ -45,15 +45,15 @@ int main() { void LowerPrecision(PvlKeyword &keyword) { if (keyword.name() != "LookDirectionCamera") { - double value = IString::ToDouble(keyword[0]); + double value = Isis::toDouble(keyword[0]); value = round(value * 1000) / 1000.0; - keyword[0] = toString(value); + keyword[0] = Isis::toString(value); } else { for (int i = 0; i < 3; i++) { - double value = IString::ToDouble(keyword[i]); + double value = Isis::toDouble(keyword[i]); value = round(value * 10000000000) / 10000000000.0; - keyword[i] = toString(value); + keyword[i] = Isis::toString(value); } } } diff --git a/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp b/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp index 5ed5e96cc3..e66b4369bc 100644 --- a/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp +++ b/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp @@ -284,7 +284,7 @@ namespace Isis { return (PvlKeyword(keyname.toStdString(), "NULL")); } else { - return (PvlKeyword(keyname.toStdString(), toString(value), unit.toStdString())); + return (PvlKeyword(keyname.toStdString(), Isis::toString(value), unit.toStdString())); } } diff --git a/isis/src/base/objs/CameraStatistics/unitTest.cpp b/isis/src/base/objs/CameraStatistics/unitTest.cpp index 345adb1ab9..f793bf9ee4 100644 --- a/isis/src/base/objs/CameraStatistics/unitTest.cpp +++ b/isis/src/base/objs/CameraStatistics/unitTest.cpp @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) { for (int j = 0; j < group.keywords(); j++) { PvlKeyword &keyword = group[j]; - cout << " " << keyword.name() << " = " << IString::ToDouble(keyword[0]) << endl; + cout << " " << keyword.name() << " = " << Isis::toDouble(keyword[0]) << endl; } cout << endl; diff --git a/isis/src/base/objs/Cube/Cube.cpp b/isis/src/base/objs/Cube/Cube.cpp index a455e9c7b8..bd45ffb557 100644 --- a/isis/src/base/objs/Cube/Cube.cpp +++ b/isis/src/base/objs/Cube/Cube.cpp @@ -418,8 +418,8 @@ namespace Isis { } if (m_samples < 1 || m_lines < 1 || m_bands < 1) { - std::string msg = "Number of samples [" + toString(m_samples) + - "], lines [" + toString(m_lines) + "], or bands [" + toString(m_bands) + + std::string msg = "Number of samples [" + Isis::toString(m_samples) + + "], lines [" + Isis::toString(m_lines) + "], or bands [" + Isis::toString(m_bands) + "] cannot be less than 1"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -446,11 +446,11 @@ namespace Isis { if (size > maxSizePreference) { std::string msg; msg += "The cube you are attempting to create [" + cubeFileName.toStdString() + "] is [" - + toString(size) + "GB]. This is larger than the current allowed " - "size of [" + toString(maxSizePreference) + "GB]. The cube " - "dimensions were (S,L,B) [" + toString(m_samples) + ", " + - toString(m_lines) + ", " + toString(m_bands) + "] with [" + - toString(SizeOf(m_pixelType)) + "] bytes per pixel. If you still " + + Isis::toString(size) + "GB]. This is larger than the current allowed " + "size of [" + Isis::toString(maxSizePreference) + "GB]. The cube " + "dimensions were (S,L,B) [" + Isis::toString(m_samples) + ", " + + Isis::toString(m_lines) + ", " + Isis::toString(m_bands) + "] with [" + + Isis::toString(SizeOf(m_pixelType)) + "] bytes per pixel. If you still " "wish to create this cube, the maximum value can be changed in your personal " "preference file located in [~/.Isis/IsisPreferences] within the group " "CubeCustomization, keyword MaximumSize. If you do not have an ISISPreference file, " @@ -470,13 +470,13 @@ namespace Isis { // See if we have attached or detached labels if (m_attached) { // StartByte is 1-based (why!!) so we need to do + 1 - core += PvlKeyword("StartByte", toString(m_labelBytes + 1)); + core += PvlKeyword("StartByte", Isis::toString(m_labelBytes + 1)); m_labelFileName = new FileName(cubFile); m_dataFileName = new FileName(cubFile); m_labelFile = new QFile(QString::fromStdString(m_labelFileName->expanded())); } else { - core += PvlKeyword("StartByte", toString(1)); + core += PvlKeyword("StartByte", Isis::toString(1)); core += PvlKeyword("^Core", cubFile.name()); m_dataFileName = new FileName(cubFile); m_dataFile = new QFile(QString::fromStdString(realDataFileName().expanded())); @@ -489,9 +489,9 @@ namespace Isis { // Create the size of the core PvlGroup dims("Dimensions"); - dims += PvlKeyword("Samples", toString(m_samples)); - dims += PvlKeyword("Lines", toString(m_lines)); - dims += PvlKeyword("Bands", toString(m_bands)); + dims += PvlKeyword("Samples", Isis::toString(m_samples)); + dims += PvlKeyword("Lines", Isis::toString(m_lines)); + dims += PvlKeyword("Bands", Isis::toString(m_bands)); core.addGroup(dims); // Create the pixel type @@ -500,8 +500,8 @@ namespace Isis { // And the byte ordering ptype += PvlKeyword("ByteOrder", ByteOrderName(m_byteOrder)); - ptype += PvlKeyword("Base", toString(m_base)); - ptype += PvlKeyword("Multiplier", toString(m_multiplier)); + ptype += PvlKeyword("Base", Isis::toString(m_base)); + ptype += PvlKeyword("Multiplier", Isis::toString(m_multiplier)); core.addGroup(ptype); } else { @@ -522,7 +522,7 @@ namespace Isis { // Setup storage reserved for the label PvlObject lbl("Label"); - lbl += PvlKeyword("Bytes", toString(m_labelBytes)); + lbl += PvlKeyword("Bytes", Isis::toString(m_labelBytes)); m_label->addObject(lbl); const PvlGroup &pref = @@ -1496,7 +1496,7 @@ namespace Isis { bodyTable.Label()["Kernels"].addValue(pckKeyword[i]); bodyTable.Label() += PvlKeyword("SolarLongitude", - toString(spice.solarLongitude().degrees())); + Isis::toString(spice.solarLongitude().degrees())); this->write(bodyTable); Table sunTable = spice.sunPosition()->Cache("SunPosition"); @@ -1799,7 +1799,7 @@ namespace Isis { if (m_virtualBandList) { if ((virtualBand < 1) || (virtualBand > m_virtualBandList->size())) { - std::string msg = "Out of array bounds [" + toString(virtualBand) + "]"; + std::string msg = "Out of array bounds [" + Isis::toString(virtualBand) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } physicalBand = m_virtualBandList->at(virtualBand - 1); @@ -2117,7 +2117,7 @@ namespace Isis { } // Change the number of bands in the labels of the cube - if (m_virtualBandList && core.hasGroup("Dimensions")) core.findGroup("Dimensions")["Bands"] = toString(m_virtualBandList->size()); + if (m_virtualBandList && core.hasGroup("Dimensions")) core.findGroup("Dimensions")["Bands"] = Isis::toString(m_virtualBandList->size()); } diff --git a/isis/src/base/objs/Cube/CubeBsqHandler.cpp b/isis/src/base/objs/Cube/CubeBsqHandler.cpp index a880ba066b..7e71a39ea6 100644 --- a/isis/src/base/objs/Cube/CubeBsqHandler.cpp +++ b/isis/src/base/objs/Cube/CubeBsqHandler.cpp @@ -90,8 +90,8 @@ namespace Isis { if(!success) { IString msg = "Reading from the file [" + dataFile->fileName().toStdString() + "] " "failed with reading [" + - toString(chunkToFill.getByteCount()) + - "] bytes at position [" + toString(startByte) + "]"; + Isis::toString(chunkToFill.getByteCount()) + + "] bytes at position [" + Isis::toString(startByte) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -114,8 +114,8 @@ namespace Isis { if(!success) { IString msg = "Writing to the file [" + dataFile->fileName().toStdString() + "] " "failed with writing [" + - toString(chunkToWrite.getByteCount()) + - "] bytes at position [" + toString(startByte) + "]"; + Isis::toString(chunkToWrite.getByteCount()) + + "] bytes at position [" + Isis::toString(startByte) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/Cube/CubeTileHandler.cpp b/isis/src/base/objs/Cube/CubeTileHandler.cpp index f6e257cc67..319b2d327e 100644 --- a/isis/src/base/objs/Cube/CubeTileHandler.cpp +++ b/isis/src/base/objs/Cube/CubeTileHandler.cpp @@ -67,9 +67,9 @@ namespace Isis { PvlObject &core = labels.findObject("IsisCube").findObject("Core"); core.addKeyword(PvlKeyword("Format", "Tile"), PvlContainer::Replace); - core.addKeyword(PvlKeyword("TileSamples", toString(getSampleCountInChunk())), + core.addKeyword(PvlKeyword("TileSamples", Isis::toString(getSampleCountInChunk())), PvlContainer::Replace); - core.addKeyword(PvlKeyword("TileLines", toString(getLineCountInChunk())), + core.addKeyword(PvlKeyword("TileLines", Isis::toString(getLineCountInChunk())), PvlContainer::Replace); } @@ -92,8 +92,8 @@ namespace Isis { if(!success) { IString msg = "Reading from the file [" + dataFile->fileName().toStdString() + "] " "failed with reading [" + - toString(chunkToFill.getByteCount()) + - "] bytes at position [" + toString(startByte) + "]"; + Isis::toString(chunkToFill.getByteCount()) + + "] bytes at position [" + Isis::toString(startByte) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -115,8 +115,8 @@ namespace Isis { if(!success) { IString msg = "Writing to the file [" + dataFile->fileName().toStdString() + "] " "failed with writing [" + - toString(chunkToWrite.getByteCount()) + - "] bytes at position [" + toString(startByte) + "]"; + Isis::toString(chunkToWrite.getByteCount()) + + "] bytes at position [" + Isis::toString(startByte) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/CubeAttribute/CubeAttribute.h b/isis/src/base/objs/CubeAttribute/CubeAttribute.h index c76474f247..05db708af7 100644 --- a/isis/src/base/objs/CubeAttribute/CubeAttribute.h +++ b/isis/src/base/objs/CubeAttribute/CubeAttribute.h @@ -54,7 +54,7 @@ namespace Isis { if(labelType == DetachedLabel) return "Detached"; if(labelType == ExternalLabel) return "External"; - std::string msg = "Invalid label attachment type [" + toString(labelType) + "]"; + std::string msg = "Invalid label attachment type [" + Isis::toString(labelType) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/CubeDataThread/CubeDataThread.cpp b/isis/src/base/objs/CubeDataThread/CubeDataThread.cpp index dd32cee25f..59842e5e28 100644 --- a/isis/src/base/objs/CubeDataThread/CubeDataThread.cpp +++ b/isis/src/base/objs/CubeDataThread/CubeDataThread.cpp @@ -197,7 +197,7 @@ namespace Isis { if (i == p_managedCubes->end()) { p_threadSafeMutex->unlock(); std::string msg = "CubeDataThread::RemoveCube failed because cube ID ["; - msg += std::to_string(cubeId); + msg += Isis::toString(cubeId); msg += "] not found"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -205,7 +205,7 @@ namespace Isis { if (p_managedDataSources->contains(cubeId)) { p_threadSafeMutex->unlock(); std::string msg = "CubeDataThread::RemoveCube failed cube ID ["; - msg += std::to_string(cubeId); + msg += Isis::toString(cubeId); msg += "] has requested Bricks"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/CubeStretch/CubeStretch.cpp b/isis/src/base/objs/CubeStretch/CubeStretch.cpp index 45ac2185f2..12717162c0 100644 --- a/isis/src/base/objs/CubeStretch/CubeStretch.cpp +++ b/isis/src/base/objs/CubeStretch/CubeStretch.cpp @@ -65,7 +65,7 @@ namespace Isis { setName(QString::fromStdString(blob.Label()["Name"][0])); setType(QString::fromStdString(blob.Label()["StretchType"][0])); Parse(QString::fromStdString(stringFromBuffer)); - setBandNumber(IString::ToInteger(blob.Label()["BandNumber"][0])); + setBandNumber(Isis::toInt(blob.Label()["BandNumber"][0])); } @@ -86,7 +86,7 @@ namespace Isis { blob.Label()["Name"] = getName().toStdString(); blob.Label() += PvlKeyword("StretchType", getType().toStdString()); - blob.Label() += PvlKeyword("BandNumber", toString(getBandNumber())); + blob.Label() += PvlKeyword("BandNumber", Isis::toString(getBandNumber())); std::string blobString = Text().toStdString(); blob.setData(blobString.c_str(), blobString.size()); return blob; diff --git a/isis/src/base/objs/DemShape/unitTest.cpp b/isis/src/base/objs/DemShape/unitTest.cpp index 06af88a2a6..31c6914750 100644 --- a/isis/src/base/objs/DemShape/unitTest.cpp +++ b/isis/src/base/objs/DemShape/unitTest.cpp @@ -74,7 +74,7 @@ int main() { cout << " Shape name is " << shape.name().toStdString() << endl; cout << " Shape name is " << defaultShape.name().toStdString() << endl; - cout << " Shape is DEM type? " << toString(shape.isDEM()) << endl; + cout << " Shape is DEM type? " << Isis::toString((bool)shape.isDEM()) << endl; cout << endl << " Testing method intersectSurface..." << endl; cout << " Do we have an intersection? " << shape.hasIntersection() << endl; diff --git a/isis/src/base/objs/EllipsoidShape/unitTest.cpp b/isis/src/base/objs/EllipsoidShape/unitTest.cpp index 1e10d6b7df..91c8d11e3e 100644 --- a/isis/src/base/objs/EllipsoidShape/unitTest.cpp +++ b/isis/src/base/objs/EllipsoidShape/unitTest.cpp @@ -61,7 +61,7 @@ int main() { cout << " Shape name is " << shape.name().toStdString() << endl; cout << " Shape2 name is " << shape2.name().toStdString() << endl; - cout << " Shape is DEM type?" << toString(shape.isDEM()) << endl; + cout << " Shape is DEM type?" << Isis::toString((bool)shape.isDEM()) << endl; std::vector sB(3); sB[0] = -2399.54; diff --git a/isis/src/base/objs/Enlarge/Enlarge.cpp b/isis/src/base/objs/Enlarge/Enlarge.cpp index bae8608458..a9388cc632 100644 --- a/isis/src/base/objs/Enlarge/Enlarge.cpp +++ b/isis/src/base/objs/Enlarge/Enlarge.cpp @@ -120,16 +120,16 @@ namespace Isis { // Information will be added to it if the Mapping or Instrument // groups are deleted from the output image label PvlGroup resultsGrp("Results"); - resultsGrp += PvlKeyword("InputLines", toString(iNumLines)); - resultsGrp += PvlKeyword("InputSamples", toString(iNumSamples)); - resultsGrp += PvlKeyword("StartingLine", toString((int)mdStartLine)); - resultsGrp += PvlKeyword("StartingSample", toString((int)mdStartSample)); - resultsGrp += PvlKeyword("EndingLine", toString((int)mdEndLine)); - resultsGrp += PvlKeyword("EndingSample", toString((int)mdEndSample)); - resultsGrp += PvlKeyword("LineIncrement", toString(1. / mdLineScale)); - resultsGrp += PvlKeyword("SampleIncrement", toString(1. / mdSampleScale)); - resultsGrp += PvlKeyword("OutputLines", toString(miOutputLines)); - resultsGrp += PvlKeyword("OutputSamples", toString(miOutputSamples)); + resultsGrp += PvlKeyword("InputLines", Isis::toString(iNumLines)); + resultsGrp += PvlKeyword("InputSamples", Isis::toString(iNumSamples)); + resultsGrp += PvlKeyword("StartingLine", Isis::toString((int)mdStartLine)); + resultsGrp += PvlKeyword("StartingSample", Isis::toString((int)mdStartSample)); + resultsGrp += PvlKeyword("EndingLine", Isis::toString((int)mdEndLine)); + resultsGrp += PvlKeyword("EndingSample", Isis::toString((int)mdEndSample)); + resultsGrp += PvlKeyword("LineIncrement", Isis::toString(1. / mdLineScale)); + resultsGrp += PvlKeyword("SampleIncrement", Isis::toString(1. / mdSampleScale)); + resultsGrp += PvlKeyword("OutputLines", Isis::toString(miOutputLines)); + resultsGrp += PvlKeyword("OutputSamples", Isis::toString(miOutputSamples)); SubArea subArea; subArea.SetSubArea(mInCube->lineCount(), mInCube->sampleCount(), (int)mdStartLine, (int)mdStartSample, diff --git a/isis/src/base/objs/Equalization/Equalization.cpp b/isis/src/base/objs/Equalization/Equalization.cpp index bc08a8d56a..4fa9ac8573 100644 --- a/isis/src/base/objs/Equalization/Equalization.cpp +++ b/isis/src/base/objs/Equalization/Equalization.cpp @@ -332,16 +332,16 @@ namespace Isis { PvlObject equ("EqualizationInformation"); PvlGroup gen("General"); - gen += PvlKeyword("TotalOverlaps", std::to_string(m_validCnt + m_invalidCnt)); - gen += PvlKeyword("ValidOverlaps", std::to_string(m_validCnt)); - gen += PvlKeyword("InvalidOverlaps", std::to_string(m_invalidCnt)); - gen += PvlKeyword("MinCount", std::to_string(m_mincnt)); - gen += PvlKeyword("SamplingPercent", std::to_string(m_samplingPercent)); + gen += PvlKeyword("TotalOverlaps", Isis::toString(m_validCnt + m_invalidCnt)); + gen += PvlKeyword("ValidOverlaps", Isis::toString(m_validCnt)); + gen += PvlKeyword("InvalidOverlaps", Isis::toString(m_invalidCnt)); + gen += PvlKeyword("MinCount", Isis::toString(m_mincnt)); + gen += PvlKeyword("SamplingPercent", Isis::toString(m_samplingPercent)); gen += PvlKeyword("Weighted", (m_wtopt) ? "true" : "false"); int solType = m_sType; int lsqMethod = m_lsqMethod; - gen += PvlKeyword("SolutionType", std::to_string(solType)); - gen += PvlKeyword("SolveMethod" , std::to_string(lsqMethod)); + gen += PvlKeyword("SolutionType", Isis::toString(solType)); + gen += PvlKeyword("SolveMethod" , Isis::toString(lsqMethod)); PvlKeyword nonOverlaps("NonOverlaps"); for (int img = 0; img < m_badFiles.size(); img++) { nonOverlaps += m_badFiles[img].toStdString(); @@ -386,18 +386,18 @@ namespace Isis { if (m_sType == OverlapNormalization::Both || m_sType == OverlapNormalization::Gains || m_sType == OverlapNormalization::GainsWithoutNormalization) { - bandStats += std::to_string(m_adjustments[img]->getGain(band - 1)); + bandStats += Isis::toString(m_adjustments[img]->getGain(band - 1)); } // OFFSET if (m_sType == OverlapNormalization::Both || m_sType == OverlapNormalization::Offsets) { - bandStats += std::to_string(m_adjustments[img]->getOffset(band - 1)); + bandStats += Isis::toString(m_adjustments[img]->getOffset(band - 1)); } // AVERAGE if (m_sType == OverlapNormalization::Both || m_sType == OverlapNormalization::Gains || m_sType == OverlapNormalization::Offsets) { - bandStats += std::to_string(m_adjustments[img]->getAverage(band - 1)); + bandStats += Isis::toString(m_adjustments[img]->getAverage(band - 1)); } norm += bandStats; } @@ -468,9 +468,9 @@ namespace Isis { // Get and store the modifiers for each band for (int band = 1; band < normalization.keywords(); band++) { - adjustment->addGain(IString::ToDouble(normalization[band][0])); - adjustment->addOffset(IString::ToDouble(normalization[band][1])); - adjustment->addAverage(IString::ToDouble(normalization[band][2])); + adjustment->addGain(Isis::toDouble(normalization[band][0])); + adjustment->addOffset(Isis::toDouble(normalization[band][1])); + adjustment->addAverage(Isis::toDouble(normalization[band][2])); } addAdjustment(adjustment); @@ -815,7 +815,7 @@ namespace Isis { m_mincnt = eqGen["MinCount"]; m_wtopt = (eqGen["Weighted"][0] == "true") ? true : false; m_sType = static_cast((int)eqGen["SolutionType"]); - m_lsqMethod = static_cast(IString::ToInteger(eqGen["SolveMethod"][0])); + m_lsqMethod = static_cast(Isis::toInt(eqGen["SolveMethod"][0])); // Unserialize previous overlap statistics PvlObject::ConstPvlObjectIterator curObj = inStats.beginObject(); diff --git a/isis/src/base/objs/EquatorialCylindricalShape/unitTest.cpp b/isis/src/base/objs/EquatorialCylindricalShape/unitTest.cpp index daafff7c48..d8cf90149f 100644 --- a/isis/src/base/objs/EquatorialCylindricalShape/unitTest.cpp +++ b/isis/src/base/objs/EquatorialCylindricalShape/unitTest.cpp @@ -59,7 +59,7 @@ int main() { EquatorialCylindricalShape shape(&targ, pvl); cout << "Shape name is " << shape.name().toStdString() << endl; - cout << "Shape is DEM type? " << toString(shape.isDEM()) << endl; + cout << "Shape is DEM type? " << Isis::toString((bool)shape.isDEM()) << endl; cout << endl << "Testing method intersectSurface..." << endl; cout << " Do we have an intersection? " << shape.hasIntersection() << endl; diff --git a/isis/src/base/objs/Equirectangular/Equirectangular.cpp b/isis/src/base/objs/Equirectangular/Equirectangular.cpp index 4c7e79eed6..3d6587ae3e 100644 --- a/isis/src/base/objs/Equirectangular/Equirectangular.cpp +++ b/isis/src/base/objs/Equirectangular/Equirectangular.cpp @@ -56,7 +56,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLongitude")) { if (allowDefaults) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } else { std::string message = "Cannot project using Equirectangular Cylindrical"; @@ -69,7 +69,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLatitude")) { if (allowDefaults) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(lat)); } else { std::string message = "Cannot project using Equirectangular Cylindrical"; @@ -95,7 +95,7 @@ namespace Isis { mapGroup += PvlKeyword("CenterLatitudeRadius"); } - mapGroup["CenterLatitudeRadius"] = toString(m_clatRadius); + mapGroup["CenterLatitudeRadius"] = Isis::toString(m_clatRadius); // Compute cos of the center latitude and make sure it is valid as // we will be dividing with it later on diff --git a/isis/src/base/objs/Equirectangular/unitTest.cpp b/isis/src/base/objs/Equirectangular/unitTest.cpp index b950986c25..76efe49e24 100644 --- a/isis/src/base/objs/Equirectangular/unitTest.cpp +++ b/isis/src/base/objs/Equirectangular/unitTest.cpp @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGroup += PvlKeyword("PolarRadius", toString(1.0)); + mapGroup += PvlKeyword("EquatorialRadius", Isis::toString(1.0)); + mapGroup += PvlKeyword("PolarRadius", Isis::toString(1.0)); mapGroup += PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(180.0)); + mapGroup += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mapGroup += PvlKeyword("MinimumLatitude", Isis::toString(-90.0)); + mapGroup += PvlKeyword("MaximumLatitude", Isis::toString(90.0)); + mapGroup += PvlKeyword("MinimumLongitude", Isis::toString(-180.0)); + mapGroup += PvlKeyword("MaximumLongitude", Isis::toString(180.0)); mapGroup += PvlKeyword("ProjectionName", "Equirectangular"); cout << "Test missing center longitude keyword ..." << endl; @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(-90.0)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(-90.0)); cout << "Test missing center latitude keyword ..." << endl; try { @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLatitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(0.0)); Projection &proj = *ProjectionFactory::Create(lab); TProjection *p = (TProjection *) &proj; @@ -109,8 +109,8 @@ int main(int argc, char *argv[]) { cout << "Testing allow defaults option ... " << endl; mapGroup.deleteKeyword("CenterLongitude"); mapGroup.deleteKeyword("CenterLatitude"); - mapGroup.findKeyword("MinimumLatitude").setValue(toString(0.0)); - mapGroup.findKeyword("MinimumLongitude").setValue(toString(0.0)); + mapGroup.findKeyword("MinimumLatitude").setValue(Isis::toString(0.0)); + mapGroup.findKeyword("MinimumLongitude").setValue(Isis::toString(0.0)); mapGroup.findKeyword("LongitudeDirection").setValue("PositiveWest"); Equirectangular p2(lab, true); cout << lab << endl; @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) { cout << endl; std::cout << "Check Invalid Latitude" << std::endl; - mapGroup.addKeyword(PvlKeyword("CenterLatitude", toString(90.0)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("CenterLatitude", Isis::toString(90.0)), Pvl::Replace); std::cout << mapGroup << std::endl; try { Equirectangular p2(lab); diff --git a/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp b/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp index 34247b7b50..5c5ab29188 100644 --- a/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp +++ b/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp @@ -126,16 +126,16 @@ namespace Isis { // NOTE: this class is currently only exporting BINARY format PDS tables. // implementation may be added later to export ASCII PDS tables. pdsTableLabelInfo.addKeyword(PvlKeyword("INTERCHANGE_FORMAT", "BINARY")); - pdsTableLabelInfo.addKeyword(PvlKeyword("ROWS", toString(m_isisTable->Records()))); - pdsTableLabelInfo.addKeyword(PvlKeyword("COLUMNS", toString(m_isisTable->RecordFields()))); - pdsTableLabelInfo.addKeyword(PvlKeyword("ROW_BYTES", toString(m_rowBytes))); - pdsTableLabelInfo.addKeyword(PvlKeyword("ROW_SUFFIX_BYTES", toString(m_outputRecordBytes - m_rowBytes))); + pdsTableLabelInfo.addKeyword(PvlKeyword("ROWS", Isis::toString(m_isisTable->Records()))); + pdsTableLabelInfo.addKeyword(PvlKeyword("COLUMNS", Isis::toString(m_isisTable->RecordFields()))); + pdsTableLabelInfo.addKeyword(PvlKeyword("ROW_BYTES", Isis::toString(m_rowBytes))); + pdsTableLabelInfo.addKeyword(PvlKeyword("ROW_SUFFIX_BYTES", Isis::toString(m_outputRecordBytes - m_rowBytes))); int startByte = 1; // PDS begins indexing at 1 for(int fieldIndex = 0; fieldIndex < m_isisTable->RecordFields(); fieldIndex++) { int columnBytes = 0; TableField field = (*m_isisTable)[0][fieldIndex]; PvlObject columnObj("COLUMN"); - columnObj.addKeyword(PvlKeyword("COLUMN_NUMBER", toString(fieldIndex + 1))); + columnObj.addKeyword(PvlKeyword("COLUMN_NUMBER", Isis::toString(fieldIndex + 1))); columnObj.addKeyword(PvlKeyword("NAME", field.name())); @@ -185,9 +185,9 @@ namespace Isis { "field type found for [" + field.name() + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } - columnObj.addKeyword(PvlKeyword("START_BYTE", toString(startByte))); + columnObj.addKeyword(PvlKeyword("START_BYTE", Isis::toString(startByte))); startByte += columnBytes; - columnObj.addKeyword(PvlKeyword("BYTES", toString(columnBytes))); + columnObj.addKeyword(PvlKeyword("BYTES", Isis::toString(columnBytes))); pdsTableLabelInfo.addObject(columnObj); } return pdsTableLabelInfo; diff --git a/isis/src/base/objs/ExportPdsTable/unitTest.cpp b/isis/src/base/objs/ExportPdsTable/unitTest.cpp index ad1bcd875b..f46b54f97e 100644 --- a/isis/src/base/objs/ExportPdsTable/unitTest.cpp +++ b/isis/src/base/objs/ExportPdsTable/unitTest.cpp @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) { FileName lsbLabelFile("$temporary/lsbPdsTable.lbl"); ofstream outputLsbLabel((lsbLabelFile.expanded()).c_str()); outputLsbLabel << PvlKeyword("RECORD_TYPE", "FIXED_LENGTH") << endl; - outputLsbLabel << PvlKeyword("RECORD_BYTES", toString(tableRecBytes)) << endl; + outputLsbLabel << PvlKeyword("RECORD_BYTES", Isis::toString(tableRecBytes)) << endl; QString tableName = ExportPdsTable::formatPdsTableName(QString::fromStdString(table.Name())); outputLsbLabel << PvlKeyword("^" + tableName.toStdString(), "lsbPdsTable.dat") << endl; outputLsbLabel << endl; @@ -76,10 +76,10 @@ int main(int argc, char *argv[]) { cout << reimportedLsbTable[0][2].name() << "\t"; cout << reimportedLsbTable[0][3].name() << "\n"; for (int i = 0; i < reimportedLsbTable.Records(); i++) { - cout << toString((double) reimportedLsbTable[i][0]) << "\t\t\t"; - cout << toString((int) reimportedLsbTable[i][1]) << "\t\t\t\t"; + cout << Isis::toString((double) reimportedLsbTable[i][0]) << "\t\t\t"; + cout << Isis::toString((int) reimportedLsbTable[i][1]) << "\t\t\t\t"; cout << (std::string) reimportedLsbTable[i][2] << "\t\t\t"; - cout << toString((float) reimportedLsbTable[i][3]) << "\n"; + cout << Isis::toString((float) reimportedLsbTable[i][3]) << "\n"; } // remove files and reset buffer QFile::remove(QString::fromStdString(lsbLabelFile.expanded())); @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) { FileName msbLabelFile("$temporary/msbPdsTable.lbl"); ofstream outputMsbLabel((msbLabelFile.expanded()).c_str()); outputMsbLabel << PvlKeyword("RECORD_TYPE", "FIXED_LENGTH") << endl; - outputMsbLabel << PvlKeyword("RECORD_BYTES", toString(tableRecBytes)) << endl; + outputMsbLabel << PvlKeyword("RECORD_BYTES", Isis::toString(tableRecBytes)) << endl; outputMsbLabel << PvlKeyword("^" + tableName.toStdString(), "msbPdsTable.dat") << endl; outputMsbLabel << endl; // Add table object to label keywords diff --git a/isis/src/base/objs/FitsToJson/FitsToJson.cpp b/isis/src/base/objs/FitsToJson/FitsToJson.cpp index eded25e81f..a49f9888f9 100644 --- a/isis/src/base/objs/FitsToJson/FitsToJson.cpp +++ b/isis/src/base/objs/FitsToJson/FitsToJson.cpp @@ -123,16 +123,16 @@ namespace Isis { bytesPerPixel /= 8; unsigned int axis1 = 1; - axis1 = IString::ToInteger((*fitsLabel)["NAXIS1"]); + axis1 = Isis::toInt((*fitsLabel)["NAXIS1"]); unsigned int axis2 = 1; if (fitsLabel->hasKeyword("NAXIS2")) { - axis2 = IString::ToInteger((*fitsLabel)["NAXIS2"]); + axis2 = Isis::toInt((*fitsLabel)["NAXIS2"]); } unsigned int axis3 = 1; if (fitsLabel->hasKeyword("NAXIS3")) { - axis3 = IString::ToInteger((*fitsLabel)["NAXIS3"]); + axis3 = Isis::toInt((*fitsLabel)["NAXIS3"]); } jump = (int)(ceil(bytesPerPixel * axis1 * axis2 * axis3 / 2880.0) * 2880.0); diff --git a/isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp b/isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp index d9a7d186ca..0810d71bd9 100644 --- a/isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp +++ b/isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp @@ -441,11 +441,11 @@ namespace Isis { PvlGroup pluginInfo(grpName.toStdString()); PvlKeyword name("Name", Algorithm().toStdString()); - PvlKeyword minThickness("MinimumThickness", toString(MinimumThickness())); - PvlKeyword minArea("MinimumArea", toString(MinimumArea())); - PvlKeyword xSpac("XSpacing", toString(p_Xspacing)); - PvlKeyword ySpac("YSpacing", toString(p_Yspacing)); - PvlKeyword subGrid("SubGrid", toString(p_subGrid)); + PvlKeyword minThickness("MinimumThickness", Isis::toString(MinimumThickness())); + PvlKeyword minArea("MinimumArea", Isis::toString(MinimumArea())); + PvlKeyword xSpac("XSpacing", Isis::toString(p_Xspacing)); + PvlKeyword ySpac("YSpacing", Isis::toString(p_Yspacing)); + PvlKeyword subGrid("SubGrid", Isis::toString(p_subGrid)); pluginInfo.addKeyword(name); pluginInfo.addKeyword(minThickness); diff --git a/isis/src/base/objs/GridPolygonSeeder/unitTest.cpp b/isis/src/base/objs/GridPolygonSeeder/unitTest.cpp index ebe7db51c2..d4ebbd8227 100644 --- a/isis/src/base/objs/GridPolygonSeeder/unitTest.cpp +++ b/isis/src/base/objs/GridPolygonSeeder/unitTest.cpp @@ -39,14 +39,14 @@ int main() { if(!alg.hasKeyword("Name")) { cout << "Test without subgrid" << endl; alg += PvlKeyword("Name", "Grid"); - alg += PvlKeyword("MinimumThickness", toString(0.3)); - alg += PvlKeyword("MinimumArea", toString(10)); - alg += PvlKeyword("XSpacing", toString(1500)); - alg += PvlKeyword("YSpacing", toString(1500)); + alg += PvlKeyword("MinimumThickness", Isis::toString(0.3)); + alg += PvlKeyword("MinimumArea", Isis::toString(10)); + alg += PvlKeyword("XSpacing", Isis::toString(1500)); + alg += PvlKeyword("YSpacing", Isis::toString(1500)); } else { cout << "Test with subgrid" << endl; - alg += PvlKeyword("SubGrid", toString(true)); + alg += PvlKeyword("SubGrid", Isis::toString(true)); } PvlObject o("AutoSeed"); @@ -93,9 +93,9 @@ int main() { mapGroup += Isis::PvlKeyword("PolarRadius", radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); - mapGroup += Isis::PvlKeyword("CenterLatitude", toString(0)); - mapGroup += Isis::PvlKeyword("CenterLongitude", toString(0)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", Isis::toString(360)); + mapGroup += Isis::PvlKeyword("CenterLatitude", Isis::toString(0)); + mapGroup += Isis::PvlKeyword("CenterLongitude", Isis::toString(0)); mapGroup += Isis::PvlKeyword("ProjectionName", "Sinusoidal"); TProjection *proj = (TProjection *) Isis::ProjectionFactory::Create(maplab); @@ -155,9 +155,9 @@ int main() { mapGroup += Isis::PvlKeyword("PolarRadius", radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); - mapGroup += Isis::PvlKeyword("CenterLatitude", toString(0)); - mapGroup += Isis::PvlKeyword("CenterLongitude", toString(0)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", Isis::toString(360)); + mapGroup += Isis::PvlKeyword("CenterLatitude", Isis::toString(0)); + mapGroup += Isis::PvlKeyword("CenterLongitude", Isis::toString(0)); mapGroup += Isis::PvlKeyword("ProjectionName", "Sinusoidal"); TProjection *proj = (TProjection *) Isis::ProjectionFactory::Create(maplab); diff --git a/isis/src/base/objs/GroundGrid/GroundGrid.cpp b/isis/src/base/objs/GroundGrid/GroundGrid.cpp index d0c02a5cc6..9f6db4b72c 100644 --- a/isis/src/base/objs/GroundGrid/GroundGrid.cpp +++ b/isis/src/base/objs/GroundGrid/GroundGrid.cpp @@ -98,7 +98,7 @@ namespace Isis { Distance::Meters); if (p_mapping->hasKeyword("MinimumLatitude")) { - p_minLat = new Latitude(IString::ToDouble((*p_mapping)["MinimumLatitude"][0]), + p_minLat = new Latitude(Isis::toDouble((*p_mapping)["MinimumLatitude"][0]), *p_mapping, Angle::Degrees, Latitude::AllowPastPole); @@ -108,7 +108,7 @@ namespace Isis { } if (p_mapping->hasKeyword("MaximumLatitude")) { - p_maxLat = new Latitude(IString::ToDouble((*p_mapping)["MaximumLatitude"][0]), + p_maxLat = new Latitude(Isis::toDouble((*p_mapping)["MaximumLatitude"][0]), *p_mapping, Angle::Degrees); } @@ -117,7 +117,7 @@ namespace Isis { } if (p_mapping->hasKeyword("MinimumLongitude")) { - p_minLon = new Longitude(IString::ToDouble((*p_mapping)["MinimumLongitude"][0]), + p_minLon = new Longitude(Isis::toDouble((*p_mapping)["MinimumLongitude"][0]), *p_mapping, Angle::Degrees); } @@ -126,7 +126,7 @@ namespace Isis { } if (p_mapping->hasKeyword("MaximumLongitude")) { - p_maxLon = new Longitude(IString::ToDouble((*p_mapping)["MaximumLongitude"][0]), + p_maxLon = new Longitude(Isis::toDouble((*p_mapping)["MaximumLongitude"][0]), *p_mapping, Angle::Degrees); } diff --git a/isis/src/base/objs/Gruen/Gruen.cpp b/isis/src/base/objs/Gruen/Gruen.cpp index de9b19123d..f8e7a373fb 100644 --- a/isis/src/base/objs/Gruen/Gruen.cpp +++ b/isis/src/base/objs/Gruen/Gruen.cpp @@ -832,7 +832,7 @@ namespace Isis { } if (m_unclassified > 0) { - algo += PvlKeyword("UnclassifiedErrors", toString(m_unclassified)); + algo += PvlKeyword("UnclassifiedErrors", Isis::toString(m_unclassified)); } pvl.addGroup(algo); pvl.addGroup(StatsLog()); @@ -853,7 +853,7 @@ namespace Isis { PvlGroup Gruen::StatsLog() const { PvlGroup stats("GruenStatistics"); - stats += PvlKeyword("TotalIterations", toString(m_totalIterations)); + stats += PvlKeyword("TotalIterations", Isis::toString(m_totalIterations)); stats += ValidateKey("IterationMinimum", m_iterStat.Minimum()); stats += ValidateKey("IterationAverage", m_iterStat.Average()); stats += ValidateKey("IterationMaximum", m_iterStat.Maximum()); @@ -890,7 +890,7 @@ namespace Isis { PvlGroup Gruen::ParameterLog() const { PvlGroup parms("GruenParameters"); - parms += PvlKeyword("MaximumIterations", toString(m_maxIters)); + parms += PvlKeyword("MaximumIterations", Isis::toString(m_maxIters)); parms += ValidateKey("AffineScaleTolerance", m_scaleTol); parms += ValidateKey("AffineShearTolerance", m_shearTol); parms += ValidateKey("AffineTranslationTolerance", m_transTol); @@ -976,22 +976,22 @@ namespace Isis { if (m_prof.Name().isEmpty()) m_prof.setName("Gruen"); // Define internal parameters - m_maxIters = toInt(ConfKey(m_prof, "MaximumIterations", toString(30))); + m_maxIters = Isis::toInt(ConfKey(m_prof, "MaximumIterations", Isis::toString(30))); - m_transTol = toDouble(ConfKey(m_prof, "AffineTranslationTolerance", toString(0.1))); - m_scaleTol = toDouble(ConfKey(m_prof, "AffineScaleTolerance", toString(0.3))); - m_shearTol = toDouble(ConfKey(m_prof, "AffineShearTolerance", toString(m_scaleTol))); - m_affineTol = toDouble(ConfKey(m_prof, "AffineTolerance", toString(DBL_MAX))); + m_transTol = Isis::toDouble(ConfKey(m_prof, "AffineTranslationTolerance", Isis::toString(0.1))); + m_scaleTol = Isis::toDouble(ConfKey(m_prof, "AffineScaleTolerance", Isis::toString(0.3))); + m_shearTol = Isis::toDouble(ConfKey(m_prof, "AffineShearTolerance", Isis::toString(m_scaleTol))); + m_affineTol = Isis::toDouble(ConfKey(m_prof, "AffineTolerance", Isis::toString(DBL_MAX))); - m_spiceTol = toDouble(ConfKey(m_prof, "SpiceTolerance", toString(DBL_MAX))); + m_spiceTol = Isis::toDouble(ConfKey(m_prof, "SpiceTolerance", Isis::toString(DBL_MAX))); - m_shiftTol = toDouble(ConfKey(m_prof, "RadioShiftTolerance", toString(DBL_MAX))); - m_rgainMinTol = toDouble(ConfKey(m_prof, "RadioGainMinTolerance", toString(-DBL_MAX))); - m_rgainMaxTol = toDouble(ConfKey(m_prof, "RadioGainMaxTolerance", toString(DBL_MAX))); + m_shiftTol = Isis::toDouble(ConfKey(m_prof, "RadioShiftTolerance", Isis::toString(DBL_MAX))); + m_rgainMinTol = Isis::toDouble(ConfKey(m_prof, "RadioGainMinTolerance", Isis::toString(-DBL_MAX))); + m_rgainMaxTol = Isis::toDouble(ConfKey(m_prof, "RadioGainMaxTolerance", Isis::toString(DBL_MAX))); // Set radiometric defaults - m_defGain = toDouble(ConfKey(m_prof, "DefaultRadioGain", toString(0.0))); - m_defShift = toDouble(ConfKey(m_prof, "DefaultRadioShift", toString(0.0))); + m_defGain = Isis::toDouble(ConfKey(m_prof, "DefaultRadioGain", Isis::toString(0.0))); + m_defShift = Isis::toDouble(ConfKey(m_prof, "DefaultRadioShift", Isis::toString(0.0))); m_callCount = 0; m_filePattern = ""; diff --git a/isis/src/base/objs/Gruen/Gruen.h b/isis/src/base/objs/Gruen/Gruen.h index 7d55bd138f..2604f9cffb 100644 --- a/isis/src/base/objs/Gruen/Gruen.h +++ b/isis/src/base/objs/Gruen/Gruen.h @@ -171,7 +171,7 @@ namespace Isis { inline int Errno() const { return (m_gerrno); } inline BigInt Count() const { return (m_count); } inline void BumpIt() { m_count++; } - PvlKeyword LogIt() const { return (PvlKeyword(m_keyname.toStdString(), toString(m_count))); } + PvlKeyword LogIt() const { return (PvlKeyword(m_keyname.toStdString(), Isis::toString(m_count))); } int m_gerrno; QString m_keyname; @@ -325,7 +325,7 @@ namespace Isis { return (PvlKeyword(keyname.toStdString(), "NULL")); } else { - return (PvlKeyword(keyname.toStdString(), toString(value), unit.toStdString())); + return (PvlKeyword(keyname.toStdString(), Isis::toString(value), unit.toStdString())); } } diff --git a/isis/src/base/objs/Gruen/unitTest.cpp b/isis/src/base/objs/Gruen/unitTest.cpp index 89a7bd8899..7d7998b41f 100644 --- a/isis/src/base/objs/Gruen/unitTest.cpp +++ b/isis/src/base/objs/Gruen/unitTest.cpp @@ -23,18 +23,18 @@ int main() { try { PvlGroup alg("Algorithm"); alg += PvlKeyword("Name", "Gruen"); - alg += PvlKeyword("Tolerance", toString(100.0)); - alg += PvlKeyword("AffineTranslationTolerance", toString(0.15)); - alg += PvlKeyword("AffineScaleTolerance", toString(0.3)); - alg += PvlKeyword("MaximumIterations", toString(30)); + alg += PvlKeyword("Tolerance", Isis::toString(100.0)); + alg += PvlKeyword("AffineTranslationTolerance", Isis::toString(0.15)); + alg += PvlKeyword("AffineScaleTolerance", Isis::toString(0.3)); + alg += PvlKeyword("MaximumIterations", Isis::toString(30)); PvlGroup pchip("PatternChip"); - pchip += PvlKeyword("Samples", toString(19)); - pchip += PvlKeyword("Lines", toString(19)); + pchip += PvlKeyword("Samples", Isis::toString(19)); + pchip += PvlKeyword("Lines", Isis::toString(19)); PvlGroup schip("SearchChip"); - schip += PvlKeyword("Samples", toString(25)); - schip += PvlKeyword("Lines", toString(25)); + schip += PvlKeyword("Samples", Isis::toString(25)); + schip += PvlKeyword("Lines", Isis::toString(25)); PvlObject o("AutoRegistration"); o.addGroup(alg); diff --git a/isis/src/base/objs/Hapke/unitTest.cpp b/isis/src/base/objs/Hapke/unitTest.cpp index 16282d055f..870c37f269 100644 --- a/isis/src/base/objs/Hapke/unitTest.cpp +++ b/isis/src/base/objs/Hapke/unitTest.cpp @@ -52,12 +52,12 @@ int main() { PvlGroup algp2("Algorithm"); algp2 += PvlKeyword("Name", "HapkeHen"); - algp2 += PvlKeyword("Wh", toString(0.52)); - algp2 += PvlKeyword("B0", toString(1.0)); - algp2 += PvlKeyword("Hh", toString(1.0)); - algp2 += PvlKeyword("Theta", toString(30.0)); - algp2 += PvlKeyword("Hg1", toString(0.213)); - algp2 += PvlKeyword("Hg2", toString(1.0)); + algp2 += PvlKeyword("Wh", Isis::toString(0.52)); + algp2 += PvlKeyword("B0", Isis::toString(1.0)); + algp2 += PvlKeyword("Hh", Isis::toString(1.0)); + algp2 += PvlKeyword("Theta", Isis::toString(30.0)); + algp2 += PvlKeyword("Hg1", Isis::toString(0.213)); + algp2 += PvlKeyword("Hg2", Isis::toString(1.0)); algp2 += PvlKeyword("ZeroB0St", "TRUE"); PvlObject op2("PhotometricModel"); @@ -88,12 +88,12 @@ int main() { PvlGroup algp3("Algorithm"); algp3 += PvlKeyword("Name", "HapkeHen"); - algp3 += PvlKeyword("Wh", toString(0.52)); - algp3 += PvlKeyword("B0", toString(1.0)); - algp3 += PvlKeyword("Hh", toString(1.0)); - algp3 += PvlKeyword("Theta", toString(30.0)); - algp3 += PvlKeyword("Hg1", toString(0.213)); - algp3 += PvlKeyword("Hg2", toString(1.0)); + algp3 += PvlKeyword("Wh", Isis::toString(0.52)); + algp3 += PvlKeyword("B0", Isis::toString(1.0)); + algp3 += PvlKeyword("Hh", Isis::toString(1.0)); + algp3 += PvlKeyword("Theta", Isis::toString(30.0)); + algp3 += PvlKeyword("Hg1", Isis::toString(0.213)); + algp3 += PvlKeyword("Hg2", Isis::toString(1.0)); algp3 += PvlKeyword("ZeroB0St", "YES"); PvlObject op3("PhotometricModel"); @@ -127,12 +127,12 @@ int main() { PvlGroup algp4("Algorithm"); algp4 += PvlKeyword("Name", "HapkeLeg"); - algp4 += PvlKeyword("Wh", toString(0.52)); - algp4 += PvlKeyword("B0", toString(1.0)); - algp4 += PvlKeyword("Hh", toString(1.0)); - algp4 += PvlKeyword("Bh", toString(0.0)); - algp4 += PvlKeyword("Ch", toString(0.0)); - algp4 += PvlKeyword("Theta", toString(30.0)); + algp4 += PvlKeyword("Wh", Isis::toString(0.52)); + algp4 += PvlKeyword("B0", Isis::toString(1.0)); + algp4 += PvlKeyword("Hh", Isis::toString(1.0)); + algp4 += PvlKeyword("Bh", Isis::toString(0.0)); + algp4 += PvlKeyword("Ch", Isis::toString(0.0)); + algp4 += PvlKeyword("Theta", Isis::toString(30.0)); algp4 += PvlKeyword("ZeroB0Standard", "FALSE"); PvlObject op4("PhotometricModel"); @@ -163,12 +163,12 @@ int main() { PvlGroup algp5("Algorithm"); algp5 += PvlKeyword("Name", "HapkeLeg"); - algp5 += PvlKeyword("Wh", toString(0.52)); - algp5 += PvlKeyword("B0", toString(1.0)); - algp5 += PvlKeyword("Hh", toString(1.0)); - algp5 += PvlKeyword("Bh", toString(0.0)); - algp5 += PvlKeyword("Ch", toString(0.0)); - algp5 += PvlKeyword("Theta", toString(30.0)); + algp5 += PvlKeyword("Wh", Isis::toString(0.52)); + algp5 += PvlKeyword("B0", Isis::toString(1.0)); + algp5 += PvlKeyword("Hh", Isis::toString(1.0)); + algp5 += PvlKeyword("Bh", Isis::toString(0.0)); + algp5 += PvlKeyword("Ch", Isis::toString(0.0)); + algp5 += PvlKeyword("Theta", Isis::toString(30.0)); algp5 += PvlKeyword("ZeroB0Standard", "NO"); PvlObject op5("PhotometricModel"); @@ -199,12 +199,12 @@ int main() { PvlGroup algp6("Algorithm"); algp6 += PvlKeyword("Name", "HapkeLeg"); - algp6 += PvlKeyword("Wh", toString(0.52)); - algp6 += PvlKeyword("B0", toString(1.0)); - algp6 += PvlKeyword("Hh", toString(1.0)); - algp6 += PvlKeyword("Bh", toString(0.0)); - algp6 += PvlKeyword("Ch", toString(0.0)); - algp6 += PvlKeyword("Theta", toString(30.0)); + algp6 += PvlKeyword("Wh", Isis::toString(0.52)); + algp6 += PvlKeyword("B0", Isis::toString(1.0)); + algp6 += PvlKeyword("Hh", Isis::toString(1.0)); + algp6 += PvlKeyword("Bh", Isis::toString(0.0)); + algp6 += PvlKeyword("Ch", Isis::toString(0.0)); + algp6 += PvlKeyword("Theta", Isis::toString(30.0)); algp6 += PvlKeyword("ZeroB0Standard", "MAYBE"); PvlObject op6("PhotometricModel"); diff --git a/isis/src/base/objs/Hillshade/Hillshade.cpp b/isis/src/base/objs/Hillshade/Hillshade.cpp index 31db3911eb..4c8b505aac 100644 --- a/isis/src/base/objs/Hillshade/Hillshade.cpp +++ b/isis/src/base/objs/Hillshade/Hillshade.cpp @@ -164,7 +164,7 @@ namespace Isis { if (input.SampleDimension() != 3 || input.LineDimension() != 3 || input.BandDimension() != 1) { - throw IException(IException::Programmer,"Hillshade requires a 3x3x1 portal of data, but a " + std::to_string(input.SampleDimension()) + "x" + std::to_string(input.LineDimension()) + "x" + std::to_string(input.BandDimension()) + " portal of data was provided instead", + throw IException(IException::Programmer,"Hillshade requires a 3x3x1 portal of data, but a " + Isis::toString(input.SampleDimension()) + "x" + Isis::toString(input.LineDimension()) + "x" + Isis::toString(input.BandDimension()) + " portal of data was provided instead", _FILEINFO_); } diff --git a/isis/src/base/objs/IdealCamera/IdealCamera.cpp b/isis/src/base/objs/IdealCamera/IdealCamera.cpp index 09fada81b5..4d80620452 100644 --- a/isis/src/base/objs/IdealCamera/IdealCamera.cpp +++ b/isis/src/base/objs/IdealCamera/IdealCamera.cpp @@ -223,7 +223,7 @@ namespace Isis { NaifStatus::CheckErrors(); } else { - std::string msg = "Unknown InstrumentType [" + toString((int)inst["InstrumentType"]) + "]"; + std::string msg = "Unknown InstrumentType [" + Isis::toString((int)inst["InstrumentType"]) + "]"; throw IException(IException::User, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/ImageExporter/ImageExporter.cpp b/isis/src/base/objs/ImageExporter/ImageExporter.cpp index ee3a066583..a3f3a3ca1d 100644 --- a/isis/src/base/objs/ImageExporter/ImageExporter.cpp +++ b/isis/src/base/objs/ImageExporter/ImageExporter.cpp @@ -265,7 +265,7 @@ namespace Isis { break; default: throw IException(IException::Programmer, - "Cannot export an image with [" + toString(m_exportDescription->channelCount()) + + "Cannot export an image with [" + Isis::toString(m_exportDescription->channelCount()) + "] channels", _FILEINFO_); } diff --git a/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp b/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp index 3849137e33..a773ba0dc2 100644 --- a/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp +++ b/isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp @@ -142,7 +142,7 @@ namespace Isis { // check here. FileName tableFile(tempTblFile.toStdString()); try { - int tableStartRecord = IString::ToInteger(tableFile.baseName()); + int tableStartRecord = Isis::toInt(tableFile.baseName()); tempTblFile = pdsLabFile; m_pdsTableStart = tableStartRecord; } @@ -215,8 +215,8 @@ namespace Isis { if ((int) index >= columns() - 1) { std::string msg = "Unable to import the binary PDS table [" + m_tableName.toStdString() + "] into Isis. The requested column index [" - + toString((int) index) + "] exceeds the last column index [" - + toString(columns() - 1) + "]"; + + Isis::toString((int) index) + "] exceeds the last column index [" + + Isis::toString(columns() - 1) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } QString name = m_coldesc[index].m_name; @@ -617,8 +617,8 @@ namespace Isis { // Ensure the nrequested column is valid if ( (nth >= columns()) || ( nth < 0) ) { - std::string mess = "Index (" + toString(nth) + - ") into Columns invalid (max: " + toString(columns()) + ")"; + std::string mess = "Index (" + Isis::toString(nth) + + ") into Columns invalid (max: " + Isis::toString(columns()) + ")"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -958,7 +958,7 @@ namespace Isis { table += extract(m_rows[i], cols, record); } catch (IException &e) { - std::string msg = "Failed to convert data in row [" + toString((int) i) + "]"; + std::string msg = "Failed to convert data in row [" + Isis::toString((int) i) + "]"; throw IException(e, IException::Programmer, msg, _FILEINFO_); } } @@ -1111,7 +1111,7 @@ namespace Isis { std::string msg = "Only 4 byte integer values are supported in Isis. " "PDS Column [" + cdesc.m_name.toStdString() + "] has an integer DATA_TYPE with [BYTES = " - + toString(cdesc.m_numBytes) + "]."; + + Isis::toString(cdesc.m_numBytes) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } setPdsByteOrder("MSB"); @@ -1123,7 +1123,7 @@ namespace Isis { std::string msg = "Only 4 byte integer values are supported in Isis. " "PDS Column [" + cdesc.m_name.toStdString() + "] has an integer DATA_TYPE with [BYTES = " - + toString(cdesc.m_numBytes) + "]."; + + Isis::toString(cdesc.m_numBytes) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } setPdsByteOrder("LSB"); @@ -1145,7 +1145,7 @@ namespace Isis { IString msg = "Only 4 byte or 8 byte real values are supported in Isis. " "PDS Column [" + cdesc.m_name.toStdString() + "] has a real DATA_TYPE with [BYTES = " - + toString(cdesc.m_numBytes) + "]."; + + Isis::toString(cdesc.m_numBytes) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -1161,7 +1161,7 @@ namespace Isis { std::string msg = "Only 4 byte or 8 byte real values are supported in Isis. " "PDS Column [" + cdesc.m_name.toStdString() + "] has a real DATA_TYPE with [BYTES = " - + toString(cdesc.m_numBytes) + "]."; + + Isis::toString(cdesc.m_numBytes) + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } } diff --git a/isis/src/base/objs/InfixToPostfix/InfixToPostfix.cpp b/isis/src/base/objs/InfixToPostfix/InfixToPostfix.cpp index c91e24f292..68e9cb02e9 100644 --- a/isis/src/base/objs/InfixToPostfix/InfixToPostfix.cpp +++ b/isis/src/base/objs/InfixToPostfix/InfixToPostfix.cpp @@ -696,7 +696,7 @@ namespace Isis { if(argument == "") { throw IException(IException::User, - "Argument " + toString(argNum + 1) + " in function " + funcName.toStdString() + " must not be empty.", + "Argument " + Isis::toString(argNum + 1) + " in function " + funcName.toStdString() + " must not be empty.", _FILEINFO_); } } diff --git a/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp b/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp index 06d635242f..5ed8513539 100644 --- a/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp +++ b/isis/src/base/objs/LambertAzimuthalEqualArea/LambertAzimuthalEqualArea.cpp @@ -75,7 +75,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLongitude")) { if (allowDefaults) { double centerLon = (MinimumLongitude() + MaximumLongitude()) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(centerLon), "Degrees"); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(centerLon), "Degrees"); } else { std::string message = "Cannot project using Lambert Azimuthal equal-area"; @@ -90,7 +90,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLatitude")) { if (allowDefaults) { double centerLat = (MinimumLatitude() + MaximumLatitude()) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(centerLat), "Degrees"); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(centerLat), "Degrees"); } else { std::string message = "Cannot project using Lambert Azimuthal equal-area"; diff --git a/isis/src/base/objs/LambertAzimuthalEqualArea/unitTest.cpp b/isis/src/base/objs/LambertAzimuthalEqualArea/unitTest.cpp index 14042ff456..681b5085b2 100644 --- a/isis/src/base/objs/LambertAzimuthalEqualArea/unitTest.cpp +++ b/isis/src/base/objs/LambertAzimuthalEqualArea/unitTest.cpp @@ -1170,7 +1170,7 @@ int main(int argc, char *argv[]) { mapGroup.findKeyword("LongitudeDirection").setValue("PositiveEast"); mapGroup.deleteKeyword("EquatorialRadius"); mapGroup += PvlKeyword("EquatorialRadius", "6378388.0"); - mapGroup.findKeyword("PolarRadius").setValue(toString(6378388.0*sqrt(1-.00672267))); + mapGroup.findKeyword("PolarRadius").setValue(Isis::toString(6378388.0*sqrt(1-.00672267))); mapGroup.findKeyword("MinimumLatitude").setValue("-89.99999"); mapGroup.findKeyword("CenterLongitude").setValue("-100.0"); mapGroup.findKeyword("MinimumLongitude").setValue("-100.0"); @@ -1621,7 +1621,7 @@ int main(int argc, char *argv[]) { //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| mapGroup.deleteKeyword("EquatorialRadius"); mapGroup += PvlKeyword("EquatorialRadius", "6378206.4"); - mapGroup.findKeyword("PolarRadius").setValue(toString(6378206.4*sqrt(1-.00676866))); + mapGroup.findKeyword("PolarRadius").setValue(Isis::toString(6378206.4*sqrt(1-.00676866))); mapGroup.findKeyword("CenterLatitude").setValue("40.0"); mapGroup.findKeyword("CenterLongitude").setValue("-100.0"); mapGroup.findKeyword("MinimumLatitude").setValue("-50"); @@ -2002,7 +2002,7 @@ int main(int argc, char *argv[]) { cout << "\t\t\t\t\t TESTING OTHER METHODS " << endl; cout << border << endl << endl; //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - mapGroup.findKeyword("PolarRadius").setValue(toString(p8->EquatorialRadius())); + mapGroup.findKeyword("PolarRadius").setValue(Isis::toString(p8->EquatorialRadius())); TProjection *p9 = (TProjection *) ProjectionFactory::Create(lab); TProjection *s = p1; cout << "Name: " << s->Name().toStdString() << endl; diff --git a/isis/src/base/objs/LambertConformal/LambertConformal.cpp b/isis/src/base/objs/LambertConformal/LambertConformal.cpp index 143d85fb81..902942e4cc 100644 --- a/isis/src/base/objs/LambertConformal/LambertConformal.cpp +++ b/isis/src/base/objs/LambertConformal/LambertConformal.cpp @@ -48,14 +48,14 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } // Compute and write the default center latitude if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(lat)); } // Get the center longitude & latitude diff --git a/isis/src/base/objs/Latitude/Latitude.cpp b/isis/src/base/objs/Latitude/Latitude.cpp index d114091f8a..20104e4c65 100644 --- a/isis/src/base/objs/Latitude/Latitude.cpp +++ b/isis/src/base/objs/Latitude/Latitude.cpp @@ -94,17 +94,17 @@ namespace Isis { m_polarRadius = NULL; if (mapping.hasKeyword("EquatorialRadius") && mapping.hasKeyword("PolarRadius")) { - m_equatorialRadius = new Distance(IString::ToDouble(mapping["EquatorialRadius"][0]), + m_equatorialRadius = new Distance(Isis::toDouble(mapping["EquatorialRadius"][0]), Distance::Meters); - m_polarRadius = new Distance(IString::ToDouble(mapping["PolarRadius"][0]), + m_polarRadius = new Distance(Isis::toDouble(mapping["PolarRadius"][0]), Distance::Meters); } else { try { PvlGroup radiiGrp = Target::radiiGroup(QString::fromStdString(mapping["TargetName"][0])); - m_equatorialRadius = new Distance(IString::ToDouble(radiiGrp["EquatorialRadius"][0]), + m_equatorialRadius = new Distance(Isis::toDouble(radiiGrp["EquatorialRadius"][0]), Distance::Meters); - m_polarRadius = new Distance(IString::ToDouble(radiiGrp["PolarRadius"][0]), + m_polarRadius = new Distance(Isis::toDouble(radiiGrp["PolarRadius"][0]), Distance::Meters); } catch (IException &e) { @@ -154,17 +154,17 @@ namespace Isis { m_polarRadius = NULL; if (mapping.hasKeyword("EquatorialRadius") && mapping.hasKeyword("PolarRadius")) { - m_equatorialRadius = new Distance(IString::ToDouble(mapping["EquatorialRadius"][0]), + m_equatorialRadius = new Distance(Isis::toDouble(mapping["EquatorialRadius"][0]), Distance::Meters); - m_polarRadius = new Distance(IString::ToDouble(mapping["PolarRadius"][0]), + m_polarRadius = new Distance(Isis::toDouble(mapping["PolarRadius"][0]), Distance::Meters); } else { try { PvlGroup radiiGrp = Target::radiiGroup(QString::fromStdString(mapping["TargetName"][0])); - m_equatorialRadius = new Distance(IString::ToDouble(radiiGrp["EquatorialRadius"][0]), + m_equatorialRadius = new Distance(Isis::toDouble(radiiGrp["EquatorialRadius"][0]), Distance::Meters); - m_polarRadius = new Distance(IString::ToDouble(radiiGrp["PolarRadius"][0]), + m_polarRadius = new Distance(Isis::toDouble(radiiGrp["PolarRadius"][0]), Distance::Meters); } catch (IException &e) { @@ -226,7 +226,7 @@ namespace Isis { setPlanetographic(latitude, latitudeUnits); } else { - std::string msg = "Enumeration value [" + std::to_string(latType) + "] is not a valid CoordinateType"; + std::string msg = "Enumeration value [" + Isis::toString(latType) + "] is not a valid CoordinateType"; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -315,7 +315,7 @@ namespace Isis { double Latitude::planetographic(Angle::Units units) const { if (m_equatorialRadius == NULL || m_polarRadius == NULL) { - std::string msg = "Latitude [" + std::to_string(true) + "] cannot " + std::string msg = "Latitude [" + Isis::toString(true) + "] cannot " "be converted to Planetographic without the planetary radii, please " "use the other Latitude constructor."; throw IException(IException::Programmer, msg, _FILEINFO_); @@ -507,17 +507,17 @@ namespace Isis { Distance equatorialRadius; Distance polarRadius; if (mapping.hasKeyword("EquatorialRadius") && mapping.hasKeyword("PolarRadius")) { - equatorialRadius = Distance(IString::ToDouble(mapping["EquatorialRadius"][0]), + equatorialRadius = Distance(Isis::toDouble(mapping["EquatorialRadius"][0]), Distance::Meters); - polarRadius = Distance(IString::ToDouble(mapping["PolarRadius"][0]), + polarRadius = Distance(Isis::toDouble(mapping["PolarRadius"][0]), Distance::Meters); } else { try { PvlGroup radiiGrp = Target::radiiGroup(QString::fromStdString(mapping["TargetName"][0])); - equatorialRadius = Distance(IString::ToDouble(radiiGrp["EquatorialRadius"][0]), + equatorialRadius = Distance(Isis::toDouble(radiiGrp["EquatorialRadius"][0]), Distance::Meters); - polarRadius = Distance(IString::ToDouble(radiiGrp["PolarRadius"][0]), + polarRadius = Distance(Isis::toDouble(radiiGrp["PolarRadius"][0]), Distance::Meters); } catch (IException &e) { diff --git a/isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp b/isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp index be826bf2c7..69f8f5183b 100644 --- a/isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp +++ b/isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp @@ -199,10 +199,10 @@ namespace Isis { PvlGroup pluginInfo(grpName.toStdString()); PvlKeyword name("Name", Algorithm().toStdString()); - PvlKeyword minThickness("MinimumThickness", toString(MinimumThickness())); - PvlKeyword minArea("MinimumArea", toString(MinimumArea())); - PvlKeyword majAxis("MajorAxisPoints", toString(p_majorAxisPts)); - PvlKeyword minAxis("MinorAxisPoints", toString(p_minorAxisPts)); + PvlKeyword minThickness("MinimumThickness", Isis::toString(MinimumThickness())); + PvlKeyword minArea("MinimumArea", Isis::toString(MinimumArea())); + PvlKeyword majAxis("MajorAxisPoints", Isis::toString(p_majorAxisPts)); + PvlKeyword minAxis("MinorAxisPoints", Isis::toString(p_minorAxisPts)); pluginInfo.addKeyword(name); pluginInfo.addKeyword(minThickness); diff --git a/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp b/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp index 100375ce88..fc83bd5a56 100644 --- a/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp +++ b/isis/src/base/objs/LunarAzimuthalEqualArea/unitTest.cpp @@ -27,16 +27,16 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(6378206.4)); - mapGroup += PvlKeyword("PolarRadius", toString(6378206.4)); + mapGroup += PvlKeyword("EquatorialRadius", Isis::toString(6378206.4)); + mapGroup += PvlKeyword("PolarRadius", Isis::toString(6378206.4)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-30.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(-15.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-30.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(-15.0)); - mapGroup += PvlKeyword("MaximumLibration", toString(1)); + mapGroup += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mapGroup += PvlKeyword("MinimumLatitude", Isis::toString(-30.0)); + mapGroup += PvlKeyword("MaximumLatitude", Isis::toString(-15.0)); + mapGroup += PvlKeyword("MinimumLongitude", Isis::toString(-30.0)); + mapGroup += PvlKeyword("MaximumLongitude", Isis::toString(-15.0)); + mapGroup += PvlKeyword("MaximumLibration", Isis::toString(1)); mapGroup += PvlKeyword("ProjectionName", "LunarAzimuthalEqualArea"); @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) { cout << "true! ..................................... [ OK ]\n"; else cout << "false! .................................... [ FAILED ]\n"; - mapGroup["PolarRadius"].setValue(toString(42)); + mapGroup["PolarRadius"].setValue(Isis::toString(42)); Pvl tmp1; TProjection *p2 = (TProjection *) ProjectionFactory::Create(lab); tmp1.addGroup(p2->Mapping()); diff --git a/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp b/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp index 0c6705a87c..82c7bf65de 100755 --- a/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp +++ b/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.cpp @@ -86,7 +86,7 @@ namespace Isis { phaseangle = strlist.Token(","); if (phaseangle < 0.0 || phaseangle > 180.0) { std::string msg = "Invalid value of empirical Lunar Lambert phase angle list value [" + - std::to_string(phaseangle) + "]"; + Isis::toString(phaseangle) + "]"; throw IException(IException::User, msg, _FILEINFO_); } p_photoPhaseList.push_back(phaseangle); @@ -115,7 +115,7 @@ namespace Isis { p_photoPhaseList.clear(); for (int i=0; i< phaseList.size(); i++) { - phaseAngle = IString::ToDouble(phaseList[i]); + phaseAngle = Isis::toDouble(phaseList[i]); if (phaseAngle < 0.0 || phaseAngle > 180.0) { std::string msg = "Invalid value of empirical Lunar Lambert phase angle list value [" + @@ -169,7 +169,7 @@ namespace Isis { p_photoLList.clear(); for (int i=0; i 180.0) { std::string msg = "Invalid value of empirical Minnaert phase angle list value [" + @@ -168,7 +168,7 @@ namespace Isis { p_photoKList.clear(); for (int i=0; isecond.second; } else { - snGroup += PvlKeyword("ObservationKeys", toString(snGroup.keywords())); + snGroup += PvlKeyword("ObservationKeys", Isis::toString(snGroup.keywords())); } return snGroup; diff --git a/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp b/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp index f412bdc663..2ebd9fcc52 100644 --- a/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp +++ b/isis/src/base/objs/OriginalXmlLabel/OriginalXmlLabel.cpp @@ -113,7 +113,7 @@ namespace Isis { if ( !m_originalLabel.setContent(&xmlFile, false, &errmsg, &errline, &errcol) ) { xmlFile.close(); std::string msg = "XML read/parse error in file [" + xmlFileName.expanded() - + "] at line [" + std::to_string(errline) + "], column [" + std::to_string(errcol) + + "] at line [" + Isis::toString(errline) + "], column [" + Isis::toString(errcol) + "], message: " + errmsg.toStdString(); throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Orthographic/Orthographic.cpp b/isis/src/base/objs/Orthographic/Orthographic.cpp index 331942e211..4f229ca537 100644 --- a/isis/src/base/objs/Orthographic/Orthographic.cpp +++ b/isis/src/base/objs/Orthographic/Orthographic.cpp @@ -48,7 +48,7 @@ namespace Isis { */ if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } /* @@ -57,7 +57,7 @@ namespace Isis { */ if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(lat)); } // Get the center longitude & latitude diff --git a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp index 2e9b0f0f1c..9fdfc3d401 100644 --- a/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp +++ b/isis/src/base/objs/OverlapStatistics/OverlapStatistics.cpp @@ -200,26 +200,26 @@ namespace Isis { PvlObject o(name.toStdString()); o += PvlKeyword("File1", FileNameX().name()); o += PvlKeyword("File2", FileNameY().name()); - o += PvlKeyword("Width", toString(Samples())); - o += PvlKeyword("Height", toString(Lines())); - o += PvlKeyword("Bands", toString(Bands())); - o += PvlKeyword("SamplingPercent", toString(SampPercent())); - o += PvlKeyword("MinCount", toString(MinCount())); // Do we need this if EqInfo has this? + o += PvlKeyword("Width", Isis::toString(Samples())); + o += PvlKeyword("Height", Isis::toString(Lines())); + o += PvlKeyword("Bands", Isis::toString(Bands())); + o += PvlKeyword("SamplingPercent", Isis::toString(SampPercent())); + o += PvlKeyword("MinCount", Isis::toString(MinCount())); // Do we need this if EqInfo has this? // Create group for first file of overlap PvlGroup gX("File1"); - PvlKeyword stsX("StartSample", toString(StartSampleX())); - PvlKeyword ensX("EndSample", toString(EndSampleX())); - PvlKeyword stlX("StartLine", toString(StartLineX())); - PvlKeyword enlX("EndLine", toString(EndLineX())); + PvlKeyword stsX("StartSample", Isis::toString(StartSampleX())); + PvlKeyword ensX("EndSample", Isis::toString(EndSampleX())); + PvlKeyword stlX("StartLine", Isis::toString(StartLineX())); + PvlKeyword enlX("EndLine", Isis::toString(EndLineX())); PvlKeyword avgX("Average"); PvlKeyword stdX("StandardDeviation"); PvlKeyword varX("Variance"); for (int band = 1; band <= Bands(); band++) { if (HasOverlap(band)) { - avgX += toString(GetMStats(band).X().Average()); - stdX += toString(GetMStats(band).X().StandardDeviation()); - varX += toString(GetMStats(band).X().Variance()); + avgX += Isis::toString(GetMStats(band).X().Average()); + stdX += Isis::toString(GetMStats(band).X().StandardDeviation()); + varX += Isis::toString(GetMStats(band).X().Variance()); } } gX += stsX; @@ -232,18 +232,18 @@ namespace Isis { // Create group for second file of overlap PvlGroup gY("File2"); - PvlKeyword stsY("StartSample", toString(StartSampleY())); - PvlKeyword ensY("EndSample", toString(EndSampleY())); - PvlKeyword stlY("StartLine", toString(StartLineY())); - PvlKeyword enlY("EndLine", toString(EndLineY())); + PvlKeyword stsY("StartSample", Isis::toString(StartSampleY())); + PvlKeyword ensY("EndSample", Isis::toString(EndSampleY())); + PvlKeyword stlY("StartLine", Isis::toString(StartLineY())); + PvlKeyword enlY("EndLine", Isis::toString(EndLineY())); PvlKeyword avgY("Average"); PvlKeyword stdY("StandardDeviation"); PvlKeyword varY("Variance"); for (int band = 1; band <= Bands(); band++) { if (HasOverlap(band)) { - avgY += toString(GetMStats(band).Y().Average()); - stdY += toString(GetMStats(band).Y().StandardDeviation()); - varY += toString(GetMStats(band).Y().Variance()); + avgY += Isis::toString(GetMStats(band).Y().Average()); + stdY += Isis::toString(GetMStats(band).Y().StandardDeviation()); + varY += Isis::toString(GetMStats(band).Y().Variance()); } } gY += stsY; diff --git a/isis/src/base/objs/Pipeline/Pipeline.cpp b/isis/src/base/objs/Pipeline/Pipeline.cpp index a94139e36e..f95b42d69f 100644 --- a/isis/src/base/objs/Pipeline/Pipeline.cpp +++ b/isis/src/base/objs/Pipeline/Pipeline.cpp @@ -723,7 +723,7 @@ namespace Isis { */ PipelineApplication &Pipeline::Application(const int &index) { if (index > Size()) { - std::string msg = "Index [" + std::to_string(index) + "] out of bounds"; + std::string msg = "Index [" + Isis::toString(index) + "] out of bounds"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -807,7 +807,7 @@ namespace Isis { if (p_finalOutput.size() > 1) { if ((unsigned int)branch >= p_finalOutput.size()) { - std::string msg = "Output not set for branch [" + std::to_string(branch) + "]"; + std::string msg = "Output not set for branch [" + Isis::toString(branch) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/base/objs/Planar/Planar.cpp b/isis/src/base/objs/Planar/Planar.cpp index 18ac7763db..6a663a4638 100644 --- a/isis/src/base/objs/Planar/Planar.cpp +++ b/isis/src/base/objs/Planar/Planar.cpp @@ -50,14 +50,14 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterRingLongitude"))) { double azimuth = (m_minimumRingLongitude + m_maximumRingLongitude) / 2.0; - mapGroup += PvlKeyword("CenterRingLongitude", toString(azimuth)); + mapGroup += PvlKeyword("CenterRingLongitude", Isis::toString(azimuth)); } // Compute and write the default center radius if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterRingRadius"))) { double radius = (m_minimumRingRadius + m_maximumRingRadius) / 2.0; - mapGroup += PvlKeyword("CenterRingRadius", toString(radius)); + mapGroup += PvlKeyword("CenterRingRadius", Isis::toString(radius)); } // Get the center longitude & radius @@ -434,11 +434,11 @@ namespace Isis { PvlGroup Planar::Mapping() { PvlGroup mapping = RingPlaneProjection::Mapping(); - mapping += PvlKeyword("CenterRingRadius", toString(m_centerRingRadius)); + mapping += PvlKeyword("CenterRingRadius", Isis::toString(m_centerRingRadius)); double dir = 1.0; if (m_ringLongitudeDirection == Clockwise) dir = -1.0; double lonDegrees = m_centerRingLongitude*RAD2DEG*dir; - mapping += PvlKeyword("CenterRingLongitude", toString(lonDegrees)); + mapping += PvlKeyword("CenterRingLongitude", Isis::toString(lonDegrees)); return mapping; } diff --git a/isis/src/base/objs/PlaneShape/unitTest.cpp b/isis/src/base/objs/PlaneShape/unitTest.cpp index 67dc6bbf2e..6a12958c10 100644 --- a/isis/src/base/objs/PlaneShape/unitTest.cpp +++ b/isis/src/base/objs/PlaneShape/unitTest.cpp @@ -64,7 +64,7 @@ int main() { cout << " Shape1 name is " << shape.name().toStdString() << endl; cout << " Shape2 name is " << shape2.name().toStdString() << endl; cout << " Shape3 name is " << shape3.name().toStdString() << endl; - cout << " Shape is DEM type? " << toString(shape3.isDEM()) << endl; + cout << " Shape is DEM type? " << Isis::toString((bool)shape3.isDEM()) << endl; std::vector sB(3); sB[0] = -19584.5; diff --git a/isis/src/base/objs/PointPerspective/PointPerspective.cpp b/isis/src/base/objs/PointPerspective/PointPerspective.cpp index 428a765529..1f3ee59709 100644 --- a/isis/src/base/objs/PointPerspective/PointPerspective.cpp +++ b/isis/src/base/objs/PointPerspective/PointPerspective.cpp @@ -46,14 +46,14 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } // Compute and write the default center latitude if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(lat)); } // Get the center longitude & latitude diff --git a/isis/src/base/objs/PointPerspective/unitTest.cpp b/isis/src/base/objs/PointPerspective/unitTest.cpp index 829c9d8db7..ce04054d9e 100644 --- a/isis/src/base/objs/PointPerspective/unitTest.cpp +++ b/isis/src/base/objs/PointPerspective/unitTest.cpp @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGroup += PvlKeyword("PolarRadius", toString(1.0)); + mapGroup += PvlKeyword("EquatorialRadius", Isis::toString(1.0)); + mapGroup += PvlKeyword("PolarRadius", Isis::toString(1.0)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(0.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(80.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(0.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(80.0)); + mapGroup += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mapGroup += PvlKeyword("MinimumLatitude", Isis::toString(0.0)); + mapGroup += PvlKeyword("MaximumLatitude", Isis::toString(80.0)); + mapGroup += PvlKeyword("MinimumLongitude", Isis::toString(0.0)); + mapGroup += PvlKeyword("MaximumLongitude", Isis::toString(80.0)); mapGroup += PvlKeyword("ProjectionName", "PointPerspective"); cout << "Test missing center longitude keyword ..." << endl; @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(0.0)); cout << "Test missing center latitude keyword..." << endl; try { @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLatitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(0.0)); cout << "Test missing distance keyword..." << endl; try { @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("Distance", toString(.00562)); + mapGroup += PvlKeyword("Distance", Isis::toString(.00562)); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); @@ -168,18 +168,18 @@ int main(int argc, char *argv[]) { Pvl lab1; lab1.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab1.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(6371000)); - mapGroup+= PvlKeyword("PolarRadius",toString(6371000)); + mapGroup += PvlKeyword("EquatorialRadius", Isis::toString(6371000)); + mapGroup+= PvlKeyword("PolarRadius",Isis::toString(6371000)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(180.0)); - mapGroup += PvlKeyword("CenterLongitude", toString(-77.0)); - mapGroup += PvlKeyword("CenterLatitude", toString(39.0)); - mapGroup += PvlKeyword("Distance", toString(500000)); + mapGroup += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mapGroup += PvlKeyword("MinimumLatitude", Isis::toString(-90.0)); + mapGroup += PvlKeyword("MaximumLatitude", Isis::toString(90.0)); + mapGroup += PvlKeyword("MinimumLongitude", Isis::toString(-180.0)); + mapGroup += PvlKeyword("MaximumLongitude", Isis::toString(180.0)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(-77.0)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(39.0)); + mapGroup += PvlKeyword("Distance", Isis::toString(500000)); mapGroup += PvlKeyword("ProjectionName", "PointPerspective"); TProjection *p1 = (TProjection *) ProjectionFactory::Create(lab1); diff --git a/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp b/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp index 24d5600ebe..c0a039511b 100644 --- a/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp +++ b/isis/src/base/objs/PolarStereographic/PolarStereographic.cpp @@ -49,7 +49,7 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } // Compute and write the default center latitude if allowed and @@ -57,10 +57,10 @@ namespace Isis { if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; if (lat > 0.0) { - mapGroup += PvlKeyword("CenterLatitude", toString(90.0)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(90.0)); } else { - mapGroup += PvlKeyword("CenterLatitude", toString(-90.0)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(-90.0)); } } diff --git a/isis/src/base/objs/PolarStereographic/unitTest.cpp b/isis/src/base/objs/PolarStereographic/unitTest.cpp index ded540a398..d1f22965b6 100644 --- a/isis/src/base/objs/PolarStereographic/unitTest.cpp +++ b/isis/src/base/objs/PolarStereographic/unitTest.cpp @@ -24,15 +24,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mg = lab.findGroup("Mapping"); - mg += PvlKeyword("EquatorialRadius", toString(6378388.0)); - mg += PvlKeyword("PolarRadius", toString(6356911.9)); + mg += PvlKeyword("EquatorialRadius", Isis::toString(6378388.0)); + mg += PvlKeyword("PolarRadius", Isis::toString(6356911.9)); mg += PvlKeyword("LatitudeType", "Planetographic"); mg += PvlKeyword("LongitudeDirection", "PositiveEast"); - mg += PvlKeyword("LongitudeDomain", toString(180)); - mg += PvlKeyword("MinimumLatitude", toString(-90.0)); - mg += PvlKeyword("MaximumLatitude", toString(0.0)); - mg += PvlKeyword("MinimumLongitude", toString(-180.0)); - mg += PvlKeyword("MaximumLongitude", toString(180.0)); + mg += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mg += PvlKeyword("MinimumLatitude", Isis::toString(-90.0)); + mg += PvlKeyword("MaximumLatitude", Isis::toString(0.0)); + mg += PvlKeyword("MinimumLongitude", Isis::toString(-180.0)); + mg += PvlKeyword("MaximumLongitude", Isis::toString(180.0)); mg += PvlKeyword("ProjectionName", "PolarStereographic"); @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) { e.print(); } cout << endl; - mg += PvlKeyword("CenterLongitude", toString(-100.0)); + mg += PvlKeyword("CenterLongitude", Isis::toString(-100.0)); cout << "Test missing center latitude keyword ..." << endl; try { @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) { } cout << endl; cout << "Test invalid center latitude keyword ..." << endl; - mg += PvlKeyword("CenterLatitude", toString(0.0)); + mg += PvlKeyword("CenterLatitude", Isis::toString(0.0)); try { PolarStereographic p(lab); } @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) { e.print(); } cout << endl; - mg.addKeyword(PvlKeyword("CenterLatitude", toString(-71.0)), PvlGroup::Replace); + mg.addKeyword(PvlKeyword("CenterLatitude", Isis::toString(-71.0)), PvlGroup::Replace); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); diff --git a/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp b/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp index 95c98abf0d..d3b9f20ec7 100644 --- a/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp +++ b/isis/src/base/objs/PolygonSeeder/PolygonSeeder.cpp @@ -147,7 +147,7 @@ namespace Isis { const geos::geom::Envelope *xyBoundBox) { if(xymp->getArea() < MinimumArea()) { std::string msg = "Polygon did not meet the minimum area of ["; - msg += toString(MinimumArea()) + "]"; + msg += Isis::toString(MinimumArea()) + "]"; return QString::fromStdString(msg); } @@ -156,7 +156,7 @@ namespace Isis { pow(std::max(xyBoundBox->getWidth(), xyBoundBox->getHeight()), 2.0); if(thickness < MinimumThickness()) { std::string msg = "Polygon did not meet the minimum thickness ratio of ["; - msg += toString(MinimumThickness()) + "]"; + msg += Isis::toString(MinimumThickness()) + "]"; return QString::fromStdString(msg); } @@ -211,8 +211,8 @@ namespace Isis { PvlGroup pluginInfo(grpName.toStdString()); PvlKeyword name("Name", p_algorithmName.toStdString()); - PvlKeyword minThickness("MinimumThickness", toString(p_minimumThickness)); - PvlKeyword minArea("MinimumArea", toString(p_minimumArea)); + PvlKeyword minThickness("MinimumThickness", Isis::toString(p_minimumThickness)); + PvlKeyword minArea("MinimumArea", Isis::toString(p_minimumArea)); pluginInfo.addKeyword(name); pluginInfo.addKeyword(minThickness); diff --git a/isis/src/base/objs/PrincipalComponentAnalysis/PrincipalComponentAnalysis.cpp b/isis/src/base/objs/PrincipalComponentAnalysis/PrincipalComponentAnalysis.cpp index dc95cb9f66..0056c42502 100644 --- a/isis/src/base/objs/PrincipalComponentAnalysis/PrincipalComponentAnalysis.cpp +++ b/isis/src/base/objs/PrincipalComponentAnalysis/PrincipalComponentAnalysis.cpp @@ -114,7 +114,7 @@ namespace Isis { // Transform the vector into principal component space TNT::Array2D PrincipalComponentAnalysis::Transform(TNT::Array2D data) { if(data.dim1() != 1 || data.dim2() != p_dimensions) { - std::string m = "Transform input must be of dimension 1 x " + toString(p_dimensions); + std::string m = "Transform input must be of dimension 1 x " + Isis::toString(p_dimensions); throw IException(IException::Programmer, m, _FILEINFO_); } @@ -125,7 +125,7 @@ namespace Isis { // Transform the vector from principal component space TNT::Array2D PrincipalComponentAnalysis::Inverse(TNT::Array2D data) { if(data.dim1() != 1 || data.dim2() != p_dimensions) { - std::string m = "Transform input must be of dimension 1 x " + toString(p_dimensions); + std::string m = "Transform input must be of dimension 1 x " + Isis::toString(p_dimensions); throw IException(IException::Programmer, m, _FILEINFO_); } diff --git a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp index 0c5a9b7d0b..0637329daf 100644 --- a/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp +++ b/isis/src/base/objs/ProcessExportPds/ProcessExportPds.cpp @@ -271,7 +271,7 @@ namespace Isis { if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { storagebytes = storagebytes * 2; } - cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", toString(storagebytes)); + cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", Isis::toString(storagebytes)); mainPvl.addObject(cmpObj); PvlObject ucmpObj("UNCOMPRESSED_FILE"); ucmpObj += PvlKeyword("FILE_NAME", infilename.name()); @@ -280,8 +280,8 @@ namespace Isis { if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { recordbytes = recordbytes * 2; } - ucmpObj += PvlKeyword("RECORD_BYTES", toString(recordbytes)); - ucmpObj += PvlKeyword("FILE_RECORDS", toString(InputCubes[0]->lineCount())); + ucmpObj += PvlKeyword("RECORD_BYTES", Isis::toString(recordbytes)); + ucmpObj += PvlKeyword("FILE_RECORDS", Isis::toString(InputCubes[0]->lineCount())); ucmpObj += PvlKeyword("^IMAGE", infilename.name()); mainPvl.addObject(ucmpObj); } @@ -362,7 +362,7 @@ namespace Isis { if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { storagebytes = storagebytes * 2; } - cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", toString(storagebytes)); + cmpObj += PvlKeyword("REQUIRED_STORAGE_BYTES", Isis::toString(storagebytes)); mainPvl.addObject(cmpObj); PvlObject ucmpObj("UNCOMPRESSED_FILE"); ucmpObj += PvlKeyword("FILE_NAME", infilename.name()); @@ -371,8 +371,8 @@ namespace Isis { if(p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::SignedWord) { recordbytes = recordbytes * 2; } - ucmpObj += PvlKeyword("RECORD_BYTES", toString(recordbytes)); - ucmpObj += PvlKeyword("FILE_RECORDS", toString(InputCubes[0]->lineCount())); + ucmpObj += PvlKeyword("RECORD_BYTES", Isis::toString(recordbytes)); + ucmpObj += PvlKeyword("FILE_RECORDS", Isis::toString(InputCubes[0]->lineCount())); ucmpObj += PvlKeyword("^IMAGE", infilename.name()); mainPvl.addObject(ucmpObj); } @@ -436,68 +436,68 @@ namespace Isis { if(!m_forceBandwidth && imgObj.hasKeyword("BANDWIDTH")) imgObj.deleteKeyword("BANDWIDTH"); if(m_forceBandStorageType) imgObj += PvlKeyword("BAND_STORAGE_TYPE", "BAND_SEQUENTIAL"); - if(m_forceOffset) imgObj += PvlKeyword("OFFSET", toString(base)); - if(m_forceScalingFactor) imgObj += PvlKeyword("SCALING_FACTOR", toString(multiplier)); + if(m_forceOffset) imgObj += PvlKeyword("OFFSET", Isis::toString(base)); + if(m_forceScalingFactor) imgObj += PvlKeyword("SCALING_FACTOR", Isis::toString(multiplier)); // Manually set the keyword for pixel type and special pixels if(p_pixelType == Isis::UnsignedByte) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "8"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString(0xff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel8.typ"); } else if((p_pixelType == Isis::UnsignedWord) && (p_endianType == Isis::Msb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::UnsignedWord) && (p_endianType == Isis::Lsb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "LSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::SignedWord) && (p_endianType == Isis::Msb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::SignedWord) && (p_endianType == Isis::Lsb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString((BigInt)0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString((BigInt)0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "LSB_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if(p_pixelType == Isis::Real) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "32"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString((BigInt)0xffffffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString((BigInt)0xffffffff)); if(p_endianType == Isis::Msb) { if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "IEEE_REAL"); @@ -505,11 +505,11 @@ namespace Isis { else { if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "PC_REAL"); } - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString(Isis::INULL4)); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString(Isis::ILOW_REPR_SAT4)); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString(Isis::ILOW_INSTR_SAT4)); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString(Isis::IHIGH_REPR_SAT4)); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString(Isis::IHIGH_INSTR_SAT4)); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString(Isis::INULL4)); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString(Isis::ILOW_REPR_SAT4)); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString(Isis::ILOW_INSTR_SAT4)); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString(Isis::IHIGH_REPR_SAT4)); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString(Isis::IHIGH_INSTR_SAT4)); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel32.typ"); } else { @@ -580,68 +580,68 @@ namespace Isis { if(!m_forceBandwidth && imgObj.hasKeyword("BANDWIDTH")) imgObj.deleteKeyword("BANDWIDTH"); if(m_forceBandStorageType) imgObj += PvlKeyword("BAND_STORAGE_TYPE", "BAND_SEQUENTIAL"); - if(m_forceOffset) imgObj += PvlKeyword("OFFSET", toString(base)); - if(m_forceScalingFactor) imgObj += PvlKeyword("SCALING_FACTOR", toString(multiplier)); + if(m_forceOffset) imgObj += PvlKeyword("OFFSET", Isis::toString(base)); + if(m_forceScalingFactor) imgObj += PvlKeyword("SCALING_FACTOR", Isis::toString(multiplier)); // Manually set the keyword for pixel type and special pixels if(p_pixelType == Isis::UnsignedByte) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "8"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString(0xff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel8.typ"); } else if((p_pixelType == Isis::UnsignedWord) && (p_endianType == Isis::Msb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::UnsignedWord) && (p_endianType == Isis::Lsb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "LSB_UNSIGNED_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::SignedWord) && (p_endianType == Isis::Msb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString(0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString(0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "MSB_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if((p_pixelType == Isis::SignedWord) && (p_endianType == Isis::Lsb)) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "16"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString((BigInt)0xffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString((BigInt)0xffff)); if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "LSB_INTEGER"); - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString((int)OutputNull())); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString((int)OutputLrs())); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString((int)OutputLis())); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString((int)OutputHrs())); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString((int)OutputHis())); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString((int)OutputNull())); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString((int)OutputLrs())); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString((int)OutputLis())); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString((int)OutputHrs())); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString((int)OutputHis())); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel16.typ"); } else if(p_pixelType == Isis::Real) { if(m_forceSampleBits) imgObj += PvlKeyword("SAMPLE_BITS", "32"); - if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", toString((BigInt)0xffffffff)); + if(m_forceSampleBitMask) imgObj += PvlKeyword("SAMPLE_BIT_MASK", Isis::toString((BigInt)0xffffffff)); if(p_endianType == Isis::Msb) { if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "IEEE_REAL"); @@ -649,11 +649,11 @@ namespace Isis { else { if(m_forceSampleType) imgObj += PvlKeyword("SAMPLE_TYPE", "PC_REAL"); } - if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", toString(Isis::INULL4)); - if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", toString(Isis::ILOW_REPR_SAT4)); - if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", toString(Isis::ILOW_INSTR_SAT4)); - if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", toString(Isis::IHIGH_REPR_SAT4)); - if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", toString(Isis::IHIGH_INSTR_SAT4)); + if(m_forceCoreNull) imgObj += PvlKeyword("CORE_NULL", Isis::toString(Isis::INULL4)); + if(m_forceCoreLrs) imgObj += PvlKeyword("CORE_LOW_REPR_SATURATION", Isis::toString(Isis::ILOW_REPR_SAT4)); + if(m_forceCoreLis) imgObj += PvlKeyword("CORE_LOW_INSTR_SATURATION", Isis::toString(Isis::ILOW_INSTR_SAT4)); + if(m_forceCoreHrs) imgObj += PvlKeyword("CORE_HIGH_REPR_SATURATION", Isis::toString(Isis::IHIGH_REPR_SAT4)); + if(m_forceCoreHis) imgObj += PvlKeyword("CORE_HIGH_INSTR_SATURATION", Isis::toString(Isis::IHIGH_INSTR_SAT4)); mainPvl.format()->add("$ISISROOT/appdata/translations/pdsExportImageImagePixel32.typ"); } else { @@ -702,21 +702,21 @@ namespace Isis { if( (unit.toUpper() == "METERS") || (unit == "") ) { //if no units, assume in meters double dValue = (double)aRadius; dValue /= 1000.0; - aRadius.setValue(toString(dValue), "KM"); + aRadius.setValue(Isis::toString(dValue), "KM"); } PvlKeyword &bRadius = pdsMapObj["B_AXIS_RADIUS"]; unit = QString::fromStdString(bRadius.unit()); if( (unit.toUpper() == "METERS") || (unit == "") ) { double dValue = (double)bRadius; dValue /= 1000.0; - bRadius.setValue(toString(dValue), "KM"); + bRadius.setValue(Isis::toString(dValue), "KM"); } PvlKeyword &cRadius = pdsMapObj["C_AXIS_RADIUS"]; unit = QString::fromStdString(cRadius.unit()); if( (unit.toUpper() == "METERS") || (unit == "") ) { double dValue = (double)cRadius; dValue /= 1000.0; - cRadius.setValue(toString(dValue), "KM"); + cRadius.setValue(Isis::toString(dValue), "KM"); } // Modify the units on MAP_SCALE and MAP_RESOLUTION @@ -727,10 +727,10 @@ namespace Isis { if(m_exportResolution == Kilometer) { double dValue = (double)mapScale; dValue /= 1000.0; - mapScale.setValue(toString(dValue), "KM/PIXEL"); + mapScale.setValue(Isis::toString(dValue), "KM/PIXEL"); } else { - mapScale.setValue(toString((double)mapScale), "METERS/PIXEL"); + mapScale.setValue(Isis::toString((double)mapScale), "METERS/PIXEL"); } } PvlKeyword &mapRes = pdsMapObj["MAP_RESOLUTION"]; @@ -748,12 +748,12 @@ namespace Isis { double maxLon = inputMapping.findKeyword("MaximumLongitude"); double minLon = inputMapping.findKeyword("MinimumLongitude"); if(lonDir == "POSITIVEEAST") { - pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", toString(maxLon)); - pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", toString(minLon)); + pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", Isis::toString(maxLon)); + pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", Isis::toString(minLon)); } else { - pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", toString(minLon)); - pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", toString(maxLon)); + pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", Isis::toString(minLon)); + pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", Isis::toString(maxLon)); } } @@ -765,12 +765,12 @@ namespace Isis { lineOffset /= (double)inputMapping.findKeyword("PixelResolution"); lineOffset *= 1.0; lineOffset -= 0.5; // Add half a line to get to the center of (1,1) - pdsMapObj += PvlKeyword("LINE_PROJECTION_OFFSET", toString(lineOffset), "PIXEL"); + pdsMapObj += PvlKeyword("LINE_PROJECTION_OFFSET", Isis::toString(lineOffset), "PIXEL"); double sampleOffset = inputMapping.findKeyword("UpperLeftCornerX"); sampleOffset /= (double)inputMapping.findKeyword("PixelResolution"); sampleOffset *= -1.0; sampleOffset -= 0.5; // Add half a sample to get to the center of (1,1) - pdsMapObj += PvlKeyword("SAMPLE_PROJECTION_OFFSET", toString(sampleOffset), "PIXEL"); + pdsMapObj += PvlKeyword("SAMPLE_PROJECTION_OFFSET", Isis::toString(sampleOffset), "PIXEL"); // Add units to keywords already in the IMAGE_MAP_PROJECTION object as necessary if(pdsMapObj.hasKeyword("CENTER_LATITUDE")) { @@ -889,9 +889,9 @@ namespace Isis { if(m_exportType == Stream) { if(m_pdsFileType != ProcessExportPds::JP2Image) { - (*m_label)["LABEL_RECORDS"].setValue(toString(labSize), "BYTES"); + (*m_label)["LABEL_RECORDS"].setValue(Isis::toString(labSize), "BYTES"); if(!m_detachedLabel) { - (*m_label)["^IMAGE"].setValue(toString(labSize + 1), "BYTES"); + (*m_label)["^IMAGE"].setValue(Isis::toString(labSize + 1), "BYTES"); } } if(m_label->format() != NULL) { @@ -910,13 +910,13 @@ namespace Isis { int labelRecords; if(m_pdsFileType != ProcessExportPds::JP2Image) { lineBytes = LineBytes(); - (*m_label)["RECORD_BYTES"].setValue(toString(lineBytes)); + (*m_label)["RECORD_BYTES"].setValue(Isis::toString(lineBytes)); // The number of label records is dependent on the number of label bytes // and the lint bytes labelRecords = (int)ceil((double)labSize / (double)lineBytes); if(m_label->hasKeyword("LABEL_RECORDS")) { //LRO MRF doesn't have this keyword - (*m_label)["LABEL_RECORDS"].setValue(toString(labelRecords)); + (*m_label)["LABEL_RECORDS"].setValue(Isis::toString(labelRecords)); } int totalTableRecords = 0; for (unsigned int i = 0; i < m_tableRecords.size(); i++) { @@ -925,10 +925,10 @@ namespace Isis { int imageRecords = InputCubes[0]->lineCount() * InputCubes[0]->bandCount(); int fileRecords = labelRecords + imageRecords + totalTableRecords; - (*m_label)["FILE_RECORDS"].setValue(toString(fileRecords)); + (*m_label)["FILE_RECORDS"].setValue(Isis::toString(fileRecords)); if(!m_detachedLabel) { - (*m_label)["^IMAGE"].setValue(toString(labelRecords + 1)); + (*m_label)["^IMAGE"].setValue(Isis::toString(labelRecords + 1)); } } if(m_label->format() != NULL) { @@ -1034,7 +1034,7 @@ namespace Isis { } // for start record values, indexing begins with 1 int tableStartRecord = 1 + labelRecords + imageRecords + totalTableRecords; - mainPvl += PvlKeyword("^" + pdsTableName.toStdString(), toString(tableStartRecord)); + mainPvl += PvlKeyword("^" + pdsTableName.toStdString(), Isis::toString(tableStartRecord)); } else { mainPvl += PvlKeyword("^" + pdsTableName.toStdString(), detachedPdsTableFileName.toStdString()); diff --git a/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp b/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp index 777e45eb43..662687127e 100644 --- a/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp +++ b/isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp @@ -162,16 +162,16 @@ namespace Isis { bytesPerPixel /= 8; unsigned int axis1 = 1; - axis1 = IString::ToInteger((*fitsLabel)["NAXIS1"]); + axis1 = Isis::toInt((*fitsLabel)["NAXIS1"]); unsigned int axis2 = 1; if (fitsLabel->hasKeyword("NAXIS2")) { - axis2 = IString::ToInteger((*fitsLabel)["NAXIS2"]); + axis2 = Isis::toInt((*fitsLabel)["NAXIS2"]); } unsigned int axis3 = 1; if (fitsLabel->hasKeyword("NAXIS3")) { - axis3 = IString::ToInteger((*fitsLabel)["NAXIS3"]); + axis3 = Isis::toInt((*fitsLabel)["NAXIS3"]); } jump = (int)(ceil(bytesPerPixel * axis1 * axis2 * axis3 / 2880.0) * 2880.0); @@ -223,9 +223,9 @@ namespace Isis { */ PvlGroup ProcessImportFits::extraFitsLabel(int labelNumber) const { if (labelNumber >= m_extraFitsLabels->size()) { - std::string msg = "The requested label number [" + toString(labelNumber) + "], from file [" + m_name.expanded() + "] is " + std::string msg = "The requested label number [" + Isis::toString(labelNumber) + "], from file [" + m_name.expanded() + "] is " "past the last extra group found in this FITS file. " - "Extra label count is [" + toString(m_extraFitsLabels->size()-1) + "]"; + "Extra label count is [" + Isis::toString(m_extraFitsLabels->size()-1) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -257,9 +257,9 @@ namespace Isis { PvlGroup ProcessImportFits::fitsImageLabel(int labelNumber) const { if (labelNumber >= m_fitsImageLabels->size()) { - std::string msg = "The requested label number [" + toString(labelNumber) + "], from file [" + m_name.expanded() + "] is " + std::string msg = "The requested label number [" + Isis::toString(labelNumber) + "], from file [" + m_name.expanded() + "] is " "past the last image group found in this FITS file. " - "Image label count is [" + toString(m_fitsImageLabels->size()-1) + "]"; + "Image label count is [" + Isis::toString(m_fitsImageLabels->size()-1) + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -356,8 +356,8 @@ namespace Isis { void ProcessImportFits::setProcessFileStructure(int labelNumber) { if (labelNumber >= m_fitsImageLabels->size()) { - std::string msg = "The requested label number [" + toString(labelNumber) + "], from file [" + InputFile().toStdString() + "] is " - "past the last image in this FITS file [" + toString(m_fitsImageLabels->size()-1) + "]."; + std::string msg = "The requested label number [" + Isis::toString(labelNumber) + "], from file [" + InputFile().toStdString() + "] is " + "past the last image in this FITS file [" + Isis::toString(m_fitsImageLabels->size()-1) + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -370,7 +370,7 @@ namespace Isis { // Find pixel type. NOTE: There are several unsupported possiblites Isis::PixelType type; std::string msg = ""; - switch (IString::ToInteger(label["BITPIX"][0])) { + switch (Isis::toInt(label["BITPIX"][0])) { case 8: type = Isis::UnsignedByte; break; @@ -406,15 +406,15 @@ namespace Isis { // considered part of the DNs. So, use the parent class' prefix/suffix byte count to reduce // the number of samples. if (Organization() == BSQ) { - if (IString::ToInteger(label["NAXIS"][0]) == 2) { - SetDimensions(IString::ToInteger(label["NAXIS1"][0]) + if (Isis::toInt(label["NAXIS"][0]) == 2) { + SetDimensions(Isis::toInt(label["NAXIS1"][0]) - (DataPrefixBytes()+DataSuffixBytes())/SizeOf(type), - IString::ToInteger(label["NAXIS2"][0]), 1); + Isis::toInt(label["NAXIS2"][0]), 1); } - else if (IString::ToInteger(label["NAXIS"][0]) == 3) { - SetDimensions(IString::ToInteger(label["NAXIS1"][0]) + else if (Isis::toInt(label["NAXIS"][0]) == 3) { + SetDimensions(Isis::toInt(label["NAXIS1"][0]) - (DataPrefixBytes()+DataSuffixBytes())/SizeOf(type), - IString::ToInteger(label["NAXIS2"][0]), IString::ToInteger(label["NAXIS3"][0])); + Isis::toInt(label["NAXIS2"][0]), Isis::toInt(label["NAXIS3"][0])); } else { std::string msg = "NAXIS count of [" @@ -424,15 +424,15 @@ namespace Isis { } } else if (Organization() == BIL) { - if (IString::ToInteger(label["NAXIS"][0]) == 2) { - SetDimensions(IString::ToInteger(label["NAXIS1"][0]) + if (Isis::toInt(label["NAXIS"][0]) == 2) { + SetDimensions(Isis::toInt(label["NAXIS1"][0]) - (DataPrefixBytes()+DataSuffixBytes())/SizeOf(type), - 1, IString::ToInteger(label["NAXIS2"][0])); + 1, Isis::toInt(label["NAXIS2"][0])); } - else if (IString::ToInteger(label["NAXIS"][0]) == 3) { - SetDimensions(IString::ToInteger(label["NAXIS1"][0]) + else if (Isis::toInt(label["NAXIS"][0]) == 3) { + SetDimensions(Isis::toInt(label["NAXIS1"][0]) - (DataPrefixBytes()+DataSuffixBytes())/SizeOf(type), - IString::ToInteger(label["NAXIS3"][0]), IString::ToInteger(label["NAXIS2"][0])); + Isis::toInt(label["NAXIS3"][0]), Isis::toInt(label["NAXIS2"][0])); } else { std::string msg = "NAXIS count of [" @@ -453,13 +453,13 @@ namespace Isis { // Base and multiplier if (label.hasKeyword("BZERO")) { - SetBase(IString::ToDouble(label["BZERO"][0])); + SetBase(Isis::toDouble(label["BZERO"][0])); } else { SetBase(0.0); } if (label.hasKeyword("BSCALE")) { - SetMultiplier(IString::ToDouble(label["BSCALE"][0])); + SetMultiplier(Isis::toDouble(label["BSCALE"][0])); } else { SetMultiplier(1.0); diff --git a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp index 34ca366135..3af740ebb4 100644 --- a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp +++ b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp @@ -295,10 +295,10 @@ namespace Isis { p_sampleProjectionOffset = str.toDouble(); p_upperLeftX = xmult * (p_sampleProjectionOffset + xoff) * p_pixelResolution; - p_projectionOffsetGroup.addKeyword(PvlKeyword("xOffset", toString(xoff))); - p_projectionOffsetGroup.addKeyword(PvlKeyword("yOffset", toString(yoff))); - p_projectionOffsetGroup.addKeyword(PvlKeyword("xMultiplier", toString(xmult))); - p_projectionOffsetGroup.addKeyword(PvlKeyword("yMultiplier", toString(ymult))); + p_projectionOffsetGroup.addKeyword(PvlKeyword("xOffset", Isis::toString(xoff))); + p_projectionOffsetGroup.addKeyword(PvlKeyword("yOffset", Isis::toString(yoff))); + p_projectionOffsetGroup.addKeyword(PvlKeyword("xMultiplier", Isis::toString(xmult))); + p_projectionOffsetGroup.addKeyword(PvlKeyword("yMultiplier", Isis::toString(ymult))); } @@ -1153,7 +1153,7 @@ namespace Isis { else { std::string msg = "Invalid PixelType and BitsPerPixel combination [" + str.toStdString() + - ", " + toString(bitsPerPixel) + "]"; + ", " + Isis::toString(bitsPerPixel) + "]"; throw IException(IException::Io, msg, _FILEINFO_); } } @@ -1604,44 +1604,44 @@ namespace Isis { Isis::PvlGroup mapGroup("Mapping"); mapGroup += Isis::PvlKeyword("ProjectionName", p_projection.toStdString()); mapGroup += Isis::PvlKeyword("TargetName", p_targetName.toStdString()); - mapGroup += Isis::PvlKeyword("EquatorialRadius", toString(p_equatorialRadius), "meters"); - mapGroup += Isis::PvlKeyword("PolarRadius", toString(p_polarRadius), "meters"); + mapGroup += Isis::PvlKeyword("EquatorialRadius", Isis::toString(p_equatorialRadius), "meters"); + mapGroup += Isis::PvlKeyword("PolarRadius", Isis::toString(p_polarRadius), "meters"); mapGroup += Isis::PvlKeyword("LongitudeDirection", p_longitudeDirection.toStdString()); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(p_longitudeDomain)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", Isis::toString(p_longitudeDomain)); mapGroup += Isis::PvlKeyword("LatitudeType", p_latitudeType.toStdString()); if (p_minimumLatitude != Isis::NULL8) { - mapGroup += Isis::PvlKeyword("MinimumLatitude", toString(p_minimumLatitude)); + mapGroup += Isis::PvlKeyword("MinimumLatitude", Isis::toString(p_minimumLatitude)); } if (p_maximumLatitude != Isis::NULL8) { - mapGroup += Isis::PvlKeyword("MaximumLatitude", toString(p_maximumLatitude)); + mapGroup += Isis::PvlKeyword("MaximumLatitude", Isis::toString(p_maximumLatitude)); } if (p_minimumLongitude != Isis::NULL8) { - mapGroup += Isis::PvlKeyword("MinimumLongitude", toString(p_minimumLongitude)); + mapGroup += Isis::PvlKeyword("MinimumLongitude", Isis::toString(p_minimumLongitude)); } if (p_maximumLongitude != Isis::NULL8) { - mapGroup += Isis::PvlKeyword("MaximumLongitude", toString(p_maximumLongitude)); + mapGroup += Isis::PvlKeyword("MaximumLongitude", Isis::toString(p_maximumLongitude)); } // if both longitudes exist, verify they are ordered correctly if (p_minimumLongitude != Isis::NULL8 && p_maximumLongitude != Isis::NULL8) { if (p_maximumLongitude <= p_minimumLongitude) { if (p_longitudeDomain == 180) { - mapGroup["MinimumLongitude"] = toString(-180); - mapGroup["MaximumLongitude"] = toString(180); + mapGroup["MinimumLongitude"] = Isis::toString(-180); + mapGroup["MaximumLongitude"] = Isis::toString(180); } else { - mapGroup["MinimumLongitude"] = toString(0); - mapGroup["MaximumLongitude"] = toString(360); + mapGroup["MinimumLongitude"] = Isis::toString(0); + mapGroup["MaximumLongitude"] = Isis::toString(360); } } } - mapGroup += Isis::PvlKeyword("PixelResolution", toString(p_pixelResolution), "meters/pixel"); - mapGroup += Isis::PvlKeyword("Scale", toString(p_scaleFactor), "pixels/degree"); - mapGroup += Isis::PvlKeyword("UpperLeftCornerX", toString(p_upperLeftX), "meters"); - mapGroup += Isis::PvlKeyword("UpperLeftCornerY", toString(p_upperLeftY), "meters"); + mapGroup += Isis::PvlKeyword("PixelResolution", Isis::toString(p_pixelResolution), "meters/pixel"); + mapGroup += Isis::PvlKeyword("Scale", Isis::toString(p_scaleFactor), "pixels/degree"); + mapGroup += Isis::PvlKeyword("UpperLeftCornerX", Isis::toString(p_upperLeftX), "meters"); + mapGroup += Isis::PvlKeyword("UpperLeftCornerY", Isis::toString(p_upperLeftY), "meters"); if (p_rotation != 0.0) { - mapGroup += Isis::PvlKeyword("Rotation", toString(p_rotation)); + mapGroup += Isis::PvlKeyword("Rotation", Isis::toString(p_rotation)); } // To handle new projections without the need to modify source code @@ -1659,17 +1659,17 @@ namespace Isis { if (lab.findGroup("Mapping").hasKeyword("CenterLongitude")) { PvlKeyword ¢erLon = lab.findGroup("Mapping")["CenterLongitude"]; if (p_longitudeDomain == 180) - centerLon = toString(TProjection::To180Domain((double)centerLon)); + centerLon = Isis::toString(TProjection::To180Domain((double)centerLon)); else - centerLon = toString(TProjection::To360Domain((double)centerLon)); + centerLon = Isis::toString(TProjection::To360Domain((double)centerLon)); } if (lab.findGroup("Mapping").hasKeyword("PoleLongitude")) { PvlKeyword &poleLon = lab.findGroup("Mapping")["PoleLongitude"]; if (p_longitudeDomain == 180) - poleLon = toString(TProjection::To180Domain((double)poleLon)); + poleLon = Isis::toString(TProjection::To180Domain((double)poleLon)); else - poleLon = toString(TProjection::To360Domain((double)poleLon)); + poleLon = Isis::toString(TProjection::To360Domain((double)poleLon)); } OutputCubes[0]->putGroup(lab.findGroup("Mapping")); diff --git a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp index fc5126e321..5e0b37b243 100644 --- a/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp +++ b/isis/src/base/objs/ProcessMapMosaic/ProcessMapMosaic.cpp @@ -365,10 +365,10 @@ namespace Isis { // range. If the current values for the latitude and longitude range are out of // order or equal, then we don't write them to the labels. if (slat < elat && slon < elon) { - mGroup.addKeyword(PvlKeyword("MinimumLatitude", toString(slat)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MaximumLatitude", toString(elat)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MinimumLongitude", toString(slon)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MaximumLongitude", toString(elon)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(slat)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(elat)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(slon)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(elon)), Pvl::Replace); } if (mGroup.hasKeyword("UpperLeftCornerX")) @@ -445,10 +445,10 @@ namespace Isis { Pvl label; label.read(propagationCubes[0].toString()); PvlGroup mGroup = label.findGroup("Mapping", Pvl::Traverse); - mGroup.addKeyword(PvlKeyword("MinimumRingRadius", toString(srad)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MaximumRingRadius", toString(erad)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MinimumRingLongitude", toString(saz)), Pvl::Replace); - mGroup.addKeyword(PvlKeyword("MaximumRingLongitude", toString(eaz)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MinimumRingRadius", Isis::toString(srad)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MaximumRingRadius", Isis::toString(erad)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MinimumRingLongitude", Isis::toString(saz)), Pvl::Replace); + mGroup.addKeyword(PvlKeyword("MaximumRingLongitude", Isis::toString(eaz)), Pvl::Replace); if (mGroup.hasKeyword("UpperLeftCornerX")) mGroup.deleteKeyword("UpperLeftCornerX"); @@ -519,10 +519,10 @@ namespace Isis { // range. If the current values for the latitude and longitude range are out of // order or equal, then we don't write them to the labels. if (latlonflag && slat < elat && slon < elon) { - mapping.addKeyword(PvlKeyword("MinimumLatitude", toString(slat)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MaximumLatitude", toString(elat)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MinimumLongitude", toString(slon)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MaximumLongitude", toString(elon)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(slat)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(elat)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(slon)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(elon)), Pvl::Replace); } else { if (mapping.hasKeyword("MinimumLatitude")) { @@ -613,12 +613,12 @@ namespace Isis { Pvl fileLab(inputFile.toStdString()); PvlGroup &mapping = fileLab.findGroup("Mapping", Pvl::Traverse); - mapping["UpperLeftCornerX"] = toString(xmin); - mapping["UpperLeftCornerY"] = toString(ymax); - mapping.addKeyword(PvlKeyword("MinimumRingRadius", toString(srad)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MaximumRingRadius", toString(erad)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MinimumRingLongitude", toString(saz)), Pvl::Replace); - mapping.addKeyword(PvlKeyword("MaximumRingLongitude", toString(eaz)), Pvl::Replace); + mapping["UpperLeftCornerX"] = Isis::toString(xmin); + mapping["UpperLeftCornerY"] = Isis::toString(ymax); + mapping.addKeyword(PvlKeyword("MinimumRingRadius", Isis::toString(srad)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MaximumRingRadius", Isis::toString(erad)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MinimumRingLongitude", Isis::toString(saz)), Pvl::Replace); + mapping.addKeyword(PvlKeyword("MaximumRingLongitude", Isis::toString(eaz)), Pvl::Replace); Projection *firstProj = ProjectionFactory::RingsCreateFromCube(fileLab); int samps = (int)(ceil(firstProj->ToWorldX(xmax) - firstProj->ToWorldX(xmin)) + 0.5); diff --git a/isis/src/base/objs/ProcessMapMosaic/unitTest.cpp b/isis/src/base/objs/ProcessMapMosaic/unitTest.cpp index e9dbb1c3fb..87f852e71e 100644 --- a/isis/src/base/objs/ProcessMapMosaic/unitTest.cpp +++ b/isis/src/base/objs/ProcessMapMosaic/unitTest.cpp @@ -116,10 +116,10 @@ void IsisMain() { inCube.open(QString::fromStdString(inputFile)); PvlGroup mapGroup = inCube.label()->findGroup("Mapping", Pvl::Traverse); - mapGroup.addKeyword(PvlKeyword("MinimumLatitude", toString(-4.9)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MaximumLatitude", toString(-4.7)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MinimumLongitude", toString(30.7)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MaximumLongitude", toString(31)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(-4.9)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(-4.7)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(30.7)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(31)), Pvl::Replace); inCube.close(); CubeAttributeOutput oAtt2( FileName("./unitTest3.cub") ); diff --git a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp index 714d578fac..5e06fd19b6 100644 --- a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp +++ b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp @@ -165,8 +165,8 @@ namespace Isis { PvlGroup imgPosition("ImageLocation"); imgPosition += PvlKeyword("File", InputCubes[0]->fileName().toStdString()); - imgPosition += PvlKeyword("StartSample", toString(m_oss)); - imgPosition += PvlKeyword("StartLine", toString(m_osl)); + imgPosition += PvlKeyword("StartSample", Isis::toString(m_oss)); + imgPosition += PvlKeyword("StartLine", Isis::toString(m_osl)); m_imagePositions += imgPosition; // Tests for completly off the mosaic @@ -919,7 +919,7 @@ namespace Isis { if (result == "") { throw IException(IException::Unknown, - "Cannot convert overlay [" + toString((int)imageOverlay) + "] to a string", + "Cannot convert overlay [" + Isis::toString((int)imageOverlay) + "] to a string", _FILEINFO_); } @@ -1117,8 +1117,8 @@ namespace Isis { else if (outKey[j] != inKey[k]) { std::string msg = "The input cube [" + inLab->fileName() + "] and the base mosaic values " "of the Pvl Group [BandBin] for Keyword [" + outKey.name() + "] do not " - "match. Base mosaic value at index [" + toString(j) + "] = " + - outKey[j] + ". Input cube value at index [" + toString(k) + "] = " + "match. Base mosaic value at index [" + Isis::toString(j) + "] = " + + outKey[j] + ". Input cube value at index [" + Isis::toString(k) + "] = " + inKey[k] + ". **Note: use mapmos/automos MatchBandBin = false to " "override this check**"; //std::string msg = "Pvl Group [BandBin] in Key[" + outKey.name() + "] In value" + inKey[k] + diff --git a/isis/src/base/objs/Projection/Projection.cpp b/isis/src/base/objs/Projection/Projection.cpp index 03f667b4e9..fd4af7c217 100644 --- a/isis/src/base/objs/Projection/Projection.cpp +++ b/isis/src/base/objs/Projection/Projection.cpp @@ -1372,8 +1372,8 @@ namespace Isis { */ void Projection::SetUpperLeftCorner(const Displacement &x, const Displacement &y) { - PvlKeyword xKeyword("UpperLeftCornerX", toString(x.meters()), "meters"); - PvlKeyword yKeyword("UpperLeftCornerY", toString(y.meters()), "meters"); + PvlKeyword xKeyword("UpperLeftCornerX", Isis::toString(x.meters()), "meters"); + PvlKeyword yKeyword("UpperLeftCornerY", Isis::toString(y.meters()), "meters"); m_mappingGrp.addKeyword(xKeyword,Pvl::Replace); m_mappingGrp.addKeyword(yKeyword,Pvl::Replace); } diff --git a/isis/src/base/objs/Projection/unitTest.cpp b/isis/src/base/objs/Projection/unitTest.cpp index c98acea3f2..b7a2274ee7 100644 --- a/isis/src/base/objs/Projection/unitTest.cpp +++ b/isis/src/base/objs/Projection/unitTest.cpp @@ -460,7 +460,7 @@ int main(int argc, char *argv[]) { cout << endl; cout << "Test == operator with pixel resolutions not matching, but names do" << endl; - mg += PvlKeyword("PixelResolution", toString(2.0)); + mg += PvlKeyword("PixelResolution", Isis::toString(2.0)); MyProjection pMy3(lab); pMy3.SetWorldMapper(new MyMapper()); cout << "Projection 1 resolution = " << p.Resolution() << endl; @@ -529,18 +529,18 @@ int main(int argc, char *argv[]) { Isis::PvlGroup &latTestGroup = latRangeTest.findGroup("Mapping"); latTestGroup += Isis::PvlKeyword("TargetName", "Moon"); latTestGroup += Isis::PvlKeyword("ProjectionName", "PolarStereographic"); - latTestGroup += Isis::PvlKeyword("EquatorialRadius", toString(1737400.0)); - latTestGroup += Isis::PvlKeyword("PolarRadius", toString(1737400.0)); + latTestGroup += Isis::PvlKeyword("EquatorialRadius", Isis::toString(1737400.0)); + latTestGroup += Isis::PvlKeyword("PolarRadius", Isis::toString(1737400.0)); latTestGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); latTestGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - latTestGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); - latTestGroup += Isis::PvlKeyword("Scale", toString(5.0)); - latTestGroup += Isis::PvlKeyword("MinimumLatitude", toString(-90.0)); - latTestGroup += Isis::PvlKeyword("MaximumLatitude", toString(-45.0)); - latTestGroup += Isis::PvlKeyword("MinimumLongitude", toString(0.0)); - latTestGroup += Isis::PvlKeyword("MaximumLongitude", toString(360.0)); - latTestGroup += Isis::PvlKeyword("CenterLatitude", toString(-90.0)); - latTestGroup += Isis::PvlKeyword("CenterLongitude", toString(0.0)); + latTestGroup += Isis::PvlKeyword("LongitudeDomain", Isis::toString(360)); + latTestGroup += Isis::PvlKeyword("Scale", Isis::toString(5.0)); + latTestGroup += Isis::PvlKeyword("MinimumLatitude", Isis::toString(-90.0)); + latTestGroup += Isis::PvlKeyword("MaximumLatitude", Isis::toString(-45.0)); + latTestGroup += Isis::PvlKeyword("MinimumLongitude", Isis::toString(0.0)); + latTestGroup += Isis::PvlKeyword("MaximumLongitude", Isis::toString(360.0)); + latTestGroup += Isis::PvlKeyword("CenterLatitude", Isis::toString(-90.0)); + latTestGroup += Isis::PvlKeyword("CenterLongitude", Isis::toString(0.0)); Isis::Projection &latTestProjection = *Isis::ProjectionFactory::Create(latRangeTest); cout << "PolarStereographic Projection Specifications" << endl; @@ -654,7 +654,7 @@ int main(int argc, char *argv[]) { cout << endl; cout << "Rotation Tests" << endl; - mg += PvlKeyword("Rotation", toString(90.0)); + mg += PvlKeyword("Rotation", Isis::toString(90.0)); mg["LongitudeDirection"] = "PositiveEast"; mg.deleteKeyword("EquatorialRadius"); mg.deleteKeyword("PolarRadius"); diff --git a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp index 8daafcbb87..9cdc92146c 100644 --- a/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp +++ b/isis/src/base/objs/ProjectionFactory/ProjectionFactory.cpp @@ -212,9 +212,9 @@ namespace Isis { pixelResolution = (2.0 * Isis::PI * localRadius) / (360.0 * scale); } // Write out the scale and resolution with units and truescale latitude - mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", toString(pixelResolution), "meters/pixel"), + mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", Isis::toString(pixelResolution), "meters/pixel"), Isis::Pvl::Replace); - mapGroup.addKeyword(Isis::PvlKeyword("Scale", toString(scale), "pixels/degree"), Isis::Pvl::Replace); + mapGroup.addKeyword(Isis::PvlKeyword("Scale", Isis::toString(scale), "pixels/degree"), Isis::Pvl::Replace); //mapGroup.addKeyword(Isis::PvlKeyword ("TrueScaleLatitude", trueScaleLat), // Isis::Pvl::Replace); @@ -334,7 +334,7 @@ namespace Isis { else { upperLeftX = minXFlipped; } - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", toString(upperLeftX)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", Isis::toString(upperLeftX)), Isis::Pvl::Replace); if (flipY) { @@ -346,7 +346,7 @@ namespace Isis { } - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", toString(upperLeftY)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", Isis::toString(upperLeftY)), Isis::Pvl::Replace); // Write it in pixel units as well @@ -457,10 +457,10 @@ namespace Isis { } // Write out the scale and resolution with units and truescale radius - mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", toString(pixelResolution), + mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", Isis::toString(pixelResolution), "meters/pixel"), Isis::Pvl::Replace); - mapGroup.addKeyword(Isis::PvlKeyword("Scale", toString(scale), "pixels/degree"), + mapGroup.addKeyword(Isis::PvlKeyword("Scale", Isis::toString(scale), "pixels/degree"), Isis::Pvl::Replace); //mapGroup.AddKeyword(Isis::PvlKeyword ("TrueScaleRadius", trueScaleRadius), @@ -539,11 +539,11 @@ namespace Isis { // Set the upper left corner and add to the labels upperLeftX = minX; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", toString(upperLeftX)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", Isis::toString(upperLeftX)), Isis::Pvl::Replace); upperLeftY = maxY; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", toString(upperLeftY)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", Isis::toString(upperLeftY)), Isis::Pvl::Replace); // Write it in pixel units as well @@ -642,9 +642,9 @@ namespace Isis { pixelResolution = (2.0 * Isis::PI * localRadius) / (360.0 * scale); } // Write out the scale and resolution with units and truescale latitude - mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", toString(pixelResolution), "meters/pixel"), + mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", Isis::toString(pixelResolution), "meters/pixel"), Isis::Pvl::Replace); - mapGroup.addKeyword(Isis::PvlKeyword("Scale", toString(scale), "pixels/degree"), Isis::Pvl::Replace); + mapGroup.addKeyword(Isis::PvlKeyword("Scale", Isis::toString(scale), "pixels/degree"), Isis::Pvl::Replace); //mapGroup.AddKeyword(Isis::PvlKeyword ("TrueScaleLatitude", trueScaleLatitude), // Isis::Pvl::Replace); @@ -797,11 +797,11 @@ namespace Isis { // Set the upper left corner and add to the labels double upperLeftX = minX; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", toString(upperLeftX)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", Isis::toString(upperLeftX)), Isis::Pvl::Replace); double upperLeftY = maxY; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", toString(upperLeftY)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", Isis::toString(upperLeftY)), Isis::Pvl::Replace); // Make sure labels have good units @@ -895,9 +895,9 @@ namespace Isis { pixelResolution = (2.0 * Isis::PI * localRadius) / (360.0 * scale); } // Write out the scale and resolution with units and truescale radius - mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", toString(pixelResolution), + mapGroup.addKeyword(Isis::PvlKeyword("PixelResolution", Isis::toString(pixelResolution), "meters/pixel"), Isis::Pvl::Replace); - mapGroup.addKeyword(Isis::PvlKeyword("Scale", toString(scale), "pixels/degree"), + mapGroup.addKeyword(Isis::PvlKeyword("Scale", Isis::toString(scale), "pixels/degree"), Isis::Pvl::Replace); // Initialize the rest of the projection @@ -1019,11 +1019,11 @@ namespace Isis { // Set the upper left corner and add to the labels double upperLeftX = minX; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", toString(upperLeftX)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerX", Isis::toString(upperLeftX)), Isis::Pvl::Replace); double upperLeftY = maxY; - mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", toString(upperLeftY)), + mapGroup.addKeyword(Isis::PvlKeyword("UpperLeftCornerY", Isis::toString(upperLeftY)), Isis::Pvl::Replace); // Make sure labels have good units diff --git a/isis/src/base/objs/ProjectionFactory/unitTest.cpp b/isis/src/base/objs/ProjectionFactory/unitTest.cpp index a8aea67ffb..bd84486d79 100644 --- a/isis/src/base/objs/ProjectionFactory/unitTest.cpp +++ b/isis/src/base/objs/ProjectionFactory/unitTest.cpp @@ -30,29 +30,29 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(3396190.0)); - mapGroup += PvlKeyword("PolarRadius", toString(3376200.0)); + mapGroup += PvlKeyword("EquatorialRadius", Isis::toString(3396190.0)); + mapGroup += PvlKeyword("PolarRadius", Isis::toString(3376200.0)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(360)); + mapGroup += PvlKeyword("LongitudeDomain", Isis::toString(360)); mapGroup += PvlKeyword("ProjectionName", "SimpleCylindrical"); - mapGroup += PvlKeyword("CenterLongitude", toString(220.0)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(220.0)); cout << "Test for missing pixel resolution ... " << endl; doit(lab); doit2(lab); - mapGroup += PvlKeyword("PixelResolution", toString(2000.0)); + mapGroup += PvlKeyword("PixelResolution", Isis::toString(2000.0)); cout << "Test for missing upper left X ... " << endl; doit(lab); - mapGroup += PvlKeyword("UpperLeftCornerX", toString(-18000.0)); + mapGroup += PvlKeyword("UpperLeftCornerX", Isis::toString(-18000.0)); cout << "Test for missing upper left Y ... " << endl; doit(lab); - mapGroup += PvlKeyword("UpperLeftCornerY", toString(2062000.0)); + mapGroup += PvlKeyword("UpperLeftCornerY", Isis::toString(2062000.0)); cout << "Testing conversion from image to ground ... " << endl; TProjection *proj = (TProjection *) ProjectionFactory::CreateFromCube(lab); @@ -71,10 +71,10 @@ int main(int argc, char *argv[]) { cout << "Testing missing ground range on create method ... " << endl; doit2(lab); - mapGroup += PvlKeyword("MinimumLatitude", toString(10.8920539924144)); - mapGroup += PvlKeyword("MaximumLatitude", toString(34.7603960060206)); - mapGroup += PvlKeyword("MinimumLongitude", toString(219.72432466275)); - mapGroup += PvlKeyword("MaximumLongitude", toString(236.186050244411)); + mapGroup += PvlKeyword("MinimumLatitude", Isis::toString(10.8920539924144)); + mapGroup += PvlKeyword("MaximumLatitude", Isis::toString(34.7603960060206)); + mapGroup += PvlKeyword("MinimumLongitude", Isis::toString(219.72432466275)); + mapGroup += PvlKeyword("MaximumLongitude", Isis::toString(236.186050244411)); mapGroup.deleteKeyword("UpperLeftCornerX"); mapGroup.deleteKeyword("UpperLeftCornerY"); @@ -88,15 +88,15 @@ int main(int argc, char *argv[]) { cout << endl; cout << "Testing create method with existing cube labels" << endl; - mapGroup.addKeyword(PvlKeyword("UpperLeftCornerX", toString(-16000.0)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("UpperLeftCornerY", toString(2060000.0)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("UpperLeftCornerX", Isis::toString(-16000.0)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("UpperLeftCornerY", Isis::toString(2060000.0)), Pvl::Replace); Pvl lab2; PvlObject icube("IsisCube"); PvlObject core("Core"); PvlGroup dims("Dimensions"); - dims += PvlKeyword("Lines", toString(400)); - dims += PvlKeyword("Samples", toString(600)); + dims += PvlKeyword("Lines", Isis::toString(400)); + dims += PvlKeyword("Samples", Isis::toString(600)); core.addGroup(dims); icube.addObject(core); icube.addGroup(mapGroup); @@ -122,18 +122,18 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(3396190.0)); - mapGroup += PvlKeyword("PolarRadius", toString(3376200.0)); + mapGroup += PvlKeyword("EquatorialRadius", Isis::toString(3396190.0)); + mapGroup += PvlKeyword("PolarRadius", Isis::toString(3376200.0)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(360)); + mapGroup += PvlKeyword("LongitudeDomain", Isis::toString(360)); mapGroup += PvlKeyword("ProjectionName", "UnsupportedProjection"); - mapGroup += PvlKeyword("CenterLongitude", toString(220.0)); - mapGroup += PvlKeyword("PixelResolution", toString(2000.0)); - mapGroup += PvlKeyword("UpperLeftCornerX", toString(-18000.0)); - mapGroup += PvlKeyword("UpperLeftCornerY", toString(2062000.0)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(220.0)); + mapGroup += PvlKeyword("PixelResolution", Isis::toString(2000.0)); + mapGroup += PvlKeyword("UpperLeftCornerX", Isis::toString(-18000.0)); + mapGroup += PvlKeyword("UpperLeftCornerY", Isis::toString(2062000.0)); TProjection *proj = (TProjection *) ProjectionFactory::Create(lab); proj->SetWorld(245.0, 355.0); @@ -153,18 +153,18 @@ int main(int argc, char *argv[]) { southMap.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroupSouth = southMap.findGroup("Mapping"); mapGroupSouth += PvlKeyword("ProjectionName", "Equirectangular"); - mapGroupSouth += PvlKeyword("CenterLongitude", toString(0.0)); - mapGroupSouth += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroupSouth += PvlKeyword("EquatorialRadius", toString(13400.0)); - mapGroupSouth += PvlKeyword("PolarRadius", toString(9200.0)); + mapGroupSouth += PvlKeyword("CenterLongitude", Isis::toString(0.0)); + mapGroupSouth += PvlKeyword("CenterLatitude", Isis::toString(0.0)); + mapGroupSouth += PvlKeyword("EquatorialRadius", Isis::toString(13400.0)); + mapGroupSouth += PvlKeyword("PolarRadius", Isis::toString(9200.0)); mapGroupSouth += PvlKeyword("LatitudeType", "Planetocentric"); mapGroupSouth += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroupSouth += PvlKeyword("LongitudeDomain", toString(360)); - mapGroupSouth += PvlKeyword("MinimumLatitude", toString(-60.0)); - mapGroupSouth += PvlKeyword("MaximumLatitude", toString(0.0)); - mapGroupSouth += PvlKeyword("MinimumLongitude", toString(0.0)); - mapGroupSouth += PvlKeyword("MaximumLongitude", toString(360.0)); - mapGroupSouth += PvlKeyword("PixelResolution", toString(10.0)); + mapGroupSouth += PvlKeyword("LongitudeDomain", Isis::toString(360)); + mapGroupSouth += PvlKeyword("MinimumLatitude", Isis::toString(-60.0)); + mapGroupSouth += PvlKeyword("MaximumLatitude", Isis::toString(0.0)); + mapGroupSouth += PvlKeyword("MinimumLongitude", Isis::toString(0.0)); + mapGroupSouth += PvlKeyword("MaximumLongitude", Isis::toString(360.0)); + mapGroupSouth += PvlKeyword("PixelResolution", Isis::toString(10.0)); Pvl northMap; @@ -172,18 +172,18 @@ int main(int argc, char *argv[]) { northMap.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroupNorth = northMap.findGroup("Mapping"); mapGroupNorth += PvlKeyword("ProjectionName", "Equirectangular"); - mapGroupNorth += PvlKeyword("CenterLongitude", toString(0.0)); - mapGroupNorth += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroupNorth += PvlKeyword("EquatorialRadius", toString(13400.0)); - mapGroupNorth += PvlKeyword("PolarRadius", toString(9200.0)); + mapGroupNorth += PvlKeyword("CenterLongitude", Isis::toString(0.0)); + mapGroupNorth += PvlKeyword("CenterLatitude", Isis::toString(0.0)); + mapGroupNorth += PvlKeyword("EquatorialRadius", Isis::toString(13400.0)); + mapGroupNorth += PvlKeyword("PolarRadius", Isis::toString(9200.0)); mapGroupNorth += PvlKeyword("LatitudeType", "Planetocentric"); mapGroupNorth += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroupNorth += PvlKeyword("LongitudeDomain", toString(360)); - mapGroupNorth += PvlKeyword("MinimumLatitude", toString(0.0)); - mapGroupNorth += PvlKeyword("MaximumLatitude", toString(60.0)); - mapGroupNorth += PvlKeyword("MinimumLongitude", toString(0.0)); - mapGroupNorth += PvlKeyword("MaximumLongitude", toString(360.0)); - mapGroupNorth += PvlKeyword("PixelResolution", toString(10.0)); + mapGroupNorth += PvlKeyword("LongitudeDomain", Isis::toString(360)); + mapGroupNorth += PvlKeyword("MinimumLatitude", Isis::toString(0.0)); + mapGroupNorth += PvlKeyword("MaximumLatitude", Isis::toString(60.0)); + mapGroupNorth += PvlKeyword("MinimumLongitude", Isis::toString(0.0)); + mapGroupNorth += PvlKeyword("MaximumLongitude", Isis::toString(360.0)); + mapGroupNorth += PvlKeyword("PixelResolution", Isis::toString(10.0)); TProjection *projNorth = (TProjection *) ProjectionFactory::CreateForCube(southMap, @@ -223,18 +223,18 @@ int main(int argc, char *argv[]) { eastMap.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroupEast = eastMap.findGroup("Mapping"); mapGroupEast += PvlKeyword("ProjectionName", "Equirectangular"); - mapGroupEast += PvlKeyword("CenterLongitude", toString(0.0)); - mapGroupEast += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroupEast += PvlKeyword("EquatorialRadius", toString(13400.0)); - mapGroupEast += PvlKeyword("PolarRadius", toString(9200.0)); + mapGroupEast += PvlKeyword("CenterLongitude", Isis::toString(0.0)); + mapGroupEast += PvlKeyword("CenterLatitude", Isis::toString(0.0)); + mapGroupEast += PvlKeyword("EquatorialRadius", Isis::toString(13400.0)); + mapGroupEast += PvlKeyword("PolarRadius", Isis::toString(9200.0)); mapGroupEast += PvlKeyword("LatitudeType", "Planetocentric"); mapGroupEast += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroupEast += PvlKeyword("LongitudeDomain", toString(360)); - mapGroupEast += PvlKeyword("MinimumLatitude", toString(0.0)); - mapGroupEast += PvlKeyword("MaximumLatitude", toString(60.0)); - mapGroupEast += PvlKeyword("MinimumLongitude", toString(0.0)); - mapGroupEast += PvlKeyword("MaximumLongitude", toString(90.0)); - mapGroupEast += PvlKeyword("PixelResolution", toString(10.0)); + mapGroupEast += PvlKeyword("LongitudeDomain", Isis::toString(360)); + mapGroupEast += PvlKeyword("MinimumLatitude", Isis::toString(0.0)); + mapGroupEast += PvlKeyword("MaximumLatitude", Isis::toString(60.0)); + mapGroupEast += PvlKeyword("MinimumLongitude", Isis::toString(0.0)); + mapGroupEast += PvlKeyword("MaximumLongitude", Isis::toString(90.0)); + mapGroupEast += PvlKeyword("PixelResolution", Isis::toString(10.0)); Pvl westMap; @@ -242,18 +242,18 @@ int main(int argc, char *argv[]) { westMap.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroupWest = westMap.findGroup("Mapping"); mapGroupWest += PvlKeyword("ProjectionName", "Equirectangular"); - mapGroupWest += PvlKeyword("CenterLongitude", toString(0.0)); - mapGroupWest += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroupWest += PvlKeyword("EquatorialRadius", toString(13400.0)); - mapGroupWest += PvlKeyword("PolarRadius", toString(9200.0)); + mapGroupWest += PvlKeyword("CenterLongitude", Isis::toString(0.0)); + mapGroupWest += PvlKeyword("CenterLatitude", Isis::toString(0.0)); + mapGroupWest += PvlKeyword("EquatorialRadius", Isis::toString(13400.0)); + mapGroupWest += PvlKeyword("PolarRadius", Isis::toString(9200.0)); mapGroupWest += PvlKeyword("LatitudeType", "Planetocentric"); mapGroupWest += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroupWest += PvlKeyword("LongitudeDomain", toString(360)); - mapGroupWest += PvlKeyword("MinimumLatitude", toString(0.0)); - mapGroupWest += PvlKeyword("MaximumLatitude", toString(60.0)); - mapGroupWest += PvlKeyword("MinimumLongitude", toString(-90.0)); - mapGroupWest += PvlKeyword("MaximumLongitude", toString(0.0)); - mapGroupWest += PvlKeyword("PixelResolution", toString(10.0)); + mapGroupWest += PvlKeyword("LongitudeDomain", Isis::toString(360)); + mapGroupWest += PvlKeyword("MinimumLatitude", Isis::toString(0.0)); + mapGroupWest += PvlKeyword("MaximumLatitude", Isis::toString(60.0)); + mapGroupWest += PvlKeyword("MinimumLongitude", Isis::toString(-90.0)); + mapGroupWest += PvlKeyword("MaximumLongitude", Isis::toString(0.0)); + mapGroupWest += PvlKeyword("PixelResolution", Isis::toString(10.0)); TProjection *projEast = (TProjection *) ProjectionFactory::CreateForCube(eastMap, diff --git a/isis/src/base/objs/RadarSlantRangeMap/RadarSlantRangeMap.cpp b/isis/src/base/objs/RadarSlantRangeMap/RadarSlantRangeMap.cpp index b5d9c35154..c170b48f5f 100644 --- a/isis/src/base/objs/RadarSlantRangeMap/RadarSlantRangeMap.cpp +++ b/isis/src/base/objs/RadarSlantRangeMap/RadarSlantRangeMap.cpp @@ -262,10 +262,10 @@ namespace Isis { double et; utc2et_c(array[0].c_str(), &et); p_time.push_back(et); - p_a0.push_back(IString::ToDouble(array[1])); - p_a1.push_back(IString::ToDouble(array[2])); - p_a2.push_back(IString::ToDouble(array[3])); - p_a3.push_back(IString::ToDouble(array[4])); + p_a0.push_back(Isis::toDouble(array[1])); + p_a1.push_back(Isis::toDouble(array[2])); + p_a2.push_back(Isis::toDouble(array[3])); + p_a3.push_back(Isis::toDouble(array[4])); // TODO: Test that times are ordered if not throw error // Make the mrf2isis program sort them if necessary } diff --git a/isis/src/base/objs/Reduce/Reduce.cpp b/isis/src/base/objs/Reduce/Reduce.cpp index 7c1723bd2b..79ada1a62c 100644 --- a/isis/src/base/objs/Reduce/Reduce.cpp +++ b/isis/src/base/objs/Reduce/Reduce.cpp @@ -117,16 +117,16 @@ namespace Isis { // Information will be added to it if the Mapping or Instrument // groups are deleted from the output image label PvlGroup resultsGrp("Results"); - resultsGrp += PvlKeyword("InputLines", toString(miInputLines)); - resultsGrp += PvlKeyword("InputSamples", toString(miInputSamples)); - resultsGrp += PvlKeyword("StartingLine", toString(miStartLine)); - resultsGrp += PvlKeyword("StartingSample", toString(miStartSample)); - resultsGrp += PvlKeyword("EndingLine", toString(miEndLine)); - resultsGrp += PvlKeyword("EndingSample", toString(miEndSample)); - resultsGrp += PvlKeyword("LineIncrement", toString(mdLineScale)); - resultsGrp += PvlKeyword("SampleIncrement", toString(mdSampleScale)); - resultsGrp += PvlKeyword("OutputLines", toString(miOutputLines)); - resultsGrp += PvlKeyword("OutputSamples", toString(miOutputSamples)); + resultsGrp += PvlKeyword("InputLines", Isis::toString(miInputLines)); + resultsGrp += PvlKeyword("InputSamples", Isis::toString(miInputSamples)); + resultsGrp += PvlKeyword("StartingLine", Isis::toString(miStartLine)); + resultsGrp += PvlKeyword("StartingSample", Isis::toString(miStartSample)); + resultsGrp += PvlKeyword("EndingLine", Isis::toString(miEndLine)); + resultsGrp += PvlKeyword("EndingSample", Isis::toString(miEndSample)); + resultsGrp += PvlKeyword("LineIncrement", Isis::toString(mdLineScale)); + resultsGrp += PvlKeyword("SampleIncrement", Isis::toString(mdSampleScale)); + resultsGrp += PvlKeyword("OutputLines", Isis::toString(miOutputLines)); + resultsGrp += PvlKeyword("OutputSamples", Isis::toString(miOutputSamples)); Isis::SubArea subArea; subArea.SetSubArea(mInCube->lineCount(), mInCube->sampleCount(), miStartLine, miStartSample, diff --git a/isis/src/base/objs/ReseauDistortionMap/ReseauDistortionMap.cpp b/isis/src/base/objs/ReseauDistortionMap/ReseauDistortionMap.cpp index 26f70435d4..cd7bce04dc 100644 --- a/isis/src/base/objs/ReseauDistortionMap/ReseauDistortionMap.cpp +++ b/isis/src/base/objs/ReseauDistortionMap/ReseauDistortionMap.cpp @@ -44,8 +44,8 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } for(int i = 0; i < p_numRes; i++) { - p_mlines.push_back(IString::ToDouble(mline[i])); - p_msamps.push_back(IString::ToDouble(msamp[i])); + p_mlines.push_back(Isis::toDouble(mline[i])); + p_msamps.push_back(Isis::toDouble(msamp[i])); } p_pixelPitch = parent->PixelPitch(); @@ -58,8 +58,8 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } for(int i = 0; i < p_numRes; i++) { - p_rlines.push_back(IString::ToDouble(rline[i])); - p_rsamps.push_back(IString::ToDouble(rsamp[i])); + p_rlines.push_back(Isis::toDouble(rline[i])); + p_rsamps.push_back(Isis::toDouble(rsamp[i])); } if(p_mlines.size() != p_rlines.size()) { string msg = "The number of master reseaus and refined reseaus"; diff --git a/isis/src/base/objs/RingCylindrical/RingCylindrical.cpp b/isis/src/base/objs/RingCylindrical/RingCylindrical.cpp index 1a235f0a2d..94a6520311 100644 --- a/isis/src/base/objs/RingCylindrical/RingCylindrical.cpp +++ b/isis/src/base/objs/RingCylindrical/RingCylindrical.cpp @@ -45,14 +45,14 @@ namespace Isis { // Compute the default value if allowed and needed if ((allowDefaults) && (!mapGroup.hasKeyword("CenterRingLongitude"))) { double az = (m_minimumRingLongitude + m_maximumRingLongitude) / 2.0; - mapGroup += PvlKeyword("CenterRingLongitude", toString(az)); + mapGroup += PvlKeyword("CenterRingLongitude", Isis::toString(az)); } // Compute and write the default center radius if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterRingRadius"))) { double radius = (m_minimumRingRadius + m_maximumRingRadius) / 2.0; - mapGroup += PvlKeyword("CenterRingRadius", toString(radius)); + mapGroup += PvlKeyword("CenterRingRadius", Isis::toString(radius)); } // Get the center ring radius and center ring longitude. @@ -274,11 +274,11 @@ namespace Isis { PvlGroup RingCylindrical::Mapping() { PvlGroup mapping = RingPlaneProjection::Mapping(); - mapping += PvlKeyword("CenterRingRadius", toString(m_centerRingRadius)); + mapping += PvlKeyword("CenterRingRadius", Isis::toString(m_centerRingRadius)); double dir = 1.0; if (m_ringLongitudeDirection == Clockwise) dir = -1.0; double lonDegrees = m_centerRingLongitude*RAD2DEG*dir; - mapping += PvlKeyword("CenterRingLongitude", toString(lonDegrees)); + mapping += PvlKeyword("CenterRingLongitude", Isis::toString(lonDegrees)); return mapping; } diff --git a/isis/src/base/objs/Robinson/Robinson.cpp b/isis/src/base/objs/Robinson/Robinson.cpp index f10c7f7205..19aa3f661a 100644 --- a/isis/src/base/objs/Robinson/Robinson.cpp +++ b/isis/src/base/objs/Robinson/Robinson.cpp @@ -93,7 +93,7 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } // Get the center longitude diff --git a/isis/src/base/objs/SerialNumber/SerialNumber.cpp b/isis/src/base/objs/SerialNumber/SerialNumber.cpp index 8e3c5c2b9e..a7ae79ff05 100644 --- a/isis/src/base/objs/SerialNumber/SerialNumber.cpp +++ b/isis/src/base/objs/SerialNumber/SerialNumber.cpp @@ -149,7 +149,7 @@ namespace Isis { } PvlGroup snGroup = outLabel.findGroup("SerialNumberKeywords"); - snGroup += PvlKeyword("ObservationKeys", toString(snGroup.keywords())); + snGroup += PvlKeyword("ObservationKeys", Isis::toString(snGroup.keywords())); return snGroup; } diff --git a/isis/src/base/objs/SessionLog/unitTest.cpp b/isis/src/base/objs/SessionLog/unitTest.cpp index b10541d00c..5b80eaf2df 100644 --- a/isis/src/base/objs/SessionLog/unitTest.cpp +++ b/isis/src/base/objs/SessionLog/unitTest.cpp @@ -23,17 +23,17 @@ int main(int argc, char *argv[]) { try { PvlGroup results("Results");; results.addComment("// This is an example of the results group"); - results += PvlKeyword("Average", toString(13.5), "Meters"); + results += PvlKeyword("Average", Isis::toString(13.5), "Meters"); results[0].addComment("// Average size of a rock"); Pvl error; PvlGroup temp("Error"); temp += PvlKeyword("Program", "ratio"); temp += PvlKeyword("Class", "I/O ERROR"); - temp += PvlKeyword("Status", toString(-1)); + temp += PvlKeyword("Status", Isis::toString(-1)); temp += PvlKeyword("Message", "Unable to open file"); temp += PvlKeyword("File", "unitTest.cpp"); - temp += PvlKeyword("Line", toString(501)); + temp += PvlKeyword("Line", Isis::toString(501)); error.addGroup(temp); char **s_argv; s_argv = new char*[10]; diff --git a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp index 30d8841fca..a4b600d7d1 100644 --- a/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp +++ b/isis/src/base/objs/ShapeModelFactory/ShapeModelFactory.cpp @@ -183,7 +183,7 @@ namespace Isis { // Do this here, otherwise default behavior will ensue from here on out kernelsPvlGroup.addKeyword(PvlKeyword("RayTraceEngine", preferred.toStdString()), PvlContainer::Replace); kernelsPvlGroup.addKeyword(PvlKeyword("OnError", onerror.toStdString()), PvlContainer::Replace); - kernelsPvlGroup.addKeyword(PvlKeyword("Tolerance", toString(tolerance)), + kernelsPvlGroup.addKeyword(PvlKeyword("Tolerance", Isis::toString(tolerance)), PvlContainer::Replace); return ( b_model ); @@ -220,7 +220,7 @@ namespace Isis { // Do this here, otherwise default behavior will ensue from here on out kernelsPvlGroup.addKeyword(PvlKeyword("RayTraceEngine", preferred.toStdString()), PvlContainer::Replace); kernelsPvlGroup.addKeyword(PvlKeyword("OnError", onerror.toStdString()), PvlContainer::Replace); - kernelsPvlGroup.addKeyword(PvlKeyword("Tolerance", toString(tolerance)), + kernelsPvlGroup.addKeyword(PvlKeyword("Tolerance", Isis::toString(tolerance)), PvlContainer::Replace); return ( embreeModel ); diff --git a/isis/src/base/objs/ShapeModelFactory/unitTest.cpp b/isis/src/base/objs/ShapeModelFactory/unitTest.cpp index b514a2afa1..fd9fdba12a 100644 --- a/isis/src/base/objs/ShapeModelFactory/unitTest.cpp +++ b/isis/src/base/objs/ShapeModelFactory/unitTest.cpp @@ -68,7 +68,7 @@ int main() { QString dir = QString::fromStdString(f.expanded()) + "/"; QString dir2 = QString::fromStdString(f2.expanded()) + "/"; QString dir3 = QString::fromStdString(f3.expanded()) + "/"; - kern1 += PvlKeyword("NaifFrameCode", toString(-94031)); + kern1 += PvlKeyword("NaifFrameCode", Isis::toString(-94031)); kern1 += PvlKeyword("LeapSecond", dir.toStdString() + "naif0007.tls"); kern1 += PvlKeyword("SpacecraftClock", dir.toStdString() + "MGS_SCLKSCET.00045.tsc"); kern1 += PvlKeyword("TargetPosition", dir.toStdString() + "de405.bsp"); @@ -78,14 +78,14 @@ int main() { kern1 += PvlKeyword("InstrumentPosition", dir.toStdString() + "moc.bsp"); kern1 += PvlKeyword("InstrumentPointing", dir.toStdString() + "moc.bc"); kern1 += PvlKeyword("Frame", ""); - kern1 += PvlKeyword("NaifBodyCode", toString(499)); + kern1 += PvlKeyword("NaifBodyCode", Isis::toString(499)); // Time Setup double startTime = -69382819.0; double endTime = -69382512.0; double slope = (endTime - startTime) / (10 - 1); - kern1 += PvlKeyword("StartPadding", toString(slope)); - kern1 += PvlKeyword("EndPadding", toString(slope)); + kern1 += PvlKeyword("StartPadding", Isis::toString(slope)); + kern1 += PvlKeyword("EndPadding", Isis::toString(slope)); Pvl lab1; lab1.addGroup(inst1); diff --git a/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp b/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp index 9df7ae7502..c0071b2f3e 100644 --- a/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp +++ b/isis/src/base/objs/SimpleCylindrical/SimpleCylindrical.cpp @@ -44,7 +44,7 @@ namespace Isis { // Compute the default value if allowed and needed if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } // Get the center longitude, convert to radians, adjust for longitude diff --git a/isis/src/base/objs/SimpleCylindrical/unitTest.cpp b/isis/src/base/objs/SimpleCylindrical/unitTest.cpp index 35894fb115..b39aa51edd 100644 --- a/isis/src/base/objs/SimpleCylindrical/unitTest.cpp +++ b/isis/src/base/objs/SimpleCylindrical/unitTest.cpp @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGrp = lab.findGroup("Mapping"); - mapGrp += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGrp += PvlKeyword("PolarRadius", toString(1.0)); + mapGrp += PvlKeyword("EquatorialRadius", Isis::toString(1.0)); + mapGrp += PvlKeyword("PolarRadius", Isis::toString(1.0)); mapGrp += PvlKeyword("LatitudeType", "Planetocentric"); mapGrp += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGrp += PvlKeyword("LongitudeDomain", toString(180)); - mapGrp += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGrp += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGrp += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGrp += PvlKeyword("MaximumLongitude", toString(180.0)); + mapGrp += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mapGrp += PvlKeyword("MinimumLatitude", Isis::toString(-90.0)); + mapGrp += PvlKeyword("MaximumLatitude", Isis::toString(90.0)); + mapGrp += PvlKeyword("MinimumLongitude", Isis::toString(-180.0)); + mapGrp += PvlKeyword("MaximumLongitude", Isis::toString(180.0)); mapGrp += PvlKeyword("ProjectionName", "SimpleCylindrical"); cout << "Test missing center longitude keyword ..." << endl; @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) { cout << endl; try { - mapGrp += PvlKeyword("CenterLongitude", toString(-90.0)); + mapGrp += PvlKeyword("CenterLongitude", Isis::toString(-90.0)); TProjection *p = (TProjection *) ProjectionFactory::Create(lab); cout << "Test SetGround method ... " << endl; diff --git a/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp b/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp index 3eca8d8cc8..5e18d209c0 100644 --- a/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp +++ b/isis/src/base/objs/Sinusoidal/Sinusoidal.cpp @@ -45,7 +45,7 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } // Get the center longitude diff --git a/isis/src/base/objs/Sinusoidal/unitTest.cpp b/isis/src/base/objs/Sinusoidal/unitTest.cpp index 1451139529..2e95b0266c 100644 --- a/isis/src/base/objs/Sinusoidal/unitTest.cpp +++ b/isis/src/base/objs/Sinusoidal/unitTest.cpp @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGroup += PvlKeyword("PolarRadius", toString(1.0)); + mapGroup += PvlKeyword("EquatorialRadius", Isis::toString(1.0)); + mapGroup += PvlKeyword("PolarRadius", Isis::toString(1.0)); mapGroup += PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(90.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-180.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(180.0)); + mapGroup += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mapGroup += PvlKeyword("MinimumLatitude", Isis::toString(-90.0)); + mapGroup += PvlKeyword("MaximumLatitude", Isis::toString(90.0)); + mapGroup += PvlKeyword("MinimumLongitude", Isis::toString(-180.0)); + mapGroup += PvlKeyword("MaximumLongitude", Isis::toString(180.0)); mapGroup += PvlKeyword("ProjectionName", "Sinusoidal"); cout << "Test missing center longitude keyword ..." << endl; @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(-90.0)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(-90.0)); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); diff --git a/isis/src/base/objs/Spice/Spice.cpp b/isis/src/base/objs/Spice/Spice.cpp index 6ca7783100..2034f5a295 100644 --- a/isis/src/base/objs/Spice/Spice.cpp +++ b/isis/src/base/objs/Spice/Spice.cpp @@ -171,14 +171,14 @@ namespace Isis { // Get the time padding first if (kernels.hasKeyword("StartPadding")) { - *m_startTimePadding = IString::ToDouble(kernels["StartPadding"][0]); + *m_startTimePadding = Isis::toDouble(kernels["StartPadding"][0]); } else { *m_startTimePadding = 0.0; } if (kernels.hasKeyword("EndPadding")) { - *m_endTimePadding = IString::ToDouble(kernels["EndPadding"][0]); + *m_endTimePadding = Isis::toDouble(kernels["EndPadding"][0]); } else { *m_endTimePadding = 0.0; @@ -297,7 +297,7 @@ namespace Isis { QString trykey = "NaifIkCode"; if (kernels.hasKeyword("NaifFrameCode")) trykey = "NaifFrameCode"; - *m_ikCode = IString::ToInteger(kernels[trykey.toStdString()][0]); + *m_ikCode = Isis::toInt(kernels[trykey.toStdString()][0]); *m_spkCode = *m_ikCode / 1000; *m_sclkCode = *m_spkCode; @@ -1217,10 +1217,10 @@ namespace Isis { storedKey[index] = value.toString().toStdString(); } else if (type == SpiceDoubleType) { - storedKey[index] = toString(value.toDouble()); + storedKey[index] = Isis::toString(value.toDouble()); } else if (type == SpiceIntType) { - storedKey[index] = toString(value.toInt()); + storedKey[index] = Isis::toString(value.toInt()); } else { std::string msg = "Unable to store variant in labels for key [" + key.toStdString() + "]"; @@ -1239,7 +1239,7 @@ namespace Isis { try { if (type == SpiceDoubleType) { - result = IString::ToDouble(storedKeyword[index]); + result = Isis::toDouble(storedKeyword[index]); } else if (type == SpiceStringType) { result = QString::fromStdString(storedKeyword[index]); @@ -1248,7 +1248,7 @@ namespace Isis { result = QString::fromStdString(storedKeyword[index]); } else if (type == SpiceIntType) { - result = IString::ToInteger(storedKeyword[index]); + result = Isis::toInt(storedKeyword[index]); } } catch(IException &e) { diff --git a/isis/src/base/objs/Spice/unitTest.cpp b/isis/src/base/objs/Spice/unitTest.cpp index d7f28c1978..c317db2978 100644 --- a/isis/src/base/objs/Spice/unitTest.cpp +++ b/isis/src/base/objs/Spice/unitTest.cpp @@ -121,8 +121,8 @@ int main(int argc, char *argv[]) { double endTime = -69382512.0; double slope = (endTime - startTime) / (10 - 1); - kernelsGroup += PvlKeyword("StartPadding", toString(slope)); - kernelsGroup += PvlKeyword("EndPadding", toString(slope)); + kernelsGroup += PvlKeyword("StartPadding", Isis::toString(slope)); + kernelsGroup += PvlKeyword("EndPadding", Isis::toString(slope)); Pvl &lab = *dummyCube.label(); PvlObject &isisCubeObj = lab.findObject("IsisCube"); diff --git a/isis/src/base/objs/SpicePosition/SpicePosition.cpp b/isis/src/base/objs/SpicePosition/SpicePosition.cpp index 97d7c83271..ebd21d5404 100644 --- a/isis/src/base/objs/SpicePosition/SpicePosition.cpp +++ b/isis/src/base/objs/SpicePosition/SpicePosition.cpp @@ -436,13 +436,13 @@ namespace Isis { // Load the full cache time information from the label if available if(table.Label().hasKeyword("SpkTableStartTime")) { - p_fullCacheStartTime = IString::ToDouble(table.Label().findKeyword("SpkTableStartTime")[0]); + p_fullCacheStartTime = Isis::toDouble(table.Label().findKeyword("SpkTableStartTime")[0]); } if(table.Label().hasKeyword("SpkTableEndTime")) { - p_fullCacheEndTime = IString::ToDouble(table.Label().findKeyword("SpkTableEndTime")[0]); + p_fullCacheEndTime = Isis::toDouble(table.Label().findKeyword("SpkTableEndTime")[0]); } if(table.Label().hasKeyword("SpkTableOriginalSize")) { - p_fullCacheSize = IString::ToDouble(table.Label().findKeyword("SpkTableOriginalSize")[0]); + p_fullCacheSize = Isis::toDouble(table.Label().findKeyword("SpkTableOriginalSize")[0]); } @@ -674,15 +674,15 @@ namespace Isis { // Write original time coverage if(p_fullCacheStartTime != 0) { table.Label() += PvlKeyword("SpkTableStartTime"); - table.Label()["SpkTableStartTime"].addValue(toString(p_fullCacheStartTime)); + table.Label()["SpkTableStartTime"].addValue(Isis::toString(p_fullCacheStartTime)); } if(p_fullCacheEndTime != 0) { table.Label() += PvlKeyword("SpkTableEndTime"); - table.Label()["SpkTableEndTime"].addValue(toString(p_fullCacheEndTime)); + table.Label()["SpkTableEndTime"].addValue(Isis::toString(p_fullCacheEndTime)); } if(p_fullCacheSize != 0) { table.Label() += PvlKeyword("SpkTableOriginalSize"); - table.Label()["SpkTableOriginalSize"].addValue(toString(p_fullCacheSize)); + table.Label()["SpkTableOriginalSize"].addValue(Isis::toString(p_fullCacheSize)); } } diff --git a/isis/src/base/objs/SpicePosition/unitTest.cpp b/isis/src/base/objs/SpicePosition/unitTest.cpp index 17ad5947fe..918ef2ba99 100644 --- a/isis/src/base/objs/SpicePosition/unitTest.cpp +++ b/isis/src/base/objs/SpicePosition/unitTest.cpp @@ -216,11 +216,11 @@ int main(int argc, char *argv[]) { // Add table label table.Label() += PvlKeyword("CacheType", "HermiteSpline"); table.Label() += PvlKeyword("SpkTableStartTime"); - table.Label()["SpkTableStartTime"].addValue(toString(-69382819.360519)); + table.Label()["SpkTableStartTime"].addValue(Isis::toString(-69382819.360519)); table.Label() += PvlKeyword("SpkTableEndTime"); - table.Label()["SpkTableEndTime"].addValue(toString(-69382512.160519)); + table.Label()["SpkTableEndTime"].addValue(Isis::toString(-69382512.160519)); table.Label() += PvlKeyword("SpkTableOriginalSize"); - table.Label()["SpkTableOriginalSize"].addValue(toString(769)); + table.Label()["SpkTableOriginalSize"].addValue(Isis::toString(769)); // Load table into the object pos4.LoadCache(table); diff --git a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp index 61c9bc57aa..0d8d7e065a 100644 --- a/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp +++ b/isis/src/base/objs/SpiceRotation/SpiceRotation.cpp @@ -551,7 +551,7 @@ namespace Isis { if (table.Label().hasKeyword("TimeDependentFrames")) { PvlKeyword labelTimeFrames = table.Label()["TimeDependentFrames"]; for (int i = 0; i < labelTimeFrames.size(); i++) { - p_timeFrames.push_back(IString::ToInteger(labelTimeFrames[i])); + p_timeFrames.push_back(Isis::toInt(labelTimeFrames[i])); } } else { @@ -564,12 +564,12 @@ namespace Isis { p_constantFrames.clear(); for (int i = 0; i < labelConstantFrames.size(); i++) { - p_constantFrames.push_back(IString::ToInteger(labelConstantFrames[i])); + p_constantFrames.push_back(Isis::toInt(labelConstantFrames[i])); } PvlKeyword labelConstantRotation = table.Label()["ConstantRotation"]; for (int i = 0; i < labelConstantRotation.size(); i++) { - p_TC.push_back(IString::ToDouble(labelConstantRotation[i])); + p_TC.push_back(Isis::toDouble(labelConstantRotation[i])); } } else { @@ -579,18 +579,18 @@ namespace Isis { // Load the full cache time information from the label if available if (table.Label().hasKeyword("CkTableStartTime")) { - p_fullCacheStartTime = IString::ToDouble(table.Label().findKeyword("CkTableStartTime")[0]); + p_fullCacheStartTime = Isis::toDouble(table.Label().findKeyword("CkTableStartTime")[0]); } if (table.Label().hasKeyword("CkTableEndTime")) { - p_fullCacheEndTime = IString::ToDouble(table.Label().findKeyword("CkTableEndTime")[0]); + p_fullCacheEndTime = Isis::toDouble(table.Label().findKeyword("CkTableEndTime")[0]); } if (table.Label().hasKeyword("CkTableOriginalSize")) { - p_fullCacheSize = IString::ToInteger(table.Label().findKeyword("CkTableOriginalSize")[0]); + p_fullCacheSize = Isis::toInt(table.Label().findKeyword("CkTableOriginalSize")[0]); } // Load FrameTypeCode from labels if available and the planetary constants keywords if (table.Label().hasKeyword("FrameTypeCode")) { - m_frameType = (FrameType) IString::ToInteger(table.Label().findKeyword("FrameTypeCode")[0]); + m_frameType = (FrameType) Isis::toInt(table.Label().findKeyword("FrameTypeCode")[0]); } else { m_frameType = UNKNOWN; @@ -1104,21 +1104,21 @@ namespace Isis { if (label.hasKeyword("PoleRa")) { PvlKeyword labelCoeffs = label["PoleRa"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_raPole.push_back(Angle(IString::ToDouble(labelCoeffs[i]), Angle::Degrees)); + m_raPole.push_back(Angle(Isis::toDouble(labelCoeffs[i]), Angle::Degrees)); } numLoaded += 1; } if (label.hasKeyword("PoleDec")) { PvlKeyword labelCoeffs = label["PoleDec"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_decPole.push_back(Angle(IString::ToDouble(labelCoeffs[i]), Angle::Degrees)); + m_decPole.push_back(Angle(Isis::toDouble(labelCoeffs[i]), Angle::Degrees)); } numLoaded += 1; } if (label.hasKeyword("PrimeMeridian")) { PvlKeyword labelCoeffs = label["PrimeMeridian"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_pm.push_back(Angle(IString::ToDouble(labelCoeffs[i]), Angle::Degrees)); + m_pm.push_back(Angle(Isis::toDouble(labelCoeffs[i]), Angle::Degrees)); } numLoaded += 1; } @@ -1127,31 +1127,31 @@ namespace Isis { if (label.hasKeyword("PoleRaNutPrec")) { PvlKeyword labelCoeffs = label["PoleRaNutPrec"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_raNutPrec.push_back(IString::ToDouble(labelCoeffs[i])); + m_raNutPrec.push_back(Isis::toDouble(labelCoeffs[i])); } } if (label.hasKeyword("PoleDecNutPrec")) { PvlKeyword labelCoeffs = label["PoleDecNutPrec"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_decNutPrec.push_back(IString::ToDouble(labelCoeffs[i])); + m_decNutPrec.push_back(Isis::toDouble(labelCoeffs[i])); } } if (label.hasKeyword("PmNutPrec")) { PvlKeyword labelCoeffs = label["PmNutPrec"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_pmNutPrec.push_back(IString::ToDouble(labelCoeffs[i])); + m_pmNutPrec.push_back(Isis::toDouble(labelCoeffs[i])); } } if (label.hasKeyword("SysNutPrec0")) { PvlKeyword labelCoeffs = label["SysNutPrec0"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_sysNutPrec0.push_back(Angle(IString::ToDouble(labelCoeffs[i]), Angle::Degrees)); + m_sysNutPrec0.push_back(Angle(Isis::toDouble(labelCoeffs[i]), Angle::Degrees)); } } if (label.hasKeyword("SysNutPrec1")) { PvlKeyword labelCoeffs = label["SysNutPrec1"]; for (int i = 0; i < labelCoeffs.size(); i++){ - m_sysNutPrec1.push_back(Angle(IString::ToDouble(labelCoeffs[i]), Angle::Degrees)); + m_sysNutPrec1.push_back(Angle(Isis::toDouble(labelCoeffs[i]), Angle::Degrees)); } } @@ -1174,7 +1174,7 @@ namespace Isis { table.Label() += PvlKeyword("TimeDependentFrames"); for (int i = 0; i < (int) p_timeFrames.size(); i++) { - table.Label()["TimeDependentFrames"].addValue(toString(p_timeFrames[i])); + table.Label()["TimeDependentFrames"].addValue(Isis::toString(p_timeFrames[i])); } } @@ -1182,33 +1182,33 @@ namespace Isis { table.Label() += PvlKeyword("ConstantFrames"); for (int i = 0; i < (int) p_constantFrames.size(); i++) { - table.Label()["ConstantFrames"].addValue(toString(p_constantFrames[i])); + table.Label()["ConstantFrames"].addValue(Isis::toString(p_constantFrames[i])); } table.Label() += PvlKeyword("ConstantRotation"); for (int i = 0; i < (int) p_TC.size(); i++) { - table.Label()["ConstantRotation"].addValue(toString(p_TC[i])); + table.Label()["ConstantRotation"].addValue(Isis::toString(p_TC[i])); } } // Write original time coverage if (p_fullCacheStartTime != 0) { table.Label() += PvlKeyword("CkTableStartTime"); - table.Label()["CkTableStartTime"].addValue(toString(p_fullCacheStartTime)); + table.Label()["CkTableStartTime"].addValue(Isis::toString(p_fullCacheStartTime)); } if (p_fullCacheEndTime != 0) { table.Label() += PvlKeyword("CkTableEndTime"); - table.Label()["CkTableEndTime"].addValue(toString(p_fullCacheEndTime)); + table.Label()["CkTableEndTime"].addValue(Isis::toString(p_fullCacheEndTime)); } if (p_fullCacheSize != 0) { table.Label() += PvlKeyword("CkTableOriginalSize"); - table.Label()["CkTableOriginalSize"].addValue(toString(p_fullCacheSize)); + table.Label()["CkTableOriginalSize"].addValue(Isis::toString(p_fullCacheSize)); } // Begin section added 06-20-2015 DAC table.Label() += PvlKeyword("FrameTypeCode"); - table.Label()["FrameTypeCode"].addValue(toString(m_frameType)); + table.Label()["FrameTypeCode"].addValue(Isis::toString(m_frameType)); if (m_frameType == PCK) { // Write out all the body orientation constants @@ -1216,50 +1216,50 @@ namespace Isis { table.Label() += PvlKeyword("PoleRa"); for (int i = 0; i < (int) m_raPole.size(); i++) { - table.Label()["PoleRa"].addValue(toString(m_raPole[i].degrees())); + table.Label()["PoleRa"].addValue(Isis::toString(m_raPole[i].degrees())); } // Pole right ascension, declination coefficients for a quadratic equation table.Label() += PvlKeyword("PoleDec"); for (int i = 0; i < (int) m_decPole.size(); i++) { - table.Label()["PoleDec"].addValue(toString(m_decPole[i].degrees())); + table.Label()["PoleDec"].addValue(Isis::toString(m_decPole[i].degrees())); } // Prime meridian coefficients for a quadratic equation table.Label() += PvlKeyword("PrimeMeridian"); for (int i = 0; i < (int) m_pm.size(); i++) { - table.Label()["PrimeMeridian"].addValue(toString(m_pm[i].degrees())); + table.Label()["PrimeMeridian"].addValue(Isis::toString(m_pm[i].degrees())); } if (m_raNutPrec.size() > 0) { // Pole right ascension nutation precision coefficients to the trig terms table.Label() += PvlKeyword("PoleRaNutPrec"); for (int i = 0; i < (int) m_raNutPrec.size(); i++) { - table.Label()["PoleRaNutPrec"].addValue(toString(m_raNutPrec[i])); + table.Label()["PoleRaNutPrec"].addValue(Isis::toString(m_raNutPrec[i])); } // Pole declination nutation precision coefficients to the trig terms table.Label() += PvlKeyword("PoleDecNutPrec"); for (int i = 0; i < (int) m_decNutPrec.size(); i++) { - table.Label()["PoleDecNutPrec"].addValue(toString(m_decNutPrec[i])); + table.Label()["PoleDecNutPrec"].addValue(Isis::toString(m_decNutPrec[i])); } // Prime meridian nutation precision coefficients to the trig terms table.Label() += PvlKeyword("PmNutPrec"); for (int i = 0; i < (int) m_pmNutPrec.size(); i++) { - table.Label()["PmNutPrec"].addValue(toString(m_pmNutPrec[i])); + table.Label()["PmNutPrec"].addValue(Isis::toString(m_pmNutPrec[i])); } // System nutation precision constant terms of linear model of periods table.Label() += PvlKeyword("SysNutPrec0"); for (int i = 0; i < (int) m_sysNutPrec0.size(); i++) { - table.Label()["SysNutPrec0"].addValue(toString(m_sysNutPrec0[i].degrees())); + table.Label()["SysNutPrec0"].addValue(Isis::toString(m_sysNutPrec0[i].degrees())); } // System nutation precision linear terms of linear model of periods table.Label() += PvlKeyword("SysNutPrec1"); for (int i = 0; i < (int) m_sysNutPrec1.size(); i++) { - table.Label()["SysNutPrec1"].addValue(toString(m_sysNutPrec1[i].degrees())); + table.Label()["SysNutPrec1"].addValue(Isis::toString(m_sysNutPrec1[i].degrees())); } } } diff --git a/isis/src/base/objs/Statistics/Statistics.cpp b/isis/src/base/objs/Statistics/Statistics.cpp index 5eacd0b199..054eaa55ee 100644 --- a/isis/src/base/objs/Statistics/Statistics.cpp +++ b/isis/src/base/objs/Statistics/Statistics.cpp @@ -408,8 +408,8 @@ namespace Isis { if (m_validMaximum < m_validMinimum) { // get the min and max DN values in the chosen range - std::string msg = "Invalid Range: Minimum [" + toString(minimum) - + "] must be less than the Maximum [" + toString(maximum) + "]."; + std::string msg = "Invalid Range: Minimum [" + Isis::toString(minimum) + + "] must be less than the Maximum [" + Isis::toString(maximum) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } //??? throw exception if data has already been added??? @@ -801,7 +801,7 @@ namespace Isis { if (value == Maximum()) return 0; else { std::string msg = "Undefined Z-score. Standard deviation is zero and the input value[" - + toString(value) + "] is out of range [" + toString(Maximum()) + "]."; + + Isis::toString(value) + "] is out of range [" + Isis::toString(Maximum()) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } } @@ -848,26 +848,26 @@ namespace Isis { } // Construct a label with the results PvlGroup results(name.toStdString()); - results += PvlKeyword("Sum", toString(Sum())); - results += PvlKeyword("SumSquare", toString(SumSquare())); - results += PvlKeyword("Minimum", toString(Minimum())); - results += PvlKeyword("Maximum", toString(Maximum())); - results += PvlKeyword("ValidMinimum", toString(ValidMinimum())); - results += PvlKeyword("ValidMaximum", toString(ValidMaximum())); + results += PvlKeyword("Sum", Isis::toString(Sum())); + results += PvlKeyword("SumSquare", Isis::toString(SumSquare())); + results += PvlKeyword("Minimum", Isis::toString(Minimum())); + results += PvlKeyword("Maximum", Isis::toString(Maximum())); + results += PvlKeyword("ValidMinimum", Isis::toString(ValidMinimum())); + results += PvlKeyword("ValidMaximum", Isis::toString(ValidMaximum())); if (ValidPixels() != 0) { - results += PvlKeyword("Average", toString(Average())); - results += PvlKeyword("StandardDeviation", toString(StandardDeviation())); - results += PvlKeyword("Variance", toString(Variance())); + results += PvlKeyword("Average", Isis::toString(Average())); + results += PvlKeyword("StandardDeviation", Isis::toString(StandardDeviation())); + results += PvlKeyword("Variance", Isis::toString(Variance())); } - results += PvlKeyword("TotalPixels", toString(TotalPixels())); - results += PvlKeyword("ValidPixels", toString(ValidPixels())); - results += PvlKeyword("OverValidMaximumPixels", toString(OverRangePixels())); - results += PvlKeyword("UnderValidMinimumPixels", toString(UnderRangePixels())); - results += PvlKeyword("NullPixels", toString(NullPixels())); - results += PvlKeyword("LisPixels", toString(LisPixels())); - results += PvlKeyword("LrsPixels", toString(LrsPixels())); - results += PvlKeyword("HisPixels", toString(HisPixels())); - results += PvlKeyword("HrsPixels", toString(HrsPixels())); + results += PvlKeyword("TotalPixels", Isis::toString(TotalPixels())); + results += PvlKeyword("ValidPixels", Isis::toString(ValidPixels())); + results += PvlKeyword("OverValidMaximumPixels", Isis::toString(OverRangePixels())); + results += PvlKeyword("UnderValidMinimumPixels", Isis::toString(UnderRangePixels())); + results += PvlKeyword("NullPixels", Isis::toString(NullPixels())); + results += PvlKeyword("LisPixels", Isis::toString(LisPixels())); + results += PvlKeyword("LrsPixels", Isis::toString(LrsPixels())); + results += PvlKeyword("HisPixels", Isis::toString(HisPixels())); + results += PvlKeyword("HrsPixels", Isis::toString(HrsPixels())); return results; } @@ -876,7 +876,7 @@ namespace Isis { void Statistics::save(QXmlStreamWriter &stream, const Project *project) const { // TODO: does xml stuff need project??? stream.writeStartElement("statistics"); -// stream.writeTextElement("id", m_id->toString()); +// stream.writeTextElement("id", m_id->Isis::toString()); stream.writeTextElement("sum",QString::fromStdString(toString(m_sum))); stream.writeTextElement("sumSquares",QString::fromStdString(toString(m_sumsum))); diff --git a/isis/src/base/objs/Stretch/Stretch.cpp b/isis/src/base/objs/Stretch/Stretch.cpp index d4f7214564..c8fe7e49de 100644 --- a/isis/src/base/objs/Stretch/Stretch.cpp +++ b/isis/src/base/objs/Stretch/Stretch.cpp @@ -349,7 +349,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } for(int i = 0; i < inputs.size(); i++) { - AddPair(IString::ToDouble(inputs[i]), IString::ToDouble(outputs[i])); + AddPair(Isis::toDouble(inputs[i]), Isis::toDouble(outputs[i])); } } @@ -375,8 +375,8 @@ namespace Isis { PvlKeyword inputs("Input"); PvlKeyword outputs("Output"); for(int i = 0; i < Pairs(); i++) { - inputs.addValue(toString(Input(i))); - outputs.addValue(toString(Output(i))); + inputs.addValue(Isis::toString(Input(i))); + outputs.addValue(Isis::toString(Output(i))); } grp->addKeyword(inputs); grp->addKeyword(outputs); diff --git a/isis/src/base/objs/StripPolygonSeeder/StripPolygonSeeder.cpp b/isis/src/base/objs/StripPolygonSeeder/StripPolygonSeeder.cpp index 8594fe4978..a395bde931 100644 --- a/isis/src/base/objs/StripPolygonSeeder/StripPolygonSeeder.cpp +++ b/isis/src/base/objs/StripPolygonSeeder/StripPolygonSeeder.cpp @@ -162,10 +162,10 @@ namespace Isis { PvlGroup pluginInfo(grpName.toStdString()); PvlKeyword name("Name", Algorithm().toStdString()); - PvlKeyword minThickness("MinimumThickness", toString(MinimumThickness())); - PvlKeyword minArea("MinimumArea", toString(MinimumArea())); - PvlKeyword xSpac("XSpacing", toString(p_Xspacing)); - PvlKeyword ySpac("YSpacing", toString(p_Yspacing)); + PvlKeyword minThickness("MinimumThickness", Isis::toString(MinimumThickness())); + PvlKeyword minArea("MinimumArea", Isis::toString(MinimumArea())); + PvlKeyword xSpac("XSpacing", Isis::toString(p_Xspacing)); + PvlKeyword ySpac("YSpacing", Isis::toString(p_Yspacing)); pluginInfo.addKeyword(name); pluginInfo.addKeyword(minThickness); diff --git a/isis/src/base/objs/StripPolygonSeeder/unitTest.cpp b/isis/src/base/objs/StripPolygonSeeder/unitTest.cpp index 219df5d28f..79c821cf23 100644 --- a/isis/src/base/objs/StripPolygonSeeder/unitTest.cpp +++ b/isis/src/base/objs/StripPolygonSeeder/unitTest.cpp @@ -38,10 +38,10 @@ int main() { if(!alg.hasKeyword("Name")) { cout << "Test without subgrid" << endl; alg += PvlKeyword("Name", "Strip"); - alg += PvlKeyword("MinimumThickness", toString(0.3)); - alg += PvlKeyword("MinimumArea", toString(10)); - alg += PvlKeyword("XSpacing", toString(1500)); - alg += PvlKeyword("YSpacing", toString(1500)); + alg += PvlKeyword("MinimumThickness", Isis::toString(0.3)); + alg += PvlKeyword("MinimumArea", Isis::toString(10)); + alg += PvlKeyword("XSpacing", Isis::toString(1500)); + alg += PvlKeyword("YSpacing", Isis::toString(1500)); } PvlObject o("AutoSeed"); @@ -85,7 +85,7 @@ int main() { mapGroup += Isis::PvlKeyword("PolarRadius", (std::string)radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", Isis::toString(360)); mapGroup += Isis::PvlKeyword("CenterLatitude", "0"); mapGroup += Isis::PvlKeyword("CenterLongitude", "0"); mapGroup += Isis::PvlKeyword("ProjectionName", "Sinusoidal"); @@ -161,9 +161,9 @@ int main() { mapGroup += Isis::PvlKeyword("PolarRadius", (std::string)radii["PolarRadius"]); mapGroup += Isis::PvlKeyword("LatitudeType", "Planetocentric"); mapGroup += Isis::PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += Isis::PvlKeyword("LongitudeDomain", toString(360)); - mapGroup += Isis::PvlKeyword("CenterLatitude", toString(0)); - mapGroup += Isis::PvlKeyword("CenterLongitude", toString(0)); + mapGroup += Isis::PvlKeyword("LongitudeDomain", Isis::toString(360)); + mapGroup += Isis::PvlKeyword("CenterLatitude", Isis::toString(0)); + mapGroup += Isis::PvlKeyword("CenterLongitude", Isis::toString(0)); mapGroup += Isis::PvlKeyword("ProjectionName", "Sinusoidal"); TProjection *proj = (TProjection *) Isis::ProjectionFactory::Create(maplab); diff --git a/isis/src/base/objs/SubArea/SubArea.cpp b/isis/src/base/objs/SubArea/SubArea.cpp index 90011c1842..17c3c1914d 100644 --- a/isis/src/base/objs/SubArea/SubArea.cpp +++ b/isis/src/base/objs/SubArea/SubArea.cpp @@ -151,9 +151,9 @@ namespace Isis { if(p_sl != 1 || p_ss != 1) { proj->SetWorld(p_ss - 0.5, p_sl - 0.5); PvlGroup &mapgroup = inlabel.findObject("IsisCube").findGroup("Mapping", Pvl::Traverse); - mapgroup.addKeyword(PvlKeyword("UpperLeftCornerX", toString(proj->XCoord())), + mapgroup.addKeyword(PvlKeyword("UpperLeftCornerX", Isis::toString(proj->XCoord())), Pvl::Replace); - mapgroup.addKeyword(PvlKeyword("UpperLeftCornerY", toString(proj->YCoord())), + mapgroup.addKeyword(PvlKeyword("UpperLeftCornerY", Isis::toString(proj->YCoord())), Pvl::Replace); } @@ -162,12 +162,12 @@ namespace Isis { if(p_linc == p_sinc && p_linc != 1.0) { PvlGroup &mapgroup = inlabel.findObject("IsisCube").findGroup("Mapping", Pvl::Traverse); QString pixresUnit = QString::fromStdString(mapgroup["PixelResolution"].unit()); - double pixres = IString::ToDouble(mapgroup["PixelResolution"][0]); - mapgroup["PixelResolution"] = toString(pixres * p_linc); + double pixres = Isis::toDouble(mapgroup["PixelResolution"][0]); + mapgroup["PixelResolution"] = Isis::toString(pixres * p_linc); mapgroup["PixelResolution"].setUnits(pixresUnit.toStdString()); QString scaleUnit = QString::fromStdString(mapgroup["Scale"].unit()); double scale = mapgroup["Scale"]; - mapgroup["Scale"] = toString(scale / p_linc); + mapgroup["Scale"] = Isis::toString(scale / p_linc); mapgroup["Scale"].setUnits(scaleUnit.toStdString()); } @@ -218,10 +218,10 @@ namespace Isis { maxlon = proj->ToPositiveWest(proj->Longitude(), 180); } } - mapgroup.addKeyword(PvlKeyword("MinimumLatitude",toString(minlat)),Pvl::Replace); - mapgroup.addKeyword(PvlKeyword("MaximumLatitude",toString(maxlat)),Pvl::Replace); - mapgroup.addKeyword(PvlKeyword("MinimumLongitude",toString(minlon)),Pvl::Replace); - mapgroup.addKeyword(PvlKeyword("MaximumLongitude",toString(maxlon)),Pvl::Replace); + mapgroup.addKeyword(PvlKeyword("MinimumLatitude",Isis::toString(minlat)),Pvl::Replace); + mapgroup.addKeyword(PvlKeyword("MaximumLatitude",Isis::toString(maxlat)),Pvl::Replace); + mapgroup.addKeyword(PvlKeyword("MinimumLongitude",Isis::toString(minlon)),Pvl::Replace); + mapgroup.addKeyword(PvlKeyword("MaximumLongitude",Isis::toString(maxlon)),Pvl::Replace); } } } diff --git a/isis/src/base/objs/SubArea/unitTest.cpp b/isis/src/base/objs/SubArea/unitTest.cpp index 7155642ae4..914dcc11a1 100644 --- a/isis/src/base/objs/SubArea/unitTest.cpp +++ b/isis/src/base/objs/SubArea/unitTest.cpp @@ -47,16 +47,16 @@ void IsisMain() { Cube *onomapcube = p1.SetOutputCube("TO", ons, onl, 1); PvlGroup results("Results"); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); SubArea s; s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); @@ -107,16 +107,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); onomapcube = p2.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&inomapcube, onomapcube, results); @@ -153,16 +153,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); onomapcube = p3.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&inomapcube, onomapcube, results); @@ -203,16 +203,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); onomapcube = p4.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&inomapcube, onomapcube, results); @@ -249,16 +249,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); onomapcube = p5.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&inomapcube, onomapcube, results); @@ -306,16 +306,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); Cube *omapcube = p6.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -363,16 +363,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p7.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -409,16 +409,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p8.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -459,16 +459,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p9.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -505,16 +505,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p10.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&imapcube, omapcube, results); @@ -562,16 +562,16 @@ void IsisMain() { ons = (int)ceil((double)(es - ss + 1) / sinc); omapcube = p11.SetOutputCube("TO", ons, onl, 1); - results += PvlKeyword("InputLines", toString(inl)); - results += PvlKeyword("InputSamples", toString(ins)); - results += PvlKeyword("StartingLine", toString(sl)); - results += PvlKeyword("StartingSample", toString(ss)); - results += PvlKeyword("EndingLine", toString(el)); - results += PvlKeyword("EndingSample", toString(es)); - results += PvlKeyword("LineIncrement", toString(linc)); - results += PvlKeyword("SampleIncrement", toString(sinc)); - results += PvlKeyword("OutputLines", toString(onl)); - results += PvlKeyword("OutputSamples", toString(ons)); + results += PvlKeyword("InputLines", Isis::toString(inl)); + results += PvlKeyword("InputSamples", Isis::toString(ins)); + results += PvlKeyword("StartingLine", Isis::toString(sl)); + results += PvlKeyword("StartingSample", Isis::toString(ss)); + results += PvlKeyword("EndingLine", Isis::toString(el)); + results += PvlKeyword("EndingSample", Isis::toString(es)); + results += PvlKeyword("LineIncrement", Isis::toString(linc)); + results += PvlKeyword("SampleIncrement", Isis::toString(sinc)); + results += PvlKeyword("OutputLines", Isis::toString(onl)); + results += PvlKeyword("OutputSamples", Isis::toString(ons)); s.SetSubArea(inl, ins, sl, ss, el, es, linc, sinc); s.UpdateLabel(&smapcube, omapcube, results); diff --git a/isis/src/base/objs/TProjection/TProjection.cpp b/isis/src/base/objs/TProjection/TProjection.cpp index d29c65852a..ea8b661802 100644 --- a/isis/src/base/objs/TProjection/TProjection.cpp +++ b/isis/src/base/objs/TProjection/TProjection.cpp @@ -175,14 +175,14 @@ namespace Isis { if ((m_minimumLatitude < -90.0) || (m_minimumLatitude > 90.0)) { std::string msg = "Projection failed. " - "[MinimumLatitude] of [" + toString(m_minimumLatitude) + "[MinimumLatitude] of [" + Isis::toString(m_minimumLatitude) + "] is outside the range of [-90:90]"; throw IException(IException::Unknown, msg, _FILEINFO_); } if ((m_maximumLatitude < -90.0) || (m_maximumLatitude > 90.0)) { std::string msg = "Projection failed. " - "[MaximumLatitude] of [" + toString(m_maximumLatitude) + "[MaximumLatitude] of [" + Isis::toString(m_maximumLatitude) + "] is outside the range of [-90:90]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -190,8 +190,8 @@ namespace Isis { if (m_minimumLatitude >= m_maximumLatitude) { std::string msg = "Projection failed. " "[MinimumLatitude,MaximumLatitude] of [" - + toString(m_minimumLatitude) + "," - + toString(m_maximumLatitude) + "] are not " + + Isis::toString(m_minimumLatitude) + "," + + Isis::toString(m_maximumLatitude) + "] are not " + "properly ordered"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -199,8 +199,8 @@ namespace Isis { if (m_minimumLongitude >= m_maximumLongitude) { std::string msg = "Projection failed. " "[MinimumLongitude,MaximumLongitude] of [" - + toString(m_minimumLongitude) + "," - + toString(m_maximumLongitude) + "] are not " + + Isis::toString(m_minimumLongitude) + "," + + Isis::toString(m_maximumLongitude) + "] are not " + "properly ordered"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -218,9 +218,9 @@ namespace Isis { // Initialize miscellaneous protected data elements if (m_equatorialRadius < m_polarRadius) { std::string msg = "Projection failed. Invalid keyword value(s). " - "[EquatorialRadius] = " + toString(m_equatorialRadius) + "[EquatorialRadius] = " + Isis::toString(m_equatorialRadius) + " must be greater than or equal to [PolarRadius] = " - + toString(m_polarRadius); + + Isis::toString(m_polarRadius); throw IException(IException::Unknown, msg, _FILEINFO_); } else { @@ -327,7 +327,7 @@ namespace Isis { if (latitude == Null) { throw IException(IException::Unknown, "Unable to calculate local radius. The given latitude value [" - + toString(latitude) + "] is invalid.", + + Isis::toString(latitude) + "] is invalid.", _FILEINFO_); } double a = m_equatorialRadius; @@ -436,7 +436,7 @@ namespace Isis { if (lat == Null || abs(lat) > 90.0) { throw IException(IException::Unknown, "Unable to convert to Planetocentric. The given latitude value [" - + toString(lat) + "] is invalid.", + + Isis::toString(lat) + "] is invalid.", _FILEINFO_); } double mylat = lat; @@ -486,7 +486,7 @@ namespace Isis { if (lat == Null || fabs(lat) > 90.0) { throw IException(IException::Unknown, "Unable to convert to Planetographic. The given latitude value [" - + toString(lat) + "] is invalid.", + + Isis::toString(lat) + "] is invalid.", _FILEINFO_); } double mylat = lat; @@ -549,7 +549,7 @@ namespace Isis { if (lon == Null) { throw IException(IException::Unknown, "Unable to convert to PositiveEast. The given longitude value [" - + toString(lon) + "] is invalid.", + + Isis::toString(lon) + "] is invalid.", _FILEINFO_); } double mylon = lon; @@ -563,7 +563,7 @@ namespace Isis { mylon = To180Domain(mylon); } else { - std::string msg = "Unable to convert longitude. Domain [" + toString(domain) + std::string msg = "Unable to convert longitude. Domain [" + Isis::toString(domain) + "] is not 180 or 360."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -588,7 +588,7 @@ namespace Isis { if (lon == Null) { throw IException(IException::Unknown, "Unable to convert to PositiveWest. The given longitude value [" - + toString(lon) + "] is invalid.", + + Isis::toString(lon) + "] is invalid.", _FILEINFO_); } double mylon = lon; @@ -602,7 +602,7 @@ namespace Isis { mylon = To180Domain(mylon); } else { - std::string msg = "Unable to convert longitude. Domain [" + toString(domain) + std::string msg = "Unable to convert longitude. Domain [" + Isis::toString(domain) + "] is not 180 or 360."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -658,7 +658,7 @@ namespace Isis { if (lon == Null) { throw IException(IException::Unknown, "Unable to convert to 180 degree domain. The given longitude value [" - + toString(lon) + "] is invalid.", + + Isis::toString(lon) + "] is invalid.", _FILEINFO_); } return Isis::Longitude(lon, Angle::Degrees).force180Domain().degrees(); @@ -676,7 +676,7 @@ namespace Isis { if (lon == Null) { throw IException(IException::Unknown, "Unable to convert to 360 degree domain. The given longitude value [" - + toString(lon) + "] is invalid.", + + Isis::toString(lon) + "] is invalid.", _FILEINFO_); } double result = lon; diff --git a/isis/src/base/objs/Target/Target.cpp b/isis/src/base/objs/Target/Target.cpp index f6a3eca0bf..fb9c637801 100644 --- a/isis/src/base/objs/Target/Target.cpp +++ b/isis/src/base/objs/Target/Target.cpp @@ -62,7 +62,7 @@ namespace Isis { if (name().toUpper() == "SKY") { m_radii[0] = m_radii[1] = m_radii[2] = Distance(1000.0, Distance::Meters); m_sky = true; - int ikCode = IString::ToInteger(kernels[trykey.toStdString()][0]); + int ikCode = Isis::toInt(kernels[trykey.toStdString()][0]); *m_bodyCode = ikCode / 1000; // Check for override in kernel group if (kernels.hasKeyword("NaifSpkCode")) { @@ -133,7 +133,7 @@ namespace Isis { if (name().toUpper() == "SKY" && kernels.hasKeyword(trykey)) { m_radii[0] = m_radii[1] = m_radii[2] = Distance(1000.0, Distance::Meters); m_sky = true; - int ikCode = IString::ToInteger(kernels[trykey][0]); + int ikCode = Isis::toInt(kernels[trykey][0]); *m_bodyCode = ikCode / 1000; // Check for override in kernel group if (kernels.hasKeyword("NaifSpkCode")) { @@ -368,15 +368,15 @@ namespace Isis { catch (IException &e2) { throw IException(e, IException::Unknown, e2.what(), _FILEINFO_); } - std::string radiiKeyword = "BODY" + toString(int(bodyCode)) + "_RADII"; + std::string radiiKeyword = "BODY" + Isis::toString(int(bodyCode)) + "_RADII"; if (naifKeywords.hasKeyword(radiiKeyword)) { PvlKeyword radii = naifKeywords.findKeyword(radiiKeyword); mapping.addKeyword( PvlKeyword("EquatorialRadius", - toString(IString::ToDouble(radii[0]) * 1000.0), "meters"), + Isis::toString(Isis::toDouble(radii[0]) * 1000.0), "meters"), PvlContainer::Replace); mapping.addKeyword( PvlKeyword("PolarRadius", - toString(IString::ToDouble(radii[2]) * 1000.0), "meters"), + Isis::toString(Isis::toDouble(radii[2]) * 1000.0), "meters"), PvlContainer::Replace); return mapping; } @@ -391,11 +391,11 @@ namespace Isis { if (naifKeywords.hasKeyword(radiiKeyword.toStdString())) { PvlKeyword radii = naifKeywords.findKeyword(radiiKeyword.toStdString()); mapping.addKeyword( PvlKeyword("EquatorialRadius", - toString(IString::ToDouble(radii[0]) * 1000.0), + Isis::toString(Isis::toDouble(radii[0]) * 1000.0), "meters"), PvlContainer::Replace); mapping.addKeyword( PvlKeyword("PolarRadius", - toString(IString::ToDouble(radii[2]) * 1000.0), + Isis::toString(Isis::toDouble(radii[2]) * 1000.0), "meters"), PvlContainer::Replace); return mapping; @@ -498,15 +498,15 @@ namespace Isis { NaifStatus::CheckErrors(); } catch (IException &e) { - std::string msg = "Unable to find radii for target code [" + toString(bodyCode) + std::string msg = "Unable to find radii for target code [" + Isis::toString(bodyCode) + "]. Target code was not found in furnished kernels."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } PvlGroup radiiGroup; - radiiGroup += PvlKeyword("EquatorialRadius", toString(radii[0] * 1000.0), "meters"); - radiiGroup += PvlKeyword("PolarRadius", toString(radii[2] * 1000.0), "meters"); + radiiGroup += PvlKeyword("EquatorialRadius", Isis::toString(radii[0] * 1000.0), "meters"); + radiiGroup += PvlKeyword("PolarRadius", Isis::toString(radii[2] * 1000.0), "meters"); return radiiGroup; diff --git a/isis/src/base/objs/Target/unitTest.cpp b/isis/src/base/objs/Target/unitTest.cpp index 54104abdd4..781565e942 100644 --- a/isis/src/base/objs/Target/unitTest.cpp +++ b/isis/src/base/objs/Target/unitTest.cpp @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) { FileName f2("$base/dems"); std::string dir = f.expanded() + "/"; std::string dir2 = f2.expanded() + "/"; - kern1 += PvlKeyword("NaifFrameCode", toString(-94031)); + kern1 += PvlKeyword("NaifFrameCode", Isis::toString(-94031)); kern1 += PvlKeyword("LeapSecond", dir + "naif0007.tls"); kern1 += PvlKeyword("SpacecraftClock", dir + "MGS_SCLKSCET.00045.tsc"); kern1 += PvlKeyword("TargetPosition", dir + "de405.bsp"); @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) { kern1 += PvlKeyword("Frame", ""); PvlGroup kern2("Kernels"); - kern2 += PvlKeyword("NaifIkCode", toString(-94031)); + kern2 += PvlKeyword("NaifIkCode", Isis::toString(-94031)); kern2 += PvlKeyword("LeapSecond", dir + "naif0007.tls"); kern2 += PvlKeyword("SpacecraftClock", dir + "MGS_SCLKSCET.00045.tsc"); kern2 += PvlKeyword("TargetPosition", dir + "de405.bsp"); @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) { kern2 += PvlKeyword("InstrumentPosition", dir + "moc.bsp"); kern2 += PvlKeyword("InstrumentPointing", dir + "moc.bc"); kern2 += PvlKeyword("Frame", ""); - kern2 += PvlKeyword("NaifBodyCode", toString(499)); + kern2 += PvlKeyword("NaifBodyCode", Isis::toString(499)); PvlGroup kern3 = kern2; kern3 += PvlKeyword("ShapeModel", dir2 + "molaMarsPlanetaryRadius0005.cub"); @@ -82,8 +82,8 @@ int main(int argc, char *argv[]) { double endTime = -69382512.0; double slope = (endTime - startTime) / (10 - 1); - kern1 += PvlKeyword("StartPadding", toString(slope)); - kern1 += PvlKeyword("EndPadding", toString(slope)); + kern1 += PvlKeyword("StartPadding", Isis::toString(slope)); + kern1 += PvlKeyword("EndPadding", Isis::toString(slope)); Pvl lab1; lab1.addGroup(inst1); diff --git a/isis/src/base/objs/TiffImporter/TiffImporter.cpp b/isis/src/base/objs/TiffImporter/TiffImporter.cpp index dc57b37e42..16eb40925b 100644 --- a/isis/src/base/objs/TiffImporter/TiffImporter.cpp +++ b/isis/src/base/objs/TiffImporter/TiffImporter.cpp @@ -128,10 +128,10 @@ namespace Isis { // Get the mapping group data for this code: proj name, clat, clon, ... FileName transFile("$ISISROOT/appdata/translations/" + - toString(coordSysType) + ".trn"); + Isis::toString(coordSysType) + ".trn"); if (transFile.fileExists()) { Pvl tmp; - tmp += PvlKeyword("Code", toString(coordSysType)); + tmp += PvlKeyword("Code", Isis::toString(coordSysType)); PvlToPvlTranslationManager geoTiffCodeTranslater(tmp, QString::fromStdString(transFile.expanded())); geoTiffCodeTranslater.Auto(outPvl); } @@ -350,7 +350,7 @@ namespace Isis { double localRadius = proj->LocalRadius(trueScaleLat); double scale = (2.0 * Isis::PI * localRadius) / (360.0 * pixelResolution); - mapGroup += PvlKeyword("Scale", toString(scale), "pixels/degree"); + mapGroup += PvlKeyword("Scale", Isis::toString(scale), "pixels/degree"); } catch (IException &e) { outPvl.findGroup("Mapping").clear(); @@ -392,19 +392,19 @@ namespace Isis { if (gdalElement.tagName() == "Item") { if (gdalElement.attribute("name", "") == "WEST_LONGITUDE") { QString westLon = gdalElement.text(); - map += PvlKeyword("MinimumLongitude", toString(Angle(westLon).degrees())); + map += PvlKeyword("MinimumLongitude", Isis::toString(Angle(westLon).degrees())); } else if (gdalElement.attribute("name", "") == "EAST_LONGITUDE") { QString eastLon = gdalElement.text(); - map += PvlKeyword("MaximumLongitude", toString(Angle(eastLon).degrees())); + map += PvlKeyword("MaximumLongitude", Isis::toString(Angle(eastLon).degrees())); } else if (gdalElement.attribute("name", "") == "SOUTH_LATITUDE") { QString southLat = gdalElement.text(); - map += PvlKeyword("MinimumLatitude", toString(Angle(southLat).degrees())); + map += PvlKeyword("MinimumLatitude", Isis::toString(Angle(southLat).degrees())); } else if (gdalElement.attribute("name", "") == "NORTH_LATITUDE") { QString northLat = gdalElement.text(); - map += PvlKeyword("MaximumLatitude", toString(Angle(northLat).degrees())); + map += PvlKeyword("MaximumLatitude", Isis::toString(Angle(northLat).degrees())); } } } @@ -450,8 +450,8 @@ namespace Isis { map.deleteKeyword("FalseNorthing"); } - map += PvlKeyword("UpperLeftCornerX", toString(x), "meters"); - map += PvlKeyword("UpperLeftCornerY", toString(y), "meters"); + map += PvlKeyword("UpperLeftCornerX", Isis::toString(x), "meters"); + map += PvlKeyword("UpperLeftCornerY", Isis::toString(y), "meters"); } else { std::string msg = "The upper left X and Y can not be calculated. Unsupported tiepoint " @@ -484,7 +484,7 @@ namespace Isis { // The expected scales are TIFF(x, y, z) = ISIS(sample, line, 0) // Make sure the (x, y) are the same but not zero (0) for ISIS if ((scaleCount == 3) && (scales[0] > 0.0 && scales[1] > 0.0) && (scales[0] == scales[1])) { - map += PvlKeyword("PixelResolution", toString(scales[0]), "meters"); + map += PvlKeyword("PixelResolution", Isis::toString(scales[0]), "meters"); } else { std::string msg = "The pixel resolution could not be retrieved from the TIFF file. Unsupported " diff --git a/isis/src/base/objs/TransverseMercator/TransverseMercator.cpp b/isis/src/base/objs/TransverseMercator/TransverseMercator.cpp index 352630c330..a707571d8f 100644 --- a/isis/src/base/objs/TransverseMercator/TransverseMercator.cpp +++ b/isis/src/base/objs/TransverseMercator/TransverseMercator.cpp @@ -46,14 +46,14 @@ namespace Isis { // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLongitude"))) { double lon = (m_minimumLongitude + m_maximumLongitude) / 2.0; - mapGroup += PvlKeyword("CenterLongitude", toString(lon)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(lon)); } // Compute and write the default center latitude if allowed and // necessary if ((allowDefaults) && (!mapGroup.hasKeyword("CenterLatitude"))) { double lat = (m_minimumLatitude + m_maximumLatitude) / 2.0; - mapGroup += PvlKeyword("CenterLatitude", toString(lat)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(lat)); } // Get the center longitude & latitude @@ -101,7 +101,7 @@ namespace Isis { // Get the scale factor if ((allowDefaults) && (!mapGroup.hasKeyword("ScaleFactor"))) { - mapGroup += PvlKeyword("ScaleFactor", toString(1.0)); + mapGroup += PvlKeyword("ScaleFactor", Isis::toString(1.0)); } m_scalefactor = mapGroup["ScaleFactor"]; } diff --git a/isis/src/base/objs/TransverseMercator/unitTest.cpp b/isis/src/base/objs/TransverseMercator/unitTest.cpp index 386fc97033..270640197a 100644 --- a/isis/src/base/objs/TransverseMercator/unitTest.cpp +++ b/isis/src/base/objs/TransverseMercator/unitTest.cpp @@ -25,15 +25,15 @@ int main(int argc, char *argv[]) { Pvl lab; lab.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup = lab.findGroup("Mapping"); - mapGroup += PvlKeyword("EquatorialRadius", toString(1.0)); - mapGroup += PvlKeyword("PolarRadius", toString(1.0)); + mapGroup += PvlKeyword("EquatorialRadius", Isis::toString(1.0)); + mapGroup += PvlKeyword("PolarRadius", Isis::toString(1.0)); mapGroup += PvlKeyword("LatitudeType", "Planetographic"); mapGroup += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup += PvlKeyword("MinimumLatitude", toString(-70.0)); - mapGroup += PvlKeyword("MaximumLatitude", toString(70.0)); - mapGroup += PvlKeyword("MinimumLongitude", toString(-90.0)); - mapGroup += PvlKeyword("MaximumLongitude", toString(-60.0)); + mapGroup += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mapGroup += PvlKeyword("MinimumLatitude", Isis::toString(-70.0)); + mapGroup += PvlKeyword("MaximumLatitude", Isis::toString(70.0)); + mapGroup += PvlKeyword("MinimumLongitude", Isis::toString(-90.0)); + mapGroup += PvlKeyword("MaximumLongitude", Isis::toString(-60.0)); mapGroup += PvlKeyword("ProjectionName", "TransverseMercator"); cout << "Test missing center longitude keyword ..." << endl; @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLongitude", toString(-75.0)); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(-75.0)); cout << "Test missing center latitude keyword..." << endl; try { @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("CenterLatitude", toString(0.0)); + mapGroup += PvlKeyword("CenterLatitude", Isis::toString(0.0)); cout << "Test missing scale factor keyword..." << endl; try { @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) { } cout << endl; - mapGroup += PvlKeyword("ScaleFactor", toString(1.0)); + mapGroup += PvlKeyword("ScaleFactor", Isis::toString(1.0)); try { TProjection *p = (TProjection *) ProjectionFactory::Create(lab); @@ -130,19 +130,19 @@ int main(int argc, char *argv[]) { Pvl lab2; lab2.addGroup(PvlGroup("Mapping")); PvlGroup &mapGroup2 = lab2.findGroup("Mapping"); - mapGroup2 += PvlKeyword("EquatorialRadius", toString(6378206.4)); - mapGroup2 += PvlKeyword("PolarRadius", toString(6356583.8)); + mapGroup2 += PvlKeyword("EquatorialRadius", Isis::toString(6378206.4)); + mapGroup2 += PvlKeyword("PolarRadius", Isis::toString(6356583.8)); mapGroup2 += PvlKeyword("LatitudeType", "Planetographic"); mapGroup2 += PvlKeyword("LongitudeDirection", "PositiveEast"); - mapGroup2 += PvlKeyword("LongitudeDomain", toString(180)); - mapGroup2 += PvlKeyword("MinimumLatitude", toString(-70.0)); - mapGroup2 += PvlKeyword("MaximumLatitude", toString(70.0)); - mapGroup2 += PvlKeyword("MinimumLongitude", toString(-90.0)); - mapGroup2 += PvlKeyword("MaximumLongitude", toString(-60.0)); + mapGroup2 += PvlKeyword("LongitudeDomain", Isis::toString(180)); + mapGroup2 += PvlKeyword("MinimumLatitude", Isis::toString(-70.0)); + mapGroup2 += PvlKeyword("MaximumLatitude", Isis::toString(70.0)); + mapGroup2 += PvlKeyword("MinimumLongitude", Isis::toString(-90.0)); + mapGroup2 += PvlKeyword("MaximumLongitude", Isis::toString(-60.0)); mapGroup2 += PvlKeyword("ProjectionName", "TransverseMercator"); - mapGroup2 += PvlKeyword("CenterLongitude", toString(-75.0)); - mapGroup2 += PvlKeyword("CenterLatitude", toString(0.0)); - mapGroup2 += PvlKeyword("ScaleFactor", toString(0.9996)); + mapGroup2 += PvlKeyword("CenterLongitude", Isis::toString(-75.0)); + mapGroup2 += PvlKeyword("CenterLatitude", Isis::toString(0.0)); + mapGroup2 += PvlKeyword("ScaleFactor", Isis::toString(0.9996)); cout << endl; try { diff --git a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp index 4a94289048..6cfc7f42e5 100644 --- a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp +++ b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/UpturnedEllipsoidTransverseAzimuthal.cpp @@ -62,7 +62,7 @@ namespace Isis { if (!mapGroup.hasKeyword("CenterLongitude")) { if (allowDefaults) { // centerLongitude still 0.0 here - mapGroup += PvlKeyword("CenterLongitude", toString(centerLongitude), "Degrees"); + mapGroup += PvlKeyword("CenterLongitude", Isis::toString(centerLongitude), "Degrees"); } else { std::string message = "Cannot project using upturned ellipsoid Transverse Azimuthal"; @@ -77,16 +77,16 @@ namespace Isis { if (MinimumLongitude() < centerLongitude - 90.0) { std::string message = "MinimumLongitude [" - + toString(MinimumLongitude()) + + Isis::toString(MinimumLongitude()) + "] is invalid. Must be within -90 degrees of the CenterLongitude [" - + toString(centerLongitude) + "]."; + + Isis::toString(centerLongitude) + "]."; throw IException(IException::Unknown, message, _FILEINFO_); } if (MaximumLongitude() > centerLongitude + 90.0) { std::string message = "MaximumLongitude [" - + toString(MaximumLongitude()) + + Isis::toString(MaximumLongitude()) + "] is invalid. Must be within +90 degrees of the CenterLongitude [" - + toString(centerLongitude) + "]."; + + Isis::toString(centerLongitude) + "]."; throw IException(IException::Unknown, message, _FILEINFO_); } @@ -682,7 +682,7 @@ namespace Isis { */ PvlGroup UpturnedEllipsoidTransverseAzimuthal::Mapping() { PvlGroup mapping = TProjection::Mapping(); - mapping += PvlKeyword("CenterLongitude", toString(m_lambda0 * RAD2DEG)); + mapping += PvlKeyword("CenterLongitude", Isis::toString(m_lambda0 * RAD2DEG)); return mapping; } @@ -723,7 +723,7 @@ namespace Isis { */ PvlGroup UpturnedEllipsoidTransverseAzimuthal::MappingLongitudes() { PvlGroup mapping = TProjection::MappingLongitudes(); - mapping += PvlKeyword("CenterLongitude", toString(m_lambda0 * RAD2DEG)); + mapping += PvlKeyword("CenterLongitude", Isis::toString(m_lambda0 * RAD2DEG)); return mapping; } diff --git a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/unitTest.cpp b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/unitTest.cpp index 1ab8159d23..6951fd0173 100644 --- a/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/unitTest.cpp +++ b/isis/src/base/objs/UpturnedEllipsoidTransverseAzimuthal/unitTest.cpp @@ -585,7 +585,7 @@ int main(int argc, char *argv[]) { cout << "\t\t\t TESTING OTHER METHODS" << endl; cout << border << endl << endl; //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - mapGroup.findKeyword("PolarRadius").setValue(toString(p2a->EquatorialRadius())); + mapGroup.findKeyword("PolarRadius").setValue(Isis::toString(p2a->EquatorialRadius())); TProjection *p9 = (TProjection *) ProjectionFactory::Create(lab); TProjection *s = p1; cout << "Name: " << s->Name().toStdString() << endl; diff --git a/isis/src/base/objs/UserInterface/UserInterface.cpp b/isis/src/base/objs/UserInterface/UserInterface.cpp index 4a284d2120..2e745987a2 100644 --- a/isis/src/base/objs/UserInterface/UserInterface.cpp +++ b/isis/src/base/objs/UserInterface/UserInterface.cpp @@ -297,7 +297,7 @@ namespace Isis { hist.addGroup( cmdLine.findGroup("UserParameters") ); // See if we have exceeded history length - while( hist.groups() > IString::ToInteger(grp["HistoryLength"][0]) ) { + while( hist.groups() > Isis::toInt(grp["HistoryLength"][0]) ) { hist.deleteGroup("UserParameters"); } diff --git a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp index 44abfe77a2..6aece85cf2 100644 --- a/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp +++ b/isis/src/base/objs/XmlToPvlTranslationManager/XmlToPvlTranslationManager.cpp @@ -474,7 +474,7 @@ namespace Isis { if ( !m_xmlLabel.setContent(&xmlFile, false, &errmsg, &errline, &errcol) ) { xmlFile.close(); std::string msg = "XML read/parse error in file [" + xmlFileName.expanded() - + "] at line [" + toString(errline) + "], column [" + toString(errcol) + + "] at line [" + Isis::toString(errline) + "], column [" + Isis::toString(errcol) + "], message: " + errmsg.toStdString(); throw IException(IException::Unknown, msg, _FILEINFO_); } diff --git a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp index df3dd551b6..e48963b0d8 100644 --- a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp +++ b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp @@ -94,7 +94,7 @@ namespace Isis{ //Adjust Table-encoded values from 8 bit back to 12 bit. PvlGroup &inst = outputLabel->findGroup("Instrument", Pvl::Traverse); double biasStripMean = inst.findKeyword("BiasStripMean"); - inst.findKeyword("BiasStripMean").setValue(toString(stretch.Map(biasStripMean))); + inst.findKeyword("BiasStripMean").setValue(Isis::toString(stretch.Map(biasStripMean))); inst.findKeyword("BiasStripMean").addComment("BiasStripMean value converted back to 12 bit."); p.Progress()->SetText("Image was converted using 12-to-8 bit table. \nConverting prefix pixels back to 12 bit and saving line prefix data..."); } @@ -103,7 +103,7 @@ namespace Isis{ if (inputLabel.hasKeyword("VALID_MAXIMUM")) { PvlKeyword labelValidMax = inputLabel.findKeyword("VALID_MAXIMUM"); if (labelValidMax[1] != "UNK") { - validMax = IString::ToInteger(labelValidMax[1]); + validMax = Isis::toInt(labelValidMax[1]); } } @@ -120,7 +120,7 @@ namespace Isis{ int roo = *(header + 50 + vicarLabelBytes) / 32 % 2; //**** THIS MAY NEED TO BE CHANGED, // SEE BOTTOM OF THIS FILE FOR IN DEPTH COMMENTS ON READOUTORDER PvlGroup &inst = ocube->label()->findGroup("Instrument", Pvl::Traverse); - inst.addKeyword(PvlKeyword("ReadoutOrder", toString(roo))); + inst.addKeyword(PvlKeyword("ReadoutOrder", Isis::toString(roo))); p.EndProcess(); // PROCESS 2 : Do 8 bit to 12 bit conversion for image ==============================================// @@ -291,17 +291,17 @@ namespace Isis{ //Add units of measurement to keywords from translation table double exposureDuration = inst.findKeyword("ExposureDuration"); - inst.findKeyword("ExposureDuration").setValue(toString(exposureDuration), "Milliseconds"); + inst.findKeyword("ExposureDuration").setValue(Isis::toString(exposureDuration), "Milliseconds"); int gainModeId = inst.findKeyword("GainModeId"); - inst.findKeyword("GainModeId").setValue(toString(gainModeId), "ElectronsPerDN"); + inst.findKeyword("GainModeId").setValue(Isis::toString(gainModeId), "ElectronsPerDN"); PvlKeyword opticsTemp = inst.findKeyword("OpticsTemperature"); inst.findKeyword("OpticsTemperature").setValue(opticsTemp[0]); inst.findKeyword("OpticsTemperature").addValue(opticsTemp[1], "DegreesCelcius"); double instDataRate = inst.findKeyword("InstrumentDataRate"); - inst.findKeyword("InstrumentDataRate").setValue(toString(instDataRate), "KilobitsPerSecond"); + inst.findKeyword("InstrumentDataRate").setValue(Isis::toString(instDataRate), "KilobitsPerSecond"); // initialize global variables dataConversionType = QString::fromStdString(inst.findKeyword("DataConversionType")); @@ -365,8 +365,8 @@ namespace Isis{ bandBin += PvlKeyword("OriginalBand", "1"); if(foundfilter) { - bandBin += PvlKeyword("Center", toString(center)); - bandBin += PvlKeyword("Width", toString(width)); + bandBin += PvlKeyword("Center", Isis::toString(center)); + bandBin += PvlKeyword("Width", Isis::toString(width)); } else { PvlGroup msgGrp("Warnings"); diff --git a/isis/src/cassini/apps/cisscal/DarkCurrent.cpp b/isis/src/cassini/apps/cisscal/DarkCurrent.cpp index f8e718072c..1eafe60fa4 100644 --- a/isis/src/cassini/apps/cisscal/DarkCurrent.cpp +++ b/isis/src/cassini/apps/cisscal/DarkCurrent.cpp @@ -1063,7 +1063,7 @@ namespace Isis { if (FileName(fileList[i].toStdString()).baseName().substr(0, 3) != instrument.toStdString()){ continue; } - double currentEpoch = IString::ToDouble(FileName(fileList[i].toStdString()).baseName().substr(10, 6)); + double currentEpoch = Isis::toDouble(FileName(fileList[i].toStdString()).baseName().substr(10, 6)); if (abs(currentEpoch - imgTime) < abs(closestEpochFileNum - imgTime)) { // find closest epoch closestEpochFileNum = currentEpoch; p_hotpixfile = FileName(fileList[i].toStdString()); diff --git a/isis/src/cassini/apps/cisscal/main.cpp b/isis/src/cassini/apps/cisscal/main.cpp index 609aa441e2..ec882e692d 100644 --- a/isis/src/cassini/apps/cisscal/main.cpp +++ b/isis/src/cassini/apps/cisscal/main.cpp @@ -647,7 +647,7 @@ void gbl::ComputeBias() { gbl::bias.resize(1); gbl::bias[0] = gbl::cissLab->BiasStripMean(); } - gbl::calgrp += PvlKeyword("NumberOfOverclocks", toString(gbl::numberOfOverclocks)); + gbl::calgrp += PvlKeyword("NumberOfOverclocks", Isis::toString(gbl::numberOfOverclocks)); return; } @@ -884,14 +884,14 @@ void gbl::FindDustRingParameters() { long largestEpochFileNum = 0; QStringList fileList = QDir(gbl::GetCalibrationDirectory("dustring")).entryList(); for(int i = 0; i < fileList.count(); i++){ - long currentEpoch = IString::ToInteger(FileName(fileList[i].toStdString()).baseName().substr(13, 10)); + long currentEpoch = Isis::toInt(FileName(fileList[i].toStdString()).baseName().substr(13, 10)); if (currentEpoch > largestEpochFileNum && currentEpoch <= imgNumber) { largestEpochFileNum = currentEpoch; } } // get name of dust file - gbl::dustFile = (gbl::GetCalibrationDirectory("dustring").toStdString() + "nac_dustring_" + toString(largestEpochFileNum) + gbl::dustFile = (gbl::GetCalibrationDirectory("dustring").toStdString() + "nac_dustring_" + Isis::toString(largestEpochFileNum) + "." + gbl::cissLab->InstrumentModeId().toStdString() + ".cub"); if(!gbl::dustFile.fileExists()) { // dustring file not found, assume file uses old dustring files gbl::dustFile = (gbl::GetCalibrationDirectory("dustring").toStdString() + "nac_dustring_venus." @@ -982,7 +982,7 @@ void gbl::FindDustRingParameters() { } else { effwl = col5.toDouble(); - gbl::calgrp += PvlKeyword("EffectiveWavelength", toString(effwl)); + gbl::calgrp += PvlKeyword("EffectiveWavelength", Isis::toString(effwl)); gbl::strengthFactor = 1.30280 - 0.000717552 * effwl; } break; @@ -1067,7 +1067,7 @@ void gbl::FindDustRingParameters() { } } } - gbl::calgrp += PvlKeyword("StrengthFactor", toString(gbl::strengthFactor)); + gbl::calgrp += PvlKeyword("StrengthFactor", Isis::toString(gbl::strengthFactor)); return; } @@ -1259,7 +1259,7 @@ void gbl::DNtoElectrons() { _FILEINFO_); } } - gbl::calgrp += PvlKeyword("TrueGain", toString(gbl::trueGain)); + gbl::calgrp += PvlKeyword("TrueGain", Isis::toString(gbl::trueGain)); return; } @@ -1364,9 +1364,9 @@ void gbl::DivideByAreaPixel() { // it was expressed in IDL as the following: // [gbl::sumFactor = (gbl::incube->sampleCount()/1024.0)*(gbl::incube->lineCount()/1024.0);] gbl::sumFactor = 1 / pow(gbl::cissLab->SummingMode(), 2.0); - gbl::calgrp += PvlKeyword("SolidAngle", toString(gbl::solidAngle)); - gbl::calgrp += PvlKeyword("OpticsArea", toString(gbl::opticsArea)); - gbl::calgrp += PvlKeyword("SumFactor", toString(gbl::sumFactor)); + gbl::calgrp += PvlKeyword("SolidAngle", Isis::toString(gbl::solidAngle)); + gbl::calgrp += PvlKeyword("OpticsArea", Isis::toString(gbl::opticsArea)); + gbl::calgrp += PvlKeyword("SumFactor", Isis::toString(gbl::sumFactor)); return; } @@ -1605,7 +1605,7 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { "Unable to calibrate image using I/F. Solar Distance calculated is less than or equal to 0.", _FILEINFO_); } - gbl::calgrp += PvlKeyword("SolarDistance", toString(distFromSun)); + gbl::calgrp += PvlKeyword("SolarDistance", Isis::toString(distFromSun)); // read spectral file to find wavelength and flux CisscalFile *spectral = new CisscalFile(QString::fromStdString(specfile.original())); @@ -1673,8 +1673,8 @@ void gbl::FindEfficiencyFactor(QString fluxunits) { spline2.AddData(lambda, fluxproduct2); gbl::efficiencyFactor = spline1.BoolesRule(spline1.DomainMinimum(), spline1.DomainMaximum()); double efficiency = spline2.BoolesRule(spline2.DomainMinimum(), spline2.DomainMaximum()); - gbl::calgrp += PvlKeyword("EfficiencyFactor", toString(gbl::efficiencyFactor), units.toStdString()); - gbl::calgrp += PvlKeyword("TotalEfficiency", toString(efficiency)); + gbl::calgrp += PvlKeyword("EfficiencyFactor", Isis::toString(gbl::efficiencyFactor), units.toStdString()); + gbl::calgrp += PvlKeyword("TotalEfficiency", Isis::toString(efficiency)); // Cannot divide by 0.0 if(gbl::efficiencyFactor == 0) { @@ -1787,7 +1787,7 @@ void gbl::FindCorrectionFactors() { gbl::calgrp.findKeyword("CorrectionFactorPerformed").addComment("Correction Factor Parameters"); } - gbl::calgrp += PvlKeyword("CorrectionFactor", toString(gbl::correctionFactor)); + gbl::calgrp += PvlKeyword("CorrectionFactor", Isis::toString(gbl::correctionFactor)); return; } @@ -1840,7 +1840,7 @@ void gbl::FindSensitivityCorrection() { gbl::calgrp += PvlKeyword("SensitivityCorrectionPerformed", "Yes"); gbl::calgrp.findKeyword("SensitivityCorrectionPerformed").addComment("Sensitivity vs Time Correction Parameters"); gbl::sensCorrection = true; - gbl::calgrp += PvlKeyword("SensVsTimeCorr", toString(gbl::sensVsTimeCorr)); + gbl::calgrp += PvlKeyword("SensVsTimeCorr", Isis::toString(gbl::sensVsTimeCorr)); } diff --git a/isis/src/cassini/apps/vims2isis/main.cpp b/isis/src/cassini/apps/vims2isis/main.cpp index 7e15931880..2b8e285b7f 100644 --- a/isis/src/cassini/apps/vims2isis/main.cpp +++ b/isis/src/cassini/apps/vims2isis/main.cpp @@ -82,7 +82,7 @@ void IsisMain() { Pvl pdsLab(in.expanded()); // It's VIMS, let's figure out if it has the suffix data or not - if(IString::ToInteger(lab.findObject("QUBE")["SUFFIX_ITEMS"][0]) == 0) { + if(Isis::toInt(lab.findObject("QUBE")["SUFFIX_ITEMS"][0]) == 0) { // No suffix data, we can use processimportpds ProcessImportPds p; @@ -339,10 +339,10 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF out.SetBasePosition(1, line + 1, band + 1); outCube.write(out); - if(IString::ToInteger(suffixItems[0]) != 0) { + if(Isis::toInt(suffixItems[0]) != 0) { pos = fin.tellg(); - char *sideplaneData = new char[4*IString::ToInteger(suffixItems[0])]; - fin.read(sideplaneData, 4 * IString::ToInteger(suffixItems[0])); + char *sideplaneData = new char[4*Isis::toInt(suffixItems[0])]; + fin.read(sideplaneData, 4 * Isis::toInt(suffixItems[0])); int suffixData = (int)swapper.Int((int *)sideplaneData); record[0] = line + 1; record[1] = band + 1; @@ -382,7 +382,7 @@ void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outF } } // End band loop - int backplaneSize = IString::ToInteger(suffixItems[1]) * (4 * (ns + IString::ToInteger(suffixItems[0]))); + int backplaneSize = Isis::toInt(suffixItems[1]) * (4 * (ns + Isis::toInt(suffixItems[0]))); fin.seekg(backplaneSize, ios_base::cur); // Check the last io @@ -454,7 +454,7 @@ void ProcessBands(Pvl &pdsLab, Cube *vimsCube, VimsType vtype) { PvlGroup bandbin("BandBin"); PvlKeyword originalBand("OriginalBand"); for(int i = vims.mi32OrigBandStart; i <= vims.mi32OrigBinEnd; i++) { - originalBand.addValue(toString(i)); + originalBand.addValue(Isis::toString(i)); } bandbin += originalBand; PvlKeyword center("Center"); @@ -468,7 +468,7 @@ void ProcessBands(Pvl &pdsLab, Cube *vimsCube, VimsType vtype) { //Create the Kernels Group PvlGroup kern("Kernels"); - kern += PvlKeyword("NaifFrameCode", toString(vims.mi32NaifFrameCode)); + kern += PvlKeyword("NaifFrameCode", Isis::toString(vims.mi32NaifFrameCode)); vimsCube->putGroup(kern); } diff --git a/isis/src/cassini/apps/vimscal/main.cpp b/isis/src/cassini/apps/vimscal/main.cpp index cfbfd5aaa4..ba619a0cd8 100644 --- a/isis/src/cassini/apps/vimscal/main.cpp +++ b/isis/src/cassini/apps/vimscal/main.cpp @@ -436,13 +436,13 @@ void loadCalibrationValues() { calVersion = QString::fromStdString(multipliers["version"]); - g_solar = IString::ToDouble(multipliers["solar"][0]); + g_solar = Isis::toDouble(multipliers["solar"][0]); - g_ir = IString::ToDouble(multipliers["IR"][0]); + g_ir = Isis::toDouble(multipliers["IR"][0]); - g_vis = IString::ToDouble(multipliers["VIS"][0]); + g_vis = Isis::toDouble(multipliers["VIS"][0]); - g_wavecal = IString::ToDouble(multipliers["wave-cal"][0]); + g_wavecal = Isis::toDouble(multipliers["wave-cal"][0]); @@ -571,7 +571,7 @@ void calculateSpecificEnergy(Cube *icube) { } if(g_visBool) { - coefficient /= IString::ToDouble(inst["ExposureDuration"][1]) / 1000.0; + coefficient /= Isis::toDouble(inst["ExposureDuration"][1]) / 1000.0; } else { @@ -608,7 +608,7 @@ void calculateSpecificEnergy(Cube *icube) { */ //USGS - coefficient /= (IString::ToDouble(inst["ExposureDuration"][0]) * 1.01725) / 1000.0 - 0.004; + coefficient /= (Isis::toDouble(inst["ExposureDuration"][0]) * 1.01725) / 1000.0 - 0.004; //University of Arizona @@ -773,7 +773,7 @@ void calculateVisDarkCurrent(Cube *icube) { FILE *calFilePtr = fopen(calFile.toLatin1().data(), "r"); - double visExposure = IString::ToDouble(inst["ExposureDuration"][1]); + double visExposure = Isis::toDouble(inst["ExposureDuration"][1]); int sampleOffset, lineOffset; GetOffsets(*icube->label(), sampleOffset, lineOffset); diff --git a/isis/src/cassini/objs/CissLabels/CissLabels.cpp b/isis/src/cassini/objs/CissLabels/CissLabels.cpp index 147789a923..48220e60d9 100644 --- a/isis/src/cassini/objs/CissLabels/CissLabels.cpp +++ b/isis/src/cassini/objs/CissLabels/CissLabels.cpp @@ -83,7 +83,7 @@ namespace Isis { p_shutterModeId = QString::fromStdString( inst["ShutterModeId"]); //valid values: BothSim, NacOnly, WacOnly p_shutterStateId = QString::fromStdString( inst["ShutterStateId"]); //valid values: Enabled or Disabled p_summingMode = (int) inst["SummingMode"]; //valid values: 1, 2, 4 - p_frontOpticsTemp = IString::ToDouble(inst["OpticsTemperature"][0]); //valid values: real numbers + p_frontOpticsTemp = Isis::toDouble(inst["OpticsTemperature"][0]); //valid values: real numbers p_imageTime = QString::fromStdString( inst["ImageTime"]); p_targetName = QString::fromStdString( inst["TargetName"]); //valid values: may change overtime, any subject of a Cassini image // Get values out of the archive group diff --git a/isis/src/cassini/objs/VimsCamera/VimsGroundMap.cpp b/isis/src/cassini/objs/VimsCamera/VimsGroundMap.cpp index bcce00094c..0a1e2f5cb6 100644 --- a/isis/src/cassini/objs/VimsCamera/VimsGroundMap.cpp +++ b/isis/src/cassini/objs/VimsCamera/VimsGroundMap.cpp @@ -130,9 +130,9 @@ namespace Isis { // Because of inaccuracy with the 15 Mhz clock, the IR exposure and // interline delay need to be adjusted. //---------------------------------------------------------------------- - p_irExp = (IString::ToDouble(inst ["ExposureDuration"][0]) * 1.01725) / 1000.; - p_visExp = (IString::ToDouble(inst ["ExposureDuration"][1])) / 1000.; - p_interlineDelay = (IString::ToDouble(inst ["InterlineDelayDuration"]) * 1.01725) / 1000.; + p_irExp = (Isis::toDouble(inst ["ExposureDuration"][0]) * 1.01725) / 1000.; + p_visExp = (Isis::toDouble(inst ["ExposureDuration"][1])) / 1000.; + p_interlineDelay = (Isis::toDouble(inst ["InterlineDelayDuration"]) * 1.01725) / 1000.; // Get summation mode QString sampMode = QString::fromStdString(inst ["SamplingMode"]).toUpper(); diff --git a/isis/src/cassini/objs/VimsCamera/VimsSkyMap.cpp b/isis/src/cassini/objs/VimsCamera/VimsSkyMap.cpp index a4d8179abd..4e1119a145 100644 --- a/isis/src/cassini/objs/VimsCamera/VimsSkyMap.cpp +++ b/isis/src/cassini/objs/VimsCamera/VimsSkyMap.cpp @@ -72,9 +72,9 @@ namespace Isis { // Because of inaccuracy with the 15 Mhz clock, the IR exposure and // interline delay need to be adjusted. //---------------------------------------------------------------------- - p_irExp = (IString::ToDouble(inst ["ExposureDuration"][0]) * 1.01725) / 1000.; - p_visExp = IString::ToDouble(inst ["ExposureDuration"][1]) / 1000.; - p_interlineDelay = (IString::ToDouble(inst ["InterlineDelayDuration"]) * 1.01725) / 1000.; + p_irExp = (Isis::toDouble(inst ["ExposureDuration"][0]) * 1.01725) / 1000.; + p_visExp = Isis::toDouble(inst ["ExposureDuration"][1]) / 1000.; + p_interlineDelay = (Isis::toDouble(inst ["InterlineDelayDuration"]) * 1.01725) / 1000.; // Get summation mode QString sampMode = QString::fromStdString(inst ["SamplingMode"]).toUpper(); diff --git a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp index 866b1d8a55..5007a36f57 100644 --- a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp +++ b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp @@ -207,11 +207,11 @@ namespace Isis { } else { importPds.StartProcess(writeCubeWithDroppedLines); - g_results += PvlKeyword("LinesFlipped", toString(linesNeedFlipped)); - g_results += PvlKeyword("SamplesFlipped", toString(samplesNeedFlipped)); - g_results += PvlKeyword("LinesAdded", toString(g_totalLinesAdded)); - g_results += PvlKeyword("OutputLines", toString(outputLines)); - g_results += PvlKeyword("CalculatedOutputLines", toString(calcOutputLines)); + g_results += PvlKeyword("LinesFlipped", Isis::toString(linesNeedFlipped)); + g_results += PvlKeyword("SamplesFlipped", Isis::toString(samplesNeedFlipped)); + g_results += PvlKeyword("LinesAdded", Isis::toString(g_totalLinesAdded)); + g_results += PvlKeyword("OutputLines", Isis::toString(outputLines)); + g_results += PvlKeyword("CalculatedOutputLines", Isis::toString(calcOutputLines)); } delete g_oBuff; @@ -423,7 +423,7 @@ namespace Isis { } PvlKeyword originalBand("OriginalBand"); for (int i = 1; i <= numBands; i++) { - originalBand.addValue(toString(i)); + originalBand.addValue(Isis::toString(i)); } bandGroup += originalBand; ocube->putGroup(bandGroup); @@ -433,8 +433,8 @@ namespace Isis { PvlGroup calib("RadiometricCalibration"); PvlKeyword solar = pdsLabel["SOLAR_DISTANCE"]; calib += PvlKeyword("Units", "W/m2/um/sr"); - calib += PvlKeyword("SolarDistance", toString((double)solar), solar.unit()); - calib += PvlKeyword("DetectorTemperature", toString((double)pdsLabel["DETECTOR_TEMPERATURE"])); + calib += PvlKeyword("SolarDistance", Isis::toString((double)solar), solar.unit()); + calib += PvlKeyword("DetectorTemperature", Isis::toString((double)pdsLabel["DETECTOR_TEMPERATURE"])); calib += PvlKeyword("SpectralCalibrationFileName", pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); calib += PvlKeyword("RadGainFactorFileName", diff --git a/isis/src/clementine/apps/clem2isis/main.cpp b/isis/src/clementine/apps/clem2isis/main.cpp index 526b07910c..b24facab8b 100755 --- a/isis/src/clementine/apps/clem2isis/main.cpp +++ b/isis/src/clementine/apps/clem2isis/main.cpp @@ -143,11 +143,11 @@ void translateLabels(FileName in, Cube *ocube) { //Band Bin group double center = pdsLab["CenterFilterWavelength"]; center /= 1000.0; - bBin.findKeyword("Center").setValue(toString(center), "micrometers"); + bBin.findKeyword("Center").setValue(Isis::toString(center), "micrometers"); } double width = pdsLab["Bandwidth"]; width /= 1000.0; - bBin.findKeyword("Width").setValue(toString(width), "micrometers"); + bBin.findKeyword("Width").setValue(Isis::toString(width), "micrometers"); ocube->putGroup(bBin); //Kernel group diff --git a/isis/src/clementine/apps/clemnircal/main.cpp b/isis/src/clementine/apps/clemnircal/main.cpp index 48f57372d9..2303cca88e 100644 --- a/isis/src/clementine/apps/clemnircal/main.cpp +++ b/isis/src/clementine/apps/clemnircal/main.cpp @@ -129,7 +129,7 @@ void IsisMain() { if(!gainFactorData.hasGroup(group.toStdString())) { std::string err = "The Gain Factor for Gain Mode ID ["; - err += toString(gainModeID); + err += Isis::toString(gainModeID); err += "] could not be found in clemnircal.def"; throw IException(IException::Programmer, err, _FILEINFO_); } @@ -138,7 +138,7 @@ void IsisMain() { if(abs(gainFactor) < DBL_EPSILON) { std::string err = "The Gain Factor for Gain Mode ID ["; - err += toString(gainModeID); + err += Isis::toString(gainModeID); err += "] can not be zero."; throw IException(IException::Programmer, err, _FILEINFO_); } @@ -250,15 +250,15 @@ void IsisMain() { calgrp += PvlKeyword("ThermalCorrectionTable", thermTbl.toStdString()); calgrp += PvlKeyword("AdditiveFileTable", afFileTableLoc.toStdString()); - calgrp += PvlKeyword("DigitalOffset", toString(digitalOffset)); - calgrp += PvlKeyword("GlobalBias", toString(globalBias)); - calgrp += PvlKeyword("GlobalDarkCoefficient", toString(globalDarkCoefficient)); - calgrp += PvlKeyword("V", toString(vConstant)); + calgrp += PvlKeyword("DigitalOffset", Isis::toString(digitalOffset)); + calgrp += PvlKeyword("GlobalBias", Isis::toString(globalBias)); + calgrp += PvlKeyword("GlobalDarkCoefficient", Isis::toString(globalDarkCoefficient)); + calgrp += PvlKeyword("V", Isis::toString(vConstant)); //Calculated in processing routine - calgrp += PvlKeyword("GainFactor", toString(gainFactor)); - calgrp += PvlKeyword("AbsoluteCoefficient", toString(absoluteCoefficient)); - calgrp += PvlKeyword("CryoNorm", toString(cryonorm)); - calgrp += PvlKeyword("OptimalExposureDuration", toString(optimalExposureDuration)); + calgrp += PvlKeyword("GainFactor", Isis::toString(gainFactor)); + calgrp += PvlKeyword("AbsoluteCoefficient", Isis::toString(absoluteCoefficient)); + calgrp += PvlKeyword("CryoNorm", Isis::toString(cryonorm)); + calgrp += PvlKeyword("OptimalExposureDuration", Isis::toString(optimalExposureDuration)); ocube->putGroup(calgrp); p.EndProcess(); diff --git a/isis/src/clementine/apps/clemuvviscal/main.cpp b/isis/src/clementine/apps/clemuvviscal/main.cpp index 13551393c0..a2591600cf 100644 --- a/isis/src/clementine/apps/clemuvviscal/main.cpp +++ b/isis/src/clementine/apps/clemuvviscal/main.cpp @@ -175,25 +175,25 @@ void IsisMain() { calgrp += PvlKeyword("DarkCurrentFile", dccube->fileName().toStdString()); } else { - calgrp += PvlKeyword("DarkCurrentConstant", toString(dcconst)); + calgrp += PvlKeyword("DarkCurrentConstant", Isis::toString(dcconst)); } - calgrp += PvlKeyword("CorrectedFocalPlaneTemp", toString(focalPlaneTemp)); - calgrp += PvlKeyword("C1", toString(avgFF)); - calgrp += PvlKeyword("C2", toString(C2)); - calgrp += PvlKeyword("C3", toString(C3)); - calgrp += PvlKeyword("C4", toString(C4)); - calgrp += PvlKeyword("C5", toString(C5)); - calgrp += PvlKeyword("CR", toString(cr)); - calgrp += PvlKeyword("FrameTransferTimePerRow", toString(cr)); - calgrp += PvlKeyword("Gain", toString(gain)); - calgrp += PvlKeyword("CorrectedExposureDuration", toString(correctedExposureDuration)); - calgrp += PvlKeyword("ConvertToRadiance", toString(conv)); - - calgrp += PvlKeyword("ACO", toString(ACO)); - calgrp += PvlKeyword("BCO", toString(BCO)); - calgrp += PvlKeyword("CCO", toString(CCO)); - calgrp += PvlKeyword("DCO", toString(DCO)); + calgrp += PvlKeyword("CorrectedFocalPlaneTemp", Isis::toString(focalPlaneTemp)); + calgrp += PvlKeyword("C1", Isis::toString(avgFF)); + calgrp += PvlKeyword("C2", Isis::toString(C2)); + calgrp += PvlKeyword("C3", Isis::toString(C3)); + calgrp += PvlKeyword("C4", Isis::toString(C4)); + calgrp += PvlKeyword("C5", Isis::toString(C5)); + calgrp += PvlKeyword("CR", Isis::toString(cr)); + calgrp += PvlKeyword("FrameTransferTimePerRow", Isis::toString(cr)); + calgrp += PvlKeyword("Gain", Isis::toString(gain)); + calgrp += PvlKeyword("CorrectedExposureDuration", Isis::toString(correctedExposureDuration)); + calgrp += PvlKeyword("ConvertToRadiance", Isis::toString(conv)); + + calgrp += PvlKeyword("ACO", Isis::toString(ACO)); + calgrp += PvlKeyword("BCO", Isis::toString(BCO)); + calgrp += PvlKeyword("CCO", Isis::toString(CCO)); + calgrp += PvlKeyword("DCO", Isis::toString(DCO)); ocube->putGroup(calgrp); p.EndProcess(); diff --git a/isis/src/clipper/apps/eis2isis/eis2isis.cpp b/isis/src/clipper/apps/eis2isis/eis2isis.cpp index 324c724747..143c099afc 100644 --- a/isis/src/clipper/apps/eis2isis/eis2isis.cpp +++ b/isis/src/clipper/apps/eis2isis/eis2isis.cpp @@ -97,10 +97,10 @@ namespace Isis { if (instrumentNameString == "EIS-NAC-RS") { // This ID will need to be updated. It is temporarily used for testing but is NOT the actual // NAC ID. - kerns += PvlKeyword("NaifFrameCode", toString(-159101)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-159101)); } else if (instrumentNameString == "EIS-WAC-FC") { - kerns += PvlKeyword("NaifFrameCode", toString(-159102)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-159102)); } else { std::string msg = "Input file [" + xmlFileName.expanded() + "] has an invalid " + @@ -229,14 +229,14 @@ namespace Isis { // Set a default value for the JitterSampleCoefficients and the JitterLineCoefficient keywords in the Instrument group. // These values are overwritten with a call to the jitterfit application. - PvlKeyword jitterLineCoefficients = PvlKeyword("JitterLineCoefficients", (toString(0.0))); - jitterLineCoefficients += toString(0.0); - jitterLineCoefficients += toString(0.0); + PvlKeyword jitterLineCoefficients = PvlKeyword("JitterLineCoefficients", (Isis::toString(0.0))); + jitterLineCoefficients += Isis::toString(0.0); + jitterLineCoefficients += Isis::toString(0.0); outputLabel->findGroup("Instrument", PvlObject::Traverse).addKeyword(jitterLineCoefficients); - PvlKeyword jitterSampleCoefficients = PvlKeyword("JitterSampleCoefficients", (toString(0.0))); - jitterSampleCoefficients += toString(0.0); - jitterSampleCoefficients += toString(0.0); + PvlKeyword jitterSampleCoefficients = PvlKeyword("JitterSampleCoefficients", (Isis::toString(0.0))); + jitterSampleCoefficients += Isis::toString(0.0); + jitterSampleCoefficients += Isis::toString(0.0); outputLabel->findGroup("Instrument", PvlObject::Traverse).addKeyword(jitterSampleCoefficients); diff --git a/isis/src/clipper/apps/jitterfit/jitterfit.cpp b/isis/src/clipper/apps/jitterfit/jitterfit.cpp index d8e9b49502..a4abd24342 100644 --- a/isis/src/clipper/apps/jitterfit/jitterfit.cpp +++ b/isis/src/clipper/apps/jitterfit/jitterfit.cpp @@ -182,12 +182,12 @@ namespace Isis{ outputCoefficientFile << std::setprecision(14) << lineFunction->Coefficient(i) << "," << std::setprecision(14) << sampleFunction->Coefficient(i) << endl; if (i == 0) { - jitterLineCoefficients.setValue(toString(lineFunction->Coefficient(i))); - jitterSampleCoefficients.setValue(toString(sampleFunction->Coefficient(i))); + jitterLineCoefficients.setValue(Isis::toString(lineFunction->Coefficient(i))); + jitterSampleCoefficients.setValue(Isis::toString(sampleFunction->Coefficient(i))); } else { - jitterLineCoefficients += toString(lineFunction->Coefficient(i)); - jitterSampleCoefficients += toString(sampleFunction->Coefficient(i)); + jitterLineCoefficients += Isis::toString(lineFunction->Coefficient(i)); + jitterSampleCoefficients += Isis::toString(sampleFunction->Coefficient(i)); } } diff --git a/isis/src/clipper/objs/ClipperNacRollingShutterCamera/ClipperNacRollingShutterCamera.cpp b/isis/src/clipper/objs/ClipperNacRollingShutterCamera/ClipperNacRollingShutterCamera.cpp index df3248062c..c4725e09d6 100644 --- a/isis/src/clipper/objs/ClipperNacRollingShutterCamera/ClipperNacRollingShutterCamera.cpp +++ b/isis/src/clipper/objs/ClipperNacRollingShutterCamera/ClipperNacRollingShutterCamera.cpp @@ -67,12 +67,12 @@ namespace Isis { && cube.hasTable("Normalized Main Readout Line Times")) { PvlKeyword sampleCoefficients = inst.findKeyword("JitterSampleCoefficients"); for (int i = 0; i < sampleCoefficients.size(); i++) { - sampleCoeffs.push_back(IString::ToDouble(sampleCoefficients[i])); + sampleCoeffs.push_back(Isis::toDouble(sampleCoefficients[i])); } PvlKeyword lineCoefficients = inst.findKeyword("JitterLineCoefficients"); for (int i = 0; i < lineCoefficients.size(); i++) { - lineCoeffs.push_back(IString::ToDouble(lineCoefficients[i])); + lineCoeffs.push_back(Isis::toDouble(lineCoefficients[i])); } Table normalizedReadoutTimes("Normalized Main Readout Line Times", lab.fileName(), lab); diff --git a/isis/src/control/apps/autoseed/autoseed.cpp b/isis/src/control/apps/autoseed/autoseed.cpp index 40a7ba0a36..e236a251ca 100644 --- a/isis/src/control/apps/autoseed/autoseed.cpp +++ b/isis/src/control/apps/autoseed/autoseed.cpp @@ -474,8 +474,8 @@ namespace Isis { // create SeedDef group and add to print.prt PvlGroup pluginInfo = seeder->PluginParameters("SeedDefinition"); - pluginInfo.addKeyword(PvlKeyword("MaxIncidence", toString(maxIncidence))); - pluginInfo.addKeyword(PvlKeyword("MaxEmission", toString(maxEmission))); + pluginInfo.addKeyword(PvlKeyword("MaxIncidence", Isis::toString(maxIncidence))); + pluginInfo.addKeyword(PvlKeyword("MaxEmission", Isis::toString(maxEmission))); Application::Log(pluginInfo); // inform user of any unused (invalid) keywords found in the def file @@ -493,10 +493,10 @@ namespace Isis { } // create Results group and add to print.prt - PvlKeyword cpCountKeyword("ControlPointCount", toString(cpCount)); - PvlKeyword msCountKeyword("ControlMeasureCount", toString(msCount)); - PvlKeyword cpIgnoredCountKeyword("ControlPointsIgnored", toString(cpIgnoredCount)); - PvlKeyword cmIgnoredCountKeyword("ControlMeasuresIgnored", toString(cmIgnoredCount)); + PvlKeyword cpCountKeyword("ControlPointCount", Isis::toString(cpCount)); + PvlKeyword msCountKeyword("ControlMeasureCount", Isis::toString(msCount)); + PvlKeyword cpIgnoredCountKeyword("ControlPointsIgnored", Isis::toString(cpIgnoredCount)); + PvlKeyword cmIgnoredCountKeyword("ControlMeasuresIgnored", Isis::toString(cmIgnoredCount)); PvlGroup resultsGrp("Results"); resultsGrp.addKeyword(cpCountKeyword); diff --git a/isis/src/control/apps/cnet2dem/main.cpp b/isis/src/control/apps/cnet2dem/main.cpp index b6c3e2426a..5f49245639 100644 --- a/isis/src/control/apps/cnet2dem/main.cpp +++ b/isis/src/control/apps/cnet2dem/main.cpp @@ -381,7 +381,7 @@ void IsisMain() { PvlKeyword cnumber("Number"); for (int i = 0 ; i < functors.size() ; i++) { fname.addValue(functors[i]->name().toStdString()); - cnumber.addValue(toString(i+1)); + cnumber.addValue(Isis::toString(i+1)); } // Create the BandBin group diff --git a/isis/src/control/apps/cnetcheck/cnetcheck.cpp b/isis/src/control/apps/cnetcheck/cnetcheck.cpp index e5f73efd4e..52e71ca243 100644 --- a/isis/src/control/apps/cnetcheck/cnetcheck.cpp +++ b/isis/src/control/apps/cnetcheck/cnetcheck.cpp @@ -232,7 +232,7 @@ namespace Isis { // Islands that have no cubes listed in the input list will // not be shown. for (int i = 0; i < (int)islands.size(); i++) { - QString name(QString::fromStdString(FileName(prefix.toStdString() + "Island." + toString(i + 1)).expanded())); + QString name(QString::fromStdString(FileName(prefix.toStdString() + "Island." + Isis::toString(i + 1)).expanded())); ofstream out_stream; out_stream.open(name.toLatin1().data(), std::ios::out); out_stream.seekp(0, std::ios::beg); //Start writing from beginning of file @@ -262,7 +262,7 @@ namespace Isis { stringstream ss(stringstream::in | stringstream::out); - results.addKeyword(PvlKeyword("Islands", toString((BigInt)islands.size()))); + results.addKeyword(PvlKeyword("Islands", Isis::toString((BigInt)islands.size()))); ss << endl << "----------------------------------------" \ "----------------------------------------" << endl; if (islands.size() == 1) { @@ -279,7 +279,7 @@ namespace Isis { if (ui.GetBoolean("SINGLEMEASURE") && singleMeasureSerialNumbers.size() > 0) { results.addKeyword( - PvlKeyword("SingleMeasure", toString((BigInt)singleMeasureSerialNumbers.size()))); + PvlKeyword("SingleMeasure", Isis::toString((BigInt)singleMeasureSerialNumbers.size()))); std::string name(FileName(prefix.toStdString() + "SinglePointCubes.txt").expanded()); writeOutput(num2cube, QString::fromStdString(name), @@ -297,7 +297,7 @@ namespace Isis { if (ui.GetBoolean("NOLATLON") && noLatLonSerialNumbers.size() > 0) { results.addKeyword( - PvlKeyword("NoLatLonCubes", toString((BigInt)noLatLonSerialNumbers.size()))); + PvlKeyword("NoLatLonCubes", Isis::toString((BigInt)noLatLonSerialNumbers.size()))); std::string name(FileName(prefix.toStdString() + "NoLatLon.txt").expanded()); writeOutput(num2cube, QString::fromStdString(name), @@ -352,14 +352,14 @@ namespace Isis { "coverages, are listed in [" << FileName(name).name() << "]" << endl; results.addKeyword( - PvlKeyword(coverageOp.toStdString(), toString((BigInt) failedCoverageCheck))); + PvlKeyword(coverageOp.toStdString(), Isis::toString((BigInt) failedCoverageCheck))); } } // At this point, inListNums is the list of cubes NOT included in the // ControlNet, and inListNums are their those cube's serial numbers. if (ui.GetBoolean("NOCONTROL") && !inListNums.empty()) { - results.addKeyword(PvlKeyword("NoControl", toString((BigInt)inListNums.size()))); + results.addKeyword(PvlKeyword("NoControl", Isis::toString((BigInt)inListNums.size()))); QString name(QString::fromStdString(FileName(prefix.toStdString() + "NoControl.txt").expanded())); ofstream out_stream; @@ -387,7 +387,7 @@ namespace Isis { // cube in the input list. if (ui.GetBoolean("NOCUBE") && nonListedSerialNumbers.size() > 0) { results.addKeyword( - PvlKeyword("NoCube", toString((BigInt)nonListedSerialNumbers.size()))); + PvlKeyword("NoCube", Isis::toString((BigInt)nonListedSerialNumbers.size()))); QString name(QString::fromStdString(FileName(prefix.toStdString() + "NoCube.txt").expanded())); ofstream out_stream; @@ -428,7 +428,7 @@ namespace Isis { if (singleMeasureCubes.size() > 0) { results.addKeyword( - PvlKeyword("SingleCube", toString((BigInt)singleMeasureCubes.size()))); + PvlKeyword("SingleCube", Isis::toString((BigInt)singleMeasureCubes.size()))); std::string name(FileName(prefix.toStdString() + "SingleCube.txt").expanded()); ofstream out_stream; diff --git a/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp b/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp index f33dd9a3e5..7cd51b470c 100644 --- a/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp +++ b/isis/src/control/apps/cnetcombinept/cnetcombinept.cpp @@ -489,15 +489,15 @@ namespace Isis{ // Write out a report int pMerged = validPoints - vPoints; PvlGroup summary("Summary"); - summary += PvlKeyword("TotalCubes", toString(cube_measures_size)); - summary += PvlKeyword("TotalInputPoints", toString(all_points.size())); - summary += PvlKeyword("TotalOutputPoints", toString(oPoints)); - summary += PvlKeyword("PointsMerged", toString(pMerged)); - summary += PvlKeyword("PointsEvaluated", toString(nfound)); - summary += PvlKeyword("TotalMeasures", toString(allPoints)); - summary += PvlKeyword("MeasuresMerged", toString(nMerged)); - summary += PvlKeyword("MeasuresDeleted", toString(nRemoved)); - summary += PvlKeyword("MinimumMeasures", toString(nMinMeasures)); + summary += PvlKeyword("TotalCubes", Isis::toString(cube_measures_size)); + summary += PvlKeyword("TotalInputPoints", Isis::toString(all_points.size())); + summary += PvlKeyword("TotalOutputPoints", Isis::toString(oPoints)); + summary += PvlKeyword("PointsMerged", Isis::toString(pMerged)); + summary += PvlKeyword("PointsEvaluated", Isis::toString(nfound)); + summary += PvlKeyword("TotalMeasures", Isis::toString(allPoints)); + summary += PvlKeyword("MeasuresMerged", Isis::toString(nMerged)); + summary += PvlKeyword("MeasuresDeleted", Isis::toString(nRemoved)); + summary += PvlKeyword("MinimumMeasures", Isis::toString(nMinMeasures)); Application::Log(summary); pbl.EndProcess(); diff --git a/isis/src/control/apps/cnetdiff/cnetdiff.cpp b/isis/src/control/apps/cnetdiff/cnetdiff.cpp index c9cf138705..c7a500b310 100644 --- a/isis/src/control/apps/cnetdiff/cnetdiff.cpp +++ b/isis/src/control/apps/cnetdiff/cnetdiff.cpp @@ -348,7 +348,7 @@ namespace Isis { double difference = abs(val1.toDouble() - val2.toDouble()); if (tolerances.hasKeyword(pvl1.name())) { - tolerance = IString::ToDouble((tolerances[pvl1.name()].size() == 1) ? + tolerance = Isis::toDouble((tolerances[pvl1.name()].size() == 1) ? tolerances[pvl1.name()][0] : tolerances[pvl1.name()][i]); } diff --git a/isis/src/control/apps/cnetedit/cnetedit.cpp b/isis/src/control/apps/cnetedit/cnetedit.cpp index 4027255232..3ff6adcfb5 100644 --- a/isis/src/control/apps/cnetedit/cnetedit.cpp +++ b/isis/src/control/apps/cnetedit/cnetedit.cpp @@ -141,7 +141,7 @@ namespace Isis { QString line = in.readLine(); QStringList results = line.split(","); if (results.size() < 2) { - std::string msg = "Line " + toString(lineNumber) + " in the MEASURELIST does " + std::string msg = "Line " + Isis::toString(lineNumber) + " in the MEASURELIST does " "not contain a Point ID and a cube filename separated by a comma"; throw IException(IException::User, msg, _FILEINFO_); } @@ -370,8 +370,8 @@ namespace Isis { if (keepLog) { Pvl outputLog; - outputLog.addKeyword(PvlKeyword("PointsDeleted", toString(numPointsDeleted))); - outputLog.addKeyword(PvlKeyword("MeasuresDeleted", toString(numMeasuresDeleted))); + outputLog.addKeyword(PvlKeyword("PointsDeleted", Isis::toString(numPointsDeleted))); + outputLog.addKeyword(PvlKeyword("MeasuresDeleted", Isis::toString(numMeasuresDeleted))); PvlObject lockedLog = createLog( "EditLocked", editLockedPoints, editLockedMeasures); diff --git a/isis/src/control/apps/cnetextract/cnetextract.cpp b/isis/src/control/apps/cnetextract/cnetextract.cpp index c965dcb74e..41366ba29a 100644 --- a/isis/src/control/apps/cnetextract/cnetextract.cpp +++ b/isis/src/control/apps/cnetextract/cnetextract.cpp @@ -322,10 +322,10 @@ namespace Isis { PvlGroup summary("ResultSummary"); PvlGroup results("Results"); - summary.addKeyword(PvlKeyword("InputPoints", toString(inputPoints))); - summary.addKeyword(PvlKeyword("InputMeasures", toString(inputMeasures))); - summary.addKeyword(PvlKeyword("OutputPoints", toString(outputPoints))); - summary.addKeyword(PvlKeyword("OutputMeasures", toString(outputMeasures))); + summary.addKeyword(PvlKeyword("InputPoints", Isis::toString(inputPoints))); + summary.addKeyword(PvlKeyword("InputMeasures", Isis::toString(inputMeasures))); + summary.addKeyword(PvlKeyword("OutputPoints", Isis::toString(outputPoints))); + summary.addKeyword(PvlKeyword("OutputMeasures", Isis::toString(outputMeasures))); if (outputPoints != 0) { // Write the filenames associated with outNet @@ -357,43 +357,43 @@ namespace Isis { if(noIgnore) { - summary.addKeyword(PvlKeyword("IgnoredPoints", toString((int)ignoredPoints.size()))); - summary.addKeyword(PvlKeyword("IgnoredMeasures", toString((int)ignoredMeasures.size()))); + summary.addKeyword(PvlKeyword("IgnoredPoints", Isis::toString((int)ignoredPoints.size()))); + summary.addKeyword(PvlKeyword("IgnoredMeasures", Isis::toString((int)ignoredMeasures.size()))); } if(noSingleMeasure) { - summary.addKeyword(PvlKeyword("SingleMeasurePoints", toString((int)singleMeasurePoints.size()))); + summary.addKeyword(PvlKeyword("SingleMeasurePoints", Isis::toString((int)singleMeasurePoints.size()))); } if(noMeasureless) { - summary.addKeyword(PvlKeyword("MeasurelessPoints", toString((int)measurelessPoints.size()))); + summary.addKeyword(PvlKeyword("MeasurelessPoints", Isis::toString((int)measurelessPoints.size()))); } if(noTolerancePoints) { - summary.addKeyword(PvlKeyword("TolerancePoints", toString((int)tolerancePoints.size()))); + summary.addKeyword(PvlKeyword("TolerancePoints", Isis::toString((int)tolerancePoints.size()))); } if(reference) { - summary.addKeyword(PvlKeyword("NonReferenceMeasures", toString((int)nonReferenceMeasures.size()))); + summary.addKeyword(PvlKeyword("NonReferenceMeasures", Isis::toString((int)nonReferenceMeasures.size()))); } if(fixed) { - summary.addKeyword(PvlKeyword("NonFixedPoints", toString((int)nonFixedPoints.size()))); + summary.addKeyword(PvlKeyword("NonFixedPoints", Isis::toString((int)nonFixedPoints.size()))); } if(cubePoints) { - summary.addKeyword(PvlKeyword("NonCubePoints", toString((int)nonCubePoints.size()))); + summary.addKeyword(PvlKeyword("NonCubePoints", Isis::toString((int)nonCubePoints.size()))); } // This is commented out since this does not correspond to any filters or the // documentation of this application. I did not delete the code in case we find // that we need it later. J.Backer 2012-06-22 // // if(noMeasurePoints.size() != 0) { - // summary.addKeyword(PvlKeyword("NoCubeMeasure", toString((int)noMeasurePoints.size()))); + // summary.addKeyword(PvlKeyword("NoCubeMeasure", Isis::toString((int)noMeasurePoints.size()))); // } if(cubeMeasures) { - summary.addKeyword(PvlKeyword("NonCubeMeasures", toString((int)noCubeMeasures.size()))); + summary.addKeyword(PvlKeyword("NonCubeMeasures", Isis::toString((int)noCubeMeasures.size()))); } if(pointsEntered) { - summary.addKeyword(PvlKeyword("NonListedPoints", toString((int)nonListedPoints.size()))); + summary.addKeyword(PvlKeyword("NonListedPoints", Isis::toString((int)nonListedPoints.size()))); } if(latLon) { - summary.addKeyword(PvlKeyword("LatLonOutOfRange", toString((int)nonLatLonPoints.size()))); - summary.addKeyword(PvlKeyword("NoLatLonPoints", toString((int)cannotGenerateLatLonPoints.size()))); + summary.addKeyword(PvlKeyword("LatLonOutOfRange", Isis::toString((int)nonLatLonPoints.size()))); + summary.addKeyword(PvlKeyword("NoLatLonPoints", Isis::toString((int)cannotGenerateLatLonPoints.size()))); } outProgress.CheckStatus(); diff --git a/isis/src/control/apps/cnetnewradii/main.cpp b/isis/src/control/apps/cnetnewradii/main.cpp index bb3efa5a29..5376a601ad 100644 --- a/isis/src/control/apps/cnetnewradii/main.cpp +++ b/isis/src/control/apps/cnetnewradii/main.cpp @@ -161,11 +161,11 @@ void IsisMain() { // Write results to Logs // Summary group is created with the counts of successes and failures PvlGroup summaryGroup = PvlGroup("Summary"); - summaryGroup.addKeyword(PvlKeyword("Successes", toString(numSuccesses))); - summaryGroup.addKeyword(PvlKeyword("Failures", toString(numFailures))); + summaryGroup.addKeyword(PvlKeyword("Successes", Isis::toString(numSuccesses))); + summaryGroup.addKeyword(PvlKeyword("Failures", Isis::toString(numFailures))); summaryGroup.addKeyword(PvlKeyword("NumberFixedConstrainedPoints", - toString(numConstrainedFixed))); - summaryGroup.addKeyword(PvlKeyword("NumberEditLockedPoints", toString(numLocked))); + Isis::toString(numConstrainedFixed))); + summaryGroup.addKeyword(PvlKeyword("NumberEditLockedPoints", Isis::toString(numLocked))); bool errorlog; FileName errorlogFile; diff --git a/isis/src/control/apps/cnetref/CnetRefByEmission.cpp b/isis/src/control/apps/cnetref/CnetRefByEmission.cpp index 71f263748e..f2bfe7c2ba 100644 --- a/isis/src/control/apps/cnetref/CnetRefByEmission.cpp +++ b/isis/src/control/apps/cnetref/CnetRefByEmission.cpp @@ -197,24 +197,24 @@ namespace Isis { int iComment = 0; if (numMeasures == 0) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "No Measures in the Point"); } if (newPnt->IsIgnored()) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Point was originally Ignored"); } if (origPnt.GetType() == ControlPoint::Fixed) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Fixed Point"); } else if (newPnt->GetType() == ControlPoint::Constrained) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Constrained Point"); } @@ -246,7 +246,7 @@ namespace Isis { pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", origPnt.GetReferenceSN().toStdString()); pvlRefChangeGrp += Isis::PvlKeyword("PrevEmAngle", - toString(bestEmissionAngle[iRefIndex])); + Isis::toString(bestEmissionAngle[iRefIndex])); istrTemp = QString::number((int)origPnt.GetMeasure(iRefIndex)->GetSample()); istrTemp += ","; @@ -260,7 +260,7 @@ namespace Isis { pvlRefChangeGrp += Isis::PvlKeyword("NewSerialNumber", newPnt->GetMeasure(iBestIndex)->GetCubeSerialNumber().toStdString()); pvlRefChangeGrp += Isis::PvlKeyword("NewLeastEmAngle", - toString(bestEmissionAngle[iBestIndex])); + Isis::toString(bestEmissionAngle[iBestIndex])); istrTemp = QString::number((int)newPnt->GetMeasure(iBestIndex)->GetSample()); istrTemp += ","; @@ -278,9 +278,9 @@ namespace Isis { }// end Point // CnetRef Change Statistics - mStatisticsGrp += Isis::PvlKeyword("PointsModified", toString(iPointsModified)); - mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", toString(iRefChanged)); - mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", toString(iMeasuresModified)); + mStatisticsGrp += Isis::PvlKeyword("PointsModified", Isis::toString(iPointsModified)); + mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", Isis::toString(iRefChanged)); + mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", Isis::toString(iMeasuresModified)); mPvlLog += mStatisticsGrp; } diff --git a/isis/src/control/apps/cnetref/CnetRefByIncidence.cpp b/isis/src/control/apps/cnetref/CnetRefByIncidence.cpp index ed0a5e7f45..1eb3339f08 100644 --- a/isis/src/control/apps/cnetref/CnetRefByIncidence.cpp +++ b/isis/src/control/apps/cnetref/CnetRefByIncidence.cpp @@ -194,24 +194,24 @@ namespace Isis { int iComment = 0; if (numMeasures == 0) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "No Measures in the Point"); } if (newPnt->IsIgnored()) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Point was originally Ignored"); } if (origPnt.GetType() == ControlPoint::Fixed) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Fixed Point"); } else if (newPnt->GetType() == ControlPoint::Constrained) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Constrained Point"); } @@ -241,7 +241,7 @@ namespace Isis { if (iRefIndex >= 0) { pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", origPnt.GetMeasure(iRefIndex)->GetCubeSerialNumber().toStdString()); - pvlRefChangeGrp += Isis::PvlKeyword("PrevIncAngle", toString(bestIncidenceAngle[iRefIndex])); + pvlRefChangeGrp += Isis::PvlKeyword("PrevIncAngle", Isis::toString(bestIncidenceAngle[iRefIndex])); istrTemp = QString::number((int)origPnt.GetMeasure(iRefIndex)->GetSample()); istrTemp += ","; @@ -254,7 +254,7 @@ namespace Isis { pvlRefChangeGrp += Isis::PvlKeyword("NewSerialNumber", newPnt->GetMeasure(iBestIndex)->GetCubeSerialNumber().toStdString()); - pvlRefChangeGrp += Isis::PvlKeyword("NewLeastIncAngle", toString(bestIncidenceAngle[iBestIndex])); + pvlRefChangeGrp += Isis::PvlKeyword("NewLeastIncAngle", Isis::toString(bestIncidenceAngle[iBestIndex])); istrTemp = QString::number((int)newPnt->GetMeasure(iBestIndex)->GetSample()); istrTemp += ","; @@ -272,9 +272,9 @@ namespace Isis { }// end Point // CnetRef Change Statistics - mStatisticsGrp += Isis::PvlKeyword("PointsModified", toString(iPointsModified)); - mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", toString(iRefChanged)); - mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", toString(iMeasuresModified)); + mStatisticsGrp += Isis::PvlKeyword("PointsModified", Isis::toString(iPointsModified)); + mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", Isis::toString(iRefChanged)); + mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", Isis::toString(iMeasuresModified)); mPvlLog += mStatisticsGrp; } diff --git a/isis/src/control/apps/cnetref/CnetRefByResolution.cpp b/isis/src/control/apps/cnetref/CnetRefByResolution.cpp index 99708490b6..55635abb66 100644 --- a/isis/src/control/apps/cnetref/CnetRefByResolution.cpp +++ b/isis/src/control/apps/cnetref/CnetRefByResolution.cpp @@ -212,24 +212,24 @@ namespace Isis { int iComment = 0; if (numMeasures == 0) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "No Measures in the Point"); } if (newPnt->IsIgnored()) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Point was originally Ignored"); } if (newPnt->GetType() == ControlPoint::Fixed) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Fixed Point"); } else if (newPnt->GetType() == ControlPoint::Constrained) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Constrained Point"); } @@ -259,7 +259,7 @@ namespace Isis { if (iRefIndex >= 0) { pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", origPnt.GetMeasure(iRefIndex)->GetCubeSerialNumber().toStdString()); - pvlRefChangeGrp += Isis::PvlKeyword("PrevResolution", toString(mdResVector[iRefIndex])); + pvlRefChangeGrp += Isis::PvlKeyword("PrevResolution", Isis::toString(mdResVector[iRefIndex])); istrTemp = QString((int)origPnt.GetMeasure(iRefIndex)->GetSample()); istrTemp += ","; @@ -277,7 +277,7 @@ namespace Isis { sKeyName = "NewLeastResolution"; } else if (meType == Mean) { - pvlRefChangeGrp += Isis::PvlKeyword("MeanResolution", toString(GetMeanResolution())); + pvlRefChangeGrp += Isis::PvlKeyword("MeanResolution", Isis::toString(GetMeanResolution())); sKeyName = "NewResolutionNeartoMean"; } else if (meType == Nearest) { @@ -286,7 +286,7 @@ namespace Isis { else if (meType == Range) { sKeyName = "NewResolutionInRange"; } - pvlRefChangeGrp += Isis::PvlKeyword(sKeyName.toStdString(), toString(mdResVector[iBestIndex])); + pvlRefChangeGrp += Isis::PvlKeyword(sKeyName.toStdString(), Isis::toString(mdResVector[iBestIndex])); istrTemp = QString((int)newPnt->GetMeasure(iBestIndex)->GetSample()); istrTemp += ","; @@ -305,9 +305,9 @@ namespace Isis { }// end Point // CnetRef Change Statistics - mStatisticsGrp += Isis::PvlKeyword("PointsModified", toString(iPointsModified)); - mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", toString(iRefChanged)); - mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", toString(iMeasuresModified)); + mStatisticsGrp += Isis::PvlKeyword("PointsModified", Isis::toString(iPointsModified)); + mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", Isis::toString(iRefChanged)); + mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", Isis::toString(iMeasuresModified)); mPvlLog += mStatisticsGrp; } diff --git a/isis/src/control/apps/coreg/main.cpp b/isis/src/control/apps/coreg/main.cpp index 462ef55e0c..e7008f0658 100644 --- a/isis/src/control/apps/coreg/main.cpp +++ b/isis/src/control/apps/coreg/main.cpp @@ -201,14 +201,14 @@ void IsisMain() { double lMax = (int)(lStats.Maximum() * 100.0) / 100.0; double lDev = (int)(lStats.StandardDeviation() * 100.0) / 100.0; - results += PvlKeyword("SampleMinimum", toString(sMin)); - results += PvlKeyword("SampleAverage", toString(sTrans)); - results += PvlKeyword("SampleMaximum", toString(sMax)); - results += PvlKeyword("SampleStandardDeviation", toString(sDev)); - results += PvlKeyword("LineMinimum", toString(lMin)); - results += PvlKeyword("LineAverage", toString(lTrans)); - results += PvlKeyword("LineMaximum", toString(lMax)); - results += PvlKeyword("LineStandardDeviation", toString(lDev)); + results += PvlKeyword("SampleMinimum", Isis::toString(sMin)); + results += PvlKeyword("SampleAverage", Isis::toString(sTrans)); + results += PvlKeyword("SampleMaximum", Isis::toString(sMax)); + results += PvlKeyword("SampleStandardDeviation", Isis::toString(sDev)); + results += PvlKeyword("LineMinimum", Isis::toString(lMin)); + results += PvlKeyword("LineAverage", Isis::toString(lTrans)); + results += PvlKeyword("LineMaximum", Isis::toString(lMax)); + results += PvlKeyword("LineStandardDeviation", Isis::toString(lDev)); Application::Log(results); Pvl arPvl = ar->RegistrationStatistics(); diff --git a/isis/src/control/apps/deltack/main.cpp b/isis/src/control/apps/deltack/main.cpp index 8568515219..5a8fc8f50b 100644 --- a/isis/src/control/apps/deltack/main.cpp +++ b/isis/src/control/apps/deltack/main.cpp @@ -94,31 +94,31 @@ void IsisMain() { // Map the latitude/longitude to a line/sample of the desired update // cout << "Input Lat, Lon = " << lat1.degrees() << "," << lon1.degrees() << "\n"; - results += PvlKeyword("Lat1", toString(lat1.degrees()), "degrees"); - results += PvlKeyword("Lon1", toString(lon1.degrees()), "degrees"); + results += PvlKeyword("Lat1", Isis::toString(lat1.degrees()), "degrees"); + results += PvlKeyword("Lon1", Isis::toString(lon1.degrees()), "degrees"); if ( !v_cam->SetUniversalGround(lat1.degrees(), lon1.degrees()) ) { std::string mess = "Geometry coordinate does not map into image at location (" + - toString(lat1.degrees()) + "," + toString(lon1.degrees()) + ")"; + Isis::toString(lat1.degrees()) + "," + Isis::toString(lon1.degrees()) + ")"; throw IException(IException::User, mess, _FILEINFO_); } // Get the surface coordinate in body fixed // cout << "Sample, Line = " << v_cam->Sample() << "," << v_cam->Line() << "\n"; - results += PvlKeyword("Lat1Lon1Sample", toString(v_cam->Sample())); - results += PvlKeyword("Lat1Lon1Line", toString(v_cam->Line())); + results += PvlKeyword("Lat1Lon1Sample", Isis::toString(v_cam->Sample())); + results += PvlKeyword("Lat1Lon1Line", Isis::toString(v_cam->Line())); double pt2[3]; v_cam->Coordinate(pt2); // Retrieve the current geometry of a point to use as reference for the update - results += PvlKeyword("Samp1", toString(samp1)); - results += PvlKeyword("Line1", toString(line1)); + results += PvlKeyword("Samp1", Isis::toString(samp1)); + results += PvlKeyword("Line1", Isis::toString(line1)); if ( !v_cam->SetImage(samp1, line1) ) { // Ignore the SetImage() error as long as the coordinate is a valid // image coordinate. if (!v_cam->InCube() ) { std::string mess = "Image coordinate is outside image coordinates at point (" + - toString(samp1) + "," + toString(line1) + ")"; + Isis::toString(samp1) + "," + Isis::toString(line1) + ")"; throw IException(IException::User, mess, _FILEINFO_); } @@ -130,8 +130,8 @@ void IsisMain() { results += PvlKeyword("Samp1Line1Lon"); } else { - results += PvlKeyword("Samp1Line1Lat", toString(v_cam->GetLatitude().degrees()), "degrees"); - results += PvlKeyword("Samp1Line1Lon", toString(v_cam->GetLongitude().degrees()), "degrees"); + results += PvlKeyword("Samp1Line1Lat", Isis::toString(v_cam->GetLatitude().degrees()), "degrees"); + results += PvlKeyword("Samp1Line1Lon", Isis::toString(v_cam->GetLongitude().degrees()), "degrees"); } // Get vector to surface from S/C and S/C position in body-fixed. @@ -155,7 +155,7 @@ void IsisMain() { // Compute angle difference of update double j2kAngle = vsep_c(&ldir1[0], &ldir2[0]); - results += PvlKeyword("AdjustedAngle", toString(j2kAngle * dpr_c()), "degrees"); + results += PvlKeyword("AdjustedAngle", Isis::toString(j2kAngle * dpr_c()), "degrees"); // Compute rotation of vectors SpiceDouble R[3][3]; @@ -179,7 +179,7 @@ void IsisMain() { // else and we have to abort... if ( o_cmat.Records() != 4 ) { std::string mess = "Expect only 4 records for polynomial cache but got " - + toString(o_cmat.Records()) + " instead!"; + + Isis::toString(o_cmat.Records()) + " instead!"; throw IException(IException::User, mess, _FILEINFO_); } @@ -193,7 +193,7 @@ void IsisMain() { } // Write out a description in the spice table - results += PvlKeyword("RecordsUpdated", toString(o_cmat.Records())); + results += PvlKeyword("RecordsUpdated", Isis::toString(o_cmat.Records())); QString deltackComment = "deltackDirectAdjusted = " + Isis::iTime::CurrentLocalTime(); o_cmat.Label().addComment(deltackComment.toStdString()); @@ -331,7 +331,7 @@ Distance GetRadius(QString filename, Latitude lat, Longitude lon) { Distance radius = sensor->LocalRadius(); if (!radius.isValid()) { std::string msg = "Could not determine radius from DEM at lat/lon ["; - msg += toString(lat.degrees()) + "," + toString(lon.degrees()) + "]"; + msg += Isis::toString(lat.degrees()) + "," + Isis::toString(lon.degrees()) + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } return radius; @@ -494,7 +494,7 @@ void ApplyRotation(const double R[3][3], Table &table) { // Sanity check... if ( table[0].Fields() < 4 ) { std::string mess = "Expect at least 4 fields for quaternion cache but got " - + toString(table.Records()) + " instead!"; + + Isis::toString(table.Records()) + " instead!"; throw IException(IException::User, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/ImageSource.cpp b/isis/src/control/apps/findfeatures/ImageSource.cpp index 7f11bf215b..8a2ed00eb5 100644 --- a/isis/src/control/apps/findfeatures/ImageSource.cpp +++ b/isis/src/control/apps/findfeatures/ImageSource.cpp @@ -342,7 +342,7 @@ cv::Mat ImageSource::getGeometryMapping(ImageSource &match, // Compute homography if enough point if ( (int) source.size() < v_minpts ) { std::string mess = "Failed to get geometry mapping for " + match.name().toStdString() + - " to " + name().toStdString() + " needing " + std::to_string(v_minpts) + + " to " + name().toStdString() + " needing " + Isis::toString(v_minpts) + " but only could get " + std::to_string(source.size()) +"."; throw IException(IException::Programmer, mess, _FILEINFO_); } diff --git a/isis/src/control/apps/findfeatures/MatchMaker.cpp b/isis/src/control/apps/findfeatures/MatchMaker.cpp index 61b71e71f9..76dd4c6e42 100644 --- a/isis/src/control/apps/findfeatures/MatchMaker.cpp +++ b/isis/src/control/apps/findfeatures/MatchMaker.cpp @@ -158,7 +158,7 @@ MatcherSolutionList MatchMaker::match(const RobustMatcherList &matchers) { logger().flush(); } - cnetinfo += PvlKeyword("SolutionSize", toString(solution.size()) ); + cnetinfo += PvlKeyword("SolutionSize", Isis::toString(solution.size()) ); if ( solution.size() <= 0 ) { cnetinfo += PvlKeyword("Error", "No matches, no network!!"); return (cnetinfo); @@ -217,12 +217,12 @@ MatcherSolutionList MatchMaker::match(const RobustMatcherList &matchers) { } } - cnetinfo += PvlKeyword("ImagesMatched", toString(nImages) ); - cnetinfo += PvlKeyword("ControlPoints", toString(nPoints) ); - cnetinfo += PvlKeyword("ControlMeasures", toString(nMeasures) ); - cnetinfo += PvlKeyword("InvalidIgnoredPoints", toString(nBadPoints) ); - cnetinfo += PvlKeyword("InvalidIgnoredMeasures", toString(nBadMeasures) ); - cnetinfo += PvlKeyword("PreserveIgnoredControl", toString(preserve_ignored) ); + cnetinfo += PvlKeyword("ImagesMatched", Isis::toString(nImages) ); + cnetinfo += PvlKeyword("ControlPoints", Isis::toString(nPoints) ); + cnetinfo += PvlKeyword("ControlMeasures", Isis::toString(nMeasures) ); + cnetinfo += PvlKeyword("InvalidIgnoredPoints", Isis::toString(nBadPoints) ); + cnetinfo += PvlKeyword("InvalidIgnoredMeasures", Isis::toString(nBadMeasures) ); + cnetinfo += PvlKeyword("PreserveIgnoredControl", Isis::toString(preserve_ignored) ); if ( isDebug() ) { logger() << " Images Matched: " << nImages << "\n"; logger() << " ControlPoints created: " << nPoints << "\n"; @@ -234,7 +234,7 @@ MatcherSolutionList MatchMaker::match(const RobustMatcherList &matchers) { } // Report measure statistics - PvlKeyword mkey = PvlKeyword("ValidPoints", toString(pointStats.ValidPixels()) ); + PvlKeyword mkey = PvlKeyword("ValidPoints", Isis::toString(pointStats.ValidPixels()) ); mkey.addComment(" -- Valid Point/Measure Statistics ---"); cnetinfo += mkey; if ( isDebug() ) { @@ -243,11 +243,11 @@ MatcherSolutionList MatchMaker::match(const RobustMatcherList &matchers) { } if ( pointStats.ValidPixels() > 0 ) { - cnetinfo += PvlKeyword("MinimumMeasures", toString(pointStats.Minimum()) ); - cnetinfo += PvlKeyword("MaximumMeasures", toString(pointStats.Maximum()) ); - cnetinfo += PvlKeyword("AverageMeasures", toString(pointStats.Average()) ); - cnetinfo += PvlKeyword("StdDevMeasures", toString(pointStats.StandardDeviation()) ); - cnetinfo += PvlKeyword("TotalMeasures", toString((int) pointStats.Sum()) ); + cnetinfo += PvlKeyword("MinimumMeasures", Isis::toString(pointStats.Minimum()) ); + cnetinfo += PvlKeyword("MaximumMeasures", Isis::toString(pointStats.Maximum()) ); + cnetinfo += PvlKeyword("AverageMeasures", Isis::toString(pointStats.Average()) ); + cnetinfo += PvlKeyword("StdDevMeasures", Isis::toString(pointStats.StandardDeviation()) ); + cnetinfo += PvlKeyword("TotalMeasures", Isis::toString((int) pointStats.Sum()) ); if ( isDebug() ) { logger() << " MinimumMeasures: " << pointStats.Minimum() << "\n"; logger() << " MaximumMeasures: " << pointStats.Maximum() << "\n"; diff --git a/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp b/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp index ce5c40c9fa..2744545c6b 100644 --- a/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp +++ b/isis/src/control/apps/findfeatures/MatcherAlgorithms.cpp @@ -132,7 +132,7 @@ namespace Isis { // Shall we throw an exception to report the issues? if ( (0 < nerrors) && (true == throwOnErrors)) { - std::string mess = "There were " + toString(nerrors) + + std::string mess = "There were " + Isis::toString(nerrors) + " errors found in this matcher algorithm set"; ie.append(IException(IException::Programmer, mess, _FILEINFO_)); throw ie; diff --git a/isis/src/control/apps/findfeatures/findfeatures.cpp b/isis/src/control/apps/findfeatures/findfeatures.cpp index ab0d2fe3c1..556c5b1adb 100644 --- a/isis/src/control/apps/findfeatures/findfeatures.cpp +++ b/isis/src/control/apps/findfeatures/findfeatures.cpp @@ -396,7 +396,7 @@ namespace Isis { if ( matcher.size() <= 0 ) { logger->dbugout() << "\n\n### No valid files loaded - aborting...\n"; logger->dbugout() << "Time: " << Application::DateTime() << "\n"; - std::string msg = "Input cubes (" + toString(badgeom.size()) + ") failed to load. " + + std::string msg = "Input cubes (" + Isis::toString(badgeom.size()) + ") failed to load. " + "Must provide valid FROM/FROMLIST and MATCH cube or image filenames"; throw IException(IException::User, msg, _FILEINFO_); } @@ -438,7 +438,7 @@ namespace Isis { logger->dbugout() << "Shucks! Insufficient matches were found (" << best->size() << ")\n"; std::string mess = "Shucks! Insufficient matches were found (" + - toString(best->size()) + ")"; + Isis::toString(best->size()) + ")"; throw IException(IException::User, mess, _FILEINFO_); } @@ -446,12 +446,12 @@ namespace Isis { Statistics quality = best->qualityStatistics(); PvlGroup bestinfo("MatchSolution"); bestinfo += PvlKeyword("Matcher", best->matcher()->name().toStdString()); - bestinfo += PvlKeyword("MatchedPairs", toString(best->size())); - bestinfo += PvlKeyword("ValidPairs", toString(quality.ValidPixels())); - bestinfo += PvlKeyword("Efficiency", toString(quality.Average())); + bestinfo += PvlKeyword("MatchedPairs", Isis::toString(best->size())); + bestinfo += PvlKeyword("ValidPairs", Isis::toString(quality.ValidPixels())); + bestinfo += PvlKeyword("Efficiency", Isis::toString(quality.Average())); if ( quality.ValidPixels() > 1 ) { bestinfo += PvlKeyword("StdDevEfficiency", - toString(quality.StandardDeviation())); + Isis::toString(quality.StandardDeviation())); } Application::Log(bestinfo); diff --git a/isis/src/control/apps/fplanemap/main.cpp b/isis/src/control/apps/fplanemap/main.cpp index bc51fd9bcd..e57cbb1eab 100644 --- a/isis/src/control/apps/fplanemap/main.cpp +++ b/isis/src/control/apps/fplanemap/main.cpp @@ -150,14 +150,14 @@ void IsisMain() { } PvlGroup results("Results"); - results += PvlKeyword("PixelPitch", toString(pp), "millimeters"); - results += PvlKeyword("TotalPoints", toString(cn.GetNumPoints())); - results += PvlKeyword("ValidPoints", toString((BigInt) coords.size())); - results += PvlKeyword("InvalidPoints", toString(badPoint)); - if (checkForNulls) results += PvlKeyword("NullDNs", toString(nulls)); - results += PvlKeyword("OldPointNotInImage", toString(oldNotInImage)); - results += PvlKeyword("NewPointNotInImage", toString(newNotInImage)); - results += PvlKeyword("ToleranceExceeded", toString(badTol)); + results += PvlKeyword("PixelPitch", Isis::toString(pp), "millimeters"); + results += PvlKeyword("TotalPoints", Isis::toString(cn.GetNumPoints())); + results += PvlKeyword("ValidPoints", Isis::toString((BigInt) coords.size())); + results += PvlKeyword("InvalidPoints", Isis::toString(badPoint)); + if (checkForNulls) results += PvlKeyword("NullDNs", Isis::toString(nulls)); + results += PvlKeyword("OldPointNotInImage", Isis::toString(oldNotInImage)); + results += PvlKeyword("NewPointNotInImage", Isis::toString(newNotInImage)); + results += PvlKeyword("ToleranceExceeded", Isis::toString(badTol)); // Log it Application::Log(results); diff --git a/isis/src/control/apps/mat2cnet/main.cpp b/isis/src/control/apps/mat2cnet/main.cpp index b52ddbc9cd..dbbd4b49b2 100644 --- a/isis/src/control/apps/mat2cnet/main.cpp +++ b/isis/src/control/apps/mat2cnet/main.cpp @@ -469,7 +469,7 @@ void IsisMain() { // Write results to Logs // Summary group is created with the counts of RAND PPP only points PvlGroup summaryGroup = PvlGroup("Summary"); - summaryGroup.addKeyword(PvlKeyword("RandOnlyPoints", toString(numRandOnly))); + summaryGroup.addKeyword(PvlKeyword("RandOnlyPoints", Isis::toString(numRandOnly))); bool log; FileName logFile; diff --git a/isis/src/control/apps/pointreg/pointreg.cpp b/isis/src/control/apps/pointreg/pointreg.cpp index 70f22c2b6f..b5aee0b5a8 100644 --- a/isis/src/control/apps/pointreg/pointreg.cpp +++ b/isis/src/control/apps/pointreg/pointreg.cpp @@ -467,15 +467,15 @@ namespace Isis { } PvlGroup pLog("Points"); - pLog += PvlKeyword("Total", toString(outNet.GetNumPoints())); - pLog += PvlKeyword("Ignored", toString(ignored)); + pLog += PvlKeyword("Total", Isis::toString(outNet.GetNumPoints())); + pLog += PvlKeyword("Ignored", Isis::toString(ignored)); Application::AppendAndLog(pLog, appLog); PvlGroup mLog("Measures"); - mLog += PvlKeyword("Locked", toString(locked)); - mLog += PvlKeyword("Registered", toString(registered)); - mLog += PvlKeyword("NotIntersected", toString(notintersected)); - mLog += PvlKeyword("Unregistered", toString(unregistered)); + mLog += PvlKeyword("Locked", Isis::toString(locked)); + mLog += PvlKeyword("Registered", Isis::toString(registered)); + mLog += PvlKeyword("NotIntersected", Isis::toString(notintersected)); + mLog += PvlKeyword("Unregistered", Isis::toString(unregistered)); Application::AppendAndLog(mLog, appLog); // Log Registration Statistics diff --git a/isis/src/control/apps/seedgrid/main.cpp b/isis/src/control/apps/seedgrid/main.cpp index 3eaab6e55b..9802c2f4eb 100644 --- a/isis/src/control/apps/seedgrid/main.cpp +++ b/isis/src/control/apps/seedgrid/main.cpp @@ -79,7 +79,7 @@ void IsisMain() { throw IException(e, IException::Unknown, msg, _FILEINFO_); } } - double equatorialRadius = IString::ToDouble(mapGroup.findKeyword("EquatorialRadius")[0]); + double equatorialRadius = Isis::toDouble(mapGroup.findKeyword("EquatorialRadius")[0]); QString networkId; if (ui.WasEntered("NETWORKID")) { @@ -102,7 +102,7 @@ void IsisMain() { checkLatitude(minLat, maxLat); int lonDomain = (mapGroup.hasKeyword("LongitudeDomain") ? - IString::ToInteger(mapGroup.findKeyword("LongitudeDomain")[0]) : + Isis::toInt(mapGroup.findKeyword("LongitudeDomain")[0]) : 360); checkLongitude(minLon, maxLon, lonDomain); @@ -120,10 +120,10 @@ void IsisMain() { mapGroup += PvlKeyword("CenterLongitude", "0.0"); } - mapGroup.addKeyword(PvlKeyword("MinimumLatitude", toString(minLat)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MaximumLatitude", toString(maxLat)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MinimumLongitude", toString(minLon)), Pvl::Replace); - mapGroup.addKeyword(PvlKeyword("MaximumLongitude", toString(maxLon)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MinimumLatitude", Isis::toString(minLat)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MaximumLatitude", Isis::toString(maxLat)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MinimumLongitude", Isis::toString(minLon)), Pvl::Replace); + mapGroup.addKeyword(PvlKeyword("MaximumLongitude", Isis::toString(maxLon)), Pvl::Replace); // create the projection from the editted map TProjection *proj = (TProjection *) ProjectionFactory::Create(userMap); @@ -228,8 +228,8 @@ void IsisMain() { } PvlGroup results("Results"); - results += PvlKeyword("EquatorialRadius", toString(equatorialRadius)); - results += PvlKeyword("NumberControlPoints", toString(cnet.GetNumPoints())); + results += PvlKeyword("EquatorialRadius", Isis::toString(equatorialRadius)); + results += PvlKeyword("NumberControlPoints", Isis::toString(cnet.GetNumPoints())); Application::Log(results); cnet.Write(ui.GetFileName("ONET")); diff --git a/isis/src/control/apps/sumspice/SumFinder.cpp b/isis/src/control/apps/sumspice/SumFinder.cpp index 6c6562c476..1fda4136ad 100644 --- a/isis/src/control/apps/sumspice/SumFinder.cpp +++ b/isis/src/control/apps/sumspice/SumFinder.cpp @@ -341,7 +341,7 @@ namespace Isis { PvlGroup &instGrp = cubeLabels->findGroup("Instrument", Pvl::Traverse); PvlKeyword exptime = instGrp["ExposureDuration"]; QString units = QString::fromStdString(exptime.unit(0)).toLower(); - double etime = IString::ToDouble(exptime[0]); + double etime = Isis::toDouble(exptime[0]); // Convert to seconds if indicated if ( "milliseconds" == units) etime /= 1000.0; diff --git a/isis/src/control/apps/warp/WarpTransform.cpp b/isis/src/control/apps/warp/WarpTransform.cpp index 32b42eb24f..3edd1ed3f5 100644 --- a/isis/src/control/apps/warp/WarpTransform.cpp +++ b/isis/src/control/apps/warp/WarpTransform.cpp @@ -147,9 +147,9 @@ namespace Isis { PvlGroup WarpTransform::Residuals() { PvlGroup errs("Residuals"); for (int i = 0; i < p_lsqInputLine->Knowns(); i++) { - PvlKeyword p("POINT" + toString (i + 1)); - p += toString (p_lsqInputLine->Residual(i)); - p += toString (p_lsqInputSamp->Residual(i)); + PvlKeyword p("POINT" + Isis::toString (i + 1)); + p += Isis::toString (p_lsqInputLine->Residual(i)); + p += Isis::toString (p_lsqInputSamp->Residual(i)); errs += p; } return errs; diff --git a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp index 3dc8575900..3ba146444b 100644 --- a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp +++ b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp @@ -84,8 +84,8 @@ namespace Isis { PvlGroup gp(errlog.toStdString()); gp += PvlKeyword("File",file); - gp += PvlKeyword("Line_Number", toString(nLineNo)); - gp += PvlKeyword("Status", toString(nStatus)); + gp += PvlKeyword("Line_Number", Isis::toString(nLineNo)); + gp += PvlKeyword("Status", Isis::toString(nStatus)); // Application::Log(gp); @@ -1821,7 +1821,7 @@ namespace Isis { // check for "matrix not positive definite" error if (m_cholmodCommon.status == CHOLMOD_NOT_POSDEF) { - std::string msg = "Matrix NOT positive-definite: failure at column " + toString((int) m_L->minor); + std::string msg = "Matrix NOT positive-definite: failure at column " + Isis::toString((int) m_L->minor); // throw IException(IException::User, msg, _FILEINFO_); error(QString::fromStdString(msg)); emit(finished()); @@ -2974,7 +2974,7 @@ namespace Isis { QString BundleAdjust::modelState(int i) { Camera *imageCam = m_controlNet->Camera(i); if (imageCam->GetCameraType() != Camera::Csm) { - std::string msg = "Cannot get model state for image [" + toString(i) + + std::string msg = "Cannot get model state for image [" + Isis::toString(i) + "] because it is not a CSM camera model."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -3005,46 +3005,46 @@ namespace Isis { PvlGroup summaryGroup(iterationNumber.toStdString()); summaryGroup += PvlKeyword("Sigma0", - toString( m_bundleResults.sigma0() ) ); + Isis::toString( m_bundleResults.sigma0() ) ); summaryGroup += PvlKeyword("Observations", - toString( m_bundleResults.numberObservations() ) ); + Isis::toString( m_bundleResults.numberObservations() ) ); summaryGroup += PvlKeyword("Constrained_Point_Parameters", - toString( m_bundleResults.numberConstrainedPointParameters() ) ); + Isis::toString( m_bundleResults.numberConstrainedPointParameters() ) ); summaryGroup += PvlKeyword("Constrained_Image_Parameters", - toString( m_bundleResults.numberConstrainedImageParameters() ) ); + Isis::toString( m_bundleResults.numberConstrainedImageParameters() ) ); if (m_bundleSettings->bundleTargetBody()) { summaryGroup += PvlKeyword("Constrained_Target_Parameters", - toString( m_bundleResults.numberConstrainedTargetParameters() ) ); + Isis::toString( m_bundleResults.numberConstrainedTargetParameters() ) ); } summaryGroup += PvlKeyword("Unknown_Parameters", - toString( m_bundleResults.numberUnknownParameters() ) ); + Isis::toString( m_bundleResults.numberUnknownParameters() ) ); summaryGroup += PvlKeyword("Degrees_of_Freedom", - toString( m_bundleResults.degreesOfFreedom() ) ); + Isis::toString( m_bundleResults.degreesOfFreedom() ) ); summaryGroup += PvlKeyword( "Rejected_Measures", - toString( m_bundleResults.numberRejectedObservations()/2) ); + Isis::toString( m_bundleResults.numberRejectedObservations()/2) ); if ( m_bundleResults.numberMaximumLikelihoodModels() > m_bundleResults.maximumLikelihoodModelIndex() ) { // if maximum likelihood estimation is being used summaryGroup += PvlKeyword("Maximum_Likelihood_Tier: ", - toString( m_bundleResults.maximumLikelihoodModelIndex() ) ); + Isis::toString( m_bundleResults.maximumLikelihoodModelIndex() ) ); summaryGroup += PvlKeyword("Median_of_R^2_residuals: ", - toString( m_bundleResults.maximumLikelihoodMedianR2Residuals() ) ); + Isis::toString( m_bundleResults.maximumLikelihoodMedianR2Residuals() ) ); } if ( m_bundleResults.converged() ) { summaryGroup += PvlKeyword("Converged", "TRUE"); - summaryGroup += PvlKeyword("TotalElapsedTime", toString( m_bundleResults.elapsedTime() ) ); + summaryGroup += PvlKeyword("TotalElapsedTime", Isis::toString( m_bundleResults.elapsedTime() ) ); if (m_bundleSettings->errorPropagation()) { summaryGroup += PvlKeyword("ErrorPropagationElapsedTime", - toString( m_bundleResults.elapsedTimeErrorProp() ) ); + Isis::toString( m_bundleResults.elapsedTimeErrorProp() ) ); } } else { summaryGroup += PvlKeyword("Elapsed_Time", - toString( m_iterationTime ) ); + Isis::toString( m_iterationTime ) ); } std::ostringstream ostr; diff --git a/isis/src/control/objs/BundleResults/BundleResults.cpp b/isis/src/control/objs/BundleResults/BundleResults.cpp index 444a1c5f58..a0122493af 100644 --- a/isis/src/control/objs/BundleResults/BundleResults.cpp +++ b/isis/src/control/objs/BundleResults/BundleResults.cpp @@ -1254,7 +1254,7 @@ namespace Isis { m_sigma0 = dvtpv; } else { - std::string msg = "Computed degrees of freedom [" + toString(m_degreesOfFreedom) + std::string msg = "Computed degrees of freedom [" + Isis::toString(m_degreesOfFreedom) + "] is invalid."; throw IException(IException::Io, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp index aa251a4794..7f4d207e6a 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp @@ -202,7 +202,7 @@ namespace Isis { if (scParameterGroup.hasKeyword("ADDITIONAL_CAMERA_POINTING_SIGMAS")) { PvlKeyword additionalSigmas = scParameterGroup.findKeyword("ADDITIONAL_CAMERA_POINTING_SIGMAS"); for (int i = 0; i < additionalSigmas.size(); i++ ) { - m_anglesAprioriSigma.append(IString::ToDouble(additionalSigmas[i])); + m_anglesAprioriSigma.append(Isis::toDouble(additionalSigmas[i])); } } } @@ -229,7 +229,7 @@ namespace Isis { if (scParameterGroup.hasKeyword("ADDITIONAL_SPACECRAFT_POSITION_SIGMAS")) { PvlKeyword additionalSigmas = scParameterGroup.findKeyword("ADDITIONAL_SPACECRAFT_POSITION_SIGMAS"); for (int i = 0; i < additionalSigmas.size(); i++ ) { - m_positionAprioriSigma.append(IString::ToDouble(additionalSigmas[i])); + m_positionAprioriSigma.append(Isis::toDouble(additionalSigmas[i])); } } } diff --git a/isis/src/control/objs/ControlMeasureLogData/ControlMeasureLogData.cpp b/isis/src/control/objs/ControlMeasureLogData/ControlMeasureLogData.cpp index c3ebc91465..e8f9989897 100644 --- a/isis/src/control/objs/ControlMeasureLogData/ControlMeasureLogData.cpp +++ b/isis/src/control/objs/ControlMeasureLogData/ControlMeasureLogData.cpp @@ -60,7 +60,7 @@ namespace Isis { QString name = QString::fromStdString(keywordRep.name()); p_dataType = NameToDataType(name); if (p_dataType != InvalidNumericLogDataType) - p_numericalValue = IString::ToDouble(keywordRep[0]); + p_numericalValue = Isis::toDouble(keywordRep[0]); } /** @@ -165,7 +165,7 @@ namespace Isis { */ PvlKeyword ControlMeasureLogData::ToKeyword() const { if(IsValid()) - return PvlKeyword(DataTypeToName(p_dataType).toStdString(), toString(p_numericalValue)); + return PvlKeyword(DataTypeToName(p_dataType).toStdString(), Isis::toString(p_numericalValue)); else return PvlKeyword(); } @@ -235,7 +235,7 @@ namespace Isis { return "Obsolete_AverageResidual"; } - std::string msg = "Unknown data type [" + toString(type) + "]"; + std::string msg = "Unknown data type [" + Isis::toString(type) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } } diff --git a/isis/src/control/objs/ControlMeasureLogData/unitTest.cpp b/isis/src/control/objs/ControlMeasureLogData/unitTest.cpp index fcde04ae2b..313425de9f 100644 --- a/isis/src/control/objs/ControlMeasureLogData/unitTest.cpp +++ b/isis/src/control/objs/ControlMeasureLogData/unitTest.cpp @@ -42,7 +42,7 @@ int main() { cout << "Testing PvlKeyword constructor..." << endl; { - ControlMeasureLogData logData(PvlKeyword("GoodnessOfFit", toString(3.14159))); + ControlMeasureLogData logData(PvlKeyword("GoodnessOfFit", Isis::toString(3.14159))); cout << "Valid? " << logData.IsValid() << "\n" << "Type? " << logData.GetDataType() << "\n" diff --git a/isis/src/control/objs/ControlNet/unitTest.cpp b/isis/src/control/objs/ControlNet/unitTest.cpp index 234b34d71b..b5ae5a1bdb 100644 --- a/isis/src/control/objs/ControlNet/unitTest.cpp +++ b/isis/src/control/objs/ControlNet/unitTest.cpp @@ -486,17 +486,17 @@ int main() { cout << "\nTesting take() functionality to take owernship of the points in a ControlNet:" << endl; - cout << "Original control net number of points: " << toString(net.GetNumPoints()) << endl; + cout << "Original control net number of points: " << Isis::toString(net.GetNumPoints()) << endl; QList points = net.take(); - cout << "Number of points taken out: " << toString(points.length()) << endl; + cout << "Number of points taken out: " << Isis::toString(points.length()) << endl; cout << "Now there should be zero points in the original control net. There are: " - << toString(net.GetNumPoints()) << endl; + << Isis::toString(net.GetNumPoints()) << endl; cout << "And zero pointIDs in the original control net. There are: " - << toString(net.GetPointIds().length()) << endl; + << Isis::toString(net.GetPointIds().length()) << endl; //system("cat unitTest.output | grep -v DateTime > temp.output; mv temp.output unitTest.output"); //system("cat unitTest.output | sed -r s/`date +%Y-%m-%dT`\\[0-9:\\]\\{8\\}/2010-08-27T17:10:06/g > temp.output; mv temp.output unitTest.output"); diff --git a/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp b/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp index 7362a9aa09..634a4e1a04 100644 --- a/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp +++ b/isis/src/control/objs/ControlNetDiff/ControlNetDiff.cpp @@ -68,7 +68,7 @@ namespace Isis { PvlGroup tolerances = diffFile.findGroup("Tolerances"); for (int i = 0; i < tolerances.keywords(); i++) m_tolerances->insert(QString::fromStdString(tolerances[i].name()), - IString::ToDouble(tolerances[i][0])); + Isis::toDouble(tolerances[i][0])); } if (diffFile.hasGroup("IgnoreKeys")) { @@ -264,7 +264,7 @@ namespace Isis { void ControlNetDiff::compare(PvlKeyword &k1, PvlKeyword &k2, PvlContainer &report) { QString name = QString::fromStdString(k1.name()); if (m_tolerances->contains(name)) - diff(name, IString::ToDouble(k1[0]), IString::ToDouble(k2[0]), (*m_tolerances)[name], report); + diff(name, Isis::toDouble(k1[0]), Isis::toDouble(k2[0]), (*m_tolerances)[name], report); else diff(name, QString::fromStdString(k1[0]), QString::fromStdString(k2[0]), report); } @@ -355,10 +355,10 @@ namespace Isis { */ PvlKeyword ControlNetDiff::makeKeyword(QString name, double v1, double v2, double tol) { PvlKeyword keyword(name.toStdString()); - keyword.addValue(toString(v1)); + keyword.addValue(Isis::toString(v1)); if (fabs(v1 - v2) > tol) { - keyword.addValue(toString(v2)); - keyword.addValue(toString(tol)); + keyword.addValue(Isis::toString(v2)); + keyword.addValue(Isis::toString(tol)); } return keyword; } diff --git a/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp b/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp index afaa3d0635..938ff8f7e9 100644 --- a/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp +++ b/isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp @@ -259,11 +259,11 @@ namespace Isis { int iGreater = 0; if (pvlGrp.hasKeyword("LessThan")) { - iLesser = IString::ToInteger(pvlGrp["LessThan"][0]); + iLesser = Isis::toInt(pvlGrp["LessThan"][0]); } if (pvlGrp.hasKeyword("GreaterThan")) { - iGreater = IString::ToInteger(pvlGrp["GreaterThan"][0]); + iGreater = Isis::toInt(pvlGrp["GreaterThan"][0]); } if (iLesser < 0 || iGreater < 0 || iLesser < iGreater) { @@ -501,13 +501,13 @@ namespace Isis { if (pvlGrp.hasKeyword("LessThan")) { if (pvlGrp["LessThan"][0] != "") { - iLesser = IString::ToInteger(pvlGrp["LessThan"][0]); + iLesser = Isis::toInt(pvlGrp["LessThan"][0]); } } if (pvlGrp.hasKeyword("GreaterThan")) { if (pvlGrp["GreaterThan"][0] != "") { - iGreater = IString::ToInteger(pvlGrp["GreaterThan"][0]); + iGreater = Isis::toInt(pvlGrp["GreaterThan"][0]); } } @@ -1242,12 +1242,12 @@ namespace Isis { int iLessPoints = VALID_MAX2, iGreaterPoints = 0; if (pvlGrp.hasKeyword("LessThan")) { if (pvlGrp["LessThan"][0] != "") { - iLessPoints = IString::ToInteger(pvlGrp["LessThan"][0]); + iLessPoints = Isis::toInt(pvlGrp["LessThan"][0]); } } if (pvlGrp.hasKeyword("GreaterThan")) { if (pvlGrp["GreaterThan"][0] != "") { - iGreaterPoints = IString::ToInteger(pvlGrp["GreaterThan"][0]); + iGreaterPoints = Isis::toInt(pvlGrp["GreaterThan"][0]); } } diff --git a/isis/src/control/objs/ControlNetFilter/unitTest.cpp b/isis/src/control/objs/ControlNetFilter/unitTest.cpp index 1f8567345f..99975a0aa7 100644 --- a/isis/src/control/objs/ControlNetFilter/unitTest.cpp +++ b/isis/src/control/objs/ControlNetFilter/unitTest.cpp @@ -48,7 +48,7 @@ void IsisMain() { // Point ResidualMagnitude Filter cout << "****************** Point_ResidualMagnitude Filter ******************" << endl; filterGrp = PvlGroup("Point_ResidualMagnitude"); - keyword = PvlKeyword("LessThan", toString(1)); + keyword = PvlKeyword("LessThan", Isis::toString(1)); filterGrp += keyword; cnetFilter->PointResMagnitudeFilter(filterGrp, false); cout << filterGrp << endl; @@ -82,7 +82,7 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_NumMeasuresEditLock"); - keyword = PvlKeyword("LessThan", toString(1)); + keyword = PvlKeyword("LessThan", Isis::toString(1)); filterGrp += keyword; cnetFilter->PointNumMeasuresEditLockFilter(filterGrp, false); cout << filterGrp << endl; @@ -99,9 +99,9 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_PixelShift"); - keyword = PvlKeyword("LessThan", toString(10)); + keyword = PvlKeyword("LessThan", Isis::toString(10)); filterGrp += keyword; - keyword = PvlKeyword("GreaterThan", toString(1)); + keyword = PvlKeyword("GreaterThan", Isis::toString(1)); filterGrp += keyword; cnetFilter->PointPixelShiftFilter(filterGrp, false); cout << filterGrp << endl; @@ -135,9 +135,9 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_NumMeasures"); - keyword = PvlKeyword("GreaterThan", toString(2)); + keyword = PvlKeyword("GreaterThan", Isis::toString(2)); filterGrp += keyword; - keyword = PvlKeyword("LessThan", toString(2)); + keyword = PvlKeyword("LessThan", Isis::toString(2)); filterGrp += keyword; cnetFilter->PointMeasuresFilter(filterGrp, false); cout << filterGrp << endl; @@ -173,16 +173,16 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_LatLon"); - PvlKeyword keyword1("MinLat", toString(-100)); + PvlKeyword keyword1("MinLat", Isis::toString(-100)); filterGrp += keyword1; - PvlKeyword keyword2("MaxLat", toString(100)); + PvlKeyword keyword2("MaxLat", Isis::toString(100)); filterGrp += keyword2; - PvlKeyword keyword3("MinLon", toString(0)); + PvlKeyword keyword3("MinLon", Isis::toString(0)); filterGrp += keyword3; - PvlKeyword keyword4("MaxLon", toString(238)); + PvlKeyword keyword4("MaxLon", Isis::toString(238)); filterGrp += keyword4; cnetFilter->PointLatLonFilter(filterGrp, false); @@ -200,7 +200,7 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_Distance"); - keyword = PvlKeyword("MaxDistance", toString(50000)); + keyword = PvlKeyword("MaxDistance", Isis::toString(50000)); filterGrp += keyword; keyword = PvlKeyword("Units", "meters"); filterGrp += keyword; @@ -237,7 +237,7 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Point_GoodnessOfFit"); - keyword = PvlKeyword("LessThan", toString(0.5)); + keyword = PvlKeyword("LessThan", Isis::toString(0.5)); filterGrp += keyword; cnetFilter->PointGoodnessOfFitFilter(filterGrp, false); cout << filterGrp << endl; @@ -295,9 +295,9 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Cube_NumPoints"); - keyword = PvlKeyword("GreaterThan", toString(10)); + keyword = PvlKeyword("GreaterThan", Isis::toString(10)); filterGrp += keyword; - keyword = PvlKeyword("LessThan", toString(20)); + keyword = PvlKeyword("LessThan", Isis::toString(20)); filterGrp += keyword; cnetFilter->CubeNumPointsFilter(filterGrp, false); cout << filterGrp << endl; @@ -314,7 +314,7 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Cube_Distance"); - keyword = PvlKeyword("MaxDistance", toString(100000)); + keyword = PvlKeyword("MaxDistance", Isis::toString(100000)); filterGrp += keyword; keyword = PvlKeyword("Units=", "meters"); filterGrp += keyword; @@ -333,9 +333,9 @@ void IsisMain() { cnet = new ControlNet(ui.GetFileName("CNET")); cnetFilter = new ControlNetFilter(cnet, sSerialFile); filterGrp = PvlGroup("Cube_ConvexHullRatio"); - keyword = PvlKeyword("GreaterThan", toString(0.2)); + keyword = PvlKeyword("GreaterThan", Isis::toString(0.2)); filterGrp += keyword; - keyword = PvlKeyword("LessThan", toString(0.3)); + keyword = PvlKeyword("LessThan", Isis::toString(0.3)); filterGrp += keyword; cnetFilter->CubeConvexHullFilter(filterGrp, false); cout << filterGrp << endl; diff --git a/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp b/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp index 48c3ebda1e..9d23822077 100644 --- a/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp +++ b/isis/src/control/objs/ControlNetStatistics/ControlNetStatistics.cpp @@ -117,94 +117,94 @@ namespace Isis { int numSN = mSerialNumList.size(); if (numSN) { - pStatsGrp += PvlKeyword("TotalImages", toString(numSN)); - pStatsGrp += PvlKeyword("ImagesInControlNet", toString(numCNetImages)); + pStatsGrp += PvlKeyword("TotalImages", Isis::toString(numSN)); + pStatsGrp += PvlKeyword("ImagesInControlNet", Isis::toString(numCNetImages)); } - pStatsGrp += PvlKeyword("TotalPoints", toString(mCNet->GetNumPoints())); - pStatsGrp += PvlKeyword("ValidPoints", toString(NumValidPoints())); - pStatsGrp += PvlKeyword("IgnoredPoints", toString(mCNet->GetNumPoints() - NumValidPoints())); - pStatsGrp += PvlKeyword("FixedPoints", toString(NumFixedPoints())); - pStatsGrp += PvlKeyword("ConstrainedPoints", toString(NumConstrainedPoints())); - pStatsGrp += PvlKeyword("FreePoints", toString(NumFreePoints())); - pStatsGrp += PvlKeyword("EditLockPoints", toString(mCNet->GetNumEditLockPoints())); + pStatsGrp += PvlKeyword("TotalPoints", Isis::toString(mCNet->GetNumPoints())); + pStatsGrp += PvlKeyword("ValidPoints", Isis::toString(NumValidPoints())); + pStatsGrp += PvlKeyword("IgnoredPoints", Isis::toString(mCNet->GetNumPoints() - NumValidPoints())); + pStatsGrp += PvlKeyword("FixedPoints", Isis::toString(NumFixedPoints())); + pStatsGrp += PvlKeyword("ConstrainedPoints", Isis::toString(NumConstrainedPoints())); + pStatsGrp += PvlKeyword("FreePoints", Isis::toString(NumFreePoints())); + pStatsGrp += PvlKeyword("EditLockPoints", Isis::toString(mCNet->GetNumEditLockPoints())); - pStatsGrp += PvlKeyword("TotalMeasures", toString(NumMeasures())); - pStatsGrp += PvlKeyword("ValidMeasures", toString(NumValidMeasures())); - pStatsGrp += PvlKeyword("IgnoredMeasures", toString(NumIgnoredMeasures())); - pStatsGrp += PvlKeyword("EditLockMeasures", toString(mCNet->GetNumEditLockMeasures())); + pStatsGrp += PvlKeyword("TotalMeasures", Isis::toString(NumMeasures())); + pStatsGrp += PvlKeyword("ValidMeasures", Isis::toString(NumValidMeasures())); + pStatsGrp += PvlKeyword("IgnoredMeasures", Isis::toString(NumIgnoredMeasures())); + pStatsGrp += PvlKeyword("EditLockMeasures", Isis::toString(mCNet->GetNumEditLockMeasures())); double dValue = GetAverageResidual(); - pStatsGrp += PvlKeyword("AvgResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("AvgResidual", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMinimumResidual(); - pStatsGrp += PvlKeyword("MinResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinResidual", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMaximumResidual(); - pStatsGrp += PvlKeyword("MaxResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxResidual", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMinLineResidual(); - pStatsGrp += PvlKeyword("MinLineResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinLineResidual", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMaxLineResidual(); - pStatsGrp += PvlKeyword("MaxLineResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxLineResidual", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMinSampleResidual(); - pStatsGrp += PvlKeyword("MinSampleResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinSampleResidual", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMaxSampleResidual(); - pStatsGrp += PvlKeyword("MaxSampleResidual", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxSampleResidual", (dValue == Null ? "Null" : Isis::toString(dValue))); // Shifts - Line, Sample, Pixel dValue = GetMinLineShift(); - pStatsGrp += PvlKeyword("MinLineShift", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinLineShift", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMaxLineShift(); - pStatsGrp += PvlKeyword("MaxLineShift", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxLineShift", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMinSampleShift(); - pStatsGrp += PvlKeyword("MinSampleShift", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinSampleShift", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetMaxSampleShift(); - pStatsGrp += PvlKeyword("MaxSampleShift", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxSampleShift", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = GetAvgPixelShift(); - pStatsGrp += PvlKeyword("AvgPixelShift", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("AvgPixelShift", (dValue == Null ? "NA" : Isis::toString(dValue))); dValue = GetMinPixelShift(); - pStatsGrp += PvlKeyword("MinPixelShift", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MinPixelShift", (dValue == Null ? "NA" : Isis::toString(dValue))); dValue = GetMaxPixelShift(); - pStatsGrp += PvlKeyword("MaxPixelShift", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxPixelShift", (dValue == Null ? "NA" : Isis::toString(dValue))); dValue = mPointDoubleStats[minGFit]; - pStatsGrp += PvlKeyword("MinGoodnessOfFit", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MinGoodnessOfFit", (dValue == Null ? "NA" : Isis::toString(dValue))); dValue = mPointDoubleStats[maxGFit]; - pStatsGrp += PvlKeyword("MaxGoodnessOfFit", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxGoodnessOfFit", (dValue == Null ? "NA" : Isis::toString(dValue))); dValue = mPointDoubleStats[minEccentricity]; - pStatsGrp += PvlKeyword("MinEccentricity", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MinEccentricity", (dValue == Null ? "NA" : Isis::toString(dValue))); dValue = mPointDoubleStats[maxEccentricity]; - pStatsGrp += PvlKeyword("MaxEccentricity", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxEccentricity", (dValue == Null ? "NA" : Isis::toString(dValue))); dValue = mPointDoubleStats[minPixelZScore]; - pStatsGrp += PvlKeyword("MinPixelZScore", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MinPixelZScore", (dValue == Null ? "NA" : Isis::toString(dValue))); dValue = mPointDoubleStats[maxPixelZScore]; - pStatsGrp += PvlKeyword("MaxPixelZScore", (dValue == Null ? "NA" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxPixelZScore", (dValue == Null ? "NA" : Isis::toString(dValue))); // Convex Hull if (mSerialNumList.size()) { dValue = mConvexHullRatioStats.Minimum(); - pStatsGrp += PvlKeyword("MinConvexHullRatio", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MinConvexHullRatio", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = mConvexHullRatioStats.Maximum(); - pStatsGrp += PvlKeyword("MaxConvexHullRatio", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("MaxConvexHullRatio", (dValue == Null ? "Null" : Isis::toString(dValue))); dValue = mConvexHullRatioStats.Average(); - pStatsGrp += PvlKeyword("AvgConvexHullRatio", (dValue == Null ? "Null" : toString(dValue))); + pStatsGrp += PvlKeyword("AvgConvexHullRatio", (dValue == Null ? "Null" : Isis::toString(dValue))); } } diff --git a/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp b/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp index cff59f74e5..ea7c5b7117 100644 --- a/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp +++ b/isis/src/control/objs/ControlNetValidMeasure/ControlNetValidMeasure.cpp @@ -95,25 +95,25 @@ namespace Isis { void ControlNetValidMeasure::InitStdOptionsGroup(void) { mStdOptionsGrp = PvlGroup("StandardOptions"); - mStdOptionsGrp += Isis::PvlKeyword("MinDN", (mdMinDN == Isis::ValidMinimum ? "NA" : toString(mdMinDN))); - mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : toString(mdMaxDN))); - - mStdOptionsGrp += Isis::PvlKeyword("MinEmission", toString(mdMinEmissionAngle)); - mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", toString(mdMaxEmissionAngle)); - mStdOptionsGrp += Isis::PvlKeyword("MinIncidence", toString(mdMinIncidenceAngle)); - mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", toString(mdMaxIncidenceAngle)); - mStdOptionsGrp += Isis::PvlKeyword("MinResolution", toString(mdMinResolution)); - mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : toString(mdSampleResTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("PixelsFromEdge", toString(miPixelsFromEdge)); - mStdOptionsGrp += Isis::PvlKeyword("MetersFromEdge", toString(mdMetersFromEdge)); - - mStdOptionsGrp += Isis::PvlKeyword("SampleResidual", (mdSampleResTolerance == DBL_MAX ? "NA" : toString(mdSampleResTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("LineResidual", (mdLineResTolerance == DBL_MAX ? "NA" : toString(mdLineResTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : toString(mdResidualTolerance))); - - mStdOptionsGrp += Isis::PvlKeyword("SampleShift", (m_sampleShiftTolerance == DBL_MAX ? "NA" : toString(m_sampleShiftTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("LineShift", (m_lineShiftTolerance == DBL_MAX ? "NA" : toString(m_lineShiftTolerance))); - mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : toString(m_pixelShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("MinDN", (mdMinDN == Isis::ValidMinimum ? "NA" : Isis::toString(mdMinDN))); + mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : Isis::toString(mdMaxDN))); + + mStdOptionsGrp += Isis::PvlKeyword("MinEmission", Isis::toString(mdMinEmissionAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", Isis::toString(mdMaxEmissionAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MinIncidence", Isis::toString(mdMinIncidenceAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", Isis::toString(mdMaxIncidenceAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MinResolution", Isis::toString(mdMinResolution)); + mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : Isis::toString(mdSampleResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("PixelsFromEdge", Isis::toString(miPixelsFromEdge)); + mStdOptionsGrp += Isis::PvlKeyword("MetersFromEdge", Isis::toString(mdMetersFromEdge)); + + mStdOptionsGrp += Isis::PvlKeyword("SampleResidual", (mdSampleResTolerance == DBL_MAX ? "NA" : Isis::toString(mdSampleResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("LineResidual", (mdLineResTolerance == DBL_MAX ? "NA" : Isis::toString(mdLineResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : Isis::toString(mdResidualTolerance))); + + mStdOptionsGrp += Isis::PvlKeyword("SampleShift", (m_sampleShiftTolerance == DBL_MAX ? "NA" : Isis::toString(m_sampleShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("LineShift", (m_lineShiftTolerance == DBL_MAX ? "NA" : Isis::toString(m_lineShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : Isis::toString(m_pixelShiftTolerance))); } /** @@ -262,9 +262,9 @@ namespace Isis { if(pMeasureGrp != NULL) { if(mbCameraRequired && (mdEmissionAngle != Null || mdIncidenceAngle != Null || mdResolution != Null)) { - *pMeasureGrp += Isis::PvlKeyword("EmissionAngle", toString(mdEmissionAngle)); - *pMeasureGrp += Isis::PvlKeyword("IncidenceAngle", toString(mdIncidenceAngle)); - *pMeasureGrp += Isis::PvlKeyword("Resolution", toString(mdResolution)); + *pMeasureGrp += Isis::PvlKeyword("EmissionAngle", Isis::toString(mdEmissionAngle)); + *pMeasureGrp += Isis::PvlKeyword("IncidenceAngle", Isis::toString(mdIncidenceAngle)); + *pMeasureGrp += Isis::PvlKeyword("Resolution", Isis::toString(mdResolution)); } else { *pMeasureGrp += Isis::PvlKeyword("EmissionAngle", "Invalid Emission Angle"); @@ -272,15 +272,15 @@ namespace Isis { *pMeasureGrp += Isis::PvlKeyword("Resolution", "Invalid Resolution"); } if(mbValidateDN) { - *pMeasureGrp += Isis::PvlKeyword("DNValue", toString(mdDnValue)); + *pMeasureGrp += Isis::PvlKeyword("DNValue", Isis::toString(mdDnValue)); } - *pMeasureGrp += Isis::PvlKeyword("SampleResidual", toString(mdSampleResidual)); - *pMeasureGrp += Isis::PvlKeyword("LineResidual", toString(mdLineResidual)); - *pMeasureGrp += Isis::PvlKeyword("ResidualMagnitude", toString(mdResidualMagnitude)); + *pMeasureGrp += Isis::PvlKeyword("SampleResidual", Isis::toString(mdSampleResidual)); + *pMeasureGrp += Isis::PvlKeyword("LineResidual", Isis::toString(mdLineResidual)); + *pMeasureGrp += Isis::PvlKeyword("ResidualMagnitude", Isis::toString(mdResidualMagnitude)); - *pMeasureGrp += Isis::PvlKeyword("SampleShift", toString(m_sampleShift)); - *pMeasureGrp += Isis::PvlKeyword("LineShift", toString(m_lineShift)); - *pMeasureGrp += Isis::PvlKeyword("PixelShift", toString(m_pixelShift)); + *pMeasureGrp += Isis::PvlKeyword("SampleShift", Isis::toString(m_sampleShift)); + *pMeasureGrp += Isis::PvlKeyword("LineShift", Isis::toString(m_lineShift)); + *pMeasureGrp += Isis::PvlKeyword("PixelShift", Isis::toString(m_pixelShift)); } MeasureValidationResults results; @@ -401,7 +401,7 @@ namespace Isis { else { mbValidateFromEdge = true; } - mStdOptionsGrp += Isis::PvlKeyword("PixelsFromEdge", toString(miPixelsFromEdge)); + mStdOptionsGrp += Isis::PvlKeyword("PixelsFromEdge", Isis::toString(miPixelsFromEdge)); } // Parse the Meters from edge if(mPvlOpGrp.hasKeyword("MetersFromEdge")) { @@ -412,7 +412,7 @@ namespace Isis { else { mbValidateFromEdge = true; } - mStdOptionsGrp += Isis::PvlKeyword("MetersFromEdge", toString(mdMetersFromEdge)); + mStdOptionsGrp += Isis::PvlKeyword("MetersFromEdge", Isis::toString(mdMetersFromEdge)); } } @@ -431,7 +431,7 @@ namespace Isis { else { mdMinResolution = 0; } - mStdOptionsGrp += Isis::PvlKeyword("MinResolution", toString(mdMinResolution)); + mStdOptionsGrp += Isis::PvlKeyword("MinResolution", Isis::toString(mdMinResolution)); if(mPvlOpGrp.hasKeyword("MaxResolution")){ mdMaxResolution = mPvlOpGrp["MaxResolution"]; @@ -440,7 +440,7 @@ namespace Isis { else { mdMaxResolution = DBL_MAX; } - mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : toString(mdMaxResolution))); + mStdOptionsGrp += Isis::PvlKeyword("MaxResolution", (mdMaxResolution == DBL_MAX ? "NA" : Isis::toString(mdMaxResolution))); if(mdMinResolution < 0 || mdMaxResolution < 0) { std::string msg = "Invalid Resolution value(s), Resolution must be greater than zero"; @@ -469,7 +469,7 @@ namespace Isis { else { mdMinDN = Isis::ValidMinimum; } - mStdOptionsGrp += Isis::PvlKeyword("MinDN", (mdMinDN == Isis::ValidMinimum ? "NA" : toString(mdMinDN))); + mStdOptionsGrp += Isis::PvlKeyword("MinDN", (mdMinDN == Isis::ValidMinimum ? "NA" : Isis::toString(mdMinDN))); if(mPvlOpGrp.hasKeyword("MaxDN")) { mdMaxDN = mPvlOpGrp["MaxDN"]; @@ -478,7 +478,7 @@ namespace Isis { else { mdMaxDN = Isis::ValidMaximum; } - mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : toString(mdMaxDN))); + mStdOptionsGrp += Isis::PvlKeyword("MaxDN", (mdMaxDN == Isis::ValidMaximum ? "NA" : Isis::toString(mdMaxDN))); if(mdMaxDN < mdMinDN) { std::string msg = "MinDN must be less than MaxDN"; @@ -503,7 +503,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } } - mStdOptionsGrp += Isis::PvlKeyword("MinEmission", toString(mdMinEmissionAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MinEmission", Isis::toString(mdMinEmissionAngle)); if(mPvlOpGrp.hasKeyword("MaxEmission")) { mdMaxEmissionAngle = mPvlOpGrp["MaxEmission"]; @@ -513,7 +513,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } } - mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", toString(mdMaxEmissionAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MaxEmission", Isis::toString(mdMaxEmissionAngle)); if(mdMaxEmissionAngle < mdMinEmissionAngle) { std::string msg = "Min EmissionAngle must be less than Max EmissionAngle"; @@ -539,7 +539,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } } - mStdOptionsGrp += Isis::PvlKeyword("MinIncidence", toString(mdMinIncidenceAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MinIncidence", Isis::toString(mdMinIncidenceAngle)); if(mPvlOpGrp.hasKeyword("MaxIncidence")) { mdMaxIncidenceAngle = mPvlOpGrp["MaxIncidence"]; @@ -549,7 +549,7 @@ namespace Isis { throw IException(IException::User, msg, _FILEINFO_); } } - mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", toString(mdMaxIncidenceAngle)); + mStdOptionsGrp += Isis::PvlKeyword("MaxIncidence", Isis::toString(mdMaxIncidenceAngle)); if(mdMaxIncidenceAngle < mdMinIncidenceAngle) { std::string msg = "Min IncidenceAngle must be less than Max IncidenceAngle"; @@ -573,7 +573,7 @@ namespace Isis { } bRes = true; } - mStdOptionsGrp += Isis::PvlKeyword("SampleResidual", (mdSampleResTolerance == DBL_MAX ? "NA" : toString(mdSampleResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("SampleResidual", (mdSampleResTolerance == DBL_MAX ? "NA" : Isis::toString(mdSampleResTolerance))); if(mPvlOpGrp.hasKeyword("LineResidual")) { mdLineResTolerance = mPvlOpGrp["LineResidual"]; @@ -583,7 +583,7 @@ namespace Isis { } bRes = true; } - mStdOptionsGrp += Isis::PvlKeyword("LineResidual", (mdLineResTolerance == DBL_MAX ? "NA" : toString(mdLineResTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("LineResidual", (mdLineResTolerance == DBL_MAX ? "NA" : Isis::toString(mdLineResTolerance))); if(mPvlOpGrp.hasKeyword("ResidualMagnitude")) { mdResidualTolerance = mPvlOpGrp["ResidualMagnitude"]; @@ -593,7 +593,7 @@ namespace Isis { } bResMag = true; } - mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : toString(mdResidualTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("ResidualMagnitude", (mdResidualTolerance == DBL_MAX ? "NA" : Isis::toString(mdResidualTolerance))); if(bRes && bResMag) { std::string msg = "Cannot have both Sample/Line Residuals and Residual Magnitude."; @@ -618,7 +618,7 @@ namespace Isis { } hasSampleLineShift = true; } - mStdOptionsGrp += Isis::PvlKeyword("SampleShift", (m_sampleShiftTolerance == DBL_MAX ? "NA" : toString(m_sampleShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("SampleShift", (m_sampleShiftTolerance == DBL_MAX ? "NA" : Isis::toString(m_sampleShiftTolerance))); if (mPvlOpGrp.hasKeyword("LineShift")) { m_lineShiftTolerance = mPvlOpGrp["LineShift"]; @@ -629,7 +629,7 @@ namespace Isis { } hasSampleLineShift = true; } - mStdOptionsGrp += Isis::PvlKeyword("LineShift", (m_lineShiftTolerance == DBL_MAX ? "NA" : toString(m_lineShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("LineShift", (m_lineShiftTolerance == DBL_MAX ? "NA" : Isis::toString(m_lineShiftTolerance))); bool hasPixelShift = false; if (mPvlOpGrp.hasKeyword("PixelShift")) { @@ -641,7 +641,7 @@ namespace Isis { } hasPixelShift = true; } - mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : toString(m_pixelShiftTolerance))); + mStdOptionsGrp += Isis::PvlKeyword("PixelShift", (m_pixelShiftTolerance == DBL_MAX ? "NA" : Isis::toString(m_pixelShiftTolerance))); if (hasSampleLineShift && hasPixelShift) { std::string msg = "Cannot have both Sample/Line Shift and Pixel Shift"; diff --git a/isis/src/control/objs/ControlNetValidMeasure/unitTest.cpp b/isis/src/control/objs/ControlNetValidMeasure/unitTest.cpp index 595deacf96..e4e8f94fce 100644 --- a/isis/src/control/objs/ControlNetValidMeasure/unitTest.cpp +++ b/isis/src/control/objs/ControlNetValidMeasure/unitTest.cpp @@ -20,17 +20,17 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "StandardDeviation"); - op += PvlKeyword("DeltaLine", toString(100)); - op += PvlKeyword("DeltaSamp", toString(100)); - op += PvlKeyword("Samples", toString(15)); - op += PvlKeyword("Lines", toString(15)); - op += PvlKeyword("MinimumInterest", toString(0.01)); - op += PvlKeyword("MinDN", toString(1.0)); - op += PvlKeyword("MaxDN", toString(-1.0)); - op += PvlKeyword("MinEmission", toString(15.0)); - op += PvlKeyword("MaxEmission", toString(25.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); + op += PvlKeyword("DeltaLine", Isis::toString(100)); + op += PvlKeyword("DeltaSamp", Isis::toString(100)); + op += PvlKeyword("Samples", Isis::toString(15)); + op += PvlKeyword("Lines", Isis::toString(15)); + op += PvlKeyword("MinimumInterest", Isis::toString(0.01)); + op += PvlKeyword("MinDN", Isis::toString(1.0)); + op += PvlKeyword("MaxDN", Isis::toString(-1.0)); + op += PvlKeyword("MinEmission", Isis::toString(15.0)); + op += PvlKeyword("MaxEmission", Isis::toString(25.0)); + op += PvlKeyword("MinIncidence", Isis::toString(0.0)); + op += PvlKeyword("MaxIncidence", Isis::toString(135.0)); pvlLog += op; @@ -45,12 +45,12 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(25.0)); - op += PvlKeyword("MaxEmission", toString(15.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); + op += PvlKeyword("MinDN", Isis::toString(-1.0)); + op += PvlKeyword("MaxDN", Isis::toString(1.0)); + op += PvlKeyword("MinEmission", Isis::toString(25.0)); + op += PvlKeyword("MaxEmission", Isis::toString(15.0)); + op += PvlKeyword("MinIncidence", Isis::toString(0.0)); + op += PvlKeyword("MaxIncidence", Isis::toString(135.0)); pvlLog += op; @@ -65,17 +65,17 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "StandardDeviation"); - op += PvlKeyword("DeltaLine", toString(100)); - op += PvlKeyword("DeltaSamp", toString(100)); - op += PvlKeyword("Samples", toString(15)); - op += PvlKeyword("Lines", toString(15)); - op += PvlKeyword("MinimumInterest", toString(0.01)); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(150.0)); + op += PvlKeyword("DeltaLine", Isis::toString(100)); + op += PvlKeyword("DeltaSamp", Isis::toString(100)); + op += PvlKeyword("Samples", Isis::toString(15)); + op += PvlKeyword("Lines", Isis::toString(15)); + op += PvlKeyword("MinimumInterest", Isis::toString(0.01)); + op += PvlKeyword("MinDN", Isis::toString(-1.0)); + op += PvlKeyword("MaxDN", Isis::toString(1.0)); + op += PvlKeyword("MinEmission", Isis::toString(0.0)); + op += PvlKeyword("MaxEmission", Isis::toString(135.0)); + op += PvlKeyword("MinIncidence", Isis::toString(0.0)); + op += PvlKeyword("MaxIncidence", Isis::toString(150.0)); pvlLog += op; @@ -90,14 +90,14 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); - op += PvlKeyword("MinResolution", toString(100.0)); - op += PvlKeyword("MaxResolution", toString(-1.0)); + op += PvlKeyword("MinDN", Isis::toString(-1.0)); + op += PvlKeyword("MaxDN", Isis::toString(1.0)); + op += PvlKeyword("MinEmission", Isis::toString(0.0)); + op += PvlKeyword("MaxEmission", Isis::toString(135.0)); + op += PvlKeyword("MinIncidence", Isis::toString(0.0)); + op += PvlKeyword("MaxIncidence", Isis::toString(135.0)); + op += PvlKeyword("MinResolution", Isis::toString(100.0)); + op += PvlKeyword("MaxResolution", Isis::toString(-1.0)); pvlLog += op; @@ -112,19 +112,19 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); - op += PvlKeyword("MinResolution", toString(100.0)); - op += PvlKeyword("MaxResolution", toString(500.0)); - op += PvlKeyword("SampleResidual", toString(5.0)); - op += PvlKeyword("LineResidual", toString(5.0)); - op += PvlKeyword("ResidualMagnitude", toString(10.0)); - op += PvlKeyword("SampleShift", toString(5.0)); - op += PvlKeyword("LineShift", toString(5.0)); + op += PvlKeyword("MinDN", Isis::toString(-1.0)); + op += PvlKeyword("MaxDN", Isis::toString(1.0)); + op += PvlKeyword("MinEmission", Isis::toString(0.0)); + op += PvlKeyword("MaxEmission", Isis::toString(135.0)); + op += PvlKeyword("MinIncidence", Isis::toString(0.0)); + op += PvlKeyword("MaxIncidence", Isis::toString(135.0)); + op += PvlKeyword("MinResolution", Isis::toString(100.0)); + op += PvlKeyword("MaxResolution", Isis::toString(500.0)); + op += PvlKeyword("SampleResidual", Isis::toString(5.0)); + op += PvlKeyword("LineResidual", Isis::toString(5.0)); + op += PvlKeyword("ResidualMagnitude", Isis::toString(10.0)); + op += PvlKeyword("SampleShift", Isis::toString(5.0)); + op += PvlKeyword("LineShift", Isis::toString(5.0)); pvlLog += op; @@ -139,19 +139,19 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); - op += PvlKeyword("MinResolution", toString(100.0)); - op += PvlKeyword("MaxResolution", toString(500.0)); - op += PvlKeyword("SampleResidual", toString(5.0)); - op += PvlKeyword("LineResidual", toString(5.0)); - op += PvlKeyword("SampleShift", toString(5.0)); - op += PvlKeyword("LineShift", toString(5.0)); - op += PvlKeyword("PixelShift", toString(10.0)); + op += PvlKeyword("MinDN", Isis::toString(-1.0)); + op += PvlKeyword("MaxDN", Isis::toString(1.0)); + op += PvlKeyword("MinEmission", Isis::toString(0.0)); + op += PvlKeyword("MaxEmission", Isis::toString(135.0)); + op += PvlKeyword("MinIncidence", Isis::toString(0.0)); + op += PvlKeyword("MaxIncidence", Isis::toString(135.0)); + op += PvlKeyword("MinResolution", Isis::toString(100.0)); + op += PvlKeyword("MaxResolution", Isis::toString(500.0)); + op += PvlKeyword("SampleResidual", Isis::toString(5.0)); + op += PvlKeyword("LineResidual", Isis::toString(5.0)); + op += PvlKeyword("SampleShift", Isis::toString(5.0)); + op += PvlKeyword("LineShift", Isis::toString(5.0)); + op += PvlKeyword("PixelShift", Isis::toString(10.0)); pvlLog += op; @@ -166,18 +166,18 @@ int main(void) { Pvl pvlLog; PvlGroup op("ValidMeasure"); op += PvlKeyword("Name", "None"); - op += PvlKeyword("MinDN", toString(-1.0)); - op += PvlKeyword("MaxDN", toString(1.0)); - op += PvlKeyword("MinEmission", toString(0.0)); - op += PvlKeyword("MaxEmission", toString(135.0)); - op += PvlKeyword("MinIncidence", toString(0.0)); - op += PvlKeyword("MaxIncidence", toString(135.0)); - op += PvlKeyword("MinResolution", toString(100.0)); - op += PvlKeyword("MaxResolution", toString(500.0)); - op += PvlKeyword("SampleResidual", toString(5.0)); - op += PvlKeyword("LineResidual", toString(5.0)); - op += PvlKeyword("SampleShift", toString(5.0)); - op += PvlKeyword("LineShift", toString(5.0)); + op += PvlKeyword("MinDN", Isis::toString(-1.0)); + op += PvlKeyword("MaxDN", Isis::toString(1.0)); + op += PvlKeyword("MinEmission", Isis::toString(0.0)); + op += PvlKeyword("MaxEmission", Isis::toString(135.0)); + op += PvlKeyword("MinIncidence", Isis::toString(0.0)); + op += PvlKeyword("MaxIncidence", Isis::toString(135.0)); + op += PvlKeyword("MinResolution", Isis::toString(100.0)); + op += PvlKeyword("MaxResolution", Isis::toString(500.0)); + op += PvlKeyword("SampleResidual", Isis::toString(5.0)); + op += PvlKeyword("LineResidual", Isis::toString(5.0)); + op += PvlKeyword("SampleShift", Isis::toString(5.0)); + op += PvlKeyword("LineShift", Isis::toString(5.0)); pvlLog += op; diff --git a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp index 8bbe90954a..1543fe2357 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp @@ -305,19 +305,19 @@ namespace Isis { // add surface point x/y/z, convert to lat,lon,radius and output as comment SurfacePoint aprioriSurfacePoint = controlPoint->GetAprioriSurfacePoint(); if ( aprioriSurfacePoint.Valid() ) { - PvlKeyword aprioriX("AprioriX", toString(aprioriSurfacePoint.GetX().meters()), "meters"); - PvlKeyword aprioriY("AprioriY", toString(aprioriSurfacePoint.GetY().meters()), "meters"); - PvlKeyword aprioriZ("AprioriZ", toString(aprioriSurfacePoint.GetZ().meters()), "meters"); + PvlKeyword aprioriX("AprioriX", Isis::toString(aprioriSurfacePoint.GetX().meters()), "meters"); + PvlKeyword aprioriY("AprioriY", Isis::toString(aprioriSurfacePoint.GetY().meters()), "meters"); + PvlKeyword aprioriZ("AprioriZ", Isis::toString(aprioriSurfacePoint.GetZ().meters()), "meters"); aprioriX.addComment("AprioriLatitude = " - + toString(aprioriSurfacePoint.GetLatitude().degrees()) + + Isis::toString(aprioriSurfacePoint.GetLatitude().degrees()) + " "); aprioriY.addComment("AprioriLongitude = " - + toString(aprioriSurfacePoint.GetLongitude().degrees()) + + Isis::toString(aprioriSurfacePoint.GetLongitude().degrees()) + " "); aprioriZ.addComment("AprioriRadius = " - + toString(aprioriSurfacePoint.GetLocalRadius().meters()) + + Isis::toString(aprioriSurfacePoint.GetLocalRadius().meters()) + " "); pvlPoint += aprioriX; @@ -331,12 +331,12 @@ namespace Isis { // Matrix units are meters squared PvlKeyword matrix("AprioriCovarianceMatrix"); - matrix += toString(aprioriCovarianceMatrix(0, 0)); - matrix += toString(aprioriCovarianceMatrix(0, 1)); - matrix += toString(aprioriCovarianceMatrix(0, 2)); - matrix += toString(aprioriCovarianceMatrix(1, 1)); - matrix += toString(aprioriCovarianceMatrix(1, 2)); - matrix += toString(aprioriCovarianceMatrix(2, 2)); + matrix += Isis::toString(aprioriCovarianceMatrix(0, 0)); + matrix += Isis::toString(aprioriCovarianceMatrix(0, 1)); + matrix += Isis::toString(aprioriCovarianceMatrix(0, 2)); + matrix += Isis::toString(aprioriCovarianceMatrix(1, 1)); + matrix += Isis::toString(aprioriCovarianceMatrix(1, 2)); + matrix += Isis::toString(aprioriCovarianceMatrix(2, 2)); // *** TODO *** What do we do in the case of bundled in rectangular coordinates? // For now we do nothing. @@ -385,20 +385,20 @@ namespace Isis { SurfacePoint adjustedSurfacePoint = controlPoint->GetAdjustedSurfacePoint(); if ( adjustedSurfacePoint.Valid() ) { PvlKeyword adjustedX("AdjustedX", - toString(adjustedSurfacePoint.GetX().meters()), "meters"); + Isis::toString(adjustedSurfacePoint.GetX().meters()), "meters"); PvlKeyword adjustedY("AdjustedY", - toString(adjustedSurfacePoint.GetY().meters()), "meters"); + Isis::toString(adjustedSurfacePoint.GetY().meters()), "meters"); PvlKeyword adjustedZ("AdjustedZ", - toString(adjustedSurfacePoint.GetZ().meters()), "meters"); + Isis::toString(adjustedSurfacePoint.GetZ().meters()), "meters"); adjustedX.addComment("AdjustedLatitude = " - + toString(adjustedSurfacePoint.GetLatitude().degrees()) + + Isis::toString(adjustedSurfacePoint.GetLatitude().degrees()) + " "); adjustedY.addComment("AdjustedLongitude = " - + toString(adjustedSurfacePoint.GetLongitude().degrees()) + + Isis::toString(adjustedSurfacePoint.GetLongitude().degrees()) + " "); adjustedZ.addComment("AdjustedRadius = " - + toString(adjustedSurfacePoint.GetLocalRadius().meters()) + + Isis::toString(adjustedSurfacePoint.GetLocalRadius().meters()) + " "); pvlPoint += adjustedX; @@ -411,12 +411,12 @@ namespace Isis { if ( adjustedCovarianceMatrix.size1() > 0 ) { PvlKeyword matrix("AdjustedCovarianceMatrix"); - matrix += toString(adjustedCovarianceMatrix(0, 0)); - matrix += toString(adjustedCovarianceMatrix(0, 1)); - matrix += toString(adjustedCovarianceMatrix(0, 2)); - matrix += toString(adjustedCovarianceMatrix(1, 1)); - matrix += toString(adjustedCovarianceMatrix(1, 2)); - matrix += toString(adjustedCovarianceMatrix(2, 2)); + matrix += Isis::toString(adjustedCovarianceMatrix(0, 0)); + matrix += Isis::toString(adjustedCovarianceMatrix(0, 1)); + matrix += Isis::toString(adjustedCovarianceMatrix(0, 2)); + matrix += Isis::toString(adjustedCovarianceMatrix(1, 1)); + matrix += Isis::toString(adjustedCovarianceMatrix(1, 2)); + matrix += Isis::toString(adjustedCovarianceMatrix(2, 2)); if ( adjustedSurfacePoint.GetLatSigmaDistance().meters() != Isis::Null && adjustedSurfacePoint.GetLonSigmaDistance().meters() != Isis::Null @@ -480,50 +480,50 @@ namespace Isis { } if ( controlMeasure.GetSample() != Isis::Null) { - pvlMeasure += PvlKeyword("Sample", toString(controlMeasure.GetSample())); + pvlMeasure += PvlKeyword("Sample", Isis::toString(controlMeasure.GetSample())); } if ( controlMeasure.GetLine() != Isis::Null ) { - pvlMeasure += PvlKeyword("Line", toString(controlMeasure.GetLine())); + pvlMeasure += PvlKeyword("Line", Isis::toString(controlMeasure.GetLine())); } if ( controlMeasure.GetDiameter() != Isis::Null && controlMeasure.GetDiameter() != 0. ) { - pvlMeasure += PvlKeyword("Diameter", toString(controlMeasure.GetDiameter())); + pvlMeasure += PvlKeyword("Diameter", Isis::toString(controlMeasure.GetDiameter())); } if ( controlMeasure.GetAprioriSample() != Isis::Null ) { - pvlMeasure += PvlKeyword("AprioriSample", toString(controlMeasure.GetAprioriSample())); + pvlMeasure += PvlKeyword("AprioriSample", Isis::toString(controlMeasure.GetAprioriSample())); } if ( controlMeasure.GetAprioriLine() != Isis::Null ) { - pvlMeasure += PvlKeyword("AprioriLine", toString(controlMeasure.GetAprioriLine())); + pvlMeasure += PvlKeyword("AprioriLine", Isis::toString(controlMeasure.GetAprioriLine())); } if ( controlMeasure.GetSampleSigma() != Isis::Null ) { - pvlMeasure += PvlKeyword("SampleSigma", toString(controlMeasure.GetSampleSigma()), + pvlMeasure += PvlKeyword("SampleSigma", Isis::toString(controlMeasure.GetSampleSigma()), "pixels"); } if ( controlMeasure.GetLineSigma() != Isis::Null ) { - pvlMeasure += PvlKeyword("LineSigma", toString(controlMeasure.GetLineSigma()), + pvlMeasure += PvlKeyword("LineSigma", Isis::toString(controlMeasure.GetLineSigma()), "pixels"); } if ( controlMeasure.GetSampleResidual() != Isis::Null ) { pvlMeasure += PvlKeyword("SampleResidual", - toString(controlMeasure.GetSampleResidual()), + Isis::toString(controlMeasure.GetSampleResidual()), "pixels"); } if ( controlMeasure.GetLineResidual() != Isis::Null ) { - pvlMeasure += PvlKeyword("LineResidual", toString(controlMeasure.GetLineResidual()), + pvlMeasure += PvlKeyword("LineResidual", Isis::toString(controlMeasure.GetLineResidual()), "pixels"); } if ( controlMeasure.IsRejected() ) { - pvlMeasure += PvlKeyword("JigsawRejected", toString(controlMeasure.IsRejected())); + pvlMeasure += PvlKeyword("JigsawRejected", Isis::toString(controlMeasure.IsRejected())); } foreach (ControlMeasureLogData log, controlMeasure.GetLogDataEntries()) { @@ -587,7 +587,7 @@ namespace Isis { int version = 1; if ( controlNetwork.hasKeyword("Version") ) { - version = IString::ToInteger(controlNetwork["Version"][0]); + version = Isis::toInt(controlNetwork["Version"][0]); } switch ( version ) { @@ -607,7 +607,7 @@ namespace Isis { readPvlV0005(controlNetwork, progress); break; default: - std::string msg = "The Pvl file version [" + toString(version) + std::string msg = "The Pvl file version [" + Isis::toString(version) + "] is not supported"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -660,7 +660,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + + Isis::toString(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -711,7 +711,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + + Isis::toString(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -761,7 +761,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + + Isis::toString(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -810,7 +810,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + + Isis::toString(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -859,7 +859,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Failed to initialize control point at index [" - + toString(objectIndex) + "]."; + + Isis::toString(objectIndex) + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -883,7 +883,7 @@ namespace Isis { const PvlGroup &netInfo = protoBuf.findGroup("ControlNetworkInfo"); if ( netInfo.hasKeyword("Version") ) { - version = IString::ToInteger(netInfo["Version"][0]); + version = Isis::toInt(netInfo["Version"][0]); } switch ( version ) { case 1: @@ -896,7 +896,7 @@ namespace Isis { readProtobufV0005(header, netFile, progress); break; default: - std::string msg = "The Protobuf file version [" + toString(version) + std::string msg = "The Protobuf file version [" + Isis::toString(version) + "] is not supported"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1019,7 +1019,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Failed to convert version 1 protobuf control point at index [" - + toString(i) + "] into a ControlPoint."; + + Isis::toString(i) + "] into a ControlPoint."; throw IException(e, IException::User, msg, _FILEINFO_); } } @@ -1121,7 +1121,7 @@ namespace Isis { } catch (...) { std::string msg = "Failed to read protobuf version 2 control point at index [" - + toString(pointIndex) + "]."; + + Isis::toString(pointIndex) + "]."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1136,7 +1136,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Failed to convert protobuf version 2 control point at index [" - + toString(pointIndex) + "] into a ControlPoint."; + + Isis::toString(pointIndex) + "] into a ControlPoint."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -1270,7 +1270,7 @@ namespace Isis { } catch (...) { std::string msg = "Failed to read protobuf version 2 control point at index [" - + toString(pointIndex) + "]."; + + Isis::toString(pointIndex) + "]."; throw IException(IException::Io, msg, _FILEINFO_); } @@ -1285,7 +1285,7 @@ namespace Isis { } catch (IException &e) { std::string msg = "Failed to convert protobuf version 2 control point at index [" - + toString(pointIndex) + "] into a ControlPoint."; + + Isis::toString(pointIndex) + "] into a ControlPoint."; throw IException(e, IException::Io, msg, _FILEINFO_); } } @@ -1367,7 +1367,7 @@ namespace Isis { break; default: std::string msg = "Unable to create ControlPoint [" + protoPoint.id() - + "] from file. Type enumeration [" + toString((int)(protoPoint.type())) + + "] from file. Type enumeration [" + Isis::toString((int)(protoPoint.type())) + "] is invalid."; throw IException(IException::Programmer, msg, _FILEINFO_); break; @@ -1697,15 +1697,15 @@ namespace Isis { PvlObject protoCore("Core"); protoCore.addKeyword(PvlKeyword("HeaderStartByte", - toString(((BigInt) startCoreHeaderPos)))); - protoCore.addKeyword(PvlKeyword("HeaderBytes", toString(((BigInt) coreHeaderSize)))); + Isis::toString(((BigInt) startCoreHeaderPos)))); + protoCore.addKeyword(PvlKeyword("HeaderBytes", Isis::toString(((BigInt) coreHeaderSize)))); BigInt pointsStartByte = (BigInt) (startCoreHeaderPos + coreHeaderSize); - protoCore.addKeyword(PvlKeyword("PointsStartByte", toString((pointsStartByte)))); + protoCore.addKeyword(PvlKeyword("PointsStartByte", Isis::toString((pointsStartByte)))); protoCore.addKeyword(PvlKeyword("PointsBytes", - toString(pointByteTotal))); + Isis::toString(pointByteTotal))); protoObj.addObject(protoCore); PvlGroup netInfo("ControlNetworkInfo"); @@ -1716,8 +1716,8 @@ namespace Isis { netInfo += PvlKeyword("Created", protobufHeader.created()); netInfo += PvlKeyword("LastModified", protobufHeader.lastmodified()); netInfo += PvlKeyword("Description", protobufHeader.description()); - netInfo += PvlKeyword("NumberOfPoints", toString(numPoints)); - netInfo += PvlKeyword("NumberOfMeasures", toString(numMeasures)); + netInfo += PvlKeyword("NumberOfPoints", Isis::toString(numPoints)); + netInfo += PvlKeyword("NumberOfMeasures", Isis::toString(numMeasures)); netInfo += PvlKeyword("Version", "5"); protoObj.addGroup(netInfo); diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp index 235ee98c6d..b2bf24277b 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp @@ -87,9 +87,9 @@ namespace Isis { && pointObject.hasKeyword("Longitude") && pointObject.hasKeyword("Radius") ) { SurfacePoint adjustedPoint( - Latitude(IString::ToDouble(pointObject["Latitude"][0]), Angle::Degrees), - Longitude(IString::ToDouble(pointObject["Longitude"][0]), Angle::Degrees), - Distance(IString::ToDouble(pointObject["Radius"][0]), Distance::Meters)); + Latitude(Isis::toDouble(pointObject["Latitude"][0]), Angle::Degrees), + Longitude(Isis::toDouble(pointObject["Longitude"][0]), Angle::Degrees), + Distance(Isis::toDouble(pointObject["Radius"][0]), Distance::Meters)); m_pointData->set_adjustedx( adjustedPoint.GetX().meters() ); m_pointData->set_adjustedy( adjustedPoint.GetY().meters() ); @@ -98,9 +98,9 @@ namespace Isis { else if ( pointObject.hasKeyword("X") && pointObject.hasKeyword("Y") && pointObject.hasKeyword("Z") ) { - m_pointData->set_adjustedx( IString::ToDouble(pointObject["X"][0]) ); - m_pointData->set_adjustedy( IString::ToDouble(pointObject["Y"][0]) ); - m_pointData->set_adjustedz( IString::ToDouble(pointObject["Z"][0]) ); + m_pointData->set_adjustedx( Isis::toDouble(pointObject["X"][0]) ); + m_pointData->set_adjustedy( Isis::toDouble(pointObject["Y"][0]) ); + m_pointData->set_adjustedz( Isis::toDouble(pointObject["Z"][0]) ); } // copy over the apriori surface point @@ -108,9 +108,9 @@ namespace Isis { && pointObject.hasKeyword("AprioriLongitude") && pointObject.hasKeyword("AprioriRadius") ) { SurfacePoint aprioriPoint( - Latitude(IString::ToDouble(pointObject["AprioriLatitude"][0]), Angle::Degrees), - Longitude(IString::ToDouble(pointObject["AprioriLongitude"][0]), Angle::Degrees), - Distance(IString::ToDouble(pointObject["AprioriRadius"][0]), Distance::Meters)); + Latitude(Isis::toDouble(pointObject["AprioriLatitude"][0]), Angle::Degrees), + Longitude(Isis::toDouble(pointObject["AprioriLongitude"][0]), Angle::Degrees), + Distance(Isis::toDouble(pointObject["AprioriRadius"][0]), Distance::Meters)); m_pointData->set_apriorix( aprioriPoint.GetX().meters() ); m_pointData->set_aprioriy( aprioriPoint.GetY().meters() ); @@ -119,9 +119,9 @@ namespace Isis { else if ( pointObject.hasKeyword("AprioriX") && pointObject.hasKeyword("AprioriY") && pointObject.hasKeyword("AprioriZ") ) { - m_pointData->set_apriorix( IString::ToDouble(pointObject["AprioriX"][0]) ); - m_pointData->set_aprioriy( IString::ToDouble(pointObject["AprioriY"][0]) ); - m_pointData->set_aprioriz( IString::ToDouble(pointObject["AprioriZ"][0]) ); + m_pointData->set_apriorix( Isis::toDouble(pointObject["AprioriX"][0]) ); + m_pointData->set_aprioriy( Isis::toDouble(pointObject["AprioriY"][0]) ); + m_pointData->set_aprioriz( Isis::toDouble(pointObject["AprioriZ"][0]) ); } // If the apriori values are missing, copy them from the adjusted. else if ( m_pointData->has_adjustedx() @@ -242,12 +242,12 @@ namespace Isis { if ( pointObject.hasKeyword("AprioriCovarianceMatrix") ) { PvlKeyword &matrix = pointObject["AprioriCovarianceMatrix"]; - m_pointData->add_aprioricovar(IString::ToDouble(matrix[0])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[1])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[2])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[3])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[4])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[5])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[0])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[1])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[2])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[3])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[4])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[5])); m_pointData->set_latitudeconstrained(true); m_pointData->set_longitudeconstrained(true); @@ -262,25 +262,25 @@ namespace Isis { double sigmaRad = 10000.0; if ( pointObject.hasKeyword("AprioriSigmaLatitude") ) { - if (IString::ToDouble(pointObject["AprioriSigmaLatitude"][0]) > 0 - && IString::ToDouble(pointObject["AprioriSigmaLatitude"][0]) < sigmaLat) { - sigmaLat = IString::ToDouble(pointObject["AprioriSigmaLatitude"][0]); + if (Isis::toDouble(pointObject["AprioriSigmaLatitude"][0]) > 0 + && Isis::toDouble(pointObject["AprioriSigmaLatitude"][0]) < sigmaLat) { + sigmaLat = Isis::toDouble(pointObject["AprioriSigmaLatitude"][0]); } m_pointData->set_latitudeconstrained(true); } if ( pointObject.hasKeyword("AprioriSigmaLongitude") ) { - if (IString::ToDouble(pointObject["AprioriSigmaLongitude"][0]) > 0 - && IString::ToDouble(pointObject["AprioriSigmaLongitude"][0]) < sigmaLon) { - sigmaLon = IString::ToDouble(pointObject["AprioriSigmaLongitude"][0]); + if (Isis::toDouble(pointObject["AprioriSigmaLongitude"][0]) > 0 + && Isis::toDouble(pointObject["AprioriSigmaLongitude"][0]) < sigmaLon) { + sigmaLon = Isis::toDouble(pointObject["AprioriSigmaLongitude"][0]); } m_pointData->set_longitudeconstrained(true); } if ( pointObject.hasKeyword("AprioriSigmaRadius") ) { - if (IString::ToDouble(pointObject["AprioriSigmaRadius"][0]) > 0 - && IString::ToDouble(pointObject["AprioriSigmaRadius"][0]) < sigmaRad) { - sigmaRad = IString::ToDouble(pointObject["AprioriSigmaRadius"][0]); + if (Isis::toDouble(pointObject["AprioriSigmaRadius"][0]) > 0 + && Isis::toDouble(pointObject["AprioriSigmaRadius"][0]) < sigmaRad) { + sigmaRad = Isis::toDouble(pointObject["AprioriSigmaRadius"][0]); } m_pointData->set_radiusconstrained(true); } @@ -304,12 +304,12 @@ namespace Isis { if ( pointObject.hasKeyword("ApostCovarianceMatrix") ) { PvlKeyword &matrix = pointObject["ApostCovarianceMatrix"]; - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[0])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[1])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[2])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[3])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[4])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[5])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[0])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[1])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[2])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[3])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[4])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[5])); m_pointData->set_latitudeconstrained(true); m_pointData->set_longitudeconstrained(true); @@ -324,23 +324,23 @@ namespace Isis { double sigmaRad = 10000.0; if ( pointObject.hasKeyword("AdjustedSigmaLatitude") ) { - if (IString::ToDouble(pointObject["AdjustedSigmaLatitude"][0]) > 0 - && IString::ToDouble(pointObject["AdjustedSigmaLatitude"][0]) < sigmaLat) { - sigmaLat = IString::ToDouble(pointObject["AdjustedSigmaLatitude"][0]); + if (Isis::toDouble(pointObject["AdjustedSigmaLatitude"][0]) > 0 + && Isis::toDouble(pointObject["AdjustedSigmaLatitude"][0]) < sigmaLat) { + sigmaLat = Isis::toDouble(pointObject["AdjustedSigmaLatitude"][0]); } } if ( pointObject.hasKeyword("AdjustedSigmaLongitude") ) { - if (IString::ToDouble(pointObject["AdjustedSigmaLongitude"][0]) > 0 - && IString::ToDouble(pointObject["AdjustedSigmaLongitude"][0]) < sigmaLon) { - sigmaLon = IString::ToDouble(pointObject["AdjustedSigmaLongitude"][0]); + if (Isis::toDouble(pointObject["AdjustedSigmaLongitude"][0]) > 0 + && Isis::toDouble(pointObject["AdjustedSigmaLongitude"][0]) < sigmaLon) { + sigmaLon = Isis::toDouble(pointObject["AdjustedSigmaLongitude"][0]); } } if ( pointObject.hasKeyword("AdjustedSigmaRadius") ) { - if (IString::ToDouble(pointObject["AdjustedSigmaRadius"][0]) > 0 - && IString::ToDouble(pointObject["AdjustedSigmaRadius"][0]) < sigmaRad) { - sigmaRad = IString::ToDouble(pointObject["AdjustedSigmaRadius"][0]); + if (Isis::toDouble(pointObject["AdjustedSigmaRadius"][0]) > 0 + && Isis::toDouble(pointObject["AdjustedSigmaRadius"][0]) < sigmaRad) { + sigmaRad = Isis::toDouble(pointObject["AdjustedSigmaRadius"][0]); } } @@ -395,7 +395,7 @@ namespace Isis { // in this case set it to 0 and ignore the measure double value; try { - value = IString::ToDouble(group["Sample"][0]); + value = Isis::toDouble(group["Sample"][0]); } catch (...) { value = 0; @@ -409,7 +409,7 @@ namespace Isis { // in this case set it to 0 and ignore the measure double value; try { - value = IString::ToDouble(group["Line"][0]); + value = Isis::toDouble(group["Line"][0]); } catch (...) { value = 0; @@ -422,24 +422,24 @@ namespace Isis { // Some old networks use ErrorSample and ErrorLine, // others use SampleResidual and LineResidual so check for both if (group.hasKeyword("ErrorSample")) { - double value = IString::ToDouble(group["ErrorSample"][0]); + double value = Isis::toDouble(group["ErrorSample"][0]); measure.mutable_measurement()->set_sampleresidual(value); group.deleteKeyword("ErrorSample"); } if (group.hasKeyword("ErrorLine")) { - double value = IString::ToDouble(group["ErrorLine"][0]); + double value = Isis::toDouble(group["ErrorLine"][0]); measure.mutable_measurement()->set_lineresidual(value); group.deleteKeyword("ErrorLine"); } if (group.hasKeyword("SampleResidual")) { - double value = IString::ToDouble(group["SampleResidual"][0]); + double value = Isis::toDouble(group["SampleResidual"][0]); measure.mutable_measurement()->set_sampleresidual(value); group.deleteKeyword("SampleResidual"); } if (group.hasKeyword("LineResidual")) { - double value = IString::ToDouble(group["LineResidual"][0]); + double value = Isis::toDouble(group["LineResidual"][0]); measure.mutable_measurement()->set_lineresidual(value); group.deleteKeyword("LineResidual"); } @@ -528,7 +528,7 @@ namespace Isis { } try { - value = IString::ToDouble(dataKeyword[0]); + value = Isis::toDouble(dataKeyword[0]); } catch (IException &e) { std::string msg = "Invalid control measure log data value [" + dataKeyword[0] + "]"; @@ -633,7 +633,7 @@ namespace Isis { return; } - double value = IString::ToDouble(container[keyName.toStdString()][0]); + double value = Isis::toDouble(container[keyName.toStdString()][0]); container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value); } @@ -726,7 +726,7 @@ namespace Isis { double value = Isis::Null; if ( container.hasKeyword(keyName.toStdString()) ) { - value = IString::ToDouble(container[keyName.toStdString()][0]); + value = Isis::toDouble(container[keyName.toStdString()][0]); container.deleteKeyword(keyName.toStdString()); } diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp index 4e0e27e554..f92b030799 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0002.cpp @@ -154,23 +154,23 @@ namespace Isis { if (pointObject.hasKeyword("AprioriCovarianceMatrix")) { PvlKeyword &matrix = pointObject["AprioriCovarianceMatrix"]; - m_pointData->add_aprioricovar(IString::ToDouble(matrix[0])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[1])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[2])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[3])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[4])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[5])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[0])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[1])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[2])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[3])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[4])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[5])); } if (pointObject.hasKeyword("AdjustedCovarianceMatrix")) { PvlKeyword &matrix = pointObject["AdjustedCovarianceMatrix"]; - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[0])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[1])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[2])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[3])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[4])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[5])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[0])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[1])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[2])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[3])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[4])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[5])); } // Process Measures @@ -205,22 +205,22 @@ namespace Isis { // The sample, line, sample residual, and line residual are nested in another structure // inside the measure, so they cannot be copied with the conenience methods. if (group.hasKeyword("Sample")) { - double value = IString::ToDouble(group["Sample"][0]); + double value = Isis::toDouble(group["Sample"][0]); measure.mutable_measurement()->set_sample(value); group.deleteKeyword("Sample"); } if (group.hasKeyword("Line")) { - double value = IString::ToDouble(group["Line"][0]); + double value = Isis::toDouble(group["Line"][0]); measure.mutable_measurement()->set_line(value); group.deleteKeyword("Line"); } if (group.hasKeyword("SampleResidual")) { - double value = IString::ToDouble(group["SampleResidual"][0]); + double value = Isis::toDouble(group["SampleResidual"][0]); measure.mutable_measurement()->set_sampleresidual(value); group.deleteKeyword("SampleResidual"); } if (group.hasKeyword("LineResidual")) { - double value = IString::ToDouble(group["LineResidual"][0]); + double value = Isis::toDouble(group["LineResidual"][0]); measure.mutable_measurement()->set_lineresidual(value); group.deleteKeyword("LineResidual"); } @@ -302,7 +302,7 @@ namespace Isis { } try { - value = IString::ToDouble(dataKeyword[0]); + value = Isis::toDouble(dataKeyword[0]); } catch (IException &e) { std::string msg = "Invalid control measure log data value [" + dataKeyword[0] + "]"; @@ -422,7 +422,7 @@ namespace Isis { return; } - double value = IString::ToDouble(container[keyName.toStdString()][0]); + double value = Isis::toDouble(container[keyName.toStdString()][0]); container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value); } @@ -513,7 +513,7 @@ namespace Isis { return; } - double value = IString::ToDouble(container[keyName.toStdString()][0]); + double value = Isis::toDouble(container[keyName.toStdString()][0]); container.deleteKeyword(keyName.toStdString()); (measure.*setter)(value); } diff --git a/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp b/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp index f13336d5a6..47171ce304 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlPointV0003.cpp @@ -157,23 +157,23 @@ namespace Isis { if (pointObject.hasKeyword("AprioriCovarianceMatrix")) { PvlKeyword &matrix = pointObject["AprioriCovarianceMatrix"]; - m_pointData->add_aprioricovar(IString::ToDouble(matrix[0])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[1])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[2])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[3])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[4])); - m_pointData->add_aprioricovar(IString::ToDouble(matrix[5])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[0])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[1])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[2])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[3])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[4])); + m_pointData->add_aprioricovar(Isis::toDouble(matrix[5])); } if (pointObject.hasKeyword("AdjustedCovarianceMatrix")) { PvlKeyword &matrix = pointObject["AdjustedCovarianceMatrix"]; - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[0])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[1])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[2])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[3])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[4])); - m_pointData->add_adjustedcovar(IString::ToDouble(matrix[5])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[0])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[1])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[2])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[3])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[4])); + m_pointData->add_adjustedcovar(Isis::toDouble(matrix[5])); } // Process Measures @@ -623,7 +623,7 @@ namespace Isis { return; } - double value = IString::ToDouble(container[keyName.toStdString()][0]); + double value = Isis::toDouble(container[keyName.toStdString()][0]); container.deleteKeyword(keyName.toStdString()); (point.data()->*setter)(value); } @@ -714,7 +714,7 @@ namespace Isis { return; } - double value = IString::ToDouble(container[keyName.toStdString()][0]); + double value = Isis::toDouble(container[keyName.toStdString()][0]); container.deleteKeyword(keyName.toStdString()); (measure.*setter)(value); } diff --git a/isis/src/control/objs/ControlPoint/ControlPoint.cpp b/isis/src/control/objs/ControlPoint/ControlPoint.cpp index 2af76fb775..0a05ee26ee 100644 --- a/isis/src/control/objs/ControlPoint/ControlPoint.cpp +++ b/isis/src/control/objs/ControlPoint/ControlPoint.cpp @@ -362,7 +362,7 @@ namespace Isis { */ int ControlPoint::Delete(int index) { if (index < 0 || index >= cubeSerials->size()) { - std::string msg = "index [" + toString(index) + "] out of bounds"; + std::string msg = "index [" + Isis::toString(index) + "] out of bounds"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -704,7 +704,7 @@ namespace Isis { */ ControlPoint::Status ControlPoint::SetType(PointType newType) { if (type != Fixed && type != Free && type != Constrained) { - std::string msg = "Invalid Point Enumeration, [" + toString(type) + "], for " + std::string msg = "Invalid Point Enumeration, [" + Isis::toString(type) + "], for " "Control Point [" + GetId().toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/control/objs/ControlPointList/ControlPointList.cpp b/isis/src/control/objs/ControlPointList/ControlPointList.cpp index 3fdd24f8b1..e532fec497 100644 --- a/isis/src/control/objs/ControlPointList/ControlPointList.cpp +++ b/isis/src/control/objs/ControlPointList/ControlPointList.cpp @@ -136,9 +136,9 @@ namespace Isis { } } - pcPvlLog += Isis::PvlKeyword("TotalPoints", toString(size)); - pcPvlLog += Isis::PvlKeyword("ValidPoints", toString(size - iNotFound)); - pcPvlLog += Isis::PvlKeyword("InvalidPoints", toString(iNotFound)); + pcPvlLog += Isis::PvlKeyword("TotalPoints", Isis::toString(size)); + pcPvlLog += Isis::PvlKeyword("ValidPoints", Isis::toString(size - iNotFound)); + pcPvlLog += Isis::PvlKeyword("InvalidPoints", Isis::toString(iNotFound)); pcPvlLog += Isis::PvlKeyword("InvalidPointIds", sPointsNotFound.toStdString()); } } diff --git a/isis/src/control/objs/InterestOperator/InterestOperator.cpp b/isis/src/control/objs/InterestOperator/InterestOperator.cpp index 7b97ebdb17..a04ec9b643 100644 --- a/isis/src/control/objs/InterestOperator/InterestOperator.cpp +++ b/isis/src/control/objs/InterestOperator/InterestOperator.cpp @@ -97,19 +97,19 @@ namespace Isis { mOperatorGrp += Isis::PvlKeyword(op["Name"]); p_samples = op["Samples"]; - mOperatorGrp += Isis::PvlKeyword("Samples", toString(p_samples)); + mOperatorGrp += Isis::PvlKeyword("Samples", Isis::toString(p_samples)); p_lines = op["Lines"]; - mOperatorGrp += Isis::PvlKeyword("Lines", toString(p_lines)); + mOperatorGrp += Isis::PvlKeyword("Lines", Isis::toString(p_lines)); p_deltaLine = op["DeltaLine"]; - mOperatorGrp += Isis::PvlKeyword("DeltaLine", toString(p_deltaLine)); + mOperatorGrp += Isis::PvlKeyword("DeltaLine", Isis::toString(p_deltaLine)); p_deltaSamp = op["DeltaSamp"]; - mOperatorGrp += Isis::PvlKeyword("DeltaSamp", toString(p_deltaSamp)); + mOperatorGrp += Isis::PvlKeyword("DeltaSamp", Isis::toString(p_deltaSamp)); p_minimumInterest = op["MinimumInterest"]; - mOperatorGrp += Isis::PvlKeyword("MinimumInterest", toString(p_minimumInterest)); + mOperatorGrp += Isis::PvlKeyword("MinimumInterest", Isis::toString(p_minimumInterest)); } catch (IException &e) { @@ -497,8 +497,8 @@ namespace Isis { pvlMeasureGrp += Isis::PvlKeyword("NewLocation", LocationString(mtInterestResults[measure].mdBestSample, mtInterestResults[measure].mdBestLine).toStdString()); - pvlMeasureGrp += Isis::PvlKeyword("DeltaSample", toString(mtInterestResults[measure].miDeltaSample)); - pvlMeasureGrp += Isis::PvlKeyword("DeltaLine", toString(mtInterestResults[measure].miDeltaLine)); + pvlMeasureGrp += Isis::PvlKeyword("DeltaSample", Isis::toString(mtInterestResults[measure].miDeltaSample)); + pvlMeasureGrp += Isis::PvlKeyword("DeltaLine", Isis::toString(mtInterestResults[measure].miDeltaLine)); pvlMeasureGrp += Isis::PvlKeyword("Reference", "true"); } else { @@ -518,8 +518,8 @@ namespace Isis { newMeasure->SetIgnored(true); } pvlMeasureGrp += Isis::PvlKeyword("NewLocation", LocationString(dSample, dLine).toStdString()); - pvlMeasureGrp += Isis::PvlKeyword("DeltaSample", toString((int)abs((int)dSample - (int)origSample))); - pvlMeasureGrp += Isis::PvlKeyword("DeltaLine", toString((int)abs((int)dLine - (int)origLine))); + pvlMeasureGrp += Isis::PvlKeyword("DeltaSample", Isis::toString((int)abs((int)dSample - (int)origSample))); + pvlMeasureGrp += Isis::PvlKeyword("DeltaLine", Isis::toString((int)abs((int)dLine - (int)origLine))); pvlMeasureGrp += Isis::PvlKeyword("Reference", "false"); } } @@ -543,11 +543,11 @@ namespace Isis { iMeasuresModified ++; } - pvlMeasureGrp += Isis::PvlKeyword("BestInterest", toString(mtInterestResults[measure].mdInterest)); - pvlMeasureGrp += Isis::PvlKeyword("EmissionAngle", toString(mtInterestResults[measure].mdEmission)); - pvlMeasureGrp += Isis::PvlKeyword("IncidenceAngle", toString(mtInterestResults[measure].mdIncidence)); - pvlMeasureGrp += Isis::PvlKeyword("Resolution", toString(mtInterestResults[measure].mdResolution)); - pvlMeasureGrp += Isis::PvlKeyword("DNValue", toString(mtInterestResults[measure].mdDn)); + pvlMeasureGrp += Isis::PvlKeyword("BestInterest", Isis::toString(mtInterestResults[measure].mdInterest)); + pvlMeasureGrp += Isis::PvlKeyword("EmissionAngle", Isis::toString(mtInterestResults[measure].mdEmission)); + pvlMeasureGrp += Isis::PvlKeyword("IncidenceAngle", Isis::toString(mtInterestResults[measure].mdIncidence)); + pvlMeasureGrp += Isis::PvlKeyword("Resolution", Isis::toString(mtInterestResults[measure].mdResolution)); + pvlMeasureGrp += Isis::PvlKeyword("DNValue", Isis::toString(mtInterestResults[measure].mdDn)); pvlPointObj += pvlMeasureGrp; } // Measures Loop @@ -568,7 +568,7 @@ namespace Isis { PvlGroup pvlRefChangeGrp("ReferenceChangeDetails"); if (iOrigRefIndex >= 0) { pvlRefChangeGrp += Isis::PvlKeyword("PrevSerialNumber", mtInterestResults[iOrigRefIndex].msSerialNum.toStdString()); - pvlRefChangeGrp += Isis::PvlKeyword("PrevBestInterest", toString(mtInterestResults[iOrigRefIndex].mdInterest)); + pvlRefChangeGrp += Isis::PvlKeyword("PrevBestInterest", Isis::toString(mtInterestResults[iOrigRefIndex].mdInterest)); pvlRefChangeGrp += Isis::PvlKeyword("PrevLocation", LocationString(mtInterestResults[iOrigRefIndex].mdOrigSample, mtInterestResults[iOrigRefIndex].mdOrigLine).toStdString()); } @@ -576,7 +576,7 @@ namespace Isis { pvlRefChangeGrp += Isis::PvlKeyword("PrevReference", "Not Set"); } pvlRefChangeGrp += Isis::PvlKeyword("NewSerialNumber", mtInterestResults[iBestMeasureIndex].msSerialNum.toStdString()); - pvlRefChangeGrp += Isis::PvlKeyword("NewBestInterest", toString(mtInterestResults[iBestMeasureIndex].mdInterest)); + pvlRefChangeGrp += Isis::PvlKeyword("NewBestInterest", Isis::toString(mtInterestResults[iBestMeasureIndex].mdInterest)); pvlRefChangeGrp += Isis::PvlKeyword("NewLocation", LocationString(mtInterestResults[iBestMeasureIndex].mdBestSample, mtInterestResults[iBestMeasureIndex].mdBestLine).toStdString()); @@ -599,24 +599,24 @@ namespace Isis { if (numMeasures == 0) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "No Measures in the Point"); } if (newPnt->IsIgnored()) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Point was originally Ignored"); } if (newPnt->GetType() == ControlPoint::Fixed) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Fixed Point"); } else if (newPnt->GetType() == ControlPoint::Constrained) { std::string sComment = "Comment"; - sComment += toString(++iComment); + sComment += Isis::toString(++iComment); pvlPointObj += Isis::PvlKeyword(sComment, "Constrained Point"); } @@ -639,9 +639,9 @@ namespace Isis { } // Point loop // CnetRef Change Statistics - mStatisticsGrp += Isis::PvlKeyword("PointsModified", toString(iPointsModified)); - mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", toString(iRefChanged)); - mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", toString(iMeasuresModified)); + mStatisticsGrp += Isis::PvlKeyword("PointsModified", Isis::toString(iPointsModified)); + mStatisticsGrp += Isis::PvlKeyword("ReferenceChanged", Isis::toString(iRefChanged)); + mStatisticsGrp += Isis::PvlKeyword("MeasuresModified", Isis::toString(iMeasuresModified)); mPvlLog += mStatisticsGrp; } diff --git a/isis/src/control/objs/InterestOperator/unitTest.cpp b/isis/src/control/objs/InterestOperator/unitTest.cpp index 0d6c39e2d4..5e11953fc4 100644 --- a/isis/src/control/objs/InterestOperator/unitTest.cpp +++ b/isis/src/control/objs/InterestOperator/unitTest.cpp @@ -26,19 +26,19 @@ int main() { try { PvlGroup op("Operator"); op += PvlKeyword("Name", "StandardDeviation"); - op += PvlKeyword("DeltaLine", toString(100)); - op += PvlKeyword("DeltaSamp", toString(100)); - op += PvlKeyword("Samples", toString(15)); - op += PvlKeyword("Lines", toString(15)); - op += PvlKeyword("MinimumInterest", toString(0.01)); + op += PvlKeyword("DeltaLine", Isis::toString(100)); + op += PvlKeyword("DeltaSamp", Isis::toString(100)); + op += PvlKeyword("Samples", Isis::toString(15)); + op += PvlKeyword("Lines", Isis::toString(15)); + op += PvlKeyword("MinimumInterest", Isis::toString(0.01)); PvlGroup opv("ValidMeasure"); - opv += PvlKeyword("MinDN", toString(0.0)); - opv += PvlKeyword("MaxDN", toString(1.0)); - opv += PvlKeyword("MinEmission", toString(15.0)); - opv += PvlKeyword("MaxEmission", toString(25.0)); - opv += PvlKeyword("MinIncidence", toString(0.0)); - opv += PvlKeyword("MaxIncidence", toString(135.0)); + opv += PvlKeyword("MinDN", Isis::toString(0.0)); + opv += PvlKeyword("MaxDN", Isis::toString(1.0)); + opv += PvlKeyword("MinEmission", Isis::toString(15.0)); + opv += PvlKeyword("MaxEmission", Isis::toString(25.0)); + opv += PvlKeyword("MinIncidence", Isis::toString(0.0)); + opv += PvlKeyword("MaxIncidence", Isis::toString(135.0)); //op += PvlKeyword("MinResolution", 100); //op += PvlKeyword("MaxResolution", 300); diff --git a/isis/src/core/src/Blob.cpp b/isis/src/core/src/Blob.cpp index 53d968d585..5bcfef6f07 100644 --- a/isis/src/core/src/Blob.cpp +++ b/isis/src/core/src/Blob.cpp @@ -424,8 +424,8 @@ namespace Isis { os.seekp(0, std::ios::end); BigInt nbytes = (BigInt) os.tellp() + (BigInt) 64; p_startByte = nbytes + 1 + 1; // 1-based; - pvl.findObject(p_type)["StartByte"] = std::to_string(p_startByte); - pvl.findObject(p_type)["Bytes"] = std::to_string(p_nbytes); + pvl.findObject(p_type)["StartByte"] = Isis::toString(p_startByte); + pvl.findObject(p_type)["Bytes"] = Isis::toString(p_nbytes); pvl.write(file); // Prepare and write the binary data @@ -482,8 +482,8 @@ namespace Isis { } - p_blobPvl["StartByte"] = std::to_string((BigInt)sbyte); - p_blobPvl["Bytes"] = std::to_string(p_nbytes); + p_blobPvl["StartByte"] = Isis::toString((BigInt)sbyte); + p_blobPvl["Bytes"] = Isis::toString(p_nbytes); // See if the blob is already in the file diff --git a/isis/src/core/src/FileName.cpp b/isis/src/core/src/FileName.cpp index 07e63e0f25..94a3b20469 100644 --- a/isis/src/core/src/FileName.cpp +++ b/isis/src/core/src/FileName.cpp @@ -410,12 +410,12 @@ namespace Isis { int width = std::count(file.begin(), file.end(), '?'); if (versionNumber < 0) { - std::string msg = "FileName does not support negative version numbers in the file name, tried to get version [" + std::to_string(versionNumber) + "] in file named " + originalPath() + "/" + file; + std::string msg = "FileName does not support negative version numbers in the file name, tried to get version [" + Isis::toString(versionNumber) + "] in file named " + originalPath() + "/" + file; throw IException(IException::Unknown, msg, _FILEINFO_); } if (versionNumber >= pow(10.0, width)) { - std::string msg = "FileName does not support version numbers greater than what would fit in the file name, tried to get version [" + std::to_string(versionNumber) + "] in file named [" + originalPath() + "/" + file + "]"; + std::string msg = "FileName does not support version numbers greater than what would fit in the file name, tried to get version [" + Isis::toString(versionNumber) + "] in file named [" + originalPath() + "/" + file + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -746,7 +746,7 @@ namespace Isis { for (std::string foundFile : files) { try { - foundValue = IString::ToInteger(foundFile.substr(before.length(), width)); + foundValue = Isis::toInt(foundFile.substr(before.length(), width)); success = true; } catch (...) { diff --git a/isis/src/core/src/IException.cpp b/isis/src/core/src/IException.cpp index 6d08d67c41..6828d976e9 100644 --- a/isis/src/core/src/IException.cpp +++ b/isis/src/core/src/IException.cpp @@ -422,7 +422,7 @@ namespace Isis { errGroup += PvlKeyword("File", *exception.m_fileName); if (exception.m_lineNumber != -1) - errGroup += PvlKeyword("Line", std::to_string(exception.m_lineNumber)); + errGroup += PvlKeyword("Line", Isis::toString(exception.m_lineNumber)); } if (!exceptionIsBlank) diff --git a/isis/src/core/src/Preference.cpp b/isis/src/core/src/Preference.cpp index 033e2f34f4..359e516335 100644 --- a/isis/src/core/src/Preference.cpp +++ b/isis/src/core/src/Preference.cpp @@ -65,7 +65,7 @@ namespace Isis { if (threadsPreference != "optimized") { // We need a no-iException conversion here - int threads = IString::ToInteger(threadsPreference); + int threads = Isis::toInt(threadsPreference); if (threads > 0) { QThreadPool::globalInstance()->setMaxThreadCount(threads); diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index 4dd20a547d..a51c26e2c0 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -549,7 +549,7 @@ namespace Isis { upcase = true; } else if (upcase) { - std::string valueUpper = std::to_string(value[i]); + std::string valueUpper = Isis::toString(value[i]); std::transform(valueUpper.begin(), valueUpper.end(), valueUpper.begin(), ::toupper); out += valueUpper; lastlower = false; @@ -581,7 +581,7 @@ namespace Isis { lastlower = false; } else { - std::string valueUpper = std::to_string(value[i]); + std::string valueUpper = Isis::toString(value[i]); std::transform(valueUpper.begin(), valueUpper.end(), valueUpper.begin(), ::toupper); out += valueUpper; if (islower(value[i])) lastlower = true; @@ -2003,8 +2003,8 @@ namespace Isis { // Check for Range if (sValueName.find("__Range") != std::string::npos) { - dRangeMin = IString::ToDouble((*pvlKwrdValue)[0]); - dRangeMax = IString::ToDouble((*pvlKwrdValue)[1]); + dRangeMin = Isis::toDouble((*pvlKwrdValue)[0]); + dRangeMax = Isis::toDouble((*pvlKwrdValue)[1]); bRange = true; } else if (sValueName.find("__Value") != std::string::npos) { @@ -2020,7 +2020,7 @@ namespace Isis { if (sValue != "null"){ int iValue=0; try { - iValue = IString::ToInteger(sValue); + iValue = Isis::toInt(sValue); } catch (IException & e) { std::string sErrMsg = "\"" +pvlKwrd.name() +"\" expects an Integer value"; throw IException(e, IException::User, sErrMsg, _FILEINFO_); @@ -2032,7 +2032,7 @@ namespace Isis { if (bValue) { bool bFound = false; for (int j=0; jsize(); j++) { - if (iValue == IString::ToInteger((*pvlKwrdValue)[j])) { + if (iValue == Isis::toInt((*pvlKwrdValue)[j])) { bFound = true; break; } @@ -2060,7 +2060,7 @@ namespace Isis { std::string sValue = pvlKwrd[i]; std::transform(sValue.begin(), sValue.end(), sValue.begin(), ::tolower); if (sValue != "null"){ - double dValue = IString::ToDouble(sValue); + double dValue = Isis::toDouble(sValue); if (bRange && (dValue < dRangeMin || dValue > dRangeMax)) { std::string sErrMsg = "\"" +pvlKwrd.name() +"\" is not in the specified Range"; throw IException(IException::User, sErrMsg, _FILEINFO_); @@ -2068,7 +2068,7 @@ namespace Isis { if (bValue) { bool bFound = false; for (int j=0; jsize(); j++) { - if (dValue == IString::ToDouble((*pvlKwrdValue)[j])) { + if (dValue == Isis::toDouble((*pvlKwrdValue)[j])) { bFound = true; break; } diff --git a/isis/src/core/src/Table.cpp b/isis/src/core/src/Table.cpp index 2874c79434..a7fa64fab0 100644 --- a/isis/src/core/src/Table.cpp +++ b/isis/src/core/src/Table.cpp @@ -420,9 +420,9 @@ namespace Isis { if (RecordSize() != rec.RecordSize()) { std::string msg = "Unable to add the given record with size = [" - + std::to_string(rec.RecordSize()) + " bytes] to to Isis Table [" + + Isis::toString(rec.RecordSize()) + " bytes] to to Isis Table [" + p_name + "] with record size = [" - + std::to_string(RecordSize()) + " bytes]. Record sizes must match."; + + Isis::toString(RecordSize()) + " bytes]. Record sizes must match."; throw IException(IException::Unknown, msg, _FILEINFO_); } char *newbuf = new char[RecordSize()]; @@ -474,7 +474,7 @@ namespace Isis { PvlObject &blobLabel = tableBlob.Label(); // Label setup - blobLabel += PvlKeyword("Records", std::to_string(Records())); + blobLabel += PvlKeyword("Records", Isis::toString(Records())); int nbytes = Records() * RecordSize(); if (Isis::IsLsb()) { diff --git a/isis/src/core/src/TableField.cpp b/isis/src/core/src/TableField.cpp index ac81b9d180..7cf7b06bae 100644 --- a/isis/src/core/src/TableField.cpp +++ b/isis/src/core/src/TableField.cpp @@ -356,7 +356,7 @@ namespace Isis { } if (m_size > 1) { std::string msg = "Unable to set field to the given int value. " - "Field [" + m_name + "] has [" + std::to_string(m_size) + "] " + "Field [" + m_name + "] has [" + Isis::toString(m_size) + "] " "Integer values. Use operator=(vector)."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -380,7 +380,7 @@ namespace Isis { } if (m_size > 1) { std::string msg = "Unable to set field to the given double value. " - "Field [" + m_name + "] has [" + std::to_string(m_size) + "] " + "Field [" + m_name + "] has [" + Isis::toString(m_size) + "] " "Double values. Use operator=(vector)."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -404,7 +404,7 @@ namespace Isis { } if (m_size > 1) { std::string msg = "Unable to set field to the given float value. " - "Field [" + m_name + "] has [" + std::to_string(m_size) + "] " + "Field [" + m_name + "] has [" + Isis::toString(m_size) + "] " "Real values. Use operator=(vector)."; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -431,7 +431,7 @@ namespace Isis { if (val[i] != ' ' && val[i] != '\0') { std::string msg = "Unable to set the Text TableField to the given string. " "The number of bytes allowed for this field value [" - + std::to_string(m_size) + "] is less than the length of the " + + Isis::toString(m_size) + "] is less than the length of the " "given string [" + value + "]."; throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -460,7 +460,7 @@ namespace Isis { else if ((int) values.size() != m_size) { std::string msg = "Unable to set field to the given vector of int values. " "Field [" + m_name + "] values has size [" - + std::to_string(m_size) + "]."; + + Isis::toString(m_size) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } m_ivalues = values; @@ -484,7 +484,7 @@ namespace Isis { else if ((int) values.size() != m_size) { std::string msg = "Unable to set field to the given vector of double values. " "Field [" + m_name + "] values has size [" - + std::to_string(m_size) + "]."; + + Isis::toString(m_size) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } m_dvalues = values; @@ -509,7 +509,7 @@ namespace Isis { else if ((int) values.size() != m_size) { std::string msg = "Unable to set field to the given vector of float values. " "Field [" + m_name + "] values has size [" - + std::to_string(m_size) + "]."; + + Isis::toString(m_size) + "]."; throw IException(IException::Programmer, msg, _FILEINFO_); } m_rvalues = values; @@ -602,7 +602,7 @@ namespace Isis { else if (m_type == TableField::Real) { group += PvlKeyword("Type", "Real"); } - group += PvlKeyword("Size", std::to_string(m_size)); + group += PvlKeyword("Size", Isis::toString(m_size)); return group; } @@ -632,7 +632,7 @@ namespace Isis { else if (field.isInteger()){ vector< int > currField = field; for (int i = 0;i <(int)currField.size();i++){ - fieldValues += std::to_string(currField[i]); + fieldValues += Isis::toString(currField[i]); if (i <(int)currField.size()- 1){ // add delimiter for all but the last element of the field fieldValues += delimiter; @@ -642,7 +642,7 @@ namespace Isis { else if (field.isDouble()){ vector< double > currField = field; for (int i = 0;i <(int)currField.size();i++){ - fieldValues += std::to_string(currField[i]); + fieldValues += Isis::toString(currField[i]); if (i <(int)currField.size()- 1){ fieldValues += delimiter; } @@ -651,7 +651,7 @@ namespace Isis { else { //if (field.isReal()) { vector< float > currField = field; for (int i = 0;i <(int)currField.size();i++){ - fieldValues += std::to_string(currField[i]); + fieldValues += Isis::toString(currField[i]); if (i <(int)currField.size()- 1){ fieldValues += delimiter; } diff --git a/isis/src/core/tests/PvlKeywordTests.cpp b/isis/src/core/tests/PvlKeywordTests.cpp index 1939ef539a..a33c902876 100644 --- a/isis/src/core/tests/PvlKeywordTests.cpp +++ b/isis/src/core/tests/PvlKeywordTests.cpp @@ -230,7 +230,11 @@ TEST(PvlKeyword, IndexSetValue) key.addValue("3.3", "feet"); key.addValue("Hello World!"); +<<<<<<< HEAD key[1] = toString(88); +======= + key[1] = Isis::toString(88); +>>>>>>> e6eff8ddd (Update std::tostring, stoi, stod to IString functions) EXPECT_EQ(key[1], "88"); } @@ -328,7 +332,11 @@ TEST(PvlKeyword, KeywordValidationNull) TEST(PvlKeyword, KeywordValidationFail) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); +<<<<<<< HEAD PvlKeyword pvlKwrd("KeyName", toString(3.5)); +======= + PvlKeyword pvlKwrd("KeyName", Isis::toString(3.5)); +>>>>>>> e6eff8ddd (Update std::tostring, stoi, stod to IString functions) pvlTmplKwrd.validateKeyword(pvlKwrd); } catch(Isis::IException &e) { @@ -339,7 +347,11 @@ TEST(PvlKeyword, KeywordValidationFail) { TEST(PvlKeyword, KeywordValidationPositive) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); +<<<<<<< HEAD PvlKeyword pvlKwrd("KeyName", toString(-3)); +======= + PvlKeyword pvlKwrd("KeyName", Isis::toString(-3)); +>>>>>>> e6eff8ddd (Update std::tostring, stoi, stod to IString functions) pvlTmplKwrd.validateKeyword(pvlKwrd, "positive"); } catch(Isis::IException &e) { @@ -350,9 +362,15 @@ TEST(PvlKeyword, KeywordValidationPositive) { TEST(PvlKeyword, KeywordValidationRange) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); +<<<<<<< HEAD PvlKeyword pvlTmplKwrdRange("KeyName__Range", toString(0)); pvlTmplKwrdRange.addValue(toString(10)); PvlKeyword pvlKwrd("KeyName", toString(11)); +======= + PvlKeyword pvlTmplKwrdRange("KeyName__Range", Isis::toString(0)); + pvlTmplKwrdRange.addValue(Isis::toString(10)); + PvlKeyword pvlKwrd("KeyName", Isis::toString(11)); +>>>>>>> e6eff8ddd (Update std::tostring, stoi, stod to IString functions) pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdRange); } catch(Isis::IException &e) { diff --git a/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp b/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp index 07235b709f..623ee6dcc4 100644 --- a/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp +++ b/isis/src/dawn/apps/dawnfc2isis/dawnfc2isis.cpp @@ -158,17 +158,17 @@ namespace Isis { "FilterNumber. The FilterNumber must fall in the range 1 to 8."; throw IException(IException::Io, msg, _FILEINFO_); } - bbGrp.addKeyword(PvlKeyword("Center", toString(center))); - bbGrp.addKeyword(PvlKeyword("Width", toString(width))); + bbGrp.addKeyword(PvlKeyword("Center", Isis::toString(center))); + bbGrp.addKeyword(PvlKeyword("Width", Isis::toString(width))); bbGrp.addKeyword(PvlKeyword("FilterName", filtname.toStdString())); outcube->putGroup(bbGrp); PvlGroup kerns("Kernels"); if(instid == "FC1") { - kerns += PvlKeyword("NaifFrameCode", toString(-203110-filtno)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-203110-filtno)); } else if(instid == "FC2") { - kerns += PvlKeyword("NaifFrameCode", toString(-203120-filtno)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-203120-filtno)); } else { std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + diff --git a/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp b/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp index 8f2b2b0d18..3779e7c77d 100644 --- a/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp +++ b/isis/src/dawn/objs/DawnFcCamera/DawnFcCamera.cpp @@ -55,7 +55,7 @@ namespace Isis { } else { std::string msg = "File does not appear to be a Dawn Framing Camera image. "; - msg += "(" + toString(ikCode) + " is not a Dawn FC instrument code)"; + msg += "(" + Isis::toString(ikCode) + " is not a Dawn FC instrument code)"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp b/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp index 2cd85751bd..8fd1e9eb47 100644 --- a/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp +++ b/isis/src/dawn/objs/DawnVirCamera/DawnVirCamera.cpp @@ -88,9 +88,9 @@ namespace Isis { // Get other info from labels PvlKeyword &frameParam = inst["FrameParameter"]; - m_exposureTime = IString::ToDouble(frameParam[0]); - m_summing = IString::ToDouble(frameParam[1]); - m_scanRate = IString::ToDouble(frameParam[2]); + m_exposureTime = Isis::toDouble(frameParam[0]); + m_summing = Isis::toDouble(frameParam[1]); + m_scanRate = Isis::toDouble(frameParam[2]); // Setup detector map // Get the line scan rates/times @@ -480,21 +480,21 @@ namespace Isis { } // Add some necessary keywords - quats.Label() += PvlKeyword("CkTableStartTime", toString(startTime())); - quats.Label() += PvlKeyword("CkTableEndTime", toString(endTime())); - quats.Label() += PvlKeyword("CkTableOriginalSize", toString(quats.Records())); + quats.Label() += PvlKeyword("CkTableStartTime", Isis::toString(startTime())); + quats.Label() += PvlKeyword("CkTableEndTime", Isis::toString(endTime())); + quats.Label() += PvlKeyword("CkTableOriginalSize", Isis::toString(quats.Records())); // Create the time dependant frames keyword int virZeroId = getInteger("FRAME_" + virZero); - PvlKeyword tdf("TimeDependentFrames", toString(virZeroId)); // DAWN_VIR_{ID}_ZERO + PvlKeyword tdf("TimeDependentFrames", Isis::toString(virZeroId)); // DAWN_VIR_{ID}_ZERO tdf.addValue("-203200"); // DAWN_VIR tdf.addValue("-203000"); // DAWN_SPACECRAFT tdf.addValue("1"); // J2000 quats.Label() += tdf; // Create constant rotation frames - PvlKeyword cf("ConstantFrames", toString(virZeroId)); - cf.addValue(toString(virZeroId)); + PvlKeyword cf("ConstantFrames", Isis::toString(virZeroId)); + cf.addValue(Isis::toString(virZeroId)); quats.Label() += cf; SpiceDouble identity[3][3]; @@ -504,7 +504,7 @@ namespace Isis { PvlKeyword crot("ConstantRotation"); for (int i = 0 ; i < 3 ; i++) { for (int j = 0 ; j < 3 ; j++) { - crot.addValue(toString(identity[i][j])); + crot.addValue(Isis::toString(identity[i][j])); } } diff --git a/isis/src/dev/apps/camcoeffs/main.cpp b/isis/src/dev/apps/camcoeffs/main.cpp index 03329d454e..771f1f259a 100644 --- a/isis/src/dev/apps/camcoeffs/main.cpp +++ b/isis/src/dev/apps/camcoeffs/main.cpp @@ -161,21 +161,21 @@ void IsisMain() { if(ui.WasEntered("IAKCODE")) { PvlKeyword naifFormatX("INS" + ui.GetString("IAKCODE").toStdString() + "_TRANSX"); - naifFormatX += toString(eq1[0]); - naifFormatX += toString(eq1[1]); - naifFormatX += toString(eq1[2]); + naifFormatX += Isis::toString(eq1[0]); + naifFormatX += Isis::toString(eq1[1]); + naifFormatX += Isis::toString(eq1[2]); PvlKeyword naifFormatY("INS" + ui.GetString("IAKCODE").toStdString() + "_TRANSY"); - naifFormatY += toString(eq2[0]); - naifFormatY += toString(eq2[1]); - naifFormatY += toString(eq2[2]); + naifFormatY += Isis::toString(eq2[0]); + naifFormatY += Isis::toString(eq2[1]); + naifFormatY += Isis::toString(eq2[2]); PvlKeyword naifFormatS("INS" + ui.GetString("IAKCODE").toStdString() + "_ITRANSS"); - naifFormatS += toString(res1[0]); - naifFormatS += toString(res1[1]); - naifFormatS += toString(res1[2]); + naifFormatS += Isis::toString(res1[0]); + naifFormatS += Isis::toString(res1[1]); + naifFormatS += Isis::toString(res1[2]); PvlKeyword naifFormatL("INS" + ui.GetString("IAKCODE").toStdString() + "_ITRANSL"); - naifFormatL += toString(res2[0]); - naifFormatL += toString(res2[1]); - naifFormatL += toString(res2[2]); + naifFormatL += Isis::toString(res2[0]); + naifFormatL += Isis::toString(res2[1]); + naifFormatL += Isis::toString(res2[2]); res += naifFormatX; res += naifFormatY; diff --git a/isis/src/dev/apps/camtest/main.cpp b/isis/src/dev/apps/camtest/main.cpp index a510b4e10c..ad6ec12e37 100644 --- a/isis/src/dev/apps/camtest/main.cpp +++ b/isis/src/dev/apps/camtest/main.cpp @@ -92,14 +92,14 @@ void IsisMain() { // Collect results PvlGroup results = PvlGroup("CamTestResults"); - results += PvlKeyword("FailedConversionsToLatLong", toString(resultsStats.LrsPixels())); - results += PvlKeyword("FailedConversionsToSampleLine", toString(resultsStats.HrsPixels())); - results += PvlKeyword("SuccessfulConversions", toString(resultsStats.ValidPixels())); + results += PvlKeyword("FailedConversionsToLatLong", Isis::toString(resultsStats.LrsPixels())); + results += PvlKeyword("FailedConversionsToSampleLine", Isis::toString(resultsStats.HrsPixels())); + results += PvlKeyword("SuccessfulConversions", Isis::toString(resultsStats.ValidPixels())); if (outFormat == Err) { - results += PvlKeyword("Average", toString(resultsStats.Average())); - results += PvlKeyword("StandardDeviation", toString(resultsStats.StandardDeviation())); - results += PvlKeyword("Minimum", toString(resultsStats.Minimum())); - results += PvlKeyword("Maximum", toString(resultsStats.Maximum())); + results += PvlKeyword("Average", Isis::toString(resultsStats.Average())); + results += PvlKeyword("StandardDeviation", Isis::toString(resultsStats.StandardDeviation())); + results += PvlKeyword("Minimum", Isis::toString(resultsStats.Minimum())); + results += PvlKeyword("Maximum", Isis::toString(resultsStats.Maximum())); } // Log output results diff --git a/isis/src/galileo/apps/gllnims2isis/main.cpp b/isis/src/galileo/apps/gllnims2isis/main.cpp index 7e2b837d4f..72cfcb48df 100644 --- a/isis/src/galileo/apps/gllnims2isis/main.cpp +++ b/isis/src/galileo/apps/gllnims2isis/main.cpp @@ -368,8 +368,8 @@ PvlGroup originalMappingGroup = qube.findGroup("IMAGE_MAP_PROJECTION", Pvl::Trav double lineOffset = -(double)(importPds.Lines()+1) / 2; double sampleOffset = -(double)(importPds.Samples()+1) / 2; double resolution = mappingGroup["PixelResolution"][0].toDouble(); - mappingGroup["UpperLeftCornerY"] = toString(-lineOffset * resolution); - mappingGroup["UpperLeftCornerX"] = toString(sampleOffset * resolution); + mappingGroup["UpperLeftCornerY"] = Isis::toString(-lineOffset * resolution); + mappingGroup["UpperLeftCornerX"] = Isis::toString(sampleOffset * resolution); if (originalMappingGroup["COORDINATE_SYSTEM_NAME"][0] == "PLANETOCENTRIC") { mappingGroup["LatitudeType"] = "Planetocentric"; } @@ -387,11 +387,11 @@ PvlGroup originalMappingGroup = qube.findGroup("IMAGE_MAP_PROJECTION", Pvl::Trav } else { if (mappingGroup.hasKeyword("CenterLatitude")) { - mappingGroup["CenterLatitude"].setValue(toString(centerLatitude), + mappingGroup["CenterLatitude"].setValue(Isis::toString(centerLatitude), "degrees"); } else { - PvlKeyword clat("CenterLatitude", toString(centerLatitude), "degrees" ); + PvlKeyword clat("CenterLatitude", Isis::toString(centerLatitude), "degrees" ); mappingGroup.addKeyword(clat); } } @@ -400,7 +400,7 @@ PvlGroup originalMappingGroup = qube.findGroup("IMAGE_MAP_PROJECTION", Pvl::Trav "degrees"); } else { - mappingGroup["CenterLongitude"].setValue(toString(centerLongitude), + mappingGroup["CenterLongitude"].setValue(Isis::toString(centerLongitude), "degrees"); } mappingGroup["LongitudeDomain"].setUnits("degrees"); diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index 3de0834a66..8d801a0d4d 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -195,7 +195,7 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube) { //change exposure duration to seconds double expDur = inst.findKeyword("exposureDuration"); double expDurOut = expDur / 1000.0; - inst.findKeyword("exposureDuration").setValue(toString(expDurOut), "seconds"); + inst.findKeyword("exposureDuration").setValue(Isis::toString(expDurOut), "seconds"); inst.addKeyword(PvlKeyword("FrameDuration", pdsLabel["frameDuration"], "seconds")); //Calculate the Frame_Rate_Id keyword @@ -207,7 +207,7 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube) { summingMode = 2; } - inst.addKeyword(PvlKeyword("Summing", toString(summingMode))); + inst.addKeyword(PvlKeyword("Summing", Isis::toString(summingMode))); inst.addKeyword(PvlKeyword("FrameModeId", frameModeId.toStdString())); // Create the Band bin Group diff --git a/isis/src/galileo/apps/gllssical/gllssical.cpp b/isis/src/galileo/apps/gllssical/gllssical.cpp index d04436c3e3..cefe699cfa 100644 --- a/isis/src/galileo/apps/gllssical/gllssical.cpp +++ b/isis/src/galileo/apps/gllssical/gllssical.cpp @@ -82,7 +82,7 @@ namespace Isis { Isis::CubeAttributeInput inAtt1; FileName darkFileName = FindDarkFile(icube); Cube *darkcube = p.SetInputCube(QString::fromStdString(darkFileName.expanded()), inAtt1); - dcScaleFactor = IString::ToDouble(darkcube->group("Instrument")["PicScale"][0]); + dcScaleFactor = Isis::toDouble(darkcube->group("Instrument")["PicScale"][0]); Isis::CubeAttributeInput inAtt2; FileName gainFileName = FindGainFile(icube); @@ -107,7 +107,7 @@ namespace Isis { calculateScaleFactor0(icube, gaincube); - exposureDuration = IString::ToDouble(icube->group("Instrument")["ExposureDuration"][0]) * 1000; + exposureDuration = Isis::toDouble(icube->group("Instrument")["ExposureDuration"][0]) * 1000; if(darkcube->pixelType() == Isis::UnsignedByte) { eightBitDarkCube = true; @@ -126,23 +126,23 @@ namespace Isis { gainFileName.name())); calibrationLog.addKeyword(PvlKeyword("ShutterFile", shutterFileName.originalPath() + "/" + shutterFileName.name())); - calibrationLog.addKeyword(PvlKeyword("ScaleFactor", toString(scaleFactor))); + calibrationLog.addKeyword(PvlKeyword("ScaleFactor", Isis::toString(scaleFactor))); calibrationLog.addKeyword(PvlKeyword("OutputUnits", iof ? "I/F" : "Radiance")); if (iof) { - calibrationLog.addKeyword(PvlKeyword("S1", toString(s1), "I/F per Ft-Lambert")); - calibrationLog.addKeyword(PvlKeyword("RSUN", toString(rsun), "(Planet-Sun range)/5.2 A.U.")); - calibrationLog.addKeyword(PvlKeyword("Scale", toString(scaleFactor), "I/F units per DN")); - calibrationLog.addKeyword(PvlKeyword("GC", toString(cubeConversion), "Cube gain conversion")); - calibrationLog.addKeyword(PvlKeyword("GG", toString(gainConversion), "Gain file gain conversion")); - calibrationLog.addKeyword(PvlKeyword("IOF-SCALE0", toString(scaleFactor0), "(S1/Scale)*(GC/GG)/RSUN**2")); + calibrationLog.addKeyword(PvlKeyword("S1", Isis::toString(s1), "I/F per Ft-Lambert")); + calibrationLog.addKeyword(PvlKeyword("RSUN", Isis::toString(rsun), "(Planet-Sun range)/5.2 A.U.")); + calibrationLog.addKeyword(PvlKeyword("Scale", Isis::toString(scaleFactor), "I/F units per DN")); + calibrationLog.addKeyword(PvlKeyword("GC", Isis::toString(cubeConversion), "Cube gain conversion")); + calibrationLog.addKeyword(PvlKeyword("GG", Isis::toString(gainConversion), "Gain file gain conversion")); + calibrationLog.addKeyword(PvlKeyword("IOF-SCALE0", Isis::toString(scaleFactor0), "(S1/Scale)*(GC/GG)/RSUN**2")); } else { - calibrationLog.addKeyword(PvlKeyword("S2", toString(s2), "Nanowatts per Ft-Lambert")); - calibrationLog.addKeyword(PvlKeyword("Scale", toString(scaleFactor), + calibrationLog.addKeyword(PvlKeyword("S2", Isis::toString(s2), "Nanowatts per Ft-Lambert")); + calibrationLog.addKeyword(PvlKeyword("Scale", Isis::toString(scaleFactor), "Nanowatts/cm**2/steradian/nanometer/DN")); - calibrationLog.addKeyword(PvlKeyword("GC", toString(cubeConversion), "Cube gain conversion")); - calibrationLog.addKeyword(PvlKeyword("GG", toString(gainConversion), "Gain file gain conversion")); - calibrationLog.addKeyword(PvlKeyword("Radiance-SCALE0", toString(scaleFactor0), "(S2/Scale)*(GC/GG)")); + calibrationLog.addKeyword(PvlKeyword("GC", Isis::toString(cubeConversion), "Cube gain conversion")); + calibrationLog.addKeyword(PvlKeyword("GG", Isis::toString(gainConversion), "Gain file gain conversion")); + calibrationLog.addKeyword(PvlKeyword("Radiance-SCALE0", Isis::toString(scaleFactor0), "(S2/Scale)*(GC/GG)")); } ocube->putGroup(calibrationLog); @@ -235,11 +235,11 @@ namespace Isis { * 4 = 60 2/3 * 5 = 15 1/6 */ - if((int)(IString::ToDouble(icube->group("Instrument")["FrameDuration"][0])) == 2) frameRateId = 1; - if((int)(IString::ToDouble(icube->group("Instrument")["FrameDuration"][0])) == 8) frameRateId = 2; - if((int)(IString::ToDouble(icube->group("Instrument")["FrameDuration"][0])) == 30) frameRateId = 3; - if((int)(IString::ToDouble(icube->group("Instrument")["FrameDuration"][0])) == 60) frameRateId = 4; - if((int)(IString::ToDouble(icube->group("Instrument")["FrameDuration"][0])) == 15) frameRateId = 5; + if((int)(Isis::toDouble(icube->group("Instrument")["FrameDuration"][0])) == 2) frameRateId = 1; + if((int)(Isis::toDouble(icube->group("Instrument")["FrameDuration"][0])) == 8) frameRateId = 2; + if((int)(Isis::toDouble(icube->group("Instrument")["FrameDuration"][0])) == 30) frameRateId = 3; + if((int)(Isis::toDouble(icube->group("Instrument")["FrameDuration"][0])) == 60) frameRateId = 4; + if((int)(Isis::toDouble(icube->group("Instrument")["FrameDuration"][0])) == 15) frameRateId = 5; int exposureTypeId = (icube->group("Instrument")["ExposureType"][0] == "NORMAL") ? 0 : 1; @@ -282,7 +282,7 @@ namespace Isis { int minImageNum = tokens.takeFirst().toInt(); int maxImageNum = tokens.takeFirst().toInt(); - int imageNumber = (int)(IString::ToDouble(icube->group("Instrument")["SpacecraftClockStartCount"]) * 100 + 0.5); + int imageNumber = (int)(Isis::toDouble(icube->group("Instrument")["SpacecraftClockStartCount"]) * 100 + 0.5); QString telemetry = QString::fromStdString(icube->group("Instrument")["TelemetryFormat"][0]); if(imageNumber > 99757701 && imageNumber < 159999999) { if((telemetry == "AI8" && (gainState == "1" || gainState == "2")) || @@ -361,7 +361,7 @@ namespace Isis { QString keyword = QString("GainState") + ((getGainModeID(icube) < 3) ? QString("12") : QString("34")); for(int i = 0; i < frameGrp[keyword.toStdString()].size(); i++) { - weight.push_back(IString::ToDouble(frameGrp[keyword.toStdString()][i])); + weight.push_back(Isis::toDouble(frameGrp[keyword.toStdString()][i])); } return weightFile; @@ -376,16 +376,16 @@ namespace Isis { * 3 = 40,000 * 4 = 10,000 */ - if((int)IString::ToDouble(icube->group("Instrument")["GainModeId"][0]) == 4E5) { + if((int)Isis::toDouble(icube->group("Instrument")["GainModeId"][0]) == 4E5) { gainModeId = 1; } - else if((int)IString::ToDouble(icube->group("Instrument")["GainModeId"][0]) == 1E5) { + else if((int)Isis::toDouble(icube->group("Instrument")["GainModeId"][0]) == 1E5) { gainModeId = 2; } - else if((int)IString::ToDouble(icube->group("Instrument")["GainModeId"][0]) == 4E4) { + else if((int)Isis::toDouble(icube->group("Instrument")["GainModeId"][0]) == 4E4) { gainModeId = 3; } - else if((int)IString::ToDouble(icube->group("Instrument")["GainModeId"][0]) == 1E4) { + else if((int)Isis::toDouble(icube->group("Instrument")["GainModeId"][0]) == 1E4) { gainModeId = 4; } else { @@ -431,7 +431,7 @@ namespace Isis { if(currGrp.hasKeyword("MinimumTargetName")) { try { if((int)currGrp["MinimumTargetName"] > - (int)IString::ToInteger(icube->group("Archive")["CalTargetCode"][0].substr(0, 2))) { + (int)Isis::toInt(icube->group("Archive")["CalTargetCode"][0].substr(0, 2))) { continue; } } @@ -444,7 +444,7 @@ namespace Isis { fltToRad = currGrp["FloatToRad"]; } - int filterNumber = IString::ToInteger(icube->group("BandBin")["FilterNumber"][0]); + int filterNumber = Isis::toInt(icube->group("BandBin")["FilterNumber"][0]); if(fltToRef.size() == 0) { throw IException(IException::Unknown, @@ -454,10 +454,10 @@ namespace Isis { _FILEINFO_); } - s1 = IString::ToDouble(fltToRef[filterNumber]); - s2 = IString::ToDouble(fltToRad[filterNumber]); - cubeConversion = IString::ToDouble( conversionFactors["GainRatios"][getGainModeID(icube)-1]); - gainConversion = IString::ToDouble(conversionFactors["GainRatios"][getGainModeID(gaincube)-1]); + s1 = Isis::toDouble(fltToRef[filterNumber]); + s2 = Isis::toDouble(fltToRad[filterNumber]); + cubeConversion = Isis::toDouble( conversionFactors["GainRatios"][getGainModeID(icube)-1]); + gainConversion = Isis::toDouble(conversionFactors["GainRatios"][getGainModeID(gaincube)-1]); if (iof) { try { diff --git a/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp b/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp index fb2419918c..68bcfaf14e 100644 --- a/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp +++ b/isis/src/hayabusa/apps/amica2isis/AmicaImportFits.cpp @@ -129,16 +129,16 @@ namespace Isis { m_label = parseLabel(input, fitsLabelName); // Get data dimensions - int naxis = IString::ToInteger(m_label["NAXIS"][0]); + int naxis = Isis::toInt(m_label["NAXIS"][0]); if (naxis == 2) { - m_samples = IString::ToInteger(m_label["NAXIS1"][0]); - m_lines = IString::ToInteger(m_label["NAXIS2"][0]); + m_samples = Isis::toInt(m_label["NAXIS1"][0]); + m_lines = Isis::toInt(m_label["NAXIS2"][0]); m_bands = 1; } else if (naxis == 3) { - m_samples = IString::ToInteger(m_label["NAXIS1"][0]); - m_lines = IString::ToInteger(m_label["NAXIS2"][0]); - m_bands = IString::ToInteger(m_label["NAXIS3"][0]); + m_samples = Isis::toInt(m_label["NAXIS1"][0]); + m_lines = Isis::toInt(m_label["NAXIS2"][0]); + m_bands = Isis::toInt(m_label["NAXIS3"][0]); } else { std::string msg = "NAXIS count of [" + m_label["NAXIS"][0] + diff --git a/isis/src/hayabusa/apps/amica2isis/main.cpp b/isis/src/hayabusa/apps/amica2isis/main.cpp index af7f62e81a..c27878c737 100644 --- a/isis/src/hayabusa/apps/amica2isis/main.cpp +++ b/isis/src/hayabusa/apps/amica2isis/main.cpp @@ -132,7 +132,7 @@ void IsisMain () // Create YearDoy keyword in Archive group iTime stime(QString::fromStdString(outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0])); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", Isis::toString(stime.Year()*1000 + stime.DayOfYear())); outLabel.findGroup("Archive", Pvl::Traverse).addKeyword(yeardoy); diff --git a/isis/src/hayabusa/apps/amicacal/main.cpp b/isis/src/hayabusa/apps/amicacal/main.cpp index 4481aba80c..6cc5c58156 100644 --- a/isis/src/hayabusa/apps/amicacal/main.cpp +++ b/isis/src/hayabusa/apps/amicacal/main.cpp @@ -461,21 +461,21 @@ void IsisMain() { // Add PSF parameter to the calibration reporting key = PvlKeyword("PSF_KernelSize"); - key.addValue(toString(g_size)); - key.addValue(toString(g_size)); + key.addValue(Isis::toString(g_size)); + key.addValue(Isis::toString(g_size)); calibrationLog.addKeyword(key); - calibrationLog.addKeyword(PvlKeyword("PSF_Focused", toString(g_alpha, 6))); + calibrationLog.addKeyword(PvlKeyword("PSF_Focused", Isis::toString(g_alpha, 6))); key = PvlKeyword("PSF_Sigma"); for (int i = 0 ; i < g_N ; i++ ) { - key.addValue(toString(g_sigma[i])); + key.addValue(Isis::toString(g_sigma[i])); } calibrationLog.addKeyword(key); key = PvlKeyword("PSF_Diffuse"); for (int i = 0 ; i < g_N ; i++ ) { - key.addValue(toString(g_A[i])); + key.addValue(Isis::toString(g_A[i])); } } @@ -629,8 +629,8 @@ QString loadCalibrationVariables(const QString &config, Cube *iCube) { // Load the hot pixels into a vector for (int i = 0; i< hotPixelsGroup.keywords(); i++ ){ - int samp(IString::ToInteger(hotPixelsGroup[i][0])); - int line (IString::ToInteger(hotPixelsGroup[i][1])); + int samp(Isis::toInt(hotPixelsGroup[i][0])); + int line (Isis::toInt(hotPixelsGroup[i][1])); hotPixelVector.append( Pixel(alpha->BetaSample(samp), alpha->BetaLine(line), 1, 0)); } @@ -639,20 +639,20 @@ QString loadCalibrationVariables(const QString &config, Cube *iCube) { g_gamma = linearityGroup["Gamma"]; g_gamma = 1.0 - g_gamma; - g_L0 = IString::ToDouble(linearityGroup["L"][0]); - g_L1 = IString::ToDouble(linearityGroup["L"][1]); + g_L0 = Isis::toDouble(linearityGroup["L"][0]); + g_L1 = Isis::toDouble(linearityGroup["L"][1]); // Load Smear Removal Variables g_tvct = smearGroup["tvct"]; // Load DarkCurrent variables - g_d0 = IString::ToDouble(darkCurrentGroup["D"][0]); - g_d1 = IString::ToDouble(darkCurrentGroup["D"][1]); + g_d0 = Isis::toDouble(darkCurrentGroup["D"][0]); + g_d1 = Isis::toDouble(darkCurrentGroup["D"][1]); // Load Bias variables - g_b0 = IString::ToDouble(biasGroup["B"][0]); - g_b1 = IString::ToDouble(biasGroup["B"][1]); - g_b2 = IString::ToDouble(biasGroup["B"][2]); + g_b0 = Isis::toDouble(biasGroup["B"][0]); + g_b1 = Isis::toDouble(biasGroup["B"][1]); + g_b2 = Isis::toDouble(biasGroup["B"][2]); g_launchTimeStr = QString::fromStdString(biasGroup["launchTime"]); diff --git a/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp b/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp index f726c83ec6..c89adefa81 100644 --- a/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp +++ b/isis/src/hayabusa/apps/nirs2isis/NirsImportFits.cpp @@ -129,16 +129,16 @@ namespace Isis { m_label = parseLabel(input, fitsLabelName); // Get data dimensions - int naxis = IString::ToInteger(m_label["NAXIS"][0]); + int naxis = Isis::toInt(m_label["NAXIS"][0]); if (naxis == 2) { - m_samples = IString::ToInteger(m_label["NAXIS1"][0]); - m_lines = IString::ToInteger(m_label["NAXIS2"][0]); + m_samples = Isis::toInt(m_label["NAXIS1"][0]); + m_lines = Isis::toInt(m_label["NAXIS2"][0]); m_bands = 1; } else if (naxis == 3) { - m_samples = IString::ToInteger(m_label["NAXIS1"][0]); - m_lines = IString::ToInteger(m_label["NAXIS2"][0]); - m_bands = IString::ToInteger(m_label["NAXIS3"][0]); + m_samples = Isis::toInt(m_label["NAXIS1"][0]); + m_lines = Isis::toInt(m_label["NAXIS2"][0]); + m_bands = Isis::toInt(m_label["NAXIS3"][0]); } else { std::string msg = "NAXIS count of [" + m_label["NAXIS"][0] + diff --git a/isis/src/hayabusa/apps/nirs2isis/main.cpp b/isis/src/hayabusa/apps/nirs2isis/main.cpp index 66728c877c..58457ec68d 100644 --- a/isis/src/hayabusa/apps/nirs2isis/main.cpp +++ b/isis/src/hayabusa/apps/nirs2isis/main.cpp @@ -156,8 +156,8 @@ void IsisMain() { PvlKeyword filterNumber("FilterNumber"); PvlKeyword center("Center"); for (int channelNumber = 1; channelNumber <= 64; channelNumber++) { - filterNumber += toString( channelNumber ); - center += toString( 2.27144 - 0.02356 * (65 - channelNumber) ); + filterNumber += Isis::toString( channelNumber ); + center += Isis::toString( 2.27144 - 0.02356 * (65 - channelNumber) ); } newLabel.findGroup("BandBin", Pvl::Traverse).addKeyword(filterNumber); newLabel.findGroup("BandBin", Pvl::Traverse).addKeyword(center); @@ -165,7 +165,7 @@ void IsisMain() { // Create YearDoy keyword in Archive group iTime stime(QString::fromStdString(newLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0])); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", Isis::toString(stime.Year()*1000 + stime.DayOfYear())); newLabel.findGroup("Archive", Pvl::Traverse).addKeyword(yeardoy); // Add the instrument, band bin, archive, mission data, and kernels diff --git a/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp b/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp index 7abb4ca8cb..107db069f1 100644 --- a/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp +++ b/isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp @@ -112,7 +112,7 @@ namespace Isis { // Create YearDoy keyword in Archive group iTime stime(QString::fromStdString(outputLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0])); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", Isis::toString(stime.Year()*1000 + stime.DayOfYear())); archGrp.addKeyword(yeardoy); outputCube->putGroup(archGrp); diff --git a/isis/src/hayabusa2/apps/hyb2onccal/main.cpp b/isis/src/hayabusa2/apps/hyb2onccal/main.cpp index 746a3d28c2..9b974fcd2a 100644 --- a/isis/src/hayabusa2/apps/hyb2onccal/main.cpp +++ b/isis/src/hayabusa2/apps/hyb2onccal/main.cpp @@ -373,13 +373,13 @@ QString loadCalibrationVariables(const QString &config) { // g_Tvct = Smear["Tvct"]; // Load DarkCurrent variables - g_d0 = IString::ToDouble(DarkCurrent["D"][0]); - g_d1 = IString::ToDouble(DarkCurrent["D"][1]); + g_d0 = Isis::toDouble(DarkCurrent["D"][0]); + g_d1 = Isis::toDouble(DarkCurrent["D"][1]); // Load Bias variables - g_b0 = IString::ToDouble(Bias["B"][0]); - g_b1 = IString::ToDouble(Bias["B"][1]); - g_b2 = IString::ToDouble(Bias["B"][2]); + g_b0 = Isis::toDouble(Bias["B"][0]); + g_b1 = Isis::toDouble(Bias["B"][1]); + g_b2 = Isis::toDouble(Bias["B"][2]); // Compute BIAS correction factor (it's a constant so do it once!) g_bias = g_b0 + g_b1 * g_AEtemperature + g_b2 * (g_AEtemperature * g_AEtemperature); diff --git a/isis/src/juno/apps/junocam2isis/main.cpp b/isis/src/juno/apps/junocam2isis/main.cpp index a0ffa0f93d..8b2043ceec 100644 --- a/isis/src/juno/apps/junocam2isis/main.cpp +++ b/isis/src/juno/apps/junocam2isis/main.cpp @@ -161,14 +161,14 @@ void IsisMain() { // Update the labels Pvl *fullFrameLabel = g_outputCubes[i]->label(); fullFrameLabel->findGroup("Instrument", PvlObject::Traverse) - .addKeyword(PvlKeyword("FrameNumber", toString(i+1))); + .addKeyword(PvlKeyword("FrameNumber", Isis::toString(i+1))); PvlGroup &bandBin = fullFrameLabel->findGroup("BandBin", PvlObject::Traverse); bandBin.addKeyword(PvlKeyword("FilterName", "FULLCCD"), PvlObject::Replace); // Add filter-specific code to band bin Group - bandBin.addKeyword(PvlKeyword("NaifIkCode", toString(spacecraftCode))); + bandBin.addKeyword(PvlKeyword("NaifIkCode", Isis::toString(spacecraftCode))); importPds.WriteHistory(*g_outputCubes[i]); g_outputCubes[i]->write(origLabels); @@ -182,7 +182,7 @@ void IsisMain() { int numSubimages = importPds.Lines() / g_frameletLines; int frameletsPerFilter = numSubimages / g_filterList.size(); outputLabel.findGroup("Instrument", PvlObject::Traverse) - .addKeyword(PvlKeyword("NumberFramelets", toString(frameletsPerFilter))); + .addKeyword(PvlKeyword("NumberFramelets", Isis::toString(frameletsPerFilter))); // get output file name and remove cube extension, if entered FileName outputFileName(ui.GetCubeName("TO").toStdString()); @@ -255,7 +255,7 @@ void IsisMain() { int frameNumber = (i / g_filterList.size()) + 1; Pvl *frameletLabel = g_outputCubes[i]->label(); frameletLabel->findGroup("Instrument", PvlObject::Traverse) - .addKeyword(PvlKeyword("FrameNumber", toString(frameNumber))); + .addKeyword(PvlKeyword("FrameNumber", Isis::toString(frameNumber))); int filterIndex = i % g_filterList.size(); QString filterName = g_filterList[filterIndex]; @@ -276,7 +276,7 @@ void IsisMain() { spacecraftCode = -61504; } // Add filter-specific code to band bin Group - bandBin.addKeyword(PvlKeyword("NaifIkCode", toString(spacecraftCode))); + bandBin.addKeyword(PvlKeyword("NaifIkCode", Isis::toString(spacecraftCode))); importPds.WriteHistory(*g_outputCubes[i]); g_outputCubes[i]->write(origLabels); @@ -353,7 +353,7 @@ void translateLabel(Pvl &inputLabel, Pvl &outputLabel) { archiveXlater.Auto(outputLabel); PvlGroup &archive = outputLabel.findGroup("Archive", PvlObject::Traverse); iTime startTime(QString::fromStdString(inst["StartTime"][0])); - PvlKeyword yeardoy("YearDoy", toString(startTime.Year()*1000 + startTime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", Isis::toString(startTime.Year()*1000 + startTime.DayOfYear())); archive.addKeyword(yeardoy); UserInterface &ui = Application::GetUserInterface(); @@ -366,7 +366,7 @@ void translateLabel(Pvl &inputLabel, Pvl &outputLabel) { // Setup the kernel group PvlGroup kern("Kernels"); int spacecraftCode = -61500; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", Isis::toString(spacecraftCode)); outputLabel.findObject("IsisCube").addGroup(kern); } diff --git a/isis/src/juno/objs/JunoCamera/unitTest.cpp b/isis/src/juno/objs/JunoCamera/unitTest.cpp index 13c3747741..2c51d1c6a4 100644 --- a/isis/src/juno/objs/JunoCamera/unitTest.cpp +++ b/isis/src/juno/objs/JunoCamera/unitTest.cpp @@ -61,7 +61,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); - double exposureDuration = IString::ToDouble( inst["ExposureDuration"][0] ); + double exposureDuration = Isis::toDouble( inst["ExposureDuration"][0] ); QString stime = QString::fromStdString(inst["StartTime"]); double et; str2et_c(stime.toLatin1().data(), &et); diff --git a/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp b/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp index ca7b1b2491..59c5a267b8 100644 --- a/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp +++ b/isis/src/kaguya/apps/kaguyami2isis/kaguyami2isis.cpp @@ -120,7 +120,7 @@ namespace Isis { if (baseBand.contains("MV")) { kern += PvlKeyword("NaifFrameCode", (toString(-13133) + QString(baseBand[2]).toStdString())); } - kern += PvlKeyword("NaifCkCode", toString(-131330)); + kern += PvlKeyword("NaifCkCode", Isis::toString(-131330)); } else if (lab.findKeyword("INSTRUMENT_ID")[0] == "MI-NIR") { if (baseBand.contains("MN")) { diff --git a/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp b/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp index 9ed41f4087..a065d97553 100644 --- a/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp +++ b/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp @@ -79,27 +79,27 @@ void IsisMain() { int qaptr = 0; if (lab.hasKeyword("^SP_SPECTRUM_WAV")) { - wavptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_WAV")[keywordIndex]) - 1; + wavptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_WAV")[keywordIndex]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_RAW")) { - rawptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_RAW")[keywordIndex]) - 1; + rawptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_RAW")[keywordIndex]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_RAD")) { - radptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_RAD")[keywordIndex]) - 1; + radptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_RAD")[keywordIndex]) - 1; } //older-format file without calibrated NIR2 data if (lab.hasKeyword("^SP_SPECTRUM_REF")) { - refptr1 = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_REF")[keywordIndex]) - 1; + refptr1 = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_REF")[keywordIndex]) - 1; } //newer-format file with calibrated NIR2 data and 2 different Reflectances if (lab.hasKeyword("^SP_SPECTRUM_REF1")) { - refptr1 = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_REF1")[keywordIndex]) - 1; + refptr1 = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_REF1")[keywordIndex]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_REF2")) { - refptr2 = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_REF2")[keywordIndex]) - 1; + refptr2 = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_REF2")[keywordIndex]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_QA")) { - qaptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_QA")[keywordIndex]) - 1; + qaptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_QA")[keywordIndex]) - 1; } FILE *spcptr; @@ -127,10 +127,10 @@ void IsisMain() { } PvlObject wavobj = lab.findObject("SP_SPECTRUM_WAV"); - int wavlines = IString::ToInteger(wavobj.findKeyword("LINES")[0]); - int wavsamps = IString::ToInteger(wavobj.findKeyword("LINE_SAMPLES")[0]); + int wavlines = Isis::toInt(wavobj.findKeyword("LINES")[0]); + int wavsamps = Isis::toInt(wavobj.findKeyword("LINE_SAMPLES")[0]); QString wavtype = QString::fromStdString(wavobj.findKeyword("SAMPLE_TYPE")); - int wavbits = IString::ToInteger(wavobj.findKeyword("SAMPLE_BITS")[0]); + int wavbits = Isis::toInt(wavobj.findKeyword("SAMPLE_BITS")[0]); if (wavlines != 1 || wavsamps != 296 || wavtype != "MSB_UNSIGNED_INTEGER" || wavbits != 16) { std::string msg = "Wavelength data in input file does not meet the following "; @@ -166,10 +166,10 @@ void IsisMain() { } PvlObject rawobj = lab.findObject("SP_SPECTRUM_RAW"); - int rawlines = IString::ToInteger(rawobj.findKeyword("LINES")[0]); - int rawsamps = IString::ToInteger(rawobj.findKeyword("LINE_SAMPLES")[0]); + int rawlines = Isis::toInt(rawobj.findKeyword("LINES")[0]); + int rawsamps = Isis::toInt(rawobj.findKeyword("LINE_SAMPLES")[0]); QString rawtype = QString::fromStdString(rawobj.findKeyword("SAMPLE_TYPE")); - int rawbits = IString::ToInteger(rawobj.findKeyword("SAMPLE_BITS")[0]); + int rawbits = Isis::toInt(rawobj.findKeyword("SAMPLE_BITS")[0]); if (rawsamps != 296 || rawtype != "MSB_UNSIGNED_INTEGER" || rawbits != 16) { std::string msg = "Raw data in input file does not meet the following "; @@ -204,10 +204,10 @@ void IsisMain() { } PvlObject qaobj = lab.findObject("SP_SPECTRUM_QA"); - int qalines = IString::ToInteger(qaobj.findKeyword("LINES")[0]); - int qasamps = IString::ToInteger(qaobj.findKeyword("LINE_SAMPLES")[0]); + int qalines = Isis::toInt(qaobj.findKeyword("LINES")[0]); + int qasamps = Isis::toInt(qaobj.findKeyword("LINE_SAMPLES")[0]); QString qatype = QString::fromStdString(qaobj.findKeyword("SAMPLE_TYPE")); - int qabits = IString::ToInteger(qaobj.findKeyword("SAMPLE_BITS")[0]); + int qabits = Isis::toInt(qaobj.findKeyword("SAMPLE_BITS")[0]); if (qalines != rawlines || qasamps != 296 || qatype != "MSB_UNSIGNED_INTEGER" || qabits != 16) { std::string msg = "Quality Assessment data in input file does not meet the "; @@ -242,10 +242,10 @@ void IsisMain() { } PvlObject radobj = lab.findObject("SP_SPECTRUM_RAD"); - int radlines = IString::ToInteger(radobj.findKeyword("LINES")[0]); - int radsamps = IString::ToInteger(radobj.findKeyword("LINE_SAMPLES")[0]); + int radlines = Isis::toInt(radobj.findKeyword("LINES")[0]); + int radsamps = Isis::toInt(radobj.findKeyword("LINE_SAMPLES")[0]); QString radtype = QString::fromStdString(radobj.findKeyword("SAMPLE_TYPE")); - int radbits = IString::ToInteger(radobj.findKeyword("SAMPLE_BITS")[0]); + int radbits = Isis::toInt(radobj.findKeyword("SAMPLE_BITS")[0]); if (radlines != qalines || radsamps != 296 || radtype != "MSB_UNSIGNED_INTEGER" || radbits != 16) { std::string msg = "Radiance data in input file does not meet the following "; @@ -290,10 +290,10 @@ void IsisMain() { refobj2 = lab.findObject("SP_SPECTRUM_REF2"); } - int reflines = IString::ToInteger(refobj.findKeyword("LINES")[0]); - int refsamps = IString::ToInteger(refobj.findKeyword("LINE_SAMPLES")[0]); + int reflines = Isis::toInt(refobj.findKeyword("LINES")[0]); + int refsamps = Isis::toInt(refobj.findKeyword("LINE_SAMPLES")[0]); QString reftype = QString::fromStdString(refobj.findKeyword("SAMPLE_TYPE")); - int refbits = IString::ToInteger(refobj.findKeyword("SAMPLE_BITS")[0]); + int refbits = Isis::toInt(refobj.findKeyword("SAMPLE_BITS")[0]); if (reflines != radlines || refsamps != 296 || reftype != "MSB_UNSIGNED_INTEGER" || refbits != 16) { std::string msg = "Reflectance data in input file does not meet the following "; @@ -331,10 +331,10 @@ void IsisMain() { //import reflectance 2 if it exists double *ref2 = NULL; if (lab.hasKeyword("^SP_SPECTRUM_REF2")) { - int reflines2 = IString::ToInteger(refobj2.findKeyword("LINES")[0]); - int refsamps2 = IString::ToInteger(refobj2.findKeyword("LINE_SAMPLES")[0]); + int reflines2 = Isis::toInt(refobj2.findKeyword("LINES")[0]); + int refsamps2 = Isis::toInt(refobj2.findKeyword("LINE_SAMPLES")[0]); QString reftype2 = QString::fromStdString(refobj2.findKeyword("SAMPLE_TYPE")); - int refbits2 = IString::ToInteger(refobj2.findKeyword("SAMPLE_BITS")[0]); + int refbits2 = Isis::toInt(refobj2.findKeyword("SAMPLE_BITS")[0]); if (reflines2 != radlines || refsamps2 != 296 || reftype2 != "MSB_UNSIGNED_INTEGER" || refbits2 != 16) { std::string msg = "Reflectance #2 data in input file does not meet the following "; diff --git a/isis/src/kaguya/apps/kaguyasp2isis/main.cpp b/isis/src/kaguya/apps/kaguyasp2isis/main.cpp index 99a67b6321..5607dd6bdc 100644 --- a/isis/src/kaguya/apps/kaguyasp2isis/main.cpp +++ b/isis/src/kaguya/apps/kaguyasp2isis/main.cpp @@ -58,19 +58,19 @@ void IsisMain() { int qaptr = 0; if (lab.hasKeyword("^SP_SPECTRUM_WAV")) { - wavptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_WAV")[0]) - 1; + wavptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_WAV")[0]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_RAW")) { - rawptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_RAW")[0]) - 1; + rawptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_RAW")[0]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_RAD")) { - radptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_RAD")[0]) - 1; + radptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_RAD")[0]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_REF")) { - refptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1; + refptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1; } if (lab.hasKeyword("^SP_SPECTRUM_QA")) { - qaptr = IString::ToInteger(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1; + qaptr = Isis::toInt(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1; } FILE *spcptr; @@ -97,10 +97,10 @@ void IsisMain() { } PvlObject wavobj = lab.findObject("SP_SPECTRUM_WAV"); - int wavlines = IString::ToInteger(wavobj.findKeyword("LINES")[0]); - int wavsamps = IString::ToInteger(wavobj.findKeyword("LINE_SAMPLES")[0]); + int wavlines = Isis::toInt(wavobj.findKeyword("LINES")[0]); + int wavsamps = Isis::toInt(wavobj.findKeyword("LINE_SAMPLES")[0]); QString wavtype = QString::fromStdString(wavobj.findKeyword("SAMPLE_TYPE")); - int wavbits = IString::ToInteger(wavobj.findKeyword("SAMPLE_BITS")[0]); + int wavbits = Isis::toInt(wavobj.findKeyword("SAMPLE_BITS")[0]); if (wavlines != 1 || wavsamps != 296 || wavtype != "MSB_UNSIGNED_INTEGER" || wavbits != 16) { std::string msg = "Wavelength data in input file does not meet the following "; @@ -136,10 +136,10 @@ void IsisMain() { } PvlObject rawobj = lab.findObject("SP_SPECTRUM_RAW"); - int rawlines = IString::ToInteger(rawobj.findKeyword("LINES")[0]); - int rawsamps = IString::ToInteger(rawobj.findKeyword("LINE_SAMPLES")[0]); + int rawlines = Isis::toInt(rawobj.findKeyword("LINES")[0]); + int rawsamps = Isis::toInt(rawobj.findKeyword("LINE_SAMPLES")[0]); QString rawtype = QString::fromStdString(rawobj.findKeyword("SAMPLE_TYPE")); - int rawbits = IString::ToInteger(rawobj.findKeyword("SAMPLE_BITS")[0]); + int rawbits = Isis::toInt(rawobj.findKeyword("SAMPLE_BITS")[0]); if (rawsamps != 296 || rawtype != "MSB_UNSIGNED_INTEGER" || rawbits != 16) { std::string msg = "Raw data in input file does not meet the following "; @@ -174,10 +174,10 @@ void IsisMain() { } PvlObject qaobj = lab.findObject("SP_SPECTRUM_QA"); - int qalines = IString::ToInteger(qaobj.findKeyword("LINES")[0]); - int qasamps = IString::ToInteger(qaobj.findKeyword("LINE_SAMPLES")[0]); + int qalines = Isis::toInt(qaobj.findKeyword("LINES")[0]); + int qasamps = Isis::toInt(qaobj.findKeyword("LINE_SAMPLES")[0]); QString qatype = QString::fromStdString(qaobj.findKeyword("SAMPLE_TYPE")); - int qabits = IString::ToInteger(qaobj.findKeyword("SAMPLE_BITS")[0]); + int qabits = Isis::toInt(qaobj.findKeyword("SAMPLE_BITS")[0]); if (qalines != rawlines || qasamps != 296 || qatype != "MSB_UNSIGNED_INTEGER" || qabits != 16) { std::string msg = "Quality Assessment data in input file does not meet the "; @@ -212,10 +212,10 @@ void IsisMain() { } PvlObject radobj = lab.findObject("SP_SPECTRUM_RAD"); - int radlines = IString::ToInteger(radobj.findKeyword("LINES")[0]); - int radsamps = IString::ToInteger(radobj.findKeyword("LINE_SAMPLES")[0]); + int radlines = Isis::toInt(radobj.findKeyword("LINES")[0]); + int radsamps = Isis::toInt(radobj.findKeyword("LINE_SAMPLES")[0]); QString radtype = QString::fromStdString(radobj.findKeyword("SAMPLE_TYPE")); - int radbits = IString::ToInteger(radobj.findKeyword("SAMPLE_BITS")[0]); + int radbits = Isis::toInt(radobj.findKeyword("SAMPLE_BITS")[0]); if (radlines != qalines || radsamps != 296 || radtype != "MSB_UNSIGNED_INTEGER" || radbits != 16) { std::string msg = "Radiance data in input file does not meet the following "; @@ -250,10 +250,10 @@ void IsisMain() { } PvlObject refobj = lab.findObject("SP_SPECTRUM_REF"); - int reflines = IString::ToInteger(refobj.findKeyword("LINES")[0]); - int refsamps = IString::ToInteger(refobj.findKeyword("LINE_SAMPLES")[0]); + int reflines = Isis::toInt(refobj.findKeyword("LINES")[0]); + int refsamps = Isis::toInt(refobj.findKeyword("LINE_SAMPLES")[0]); QString reftype = QString::fromStdString(refobj.findKeyword("SAMPLE_TYPE")); - int refbits = IString::ToInteger(refobj.findKeyword("SAMPLE_BITS")[0]); + int refbits = Isis::toInt(refobj.findKeyword("SAMPLE_BITS")[0]); if (reflines != radlines || refsamps != 296 || reftype != "MSB_UNSIGNED_INTEGER" || refbits != 16) { std::string msg = "Reflectance data in input file does not meet the following "; diff --git a/isis/src/kaguya/apps/mimap2isis/mimap2isis.cpp b/isis/src/kaguya/apps/mimap2isis/mimap2isis.cpp index 7a36db0d63..922b972527 100644 --- a/isis/src/kaguya/apps/mimap2isis/mimap2isis.cpp +++ b/isis/src/kaguya/apps/mimap2isis/mimap2isis.cpp @@ -28,9 +28,9 @@ namespace Isis { // keyword value in their labels. The following code creates a temporary // detached PDS label with the correct (negated) keyword value. PvlObject obj = label.findObject("IMAGE_MAP_PROJECTION"); - double soff = IString::ToDouble(obj.findKeyword("SAMPLE_PROJECTION_OFFSET")[0]); + double soff = Isis::toDouble(obj.findKeyword("SAMPLE_PROJECTION_OFFSET")[0]); soff = -soff; - label.findObject("IMAGE_MAP_PROJECTION").addKeyword(PvlKeyword("SAMPLE_PROJECTION_OFFSET",toString(soff)),Pvl::Replace); + label.findObject("IMAGE_MAP_PROJECTION").addKeyword(PvlKeyword("SAMPLE_PROJECTION_OFFSET",Isis::toString(soff)),Pvl::Replace); FileName tempFileName = FileName::createTempFile("TEMPORARYlabel.pvl").name(); QString fn(QString::fromStdString(tempFileName.expanded())); label.write(fn.toStdString()); diff --git a/isis/src/lo/apps/lo2isis/lo2isis.cpp b/isis/src/lo/apps/lo2isis/lo2isis.cpp index 281d83a5ce..18b0bff214 100644 --- a/isis/src/lo/apps/lo2isis/lo2isis.cpp +++ b/isis/src/lo/apps/lo2isis/lo2isis.cpp @@ -170,7 +170,7 @@ namespace Isis{ QString imgNumber = QString::fromStdString(inst.findKeyword("ImageNumber")); int subFrame = imgNumber.mid(5).toInt(); - inst.addKeyword(PvlKeyword("SubFrame", toString(subFrame))); + inst.addKeyword(PvlKeyword("SubFrame", Isis::toString(subFrame))); //ImageNumber is auto translated, and no longer needed inst.deleteKeyword("ImageNumber"); diff --git a/isis/src/lo/apps/lopdsgen/main.cpp b/isis/src/lo/apps/lopdsgen/main.cpp index b6da46e6e3..12bec41462 100644 --- a/isis/src/lo/apps/lopdsgen/main.cpp +++ b/isis/src/lo/apps/lopdsgen/main.cpp @@ -151,8 +151,8 @@ void IsisMain() { // Calculate statistics on the cube to be processed and place // its MINIMUM and MAXIMUM into the output label p.CalculateStatistics(); - pdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("MINIMUM", toString(p.CubeStatistics(0)->Minimum())), Pvl::Replace); - pdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("MAXIMUM", toString(p.CubeStatistics(0)->Maximum())), Pvl::Replace); + pdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("MINIMUM", Isis::toString(p.CubeStatistics(0)->Minimum())), Pvl::Replace); + pdsLabel.findObject("IMAGE").addKeyword(PvlKeyword("MAXIMUM", Isis::toString(p.CubeStatistics(0)->Maximum())), Pvl::Replace); } else { FileName inputFile(ui.GetCubeName("FROM").toStdString()); diff --git a/isis/src/lo/objs/LoCameraFiducialMap/LoCameraFiducialMap.cpp b/isis/src/lo/objs/LoCameraFiducialMap/LoCameraFiducialMap.cpp index 5f8b8f70b3..57dc273126 100644 --- a/isis/src/lo/objs/LoCameraFiducialMap/LoCameraFiducialMap.cpp +++ b/isis/src/lo/objs/LoCameraFiducialMap/LoCameraFiducialMap.cpp @@ -61,10 +61,10 @@ namespace Isis { PvlKeyword &fYs = inst["FiducialYCoordinates"]; for(int i = 0; i < fSamps.size(); i++) { - p_fidSamples.push_back(IString::ToDouble(fSamps[i])); - p_fidLines.push_back(IString::ToDouble(fLines[i])); - p_fidXCoords.push_back(IString::ToDouble(fXs[i])); - p_fidYCoords.push_back(IString::ToDouble(fYs[i])); + p_fidSamples.push_back(Isis::toDouble(fSamps[i])); + p_fidLines.push_back(Isis::toDouble(fLines[i])); + p_fidXCoords.push_back(Isis::toDouble(fXs[i])); + p_fidYCoords.push_back(Isis::toDouble(fYs[i])); } } catch(IException &e) { diff --git a/isis/src/lro/apps/lromakeflat/main.cpp b/isis/src/lro/apps/lromakeflat/main.cpp index d8f30736d4..819c300a80 100644 --- a/isis/src/lro/apps/lromakeflat/main.cpp +++ b/isis/src/lro/apps/lromakeflat/main.cpp @@ -361,8 +361,8 @@ void getCubeListNormalization(Matrix2d &matrix, int cubeWidth, int frameHeight, double normalizationAverage = hist.Average(); matrix[listIndex][frame] = normalizationAverage; normResults += PvlKeyword("FileName", g_list[listIndex].toString()); - normResults += PvlKeyword("Frame", toString(frame)); - normResults += PvlKeyword("Frame_MeanAverage", toString(normalizationAverage)); + normResults += PvlKeyword("Frame", Isis::toString(frame)); + normResults += PvlKeyword("Frame_MeanAverage", Isis::toString(normalizationAverage)); Application::Log(normResults); } tmp.close(); @@ -504,7 +504,7 @@ void exclude(int listIndex, int frame, string reason){ PvlObject exclusion("Excluded_Items"); PvlGroup excludedFiles("Excluded_Frames"); excludedFiles += PvlKeyword("Frame_from_cube", g_list[listIndex].toString()); - excludedFiles += PvlKeyword("Frame_number", toString(frame)); + excludedFiles += PvlKeyword("Frame_number", Isis::toString(frame)); excludedFiles += PvlKeyword("Exclusion_reason", reason); Application::Log(excludedFiles); exclusion.addGroup(excludedFiles); diff --git a/isis/src/lro/apps/lronac2isis/lronac2isis.cpp b/isis/src/lro/apps/lronac2isis/lronac2isis.cpp index e0a9ee8f2e..6b92d66dd5 100644 --- a/isis/src/lro/apps/lronac2isis/lronac2isis.cpp +++ b/isis/src/lro/apps/lronac2isis/lronac2isis.cpp @@ -70,9 +70,9 @@ namespace Isis { } for(int i = 0; i < xtermKeyword.size(); i++) { - g_xterm.push_back(IString::ToDouble(xtermKeyword[i])); - g_mterm.push_back(IString::ToDouble(mtermKeyword[i])); - g_bterm.push_back(IString::ToDouble(btermKeyword[i])); + g_xterm.push_back(Isis::toDouble(xtermKeyword[i])); + g_mterm.push_back(Isis::toDouble(mtermKeyword[i])); + g_bterm.push_back(Isis::toDouble(btermKeyword[i])); } double versionId = QString::fromStdString(lab.findKeyword("PRODUCT_VERSION_ID")[0]).remove(QRegExp("^v")).toDouble(); diff --git a/isis/src/lro/apps/lronac2pds/lronac2pds.cpp b/isis/src/lro/apps/lronac2pds/lronac2pds.cpp index f7be2d7021..d2c7d3cd1f 100644 --- a/isis/src/lro/apps/lronac2pds/lronac2pds.cpp +++ b/isis/src/lro/apps/lronac2pds/lronac2pds.cpp @@ -201,18 +201,18 @@ namespace Isis { // Update the "IMAGE" Object PvlObject &imageObject = labelPvl.findObject("IMAGE"); imageObject.clear(); - imageObject += PvlKeyword("LINES", toString(cube->lineCount())); - imageObject += PvlKeyword("LINE_SAMPLES", toString(cube->sampleCount())); + imageObject += PvlKeyword("LINES", Isis::toString(cube->lineCount())); + imageObject += PvlKeyword("LINE_SAMPLES", Isis::toString(cube->sampleCount())); if (g_isIof) { - imageObject += PvlKeyword("SAMPLE_BITS", toString(16)); + imageObject += PvlKeyword("SAMPLE_BITS", Isis::toString(16)); imageObject += PvlKeyword("SAMPLE_TYPE", "LSB_INTEGER"); - imageObject += PvlKeyword("SCALING_FACTOR", toString(1.0 / SCALING_FACTOR)); - imageObject += PvlKeyword("VALID_MINIMUM", toString(Isis::VALID_MIN2)); - imageObject += PvlKeyword("NULL", toString(Isis::NULL2)); - imageObject += PvlKeyword("LOW_REPR_SATURATION", toString(Isis::LOW_REPR_SAT2)); - imageObject += PvlKeyword("LOW_INSTR_SATURATION", toString(Isis::LOW_INSTR_SAT2)); - imageObject += PvlKeyword("HIGH_INSTR_SATURATION", toString(Isis::HIGH_INSTR_SAT2)); - imageObject += PvlKeyword("HIGH_REPR_SATURATION", toString(Isis::HIGH_REPR_SAT2)); + imageObject += PvlKeyword("SCALING_FACTOR", Isis::toString(1.0 / SCALING_FACTOR)); + imageObject += PvlKeyword("VALID_MINIMUM", Isis::toString(Isis::VALID_MIN2)); + imageObject += PvlKeyword("NULL", Isis::toString(Isis::NULL2)); + imageObject += PvlKeyword("LOW_REPR_SATURATION", Isis::toString(Isis::LOW_REPR_SAT2)); + imageObject += PvlKeyword("LOW_INSTR_SATURATION", Isis::toString(Isis::LOW_INSTR_SAT2)); + imageObject += PvlKeyword("HIGH_INSTR_SATURATION", Isis::toString(Isis::HIGH_INSTR_SAT2)); + imageObject += PvlKeyword("HIGH_REPR_SATURATION", Isis::toString(Isis::HIGH_REPR_SAT2)); imageObject += PvlKeyword("UNIT", "Scaled I/F"); } else { @@ -233,13 +233,13 @@ namespace Isis { int recordBytes = cube->sampleCount(); int labelRecords = (int) ((stream.str().length()) / recordBytes) + 1; - labelPvl["RECORD_BYTES"] = toString(recordBytes); + labelPvl["RECORD_BYTES"] = Isis::toString(recordBytes); if (g_isIof) - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 2 + labelRecords)); + labelPvl["FILE_RECORDS"] = Isis::toString((int) (cube->lineCount() * 2 + labelRecords)); else - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords)); - labelPvl["LABEL_RECORDS"] = toString(labelRecords); - labelPvl["^IMAGE"] = toString((int) (labelRecords + 1)); + labelPvl["FILE_RECORDS"] = Isis::toString((int) (cube->lineCount() * 4 + labelRecords)); + labelPvl["LABEL_RECORDS"] = Isis::toString(labelRecords); + labelPvl["^IMAGE"] = Isis::toString((int) (labelRecords + 1)); stream.str(std::string()); @@ -251,9 +251,9 @@ namespace Isis { while ((int)pdsLabel.length() + 2 > (int)(labelRecords * recordBytes)) { labelRecords++; // Refresh the label content - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords)); - labelPvl["LABEL_RECORDS"] = toString(labelRecords); - labelPvl["^IMAGE"] = toString((int) (labelRecords + 1)); + labelPvl["FILE_RECORDS"] = Isis::toString((int) (cube->lineCount() * 4 + labelRecords)); + labelPvl["LABEL_RECORDS"] = Isis::toString(labelRecords); + labelPvl["^IMAGE"] = Isis::toString((int) (labelRecords + 1)); stream.str(std::string()); stream << labelPvl; pdsLabel = stream.str().c_str(); diff --git a/isis/src/lro/apps/lronaccal/lronaccal.cpp b/isis/src/lro/apps/lronaccal/lronaccal.cpp index aa77dcd681..826ac08b7c 100644 --- a/isis/src/lro/apps/lronaccal/lronaccal.cpp +++ b/isis/src/lro/apps/lronaccal/lronaccal.cpp @@ -192,10 +192,10 @@ namespace Isis { } for(int i = 0; i < maskedPixels.size(); i++) - if((g_isLeftNac && IString::ToInteger(maskedPixels[i]) < cutoff) || (!g_isLeftNac && IString::ToInteger(maskedPixels[i]) > cutoff)) - g_maskedPixelsLeft.push_back(IString::ToInteger(maskedPixels[i])); + if((g_isLeftNac && Isis::toInt(maskedPixels[i]) < cutoff) || (!g_isLeftNac && Isis::toInt(maskedPixels[i]) > cutoff)) + g_maskedPixelsLeft.push_back(Isis::toInt(maskedPixels[i])); else - g_maskedPixelsRight.push_back(IString::ToInteger(maskedPixels[i])); + g_maskedPixelsRight.push_back(Isis::toInt(maskedPixels[i])); } vector darkFiles; @@ -363,9 +363,9 @@ namespace Isis { if(g_masked) { PvlKeyword darkColumns("DarkColumns"); for(unsigned int i = 0; i < g_maskedPixelsLeft.size(); i++) - darkColumns += toString(g_maskedPixelsLeft[i]); + darkColumns += Isis::toString(g_maskedPixelsLeft[i]); for(unsigned int i = 0; i < g_maskedPixelsRight.size(); i++) - darkColumns += toString(g_maskedPixelsRight[i]); + darkColumns += Isis::toString(g_maskedPixelsRight[i]); calgrp += darkColumns; } @@ -395,18 +395,18 @@ namespace Isis { if(g_iof) { calgrp += PvlKeyword("RadiometricType", "IOF"); if(g_isLeftNac) - calgrp += PvlKeyword("ResponsivityValue", toString(g_iofLeft)); + calgrp += PvlKeyword("ResponsivityValue", Isis::toString(g_iofLeft)); else - calgrp += PvlKeyword("ResponsivityValue", toString(g_iofRight)); + calgrp += PvlKeyword("ResponsivityValue", Isis::toString(g_iofRight)); } else { calgrp += PvlKeyword("RadiometricType", "AbsoluteRadiance"); if(g_isLeftNac) - calgrp += PvlKeyword("ResponsivityValue", toString(g_radianceLeft)); + calgrp += PvlKeyword("ResponsivityValue", Isis::toString(g_radianceLeft)); else - calgrp += PvlKeyword("ResponsivityValue", toString(g_radianceRight)); + calgrp += PvlKeyword("ResponsivityValue", Isis::toString(g_radianceRight)); } - calgrp += PvlKeyword("SolarDistance", toString(g_solarDistance)); + calgrp += PvlKeyword("SolarDistance", Isis::toString(g_solarDistance)); } oCube->putGroup(calgrp); diff --git a/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp b/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp index 6eca37e3f1..bb8c0c8c6f 100644 --- a/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp +++ b/isis/src/lro/apps/lronacpho/LROCEmpirical.cpp @@ -93,7 +93,7 @@ namespace Isis { std::string errs(""); for (int i = 0; i < cube.bandCount(); i++) { - Parameters parms = findParameters(IString::ToDouble(center[i])); + Parameters parms = findParameters(Isis::toDouble(center[i])); if (parms.IsValid()) { parms.band = i + 1; parms.phoStd = photometry(parms, m_iRef, m_eRef, m_gRef); @@ -236,10 +236,10 @@ namespace Isis { } pvl += PvlKeyword("Algorithm", "LROC_Empirical"); - pvl += PvlKeyword("AlgorithmVersion", toString(m_bandpho[0].algoVersion), "" ); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("AlgorithmVersion", Isis::toString(m_bandpho[0].algoVersion), "" ); + pvl += PvlKeyword("IncRef", Isis::toString(m_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", Isis::toString(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", Isis::toString(m_gRef), "degrees"); PvlKeyword units("FunctionUnits"); PvlKeyword phostd("PhotometricStandard"); @@ -250,21 +250,21 @@ namespace Isis { std::vector aTermKeywords; std::vector bTermKeywords; for (unsigned int i = 0; i < m_bandpho[0].aTerms.size(); i++) - aTermKeywords.push_back(PvlKeyword("A" + toString((int) i))); + aTermKeywords.push_back(PvlKeyword("A" + Isis::toString((int) i))); for (unsigned int i = 0; i < m_bandpho[0].bTerms.size(); i++) - bTermKeywords.push_back(PvlKeyword("B" + toString((int) i))); + bTermKeywords.push_back(PvlKeyword("B" + Isis::toString((int) i))); for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; units.addValue(p.units.toStdString()); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); + phostd.addValue(Isis::toString(p.phoStd)); + bbc.addValue(Isis::toString(p.wavelength)); + bbct.addValue(Isis::toString(p.tolerance)); + bbn.addValue(Isis::toString(p.band)); for (unsigned int j = 0; j < aTermKeywords.size(); j++) - aTermKeywords[j].addValue(toString(p.aTerms[j])); + aTermKeywords[j].addValue(Isis::toString(p.aTerms[j])); for (unsigned int j = 0; j < bTermKeywords.size(); j++) - bTermKeywords[j].addValue(toString(p.bTerms[j])); + bTermKeywords[j].addValue(Isis::toString(p.bTerms[j])); } pvl += units; diff --git a/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp b/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp index 115caf0164..3ae57c0af7 100644 --- a/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp +++ b/isis/src/lro/apps/lrowac2isis/lrowac2isis.cpp @@ -222,7 +222,7 @@ namespace Isis { OriginalLabel origLabel(pdsLab); int numFramelets = padding.size(); - PvlKeyword numFrameletsKeyword("NumFramelets", toString(numFramelets)); + PvlKeyword numFrameletsKeyword("NumFramelets", Isis::toString(numFramelets)); if(uveven) { for(int grp = 0; grp < isis3UvEvenLab.groups(); grp++) { @@ -495,10 +495,10 @@ namespace Isis { // color offset doesn't apply to BW mode (single band cubes) if(colorOffset && viseven && viseven->bandCount() == 1) { - genericInstrument.push_back(PvlKeyword("ColorOffset", toString(0))); + genericInstrument.push_back(PvlKeyword("ColorOffset", Isis::toString(0))); } else { - genericInstrument.push_back(PvlKeyword("ColorOffset", toString(colorOffset))); + genericInstrument.push_back(PvlKeyword("ColorOffset", Isis::toString(colorOffset))); } genericInstrument.push_back(PvlKeyword("Decompanded", (ui.GetBoolean("UNLUT") ? "Yes" : "No"))); @@ -520,14 +520,14 @@ namespace Isis { // add labels unique to particular files if(viseven) { visEvenInst.addKeyword(PvlKeyword("Framelets", "Even")); - visEvenInst.addKeyword(PvlKeyword("NumFramelets", toString(viseven->lineCount() / 14))); + visEvenInst.addKeyword(PvlKeyword("NumFramelets", Isis::toString(viseven->lineCount() / 14))); visEvenInst.addKeyword(PvlKeyword("InstrumentId", "WAC-VIS"), Pvl::Replace); visEvenInst.addKeyword(PvlKeyword("InstrumentModeId", pdsLab["INSTRUMENT_MODE_ID"])); } if(visodd) { visOddInst.addKeyword(PvlKeyword("Framelets", "Odd")); - visOddInst.addKeyword(PvlKeyword("NumFramelets", toString(visodd->lineCount() / 14))); + visOddInst.addKeyword(PvlKeyword("NumFramelets", Isis::toString(visodd->lineCount() / 14))); visOddInst.addKeyword(PvlKeyword("InstrumentId", "WAC-VIS"), Pvl::Replace); visOddInst.addKeyword(PvlKeyword("InstrumentModeId", pdsLab["INSTRUMENT_MODE_ID"])); } @@ -549,7 +549,7 @@ namespace Isis { } else { for(int i = 0; i < pdsLab["FILTER_NUMBER"].size(); i++) { - if(IString::ToInteger(pdsLab["FILTER_NUMBER"][i]) > 2) { + if(Isis::toInt(pdsLab["FILTER_NUMBER"][i]) > 2) { visWavelength += pdsLab["CENTER_FILTER_WAVELENGTH"][i]; visFilterNum += pdsLab["FILTER_NUMBER"][i]; @@ -577,14 +577,14 @@ namespace Isis { if(uveven) { uvEvenInst.addKeyword(PvlKeyword("Framelets", "Even")); - uvEvenInst.addKeyword(PvlKeyword("NumFramelets", toString(uveven->lineCount() / 4))); + uvEvenInst.addKeyword(PvlKeyword("NumFramelets", Isis::toString(uveven->lineCount() / 4))); uvEvenInst.addKeyword(PvlKeyword("InstrumentId", "WAC-UV"), Pvl::Replace); uvEvenInst.addKeyword(PvlKeyword("InstrumentModeId", pdsLab["INSTRUMENT_MODE_ID"])); } if(uvodd) { uvOddInst.addKeyword(PvlKeyword("Framelets", "Odd")); - uvOddInst.addKeyword(PvlKeyword("NumFramelets", toString(uvodd->lineCount() / 4))); + uvOddInst.addKeyword(PvlKeyword("NumFramelets", Isis::toString(uvodd->lineCount() / 4))); uvOddInst.addKeyword(PvlKeyword("InstrumentId", "WAC-UV"), Pvl::Replace); uvOddInst.addKeyword(PvlKeyword("InstrumentModeId", pdsLab["INSTRUMENT_MODE_ID"])); } @@ -596,7 +596,7 @@ namespace Isis { PvlKeyword uvBandwidth("Width"); for(int i = 0; i < pdsLab["FILTER_NUMBER"].size(); i++) { - if(IString::ToInteger(pdsLab["FILTER_NUMBER"][i]) <= 2) { + if(Isis::toInt(pdsLab["FILTER_NUMBER"][i]) <= 2) { uvWavelength += pdsLab["CENTER_FILTER_WAVELENGTH"][i]; uvFilterNum += pdsLab["FILTER_NUMBER"][i]; @@ -742,7 +742,7 @@ namespace Isis { bool found = false; bool match = false; for(int j = 0; !found && j < (int) filters.size(); j++) { - if(IString::ToInteger(pdsLab["FILTER_NUMBER"][i]) == filters[j].first) { + if(Isis::toInt(pdsLab["FILTER_NUMBER"][i]) == filters[j].first) { found = true; match = (pdsLab["CENTER_FILTER_WAVELENGTH"][i] == filters[j].second.toStdString()); diff --git a/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp b/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp index a04ad309b7..875e9c7efe 100644 --- a/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp +++ b/isis/src/lro/apps/lrowac2pds/lrowac2pds.cpp @@ -418,9 +418,9 @@ namespace Isis { // Update the "IMAGE" Object PvlObject &imageObject = labelPvl.findObject("IMAGE"); imageObject.clear(); - imageObject += PvlKeyword("LINES", toString(cube->lineCount())); - imageObject += PvlKeyword("LINE_SAMPLES", toString(cube->sampleCount())); - imageObject += PvlKeyword("SAMPLE_BITS", toString(32)); + imageObject += PvlKeyword("LINES", Isis::toString(cube->lineCount())); + imageObject += PvlKeyword("LINE_SAMPLES", Isis::toString(cube->sampleCount())); + imageObject += PvlKeyword("SAMPLE_BITS", Isis::toString(32)); imageObject += PvlKeyword("SAMPLE_TYPE", "PC_REAL"); imageObject += PvlKeyword("VALID_MINIMUM", "16#FF7FFFFA#"); imageObject += PvlKeyword("NULL", "16#FF7FFFFB#"); @@ -439,10 +439,10 @@ namespace Isis { int recordBytes = cube->sampleCount(); int labelRecords = (int) ((stream.str().length()) / recordBytes) + 1; - labelPvl["RECORD_BYTES"] = toString(recordBytes); - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords)); - labelPvl["LABEL_RECORDS"] = toString(labelRecords); - labelPvl["^IMAGE"] = toString((int) (labelRecords + 1)); + labelPvl["RECORD_BYTES"] = Isis::toString(recordBytes); + labelPvl["FILE_RECORDS"] = Isis::toString((int) (cube->lineCount() * 4 + labelRecords)); + labelPvl["LABEL_RECORDS"] = Isis::toString(labelRecords); + labelPvl["^IMAGE"] = Isis::toString((int) (labelRecords + 1)); stream.str(std::string()); @@ -455,9 +455,9 @@ namespace Isis { while ((int)pdsLabel.length() + 2 > (int)(labelRecords * recordBytes)) { labelRecords++; // Refresh the label content - labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords)); - labelPvl["LABEL_RECORDS"] = toString(labelRecords); - labelPvl["^IMAGE"] = toString((int) (labelRecords + 1)); + labelPvl["FILE_RECORDS"] = Isis::toString((int) (cube->lineCount() * 4 + labelRecords)); + labelPvl["LABEL_RECORDS"] = Isis::toString(labelRecords); + labelPvl["^IMAGE"] = Isis::toString((int) (labelRecords + 1)); stream.str(std::string()); stream << labelPvl; pdsLabel = stream.str().c_str(); diff --git a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp index 76d9ba537f..10f90f8987 100644 --- a/isis/src/lro/apps/lrowaccal/lrowaccal.cpp +++ b/isis/src/lro/apps/lrowaccal/lrowaccal.cpp @@ -653,7 +653,7 @@ namespace Isis { responsivity = radPvl["IOF"]; for (int i = 0; i < bands.size(); i++) { - g_iofResponsivity.push_back(IString::ToDouble(responsivity[IString::ToInteger(bands[i]) - 1])); + g_iofResponsivity.push_back(Isis::toDouble(responsivity[Isis::toInt(bands[i]) - 1])); } try { @@ -704,7 +704,7 @@ namespace Isis { else { responsivity = radPvl["Radiance"]; for (int i = 0; i < bands.size(); i++) - g_radianceResponsivity.push_back(IString::ToDouble(responsivity[IString::ToInteger(bands[i]) - 1])); + g_radianceResponsivity.push_back(Isis::toDouble(responsivity[Isis::toInt(bands[i]) - 1])); } } @@ -738,8 +738,8 @@ namespace Isis { Pvl tempPvl(tempFileName.expanded()); temperaturePvl.addValue(tempFileName.expanded()); for (int b = 0; b < bands.size(); b++){ - g_TempratureConstants[g_bands[b]][0]=IString::ToDouble(tempPvl[bands[b]][0]); - g_TempratureConstants[g_bands[b]][1]=IString::ToDouble(tempPvl[bands[b]][1]); + g_TempratureConstants[g_bands[b]][0]=Isis::toDouble(tempPvl[bands[b]][0]); + g_TempratureConstants[g_bands[b]][1]=Isis::toDouble(tempPvl[bands[b]][1]); } } @@ -781,15 +781,15 @@ namespace Isis { if (g_iof) { calgrp += PvlKeyword("RadiometricType", "IOF"); for (unsigned int i=0; i< g_iofResponsivity.size(); i++) - vals.addValue(toString(g_iofResponsivity[i])); + vals.addValue(Isis::toString(g_iofResponsivity[i])); } else { calgrp += PvlKeyword("RadiometricType", "AbsoluteRadiance", "W/m2/sr/um"); for (unsigned int i=0; i< g_radianceResponsivity.size(); i++) - vals.addValue(toString(g_radianceResponsivity[i])); + vals.addValue(Isis::toString(g_radianceResponsivity[i])); } calgrp += vals; - calgrp += PvlKeyword("SolarDistance", toString(g_solarDistance)); + calgrp += PvlKeyword("SolarDistance", Isis::toString(g_solarDistance)); } if (g_specpix) calgrp += PvlKeyword("SpecialPixelsFile", specpixFile.toStdString()); diff --git a/isis/src/lro/apps/lrowacpho/Exponential.cpp b/isis/src/lro/apps/lrowacpho/Exponential.cpp index d8dea2bcd6..2838c17ea0 100644 --- a/isis/src/lro/apps/lrowacpho/Exponential.cpp +++ b/isis/src/lro/apps/lrowacpho/Exponential.cpp @@ -116,9 +116,9 @@ namespace Isis { pvl.addComment(" F(phase) = A0*exp(B0*phase) + A1*exp(B1*phase) + ... + An*exp(Bn*phase)"); pvl += PvlKeyword("Algorithm", "Exponential"); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("IncRef", Isis::toString(m_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", Isis::toString(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", Isis::toString(m_gRef), "degrees"); PvlKeyword units("ExponentialUnits"); PvlKeyword phostd("PhotometricStandard"); PvlKeyword bbc("BandBinCenter"); @@ -128,21 +128,21 @@ namespace Isis { std::vector < PvlKeyword > aTermKeywords; std::vector < PvlKeyword > bTermKeywords; for (unsigned int i = 0; i < m_bandpho[0].aTerms.size(); i++) - aTermKeywords.push_back(PvlKeyword("A" + toString((int) i))); + aTermKeywords.push_back(PvlKeyword("A" + Isis::toString((int) i))); for (unsigned int i = 0; i < m_bandpho[0].bTerms.size(); i++) - bTermKeywords.push_back(PvlKeyword("B" + toString((int) i))); + bTermKeywords.push_back(PvlKeyword("B" + Isis::toString((int) i))); for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; units.addValue(p.units.toStdString()); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); + phostd.addValue(Isis::toString(p.phoStd)); + bbc.addValue(Isis::toString(p.wavelength)); + bbct.addValue(Isis::toString(p.tolerance)); + bbn.addValue(Isis::toString(p.band)); for (unsigned int j = 0; j < aTermKeywords.size(); j++) - aTermKeywords[j].addValue(toString(p.aTerms[j])); + aTermKeywords[j].addValue(Isis::toString(p.aTerms[j])); for (unsigned int j = 0; j < bTermKeywords.size(); j++) - bTermKeywords[j].addValue(toString(p.bTerms[j])); + bTermKeywords[j].addValue(Isis::toString(p.bTerms[j])); } pvl += units; pvl += phostd; @@ -268,7 +268,7 @@ namespace Isis { PvlKeyword center = label->findGroup("BandBin", Pvl::Traverse)["Center"]; std::string errs(""); for (int i = 0; i < cube.bandCount(); i++) { - Parameters parms = findParameters(IString::ToDouble(center[i])); + Parameters parms = findParameters(Isis::toDouble(center[i])); if (parms.IsValid()) { parms.band = i + 1; //_camera->SetBand(i + 1); diff --git a/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp b/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp index 02c223eed2..abae7957af 100644 --- a/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp +++ b/isis/src/lro/apps/lrowacpho/HapkeExponential.cpp @@ -121,9 +121,9 @@ namespace Isis { pvl.addComment(" F(mu,mu0,phase) = A1*exp(B1*phase) + A2*( mu0 + mu )exp(B2*phase) + A3*( mu0 + mu ) + A4"); pvl += PvlKeyword("Algorithm", "HapkeExponential"); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("IncRef", Isis::toString(m_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", Isis::toString(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", Isis::toString(m_gRef), "degrees"); PvlKeyword units("HapkeExponentialUnits"); PvlKeyword phostd("PhotometricStandard"); PvlKeyword bbc("BandBinCenter"); @@ -133,21 +133,21 @@ namespace Isis { std::vector aTermKeywords; std::vector bTermKeywords; for (unsigned int i = 0; i < m_bandpho[0].aTerms.size(); i++) - aTermKeywords.push_back(PvlKeyword("A" + toString((int) i+1))); + aTermKeywords.push_back(PvlKeyword("A" + Isis::toString((int) i+1))); for (unsigned int i = 0; i < m_bandpho[0].bTerms.size(); i++) - bTermKeywords.push_back(PvlKeyword("B" + toString((int) i+1))); + bTermKeywords.push_back(PvlKeyword("B" + Isis::toString((int) i+1))); for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; units.addValue(p.units.toStdString()); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); + phostd.addValue(Isis::toString(p.phoStd)); + bbc.addValue(Isis::toString(p.wavelength)); + bbct.addValue(Isis::toString(p.tolerance)); + bbn.addValue(Isis::toString(p.band)); for (unsigned int j = 0; j < aTermKeywords.size(); j++) - aTermKeywords[j].addValue(toString(p.aTerms[j])); + aTermKeywords[j].addValue(Isis::toString(p.aTerms[j])); for (unsigned int j = 0; j < bTermKeywords.size(); j++) - bTermKeywords[j].addValue(toString(p.bTerms[j])); + bTermKeywords[j].addValue(Isis::toString(p.bTerms[j])); } pvl += units; pvl += phostd; @@ -271,7 +271,7 @@ namespace Isis { PvlKeyword center = label->findGroup("BandBin", Pvl::Traverse)["Center"]; std::string errs(""); for (int i = 0; i < cube.bandCount(); i++) { - Parameters parms = findParameters(IString::ToDouble(center[i])); + Parameters parms = findParameters(Isis::toDouble(center[i])); if (parms.IsValid()) { parms.band = i + 1; //_camera->SetBand(i + 1); diff --git a/isis/src/lro/apps/lrowacpho/Hillier.cpp b/isis/src/lro/apps/lrowacpho/Hillier.cpp index 6ccab202d0..4e1b8262f4 100644 --- a/isis/src/lro/apps/lrowacpho/Hillier.cpp +++ b/isis/src/lro/apps/lrowacpho/Hillier.cpp @@ -114,9 +114,9 @@ namespace Isis { pvl.addComment(" F(phase) = B0*exp(-B1*phase) + A0 + A1*phase + A2*phase^2 + A3*phase^3 + A4*phase^4"); pvl += PvlKeyword("Algorithm", "Hillier"); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmaRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("IncRef", Isis::toString(m_iRef), "degrees"); + pvl += PvlKeyword("EmaRef", Isis::toString(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", Isis::toString(m_gRef), "degrees"); PvlKeyword units("HillierUnits"); PvlKeyword phostd("PhotometricStandard"); PvlKeyword bbc("BandBinCenter"); @@ -132,17 +132,17 @@ namespace Isis { for (unsigned int i = 0; i < m_bandpho.size(); i++) { Parameters &p = m_bandpho[i]; units.addValue(p.units.toStdString()); - phostd.addValue(toString(p.phoStd)); - bbc.addValue(toString(p.wavelength)); - bbct.addValue(toString(p.tolerance)); - bbn.addValue(toString(p.band)); - b0.addValue(toString(p.b0)); - b1.addValue(toString(p.b1)); - a0.addValue(toString(p.a0)); - a1.addValue(toString(p.a1)); - a2.addValue(toString(p.a2)); - a3.addValue(toString(p.a3)); - a4.addValue(toString(p.a4)); + phostd.addValue(Isis::toString(p.phoStd)); + bbc.addValue(Isis::toString(p.wavelength)); + bbct.addValue(Isis::toString(p.tolerance)); + bbn.addValue(Isis::toString(p.band)); + b0.addValue(Isis::toString(p.b0)); + b1.addValue(Isis::toString(p.b1)); + a0.addValue(Isis::toString(p.a0)); + a1.addValue(Isis::toString(p.a1)); + a2.addValue(Isis::toString(p.a2)); + a3.addValue(Isis::toString(p.a3)); + a4.addValue(Isis::toString(p.a4)); } pvl += units; pvl += phostd; @@ -267,7 +267,7 @@ namespace Isis { PvlKeyword center = label->findGroup("BandBin", Pvl::Traverse)["Center"]; std::string errs(""); for (int i = 0; i < cube.bandCount(); i++) { - Parameters parms = findParameters(IString::ToDouble(center[i])); + Parameters parms = findParameters(Isis::toDouble(center[i])); if (parms.IsValid()) { parms.band = i + 1; //_camera->SetBand(i + 1); diff --git a/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp b/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp index 364aa16990..7742f44c7b 100644 --- a/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp +++ b/isis/src/lro/apps/lrowacphomap/HapkeLRO.cpp @@ -65,9 +65,9 @@ namespace Isis { m_currentMapIndex = 0; PvlObject phoModel = pvl.findObject("PhotometricModel"); - m_iRef = IString::ToDouble(phoModel.findKeyword("Incref")[0]); // Incidence refernce angle - m_eRef = IString::ToDouble(phoModel.findKeyword("EmiRef")[0]); // Emission reference angle - m_gRef = IString::ToDouble(phoModel.findKeyword("Pharef")[0]); // Phase reference angle + m_iRef = Isis::toDouble(phoModel.findKeyword("Incref")[0]); // Incidence refernce angle + m_eRef = Isis::toDouble(phoModel.findKeyword("EmiRef")[0]); // Emission reference angle + m_gRef = Isis::toDouble(phoModel.findKeyword("Pharef")[0]); // Phase reference angle if (QString::fromStdString(phoModel.findKeyword("Units")[0]).toUpper() == "DEGREES") { m_isDegrees = true; } @@ -85,7 +85,7 @@ namespace Isis { PvlGroup paramGroup = phoModel.group(i); HapkeLRO::Parameters parms; - parms.bandBinCenter = IString::ToDouble(paramGroup.findKeyword("BandBinCenter")[0]); + parms.bandBinCenter = Isis::toDouble(paramGroup.findKeyword("BandBinCenter")[0]); for (int j = 0; j < center.size(); j++) { if (center[j] == paramGroup.findKeyword("BandBinCenter")[0]) { parms.band = j + 1; @@ -94,8 +94,8 @@ namespace Isis { PvlKeyword bands = paramGroup.findKeyword("Bands"); for (int j = 0; j < bands.size(); j++) { - parms.mapBands.push_back(IString::ToInteger(bands[j]) - 1); - parms.names.push_back(QString::fromStdString(paramBandNames[IString::ToInteger(bands[j]) - 1]).toUpper()); + parms.mapBands.push_back(Isis::toInt(bands[j]) - 1); + parms.names.push_back(QString::fromStdString(paramBandNames[Isis::toInt(bands[j]) - 1]).toUpper()); parms.values.push_back(0.0); } @@ -329,9 +329,9 @@ namespace Isis { pvl += PvlKeyword("Algorithm", "HapkeLRO"); pvl += PvlKeyword("ParameterMapCube", m_paramMap->fileName().toStdString()); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmiRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("IncRef", Isis::toString(m_iRef), "degrees"); + pvl += PvlKeyword("EmiRef", Isis::toString(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", Isis::toString(m_gRef), "degrees"); PvlKeyword units("Units"); if (m_isDegrees) { diff --git a/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp b/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp index 1f5cedad3c..d7a5302f73 100644 --- a/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp +++ b/isis/src/lro/apps/lrowacphomap/HapkeLROC.cpp @@ -57,9 +57,9 @@ namespace Isis { m_currentMapIndex = 0; PvlObject phoModel = pvl.findObject("PhotometricModel"); - m_iRef = IString::ToDouble(phoModel.findKeyword("Incref")[0]); // Incidence refernce angle - m_eRef = IString::ToDouble(phoModel.findKeyword("EmiRef")[0]); // Emission reference angle - m_gRef = IString::ToDouble(phoModel.findKeyword("Pharef")[0]); // Phase reference angle + m_iRef = Isis::toDouble(phoModel.findKeyword("Incref")[0]); // Incidence refernce angle + m_eRef = Isis::toDouble(phoModel.findKeyword("EmiRef")[0]); // Emission reference angle + m_gRef = Isis::toDouble(phoModel.findKeyword("Pharef")[0]); // Phase reference angle if (QString::fromStdString(phoModel.findKeyword("Units")[0]).toUpper() == "DEGREES") { m_isDegrees = true; @@ -78,7 +78,7 @@ namespace Isis { PvlGroup paramGroup = phoModel.group(i); HapkeLROC::Parameters parms; - parms.bandBinCenter = IString::ToDouble(paramGroup.findKeyword("BandBinCenter")[0]); + parms.bandBinCenter = Isis::toDouble(paramGroup.findKeyword("BandBinCenter")[0]); for (int j = 0; j < center.size(); j++) { if (center[j] == paramGroup.findKeyword("BandBinCenter")[0]) { parms.band = j + 1; @@ -87,8 +87,8 @@ namespace Isis { PvlKeyword bands = paramGroup.findKeyword("Bands"); for (int j = 0; j < bands.size(); j++) { - parms.mapBands.push_back(IString::ToInteger(bands[j]) - 1); - parms.names.push_back(QString::fromStdString(paramBandNames[IString::ToInteger(bands[j]) - 1]).toUpper()); + parms.mapBands.push_back(Isis::toInt(bands[j]) - 1); + parms.names.push_back(QString::fromStdString(paramBandNames[Isis::toInt(bands[j]) - 1]).toUpper()); parms.values.push_back(0.0); } @@ -616,9 +616,9 @@ namespace Isis { void HapkeLROC::report(PvlContainer &pvl) { pvl += PvlKeyword("Algorithm", "HapkeLROC"); pvl += PvlKeyword("ParameterMapCube", m_paramMap->fileName().toStdString()); - pvl += PvlKeyword("IncRef", toString(m_iRef), "degrees"); - pvl += PvlKeyword("EmiRef", toString(m_eRef), "degrees"); - pvl += PvlKeyword("PhaRef", toString(m_gRef), "degrees"); + pvl += PvlKeyword("IncRef", Isis::toString(m_iRef), "degrees"); + pvl += PvlKeyword("EmiRef", Isis::toString(m_eRef), "degrees"); + pvl += PvlKeyword("PhaRef", Isis::toString(m_gRef), "degrees"); PvlKeyword units("Units"); if (m_isDegrees) { diff --git a/isis/src/lro/apps/mrf2isis/main.cpp b/isis/src/lro/apps/mrf2isis/main.cpp index 0f46450303..8f783636d0 100644 --- a/isis/src/lro/apps/mrf2isis/main.cpp +++ b/isis/src/lro/apps/mrf2isis/main.cpp @@ -149,15 +149,15 @@ void IsisMain() { else { // BASELINE_X or ZOOM_X frequency = 7140000000.0; } - instGrp.addKeyword(PvlKeyword("Frequency", toString(frequency))); + instGrp.addKeyword(PvlKeyword("Frequency", Isis::toString(frequency))); outcube->putGroup(instGrp); } PvlGroup kerns("Kernels"); if(id.startsWith("CHAN1") || id.startsWith("CH1")) { - kerns += PvlKeyword("NaifFrameCode", toString(-86001)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-86001)); } else { // LRO - kerns += PvlKeyword("NaifFrameCode", toString(-85700)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-85700)); } outcube->putGroup(kerns); } diff --git a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp index 87d15b0d34..6345ea7ce4 100644 --- a/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp +++ b/isis/src/lro/objs/LroWideAngleCamera/LroWideAngleCamera.cpp @@ -59,7 +59,7 @@ namespace Isis { QString stime = QString::fromStdString(inst["SpacecraftClockStartCount"]); et = getClockTime(stime).Et(); - p_exposureDur = IString::ToDouble(inst["ExposureDuration"]); + p_exposureDur = Isis::toDouble(inst["ExposureDuration"]); // TODO: Changed et - exposure to et + exposure. // Think about if this is correct p_etStart = et + ((p_exposureDur / 1000.0) / 2.0); @@ -148,15 +148,15 @@ namespace Isis { // Now map the actual filters that exist in cube to camera components or // storage vectors for later band selection (see SetBand(vband)) for (int i = 0; i < filtNames.size(); i++) { - if (!filterToDetectorOffset.exists(IString::ToInteger(filtNames[i]))) { + if (!filterToDetectorOffset.exists(Isis::toInt(filtNames[i]))) { std::string msg = "Unrecognized filter name [" + filtNames[i] + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } - p_detectorStartLines.push_back(filterToDetectorOffset.get(IString::ToInteger(filtNames[i]))); - p_frameletOffsets.push_back(filterToFrameletOffset.get(IString::ToInteger(filtNames[i]))); + p_detectorStartLines.push_back(filterToDetectorOffset.get(Isis::toInt(filtNames[i]))); + p_frameletOffsets.push_back(filterToFrameletOffset.get(Isis::toInt(filtNames[i]))); - QString kBase = "INS" + QString::number(filterIKCode.get(IString::ToInteger(filtNames[i]))); + QString kBase = "INS" + QString::number(filterIKCode.get(Isis::toInt(filtNames[i]))); p_focalLength.push_back(getDouble(kBase+"_FOCAL_LENGTH")); p_boreSightSample.push_back(getDouble(kBase+"_BORESIGHT_SAMPLE")); p_boreSightLine.push_back(getDouble(kBase+"_BORESIGHT_LINE")); @@ -194,8 +194,8 @@ namespace Isis { LroWideAngleCameraDistortionMap *distort = new LroWideAngleCameraDistortionMap(this, naifIkCode()); for ( int i = 0 ; i < filtNames.size() ; i++ ) { - fplane->addFilter(filterIKCode.get(IString::ToInteger(filtNames[i]))); - distort->addFilter(filterIKCode.get(IString::ToInteger(filtNames[i]))); + fplane->addFilter(filterIKCode.get(Isis::toInt(filtNames[i]))); + distort->addFilter(filterIKCode.get(Isis::toInt(filtNames[i]))); } // Setup the ground and sky map @@ -307,7 +307,7 @@ namespace Isis { PvlKeyword kw = NaifKeywords[key.toStdString()]; IntParameterList parms; for (int i = 0; ifileName().toStdString()); } calgrp += PvlKeyword("CoefficientCube", coCube.fileName().toStdString()); - calgrp += PvlKeyword("AbsoluteCoefficient", toString(absCoef)); + calgrp += PvlKeyword("AbsoluteCoefficient", Isis::toString(absCoef)); ocube->putGroup(calgrp); diff --git a/isis/src/mer/apps/mical/MiCalibration.cpp b/isis/src/mer/apps/mical/MiCalibration.cpp index 2bfdab52f6..fd49c004d9 100644 --- a/isis/src/mer/apps/mical/MiCalibration.cpp +++ b/isis/src/mer/apps/mical/MiCalibration.cpp @@ -36,8 +36,8 @@ namespace Isis { image.label()->findGroup("Instrument", Pvl::Traverse); p_exposureDuration = labelgrp["ExposureDuration"]; p_instrumentSerialNumber = labelgrp["InstrumentSerialNumber"]; - p_CCDTemperature = IString::ToDouble(labelgrp["InstrumentTemperature"][6]); - p_PCBTemperature = IString::ToDouble(labelgrp["InstrumentTemperature"][7]); + p_CCDTemperature = Isis::toDouble(labelgrp["InstrumentTemperature"][6]); + p_PCBTemperature = Isis::toDouble(labelgrp["InstrumentTemperature"][7]); p_OffsetModeId = labelgrp["OffsetModeID"]; p_shuttereffectcorrectionflag = QString::fromStdString(labelgrp["ShutterEffectCorrectionFlag"]); p_filterName = QString::fromStdString(labelgrp["FilterName"]); diff --git a/isis/src/mer/apps/mical/main.cpp b/isis/src/mer/apps/mical/main.cpp index 51e9f7403a..44b9165983 100644 --- a/isis/src/mer/apps/mical/main.cpp +++ b/isis/src/mer/apps/mical/main.cpp @@ -144,12 +144,12 @@ void IsisMain() { calgrp += PvlKeyword("ReferencePixelValueSource", "ERPImage"); calgrp += PvlKeyword("ReferencePixelValueImage", ui.GetCubeName("REFPIXIMAGE").toStdString()); - calgrp += PvlKeyword("ReferencePixelValue", toString(gbl::ReferencePixelValue)); + calgrp += PvlKeyword("ReferencePixelValue", Isis::toString(gbl::ReferencePixelValue)); } else { gbl::ReferencePixelValue = gbl::mi->ReferencePixelModel(); calgrp += PvlKeyword("ReferencePixelValueSource", "ERPModel"); - calgrp += PvlKeyword("ReferenceModel", toString(gbl::ReferencePixelValue)); + calgrp += PvlKeyword("ReferenceModel", Isis::toString(gbl::ReferencePixelValue)); } // if user wants NO zero exposure or if shutter effect correction is true // set the user value to zero and set label output to reflect no correction @@ -159,7 +159,7 @@ void IsisMain() { calgrp += PvlKeyword("ZeroExposureImage", "NoCorrection"); } else { - calgrp += PvlKeyword("ZeroExposureValue", toString(gbl::mi->ZeroExposureValue())); + calgrp += PvlKeyword("ZeroExposureValue", Isis::toString(gbl::mi->ZeroExposureValue())); calgrp += PvlKeyword("ZeroExposureImage", gbl::mi->ZeroExposureImage().toStdString()); } // If user wants NO active area set user value to zero and set the label @@ -170,7 +170,7 @@ void IsisMain() { calgrp += PvlKeyword("ActiveAreaImage", "NoCorrection"); } else { - calgrp += PvlKeyword("ActiveAreaValue", toString(gbl::mi->ActiveAreaValue())); + calgrp += PvlKeyword("ActiveAreaValue", Isis::toString(gbl::mi->ActiveAreaValue())); calgrp += PvlKeyword("ActiveAreaImage", gbl::mi->ActiveAreaImage().toStdString()); } @@ -211,14 +211,14 @@ void IsisMain() { double fullModel = gbl::mi->ReferencePixelModel() + gbl::mi->ZeroExposureValue() + gbl::mi->ActiveAreaValue(); - calgrp += PvlKeyword("DarkCurrentFullModel", toString(fullModel)); + calgrp += PvlKeyword("DarkCurrentFullModel", Isis::toString(fullModel)); //Add temperature values to the radiometry group - calgrp += PvlKeyword("CCDTemperture", toString(gbl::mi->CCDTemperatureCorrect())); - calgrp += PvlKeyword("PCBTemperature", toString(gbl::mi->PCBTemperature())); + calgrp += PvlKeyword("CCDTemperture", Isis::toString(gbl::mi->CCDTemperatureCorrect())); + calgrp += PvlKeyword("PCBTemperature", Isis::toString(gbl::mi->PCBTemperature())); if(stagestop == "IOF") { - calgrp += PvlKeyword("OmegaNaught", toString(gbl::mi->OmegaNaught())); - calgrp += PvlKeyword("SunAU", toString(gbl::sunAU)); + calgrp += PvlKeyword("OmegaNaught", Isis::toString(gbl::mi->OmegaNaught())); + calgrp += PvlKeyword("SunAU", Isis::toString(gbl::sunAU)); } //write Radiometry group to the output cube. diff --git a/isis/src/messenger/apps/mdis2isis/main.cpp b/isis/src/messenger/apps/mdis2isis/main.cpp index 63e49ad472..d3d2788396 100644 --- a/isis/src/messenger/apps/mdis2isis/main.cpp +++ b/isis/src/messenger/apps/mdis2isis/main.cpp @@ -121,7 +121,7 @@ void IsisMain() { // Create YearDoy keyword in Archive group iTime stime( QString::fromStdString(outLabel.findGroup("Instrument", Pvl::Traverse)["StartTime"][0])); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", Isis::toString(stime.Year()*1000 + stime.DayOfYear())); (void) outLabel.findGroup("Archive", Pvl::Traverse).addKeyword(yeardoy); if(ui.GetBoolean("UNLUT") == false || !needsUnlut) { @@ -133,7 +133,7 @@ void IsisMain() { // Write the Instrument, BandBin, Archive, and Kernels groups to the output // cube label PvlGroup &group = outLabel.findGroup("Instrument", Pvl::Traverse); - group.addKeyword(PvlKeyword("Unlutted", toString((int)!needsUnlut))); + group.addKeyword(PvlKeyword("Unlutted", Isis::toString((int)!needsUnlut))); outCube->putGroup(group); outCube->putGroup(outLabel.findGroup("BandBin", Pvl::Traverse)); @@ -162,7 +162,7 @@ void IsisMain() { outCube->create(ui.GetCubeName("TO")); PvlGroup &group = outLabel.findGroup("Instrument", Pvl::Traverse); - group.addKeyword(PvlKeyword("Unlutted", toString((int)true))); + group.addKeyword(PvlKeyword("Unlutted", Isis::toString((int)true))); group.addKeyword(PvlKeyword("LutInversionTable", lutfile.toStdString())); outCube->label()->findObject("IsisCube").addGroup(group); @@ -237,7 +237,7 @@ Pvl TranslateMdisEdrLabels(FileName &labelFile, const QString &target) { // Compute the gimble pivot angle and write to the label double pivotCounter = (double) instGrp["PivotPosition"]; double pivotAngle = pivotCounter / ((double)(2 << 15)) * 180.0; - instGrp += PvlKeyword("PivotAngle", toString(pivotAngle), "Degrees"); + instGrp += PvlKeyword("PivotAngle", Isis::toString(pivotAngle), "Degrees"); return outLabel; } @@ -304,7 +304,7 @@ int CreateFilterSpecs(const QString &instId, int filter_code, naifCode = "-236800"; for(int filterTry = 1; filterTry <= 12 ; filterTry++) { - int idealPosition = confgrp["EncoderPosition" + toString(filterTry)]; + int idealPosition = confgrp["EncoderPosition" + Isis::toString(filterTry)]; if((filter_code <= (idealPosition + tolerance)) && (filter_code >= (idealPosition - tolerance))) { int fno = filterTry - 1; @@ -324,7 +324,7 @@ int CreateFilterSpecs(const QString &instId, int filter_code, } if(!name.isEmpty()) { - bandbin.addKeyword(PvlKeyword("Number", toString(filter)), PvlContainer::Replace); + bandbin.addKeyword(PvlKeyword("Number", Isis::toString(filter)), PvlContainer::Replace); bandbin.addKeyword(PvlKeyword("Name", name.toStdString()), PvlContainer::Replace); bandbin.addKeyword(PvlKeyword("Center", center.toStdString(), "NM"), PvlContainer::Replace); bandbin.addKeyword(PvlKeyword("Width", width.toStdString(), "NM"), PvlContainer::Replace); diff --git a/isis/src/messenger/apps/mdis2pds/main.cpp b/isis/src/messenger/apps/mdis2pds/main.cpp index 44a11d5c6e..a648d88b2c 100644 --- a/isis/src/messenger/apps/mdis2pds/main.cpp +++ b/isis/src/messenger/apps/mdis2pds/main.cpp @@ -47,7 +47,7 @@ inline void validateUnit(PvlKeyword &key, const QString &kunit) { for (int i = 0; i < temp.size(); i++) { try { // If this works, check unit, otherwise an exception is thrown - IString::ToDouble(temp[i]); + Isis::toDouble(temp[i]); QString unit = QString::fromStdString(temp.unit(i)); if (unit.isEmpty()) unit = kunit; key.addValue(temp[i], unit.toStdString()); @@ -230,12 +230,12 @@ void IsisMain() { p.CheckStatus(); // Creates keywords from the input's hist above - PvlKeyword minDn("MINIMUM", toString(setRound(hist->Minimum(), 16))); - PvlKeyword maxDn("MAXIMUM", toString(setRound(hist->Maximum(), 16))); - PvlKeyword meanDn("MEAN", toString(setRound(hist->Average(), 16))); - PvlKeyword stddev("STANDARD_DEVIATION", toString(setRound(hist->StandardDeviation(), 16))); + PvlKeyword minDn("MINIMUM", Isis::toString(setRound(hist->Minimum(), 16))); + PvlKeyword maxDn("MAXIMUM", Isis::toString(setRound(hist->Maximum(), 16))); + PvlKeyword meanDn("MEAN", Isis::toString(setRound(hist->Average(), 16))); + PvlKeyword stddev("STANDARD_DEVIATION", Isis::toString(setRound(hist->StandardDeviation(), 16))); - PvlKeyword saturated("SATURATED_PIXEL_COUNT", toString(hist->HisPixels())); + PvlKeyword saturated("SATURATED_PIXEL_COUNT", Isis::toString(hist->HisPixels())); PvlObject &imageObj = pdsLabel.findObject("IMAGE"); @@ -252,7 +252,7 @@ void IsisMain() { PvlKeyword &darkStripMean = imageObj.findKeyword("DARK_STRIP_MEAN"); try { - darkStripMean[0] = toString(setRound(IString::ToDouble(darkStripMean[0]), 16)); + darkStripMean[0] = Isis::toString(setRound(Isis::toDouble(darkStripMean[0]), 16)); } catch (IException &) { // If we fail to convert this keyword to a number, then preserve diff --git a/isis/src/messenger/apps/mdiscal/main.cpp b/isis/src/messenger/apps/mdiscal/main.cpp index a280f5d4f9..1c57b5a210 100644 --- a/isis/src/messenger/apps/mdiscal/main.cpp +++ b/isis/src/messenger/apps/mdiscal/main.cpp @@ -410,8 +410,8 @@ void IsisMain() { calibrationLog.addKeyword(PvlKeyword("DarkCurrentFile", darkCurrentFile.toStdString())); } - calibrationLog.addKeyword(PvlKeyword("BinnedImage", toString((int)g_isBinnedData))); - calibrationLog.addKeyword(PvlKeyword("FilterNumber", toString(g_filterNumber + 1))); + calibrationLog.addKeyword(PvlKeyword("BinnedImage", Isis::toString((int)g_isBinnedData))); + calibrationLog.addKeyword(PvlKeyword("FilterNumber", Isis::toString(g_filterNumber + 1))); if (g_applyFlatfield) { calibrationLog.addKeyword(PvlKeyword("FlatFieldFile", flatfield.originalPath() + "/" + flatfield.name())); @@ -423,20 +423,20 @@ void IsisMain() { calibFile.originalPath() + "/" + calibFile.name())); calibrationLog.addKeyword(PvlKeyword("ResponsivityFile", respfile.toStdString())); calibrationLog.addKeyword(PvlKeyword("SmearCompFile", smearfile.toStdString())); - PvlKeyword rspKey("Response", toString(rsp[0])); + PvlKeyword rspKey("Response", Isis::toString(rsp[0])); for (unsigned int i = 1; i < rsp.size(); i++) { - rspKey.addValue(toString(rsp[i])); + rspKey.addValue(Isis::toString(rsp[i])); } calibrationLog.addKeyword(rspKey); - calibrationLog.addKeyword(PvlKeyword("SmearComponent", toString(g_smearComponent))); + calibrationLog.addKeyword(PvlKeyword("SmearComponent", Isis::toString(g_smearComponent))); QString calibType; if (applyIOF && validIOF) { calibrationLog.addKeyword(PvlKeyword("Units", "I over F")); - calibrationLog.addKeyword(PvlKeyword("SolarDistance", toString(g_solarDist), "AU")); + calibrationLog.addKeyword(PvlKeyword("SolarDistance", Isis::toString(g_solarDist), "AU")); calibrationLog.addKeyword(PvlKeyword("SolarIrrFile", solirrfile.toStdString())); - calibrationLog.addKeyword(PvlKeyword("FilterIrradianceFactor", toString(g_Ff))); - calibrationLog.addKeyword(PvlKeyword("IOFFactor", toString(g_iof))); + calibrationLog.addKeyword(PvlKeyword("FilterIrradianceFactor", Isis::toString(g_Ff))); + calibrationLog.addKeyword(PvlKeyword("IOFFactor", Isis::toString(g_iof))); calibType = "IF"; } else if (g_applyRadiometric) { @@ -453,18 +453,18 @@ void IsisMain() { calibrationLog.addKeyword(PvlKeyword("EmpiricalCorrectionFactor", empiricalCorrectionFactor.toStdString())); - calibrationLog.addKeyword(PvlKeyword("DarkStripColumns", toString(g_nDarkColumns)), + calibrationLog.addKeyword(PvlKeyword("DarkStripColumns", Isis::toString(g_nDarkColumns)), Pvl::Replace); - calibrationLog.addKeyword(PvlKeyword("ValidDarkColumns", toString(g_nValidDark)), + calibrationLog.addKeyword(PvlKeyword("ValidDarkColumns", Isis::toString(g_nValidDark)), Pvl::Replace); if (g_darkStrip.TotalPixels() > 0) { double avgDark = (g_darkStrip.ValidPixels() > 0) ? g_darkStrip.Average() : 0.0; - calibrationLog.addKeyword(PvlKeyword("DarkStripMean", toString(avgDark)), + calibrationLog.addKeyword(PvlKeyword("DarkStripMean", Isis::toString(avgDark)), Pvl::Replace); } // Report nulled sample count - calibrationLog.addKeyword(PvlKeyword("LeftSamplesNulled", toString(g_nSampsToNull))); + calibrationLog.addKeyword(PvlKeyword("LeftSamplesNulled", Isis::toString(g_nSampsToNull))); // Handle updates of ProductId and SourceProduct Id keywords PvlGroup& archive = ocube->group("Archive"); diff --git a/isis/src/messenger/apps/mdisddr/main.cpp b/isis/src/messenger/apps/mdisddr/main.cpp index 09766e2c12..e261820f54 100644 --- a/isis/src/messenger/apps/mdisddr/main.cpp +++ b/isis/src/messenger/apps/mdisddr/main.cpp @@ -53,7 +53,7 @@ inline void validateUnit(PvlKeyword &key, const QString &kunit) { for (int i = 0; i < temp.size(); i++) { try { // If this works, check unit, otherwise an exception is thrown - (void)IString::ToDouble(temp[i]); + (void) Isis::toDouble(temp[i]); QString unit = QString::fromStdString(temp.unit(i)); if (unit.isEmpty()) unit = kunit; key.addValue(temp[i], unit.toStdString()); diff --git a/isis/src/mgs/apps/moc2isis/main.cpp b/isis/src/mgs/apps/moc2isis/main.cpp index 6a17efb8ec..dab461338f 100644 --- a/isis/src/mgs/apps/moc2isis/main.cpp +++ b/isis/src/mgs/apps/moc2isis/main.cpp @@ -195,7 +195,7 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { QString str = instrumentXlater.Translate("FirstLineSample"); int num = str.toInt(); num++; - inst += PvlKeyword("FirstLineSample", toString(num)); + inst += PvlKeyword("FirstLineSample", Isis::toString(num)); } // Add the instrument specific info to the output file @@ -288,16 +288,16 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { if(str == "BLUE") { bandBin += PvlKeyword("FilterName", str.toStdString()); - bandBin += PvlKeyword("OriginalBand", toString(1)); - bandBin += PvlKeyword("Center", toString(0.4346), "micrometers"); - bandBin += PvlKeyword("Width", toString(0.050), "micrometers"); + bandBin += PvlKeyword("OriginalBand", Isis::toString(1)); + bandBin += PvlKeyword("Center", Isis::toString(0.4346), "micrometers"); + bandBin += PvlKeyword("Width", Isis::toString(0.050), "micrometers"); frameCode = "-94033"; } else if(str == "RED") { bandBin += PvlKeyword("FilterName", str.toStdString()); - bandBin += PvlKeyword("OriginalBand", toString(1)); - bandBin += PvlKeyword("Center", toString(0.6134), "micrometers"); - bandBin += PvlKeyword("Width", toString(0.050), "micrometers"); + bandBin += PvlKeyword("OriginalBand", Isis::toString(1)); + bandBin += PvlKeyword("Center", Isis::toString(0.6134), "micrometers"); + bandBin += PvlKeyword("Width", Isis::toString(0.050), "micrometers"); frameCode = "-94032"; } else { @@ -306,9 +306,9 @@ void TranslateMocEdrLabels(FileName &labelFile, Cube *ocube) { } else { bandBin += PvlKeyword("FilterName", "BROAD_BAND"); - bandBin += PvlKeyword("OriginalBand", toString(1)); - bandBin += PvlKeyword("Center", toString(0.700), "micrometers"); - bandBin += PvlKeyword("Width", toString(0.400), "micrometers"); + bandBin += PvlKeyword("OriginalBand", Isis::toString(1)); + bandBin += PvlKeyword("Center", Isis::toString(0.700), "micrometers"); + bandBin += PvlKeyword("Width", Isis::toString(0.400), "micrometers"); frameCode = "-94031"; } diff --git a/isis/src/mgs/apps/moccal/moccal.cpp b/isis/src/mgs/apps/moccal/moccal.cpp index 91785bbe42..0588128fd2 100644 --- a/isis/src/mgs/apps/moccal/moccal.cpp +++ b/isis/src/mgs/apps/moccal/moccal.cpp @@ -179,19 +179,19 @@ namespace Isis { calgrp += PvlKeyword("CalibrationKernel", calKernelFile.toStdString()); calgrp += PvlKeyword("CoefficientFile", coefFile.toStdString()); - calgrp += PvlKeyword("a", toString(gbl::a)); + calgrp += PvlKeyword("a", Isis::toString(gbl::a)); calgrp["a"].addComment("Radiometric equation in moccal"); calgrp["a"].addComment("r = (pixel - z + off) / a - g / ex - dc"); - calgrp += PvlKeyword("off", toString(gbl::off)); - calgrp += PvlKeyword("ex", toString(gbl::ex)); - calgrp += PvlKeyword("z", toString(gbl::z)); - calgrp += PvlKeyword("dc", toString(gbl::dc)); - calgrp += PvlKeyword("g", toString(gbl::g)); + calgrp += PvlKeyword("off", Isis::toString(gbl::off)); + calgrp += PvlKeyword("ex", Isis::toString(gbl::ex)); + calgrp += PvlKeyword("z", Isis::toString(gbl::z)); + calgrp += PvlKeyword("dc", Isis::toString(gbl::dc)); + calgrp += PvlKeyword("g", Isis::toString(gbl::g)); - calgrp += PvlKeyword("w0", toString(gbl::w0)); + calgrp += PvlKeyword("w0", Isis::toString(gbl::w0)); calgrp["w0"].addComment("Reflectance = r * iof, where iof = (s * s) / w0"); - calgrp += PvlKeyword("s", toString(sunAU)); - calgrp += PvlKeyword("iof", toString(gbl::iof)); + calgrp += PvlKeyword("s", Isis::toString(sunAU)); + calgrp += PvlKeyword("iof", Isis::toString(gbl::iof)); ocube->putGroup(calgrp); diff --git a/isis/src/mgs/apps/mocnoise50/main.cpp b/isis/src/mgs/apps/mocnoise50/main.cpp index 409f411575..6241a2da1c 100644 --- a/isis/src/mgs/apps/mocnoise50/main.cpp +++ b/isis/src/mgs/apps/mocnoise50/main.cpp @@ -142,11 +142,11 @@ void IsisMain() { p.SetOutputCube("TO"); PvlGroup results("Results"); - results += PvlKeyword("DeltaSample", toString(gbl::delta)); - results += PvlKeyword("StartingSample", toString(gbl::ssFirst)); - results += PvlKeyword("Coefficient1", toString(gbl::avg1)); - results += PvlKeyword("Coefficient2", toString(gbl::avg2)); - results += PvlKeyword("Coefficient3", toString(gbl::avg3)); + results += PvlKeyword("DeltaSample", Isis::toString(gbl::delta)); + results += PvlKeyword("StartingSample", Isis::toString(gbl::ssFirst)); + results += PvlKeyword("Coefficient1", Isis::toString(gbl::avg1)); + results += PvlKeyword("Coefficient2", Isis::toString(gbl::avg2)); + results += PvlKeyword("Coefficient3", Isis::toString(gbl::avg3)); // If less than 50% of the lines do not agree on a delta then // we will assume no noise so just make a copy diff --git a/isis/src/mro/apps/crism2isis/crism2isis.cpp b/isis/src/mro/apps/crism2isis/crism2isis.cpp index 92bb2dbd59..e1d9c56575 100644 --- a/isis/src/mro/apps/crism2isis/crism2isis.cpp +++ b/isis/src/mro/apps/crism2isis/crism2isis.cpp @@ -85,7 +85,7 @@ namespace Isis{ st = st.simplified().trimmed(); QStringList cols = st.split(","); - origBand += toString(band); + origBand += Isis::toString(band); widths += cols[2].toStdString(); band++; } @@ -111,7 +111,7 @@ namespace Isis{ PvlKeyword bandName = PvlKeyword("BandName"); PvlKeyword bandNames = labelPvl.findObject("IMAGE").findKeyword("BAND_NAME"); for (int i = 0; i < bandNames.size(); i++) { - origBand += toString(i + 1); + origBand += Isis::toString(i + 1); bandName += bandNames[i]; } bandBin.addKeyword(origBand); @@ -139,7 +139,7 @@ namespace Isis{ PvlKeyword bandName = PvlKeyword("BandName"); PvlKeyword bandNames = labelPvl.findObject("FILE").findObject("IMAGE").findKeyword("BAND_NAME"); for (int i = 0; i < bandNames.size(); i++) { - origBand += toString(i + 1); + origBand += Isis::toString(i + 1); bandName += bandNames[i]; } bandBin.addKeyword(origBand); diff --git a/isis/src/mro/apps/ctxcal/ctxcal.cpp b/isis/src/mro/apps/ctxcal/ctxcal.cpp index 066171fad8..3785bfc2a8 100644 --- a/isis/src/mro/apps/ctxcal/ctxcal.cpp +++ b/isis/src/mro/apps/ctxcal/ctxcal.cpp @@ -210,7 +210,7 @@ namespace Isis { PvlGroup calgrp("Radiometry"); calgrp += PvlKeyword("FlatFile", flatFile.fileName().toStdString()); - calgrp += PvlKeyword("iof", toString(iof)); + calgrp += PvlKeyword("iof", Isis::toString(iof)); ocube->putGroup(calgrp); diff --git a/isis/src/mro/apps/hi2isis/hi2isis.cpp b/isis/src/mro/apps/hi2isis/hi2isis.cpp index 8f502b01d5..faaf16c92a 100644 --- a/isis/src/mro/apps/hi2isis/hi2isis.cpp +++ b/isis/src/mro/apps/hi2isis/hi2isis.cpp @@ -144,7 +144,7 @@ namespace Isis { // The user wants it unlutted else if(ui.GetBoolean("UNLUT")) { for(int i = 0; i < lutSeq.Size(); i++) { - stretch.AddPair(i, ((IString::ToDouble(lutSeq[i][0]) +IString::ToDouble(lutSeq[i][1])) / 2.0)); + stretch.AddPair(i, ((Isis::toDouble(lutSeq[i][0]) + Isis::toDouble(lutSeq[i][1])) / 2.0)); } instgrp.addKeyword(PvlKeyword("Unlutted", "TRUE")); instgrp.deleteKeyword("LookupTable"); @@ -187,47 +187,47 @@ namespace Isis { PvlGroup results("Results"); results += PvlKeyword("From", inFile.expanded()); - results += PvlKeyword("CalibrationBufferGaps", toString(gapCount[0])); - results += PvlKeyword("CalibrationBufferLIS", toString(lisCount[0])); - results += PvlKeyword("CalibrationBufferHIS", toString(hisCount[0])); - results += PvlKeyword("CalibrationBufferPossibleGaps", toString(suspectGapCount[0])); - results += PvlKeyword("CalibrationBufferInvalid", toString(invalidCount[0])); - results += PvlKeyword("CalibrationBufferValid", toString(validCount[0])); - - results += PvlKeyword("CalibrationImageGaps", toString(gapCount[1])); - results += PvlKeyword("CalibrationImageLIS", toString(lisCount[1])); - results += PvlKeyword("CalibrationImageHIS", toString(hisCount[1])); - results += PvlKeyword("CalibrationImagePossibleGaps", toString(suspectGapCount[1])); - results += PvlKeyword("CalibrationImageInvalid", toString(invalidCount[1])); - results += PvlKeyword("CalibrationImageValid", toString(validCount[1])); - - results += PvlKeyword("CalibrationDarkGaps", toString(gapCount[2])); - results += PvlKeyword("CalibrationDarkLIS", toString(lisCount[2])); - results += PvlKeyword("CalibrationDarkHIS", toString(hisCount[2])); - results += PvlKeyword("CalibrationDarkPossibleGaps", toString(suspectGapCount[2])); - results += PvlKeyword("CalibrationDarkInvalid", toString(invalidCount[2])); - results += PvlKeyword("CalibrationDarkValid", toString(validCount[2])); - - results += PvlKeyword("ObservationBufferGaps", toString(gapCount[3])); - results += PvlKeyword("ObservationBufferLIS", toString(lisCount[3])); - results += PvlKeyword("ObservationBufferHIS", toString(hisCount[3])); - results += PvlKeyword("ObservationBufferPossibleGaps", toString(suspectGapCount[3])); - results += PvlKeyword("ObservationBufferInvalid", toString(invalidCount[3])); - results += PvlKeyword("ObservationBufferValid", toString(validCount[3])); - - results += PvlKeyword("ObservationImageGaps", toString(gapCount[4])); - results += PvlKeyword("ObservationImageLIS", toString(lisCount[4])); - results += PvlKeyword("ObservationImageHIS", toString(hisCount[4])); - results += PvlKeyword("ObservationImagePossibleGaps", toString(suspectGapCount[4])); - results += PvlKeyword("ObservationImageInvalid", toString(invalidCount[4])); - results += PvlKeyword("ObservationImageValid", toString(validCount[4])); - - results += PvlKeyword("ObservationDarkGaps", toString(gapCount[5])); - results += PvlKeyword("ObservationDarkLIS", toString(lisCount[5])); - results += PvlKeyword("ObservationDarkHIS", toString(hisCount[5])); - results += PvlKeyword("ObservationDarkPossibleGaps", toString(suspectGapCount[5])); - results += PvlKeyword("ObservationDarkInvalid", toString(invalidCount[5])); - results += PvlKeyword("ObservationDarkValid", toString(validCount[5])); + results += PvlKeyword("CalibrationBufferGaps", Isis::toString(gapCount[0])); + results += PvlKeyword("CalibrationBufferLIS", Isis::toString(lisCount[0])); + results += PvlKeyword("CalibrationBufferHIS", Isis::toString(hisCount[0])); + results += PvlKeyword("CalibrationBufferPossibleGaps", Isis::toString(suspectGapCount[0])); + results += PvlKeyword("CalibrationBufferInvalid", Isis::toString(invalidCount[0])); + results += PvlKeyword("CalibrationBufferValid", Isis::toString(validCount[0])); + + results += PvlKeyword("CalibrationImageGaps", Isis::toString(gapCount[1])); + results += PvlKeyword("CalibrationImageLIS", Isis::toString(lisCount[1])); + results += PvlKeyword("CalibrationImageHIS", Isis::toString(hisCount[1])); + results += PvlKeyword("CalibrationImagePossibleGaps", Isis::toString(suspectGapCount[1])); + results += PvlKeyword("CalibrationImageInvalid", Isis::toString(invalidCount[1])); + results += PvlKeyword("CalibrationImageValid", Isis::toString(validCount[1])); + + results += PvlKeyword("CalibrationDarkGaps", Isis::toString(gapCount[2])); + results += PvlKeyword("CalibrationDarkLIS", Isis::toString(lisCount[2])); + results += PvlKeyword("CalibrationDarkHIS", Isis::toString(hisCount[2])); + results += PvlKeyword("CalibrationDarkPossibleGaps", Isis::toString(suspectGapCount[2])); + results += PvlKeyword("CalibrationDarkInvalid", Isis::toString(invalidCount[2])); + results += PvlKeyword("CalibrationDarkValid", Isis::toString(validCount[2])); + + results += PvlKeyword("ObservationBufferGaps", Isis::toString(gapCount[3])); + results += PvlKeyword("ObservationBufferLIS", Isis::toString(lisCount[3])); + results += PvlKeyword("ObservationBufferHIS", Isis::toString(hisCount[3])); + results += PvlKeyword("ObservationBufferPossibleGaps", Isis::toString(suspectGapCount[3])); + results += PvlKeyword("ObservationBufferInvalid", Isis::toString(invalidCount[3])); + results += PvlKeyword("ObservationBufferValid", Isis::toString(validCount[3])); + + results += PvlKeyword("ObservationImageGaps", Isis::toString(gapCount[4])); + results += PvlKeyword("ObservationImageLIS", Isis::toString(lisCount[4])); + results += PvlKeyword("ObservationImageHIS", Isis::toString(hisCount[4])); + results += PvlKeyword("ObservationImagePossibleGaps", Isis::toString(suspectGapCount[4])); + results += PvlKeyword("ObservationImageInvalid", Isis::toString(invalidCount[4])); + results += PvlKeyword("ObservationImageValid", Isis::toString(validCount[4])); + + results += PvlKeyword("ObservationDarkGaps", Isis::toString(gapCount[5])); + results += PvlKeyword("ObservationDarkLIS", Isis::toString(lisCount[5])); + results += PvlKeyword("ObservationDarkHIS", Isis::toString(hisCount[5])); + results += PvlKeyword("ObservationDarkPossibleGaps", Isis::toString(suspectGapCount[5])); + results += PvlKeyword("ObservationDarkInvalid", Isis::toString(invalidCount[5])); + results += PvlKeyword("ObservationDarkValid", Isis::toString(validCount[5])); // Write the results to the log Application::Log(results); diff --git a/isis/src/mro/apps/hicalproc/main.cpp b/isis/src/mro/apps/hicalproc/main.cpp index f33c75352c..aa1f0b390c 100644 --- a/isis/src/mro/apps/hicalproc/main.cpp +++ b/isis/src/mro/apps/hicalproc/main.cpp @@ -61,7 +61,7 @@ void IsisMain() { cubeLabel = Pvl(inFile.toStdString()); } // Get the Summing from the label - int iSumming = IString::ToInteger(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("Summing")[0]); + int iSumming = Isis::toInt(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("Summing")[0]); Pipeline p1("hicalproc1"); p1.SetInputFile("FROM"); @@ -456,7 +456,7 @@ void GetCCD_Channel_Coefficients(Pvl & pCubeLabel) } else { PvlKeyword binKey = instrGrp.findKeyword("Summing"); - iSumming = IString::ToInteger(binKey[0]); + iSumming = Isis::toInt(binKey[0]); if (iSumming != 1 && iSumming != 2 && iSumming != 4) { std::string sMsg = "Invalid Summing value in input file, must be 1,2,or 4"; throw IException(IException::User, sMsg, _FILEINFO_); @@ -480,7 +480,7 @@ void GetCCD_Channel_Coefficients(Pvl & pCubeLabel) } else { PvlKeyword channelKey = instrGrp.findKeyword("ChannelNumber"); - iChannel = IString::ToInteger(channelKey[0]); + iChannel = Isis::toInt(channelKey[0]); } // Get the coefficient file name diff --git a/isis/src/mro/apps/hiccdstitch/main.cpp b/isis/src/mro/apps/hiccdstitch/main.cpp index d744e76b5e..498baf73e3 100644 --- a/isis/src/mro/apps/hiccdstitch/main.cpp +++ b/isis/src/mro/apps/hiccdstitch/main.cpp @@ -377,14 +377,14 @@ void IsisMain() { PvlGroup ccdGroup(CCDlist[CCDindex].ccdName.toStdString()); ccdGroup += PvlKeyword("File", CCDlist[CCDindex].filename.toStdString()); - ccdGroup += PvlKeyword("FocalPlaneSample", toString(CCDlist[CCDindex].fpsamp)); - ccdGroup += PvlKeyword("FocalPlaneLine", toString(CCDlist[CCDindex].fpline)); - ccdGroup += PvlKeyword("ImageSample", toString(CCDlist[CCDindex].outss)); - ccdGroup += PvlKeyword("ImageLine", toString(CCDlist[CCDindex].outsl)); + ccdGroup += PvlKeyword("FocalPlaneSample", Isis::toString(CCDlist[CCDindex].fpsamp)); + ccdGroup += PvlKeyword("FocalPlaneLine", Isis::toString(CCDlist[CCDindex].fpline)); + ccdGroup += PvlKeyword("ImageSample", Isis::toString(CCDlist[CCDindex].outss)); + ccdGroup += PvlKeyword("ImageLine", Isis::toString(CCDlist[CCDindex].outsl)); int ccd = CCDlist[CCDindex].ccdNumber; - ccdGroup += PvlKeyword("SampleOffset", toString(CCDlist[CCDindex].fpsamp - xoffset[ccd])); - ccdGroup += PvlKeyword("LineOffset", toString(CCDlist[CCDindex].fpline - yoffset[ccd])); + ccdGroup += PvlKeyword("SampleOffset", Isis::toString(CCDlist[CCDindex].fpsamp - xoffset[ccd])); + ccdGroup += PvlKeyword("LineOffset", Isis::toString(CCDlist[CCDindex].fpline - yoffset[ccd])); results.addGroup(ccdGroup); } diff --git a/isis/src/mro/apps/hicolormos/hicolormos.cpp b/isis/src/mro/apps/hicolormos/hicolormos.cpp index 4ff063e8aa..7dc38194f2 100644 --- a/isis/src/mro/apps/hicolormos/hicolormos.cpp +++ b/isis/src/mro/apps/hicolormos/hicolormos.cpp @@ -258,13 +258,13 @@ void hicolormos(Cube *from1, Cube* from2, UserInterface &ui) { mos += PvlKeyword("SpacecraftClockStartCount ", startClk.toStdString()); mos += PvlKeyword("StopTime ", stopTime.toStdString()); mos += PvlKeyword("SpacecraftClockStopCount ", stopClk.toStdString()); - mos += PvlKeyword("IncidenceAngle ", toString(Cincid), "DEG"); - mos += PvlKeyword("EmissionAngle ", toString(Cemiss), "DEG"); - mos += PvlKeyword("PhaseAngle ", toString(Cphase), "DEG"); - mos += PvlKeyword("LocalTime ", toString(ClocalSolTime), "LOCALDAY/24"); - mos += PvlKeyword("SolarLongitude ", toString(CsolarLong), "DEG"); - mos += PvlKeyword("SubSolarAzimuth ", toString(CsunAzimuth), "DEG"); - mos += PvlKeyword("NorthAzimuth ", toString(CnorthAzimuth), "DEG"); + mos += PvlKeyword("IncidenceAngle ", Isis::toString(Cincid), "DEG"); + mos += PvlKeyword("EmissionAngle ", Isis::toString(Cemiss), "DEG"); + mos += PvlKeyword("PhaseAngle ", Isis::toString(Cphase), "DEG"); + mos += PvlKeyword("LocalTime ", Isis::toString(ClocalSolTime), "LOCALDAY/24"); + mos += PvlKeyword("SolarLongitude ", Isis::toString(CsolarLong), "DEG"); + mos += PvlKeyword("SubSolarAzimuth ", Isis::toString(CsunAzimuth), "DEG"); + mos += PvlKeyword("NorthAzimuth ", Isis::toString(CnorthAzimuth), "DEG"); mos += cpmmTdiFlag; mos += cpmmSummingFlag; mos += specialProcessingFlag; diff --git a/isis/src/mro/apps/hicrop/hicrop.cpp b/isis/src/mro/apps/hicrop/hicrop.cpp index a352f2d344..f416b9b9aa 100644 --- a/isis/src/mro/apps/hicrop/hicrop.cpp +++ b/isis/src/mro/apps/hicrop/hicrop.cpp @@ -355,11 +355,11 @@ namespace Isis { // Construct a label with the results PvlGroup results("Results"); - results += PvlKeyword("InputLines", toString(inputLineCount)); - results += PvlKeyword("NumberOfLinesCropped", toString(inputLineCount-g_cropLineCount)); - results += PvlKeyword("OututStartingLine", toString(g_cropStartLine)); - results += PvlKeyword("OututEndingLine", toString(g_cropEndLine)); - results += PvlKeyword("OututLineCount", toString(g_cropLineCount)); + results += PvlKeyword("InputLines", Isis::toString(inputLineCount)); + results += PvlKeyword("NumberOfLinesCropped", Isis::toString(inputLineCount-g_cropLineCount)); + results += PvlKeyword("OututStartingLine", Isis::toString(g_cropStartLine)); + results += PvlKeyword("OututEndingLine", Isis::toString(g_cropEndLine)); + results += PvlKeyword("OututLineCount", Isis::toString(g_cropLineCount)); results += PvlKeyword("OututStartTime", cropStartTime.UTC().toStdString()); results += PvlKeyword("OututStopTime", cropStopTime.UTC().toStdString()); //??? adjustedCropStopTime results += PvlKeyword("OututStartClock", adjustedCropStartClockCount.toStdString()); diff --git a/isis/src/mro/apps/hicubenorm/hicubenorm.cpp b/isis/src/mro/apps/hicubenorm/hicubenorm.cpp index b102d16410..c06e8d342b 100644 --- a/isis/src/mro/apps/hicubenorm/hicubenorm.cpp +++ b/isis/src/mro/apps/hicubenorm/hicubenorm.cpp @@ -254,22 +254,22 @@ namespace Isis { void pvlOut(const QString &StatFile) { PvlGroup results("Results"); for(unsigned int i = 0; i < band.size(); i++) { - results += PvlKeyword("Band", toString(band[i])); - results += PvlKeyword("RowCol", toString(element[i])); - results += PvlKeyword("ValidPixels", toString(validpixels[i])); + results += PvlKeyword("Band", Isis::toString(band[i])); + results += PvlKeyword("RowCol", Isis::toString(element[i])); + results += PvlKeyword("ValidPixels", Isis::toString(validpixels[i])); if(validpixels[i] > 0) { - results += PvlKeyword("Mean", toString(average[i])); - results += PvlKeyword("Median", toString(median[i])); - results += PvlKeyword("Std", toString(stddev[i])); - results += PvlKeyword("Minimum", toString(minimum[i])); - results += PvlKeyword("Maximum", toString(maximum[i])); + results += PvlKeyword("Mean", Isis::toString(average[i])); + results += PvlKeyword("Median", Isis::toString(median[i])); + results += PvlKeyword("Std", Isis::toString(stddev[i])); + results += PvlKeyword("Minimum", Isis::toString(minimum[i])); + results += PvlKeyword("Maximum", Isis::toString(maximum[i])); } else { - results += PvlKeyword("Mean", toString(0.0)); - results += PvlKeyword("Median", toString(0.0)); - results += PvlKeyword("Std", toString(0.0)); - results += PvlKeyword("Minimum", toString(0.0)); - results += PvlKeyword("Maximum", toString(0.0)); + results += PvlKeyword("Mean", Isis::toString(0.0)); + results += PvlKeyword("Median", Isis::toString(0.0)); + results += PvlKeyword("Std", Isis::toString(0.0)); + results += PvlKeyword("Minimum", Isis::toString(0.0)); + results += PvlKeyword("Maximum", Isis::toString(0.0)); } } @@ -338,21 +338,21 @@ namespace Isis { PvlObject::PvlKeywordIterator itr = results.begin(); while(itr != results.end()) { - band.push_back(IString::ToInteger((*itr)[0])); + band.push_back(Isis::toInt((*itr)[0])); itr++; - element.push_back(IString::ToInteger((*itr)[0])); + element.push_back(Isis::toInt((*itr)[0])); itr++; - validpixels.push_back(IString::ToInteger((*itr)[0])); + validpixels.push_back(Isis::toInt((*itr)[0])); itr++; - average.push_back(IString::ToDouble((*itr)[0])); + average.push_back(Isis::toDouble((*itr)[0])); itr++; - median.push_back(IString::ToDouble((*itr)[0])); + median.push_back(Isis::toDouble((*itr)[0])); itr++; - stddev.push_back(IString::ToDouble((*itr)[0])); + stddev.push_back(Isis::toDouble((*itr)[0])); itr++; - minimum.push_back(IString::ToDouble((*itr)[0])); + minimum.push_back(Isis::toDouble((*itr)[0])); itr++; - maximum.push_back(IString::ToDouble((*itr)[0])); + maximum.push_back(Isis::toDouble((*itr)[0])); itr++; } } diff --git a/isis/src/mro/apps/hideal2pds/main.cpp b/isis/src/mro/apps/hideal2pds/main.cpp index 5a0e77af14..f60506d655 100644 --- a/isis/src/mro/apps/hideal2pds/main.cpp +++ b/isis/src/mro/apps/hideal2pds/main.cpp @@ -194,7 +194,7 @@ void IsisMain() { // change SAMPLE_BIT_MASK value according to BITS input PvlObject &image = pdsLabel.findObject("IMAGE"); - image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", toString((int)pow(2.0, (double)nbits) - 1)), + image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", Isis::toString((int)pow(2.0, (double)nbits) - 1)), Pvl::Replace); Camera *cam = inputCube->camera(); @@ -273,7 +273,7 @@ void IsisMain() { } else { tableKeyword = PvlKeyword("SOLAR_LONGITUDE", - toString(cam->solarLongitude().force360Domain() + Isis::toString(cam->solarLongitude().force360Domain() .positiveEast(Angle::Degrees)), "DEGREES"); } @@ -419,10 +419,10 @@ void updatePdsLabelImageObject(PvlObject *isisCubeLab, Pvl &pdsLabel) { firstSample = alphaStartingSample; firstLine = alphaStartingLine; } - image += PvlKeyword("SOURCE_LINE_SAMPLES", toString(sourceSamples)); - image += PvlKeyword("SOURCE_LINES", toString(sourceLines)); - image += PvlKeyword("FIRST_LINE_SAMPLE", toString(firstSample)); - image += PvlKeyword("FIRST_LINE", toString(firstLine)); + image += PvlKeyword("SOURCE_LINE_SAMPLES", Isis::toString(sourceSamples)); + image += PvlKeyword("SOURCE_LINES", Isis::toString(sourceLines)); + image += PvlKeyword("FIRST_LINE_SAMPLE", Isis::toString(firstSample)); + image += PvlKeyword("FIRST_LINE", Isis::toString(firstLine)); // Add center wavelength and bandwidth with correct units to the IMAGE object @@ -503,7 +503,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, pdsLabel += PvlKeyword("PRODUCT_VERSION_ID", ui.GetString("VERSION").toStdString()); // Add the N/A constant keyword to the ROOT object - pdsLabel += PvlKeyword("NOT_APPLICABLE_CONSTANT", toString(-9998)); + pdsLabel += PvlKeyword("NOT_APPLICABLE_CONSTANT", Isis::toString(-9998)); // Compute and add SOFTWARE_NAME to the ROOT object QString sfname; @@ -520,9 +520,9 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, bool jitter = false; if (isisCubeLab->findObject("IsisCube").findGroup("Instrument") .hasKeyword("ImageJitterCorrected")) { - jitter = IString::ToInteger(isisCubeLab->findObject("IsisCube") + jitter = Isis::toInt(isisCubeLab->findObject("IsisCube") .findGroup("Instrument")["ImageJitterCorrected"][0]); - pdsLabel += PvlKeyword("IMAGE_JITTER_CORRECTED", toString((int)jitter)); + pdsLabel += PvlKeyword("IMAGE_JITTER_CORRECTED", Isis::toString((int)jitter)); } else { pdsLabel += PvlKeyword("IMAGE_JITTER_CORRECTED", "UNK"); @@ -550,30 +550,30 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, else { Distance naifBodyRadii[3]; cam->radii(naifBodyRadii); - pdsLabel += PvlKeyword("A_AXIS_RADIUS", toString(naifBodyRadii[0].kilometers()), "KILOMETERS"); - pdsLabel += PvlKeyword("B_AXIS_RADIUS", toString(naifBodyRadii[1].kilometers()), "KILOMETERS"); - pdsLabel += PvlKeyword("C_AXIS_RADIUS", toString(naifBodyRadii[2].kilometers()), "KILOMETERS"); + pdsLabel += PvlKeyword("A_AXIS_RADIUS", Isis::toString(naifBodyRadii[0].kilometers()), "KILOMETERS"); + pdsLabel += PvlKeyword("B_AXIS_RADIUS", Isis::toString(naifBodyRadii[1].kilometers()), "KILOMETERS"); + pdsLabel += PvlKeyword("C_AXIS_RADIUS", Isis::toString(naifBodyRadii[2].kilometers()), "KILOMETERS"); } if (naifKeywordGroup.hasKeyword("BODY_FRAME_CODE")) { pdsLabel += naifKeywordGroup.findKeyword("BODY_FRAME_CODE"); } else { - pdsLabel += PvlKeyword("BODY_FRAME_CODE", toString(cam->naifBodyFrameCode())); + pdsLabel += PvlKeyword("BODY_FRAME_CODE", Isis::toString(cam->naifBodyFrameCode())); } if (naifKeywordGroup.hasKeyword("IDEAL_FOCAL_LENGTH")) { pdsLabel += naifKeywordGroup.findKeyword("IDEAL_FOCAL_LENGTH"); } else { - pdsLabel += PvlKeyword("IDEAL_FOCAL_LENGTH", toString(cam->FocalLength())); + pdsLabel += PvlKeyword("IDEAL_FOCAL_LENGTH", Isis::toString(cam->FocalLength())); } if (naifKeywordGroup.hasKeyword("IDEAL_PIXEL_PITCH")) { pdsLabel += naifKeywordGroup.findKeyword("IDEAL_PIXEL_PITCH"); } else { - pdsLabel += PvlKeyword("IDEAL_PIXEL_PITCH", toString(cam->PixelPitch())); + pdsLabel += PvlKeyword("IDEAL_PIXEL_PITCH", Isis::toString(cam->PixelPitch())); } if (naifKeywordGroup.hasKeyword("IDEAL_TRANSX")) { @@ -583,7 +583,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, const double *transXValues = cam->FocalPlaneMap()->TransX(); PvlKeyword transX("IDEAL_TRANSX"); for (int i = 0; i < 3; i++) { - transX += toString(transXValues[i]); + transX += Isis::toString(transXValues[i]); } pdsLabel += transX; } @@ -595,7 +595,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, const double *transYValues = cam->FocalPlaneMap()->TransY(); PvlKeyword transY("IDEAL_TRANSY"); for (int i = 0; i < 3; i++) { - transY += toString(transYValues[i]); + transY += Isis::toString(transYValues[i]); } pdsLabel += transY; } @@ -607,7 +607,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, const double *transSValues = cam->FocalPlaneMap()->TransS(); PvlKeyword transS("IDEAL_TRANSS"); for (int i = 0; i < 3; i++) { - transS += toString(transSValues[i]); + transS += Isis::toString(transSValues[i]); } pdsLabel += transS; } @@ -619,7 +619,7 @@ void updatePdsLabelRootObject(PvlObject *isisCubeLab, Pvl &pdsLabel, const double *transLValues = cam->FocalPlaneMap()->TransL(); PvlKeyword transL("IDEAL_TRANSL"); for (int i = 0; i < 3; i++) { - transL += toString(transLValues[i]); + transL += Isis::toString(transLValues[i]); } pdsLabel += transL; } diff --git a/isis/src/mro/apps/hidtmgen/hidtmgen.cpp b/isis/src/mro/apps/hidtmgen/hidtmgen.cpp index f1d5beece7..e5f07ba36d 100644 --- a/isis/src/mro/apps/hidtmgen/hidtmgen.cpp +++ b/isis/src/mro/apps/hidtmgen/hidtmgen.cpp @@ -499,7 +499,7 @@ namespace Isis{ PvlObject viewingParameters("VIEWING_PARAMETERS"); if (northAzimuth != Isis::Null) { - viewingParameters.addKeyword(PvlKeyword("NORTH_AZIMUTH", toString(northAzimuth), "DEG")); + viewingParameters.addKeyword(PvlKeyword("NORTH_AZIMUTH", Isis::toString(northAzimuth), "DEG")); } else { viewingParameters.addKeyword(PvlKeyword("NORTH_AZIMUTH", "N/A")); @@ -513,11 +513,11 @@ namespace Isis{ TProjection *proj = (TProjection *) ProjectionFactory::CreateFromCube(*inCube); double newRadius = proj->LocalRadius((double)mappingObject["CENTER_LATITUDE"]); newRadius /= 1000; - mappingObject.findKeyword("A_AXIS_RADIUS").setValue(toString(newRadius)); + mappingObject.findKeyword("A_AXIS_RADIUS").setValue(Isis::toString(newRadius)); mappingObject.findKeyword("A_AXIS_RADIUS").setUnits("KM"); - mappingObject.findKeyword("B_AXIS_RADIUS").setValue(toString(newRadius)); + mappingObject.findKeyword("B_AXIS_RADIUS").setValue(Isis::toString(newRadius)); mappingObject.findKeyword("B_AXIS_RADIUS").setUnits("KM"); - mappingObject.findKeyword("C_AXIS_RADIUS").setValue(toString(newRadius)); + mappingObject.findKeyword("C_AXIS_RADIUS").setValue(Isis::toString(newRadius)); mappingObject.findKeyword("C_AXIS_RADIUS").setUnits("KM"); } @@ -532,14 +532,14 @@ namespace Isis{ // find the center latitude of this set of images // (not the same as the center lat for the projection) - double clat = ((IString::ToDouble(mappingObject["MAXIMUM_LATITUDE"][0]) - - IString::ToDouble(mappingObject["MINIMUM_LATITUDE"][0])) / 2) + - IString::ToDouble(mappingObject["MINIMUM_LATITUDE"][0]); + double clat = ((Isis::toDouble(mappingObject["MAXIMUM_LATITUDE"][0]) - + Isis::toDouble(mappingObject["MINIMUM_LATITUDE"][0])) / 2) + + Isis::toDouble(mappingObject["MINIMUM_LATITUDE"][0]); // find the center longitude of this set of images // (not the same as the center lon for the projection) - double clon = ((IString::ToDouble(mappingObject["EASTERNMOST_LONGITUDE"][0]) - - IString::ToDouble(mappingObject["WESTERNMOST_LONGITUDE"][0])) / 2) + - IString::ToDouble(mappingObject["WESTERNMOST_LONGITUDE"][0]); + double clon = ((Isis::toDouble(mappingObject["EASTERNMOST_LONGITUDE"][0]) - + Isis::toDouble(mappingObject["WESTERNMOST_LONGITUDE"][0])) / 2) + + Isis::toDouble(mappingObject["WESTERNMOST_LONGITUDE"][0]); if (clat > 0.0 && clon < 270.0) { // Northern Hemisphere, 0 to 270 lon northAzimuth = 270.00 - clon; @@ -603,7 +603,7 @@ namespace Isis{ QString versionNumber(const Pvl ¶msPvl, const UserInterface &ui) { - double version = IString::ToDouble(paramsPvl["PRODUCT_VERSION_ID"]); + double version = Isis::toDouble(paramsPvl["PRODUCT_VERSION_ID"]); // Format the version for the output name: // Only important thing to note is that a #.0 number is converted to 0# @@ -777,8 +777,8 @@ namespace Isis{ // Create statistics and add to image group Statistics *stat = inCube->statistics(); - image.addKeyword(PvlKeyword("VALID_MINIMUM", toString(stat->Minimum()))); - image.addKeyword(PvlKeyword("VALID_MAXIMUM", toString(stat->Maximum()))); + image.addKeyword(PvlKeyword("VALID_MINIMUM", Isis::toString(stat->Minimum()))); + image.addKeyword(PvlKeyword("VALID_MAXIMUM", Isis::toString(stat->Maximum()))); // delete unneeded keywords in map object mappingObject.deleteKeyword("FIRST_STANDARD_PARALLEL"); diff --git a/isis/src/mro/apps/hifringe/main.cpp b/isis/src/mro/apps/hifringe/main.cpp index d637b3e62b..dbe67871e6 100644 --- a/isis/src/mro/apps/hifringe/main.cpp +++ b/isis/src/mro/apps/hifringe/main.cpp @@ -199,28 +199,28 @@ void IsisMain() { void pvlOut(Statistics stats1, Statistics stats2, QString name, int start, int end, PvlObject *one, PvlObject *two) { PvlGroup left(name.toStdString()); - left += PvlKeyword("StartLine", toString(start + 1)); - left += PvlKeyword("EndLine", toString(end)); - left += PvlKeyword("TotalPixels", toString(stats1.TotalPixels())); - left += PvlKeyword("ValidPixels", toString(stats1.ValidPixels())); + left += PvlKeyword("StartLine", Isis::toString(start + 1)); + left += PvlKeyword("EndLine", Isis::toString(end)); + left += PvlKeyword("TotalPixels", Isis::toString(stats1.TotalPixels())); + left += PvlKeyword("ValidPixels", Isis::toString(stats1.ValidPixels())); if(stats1.ValidPixels() > 0) { - left += PvlKeyword("Mean", toString(stats1.Average())); - left += PvlKeyword("StandardDeviation", toString(stats1.StandardDeviation())); - left += PvlKeyword("Minimum", toString(stats1.Minimum())); - left += PvlKeyword("Maximum", toString(stats1.Maximum())); + left += PvlKeyword("Mean", Isis::toString(stats1.Average())); + left += PvlKeyword("StandardDeviation", Isis::toString(stats1.StandardDeviation())); + left += PvlKeyword("Minimum", Isis::toString(stats1.Minimum())); + left += PvlKeyword("Maximum", Isis::toString(stats1.Maximum())); } one->addGroup(left); PvlGroup right(name.toStdString()); - right += PvlKeyword("StartLine", toString(start + 1)); - right += PvlKeyword("EndLine", toString(end)); - right += PvlKeyword("TotalPixels", toString(stats2.TotalPixels())); - right += PvlKeyword("ValidPixels", toString(stats2.ValidPixels())); + right += PvlKeyword("StartLine", Isis::toString(start + 1)); + right += PvlKeyword("EndLine", Isis::toString(end)); + right += PvlKeyword("TotalPixels", Isis::toString(stats2.TotalPixels())); + right += PvlKeyword("ValidPixels", Isis::toString(stats2.ValidPixels())); if(stats2.ValidPixels() > 0) { - right += PvlKeyword("Mean", toString(stats2.Average())); - right += PvlKeyword("StandardDeviation", toString(stats2.StandardDeviation())); - right += PvlKeyword("Minimum", toString(stats2.Minimum())); - right += PvlKeyword("Maximum", toString(stats2.Maximum())); + right += PvlKeyword("Mean", Isis::toString(stats2.Average())); + right += PvlKeyword("StandardDeviation", Isis::toString(stats2.StandardDeviation())); + right += PvlKeyword("Minimum", Isis::toString(stats2.Minimum())); + right += PvlKeyword("Maximum", Isis::toString(stats2.Maximum())); } two->addGroup(right); } diff --git a/isis/src/mro/apps/hifurrows/main.cpp b/isis/src/mro/apps/hifurrows/main.cpp index 72b5a53732..bc912a27c3 100644 --- a/isis/src/mro/apps/hifurrows/main.cpp +++ b/isis/src/mro/apps/hifurrows/main.cpp @@ -133,7 +133,7 @@ void IsisMain() { ss >> finish; } label += "Column" + begin + "to" + finish; - stats += PvlKeyword(label.c_str(), toString(furrows[i].mvstats[j].Correlation())); + stats += PvlKeyword(label.c_str(), Isis::toString(furrows[i].mvstats[j].Correlation())); } } Application::Log(stats); diff --git a/isis/src/mro/apps/hijitreg/main.cpp b/isis/src/mro/apps/hijitreg/main.cpp index e604f32059..99360b55dd 100644 --- a/isis/src/mro/apps/hijitreg/main.cpp +++ b/isis/src/mro/apps/hijitreg/main.cpp @@ -355,9 +355,9 @@ void IsisMain() { if (jparms.sStats.ValidPixels() > 0) { double sTrans = (int)(jparms.sStats.Average() * 100.0) / 100.0; double lTrans = (int)(jparms.lStats.Average() * 100.0) / 100.0; - results += PvlKeyword("Sample", toString(sTrans)); - results += PvlKeyword("Line", toString(lTrans)); - results += PvlKeyword("NSuspects", toString(jparms.nSuspects)); + results += PvlKeyword("Sample", Isis::toString(sTrans)); + results += PvlKeyword("Line", Isis::toString(lTrans)); + results += PvlKeyword("NSuspects", Isis::toString(jparms.nSuspects)); } else { results += PvlKeyword("Sample", "NULL"); diff --git a/isis/src/mro/apps/himos/himos.cpp b/isis/src/mro/apps/himos/himos.cpp index 7c2088a117..6a7917769f 100644 --- a/isis/src/mro/apps/himos/himos.cpp +++ b/isis/src/mro/apps/himos/himos.cpp @@ -259,13 +259,13 @@ namespace Isis { mos += PvlKeyword("SpacecraftClockStartCount ", startClock.toStdString()); mos += PvlKeyword("StopTime ", stopTime.toStdString()); mos += PvlKeyword("SpacecraftClockStopCount ", stopClock.toStdString()); - mos += PvlKeyword("IncidenceAngle ", toString(Cincid), "DEG"); - mos += PvlKeyword("EmissionAngle ", toString(Cemiss), "DEG"); - mos += PvlKeyword("PhaseAngle ", toString(Cphase), "DEG"); - mos += PvlKeyword("LocalTime ", toString(ClocalSolTime), "LOCALDAY/24"); - mos += PvlKeyword("SolarLongitude ", toString(CsolarLong), "DEG"); - mos += PvlKeyword("SubSolarAzimuth ", toString(CsunAzimuth), "DEG"); - mos += PvlKeyword("NorthAzimuth ", toString(CnorthAzimuth), "DEG"); + mos += PvlKeyword("IncidenceAngle ", Isis::toString(Cincid), "DEG"); + mos += PvlKeyword("EmissionAngle ", Isis::toString(Cemiss), "DEG"); + mos += PvlKeyword("PhaseAngle ", Isis::toString(Cphase), "DEG"); + mos += PvlKeyword("LocalTime ", Isis::toString(ClocalSolTime), "LOCALDAY/24"); + mos += PvlKeyword("SolarLongitude ", Isis::toString(CsolarLong), "DEG"); + mos += PvlKeyword("SubSolarAzimuth ", Isis::toString(CsunAzimuth), "DEG"); + mos += PvlKeyword("NorthAzimuth ", Isis::toString(CnorthAzimuth), "DEG"); mos += cpmmTdiFlag; mos += cpmmSummingFlag; mos += specialProcessingFlag; diff --git a/isis/src/mro/apps/hinoise/main.cpp b/isis/src/mro/apps/hinoise/main.cpp index 35da55263f..0829a31a99 100644 --- a/isis/src/mro/apps/hinoise/main.cpp +++ b/isis/src/mro/apps/hinoise/main.cpp @@ -87,8 +87,8 @@ void IsisMain() { // Get Summing, CcdId and Channel Number from the cube label Pvl cubeLabel = Pvl(sInputFile.toStdString()); - int iSumming = IString::ToInteger(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("Summing")[0]); - int iChannel = IString::ToInteger(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("ChannelNumber")[0]); + int iSumming = Isis::toInt(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("Summing")[0]); + int iChannel = Isis::toInt(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("ChannelNumber")[0]); QString sCcdId = QString::fromStdString(cubeLabel.findObject("IsisCube").findGroup("Instrument").findKeyword("CcdId")); // Get the image histogram diff --git a/isis/src/mro/apps/hirdrgen/main.cpp b/isis/src/mro/apps/hirdrgen/main.cpp index c3a46f5351..f48dbd22f7 100644 --- a/isis/src/mro/apps/hirdrgen/main.cpp +++ b/isis/src/mro/apps/hirdrgen/main.cpp @@ -210,7 +210,7 @@ void IsisMain() { timeParam += PvlKeyword("PRODUCT_CREATION_TIME", tmpDateTime.UTC().toStdString()); // Add the N/A constant keyword to the ROOT - pdsLabel += PvlKeyword("NOT_APPLICABLE_CONSTANT", toString(-9998)); + pdsLabel += PvlKeyword("NOT_APPLICABLE_CONSTANT", Isis::toString(-9998)); // Add SOFTWARE_NAME to the ROOT QString sfname; @@ -306,9 +306,9 @@ void IsisMain() { TProjection *proj = (TProjection *) ProjectionFactory::CreateFromCube(*icube2); PvlGroup &mapping = icube2->label()->findGroup("MAPPING", Pvl::Traverse); double radius = proj->LocalRadius((double)mapping["CenterLatitude"]) / 1000.0; - mapObject["A_AXIS_RADIUS"].setValue(toString(radius), "KM"); - mapObject["B_AXIS_RADIUS"].setValue(toString(radius), "KM"); - mapObject["C_AXIS_RADIUS"].setValue(toString(radius), "KM"); + mapObject["A_AXIS_RADIUS"].setValue(Isis::toString(radius), "KM"); + mapObject["B_AXIS_RADIUS"].setValue(Isis::toString(radius), "KM"); + mapObject["C_AXIS_RADIUS"].setValue(Isis::toString(radius), "KM"); } projName = QString::fromStdString(mapObject["MAP_PROJECTION_TYPE"][0]); @@ -319,11 +319,11 @@ void IsisMain() { // The input to output mapping is opposite from the one above double slope = (p.GetOutputMaximum() - p.GetOutputMinimum()) / (maxmax - minmin); double intercept = p.GetOutputMaximum() - slope * maxmax; - PvlKeyword minimum("MRO:MINIMUM_STRETCH", toString(slope * g_min[0] + intercept)); - PvlKeyword maximum("MRO:MAXIMUM_STRETCH", toString(slope * g_max[0] + intercept)); + PvlKeyword minimum("MRO:MINIMUM_STRETCH", Isis::toString(slope * g_min[0] + intercept)); + PvlKeyword maximum("MRO:MAXIMUM_STRETCH", Isis::toString(slope * g_max[0] + intercept)); for (int band = 1; band < icube2->bandCount(); ++band) { - minimum += toString(slope * g_min[band] + intercept); - maximum += toString(slope * g_max[band] + intercept); + minimum += Isis::toString(slope * g_min[band] + intercept); + maximum += Isis::toString(slope * g_max[band] + intercept); } if (enctype.Equal("jp2")) { @@ -334,8 +334,8 @@ void IsisMain() { imagejp2 += PvlKeyword("DESCRIPTION", "HiRISE projected and mosaicked product"); // Add the SCALLING_FACTOR and OFFSET keywords - imagejp2.addKeyword(PvlKeyword("SCALING_FACTOR", toString(slope)), Pvl::Replace); - imagejp2.addKeyword(PvlKeyword("OFFSET", toString(intercept)), Pvl::Replace); + imagejp2.addKeyword(PvlKeyword("SCALING_FACTOR", Isis::toString(slope)), Pvl::Replace); + imagejp2.addKeyword(PvlKeyword("OFFSET", Isis::toString(intercept)), Pvl::Replace); // Reformat some keyword units in the image object // This is lame, but PDS units are difficult to work with, so for now??? @@ -381,7 +381,7 @@ void IsisMain() { // ProcessExportPds if (nbits != 8 && nbits != 16) { imagejp2.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", - toString((int)pow(2.0, (double)ui.GetInteger("BITS")) - 1)), + Isis::toString((int)pow(2.0, (double)ui.GetInteger("BITS")) - 1)), Pvl::Replace); } } @@ -402,8 +402,8 @@ void IsisMain() { // ??? unneccessary calculation - this is done by ProcessExportPds class. double slope = (maxmax - minmin) / (p.GetOutputMaximum() - p.GetOutputMinimum()); double intercept = maxmax - slope * p.GetOutputMaximum(); - image.addKeyword(PvlKeyword("SCALING_FACTOR", toString(slope)), Pvl::Replace); - image.addKeyword(PvlKeyword("OFFSET", toString(intercept)), Pvl::Replace); + image.addKeyword(PvlKeyword("SCALING_FACTOR", Isis::toString(slope)), Pvl::Replace); + image.addKeyword(PvlKeyword("OFFSET", Isis::toString(intercept)), Pvl::Replace); // Reformat some keyword units in the image object // This is lame, but PDS units are difficult to work with, so for now @@ -449,7 +449,7 @@ void IsisMain() { // ProcessExportPds if (nbits != 8 && nbits != 16) { image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", - toString((int)pow(2.0, (double)ui.GetInteger("BITS")) - 1)), + Isis::toString((int)pow(2.0, (double)ui.GetInteger("BITS")) - 1)), Pvl::Replace); } } diff --git a/isis/src/mro/apps/histat/main.cpp b/isis/src/mro/apps/histat/main.cpp index 6ecd2818a7..ee25f03854 100644 --- a/isis/src/mro/apps/histat/main.cpp +++ b/isis/src/mro/apps/histat/main.cpp @@ -314,19 +314,19 @@ PvlGroup PvlStats(Statistics &stats, const QString &name) { // Construct a label with the results PvlGroup results(name.toStdString()); if(stats.ValidPixels() != 0) { - results += PvlKeyword("Average", toString(stats.Average())); - results += PvlKeyword("StandardDeviation", toString(stats.StandardDeviation())); - results += PvlKeyword("Variance", toString(stats.Variance())); - results += PvlKeyword("Minimum", toString(stats.Minimum())); - results += PvlKeyword("Maximum", toString(stats.Maximum())); + results += PvlKeyword("Average", Isis::toString(stats.Average())); + results += PvlKeyword("StandardDeviation", Isis::toString(stats.StandardDeviation())); + results += PvlKeyword("Variance", Isis::toString(stats.Variance())); + results += PvlKeyword("Minimum", Isis::toString(stats.Minimum())); + results += PvlKeyword("Maximum", Isis::toString(stats.Maximum())); } - results += PvlKeyword("TotalPixels", toString(stats.TotalPixels())); - results += PvlKeyword("ValidPixels", toString(stats.ValidPixels())); - results += PvlKeyword("NullPixels", toString(stats.NullPixels())); - results += PvlKeyword("LisPixels", toString(stats.LisPixels())); - results += PvlKeyword("LrsPixels", toString(stats.LrsPixels())); - results += PvlKeyword("HisPixels", toString(stats.HisPixels())); - results += PvlKeyword("HrsPixels", toString(stats.HrsPixels())); + results += PvlKeyword("TotalPixels", Isis::toString(stats.TotalPixels())); + results += PvlKeyword("ValidPixels", Isis::toString(stats.ValidPixels())); + results += PvlKeyword("NullPixels", Isis::toString(stats.NullPixels())); + results += PvlKeyword("LisPixels", Isis::toString(stats.LisPixels())); + results += PvlKeyword("LrsPixels", Isis::toString(stats.LrsPixels())); + results += PvlKeyword("HisPixels", Isis::toString(stats.HisPixels())); + results += PvlKeyword("HrsPixels", Isis::toString(stats.HrsPixels())); return results; } diff --git a/isis/src/mro/apps/histitch/main.cpp b/isis/src/mro/apps/histitch/main.cpp index 1a13aaa792..25d69d1c8a 100644 --- a/isis/src/mro/apps/histitch/main.cpp +++ b/isis/src/mro/apps/histitch/main.cpp @@ -245,7 +245,7 @@ void IsisMain() { InstrumentOut += PvlKeyword("StitchedProductIds", stitchedProductIds.toStdString()); } else { - InstrumentOut += PvlKeyword("StitchedChannels", toString(fromData[0].ChnNumber)); + InstrumentOut += PvlKeyword("StitchedChannels", Isis::toString(fromData[0].ChnNumber)); InstrumentOut += PvlKeyword("StitchedProductIds", stitchedProductIds.toStdString()); } @@ -293,15 +293,15 @@ void IsisMain() { fromData[ch0Index].mult = coeff; } } - results += PvlKeyword("TruthChannel", toString(hiChannel)); - results += PvlKeyword("BalanceRatio", toString(coeff)); + results += PvlKeyword("TruthChannel", Isis::toString(hiChannel)); + results += PvlKeyword("BalanceRatio", Isis::toString(coeff)); } else { // Store off original averages for table HiVector ch0_org = f0LineAvg; HiVector ch1_org = f1LineAvg; - results += PvlKeyword("FilterWidth", toString(filterWidth)); + results += PvlKeyword("FilterWidth", Isis::toString(filterWidth)); if(filterWidth > 0) { f0LineAvg = filter(f0LineAvg, filterWidth); f1LineAvg = filter(f1LineAvg, filterWidth); @@ -311,12 +311,12 @@ void IsisMain() { if(fillNull) { int nfilled; f0LineAvg = filler(f0LineAvg, nfilled); - results += PvlKeyword("Channel0Filled", toString(nfilled)); + results += PvlKeyword("Channel0Filled", Isis::toString(nfilled)); f1LineAvg = filler(f1LineAvg, nfilled); - results += PvlKeyword("Channel1Filled", toString(nfilled)); + results += PvlKeyword("Channel1Filled", Isis::toString(nfilled)); } - results += PvlKeyword("TruthChannel", toString(hiChannel)); + results += PvlKeyword("TruthChannel", Isis::toString(hiChannel)); results += PvlKeyword("Operator", fixop.toStdString()); int nunfilled(0); HiVector ch0_fixed(icube1->lineCount(), 1.0); @@ -343,7 +343,7 @@ void IsisMain() { ch1_fixed = 0.0; } } - results += PvlKeyword("UnFilled", toString(nunfilled)); + results += PvlKeyword("UnFilled", Isis::toString(nunfilled)); // Add a table to the output file of the data values TableField f1("Channel1Original", Isis::TableField::Double); diff --git a/isis/src/mro/apps/marci2isis/marci2isis.cpp b/isis/src/mro/apps/marci2isis/marci2isis.cpp index 8d829014f2..93db1bff6f 100644 --- a/isis/src/mro/apps/marci2isis/marci2isis.cpp +++ b/isis/src/mro/apps/marci2isis/marci2isis.cpp @@ -173,7 +173,7 @@ namespace Isis{ // Populate with first values Pvl *isisLabelInitial = outputCubes[0]->label(); PvlGroup &instInitial = isisLabelInitial->findGroup("Instrument", Pvl::Traverse); - double exposure = IString::ToDouble(instInitial["ExposureDuration"][0]) * 1000.0; + double exposure = Isis::toDouble(instInitial["ExposureDuration"][0]) * 1000.0; frameseq.push_back(0); exptime.push_back(exposure); @@ -240,8 +240,8 @@ namespace Isis{ PvlKeyword frameNumber("FrameNumber"); for (unsigned int i=0; i < exptime.size(); i++) { - varExposure.addValue(toString(exptime[i]), "ms" ); - frameNumber.addValue(toString(frameseq[i])); + varExposure.addValue(Isis::toString(exptime[i]), "ms" ); + frameNumber.addValue(Isis::toString(frameseq[i])); } inst.addKeyword(frameNumber); inst.addKeyword(varExposure); @@ -395,17 +395,17 @@ namespace Isis{ inst += PvlKeyword("StartTime", pdsLabel["START_TIME"]); inst += PvlKeyword("StopTime", pdsLabel["STOP_TIME"]); inst += PvlKeyword("SpacecraftClockCount", pdsLabel["SPACECRAFT_CLOCK_START_COUNT"]); - inst += PvlKeyword("DataFlipped", toString((int)(flip == 1))); - inst += PvlKeyword("ColorOffset", toString(colorOffset)); - inst += PvlKeyword("InterframeDelay", toString((double)pdsLabel["INTERFRAME_DELAY"]), "seconds"); - inst += PvlKeyword("ExposureDuration", toString((double)pdsLabel["LINE_EXPOSURE_DURATION"] / 1000.0), "seconds"); + inst += PvlKeyword("DataFlipped", Isis::toString((int)(flip == 1))); + inst += PvlKeyword("ColorOffset", Isis::toString(colorOffset)); + inst += PvlKeyword("InterframeDelay", Isis::toString((double)pdsLabel["INTERFRAME_DELAY"]), "seconds"); + inst += PvlKeyword("ExposureDuration", Isis::toString((double)pdsLabel["LINE_EXPOSURE_DURATION"] / 1000.0), "seconds"); PvlGroup bandBin("BandBin"); PvlKeyword filterName("FilterName"); PvlKeyword origBands("OriginalBand"); for(int filter = 0; filter < pdsLabel["FILTER_NAME"].size(); filter++) { filterName += pdsLabel["FILTER_NAME"][filter]; - origBands += toString(filter + 1); + origBands += Isis::toString(filter + 1); } bandBin += filterName; @@ -435,7 +435,7 @@ namespace Isis{ PvlGroup kerns("Kernels"); QString uvvis = bandUvVis.find(QString::fromStdString(bandBin["FilterName"][0]))->second; int iakCode = naifIkCodes.find(uvvis)->second; - kerns += PvlKeyword("NaifIkCode", toString(iakCode)); + kerns += PvlKeyword("NaifIkCode", Isis::toString(iakCode)); isisCube.addGroup(kerns); } diff --git a/isis/src/mro/apps/marcical/marcical.cpp b/isis/src/mro/apps/marcical/marcical.cpp index 5754083ea6..6784e4d188 100644 --- a/isis/src/mro/apps/marcical/marcical.cpp +++ b/isis/src/mro/apps/marcical/marcical.cpp @@ -256,9 +256,9 @@ namespace Isis { vector flatcubes; vector fcubeMgrs; - int summing = IString::ToInteger(icube.group("Instrument")["SummingMode"][0]); - double ifdelay = IString::ToDouble(icube.group("Instrument")["InterframeDelay"][0]) * 1000.0; - int flipped = IString::ToInteger(icube.group("Instrument")["DataFlipped"][0]); + int summing = Isis::toInt(icube.group("Instrument")["SummingMode"][0]); + double ifdelay = Isis::toDouble(icube.group("Instrument")["InterframeDelay"][0]) * 1000.0; + int flipped = Isis::toInt(icube.group("Instrument")["DataFlipped"][0]); // Read in the flat files for (int band = 0; band < 7; band++) { @@ -330,12 +330,12 @@ namespace Isis { } PvlKeyword &sumMode = icube.label()->findGroup("Instrument", Pvl::Traverse)["SummingMode"]; - int summingMode = IString::ToInteger(sumMode[0]); + int summingMode = Isis::toInt(sumMode[0]); int filterHeight = 16 / summingMode; std::vector padding; padding.resize(numFilters); PvlKeyword &colOff = icube.label()->findGroup("Instrument", Pvl::Traverse)["ColorOffset"]; - int colorOffset = IString::ToInteger(colOff[0]); + int colorOffset = Isis::toInt(colOff[0]); for (int i = 0; i < numFilters; i++) { if (colorOffset > 0) { @@ -377,9 +377,9 @@ namespace Isis { PvlKeyword expTimesKey = inst["VariableExposureDuration"]; PvlKeyword frameNumbersKey = inst["FrameNumber"]; for (int i=0; igroup("Instrument"); // change flipped keyword - inst["DataFlipped"] = toString(((int)inst["DataFlipped"] + 1) % 2); + inst["DataFlipped"] = Isis::toString(((int)inst["DataFlipped"] + 1) % 2); outputCube->label()->findObject("IsisCube").addGroup(inst); } diff --git a/isis/src/mro/apps/mroctx2isis/main.cpp b/isis/src/mro/apps/mroctx2isis/main.cpp index 1922ce98ca..4b7cd8a7c1 100644 --- a/isis/src/mro/apps/mroctx2isis/main.cpp +++ b/isis/src/mro/apps/mroctx2isis/main.cpp @@ -244,12 +244,12 @@ void TranslateMroCtxLabels(FileName &labelFile, Cube *ocube) { // Set up the BandBin groups PvlGroup bbin("BandBin"); bbin += PvlKeyword("FilterName", "BroadBand"); - bbin += PvlKeyword("Center", toString(0.650), "micrometers"); - bbin += PvlKeyword("Width", toString(0.150), "micrometers"); + bbin += PvlKeyword("Center", Isis::toString(0.650), "micrometers"); + bbin += PvlKeyword("Width", Isis::toString(0.150), "micrometers"); //Set up the Kernels group PvlGroup kern("Kernels"); - kern += PvlKeyword("NaifFrameCode", toString(-74021)); + kern += PvlKeyword("NaifFrameCode", Isis::toString(-74021)); Pvl lab(labelFile.expanded()); int sumMode, startSamp; @@ -266,8 +266,8 @@ void TranslateMroCtxLabels(FileName &labelFile, Cube *ocube) { startSamp = (int)lab.findKeyword("SAMPLE_FIRST_PIXEL"); } PvlGroup inst = outLabel.findGroup("Instrument", Pvl::Traverse); - inst += PvlKeyword("SpatialSumming", toString(sumMode)); - inst += PvlKeyword("SampleFirstPixel", toString(startSamp)); + inst += PvlKeyword("SpatialSumming", Isis::toString(sumMode)); + inst += PvlKeyword("SampleFirstPixel", Isis::toString(startSamp)); //Add all groups to the output cube ocube->putGroup(inst); diff --git a/isis/src/mro/apps/pds2hideal/main.cpp b/isis/src/mro/apps/pds2hideal/main.cpp index aecde341fb..604d3c01db 100644 --- a/isis/src/mro/apps/pds2hideal/main.cpp +++ b/isis/src/mro/apps/pds2hideal/main.cpp @@ -59,7 +59,7 @@ void IsisMain() { outputCube->putGroup(otherGroups.findGroup("Archive")); PvlGroup kernelGroup("Kernels"); - kernelGroup += PvlKeyword("NaifIkCode", toString(-74699)); + kernelGroup += PvlKeyword("NaifIkCode", Isis::toString(-74699)); kernelGroup += PvlKeyword("TargetPosition", "Table"); kernelGroup += PvlKeyword("InstrumentPointing", "Table"); kernelGroup += PvlKeyword("InstrumentPosition", "Table"); @@ -101,14 +101,14 @@ void IsisMain() { if (sourceLines != lines) { // this image is cropped, create an AlphaCube group PvlGroup alphaCube("AlphaCube"); - alphaCube += PvlKeyword("AlphaSamples", toString(sourceSamps)); - alphaCube += PvlKeyword("AlphaLines", toString(sourceLines)); - alphaCube += PvlKeyword("AlphaStartingSample", toString(firstSamp)); - alphaCube += PvlKeyword("AlphaEndingSample", toString((double) firstSamp + samples)); - alphaCube += PvlKeyword("AlphaStartingLine", toString(firstLine)); - alphaCube += PvlKeyword("AlphaEndingLine", toString((double) firstLine + lines)); - alphaCube += PvlKeyword("BetaSamples", toString(samples)); - alphaCube += PvlKeyword("BetaLines", toString(lines)); + alphaCube += PvlKeyword("AlphaSamples", Isis::toString(sourceSamps)); + alphaCube += PvlKeyword("AlphaLines", Isis::toString(sourceLines)); + alphaCube += PvlKeyword("AlphaStartingSample", Isis::toString(firstSamp)); + alphaCube += PvlKeyword("AlphaEndingSample", Isis::toString((double) firstSamp + samples)); + alphaCube += PvlKeyword("AlphaStartingLine", Isis::toString(firstLine)); + alphaCube += PvlKeyword("AlphaEndingLine", Isis::toString((double) firstLine + lines)); + alphaCube += PvlKeyword("BetaSamples", Isis::toString(samples)); + alphaCube += PvlKeyword("BetaLines", Isis::toString(lines)); isisCubeObject += alphaCube; } diff --git a/isis/src/near/apps/msi2isis/msi2isis.cpp b/isis/src/near/apps/msi2isis/msi2isis.cpp index 3c94348b9e..6c56c0bb44 100644 --- a/isis/src/near/apps/msi2isis/msi2isis.cpp +++ b/isis/src/near/apps/msi2isis/msi2isis.cpp @@ -75,8 +75,8 @@ namespace Isis { + "]. The msi2isis program requires INSTRUMENT_ID = [MSI].", _FILEINFO_); } - int lines = IString::ToInteger(inputLabelPvl.findObject("IMAGE")["LINES"][0]); - int samples = IString::ToInteger(inputLabelPvl.findObject("IMAGE")["LINE_SAMPLES"][0]); + int lines = Isis::toInt(inputLabelPvl.findObject("IMAGE")["LINES"][0]); + int samples = Isis::toInt(inputLabelPvl.findObject("IMAGE")["LINE_SAMPLES"][0]); if ( ( (lines != 244) && (lines != 412) ) || samples != 537) { std::string msg = "The given file [" + from.expanded() + "] does not contain " "a full MSI image. Full NEAR Shoemaker MSI images have " diff --git a/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp b/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp index af494799d5..03c03b41c5 100644 --- a/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp +++ b/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp @@ -204,7 +204,7 @@ namespace Isis { QString exposureTime = QString::fromStdString(inst["ExposureDuration"]); double frameRate = 1.0/exposureTime.toDouble(); - inst.addKeyword(PvlKeyword("FrameRate", toString(frameRate)), PvlGroup::Replace); + inst.addKeyword(PvlKeyword("FrameRate", Isis::toString(frameRate)), PvlGroup::Replace); inst.findKeyword("FrameRate").setUnits("Hz"); // Save the input FITS label in the Cube original labels diff --git a/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp b/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp index c2f10ba8c7..708351642b 100644 --- a/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp +++ b/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp @@ -287,7 +287,7 @@ namespace Isis { bandBin.findKeyword("Name").addValue(name.toStdString()); bandBin.findKeyword("Center").addValue(center.toStdString(), "nanometers"); bandBin.findKeyword("Width").addValue(width.toStdString(), "nanometers"); - bandBin.findKeyword("OriginalBand").addValue(toString(i+1)); + bandBin.findKeyword("OriginalBand").addValue(Isis::toString(i+1)); QString fitsKey = QString("UTCMID%1").arg(i, 2, 10, QChar('0')); QString fitsVal = QString::fromStdString(fitslabel.findKeyword(fitsKey.toStdString(), Pvl::Traverse)); bandBin.findKeyword("UtcTime").addValue(fitsVal.toStdString()); diff --git a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp index 273e4718e7..ce3f5146e5 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp @@ -91,7 +91,7 @@ namespace Isis { PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse); PvlKeyword &orgBand = bandBin["OriginalBand"]; for (int i = 0; i < orgBand.size(); i++) { - m_originalBand.append(IString::ToInteger(orgBand[i])); + m_originalBand.append(Isis::toInt(orgBand[i])); } // Use the defualt no correction distortion map. diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp index a738e01227..12190dc0dc 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp @@ -70,7 +70,7 @@ namespace Isis { PvlKeyword &origBand = bandBin["OriginalBand"]; PvlKeyword &utcTime = bandBin["UtcTime"]; for(int i = 0; i < origBand.size(); i++) { - m_originalBand.push_back(IString::ToInteger(origBand[i])); + m_originalBand.push_back(Isis::toInt(origBand[i])); m_utcTime.push_back(QString::fromStdString(utcTime[i])); } diff --git a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp index 1c0bf67a56..c03bf1e6aa 100644 --- a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp +++ b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp @@ -109,7 +109,7 @@ namespace Isis { if(outputCubes.size() != 1) { int numFramelets = p.Lines() / frameletLines; isis3Lab.findGroup("Instrument").addKeyword( - PvlKeyword("NumFramelets", toString(numFramelets)), Pvl::Replace + PvlKeyword("NumFramelets", Isis::toString(numFramelets)), Pvl::Replace ); QString frameletType = ((i == 0) ? "Odd" : "Even"); @@ -189,7 +189,7 @@ namespace Isis { // Add at time offset to the Instrument group double spacecraftClockOffset = ui.GetDouble("TIMEOFFSET"); - inst += PvlKeyword("SpacecraftClockOffset", toString(spacecraftClockOffset), "seconds"); + inst += PvlKeyword("SpacecraftClockOffset", Isis::toString(spacecraftClockOffset), "seconds"); isis3.addGroup(inst); @@ -199,7 +199,7 @@ namespace Isis { // The original band is the original ISIS cube band number upon ingestion PvlKeyword originalBand("OriginalBand"); for(int i = 1; i <= numBands; i++) { - originalBand.addValue(toString(i)); + originalBand.addValue(Isis::toString(i)); } bandBin += originalBand; @@ -253,10 +253,10 @@ namespace Isis { // Create the Kernel Group PvlGroup kerns("Kernels"); if(instId == "THEMIS_IR") { - kerns += PvlKeyword("NaifFrameCode", toString(-53031)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-53031)); } else { - kerns += PvlKeyword("NaifFrameCode", toString(-53032)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-53032)); } isis3.addGroup(kerns); } diff --git a/isis/src/odyssey/apps/thmnoseam/main.cpp b/isis/src/odyssey/apps/thmnoseam/main.cpp index 16e27e8c29..0656eced1e 100644 --- a/isis/src/odyssey/apps/thmnoseam/main.cpp +++ b/isis/src/odyssey/apps/thmnoseam/main.cpp @@ -133,7 +133,7 @@ void IsisMain() { PvlGroup &inputInstrumentGrp = evenCube->group("Instrument"); PvlKeyword &spatialSumming = inputInstrumentGrp["SpatialSumming"]; - frameletSize = 192 / IString::ToInteger(spatialSumming[0]); + frameletSize = 192 / Isis::toInt(spatialSumming[0]); overlapSize = FrameletOverlapSize(); if(overlapSize == 0) { diff --git a/isis/src/odyssey/apps/thmvisflat/main.cpp b/isis/src/odyssey/apps/thmvisflat/main.cpp index 49a88342e2..d0e72ebc19 100644 --- a/isis/src/odyssey/apps/thmvisflat/main.cpp +++ b/isis/src/odyssey/apps/thmvisflat/main.cpp @@ -46,7 +46,7 @@ void IsisMain() { vector flatcubes; vector fcubeMgrs; - int summing = IString::ToInteger(icube.group("Instrument")["SpatialSumming"][0]); + int summing = Isis::toInt(icube.group("Instrument")["SpatialSumming"][0]); for(int filt = 0; filt < 5; filt++) { QString filePattern = "$odyssey/calibration/flat_filter_"; @@ -79,7 +79,7 @@ void IsisMain() { PvlKeyword &filtNums = icube.label()->findGroup("BandBin", Pvl::Traverse)["FilterNumber"]; for(int i = 0; i < filtNums.size(); i++) { - filter.push_back(IString::ToInteger(filtNums[i])); + filter.push_back(Isis::toInt(filtNums[i])); } LineManager ocubeMgr(ocube); diff --git a/isis/src/odyssey/apps/thmvistrim/main.cpp b/isis/src/odyssey/apps/thmvistrim/main.cpp index 0ff9b9d713..dc4553fdf4 100644 --- a/isis/src/odyssey/apps/thmvistrim/main.cpp +++ b/isis/src/odyssey/apps/thmvistrim/main.cpp @@ -50,7 +50,7 @@ void IsisMain() { p.SetOutputCube("TO"); - frameletSize = 192 / IString::ToInteger(icube->group("Instrument")["SpatialSumming"][0]); + frameletSize = 192 / Isis::toInt(icube->group("Instrument")["SpatialSumming"][0]); frameletTopTrimSize = ui.GetInteger("TOPTRIM"); frameletLeftTrimSize = ui.GetInteger("LEFTTRIM"); frameletRightTrimSize = ui.GetInteger("RIGHTTRIM"); diff --git a/isis/src/odyssey/objs/ThemisIrCamera/ThemisIrCamera.cpp b/isis/src/odyssey/objs/ThemisIrCamera/ThemisIrCamera.cpp index 7eed8ed805..872c8b70ad 100644 --- a/isis/src/odyssey/objs/ThemisIrCamera/ThemisIrCamera.cpp +++ b/isis/src/odyssey/objs/ThemisIrCamera/ThemisIrCamera.cpp @@ -57,7 +57,7 @@ namespace Isis { PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse); PvlKeyword &orgBand = bandBin["FilterNumber"]; for(int i = 0; i < orgBand.size(); i++) { - p_originalBand.push_back(IString::ToInteger(orgBand[i])); + p_originalBand.push_back(Isis::toInt(orgBand[i])); } // Themis IR had a summing mode added. This directly affects the line diff --git a/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp b/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp index ffc3fe36da..52a995de27 100644 --- a/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp +++ b/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp @@ -79,7 +79,7 @@ namespace Isis { PvlKeyword &filterNumbers = bandBin["FilterNumber"]; for (int i = 0; i < filterNumbers.size(); i++) { - p_filterNumber.append(IString::ToInteger(filterNumbers[i])); + p_filterNumber.append(Isis::toInt(filterNumbers[i])); } diff --git a/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp b/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp index 7949dc987b..1b65776a22 100644 --- a/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp +++ b/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp @@ -157,7 +157,7 @@ namespace Isis { // Create YearDoy keyword in Archive group iTime stime(QString::fromStdString(instGrp["StartTime"][0])); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", Isis::toString(stime.Year()*1000 + stime.DayOfYear())); archiveGrp.addKeyword(yeardoy); output->putGroup(archiveGrp); @@ -181,7 +181,7 @@ namespace Isis { if ( "NFT" == instId ) b = -273.43; double camHeadTempC = a * ((double)rawcamT) + b; - instGrp.addKeyword(PvlKeyword("CameraHeadTemperature", toString(camHeadTempC), "celsius")); + instGrp.addKeyword(PvlKeyword("CameraHeadTemperature", Isis::toString(camHeadTempC), "celsius")); output->putGroup(instGrp); // Create a Band Bin group diff --git a/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp b/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp index e3baa7ac95..3b118b2c63 100644 --- a/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp +++ b/isis/src/qisis/objs/CubeViewport/CubeViewport.cpp @@ -1375,15 +1375,15 @@ namespace Isis { whatsThisObj += PvlKeyword("Cube", p_cube->fileName().toStdString()); PvlGroup cubeGrp("CubeDimensions"); - cubeGrp += PvlKeyword("Samples", toString(p_cube->sampleCount())); - cubeGrp += PvlKeyword("Lines", toString(p_cube->lineCount())); - cubeGrp += PvlKeyword("Bands", toString(p_cube->bandCount())); + cubeGrp += PvlKeyword("Samples", Isis::toString(p_cube->sampleCount())); + cubeGrp += PvlKeyword("Lines", Isis::toString(p_cube->lineCount())); + cubeGrp += PvlKeyword("Bands", Isis::toString(p_cube->bandCount())); whatsThisObj += cubeGrp; // Get Viewport Info PvlGroup viewportGrp("ViewportDimensions"); - viewportGrp += PvlKeyword("Samples", toString(viewport()->width())); - viewportGrp += PvlKeyword("Lines", toString(viewport()->height())); + viewportGrp += PvlKeyword("Samples", Isis::toString(viewport()->width())); + viewportGrp += PvlKeyword("Lines", Isis::toString(viewport()->height())); whatsThisObj += viewportGrp; // Get Cube area Info @@ -1403,14 +1403,14 @@ namespace Isis { bandGrp += PvlKeyword("Color", "RGB"); - virtualKey = toString(iRedBand); - virtualKey += toString(iGreenBand); - virtualKey += toString(iBlueBand); + virtualKey = Isis::toString(iRedBand); + virtualKey += Isis::toString(iGreenBand); + virtualKey += Isis::toString(iBlueBand); bandGrp += virtualKey; - physicalKey = toString(p_cube->physicalBand(iRedBand)); - physicalKey += toString(p_cube->physicalBand(iGreenBand)); - physicalKey += toString(p_cube->physicalBand(iBlueBand)); + physicalKey = Isis::toString(p_cube->physicalBand(iRedBand)); + physicalKey += Isis::toString(p_cube->physicalBand(iGreenBand)); + physicalKey += Isis::toString(p_cube->physicalBand(iBlueBand)); bandGrp += physicalKey; if(iFilterSize) { @@ -1442,8 +1442,8 @@ namespace Isis { bandGrp += PvlKeyword("Color", "Gray"); - bandGrp += PvlKeyword("Virtual", toString(iGrayBand)); - bandGrp += PvlKeyword("Physical", toString(p_cube->physicalBand(iGrayBand))); + bandGrp += PvlKeyword("Virtual", Isis::toString(iGrayBand)); + bandGrp += PvlKeyword("Physical", Isis::toString(p_cube->physicalBand(iGrayBand))); if(iFilterSize && iGrayBand <= iFilterSize) { bandGrp += PvlKeyword("FilterName", filterName[iGrayBand-1]); @@ -1453,10 +1453,10 @@ namespace Isis { //start, end line and sample double sl, ss, es, el; getCubeArea(ss, es, sl, el); - cubeAreaPvl += PvlKeyword("StartSample", toString(int(ss + 0.5))); - cubeAreaPvl += PvlKeyword("EndSample", toString(int(es + 0.5))); - cubeAreaPvl += PvlKeyword("StartLine", toString(int(sl + 0.5))); - cubeAreaPvl += PvlKeyword("EndLine", toString(int(el + 0.5))); + cubeAreaPvl += PvlKeyword("StartSample", Isis::toString(int(ss + 0.5))); + cubeAreaPvl += PvlKeyword("EndSample", Isis::toString(int(es + 0.5))); + cubeAreaPvl += PvlKeyword("StartLine", Isis::toString(int(sl + 0.5))); + cubeAreaPvl += PvlKeyword("EndLine", Isis::toString(int(el + 0.5))); cubeAreaPvl += bandGrp; whatsThisObj += cubeAreaPvl; pWhatsThisPvl += whatsThisObj; diff --git a/isis/src/qisis/objs/Directory/ExportImagesWorkOrder.cpp b/isis/src/qisis/objs/Directory/ExportImagesWorkOrder.cpp index ed078fee06..1927852bba 100644 --- a/isis/src/qisis/objs/Directory/ExportImagesWorkOrder.cpp +++ b/isis/src/qisis/objs/Directory/ExportImagesWorkOrder.cpp @@ -246,7 +246,7 @@ namespace Isis { if (*m_numErrors != 0) { result.append( - IException(IException::Unknown,"Failed to export [" + std::to_string(*m_numErrors) + "] images", + IException(IException::Unknown,"Failed to export [" + Isis::toString(*m_numErrors) + "] images", _FILEINFO_)); } diff --git a/isis/src/qisis/objs/FileTool/FileTool.cpp b/isis/src/qisis/objs/FileTool/FileTool.cpp index 509beb4b5d..b2f0171e08 100644 --- a/isis/src/qisis/objs/FileTool/FileTool.cpp +++ b/isis/src/qisis/objs/FileTool/FileTool.cpp @@ -703,16 +703,16 @@ namespace Isis { int iNumBands = pInCube->bandCount(); PvlGroup results("Results"); - results += PvlKeyword("InputLines", toString(pInCube->lineCount())); - results += PvlKeyword("InputSamples", toString(pInCube->sampleCount())); - results += PvlKeyword("StartingLine", toString(dStartLine)); - results += PvlKeyword("StartingSample", toString(dStartSample)); - results += PvlKeyword("EndingLine", toString(dEndLine)); - results += PvlKeyword("EndingSample", toString(dEndSample)); - results += PvlKeyword("LineIncrement", toString(1)); - results += PvlKeyword("SampleIncrement", toString(1)); - results += PvlKeyword("OutputLines", toString(pNumLines)); - results += PvlKeyword("OutputSamples", toString(pNumSamples)); + results += PvlKeyword("InputLines", Isis::toString(pInCube->lineCount())); + results += PvlKeyword("InputSamples", Isis::toString(pInCube->sampleCount())); + results += PvlKeyword("StartingLine", Isis::toString(dStartLine)); + results += PvlKeyword("StartingSample", Isis::toString(dStartSample)); + results += PvlKeyword("EndingLine", Isis::toString(dEndLine)); + results += PvlKeyword("EndingSample", Isis::toString(dEndSample)); + results += PvlKeyword("LineIncrement", Isis::toString(1)); + results += PvlKeyword("SampleIncrement", Isis::toString(1)); + results += PvlKeyword("OutputLines", Isis::toString(pNumLines)); + results += PvlKeyword("OutputSamples", Isis::toString(pNumSamples)); SubArea subArea; subArea.SetSubArea(pInCube->lineCount(), pInCube->sampleCount(), dStartLine, dStartSample, dEndLine, dEndSample, 1.0, 1.0); diff --git a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp index 45782a9862..0e1d4c1d4a 100644 --- a/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp +++ b/isis/src/qisis/objs/ImageFileListWidget/ImageFileListWidget.cpp @@ -189,11 +189,11 @@ namespace Isis { key = key.Convert(" ", '_'); bool visible = !m_tree->isColumnHidden(col); - output += PvlKeyword(key, toString((int)visible)); + output += PvlKeyword(key, Isis::toString((int)visible)); col = (ImageTreeWidgetItem::TreeColumn)(col + 1); } - output += PvlKeyword("SortColumn", toString(m_tree->sortColumn())); + output += PvlKeyword("SortColumn", Isis::toString(m_tree->sortColumn())); // Now store groups and the cubes that are in those groups for (int i = 0; i < m_tree->topLevelItemCount(); i++) { @@ -633,7 +633,7 @@ namespace Isis { // stream.writeEndElement(); // // stream.writeStartElement("position"); -// //qDebug()<<"ImageFileListWidget::save Position = "<text().toStdString()); obj += PvlKeyword("Longitude", m_lonLineEdit->text().toStdString()); obj += PvlKeyword("Area", m_areaLineEdit->text().toStdString()); - obj += PvlKeyword("Visible", toString((int)(m_box != NULL))); + obj += PvlKeyword("Visible", Isis::toString((int)(m_box != NULL))); } return obj; diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp index c271dedf00..2cd658d540 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicControlNetTool.cpp @@ -164,16 +164,16 @@ namespace Isis { obj += PvlKeyword("FileName", m_controlNetFile.toStdString()); obj += PvlKeyword("Visible", - std::to_string((int)(m_controlNetGraphics && m_controlNetGraphics->isVisible()))); - obj += PvlKeyword("Movement", std::to_string(m_movementArrowColorSource)); + Isis::toString((int)(m_controlNetGraphics && m_controlNetGraphics->isVisible()))); + obj += PvlKeyword("Movement", Isis::toString(m_movementArrowColorSource)); if (maxMovementColorMeasureCount() != -1) { - obj += PvlKeyword("MovementColorMaxMeasureCount", std::to_string(m_measureCount)); + obj += PvlKeyword("MovementColorMaxMeasureCount", Isis::toString(m_measureCount)); } if (maxMovementColorResidualMagnitude() != Null) { obj += PvlKeyword("MovementColorMaxResidualMagnitude", - std::to_string(m_residualMagnitude)); + Isis::toString(m_residualMagnitude)); } return obj; @@ -190,11 +190,11 @@ namespace Isis { } if (obj.hasKeyword("MovementColorMaxMeasureCount")) { - m_measureCount = IString::ToInteger(obj["MovementColorMaxMeasureCount"][0]); + m_measureCount = Isis::toInt(obj["MovementColorMaxMeasureCount"][0]); } if (obj.hasKeyword("MovementColorMaxResidualMagnitude")) { - m_residualMagnitude = IString::ToDouble(obj["MovementColorMaxResidualMagnitude"][0]); + m_residualMagnitude = Isis::toDouble(obj["MovementColorMaxResidualMagnitude"][0]); } loadNetwork(); diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp index d8bf3f84a8..7f7d17087b 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicFindTool.cpp @@ -172,7 +172,7 @@ namespace Isis { obj += PvlKeyword("Latitude", p_latLineEdit->text().toStdString()); obj += PvlKeyword("Longitude", p_lonLineEdit->text().toStdString()); - obj += PvlKeyword("Visible", toString((int)(p_findSpot != NULL))); + obj += PvlKeyword("Visible", Isis::toString((int)(p_findSpot != NULL))); return obj; } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp index 75648c2512..b8ff4d2867 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicGridTool.cpp @@ -568,52 +568,52 @@ namespace Isis { tproj->PolarRadius(), Distance::Meters); if (obj["BaseLatitude"][0] != "Null") - m_baseLat = Latitude(IString::ToDouble(obj["BaseLatitude"][0]), equatorialRadius, polarRadius, + m_baseLat = Latitude(Isis::toDouble(obj["BaseLatitude"][0]), equatorialRadius, polarRadius, Latitude::Planetocentric, Angle::Degrees); if (obj["BaseLongitude"][0] != "Null") - m_baseLon = Longitude(IString::ToDouble(obj["BaseLongitude"][0]), Angle::Degrees); + m_baseLon = Longitude(Isis::toDouble(obj["BaseLongitude"][0]), Angle::Degrees); if (obj["LatitudeIncrement"][0] != "Null") - m_latInc = Angle(IString::ToDouble(obj["LatitudeIncrement"][0]), Angle::Degrees); + m_latInc = Angle(Isis::toDouble(obj["LatitudeIncrement"][0]), Angle::Degrees); if (obj["LongitudeIncrement"][0] != "Null") - m_lonInc = Angle(IString::ToDouble(obj["LongitudeIncrement"][0]), Angle::Degrees); + m_lonInc = Angle(Isis::toDouble(obj["LongitudeIncrement"][0]), Angle::Degrees); if (obj.hasKeyword("LatitudeExtentType")) { if (obj["LatitudeExtentType"][0] != "Null") - m_latExtents = (GridExtentSource)IString::ToInteger(obj["LatitudeExtentType"][0]); + m_latExtents = (GridExtentSource)Isis::toInt(obj["LatitudeExtentType"][0]); } if (obj.hasKeyword("MinimumLatitude")) { if (obj["MinimumLatitude"][0] != "Null") - m_minLat = Latitude(IString::ToDouble(obj["MinimumLatitude"][0]), equatorialRadius, polarRadius, + m_minLat = Latitude(Isis::toDouble(obj["MinimumLatitude"][0]), equatorialRadius, polarRadius, Latitude::Planetocentric, Angle::Degrees); } if (obj.hasKeyword("MaximumLatitude")) { if (obj["MaximumLatitude"][0] != "Null") - m_maxLat = Latitude(IString::ToDouble(obj["MaximumLatitude"][0]), equatorialRadius, polarRadius, + m_maxLat = Latitude(Isis::toDouble(obj["MaximumLatitude"][0]), equatorialRadius, polarRadius, Latitude::Planetocentric, Angle::Degrees); } if (obj.hasKeyword("LongitudeExtentType")) { if (obj["LongitudeExtentType"][0] != "Null") - m_lonExtents = (GridExtentSource)IString::ToInteger(obj["LongitudeExtentType"][0]); + m_lonExtents = (GridExtentSource)Isis::toInt(obj["LongitudeExtentType"][0]); } if (obj.hasKeyword("MinimumLongitude")) { if (obj["MinimumLongitude"][0] != "Null") - m_minLon = Longitude(IString::ToDouble(obj["MinimumLongitude"][0]), Angle::Degrees); + m_minLon = Longitude(Isis::toDouble(obj["MinimumLongitude"][0]), Angle::Degrees); } if (obj.hasKeyword("MaximumLongitude")) { if (obj["MaximumLongitude"][0] != "Null") - m_maxLon = Longitude(IString::ToDouble(obj["MaximumLongitude"][0]), Angle::Degrees); + m_maxLon = Longitude(Isis::toDouble(obj["MaximumLongitude"][0]), Angle::Degrees); } if (obj["Density"][0] != "Null") - m_density = IString::ToDouble(obj["Density"][0]); + m_density = Isis::toDouble(obj["Density"][0]); if (obj.hasKeyword("CheckTheBoxes")) { @@ -647,24 +647,24 @@ namespace Isis { PvlObject MosaicGridTool::toPvl() const { PvlObject obj(projectPvlObjectName().toStdString()); - obj += PvlKeyword("ShouldCheckBoxes", toString((int)m_shouldCheckBoxes)); + obj += PvlKeyword("ShouldCheckBoxes", Isis::toString((int)m_shouldCheckBoxes)); - obj += PvlKeyword("BaseLatitude", toString(m_baseLat.degrees())); - obj += PvlKeyword("BaseLongitude", toString(m_baseLon.degrees())); + obj += PvlKeyword("BaseLatitude", Isis::toString(m_baseLat.degrees())); + obj += PvlKeyword("BaseLongitude", Isis::toString(m_baseLon.degrees())); - obj += PvlKeyword("LatitudeIncrement", toString(m_latInc.degrees())); - obj += PvlKeyword("LongitudeIncrement", toString(m_lonInc.degrees())); + obj += PvlKeyword("LatitudeIncrement", Isis::toString(m_latInc.degrees())); + obj += PvlKeyword("LongitudeIncrement", Isis::toString(m_lonInc.degrees())); - obj += PvlKeyword("LatitudeExtentType", toString(m_latExtents)); - obj += PvlKeyword("MaximumLatitude", toString(m_maxLat.degrees())); - obj += PvlKeyword("MinimumLongitude", toString(m_minLon.degrees())); + obj += PvlKeyword("LatitudeExtentType", Isis::toString(m_latExtents)); + obj += PvlKeyword("MaximumLatitude", Isis::toString(m_maxLat.degrees())); + obj += PvlKeyword("MinimumLongitude", Isis::toString(m_minLon.degrees())); - obj += PvlKeyword("LongitudeExtentType", toString(m_lonExtents)); - obj += PvlKeyword("MinimumLatitude", toString(m_minLat.degrees())); - obj += PvlKeyword("MaximumLongitude", toString(m_maxLon.degrees())); + obj += PvlKeyword("LongitudeExtentType", Isis::toString(m_lonExtents)); + obj += PvlKeyword("MinimumLatitude", Isis::toString(m_minLat.degrees())); + obj += PvlKeyword("MaximumLongitude", Isis::toString(m_maxLon.degrees())); - obj += PvlKeyword("Density", toString(m_density)); - obj += PvlKeyword("Visible", toString((int)(m_gridItem != NULL))); + obj += PvlKeyword("Density", Isis::toString(m_density)); + obj += PvlKeyword("Visible", Isis::toString((int)(m_gridItem != NULL))); return obj; } diff --git a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp index 7b5ba8ddd9..e3b38411c3 100644 --- a/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp +++ b/isis/src/qisis/objs/MosaicSceneWidget/MosaicSceneWidget.cpp @@ -357,9 +357,9 @@ namespace Isis { cam->radii(radii); mappingGrp += PvlKeyword("TargetName", cam->target()->name().toStdString()); - mappingGrp += PvlKeyword("EquatorialRadius", toString(radii[0].meters()), + mappingGrp += PvlKeyword("EquatorialRadius", Isis::toString(radii[0].meters()), "meters"); - mappingGrp += PvlKeyword("PolarRadius", toString(radii[2].meters()), + mappingGrp += PvlKeyword("PolarRadius", Isis::toString(radii[2].meters()), "meters"); } @@ -535,8 +535,8 @@ namespace Isis { mosaicScenePosition += PvlKeyword("ViewTransform", std::string(dataBuffer.data().toHex())); PvlKeyword scrollPos("ScrollPosition"); - scrollPos += toString(getView()->horizontalScrollBar()->value()); - scrollPos += toString(getView()->verticalScrollBar()->value()); + scrollPos += Isis::toString(getView()->horizontalScrollBar()->value()); + scrollPos += Isis::toString(getView()->verticalScrollBar()->value()); mosaicScenePosition += scrollPos; output += mosaicScenePosition; @@ -554,7 +554,7 @@ namespace Isis { foreach(MosaicSceneItem * mosaicSceneItem, *m_mosaicSceneItems) { PvlKeyword zValue("ZValue"); zValue += mosaicSceneItem->image()->id().toStdString(); - zValue += toString(mosaicSceneItem->zValue()); + zValue += Isis::toString(mosaicSceneItem->zValue()); zOrders += zValue; } @@ -601,7 +601,7 @@ namespace Isis { zOrderIndex ++) { const PvlKeyword &zOrder = zOrders[zOrderIndex]; - (*m_projectImageZOrders)[QString::fromStdString(zOrder[0])] = IString::ToDouble(zOrder[1]); + (*m_projectImageZOrders)[QString::fromStdString(zOrder[0])] = Isis::toDouble(zOrder[1]); } } @@ -1377,8 +1377,8 @@ namespace Isis { transformStream >> viewTransform; getView()->setTransform(viewTransform); - QPoint projectScrollPos(IString::ToInteger(positionInfo["ScrollPosition"][0]), - IString::ToInteger(positionInfo["ScrollPosition"][1])); + QPoint projectScrollPos(Isis::toInt(positionInfo["ScrollPosition"][0]), + Isis::toInt(positionInfo["ScrollPosition"][1])); getView()->horizontalScrollBar()->setValue(projectScrollPos.x()); getView()->verticalScrollBar()->setValue(projectScrollPos.y()); diff --git a/isis/src/qisis/objs/ScatterPlotTool/ScatterPlotData.cpp b/isis/src/qisis/objs/ScatterPlotTool/ScatterPlotData.cpp index 46c2378e6d..b67b582b31 100644 --- a/isis/src/qisis/objs/ScatterPlotTool/ScatterPlotData.cpp +++ b/isis/src/qisis/objs/ScatterPlotTool/ScatterPlotData.cpp @@ -253,8 +253,8 @@ namespace Isis { } - std::string msg = "Bin at index [" + toString(index) + "] not found. " - "There are [" + toString(numberOfBins()) + "] bins"; + std::string msg = "Bin at index [" + Isis::toString(index) + "] not found. " + "There are [" + Isis::toString(numberOfBins()) + "] bins"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -447,8 +447,8 @@ namespace Isis { int xIndex = binIndex; if (xIndex < 0 || yIndex < 0 || xIndex >= xSize || yIndex >= ySize) { - std::string msg = "Bin at index [" + toString(binIndex) + "] not found. " - "There are [" + toString(numberOfBins()) + "] bins"; + std::string msg = "Bin at index [" + Isis::toString(binIndex) + "] not found. " + "There are [" + Isis::toString(numberOfBins()) + "] bins"; throw IException(IException::Programmer, msg, _FILEINFO_); } diff --git a/isis/src/qisis/objs/Shape/Shape.cpp b/isis/src/qisis/objs/Shape/Shape.cpp index 118a0fddaf..15f9ec80ad 100644 --- a/isis/src/qisis/objs/Shape/Shape.cpp +++ b/isis/src/qisis/objs/Shape/Shape.cpp @@ -748,27 +748,27 @@ namespace Isis { m_projectionName = QString::fromStdString(obj.findGroup("Mapping")["ProjectionName"][0]); if (mapGroup.hasKeyword("CenterLongitude")) - m_centerLongitude = Longitude(IString::ToDouble(obj.findGroup("Mapping")["CenterLongitude"][0]), + m_centerLongitude = Longitude(Isis::toDouble(obj.findGroup("Mapping")["CenterLongitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("CenterLatitude")) - m_centerLatitude = Latitude(IString::ToDouble(obj.findGroup("Mapping")["CenterLatitude"][0]), + m_centerLatitude = Latitude(Isis::toDouble(obj.findGroup("Mapping")["CenterLatitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("MinimumLatitude")) - m_minimumLatitude = Latitude(IString::ToDouble(obj.findGroup("Mapping")["MinimumLatitude"][0]), + m_minimumLatitude = Latitude(Isis::toDouble(obj.findGroup("Mapping")["MinimumLatitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("MaximumLatitude")) - m_maximumLatitude = Latitude(IString::ToDouble(obj.findGroup("Mapping")["MaximumLatitude"][0]), + m_maximumLatitude = Latitude(Isis::toDouble(obj.findGroup("Mapping")["MaximumLatitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("MinimumLongitude")) - m_minimumLongitude = Longitude(IString::ToDouble(obj.findGroup("Mapping")["MinimumLongitude"][0]), + m_minimumLongitude = Longitude(Isis::toDouble(obj.findGroup("Mapping")["MinimumLongitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("MaximumLongitude")) - m_maximumLongitude = Longitude(IString::ToDouble(obj.findGroup("Mapping")["MaximumLongitude"][0]), + m_maximumLongitude = Longitude(Isis::toDouble(obj.findGroup("Mapping")["MaximumLongitude"][0]), mapGroup, Angle::Degrees); if (mapGroup.hasKeyword("PixelResolution")) diff --git a/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotTool.cpp b/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotTool.cpp index aeec415e83..4f2752ba5a 100644 --- a/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotTool.cpp +++ b/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotTool.cpp @@ -669,7 +669,7 @@ namespace Isis { if (bandBin.hasKeyword("Center")) { PvlKeyword &wavelength = bandBin.findKeyword("Center"); if (wavelength.size() > (band - 1)) { - labels.push_back(IString::ToDouble(wavelength[band-1])); + labels.push_back(Isis::toDouble(wavelength[band-1])); } } } diff --git a/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotWindow.cpp b/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotWindow.cpp index 657d6a318b..9fe3242812 100644 --- a/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotWindow.cpp +++ b/isis/src/qisis/objs/SpectralPlotTool/SpectralPlotWindow.cpp @@ -121,7 +121,7 @@ namespace Isis { /*This is were we need to set the x value to the band number.*/ if (grayBand > 0) { if (xAxisUnits() == PlotCurve::Wavelength) { - m_grayBandLine->setXValue(IString::ToDouble(wavelengths[grayBand-1])); + m_grayBandLine->setXValue(Isis::toDouble(wavelengths[grayBand-1])); } else { m_grayBandLine->setXValue(grayBand); @@ -136,7 +136,7 @@ namespace Isis { if (redBand > 0) { if (xAxisUnits() == PlotCurve::Wavelength) { - m_redBandLine->setXValue(IString::ToDouble(wavelengths[redBand-1])); + m_redBandLine->setXValue(Isis::toDouble(wavelengths[redBand-1])); } else { m_redBandLine->setXValue(redBand); @@ -150,7 +150,7 @@ namespace Isis { } if (greenBand > 0) { if (xAxisUnits() == PlotCurve::Wavelength) { - m_greenBandLine->setXValue(IString::ToDouble(wavelengths[greenBand-1])); + m_greenBandLine->setXValue(Isis::toDouble(wavelengths[greenBand-1])); } else { m_greenBandLine->setXValue(greenBand); @@ -165,7 +165,7 @@ namespace Isis { if (blueBand > 0) { if (xAxisUnits() == PlotCurve::Wavelength) { - m_blueBandLine->setXValue(IString::ToDouble(wavelengths[blueBand-1])); + m_blueBandLine->setXValue(Isis::toDouble(wavelengths[blueBand-1])); } else { m_blueBandLine->setXValue(blueBand); diff --git a/isis/src/qisis/objs/StretchTool/StretchTool.cpp b/isis/src/qisis/objs/StretchTool/StretchTool.cpp index c944627a6c..2c9f7cdaec 100644 --- a/isis/src/qisis/objs/StretchTool/StretchTool.cpp +++ b/isis/src/qisis/objs/StretchTool/StretchTool.cpp @@ -511,13 +511,13 @@ namespace Isis { } else { std::vector keywordValueRed; - keywordValueRed.push_back(PvlKeyword("BandNumber", toString(cvp->redBand()))); + keywordValueRed.push_back(PvlKeyword("BandNumber", Isis::toString(cvp->redBand()))); std::vector keywordValueGreen; - keywordValueGreen.push_back(PvlKeyword("BandNumber", toString(cvp->greenBand()))); + keywordValueGreen.push_back(PvlKeyword("BandNumber", Isis::toString(cvp->greenBand()))); std::vector keywordValueBlue; - keywordValueBlue.push_back(PvlKeyword("BandNumber", toString(cvp->blueBand()))); + keywordValueBlue.push_back(PvlKeyword("BandNumber", Isis::toString(cvp->blueBand()))); CubeStretch redStretch = icube->readCubeStretch(stretchName, keywordValueRed); CubeStretch greenStretch = icube->readCubeStretch(stretchName, keywordValueGreen); diff --git a/isis/src/rosetta/apps/rososiris2isis/main.cpp b/isis/src/rosetta/apps/rososiris2isis/main.cpp index 5b8757ee3f..da70042f49 100644 --- a/isis/src/rosetta/apps/rososiris2isis/main.cpp +++ b/isis/src/rosetta/apps/rososiris2isis/main.cpp @@ -138,21 +138,21 @@ void IsisMain() { throw IException(e, IException::Io, msg, _FILEINFO_); } } - // bandBin += PvlKeyword("FilterId", toString(filterId)); + // bandBin += PvlKeyword("FilterId", Isis::toString(filterId)); bbGrp.addKeyword(PvlKeyword("FilterOneName", filterNames[0].toStdString())); - bbGrp.addKeyword(PvlKeyword("FilterOneCenter", toString(filterCenters[0]), "nanometers")); - bbGrp.addKeyword(PvlKeyword("FilterOneWidth", toString(filterWidths[0]), "nanometers")); + bbGrp.addKeyword(PvlKeyword("FilterOneCenter", Isis::toString(filterCenters[0]), "nanometers")); + bbGrp.addKeyword(PvlKeyword("FilterOneWidth", Isis::toString(filterWidths[0]), "nanometers")); bbGrp.addKeyword(PvlKeyword("FilterTwoName", filterNames[1].toStdString())); - bbGrp.addKeyword(PvlKeyword("FilterTwoCenter", toString(filterCenters[1]), "nanometers")); - bbGrp.addKeyword(PvlKeyword("FilterTwoWidth", toString(filterWidths[1]), "nanometers")); + bbGrp.addKeyword(PvlKeyword("FilterTwoCenter", Isis::toString(filterCenters[1]), "nanometers")); + bbGrp.addKeyword(PvlKeyword("FilterTwoWidth", Isis::toString(filterWidths[1]), "nanometers")); outcube->putGroup(bbGrp); PvlGroup kerns("Kernels"); if (instId.compare("OSINAC", Qt::CaseInsensitive) == 0) { - kerns += PvlKeyword("NaifFrameCode", toString(-226111)); //should I add [-filtno] directly after the number? That's what Dawn did + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-226111)); //should I add [-filtno] directly after the number? That's what Dawn did } else if (instId.compare("OSIWAC", Qt::CaseInsensitive) == 0) { - kerns += PvlKeyword("NaifFrameCode", toString(-226112)); //should I add [-filtno] directly after the number? That's what Dawn did + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-226112)); //should I add [-filtno] directly after the number? That's what Dawn did } else { std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + diff --git a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp index 26c062aafb..aa06b1575e 100644 --- a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp +++ b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp @@ -420,7 +420,7 @@ void IsisMain () scs2e_c( (SpiceInt) -226, stopScet.toLatin1().data(), &etEnd); PvlKeyword &frameParam = inst["FrameParameter"]; - double exposureTime = IString::ToDouble(frameParam[0]); + double exposureTime = Isis::toDouble(frameParam[0]); QString startTime = iTime(etStart-exposureTime).UTC(); QString stopTime = iTime(etEnd-exposureTime).UTC(); @@ -451,13 +451,13 @@ void IsisMain () // VIRTIS_H is also supported. PvlGroup kerns("Kernels"); if (channelid == "VIRTIS_M_IR") { - kerns += PvlKeyword("NaifFrameCode", toString(-226213)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-226213)); } else if (channelid == "VIRTIS_M_VIS") { - kerns += PvlKeyword("NaifFrameCode", toString(-226211)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-226211)); } else if (channelid == "VIRTIS_H") { - kerns += PvlKeyword("NaifFrameCode", toString(-226220)); + kerns += PvlKeyword("NaifFrameCode", Isis::toString(-226220)); } else { std::string msg = "Input file [" + inFile.expanded() + "] has an invalid " + @@ -471,7 +471,7 @@ void IsisMain () const PvlKeyword &frameKey = outcube->group("Instrument").findKeyword("FrameParameter"); // The third frame key is always the number of scans in between dark current scans. // So, we need to add one to that in order to get the number of lines to next dark current. - int darkRate = IString::ToInteger(frameKey[3]) + 1; + int darkRate = Isis::toInt(frameKey[3]) + 1; LineManager darkLineManager(*outcube); for (int band = 1; band <= outcube->bandCount(); band++) { diff --git a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp index 2d3401c9ac..26cc4c377c 100644 --- a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp +++ b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp @@ -104,9 +104,9 @@ namespace Isis { // convert milliseconds to seconds - m_exposureTime = IString::ToDouble(frameParam[0]) * 0.001; - m_summing = IString::ToDouble(frameParam[1]); - m_scanRate = IString::ToDouble(frameParam[2]); + m_exposureTime = Isis::toDouble(frameParam[0]) * 0.001; + m_summing = Isis::toDouble(frameParam[1]); + m_scanRate = Isis::toDouble(frameParam[2]); // Setup detector map // Get the line scan rates/times @@ -527,21 +527,21 @@ namespace Isis { } // Add some necessary keywords - quats.Label() += PvlKeyword("CkTableStartTime", toString(startTime())); - quats.Label() += PvlKeyword("CkTableEndTime", toString(endTime())); - quats.Label() += PvlKeyword("CkTableOriginalSize", toString(quats.Records())); + quats.Label() += PvlKeyword("CkTableStartTime", Isis::toString(startTime())); + quats.Label() += PvlKeyword("CkTableEndTime", Isis::toString(endTime())); + quats.Label() += PvlKeyword("CkTableOriginalSize", Isis::toString(quats.Records())); // Create the time dependant frames keyword int virZeroId = getInteger("FRAME_" + virZero); - PvlKeyword tdf("TimeDependentFrames", toString(virZeroId)); // ROS_VIRTIS_M_{ID}_ZERO + PvlKeyword tdf("TimeDependentFrames", Isis::toString(virZeroId)); // ROS_VIRTIS_M_{ID}_ZERO tdf.addValue("-226200"); // ROS_VIRTIS tdf.addValue("-226000"); // ROSETTA_SPACECRAFT tdf.addValue("1"); // J2000 quats.Label() += tdf; // Create constant rotation frames - PvlKeyword cf("ConstantFrames", toString(virZeroId)); - cf.addValue(toString(virZeroId)); + PvlKeyword cf("ConstantFrames", Isis::toString(virZeroId)); + cf.addValue(Isis::toString(virZeroId)); quats.Label() += cf; SpiceDouble identity[3][3]; @@ -551,7 +551,7 @@ namespace Isis { PvlKeyword crot("ConstantRotation"); for (int i = 0 ; i < 3 ; i++) { for (int j = 0 ; j < 3 ; j++) { - crot.addValue(toString(identity[i][j])); + crot.addValue(Isis::toString(identity[i][j])); } } diff --git a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp index fdd3ce1200..00e0f850c2 100644 --- a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp +++ b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp @@ -692,8 +692,8 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { Distance targetRadii[3]; if (input->label()->hasGroup("Mapping")) { PvlGroup &mappingGroup = input->label()->findGroup("Mapping"); - targetRadii[0].setMeters(IString::ToDouble(mappingGroup["EquatorialRadius"][0])); - targetRadii[2].setMeters(IString::ToDouble(mappingGroup["PolarRadius"][0])); + targetRadii[0].setMeters(Isis::toDouble(mappingGroup["EquatorialRadius"][0])); + targetRadii[2].setMeters(Isis::toDouble(mappingGroup["PolarRadius"][0])); } else { try { diff --git a/isis/src/system/apps/isisdataeval/isisdataeval.cpp b/isis/src/system/apps/isisdataeval/isisdataeval.cpp index 00fad29f84..9862348811 100644 --- a/isis/src/system/apps/isisdataeval/isisdataeval.cpp +++ b/isis/src/system/apps/isisdataeval/isisdataeval.cpp @@ -182,17 +182,17 @@ namespace Isis { PvlGroup results("Results"); results.addKeyword( PvlKeyword( "ISISDATA", isisdata.expanded() ) ); results.addKeyword( PvlKeyword( "DATADIR", datadir.toStdString() ) ); - results.addKeyword( PvlKeyword( "EmptyKernelDBs", toString( inventory_counts.m_empty ) ) ); - results.addKeyword( PvlKeyword( "MissingKernelDBs", toString( inventory_counts.m_missing ) ) ); - results.addKeyword( PvlKeyword( "SymlinkKernelFiles", toString( inventory_counts.m_symlinks ) ) ); - results.addKeyword( PvlKeyword( "ExternalKernelFiles", toString( inventory_counts.m_externals ) ) ); - results.addKeyword( PvlKeyword( "ErrorKernelFiles", toString( inventory_counts.m_errors ) ) ); - results.addKeyword( PvlKeyword( "TotalDBConfigFiles", toString( t_configs ), "conf" ) ); - results.addKeyword( PvlKeyword( "TotalKernelDBFiles", toString( t_kerneldbs ), "db" ) ); - results.addKeyword( PvlKeyword( "TotalDirectories", toString( t_dirs ) ) ); - results.addKeyword( PvlKeyword( "TotalDataFiles", toString( t_files ) ) ); - results.addKeyword( PvlKeyword( "TotalInstallSize", toString( t_install_size ), "bytes" ) ); - results.addKeyword( PvlKeyword( "TotalVolumeSize", toString( t_volume_size ), "GB" ) ); + results.addKeyword( PvlKeyword( "EmptyKernelDBs", Isis::toString( inventory_counts.m_empty ) ) ); + results.addKeyword( PvlKeyword( "MissingKernelDBs", Isis::toString( inventory_counts.m_missing ) ) ); + results.addKeyword( PvlKeyword( "SymlinkKernelFiles", Isis::toString( inventory_counts.m_symlinks ) ) ); + results.addKeyword( PvlKeyword( "ExternalKernelFiles", Isis::toString( inventory_counts.m_externals ) ) ); + results.addKeyword( PvlKeyword( "ErrorKernelFiles", Isis::toString( inventory_counts.m_errors ) ) ); + results.addKeyword( PvlKeyword( "TotalDBConfigFiles", Isis::toString( t_configs ), "conf" ) ); + results.addKeyword( PvlKeyword( "TotalKernelDBFiles", Isis::toString( t_kerneldbs ), "db" ) ); + results.addKeyword( PvlKeyword( "TotalDirectories", Isis::toString( t_dirs ) ) ); + results.addKeyword( PvlKeyword( "TotalDataFiles", Isis::toString( t_files ) ) ); + results.addKeyword( PvlKeyword( "TotalInstallSize", Isis::toString( t_install_size ), "bytes" ) ); + results.addKeyword( PvlKeyword( "TotalVolumeSize", Isis::toString( t_volume_size ), "GB" ) ); // If users wants kernel issues reported, write it out here if ( ui.WasEntered( "TOISSUES" ) ) { @@ -390,17 +390,17 @@ namespace Isis { } // Report results - results.addKeyword( PvlKeyword( "MissingInInventory", toString( error_counts_t.m_missing ) ) ); - results.addKeyword( PvlKeyword( "SymlinkInInventory", toString( error_counts_t.m_symlinks ) ) ); - results.addKeyword( PvlKeyword( "ExternalToInventory", toString( error_counts_t.m_externals ) ) ); - results.addKeyword( PvlKeyword( "ErrorInInventory", toString( error_counts_t.m_errors ) ) ); + results.addKeyword( PvlKeyword( "MissingInInventory", Isis::toString( error_counts_t.m_missing ) ) ); + results.addKeyword( PvlKeyword( "SymlinkInInventory", Isis::toString( error_counts_t.m_symlinks ) ) ); + results.addKeyword( PvlKeyword( "ExternalToInventory", Isis::toString( error_counts_t.m_externals ) ) ); + results.addKeyword( PvlKeyword( "ErrorInInventory", Isis::toString( error_counts_t.m_errors ) ) ); if ( needHash ) { QByteArray v_hash_data = volume_hash.result(); QString volume_hash_str = QString::fromUtf8( v_hash_data.toHex() ); BigInt hbsize = HashBufferSizeBytes; - results.addKeyword( PvlKeyword( "HashBufferSize", toString(hbsize), "bytes" ) ); + results.addKeyword( PvlKeyword( "HashBufferSize", Isis::toString(hbsize), "bytes" ) ); results.addKeyword( PvlKeyword( "TotalVolumeHash", volume_hash_str.toStdString(), hashtype.toStdString() ) ); } diff --git a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp index 6199bea42b..135eadbd44 100644 --- a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp +++ b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp @@ -234,7 +234,7 @@ namespace Isis { throw IException(IException::Unknown, "Expected the keyword File in ["+ kernelFileName.original() +"] to have two " "values, a mission data directory and a path into " - "that directory. The keyword has ["+ toString(key.size()) +"] values.", + "that directory. The keyword has ["+ Isis::toString(key.size()) +"] values.", _FILEINFO_); } } @@ -247,9 +247,9 @@ namespace Isis { } } else { - throw IException(IException::Unknown, "Expected Pvl Group [" + primaryGroup.name() + "] in the first Pvl Object [" + primaryObject.name() + "] " - "in the DB file [" + kernelFileName.original() + "] to have a single keyword (named " - "File), but found [" + toString(primaryGroup.keywords()) + "] keywords", + throw IException(IException::Unknown, "Expected Pvl Group " + primaryGroup.name() + " in the first Pvl Object " + primaryObject.name() + " " + "in the DB file " + kernelFileName.original() + " to have a single keyword (named " + "File), but found " + Isis::toString(primaryGroup.keywords()) + " keywords", _FILEINFO_); } } @@ -260,14 +260,14 @@ namespace Isis { } } else { - throw IException(IException::Unknown,"Expected one Pvl Group in the first Pvl Object [" + primaryObject.name() + "] in " - "the DB file [" + kernelFileName.original() + "] but found [" + toString(primaryObject.groups()) + "]", _FILEINFO_); + throw IException(IException::Unknown,"Expected one Pvl Group in the first Pvl Object " + primaryObject.name() + " in " + "the DB file " + kernelFileName.original() + " but found " + Isis::toString(primaryObject.groups()), _FILEINFO_); } } else { throw IException(IException::Unknown, "Expected one Pvl Object in the DB file ["+kernelFileName.original()+"] but " - "found ["+ toString(kernelDbPvl.objects()) +"]", + "found ["+ Isis::toString(kernelDbPvl.objects()) +"]", _FILEINFO_); } } diff --git a/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.cpp b/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.cpp index 895cba0ef4..14d49a2f7b 100644 --- a/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.cpp +++ b/isis/src/system/apps/prtloganalyzer/ProgramAnalyzer.cpp @@ -202,16 +202,16 @@ void ProgramAnalyzer::add(PvlObject &program) { PvlGroup ProgramAnalyzer::review(const QString &name) const { PvlGroup pvl(name.toStdString()); - pvl += PvlKeyword("Programs", toString(size())); - pvl += PvlKeyword("Unique", toString(Programs())); - pvl += PvlKeyword("Included", toString(LimitTotals(_includes))); - pvl += PvlKeyword("Excluded", toString(LimitTotals(_excludes))); - pvl += PvlKeyword("Valid", toString(valid())); - pvl += PvlKeyword("Errors", toString(errors())); - pvl += PvlKeyword("ZeroTime", toString(zerotime())); - pvl += PvlKeyword("NoData", toString(nodata())); - pvl += PvlKeyword("BadData", toString(baddata())); - pvl += PvlKeyword("Total", toString(count())); + pvl += PvlKeyword("Programs", Isis::toString(size())); + pvl += PvlKeyword("Unique", Isis::toString(Programs())); + pvl += PvlKeyword("Included", Isis::toString(LimitTotals(_includes))); + pvl += PvlKeyword("Excluded", Isis::toString(LimitTotals(_excludes))); + pvl += PvlKeyword("Valid", Isis::toString(valid())); + pvl += PvlKeyword("Errors", Isis::toString(errors())); + pvl += PvlKeyword("ZeroTime", Isis::toString(zerotime())); + pvl += PvlKeyword("NoData", Isis::toString(nodata())); + pvl += PvlKeyword("BadData", Isis::toString(baddata())); + pvl += PvlKeyword("Total", Isis::toString(count())); return (pvl); } @@ -490,7 +490,7 @@ PvlGroup ProgramAnalyzer::toPvl(const RunTimeStats &stats, const QString &name) const { PvlGroup pvl((name.isEmpty() ? stats.pname.toStdString() : name.toStdString())); - pvl += PvlKeyword("Hits", toString(stats.contime.TotalPixels())); + pvl += PvlKeyword("Hits", Isis::toString(stats.contime.TotalPixels())); pvl += PvlKeyword("ConnectTimeMinimum", DblToStr(stats.contime.Minimum(), 2).toStdString()); pvl += PvlKeyword("ConnectTimeMaximum", DblToStr(stats.contime.Maximum(), 2).toStdString()); pvl += PvlKeyword("ConnectTimeAverage", DblToStr(stats.contime.Average(), 2).toStdString()); diff --git a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp index a95487abf0..c89f6dce48 100644 --- a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp +++ b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp @@ -400,7 +400,7 @@ namespace Isis { PvlKeyword summingMode("SummingMode", sumMode.toStdString()); outputLabel->findGroup("Instrument", Pvl::Traverse).addKeyword(summingMode); - PvlKeyword yeardoy("YearDoy", toString(stime.Year()*1000 + stime.DayOfYear())); + PvlKeyword yeardoy("YearDoy", Isis::toString(stime.Year()*1000 + stime.DayOfYear())); archive.addKeyword(yeardoy); // Set units on optional archived keywords @@ -444,7 +444,7 @@ namespace Isis { int spacecraftCode = -143400; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", Isis::toString(spacecraftCode)); if (filter.compare("PAN", Qt::CaseInsensitive) == 0) { spacecraftCode = -143421; @@ -466,7 +466,7 @@ namespace Isis { } // Add Kernel to BandBin Group - bandBin.addKeyword(PvlKeyword("NaifIkCode", toString(spacecraftCode))); + bandBin.addKeyword(PvlKeyword("NaifIkCode", Isis::toString(spacecraftCode))); } else { std::string msg = "Unrecognized Spacecraft name [" diff --git a/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp b/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp index 0ec6f2ab86..c5c475fd8e 100644 --- a/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp +++ b/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp @@ -250,13 +250,13 @@ namespace Isis { mos += PvlKeyword("StartTime ", firstStartTime.toStdString()); mos += PvlKeyword("StopTime ", stopTime.toStdString()); mos += PvlKeyword("SpacecraftClockStartCount ", startClock.toStdString()); - mos += PvlKeyword("IncidenceAngle ", toString(incidenceAngle), "degrees"); - mos += PvlKeyword("EmissionAngle ", toString(emissionAngle), "degrees"); - mos += PvlKeyword("PhaseAngle ", toString(phaseAngle), "degrees"); - mos += PvlKeyword("LocalTime ", toString(localSolarTime)); - mos += PvlKeyword("SolarLongitude ", toString(solarLongitude), "degrees"); - mos += PvlKeyword("SubSolarAzimuth ", toString(sunAzimuth), "degrees"); - mos += PvlKeyword("NorthAzimuth ", toString(northAzimuth), "degrees"); + mos += PvlKeyword("IncidenceAngle ", Isis::toString(incidenceAngle), "degrees"); + mos += PvlKeyword("EmissionAngle ", Isis::toString(emissionAngle), "degrees"); + mos += PvlKeyword("PhaseAngle ", Isis::toString(phaseAngle), "degrees"); + mos += PvlKeyword("LocalTime ", Isis::toString(localSolarTime)); + mos += PvlKeyword("SolarLongitude ", Isis::toString(solarLongitude), "degrees"); + mos += PvlKeyword("SubSolarAzimuth ", Isis::toString(sunAzimuth), "degrees"); + mos += PvlKeyword("NorthAzimuth ", Isis::toString(northAzimuth), "degrees"); Cube mosCube; mosCube.open(ui.GetCubeName("TO"), "rw"); diff --git a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp index 2aafb2eecd..c12a575cf9 100644 --- a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp +++ b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp @@ -224,10 +224,10 @@ namespace Isis { frameCube.putGroup(archiveGroup); AlphaCube frameletAlphaCube(*frameletCube); - stitchGroup["FilterStartSamples"] += toString(frameletAlphaCube.AlphaSample(0.0)); - stitchGroup["FilterSamples"] += toString(frameletAlphaCube.BetaSamples()); - stitchGroup["FilterStartLines"] += toString(frameletAlphaCube.AlphaLine(0.0)); - stitchGroup["FilterLines"] += toString(frameletAlphaCube.BetaLines()); + stitchGroup["FilterStartSamples"] += Isis::toString(frameletAlphaCube.AlphaSample(0.0)); + stitchGroup["FilterSamples"] += Isis::toString(frameletAlphaCube.BetaSamples()); + stitchGroup["FilterStartLines"] += Isis::toString(frameletAlphaCube.AlphaLine(0.0)); + stitchGroup["FilterLines"] += Isis::toString(frameletAlphaCube.BetaLines()); PvlGroup frameletArchGroup = frameletCube->group("Archive"); stitchGroup["FilterFileNames"] += frameletArchGroup["FileName"]; diff --git a/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp b/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp index e6647715b7..ebb708faf1 100644 --- a/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp +++ b/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp @@ -89,14 +89,14 @@ namespace Isis { PvlKeyword filterWidth = inputLabel->findKeyword("FilterWidths", PvlObject::Traverse); for (int i = 0; i < filterKey.size(); i++) { - g_frameletInfoList.append(FilterInfo(IString::ToInteger(filterIkCodes[i]), + g_frameletInfoList.append(FilterInfo(Isis::toInt(filterIkCodes[i]), QString::fromStdString(filterKey[i]), - IString::ToDouble(filterStartSamples[i]), - IString::ToDouble(filterStartLines[i]), - IString::ToDouble(filterSamples[i]), - IString::ToDouble(filterLines[i]), - IString::ToDouble(filterWavelength[i]), - IString::ToDouble(filterWidth[i]))); + Isis::toDouble(filterStartSamples[i]), + Isis::toDouble(filterStartLines[i]), + Isis::toDouble(filterSamples[i]), + Isis::toDouble(filterLines[i]), + Isis::toDouble(filterWavelength[i]), + Isis::toDouble(filterWidth[i]))); } // Collect the tables and history from the input stitched cube @@ -188,9 +188,9 @@ namespace Isis { bandBin.addKeyword(PvlKeyword("FilterName", g_frameletInfoList[i].m_filterName.toStdString()), PvlObject::Replace); - bandBin.addKeyword(PvlKeyword("Center", toString(g_frameletInfoList[i].m_wavelength))); - bandBin.addKeyword(PvlKeyword("Width", toString(g_frameletInfoList[i].m_width))); - bandBin.addKeyword(PvlKeyword("NaifIkCode", toString(g_frameletInfoList[i].m_frameId))); + bandBin.addKeyword(PvlKeyword("Center", Isis::toString(g_frameletInfoList[i].m_wavelength))); + bandBin.addKeyword(PvlKeyword("Width", Isis::toString(g_frameletInfoList[i].m_width))); + bandBin.addKeyword(PvlKeyword("NaifIkCode", Isis::toString(g_frameletInfoList[i].m_frameId))); // Add the alpha cube AlphaCube frameletArea(cube->sampleCount(), cube->lineCount(), diff --git a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp index cee5062b59..3adb98afdb 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp @@ -69,7 +69,7 @@ namespace Isis { // 0 = 1x1 (No summing) // 1 = 2x2 // 2 = 4x4 - int sumMode = IString::ToInteger(inst["SummingMode"][0]); + int sumMode = Isis::toInt(inst["SummingMode"][0]); int summing = sumMode * 2; // Setup camera detector map @@ -103,7 +103,7 @@ namespace Isis { // Set start time to center of exposure time to ensure // the proper SPICE data is cached. - double p_exposureDur = IString::ToDouble(inst["ExposureDuration"]); + double p_exposureDur = Isis::toDouble(inst["ExposureDuration"]); iTime p_etStart = et + ( p_exposureDur / 2.0); setTime(p_etStart); diff --git a/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp b/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp index 90d847a89c..7db2043745 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp @@ -60,7 +60,7 @@ int main(void) { // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); - double exposureDuration = IString::ToDouble( inst["ExposureDuration"][0] ); + double exposureDuration = Isis::toDouble( inst["ExposureDuration"][0] ); QString stime = QString::fromStdString(inst["StartTime"]); double et; str2et_c(stime.toLatin1().data(), &et); diff --git a/isis/src/viking/apps/vik2isis/main.cpp b/isis/src/viking/apps/vik2isis/main.cpp index 0f70bf384e..2ecfb90a9c 100644 --- a/isis/src/viking/apps/vik2isis/main.cpp +++ b/isis/src/viking/apps/vik2isis/main.cpp @@ -176,9 +176,9 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { filterCenter = 0.590000; filterWidth = 0.150000; } - bandBin += PvlKeyword("FilterId", toString(filterId)); - bandBin += PvlKeyword("Center", toString(filterCenter), "micrometers"); - bandBin += PvlKeyword("Width", toString(filterWidth), "micrometers"); + bandBin += PvlKeyword("FilterId", Isis::toString(filterId)); + bandBin += PvlKeyword("Center", Isis::toString(filterCenter), "micrometers"); + bandBin += PvlKeyword("Width", Isis::toString(filterWidth), "micrometers"); ocube->putGroup(bandBin); // Setup the kernel group @@ -208,7 +208,7 @@ void TranslateVikingLabels(Pvl &pdsLabel, Cube *ocube) { // Set up the nominal reseaus group PvlGroup res("Reseaus"); - Pvl nomRes("$viking" + toString(spn) + "/reseaus/nominal.pvl"); + Pvl nomRes("$viking" + Isis::toString(spn) + "/reseaus/nominal.pvl"); PvlKeyword samps, lines, type, valid; lines = PvlKeyword("Line"); samps = PvlKeyword("Sample"); diff --git a/isis/src/viking/apps/vikcal/main.cpp b/isis/src/viking/apps/vikcal/main.cpp index ffa9430ae4..dbb8d77f35 100644 --- a/isis/src/viking/apps/vikcal/main.cpp +++ b/isis/src/viking/apps/vikcal/main.cpp @@ -71,24 +71,24 @@ void IsisMain() { calgrp.addComment("DI(l,s) = (1.0/(exp*w1))*G(l,s)*(gain*DR(l,s)+DC(l,s)+offt+offc)"); calgrp.addComment("with w1 = w0*((dist0*dist0) / (dist1*dist1))"); calgrp.addComment("and offt(l,s) = A*l + B*l*l + C*s + D*l*s + E"); - calgrp += PvlKeyword("offc", toString(calParam->Offset())); - calgrp += PvlKeyword("exp", toString(calParam->Exposure())); - calgrp += PvlKeyword("gain", toString(calParam->Gain())); + calgrp += PvlKeyword("offc", Isis::toString(calParam->Offset())); + calgrp += PvlKeyword("exp", Isis::toString(calParam->Exposure())); + calgrp += PvlKeyword("gain", Isis::toString(calParam->Gain())); calgrp += PvlKeyword("DR", in.toStdString()); calgrp += PvlKeyword("DC", calParam->OffsetFile().toStdString()); calgrp += PvlKeyword("G", calParam->GainFile().toStdString()); - calgrp += PvlKeyword("w0", toString(calParam->Omega0())); - calgrp += PvlKeyword("w1", toString(calParam->Omega1())); - calgrp += PvlKeyword("dist0", toString(calParam->Distance())); - calgrp += PvlKeyword("dist1", toString(calParam->Dist1())); - calgrp += PvlKeyword("1.0/exp*w1", toString(1.0 / (calParam->Exposure() * calParam->Omega1()))); - - calgrp += PvlKeyword("Acoeff", toString(calParam->Acoeff())); - calgrp += PvlKeyword("Bcoeff", toString(calParam->Bcoeff())); - calgrp += PvlKeyword("Ccoeff", toString(calParam->Ccoeff())); - calgrp += PvlKeyword("Dcoeff", toString(calParam->Dcoeff())); - calgrp += PvlKeyword("Ecoeff", toString(calParam->Ecoeff())); + calgrp += PvlKeyword("w0", Isis::toString(calParam->Omega0())); + calgrp += PvlKeyword("w1", Isis::toString(calParam->Omega1())); + calgrp += PvlKeyword("dist0", Isis::toString(calParam->Distance())); + calgrp += PvlKeyword("dist1", Isis::toString(calParam->Dist1())); + calgrp += PvlKeyword("1.0/exp*w1", Isis::toString(1.0 / (calParam->Exposure() * calParam->Omega1()))); + + calgrp += PvlKeyword("Acoeff", Isis::toString(calParam->Acoeff())); + calgrp += PvlKeyword("Bcoeff", Isis::toString(calParam->Bcoeff())); + calgrp += PvlKeyword("Ccoeff", Isis::toString(calParam->Ccoeff())); + calgrp += PvlKeyword("Dcoeff", Isis::toString(calParam->Dcoeff())); + calgrp += PvlKeyword("Ecoeff", Isis::toString(calParam->Ecoeff())); ocube->putGroup(calgrp); diff --git a/isis/src/viking/apps/vikcal/vikcal.cpp b/isis/src/viking/apps/vikcal/vikcal.cpp index b6d942d9ce..c388efe3c5 100644 --- a/isis/src/viking/apps/vikcal/vikcal.cpp +++ b/isis/src/viking/apps/vikcal/vikcal.cpp @@ -77,24 +77,24 @@ namespace Isis { calgrp.addComment("DI(l,s) = (1.0/(exp*w1))*G(l,s)*(gain*DR(l,s)+DC(l,s)+offt+offc)"); calgrp.addComment("with w1 = w0*((dist0*dist0) / (dist1*dist1))"); calgrp.addComment("and offt(l,s) = A*l + B*l*l + C*s + D*l*s + E"); - calgrp += PvlKeyword("offc", toString(calParam->Offset())); - calgrp += PvlKeyword("exp", toString(calParam->Exposure())); - calgrp += PvlKeyword("gain", toString(calParam->Gain())); + calgrp += PvlKeyword("offc", Isis::toString(calParam->Offset())); + calgrp += PvlKeyword("exp", Isis::toString(calParam->Exposure())); + calgrp += PvlKeyword("gain", Isis::toString(calParam->Gain())); calgrp += PvlKeyword("DR", in.toStdString()); calgrp += PvlKeyword("DC", calParam->OffsetFile().toStdString()); calgrp += PvlKeyword("G", calParam->GainFile().toStdString()); - calgrp += PvlKeyword("w0", toString(calParam->Omega0())); - calgrp += PvlKeyword("w1", toString(calParam->Omega1())); - calgrp += PvlKeyword("dist0", toString(calParam->Distance())); - calgrp += PvlKeyword("dist1", toString(calParam->Dist1())); - calgrp += PvlKeyword("1.0/exp*w1", toString(1.0 / (calParam->Exposure() * calParam->Omega1()))); - - calgrp += PvlKeyword("Acoeff", toString(calParam->Acoeff())); - calgrp += PvlKeyword("Bcoeff", toString(calParam->Bcoeff())); - calgrp += PvlKeyword("Ccoeff", toString(calParam->Ccoeff())); - calgrp += PvlKeyword("Dcoeff", toString(calParam->Dcoeff())); - calgrp += PvlKeyword("Ecoeff", toString(calParam->Ecoeff())); + calgrp += PvlKeyword("w0", Isis::toString(calParam->Omega0())); + calgrp += PvlKeyword("w1", Isis::toString(calParam->Omega1())); + calgrp += PvlKeyword("dist0", Isis::toString(calParam->Distance())); + calgrp += PvlKeyword("dist1", Isis::toString(calParam->Dist1())); + calgrp += PvlKeyword("1.0/exp*w1", Isis::toString(1.0 / (calParam->Exposure() * calParam->Omega1()))); + + calgrp += PvlKeyword("Acoeff", Isis::toString(calParam->Acoeff())); + calgrp += PvlKeyword("Bcoeff", Isis::toString(calParam->Bcoeff())); + calgrp += PvlKeyword("Ccoeff", Isis::toString(calParam->Ccoeff())); + calgrp += PvlKeyword("Dcoeff", Isis::toString(calParam->Dcoeff())); + calgrp += PvlKeyword("Ecoeff", Isis::toString(calParam->Ecoeff())); ocube->putGroup(calgrp); diff --git a/isis/src/voyager/apps/voy2isis/main.cpp b/isis/src/voyager/apps/voy2isis/main.cpp index 251fdb24fe..f2f3d63d25 100644 --- a/isis/src/voyager/apps/voy2isis/main.cpp +++ b/isis/src/voyager/apps/voy2isis/main.cpp @@ -234,12 +234,12 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { spacecraftNumber = "1"; if(instId == "NARROW_ANGLE_CAMERA") { spacecraftCode = -31101; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", Isis::toString(spacecraftCode)); instId = "issna"; } else if (instId == "WIDE_ANGLE_CAMERA") { spacecraftCode = -31102; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", Isis::toString(spacecraftCode)); instId = "isswa"; } else { @@ -254,12 +254,12 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { spacecraftNumber = "2"; if(instId == "NARROW_ANGLE_CAMERA") { spacecraftCode = -32101; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", Isis::toString(spacecraftCode)); instId = "issna"; } else if (instId == "WIDE_ANGLE_CAMERA") { spacecraftCode = -32102; - kern += PvlKeyword("NaifFrameCode", toString(spacecraftCode)); + kern += PvlKeyword("NaifFrameCode", Isis::toString(spacecraftCode)); instId = "isswa"; } else { diff --git a/isis/src/voyager/apps/voycal/main.cpp b/isis/src/voyager/apps/voycal/main.cpp index fa6da8911d..adbb3c16a8 100644 --- a/isis/src/voyager/apps/voycal/main.cpp +++ b/isis/src/voyager/apps/voycal/main.cpp @@ -199,11 +199,11 @@ void IsisMain() { calgrp.addKeyword(calib[4]); calgrp.addKeyword(calib[5]); calgrp.addKeyword(calib[6]); - calgrp.addKeyword(PvlKeyword("CalcSunDistance",toString(dist1))); + calgrp.addKeyword(PvlKeyword("CalcSunDistance",Isis::toString(dist1))); calgrp.addKeyword(instrument["ExposureDuration"]); - calgrp.addKeyword(PvlKeyword("XMLT",toString(XMLT))); - calgrp.addKeyword(PvlKeyword("Omega_W1",toString(w1))); - calgrp.addKeyword(PvlKeyword("CalcExpoDuration",toString(newExpo))); + calgrp.addKeyword(PvlKeyword("XMLT",Isis::toString(XMLT))); + calgrp.addKeyword(PvlKeyword("Omega_W1",Isis::toString(w1))); + calgrp.addKeyword(PvlKeyword("CalcExpoDuration",Isis::toString(newExpo))); // Linear correction equation and constants if (linear) { @@ -215,10 +215,10 @@ void IsisMain() { linearity.addComment("XNORM = NormalizingPower"); linearity.addComment("KPOWER = K_PowerOfNon-Linearity"); calgrp.addKeyword(linearity); - calgrp.addKeyword(PvlKeyword("ACoefficient",toString(aCoef))); - calgrp.addKeyword(PvlKeyword("B_HighEndNon-LinearityCorrection",toString(bHighEnd))); - calgrp.addKeyword(PvlKeyword("K_PowerOfNon-Linearity",toString(kPowerOf))); - calgrp.addKeyword(PvlKeyword("NormalizingPower",toString(normalizingPower))); + calgrp.addKeyword(PvlKeyword("ACoefficient",Isis::toString(aCoef))); + calgrp.addKeyword(PvlKeyword("B_HighEndNon-LinearityCorrection",Isis::toString(bHighEnd))); + calgrp.addKeyword(PvlKeyword("K_PowerOfNon-Linearity",Isis::toString(kPowerOf))); + calgrp.addKeyword(PvlKeyword("NormalizingPower",Isis::toString(normalizingPower))); } else { calgrp.addKeyword(PvlKeyword("LinearityCorrection","False")); diff --git a/isis/src/voyager/apps/voyramp/main.cpp b/isis/src/voyager/apps/voyramp/main.cpp index 434f2274e5..489d6e99b9 100644 --- a/isis/src/voyager/apps/voyramp/main.cpp +++ b/isis/src/voyager/apps/voyramp/main.cpp @@ -155,10 +155,10 @@ void IsisMain() { plasmaC = detb3/deta; // Create data to go in Radiometry group - PvlKeyword top = PvlKeyword("TopCorrectiveDN", toString(y1)); + PvlKeyword top = PvlKeyword("TopCorrectiveDN", Isis::toString(y1)); top.addComment("Voyramp plasma torus corrective DN values:"); - PvlKeyword mid = PvlKeyword("MiddleCorrectiveDN", toString(y2)); - PvlKeyword bot = PvlKeyword("BottomCorrectiveDN", toString(y3)); + PvlKeyword mid = PvlKeyword("MiddleCorrectiveDN", Isis::toString(y2)); + PvlKeyword bot = PvlKeyword("BottomCorrectiveDN", Isis::toString(y3)); // Add it radio += top; diff --git a/isis/tests/CameraFixtures.cpp b/isis/tests/CameraFixtures.cpp index e89ce2554b..797af2b489 100644 --- a/isis/tests/CameraFixtures.cpp +++ b/isis/tests/CameraFixtures.cpp @@ -219,9 +219,9 @@ namespace Isis { label.addObject(isisCube); PvlGroup &dim = label.findObject("IsisCube").findObject("Core").findGroup("Dimensions"); - dim.findKeyword("Samples").setValue(toString(samples)); - dim.findKeyword("Lines").setValue(toString(lines)); - dim.findKeyword("Bands").setValue(toString(bands)); + dim.findKeyword("Samples").setValue(Isis::toString(samples)); + dim.findKeyword("Lines").setValue(Isis::toString(lines)); + dim.findKeyword("Bands").setValue(Isis::toString(bands)); delete testCube; testCube = new Cube(); @@ -245,9 +245,9 @@ namespace Isis { projLabel.addObject(isisProjCube); PvlGroup &projDim = projLabel.findObject("IsisCube").findObject("Core").findGroup("Dimensions"); - projDim.findKeyword("Samples").setValue(toString(samples)); - projDim.findKeyword("Lines").setValue(toString(lines)); - projDim.findKeyword("Bands").setValue(toString(bands)); + projDim.findKeyword("Samples").setValue(Isis::toString(samples)); + projDim.findKeyword("Lines").setValue(Isis::toString(lines)); + projDim.findKeyword("Bands").setValue(Isis::toString(bands)); delete projTestCube; projTestCube = new Cube(); diff --git a/isis/tests/CubeFixtures.cpp b/isis/tests/CubeFixtures.cpp index 071a454612..0a6f4166cd 100644 --- a/isis/tests/CubeFixtures.cpp +++ b/isis/tests/CubeFixtures.cpp @@ -308,13 +308,13 @@ namespace Isis { } PvlGroup reseausGroup("Reseaus"); - PvlKeyword samples = PvlKeyword("Sample", toString(reseaus[0].first)); - PvlKeyword lines = PvlKeyword("Line", toString(reseaus[0].second)); + PvlKeyword samples = PvlKeyword("Sample", Isis::toString(reseaus[0].first)); + PvlKeyword lines = PvlKeyword("Line", Isis::toString(reseaus[0].second)); PvlKeyword types = PvlKeyword("Type", "5"); PvlKeyword valid = PvlKeyword("Valid", "1"); for (size_t i = 1; i < reseaus.size(); i++) { - samples += toString(reseaus[i].first); - lines += toString(reseaus[i].second); + samples += Isis::toString(reseaus[i].first); + lines += Isis::toString(reseaus[i].second); types += "5"; valid += "1"; } diff --git a/isis/tests/FunctionalTestsApollofindrx.cpp b/isis/tests/FunctionalTestsApollofindrx.cpp index 0067067d07..fc715b9b09 100644 --- a/isis/tests/FunctionalTestsApollofindrx.cpp +++ b/isis/tests/FunctionalTestsApollofindrx.cpp @@ -69,19 +69,19 @@ TEST_F(LargeCube, FunctionalTestApollofindrxDefault) { PvlGroup newReseaus = newLab.findObject("IsisCube").findGroup("Reseaus"); PvlKeyword testKeyword = newReseaus.findKeyword("Line"); - EXPECT_NEAR(IString::ToDouble(testKeyword[0]), 100.8141, 0.0001); - EXPECT_NEAR(IString::ToDouble(testKeyword[1]), 192.8, 0.0001); - EXPECT_NEAR(IString::ToDouble(testKeyword[2]), 275.8, 0.0001); + EXPECT_NEAR(Isis::toDouble(testKeyword[0]), 100.8141, 0.0001); + EXPECT_NEAR(Isis::toDouble(testKeyword[1]), 192.8, 0.0001); + EXPECT_NEAR(Isis::toDouble(testKeyword[2]), 275.8, 0.0001); testKeyword = newReseaus.findKeyword("Sample"); - EXPECT_NEAR(IString::ToDouble(testKeyword[0]), 100.8141, 0.0001); - EXPECT_NEAR(IString::ToDouble(testKeyword[1]), 192.8, 0.0001); - EXPECT_NEAR(IString::ToDouble(testKeyword[2]), 167.8, 0.0001); + EXPECT_NEAR(Isis::toDouble(testKeyword[0]), 100.8141, 0.0001); + EXPECT_NEAR(Isis::toDouble(testKeyword[1]), 192.8, 0.0001); + EXPECT_NEAR(Isis::toDouble(testKeyword[2]), 167.8, 0.0001); testKeyword = newReseaus.findKeyword("Valid"); - EXPECT_EQ(IString::ToInteger(testKeyword[0]), 1); - EXPECT_EQ(IString::ToInteger(testKeyword[1]), 1); - EXPECT_EQ(IString::ToInteger(testKeyword[2]), 1); + EXPECT_EQ(Isis::toInt(testKeyword[0]), 1); + EXPECT_EQ(Isis::toInt(testKeyword[1]), 1); + EXPECT_EQ(Isis::toInt(testKeyword[2]), 1); EXPECT_PRED_FORMAT2(AssertStringsEqual, newReseaus.findKeyword("Status"), "Refined"); diff --git a/isis/tests/FunctionalTestsApolloremrx.cpp b/isis/tests/FunctionalTestsApolloremrx.cpp index c2cb8d53ff..04eaef7a64 100644 --- a/isis/tests/FunctionalTestsApolloremrx.cpp +++ b/isis/tests/FunctionalTestsApolloremrx.cpp @@ -36,19 +36,19 @@ TEST_F(ApolloCube, FunctionalTestApolloremrxDefault) { PvlGroup reseausGroup = isisLabel->findObject("IsisCube").findGroup("Reseaus"); PvlKeyword lineKey = reseausGroup.findKeyword("Line"); - EXPECT_NEAR(IString::ToDouble(lineKey[0]), 200, 0.0001); - EXPECT_NEAR(IString::ToDouble(lineKey[1]), 400, 0.0001); - EXPECT_NEAR(IString::ToDouble(lineKey[2]), 600, 0.0001); + EXPECT_NEAR(Isis::toDouble(lineKey[0]), 200, 0.0001); + EXPECT_NEAR(Isis::toDouble(lineKey[1]), 400, 0.0001); + EXPECT_NEAR(Isis::toDouble(lineKey[2]), 600, 0.0001); PvlKeyword sampleKey = reseausGroup.findKeyword("Sample"); - EXPECT_NEAR(IString::ToDouble(sampleKey[0]), 200, 0.0001); - EXPECT_NEAR(IString::ToDouble(sampleKey[1]), 400, 0.0001); - EXPECT_NEAR(IString::ToDouble(sampleKey[2]), 600, 0.0001); + EXPECT_NEAR(Isis::toDouble(sampleKey[0]), 200, 0.0001); + EXPECT_NEAR(Isis::toDouble(sampleKey[1]), 400, 0.0001); + EXPECT_NEAR(Isis::toDouble(sampleKey[2]), 600, 0.0001); PvlKeyword validKey = reseausGroup.findKeyword("Valid"); - EXPECT_EQ(IString::ToInteger(validKey[0]), 1); - EXPECT_EQ(IString::ToInteger(validKey[1]), 1); - EXPECT_EQ(IString::ToInteger(validKey[2]), 1); + EXPECT_EQ(Isis::toInt(validKey[0]), 1); + EXPECT_EQ(Isis::toInt(validKey[1]), 1); + EXPECT_EQ(Isis::toInt(validKey[2]), 1); EXPECT_PRED_FORMAT2(AssertStringsEqual, reseausGroup.findKeyword("Status"), "Removed"); diff --git a/isis/tests/FunctionalTestsCaminfo.cpp b/isis/tests/FunctionalTestsCaminfo.cpp index 4b6a6828a8..0197ef71f1 100644 --- a/isis/tests/FunctionalTestsCaminfo.cpp +++ b/isis/tests/FunctionalTestsCaminfo.cpp @@ -200,7 +200,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoDefault) { record[entry] = group.name(); entry++; for (int j = 0; j < group.keywords(); j++) { - record[entry] = IString::ToDouble(group[j][0]); + record[entry] = Isis::toDouble(group[j][0]); entry++; } table += record; @@ -469,7 +469,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoCamStatsTable) { record[entry] = group.name(); entry++; for (int j = 0; j < group.keywords(); j++) { - record[entry] = IString::ToDouble(group[j][0]); + record[entry] = Isis::toDouble(group[j][0]); entry++; } table += record; diff --git a/isis/tests/FunctionalTestsCampt.cpp b/isis/tests/FunctionalTestsCampt.cpp index e729f557a9..a999ae111a 100644 --- a/isis/tests/FunctionalTestsCampt.cpp +++ b/isis/tests/FunctionalTestsCampt.cpp @@ -88,9 +88,9 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_NEAR( (double) groundPoint.findKeyword("PositiveWest360Longitude"), 104.10707141824, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("PositiveWest180Longitude"), 104.10707141824, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("BodyFixedCoordinate")[0]), -818.59644749774, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("BodyFixedCoordinate")[1]), -3257.2675597135, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("BodyFixedCoordinate")[2]), 603.17640797124, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("BodyFixedCoordinate")[0]), -818.59644749774, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("BodyFixedCoordinate")[1]), -3257.2675597135, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("BodyFixedCoordinate")[2]), 603.17640797124, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("LocalRadius"), 3412288.6569795, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SampleResolution"), 18.904248467739, 1e-8); @@ -100,9 +100,9 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_NEAR( (double) groundPoint.findKeyword("ObliqueLineResolution"), 19.589652452595999, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("ObliqueSampleResolution"), 19.589652452595999, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("SpacecraftPosition")[0]), -1152.8979327717, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("SpacecraftPosition")[1]), -3930.9421518203, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("SpacecraftPosition")[2]), 728.14118380775, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("SpacecraftPosition")[0]), -1152.8979327717, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("SpacecraftPosition")[1]), -3930.9421518203, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("SpacecraftPosition")[2]), 728.14118380775, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SpacecraftAzimuth"), 240.08514246657, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SlantDistance"), 762.37204454685, 1e-8); @@ -113,9 +113,9 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_NEAR( (double) groundPoint.findKeyword("OffNadirAngle"), 9.9273765143684, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SubSpacecraftGroundAzimuth"), 267.5318718687, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("SunPosition")[0]), 147591102.63158, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("SunPosition")[1]), -127854342.1274, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("SunPosition")[2]), -81844199.02275, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("SunPosition")[0]), 147591102.63158, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("SunPosition")[1]), -127854342.1274, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("SunPosition")[2]), -81844199.02275, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SubSolarAzimuth"), 92.033828156965, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SolarDistance"), 1.4153000672557, 1e-8); @@ -133,17 +133,17 @@ TEST_F(DefaultCube, FunctionalTestCamptDefaultParameters) { EXPECT_NEAR( (double) groundPoint.findKeyword("LocalSolarTime"), 7.7862975330952, 1e-8); EXPECT_NEAR( (double) groundPoint.findKeyword("SolarLongitude"), 294.73518830594998, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[0]), 0.43850176257802, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[1]), 0.88365594846443, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[2]), -0.16391573737569, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[0]), 0.43850176257802, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[1]), 0.88365594846443, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionBodyFixed")[2]), -0.16391573737569, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionJ2000")[0]), 0.44577814515745, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionJ2000")[1]), -0.52737586689974, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionJ2000")[2]), -0.72329561059897, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionJ2000")[0]), 0.44577814515745, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionJ2000")[1]), -0.52737586689974, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionJ2000")[2]), -0.72329561059897, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionCamera")[0]), -1.27447324380581e-04, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionCamera")[1]), 2.5816511718707e-05, 1e-8); - EXPECT_NEAR(IString::ToDouble(groundPoint.findKeyword("LookDirectionCamera")[2]), 0.99999999154535, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionCamera")[0]), -1.27447324380581e-04, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionCamera")[1]), 2.5816511718707e-05, 1e-8); + EXPECT_NEAR( Isis::toDouble(groundPoint.findKeyword("LookDirectionCamera")[2]), 0.99999999154535, 1e-8); } TEST_F(DefaultCube, FunctionalTestCamptSetSL) { diff --git a/isis/tests/FunctionalTestsChan1m32isis.cpp b/isis/tests/FunctionalTestsChan1m32isis.cpp index 37086b4a57..795cf833e9 100644 --- a/isis/tests/FunctionalTestsChan1m32isis.cpp +++ b/isis/tests/FunctionalTestsChan1m32isis.cpp @@ -75,26 +75,26 @@ TEST(Chan1m32Isis, Chan1m32IsisTestFowardAscending) { ASSERT_EQ(bandbin["FilterNumber"].size(), 256); ASSERT_EQ(bandbin["OriginalBand"].size(), 256); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][0]), 446.02); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][64]), 1084.8); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][128]), 1723.5899999999999); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][255]), 2991.17); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][0]), 446.02); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][64]), 1084.8); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][128]), 1723.5899999999999); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][255]), 2991.17); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][0]), 12.31); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][64]), 12.29); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][128]), 12.61); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][255]), 12.18); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][0]), 12.31); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][64]), 12.29); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][128]), 12.61); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][255]), 12.18); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["FilterNumber"][0]), 5); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["FilterNumber"][64]), 69); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["FilterNumber"][128]), 133); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["FilterNumber"][255]), 260); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["FilterNumber"][0]), 5); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["FilterNumber"][64]), 69); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["FilterNumber"][128]), 133); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["FilterNumber"][255]), 260); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][0]), 1); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][64]), 65); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][128]), 129); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][255]), 256); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][0]), 1); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][64]), 65); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][128]), 129); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][255]), 256); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -359,20 +359,20 @@ TEST(Chan1m32Isis, Chan1m32IsisTestL0) { ASSERT_EQ(bandbin["FilterNumber"].size(), 85); ASSERT_EQ(bandbin["OriginalBand"].size(), 85); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][0]), 460.990); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][21]), 1009.95); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][42]), 1429.15); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][84]), 2976.20); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][0]), 460.990); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][21]), 1009.95); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][42]), 1429.15); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][84]), 2976.20); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["FilterNumber"][0]), 5); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["FilterNumber"][21]), 57); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["FilterNumber"][42]), 99); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["FilterNumber"][84]), 253); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["FilterNumber"][0]), 5); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["FilterNumber"][21]), 57); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["FilterNumber"][42]), 99); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["FilterNumber"][84]), 253); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][0]), 1); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][21]), 22); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][42]), 43); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][84]), 85); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][0]), 1); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][21]), 22); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][42]), 43); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][84]), 85); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsFootprintinit.cpp b/isis/tests/FunctionalTestsFootprintinit.cpp index 0749385e77..4aebc0b575 100644 --- a/isis/tests/FunctionalTestsFootprintinit.cpp +++ b/isis/tests/FunctionalTestsFootprintinit.cpp @@ -142,8 +142,8 @@ TEST_F(DefaultCube, FunctionalTestFootprintinitPrecision) { ASSERT_TRUE(testCube->label()->hasObject("Polygon")); ASSERT_TRUE(log.hasGroup("Results")); - ASSERT_EQ(100, IString::ToInteger(log.findGroup("Results").findKeyword("LINC")[0])); - ASSERT_EQ(100, IString::ToInteger(log.findGroup("Results").findKeyword("SINC")[0])); + ASSERT_EQ(100, Isis::toInt(log.findGroup("Results").findKeyword("LINC")[0])); + ASSERT_EQ(100, Isis::toInt(log.findGroup("Results").findKeyword("SINC")[0])); ImagePolygon poly = testCube->readFootprint(); diff --git a/isis/tests/FunctionalTestsFrameStitch.cpp b/isis/tests/FunctionalTestsFrameStitch.cpp index 7699125724..4bd02ccad1 100644 --- a/isis/tests/FunctionalTestsFrameStitch.cpp +++ b/isis/tests/FunctionalTestsFrameStitch.cpp @@ -163,7 +163,7 @@ TEST_F(PushFramePair, FunctionalTestFramestitchFlip) { ASSERT_TRUE(outCube.hasGroup("Instrument")); ASSERT_TRUE(outCube.group("Instrument").hasKeyword("DataFlipped")); - EXPECT_TRUE(toBool(outCube.group("Instrument")["DataFlipped"])); + EXPECT_TRUE(Isis::toInt(outCube.group("Instrument")["DataFlipped"])); } TEST_F(FlippedPushFramePair, FunctionalTestFramestitchNoFlip) { @@ -213,7 +213,7 @@ TEST_F(FlippedPushFramePair, FunctionalTestFramestitchNoFlip) { ASSERT_TRUE(outCube.hasGroup("Instrument")); ASSERT_TRUE(outCube.group("Instrument").hasKeyword("DataFlipped")); - EXPECT_TRUE(toBool(outCube.group("Instrument")["DataFlipped"])); + EXPECT_TRUE(Isis::toInt(outCube.group("Instrument")["DataFlipped"])); } TEST_F(FlippedPushFramePair, FunctionalTestFramestitchFlip) { @@ -264,7 +264,7 @@ TEST_F(FlippedPushFramePair, FunctionalTestFramestitchFlip) { ASSERT_TRUE(outCube.hasGroup("Instrument")); ASSERT_TRUE(outCube.group("Instrument").hasKeyword("DataFlipped")); - EXPECT_FALSE(toBool(outCube.group("Instrument")["DataFlipped"])); + EXPECT_FALSE(Isis::toInt(outCube.group("Instrument")["DataFlipped"])); } TEST_F(PushFramePair, FunctionalTestFramestitchDifferentObservations) { diff --git a/isis/tests/FunctionalTestsHicubenorm.cpp b/isis/tests/FunctionalTestsHicubenorm.cpp index 1175de0d04..2d90989f53 100644 --- a/isis/tests/FunctionalTestsHicubenorm.cpp +++ b/isis/tests/FunctionalTestsHicubenorm.cpp @@ -130,10 +130,10 @@ TEST_F(MroHiriseCube, FunctionalTestHicubenormNewVersion) { PvlGroup stats("Results"); for(int i = 1; i <= 1204; i++) { stats += PvlKeyword("Band", "1"); - stats += PvlKeyword("RowCol", toString(i)); - stats += PvlKeyword("ValidPixels", toString(1056)); - stats += PvlKeyword("Mean", toString(i)); - stats += PvlKeyword("Median", toString(i/2)); + stats += PvlKeyword("RowCol", Isis::toString(i)); + stats += PvlKeyword("ValidPixels", Isis::toString(1056)); + stats += PvlKeyword("Mean", Isis::toString(i)); + stats += PvlKeyword("Median", Isis::toString(i/2)); // the rest shouldn't matter stats += PvlKeyword("Std", "0.0"); stats += PvlKeyword("Minimum", "0.0"); diff --git a/isis/tests/FunctionalTestsHimos.cpp b/isis/tests/FunctionalTestsHimos.cpp index 739c31f7b2..66d39f45d7 100644 --- a/isis/tests/FunctionalTestsHimos.cpp +++ b/isis/tests/FunctionalTestsHimos.cpp @@ -61,13 +61,13 @@ TEST_F(MroHiriseCube, FunctionalTestHimosDefault) { EXPECT_EQ(mos["StopTime"][0], "2006-09-29T15:16:35.036"); EXPECT_EQ(mos["SpacecraftClockStopCount"][0], "844010213:55196"); - EXPECT_NEAR(IString::ToDouble(mos["IncidenceAngle"][0]), 59.687930340662, 1e-6); - EXPECT_NEAR(IString::ToDouble(mos["EmissionAngle"][0]), 0.091672512439956, 1e-6); - EXPECT_NEAR(IString::ToDouble(mos["PhaseAngle"][0]), 59.597812369363, 1e-6); - EXPECT_NEAR(IString::ToDouble(mos["LocalTime"][0]), 15.486088288555, 1e-6); - EXPECT_NEAR(IString::ToDouble(mos["SolarLongitude"][0]), 113.54746578654, 1e-6); - EXPECT_NEAR(IString::ToDouble(mos["SubSolarAzimuth"][0]), 212.41484032558 , 1e-6); - EXPECT_NEAR(IString::ToDouble(mos["NorthAzimuth"][0]), 270.00024569628, 1e-6); + EXPECT_NEAR(Isis::toDouble(mos["IncidenceAngle"][0]), 59.687930340662, 1e-6); + EXPECT_NEAR(Isis::toDouble(mos["EmissionAngle"][0]), 0.091672512439956, 1e-6); + EXPECT_NEAR(Isis::toDouble(mos["PhaseAngle"][0]), 59.597812369363, 1e-6); + EXPECT_NEAR(Isis::toDouble(mos["LocalTime"][0]), 15.486088288555, 1e-6); + EXPECT_NEAR(Isis::toDouble(mos["SolarLongitude"][0]), 113.54746578654, 1e-6); + EXPECT_NEAR(Isis::toDouble(mos["SubSolarAzimuth"][0]), 212.41484032558 , 1e-6); + EXPECT_NEAR(Isis::toDouble(mos["NorthAzimuth"][0]), 270.00024569628, 1e-6); EXPECT_EQ(mos["cpmmTdiFlag"][5], "128"); EXPECT_EQ(mos["cpmmSummingFlag"][5], "1"); diff --git a/isis/tests/FunctionalTestsIsisImport.cpp b/isis/tests/FunctionalTestsIsisImport.cpp index 4629cafe39..511a593d67 100644 --- a/isis/tests/FunctionalTestsIsisImport.cpp +++ b/isis/tests/FunctionalTestsIsisImport.cpp @@ -66,9 +66,9 @@ End)"; PvlGroup dimensionsGroup = label->findObject("IsisCube").findObject("Core").findGroup("Dimensions"); - EXPECT_EQ(IString::ToInteger(dimensionsGroup["Samples"][0]), 3); - EXPECT_EQ(IString::ToInteger(dimensionsGroup["Lines"][0]), 2); - EXPECT_EQ(IString::ToInteger(dimensionsGroup["Bands"][0]), 1); + EXPECT_EQ(Isis::toInt(dimensionsGroup["Samples"][0]), 3); + EXPECT_EQ(Isis::toInt(dimensionsGroup["Lines"][0]), 2); + EXPECT_EQ(Isis::toInt(dimensionsGroup["Bands"][0]), 1); EXPECT_EQ(cube.sampleCount(), 3); EXPECT_EQ(cube.lineCount(), 2); diff --git a/isis/tests/FunctionalTestsIsisImportLo.cpp b/isis/tests/FunctionalTestsIsisImportLo.cpp index 946277258d..007b7727da 100644 --- a/isis/tests/FunctionalTestsIsisImportLo.cpp +++ b/isis/tests/FunctionalTestsIsisImportLo.cpp @@ -64,25 +64,25 @@ TEST(IsisImportTests, loTestDefault) { ASSERT_EQ(inst["FiducialID"][14], "144b"); ASSERT_EQ(inst["FiducialID"][29], "283b"); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialSamples"][0]), 32162.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialSamples"][6]), 24295.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialSamples"][14]), 16593.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialSamples"][29]), 1248.0); - - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialLines"][0]), 8510.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialLines"][6]), 8504.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialLines"][14]), 584.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialLines"][29]), 8496.0); - - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialXCoordinates"][0]), -108.168); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialXCoordinates"][6]), -53.474); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialXCoordinates"][14]), 0.122); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialXCoordinates"][29]), 106.844); - - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialYCoordinates"][0]), 27.476); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialYCoordinates"][6]), 27.5); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialYCoordinates"][14]), -27.493); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialYCoordinates"][29]), 27.479); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialSamples"][0]), 32162.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialSamples"][6]), 24295.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialSamples"][14]), 16593.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialSamples"][29]), 1248.0); + + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialLines"][0]), 8510.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialLines"][6]), 8504.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialLines"][14]), 584.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialLines"][29]), 8496.0); + + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialXCoordinates"][0]), -108.168); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialXCoordinates"][6]), -53.474); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialXCoordinates"][14]), 0.122); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialXCoordinates"][29]), 106.844); + + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialYCoordinates"][0]), 27.476); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialYCoordinates"][6]), 27.5); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialYCoordinates"][14]), -27.493); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialYCoordinates"][29]), 27.479); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsJitterfit.cpp b/isis/tests/FunctionalTestsJitterfit.cpp index f10ca8752b..0059d2e4dd 100644 --- a/isis/tests/FunctionalTestsJitterfit.cpp +++ b/isis/tests/FunctionalTestsJitterfit.cpp @@ -72,12 +72,12 @@ TEST_F(TempTestingFiles, DISABLED_FunctionalTestJitterfitDefault){ Pvl *isisLabel = cube.label(); PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); - EXPECT_DOUBLE_EQ(IString::ToDouble(inst["JitterSampleCoefficients"][0]), -6.3185740156776303e-09); - EXPECT_DOUBLE_EQ(IString::ToDouble(inst["JitterSampleCoefficients"][1]), 2.44034713747508e-06); - EXPECT_DOUBLE_EQ(IString::ToDouble(inst["JitterSampleCoefficients"][2]), 0.0032581267520383002); - EXPECT_DOUBLE_EQ(IString::ToDouble(inst["JitterLineCoefficients"][0]), -2.7623177125388001e-09); - EXPECT_DOUBLE_EQ(IString::ToDouble(inst["JitterLineCoefficients"][1]), 3.3727910440682698e-06); - EXPECT_DOUBLE_EQ(IString::ToDouble(inst["JitterLineCoefficients"][2]), 0.0013484324974775001); + EXPECT_DOUBLE_EQ(Isis::toDouble(inst["JitterSampleCoefficients"][0]), -6.3185740156776303e-09); + EXPECT_DOUBLE_EQ(Isis::toDouble(inst["JitterSampleCoefficients"][1]), 2.44034713747508e-06); + EXPECT_DOUBLE_EQ(Isis::toDouble(inst["JitterSampleCoefficients"][2]), 0.0032581267520383002); + EXPECT_DOUBLE_EQ(Isis::toDouble(inst["JitterLineCoefficients"][0]), -2.7623177125388001e-09); + EXPECT_DOUBLE_EQ(Isis::toDouble(inst["JitterLineCoefficients"][1]), 3.3727910440682698e-06); + EXPECT_DOUBLE_EQ(Isis::toDouble(inst["JitterLineCoefficients"][2]), 0.0013484324974775001); // Test residuals CSVReader::CSVAxis residLine; diff --git a/isis/tests/FunctionalTestsLeisa2isis.cpp b/isis/tests/FunctionalTestsLeisa2isis.cpp index 58f8528fc2..ad49286f2d 100644 --- a/isis/tests/FunctionalTestsLeisa2isis.cpp +++ b/isis/tests/FunctionalTestsLeisa2isis.cpp @@ -68,20 +68,20 @@ TEST(Leisa2Isis, Leisa2IsisTestDefault) { ASSERT_EQ(bandbin["Width"].size(), 256); ASSERT_EQ(bandbin["OriginalBand"].size(), 256); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][0]), 2.4892); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][64]), 1.9784); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][128]), 1.572); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][255]), 2.0898); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][0]), 2.4892); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][64]), 1.9784); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][128]), 1.572); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][255]), 2.0898); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][0]), 0.011228); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][64]), 0.008924); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][128]), 0.007091); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][255]), 0.004915); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][0]), 0.011228); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][64]), 0.008924); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][128]), 0.007091); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][255]), 0.004915); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][0]), 1); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][64]), 65); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][128]), 129); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][255]), 256); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][0]), 1); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][64]), 65); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][128]), 129); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][255]), 256); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -304,20 +304,20 @@ TEST(Leisa2Isis, Leisa2IsisTestRaw) { ASSERT_EQ(bandbin["Width"].size(), 256); ASSERT_EQ(bandbin["OriginalBand"].size(), 256); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][0]), 2.4892); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][64]), 1.9784); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][128]), 1.572); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][255]), 2.0898); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][0]), 2.4892); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][64]), 1.9784); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][128]), 1.572); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][255]), 2.0898); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][0]), 0.011228); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][64]), 0.008924); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][128]), 0.007091); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][255]), 0.004915); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][0]), 0.011228); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][64]), 0.008924); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][128]), 0.007091); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][255]), 0.004915); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][0]), 1); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][64]), 65); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][128]), 129); - ASSERT_DOUBLE_EQ(IString::ToDouble(bandbin["OriginalBand"][255]), 256); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][0]), 1); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][64]), 65); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][128]), 129); + ASSERT_DOUBLE_EQ(Isis::toDouble(bandbin["OriginalBand"][255]), 256); } diff --git a/isis/tests/FunctionalTestsLo2isis.cpp b/isis/tests/FunctionalTestsLo2isis.cpp index 66dd956f18..b249cc5b49 100644 --- a/isis/tests/FunctionalTestsLo2isis.cpp +++ b/isis/tests/FunctionalTestsLo2isis.cpp @@ -56,25 +56,25 @@ TEST(lo2isisTest, lo2isisTestDefault) { ASSERT_EQ(inst["FiducialID"][14], "144b"); ASSERT_EQ(inst["FiducialID"][29], "283b"); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialSamples"][0]), 32162.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialSamples"][6]), 24295.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialSamples"][14]), 16593.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialSamples"][29]), 1248.0); - - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialLines"][0]), 8510.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialLines"][6]), 8504.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialLines"][14]), 584.0); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialLines"][29]), 8496.0); - - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialXCoordinates"][0]), -108.168); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialXCoordinates"][6]), -53.474); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialXCoordinates"][14]), 0.122); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialXCoordinates"][29]), 106.844); - - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialYCoordinates"][0]), 27.476); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialYCoordinates"][6]), 27.5); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialYCoordinates"][14]), -27.493); - ASSERT_DOUBLE_EQ(IString::ToDouble(inst["FiducialYCoordinates"][29]), 27.479); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialSamples"][0]), 32162.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialSamples"][6]), 24295.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialSamples"][14]), 16593.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialSamples"][29]), 1248.0); + + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialLines"][0]), 8510.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialLines"][6]), 8504.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialLines"][14]), 584.0); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialLines"][29]), 8496.0); + + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialXCoordinates"][0]), -108.168); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialXCoordinates"][6]), -53.474); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialXCoordinates"][14]), 0.122); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialXCoordinates"][29]), 106.844); + + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialYCoordinates"][0]), 27.476); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialYCoordinates"][6]), 27.5); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialYCoordinates"][14]), -27.493); + ASSERT_DOUBLE_EQ(Isis::toDouble(inst["FiducialYCoordinates"][29]), 27.479); // Bandbin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsLorri2isis.cpp b/isis/tests/FunctionalTestsLorri2isis.cpp index c1e7c8dd5c..0e238dda35 100644 --- a/isis/tests/FunctionalTestsLorri2isis.cpp +++ b/isis/tests/FunctionalTestsLorri2isis.cpp @@ -58,8 +58,8 @@ TEST(Lorri2Isis, Lorri2IsisTestDefault) { // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][0]), 600); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][0]), 500); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][0]), 600); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][0]), 500); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); @@ -123,8 +123,8 @@ TEST(Lorri2Isis, Lorri2IsisTestRaw) { // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin["Center"][0]), 600); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin["Width"][0]), 500); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin["Center"][0]), 600); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin["Width"][0]), 500); // Kernels Group PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsLrowac2isis.cpp b/isis/tests/FunctionalTestsLrowac2isis.cpp index 00114382ed..89be6431ee 100644 --- a/isis/tests/FunctionalTestsLrowac2isis.cpp +++ b/isis/tests/FunctionalTestsLrowac2isis.cpp @@ -52,12 +52,12 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisDefault) { EXPECT_EQ(uvEvenInst["StartTime"][0], "2009-09-15T07:27:49.230000"); EXPECT_EQ(uvEvenInst["StopTime"][0], "2009-09-15T07:30:19.542000"); EXPECT_EQ(uvEvenInst["MissionPhaseName"][0], "COMMISSIONING"); - EXPECT_EQ(IString::ToDouble(uvEvenInst["BeginTemperatureFpa"][0]), -1.66529297828674); - EXPECT_EQ(IString::ToDouble(uvEvenInst["MiddleTemperatureFpa"][0]), -1.12489998340607); - EXPECT_EQ(IString::ToDouble(uvEvenInst["EndTemperatureFpa"][0]), -0.669131994247437); - EXPECT_EQ(IString::ToDouble(uvEvenInst["BeginTemperatureScs"][0]), 10.8307619094849); - EXPECT_EQ(IString::ToDouble(uvEvenInst["MiddleTemperatureScs"][0]), 10.914568901062); - EXPECT_EQ(IString::ToDouble(uvEvenInst["EndTemperatureScs"][0]), 10.9736194610596); + EXPECT_EQ(Isis::toDouble(uvEvenInst["BeginTemperatureFpa"][0]), -1.66529297828674); + EXPECT_EQ(Isis::toDouble(uvEvenInst["MiddleTemperatureFpa"][0]), -1.12489998340607); + EXPECT_EQ(Isis::toDouble(uvEvenInst["EndTemperatureFpa"][0]), -0.669131994247437); + EXPECT_EQ(Isis::toDouble(uvEvenInst["BeginTemperatureScs"][0]), 10.8307619094849); + EXPECT_EQ(Isis::toDouble(uvEvenInst["MiddleTemperatureScs"][0]), 10.914568901062); + EXPECT_EQ(Isis::toDouble(uvEvenInst["EndTemperatureScs"][0]), 10.9736194610596); EXPECT_EQ(uvEvenInst["Mode"][0], "0"); EXPECT_EQ(uvEvenInst["DataFlipped"][0], "No"); EXPECT_EQ(uvEvenInst["ColorOffset"][0], "0"); @@ -106,12 +106,12 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisDefault) { EXPECT_EQ(uvOddInst["StartTime"][0], "2009-09-15T07:27:49.230000"); EXPECT_EQ(uvOddInst["StopTime"][0], "2009-09-15T07:30:19.542000"); EXPECT_EQ(uvOddInst["MissionPhaseName"][0], "COMMISSIONING"); - EXPECT_EQ(IString::ToDouble(uvOddInst["BeginTemperatureFpa"][0]), -1.66529297828674); - EXPECT_EQ(IString::ToDouble(uvOddInst["MiddleTemperatureFpa"][0]), -1.12489998340607); - EXPECT_EQ(IString::ToDouble(uvOddInst["EndTemperatureFpa"][0]), -0.669131994247437); - EXPECT_EQ(IString::ToDouble(uvOddInst["BeginTemperatureScs"][0]), 10.8307619094849); - EXPECT_EQ(IString::ToDouble(uvOddInst["MiddleTemperatureScs"][0]), 10.914568901062); - EXPECT_EQ(IString::ToDouble(uvOddInst["EndTemperatureScs"][0]), 10.9736194610596); + EXPECT_EQ(Isis::toDouble(uvOddInst["BeginTemperatureFpa"][0]), -1.66529297828674); + EXPECT_EQ(Isis::toDouble(uvOddInst["MiddleTemperatureFpa"][0]), -1.12489998340607); + EXPECT_EQ(Isis::toDouble(uvOddInst["EndTemperatureFpa"][0]), -0.669131994247437); + EXPECT_EQ(Isis::toDouble(uvOddInst["BeginTemperatureScs"][0]), 10.8307619094849); + EXPECT_EQ(Isis::toDouble(uvOddInst["MiddleTemperatureScs"][0]), 10.914568901062); + EXPECT_EQ(Isis::toDouble(uvOddInst["EndTemperatureScs"][0]), 10.9736194610596); EXPECT_EQ(uvOddInst["Mode"][0], "0"); EXPECT_EQ(uvOddInst["DataFlipped"][0], "No"); EXPECT_EQ(uvOddInst["ColorOffset"][0], "0"); @@ -160,12 +160,12 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisDefault) { EXPECT_EQ(visEvenInst["StartTime"][0], "2009-09-15T07:27:49.230000"); EXPECT_EQ(visEvenInst["StopTime"][0], "2009-09-15T07:30:19.542000"); EXPECT_EQ(visEvenInst["MissionPhaseName"][0], "COMMISSIONING"); - EXPECT_EQ(IString::ToDouble(visEvenInst["BeginTemperatureFpa"][0]), -1.66529297828674); - EXPECT_EQ(IString::ToDouble(visEvenInst["MiddleTemperatureFpa"][0]), -1.12489998340607); - EXPECT_EQ(IString::ToDouble(visEvenInst["EndTemperatureFpa"][0]), -0.669131994247437); - EXPECT_EQ(IString::ToDouble(visEvenInst["BeginTemperatureScs"][0]), 10.8307619094849); - EXPECT_EQ(IString::ToDouble(visEvenInst["MiddleTemperatureScs"][0]), 10.914568901062); - EXPECT_EQ(IString::ToDouble(visEvenInst["EndTemperatureScs"][0]), 10.9736194610596); + EXPECT_EQ(Isis::toDouble(visEvenInst["BeginTemperatureFpa"][0]), -1.66529297828674); + EXPECT_EQ(Isis::toDouble(visEvenInst["MiddleTemperatureFpa"][0]), -1.12489998340607); + EXPECT_EQ(Isis::toDouble(visEvenInst["EndTemperatureFpa"][0]), -0.669131994247437); + EXPECT_EQ(Isis::toDouble(visEvenInst["BeginTemperatureScs"][0]), 10.8307619094849); + EXPECT_EQ(Isis::toDouble(visEvenInst["MiddleTemperatureScs"][0]), 10.914568901062); + EXPECT_EQ(Isis::toDouble(visEvenInst["EndTemperatureScs"][0]), 10.9736194610596); EXPECT_EQ(visEvenInst["Mode"][0], "0"); EXPECT_EQ(visEvenInst["DataFlipped"][0], "No"); EXPECT_EQ(visEvenInst["ColorOffset"][0], "0"); @@ -214,12 +214,12 @@ TEST(Lrowac2isisTests, FunctionalTestLrowac2isisDefault) { EXPECT_EQ(visOddInst["StartTime"][0], "2009-09-15T07:27:49.230000"); EXPECT_EQ(visOddInst["StopTime"][0], "2009-09-15T07:30:19.542000"); EXPECT_EQ(visOddInst["MissionPhaseName"][0], "COMMISSIONING"); - EXPECT_EQ(IString::ToDouble(visOddInst["BeginTemperatureFpa"][0]), -1.66529297828674); - EXPECT_EQ(IString::ToDouble(visOddInst["MiddleTemperatureFpa"][0]), -1.12489998340607); - EXPECT_EQ(IString::ToDouble(visOddInst["EndTemperatureFpa"][0]), -0.669131994247437); - EXPECT_EQ(IString::ToDouble(visOddInst["BeginTemperatureScs"][0]), 10.8307619094849); - EXPECT_EQ(IString::ToDouble(visOddInst["MiddleTemperatureScs"][0]), 10.914568901062); - EXPECT_EQ(IString::ToDouble(visOddInst["EndTemperatureScs"][0]), 10.9736194610596); + EXPECT_EQ(Isis::toDouble(visOddInst["BeginTemperatureFpa"][0]), -1.66529297828674); + EXPECT_EQ(Isis::toDouble(visOddInst["MiddleTemperatureFpa"][0]), -1.12489998340607); + EXPECT_EQ(Isis::toDouble(visOddInst["EndTemperatureFpa"][0]), -0.669131994247437); + EXPECT_EQ(Isis::toDouble(visOddInst["BeginTemperatureScs"][0]), 10.8307619094849); + EXPECT_EQ(Isis::toDouble(visOddInst["MiddleTemperatureScs"][0]), 10.914568901062); + EXPECT_EQ(Isis::toDouble(visOddInst["EndTemperatureScs"][0]), 10.9736194610596); EXPECT_EQ(visOddInst["Mode"][0], "0"); EXPECT_EQ(visOddInst["DataFlipped"][0], "No"); EXPECT_EQ(visOddInst["ColorOffset"][0], "0"); diff --git a/isis/tests/FunctionalTestsMimap2isis.cpp b/isis/tests/FunctionalTestsMimap2isis.cpp index ad89ea43f8..ca762b2cb9 100644 --- a/isis/tests/FunctionalTestsMimap2isis.cpp +++ b/isis/tests/FunctionalTestsMimap2isis.cpp @@ -39,8 +39,8 @@ TEST(FunctionalTestMimap2Isis, Default) { PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); EXPECT_PRED_FORMAT2(AssertStringsEqual, pixels.findKeyword("Type"), "SignedWord"); EXPECT_PRED_FORMAT2(AssertStringsEqual, pixels.findKeyword("ByteOrder"), "Lsb"); - EXPECT_DOUBLE_EQ(IString::ToDouble( pixels.findKeyword("Base")), 0.0); - EXPECT_DOUBLE_EQ(IString::ToDouble( pixels.findKeyword("Multiplier")), 2.0e-05); + EXPECT_DOUBLE_EQ(Isis::toDouble( pixels.findKeyword("Base")), 0.0); + EXPECT_DOUBLE_EQ(Isis::toDouble( pixels.findKeyword("Multiplier")), 2.0e-05); // Instrument Group PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); @@ -93,79 +93,79 @@ TEST(FunctionalTestMimap2Isis, Default) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageUnit"), "ND"); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[0]), 32268); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[1]), 32178); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[2]), 32562); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[3]), 31727); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[4]), 32684); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[5]), 32528); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[6]), 32179); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[7]), 32293); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[8]), 32433); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[0]), 32268); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[1]), 32178); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[2]), 32562); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[3]), 31727); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[4]), 32684); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[5]), 32528); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[6]), 32179); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[7]), 32293); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[8]), 32433); for (int i = 0; i < 7; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[i]), 0) << "Error at index: " << i;; - } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[8]), 1); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[0]), 3096.5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[1]), 5582.3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[2]), 5993.3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[3]), 6101.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[4]), 6480.5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[5]), 6425.4); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[6]), 6767.4); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[7]), 8075.3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[8]), 9526.2); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[0]), 1232.1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[1]), 1933.4); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[2]), 2080.3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[3]), 2053.8); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[4]), 2138.1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[5]), 2049.9); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[6]), 2110.4); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[7]), 2367.1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[8]), 2629.7); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[0]), 2980); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[1]), 5635); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[2]), 3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[3]), 6095); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[4]), 6324); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[5]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[6]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[7]), 7965); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[8]), 9305); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[i]), 0) << "Error at index: " << i;; + } + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[8]), 1); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[0]), 3096.5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[1]), 5582.3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[2]), 5993.3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[3]), 6101.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[4]), 6480.5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[5]), 6425.4); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[6]), 6767.4); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[7]), 8075.3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[8]), 9526.2); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[0]), 1232.1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[1]), 1933.4); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[2]), 2080.3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[3]), 2053.8); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[4]), 2138.1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[5]), 2049.9); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[6]), 2110.4); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[7]), 2367.1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[8]), 2629.7); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[0]), 2980); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[1]), 5635); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[2]), 3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[3]), 6095); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[4]), 6324); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[5]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[6]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[7]), 7965); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[8]), 9305); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaMaximum")[i]), 327) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaMaximum")[i]), 327) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[0]), 2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[1]), 2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[2]), 2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[3]), 2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[4]), 1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[5]), 3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[6]), 2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[7]), 1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[8]), 1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[0]), 2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[1]), 2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[2]), 2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[3]), 2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[4]), 1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[5]), 3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[6]), 2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[7]), 1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[8]), 1); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[0]), -20000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[1]), -21000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[2]), -22000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[3]), -23000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[0]), -20000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[1]), -21000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[2]), -22000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[3]), -23000); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[0], "(94, 365, 0, 0)"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[1], "(176, 370, 0, 0)"); @@ -177,10 +177,10 @@ TEST(FunctionalTestMimap2Isis, Default) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[7], "(162, 1245, 0, 0)"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[8], "(585, 952, 0, 0)"); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("OutOfImageBoundsValue")), -30000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("OutOfImageBoundsValue")), -30000); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("OutOfImageBoundsPixel")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("OutOfImageBoundsPixel")[i]), 0) << "Error at index: " << i; } EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("StretchedFlag"), "FALSE"); @@ -212,19 +212,19 @@ TEST(FunctionalTestMimap2Isis, Default) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("RadCnvCoef")[i], "(1.470593, 2.204781, 2.244315, 2.734361, 1.885889, 3.04924, 3.312096, 4.788256, 7.969085)") << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[0]), 30.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[1]), 0.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[2]), 30.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[0]), 30.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[1]), 0.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[2]), 30.0); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); @@ -251,48 +251,48 @@ TEST(FunctionalTestMimap2Isis, Default) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("MatchingMosaic"), "N/A"); for (int i = 0; i < 5; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("FtValidMinimum")), -2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RadianceSaturationThreshold")), 425.971); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefSaturationThreshold")), 0.65534); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("FtValidMinimum")), -2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RadianceSaturationThreshold")), 425.971); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefSaturationThreshold")), 0.65534); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); for (int i = 0; i < 5; i++) { - EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + toString(i + 1)) << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + Isis::toString(i + 1)) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + toString(i - 4)) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[0]), 414.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[1]), 749.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[2]), 901.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[3]), 950.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[4]), 1001.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[5]), 1000.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[6]), 1049.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[7]), 1248.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[8]), 1548.0); - - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[0]), 20.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[1]), 12.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[2]), 21.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[3]), 30.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[4]), 42.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[5]), 27.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[6]), 28.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[7]), 33.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[8]), 48.0); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + Isis::toString(i - 4)) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[0]), 414.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[1]), 749.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[2]), 901.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[3]), 950.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[4]), 1001.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[5]), 1000.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[6]), 1049.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[7]), 1248.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[8]), 1548.0); + + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[0]), 20.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[1]), 12.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[2]), 21.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[3]), 30.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[4]), 42.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[5]), 27.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[6]), 28.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[7]), 33.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[8]), 48.0); EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); @@ -351,84 +351,84 @@ TEST(FunctionalTestMimap2Isis, L3C) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageUnit"), "ND"); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble( archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[0]), 20866); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[1]), 31905); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[2]), 32710); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[3]), 32352); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[4]), 32589); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[5]), 32644); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[6]), 32670); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[7]), 32720); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[8]), 32673); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[0]), 6); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[1]), 14); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[2]), 12); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[3]), 18); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[4]), 23); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[5]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[6]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[7]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[8]), 11); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[0]), 5313.7); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[1]), 9108.2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[2]), 9735.2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[3]), 9950.5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[4]), 10454.1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[5]), 9948.5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[6]), 10312.5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[7]), 11676.5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[8]), 13360.7); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[0]), 2756.2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[1]), 4579.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[2]), 5173.3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[3]), 4877.5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[4]), 5046.1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[5]), 5216.4); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[6]), 5294.5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[7]), 5561.1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[8]), 5645.0); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[0]), 4834); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[1]), 8614); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[2]), 8969); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[3]), 9179); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[4]), 9650); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[5]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[6]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[7]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[8]), 13310); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble( archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[0]), 20866); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[1]), 31905); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[2]), 32710); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[3]), 32352); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[4]), 32589); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[5]), 32644); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[6]), 32670); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[7]), 32720); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[8]), 32673); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[0]), 6); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[1]), 14); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[2]), 12); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[3]), 18); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[4]), 23); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[5]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[6]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[7]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[8]), 11); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[0]), 5313.7); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[1]), 9108.2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[2]), 9735.2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[3]), 9950.5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[4]), 10454.1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[5]), 9948.5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[6]), 10312.5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[7]), 11676.5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[8]), 13360.7); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[0]), 2756.2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[1]), 4579.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[2]), 5173.3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[3]), 4877.5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[4]), 5046.1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[5]), 5216.4); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[6]), 5294.5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[7]), 5561.1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[8]), 5645.0); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[0]), 4834); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[1]), 8614); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[2]), 8969); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[3]), 9179); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[4]), 9650); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[5]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[6]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[7]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[8]), 13310); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaMaximum")[i]), 500) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaMaximum")[i]), 500) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[0]), 1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[1]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[2]), 1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[3]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[4]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[5]), 6); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[6]), 5); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[7]), 2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[8]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[0]), 1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[1]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[2]), 1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[3]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[4]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[5]), 6); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[6]), 5); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[7]), 2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[8]), 0); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[0]), -20000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[1]), -21000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[2]), -22000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[3]), -23000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[0]), -20000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[1]), -21000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[2]), -22000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[3]), -23000); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[0], "(100, 0, 0, 7)"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[1], "(2956, 0, 0, 622)"); @@ -440,10 +440,10 @@ TEST(FunctionalTestMimap2Isis, L3C) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[7], "(33821, 135, 0, 112625)"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[8], "(51843, 162, 0, 209314)"); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("OutOfImageBoundsValue")), -30000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("OutOfImageBoundsValue")), -30000); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("OutOfImageBoundsPixel")[i]), 1642126) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("OutOfImageBoundsPixel")[i]), 1642126) << "Error at index: " << i; } EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DarkFileName")[0], "MIN_DRK_01313_01398_L___003.csv"); @@ -456,30 +456,30 @@ TEST(FunctionalTestMimap2Isis, L3C) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[0], "MIN_NLT_PRFLT_N___v01.csv"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[1], "MIV_NLT_PRFLT_N___v01.csv"); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[0]), 1.470593, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[1]), 2.204781, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[2]), 2.244315, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[3]), 2.734361, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[4]), 1.885889, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[5]), 3.04924, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[6]), 3.312096, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[7]), 4.788256, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[8]), 7.969085, .000001); - - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[0]), 30.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[1]), 0.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[2]), 30.0); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[0]), 1.470593, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[1]), 2.204781, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[2]), 2.244315, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[3]), 2.734361, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[4]), 1.885889, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[5]), 3.04924, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[6]), 3.312096, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[7]), 4.788256, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[8]), 7.969085, .000001); + + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[0]), 30.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[1]), 0.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[2]), 30.0); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); @@ -496,48 +496,48 @@ TEST(FunctionalTestMimap2Isis, L3C) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ResamplingMethod"), "Bi-Linear"); for (int i = 0; i < 5; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("FtValidMinimum")), -2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RadianceSaturationThreshold")), 425.971); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefSaturationThreshold")), 0.65534); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("FtValidMinimum")), -2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RadianceSaturationThreshold")), 425.971); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefSaturationThreshold")), 0.65534); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); for (int i = 0; i < 5; i++) { - EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + toString(i + 1)) << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + Isis::toString(i + 1)) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + toString(i - 4)) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[0]), 414.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[1]), 749.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[2]), 901.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[3]), 950.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[4]), 1001.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[5]), 1000.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[6]), 1049.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[7]), 1248.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[8]), 1548.0); - - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[0]), 20.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[1]), 12.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[2]), 21.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[3]), 30.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[4]), 42.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[5]), 27.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[6]), 28.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[7]), 33.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[8]), 48.0); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + Isis::toString(i - 4)) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[0]), 414.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[1]), 749.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[2]), 901.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[3]), 950.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[4]), 1001.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[5]), 1000.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[6]), 1049.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[7]), 1248.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[8]), 1548.0); + + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[0]), 20.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[1]), 12.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[2]), 21.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[3]), 30.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[4]), 42.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[5]), 27.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[6]), 28.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[7]), 33.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[8]), 48.0); EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); } @@ -578,84 +578,84 @@ TEST(FunctionalTestMimap2Isis, MAPv3) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ImageUnit"), "ND"); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[0]), 11914); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[1]), 18693); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[2]), 22004); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[3]), 21392); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[4]), 22057); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[5]), 19521); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[6]), 20790); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[7]), 22610); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMaximumDn")[8]), 27149); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[0]), 2336); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[1]), 4236); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[2]), 4020); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[3]), 4643); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[4]), 4957); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[5]), 5559); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[6]), 5804); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[7]), 6892); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneMinimumDn")[8]), 8121); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[0]), 3739.9); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[1]), 6790.8); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[2]), 7729.2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[3]), 7954.9); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[4]), 8312.9); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[5]), 8080.9); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[6]), 8416.3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[7]), 9692.3); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneAverageDn")[8]), 11512.4); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[0]), 528.9); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[1]), 785.4); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[2]), 860.7); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[3]), 826.7); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[4]), 837.4); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[5]), 798.7); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[6]), 837.1); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[7]), 882.8); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneStdevDn")[8]), 1005.1); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[0]), 3495); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[1]), 6483); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[2]), 7484); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[3]), 7645); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[4]), 8086); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[5]), 7789); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[6]), 8103); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[7]), 9429); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("SceneModeDn")[8]), 11274); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("MinForStatisticalEvaluation")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("MaxForStatisticalEvaluation")[i]), 32767) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[0]), 11914); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[1]), 18693); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[2]), 22004); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[3]), 21392); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[4]), 22057); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[5]), 19521); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[6]), 20790); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[7]), 22610); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMaximumDn")[8]), 27149); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[0]), 2336); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[1]), 4236); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[2]), 4020); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[3]), 4643); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[4]), 4957); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[5]), 5559); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[6]), 5804); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[7]), 6892); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneMinimumDn")[8]), 8121); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[0]), 3739.9); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[1]), 6790.8); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[2]), 7729.2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[3]), 7954.9); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[4]), 8312.9); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[5]), 8080.9); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[6]), 8416.3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[7]), 9692.3); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneAverageDn")[8]), 11512.4); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[0]), 528.9); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[1]), 785.4); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[2]), 860.7); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[3]), 826.7); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[4]), 837.4); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[5]), 798.7); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[6]), 837.1); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[7]), 882.8); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneStdevDn")[8]), 1005.1); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[0]), 3495); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[1]), 6483); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[2]), 7484); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[3]), 7645); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[4]), 8086); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[5]), 7789); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[6]), 8103); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[7]), 9429); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("SceneModeDn")[8]), 11274); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaMaximum")[i]), 500) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaMinimum")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaMaximum")[i]), 500) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[0]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[1]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[2]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[3]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[4]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[5]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[6]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[7]), 0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("ShadowedAreaPercentage")[8]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[0]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[1]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[2]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[3]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[4]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[5]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[6]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[7]), 0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("ShadowedAreaPercentage")[8]), 0); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[0], "SATURATION"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[1], "MINUS"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[2], "DUMMY_DEFECT"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidType")[3], "OTHER"); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[0]), -20000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[1]), -21000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[2]), -22000); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("InvalidValue")[3]), -23000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[0]), -20000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[1]), -21000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[2]), -22000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("InvalidValue")[3]), -23000); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[0], "(0, 0, 0, 0)"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[1], "(0, 0, 0, 0)"); @@ -667,10 +667,10 @@ TEST(FunctionalTestMimap2Isis, MAPv3) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[7], "(0, 0, 0, 0)"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("InvalidPixels")[8], "(0, 0, 0, 0)"); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("OutOfImageBoundsValue")), -30000); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("OutOfImageBoundsValue")), -30000); for (int i = 0; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("OutOfImageBoundsPixel")[i]), 0) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("OutOfImageBoundsPixel")[i]), 0) << "Error at index: " << i; } EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("DarkFileName")[0], "MIV_DRK_04375_04723_S___002.csv"); @@ -683,30 +683,30 @@ TEST(FunctionalTestMimap2Isis, MAPv3) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[0], "MIV_NLT_PRFLT_N___v01.csv"); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("NonlinFileName")[1], "MIN_NLT_PRFLT_N___v01.csv"); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[0]), 1.470593, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[1]), 2.204781, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[2]), 2.244315, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[3]), 2.734361, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[4]), 1.885889, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[5]), 3.04924, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[6]), 3.312096, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[7]), 4.788256, .000001); - EXPECT_NEAR(IString::ToDouble(archive.findKeyword("RadCnvCoef")[8]), 7.969085, .000001); - - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); - - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[0]), 30.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[1]), 0.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("StandardGeometry")[2]), 30.0); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[0]), 1.470593, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[1]), 2.204781, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[2]), 2.244315, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[3]), 2.734361, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[4]), 1.885889, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[5]), 3.04924, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[6]), 3.312096, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[7]), 4.788256, .000001); + EXPECT_NEAR(Isis::toDouble(archive.findKeyword("RadCnvCoef")[8]), 7.969085, .000001); + + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[0]), 0.002353311); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[1]), 0.002450451); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[2]), 0.003549924); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[3]), 0.003886012); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[4]), 0.004316842); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[5]), 0.004316842); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[6]), 0.004893535); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[7]), 0.007400877); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefCnvCoef")[8]), 0.01218292); + + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[0]), 30.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[1]), 0.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("StandardGeometry")[2]), 30.0); EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("PhotoCorrId"), "LISM ORIGINAL"); @@ -723,48 +723,48 @@ TEST(FunctionalTestMimap2Isis, MAPv3) { EXPECT_PRED_FORMAT2(AssertStringsEqual, archive.findKeyword("ResamplingMethod"), "Bi-Linear"); for (int i = 0; i < 5; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 35) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 1023) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("DarkValidMinimum")[i]), -3) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aDeadPixelThreshold")[i]), 200) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("L2aSaturationThreshold")[i]), 4095) << "Error at index: " << i; + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("DarkValidMinimum")[i]), -10) << "Error at index: " << i; } - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("FtValidMinimum")), -2); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RadianceSaturationThreshold")), 425.971); - EXPECT_DOUBLE_EQ(IString::ToDouble(archive.findKeyword("RefSaturationThreshold")), 0.65534); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("FtValidMinimum")), -2); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RadianceSaturationThreshold")), 425.971); + EXPECT_DOUBLE_EQ(Isis::toDouble(archive.findKeyword("RefSaturationThreshold")), 0.65534); // BandBin Group PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); for (int i = 0; i < 5; i++) { - EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + toString(i + 1)) << "Error at index: " << i; + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MV" + Isis::toString(i + 1)) << "Error at index: " << i; } for (int i = 5; i < 9; i++) { - EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + toString(i - 4)) << "Error at index: " << i; - } - - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[0]), 414.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[1]), 749.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[2]), 901.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[3]), 950.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[4]), 1001.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[5]), 1000.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[6]), 1049.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[7]), 1248.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Center")[8]), 1548.0); - - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[0]), 20.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[1]), 12.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[2]), 21.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[3]), 30.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[4]), 42.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[5]), 27.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[6]), 28.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[7]), 33.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandbin.findKeyword("Width")[8]), 48.0); + EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("FilterName")[i], "MN" + Isis::toString(i - 4)) << "Error at index: " << i; + } + + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[0]), 414.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[1]), 749.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[2]), 901.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[3]), 950.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[4]), 1001.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[5]), 1000.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[6]), 1049.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[7]), 1248.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Center")[8]), 1548.0); + + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[0]), 20.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[1]), 12.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[2]), 21.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[3]), 30.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[4]), 42.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[5]), 27.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[6]), 28.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[7]), 33.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandbin.findKeyword("Width")[8]), 48.0); EXPECT_PRED_FORMAT2(AssertStringsEqual, bandbin.findKeyword("BaseBand"), "MV5"); } diff --git a/isis/tests/FunctionalTestsPds2isis.cpp b/isis/tests/FunctionalTestsPds2isis.cpp index 7475986846..0a360e7f01 100644 --- a/isis/tests/FunctionalTestsPds2isis.cpp +++ b/isis/tests/FunctionalTestsPds2isis.cpp @@ -37,8 +37,8 @@ TEST(Pds2Isis, Pds2isisTestDefault) { PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); ASSERT_EQ(pixels["Type"][0], "UnsignedByte"); ASSERT_EQ(pixels["ByteOrder"][0], "Lsb"); - ASSERT_EQ(IString::ToDouble(pixels["Base"]), 0.0); - ASSERT_EQ(IString::ToDouble(pixels["Multiplier"]), 1.0); + ASSERT_EQ(Isis::toDouble(pixels["Base"]), 0.0); + ASSERT_EQ(Isis::toDouble(pixels["Multiplier"]), 1.0); PvlGroup archive = outLabel->findGroup("Archive", Pvl::Traverse); ASSERT_EQ(archive["DataSetId"][0], "MGS-M-MOC-NA/WA-2-DSDP-L0-V1.0"); @@ -83,59 +83,59 @@ TEST(Pds2Isis, Pds2isisTestBandBin) { bool ok = false; PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][0]), 0.7360); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][1]), 0.8750); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][2]), 1.0546); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][3]), 1.3326); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][4]), 1.6110); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][5]), 1.8914); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][6]), 2.1728); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][7]), 2.4529); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][8]), 2.7382); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][9]), 3.0178); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][10]), 3.3012); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][11]), 3.5839); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][12]), 3.8670); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][13]), 4.1503); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][14]), 4.4343); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][15]), 4.7164); - ASSERT_EQ(IString::ToDouble(bandbin["Center"][16]), 4.9988); - - ASSERT_EQ(IString::ToDouble(bandbin["Width"][0]), 0.0125); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][1]), 0.0125); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][2]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][3]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][4]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][5]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][6]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][7]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][8]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][9]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][10]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][11]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][12]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][13]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][14]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][15]), 0.0250); - ASSERT_EQ(IString::ToDouble(bandbin["Width"][16]), 0.0250); - - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][0]), 1); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][1]), 2); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][2]), 3); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][3]), 4); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][4]), 5); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][5]), 6); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][6]), 7); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][7]), 8); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][8]), 9); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][9]), 10); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][10]), 11); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][11]), 12); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][12]), 13); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][13]), 14); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][14]), 15); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][15]), 16); - ASSERT_EQ(IString::ToInteger(bandbin["FilterNumber"][16]), 17); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][0]), 0.7360); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][1]), 0.8750); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][2]), 1.0546); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][3]), 1.3326); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][4]), 1.6110); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][5]), 1.8914); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][6]), 2.1728); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][7]), 2.4529); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][8]), 2.7382); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][9]), 3.0178); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][10]), 3.3012); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][11]), 3.5839); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][12]), 3.8670); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][13]), 4.1503); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][14]), 4.4343); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][15]), 4.7164); + ASSERT_EQ(Isis::toDouble(bandbin["Center"][16]), 4.9988); + + ASSERT_EQ(Isis::toDouble(bandbin["Width"][0]), 0.0125); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][1]), 0.0125); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][2]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][3]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][4]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][5]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][6]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][7]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][8]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][9]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][10]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][11]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][12]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][13]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][14]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][15]), 0.0250); + ASSERT_EQ(Isis::toDouble(bandbin["Width"][16]), 0.0250); + + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][0]), 1); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][1]), 2); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][2]), 3); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][3]), 4); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][4]), 5); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][5]), 6); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][6]), 7); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][7]), 8); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][8]), 9); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][9]), 10); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][10]), 11); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][11]), 12); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][12]), 13); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][13]), 14); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][14]), 15); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][15]), 16); + ASSERT_EQ(Isis::toInt(bandbin["FilterNumber"][16]), 17); std::unique_ptr hist (outCube.histogram(0)); ASSERT_NEAR(hist->Average(), 0.205984, 1e-3); @@ -165,21 +165,21 @@ TEST(Pds2Isis, Pds2isisTestOffset) { PvlGroup mapping = outLabel->findGroup("Mapping", Pvl::Traverse); ASSERT_EQ(mapping["ProjectionName"][0], "SimpleCylindrical"); - ASSERT_EQ(IString::ToDouble(mapping["CenterLongitude"]), 180.0); + ASSERT_EQ(Isis::toDouble(mapping["CenterLongitude"]), 180.0); ASSERT_EQ(mapping["TargetName"][0], "Moon"); - ASSERT_EQ(IString::ToDouble(mapping["EquatorialRadius"]), 1737400.0); - ASSERT_EQ(IString::ToDouble(mapping["PolarRadius"]), 1737400.0); + ASSERT_EQ(Isis::toDouble(mapping["EquatorialRadius"]), 1737400.0); + ASSERT_EQ(Isis::toDouble(mapping["PolarRadius"]), 1737400.0); ASSERT_EQ(mapping["LatitudeType"][0], "Planetocentric"); ASSERT_EQ(mapping["LongitudeDirection"][0], "PositiveEast"); ASSERT_EQ((int)mapping["LongitudeDomain"], 360); - ASSERT_EQ(IString::ToDouble(mapping["MinimumLatitude"]), -90.0); - ASSERT_EQ(IString::ToDouble(mapping["MaximumLatitude"]), 90.0); - ASSERT_EQ(IString::ToDouble(mapping["MinimumLongitude"]), 0.0); - ASSERT_EQ(IString::ToDouble(mapping["MaximumLongitude"]), 360.0); - ASSERT_EQ(IString::ToDouble(mapping["UpperLeftCornerX"]), -5458204.8); - ASSERT_EQ(IString::ToDouble(mapping["UpperLeftCornerY"]), 2729102.4); - ASSERT_EQ(IString::ToDouble(mapping["PixelResolution"]), 7580.84); - ASSERT_EQ(IString::ToDouble(mapping["Scale"]), 4.0); + ASSERT_EQ(Isis::toDouble(mapping["MinimumLatitude"]), -90.0); + ASSERT_EQ(Isis::toDouble(mapping["MaximumLatitude"]), 90.0); + ASSERT_EQ(Isis::toDouble(mapping["MinimumLongitude"]), 0.0); + ASSERT_EQ(Isis::toDouble(mapping["MaximumLongitude"]), 360.0); + ASSERT_EQ(Isis::toDouble(mapping["UpperLeftCornerX"]), -5458204.8); + ASSERT_EQ(Isis::toDouble(mapping["UpperLeftCornerY"]), 2729102.4); + ASSERT_EQ(Isis::toDouble(mapping["PixelResolution"]), 7580.84); + ASSERT_EQ(Isis::toDouble(mapping["Scale"]), 4.0); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 1.7375e+06, 10); @@ -208,21 +208,21 @@ TEST(Pds2Isis, Pds2isisTestProjection) { PvlGroup mapping = outLabel->findGroup("Mapping", Pvl::Traverse); ASSERT_EQ(mapping["ProjectionName"][0], "Sinusoidal"); - ASSERT_EQ(IString::ToDouble(mapping["CenterLongitude"]), 325.3829); + ASSERT_EQ(Isis::toDouble(mapping["CenterLongitude"]), 325.3829); ASSERT_EQ(mapping["TargetName"][0], "Venus"); - ASSERT_EQ(IString::ToDouble(mapping["EquatorialRadius"]), 6051920.0); - ASSERT_EQ(IString::ToDouble(mapping["PolarRadius"]), 6051920.0); + ASSERT_EQ(Isis::toDouble(mapping["EquatorialRadius"]), 6051920.0); + ASSERT_EQ(Isis::toDouble(mapping["PolarRadius"]), 6051920.0); ASSERT_EQ(mapping["LatitudeType"][0], "Planetocentric"); ASSERT_EQ(mapping["LongitudeDirection"][0], "PositiveEast"); ASSERT_EQ((int)mapping["LongitudeDomain"], 360); - ASSERT_EQ(IString::ToDouble(mapping["MinimumLatitude"]), -29.6357); - ASSERT_EQ(IString::ToDouble(mapping["MaximumLatitude"]), -28.9092); - ASSERT_EQ(IString::ToDouble(mapping["MinimumLongitude"]), 322.0367); - ASSERT_EQ(IString::ToDouble(mapping["MaximumLongitude"]), 322.8903); - ASSERT_EQ(IString::ToDouble(mapping["UpperLeftCornerX"]), -307162.5); - ASSERT_EQ(IString::ToDouble(mapping["UpperLeftCornerY"]), -3053025.0); - ASSERT_EQ(IString::ToDouble(mapping["PixelResolution"]), 75.0); - ASSERT_EQ(IString::ToDouble(mapping["Scale"]), 1407.4); + ASSERT_EQ(Isis::toDouble(mapping["MinimumLatitude"]), -29.6357); + ASSERT_EQ(Isis::toDouble(mapping["MaximumLatitude"]), -28.9092); + ASSERT_EQ(Isis::toDouble(mapping["MinimumLongitude"]), 322.0367); + ASSERT_EQ(Isis::toDouble(mapping["MaximumLongitude"]), 322.8903); + ASSERT_EQ(Isis::toDouble(mapping["UpperLeftCornerX"]), -307162.5); + ASSERT_EQ(Isis::toDouble(mapping["UpperLeftCornerY"]), -3053025.0); + ASSERT_EQ(Isis::toDouble(mapping["PixelResolution"]), 75.0); + ASSERT_EQ(Isis::toDouble(mapping["Scale"]), 1407.4); std::unique_ptr hist (outCube.histogram()); ASSERT_NEAR(hist->Average(), 67.7978515625, .00001); diff --git a/isis/tests/FunctionalTestsPhocube.cpp b/isis/tests/FunctionalTestsPhocube.cpp index d3a69d8cf6..8abe2a3415 100644 --- a/isis/tests/FunctionalTestsPhocube.cpp +++ b/isis/tests/FunctionalTestsPhocube.cpp @@ -42,8 +42,8 @@ TEST_F(DefaultCube, FunctionalTestPhocubeDefault) { EXPECT_EQ((int) bandBin.findKeyword("FilterId"), 4); for (int i = 0; i < cube.bandCount(); i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(bandBin.findKeyword("Center")[i]), 1.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandBin.findKeyword("Width")[i]), 1.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandBin.findKeyword("Center")[i]), 1.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandBin.findKeyword("Width")[i]), 1.0); } std::unique_ptr hist (cube.histogram(0)); @@ -493,8 +493,8 @@ TEST(Phocube, FunctionalTestPhocubeSunIlluminationMask) { // verify center and width entries in BandBin group for (int i = 0; i < cube.bandCount(); i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(bandBin.findKeyword("Center")[i]), 650.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandBin.findKeyword("Width")[i]), 1.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandBin.findKeyword("Center")[i]), 650.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandBin.findKeyword("Width")[i]), 1.0); } // verify statistics of SunIlluminationMask band @@ -550,8 +550,8 @@ TEST(Phocube, FunctionalTestPhocubeSurfaceObliqueDetectorResolution) { // verify center and width entries in BandBin group for (int i = 0; i < cube.bandCount(); i++) { - EXPECT_DOUBLE_EQ(IString::ToDouble(bandBin.findKeyword("Center")[i]), 650.0); - EXPECT_DOUBLE_EQ(IString::ToDouble(bandBin.findKeyword("Width")[i]), 1.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandBin.findKeyword("Center")[i]), 650.0); + EXPECT_DOUBLE_EQ(Isis::toDouble(bandBin.findKeyword("Width")[i]), 1.0); } // verify statistics of SurfaceObliqueDetectorResolution band diff --git a/isis/tests/FunctionalTestsSumspice.cpp b/isis/tests/FunctionalTestsSumspice.cpp index 074b40308c..8ba0a8e033 100644 --- a/isis/tests/FunctionalTestsSumspice.cpp +++ b/isis/tests/FunctionalTestsSumspice.cpp @@ -42,8 +42,8 @@ TEST(Sumspice, FunctionalTestSumspiceTimeUpdate) { // SumTimeHistory Group PvlGroup &sumTime = isisLabel->findGroup("SumTimeHistory", Pvl::Traverse); EXPECT_EQ(sumTime["SUMFILE"][0], "N2395699394"); - EXPECT_EQ(IString::ToDouble(sumTime["SpacecraftClockStartCount"][0]), 2395694888); - EXPECT_EQ(IString::ToDouble(sumTime["SpacecraftClockStopCount"][0]), 2395695365); + EXPECT_EQ(Isis::toDouble(sumTime["SpacecraftClockStartCount"][0]), 2395694888); + EXPECT_EQ(Isis::toDouble(sumTime["SpacecraftClockStopCount"][0]), 2395695365); EXPECT_EQ(sumTime["StartTime"][0], "2005-09-21T10:44:07"); EXPECT_EQ(sumTime["StopTime"][0], "2005-09-21T10:44:07"); diff --git a/isis/tests/TestUtilities.cpp b/isis/tests/TestUtilities.cpp index 3f48de1350..2020fec6ce 100644 --- a/isis/tests/TestUtilities.cpp +++ b/isis/tests/TestUtilities.cpp @@ -34,8 +34,8 @@ namespace Isis { if (e.errorType() == errorType) return ::testing::AssertionSuccess(); return ::testing::AssertionFailure() << "IExeption "<< e_expr << "\'s error type (" - << std::to_string(e.errorType()) << ") does not match expected error type (" - << std::to_string(errorType) << ")."; + << Isis::toString(e.errorType()) << ") does not match expected error type (" + << Isis::toString(errorType) << ")."; } @@ -303,8 +303,8 @@ namespace Isis { if (numDiff > tolerance) { differences.push_back( "Values [" + json1.dump() + "] and [" + json2.dump() + "] differ by [" - + std::to_string(numDiff) + "] which is greater than tolerance [" - + std::to_string(tolerance) + "] at [" + jsonPointer + "]"); + + Isis::toString(numDiff) + "] which is greater than tolerance [" + + Isis::toString(tolerance) + "] at [" + jsonPointer + "]"); } break; From db26f69483c6c8d3fa8df33b6604415fe82d9c21 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Thu, 26 Sep 2024 10:25:18 -0600 Subject: [PATCH 89/95] Updated formatting for tests --- gtest | 2 +- isis/src/base/objs/Area3D/Area3D.truth | 6 +- isis/src/base/objs/AutoReg/AutoReg.cpp | 2 +- isis/src/base/objs/Blobber/Blobber.truth | 6 +- .../CameraPointInfo/CameraPointInfo.truth | 4 +- .../base/objs/CubeAttribute/CubeAttribute.cpp | 12 ++-- isis/src/base/objs/GisGeometry/unitTest.cpp | 14 ++-- isis/src/base/objs/Hillshade/Hillshade.truth | 6 +- .../LunarLambertEmpirical.truth | 8 +-- .../MinnaertEmpirical/MinnaertEmpirical.truth | 8 +-- .../base/objs/NaifDskPlateModel/unitTest.cpp | 6 +- isis/src/base/objs/NaifDskShape/unitTest.cpp | 12 ++-- .../SpectralDefinition1D.cpp | 6 +- .../SpectralDefinition1D.truth | 68 +++++++++---------- .../BundleObservationSolveSettings.cpp | 6 +- isis/src/core/include/SpecialPixel.h | 3 + isis/src/core/tests/PvlKeywordTests.cpp | 18 ----- .../BundleObservationSolveSettingsTests.cpp | 6 +- isis/tests/StatisticsTest.cpp | 2 +- 19 files changed, 90 insertions(+), 105 deletions(-) diff --git a/gtest b/gtest index f8d7d77c06..eff443c6ef 160000 --- a/gtest +++ b/gtest @@ -1 +1 @@ -Subproject commit f8d7d77c06936315286eb55f8de22cd23c188571 +Subproject commit eff443c6ef5eb6ab598bfaae27f9427fdb4f6af7 diff --git a/isis/src/base/objs/Area3D/Area3D.truth b/isis/src/base/objs/Area3D/Area3D.truth index a8c198f6e9..c7b5f4e6c5 100644 --- a/isis/src/base/objs/Area3D/Area3D.truth +++ b/isis/src/base/objs/Area3D/Area3D.truth @@ -76,6 +76,6 @@ Area3D 1 = Area3D 2... Area3D 1 = -1.7976931348623e+308,0,-1.7976931348623e+308 ----- Testing Error Checking ----- -**PROGRAMMER ERROR** Cannot have a 3D area with inverted X coordinates of [1 meters] to [0 meters]. -**PROGRAMMER ERROR** Cannot have a 3D area with inverted Y coordinates of [1 meters] to [0 meters]. -**PROGRAMMER ERROR** Cannot have a 3D area with inverted Z coordinates of [1 meters] to [0 meters]. +**PROGRAMMER ERROR** Cannot have a 3D area with inverted X coordinates of [1.0 meters] to [0.0 meters]. +**PROGRAMMER ERROR** Cannot have a 3D area with inverted Y coordinates of [1.0 meters] to [0.0 meters]. +**PROGRAMMER ERROR** Cannot have a 3D area with inverted Z coordinates of [1.0 meters] to [0.0 meters]. diff --git a/isis/src/base/objs/AutoReg/AutoReg.cpp b/isis/src/base/objs/AutoReg/AutoReg.cpp index 481f824581..0976a3a215 100644 --- a/isis/src/base/objs/AutoReg/AutoReg.cpp +++ b/isis/src/base/objs/AutoReg/AutoReg.cpp @@ -201,7 +201,7 @@ namespace Isis { } if(algo.hasKeyword("SubpixelAccuracy")) { - SetSubPixelAccuracy(Isis::toString((int)algo["SubpixelAccuracy"]) == "True"); + SetSubPixelAccuracy(Isis::toBool(algo["SubpixelAccuracy"]) == true); } if(algo.hasKeyword("ReductionFactor")) { diff --git a/isis/src/base/objs/Blobber/Blobber.truth b/isis/src/base/objs/Blobber/Blobber.truth index c9ca1feb4b..156850e720 100644 --- a/isis/src/base/objs/Blobber/Blobber.truth +++ b/isis/src/base/objs/Blobber/Blobber.truth @@ -11,9 +11,9 @@ Number Blob Samples: 16 Total Pixels: 2688 ** Blob Values... -Pixel[0][0] = 1008 -Pixel[84][8] = 1115 -Pixel[167][15] = 1259 +Pixel[0][0] = 1008.0 +Pixel[84][8] = 1115.0 +Pixel[167][15] = 1259.0 ** Test Blobber direct access (via filename)... diff --git a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.truth b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.truth index 0eae5d11c6..834060a49f 100644 --- a/isis/src/base/objs/CameraPointInfo/CameraPointInfo.truth +++ b/isis/src/base/objs/CameraPointInfo/CameraPointInfo.truth @@ -1,7 +1,7 @@ Group = GroundPoint Sample = 1.0 Line = 1.0 - PixelValue = 21 + PixelValue = 21.0 RightAscension = 254.44877411829 Declination = 67.288137235407 PlanetocentricLatitude = -85.539935681585 @@ -64,7 +64,7 @@ End_Group Group = GroundPoint Sample = 155.47884244269 Line = 184.71817081965 - PixelValue = 29 + PixelValue = 29.0 RightAscension = 262.28855950942 Declination = 65.693319737566 PlanetocentricLatitude = -84.5 diff --git a/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp b/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp index 2443a10138..63cf1117a4 100644 --- a/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp +++ b/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp @@ -323,15 +323,15 @@ namespace Isis { void CubeAttributeOutput::setMinimum(double min) { if (!IsSpecial(min)) { - QString newRange = QString::number(min) + ":"; + QString newRange = QString::fromStdString(Isis::toString(min)) + ":"; if (!IsSpecial(maximum())) - newRange += QString::number(maximum()); + newRange += QString::fromStdString(Isis::toString(maximum())); setAttribute(newRange, &CubeAttributeOutput::isRange); } else if (!IsSpecial(maximum())) { - setAttribute(":" + QString::number(maximum()), &CubeAttributeOutput::isRange); + setAttribute(":" + QString::fromStdString(Isis::toString(maximum())), &CubeAttributeOutput::isRange); } else { setAttribute("", &CubeAttributeOutput::isRange); @@ -341,15 +341,15 @@ namespace Isis { void CubeAttributeOutput::setMaximum(double max) { if (!IsSpecial(max)) { - QString newRange = ":" + QString::number(max); + QString newRange = ":" + QString::fromStdString(Isis::toString(max)); if (!IsSpecial(minimum())) - newRange = QString::number(minimum()) + newRange; + newRange = QString::fromStdString(Isis::toString(minimum())) + newRange; setAttribute(newRange, &CubeAttributeOutput::isRange); } else if (!IsSpecial(minimum())) { - setAttribute(QString::number(minimum()) + ":", &CubeAttributeOutput::isRange); + setAttribute(QString::fromStdString(Isis::toString(minimum())) + ":", &CubeAttributeOutput::isRange); } else { setAttribute("", &CubeAttributeOutput::isRange); diff --git a/isis/src/base/objs/GisGeometry/unitTest.cpp b/isis/src/base/objs/GisGeometry/unitTest.cpp index 592f3d4a00..674ed2f1e8 100644 --- a/isis/src/base/objs/GisGeometry/unitTest.cpp +++ b/isis/src/base/objs/GisGeometry/unitTest.cpp @@ -290,13 +290,13 @@ void printBasicInfo(GisGeometry geom, QString description) { */ void printTargetInfo(GisGeometry geom, GisGeometry target, QString description) { qDebug() << description; - qDebug() << " distance? " << QString::number(geom.distance(target)); - qDebug() << " intersects? " << QString::number(geom.intersects(target)); - qDebug() << " contains? " << QString::number(geom.contains(target)); - qDebug() << " disjoint? " << QString::number(geom.disjoint(target)); - qDebug() << " overlaps? " << QString::number(geom.overlaps(target)); - qDebug() << " equals? " << QString::number(geom.equals(target)); - qDebug() << " intersect ratio? " << QString::number(geom.intersectRatio(target)); + qDebug() << " distance? " << QString::fromStdString(Isis::toString(geom.distance(target))); + qDebug() << " intersects? " << QString::fromStdString(Isis::toString(geom.intersects(target))); + qDebug() << " contains? " << QString::fromStdString(Isis::toString(geom.contains(target))); + qDebug() << " disjoint? " << QString::fromStdString(Isis::toString(geom.disjoint(target))); + qDebug() << " overlaps? " << QString::fromStdString(Isis::toString(geom.overlaps(target))); + qDebug() << " equals? " << QString::fromStdString(Isis::toString(geom.equals(target))); + qDebug() << " intersect ratio? " << QString::fromStdString(Isis::toString(geom.intersectRatio(target))); qDebug() << ""; } diff --git a/isis/src/base/objs/Hillshade/Hillshade.truth b/isis/src/base/objs/Hillshade/Hillshade.truth index c401c09191..894f5291e6 100644 --- a/isis/src/base/objs/Hillshade/Hillshade.truth +++ b/isis/src/base/objs/Hillshade/Hillshade.truth @@ -2,9 +2,9 @@ Default constructed: Hillshade[ azimuth = zenith = resolution = Null ] Empty constructed: Hillshade[ azimuth = zenith = resolution = Null ] Copied empty: Hillshade[ azimuth = zenith = resolution = Null ] Assigned empty: Hillshade[ azimuth = zenith = resolution = Null ] -Valid: Hillshade[ azimuth = 0.0 degrees zenith = 15.0 degrees resolution = 5.0 ] -Copied valid: Hillshade[ azimuth = 0.0 degrees zenith = 15.0 degrees resolution = 5.0 ] -Assigned valid: Hillshade[ azimuth = 0.0 degrees zenith = 15.0 degrees resolution = 5.0 ] +Valid: Hillshade[ azimuth = 0.0 degrees zenith = 15.0 degrees resolution = 5 ] +Copied valid: Hillshade[ azimuth = 0.0 degrees zenith = 15.0 degrees resolution = 5 ] +Assigned valid: Hillshade[ azimuth = 0.0 degrees zenith = 15.0 degrees resolution = 5 ] Test computations diff --git a/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.truth b/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.truth index 5bcd731886..bf5411eae8 100644 --- a/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.truth +++ b/isis/src/base/objs/LunarLambertEmpirical/LunarLambertEmpirical.truth @@ -31,10 +31,10 @@ Object = PhotometricModel Name = LunarLambertEmpirical PhaseList = (0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140) - LList = (0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, - 1.2, 1.3, 1.4) - PhaseCurveList = (0, 0.3, 0.6, 0.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7, 3, 3.3, - 3.6, 3.9, 4.2) + LList = (0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, + 1.1, 1.2, 1.3, 1.4) + PhaseCurveList = (0.0, 0.3, 0.6, 0.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7, 3.0, + 3.3, 3.6, 3.9, 4.2) End_Group End_Object End diff --git a/isis/src/base/objs/MinnaertEmpirical/MinnaertEmpirical.truth b/isis/src/base/objs/MinnaertEmpirical/MinnaertEmpirical.truth index 4c235e235e..52411011e2 100644 --- a/isis/src/base/objs/MinnaertEmpirical/MinnaertEmpirical.truth +++ b/isis/src/base/objs/MinnaertEmpirical/MinnaertEmpirical.truth @@ -31,10 +31,10 @@ Object = PhotometricModel Name = MinnaertEmpirical PhaseList = (0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140) - KList = (0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, - 1.2, 1.3, 1.4) - PhaseCurveList = (0, 0.3, 0.6, 0.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7, 3, 3.3, - 3.6, 3.9, 4.2) + KList = (0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, + 1.1, 1.2, 1.3, 1.4) + PhaseCurveList = (0.0, 0.3, 0.6, 0.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7, 3.0, + 3.3, 3.6, 3.9, 4.2) End_Group End_Object End diff --git a/isis/src/base/objs/NaifDskPlateModel/unitTest.cpp b/isis/src/base/objs/NaifDskPlateModel/unitTest.cpp index 2ea12da8cf..7e7688099c 100755 --- a/isis/src/base/objs/NaifDskPlateModel/unitTest.cpp +++ b/isis/src/base/objs/NaifDskPlateModel/unitTest.cpp @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) { Latitude lat(0.0, Angle::Degrees); Longitude lon(0.0, Angle::Degrees); SurfacePoint *sp = naifPlateModelFromDSK.point(lat, lon); - qDebug() << "Surface point at pole is null? " << QString::number(sp == NULL); + qDebug() << "Surface point at pole is null? " << QString::fromStdString(Isis::toString(sp == NULL)); qDebug() << "Surface point: " << sp->GetX().meters() << sp->GetY().meters() << sp->GetZ().meters() @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) { Intercept *intercept = naifPlateModelFromDSK.intercept(obsPos, rayDir); qDebug() << "Ray Dir: " << rayDir; qDebug() << "Observer: " << obsPos; - qDebug() << "Intercept is null? " << QString::number(intercept == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(intercept == NULL)); qDebug() << "intercept plateID? " << naifPlateModelFromDSK.plateIdOfIntercept(obsPos, rayDir, xpoint); @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) { intercept = naifPlateModelFromDSK.intercept(obsPos, rayDir); qDebug() << "Ray Dir: " << rayDir; qDebug() << "Observer: " << obsPos; - qDebug() << "Intercept is null? " << QString::number(intercept == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(intercept == NULL)); qDebug() << "intercept plate name = " << intercept->shape()->name(); qDebug() << "intercept vertex (obsPos position) = " << intercept->observer(); qDebug() << "intercept vector (look direction) = " << intercept->lookDirectionRay(); diff --git a/isis/src/base/objs/NaifDskShape/unitTest.cpp b/isis/src/base/objs/NaifDskShape/unitTest.cpp index af98498255..206520bc78 100755 --- a/isis/src/base/objs/NaifDskShape/unitTest.cpp +++ b/isis/src/base/objs/NaifDskShape/unitTest.cpp @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) { qDebug() << "Default constructor."; NaifDskShape shapeModel; qDebug() << "Shape name is " << shapeModel.name(); - qDebug() << "Shape is DEM type? " << QString::number(shapeModel.isDEM()); + qDebug() << "Shape is DEM type? " << QString::fromStdString(Isis::toString(shapeModel.isDEM())); qDebug() << ""; @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) { obsPos.push_back(0.0); obsPos.push_back(0.0); obsPos.push_back(0.0); lookDir.push_back(1.0); lookDir.push_back(1.0); lookDir.push_back(1.0); bool success = shapeModelFromPlate.intersectSurface(obsPos, lookDir); - qDebug() << "Intersection successful? " << QString::number(success); + qDebug() << "Intersection successful? " << QString::fromStdString(Isis::toString(success)); qDebug() << ""; qDebug() << "Construct NaifDskShape object from cube labels with ShapeModel=DSK file."; @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) { obsPos[0] = 0.0; obsPos[1] = 0.0; obsPos[2] = 1000.0; lookDir[0] = 0.0; lookDir[1] = -1.0; lookDir[2] = -1.0; success = shapeModelFromPvlShape.intersectSurface(obsPos, lookDir); - qDebug() << "Intersection successful? " << QString::number(success); + qDebug() << "Intersection successful? " << QString::fromStdString(Isis::toString(success)); qDebug() << "Try to intersect surface at obsPos (1000,0,0) and ground point (1,0,0)"; Displacement x(1.0, Displacement::Meters); @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) { qDebug() << "Intercept Y = " << point->DisplacementToDouble(point->GetY(), SurfacePoint::Kilometers); qDebug() << "Intercept Z = " << point->DisplacementToDouble(point->GetZ(), SurfacePoint::Kilometers); } - qDebug() << "Intersection successful? " << QString::number(success); + qDebug() << "Intersection successful? " << QString::fromStdString(Isis::toString(success)); qDebug() << ""; qDebug() << "Construct NaifDskShape object from cube labels with ElevationModel=DSK file."; @@ -111,11 +111,11 @@ int main(int argc, char *argv[]) { obsPos[0] = 1000.0; obsPos[1] = 0.0; obsPos[2] = 0.0; lookDir[0] = -1.0; lookDir[1] = 0.0; lookDir[2] = 0.0; success = shapeModelFromPvlElevation.intersectSurface(obsPos, lookDir); - qDebug() << "Intersection successful? " << QString::number(success); + qDebug() << "Intersection successful? " << QString::fromStdString(Isis::toString(success)); qDebug() << "Intersection valid? " << shapeModelFromPvlElevation.surfaceIntersection()->Valid(); const Intercept *intercept = shapeModelFromPvlElevation.intercept(); - qDebug() << "Intercept is null? " << QString::number(intercept == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(intercept == NULL)); SurfacePoint xp = intercept->location(); NaifVertex xpoint(3); xpoint[0] = xp.GetX().meters(); diff --git a/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp b/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp index 8a909e7271..1d9c9e9536 100644 --- a/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp +++ b/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.cpp @@ -97,13 +97,13 @@ namespace Isis { QString temp; for (int i=0; ilength(); i++){ temp +="----Section "; - temp +=QString::number(i); + temp += QString::fromStdString(Isis::toString(i)); temp +="----\n"; for(int j=0; jat(i)->length(); j++){ temp+="Wavelength= "; - temp+=QString::number(m_spectelList->at(i)->at(j).centerWavelength()); + temp+=QString::fromStdString(Isis::toString(m_spectelList->at(i)->at(j).centerWavelength())); temp+=", Width= "; - temp+=QString::number(m_spectelList->at(i)->at(j).filterWidth()); + temp+=QString::fromStdString(Isis::toString(m_spectelList->at(i)->at(j).filterWidth())); temp+="\n"; } } diff --git a/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.truth b/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.truth index d6a537d970..1a56b52962 100644 --- a/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.truth +++ b/isis/src/base/objs/SpectralDefinition1D/SpectralDefinition1D.truth @@ -71,37 +71,37 @@ Section number is: 1 ----- Testing multiple sections in opposite order----- ----Section 0---- -Wavelength= 8, Width= 0.308 -Wavelength= 7, Width= 0.307 -Wavelength= 6, Width= 0.306 -Wavelength= 5, Width= 0.305 -Wavelength= 4, Width= 0.304 -Wavelength= 3, Width= 0.303 -Wavelength= 2, Width= 0.302 -Wavelength= 1, Width= 0.301 +Wavelength= 8.0, Width= 0.308 +Wavelength= 7.0, Width= 0.307 +Wavelength= 6.0, Width= 0.306 +Wavelength= 5.0, Width= 0.305 +Wavelength= 4.0, Width= 0.304 +Wavelength= 3.0, Width= 0.303 +Wavelength= 2.0, Width= 0.302 +Wavelength= 1.0, Width= 0.301 ----Section 1---- -Wavelength= 6, Width= 0.1511 +Wavelength= 6.0, Width= 0.1511 Wavelength= 5.5, Width= 0.151 -Wavelength= 5, Width= 0.1509 +Wavelength= 5.0, Width= 0.1509 Wavelength= 4.5, Width= 0.1508 -Wavelength= 4, Width= 0.1507 +Wavelength= 4.0, Width= 0.1507 Wavelength= 3.5, Width= 0.1506 -Wavelength= 3, Width= 0.1505 +Wavelength= 3.0, Width= 0.1505 Wavelength= 2.5, Width= 0.1504 -Wavelength= 2, Width= 0.1503 +Wavelength= 2.0, Width= 0.1503 Wavelength= 1.5, Width= 0.1502 -Wavelength= 1, Width= 0.1501 +Wavelength= 1.0, Width= 0.1501 ----Section 2---- Wavelength= 6.25, Width= 0.078 -Wavelength= 6, Width= 0.076 +Wavelength= 6.0, Width= 0.076 Wavelength= 5.75, Width= 0.075 Wavelength= 5.5, Width= 0.074 Wavelength= 5.25, Width= 0.073 -Wavelength= 5, Width= 0.072 +Wavelength= 5.0, Width= 0.072 Wavelength= 4.75, Width= 0.071 Wavelength= 4.5, Width= 0.07 ----Section 3---- -Wavelength= 10, Width= 4 +Wavelength= 10.0, Width= 4.0 The number of sections is : 4 Spectel at band: 28 : Wavelength=10 Width=4 Spectel at band: 28 : Wavelength=10 Width=4 @@ -143,37 +143,37 @@ Section number is: 1 ---- Testing toString --- ----Section 0---- -Wavelength= 8, Width= 0.308 -Wavelength= 7, Width= 0.307 -Wavelength= 6, Width= 0.306 -Wavelength= 5, Width= 0.305 -Wavelength= 4, Width= 0.304 -Wavelength= 3, Width= 0.303 -Wavelength= 2, Width= 0.302 -Wavelength= 1, Width= 0.301 +Wavelength= 8.0, Width= 0.308 +Wavelength= 7.0, Width= 0.307 +Wavelength= 6.0, Width= 0.306 +Wavelength= 5.0, Width= 0.305 +Wavelength= 4.0, Width= 0.304 +Wavelength= 3.0, Width= 0.303 +Wavelength= 2.0, Width= 0.302 +Wavelength= 1.0, Width= 0.301 ----Section 1---- -Wavelength= 6, Width= 0.1511 +Wavelength= 6.0, Width= 0.1511 Wavelength= 5.5, Width= 0.151 -Wavelength= 5, Width= 0.1509 +Wavelength= 5.0, Width= 0.1509 Wavelength= 4.5, Width= 0.1508 -Wavelength= 4, Width= 0.1507 +Wavelength= 4.0, Width= 0.1507 Wavelength= 3.5, Width= 0.1506 -Wavelength= 3, Width= 0.1505 +Wavelength= 3.0, Width= 0.1505 Wavelength= 2.5, Width= 0.1504 -Wavelength= 2, Width= 0.1503 +Wavelength= 2.0, Width= 0.1503 Wavelength= 1.5, Width= 0.1502 -Wavelength= 1, Width= 0.1501 +Wavelength= 1.0, Width= 0.1501 ----Section 2---- Wavelength= 6.25, Width= 0.078 -Wavelength= 6, Width= 0.076 +Wavelength= 6.0, Width= 0.076 Wavelength= 5.75, Width= 0.075 Wavelength= 5.5, Width= 0.074 Wavelength= 5.25, Width= 0.073 -Wavelength= 5, Width= 0.072 +Wavelength= 5.0, Width= 0.072 Wavelength= 4.75, Width= 0.071 Wavelength= 4.5, Width= 0.07 ----Section 3---- -Wavelength= 10, Width= 4 +Wavelength= 10.0, Width= 4.0 ---- Testing for errors --- diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp index 7f4d207e6a..eda5bbaccc 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp @@ -1221,8 +1221,8 @@ namespace Isis { stream.writeAttribute("numberCoefSolved", QString::number(m_numberCamAngleCoefSolved)); stream.writeAttribute("degree", QString::number(m_ckDegree)); stream.writeAttribute("solveDegree", QString::number(m_ckSolveDegree)); - stream.writeAttribute("solveTwist", QString::number(m_solveTwist)); - stream.writeAttribute("solveOverExisting", QString::number(m_solvePointingPolynomialOverExisting)); + stream.writeAttribute("solveTwist", QString::fromStdString(Isis::toString(m_solveTwist))); + stream.writeAttribute("solveOverExisting", QString::fromStdString(Isis::toString(m_solvePointingPolynomialOverExisting))); stream.writeAttribute("interpolationType", QString::number(m_pointingInterpolationType)); stream.writeStartElement("aprioriPointingSigmas"); @@ -1244,7 +1244,7 @@ namespace Isis { stream.writeAttribute("numberCoefSolved", QString::number(m_numberCamPosCoefSolved)); stream.writeAttribute("degree", QString::number(m_spkDegree)); stream.writeAttribute("solveDegree", QString::number(m_spkSolveDegree)); - stream.writeAttribute("solveOverHermiteSpline", QString::number(m_solvePositionOverHermiteSpline)); + stream.writeAttribute("solveOverHermiteSpline", QString::fromStdString(Isis::toString(m_solvePositionOverHermiteSpline))); stream.writeAttribute("interpolationType", QString::number(m_positionInterpolationType)); stream.writeStartElement("aprioriPositionSigmas"); diff --git a/isis/src/core/include/SpecialPixel.h b/isis/src/core/include/SpecialPixel.h index 88895bb6cd..24be01ebc1 100644 --- a/isis/src/core/include/SpecialPixel.h +++ b/isis/src/core/include/SpecialPixel.h @@ -376,9 +376,12 @@ namespace Isis { return "Invalid"; } + /* std::ostringstream result; result << std::setprecision(precision) << std::scientific << d; return result.str(); + */ + return Isis::toString(d); } diff --git a/isis/src/core/tests/PvlKeywordTests.cpp b/isis/src/core/tests/PvlKeywordTests.cpp index a33c902876..1939ef539a 100644 --- a/isis/src/core/tests/PvlKeywordTests.cpp +++ b/isis/src/core/tests/PvlKeywordTests.cpp @@ -230,11 +230,7 @@ TEST(PvlKeyword, IndexSetValue) key.addValue("3.3", "feet"); key.addValue("Hello World!"); -<<<<<<< HEAD key[1] = toString(88); -======= - key[1] = Isis::toString(88); ->>>>>>> e6eff8ddd (Update std::tostring, stoi, stod to IString functions) EXPECT_EQ(key[1], "88"); } @@ -332,11 +328,7 @@ TEST(PvlKeyword, KeywordValidationNull) TEST(PvlKeyword, KeywordValidationFail) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); -<<<<<<< HEAD PvlKeyword pvlKwrd("KeyName", toString(3.5)); -======= - PvlKeyword pvlKwrd("KeyName", Isis::toString(3.5)); ->>>>>>> e6eff8ddd (Update std::tostring, stoi, stod to IString functions) pvlTmplKwrd.validateKeyword(pvlKwrd); } catch(Isis::IException &e) { @@ -347,11 +339,7 @@ TEST(PvlKeyword, KeywordValidationFail) { TEST(PvlKeyword, KeywordValidationPositive) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); -<<<<<<< HEAD PvlKeyword pvlKwrd("KeyName", toString(-3)); -======= - PvlKeyword pvlKwrd("KeyName", Isis::toString(-3)); ->>>>>>> e6eff8ddd (Update std::tostring, stoi, stod to IString functions) pvlTmplKwrd.validateKeyword(pvlKwrd, "positive"); } catch(Isis::IException &e) { @@ -362,15 +350,9 @@ TEST(PvlKeyword, KeywordValidationPositive) { TEST(PvlKeyword, KeywordValidationRange) { try { PvlKeyword pvlTmplKwrd("KeyName", "integer"); -<<<<<<< HEAD PvlKeyword pvlTmplKwrdRange("KeyName__Range", toString(0)); pvlTmplKwrdRange.addValue(toString(10)); PvlKeyword pvlKwrd("KeyName", toString(11)); -======= - PvlKeyword pvlTmplKwrdRange("KeyName__Range", Isis::toString(0)); - pvlTmplKwrdRange.addValue(Isis::toString(10)); - PvlKeyword pvlKwrd("KeyName", Isis::toString(11)); ->>>>>>> e6eff8ddd (Update std::tostring, stoi, stod to IString functions) pvlTmplKwrd.validateKeyword(pvlKwrd, "", &pvlTmplKwrdRange); } catch(Isis::IException &e) { diff --git a/isis/tests/BundleObservationSolveSettingsTests.cpp b/isis/tests/BundleObservationSolveSettingsTests.cpp index 24bce0467b..bcc1f843a4 100644 --- a/isis/tests/BundleObservationSolveSettingsTests.cpp +++ b/isis/tests/BundleObservationSolveSettingsTests.cpp @@ -386,11 +386,11 @@ TEST(BundleObservationSolveSettings, SaveSettings){ EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointingOptionsAtts.namedItem("solveTwist").nodeValue(), - QString::number(boss.solveTwist())); + QString::fromStdString(Isis::toString(boss.solveTwist()))); EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointingOptionsAtts.namedItem("solveOverExisting").nodeValue(), - QString::number(boss.solvePolyOverPointing())); + QString::fromStdString(Isis::toString(boss.solvePolyOverPointing()))); EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointingOptionsAtts.namedItem("interpolationType").nodeValue(), "3"); @@ -431,7 +431,7 @@ TEST(BundleObservationSolveSettings, SaveSettings){ EXPECT_PRED_FORMAT2(AssertQStringsEqual, positionOptionsAtts.namedItem("solveOverHermiteSpline").nodeValue(), - QString::number(boss.solvePositionOverHermite())); + QString::fromStdString(Isis::toString(boss.solvePositionOverHermite()))); EXPECT_PRED_FORMAT2(AssertQStringsEqual, positionOptionsAtts.namedItem("interpolationType").nodeValue(), "3"); diff --git a/isis/tests/StatisticsTest.cpp b/isis/tests/StatisticsTest.cpp index 3f56edfe25..a384a1945f 100644 --- a/isis/tests/StatisticsTest.cpp +++ b/isis/tests/StatisticsTest.cpp @@ -265,6 +265,6 @@ TEST(Statistics,XMLReadWrite) { EXPECT_DOUBLE_EQ(hrsPixels.text().toDouble(), 0.0); EXPECT_DOUBLE_EQ(underRangePixels.text().toDouble(), 0.0); EXPECT_DOUBLE_EQ(overRangePixels.text().toDouble(), 0.0); - EXPECT_STREQ(removedData.text().toStdString().c_str(), "No"); + EXPECT_STREQ(removedData.text().toStdString().c_str(), "0"); } From 483fb4bcb15362ba98b11b835be4091e0b51402f Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 27 Sep 2024 11:14:38 -0600 Subject: [PATCH 90/95] Fix unit tests --- .../InlineCalculator/InlineCalculator.cpp | 2 +- .../ProcessExportPds4/ProcessExportPds4.cpp | 4 +- isis/src/base/objs/Statistics/unitTest.cpp | 4 +- .../base/objs/TriangularPlate/unitTest.cpp | 18 ++-- isis/src/base/objs/UserInterface/unitTest.cpp | 34 ++++---- .../objs/BundleSettings/BundleSettings.cpp | 30 +++---- .../objs/BundleSettings/BundleSettings.truth | 6 +- .../BundleObservationSolveSettings.cpp | 6 +- .../MaximumLikelihoodWFunctions.cpp | 4 +- .../MaximumLikelihoodWFunctions/unitTest.cpp | 84 +++++++++---------- isis/tests/BundleSettingsTests.cpp | 28 +++---- 11 files changed, 110 insertions(+), 110 deletions(-) diff --git a/isis/src/base/objs/InlineCalculator/InlineCalculator.cpp b/isis/src/base/objs/InlineCalculator/InlineCalculator.cpp index 53f3523e9a..1976301361 100644 --- a/isis/src/base/objs/InlineCalculator/InlineCalculator.cpp +++ b/isis/src/base/objs/InlineCalculator/InlineCalculator.cpp @@ -255,7 +255,7 @@ namespace Isis { bool InlineCalculator::isScalar(const QString &scalar) { if (scalar.isEmpty()) return (false); try { - scalar.toDouble(); + Isis::toDouble(scalar.toStdString()); return (true); } catch (IException &e) { diff --git a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp index 436e780e61..9ad02e16c1 100644 --- a/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp +++ b/isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp @@ -895,12 +895,12 @@ namespace Isis { QDomElement scalingFactorElement = m_domDoc->createElement("scaling_factor"); PvlToXmlTranslationManager::setElementValue(scalingFactorElement, - QString::fromStdString(toString(multiplier))); + QString::fromStdString(Isis::toString(multiplier))); elementArrayElement.appendChild(scalingFactorElement); QDomElement offsetElement = m_domDoc->createElement("value_offset"); PvlToXmlTranslationManager::setElementValue(offsetElement, - QString::fromStdString(toString(base))); + QString::fromStdString(Isis::toString(base))); elementArrayElement.appendChild(offsetElement); } diff --git a/isis/src/base/objs/Statistics/unitTest.cpp b/isis/src/base/objs/Statistics/unitTest.cpp index 56506ded0e..f7d81fde72 100644 --- a/isis/src/base/objs/Statistics/unitTest.cpp +++ b/isis/src/base/objs/Statistics/unitTest.cpp @@ -86,8 +86,8 @@ int main(int argc, char *argv[]) { qDebug() << "ChebyShev Max: " << s.ChebyshevMaximum(); qDebug() << "Best Minimum: " << s.BestMinimum(); qDebug() << "Best Maximum: " << s.BestMaximum(); - qDebug() << "Valid Minimum: " << s.ValidMinimum(); - qDebug() << "Valid Maximum: " << s.ValidMaximum(); + qDebug() << "Valid Minimum: " << QString::fromStdString(Isis::toString(s.ValidMinimum())); + qDebug() << "Valid Maximum: " << QString::fromStdString(Isis::toString(s.ValidMaximum())); qDebug() << "Total Pixels: " << s.TotalPixels(); qDebug() << "Valid Pixels: " << s.ValidPixels(); qDebug() << "Null Pixels: " << s.NullPixels(); diff --git a/isis/src/base/objs/TriangularPlate/unitTest.cpp b/isis/src/base/objs/TriangularPlate/unitTest.cpp index 5ba0232e97..e832ab1621 100755 --- a/isis/src/base/objs/TriangularPlate/unitTest.cpp +++ b/isis/src/base/objs/TriangularPlate/unitTest.cpp @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) { qDebug() << "Observer: " << vertex; qDebug() << "Has intercept? " << tp.hasIntercept(vertex, raydir); Intercept *i = tp.intercept(vertex, raydir); - qDebug() << "Intercept is null? " << QString::number(i == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(i == NULL)); qDebug() << ""; // No Plate Intercept - Case (en < 0 && tdot12 > 0) raydir[0] = 0.0; raydir[1] = 0.0; raydir[2] = 1.0; @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) { qDebug() << "Observer: " << vertex; qDebug() << "Has intercept? " << tp.hasIntercept(vertex, raydir); i = tp.intercept(vertex, raydir); - qDebug() << "Intercept is null? " << QString::number(i == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(i == NULL)); qDebug() << ""; // No Plate Intercept - Case (en < 0, tdot12 == 0, && tdot23 > 0) raydir[0] = -1.0; raydir[1] = 1.0; raydir[2] = 0.0; @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) { qDebug() << "Observer: " << vertex; qDebug() << "Has intercept? " << tp.hasIntercept(vertex, raydir); i = tp.intercept(vertex, raydir); - qDebug() << "Intercept is null? " << QString::number(i == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(i == NULL)); qDebug() << ""; // No Plate Intercept - Case (en < 0, tdot12 == 0, tdot23 < 0, && tdot31 > 0) raydir[0] = 1.0; raydir[1] = -1.0; raydir[2] = 0.0; @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) { qDebug() << "Observer: " << vertex; qDebug() << "Has intercept? " << tp.hasIntercept(vertex, raydir); i = tp.intercept(vertex, raydir); - qDebug() << "Intercept is null? " << QString::number(i == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(i == NULL)); qDebug() << ""; // No Plate Intercept - Case (en > 0 && tdot12 < 0) raydir[0] = 0.0; raydir[1] = 0.0; raydir[2] = -1.0; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { qDebug() << "Observer: " << vertex; qDebug() << "Has intercept? " << tp.hasIntercept(vertex, raydir); i = tp.intercept(vertex, raydir); - qDebug() << "Intercept is null? " << QString::number(i == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(i == NULL)); qDebug() << ""; // No Plate Intercept - Case (en > 0, tdot12 == 0, && tdot23 < 0) raydir[0] = -1.0; raydir[1] = 0.0; raydir[2] = 0.0; @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) { qDebug() << "Observer: " << vertex; qDebug() << "Has intercept? " << tp.hasIntercept(vertex, raydir); i = tp.intercept(vertex, raydir); - qDebug() << "Intercept is null? " << QString::number(i == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(i == NULL)); qDebug() << ""; // No Plate Intercept - Case (en > 0, tdot12 == tdot23 == 0, && tdot31 < 0) raydir[0] = 0.0; raydir[1] = -1.0; raydir[2] = 0.0; @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) { qDebug() << "Observer: " << vertex; qDebug() << "Has intercept? " << tp.hasIntercept(vertex, raydir); i = tp.intercept(vertex, raydir); - qDebug() << "Intercept is null? " << QString::number(i == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(i == NULL)); qDebug() << ""; // No Plate Intercept - Case (en != 0 && tdot12 == tdot23 == tdot31 == 0) raydir[0] = 0.0; raydir[1] = 0.0; raydir[2] = 0.0; @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) { qDebug() << "Observer: " << vertex; qDebug() << "Has intercept? " << tp.hasIntercept(vertex, raydir); i = tp.intercept(vertex, raydir); - qDebug() << "Intercept is null? " << QString::number(i == NULL); + qDebug() << "Intercept is null? " << QString::fromStdString(Isis::toString(i == NULL)); qDebug() << ""; // Plate Intercept = true raydir[0] = 1.0; raydir[1] = 1.0; raydir[2] = 1.0; @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) { qDebug() << "Longitude: " << lon; qDebug() << "Has point? " << tp.hasPoint(pole, lon); SurfacePoint *spPole = tp.point(pole, lon); - qDebug() << "Surface point at pole is null? " << QString::number(spPole == NULL); + qDebug() << "Surface point at pole is null? " << QString::fromStdString(Isis::toString(spPole == NULL)); qDebug() << ""; Latitude equator(0.0, Angle::Degrees); qDebug() << "Look for surface point using equator"; diff --git a/isis/src/base/objs/UserInterface/unitTest.cpp b/isis/src/base/objs/UserInterface/unitTest.cpp index e644de2d41..eec0df3c0f 100644 --- a/isis/src/base/objs/UserInterface/unitTest.cpp +++ b/isis/src/base/objs/UserInterface/unitTest.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(highpass), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgcQ, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { cout << vals[i].toStdString(); } cout << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) { cout << " >> '" << vals[i].toStdString() << "'" << endl; } cout << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) { cout << " >> " << vals[i].toStdString() << endl; } cout << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -213,7 +213,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(highpass), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -228,7 +228,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -358,7 +358,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -384,7 +384,7 @@ int main(int argc, char *argv[]) { strcpy(myArgv[myArgc++], "unitTest"); Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -393,7 +393,7 @@ int main(int argc, char *argv[]) { strcpy(myArgv[myArgc++], "./unitTest"); Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -432,7 +432,7 @@ int main(int argc, char *argv[]) { strcpy(myArgv[myArgc++], "-nogui"); Isis::UserInterface ui(QString::fromStdString(highpass), myArgc, myArgv); - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -450,7 +450,7 @@ int main(int argc, char *argv[]) { ui.SetBatchList(i); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } cout << "Finished Batchlist Test" << endl; @@ -814,7 +814,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -829,7 +829,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -871,7 +871,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; } @@ -956,7 +956,7 @@ int main(int argc, char *argv[]) { Isis::UserInterface ui(QString::fromStdString(unitTestXml), myArgc, myArgv); cout << "FROM: " << ui.GetAsString("FROM").toStdString() << endl; cout << "TO: " << ui.GetAsString("TO").toStdString() << endl; - cout << "GUI: " << ui.IsInteractive() << endl; + cout << "GUI: " << Isis::toString(ui.IsInteractive()) << endl; cout << endl; ui.SaveHistory(); diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.cpp b/isis/src/control/objs/BundleSettings/BundleSettings.cpp index 568a74a4d8..ed00a06dbc 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.cpp +++ b/isis/src/control/objs/BundleSettings/BundleSettings.cpp @@ -1027,16 +1027,16 @@ namespace Isis { stream.writeStartElement("globalSettings"); - stream.writeTextElement("validateNetwork", QString::fromStdString(toString(validateNetwork()))); + stream.writeTextElement("validateNetwork", QString::fromStdString(Isis::toString(validateNetwork()))); stream.writeStartElement("solveOptions"); - stream.writeAttribute("solveObservationMode", QString::fromStdString(toString(solveObservationMode()))); - stream.writeAttribute("solveRadius", QString::fromStdString(toString(solveRadius()))); - stream.writeAttribute("controlPointCoordTypeReports", QString::fromStdString(toString(controlPointCoordTypeReports()))); - stream.writeAttribute("controlPointCoordTypeBundle", QString::fromStdString(toString(controlPointCoordTypeBundle()))); - stream.writeAttribute("updateCubeLabel", QString::fromStdString(toString(updateCubeLabel()))); - stream.writeAttribute("errorPropagation", QString::fromStdString(toString(errorPropagation()))); - stream.writeAttribute("createInverseMatrix", QString::fromStdString(toString(createInverseMatrix()))); + stream.writeAttribute("solveObservationMode", QString::fromStdString(Isis::toString(solveObservationMode()))); + stream.writeAttribute("solveRadius", QString::fromStdString(Isis::toString(solveRadius()))); + stream.writeAttribute("controlPointCoordTypeReports", QString::number(controlPointCoordTypeReports())); + stream.writeAttribute("controlPointCoordTypeBundle", QString::number(controlPointCoordTypeBundle())); + stream.writeAttribute("updateCubeLabel", QString::fromStdString(Isis::toString(updateCubeLabel()))); + stream.writeAttribute("errorPropagation", QString::fromStdString(Isis::toString(errorPropagation()))); + stream.writeAttribute("createInverseMatrix", QString::fromStdString(Isis::toString(createInverseMatrix()))); stream.writeEndElement(); stream.writeStartElement("aprioriSigmas"); @@ -1044,26 +1044,26 @@ namespace Isis { stream.writeAttribute("pointCoord1", "N/A"); } else { - stream.writeAttribute("pointCoord1", QString::fromStdString(toString(globalPointCoord1AprioriSigma()))); + stream.writeAttribute("pointCoord1", QString::fromStdString(Isis::toString(globalPointCoord1AprioriSigma()))); } if (IsSpecial(globalPointCoord2AprioriSigma())) { stream.writeAttribute("pointCoord2", "N/A"); } else { - stream.writeAttribute("pointCoord2", QString::fromStdString(toString(globalPointCoord2AprioriSigma()))); + stream.writeAttribute("pointCoord2", QString::fromStdString(Isis::toString(globalPointCoord2AprioriSigma()))); } if (IsSpecial(globalPointCoord3AprioriSigma())) { stream.writeAttribute("pointCoord3", "N/A"); } else { - stream.writeAttribute("pointCoord3", QString::fromStdString(toString(globalPointCoord3AprioriSigma()))); + stream.writeAttribute("pointCoord3", QString::fromStdString(Isis::toString(globalPointCoord3AprioriSigma()))); } stream.writeEndElement(); stream.writeStartElement("outlierRejectionOptions"); - stream.writeAttribute("rejection", QString::fromStdString(toString(outlierRejection()))); + stream.writeAttribute("rejection", QString::fromStdString(Isis::toString(outlierRejection()))); if (outlierRejection()) { - stream.writeAttribute("multiplier", QString::fromStdString(toString(outlierRejectionMultiplier()))); + stream.writeAttribute("multiplier", QString::fromStdString(Isis::toString(outlierRejectionMultiplier()))); } else { stream.writeAttribute("multiplier", "N/A"); @@ -1074,7 +1074,7 @@ namespace Isis { stream.writeAttribute("convergenceCriteria", convergenceCriteriaToString(convergenceCriteria())); stream.writeAttribute("threshold", - QString::fromStdString(toString(convergenceCriteriaThreshold()))); + QString::fromStdString(Isis::toString(convergenceCriteriaThreshold()))); stream.writeAttribute("maximumIterations", QString::fromStdString(toString(convergenceCriteriaMaximumIterations()))); stream.writeEndElement(); @@ -1084,7 +1084,7 @@ namespace Isis { stream.writeStartElement("model"); stream.writeAttribute("type", MaximumLikelihoodWFunctions::modelToString(m_maximumLikelihood[i].first)); - stream.writeAttribute("quantile", QString::fromStdString(toString(m_maximumLikelihood[i].second))); + stream.writeAttribute("quantile", QString::fromStdString(Isis::toString(m_maximumLikelihood[i].second))); stream.writeEndElement(); } stream.writeEndElement(); diff --git a/isis/src/control/objs/BundleSettings/BundleSettings.truth b/isis/src/control/objs/BundleSettings/BundleSettings.truth index 443fa90b2b..5583958455 100644 --- a/isis/src/control/objs/BundleSettings/BundleSettings.truth +++ b/isis/src/control/objs/BundleSettings/BundleSettings.truth @@ -261,9 +261,9 @@ Now get BundleObservationSolveSettings at index 1 "Huber" "0.27" -"Welsch" "28.0" -"HuberModified" "29.0" -"Chen" "30.0" +"Welsch" "28" +"HuberModified" "29" +"Chen" "30" Testing static enum-to-string and string-to-enum methods... "Sigma0" diff --git a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp index eda5bbaccc..f3eec3d3f3 100644 --- a/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp +++ b/isis/src/control/objs/BundleUtilities/BundleObservationSolveSettings.cpp @@ -1223,7 +1223,7 @@ namespace Isis { stream.writeAttribute("solveDegree", QString::number(m_ckSolveDegree)); stream.writeAttribute("solveTwist", QString::fromStdString(Isis::toString(m_solveTwist))); stream.writeAttribute("solveOverExisting", QString::fromStdString(Isis::toString(m_solvePointingPolynomialOverExisting))); - stream.writeAttribute("interpolationType", QString::number(m_pointingInterpolationType)); + stream.writeAttribute("interpolationType", QString::fromStdString(Isis::toString(m_pointingInterpolationType))); stream.writeStartElement("aprioriPointingSigmas"); for (int i = 0; i < m_anglesAprioriSigma.size(); i++) { @@ -1231,7 +1231,7 @@ namespace Isis { stream.writeTextElement("sigma", "N/A"); } else { - stream.writeTextElement("sigma", QString::number(m_anglesAprioriSigma[i])); + stream.writeTextElement("sigma", QString::fromStdString(Isis::toString(m_anglesAprioriSigma[i]))); } } stream.writeEndElement();// end aprioriPointingSigmas @@ -1253,7 +1253,7 @@ namespace Isis { stream.writeTextElement("sigma", "N/A"); } else { - stream.writeTextElement("sigma", QString::number(m_positionAprioriSigma[i])); + stream.writeTextElement("sigma", QString::fromStdString(Isis::toString(m_positionAprioriSigma[i]))); } } stream.writeEndElement();// end aprioriPositionSigmas diff --git a/isis/src/control/objs/MaximumLikelihoodWFunctions/MaximumLikelihoodWFunctions.cpp b/isis/src/control/objs/MaximumLikelihoodWFunctions/MaximumLikelihoodWFunctions.cpp index 1995367789..45eede9f7e 100644 --- a/isis/src/control/objs/MaximumLikelihoodWFunctions/MaximumLikelihoodWFunctions.cpp +++ b/isis/src/control/objs/MaximumLikelihoodWFunctions/MaximumLikelihoodWFunctions.cpp @@ -398,8 +398,8 @@ namespace Isis { */ QString MaximumLikelihoodWFunctions::weightedResidualCutoff() { if (m_model == Huber || m_model == HuberModified) return "N/A"; - else if (m_model == Welsch) return QString::number(m_tweakingConstant * 1.5); - else if (m_model == Chen) return QString::number(m_tweakingConstant); + else if (m_model == Welsch) return QString::fromStdString(Isis::toString(m_tweakingConstant * 1.5)); + else if (m_model == Chen) return QString::fromStdString(Isis::toString(m_tweakingConstant)); else throw IException(IException::Programmer, "Estimation model has not been set.", _FILEINFO_); } diff --git a/isis/src/control/objs/MaximumLikelihoodWFunctions/unitTest.cpp b/isis/src/control/objs/MaximumLikelihoodWFunctions/unitTest.cpp index fcf05adb7c..486d86f13c 100644 --- a/isis/src/control/objs/MaximumLikelihoodWFunctions/unitTest.cpp +++ b/isis/src/control/objs/MaximumLikelihoodWFunctions/unitTest.cpp @@ -41,9 +41,9 @@ int main(int argc, char *argv[]) { MaximumLikelihoodWFunctions wFunc; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -58,9 +58,9 @@ int main(int argc, char *argv[]) { qDebug() << "TC constant re-set to 2.0:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -75,9 +75,9 @@ int main(int argc, char *argv[]) { qDebug() << "TC constant re-set to default:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -92,9 +92,9 @@ int main(int argc, char *argv[]) { qDebug() << "Model manually set with default TC:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -109,9 +109,9 @@ int main(int argc, char *argv[]) { qDebug() << "Model manually set with TC = 2.0:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -126,9 +126,9 @@ int main(int argc, char *argv[]) { qDebug() << "Testing Copy constructor:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(copyWFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(copyWFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(copyWFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << copyWFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(copyWFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(copyWFunc.tweakingConstantQuantile())); temp = copyWFunc.sqrtWeightScaler(-0.5); qDebug() << "copyWFunc->sqrtWeightScaler(-0.5): " << temp; temp = copyWFunc.sqrtWeightScaler(0.75); @@ -147,9 +147,9 @@ int main(int argc, char *argv[]) { wFunc = MaximumLikelihoodWFunctions(MaximumLikelihoodWFunctions::stringToModel("HuberModified")); qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -164,9 +164,9 @@ int main(int argc, char *argv[]) { qDebug() << "TC constant re-set to 2.0:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -181,9 +181,9 @@ int main(int argc, char *argv[]) { qDebug() << "TC constant re-set to default:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -198,9 +198,9 @@ int main(int argc, char *argv[]) { qDebug() << "Model manually set to Huber_Modified with default TC:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -215,9 +215,9 @@ int main(int argc, char *argv[]) { qDebug() << "Model manually set with TC = 2.0:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -235,9 +235,9 @@ int main(int argc, char *argv[]) { wFunc = MaximumLikelihoodWFunctions(MaximumLikelihoodWFunctions::stringToModel("Welsch"), 2.0); qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -252,9 +252,9 @@ int main(int argc, char *argv[]) { qDebug() << "TC constant set to default:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -269,9 +269,9 @@ int main(int argc, char *argv[]) { qDebug() << "Model manually set with default TC:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -286,9 +286,9 @@ int main(int argc, char *argv[]) { qDebug() << "Model manually set with TC = 2.0:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -307,9 +307,9 @@ int main(int argc, char *argv[]) { wFunc = MaximumLikelihoodWFunctions(MaximumLikelihoodWFunctions::stringToModel("Chen")); qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -324,9 +324,9 @@ int main(int argc, char *argv[]) { qDebug() << "TC constant re-set to 2.0:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -341,9 +341,9 @@ int main(int argc, char *argv[]) { qDebug() << "TC constant re-set to default:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -358,9 +358,9 @@ int main(int argc, char *argv[]) { qDebug() << "Model manually set with default TC:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -375,9 +375,9 @@ int main(int argc, char *argv[]) { qDebug() << "Model manually set with TC = 2.0:"; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); @@ -400,9 +400,9 @@ int main(int argc, char *argv[]) { inputData >> newWFunc; qDebug() << "Model = " << MaximumLikelihoodWFunctions::modelToString(wFunc.model()); - qDebug() << "TweakingConstant = " << QString::number(wFunc.tweakingConstant()); + qDebug() << "TweakingConstant = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstant())); qDebug() << "WeightedResidualCutoff = " << wFunc.weightedResidualCutoff(); - qDebug() << "TweakingConstantQuantile = " << QString::number(wFunc.tweakingConstantQuantile()); + qDebug() << "TweakingConstantQuantile = " << QString::fromStdString(Isis::toString(wFunc.tweakingConstantQuantile())); temp = wFunc.sqrtWeightScaler(-0.5); qDebug() << "wFunc->sqrtWeightScaler(-0.5): " << temp; temp = wFunc.sqrtWeightScaler(0.75); diff --git a/isis/tests/BundleSettingsTests.cpp b/isis/tests/BundleSettingsTests.cpp index b8cc648ae5..0371dab500 100644 --- a/isis/tests/BundleSettingsTests.cpp +++ b/isis/tests/BundleSettingsTests.cpp @@ -262,7 +262,7 @@ TEST_P(BoolTest, saveValidateNetwork) { QDomElement validateNetwork = globalSettings.firstChildElement("validateNetwork"); ASSERT_FALSE(validateNetwork.isNull()); EXPECT_EQ("validateNetwork", validateNetwork.tagName()); - EXPECT_EQ(QString::number(testSettings.validateNetwork()), validateNetwork.text()); + EXPECT_EQ(QString::fromStdString(Isis::toString(testSettings.validateNetwork())), validateNetwork.text()); } TEST_P(BoolTest, outlierRejection) { @@ -285,12 +285,12 @@ TEST_P(BoolTest, saveOutlierRejection) { ASSERT_FALSE(outlierRejectionOptions.isNull()); QDomNamedNodeMap outlierRejectionOptionsAtts = outlierRejectionOptions.attributes(); EXPECT_EQ( - QString::number(testSettings.outlierRejection()), + QString::fromStdString(Isis::toString(testSettings.outlierRejection())), outlierRejectionOptionsAtts.namedItem("rejection").nodeValue() ); EXPECT_EQ( (testSettings.outlierRejection() ? - QString::number(testSettings.outlierRejectionMultiplier()) : "N/A"), + QString::fromStdString(Isis::toString(testSettings.outlierRejectionMultiplier())) : "N/A"), outlierRejectionOptionsAtts.namedItem("multiplier").nodeValue() ); } @@ -341,23 +341,23 @@ TEST_P(BoolTest, saveSolveOptions) { ASSERT_FALSE(solveOptions.isNull()); QDomNamedNodeMap solveOptionAtts = solveOptions.attributes(); EXPECT_EQ( - QString::number(testSettings.solveObservationMode()), + QString::fromStdString(Isis::toString(testSettings.solveObservationMode())), solveOptionAtts.namedItem("solveObservationMode").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.solveRadius()), + QString::fromStdString(Isis::toString(testSettings.solveRadius())), solveOptionAtts.namedItem("solveRadius").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.updateCubeLabel()), + QString::fromStdString(Isis::toString(testSettings.updateCubeLabel())), solveOptionAtts.namedItem("updateCubeLabel").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.errorPropagation()), + QString::fromStdString(Isis::toString(testSettings.errorPropagation())), solveOptionAtts.namedItem("errorPropagation").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.createInverseMatrix()), + QString::fromStdString(Isis::toString(testSettings.createInverseMatrix())), solveOptionAtts.namedItem("createInverseMatrix").nodeValue() ); } @@ -496,15 +496,15 @@ TEST(BundleSettings, saveGlobalSigmas) { ASSERT_FALSE(aprioriSigmas.isNull()); QDomNamedNodeMap aprioriSigmasAtts = aprioriSigmas.attributes(); EXPECT_EQ( - QString::number(testSettings.globalPointCoord1AprioriSigma()), + QString::fromStdString(Isis::toString(testSettings.globalPointCoord1AprioriSigma())), aprioriSigmasAtts.namedItem("pointCoord1").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.globalPointCoord2AprioriSigma()), + QString::fromStdString(Isis::toString(testSettings.globalPointCoord2AprioriSigma())), aprioriSigmasAtts.namedItem("pointCoord2").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.globalPointCoord3AprioriSigma()), + QString::fromStdString(Isis::toString(testSettings.globalPointCoord3AprioriSigma())), aprioriSigmasAtts.namedItem("pointCoord3").nodeValue() ); } @@ -622,11 +622,11 @@ TEST_P(ConvergenceCriteriaTest, saveConvergenceCriteria) { convergenceCriteriaOptionsAtts.namedItem("convergenceCriteria").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.convergenceCriteriaThreshold()), + QString::fromStdString(Isis::toString(testSettings.convergenceCriteriaThreshold())), convergenceCriteriaOptionsAtts.namedItem("threshold").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.convergenceCriteriaMaximumIterations()), + QString::fromStdString(Isis::toString(testSettings.convergenceCriteriaMaximumIterations())), convergenceCriteriaOptionsAtts.namedItem("maximumIterations").nodeValue() ); } @@ -781,7 +781,7 @@ TEST(BundleSettings, saveMaximumLikelyhoodModels) { modelAtts.namedItem("type").nodeValue() ); EXPECT_EQ( - QString::number(functions[modelIndex].second), + QString::fromStdString(Isis::toString(functions[modelIndex].second)), modelAtts.namedItem("quantile").nodeValue() ); } From dd11f80baca9b0476aada58c2e1271c4d052eb88 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 27 Sep 2024 15:04:19 -0600 Subject: [PATCH 91/95] Fixed unit test --- .../src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isis/src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp b/isis/src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp index f0ad222c3a..ea44e2aba7 100644 --- a/isis/src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp +++ b/isis/src/base/objs/InlineInfixToPostfix/InlineInfixToPostfix.cpp @@ -155,7 +155,7 @@ namespace Isis { // if (InfixToPostfix::isKnownSymbol(token)) return (false); try { - token.toDouble(); + Isis::toDouble(token.toStdString()); return (true); } catch (IException &) { From edfe8740c357d30e933f1d8f3b10c9e2747d114f Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Mon, 30 Sep 2024 08:57:07 -0700 Subject: [PATCH 92/95] fixed gtests part 3 --- .../src/base/objs/Application/Application.cpp | 4 +-- isis/src/base/objs/Camera/Camera.cpp | 4 +-- .../CameraDistortionMap.cpp | 2 +- .../CameraFocalPlaneMap.cpp | 8 +++--- .../base/objs/CubeAttribute/CubeAttribute.cpp | 4 +-- .../base/objs/Equalization/Equalization.cpp | 26 +++++++++---------- isis/src/base/objs/Hillshade/Hillshade.cpp | 2 +- isis/src/base/objs/IsisAml/IsisAml.cpp | 8 +++--- .../NaifDskPlateModel/NaifDskPlateModel.cpp | 2 +- isis/src/base/objs/Pipeline/Pipeline.cpp | 2 +- .../ProcessImportPds/ProcessImportPds.cpp | 4 +-- .../base/objs/ProcessMosaic/ProcessMosaic.cpp | 4 +-- .../objs/ProgramLauncher/ProgramLauncher.cpp | 2 +- .../PushFrameCameraCcdLayout.cpp | 6 ++--- isis/src/base/objs/Strategy/Strategy.cpp | 8 +++--- isis/src/cassini/apps/cisscal/DarkCurrent.cpp | 2 +- isis/src/cassini/apps/cisscal/main.cpp | 2 +- isis/src/cassini/apps/vimscal/main.cpp | 26 +++++++++---------- isis/src/clementine/apps/clemnircal/main.cpp | 4 +-- .../src/control/apps/cnet2dem/DatumFunctoid.h | 2 +- isis/tests/BundleSettingsTests.cpp | 4 +-- 21 files changed, 63 insertions(+), 63 deletions(-) diff --git a/isis/src/base/objs/Application/Application.cpp b/isis/src/base/objs/Application/Application.cpp index b77d9d3fa9..2280153a7e 100644 --- a/isis/src/base/objs/Application/Application.cpp +++ b/isis/src/base/objs/Application/Application.cpp @@ -143,7 +143,7 @@ namespace Isis { p_connectionToParent = new QLocalSocket; QString serverName = "isis_" + UserName() + - "_" + QString::number(iApp->GetUserInterface().ParentId()); + "_" + QString::fromStdString(toString(iApp->GetUserInterface().ParentId())); p_connectionToParent->connectToServer(serverName); if (!p_connectionToParent->waitForConnected()) { @@ -800,7 +800,7 @@ namespace Isis { */ void Application::UpdateProgress(int percent, bool print) { if (HasParent() && print) { - QString data = QString::number(percent); + QString data = QString::fromStdString(toString(percent)); iApp->SendParentData(QString("PROGRESS"), data); } else if (p_ui->IsInteractive()) { diff --git a/isis/src/base/objs/Camera/Camera.cpp b/isis/src/base/objs/Camera/Camera.cpp index 1355031905..d930a7bd11 100644 --- a/isis/src/base/objs/Camera/Camera.cpp +++ b/isis/src/base/objs/Camera/Camera.cpp @@ -1421,14 +1421,14 @@ namespace Isis { //! Reads the focal length from the instrument kernel void Camera::SetFocalLength() { int code = naifIkCode(); - QString key = "INS" + QString::number(code) + "_FOCAL_LENGTH"; + QString key = "INS" + QString::fromStdString(toString(code)) + "_FOCAL_LENGTH"; SetFocalLength(Spice::getDouble(key)); } //! Reads the Pixel Pitch from the instrument kernel void Camera::SetPixelPitch() { int code = naifIkCode(); - QString key = "INS" + QString::number(code) + "_PIXEL_PITCH"; + QString key = "INS" + QString::fromStdString(toString(code)) + "_PIXEL_PITCH"; SetPixelPitch(Spice::getDouble(key)); } diff --git a/isis/src/base/objs/CameraDistortionMap/CameraDistortionMap.cpp b/isis/src/base/objs/CameraDistortionMap/CameraDistortionMap.cpp index e9cc0e7516..a80d0117a7 100644 --- a/isis/src/base/objs/CameraDistortionMap/CameraDistortionMap.cpp +++ b/isis/src/base/objs/CameraDistortionMap/CameraDistortionMap.cpp @@ -57,7 +57,7 @@ namespace Isis { */ void CameraDistortionMap::SetDistortion(int naifIkCode) { p_odk.clear(); - QString odkkey = "INS" + QString::number(naifIkCode) + "_OD_K"; + QString odkkey = "INS" + QString::fromStdString(toString(naifIkCode)) + "_OD_K"; for (int i = 0; i < 3; ++i) { p_odk.push_back(p_camera->Spice::getDouble(odkkey, i)); } diff --git a/isis/src/base/objs/CameraFocalPlaneMap/CameraFocalPlaneMap.cpp b/isis/src/base/objs/CameraFocalPlaneMap/CameraFocalPlaneMap.cpp index 1bdeb6eba8..ba189282bf 100644 --- a/isis/src/base/objs/CameraFocalPlaneMap/CameraFocalPlaneMap.cpp +++ b/isis/src/base/objs/CameraFocalPlaneMap/CameraFocalPlaneMap.cpp @@ -97,10 +97,10 @@ namespace Isis { p_camera = parent; if (naifIkCode != 0) { - QString xkey = "INS" + QString::number(naifIkCode) + "_TRANSX"; - QString ykey = "INS" + QString::number(naifIkCode) + "_TRANSY"; - QString ixkey = "INS" + QString::number(naifIkCode) + "_ITRANSS"; - QString iykey = "INS" + QString::number(naifIkCode) + "_ITRANSL"; + QString xkey = "INS" + QString::fromStdString(toString(naifIkCode)) + "_TRANSX"; + QString ykey = "INS" + QString::fromStdString(toString(naifIkCode)) + "_TRANSY"; + QString ixkey = "INS" + QString::fromStdString(toString(naifIkCode)) + "_ITRANSS"; + QString iykey = "INS" + QString::fromStdString(toString(naifIkCode)) + "_ITRANSL"; for (int i = 0; i < 3; ++i) { p_transx[i] = parent->getDouble(xkey, i); p_transy[i] = parent->getDouble(ykey, i); diff --git a/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp b/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp index 63cf1117a4..7d99053af2 100644 --- a/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp +++ b/isis/src/base/objs/CubeAttribute/CubeAttribute.cpp @@ -95,9 +95,9 @@ namespace Isis { direction = (start <= end) ? 1 : -1; // Save the entire range of bands for (int band = start; band != end; band += direction) { - result.push_back(QString::number(band)); + result.push_back(QString::fromStdString(Isis::toString(band))); } - result.push_back(QString::number(end)); + result.push_back(QString::fromStdString(Isis::toString(end))); } // This token is a single band specification else { diff --git a/isis/src/base/objs/Equalization/Equalization.cpp b/isis/src/base/objs/Equalization/Equalization.cpp index 4fa9ac8573..be0f474b5c 100644 --- a/isis/src/base/objs/Equalization/Equalization.cpp +++ b/isis/src/base/objs/Equalization/Equalization.cpp @@ -217,10 +217,10 @@ namespace Isis { vector statsList; for (int img = 0; img < (int) m_imageList.size(); img++) { ProcessByLine p; - QString bandStr(QString::number(band)); + QString bandStr(QString::fromStdString(toString(band))); QString statMsg = "Calculating Statistics for Band " + bandStr + - " of " + QString::number(m_maxBand) + " in Cube " + QString::number(img + 1) + - " of " + QString::number(m_maxCube); + " of " + QString::fromStdString(toString(m_maxBand)) + " in Cube " + QString::fromStdString(toString(img + 1)) + + " of " + QString::fromStdString(toString(m_maxCube)); p.Progress()->SetText(statMsg); CubeAttributeInput att("+" + bandStr.toStdString()); QString inp = QString::fromStdString(m_imageList[img].toString()); @@ -272,11 +272,11 @@ namespace Isis { Cube cube2; cube2.open(QString::fromStdString(m_imageList[j].toString())); - QString cubeStr1 = QString::number((int)(i + 1)); - QString cubeStr2 = QString::number((int)(j + 1)); + QString cubeStr1 = QString::fromStdString(toString((int)(i + 1))); + QString cubeStr2 = QString::fromStdString(toString((int)(j + 1))); QString statMsg = "Gathering Overlap Statisitcs for Cube " + cubeStr1 + " vs " + cubeStr2 + " of " + - QString::number(m_maxCube); + QString::fromStdString(toString(m_maxCube)); // Get overlap statistics for new cubes OverlapStatistics *oStats = new OverlapStatistics(cube1, cube2, statMsg, m_samplingPercent); @@ -379,7 +379,7 @@ namespace Isis { if (m_normsSolved) { // Band by band statistics for (int band = 1; band <= m_maxBand; band++) { - QString bandNum = QString::number(band); + QString bandNum = QString::fromStdString(toString(band)); QString bandStr = "Band" + bandNum; PvlKeyword bandStats(bandStr.toStdString()); // GAIN @@ -513,11 +513,11 @@ namespace Isis { FileList outList; fillOutList(outList, toListName); - QString maxCubeStr = QString::number((int) m_imageList.size()); + QString maxCubeStr = QString::fromStdString(toString((int) m_imageList.size())); for (int img = 0; img < m_imageList.size(); img++) { // Set up for progress bar ProcessByLine p; - p.Progress()->SetText("Equalizing Cube " + QString::number((int) img + 1) + + p.Progress()->SetText("Equalizing Cube " + QString::fromStdString(toString((int) img + 1)) + " of " + maxCubeStr); // Open input cube @@ -557,10 +557,10 @@ namespace Isis { // Band by band statistics for (int band = 1; band <= m_maxBand; band++) { - QString mult = QString::number(m_adjustments[img]->getGain(band - 1)); - QString base = QString::number(m_adjustments[img]->getOffset(band - 1)); - QString avg = QString::number(m_adjustments[img]->getAverage(band - 1)); - QString bandNum = QString::number(band); + QString mult = QString::fromStdString(toString(m_adjustments[img]->getGain(band - 1))); + QString base = QString::fromStdString(toString(m_adjustments[img]->getOffset(band - 1))); + QString avg = QString::fromStdString(toString(m_adjustments[img]->getAverage(band - 1))); + QString bandNum = QString::fromStdString(toString(band)); QString bandStr = "Band" + bandNum; PvlKeyword bandStats(bandStr.toStdString()); bandStats += mult.toStdString(); diff --git a/isis/src/base/objs/Hillshade/Hillshade.cpp b/isis/src/base/objs/Hillshade/Hillshade.cpp index 4c8b505aac..1e703d8088 100644 --- a/isis/src/base/objs/Hillshade/Hillshade.cpp +++ b/isis/src/base/objs/Hillshade/Hillshade.cpp @@ -298,7 +298,7 @@ namespace Isis { QString resolution = "Null"; if (!IsSpecial(hillshade.resolution())) - resolution = QString::number(hillshade.resolution()); + resolution = QString::fromStdString(toString(hillshade.resolution())); debug << "Hillshade[ azimuth =" << hillshade.azimuth().toString().toLatin1().data() << "zenith =" << hillshade.zenith().toString().toLatin1().data() diff --git a/isis/src/base/objs/IsisAml/IsisAml.cpp b/isis/src/base/objs/IsisAml/IsisAml.cpp index 7da83fc4b3..643842457c 100644 --- a/isis/src/base/objs/IsisAml/IsisAml.cpp +++ b/isis/src/base/objs/IsisAml/IsisAml.cpp @@ -326,7 +326,7 @@ void IsisAml::PutInteger(const QString ¶mName, } param->values.clear(); - param->values.push_back(QString::number(value)); + param->values.push_back(QString::fromStdString(Isis::toString(value))); Verify(param); } @@ -368,7 +368,7 @@ void IsisAml::PutInteger(const QString ¶mName, param->values.resize(value.size()); for(unsigned int i = 0; i < value.size(); i++) { - param->values[i] = QString::number(value[i]); + param->values[i] = QString::fromStdString(Isis::toString(value[i])); } Verify(param); @@ -410,7 +410,7 @@ void IsisAml::PutDouble(const QString ¶mName, } param->values.clear(); - param->values.push_back(QString::number(value)); + param->values.push_back(QString::fromStdString(Isis::toString(value))); Verify(param); } @@ -452,7 +452,7 @@ void IsisAml::PutDouble(const QString ¶mName, param->values.resize(value.size()); for(unsigned int i = 0; i < value.size(); i++) { - param->values[i] = QString::number(value[i]); + param->values[i] = QString::fromStdString(Isis::toString(value[i])); } Verify(param); diff --git a/isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp b/isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp index e0a5bb43c5..d5a9885f7f 100755 --- a/isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp +++ b/isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp @@ -147,7 +147,7 @@ namespace Isis { #if 0 if ( !isPlateIdValid(plateId) ) { - std::string mess = "Plateid = " + QString::number(plateId) + " is invalid"; + std::string mess = "Plateid = " + QString::fromStdString(Isis::toString(plateId)) + " is invalid"; throw IException(IException::Programmer, mess, _FILEINFO_); } #endif diff --git a/isis/src/base/objs/Pipeline/Pipeline.cpp b/isis/src/base/objs/Pipeline/Pipeline.cpp index f95b42d69f..b900480031 100644 --- a/isis/src/base/objs/Pipeline/Pipeline.cpp +++ b/isis/src/base/objs/Pipeline/Pipeline.cpp @@ -376,7 +376,7 @@ namespace Isis { filename = filelist.front(); filelist.erase(filelist.begin()); p_originalInput.push_back(QString::fromStdString(filename.expanded())); - p_inputBranches.push_back(QString::fromStdString(inputFileName.name()) + QString::number(branch)); + p_inputBranches.push_back(QString::fromStdString(inputFileName.name()) + QString::fromStdString(toString(branch))); p_virtualBands.push_back(""); p_finalOutput.push_back(QString::fromStdString(filename.name())); diff --git a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp index 3af740ebb4..76fe804f9b 100644 --- a/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp +++ b/isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp @@ -495,7 +495,7 @@ namespace Isis { if (dataFilePointer.size() == 1) { try { str = pdsXlater.Translate("DataFilePointer"); - offset = str.toInt(); + offset = toInt(str.toStdString()); units = QString::fromStdString(dataFilePointer.unit()); // Successful? we have an offset, means current, p_labelFile // is the location of the data as well @@ -563,7 +563,7 @@ namespace Isis { } } } - + // Now, to handle the offset units = units.trimmed(); if (units == "BYTES" || units == "B") { diff --git a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp index 5e06fd19b6..a8f1471e58 100644 --- a/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp +++ b/isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp @@ -1204,12 +1204,12 @@ namespace Isis { cOutKey += cInKey[isb++] + "_Count"; } else { - cOutKey += 0; + cOutKey += "0"; isb++; } } else { - cOutKey += 0; + cOutKey += "0"; } } } diff --git a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp index 861bc11e44..2ab20f509d 100644 --- a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp +++ b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp @@ -58,7 +58,7 @@ namespace Isis { } QString serverName = "isis_" + Application::UserName() + - "_" + QString::number(getpid()); + "_" + QString::fromStdString(toString(getpid())); QLocalServer server; server.listen(serverName); diff --git a/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp b/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp index 3ebc38a68f..61b8d79511 100644 --- a/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp +++ b/isis/src/base/objs/PushFrameCameraCcdLayout/PushFrameCameraCcdLayout.cpp @@ -71,7 +71,7 @@ namespace Isis { * @return @b int The number of samples in the CCD. */ int PushFrameCameraCcdLayout::ccdSamples() const { - QString var = "INS" + QString::number(m_ccdId) + "_FILTER_SAMPLES"; + QString var = "INS" + QString::fromStdString(toString(m_ccdId)) + "_FILTER_SAMPLES"; return (getSpiceInt(var)); } @@ -83,7 +83,7 @@ namespace Isis { * @return @b int The number of lines in the CCD. */ int PushFrameCameraCcdLayout::ccdLines() const { - QString var = "INS" + QString::number(m_ccdId) + "_FILTER_LINES"; + QString var = "INS" + QString::fromStdString(toString(m_ccdId)) + "_FILTER_LINES"; return (getSpiceInt(var)); } @@ -103,7 +103,7 @@ namespace Isis { FrameletInfo finfo(frameId); finfo.m_filterName = name; - QString base = "INS" + QString::number(frameId); + QString base = "INS" + QString::fromStdString(toString(frameId)); try { finfo.m_samples = getSpiceInt(base + "_FILTER_SAMPLES"); finfo.m_lines = getSpiceInt(base + "_FILTER_LINES"); diff --git a/isis/src/base/objs/Strategy/Strategy.cpp b/isis/src/base/objs/Strategy/Strategy.cpp index 0a29255974..5b64fdb687 100644 --- a/isis/src/base/objs/Strategy/Strategy.cpp +++ b/isis/src/base/objs/Strategy/Strategy.cpp @@ -574,7 +574,7 @@ namespace Isis { QString result = value; int i = argKeys.size(); BOOST_REVERSE_FOREACH ( QString arg, argKeys ) { - QString target("%"+QString::number(i)); + QString target("%"+QString::fromStdString(toString(i))); result = scanAndReplace(result, target, findReplacement(arg,globals,0,defValue)); i--; } @@ -833,9 +833,9 @@ namespace Isis { getGlobals(resource, globals), ""); if ( !pointsKey.isEmpty() ) { - resource->add(pointsKey, QString::number(npoints)); - resource->add(pointsKey+"Original", QString::number(npointsOrg)); - resource->add(pointsKey+"Tolerance", QString::number(tolerance)); + resource->add(pointsKey, QString::fromStdString(toString(npoints))); + resource->add(pointsKey+"Original", QString::fromStdString(toString(npointsOrg))); + resource->add(pointsKey+"Tolerance", QString::fromStdString(toString(tolerance))); } // Status if requested diff --git a/isis/src/cassini/apps/cisscal/DarkCurrent.cpp b/isis/src/cassini/apps/cisscal/DarkCurrent.cpp index 1eafe60fa4..3286065a0c 100644 --- a/isis/src/cassini/apps/cisscal/DarkCurrent.cpp +++ b/isis/src/cassini/apps/cisscal/DarkCurrent.cpp @@ -45,7 +45,7 @@ namespace Isis { p_flightSoftware = cissLab.FlightSoftwareVersion(); p_gainMode = cissLab.GainModeId(); p_narrow = cissLab.NarrowAngle(); - p_sum = QString::number(cissLab.SummingMode()); + p_sum = QString::fromStdString(toString(cissLab.SummingMode())); p_imageTime = cissLab.ImageTime(); if(cissLab.ReadoutCycleIndex() == "Unknown") { diff --git a/isis/src/cassini/apps/cisscal/main.cpp b/isis/src/cassini/apps/cisscal/main.cpp index ec882e692d..cc273a8d8a 100644 --- a/isis/src/cassini/apps/cisscal/main.cpp +++ b/isis/src/cassini/apps/cisscal/main.cpp @@ -542,7 +542,7 @@ FileName gbl::FindBitweightFile() { else { bitweightName += "wac"; } - QString gainState(QString::number(gbl::cissLab->GainState())); + QString gainState(QString::fromStdString(toString(gbl::cissLab->GainState()))); bitweightName = bitweightName + "g" + gainState; if(gbl::cissLab->FrontOpticsTemp() < -5.0) { diff --git a/isis/src/cassini/apps/vimscal/main.cpp b/isis/src/cassini/apps/vimscal/main.cpp index ba619a0cd8..4ee794e84c 100644 --- a/isis/src/cassini/apps/vimscal/main.cpp +++ b/isis/src/cassini/apps/vimscal/main.cpp @@ -155,7 +155,7 @@ void IsisMain() { iTime startTime(timeString); //Determine the year string to access the appropriate calibration file - yearString= QString::number(startTime.Year() ); + yearString= QString::fromStdString(toString(startTime.Year() )); if(!isVims) { @@ -447,10 +447,10 @@ void loadCalibrationValues() { calibInfo += PvlKeyword("CalibrationVersion", calVersion.toStdString()); - calibInfo += PvlKeyword("SolarMultiplier",QString::number(g_solar,'f',2).toStdString()); - calibInfo += PvlKeyword("IR_Multiplier",QString::number(g_ir,'f',2).toStdString()); - calibInfo += PvlKeyword("VIS_Multiplier",QString::number(g_vis,'f',2).toStdString()); - calibInfo += PvlKeyword("Wave-CalMultiplier",QString::number(g_wavecal,'f',2).toStdString()); + calibInfo += PvlKeyword("SolarMultiplier", toString(g_solar, 2)); + calibInfo += PvlKeyword("IR_Multiplier", toString(g_ir, 2)); + calibInfo += PvlKeyword("VIS_Multiplier", toString(g_vis, 2)); + calibInfo += PvlKeyword("Wave-CalMultiplier", toString(g_wavecal, 2)); } @@ -525,17 +525,17 @@ void updateWavelengths(Cube *icube) { QString averageBandbinString("("); for (unsigned int i =0; i < bandwidthVector.size()-1; i++) { - bandbinCenterString+=QString::number(bandwidthVector[i]); + bandbinCenterString+=QString::fromStdString(toString(bandwidthVector[i])); bandbinCenterString+=","; - averageBandbinString+=QString::number(averageBandwidthVector[i]); + averageBandbinString+=QString::fromStdString(toString(averageBandwidthVector[i])); averageBandbinString+=","; } - bandbinCenterString+=QString::number(bandwidthVector[bandwidthVector.size()-1]); + bandbinCenterString+=QString::fromStdString(toString(bandwidthVector[bandwidthVector.size()-1])); bandbinCenterString+=")"; - averageBandbinString+=QString::number(averageBandwidthVector[averageBandwidthVector.size()-1]); + averageBandbinString+=QString::fromStdString(toString(averageBandwidthVector[averageBandwidthVector.size()-1])); averageBandbinString+=")"; @@ -1063,10 +1063,10 @@ QString createCroppedFile(Cube *icube, QString cubeFileName, bool flatFile) { QString appArgs = "from=" + cubeFileName + " "; - appArgs += "sample=" + QString::number(sampOffset) + " "; - appArgs += "line=" + QString::number(lineOffset) + " "; - appArgs += "nsamples=" + QString::number(icube->sampleCount()) + " "; - appArgs += "nlines=" + QString::number(icube->lineCount()) + " "; + appArgs += "sample=" + QString::fromStdString(toString(sampOffset)) + " "; + appArgs += "line=" + QString::fromStdString(toString(lineOffset)) + " "; + appArgs += "nsamples=" + QString::fromStdString(toString(icube->sampleCount())) + " "; + appArgs += "nlines=" + QString::fromStdString(toString(icube->lineCount())) + " "; FileName tempFile("$TEMPORARY/tmp_" + FileName(cubeFileName.toStdString()).baseName() + "_" + FileName(icube->fileName().toStdString()).name()); diff --git a/isis/src/clementine/apps/clemnircal/main.cpp b/isis/src/clementine/apps/clemnircal/main.cpp index 2303cca88e..628e078bc3 100644 --- a/isis/src/clementine/apps/clemnircal/main.cpp +++ b/isis/src/clementine/apps/clemnircal/main.cpp @@ -65,7 +65,7 @@ void IsisMain() { QString compressionType = QString::fromStdString((icube->group("Instrument"))["EncodingFormat"]); offsetModeID = (icube->group("Instrument"))["OffsetModeID"]; int gainModeID = (icube->group("Instrument"))["GainModeID"]; - QString gainModeIDStr = QString::number(gainModeID); + QString gainModeIDStr = QString::fromStdString(toString(gainModeID)); double exposureDuration = (double)(icube->group("Instrument"))["ExposureDuration"]; optimalExposureDuration = (exposureDuration * 0.984675) + 0.233398; cryocoolerDuration = (icube->group("Instrument"))["CryocoolerDuration"]; @@ -125,7 +125,7 @@ void IsisMain() { gainFactorDef += "clemnircal.def"; Pvl gainFactorData(gainFactorDef.toStdString()); QString group = "GainModeID"; - group += QString::number(gainModeID); + group += QString::fromStdString(toString(gainModeID)); if(!gainFactorData.hasGroup(group.toStdString())) { std::string err = "The Gain Factor for Gain Mode ID ["; diff --git a/isis/src/control/apps/cnet2dem/DatumFunctoid.h b/isis/src/control/apps/cnet2dem/DatumFunctoid.h index e3676e0089..483316f0a4 100644 --- a/isis/src/control/apps/cnet2dem/DatumFunctoid.h +++ b/isis/src/control/apps/cnet2dem/DatumFunctoid.h @@ -411,7 +411,7 @@ namespace Isis { const PvlFlatMap ¶meters = PvlFlatMap(), const int power = 2) : DatumFunctoid(name, parameters), m_power(power) { - m_power = parameters.get("Power", QString::number(m_power)).toInt(); + m_power = parameters.get("Power", QString::fromStdString(toString(m_power))).toInt(); } virtual ~ShepardsRadius() { } diff --git a/isis/tests/BundleSettingsTests.cpp b/isis/tests/BundleSettingsTests.cpp index 0371dab500..bc111ddae4 100644 --- a/isis/tests/BundleSettingsTests.cpp +++ b/isis/tests/BundleSettingsTests.cpp @@ -402,11 +402,11 @@ TEST_P(BoolTest, saveCoordinateTypes) { ASSERT_FALSE(solveOptions.isNull()); QDomNamedNodeMap solveOptionAtts = solveOptions.attributes(); EXPECT_EQ( - QString::number(testSettings.controlPointCoordTypeReports()), + QString::fromStdString(toString(testSettings.controlPointCoordTypeReports())), solveOptionAtts.namedItem("controlPointCoordTypeReports").nodeValue() ); EXPECT_EQ( - QString::number(testSettings.controlPointCoordTypeBundle()), + QString::fromStdString(toString(testSettings.controlPointCoordTypeBundle())), solveOptionAtts.namedItem("controlPointCoordTypeBundle").nodeValue() ); } From 9346e667fbc786694f17c03d561b6a0aedadb21f Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Mon, 27 Jan 2025 15:09:30 -0700 Subject: [PATCH 93/95] Rebase updates --- gtest | 2 +- isis/src/base/apps/csv2table/csv2table.cpp | 36 +- isis/src/base/apps/dstripe/dstripe.cpp | 28 +- isis/src/base/apps/footprintmerge/main.cpp | 2 +- .../base/apps/isisimport/ClipperImportUtils.h | 4 +- .../apps/isisminer/RunCommandStrategy.cpp | 2 +- isis/src/base/apps/noseam/noseam.cpp | 36 +- isis/src/base/apps/photomet/main.cpp | 64 ++-- isis/src/base/apps/photomet/photomet.cpp | 342 +++++++++--------- isis/src/base/apps/pixel2map/main.cpp | 7 +- isis/src/base/apps/pixel2map/pixel2map.cpp | 38 +- .../CameraStatistics/CameraStatistics.cpp | 2 +- isis/src/base/objs/Cube/Cube.cpp | 2 +- .../objs/ProgramLauncher/ProgramLauncher.cpp | 6 +- isis/src/base/objs/Reduce/Reduce.cpp | 14 +- isis/src/base/objs/Strategy/Strategy.cpp | 14 +- isis/src/base/objs/Strategy/unitTest.cpp | 2 +- .../ClipperPushBroomCamera.cpp | 8 +- isis/src/control/apps/jigsaw/jigsaw.cpp | 4 +- isis/src/core/src/PvlKeyword.cpp | 5 +- .../tests/unitTests/FileName/unitTest.cpp | 1 + isis/src/lro/apps/lronaccal/lronaccal.cpp | 2 +- .../apps/mdisedrinfo/MdisGeometry.cpp | 2 +- isis/src/mex/objs/HrscCamera/HrscCamera.cpp | 4 +- .../socetlinescankeywords.cpp | 16 +- .../system/apps/isisdataeval/isisdataeval.cpp | 2 +- isis/tests/CubeTests.cpp | 86 ++--- isis/tests/Fixtures.cpp | 234 ------------ isis/tests/FunctionalTestsCsv2Table.cpp | 6 +- 29 files changed, 357 insertions(+), 614 deletions(-) diff --git a/gtest b/gtest index eff443c6ef..b10fad38c4 160000 --- a/gtest +++ b/gtest @@ -1 +1 @@ -Subproject commit eff443c6ef5eb6ab598bfaae27f9427fdb4f6af7 +Subproject commit b10fad38c4026a29ea6561ab15fc4818170d1c10 diff --git a/isis/src/base/apps/csv2table/csv2table.cpp b/isis/src/base/apps/csv2table/csv2table.cpp index 8d63215b8e..2dea8ee457 100644 --- a/isis/src/base/apps/csv2table/csv2table.cpp +++ b/isis/src/base/apps/csv2table/csv2table.cpp @@ -40,12 +40,12 @@ namespace Isis { } catch(IException &e) { QString msg = "Failed to read CSV file [" + csvFileName + "]."; - throw IException(e, IException::Io, msg, _FILEINFO_); + throw IException(e, IException::Io, msg.toStdString(), _FILEINFO_); } int numColumns = reader.columns(); int numRows = reader.rows(); if (numColumns < 1 || numRows < 1) { - QString msg = "CSV file does not have data.\nFile has [" + toString(numRows) + + std::string msg = "CSV file does not have data.\nFile has [" + toString(numRows) + "] rows and [" + toString(numColumns) +"] columns."; throw IException(IException::User, msg, _FILEINFO_); } @@ -78,13 +78,13 @@ namespace Isis { else { QString msg = "Field [" + type + "] cannot be translated. Accepted types are " "Integer, Double, Text, and Real"; - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } } } else { int numFields = fieldTypes.size(); - QString msg = "Number of fields provided does not equal the number of columns in the CSV. " + std::string msg = "Number of fields provided does not equal the number of columns in the CSV. " "Number of fields [" + toString(numFields) + "] vs Number of Columns [" + toString(numColumns) + "]"; throw IException(IException::User, msg, _FILEINFO_); @@ -108,14 +108,14 @@ namespace Isis { // If the next column header is different, create a field for this one QRegularExpressionMatch nextMatch = (columnIndex0)?(index.toInt()+1):1); + TableField columnField(name.toStdString(), tableTypes[columnIndex], (index.length()>0)?(index.toInt()+1):1); tableRow += columnField; } } } QString tableName = ui.GetString("tablename"); - Table table(tableName, tableRow); + Table table(tableName.toStdString(), tableRow); // Fill the table from the csv for (int rowIndex = 0; rowIndex < numRows; rowIndex++) { @@ -125,16 +125,16 @@ namespace Isis { tableRow[fieldIndex].isText()) { switch(tableTypes[columnIndex]) { case TableField::Type::Integer: - tableRow[fieldIndex] = toInt(csvRow[columnIndex++]); + tableRow[fieldIndex] = csvRow[columnIndex++].toInt(); break; case TableField::Type::Double: - tableRow[fieldIndex] = toDouble(csvRow[columnIndex++]); + tableRow[fieldIndex] = csvRow[columnIndex++].toDouble(); break; case TableField::Type::Text: - tableRow[fieldIndex] = QString(csvRow[columnIndex++]); + tableRow[fieldIndex] = csvRow[columnIndex++].toStdString(); break; case TableField::Type::Real: - tableRow[fieldIndex] = (float)toDouble(csvRow[columnIndex++]); + tableRow[fieldIndex] = (float)csvRow[columnIndex++].toDouble(); break; } } @@ -146,22 +146,22 @@ namespace Isis { switch(tableTypes[columnIndex]) { case TableField::Type::Integer: for (int arrayLen = 0; arrayLen < tableRow[fieldIndex].size(); arrayLen++) { - intVector.push_back(toInt(csvRow[columnIndex++])); + intVector.push_back((csvRow[columnIndex++]).toInt()); } tableRow[fieldIndex] = intVector; break; case TableField::Type::Double: for (int arrayLen = 0; arrayLen < tableRow[fieldIndex].size(); arrayLen++) { - dblVector.push_back(toDouble(csvRow[columnIndex++])); + dblVector.push_back((csvRow[columnIndex++]).toDouble()); } tableRow[fieldIndex] = dblVector; break; case TableField::Type::Text: - throw IException(IException::User, strMsg, _FILEINFO_); + throw IException(IException::User, strMsg.toStdString(), _FILEINFO_); break; case TableField::Type::Real: for (int arrayLen = 0; arrayLen < tableRow[fieldIndex].size(); arrayLen++) { - realVector.push_back((float)toDouble(csvRow[columnIndex++])); + realVector.push_back((float)csvRow[columnIndex++].toDouble()); } tableRow[fieldIndex] = realVector; break; @@ -180,11 +180,11 @@ namespace Isis { QString labelPvlFilename = ui.GetFileName("label"); Pvl labelPvl; try { - labelPvl.read(labelPvlFilename); + labelPvl.read(labelPvlFilename.toStdString()); } catch(IException &e) { QString msg = "Failed to read PVL label file [" + labelPvlFilename + "]."; - throw IException(e, IException::Io, msg, _FILEINFO_); + throw IException(e, IException::Io, msg.toStdString(), _FILEINFO_); } PvlObject &tableLabel = table.Label(); @@ -201,7 +201,7 @@ namespace Isis { } catch(IException &e) { QString msg = "Could not open output cube [" + outCubeFileName + "]."; - throw IException(e, IException::Io, msg, _FILEINFO_); + throw IException(e, IException::Io, msg.toStdString(), _FILEINFO_); } try { @@ -210,7 +210,7 @@ namespace Isis { catch(IException &e) { QString msg = "Could not write output table [" + tableName + "] to output cube [" + outCubeFileName + "]."; - throw IException(e, IException::Io, msg, _FILEINFO_); + throw IException(e, IException::Io, msg.toStdString(), _FILEINFO_); } outCube.close(); diff --git a/isis/src/base/apps/dstripe/dstripe.cpp b/isis/src/base/apps/dstripe/dstripe.cpp index 15d7419533..0bae70c5f1 100644 --- a/isis/src/base/apps/dstripe/dstripe.cpp +++ b/isis/src/base/apps/dstripe/dstripe.cpp @@ -75,13 +75,13 @@ namespace Isis { // Algorithm: lowpass(from, temp) -> hipass(temp, noise) -> to = from-noise // Run lowpass filter on input - QString tempFileName = + std::string tempFileName = FileName::createTempFile("$TEMPORARY/dstripe.temporary.cub").expanded(); QString lowParams = ""; lowParams += "from= " + ui.GetCubeName("FROM"); - lowParams += " to= " + tempFileName + " "; - lowParams += " samples= " + toString(lowSamples); - lowParams += " lines= " + toString(lowLines); + lowParams += " to= " + QString::fromStdString(tempFileName) + " "; + lowParams += " samples= " + QString::number(lowSamples); + lowParams += " lines= " + QString::number(lowLines); ProgramLauncher::RunIsisProgram("lowpass", lowParams); @@ -90,33 +90,33 @@ namespace Isis { QString lowParams = ""; lowParams += "from= " + ui.GetCubeName("FROM"); lowParams += " to= " + ui.GetCubeName("LPFNOISE"); - lowParams += " samples= " + toString(lowSamples); - lowParams += " lines= " + toString(lowLines); + lowParams += " samples= " + QString::number(lowSamples); + lowParams += " lines= " + QString::number(lowLines); ProgramLauncher::RunIsisProgram("lowpass", lowParams); } // Run highpass filter after lowpass is done, i.e. highpass(lowpass(input)) - QString tempNoiseFileName = + std::string tempNoiseFileName = FileName::createTempFile("$TEMPORARY/dstripe.noise.temporary.cub") .expanded(); QString highParams = ""; - highParams += " from= " + tempFileName + " "; - highParams += " to= " + tempNoiseFileName + " "; - highParams += " samples= " + toString(highSamples); - highParams += " lines= " + toString(highLines); + highParams += " from= " + QString::fromStdString(tempFileName) + " "; + highParams += " to= " + QString::fromStdString(tempNoiseFileName) + " "; + highParams += " samples= " + QString::number(highSamples); + highParams += " lines= " + QString::number(highLines); ProgramLauncher::RunIsisProgram("highpass", highParams); - QFile::remove(tempFileName); + QFile::remove(QString::fromStdString(tempFileName)); // Take the difference (FROM-NOISE) and write it to output CubeAttributeInput inatt; - p.SetInputCube(tempNoiseFileName, inatt); + p.SetInputCube(QString::fromStdString(tempNoiseFileName), inatt); CubeAttributeOutput &outatt = ui.GetOutputAttribute("TO"); p.SetOutputCube(ui.GetCubeName("TO"), outatt); p.StartProcess(difference); p.EndProcess(); if (ui.GetBoolean("DELETENOISE")) { - QFile::remove(tempNoiseFileName); + QFile::remove(QString::fromStdString(tempNoiseFileName)); } } diff --git a/isis/src/base/apps/footprintmerge/main.cpp b/isis/src/base/apps/footprintmerge/main.cpp index 29600bf337..8f73233253 100644 --- a/isis/src/base/apps/footprintmerge/main.cpp +++ b/isis/src/base/apps/footprintmerge/main.cpp @@ -61,7 +61,7 @@ void IsisMain() { allPolys.push_back(PolygonTools::CopyMultiPolygon(poly.Polys())); - files.push_back(imageList[img].name()); + files.push_back(QString::fromStdString(imageList[img].name())); prog.CheckStatus(); diff --git a/isis/src/base/apps/isisimport/ClipperImportUtils.h b/isis/src/base/apps/isisimport/ClipperImportUtils.h index f4cb795818..c581a38918 100644 --- a/isis/src/base/apps/isisimport/ClipperImportUtils.h +++ b/isis/src/base/apps/isisimport/ClipperImportUtils.h @@ -32,11 +32,11 @@ namespace Isis { instGroup = inputCubeLabel->findGroup("Instrument", PvlObject::FindOptions::Traverse); } catch(IException &e) { - QString msg = "Unable to find instrument group in [" + cube->fileName() + "]"; + std::string msg = "Unable to find instrument group in [" + cube->fileName().toStdString() + "]"; throw IException(e, IException::User, msg, _FILEINFO_); } - QString startTime = QString(instGroup.findKeyword("StartTime")); + QString startTime = QString::fromStdString(instGroup.findKeyword("StartTime")); iTime time(startTime); PvlKeyword exposureDuration = instGroup.findKeyword("ExposureDuration"); double lineDuration = (double)exposureDuration; diff --git a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp index b7a1cc164a..a09d3397c4 100644 --- a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp +++ b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp @@ -245,7 +245,7 @@ namespace Isis { } else { if ( isDebug() ) { - cout << "Command " << command.m_name << " succeeded\n"; + cout << "Command " << command.m_name.toStdString() << " succeeded\n"; } } } diff --git a/isis/src/base/apps/noseam/noseam.cpp b/isis/src/base/apps/noseam/noseam.cpp index bd59546c2c..2d238f15ea 100644 --- a/isis/src/base/apps/noseam/noseam.cpp +++ b/isis/src/base/apps/noseam/noseam.cpp @@ -31,7 +31,7 @@ namespace Isis { void noseam(UserInterface &ui) { // Get Filename with list of cubes to mosaic - FileName cubeListFileName(ui.GetFileName("FROMLIST")); + FileName cubeListFileName(ui.GetFileName("FROMLIST").toStdString()); return noseam(cubeListFileName, ui); } @@ -83,14 +83,14 @@ namespace Isis { // Sets up the pathName to be used for most application calls FileName inFile = cubes[0]; - QString pathName = FileName("$TEMPORARY/").expanded(); + QString pathName = QString::fromStdString(FileName("$TEMPORARY/").expanded()); /** * Creates a mosaic from the original images. It is placed here * so that the failure MATCHBANDBIN causes does not leave * highpasses cubes lying around! */ - QString parameters = "FROMLIST=" + cubeListFileName.original() + + QString parameters = "FROMLIST=" + QString::fromStdString(cubeListFileName.original()) + " MOSAIC=" + pathName + "OriginalMosaic.cub" + " MATCHBANDBIN=" + match; ProgramLauncher::RunIsisProgram("automos", parameters); @@ -100,13 +100,13 @@ namespace Isis { highPassList.open("HighPassList.lis"); for(int i = 0; i < cubes.size(); i++) { inFile = cubes[i]; - QString outParam = pathName + inFile.baseName() + "_highpass.cub"; - parameters = "FROM=" + inFile.expanded() + + QString outParam = pathName + QString::fromStdString(inFile.baseName()) + "_highpass.cub"; + parameters = "FROM=" + QString::fromStdString(inFile.expanded()) + " TO=" + outParam - + " SAMPLES=" + toString(samples) + " LINES=" + toString(lines); + + " SAMPLES=" + QString::number(samples) + " LINES=" + QString::number(lines); ProgramLauncher::RunIsisProgram("highpass", parameters); // Reads the just created highpass cube into a list file for automos - highPassList << outParam << endl; + highPassList << outParam.toStdString() << endl; } highPassList.close(); @@ -118,7 +118,7 @@ namespace Isis { // Does a lowpass on the original mosaic parameters = "FROM=" + pathName + "OriginalMosaic.cub" + " TO=" + pathName + "LowpassMosaic.cub" - + " SAMPLES=" + toString(samples) + " LINES=" + toString(lines); + + " SAMPLES=" + QString::number(samples) + " LINES=" + QString::number(lines); ProgramLauncher::RunIsisProgram("lowpass", parameters); // Finally combines the highpass and lowpass mosaics @@ -130,19 +130,19 @@ namespace Isis { // Will remove all of the temp files by default if(ui.GetBoolean("REMOVETEMP")) { - QString file("HighPassList.lis"); - remove(file.toLatin1().data()); - file = pathName + "HighpassMosaic.cub"; - remove(file.toLatin1().data()); - file = pathName + "LowpassMosaic.cub"; - remove(file.toLatin1().data()); - file = pathName + "OriginalMosaic.cub"; - remove(file.toLatin1().data()); + std::string file("HighPassList.lis"); + remove(file.c_str()); + file = pathName.toStdString() + "HighpassMosaic.cub"; + remove(file.c_str()); + file = pathName.toStdString() + "LowpassMosaic.cub"; + remove(file.c_str()); + file = pathName.toStdString() + "OriginalMosaic.cub"; + remove(file.c_str()); for(int i = 0; i < cubes.size(); i++) { inFile = cubes[i]; - file = pathName + inFile.baseName() + "_highpass.cub"; - remove(file.toLatin1().data()); + file = pathName.toStdString() + inFile.baseName() + "_highpass.cub"; + remove(file.c_str()); } } } diff --git a/isis/src/base/apps/photomet/main.cpp b/isis/src/base/apps/photomet/main.cpp index 82c5fe1224..8c1ee56c6f 100644 --- a/isis/src/base/apps/photomet/main.cpp +++ b/isis/src/base/apps/photomet/main.cpp @@ -63,19 +63,19 @@ void LoadPvl() { if (!phtObj.hasGroup("Algorithm")) { QString message = "The input PVL does not contain a valid photometric model so you must specify one "; message += "- the [Algorithm] group is missing in your [PhotometricModel]"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } else { PvlObject::PvlGroupIterator phtGrp = phtObj.beginGroup(); bool wasFound = false; if (phtGrp->hasKeyword("PHTNAME")) { - phtVal = (QString)phtGrp->findKeyword("PHTNAME"); + phtVal = QString::fromStdString(phtGrp->findKeyword("PHTNAME")); } else if (phtGrp->hasKeyword("NAME")) { - phtVal = (QString)phtGrp->findKeyword("NAME"); + phtVal = QString::fromStdString(phtGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid photometric model so you must specify one "; message += "- the [Phtname] keyword is missing in your [Algorithm] group"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } phtVal = phtVal.toUpper(); if (phtName == phtVal || phtName == "NONE" || phtName == "FROMPVL") { @@ -85,13 +85,13 @@ void LoadPvl() { while (phtGrp != phtObj.endGroup()) { if (phtGrp->hasKeyword("PHTNAME") || phtGrp->hasKeyword("NAME")) { if (phtGrp->hasKeyword("PHTNAME")) { - phtVal = (QString)phtGrp->findKeyword("PHTNAME"); + phtVal = QString::fromStdString(phtGrp->findKeyword("PHTNAME")); } else if (phtGrp->hasKeyword("NAME")) { - phtVal = (QString)phtGrp->findKeyword("NAME"); + phtVal = QString::fromStdString(phtGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid photometric model so you must specify one "; message += "- the [Phtname] keyword is missing in your [Algorithm] group"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } phtVal = phtVal.toUpper(); if (phtName == phtVal) { @@ -145,7 +145,7 @@ void LoadPvl() { ui.PutAsString("B0", os.str().c_str()); } if (phtGrp->hasKeyword("ZEROB0STANDARD")) { - QString zerob0 = (QString)phtGrp->findKeyword("ZEROB0STANDARD"); + QString zerob0 = QString::fromStdString(phtGrp->findKeyword("ZEROB0STANDARD")); QString izerob0 = zerob0; izerob0 = izerob0.toUpper(); if (izerob0 == "TRUE") { @@ -154,7 +154,7 @@ void LoadPvl() { ui.PutString("ZEROB0STANDARD", "FALSE"); } else { QString message = "The ZEROB0STANDARD value is invalid - must be set to TRUE or FALSE"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } if (phtVal == "HAPKEHEN") { @@ -187,22 +187,22 @@ void LoadPvl() { } } else if (phtVal == "LUNARLAMBERTEMPIRICAL" || phtVal == "MINNAERTEMPIRICAL") { if (phtGrp->hasKeyword("PHASELIST")) { - QString phaselist = (QString)phtGrp->findKeyword("PHASELIST"); + QString phaselist =QString::fromStdString(phtGrp->findKeyword("PHASELIST")); ui.PutAsString("PHASELIST", phaselist); } if (phtGrp->hasKeyword("PHASECURVELIST")) { - QString phasecurvelist = (QString)phtGrp->findKeyword("PHASECURVELIST"); + QString phasecurvelist = QString::fromStdString(phtGrp->findKeyword("PHASECURVELIST")); ui.PutAsString("PHASECURVELIST", phasecurvelist); } if (phtVal == "LUNARLAMBERTEMPIRICAL") { if (phtGrp->hasKeyword("LLIST")) { - QString llist = (QString)phtGrp->findKeyword("LLIST"); + QString llist = QString::fromStdString(phtGrp->findKeyword("LLIST")); ui.PutAsString("LLIST", llist); } } if (phtVal == "MINNAERTEMPIRICAL") { if (phtGrp->hasKeyword("KLIST")) { - QString klist = (QString)phtGrp->findKeyword("KLIST"); + QString klist = QString::fromStdString(phtGrp->findKeyword("KLIST")); ui.PutAsString("KLIST", klist); } } @@ -223,7 +223,7 @@ void LoadPvl() { } else if (phtVal != "LAMBERT" && phtVal != "LOMMELSEELIGER" && phtVal != "LUNARLAMBERTMCEWEN") { QString message = "Unsupported photometric model [" + phtVal + "]."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } ui.PutAsString("PHTNAME", phtVal); } @@ -236,19 +236,19 @@ void LoadPvl() { if (!nrmObj.hasGroup("Algorithm")) { QString message = "The input PVL does not contain a valid normalization model so you must specify one "; message += "- the [Algorithm] group is missing in your [NormalizationModel]"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } else { PvlObject::PvlGroupIterator nrmGrp = nrmObj.beginGroup(); bool wasFound = false; if (nrmGrp->hasKeyword("NORMNAME")) { - nrmVal = (QString)nrmGrp->findKeyword("NORMNAME"); + nrmVal = QString::fromStdString(nrmGrp->findKeyword("NORMNAME")); } else if (nrmGrp->hasKeyword("NAME")) { - nrmVal = (QString)nrmGrp->findKeyword("NAME"); + nrmVal = QString::fromStdString(nrmGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid normalization model so you must specify one "; message += "- the [Normname] keyword is missing in your [Algorithm] group"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } nrmVal = nrmVal.toUpper(); if (nrmName == nrmVal || nrmName == "NONE" || nrmName == "FROMPVL") { @@ -258,13 +258,13 @@ void LoadPvl() { while (nrmGrp != nrmObj.endGroup()) { if (nrmGrp->hasKeyword("NORMNAME") || nrmGrp->hasKeyword("NAME")) { if (nrmGrp->hasKeyword("NORMNAME")) { - nrmVal = (QString)nrmGrp->findKeyword("NORMNAME"); + nrmVal = QString::fromStdString(nrmGrp->findKeyword("NORMNAME")); } else if (nrmGrp->hasKeyword("NAME")) { - nrmVal = (QString)nrmGrp->findKeyword("NAME"); + nrmVal = QString::fromStdString(nrmGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid normalization model so you must specify one "; message += "- the [Normname] keyword is missing in your [Algorithm] group"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } nrmVal = nrmVal.toUpper(); if (nrmName == nrmVal) { @@ -387,7 +387,7 @@ void LoadPvl() { } } else { QString message = "Unsupported normalization model [" + nrmVal + "]."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } else { if (nrmGrp->hasKeyword("D")) { @@ -470,19 +470,19 @@ void LoadPvl() { if (!atmObj.hasGroup("Algorithm")) { QString message = "The input PVL does not contain a valid atmospheric model so you must specify one "; message += "- the [Algorithm] group is missing in your [AtmosphericModel]"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } else { PvlObject::PvlGroupIterator atmGrp = atmObj.beginGroup(); bool wasFound = false; if (atmGrp->hasKeyword("ATMNAME")) { - atmVal = (QString)atmGrp->findKeyword("ATMNAME"); + atmVal = QString::fromStdString(atmGrp->findKeyword("ATMNAME")); } else if (atmGrp->hasKeyword("NAME")) { - atmVal = (QString)atmGrp->findKeyword("NAME"); + atmVal = QString::fromStdString(atmGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid atmospheric model so you must specify one "; message += "- the [Atmname] keyword is missing in your [Algorithm] group"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } atmVal = atmVal.toUpper(); if (atmName == atmVal || atmName == "NONE" || atmName == "FROMPVL") { @@ -492,13 +492,13 @@ void LoadPvl() { while (atmGrp != atmObj.endGroup()) { if (atmGrp->hasKeyword("ATMNAME") || atmGrp->hasKeyword("NAME")) { if (atmGrp->hasKeyword("ATMNAME")) { - atmVal = (QString)atmGrp->findKeyword("ATMNAME"); + atmVal = QString::fromStdString(atmGrp->findKeyword("ATMNAME")); } else if (atmGrp->hasKeyword("NAME")) { - atmVal = (QString)atmGrp->findKeyword("NAME"); + atmVal = QString::fromStdString(atmGrp->findKeyword("NAME")); } else { QString message = "The input PVL does not contain a valid atmospheric model so you must specify one "; message += "- the [Atmname] keyword is missing in your [Algorithm] group"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } atmVal = atmVal.toUpper(); if (atmName == atmVal) { @@ -546,7 +546,7 @@ void LoadPvl() { ui.PutAsString("WHA", os.str().c_str()); } if (atmGrp->hasKeyword("NULNEG")) { - QString nulneg = (QString)atmGrp->findKeyword("NULNEG"); + QString nulneg = QString::fromStdString(atmGrp->findKeyword("NULNEG")); QString inulneg = nulneg; inulneg = inulneg.toUpper(); if (inulneg == "YES") { @@ -554,7 +554,7 @@ void LoadPvl() { } else if (inulneg == "NO") { ui.PutString("NULNEG", "NO"); } else { - QString message = "The NULNEG value is invalid - must be set to YES or NO"; + std::string message = "The NULNEG value is invalid - must be set to YES or NO"; throw IException(IException::User, message, _FILEINFO_); } } @@ -580,7 +580,7 @@ void LoadPvl() { atmVal != "HAPKEATM1" && atmVal != "HAPKEATM2" && atmVal != "ISOTROPIC1" && atmVal != "ISOTROPIC2") { QString message = "Unsupported atmospheric model [" + atmVal + "]."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } ui.PutAsString("ATMNAME", atmVal); } diff --git a/isis/src/base/apps/photomet/photomet.cpp b/isis/src/base/apps/photomet/photomet.cpp index b4d321b5d0..9a457e93a6 100644 --- a/isis/src/base/apps/photomet/photomet.cpp +++ b/isis/src/base/apps/photomet/photomet.cpp @@ -84,7 +84,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { message += "data that are formatted as parname=value and each pair is " "separated by spaces."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } parMap[parvalList.at(0)] = parvalList.at(1); } @@ -101,15 +101,15 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { PvlObject fromNormObj; PvlGroup fromNormGrp; QString input = ui.GetFileName("FROMPVL"); - fromNormPvl.read(input); + fromNormPvl.read(input.toStdString()); if (fromNormPvl.hasObject("NormalizationModel")) { fromNormObj = fromNormPvl.findObject("NormalizationModel"); if (fromNormObj.hasGroup("Algorithm")) { PvlObject::PvlGroupIterator fromNormGrp = fromNormObj.beginGroup(); if (fromNormGrp->hasKeyword("NORMNAME")) { - normVal = (QString)fromNormGrp->findKeyword("NORMNAME"); + normVal = QString::fromStdString(fromNormGrp->findKeyword("NORMNAME")); } else if (fromNormGrp->hasKeyword("NAME")) { - normVal = (QString)fromNormGrp->findKeyword("NAME"); + normVal = QString::fromStdString(fromNormGrp->findKeyword("NAME")); } else { normVal = "NONE"; } @@ -127,9 +127,9 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (fromNormGrp->hasKeyword("NORMNAME") || fromNormGrp->hasKeyword("NAME")) { if (fromNormGrp->hasKeyword("NORMNAME")) { - normVal = (QString)fromNormGrp->findKeyword("NORMNAME"); + normVal = QString::fromStdString(fromNormGrp->findKeyword("NORMNAME")); } else if (fromNormGrp->hasKeyword("NAME")) { - normVal = (QString)fromNormGrp->findKeyword("NAME"); + normVal = QString::fromStdString(fromNormGrp->findKeyword("NAME")); } else { normVal = "NONE"; } @@ -152,7 +152,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { } // Check to make sure that a normalization model was specified if (normName == "NONE" || normName == "FROMPVL") { - QString message = + std::string message = "A Normalization model must be specified before running this " "program. "; message += @@ -171,7 +171,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { .addGroup(PvlGroup("Algorithm")); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("NORMNAME", normName), Pvl::Replace); + .addKeyword(PvlKeyword("NORMNAME", normName.toStdString()), Pvl::Replace); } } else { // Check to make sure that a normalization model was specified @@ -185,26 +185,26 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { message += "you need to specify a Normalization model through the program " "interface."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } toNormPvl.addObject(PvlObject("NormalizationModel")); toNormPvl.findObject("NormalizationModel").addGroup(PvlGroup("Algorithm")); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("NORMNAME", normName), Pvl::Replace); + .addKeyword(PvlKeyword("NORMNAME", normName.toStdString()), Pvl::Replace); } - normLog += PvlKeyword("NORMNAME", normName); + normLog += PvlKeyword("NORMNAME", normName.toStdString()); if (normName == "ALBEDO" || normName == "MIXED") { if (parMap.contains("INCREF")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("INCREF", toString(toDouble(parMap["INCREF"]))), + PvlKeyword("INCREF", toString((parMap["INCREF"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("INCREF")) { QString keyval = ui.GetString("INCREF"); - double incref = toDouble(keyval); + double incref = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("INCREF", toString(incref)), Pvl::Replace); @@ -215,7 +215,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the INCREF parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -226,11 +226,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("INCMAT", toString(toDouble(parMap["INCMAT"]))), + PvlKeyword("INCMAT", toString((parMap["INCMAT"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("INCMAT")) { QString keyval = ui.GetString("INCMAT"); - double incmat = toDouble(keyval); + double incmat = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("INCMAT", toString(incmat)), Pvl::Replace); @@ -242,7 +242,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the INCMAT parameter."; message += "The normal range for INCMAT is: 0 <= INCMAT < 90"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -253,11 +253,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("THRESH", toString(toDouble(parMap["THRESH"]))), + PvlKeyword("THRESH", toString((parMap["THRESH"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("THRESH")) { QString keyval = ui.GetString("THRESH"); - double thresh = toDouble(keyval); + double thresh = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("THRESH", toString(thresh)), Pvl::Replace); @@ -268,7 +268,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the THRESH parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -278,11 +278,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("ALBEDO", toString(toDouble(parMap["ALBEDO"]))), + PvlKeyword("ALBEDO", toString((parMap["ALBEDO"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("ALBEDO")) { QString keyval = ui.GetString("ALBEDO"); - double albedo = toDouble(keyval); + double albedo = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("ALBEDO", toString(albedo)), Pvl::Replace); @@ -294,7 +294,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the ALBEDO parameter."; message += "The ALBEDO parameter has no limited range"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -304,11 +304,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("D")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("D", toString(toDouble(parMap["D"]))), + .addKeyword(PvlKeyword("D", toString((parMap["D"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("D")) { QString keyval = ui.GetString("D"); - double d = toDouble(keyval); + double d = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("D", toString(d)), Pvl::Replace); @@ -320,7 +320,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the D parameter."; message += "The D parameter has no limited range"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -329,11 +329,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("E")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("E", toString(toDouble(parMap["E"]))), + .addKeyword(PvlKeyword("E", toString((parMap["E"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("E")) { QString keyval = ui.GetString("E"); - double e = toDouble(keyval); + double e = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("E", toString(e)), Pvl::Replace); @@ -345,7 +345,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the E parameter."; message += "The E parameter has no limited range"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -354,11 +354,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("F")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("F", toString(toDouble(parMap["F"]))), + .addKeyword(PvlKeyword("F", toString((parMap["F"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("F")) { QString keyval = ui.GetString("F"); - double f = toDouble(keyval); + double f = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("F", toString(f)), Pvl::Replace); @@ -370,7 +370,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the F parameter."; message += "The F parameter has no limited range"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -379,11 +379,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("G2")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("G2", toString(toDouble(parMap["G2"]))), + .addKeyword(PvlKeyword("G2", toString(parMap["G2"].toDouble())), Pvl::Replace); } else if (ui.WasEntered("G2")) { QString keyval = ui.GetString("G2"); - double g2 = toDouble(keyval); + double g2 = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("G2", toString(g2)), Pvl::Replace); @@ -395,7 +395,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the G2 parameter."; message += "The G2 parameter has no limited range"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -404,11 +404,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("XMUL")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("XMUL", toString(toDouble(parMap["XMUL"]))), + .addKeyword(PvlKeyword("XMUL", toString((parMap["XMUL"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("XMUL")) { QString keyval = ui.GetString("XMUL"); - double xmul = toDouble(keyval); + double xmul = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("XMUL", toString(xmul)), Pvl::Replace); @@ -420,7 +420,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the XMUL parameter."; message += "The XMUL parameter has no range limit"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -429,11 +429,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("WL")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("WL", toString(toDouble(parMap["WL"]))), + .addKeyword(PvlKeyword("WL", toString((parMap["WL"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("WL")) { QString keyval = ui.GetString("WL"); - double wl = toDouble(keyval); + double wl = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("WL", toString(wl)), Pvl::Replace); @@ -445,7 +445,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the WL parameter."; message += "The WL parameter has no range limit"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -454,11 +454,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("H")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("H", toString(toDouble(parMap["H"]))), + .addKeyword(PvlKeyword("H", toString((parMap["H"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("H")) { QString keyval = ui.GetString("H"); - double h = toDouble(keyval); + double h = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("H", toString(h)), Pvl::Replace); @@ -470,7 +470,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the H parameter."; message += "The H parameter has no limited range"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -479,11 +479,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("BSH1")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("BSH1", toString(toDouble(parMap["BSH1"]))), + .addKeyword(PvlKeyword("BSH1", toString((parMap["BSH1"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("BSH1")) { QString keyval = ui.GetString("BSH1"); - double bsh1 = toDouble(keyval); + double bsh1 = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("BSH1", toString(bsh1)), Pvl::Replace); @@ -495,7 +495,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the BSH1 parameter."; message += "The normal range for BSH1 is: 0 <= BSH1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -504,11 +504,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("XB1")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("XB1", toString(toDouble(parMap["XB1"]))), + .addKeyword(PvlKeyword("XB1", toString((parMap["XB1"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("XB1")) { QString keyval = ui.GetString("XB1"); - double xb1 = toDouble(keyval); + double xb1 = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("XB1", toString(xb1)), Pvl::Replace); @@ -520,7 +520,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the XB1 parameter."; message += "The XB1 parameter has no range limit"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -529,11 +529,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("XB2")) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("XB2", toString(toDouble(parMap["XB2"]))), + .addKeyword(PvlKeyword("XB2", toString((parMap["XB2"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("XB2")) { QString keyval = ui.GetString("XB2"); - double xb2 = toDouble(keyval); + double xb2 = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("XB2", toString(xb2)), Pvl::Replace); @@ -545,7 +545,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the XB2 parameter."; message += "The XB2 parameter has no range limit"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -556,11 +556,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("INCREF", toString(toDouble(parMap["INCREF"]))), + PvlKeyword("INCREF", toString((parMap["INCREF"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("INCREF")) { QString keyval = ui.GetString("INCREF"); - double incref = toDouble(keyval); + double incref = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("INCREF", toString(incref)), Pvl::Replace); @@ -572,7 +572,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the INCREF parameter."; message += "The normal range for INCREF is: 0 <= INCREF < 90"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -582,11 +582,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("ALBEDO", toString(toDouble(parMap["ALBEDO"]))), + PvlKeyword("ALBEDO", toString((parMap["ALBEDO"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("ALBEDO")) { QString keyval = ui.GetString("ALBEDO"); - double albedo = toDouble(keyval); + double albedo = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("ALBEDO", toString(albedo)), Pvl::Replace); @@ -597,7 +597,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the ALBEDO parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -608,11 +608,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("INCREF", toString(toDouble(parMap["INCREF"]))), + PvlKeyword("INCREF", toString((parMap["INCREF"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("INCREF")) { QString keyval = ui.GetString("INCREF"); - double incref = toDouble(keyval); + double incref = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("INCREF", toString(incref)), Pvl::Replace); @@ -623,7 +623,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the INCREF parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -633,11 +633,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("THRESH", toString(toDouble(parMap["THRESH"]))), + PvlKeyword("THRESH", toString((parMap["THRESH"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("THRESH")) { QString keyval = ui.GetString("THRESH"); - double thresh = toDouble(keyval); + double thresh = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("THRESH", toString(thresh)), Pvl::Replace); @@ -649,7 +649,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + normName + " Normalization model requires a value for the THRESH parameter."; message += "The THRESH parameter has no range limit"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -659,11 +659,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("ALBEDO", toString(toDouble(parMap["ALBEDO"]))), + PvlKeyword("ALBEDO", toString((parMap["ALBEDO"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("ALBEDO")) { QString keyval = ui.GetString("ALBEDO"); - double albedo = toDouble(keyval); + double albedo = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("ALBEDO", toString(albedo)), Pvl::Replace); @@ -674,7 +674,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the ALBEDO parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -685,11 +685,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("INCREF", toString(toDouble(parMap["INCREF"]))), + PvlKeyword("INCREF", toString((parMap["INCREF"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("INCREF")) { QString keyval = ui.GetString("INCREF"); - double incref = toDouble(keyval); + double incref = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("INCREF", toString(incref)), Pvl::Replace); @@ -700,7 +700,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the INCREF parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -711,11 +711,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("INCREF", toString(toDouble(parMap["INCREF"]))), + PvlKeyword("INCREF", toString((parMap["INCREF"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("INCREF")) { QString keyval = ui.GetString("INCREF"); - double incref = toDouble(keyval); + double incref = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("INCREF", toString(incref)), Pvl::Replace); @@ -726,7 +726,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the INCREF parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -736,11 +736,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("ALBEDO", toString(toDouble(parMap["ALBEDO"]))), + PvlKeyword("ALBEDO", toString((parMap["ALBEDO"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("ALBEDO")) { QString keyval = ui.GetString("ALBEDO"); - double albedo = toDouble(keyval); + double albedo = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("ALBEDO", toString(albedo)), Pvl::Replace); @@ -751,7 +751,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the ALBEDO parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -762,11 +762,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("INCREF", toString(toDouble(parMap["INCREF"]))), + PvlKeyword("INCREF", toString((parMap["INCREF"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("INCREF")) { QString keyval = ui.GetString("INCREF"); - double incref = toDouble(keyval); + double incref = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("INCREF", toString(incref)), Pvl::Replace); @@ -777,7 +777,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the INCREF parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -787,11 +787,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("ALBEDO", toString(toDouble(parMap["ALBEDO"]))), + PvlKeyword("ALBEDO", toString((parMap["ALBEDO"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("ALBEDO")) { QString keyval = ui.GetString("ALBEDO"); - double albedo = toDouble(keyval); + double albedo = keyval.toDouble(); toNormPvl.findObject("NormalizationModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("ALBEDO", toString(albedo)), Pvl::Replace); @@ -802,7 +802,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + normName + " Normalization model requires a value for the ALBEDO parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } normLog += toNormPvl.findObject("NormalizationModel") @@ -826,15 +826,15 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { PvlObject fromAtmObj; PvlGroup fromAtmGrp; QString input = ui.GetFileName("FROMPVL"); - fromAtmPvl.read(input); + fromAtmPvl.read(input.toStdString()); if (fromAtmPvl.hasObject("AtmosphericModel")) { fromAtmObj = fromAtmPvl.findObject("AtmosphericModel"); if (fromAtmObj.hasGroup("Algorithm")) { PvlObject::PvlGroupIterator fromAtmGrp = fromAtmObj.beginGroup(); if (fromAtmGrp->hasKeyword("ATMNAME")) { - atmVal = (QString)fromAtmGrp->findKeyword("ATMNAME"); + atmVal = QString::fromStdString(fromAtmGrp->findKeyword("ATMNAME")); } else if (fromAtmGrp->hasKeyword("NAME")) { - atmVal = (QString)fromAtmGrp->findKeyword("NAME"); + atmVal = QString::fromStdString(fromAtmGrp->findKeyword("NAME")); } else { atmVal = "NONE"; } @@ -852,9 +852,9 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (fromAtmGrp->hasKeyword("ATMNAME") || fromAtmGrp->hasKeyword("NAME")) { if (fromAtmGrp->hasKeyword("ATMNAME")) { - atmVal = (QString)fromAtmGrp->findKeyword("ATMNAME"); + atmVal = QString::fromStdString(fromAtmGrp->findKeyword("ATMNAME")); } else if (fromAtmGrp->hasKeyword("NAME")) { - atmVal = (QString)fromAtmGrp->findKeyword("NAME"); + atmVal = QString::fromStdString(fromAtmGrp->findKeyword("NAME")); } else { atmVal = "NONE"; } @@ -885,7 +885,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { message += "you need to specify an Atmospheric model through the program " "interface."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } if (wasFound) { toAtmPvl.addObject(fromAtmObj); @@ -894,7 +894,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toAtmPvl.findObject("AtmosphericModel").addGroup(PvlGroup("Algorithm")); toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("ATMNAME", atmName), Pvl::Replace); + .addKeyword(PvlKeyword("ATMNAME", atmName.toStdString()), Pvl::Replace); } } else { if (atmName == "NONE" || atmName == "FROMPVL") { @@ -907,15 +907,15 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { message += "you need to specify an Atmospheric model through the program " "interface."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } toAtmPvl.addObject(PvlObject("AtmosphericModel")); toAtmPvl.findObject("AtmosphericModel").addGroup(PvlGroup("Algorithm")); toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("ATMNAME", atmName), Pvl::Replace); + .addKeyword(PvlKeyword("ATMNAME", atmName.toStdString()), Pvl::Replace); } - atmLog += PvlKeyword("ATMNAME", atmName); + atmLog += PvlKeyword("ATMNAME", atmName.toStdString()); if (atmName == "ANISOTROPIC1" || atmName == "ANISOTROPIC2" || atmName == "HAPKEATM1" || atmName == "HAPKEATM2" || @@ -924,11 +924,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("HNORM", toString(toDouble(parMap["HNORM"]))), + PvlKeyword("HNORM", toString((parMap["HNORM"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("HNORM")) { QString keyval = ui.GetString("HNORM"); - double hnorm = toDouble(keyval); + double hnorm = keyval.toDouble(); toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("HNORM", toString(hnorm)), Pvl::Replace); @@ -940,7 +940,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + atmName + " Atmospheric model requires a value for the HNORM parameter."; message += "The normal range for HNORM is: 0 <= HNORM"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } atmLog += toAtmPvl.findObject("AtmosphericModel") @@ -949,11 +949,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("TAU")) { toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("TAU", toString(toDouble(parMap["TAU"]))), + .addKeyword(PvlKeyword("TAU", toString((parMap["TAU"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("TAU")) { QString keyval = ui.GetString("TAU"); - double tau = toDouble(keyval); + double tau = keyval.toDouble(); toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("TAU", toString(tau)), Pvl::Replace); @@ -965,7 +965,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + atmName + " Atmospheric model requires a value for the TAU parameter."; message += "The normal range for TAU is: 0 <= TAU"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } atmLog += toAtmPvl.findObject("AtmosphericModel") @@ -975,11 +975,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") .addKeyword( - PvlKeyword("TAUREF", toString(toDouble(parMap["TAUREF"]))), + PvlKeyword("TAUREF", toString((parMap["TAUREF"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("TAUREF")) { QString keyval = ui.GetString("TAUREF"); - double tauref = toDouble(keyval); + double tauref = keyval.toDouble(); toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("TAUREF", toString(tauref)), Pvl::Replace); @@ -991,7 +991,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + atmName + " Atmospheric model requires a value for the TAUREF parameter."; message += "The normal range for TAUREF is: 0 <= TAUREF"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } atmLog += toAtmPvl.findObject("AtmosphericModel") @@ -1000,11 +1000,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("WHA")) { toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("WHA", toString(toDouble(parMap["WHA"]))), + .addKeyword(PvlKeyword("WHA", toString((parMap["WHA"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("WHA")) { QString keyval = ui.GetString("WHA"); - double wha = toDouble(keyval); + double wha = keyval.toDouble(); toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("WHA", toString(wha)), Pvl::Replace); @@ -1016,7 +1016,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + atmName + " Atmospheric model requires a value for the WHA parameter."; message += "The normal range for WHA is: 0 < WHA < 1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } atmLog += toAtmPvl.findObject("AtmosphericModel") @@ -1036,7 +1036,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + atmName + " Atmospheric model requires a value for the NULNEG parameter."; message += "The valid values for NULNEG are: YES, NO"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } else if (!toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") @@ -1054,7 +1054,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + atmName + " Atmospheric model requires a value for the NULNEG parameter."; message += "The valid values for NULNEG are: YES, NO"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } atmLog += toAtmPvl.findObject("AtmosphericModel") @@ -1066,11 +1066,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("BHA")) { toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("BHA", toString(toDouble(parMap["BHA"]))), + .addKeyword(PvlKeyword("BHA", toString((parMap["BHA"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("BHA")) { QString keyval = ui.GetString("BHA"); - double bha = toDouble(keyval); + double bha = keyval.toDouble(); toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("BHA", toString(bha)), Pvl::Replace); @@ -1082,7 +1082,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + atmName + " Atmospheric model requires a value for the BHA parameter."; message += "The normal range for BHA is: -1 <= BHA <= 1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } atmLog += toAtmPvl.findObject("AtmosphericModel") @@ -1093,11 +1093,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("HGA")) { toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("HGA", toString(toDouble(parMap["HGA"]))), + .addKeyword(PvlKeyword("HGA", toString((parMap["HGA"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("HGA")) { QString keyval = ui.GetString("HGA"); - double hga = toDouble(keyval); + double hga = keyval.toDouble(); toAtmPvl.findObject("AtmosphericModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("HGA", toString(hga)), Pvl::Replace); @@ -1109,7 +1109,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + atmName + " Atmospheric model requires a value for the HGA parameter."; message += "The normal range for HGA is: -1 < HGA < 1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } atmLog += toAtmPvl.findObject("AtmosphericModel") @@ -1130,15 +1130,15 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { PvlObject fromPhtObj; PvlGroup fromPhtGrp; QString input = ui.GetFileName("FROMPVL"); - fromPhtPvl.read(input); + fromPhtPvl.read(input.toStdString()); if (fromPhtPvl.hasObject("PhotometricModel")) { fromPhtObj = fromPhtPvl.findObject("PhotometricModel"); if (fromPhtObj.hasGroup("Algorithm")) { PvlObject::PvlGroupIterator fromPhtGrp = fromPhtObj.beginGroup(); if (fromPhtGrp->hasKeyword("PHTNAME")) { - phtVal = (QString)fromPhtGrp->findKeyword("PHTNAME"); + phtVal = QString::fromStdString(fromPhtGrp->findKeyword("PHTNAME")); } else if (fromPhtGrp->hasKeyword("NAME")) { - phtVal = (QString)fromPhtGrp->findKeyword("NAME"); + phtVal = QString::fromStdString(fromPhtGrp->findKeyword("NAME")); } else { phtVal = "NONE"; } @@ -1156,9 +1156,9 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (fromPhtGrp->hasKeyword("PHTNAME") || fromPhtGrp->hasKeyword("NAME")) { if (fromPhtGrp->hasKeyword("PHTNAME")) { - phtVal = (QString)fromPhtGrp->findKeyword("PHTNAME"); + phtVal = QString::fromStdString(fromPhtGrp->findKeyword("PHTNAME")); } else if (fromPhtGrp->hasKeyword("NAME")) { - phtVal = (QString)fromPhtGrp->findKeyword("NAME"); + phtVal = QString::fromStdString(fromPhtGrp->findKeyword("NAME")); } else { phtVal = "NONE"; } @@ -1189,7 +1189,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { message += "you need to specify a Photometric model through the program " "interface."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } if (wasFound) { toPhtPvl.addObject(fromPhtObj); @@ -1198,7 +1198,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { toPhtPvl.findObject("PhotometricModel").addGroup(PvlGroup("Algorithm")); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("PHTNAME", phtName), Pvl::Replace); + .addKeyword(PvlKeyword("PHTNAME", phtName.toStdString()), Pvl::Replace); } } else { // Check to make sure that a photometric model was specified @@ -1211,25 +1211,25 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { message += "you need to specify a Photometric model through the program " "interface."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } toPhtPvl.addObject(PvlObject("PhotometricModel")); toPhtPvl.findObject("PhotometricModel").addGroup(PvlGroup("Algorithm")); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("PHTNAME", phtName), Pvl::Replace); + .addKeyword(PvlKeyword("PHTNAME", phtName.toStdString()), Pvl::Replace); } - phtLog += PvlKeyword("PHTNAME", phtName); + phtLog += PvlKeyword("PHTNAME", phtName.toStdString()); if (phtName == "HAPKEHEN" || phtName == "HAPKELEG") { if (parMap.contains("THETA")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("THETA", toString(toDouble(parMap["THETA"]))), + .addKeyword(PvlKeyword("THETA", toString((parMap["THETA"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("THETA")) { QString keyval = ui.GetString("THETA"); - double theta = toDouble(keyval); + double theta = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("THETA", toString(theta)), Pvl::Replace); @@ -1241,7 +1241,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the THETA parameter."; message += "The normal range for THETA is: 0 <= THETA <= 90"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1250,11 +1250,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("WH")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("WH", toString(toDouble(parMap["WH"]))), + .addKeyword(PvlKeyword("WH", toString((parMap["WH"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("WH")) { QString keyval = ui.GetString("WH"); - double wh = toDouble(keyval); + double wh = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("WH", toString(wh)), Pvl::Replace); @@ -1266,7 +1266,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the WH parameter."; message += "The normal range for WH is: 0 < WH <= 1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1275,11 +1275,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("HH")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("HH", toString(toDouble(parMap["HH"]))), + .addKeyword(PvlKeyword("HH", toString((parMap["HH"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("HH")) { QString keyval = ui.GetString("HH"); - double hh = toDouble(keyval); + double hh = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("HH", toString(hh)), Pvl::Replace); @@ -1291,7 +1291,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the HH parameter."; message += "The normal range for HH is: 0 <= HH"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1300,11 +1300,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("B0")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("B0", toString(toDouble(parMap["B0"]))), + .addKeyword(PvlKeyword("B0", toString((parMap["B0"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("B0")) { QString keyval = ui.GetString("B0"); - double b0 = toDouble(keyval); + double b0 = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("B0", toString(b0)), Pvl::Replace); @@ -1316,7 +1316,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the B0 parameter."; message += "The normal range for B0 is: 0 <= B0"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1336,7 +1336,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { " Photometric model requires a value for the " "ZEROB0STANDARD parameter."; message += "The valid values for ZEROB0STANDARD are: TRUE, FALSE"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } else if (ui.GetString("ZEROB0STANDARD") != "READFROMPVL") { if (ui.GetString("ZEROB0STANDARD") == "TRUE") { @@ -1355,9 +1355,9 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { .findGroup("Algorithm") .addKeyword(PvlKeyword("ZEROB0STANDARD", "TRUE"), Pvl::Replace); } - QString zerob0 = (QString)toPhtPvl.findObject("PhotometricModel") + QString zerob0 = QString::fromStdString(toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .findKeyword("ZEROB0STANDARD"); + .findKeyword("ZEROB0STANDARD")); QString izerob0 = zerob0; izerob0 = izerob0.toUpper(); if (izerob0 != "TRUE" && izerob0 != "FALSE") { @@ -1365,7 +1365,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { " Photometric model requires a value for the " "ZEROB0STANDARD parameter."; message += "The valid values for ZEROB0STANDARD are: TRUE, FALSE"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } phtLog += toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") @@ -1374,11 +1374,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("HG1")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("HG1", toString(toDouble(parMap["HG1"]))), + .addKeyword(PvlKeyword("HG1", toString((parMap["HG1"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("HG1")) { QString keyval = ui.GetString("HG1"); - double hg1 = toDouble(keyval); + double hg1 = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("HG1", toString(hg1)), Pvl::Replace); @@ -1390,7 +1390,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the HG1 parameter."; message += "The normal range for HG1 is: -1 < HG1 < 1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1399,11 +1399,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("HG2")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("HG2", toString(toDouble(parMap["HG2"]))), + .addKeyword(PvlKeyword("HG2", toString((parMap["HG2"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("HG2")) { QString keyval = ui.GetString("HG2"); - double hg2 = toDouble(keyval); + double hg2 = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("HG2", toString(hg2)), Pvl::Replace); @@ -1415,7 +1415,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the HG2 parameter."; message += "The normal range for HG2 is: 0 <= HG2 <= 1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1425,11 +1425,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("BH")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("BH", toString(toDouble(parMap["BH"]))), + .addKeyword(PvlKeyword("BH", toString((parMap["BH"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("BH")) { QString keyval = ui.GetString("BH"); - double bh = toDouble(keyval); + double bh = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("BH", toString(bh)), Pvl::Replace); @@ -1441,7 +1441,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the BH parameter."; message += "The normal range for BH is: -1 <= BH <= 1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1450,11 +1450,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("CH")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("CH", toString(toDouble(parMap["CH"]))), + .addKeyword(PvlKeyword("CH", toString((parMap["CH"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("CH")) { QString keyval = ui.GetString("CH"); - double ch = toDouble(keyval); + double ch = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("CH", toString(ch)), Pvl::Replace); @@ -1466,7 +1466,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the CH parameter."; message += "The normal range for CH is: -1 <= CH <= 1"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1478,13 +1478,13 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("PHASELIST")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("PHASELIST", parMap["PHASELIST"]), + .addKeyword(PvlKeyword("PHASELIST", parMap["PHASELIST"].toStdString()), Pvl::Replace); } else if (ui.WasEntered("PHASELIST")) { QString keyval = ui.GetString("PHASELIST"); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("PHASELIST", keyval), Pvl::Replace); + .addKeyword(PvlKeyword("PHASELIST", keyval.toStdString()), Pvl::Replace); } else { if (!toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") @@ -1492,7 +1492,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + phtName + " Photometric model requires a value for the PHASELIST parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1501,13 +1501,13 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("PHASECURVELIST")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("PHASECURVELIST", parMap["PHASECURVELIST"]), + .addKeyword(PvlKeyword("PHASECURVELIST", parMap["PHASECURVELIST"].toStdString()), Pvl::Replace); } else if (ui.WasEntered("PHASECURVELIST")) { QString keyval = ui.GetString("PHASECURVELIST"); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("PHASECURVELIST", keyval), Pvl::Replace); + .addKeyword(PvlKeyword("PHASECURVELIST", keyval.toStdString()), Pvl::Replace); } else { if (!toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") @@ -1515,7 +1515,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + phtName + " Photometric model requires a value for the " "PHASECURVELIST parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1525,12 +1525,12 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("LLIST")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("LLIST", parMap["LLIST"]), Pvl::Replace); + .addKeyword(PvlKeyword("LLIST", parMap["LLIST"].toStdString()), Pvl::Replace); } else if (ui.WasEntered("LLIST")) { QString keyval = ui.GetString("LLIST"); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("LLIST", keyval), Pvl::Replace); + .addKeyword(PvlKeyword("LLIST", keyval.toStdString()), Pvl::Replace); } else { if (!toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") @@ -1538,7 +1538,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + phtName + " Photometric model requires a value for the LLIST parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1548,12 +1548,12 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("KLIST")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("KLIST", parMap["KLIST"]), Pvl::Replace); + .addKeyword(PvlKeyword("KLIST", parMap["KLIST"].toStdString()), Pvl::Replace); } else if (ui.WasEntered("KLIST")) { QString keyval = ui.GetString("KLIST"); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("KLIST", keyval), Pvl::Replace); + .addKeyword(PvlKeyword("KLIST", keyval.toStdString()), Pvl::Replace); } else { if (!toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") @@ -1561,7 +1561,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { QString message = "The " + phtName + " Photometric model requires a value for the KLIST parameter."; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1572,11 +1572,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("L")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("L", toString(toDouble(parMap["L"]))), + .addKeyword(PvlKeyword("L", toString((parMap["L"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("L")) { QString keyval = ui.GetString("L"); - double l = toDouble(keyval); + double l = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("L", toString(l)), Pvl::Replace); @@ -1588,7 +1588,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the L parameter."; message += "The L parameter has no limited range"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1598,11 +1598,11 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { if (parMap.contains("K")) { toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") - .addKeyword(PvlKeyword("K", toString(toDouble(parMap["K"]))), + .addKeyword(PvlKeyword("K", toString((parMap["K"]).toDouble())), Pvl::Replace); } else if (ui.WasEntered("K")) { QString keyval = ui.GetString("K"); - double k = toDouble(keyval); + double k = keyval.toDouble(); toPhtPvl.findObject("PhotometricModel") .findGroup("Algorithm") .addKeyword(PvlKeyword("K", toString(k)), Pvl::Replace); @@ -1614,7 +1614,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { "The " + phtName + " Photometric model requires a value for the K parameter."; message += "The normal range for K is: 0 <= K"; - throw IException(IException::User, message, _FILEINFO_); + throw IException(IException::User, message.toStdString(), _FILEINFO_); } } phtLog += toPhtPvl.findObject("PhotometricModel") @@ -1652,7 +1652,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { " Normalized model is not recommended for use with the " + angleSource + " Angle Source option"; PvlGroup warning("Warnings"); - warning.addKeyword(PvlKeyword("Warning", message)); + warning.addKeyword(PvlKeyword("Warning", message.toStdString())); Application::AppendAndLog(warning, appLog); } // Get camera information if needed @@ -1670,7 +1670,7 @@ void photomet(Cube *icube, UserInterface &ui, Pvl *appLog) { p.SetOutputCube(ui.GetCubeName("TO"), att); Pvl inLabel; - inLabel.read(ui.GetCubeName("FROM")); + inLabel.read(ui.GetCubeName("FROM").toStdString()); // If the source of photometric angles is the center of the image, // then get the angles at the center of the image. diff --git a/isis/src/base/apps/pixel2map/main.cpp b/isis/src/base/apps/pixel2map/main.cpp index ef3e5a1765..62d4ec61bd 100755 --- a/isis/src/base/apps/pixel2map/main.cpp +++ b/isis/src/base/apps/pixel2map/main.cpp @@ -40,13 +40,10 @@ void PrintMap() { UserInterface &ui = Application::GetUserInterface(); // Get mapping group from map file - Pvl userMap(ui.GetFileName("MAP")); + Pvl userMap(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); //Write map file out to the log // Isis::Application::GuiLog(userGrp); -} // PrintMap - - - +} // PrintMap \ No newline at end of file diff --git a/isis/src/base/apps/pixel2map/pixel2map.cpp b/isis/src/base/apps/pixel2map/pixel2map.cpp index 70e0b4dc19..d5e221538d 100644 --- a/isis/src/base/apps/pixel2map/pixel2map.cpp +++ b/isis/src/base/apps/pixel2map/pixel2map.cpp @@ -29,17 +29,17 @@ namespace Isis { void pixel2map(UserInterface &ui, Pvl *appLog){ - Pvl userMap(ui.GetFileName("MAP")); + Pvl userMap(ui.GetFileName("MAP").toStdString()); PvlGroup &userGrp = userMap.findGroup("Mapping", Pvl::Traverse); FileList list; if (ui.GetString("FROMTYPE") == "FROM") { // GetAsString will capture the entire string, including attributes - list.push_back(FileName(ui.GetAsString("FROM"))); + list.push_back(FileName(ui.GetAsString("FROM").toStdString())); } else { try { - list.read(ui.GetFileName("FROMLIST")); + list.read(ui.GetFileName("FROMLIST").toStdString()); } catch (IException &e) { throw IException(e); @@ -72,7 +72,7 @@ namespace Isis { vector lame = atts0.bands(); icube.setVirtualBands(lame); } - icube.open( list[i].toString() ); + icube.open( QString::fromStdString(list[i].toString()) ); bands = icube.bandCount(); g_incam = icube.camera(); @@ -81,18 +81,18 @@ namespace Isis { // Preparing the OGC IAU code for the vector data being generated Spice spi(icube); - ogc_SRS = "IAU:" + Isis::toString(spi.target()->naifBodyCode()) + "00"; + ogc_SRS = "IAU:" + QString::number(spi.target()->naifBodyCode()) + "00"; // Make sure it is not the sky if (g_incam->target()->isSky()) { - QString msg = "The image [" + list[i].toString() + + std::string msg = "The image [" + list[i].toString() + "] is targeting the sky, use skymap instead."; throw IException(IException::User, msg, _FILEINFO_); } // Make sure all the bands for all the files match if (i >= 1 && atts0.bandsString() != lastBandString) { - QString msg = "The Band numbers for all the files do not match."; + std::string msg = "The Band numbers for all the files do not match."; throw IException(IException::User, msg, _FILEINFO_); } else { @@ -230,7 +230,7 @@ namespace Isis { vector lame = atts0.bands(); icube.setVirtualBands(lame); } - icube.open( list.back().toString() ); + icube.open( QString::fromStdString(list.back().toString()) ); g_incam = icube.camera(); if (g_incam->IntersectsLongitudeDomain(userMap)) { @@ -275,7 +275,7 @@ namespace Isis { else if (ui.GetString("LONSEAM") == "ERROR") { QString msg = "The image [" + ui.GetCubeName("FROM") + "] crosses the " + "longitude seam"; - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } } @@ -328,11 +328,11 @@ namespace Isis { Cube cube(list[f].toString(), "r"); // Loop through the input cube and get the all pixels values for all bands ProcessByBrick processBrick; - processBrick.Progress()->SetText("Working on file: " + list[f].toString()); + processBrick.Progress()->SetText("Working on file: " + QString::fromStdString(list[f].toString())); processBrick.SetBrickSize(1, 1, bands); // Recall list[f] is a FileName, which stores the attributes CubeAttributeInput atts0(list[f]); - Cube *icube = processBrick.SetInputCube(list[f].toString(), atts0, 0); + Cube *icube = processBrick.SetInputCube(QString::fromStdString(list[f].toString()), atts0, 0); g_incam = icube->camera(); if ( ui.WasEntered("TO") ) { @@ -343,15 +343,15 @@ namespace Isis { ofstream fout_vrt; - QString outFileNameVRT = FileName( outvect.toLatin1().data() ).removeExtension().addExtension("vrt").expanded(); - QString layer_name = FileName( outvect.toLatin1().data() ).baseName(); - QString csv_fname = FileName( outvect.toLatin1().data() ).name(); + std::string outFileNameVRT = FileName( outvect.toLatin1().data() ).removeExtension().addExtension("vrt").expanded(); + std::string layer_name = FileName( outvect.toLatin1().data() ).baseName(); + std::string csv_fname = FileName( outvect.toLatin1().data() ).name(); - fout_vrt.open( outFileNameVRT.toLatin1().data() ); + fout_vrt.open( outFileNameVRT.c_str() ); fout_vrt << "" << endl; - fout_vrt << " " << endl; - fout_vrt << " " << csv_fname.toLatin1().data() << "" << endl; + fout_vrt << " " << endl; + fout_vrt << " " << csv_fname.c_str() << "" << endl; fout_vrt << " wkbPolygon" << endl; fout_vrt << " "<< ogc_SRS.toLatin1().data() << "" << endl; fout_vrt << " "<< endl; @@ -382,12 +382,12 @@ namespace Isis { // When there is only one input cube, we want to propagate IsisCube labels to output cubes if (list.size() == 1) { // Note that polygons and original labels are not propagated - g_processGroundPolygons.PropagateLabels(list[0].toString()); + g_processGroundPolygons.PropagateLabels(QString::fromStdString(list[0].toString())); // Tell Process which tables we want to propagate QList tablesToPropagate; tablesToPropagate << "InstrumentPointing" << "InstrumentPosition" << "BodyRotation" << "SunPosition"; - g_processGroundPolygons.PropagateTables(list[0].toString(), tablesToPropagate); + g_processGroundPolygons.PropagateTables(QString::fromStdString(list[0].toString()), tablesToPropagate); } } g_processGroundPolygons.EndProcess(); diff --git a/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp b/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp index e66b4369bc..6767a13154 100644 --- a/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp +++ b/isis/src/base/objs/CameraStatistics/CameraStatistics.cpp @@ -367,7 +367,7 @@ namespace Isis { // Set up the Pvl groups and get min, max, avg, and sd for each statstics // object PvlGroup pUser("UserParameters"); - if (m_filename != "") pUser += PvlKeyword("Filename", m_filename); + if (m_filename != "") pUser += PvlKeyword("Filename", m_filename.toStdString()); pUser += PvlKeyword("Linc", toString(m_linc)); pUser += PvlKeyword("Sinc", toString(m_sinc)); diff --git a/isis/src/base/objs/Cube/Cube.cpp b/isis/src/base/objs/Cube/Cube.cpp index bd45ffb557..f5de237b98 100644 --- a/isis/src/base/objs/Cube/Cube.cpp +++ b/isis/src/base/objs/Cube/Cube.cpp @@ -100,7 +100,7 @@ namespace Isis { fromLabel(fileName, label, access); PvlGroup &instGrp = label.findGroup("Instrument", Pvl::Traverse); - if (isd.contains("line_scan_rate") && (QString)instGrp["InstrumentId"] == "HRSC") { + if (isd.contains("line_scan_rate") && (std::string)instGrp["InstrumentId"] == "HRSC") { attachLineScanTableFromIsd(isd); } diff --git a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp index 2ab20f509d..44b89b771e 100644 --- a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp +++ b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp @@ -46,9 +46,9 @@ namespace Isis { } PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory"); - QString tempDir = dataDir["Temporary"]; + QString tempDir = QString::fromStdString(dataDir["Temporary"]); - QString command = program.expanded() + " " + parameters + + std::string command = program.expanded() + " " + parameters.toStdString() + " -pid=" + toString(getpid()); if(!isIsisProgram) { @@ -69,7 +69,7 @@ namespace Isis { QProcess childProcess; childProcess.setProcessEnvironment(env); childProcess.setProcessChannelMode(QProcess::ForwardedChannels); - childProcess.start("bash", QStringList() << "-c" << command); + childProcess.start("bash", QStringList() << "-c" << QString::fromStdString(command)); childProcess.waitForStarted(); bool connected = false; diff --git a/isis/src/base/objs/Reduce/Reduce.cpp b/isis/src/base/objs/Reduce/Reduce.cpp index 79ada1a62c..9fc1ad4ff3 100644 --- a/isis/src/base/objs/Reduce/Reduce.cpp +++ b/isis/src/base/objs/Reduce/Reduce.cpp @@ -209,7 +209,7 @@ namespace Isis { mdNpts[osamp] += 1.0; } if (IsSpecial((*m_iPortal)[isamp-1])) { - specialPixelCounts[osamp][PixelToString((*m_iPortal)[isamp-1])]++; + specialPixelCounts[osamp][QString::fromStdString(PixelToString((*m_iPortal)[isamp-1]))]++; } isamp++; } @@ -226,9 +226,9 @@ namespace Isis { } } if (IsSpecial((*m_iPortal)[isamp-1])) { - specialPixelCounts[osamp][PixelToString((*m_iPortal)[isamp-1])]++; + specialPixelCounts[osamp][QString::fromStdString(PixelToString((*m_iPortal)[isamp-1]))]++; if(osamp+1 <= miOutputSamples){ - specialPixelCounts[osamp+1][PixelToString((*m_iPortal)[isamp-1])]++; + specialPixelCounts[osamp+1][QString::fromStdString(PixelToString((*m_iPortal)[isamp-1]))]++; } } isamp++; @@ -252,7 +252,7 @@ namespace Isis { mdNpts2[osamp] += ldel; } if (IsSpecial((*m_iPortal)[isamp-1])) { - specialPixelCounts[osamp][PixelToString((*m_iPortal)[isamp-1])]++; + specialPixelCounts[osamp][QString::fromStdString(PixelToString((*m_iPortal)[isamp-1]))]++; } isamp++; } @@ -274,9 +274,9 @@ namespace Isis { } } if (IsSpecial((*m_iPortal)[isamp-1])) { - specialPixelCounts[osamp][PixelToString((*m_iPortal)[isamp-1])]++; + specialPixelCounts[osamp][QString::fromStdString(PixelToString((*m_iPortal)[isamp-1]))]++; if(osamp+1 <= miOutputSamples){ - specialPixelCounts[osamp+1][PixelToString((*m_iPortal)[isamp-1])]++; + specialPixelCounts[osamp+1][QString::fromStdString(PixelToString((*m_iPortal)[isamp-1]))]++; } } isamp++; @@ -299,7 +299,7 @@ namespace Isis { auto mode = std::max_element(specialPixelCounts[osamp].begin(), specialPixelCounts[osamp].end(), [](const pair &a, const pair &b) {return a.second < b.second;}); - out[osamp] = StringToPixel(mode->first); + out[osamp] = StringToPixel(mode->first.toStdString()); } else { out[osamp] = Isis::Null; diff --git a/isis/src/base/objs/Strategy/Strategy.cpp b/isis/src/base/objs/Strategy/Strategy.cpp index 5b64fdb687..e43a0f19f5 100644 --- a/isis/src/base/objs/Strategy/Strategy.cpp +++ b/isis/src/base/objs/Strategy/Strategy.cpp @@ -727,12 +727,12 @@ namespace Isis { if ( !geom.isEmpty() ) { // Get decision keys - bool repairGeom = toBool(keys.get("RepairInvalidGeometry", "true")); + bool repairGeom = toBool(keys.get("RepairInvalidGeometry", "true").toStdString()); QString geomAction = keys.get("InvalidGeometryAction", "disable").toLower(); if ( !QString("disable error continue").contains(geomAction) ) { if ( isDebug() ) { - cout << " Invalid value for InvalidGeometryAction (" << geomAction + cout << " Invalid value for InvalidGeometryAction (" << geomAction.toStdString() << ") - set to disable!\n"; } geomAction = "disable"; @@ -757,7 +757,7 @@ namespace Isis { QScopedPointer geosgeom(new GisGeometry(geom, GisGeometry::type(gisType))); if ( geosgeom.isNull() ) { if ( isDebug() ) { - cout << resource->name() << " geometry failed to construct\n"; + cout << resource->name().toStdString() << " geometry failed to construct\n"; } if ("continue" == geomAction) return (false); if ( "disable" == geomAction ) { @@ -766,7 +766,7 @@ namespace Isis { } // Throw an error - QString mess = resource->name() + " failed to construct geometry!"; + std::string mess = resource->name().toStdString() + " failed to construct geometry!"; throw IException(IException::Programmer, mess, _FILEINFO_); } @@ -775,13 +775,13 @@ namespace Isis { QString geomError = geosgeom->isValidReason(); if ( isDebug() ) { - cout << " Geometry error: " << geomError << "\n"; + cout << " Geometry error: " << geomError.toStdString() << "\n"; } // Attempt repair if requested if ( repairGeom ) { if (isDebug()) { - cout << " " << resource->name() << " geometry is invalid..." + cout << " " << resource->name().toStdString() << " geometry is invalid..." << "attempting buffer(0) to fix it!\n"; } geosgeom.reset( geosgeom->buffer(0) ); @@ -811,7 +811,7 @@ namespace Isis { // Throw an error QString mess = resource->name() + " failed to construct geometry - Error: " + geomError; - throw IException(IException::Programmer, mess, _FILEINFO_); + throw IException(IException::Programmer, mess.toStdString(), _FILEINFO_); } } diff --git a/isis/src/base/objs/Strategy/unitTest.cpp b/isis/src/base/objs/Strategy/unitTest.cpp index f3a37e8481..270343311c 100644 --- a/isis/src/base/objs/Strategy/unitTest.cpp +++ b/isis/src/base/objs/Strategy/unitTest.cpp @@ -830,7 +830,7 @@ void IsisMain() { qDebug() << polygeomsNoRepairActionError.importGeometryA(poly1,polygons); } catch(IException &e){ - qDebug() << e.toString() << Qt::endl; + qDebug() << QString::fromStdString(e.toString()) << Qt::endl; } // Reactivate polygon and rerun test with InvalidGeometryAction diff --git a/isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp b/isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp index 22ecd5921b..36e5b2a1ca 100644 --- a/isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp +++ b/isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp @@ -37,7 +37,7 @@ namespace Isis { m_instrumentNameShort = "EIS-PBWAC"; } else { - QString msg = "Unable to construct Clipper Push Broom camera model. " + std::string msg = "Unable to construct Clipper Push Broom camera model. " "Unrecognized NaifFrameCode [" + toString(frameCode) + "]."; throw IException(IException::User, msg, _FILEINFO_); } @@ -47,16 +47,16 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse); - QString key = "INS" + toString(naifIkCode()) + "_" + bandBin["FilterName"][0] + "_FOCAL_LENGTH"; + QString key = "INS" + QString::number(naifIkCode()) + "_" + QString::fromStdString(bandBin["FilterName"][0]) + "_FOCAL_LENGTH"; SetFocalLength(Spice::getDouble(key)); SetPixelPitch(); PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); - QString startTime = inst["StartTime"]; + QString startTime = QString::fromStdString(inst["StartTime"]); iTime etStart(startTime); - ReadLineRates(lab.fileName()); + ReadLineRates(QString::fromStdString(lab.fileName())); // set up detector map new VariableLineScanCameraDetectorMap(this, p_lineRates); diff --git a/isis/src/control/apps/jigsaw/jigsaw.cpp b/isis/src/control/apps/jigsaw/jigsaw.cpp index 925329a1a5..4a3d100b6e 100644 --- a/isis/src/control/apps/jigsaw/jigsaw.cpp +++ b/isis/src/control/apps/jigsaw/jigsaw.cpp @@ -114,8 +114,8 @@ namespace Isis { if (log) { PvlGroup gp("JigsawResults"); - gp += PvlKeyword("Status", "Bundle adjustment values from [" + ui.GetFileName("ADJUSTMENT_INPUT") - + "] were applied to the cubes in [" + cubeList+ "]"); + gp += PvlKeyword("Status", "Bundle adjustment values from [" + ui.GetFileName("ADJUSTMENT_INPUT").toStdString() + + "] were applied to the cubes in [" + cubeList.toStdString() + "]"); Application::AppendAndLog(gp, log); } diff --git a/isis/src/core/src/PvlKeyword.cpp b/isis/src/core/src/PvlKeyword.cpp index a51c26e2c0..61797d9baf 100644 --- a/isis/src/core/src/PvlKeyword.cpp +++ b/isis/src/core/src/PvlKeyword.cpp @@ -1414,7 +1414,7 @@ namespace Isis { Now check if it's a reserved keyword that is valueless */ bool allowedValueless = false; - static const std::vector reservedKeywordNames = {"OBJECT", + static const std::vector reservedKeywordNames = {"OBJECT", "BEGIN_OBJECT", "END_OBJECT", "ENDOBJECT", @@ -1422,7 +1422,8 @@ namespace Isis { "END_GROUP", "ENDGROUP", "END"}; - const QString keywordNameUpper = keywordName.toUpper(); + std::string keywordNameUpper = keywordName; + std::transform(keywordNameUpper.begin(), keywordNameUpper.end(), keywordNameUpper.begin(), ::toupper); for (const auto &reservedKeywordName : reservedKeywordNames) { if (keywordNameUpper == reservedKeywordName) { allowedValueless = true; diff --git a/isis/src/core/tests/unitTests/FileName/unitTest.cpp b/isis/src/core/tests/unitTests/FileName/unitTest.cpp index 67de80a4e0..c5115be1d4 100644 --- a/isis/src/core/tests/unitTests/FileName/unitTest.cpp +++ b/isis/src/core/tests/unitTests/FileName/unitTest.cpp @@ -8,6 +8,7 @@ find files of those names at the top level of this repository. **/ #include #include #include +#include #include "FileName.h" #include "IException.h" diff --git a/isis/src/lro/apps/lronaccal/lronaccal.cpp b/isis/src/lro/apps/lronaccal/lronaccal.cpp index 826ac08b7c..efddf4f912 100644 --- a/isis/src/lro/apps/lronaccal/lronaccal.cpp +++ b/isis/src/lro/apps/lronaccal/lronaccal.cpp @@ -493,7 +493,7 @@ namespace Isis { TextFile file(QString::fromStdString(filename.expanded())); QString lineString; while(file.GetLine(lineString)) { - data.push_back(toDouble(lineString.split(QRegExp("[ ,;]")).first())); + data.push_back(lineString.split(QRegExp("[ ,;]")).first().toDouble()); } fileString = QString::fromStdString(filename.original()); } diff --git a/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp b/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp index 1c7d03c03c..452e37b13c 100644 --- a/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp +++ b/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp @@ -736,7 +736,7 @@ namespace Isis { // Determine instrument ID (inst) PvlKeyword &key = _label.findKeyword("NaifIkCode", PvlObject::Traverse); - QString iCode = key[0]; + QString iCode = QString::fromStdString(key[0]); key = _label.findKeyword("Number", PvlObject::Traverse); // Get CK time tolerance (tol) diff --git a/isis/src/mex/objs/HrscCamera/HrscCamera.cpp b/isis/src/mex/objs/HrscCamera/HrscCamera.cpp index e50fa79bee..5493009aa7 100644 --- a/isis/src/mex/objs/HrscCamera/HrscCamera.cpp +++ b/isis/src/mex/objs/HrscCamera/HrscCamera.cpp @@ -127,7 +127,7 @@ namespace Isis { if(timesTable.Records() <= 0) { QString msg = "Table [LineScanTimes] in ["; msg += cube.fileName() + "] must not be empty"; - throw IException(IException::Unknown, msg, _FILEINFO_); + throw IException(IException::Unknown, msg.toStdString(), _FILEINFO_); } for(int i = 0; i < timesTable.Records(); i++) { @@ -139,7 +139,7 @@ namespace Isis { if(p_lineRates.size() <= 0) { QString msg = "There is a problem with the data within the Table "; msg += "[LineScanTimes] in [" + cube.fileName() + "]"; - throw IException(IException::Unknown, msg, _FILEINFO_); + throw IException(IException::Unknown, msg.toStdString(), _FILEINFO_); } } } diff --git a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp index 00e0f850c2..a47e1d4255 100644 --- a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp +++ b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp @@ -50,12 +50,12 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // Use a regular Process Process p; - QString to = FileName(ui.GetFileName("TO")).expanded(); + QString to = QString::fromStdString(FileName(ui.GetFileName("TO").toStdString()).expanded()); double HRSCNadirCenterTime = ui.GetDouble("HRSC_NADIRCENTERTIME"); if (input->isProjected()) { - QString msg = + std::string msg = "Input images is a map projected cube ... not a level 1 image"; throw IException(IException::User, msg, _FILEINFO_); } @@ -246,7 +246,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { intTime = lrc.GetLineScanRate(); } if (numIntTimes <= 0) { - QString msg = "HRSC: Invalid number of scan times"; + std::string msg = "HRSC: Invalid number of scan times"; throw IException(IException::Programmer, msg, _FILEINFO_); } else scanDuration = GetHRSCScanDuration(lineRates, totalLines); @@ -852,14 +852,14 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { int GetHRSCLineRates(Cube *cube, vector &lineRates, int &dtotalLines, double &HRSCNadirCenterTime) { - FileName cubefname = cube->fileName(); + FileName cubefname = cube->fileName().toStdString(); QTemporaryDir prefix; - FileName tablefname = FileName(prefix.path() + "/tabledump.txt"); + FileName tablefname = FileName(prefix.path().toStdString() + "/tabledump.txt"); // system call to ISIS function tabledump to dump LineScanTimes char syscmd[1056]; snprintf(syscmd, sizeof(syscmd), "tabledump from=%s to=%s name=LineScanTimes", - cubefname.expanded().toLatin1().data(), tablefname.expanded().toLatin1().data()); + cubefname.expanded().c_str(), tablefname.expanded().c_str()); int n = system(syscmd); @@ -869,7 +869,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // HrscCamera::ReadLineRates(IString filename) is private // open tabledump.txt for reading - ifstream fpIn(tablefname.expanded().toLatin1().data(), ifstream::in); + ifstream fpIn(tablefname.expanded().c_str(), ifstream::in); if (!fpIn) return -1; Camera *cam = cube->camera(); @@ -903,7 +903,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // get alpha cube start line PvlGroup alphacube = cube->group("AlphaCube"); - QString str = (QString)alphacube["AlphaStartingLine"]; + QString str = QString::fromStdString(alphacube["AlphaStartingLine"]); double dAlphaStartLine = atof(str.toLatin1().data()); double dAlphaLastLine = dAlphaStartLine + dtotalLines; cam->SetImage(1, 0.5); diff --git a/isis/src/system/apps/isisdataeval/isisdataeval.cpp b/isis/src/system/apps/isisdataeval/isisdataeval.cpp index 9862348811..c5e7e18640 100644 --- a/isis/src/system/apps/isisdataeval/isisdataeval.cpp +++ b/isis/src/system/apps/isisdataeval/isisdataeval.cpp @@ -295,7 +295,7 @@ namespace Isis { if (!std::filesystem::is_directory(filepath)) { // Check for symbolic links - if ( dbfile.isSymbolicLink() ) { + if ( dbfile.second.isSymbolicLink() ) { QString symtarget = dbfile.second.info().symLinkTarget(); DBFileStatus symfile( symtarget ); diff --git a/isis/tests/CubeTests.cpp b/isis/tests/CubeTests.cpp index 3dfd417a55..328a088b07 100644 --- a/isis/tests/CubeTests.cpp +++ b/isis/tests/CubeTests.cpp @@ -788,7 +788,7 @@ TEST(CubeTest, TestCubeAttachLineScanTableFromIsd) { QTemporaryFile tempFile; Cube testCube; - testCube.fromIsd(tempFile.fileName() + ".cub", label, isd, "rw"); + testCube.fromIsd(tempFile.fileName().toStdString() + ".cub", label, isd, "rw"); PvlGroup kernels = testCube.group("Kernels"); @@ -839,11 +839,11 @@ TEST_F(TempTestingFiles, TestCubeCreateWriteCopy) { // Copy returns the resulting Cube, we don't care about it (but we need it to flush) so delete QString file2 = tempDir.path() + "/IsisCube_01.cub"; - delete out.copy(file2, CubeAttributeOutput()); + delete out.copy(file2.toStdString(), CubeAttributeOutput()); out.close(); // Test the open and read methods - Cube in(file2); + Cube in(file2.toStdString()); check_cube(in, file2, 150, 200, 2, 0, 1, 7, 1, 1, 1, 1, 0, 6563); LineManager inLine(in); @@ -997,8 +997,7 @@ TEST_F(SmallCube, TestCubeNegativeHistStatsBand) { FAIL() << "Expected an exception to be thrown"; } catch (IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Invalid band in [CubeInfo::Histogram]")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Invalid band in [CubeInfo::Histogram]") != std::string::npos); } try { @@ -1006,8 +1005,7 @@ TEST_F(SmallCube, TestCubeNegativeHistStatsBand) { FAIL() << "Expected an exception to be thrown"; } catch (IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Invalid band in [CubeInfo::Statistics]")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Invalid band in [CubeInfo::Statistics]") != std::string::npos); } } @@ -1018,8 +1016,7 @@ TEST(CubeTest, TestCubeNoHistStats) { FAIL() << "Expected an exception to be thrown"; } catch (IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Cannot create histogram object for an unopened cube")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot create histogram object for an unopened cube") != std::string::npos); } try { @@ -1027,8 +1024,7 @@ TEST(CubeTest, TestCubeNoHistStats) { FAIL() << "Expected an exception to be thrown"; } catch (IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Cannot create statistics object for an unopened cube")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot create statistics object for an unopened cube") != std::string::npos); } } @@ -1071,8 +1067,7 @@ TEST_F(SmallCube, TestCubeAlreadyOpenOpen) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("You already have a cube opened.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("You already have a cube opened.") != std::string::npos); } } @@ -1082,8 +1077,7 @@ TEST_F(SmallCube, TestCubeAlreadyOpenCreate) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("You already have a cube opened.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("You already have a cube opened.") != std::string::npos); } } @@ -1105,8 +1099,7 @@ TEST_F(TempTestingFiles, TestCubeWriteToReadOnly) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Cannot write to the cube [IsisCube_00.cub] because it is opened read-only.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot write to the cube [IsisCube_00.cub] because it is opened read-only.") != std::string::npos); } } @@ -1117,8 +1110,7 @@ TEST(CubeTest, TestCubeOpenNonexistentCube) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to open [blah].")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to open [blah].") != std::string::npos); } } @@ -1135,8 +1127,7 @@ TEST_F(SmallCube, TestCubePhyscialBandOutOfBounds) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Out of array bounds [6].")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Out of array bounds [6].") != std::string::npos); } try { @@ -1144,8 +1135,7 @@ TEST_F(SmallCube, TestCubePhyscialBandOutOfBounds) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Out of array bounds [0].")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Out of array bounds [0].") != std::string::npos); } } @@ -1158,8 +1148,7 @@ TEST(CubeTest, TestCubeReadBlankCube) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Try opening a file before you read it.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Try opening a file before you read it.") != std::string::npos); } } @@ -1176,8 +1165,7 @@ TEST(CubeTest, TestCubeWriteBlankCube) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Tried to write to a cube before opening/creating it.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Tried to write to a cube before opening/creating it.") != std::string::npos); } } @@ -1189,8 +1177,7 @@ TEST_F(TempTestingFiles, TestCubeCreateZeroDimCube) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Number of samples [0], lines [0], or bands [0] cannot be less than 1.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Number of samples [0], lines [0], or bands [0] cannot be less than 1.") != std::string::npos); } } @@ -1204,8 +1191,7 @@ TEST_F(TempTestingFiles, TestCubeCreateSmallLabel) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Label space is full in [IsisCube_00.cub] unable to write labels.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Label space is full in [IsisCube_00.cub] unable to write labels.") != std::string::npos); } } @@ -1218,14 +1204,13 @@ TEST_F(TempTestingFiles, TestCubeCreateTooBig) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("The cube you are attempting to create [IsisCube_00.cub] is [33527GB]. " + EXPECT_TRUE(e.toString().find("The cube you are attempting to create [IsisCube_00.cub] is [33527GB]. " "This is larger than the current allowed size of [12GB]. The cube " "dimensions were (S,L,B) [1000000, 1000000, 9] with [4] bytes per pixel. " "If you still wish to create this cube, the maximum value can be changed " "in your personal preference file located in [~/.Isis/IsisPreferences] " "within the group CubeCustomization, keyword MaximumSize. If you do not have " - "an ISISPreference file, please refer to the documentation 'Environment and Preference Setup'. Error.")) - << e.toString().toStdString(); + "an ISISPreference file, please refer to the documentation 'Environment and Preference Setup'. Error.") != std::string::npos); } } @@ -1236,8 +1221,7 @@ TEST_F(SmallCube, TestCubeOpenBadAccessor) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unknown value for access [a]. Expected 'r' or 'rw'.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unknown value for access [a]. Expected 'r' or 'rw'.") != std::string::npos); } } @@ -1248,8 +1232,7 @@ TEST(CubeTest, TestCubeInvalidDimSamples) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("SetDimensions: Invalid number of sample, lines or bands.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("SetDimensions: Invalid number of sample, lines or bands.") != std::string::npos); } } @@ -1260,8 +1243,7 @@ TEST(CubeTest, TestCubeInvalidDimLines) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("SetDimensions: Invalid number of sample, lines or bands.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("SetDimensions: Invalid number of sample, lines or bands.") != std::string::npos); } } @@ -1272,8 +1254,7 @@ TEST(CubeTest, TestCubeInvalidDimBands) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("SetDimensions: Invalid number of sample, lines or bands.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("SetDimensions: Invalid number of sample, lines or bands.") != std::string::npos); } } @@ -1286,8 +1267,7 @@ TEST(CubeTest, TestCubeNonePixelType) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Cannot create the cube [IsisCube_00.cub] with a pixel type set to None.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot create the cube [IsisCube_00.cub] with a pixel type set to None.") != std::string::npos); } } @@ -1301,18 +1281,17 @@ TEST_F(TempTestingFiles, TestCubeAddGroupReadOnly) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Cannot add a group to the label of cube [IsisCube_00.cub] because it is opened read-only.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot add a group to the label of cube [IsisCube_00.cub] because it is opened read-only.") != std::string::npos); } } TEST_F(SmallCube, TestCubeCreateECube) { Cube localTestCube; QString path = testCube->fileName(); - localTestCube.setExternalDnData(path); + localTestCube.setExternalDnData(path.toStdString()); localTestCube.create(tempDir.path() + "/isisTruth_external.ecub"); localTestCube.putGroup(PvlGroup("TestGroup")); - EXPECT_EQ(localTestCube.realDataFileName().expanded(), path); + EXPECT_EQ(localTestCube.realDataFileName().expanded(), path.toStdString()); EXPECT_TRUE(localTestCube.hasGroup("TestGroup")); path = localTestCube.fileName(); @@ -1326,7 +1305,7 @@ class ECube : public SmallCube { void SetUp() override { SmallCube::SetUp(); testECube = new Cube(); - testECube->setExternalDnData(testCube->fileName()); + testECube->setExternalDnData(testCube->fileName().toStdString()); QString path = tempDir.path() + "/external.ecub"; testECube->create(path); @@ -1350,10 +1329,10 @@ TEST_F(ECube, TestCubeCreateECubeFromECube) { QString path1 = testECube->fileName(); Cube localTestCube; - localTestCube.setExternalDnData(path1); + localTestCube.setExternalDnData(path1.toStdString()); QString path2 = tempDir.path() + "/isisTruth_external2.ecub"; localTestCube.create(path2); - EXPECT_EQ(localTestCube.realDataFileName().expanded(), testCube->fileName()); + EXPECT_EQ(localTestCube.realDataFileName().expanded(), testCube->fileName().toStdString()); check_cube(localTestCube, path2, 10, 10, 10, 0, 1, 7, 2, 1, 1, 0, 1, 65536); } @@ -1379,8 +1358,7 @@ TEST_F(ECube, TestCubeECubeWrite) { FAIL(); } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("The cube [external.ecub] does not support storing DN data because it is using an external file for DNs.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("The cube [external.ecub] does not support storing DN data because it is using an external file for DNs.") != std::string::npos); } } @@ -1388,7 +1366,7 @@ TEST_F(ECube, TestCubeECubeFromECubeRead) { QString path1 = testECube->fileName(); Cube localTestCube; - localTestCube.setExternalDnData(path1); + localTestCube.setExternalDnData(path1.toStdString()); QString path2 = tempDir.path() + "/isisTruth_external2.ecub"; localTestCube.create(path2); diff --git a/isis/tests/Fixtures.cpp b/isis/tests/Fixtures.cpp index 4035884b27..600054524c 100644 --- a/isis/tests/Fixtures.cpp +++ b/isis/tests/Fixtures.cpp @@ -103,238 +103,4 @@ namespace Isis { historyBlob = Blob("IsisCube", "History"); historyBlob.setData(histStr.c_str(), histStr.size()); } - - void RawPvlKeywords::SetUp() { - keywordsToTry = { - "KEYWORD", - "KEYWORD X", - "KEYWORD =", - "KEYWORD = SOME_VAL", - "KEYWORD = \" val \"", - "KEYWORD = \" 'val' \"", - "KEYWORD = (VAL", - "KEYWORD = (VAL1,VAL2", - "KEYWORD = (A B,C,D)", - "KEYWORD = ((A B),(C),(D", - "KEYWORD = (SOME_VAL)", - "KEYWORD = (SOME_VAL) ", - "KEYWORD=(SOME_VAL)", - "KEYWORD = (A, )", - "KEYWORD = ()", - "KEYWORD = (A,B)", - "KEYWORD = {A, B}", - "KEYWORD = (A,B) #comment this", - "KEYWORD = ( A , B )", - "KEYWORD\t=\t( A\t,\tB )", - "KEYWORD = (A, B,C,D,E))", - "KEYWORD = ((1, 2), {3, 4}, (5), 6)", - "KEYWORD = { \"VAL1\" , \"VAL2\", \"VAL3\"}", - "KEYWORD = { \"VAL1\" , \"VAL2\", \"VAL3\")", - "KEYWORD = { \"VAL1\" ,", - "KEYWORD = \"(A,B,\"", - "KEYWORD = ',E)'", - "KEYWORD = ((1,2))", - "KEYWORD = (\"(f1+f2)\",\"/(f1-f2)\")", - "KEYWORD = \"(F1+F2)/(F1-F2)\"", - "KEYWORD = ( (1,2) , (A,B) )", - "KEYWORD = \"(f1 + min(f2,f3))\"", - "KEYWORD = \"(min(f2,f3) + f1)\"", - "KEYWORD = \"min(f2,f3) + f1\"", - "KEYWORD = \"f1 + min(f2,f3)\"", - "KEYWORD = (A , B , C, D )", - "KEYWORD = (A , B , C, D ) ", - "KEYWORD = ',E) ", - "KEYWORD = ,E) ", - "#SOMECOMMENT\nKEYWORD = SOME_VAL", - "#SOMECOMMENT1\n#SOMECOMMENT2\nKEYWORD = SOME_VAL", - "//SOMECOMMENT1\n#SOMECOMMENT2\nKEYWORD = SOME_VAL", - "/*SOMECOMMENT1*/\nKEYWORD = SOME_VAL", - "KEYWORD = '/*\n*/'", - "/* SOMECOMMENT1\n SOMECOMMENT2\nSOMECOMMENT3 */\nKEYWORD = SOME_VAL", - "/*C1\n\nA\n/*\nC3*/\nKEYWORD = SOME_VAL", - "/*C1\n/**/\nKEYWORD = SOME_VAL", - "/*C1\nA/**/\nKEYWORD = SOME_VAL", - "/* A */\n/* B *//*C*/\nKEYWORD = SOME_VAL", - "/*C1/**/\nKEYWORD = SOME_VAL", - "/*C1 \n\nA\n\nC3*//*Neato*//*Man*/KEYWORD = (A,B,C) /*Right?\nYes!*/" - }; - - results = { - PvlKeyword("KEYWORD"), // 0 - PvlKeyword("KEYWORD", "SOME_VAL"), // 1 - PvlKeyword("KEYWORD", " val "), // 2 - PvlKeyword("KEYWORD", " \'val\' "), // 3 - PvlKeyword("KEYWORD", "SOME_VAL"), // 4 - PvlKeyword("KEYWORD", "SOME_VAL", "a"), // 5 - PvlKeyword("KEYWORD", "SOME_VAL", "a"), // 6 - PvlKeyword("KEYWORD"), // 7 - PvlKeyword("KEYWORD"), // 8 - PvlKeyword("KEYWORD"), // 9 - PvlKeyword("KEYWORD"), // 10 - PvlKeyword("KEYWORD"), // 11 - PvlKeyword("KEYWORD"), // 12 - PvlKeyword("KEYWORD"), // 13 - PvlKeyword("KEYWORD"), // 14 - PvlKeyword("KEYWORD", "(A,B,"), // 15 - PvlKeyword("KEYWORD", ",E)"), // 16 - PvlKeyword("KEYWORD", "(1,2)"), // 17 - PvlKeyword("KEYWORD"), // 18 - PvlKeyword("KEYWORD", "(F1+F2)/(F1-F2)"), // 19 - PvlKeyword("KEYWORD"), // 20 - PvlKeyword("KEYWORD", "(f1 + min(f2,f3))"), // 21 - PvlKeyword("KEYWORD", "(min(f2,f3) + f1)"), // 22 - PvlKeyword("KEYWORD", "min(f2,f3) + f1"), // 23 - PvlKeyword("KEYWORD", "f1 + min(f2,f3)"), // 24 - PvlKeyword("KEYWORD"), // 25 - PvlKeyword("KEYWORD"), // 26 - PvlKeyword("KEYWORD", "SOME_VAL"), // 27 - PvlKeyword("KEYWORD", "SOME_VAL"), // 28 - PvlKeyword("KEYWORD", "SOME_VAL"), // 29 - PvlKeyword("KEYWORD", "SOME_VAL"), // 30 - PvlKeyword("KEYWORD", "/*\n*/"), // 31 - PvlKeyword("KEYWORD", "SOME_VAL"), // 32 - PvlKeyword("KEYWORD", "SOME_VAL"), // 33 - PvlKeyword("KEYWORD", "SOME_VAL"), // 34 - PvlKeyword("KEYWORD", "SOME_VAL"), // 35 - PvlKeyword("KEYWORD", "SOME_VAL"), // 36 - PvlKeyword("KEYWORD", "SOME_VAL"), // 37 - PvlKeyword("KEYWORD"), // 38 - }; - - results[8].addValue("A"); - results[8].addValue("B"); - - results[9].addValue("A"); - results[9].addValue("B"); - - results[10].addValue("A"); - results[10].addValue("B"); - results[10].addComment("#comment this"); - - results[11].addValue("A"); - results[11].addValue("B"); - - results[12].addValue("A"); - results[12].addValue("B"); - - results[13].addValue("(1, 2)"); - results[13].addValue("{3, 4}"); - results[13].addValue("(5)"); - results[13].addValue("6"); - - results[14].addValue("VAL1"); - results[14].addValue("VAL2"); - results[14].addValue("VAL3"); - - results[18].addValue("(f1+f2)"); - results[18].addValue("/(f1-f2)"); - - results[20].addValue("(1,2)"); - results[20].addValue("(A,B)"); - - results[25].addValue("A", "a"); - results[25].addValue("B", "b"); - results[25].addValue("C"); - results[25].addValue("D", "d"); - - results[26].addValue("A", "a"); - results[26].addValue("B", "b"); - results[26].addValue("C", "e"); - results[26].addValue("D", "d"); - - results[27].addComment("#SOMECOMMENT"); - - results[28].addComment("#SOMECOMMENT1"); - results[28].addComment("#SOMECOMMENT2"); - - results[29].addComment("//SOMECOMMENT1"); - results[29].addComment("#SOMECOMMENT2"); - - results[30].addComment("/* SOMECOMMENT1 */"); - - results[32].addComment("/* SOMECOMMENT1 */"); - results[32].addComment("/* SOMECOMMENT2 */"); - results[32].addComment("/* SOMECOMMENT3 */"); - - results[33].addComment("/* C1 */"); - results[33].addComment("/* A */"); - results[33].addComment("/* */"); - results[33].addComment("/* C3 */"); - - results[34].addComment("/* C1 */"); - results[34].addComment("/* */"); - - results[35].addComment("/* C1 */"); - results[35].addComment("/* A/* */"); - - results[36].addComment("/* A */"); - results[36].addComment("/* B *//*C */"); - - results[37].addComment("/* C1/* */"); - - results[38].addValue("A"); - results[38].addValue("B"); - results[38].addValue("C"); - results[38].addComment("/* C1 */"); - results[38].addComment("/* A */"); - results[38].addComment("/* C3 */"); - results[38].addComment("/* Neato */"); - results[38].addComment("/* Man */"); - results[38].addComment("/*Right? Yes!*/"); - - valid = { - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true, - false, - true, - true, - true, - true, - true, - true, - false, - true, - true, - false, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true}; - } - - void RawPvlKeywords::TearDown() {} } diff --git a/isis/tests/FunctionalTestsCsv2Table.cpp b/isis/tests/FunctionalTestsCsv2Table.cpp index 29f50b8199..410d9d395b 100644 --- a/isis/tests/FunctionalTestsCsv2Table.cpp +++ b/isis/tests/FunctionalTestsCsv2Table.cpp @@ -13,7 +13,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/csv2table.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/csv2table.xml").expanded()); TEST_F(DefaultCube, FunctionalTestCsv2TableLabel) { QTemporaryDir tempDir; @@ -291,8 +291,8 @@ TEST_F(DefaultCube, FunctionalTestCsv2TableArrayTypes) { EXPECT_TRUE(truth_ints[i] == std::vector(record[j])); } else if (j == 1) { - std::cout << truth_strings[i] << ", " << QString(record[j]).toStdString() << std::endl; - EXPECT_TRUE(truth_strings[i] == QString(record[j]).toStdString()); + std::cout << truth_strings[i] << ", " << TableField::toString(record[j]) << std::endl; + EXPECT_TRUE(truth_strings[i] == TableField::toString(record[j])); } else if (j == 2) { EXPECT_TRUE(truth_floats[i] == std::vector(record[j])); From b8037ec9327c0c12694a5693565b926338b83010 Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Mon, 27 Jan 2025 16:12:52 -0700 Subject: [PATCH 94/95] Fixed tests from rebase --- isis/tests/FunctionalTestsDstripe.cpp | 6 +- .../FunctionalTestsIsisImportChandrayaan2.cpp | 6 +- isis/tests/FunctionalTestsJigsaw.cpp | 2 +- isis/tests/FunctionalTestsNoseam.cpp | 68 +++++++++---------- isis/tests/FunctionalTestsPhotomet.cpp | 32 ++++----- isis/tests/FunctionalTestsPixel2map.cpp | 6 +- 6 files changed, 58 insertions(+), 62 deletions(-) diff --git a/isis/tests/FunctionalTestsDstripe.cpp b/isis/tests/FunctionalTestsDstripe.cpp index b51195a92c..a6f47ac2b7 100644 --- a/isis/tests/FunctionalTestsDstripe.cpp +++ b/isis/tests/FunctionalTestsDstripe.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/dstripe.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/dstripe.xml").expanded()); TEST(Dstripe, FunctionalTestDstripeName) { QTemporaryDir prefix; @@ -27,7 +27,7 @@ TEST(Dstripe, FunctionalTestDstripeName) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 99.405224835973755, .000001); @@ -50,7 +50,7 @@ TEST(Dstripe, FunctionalTestDstripeParallel) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 2.2391462548711162e-05, .000001); diff --git a/isis/tests/FunctionalTestsIsisImportChandrayaan2.cpp b/isis/tests/FunctionalTestsIsisImportChandrayaan2.cpp index d00586f66a..fc2fbc5c6e 100644 --- a/isis/tests/FunctionalTestsIsisImportChandrayaan2.cpp +++ b/isis/tests/FunctionalTestsIsisImportChandrayaan2.cpp @@ -26,7 +26,7 @@ using namespace Isis; using namespace testing; using json = nlohmann::json; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isisimport.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isisimport.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestIsisImportChandrayaan2MinimalLabel){ std::istringstream PvlInput(R"( @@ -150,7 +150,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportChandrayaan2MinimalLabel){ Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -313,7 +313,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportChandrayaan2FullLabel){ Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsJigsaw.cpp b/isis/tests/FunctionalTestsJigsaw.cpp index 2d2033be0b..5b1cfa5bbe 100644 --- a/isis/tests/FunctionalTestsJigsaw.cpp +++ b/isis/tests/FunctionalTestsJigsaw.cpp @@ -1916,7 +1916,7 @@ TEST_F(ApolloNetwork, FunctionalTestJigsawSaveApplyValues) { HighFive::DataSet datasetRead = file.getDataSet(cmatrixKey); auto cmatrixData = datasetRead.read(); Table cmatrixTable(cmatrixName, cmatrixData, ','); - std::string cmatrixTableStr = Table::toString(cmatrixTable).toStdString(); + std::string cmatrixTableStr = Table::toString(cmatrixTable); datasetRead = file.getDataSet(spvectorKey); auto spvectorData = datasetRead.read(); diff --git a/isis/tests/FunctionalTestsNoseam.cpp b/isis/tests/FunctionalTestsNoseam.cpp index a835c10b5b..343ba793e0 100644 --- a/isis/tests/FunctionalTestsNoseam.cpp +++ b/isis/tests/FunctionalTestsNoseam.cpp @@ -7,7 +7,7 @@ using namespace std; using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/noseam.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/noseam.xml").expanded()); /** * NoseamDefault Test using ThreeImageNetwork Fixture @@ -25,13 +25,13 @@ static QString APP_XML = FileName("$ISISROOT/bin/xml/noseam.xml").expanded(); TEST_F(ThreeImageNetwork, FunctionalTestNoseamDefault) { // create list of input projected cube files - FileName cubeListFileName(tempDir.path() + "/cubes.lis"); + FileName cubeListFileName(tempDir.path().toStdString() + "/cubes.lis"); ofstream of; - of.open((cubeListFileName.original()).toStdString()); - of << cube1map->fileName() << "\n"; - of << cube2map->fileName() << "\n"; - of << cube3map->fileName() << "\n"; + of.open((cubeListFileName.original())); + of << cube1map->fileName().toStdString() << "\n"; + of << cube2map->fileName().toStdString() << "\n"; + of << cube3map->fileName().toStdString() << "\n"; of.close(); // run noseam @@ -46,11 +46,11 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamDefault) { noseam(cubeListFileName, ui); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // validate output mosaic - Cube mosaic(tempDir.path() + "/noseamDefaultOut.cub"); + Cube mosaic(tempDir.path().toStdString() + "/noseamDefaultOut.cub"); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -95,14 +95,14 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamDefault) { TEST_F(ThreeImageNetwork, FunctionalTestNoseamEvenBoxFilterSamples) { // create list of input projected cube files - FileName cubeListFileName(tempDir.path() + "/cubes.lis"); + FileName cubeListFileName(tempDir.path().toStdString() + "/cubes.lis"); // create list of input cube files ofstream of; - of.open((cubeListFileName.original()).toStdString()); - of << cube1map->fileName() << "\n"; - of << cube2map->fileName() << "\n"; - of << cube3map->fileName() << "\n"; + of.open((cubeListFileName.original())); + of << cube1map->fileName().toStdString() << "\n"; + of << cube2map->fileName().toStdString() << "\n"; + of << cube3map->fileName().toStdString() << "\n"; of.close(); // run noseam @@ -118,8 +118,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamEvenBoxFilterSamples) { FAIL() << "Expected Exception for boxcar even sample input"; } catch (IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("[SAMPLES] must be odd")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("[SAMPLES] must be odd") != std::string::npos); } // remove print.prt file if it has been created @@ -146,14 +145,14 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamEvenBoxFilterSamples) { TEST_F(ThreeImageNetwork, FunctionalTestNoseamEvenBoxFilterLines) { // create list of input projected cube files - FileName cubeListFileName(tempDir.path() + "/cubes.lis"); + FileName cubeListFileName(tempDir.path().toStdString() + "/cubes.lis"); // create list of input cube files ofstream of; - of.open((cubeListFileName.original()).toStdString()); - of << cube1map->fileName() << "\n"; - of << cube2map->fileName() << "\n"; - of << cube3map->fileName() << "\n"; + of.open((cubeListFileName.original())); + of << cube1map->fileName().toStdString() << "\n"; + of << cube2map->fileName().toStdString() << "\n"; + of << cube3map->fileName().toStdString() << "\n"; of.close(); // run noseam @@ -169,8 +168,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamEvenBoxFilterLines) { FAIL() << "Expected Exception for boxcar even line input"; } catch (IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("[LINES] must be odd")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("[LINES] must be odd") != std::string::npos); } // remove print.prt file if it has been created @@ -196,14 +194,14 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamEvenBoxFilterLines) { TEST_F(ThreeImageNetwork, FunctionalTestNoseamNoBoxFilterSamples) { // create list of input projected cube files - FileName cubeListFileName(tempDir.path() + "/cubes.lis"); + FileName cubeListFileName(tempDir.path().toStdString() + "/cubes.lis"); // create list of input cube files ofstream of; - of.open((cubeListFileName.original()).toStdString()); - of << cube1map->fileName() << "\n"; - of << cube2map->fileName() << "\n"; - of << cube3map->fileName() << "\n"; + of.open((cubeListFileName.original())); + of << cube1map->fileName().toStdString() << "\n"; + of << cube2map->fileName().toStdString() << "\n"; + of << cube3map->fileName().toStdString() << "\n"; of.close(); // run noseam @@ -218,8 +216,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamNoBoxFilterSamples) { FAIL() << "Expected Exception for no input for boxcar samples"; } catch (IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("[SAMPLES] must be entered")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("[SAMPLES] must be entered") != std::string::npos); } // remove print.prt file if it has been created @@ -245,14 +242,14 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamNoBoxFilterSamples) { TEST_F(ThreeImageNetwork, FunctionalTestNoseamNoBoxFilterLines) { // create list of input projected cube files - FileName cubeListFileName(tempDir.path() + "/cubes.lis"); + FileName cubeListFileName(tempDir.path().toStdString() + "/cubes.lis"); // create list of input cube files ofstream of; - of.open((cubeListFileName.original()).toStdString()); - of << cube1map->fileName() << "\n"; - of << cube2map->fileName() << "\n"; - of << cube3map->fileName() << "\n"; + of.open((cubeListFileName.original())); + of << cube1map->fileName().toStdString() << "\n"; + of << cube2map->fileName().toStdString() << "\n"; + of << cube3map->fileName().toStdString() << "\n"; of.close(); // run noseam @@ -267,8 +264,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestNoseamNoBoxFilterLines) { FAIL() << "Expected Exception for no input for boxcar lines"; } catch (IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("[LINES] must be entered")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("[LINES] must be entered") != std::string::npos); } // determine if print.prt has been generated and if so, remove it diff --git a/isis/tests/FunctionalTestsPhotomet.cpp b/isis/tests/FunctionalTestsPhotomet.cpp index 075b46a03e..be14540e1b 100644 --- a/isis/tests/FunctionalTestsPhotomet.cpp +++ b/isis/tests/FunctionalTestsPhotomet.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/photomet.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/photomet.xml").expanded()); TEST(Photomet, FunctionalTestPhotometClementine) { QTemporaryDir prefix; @@ -23,7 +23,7 @@ TEST(Photomet, FunctionalTestPhotometClementine) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 57.865063346038504, .000001); @@ -43,7 +43,7 @@ TEST(Photomet, FunctionalTestPhotometClemMaxemiMaxinc) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 55.491706688909559, .000001); @@ -64,7 +64,7 @@ TEST(Photomet, FunctionalTestPhotometClemMaxemission) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 58.134963167604397, .000001); @@ -86,7 +86,7 @@ TEST(Photomet, FunctionalTestPhotometMessCmdline) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 0.05943594115596508, .000001); @@ -106,7 +106,7 @@ TEST(Photomet, FunctionalTestPhotometMessenger) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 0.12118244647528577, .000001); @@ -127,7 +127,7 @@ TEST(Photomet, FunctionalTestPhotometMessMaxemiMaxinc) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), -1.7976931348623149e+308, .000001); @@ -148,7 +148,7 @@ TEST(Photomet, FunctionalTestPhotometMessMaxemission) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 0.12118244647528577, .000001); @@ -169,7 +169,7 @@ TEST(Photomet, FunctionalTestPhotometMessMaxincidence) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), -1.7976931348623149e+308, .000001); @@ -193,7 +193,7 @@ TEST(Photomet, FunctionalTestPhotometMessBackplane) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), -1.7976931348623149e+308, .000001); @@ -215,7 +215,7 @@ TEST(Photomet, FunctionalTestPhotometTestDemWarningMixed) { photomet(options, &log); PvlGroup warning = log.findGroup("Warnings"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, warning["Warning"], "The MIXED Normalized model is not recommended for use with the DEM Angle Source option"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, warning["Warning"], "The MIXED Normalized model is not recommended for use with the DEM Angle Source option"); } TEST(Photomet, FunctionalTestPhotometTestDemWarningTopo) { @@ -231,7 +231,7 @@ TEST(Photomet, FunctionalTestPhotometTestDemWarningTopo) { photomet(options, &log); PvlGroup warning = log.findGroup("Warnings"); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, warning["Warning"], "The TOPO Normalized model is not recommended for use with the DEM Angle Source option"); + EXPECT_PRED_FORMAT2(AssertStringsEqual, warning["Warning"], "The TOPO Normalized model is not recommended for use with the DEM Angle Source option"); } TEST(Photomet, FunctionalTestPhotometTestAngleSourceDemUseDemFalse) { @@ -246,7 +246,7 @@ TEST(Photomet, FunctionalTestPhotometTestAngleSourceDemUseDemFalse) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 14792.765466992187, .000001); @@ -266,7 +266,7 @@ TEST(Photomet, FunctionalTestPhotometTestAngleSourceEllipsoidUseDemFalse) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 14749.07615234375, .000001); @@ -286,7 +286,7 @@ TEST(Photomet, FunctionalTestPhotometTestAngleSourceEllipsoidUseDemTrue) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 14749.07615234375, .000001); @@ -306,7 +306,7 @@ TEST(Photomet, FunctionalTestPhotometTestAngleSourceDemUseDemTrue) { photomet(options, &log); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); std::unique_ptr hist (cube.histogram(0)); EXPECT_NEAR(hist->Average(), 14792.765466992187, .000001); diff --git a/isis/tests/FunctionalTestsPixel2map.cpp b/isis/tests/FunctionalTestsPixel2map.cpp index 1862fffed0..bf05c85387 100644 --- a/isis/tests/FunctionalTestsPixel2map.cpp +++ b/isis/tests/FunctionalTestsPixel2map.cpp @@ -21,7 +21,7 @@ using namespace Isis; -static QString PIXEL2MAP_XML = FileName("$ISISROOT/bin/xml/pixel2map.xml").expanded(); +static QString PIXEL2MAP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/pixel2map.xml").expanded()); TEST_F(MroCtxCube, FunctionalTestPixel2mapVector) { @@ -50,9 +50,9 @@ TEST_F(MroCtxCube, FunctionalTestPixel2mapVector) { // TEST 1a: Check we have both csv and vrt output files - FileName csvFileOut( csvFileName ); + FileName csvFileOut( csvFileName.toStdString() ); EXPECT_TRUE(csvFileOut.fileExists()); - FileName vrtFileOut( vrtFileName ); + FileName vrtFileOut( vrtFileName.toStdString() ); EXPECT_TRUE(vrtFileOut.fileExists()); // TEST 1b: Check the output csv file header From d4323312fcb65750d994b7f228615bbcf1a63e95 Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Wed, 29 Jan 2025 08:18:03 -0700 Subject: [PATCH 95/95] kerneldb test fixes --- isis/src/system/apps/kerneldbgen/kerneldbgen.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp index 135eadbd44..588e2d7a21 100644 --- a/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp +++ b/isis/src/system/apps/kerneldbgen/kerneldbgen.cpp @@ -247,8 +247,8 @@ namespace Isis { } } else { - throw IException(IException::Unknown, "Expected Pvl Group " + primaryGroup.name() + " in the first Pvl Object " + primaryObject.name() + " " - "in the DB file " + kernelFileName.original() + " to have a single keyword (named " + throw IException(IException::Unknown, "Expected Pvl Group [" + primaryGroup.name() + "] in the first Pvl Object [" + primaryObject.name() + "] " + "in the DB file [" + kernelFileName.original() + "] to have a single keyword (named " "File), but found " + Isis::toString(primaryGroup.keywords()) + " keywords", _FILEINFO_); } @@ -260,8 +260,8 @@ namespace Isis { } } else { - throw IException(IException::Unknown,"Expected one Pvl Group in the first Pvl Object " + primaryObject.name() + " in " - "the DB file " + kernelFileName.original() + " but found " + Isis::toString(primaryObject.groups()), _FILEINFO_); + throw IException(IException::Unknown,"Expected one Pvl Group in the first Pvl Object [" + primaryObject.name() + "] in " + "the DB file [" + kernelFileName.original() + "] but found [" + Isis::toString(primaryObject.groups()) + "]", _FILEINFO_); } } else {