#5063 Improve auto name for well log plots and use it for well allocation plots

This commit is contained in:
Gaute Lindkvist 2019-11-25 12:40:51 +01:00
parent cf7608e6bf
commit dbee9759a0
8 changed files with 78 additions and 5 deletions

View File

@ -40,6 +40,7 @@
#include "RimTotalWellAllocationPlot.h"
#include "RimWellAllocationPlotLegend.h"
#include "RimWellFlowRateCurve.h"
#include "RimWellLogCurveCommonDataSource.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
@ -219,7 +220,11 @@ void RimWellAllocationPlot::updateFromWell()
if ( m_flowType() == ACCUMULATED ) description = "Accumulated Flow";
if ( m_flowType() == INFLOW ) description = "Inflow Rates";
accumulatedWellFlowPlot()->setMultiPlotTitle( description + " (" + m_wellName + ")" );
RimWellLogPlotNameConfig* nameConfig = accumulatedWellFlowPlot()->nameConfig();
nameConfig->setCustomName( description );
nameConfig->setAutoNameTags( false, true, false, false, false );
nameConfig->setFieldVisibility( true, true, true, false, false );
accumulatedWellFlowPlot()->updateAutoName();
if ( !m_case ) return;
@ -365,7 +370,6 @@ void RimWellAllocationPlot::updateFromWell()
m_totalWellAllocationPlot->updateConnectedEditors();
accumulatedWellFlowPlot()->updateConnectedEditors();
m_tofAccumulatedPhaseFractionsPlot->reloadFromWell();
m_tofAccumulatedPhaseFractionsPlot->updateConnectedEditors();

View File

@ -56,6 +56,33 @@ RimWellFlowRateCurve::RimWellFlowRateCurve()
//--------------------------------------------------------------------------------------------------
RimWellFlowRateCurve::~RimWellFlowRateCurve() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseResultCase* RimWellFlowRateCurve::rimCase()
{
RimWellAllocationPlot* wap = wellAllocationPlot();
if ( wap )
{
return wap->rimCase();
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimWellFlowRateCurve::timeStep()
{
RimWellAllocationPlot* wap = wellAllocationPlot();
if ( wap )
{
return wap->timeStep();
}
return -1;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -44,8 +44,10 @@ public:
const std::vector<double>& flowRates );
void updateStackedPlotData();
QString wellName() const override;
QString wellLogChannelName() const override;
RimEclipseResultCase* rimCase();
int timeStep();
QString wellName() const override;
QString wellLogChannelName() const override;
void setGroupId( int groupId );
int groupId() const;

View File

@ -21,10 +21,12 @@
#include "RimCase.h"
#include "RimDataSourceSteppingTools.h"
#include "RimEclipseCase.h"
#include "RimEclipseResultCase.h"
#include "RimGeoMechCase.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimTools.h"
#include "RimWellFlowRateCurve.h"
#include "RimWellLogExtractionCurve.h"
#include "RimWellLogFileCurve.h"
#include "RimWellLogPlot.h"
@ -285,6 +287,7 @@ void RimWellLogCurveCommonDataSource::updateDefaultOptions( const std::vector<Ri
}
RimWellLogExtractionCurve* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
RimWellLogFileCurve* fileCurve = dynamic_cast<RimWellLogFileCurve*>( curve );
RimWellFlowRateCurve* flowRateCurve = dynamic_cast<RimWellFlowRateCurve*>( curve );
if ( extractionCurve )
{
RimWellLogWbsCurve* wbsCurve = dynamic_cast<RimWellLogWbsCurve*>( extractionCurve );
@ -322,6 +325,13 @@ void RimWellLogCurveCommonDataSource::updateDefaultOptions( const std::vector<Ri
m_uniqueWellPaths.insert( fileCurve->wellPath() );
m_uniqueWellNames.insert( fileCurve->wellName() );
}
else if ( flowRateCurve )
{
m_uniqueTrajectoryTypes.insert( RimWellLogExtractionCurve::SIMULATION_WELL );
m_uniqueWellNames.insert( flowRateCurve->wellName() );
m_uniqueCases.insert( flowRateCurve->rimCase() );
m_uniqueTimeSteps.insert( flowRateCurve->timeStep() );
}
}
for ( RimWellLogTrack* track : tracks )
{

View File

@ -393,6 +393,14 @@ QString RimWellLogPlot::createAutoName() const
return generatedCurveName.join( ": " );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlotNameConfig* RimWellLogPlot::nameConfig() const
{
return m_nameConfig;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -91,7 +91,8 @@ public:
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
QString createAutoName() const override;
QString createAutoName() const override;
RimWellLogPlotNameConfig* nameConfig() const;
RimWellLogCurveCommonDataSource* commonDataSource() const;
void updateCommonDataSource();

View File

@ -96,6 +96,22 @@ void RimWellLogPlotNameConfig::setAutoNameTags( bool addCaseName,
m_addWaterDepth = addWaterDepth;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotNameConfig::setFieldVisibility( bool caseNameVisible,
bool wellNameVisible,
bool timeStepVisible,
bool airGapVisible,
bool waterDepthVisible )
{
m_addCaseName.uiCapability()->setUiHidden( !caseNameVisible );
m_addWellName.uiCapability()->setUiHidden( !wellNameVisible );
m_addTimestep.uiCapability()->setUiHidden( !timeStepVisible );
m_addAirGap.uiCapability()->setUiHidden( !airGapVisible );
m_addWaterDepth.uiCapability()->setUiHidden( !waterDepthVisible );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -38,6 +38,11 @@ public:
bool addWaterDepth() const;
void setAutoNameTags( bool addCaseName, bool addWellName, bool addTimeStep, bool addAirGap, bool addWaterDepth );
void setFieldVisibility( bool caseNameVisible,
bool wellNameVisible,
bool timeStepVisible,
bool airGapVisible,
bool waterDepthVisible );
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;