mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
RFT improvements
* Avoid accessing nullptr * remove unused function * Allow RFT data from single summary case to be used in RFT plots * #9736 Support horizontal plotting of LAS curves
This commit is contained in:
@@ -52,6 +52,16 @@ RimSummaryMultiPlotCollection* RiaSummaryTools::summaryMultiPlotCollection()
|
||||
return RimMainPlotCollection::current()->summaryMultiPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCase*> RiaSummaryTools::singleTopLevelSummaryCases()
|
||||
{
|
||||
if ( summaryCaseMainCollection() ) return summaryCaseMainCollection()->topLevelSummaryCases();
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -53,6 +53,8 @@ public:
|
||||
static RimSummaryCaseMainCollection* summaryCaseMainCollection();
|
||||
static RimSummaryMultiPlotCollection* summaryMultiPlotCollection();
|
||||
|
||||
static std::vector<RimSummaryCase*> singleTopLevelSummaryCases();
|
||||
|
||||
static void notifyCalculatedCurveNameHasChanged( int calculationId, const QString& currentCurveName );
|
||||
|
||||
static RimSummaryPlot* parentSummaryPlot( caf::PdmObject* object );
|
||||
|
@@ -636,10 +636,12 @@ RiaRftPltCurveDefinition RimWellPlotTools::curveDefFromCurve( const RimWellLogCu
|
||||
}
|
||||
else if ( rftSummaryCase != nullptr )
|
||||
{
|
||||
rftSummaryCase->firstAncestorOrThisOfTypeAsserted( rftEnsemble );
|
||||
RimSummaryCaseCollection* parentEnsemble = nullptr;
|
||||
|
||||
rftSummaryCase->firstAncestorOrThisOfType( parentEnsemble );
|
||||
return RiaRftPltCurveDefinition( RifDataSourceForRftPlt( RifDataSourceForRftPlt::SUMMARY_RFT,
|
||||
rftSummaryCase,
|
||||
rftEnsemble ),
|
||||
parentEnsemble ),
|
||||
wellName,
|
||||
timeStep );
|
||||
}
|
||||
@@ -855,6 +857,23 @@ std::set<RiaRftPltCurveDefinition>
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( addr.sourceType() == RifDataSourceForRftPlt::SUMMARY_RFT )
|
||||
{
|
||||
auto summaryCase = addr.summaryCase();
|
||||
if ( summaryCase && summaryCase->rftReader() )
|
||||
{
|
||||
RifDataSourceForRftPlt summaryAddr( RifDataSourceForRftPlt::SUMMARY_RFT, summaryCase, addr.ensemble() );
|
||||
|
||||
std::set<QDateTime> timeSteps = summaryCase->rftReader()->availableTimeSteps( wellPathNameOrSimWellName );
|
||||
for ( const QDateTime& time : timeSteps )
|
||||
{
|
||||
if ( selectedTimeStepSet.count( time ) )
|
||||
{
|
||||
curveDefs.insert( RiaRftPltCurveDefinition( summaryAddr, wellPathNameOrSimWellName, time ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return curveDefs;
|
||||
@@ -1280,6 +1299,8 @@ std::map<QDateTime, std::set<RifDataSourceForRftPlt>> RimWellPlotTools::calculat
|
||||
RimWellPlotTools::findMatchingOrAdjacentTimeSteps( baseTimeSteps, gridTimeSteps );
|
||||
std::set<QDateTime> filteredEnsembleRftTimeSteps =
|
||||
RimWellPlotTools::findMatchingOrAdjacentTimeSteps( baseTimeSteps, ensembleRftTimeSteps );
|
||||
std::set<QDateTime> filteredSummaryRftTimeSteps =
|
||||
RimWellPlotTools::findMatchingOrAdjacentTimeSteps( baseTimeSteps, summaryRftTimeSteps );
|
||||
|
||||
if ( addFirstTimestep && gridTimeSteps.size() )
|
||||
{
|
||||
@@ -1292,6 +1313,7 @@ std::map<QDateTime, std::set<RifDataSourceForRftPlt>> RimWellPlotTools::calculat
|
||||
std::set<QDateTime>& allFilteredTimesteps = filteredRftTimeSteps;
|
||||
allFilteredTimesteps.insert( filteredEnsembleRftTimeSteps.begin(), filteredEnsembleRftTimeSteps.end() );
|
||||
allFilteredTimesteps.insert( filteredGridTimeSteps.begin(), filteredGridTimeSteps.end() );
|
||||
allFilteredTimesteps.insert( filteredSummaryRftTimeSteps.begin(), filteredSummaryRftTimeSteps.end() );
|
||||
|
||||
for ( const QDateTime& time : allFilteredTimesteps )
|
||||
{
|
||||
@@ -1381,6 +1403,9 @@ void RimWellPlotTools::calculateValueOptionsForTimeSteps(
|
||||
case RifDataSourceForRftPlt::ENSEMBLE_RFT:
|
||||
hasEnsemble = true;
|
||||
break;
|
||||
case RifDataSourceForRftPlt::SUMMARY_RFT:
|
||||
hasRft = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "RiaDateStringParser.h"
|
||||
#include "RiaPlotDefines.h"
|
||||
#include "RiaSimWellBranchTools.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
|
||||
#include "RifReaderEclipseRft.h"
|
||||
|
||||
@@ -41,6 +42,7 @@
|
||||
#include "RimPressureDepthData.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
@@ -816,6 +818,28 @@ QList<caf::PdmOptionItemInfo> RimWellRftPlot::calculateValueOptions( const caf::
|
||||
}
|
||||
}
|
||||
|
||||
auto singleCases = RiaSummaryTools::singleTopLevelSummaryCases();
|
||||
if ( !singleCases.empty() )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo::createHeader( RifDataSourceForRftPlt::sourceTypeUiText(
|
||||
RifDataSourceForRftPlt::SUMMARY_RFT ),
|
||||
true ) );
|
||||
for ( auto summaryCase : singleCases )
|
||||
{
|
||||
if ( summaryCase->rftReader() &&
|
||||
summaryCase->rftReader()->wellNames().contains( m_wellPathNameOrSimWellName ) )
|
||||
{
|
||||
RimSummaryCaseCollection* parentEnsemble = nullptr;
|
||||
summaryCase->firstAncestorOrThisOfType( parentEnsemble );
|
||||
auto addr = RifDataSourceForRftPlt( RifDataSourceForRftPlt::SUMMARY_RFT, summaryCase, parentEnsemble );
|
||||
|
||||
auto item = caf::PdmOptionItemInfo( summaryCase->displayCaseName(), QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<RimEclipseResultCase*> gridCases = RimWellPlotTools::gridCasesForWell( simWellName );
|
||||
if ( !gridCases.empty() )
|
||||
{
|
||||
@@ -1046,6 +1070,19 @@ std::map<QString, QStringList> RimWellRftPlot::findWellSources()
|
||||
wellNames[simWellName].push_back( "Sim.Well" );
|
||||
}
|
||||
}
|
||||
|
||||
auto singleCases = RiaSummaryTools::singleTopLevelSummaryCases();
|
||||
for ( auto summaryCase : singleCases )
|
||||
{
|
||||
if ( auto rftReader = summaryCase->rftReader() )
|
||||
{
|
||||
for ( const QString& wellName : rftReader->wellNames() )
|
||||
{
|
||||
wellNames[wellName].push_back( "Summary" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<RimSummaryCaseCollection*> rftEnsembles = RimWellPlotTools::rftEnsembles();
|
||||
// Ensemble RFT wells
|
||||
{
|
||||
@@ -1071,6 +1108,15 @@ std::map<QString, QStringList> RimWellRftPlot::findWellSources()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<RimPressureDepthData*> pressureDepthData = RimWellPlotTools::pressureDepthData();
|
||||
for ( const auto& pd : pressureDepthData )
|
||||
{
|
||||
for ( const auto& wellName : pd->wellNames() )
|
||||
{
|
||||
wellNames[wellName].push_back( "Observed" );
|
||||
}
|
||||
}
|
||||
}
|
||||
return wellNames;
|
||||
}
|
||||
@@ -1106,8 +1152,8 @@ void RimWellRftPlot::onLoadDataAndUpdate()
|
||||
createEnsembleCurveSets();
|
||||
updateEditorsFromCurves();
|
||||
|
||||
// Update of curve color must happen here when loading data from project file, as the curve color is blended by the
|
||||
// background color. The background color is taken from the viewer.
|
||||
// Update of curve color must happen here when loading data from project file, as the curve color is blended by
|
||||
// the background color. The background color is taken from the viewer.
|
||||
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
|
||||
|
||||
if ( plotTrack && plotTrack->viewer() )
|
||||
|
@@ -37,7 +37,7 @@ RimPressureDepthData::RimPressureDepthData()
|
||||
CAF_PDM_InitFieldNoDefault( &m_wells, "Wells", "Wells" );
|
||||
m_wells.xmlCapability()->disableIO();
|
||||
m_wells.uiCapability()->setUiReadOnly( true );
|
||||
m_wells.registerGetMethod( this, &RimPressureDepthData::wells );
|
||||
m_wells.registerGetMethod( this, &RimPressureDepthData::wellNames );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -75,7 +75,7 @@ RifReaderRftInterface* RimPressureDepthData::rftReader()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimPressureDepthData::hasWell( const QString& wellPathName ) const
|
||||
{
|
||||
std::vector<QString> allWells = wells();
|
||||
std::vector<QString> allWells = wellNames();
|
||||
for ( const QString& well : allWells )
|
||||
{
|
||||
if ( well == wellPathName )
|
||||
@@ -89,24 +89,12 @@ bool RimPressureDepthData::hasWell( const QString& wellPathName ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RimPressureDepthData::wells() const
|
||||
std::vector<QString> RimPressureDepthData::wellNames() const
|
||||
{
|
||||
if ( m_fmuRftReader.p() )
|
||||
{
|
||||
std::set<QString> wellNames = const_cast<RifReaderPressureDepthData*>( m_fmuRftReader.p() )->wellNames();
|
||||
return std::vector<QString>( wellNames.begin(), wellNames.end() );
|
||||
}
|
||||
return std::vector<QString>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RimPressureDepthData::labels( const RifEclipseRftAddress& rftAddress )
|
||||
{
|
||||
if ( m_fmuRftReader.p() )
|
||||
{
|
||||
return const_cast<RifReaderPressureDepthData*>( m_fmuRftReader.p() )->labels( rftAddress );
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
@@ -40,8 +40,7 @@ public:
|
||||
RifReaderRftInterface* rftReader();
|
||||
|
||||
bool hasWell( const QString& wellPathName ) const;
|
||||
std::vector<QString> wells() const;
|
||||
std::vector<QString> labels( const RifEclipseRftAddress& rftAddress );
|
||||
std::vector<QString> wellNames() const;
|
||||
|
||||
private:
|
||||
cvf::ref<RifReaderPressureDepthData> m_fmuRftReader;
|
||||
|
@@ -196,9 +196,8 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
depthType = wellLogPlot->depthType();
|
||||
}
|
||||
|
||||
m_plotCurve->setSamplesValues( this->curveData()->propertyValuesByIntervals(),
|
||||
this->curveData()->depthValuesByIntervals( depthType, displayUnit ) );
|
||||
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
||||
setPropertyAndDepthValuesToPlotCurve( this->curveData()->propertyValuesByIntervals(),
|
||||
this->curveData()->depthValuesByIntervals( depthType, displayUnit ) );
|
||||
|
||||
if ( updateParentPlot )
|
||||
{
|
||||
|
Reference in New Issue
Block a user