Skip to content

Commit

Permalink
Updated recent merged changes
Browse files Browse the repository at this point in the history
  • Loading branch information
amystamile-usgs committed Sep 18, 2024
1 parent 8e438c8 commit 6f33183
Show file tree
Hide file tree
Showing 6 changed files with 339 additions and 338 deletions.
4 changes: 2 additions & 2 deletions isis/src/base/apps/explode/explode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ namespace Isis {
// Loop and extract each band
for(int band = 1; band <= bands; band++) {
int pband = icube->physicalBand(band);
QString sband(toString(pband));
QString sband(QString::number(pband));

ProcessByLine p2;
Progress *prog = p2.Progress();
prog->SetText("Exploding band " + sband);

CubeAttributeInput inatt("+" + sband);
CubeAttributeInput inatt("+" + sband.toStdString());
p2.SetInputCube(infile, inatt);

QString outfile = outbase + ".band";
Expand Down
20 changes: 10 additions & 10 deletions isis/src/base/apps/isisminer/isisminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace Isis {
// open optional, global parameter file if provided
// file is for use in global variable pool
if ( ui.WasEntered("GLOBALS") ) {
Pvl pvl_globals(ui.GetFileName("GLOBALS"));
Pvl pvl_globals(ui.GetFileName("GLOBALS").toStdString());

return isisminer(configFile, ui, &pvl_globals);
}
Expand Down Expand Up @@ -114,16 +114,16 @@ namespace Isis {
// Split values from keyword name
QStringList keyval = parm.split(":", Qt::SkipEmptyParts);
if ( keyval.size() != 2 ) {
QString mess = "Ill-formed PARAMETERS (" + parm + ") - use form @key:val";
std::string mess = "Ill-formed PARAMETERS (" + parm.toStdString() + ") - use form @key:val";
throw IException(IException::User, mess, _FILEINFO_);
}

// Now split multi string values and construct the Pvl keyword
QString keyname = keyval[0];
QStringList values = keyval[1].split(",", Qt::SkipEmptyParts);
PvlKeyword keyword(keyname);
PvlKeyword keyword(keyname.toStdString());
BOOST_FOREACH ( QString val, values) {
keyword.addValue(val);
keyword.addValue(val.toStdString());
}

// Add the parameter to global parameters
Expand Down Expand Up @@ -152,24 +152,24 @@ namespace Isis {
QTime runTime = QTime::currentTime();
BOOST_FOREACH ( SharedStrategy strategy, strategies ) {
QTime stime = QTime::currentTime();
cout << "\nRunning " << strategy->type() << "::" << strategy->name()
<< " (TimeIn: " << stime.toString("hh:mm:ss.zzz")
cout << "\nRunning " << strategy->type().toStdString() << "::" << strategy->name().toStdString()
<< " (TimeIn: " << stime.toString("hh:mm:ss.zzz").toStdString()
<< ")\n"
<< "Description: " << strategy->description() << "\n";
<< "Description: " << strategy->description().toStdString() << "\n";
QElapsedTimer stimer;
stimer.start();
int n = strategy->apply(resources);
unsigned int ntotal = strategy->totalProcessed();
cout << n << " of " << ntotal << " processed in "
<< strategy->type() << "::" << strategy->name()
<< " (TimeOut: " << QTime::currentTime().toString("hh:mm:ss.zzz") << ")\n";
<< strategy->type().toStdString() << "::" << strategy->name().toStdString()
<< " (TimeOut: " << QTime::currentTime().toString("hh:mm:ss.zzz").toStdString() << ")\n";
cout << "ElapsedTime(s): " << stimer.elapsed() / 1000 << "\n";
}

// Get total elapsed time
QTime totalT(0,0);
totalT = totalT.addMSecs(runTime.msecsTo(QTime::currentTime()));
cout << "\nSession complete in " << totalT.toString("hh:mm:ss.zzz")
cout << "\nSession complete in " << totalT.toString("hh:mm:ss.zzz").toStdString()
<< " of elapsed time\n";

return;
Expand Down
3 changes: 2 additions & 1 deletion isis/src/kaguya/apps/kaguyasp2ascii/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void IsisMain() {
// information. If label is detached label, data file is located at
// the same directory as label file.
// this allows users to specify data that is not in the current directory.
dataFile = FileName(inFile).dir().path() + "/" + dataFile;
std::filesystem::path dir = FileName(inFile.toStdString()).dir();
dataFile = (dir / dataFile).string();
}

ofstream os;
Expand Down
30 changes: 15 additions & 15 deletions isis/tests/FunctionalTestsAlgebra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

using namespace Isis;

static QString APP_XML = FileName("$ISISROOT/bin/xml/algebra.xml").expanded();
static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/algebra.xml").expanded());

/**
* class AlgebraCube
Expand All @@ -26,9 +26,9 @@ class AlgebraCube : public DefaultCube {
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(toString(samples));
dim.findKeyword("Lines").setValue(toString(lines));
dim.findKeyword("Bands").setValue(toString(bands));

// force Real dns
PvlObject &core = label.findObject("IsisCube").findObject("Core");
Expand All @@ -37,7 +37,7 @@ class AlgebraCube : public DefaultCube {

delete testCube;
testCube = new Cube();
testCube->fromIsd(tempDir.path() + "/default.cub", label, isd, "rw");
testCube->fromIsd(tempDir.path().toStdString() + "/default.cub", label, isd, "rw");

LineManager line(*testCube);
int pixelValue = 1;
Expand Down Expand Up @@ -130,11 +130,11 @@ TEST_F(AlgebraCube, FunctionalTestAlgebraAdd) {
algebra(testCube, ui, testCube);
}
catch(IException &e) {
FAIL() << e.toString().toStdString().c_str() << std::endl;
FAIL() << e.toString().c_str() << std::endl;
}

// Open output cube
Cube outCube(tempDir.path() + "/algebraAddOut.cub");
Cube outCube(tempDir.path().toStdString() + "/algebraAddOut.cub");

// validate histogram statistics in output cube
std::unique_ptr<Histogram> hist (outCube.histogram(1));
Expand Down Expand Up @@ -220,11 +220,11 @@ TEST_F(AlgebraCube, FunctionalTestAlgebraSubtract) {
algebra(testCube, ui, testCube);
}
catch(IException &e) {
FAIL() << e.toString().toStdString().c_str() << std::endl;
FAIL() << e.toString().c_str() << std::endl;
}

// Open output cube
Cube outCube(tempDir.path() + "/algebraSubtractOut.cub");
Cube outCube(tempDir.path().toStdString() + "/algebraSubtractOut.cub");

// validate histogram statistics in output cube
std::unique_ptr<Histogram> hist (outCube.histogram(1));
Expand Down Expand Up @@ -310,11 +310,11 @@ TEST_F(AlgebraCube, FunctionalTestAlgebraMultiply) {
algebra(testCube, ui, testCube);
}
catch(IException &e) {
FAIL() << e.toString().toStdString().c_str() << std::endl;
FAIL() << e.toString().c_str() << std::endl;
}

// Open output cube
Cube outCube(tempDir.path() + "/algebraMultiplyOut.cub");
Cube outCube(tempDir.path().toStdString() + "/algebraMultiplyOut.cub");

// validate histogram statistics in output cube
std::unique_ptr<Histogram> hist (outCube.histogram(1));
Expand Down Expand Up @@ -400,11 +400,11 @@ TEST_F(AlgebraCube, FunctionalTestAlgebraMultiply) {
algebra(testCube, ui, testCube);
}
catch(IException &e) {
FAIL() << e.toString().toStdString().c_str() << std::endl;
FAIL() << e.toString().c_str() << std::endl;
}

// Open output cube
Cube outCube(tempDir.path() + "/algebraDivideOut.cub");
Cube outCube(tempDir.path().toStdString() + "/algebraDivideOut.cub");

// validate histogram statistics in output cube
std::unique_ptr<Histogram> hist (outCube.histogram(1));
Expand Down Expand Up @@ -488,11 +488,11 @@ TEST_F(AlgebraCube, FunctionalTestAlgebraMultiply) {
algebra(testCube, ui);
}
catch(IException &e) {
FAIL() << e.toString().toStdString().c_str() << std::endl;
FAIL() << e.toString().c_str() << std::endl;
}

// Open output cube
Cube outCube(tempDir.path() + "/algebraUnaryOut.cub");
Cube outCube(tempDir.path().toStdString() + "/algebraUnaryOut.cub");

// validate histogram statistics in output cube
std::unique_ptr<Histogram> hist (outCube.histogram(1));
Expand Down
8 changes: 4 additions & 4 deletions isis/tests/FunctionalTestsExplode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

using namespace Isis;

static QString APP_XML = FileName("$ISISROOT/bin/xml/explode.xml").expanded();
static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/explode.xml").expanded());

/**
* ExplodeDefault Test
Expand Down Expand Up @@ -42,11 +42,11 @@ TEST_F(DefaultCube, FunctionalTestExplodeDefault) {
explode(testCube, ui);
}
catch(IException &e) {
FAIL() << e.toString().toStdString().c_str() << std::endl;
FAIL() << e.toString().c_str() << std::endl;
}

// validate band 1 output cube
Cube outCube1(tempDir.path() + "/explodeOut.band0001.cub");
Cube outCube1(tempDir.path().toStdString() + "/explodeOut.band0001.cub");

ASSERT_EQ(outCube1.sampleCount(), 5);
ASSERT_EQ(outCube1.lineCount(), 5);
Expand All @@ -62,7 +62,7 @@ TEST_F(DefaultCube, FunctionalTestExplodeDefault) {
EXPECT_NEAR(outCube1Hist->StandardDeviation(), inCubeBand1Hist->StandardDeviation(), .000001);

// validate band 2 output cube
Cube outCube2(tempDir.path() + "/explodeOut.band0002.cub");
Cube outCube2(tempDir.path().toStdString() + "/explodeOut.band0002.cub");

ASSERT_EQ(outCube2.sampleCount(), 5);
ASSERT_EQ(outCube2.lineCount(), 5);
Expand Down
Loading

0 comments on commit 6f33183

Please sign in to comment.