mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1903 Export completions. Save dialog contents
This commit is contained in:
parent
20164ec003
commit
a05f357597
@ -83,6 +83,14 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi(bool onlyWe
|
|||||||
m_displayForSimWell = true;
|
m_displayForSimWell = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicExportCompletionDataSettingsUi::setOnlyWellPathCollectionSelected(bool onlyWellPathCollectionSelected)
|
||||||
|
{
|
||||||
|
m_onlyWellPathCollectionSelected = onlyWellPathCollectionSelected;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -55,7 +55,6 @@ public:
|
|||||||
RicExportCompletionDataSettingsUi();
|
RicExportCompletionDataSettingsUi();
|
||||||
RicExportCompletionDataSettingsUi(bool onlyWellPathCollectionSelected);
|
RicExportCompletionDataSettingsUi(bool onlyWellPathCollectionSelected);
|
||||||
|
|
||||||
|
|
||||||
caf::PdmField<ExportSplitType> fileSplit;
|
caf::PdmField<ExportSplitType> fileSplit;
|
||||||
caf::PdmField<WellSelectionType> wellSelection;
|
caf::PdmField<WellSelectionType> wellSelection;
|
||||||
caf::PdmField<CompdatExportType> compdatExport;
|
caf::PdmField<CompdatExportType> compdatExport;
|
||||||
@ -72,6 +71,8 @@ public:
|
|||||||
|
|
||||||
caf::PdmField<int> timeStep;
|
caf::PdmField<int> timeStep;
|
||||||
|
|
||||||
|
void setOnlyWellPathCollectionSelected(bool onlyWellPathCollectionSelected);
|
||||||
|
|
||||||
void showForSimWells();
|
void showForSimWells();
|
||||||
void showForWellPath();
|
void showForWellPath();
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "RigWellPath.h"
|
#include "RigWellPath.h"
|
||||||
#include "RigWellPathIntersectionTools.h"
|
#include "RigWellPathIntersectionTools.h"
|
||||||
|
|
||||||
|
#include "RimDialogData.h"
|
||||||
#include "RimSimWellInViewCollection.h"
|
#include "RimSimWellInViewCollection.h"
|
||||||
#include "RimFishboneWellPath.h"
|
#include "RimFishboneWellPath.h"
|
||||||
#include "RimFishboneWellPathCollection.h"
|
#include "RimFishboneWellPathCollection.h"
|
||||||
@ -110,20 +111,21 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
|
|||||||
CVF_ASSERT(wellPaths.size() > 0 || simWells.size() > 0);
|
CVF_ASSERT(wellPaths.size() > 0 || simWells.size() > 0);
|
||||||
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
|
RimProject* project = app->project();
|
||||||
|
|
||||||
QString projectFolder = app->currentProjectPath();
|
QString projectFolder = app->currentProjectPath();
|
||||||
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder);
|
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder);
|
||||||
|
|
||||||
bool onlyWellPathCollectionSelected = noWellPathsSelectedDirectly();
|
bool onlyWellPathCollectionSelected = noWellPathsSelectedDirectly();
|
||||||
RicExportCompletionDataSettingsUi exportSettings(onlyWellPathCollectionSelected);
|
RicExportCompletionDataSettingsUi* exportSettings = project->dialogData()->exportCompletionData(onlyWellPathCollectionSelected);
|
||||||
|
|
||||||
if (wellPaths.empty())
|
if (wellPaths.empty())
|
||||||
{
|
{
|
||||||
exportSettings.showForSimWells();
|
exportSettings->showForSimWells();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exportSettings.showForWellPath();
|
exportSettings->showForWellPath();
|
||||||
}
|
}
|
||||||
std::vector<RimCase*> cases;
|
std::vector<RimCase*> cases;
|
||||||
app->project()->allCases(cases);
|
app->project()->allCases(cases);
|
||||||
@ -132,19 +134,19 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
|
|||||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(c);
|
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(c);
|
||||||
if (eclipseCase != nullptr)
|
if (eclipseCase != nullptr)
|
||||||
{
|
{
|
||||||
exportSettings.caseToApply = eclipseCase;
|
exportSettings->caseToApply = eclipseCase;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exportSettings.folder = defaultDir;
|
exportSettings->folder = defaultDir;
|
||||||
|
|
||||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Completion Data", "");
|
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), exportSettings, "Export Completion Data", "");
|
||||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||||
|
|
||||||
if (propertyDialog.exec() == QDialog::Accepted)
|
if (propertyDialog.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings.folder);
|
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings->folder);
|
||||||
|
|
||||||
exportCompletions(wellPaths, simWells, exportSettings);
|
exportCompletions(wellPaths, simWells, exportSettings);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "RimDialogData.h"
|
#include "RimDialogData.h"
|
||||||
|
|
||||||
#include "ExportCommands/RicExportCarfinUi.h"
|
#include "ExportCommands/RicExportCarfinUi.h"
|
||||||
|
#include "CompletionCommands/RicExportCompletionDataSettingsUi.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimDialogData, "RimDialogData");
|
CAF_PDM_SOURCE_INIT(RimDialogData, "RimDialogData");
|
||||||
|
|
||||||
@ -31,6 +32,9 @@ RimDialogData::RimDialogData()
|
|||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_exportCarfin, "ExportCarfin", "Export Carfin", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_exportCarfin, "ExportCarfin", "Export Carfin", "", "", "");
|
||||||
m_exportCarfin = new RicExportCarfinUi;
|
m_exportCarfin = new RicExportCarfinUi;
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&m_exportCompletionData, "ExportCompletionData", "Export Completion Data", "", "", "");
|
||||||
|
m_exportCompletionData = new RicExportCompletionDataSettingsUi(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -58,3 +62,12 @@ void RimDialogData::setExportCarfinDataFromString(const QString& data)
|
|||||||
m_exportCarfin->resolveReferencesRecursively();
|
m_exportCarfin->resolveReferencesRecursively();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RicExportCompletionDataSettingsUi* RimDialogData::exportCompletionData(bool onlyWellPathCollectionSelected) const
|
||||||
|
{
|
||||||
|
m_exportCompletionData->setOnlyWellPathCollectionSelected(onlyWellPathCollectionSelected);
|
||||||
|
return m_exportCompletionData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "cafPdmChildField.h"
|
#include "cafPdmChildField.h"
|
||||||
|
|
||||||
class RicExportCarfinUi;
|
class RicExportCarfinUi;
|
||||||
|
class RicExportCompletionDataSettingsUi;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -38,6 +39,9 @@ public:
|
|||||||
QString exportCarfinDataAsString() const;
|
QString exportCarfinDataAsString() const;
|
||||||
void setExportCarfinDataFromString(const QString& data);
|
void setExportCarfinDataFromString(const QString& data);
|
||||||
|
|
||||||
|
RicExportCompletionDataSettingsUi* exportCompletionData(bool onlyWellPathCollectionSelected) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmChildField<RicExportCarfinUi*> m_exportCarfin;
|
caf::PdmChildField<RicExportCarfinUi*> m_exportCarfin;
|
||||||
|
caf::PdmChildField<RicExportCompletionDataSettingsUi*> m_exportCompletionData;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user