#7472 Compdat Export : Check if export folder exist

This commit is contained in:
Magne Sjaastad 2021-03-08 15:01:29 +01:00
parent 59562aec29
commit 8357032d53
3 changed files with 38 additions and 1 deletions

View File

@ -100,6 +100,17 @@ void RicExportCompletionsWellSegmentsFeature::onActionTriggered( bool isChecked
if ( propertyDialog.exec() == QDialog::Accepted )
{
{
QDir folder( exportSettings.folder );
if ( !folder.exists() )
{
QString txt = QString( "The path '%1' does not exist. Aborting export." ).arg( exportSettings.folder );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
return;
}
}
RiaApplication::instance()->setLastUsedDialogDirectory( "COMPLETIONS",
QFileInfo( exportSettings.folder ).absolutePath() );
RicExportCompletionDataSettingsUi completionExportSettings;

View File

@ -20,6 +20,7 @@
#include "RicWellPathExportCompletionDataFeatureImpl.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "ExportCommands/RicExportLgrFeature.h"
#include "RicExportFeatureImpl.h"
@ -43,6 +44,7 @@
#include "cafSelectionManager.h"
#include <QAction>
#include <QDir>
CAF_CMD_SOURCE_INIT( RicWellPathExportCompletionDataFeature, "RicWellPathExportCompletionDataFeature" );
@ -147,6 +149,17 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl
if ( propertyDialog.exec() == QDialog::Accepted )
{
{
QDir folder( exportSettings->folder );
if ( !folder.exists() )
{
QString txt = QString( "The path '%1' does not exist. Aborting export." ).arg( exportSettings->folder );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
return;
}
}
RiaApplication::instance()->setLastUsedDialogDirectory( "COMPLETIONS", exportSettings->folder );
RicWellPathExportCompletionDataFeatureImpl::exportCompletions( wellPaths, simWells, *exportSettings );

View File

@ -31,6 +31,7 @@
#include "RicExportFeatureImpl.h"
#include "RicExportFractureCompletionsImpl.h"
#include "RicFishbonesTransmissibilityCalculationFeatureImp.h"
#include "RicWellPathExportCompletionsFileTools.h"
#include "RicWellPathExportMswCompletionsImpl.h"
#include "RicWellPathFractureReportItem.h"
#include "RicWellPathFractureTextReportFeatureImpl.h"
@ -66,6 +67,7 @@
#include "RimWellPathFractureCollection.h"
#include "RimWellPathValve.h"
#include "Riu3DMainWindowTools.h"
#include "RiuMainWindow.h"
#include "cafPdmUiPropertyViewDialog.h"
@ -75,8 +77,8 @@
#include "cvfPlane.h"
#include "RicWellPathExportCompletionsFileTools.h"
#include <QDir>
#include <map>
#include <set>
@ -93,6 +95,17 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
return;
}
{
QDir folder( exportSettings.folder );
if ( !folder.exists() )
{
QString txt = QString( "The path '%1' does not exist. Aborting export." ).arg( exportSettings.folder );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
return;
}
}
exportCarfinForTemporaryLgrs( exportSettings.caseToApply(), exportSettings.folder );
if ( exportSettings.compdatExport == RicExportCompletionDataSettingsUi::TRANSMISSIBILITIES ||