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:
@@ -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() )
|
||||
|
||||
Reference in New Issue
Block a user