mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2227 Well formatins: Clear well path if it does not have well picks
This commit is contained in:
@@ -248,17 +248,31 @@ void RimTools::wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>*
|
|||||||
CVF_ASSERT(options);
|
CVF_ASSERT(options);
|
||||||
if (!options) return;
|
if (!options) return;
|
||||||
|
|
||||||
RimProject* proj = RiaApplication::instance()->project();
|
std::vector<RimWellPath*> wellPaths;
|
||||||
if (proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection())
|
RimTools::wellPathWithFormations(&wellPaths);
|
||||||
{
|
|
||||||
caf::PdmChildArrayField<RimWellPath*>& wellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
|
|
||||||
|
|
||||||
QIcon wellIcon(":/Well.png");
|
QIcon wellIcon(":/Well.png");
|
||||||
for (RimWellPath* wellPath : wellPaths)
|
for (RimWellPath* wellPath : wellPaths)
|
||||||
|
{
|
||||||
|
options->push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath, false, wellIcon));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimTools::wellPathWithFormations(std::vector<RimWellPath*>* wellPaths)
|
||||||
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection())
|
||||||
|
{
|
||||||
|
caf::PdmChildArrayField<RimWellPath*>& allWellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
|
||||||
|
|
||||||
|
for (RimWellPath* wellPath : allWellPaths)
|
||||||
{
|
{
|
||||||
if (wellPath->hasFormations())
|
if (wellPath->hasFormations())
|
||||||
{
|
{
|
||||||
options->push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath, false, wellIcon));
|
wellPaths->push_back(wellPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
@@ -43,6 +45,7 @@ public:
|
|||||||
|
|
||||||
static void wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
static void wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
||||||
static void wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
static void wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
||||||
|
static void wellPathWithFormations(std::vector<RimWellPath*>* wellPaths);
|
||||||
static void caseOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
static void caseOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
||||||
|
|
||||||
static QString createTimeFormatStringFromDates(const std::vector<QDateTime>& dates);
|
static QString createTimeFormatStringFromDates(const std::vector<QDateTime>& dates);
|
||||||
|
|||||||
@@ -277,6 +277,22 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|||||||
pltPlot->updateConnectedEditors();
|
pltPlot->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool validWellPathChosen = false;
|
||||||
|
std::vector<RimWellPath*> wellPaths;
|
||||||
|
RimTools::wellPathWithFormations(&wellPaths);
|
||||||
|
for (RimWellPath* wellPath : wellPaths)
|
||||||
|
{
|
||||||
|
if (wellPath == m_formationWellPath)
|
||||||
|
{
|
||||||
|
validWellPathChosen = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!validWellPathChosen)
|
||||||
|
{
|
||||||
|
m_formationWellPath = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (changedField == &m_formationCase)
|
else if (changedField == &m_formationCase)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user