#3640 File commands. New class RicfApplicationTools containing reusable functionality

This commit is contained in:
Bjørn Erik Jensen
2018-11-07 15:42:45 +01:00
parent 06db391689
commit e8bf189116
15 changed files with 288 additions and 166 deletions

View File

@@ -18,6 +18,7 @@
#include "RicfExportSimWellFractureCompletions.h"
#include "RicfApplicationTools.h"
#include "RicfCommandFileExecutor.h"
#include "RiaApplication.h"
@@ -57,6 +58,8 @@ RicfExportSimWellFractureCompletions::RicfExportSimWellFractureCompletions()
//--------------------------------------------------------------------------------------------------
void RicfExportSimWellFractureCompletions::execute()
{
using TOOLS = RicfApplicationTools;
RimProject* project = RiaApplication::instance()->project();
RicExportCompletionDataSettingsUi* exportSettings = project->dialogData()->exportCompletionData();
@@ -65,21 +68,13 @@ void RicfExportSimWellFractureCompletions::execute()
exportSettings->compdatExport = m_compdatExport;
{
bool foundCase = false;
for (RimEclipseCase* c : RiaApplication::instance()->project()->activeOilField()->analysisModels->cases())
{
if (c->caseId() == m_caseId())
{
exportSettings->caseToApply = c;
foundCase = true;
break;
}
}
if (!foundCase)
auto eclipseCase = TOOLS::caseFromId(m_caseId());
if (!eclipseCase)
{
RiaLogging::error(QString("exportSimWellCompletions: Could not find case with ID %1").arg(m_caseId()));
return;
}
exportSettings->caseToApply = eclipseCase;
}
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath(RicfCommandFileExecutor::COMPLETIONS);