(#396) Added the data (with gui) to curves to define the well log extraction

This commit is contained in:
Jacob Støren 2015-09-02 09:17:36 +02:00
parent b29ad69673
commit e44a78cf57
7 changed files with 117 additions and 22 deletions

View File

@ -47,7 +47,7 @@ void RicNewWellLogPlotCurveFeature::onActionTriggered(bool isChecked)
RimWellLogPlotTrace* wellLogPlotTrace = selectedWellLogPlotTrace(); RimWellLogPlotTrace* wellLogPlotTrace = selectedWellLogPlotTrace();
if (wellLogPlotTrace) if (wellLogPlotTrace)
{ {
RimWellLogPlotCurve* curve = new RimWellLogPlotCurve(); RimWellLogPlotCurve* curve = new RimWellLogEclipseCurve();
wellLogPlotTrace->addCurve(curve); wellLogPlotTrace->addCurve(curve);
curve->setUiName(QString("Curve %1").arg(wellLogPlotTrace->curves.size())); curve->setUiName(QString("Curve %1").arg(wellLogPlotTrace->curves.size()));

View File

@ -34,6 +34,7 @@
#include "cafPdmUiListEditor.h" #include "cafPdmUiListEditor.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimLinkedViews.h" #include "RimLinkedViews.h"
#include "RimWellLogPlotCurve.h"
CAF_PDM_SOURCE_INIT(RimEclipseResultDefinition, "ResultDefinition"); CAF_PDM_SOURCE_INIT(RimEclipseResultDefinition, "ResultDefinition");
@ -124,7 +125,13 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
} }
} }
RimEclipsePropertyFilter* propFilter = dynamic_cast<RimEclipsePropertyFilter*>(this->parentField()->ownerObject());
RimView* view = NULL;
this->firstAnchestorOrThisOfType(view);
RimWellLogEclipseCurve* curve = NULL;
this->firstAnchestorOrThisOfType(curve);
if (&m_resultVariableUiField == changedField) if (&m_resultVariableUiField == changedField)
{ {
m_porosityModel = m_porosityModelUiField; m_porosityModel = m_porosityModelUiField;
@ -133,14 +140,11 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
loadResult(); loadResult();
RimEclipsePropertyFilter* propFilter = dynamic_cast<RimEclipsePropertyFilter*>(this->parentField()->ownerObject());
if (propFilter) if (propFilter)
{ {
propFilter->setToDefaultValues(); propFilter->setToDefaultValues();
propFilter->updateFilterName(); propFilter->updateFilterName();
RimView* view = NULL;
this->firstAnchestorOrThisOfType(view);
if (view) if (view)
{ {
view->scheduleGeometryRegen(PROPERTY_FILTERED); view->scheduleGeometryRegen(PROPERTY_FILTERED);
@ -150,8 +154,6 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
if (dynamic_cast<RimEclipseCellColors*>(this)) if (dynamic_cast<RimEclipseCellColors*>(this))
{ {
RimView* view = NULL;
this->firstAnchestorOrThisOfType(view);
if (view) if (view)
{ {
RimProject* proj = NULL; RimProject* proj = NULL;
@ -164,9 +166,13 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
} }
} }
} }
if (curve)
{
curve->updatePlotData();
}
} }
RimEclipsePropertyFilter* propFilter = dynamic_cast<RimEclipsePropertyFilter*>(this->parentField()->ownerObject());
if (propFilter) if (propFilter)
{ {
propFilter->updateConnectedEditors(); propFilter->updateConnectedEditors();
@ -177,6 +183,12 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
{ {
faultColors->updateConnectedEditors(); faultColors->updateConnectedEditors();
} }
if (curve)
{
curve->updateConnectedEditors();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -72,6 +72,7 @@ protected:
friend class RimEclipsePropertyFilter; friend class RimEclipsePropertyFilter;
friend class RimEclipseFaultColors; friend class RimEclipseFaultColors;
friend class RimWellLogEclipseCurve;
// User interface only fields, to support "filtering"-like behaviour etc. // User interface only fields, to support "filtering"-like behaviour etc.
caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > m_resultTypeUiField; caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > m_resultTypeUiField;

View File

@ -36,6 +36,7 @@
#include "cafPdmUiListEditor.h" #include "cafPdmUiListEditor.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimLinkedViews.h" #include "RimLinkedViews.h"
#include "RimWellLogPlotCurve.h"
namespace caf { namespace caf {
@ -155,6 +156,9 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
RimGeoMechPropertyFilter* propFilter = dynamic_cast<RimGeoMechPropertyFilter*>(this->parentField()->ownerObject()); RimGeoMechPropertyFilter* propFilter = dynamic_cast<RimGeoMechPropertyFilter*>(this->parentField()->ownerObject());
RimView* view = NULL; RimView* view = NULL;
this->firstAnchestorOrThisOfType(view); this->firstAnchestorOrThisOfType(view);
RimWellLogEclipseCurve* curve = NULL;
this->firstAnchestorOrThisOfType(curve);
if (&m_resultVariableUiField == changedField) if (&m_resultVariableUiField == changedField)
{ {
@ -189,8 +193,6 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
if (dynamic_cast<RimGeoMechCellColors*>(this)) if (dynamic_cast<RimGeoMechCellColors*>(this))
{ {
RimView* view = NULL;
this->firstAnchestorOrThisOfType(view);
if (view) if (view)
{ {
RimProject* proj = NULL; RimProject* proj = NULL;
@ -203,6 +205,11 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
} }
} }
} }
if (curve)
{
curve->updatePlotData();
}
} }
} }
@ -211,6 +218,10 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
propFilter->updateConnectedEditors(); propFilter->updateConnectedEditors();
} }
if (curve)
{
curve->updateConnectedEditors();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -61,8 +61,7 @@ public:
QString resultComponentUiName(); QString resultComponentUiName();
protected: protected:
friend class RimGeoMechPropertyFilter; // Property filter needs the ui fields
private: private:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool * useOptionsOnly); bool * useOptionsOnly);
@ -79,6 +78,9 @@ private:
caf::PdmField<QString> m_resultFieldName; caf::PdmField<QString> m_resultFieldName;
caf::PdmField<QString> m_resultComponentName; caf::PdmField<QString> m_resultComponentName;
friend class RimGeoMechPropertyFilter; // Property filter needs the ui fields
friend class RimWellLogEclipseCurve; // Curve needs the ui fields
caf::PdmField<caf::AppEnum<RigFemResultPosEnum> > m_resultPositionTypeUiField; caf::PdmField<caf::AppEnum<RigFemResultPosEnum> > m_resultPositionTypeUiField;
caf::PdmField<QString> m_resultVariableUiField; caf::PdmField<QString> m_resultVariableUiField;

View File

@ -167,6 +167,8 @@ bool RimWellLogPlotCurve::depthRange(double* minimumDepth, double* maximumDepth)
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimEclipseCase.h" #include "RimEclipseCase.h"
#include "RimEclipseResultDefinition.h" #include "RimEclipseResultDefinition.h"
#include "RimGeoMechResultDefinition.h"
#include "RimGeoMechCase.h"
//================================================================================================== //==================================================================================================
/// ///
@ -183,12 +185,16 @@ RimWellLogEclipseCurve::RimWellLogEclipseCurve()
CAF_PDM_InitFieldNoDefault(&m_wellPath, "CurveWellPath", "Well Path", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_wellPath, "CurveWellPath", "Well Path", "", "", "");
m_wellPath.uiCapability()->setUiChildrenHidden(true); m_wellPath.uiCapability()->setUiChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&m_case, "CurveEclipseCase", "Case", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_case, "CurveCase", "Case", "", "", "");
m_case.uiCapability()->setUiChildrenHidden(true); m_case.uiCapability()->setUiChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&m_resultdefinition, "CurveResult", "", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_eclipseResultDefinition, "CurveEclipseResult", "", "", "", "");
m_resultdefinition.uiCapability()->setUiChildrenHidden(true); m_eclipseResultDefinition.uiCapability()->setUiChildrenHidden(true);
m_eclipseResultDefinition = new RimEclipseResultDefinition;
CAF_PDM_InitFieldNoDefault(&m_geomResultDefinition, "CurveGeomechResult", "", "", "", "");
m_geomResultDefinition.uiCapability()->setUiChildrenHidden(true);
m_geomResultDefinition = new RimGeoMechResultDefinition;
CAF_PDM_InitFieldNoDefault(&m_timeStep, "CurveTimeStep", "Time Step", "", "", ""); CAF_PDM_InitField(&m_timeStep, "CurveTimeStep", 0,"Time Step", "", "", "");
} }
@ -206,6 +212,15 @@ RimWellLogEclipseCurve::~RimWellLogEclipseCurve()
void RimWellLogEclipseCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) void RimWellLogEclipseCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{ {
RimWellLogPlotCurve::fieldChangedByUi(changedField, oldValue, newValue); RimWellLogPlotCurve::fieldChangedByUi(changedField, oldValue, newValue);
if (changedField == &m_case)
{
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value());
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
m_eclipseResultDefinition->setEclipseCase(eclipseCase);
m_geomResultDefinition->setGeoMechCase(geomCase);
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -213,7 +228,33 @@ void RimWellLogEclipseCurve::fieldChangedByUi(const caf::PdmFieldHandle* changed
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogEclipseCurve::updatePlotData() void RimWellLogEclipseCurve::updatePlotData()
{ {
if (m_wellPath)
{
//RigWellLog m_wellPath->wellPathGeometry()->wellLogExtractor(m_case);
std::vector<double> values;
values.push_back(34);
values.push_back(47);
values.push_back(49);
values.push_back(22);
values.push_back(20);
std::vector<double> depthValues;
depthValues.push_back(200);
depthValues.push_back(400);
depthValues.push_back(600);
depthValues.push_back(800);
depthValues.push_back(1000);
m_plotCurve->setSamples(values.data(), depthValues.data(), (int)depthValues.size());
RimWellLogPlot* wellLogPlot;
firstAnchestorOrThisOfType(wellLogPlot);
if (wellLogPlot)
{
wellLogPlot->updateAvailableDepthRange();
}
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -260,3 +301,30 @@ QList<caf::PdmOptionItemInfo> RimWellLogEclipseCurve::calculateValueOptions(cons
return optionList; return optionList;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogEclipseCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value());
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
uiOrdering.add(&m_userName);
uiOrdering.add(&m_wellPath);
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
group1->add(&m_case);
if (eclipseCase)
{
group1->add(&(m_eclipseResultDefinition->m_resultTypeUiField));
group1->add(&(m_eclipseResultDefinition->m_porosityModelUiField));
group1->add(&(m_eclipseResultDefinition->m_resultVariableUiField));
}
if (geomCase)
{
group1->add(&(m_geomResultDefinition->m_resultPositionTypeUiField));
group1->add(&(m_geomResultDefinition->m_resultVariableUiField));
}
}

View File

@ -42,6 +42,7 @@ public:
void setPlot(RiuWellLogTracePlot* plot); void setPlot(RiuWellLogTracePlot* plot);
bool depthRange(double* minimumDepth, double* maximumDepth); bool depthRange(double* minimumDepth, double* maximumDepth);
virtual void updatePlotData();
protected: protected:
@ -50,7 +51,6 @@ protected:
virtual caf::PdmFieldHandle* objectToggleField(); virtual caf::PdmFieldHandle* objectToggleField();
virtual caf::PdmFieldHandle* userDescriptionField(); virtual caf::PdmFieldHandle* userDescriptionField();
virtual void updatePlotData();
caf::PdmField<bool> m_showCurve; caf::PdmField<bool> m_showCurve;
caf::PdmField<QString> m_userName; caf::PdmField<QString> m_userName;
@ -67,6 +67,7 @@ protected:
class RimWellPath; class RimWellPath;
class RimEclipseResultDefinition; class RimEclipseResultDefinition;
class RimGeoMechResultDefinition;
class RimCase; class RimCase;
//================================================================================================== //==================================================================================================
@ -79,18 +80,18 @@ class RimWellLogEclipseCurve : public RimWellLogPlotCurve
public: public:
RimWellLogEclipseCurve(); RimWellLogEclipseCurve();
virtual ~RimWellLogEclipseCurve(); virtual ~RimWellLogEclipseCurve();
virtual void updatePlotData();
protected: protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
virtual void updatePlotData(); virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly); virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
caf::PdmPtrField<RimWellPath*> m_wellPath; caf::PdmPtrField<RimWellPath*> m_wellPath;
caf::PdmPtrField<RimCase*> m_case; caf::PdmPtrField<RimCase*> m_case;
caf::PdmChildField<RimEclipseResultDefinition*> m_resultdefinition; caf::PdmChildField<RimEclipseResultDefinition*> m_eclipseResultDefinition;
caf::PdmChildField<RimGeoMechResultDefinition*> m_geomResultDefinition;
caf::PdmField<int> m_timeStep; caf::PdmField<int> m_timeStep;
}; };