Bubble plot (#5452)

Bubble plot issues #5209 #2285 #5308 

Co-authored-by: Kristian Bendiksen <kristian.bendiksen@gmail.com>
This commit is contained in:
Magne Sjaastad
2020-02-03 12:20:35 +01:00
committed by GitHub
parent cf72ce5989
commit 7148bd73ae
23 changed files with 1828 additions and 64 deletions

View File

@@ -34,6 +34,7 @@
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSimWellInView.h"
#include "RimSimWellInViewTools.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCurveAppearanceCalculator.h"
@@ -58,7 +59,7 @@ bool RicPlotProductionRateFeature::isCommandEnabled()
for ( RimSimWellInView* well : collection )
{
RimGridSummaryCase* gridSummaryCase = RicPlotProductionRateFeature::gridSummaryCaseForWell( well );
RimGridSummaryCase* gridSummaryCase = RimSimWellInViewTools::gridSummaryCaseForWell( well );
if ( gridSummaryCase )
{
return true;
@@ -90,12 +91,12 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
for ( RimSimWellInView* well : collection )
{
RimGridSummaryCase* gridSummaryCase = RicPlotProductionRateFeature::gridSummaryCaseForWell( well );
RimGridSummaryCase* gridSummaryCase = RimSimWellInViewTools::gridSummaryCaseForWell( well );
if ( !gridSummaryCase ) continue;
QString description = "Well Production Rates : ";
if ( isInjector( well ) )
if ( RimSimWellInViewTools::isInjector( well ) )
{
description = "Well Injection Rates : ";
}
@@ -103,7 +104,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
description += well->name();
RimSummaryPlot* plot = summaryPlotColl->createNamedSummaryPlot( description );
if ( isInjector( well ) )
if ( RimSimWellInViewTools::isInjector( well ) )
{
// Left Axis
@@ -239,63 +240,6 @@ void RicPlotProductionRateFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setText( "Plot Production Rates" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridSummaryCase* RicPlotProductionRateFeature::gridSummaryCaseForWell( RimSimWellInView* well )
{
RimProject* project = RiaApplication::instance()->project();
if ( !project ) return nullptr;
RimSummaryCaseMainCollection* sumCaseColl = project->activeOilField()
? project->activeOilField()->summaryCaseMainCollection()
: nullptr;
if ( !sumCaseColl ) return nullptr;
RimEclipseResultCase* eclCase = nullptr;
well->firstAncestorOrThisOfType( eclCase );
if ( eclCase )
{
RimGridSummaryCase* gridSummaryCase = dynamic_cast<RimGridSummaryCase*>(
sumCaseColl->findSummaryCaseFromEclipseResultCase( eclCase ) );
if ( gridSummaryCase )
{
return gridSummaryCase;
}
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicPlotProductionRateFeature::isInjector( RimSimWellInView* well )
{
RigSimWellData* wRes = well->simWellData();
if ( wRes )
{
Rim3dView* rimView = nullptr;
well->firstAncestorOrThisOfTypeAsserted( rimView );
int currentTimeStep = rimView->currentTimeStep();
if ( wRes->hasWellResult( currentTimeStep ) )
{
const RigWellResultFrame& wrf = wRes->wellResultFrame( currentTimeStep );
if ( wrf.m_productionType == RigWellResultFrame::OIL_INJECTOR ||
wrf.m_productionType == RigWellResultFrame::GAS_INJECTOR ||
wrf.m_productionType == RigWellResultFrame::WATER_INJECTOR )
{
return true;
}
}
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------