Skip to content

Commit

Permalink
fixed gtests part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
amystamile-usgs committed Sep 30, 2024
1 parent ea1ea7b commit 790fe9a
Show file tree
Hide file tree
Showing 21 changed files with 106 additions and 106 deletions.
4 changes: 2 additions & 2 deletions isis/src/base/objs/Application/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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()) {
Expand Down
28 changes: 14 additions & 14 deletions isis/src/base/objs/Camera/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,19 +1369,19 @@ namespace Isis {
map += PvlKeyword("TargetName", target()->name().toStdString());

std::vector<Distance> 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", toString(radii[0].meters()), "meters");
map += PvlKeyword("PolarRadius", 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", 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("ProjectionName", "Sinusoidal");
pvl.addGroup(map);
Expand All @@ -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", 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("ProjectionName", "Planar");
pvl.addGroup(map);
Expand All @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions isis/src/base/objs/CubeAttribute/CubeAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
46 changes: 23 additions & 23 deletions isis/src/base/objs/Equalization/Equalization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ namespace Isis {
vector<Statistics *> 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());
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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", 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("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", toString(solType));
gen += PvlKeyword("SolveMethod" , toString(lsqMethod));
PvlKeyword nonOverlaps("NonOverlaps");
for (int img = 0; img < m_badFiles.size(); img++) {
nonOverlaps += m_badFiles[img].toStdString();
Expand Down Expand Up @@ -379,25 +379,25 @@ 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
if (m_sType == OverlapNormalization::Both ||
m_sType == OverlapNormalization::Gains ||
m_sType == OverlapNormalization::GainsWithoutNormalization) {
bandStats += std::to_string(m_adjustments[img]->getGain(band - 1));
bandStats += 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 += 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 += toString(m_adjustments[img]->getAverage(band - 1));
}
norm += bandStats;
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/Hillshade/Hillshade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions isis/src/base/objs/IsisAml/IsisAml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void IsisAml::PutInteger(const QString &paramName,
}

param->values.clear();
param->values.push_back(QString::number(value));
param->values.push_back(QString::fromStdString(Isis::toString(value)));

Verify(param);
}
Expand Down Expand Up @@ -368,7 +368,7 @@ void IsisAml::PutInteger(const QString &paramName,

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);
Expand Down Expand Up @@ -410,7 +410,7 @@ void IsisAml::PutDouble(const QString &paramName,
}

param->values.clear();
param->values.push_back(QString::number(value));
param->values.push_back(QString::fromStdString(Isis::toString(value)));

Verify(param);
}
Expand Down Expand Up @@ -452,7 +452,7 @@ void IsisAml::PutDouble(const QString &paramName,

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);
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/Pipeline/Pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -563,7 +563,7 @@ namespace Isis {
}
}
}

// Now, to handle the offset
units = units.trimmed();
if (units == "BYTES" || units == "B") {
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1204,12 +1204,12 @@ namespace Isis {
cOutKey += cInKey[isb++] + "_Count";
}
else {
cOutKey += 0;
cOutKey += "0";
isb++;
}
}
else {
cOutKey += 0;
cOutKey += "0";
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace Isis {
}

QString command = QString::fromStdString(program.expanded()) + " " + parameters +
" -pid=" + QString::number(getpid());
" -pid=" + QString::fromStdString(toString(getpid()));

if(!isIsisProgram) {
std::string msg = "Program [" + programName.toStdString() + "] does not appear to be a "
Expand All @@ -54,7 +54,7 @@ namespace Isis {
}

QString serverName = "isis_" + Application::UserName() +
"_" + QString::number(getpid());
"_" + QString::fromStdString(toString(getpid()));

QLocalServer server;
server.listen(serverName);
Expand Down
Loading

0 comments on commit 790fe9a

Please sign in to comment.