Loading isis/src/base/objs/History/History.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ namespace Isis { for (int i = 0; i < p_bufferSize; i++) os << p_histBuffer[i]; for (int i = 0; i < p_history.objects(); i++) { os << p_history.object(i); os << std::endl << p_history.object(i); } os >> pvl; return pvl; Loading isis/src/tgo/apps/tgocassisunstitch/main.cpp +7 −10 Original line number Diff line number Diff line Loading @@ -100,17 +100,17 @@ void IsisMain() { } // Collect the tables and history from the input stitched cube QList<Blob> inputTables; History inputHistory; QList<Blob> 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()); cube->read(table); inputTables.append(table); inputBlobs.append(table); } if(inputLabel->object(i).isNamed("History") && Isis::iApp != NULL) { inputHistory = cube->readHistory((QString)inputLabel->object(i)["Name"]); History inputHistory = cube->readHistory((QString)inputLabel->object(i)["Name"]); inputHistory.AddEntry(); inputBlobs.append(inputHistory.toBlob()); } } Loading Loading @@ -205,14 +205,11 @@ void IsisMain() { // Delete Stitch group frameletLabel->findObject("IsisCube").deleteGroup("Stitch"); // Propagate Tables for (int j = 0; j < inputTables.size(); j++) { g_outputCubes[i]->write(inputTables[j]); // Propagate Blobs for (int j = 0; j < inputBlobs.size(); j++) { g_outputCubes[i]->write(inputBlobs[j]); } // Propagate History g_outputCubes[i]->write(inputHistory); // Close output cube g_outputCubes[i]->close(); delete g_outputCubes[i]; Loading isis/tests/HistoryTests.cpp +43 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,49 @@ TEST_F(HistoryBlob, HistoryTestsAddEntry) { EXPECT_TRUE(newHistoryPvl.findObject("mroctx2isis").hasGroup("UserParameters")); } TEST_F(HistoryBlob, HistoryTestsAddSecondEntry) { History history(historyBlob); std::istringstream hss(R"( Object = ctxcal IsisVersion = "4.1.0 | 2020-07-01" ProgramVersion = 2016-06-10 ProgramPath = /Users/acpaquette/repos/ISIS3/build/bin ExecutionDateTime = 2020-07-01T16:48:40 HostName = Unknown UserName = acpaquette Description = "Import an MRO CTX image as an Isis cube" Group = UserParameters FROM = /Users/acpaquette/Desktop/J03_045994_1986_XN_18N282W_isis.cub TO = /Users/acpaquette/Desktop/J03_045994_1986_XN_18N282W_isis.cal.cub End_Group End_Object)"); PvlObject secondHistoryPvl; hss >> secondHistoryPvl; history.AddEntry(secondHistoryPvl); Blob blob = history.toBlob(); Pvl newHistoryPvl = history.ReturnHist(); EXPECT_TRUE(newHistoryPvl.hasObject("mroctx2isis")); ASSERT_TRUE(newHistoryPvl.hasObject("ctxcal")); EXPECT_TRUE(newHistoryPvl.findObject("ctxcal").hasGroup("UserParameters")); History reingestedHistory(blob); Pvl reingestedHistoryPvl = reingestedHistory.ReturnHist(); EXPECT_TRUE(reingestedHistoryPvl.hasObject("mroctx2isis")); ASSERT_TRUE(reingestedHistoryPvl.hasObject("ctxcal")); EXPECT_TRUE(reingestedHistoryPvl.findObject("ctxcal").hasGroup("UserParameters")); } TEST_F(HistoryBlob, HistoryTeststoBlob) { History history(historyBlob); Loading Loading
isis/src/base/objs/History/History.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ namespace Isis { for (int i = 0; i < p_bufferSize; i++) os << p_histBuffer[i]; for (int i = 0; i < p_history.objects(); i++) { os << p_history.object(i); os << std::endl << p_history.object(i); } os >> pvl; return pvl; Loading
isis/src/tgo/apps/tgocassisunstitch/main.cpp +7 −10 Original line number Diff line number Diff line Loading @@ -100,17 +100,17 @@ void IsisMain() { } // Collect the tables and history from the input stitched cube QList<Blob> inputTables; History inputHistory; QList<Blob> 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()); cube->read(table); inputTables.append(table); inputBlobs.append(table); } if(inputLabel->object(i).isNamed("History") && Isis::iApp != NULL) { inputHistory = cube->readHistory((QString)inputLabel->object(i)["Name"]); History inputHistory = cube->readHistory((QString)inputLabel->object(i)["Name"]); inputHistory.AddEntry(); inputBlobs.append(inputHistory.toBlob()); } } Loading Loading @@ -205,14 +205,11 @@ void IsisMain() { // Delete Stitch group frameletLabel->findObject("IsisCube").deleteGroup("Stitch"); // Propagate Tables for (int j = 0; j < inputTables.size(); j++) { g_outputCubes[i]->write(inputTables[j]); // Propagate Blobs for (int j = 0; j < inputBlobs.size(); j++) { g_outputCubes[i]->write(inputBlobs[j]); } // Propagate History g_outputCubes[i]->write(inputHistory); // Close output cube g_outputCubes[i]->close(); delete g_outputCubes[i]; Loading
isis/tests/HistoryTests.cpp +43 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,49 @@ TEST_F(HistoryBlob, HistoryTestsAddEntry) { EXPECT_TRUE(newHistoryPvl.findObject("mroctx2isis").hasGroup("UserParameters")); } TEST_F(HistoryBlob, HistoryTestsAddSecondEntry) { History history(historyBlob); std::istringstream hss(R"( Object = ctxcal IsisVersion = "4.1.0 | 2020-07-01" ProgramVersion = 2016-06-10 ProgramPath = /Users/acpaquette/repos/ISIS3/build/bin ExecutionDateTime = 2020-07-01T16:48:40 HostName = Unknown UserName = acpaquette Description = "Import an MRO CTX image as an Isis cube" Group = UserParameters FROM = /Users/acpaquette/Desktop/J03_045994_1986_XN_18N282W_isis.cub TO = /Users/acpaquette/Desktop/J03_045994_1986_XN_18N282W_isis.cal.cub End_Group End_Object)"); PvlObject secondHistoryPvl; hss >> secondHistoryPvl; history.AddEntry(secondHistoryPvl); Blob blob = history.toBlob(); Pvl newHistoryPvl = history.ReturnHist(); EXPECT_TRUE(newHistoryPvl.hasObject("mroctx2isis")); ASSERT_TRUE(newHistoryPvl.hasObject("ctxcal")); EXPECT_TRUE(newHistoryPvl.findObject("ctxcal").hasGroup("UserParameters")); History reingestedHistory(blob); Pvl reingestedHistoryPvl = reingestedHistory.ReturnHist(); EXPECT_TRUE(reingestedHistoryPvl.hasObject("mroctx2isis")); ASSERT_TRUE(reingestedHistoryPvl.hasObject("ctxcal")); EXPECT_TRUE(reingestedHistoryPvl.findObject("ctxcal").hasGroup("UserParameters")); } TEST_F(HistoryBlob, HistoryTeststoBlob) { History history(historyBlob); Loading