mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1174 Create TOF property filter with selected tracer
This commit is contained in:
parent
07dc89bceb
commit
73053b0bb7
@ -22,11 +22,15 @@
|
|||||||
|
|
||||||
#include "RimDefines.h"
|
#include "RimDefines.h"
|
||||||
#include "RimEclipseCellColors.h"
|
#include "RimEclipseCellColors.h"
|
||||||
|
#include "RimEclipsePropertyFilter.h"
|
||||||
|
#include "RimEclipsePropertyFilterCollection.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimEclipseWell.h"
|
#include "RimEclipseWell.h"
|
||||||
#include "RimEclipseWellCollection.h"
|
#include "RimEclipseWellCollection.h"
|
||||||
#include "RimWellAllocationPlot.h"
|
#include "RimWellAllocationPlot.h"
|
||||||
|
|
||||||
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicShowContributingWellsFeature, "RicShowContributingWellsFeature");
|
CAF_CMD_SOURCE_INIT(RicShowContributingWellsFeature, "RicShowContributingWellsFeature");
|
||||||
@ -76,6 +80,27 @@ void RicShowContributingWellsFeature::onActionTriggered(bool isChecked)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable all existing property filters, and
|
||||||
|
// create a new property filter based on TOF for current well
|
||||||
|
|
||||||
|
RimEclipsePropertyFilterCollection* propertyFilterCollection = activeView->eclipsePropertyFilterCollection();
|
||||||
|
|
||||||
|
for (RimEclipsePropertyFilter* f : propertyFilterCollection->propertyFilters())
|
||||||
|
{
|
||||||
|
f->isActive = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RimEclipsePropertyFilter* propertyFilter = new RimEclipsePropertyFilter();
|
||||||
|
propertyFilterCollection->propertyFilters().push_back(propertyFilter);
|
||||||
|
|
||||||
|
propertyFilter->resultDefinition()->setEclipseCase(activeView->eclipseCase());
|
||||||
|
propertyFilter->resultDefinition()->setTofAndSelectTracer(wellAllocationPlot->wellName());
|
||||||
|
propertyFilter->resultDefinition()->updateResultNameHasChanged();
|
||||||
|
|
||||||
|
propertyFilterCollection->updateConnectedEditors();
|
||||||
|
|
||||||
|
RiuMainWindow::instance()->setExpanded(propertyFilterCollection, true);
|
||||||
|
|
||||||
activeView->scheduleCreateDisplayModelAndRedraw();
|
activeView->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,6 +250,43 @@ void RimEclipseResultDefinition::updateAnyFieldHasChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultDefinition::setTofAndSelectTracer(const QString& tracerName)
|
||||||
|
{
|
||||||
|
setResultType(RimDefines::FLOW_DIAGNOSTICS);
|
||||||
|
setResultVariable("TOF");
|
||||||
|
|
||||||
|
m_flowTracerSelectionMode = FLOW_TR_BY_SELECTION;
|
||||||
|
|
||||||
|
std::vector<QString> tracers;
|
||||||
|
tracers.push_back(tracerName);
|
||||||
|
setSelectedTracers(tracers);
|
||||||
|
|
||||||
|
if (m_flowSolution() == nullptr)
|
||||||
|
{
|
||||||
|
assignFlowSolutionFromCase();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultDefinition::assignFlowSolutionFromCase()
|
||||||
|
{
|
||||||
|
RimEclipseResultCase* eclCase = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(eclCase);
|
||||||
|
if (eclCase)
|
||||||
|
{
|
||||||
|
std::vector<RimFlowDiagSolution*> flowSols = eclCase->flowDiagSolutions();
|
||||||
|
if (flowSols.size() > 0)
|
||||||
|
{
|
||||||
|
this->setFlowSolution(flowSols[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -891,13 +928,7 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
|
|||||||
|
|
||||||
if ( m_flowSolution() == nullptr )
|
if ( m_flowSolution() == nullptr )
|
||||||
{
|
{
|
||||||
RimEclipseResultCase* eclCase;
|
assignFlowSolutionFromCase();
|
||||||
this->firstAncestorOrThisOfType(eclCase);
|
|
||||||
if ( eclCase )
|
|
||||||
{
|
|
||||||
std::vector<RimFlowDiagSolution*> flowSols = eclCase->flowDiagSolutions();
|
|
||||||
if (flowSols.size()){ this->setFlowSolution(flowSols[0]); }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uiOrdering.add(&m_resultVariableUiField);
|
uiOrdering.add(&m_resultVariableUiField);
|
||||||
|
@ -87,6 +87,8 @@ public:
|
|||||||
void updateResultNameHasChanged();
|
void updateResultNameHasChanged();
|
||||||
void updateAnyFieldHasChanged();
|
void updateAnyFieldHasChanged();
|
||||||
|
|
||||||
|
void setTofAndSelectTracer(const QString& tracerName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void updateLegendCategorySettings() {};
|
virtual void updateLegendCategorySettings() {};
|
||||||
|
|
||||||
@ -123,6 +125,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void setFlowSolution(RimFlowDiagSolution* flowSol);
|
void setFlowSolution(RimFlowDiagSolution* flowSol);
|
||||||
void setSelectedTracers(const std::vector<QString>& selectedTracers);
|
void setSelectedTracers(const std::vector<QString>& selectedTracers);
|
||||||
|
void assignFlowSolutionFromCase();
|
||||||
|
|
||||||
bool hasDualPorFractureResult();
|
bool hasDualPorFractureResult();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user