mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#396) Wip: Adding an Eclipse WellLog Curve with the pointers to the needed data.
This commit is contained in:
parent
406d34c411
commit
26eada49e2
@ -158,3 +158,105 @@ bool RimWellLogPlotCurve::depthRange(double* minimumDepth, double* maximumDepth)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RiaApplication.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellLogEclipseCurve, "WellLogEclipseCurve");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogEclipseCurve::RimWellLogEclipseCurve()
|
||||
{
|
||||
CAF_PDM_InitObject("Well Log Curve", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellPath, "CurveWellPath", "Well Path", "", "", "");
|
||||
m_wellPath.uiCapability()->setUiChildrenHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_case, "CurveEclipseCase", "Case", "", "", "");
|
||||
m_case.uiCapability()->setUiChildrenHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_resultdefinition, "CurveResult", "", "", "", "");
|
||||
m_resultdefinition.uiCapability()->setUiChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_timeStep, "CurveTimeStep", "Time Step", "", "", "");
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogEclipseCurve::~RimWellLogEclipseCurve()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogEclipseCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
RimWellLogPlotCurve::fieldChangedByUi(changedField, oldValue, newValue);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogEclipseCurve::updatePlotData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimWellLogEclipseCurve::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> optionList;
|
||||
|
||||
if (fieldNeedingOptions == &m_wellPath)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
caf::PdmChildArrayField<RimWellPath*>& wellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
|
||||
|
||||
for (size_t i = 0; i< wellPaths.size(); i++)
|
||||
{
|
||||
optionList.push_back(caf::PdmOptionItemInfo(wellPaths[i]->name(), QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(wellPaths[i]))));
|
||||
}
|
||||
|
||||
if (optionList.size() > 0)
|
||||
{
|
||||
optionList.push_front(caf::PdmOptionItemInfo("None", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(NULL))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (fieldNeedingOptions == &m_case)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<RimCase*> cases;
|
||||
|
||||
proj->allCases(cases);
|
||||
|
||||
for (size_t i = 0; i< cases.size(); i++)
|
||||
{
|
||||
optionList.push_back(caf::PdmOptionItemInfo(cases[i]->caseUserDescription(), QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(cases[i]))));
|
||||
}
|
||||
|
||||
if (optionList.size() > 0)
|
||||
{
|
||||
optionList.push_front(caf::PdmOptionItemInfo("None", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(NULL))));
|
||||
}
|
||||
}
|
||||
|
||||
return optionList;
|
||||
}
|
||||
|
@ -46,18 +46,51 @@ public:
|
||||
protected:
|
||||
|
||||
// Overridden PDM methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
void updatePlotData();
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
|
||||
private:
|
||||
virtual void updatePlotData();
|
||||
|
||||
caf::PdmField<bool> m_showCurve;
|
||||
caf::PdmField<QString> m_userName;
|
||||
// caf::PdmField<QColor> m_curveColor;
|
||||
// caf::PdmField<Linestyle> m_lineStyle;
|
||||
// caf::PdmField<int> m_lineWidth;
|
||||
|
||||
RiuWellLogTracePlot* m_plot;
|
||||
QwtPlotCurve* m_plotCurve;
|
||||
};
|
||||
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
|
||||
class RimWellPath;
|
||||
class RimEclipseResultDefinition;
|
||||
class RimCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimWellLogEclipseCurve : public RimWellLogPlotCurve
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimWellLogEclipseCurve();
|
||||
virtual ~RimWellLogEclipseCurve();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual void updatePlotData();
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
|
||||
caf::PdmPtrField<RimWellPath*> m_wellPath;
|
||||
caf::PdmPtrField<RimCase*> m_case;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_resultdefinition;
|
||||
caf::PdmField<int> m_timeStep;
|
||||
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user