mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2025 Formations : Use imported formation names by default when sensible
This commit is contained in:
parent
3f90e8a632
commit
3eaeba8f67
@ -20,10 +20,18 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimFormationNames.h"
|
||||
#include "RimFormationNamesCollection.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -66,6 +74,28 @@ void RicImportFormationNamesFeature::onActionTriggered(bool isChecked)
|
||||
// For each file, find existing Formation names item, or create new
|
||||
|
||||
RimFormationNames* formationName = fomNameColl->importFiles(fileNames);
|
||||
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases(cases);
|
||||
|
||||
if (cases.size() == 1)
|
||||
{
|
||||
std::vector<RimEclipseCase*> eclCases = proj->eclipseCases();
|
||||
if (eclCases.size() == 1)
|
||||
{
|
||||
eclCases[0]->activeFormationNames = formationName;
|
||||
eclCases[0]->eclipseCaseData()->setActiveFormationNames(formationName->formationNamesData());
|
||||
}
|
||||
|
||||
std::vector<RimGeoMechCase*> geoMechCases = proj->geoMechCases();
|
||||
|
||||
if (geoMechCases.size() == 1)
|
||||
{
|
||||
geoMechCases[0]->activeFormationNames = formationName;
|
||||
geoMechCases[0]->geoMechData()->femPartResults()->setActiveFormationNames(formationName->formationNamesData());
|
||||
}
|
||||
}
|
||||
|
||||
proj->updateConnectedEditors();
|
||||
|
||||
if (formationName)
|
||||
|
@ -919,6 +919,30 @@ RimWellPath* RimProject::wellPathFromSimulationWell(const QString& simWellName,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimGeoMechCase*> RimProject::geoMechCases() const
|
||||
{
|
||||
std::vector<RimGeoMechCase*> cases;
|
||||
|
||||
for (size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++)
|
||||
{
|
||||
RimOilField* oilField = oilFields[oilFieldIdx];
|
||||
if (!oilField) continue;
|
||||
|
||||
RimGeoMechModels* geomModels = oilField->geoMechModels();
|
||||
if (geomModels)
|
||||
{
|
||||
for (size_t caseIdx = 0; caseIdx < geomModels->cases.size(); caseIdx++)
|
||||
{
|
||||
cases.push_back(geomModels->cases[caseIdx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return cases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -34,10 +34,12 @@ class RigGridManager;
|
||||
class RigMainGrid;
|
||||
class RigWellPath;
|
||||
|
||||
class RimCalculationCollection;
|
||||
class RimCase;
|
||||
class RimCommandObject;
|
||||
class RimDialogData;
|
||||
class RimEclipseCase;
|
||||
class RimGeoMechCase;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimMainPlotCollection;
|
||||
class RimMultiSnapshotDefinition;
|
||||
@ -48,9 +50,8 @@ class RimSummaryCase;
|
||||
class RimView;
|
||||
class RimViewLinker;
|
||||
class RimViewLinkerCollection;
|
||||
class RimWellPathImport;
|
||||
class RimCalculationCollection;
|
||||
class RimWellPath;
|
||||
class RimWellPathImport;
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@ -127,6 +128,8 @@ public:
|
||||
std::vector<const RigWellPath*> simulationWellBranches(const QString& simWellName);
|
||||
RimWellPath* wellPathFromSimulationWell(const QString& simWellName, int branchIndex = -1);
|
||||
|
||||
std::vector<RimGeoMechCase*> geoMechCases() const;
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
void initScriptDirectories();
|
||||
|
Loading…
Reference in New Issue
Block a user