#3735 Summary plot : Improve stepping for well path name

This commit is contained in:
Magne Sjaastad 2018-11-22 15:24:14 +01:00
parent ceb5fff780
commit 314c20a04a
3 changed files with 33 additions and 8 deletions

View File

@ -517,6 +517,26 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress(con
return addr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifEclipseSummaryAddress::isDependentOnWellName(const RifEclipseSummaryAddress& address)
{
// clang-format off
if (address.category() == SUMMARY_WELL ||
address.category() == SUMMARY_WELL_COMPLETION ||
address.category() == SUMMARY_WELL_COMPLETION_LGR ||
address.category() == SUMMARY_WELL_LGR ||
address.category() == SUMMARY_WELL_SEGMENT)
{
return true;
}
// clang-format on
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -144,6 +144,8 @@ public:
static RifEclipseSummaryAddress importedAddress(const std::string& quantityName);
static RifEclipseSummaryAddress ensembleStatisticsAddress(const std::string& quantityName, const std::string& dataQuantityName);
static bool isDependentOnWellName(const RifEclipseSummaryAddress& address);
// Access methods
SummaryVarCategory category() const { return m_variableCategory; }

View File

@ -44,7 +44,8 @@ CAF_PDM_SOURCE_INIT(RimSummaryPlotSourceStepping, "RimSummaryCurveCollectionModi
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping() : m_sourceSteppingType(Y_AXIS)
RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
: m_sourceSteppingType(Y_AXIS)
{
// clang-format off
CAF_PDM_InitObject("Summary Curves Modifier", "", "", "");
@ -244,7 +245,8 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue)
{
RimSummaryCurveCollection* curveCollection = nullptr;
@ -286,7 +288,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
if (isYAxisStepping())
{
RifEclipseSummaryAddress adr = curve->summaryAddressY();
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL)
if (RifEclipseSummaryAddress::isDependentOnWellName(adr))
{
adr.setWellName(m_wellName().toStdString());
@ -297,7 +299,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
if (isXAxisStepping())
{
RifEclipseSummaryAddress adr = curve->summaryAddressX();
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL)
if (RifEclipseSummaryAddress::isDependentOnWellName(adr))
{
adr.setWellName(m_wellName().toStdString());
@ -654,7 +656,8 @@ void RimSummaryPlotSourceStepping::modifyCurrentIndex(caf::PdmValueField* valueF
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotSourceStepping::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName,
void RimSummaryPlotSourceStepping::defineEditorAttribute(const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute)
{
caf::PdmUiComboBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>(attribute);