Skip to content

Commit

Permalink
fmk - using ZipUtils in ResultsMPM
Browse files Browse the repository at this point in the history
  • Loading branch information
fmckenna committed Apr 12, 2024
1 parent 1f85aad commit 2710ca3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions EVENTS/MPM/ResultsMPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

#include "ResultsMPM.h"
#include "MPM.h"
#include <ZipUtils/ZipUtils.h>

#include <GeneralInformationWidget.h>
#include <RandomVariablesContainer.h>
#include <LineEditRV.h>
Expand Down Expand Up @@ -531,8 +533,11 @@ ResultsMPM::onPlotPressureClicked(void)
zipPath = SimCenterPreferences::getInstance()->getRemoteAppDir() + QDir::separator()
+ "results.zip";
}

if (QFileInfo::exists(zipPath))
{
ZipUtils::UnzipFile(zipPath, plotDir);
/* ***************************************************************************************************************
QString program = "tar";
QStringList arguments;
// Extract results.zip file from zipPath (either in the GUI set caseDir/output/{'','sensors','results}, variants in brackets, or in RemoteWorkDir when retrieving run from DesignSafe. Extract to plotDir
Expand All @@ -554,8 +559,9 @@ ResultsMPM::onPlotPressureClicked(void)
qDebug() << "ResultsMPM::onPlotPressureClicked - The unzip process has finished running with an unknown exit status.";
}
process->deleteLater();
}

********************************************************************************************* */
}

QString plotPath = mainModel->caseDir() + QDir::separator()
+ "output" + QDir::separator()
+ intermediateFolder + QDir::separator()
Expand Down Expand Up @@ -723,6 +729,9 @@ ResultsMPM::plotSensors(MPM* host)

if (QFileInfo::exists(zipPath))
{
ZipUtils::UnzipFile(zipPath, plotDir);

/* **********************************************************************************************
QString program = "tar"; // "unzip"; // TODO: consider cross-platform compatibility.
QStringList arguments;
// Extract results.zip file from zipPath (either in the GUI set caseDir/output/{'','sensors','results}, variants in brackets, or in RemoteWorkDir when retrieving run from DesignSafe. Extract to plotDir
Expand All @@ -747,6 +756,8 @@ ResultsMPM::plotSensors(MPM* host)
qDebug() << "ResultsMPM::plotSensors - The unzip process has finished running with an unknown exit status.";
}
process->deleteLater();
********************************************************************************************************************** */

} else {
qDebug () << "ERROR - ResultsMPM::plotSensors - Cannot find the results.zip file in the checked directory: " << plotDir;
}
Expand Down Expand Up @@ -908,4 +919,4 @@ bool
ResultsMPM::simulationCompleted()
{
return true;
}
}

0 comments on commit 2710ca3

Please sign in to comment.