From 31d753ca369538f82fc461c8fc68ec6f20541150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Wed, 13 Sep 2017 10:14:18 +0200 Subject: [PATCH] #1847 Summary curves. Minor imporvements. Removed code commited by accident --- .../RicSummaryCurveCreator.cpp | 63 ++----------------- .../RicSummaryCurveCreator.h | 2 +- 2 files changed, 7 insertions(+), 58 deletions(-) diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp index 06a9ac172a..8341bb6203 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp @@ -187,10 +187,6 @@ RicSummaryCurveCreator::~RicSummaryCurveCreator() //-------------------------------------------------------------------------------------------------- void RicSummaryCurveCreator::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) { - if (changedField == &m_selectedCurves) - { - loadDataAndUpdatePlot(); - } } //-------------------------------------------------------------------------------------------------- @@ -270,9 +266,8 @@ std::set RicSummaryCurveCreator::findPossibleSummaryAd { std::set addrUnion; - auto isVectorField = identifierAndField->summaryIdentifier() == INPUT_VECTOR_NAME; - //auto applySelection = identifierAndField == NULL || identifierAndField->summaryIdentifier() == INPUT_VECTOR_NAME; - auto controllingIdentifierAndField = lookupControllingField(identifierAndField); + auto isVectorField = identifierAndField != nullptr && identifierAndField->summaryIdentifier() == INPUT_VECTOR_NAME; + auto controllingIdentifierAndField = identifierAndField != nullptr ? lookupControllingField(identifierAndField) : nullptr; if (!isVectorField && controllingIdentifierAndField != nullptr && controllingIdentifierAndField->pdmField()->v().size() == 0) return addrUnion; @@ -285,8 +280,9 @@ std::set RicSummaryCurveCreator::findPossibleSummaryAd const std::vector& allAddresses = reader->allResultAddresses(); int addressCount = static_cast(allAddresses.size()); - std::vector selections; - if (!isVectorField && controllingIdentifierAndField != nullptr) + bool applySelections = identifierAndField == nullptr || (!isVectorField && controllingIdentifierAndField != nullptr); + std::vector selections; + if (applySelections) { // Build selections vector selections = buildControllingFieldList(identifierAndField); @@ -296,8 +292,7 @@ std::set RicSummaryCurveCreator::findPossibleSummaryAd { if (allAddresses[i].category() == m_selectedSummaryCategory()) { - bool addressSelected = isVectorField || controllingIdentifierAndField != nullptr ? - isAddressSelected(allAddresses[i], selections) : true; + bool addressSelected = applySelections ? isAddressSelected(allAddresses[i], selections) : true; // Todo: Add text filter //if (!m_summaryFilter->isIncludedByFilter(allAddresses[i])) continue; @@ -405,49 +400,3 @@ bool RicSummaryCurveCreator::isAddressSelected(const RifEclipseSummaryAddress &a } return true; } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSummaryCurveCreator::loadDataAndUpdatePlot() -{ - //syncCurvesFromUiSelection(); - //loadDataAndUpdate(); - - RimSummaryPlot* plot = nullptr; - firstAncestorOrThisOfType(plot); - plot->updateAxes(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSummaryCurveCreator::syncCurvesFromUiSelection() -{ - // Create a search map containing whats supposed to be curves - - std::set > newCurveDefinitions; - - // Populate the newCurveDefinitions from the Gui - - std::set addrUnion = findPossibleSummaryAddresses(nullptr); - - for (RimSummaryCase* currentCase : m_selectedCases) - { - if (!currentCase || !currentCase->caseData() || !currentCase->caseData()->summaryReader()) continue; - - RifReaderEclipseSummary* reader = currentCase->caseData()->summaryReader(); - - //for (const RifEclipseSummaryAddress& addr : m_uiFilterResultMultiSelection.v()) - //{ - // if (!reader->hasAddress(addr)) continue; - // if (addrUnion.count(addr) == 0) continue; // Wash the possible "old" ui selection with new filter - - // newCurveDefinitions.insert(std::make_pair(currentCase, addr)); - //} - } - -// m_curves.deleteAllChildObjects(); - -// createCurvesFromCurveDefinitions(newCurveDefinitions); -} diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.h b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.h index ec85d132f1..e9770a5615 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.h +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.h @@ -83,7 +83,7 @@ private: virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; std::set findPossibleSummaryAddresses(const SummaryIdentifierAndField *identifierAndField); - std::vector buildControllingFieldList(const SummaryIdentifierAndField *identifierAndField); + std::vector buildControllingFieldList(const SummaryIdentifierAndField *identifierAndField); QString getIdentifierTextFromAddress(SummaryIdentifierType itemTypeInput, const RifEclipseSummaryAddress &address); SummaryIdentifierAndField* findIdentifierAndField(const caf::PdmFieldHandle* pdmFieldHandle); SummaryIdentifierAndField* lookupControllingField(const SummaryIdentifierAndField *identifierAndField);