mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3169 Implement proper auto name for well log plots
This commit is contained in:
parent
be63eb5aef
commit
022aac3682
@ -72,7 +72,7 @@ void Rim3dWellLogCurveCollection::add3dWellLogCurve(Rim3dWellLogCurve* curve)
|
||||
size_t index = m_3dWellLogCurves.size();
|
||||
curve->setColor(RiaColorTables::wellLogPlotPaletteColors().cycledColor3f(index));
|
||||
m_3dWellLogCurves.push_back(curve);
|
||||
curve->createCurveAutoName();
|
||||
curve->createAutoName();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ void Rim3dWellLogCurve::defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dWellLogCurve::initAfterRead()
|
||||
{
|
||||
this->createCurveAutoName();
|
||||
this->createAutoName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -274,7 +274,7 @@ QString Rim3dWellLogExtractionCurve::name() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim3dWellLogExtractionCurve::createCurveAutoName() const
|
||||
QString Rim3dWellLogExtractionCurve::createAutoName() const
|
||||
{
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value());
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
virtual std::pair<double, double> findCurveValueRange() override;
|
||||
|
||||
virtual QString name() const override;
|
||||
virtual QString createCurveAutoName() const override;
|
||||
virtual QString createAutoName() const override;
|
||||
double rkbDiff() const;
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
@ -119,7 +119,7 @@ QString Rim3dWellLogFileCurve::name() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim3dWellLogFileCurve::createCurveAutoName() const
|
||||
QString Rim3dWellLogFileCurve::createAutoName() const
|
||||
{
|
||||
QStringList name;
|
||||
QString unit;
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
virtual void curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const override;
|
||||
virtual QString resultPropertyString() const override;
|
||||
virtual QString name() const override;
|
||||
virtual QString createCurveAutoName() const override;
|
||||
virtual QString createAutoName() const override;
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
|
@ -99,7 +99,7 @@ QString Rim3dWellLogRftCurve::name() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim3dWellLogRftCurve::createCurveAutoName() const
|
||||
QString Rim3dWellLogRftCurve::createAutoName() const
|
||||
{
|
||||
QStringList name;
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
|
||||
virtual QString resultPropertyString() const override;
|
||||
virtual QString name() const override;
|
||||
virtual QString createCurveAutoName() const override;
|
||||
virtual QString createAutoName() const override;
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
@ -92,6 +92,14 @@ void RimWellLogCurveCommonDataSource::setWellPathToApply(RimWellPath* val)
|
||||
m_wellPath = val;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellLogCurveCommonDataSource::simWellNameToApply() const
|
||||
{
|
||||
return m_simWellName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
void setCaseToApply(RimCase* val);
|
||||
RimWellPath* wellPathToApply() const;
|
||||
void setWellPathToApply(RimWellPath* val);
|
||||
QString simWellNameToApply() const;
|
||||
int timeStepToApply() const;
|
||||
void setTimeStepToApply(int val);
|
||||
void updateDefaultOptions(const std::vector<RimWellLogCurve*>& curves);
|
||||
@ -65,6 +66,6 @@ private:
|
||||
caf::PdmPtrField<RimWellPath*> m_wellPath;
|
||||
caf::PdmField<QString> m_simWellName;
|
||||
caf::PdmField<int> m_branchIndex;
|
||||
caf::PdmField<caf::Tristate> m_branchDetection;
|
||||
caf::PdmField<caf::Tristate> m_branchDetection;
|
||||
caf::PdmField<int> m_timeStep;
|
||||
};
|
||||
|
@ -105,7 +105,7 @@ void RimCurveNameConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedFiel
|
||||
|
||||
if (changedField == &m_isUsingAutoName && !isUsingAutoName())
|
||||
{
|
||||
m_customName = m_configHolder->createCurveAutoName();
|
||||
m_customName = m_configHolder->createAutoName();
|
||||
}
|
||||
|
||||
updateAllSettings();
|
||||
@ -116,7 +116,7 @@ void RimCurveNameConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedFiel
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimCurveNameConfig::autoName() const
|
||||
{
|
||||
return m_configHolder->createCurveAutoName();
|
||||
return m_configHolder->createAutoName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -138,10 +138,14 @@ void RimCurveNameConfig::updateAllSettings()
|
||||
m_autoName.uiCapability()->updateConnectedEditors();
|
||||
m_customName.uiCapability()->updateConnectedEditors();
|
||||
|
||||
Rim3dWellLogCurve* curve;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curve);
|
||||
curve->updateConnectedEditors();
|
||||
|
||||
RimCurveNameConfigHolderInterface* holder;
|
||||
this->firstAncestorOrThisOfTypeAsserted(holder);
|
||||
holder->updateHolder();
|
||||
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>(holder);
|
||||
if (pdmObject)
|
||||
{
|
||||
pdmObject->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
|
@ -29,7 +29,8 @@
|
||||
class RimCurveNameConfigHolderInterface
|
||||
{
|
||||
public:
|
||||
virtual QString createCurveAutoName() const = 0;
|
||||
virtual QString createAutoName() const = 0;
|
||||
virtual void updateHolder() {}
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
#include "RimWellLogCurveCommonDataSource.h"
|
||||
@ -105,6 +107,9 @@ RimWellLogPlot::RimWellLogPlot()
|
||||
CAF_PDM_InitFieldNoDefault(&m_tracks, "Tracks", "", "", "", "");
|
||||
m_tracks.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "", "", "", "");
|
||||
m_nameConfig = new RimWellLogExtractionCurveNameConfig(this);
|
||||
|
||||
m_minAvailableDepth = HUGE_VAL;
|
||||
m_maxAvailableDepth = -HUGE_VAL;
|
||||
}
|
||||
@ -120,6 +125,7 @@ RimWellLogPlot::~RimWellLogPlot()
|
||||
|
||||
deleteViewWidget();
|
||||
delete m_commonDataSource;
|
||||
delete m_nameConfig;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -602,6 +608,54 @@ void RimWellLogPlot::uiOrderingForPlotSettings(caf::PdmUiOrdering& uiOrdering)
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellLogPlot::createAutoName() const
|
||||
{
|
||||
RimCase* commonCase = m_commonDataSource->caseToApply();
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(commonCase);
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(commonCase);
|
||||
|
||||
QStringList generatedCurveName;
|
||||
|
||||
if (m_nameConfig->addWellName())
|
||||
{
|
||||
RimWellPath* wellPath = m_commonDataSource->wellPathToApply();
|
||||
if (wellPath && !wellPath->name().isEmpty())
|
||||
{
|
||||
generatedCurveName.push_back(wellPath->name());
|
||||
}
|
||||
else if (!m_commonDataSource->simWellNameToApply().isEmpty())
|
||||
{
|
||||
generatedCurveName.push_back(m_commonDataSource->simWellNameToApply());
|
||||
}
|
||||
}
|
||||
|
||||
if (m_nameConfig->addCaseName() && commonCase)
|
||||
{
|
||||
generatedCurveName.push_back(commonCase->caseUserDescription());
|
||||
}
|
||||
|
||||
if (m_nameConfig->addDate())
|
||||
{
|
||||
if (commonCase && m_commonDataSource->timeStepToApply() != -1)
|
||||
{
|
||||
generatedCurveName.push_back(commonCase->timeStepName(m_commonDataSource->timeStepToApply()));
|
||||
}
|
||||
}
|
||||
|
||||
return m_userName + QString(": ") + generatedCurveName.join(", ");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::updateHolder()
|
||||
{
|
||||
this->updatePlotTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -621,11 +675,19 @@ void RimWellLogPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
m_commonDataSource->uiOrdering(uiConfigName, uiOrdering);
|
||||
uiOrderingForDepthAxis(uiOrdering);
|
||||
uiOrderingForPlotSettings(uiOrdering);
|
||||
|
||||
m_nameConfig()->createUiGroup(uiConfigName, uiOrdering);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimWellLogPlot::userDescriptionField()
|
||||
{
|
||||
return m_nameConfig->nameField();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RimViewWindow.h"
|
||||
#include "RimWellLogCurveNameConfig.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
@ -41,7 +42,7 @@ class RimWellPltPlot;
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimWellLogPlot : public RimViewWindow
|
||||
class RimWellLogPlot : public RimViewWindow, public RimCurveNameConfigHolderInterface
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@ -121,12 +122,15 @@ public:
|
||||
void uiOrderingForDepthAxis(caf::PdmUiOrdering& uiOrdering);
|
||||
void uiOrderingForPlotSettings(caf::PdmUiOrdering& uiOrdering);
|
||||
|
||||
virtual QString createAutoName() const override;
|
||||
void updateHolder() override;
|
||||
|
||||
protected:
|
||||
|
||||
// Overridden PDM methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
|
||||
@ -148,21 +152,23 @@ private:
|
||||
void updatePlotTitle();
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
|
||||
caf::PdmChildArrayField<RimWellLogTrack*> m_tracks;
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
|
||||
caf::PdmChildArrayField<RimWellLogTrack*> m_tracks;
|
||||
|
||||
caf::PdmField< caf::AppEnum<DepthTypeEnum>> m_depthType;
|
||||
caf::PdmField< caf::AppEnum<RiaDefines::DepthUnitType>> m_depthUnit;
|
||||
std::set<RimWellLogPlot::DepthTypeEnum> m_disabledDepthTypes;
|
||||
caf::PdmField<double> m_minVisibleDepth;
|
||||
caf::PdmField<double> m_maxVisibleDepth;
|
||||
caf::PdmField<AxisGridEnum> m_depthAxisGridVisibility;
|
||||
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
|
||||
caf::PdmField< caf::AppEnum<DepthTypeEnum>> m_depthType;
|
||||
caf::PdmField< caf::AppEnum<RiaDefines::DepthUnitType>> m_depthUnit;
|
||||
std::set<RimWellLogPlot::DepthTypeEnum> m_disabledDepthTypes;
|
||||
caf::PdmField<double> m_minVisibleDepth;
|
||||
caf::PdmField<double> m_maxVisibleDepth;
|
||||
caf::PdmField<AxisGridEnum> m_depthAxisGridVisibility;
|
||||
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
|
||||
|
||||
caf::PdmField<bool> m_showTitleInPlot;
|
||||
caf::PdmField<bool> m_showTrackLegends;
|
||||
caf::PdmField<bool> m_trackLegendsHorizontal;
|
||||
caf::PdmField<bool> m_showTitleInPlot;
|
||||
caf::PdmField<bool> m_showTrackLegends;
|
||||
caf::PdmField<bool> m_trackLegendsHorizontal;
|
||||
|
||||
caf::PdmChildField<RimWellLogExtractionCurveNameConfig*> m_nameConfig;
|
||||
|
||||
double m_minAvailableDepth;
|
||||
double m_maxAvailableDepth;
|
||||
|
Loading…
Reference in New Issue
Block a user