#864 Added auto name config to curve filter

This commit is contained in:
Magne Sjaastad
2016-11-04 15:23:44 +01:00
parent 65f118ba24
commit edb6cef18c
6 changed files with 81 additions and 7 deletions

View File

@@ -22,6 +22,7 @@
#include "RimSummaryCurve.h"
#include "RimSummaryCase.h"
#include "RimSummaryCurveFilter.h"
@@ -187,6 +188,22 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
return QString::fromStdString(text);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCurveAutoName::applySettings(const RimSummaryCurveAutoName& other)
{
m_caseName = other.m_caseName;
m_vectorName = other.m_vectorName;
m_unit = other.m_unit;
m_regionNumber = other.m_regionNumber;
m_wellGroupName = other.m_wellGroupName;
m_wellName = other.m_wellName;
m_wellSegmentNumber = other.m_wellSegmentNumber;
m_lgrName = other.m_lgrName;
m_completion = other.m_completion;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -216,13 +233,22 @@ void RimSummaryCurveAutoName::appendLgrName(std::string& text, const RifEclipseS
//--------------------------------------------------------------------------------------------------
void RimSummaryCurveAutoName::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
RimSummaryCurve* summaryCurve = nullptr;
this->firstAncestorOrThisOfType(summaryCurve);
// NOTE: The curve filter is parent object of a summary curve, and the update is supposed to update
// the first parent, not the grandparent. This is the reason for not using firstAncestorOrThisOfType()
RimSummaryCurve* summaryCurve = dynamic_cast<RimSummaryCurve*>(this->parentField()->ownerObject());
if (summaryCurve)
{
summaryCurve->updateCurveName();
summaryCurve->updateConnectedEditors();
}
RimSummaryCurveFilter* summaryCurveFilter = dynamic_cast<RimSummaryCurveFilter*>(this->parentField()->ownerObject());
if (summaryCurveFilter)
{
summaryCurveFilter->updateCurveNames();
summaryCurveFilter->updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------