mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
System: Created a general basename cleanup function, and applied that when creating filenames from userdescription etc. Related to #1054 preparations
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "QMessageBox"
|
||||
#include "cafUtils.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicExportFaultsFeature, "RicExportFaultsFeature");
|
||||
|
||||
@@ -79,7 +80,7 @@ void RicExportFaultsFeature::onActionTriggered(bool isChecked)
|
||||
if ( faultName == RimDefines::undefinedGridFaultWithInactiveName() ) faultName = "UNDEF_IA";
|
||||
|
||||
QString baseFilename = "Fault_" + faultName + "_" + caseName;
|
||||
baseFilename.replace(" ", "_");
|
||||
baseFilename = caf::Utils::makeValidFileBasename(baseFilename);
|
||||
|
||||
QString completeFilename = selectedDir + "/" + baseFilename + ".grdecl";
|
||||
|
||||
|
||||
@@ -214,6 +214,7 @@ void RicExportMultipleSnapshotsFeature::exportViewVariationsToFolder(RimView* ri
|
||||
|
||||
QString resName = resultName(rimView);
|
||||
QString viewCaseResultString = rimCase->caseUserDescription() + "_" + rimView->name() + "_" + resName;
|
||||
viewCaseResultString = caf::Utils::makeValidFileBasename(viewCaseResultString);
|
||||
|
||||
for (int i = msd->timeStepStart(); i <= msd->timeStepEnd(); i++)
|
||||
{
|
||||
@@ -235,7 +236,6 @@ void RicExportMultipleSnapshotsFeature::exportViewVariationsToFolder(RimView* ri
|
||||
if (msd->sliceDirection == RimMultiSnapshotDefinition::NO_RANGEFILTER)
|
||||
{
|
||||
QString fileName = viewCaseResultString + "_" + timeStepString;
|
||||
fileName.replace(" ", "-");
|
||||
QString absoluteFileName = caf::Utils::constructFullFileName(folder, fileName, ".png");
|
||||
|
||||
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, rimView);
|
||||
@@ -252,7 +252,6 @@ void RicExportMultipleSnapshotsFeature::exportViewVariationsToFolder(RimView* ri
|
||||
{
|
||||
QString rangeFilterString = msd->sliceDirection().text() + "-" + QString::number(i);
|
||||
QString fileName = viewCaseResultString + "_" + timeStepString + "_" + rangeFilterString;
|
||||
fileName.replace(" ", "-");
|
||||
|
||||
rangeFilter->setDefaultValues();
|
||||
if (msd->sliceDirection == RimMultiSnapshotDefinition::RANGEFILTER_I)
|
||||
@@ -293,7 +292,7 @@ QString RicExportMultipleSnapshotsFeature::resultName(RimView* rimView)
|
||||
if (dynamic_cast<RimEclipseView*>(rimView))
|
||||
{
|
||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(rimView);
|
||||
|
||||
|
||||
return eclView->cellResult()->resultVariable();
|
||||
}
|
||||
else if (dynamic_cast<RimGeoMechView*>(rimView))
|
||||
|
||||
@@ -208,7 +208,7 @@ void RicSnapshotAllPlotsToFileFeature::createSnapshotOfAllPlotsInFolder(QString
|
||||
if (wellLogPlot && wellLogPlot->viewWidget())
|
||||
{
|
||||
QString fileName = wellLogPlot->description();
|
||||
fileName.replace(" ", "_");
|
||||
fileName = caf::Utils::makeValidFileBasename(fileName);
|
||||
|
||||
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");
|
||||
|
||||
@@ -226,7 +226,7 @@ void RicSnapshotAllPlotsToFileFeature::createSnapshotOfAllPlotsInFolder(QString
|
||||
if (summaryPlot && summaryPlot->viewWidget())
|
||||
{
|
||||
QString fileName = summaryPlot->description();
|
||||
fileName.replace(" ", "_");
|
||||
fileName = caf::Utils::makeValidFileBasename(fileName);
|
||||
|
||||
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user