mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve RFT reader performance
* #9963 Rft reader: Search for DATA file when required WSEGLINK is used to establish the branch topology for MSW wells. Search and read WSEGLINK data when segment data is requested by the user. This can be a time consuming operation. Avoid doing this search for standard RFT plots. * Make sure that single summary curves are displayed correctly * Make sure single summary curves are visible in the plot
This commit is contained in:
@@ -68,6 +68,8 @@ RimFileSummaryCase::RimFileSummaryCase()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_rftCase, "RftCase", "RFT Data" );
|
||||
m_rftCase = new RimRftCase;
|
||||
|
||||
m_hasParsedForWeseglink = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -147,36 +149,10 @@ void RimFileSummaryCase::createRftReaderInterface()
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_rftCase->dataDeckFilePath().isEmpty() )
|
||||
{
|
||||
// Search for *.DATA file in same folder as summary file. If not found, search for a schedule file.
|
||||
QString validDataDeckFileName;
|
||||
|
||||
QString dataDeckFileName = folder + "/" + fileInfo.completeBaseName() + ".DATA";
|
||||
QFileInfo fi( dataDeckFileName );
|
||||
|
||||
if ( fi.exists() )
|
||||
{
|
||||
validDataDeckFileName = dataDeckFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
QString scheduleFileName = folder + "/" + fileInfo.completeBaseName() + ".SCH";
|
||||
QFileInfo fi( scheduleFileName );
|
||||
|
||||
if ( fi.exists() )
|
||||
{
|
||||
validDataDeckFileName = scheduleFileName;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !validDataDeckFileName.isEmpty() )
|
||||
{
|
||||
m_rftCase->setDataDeckFileName( dataDeckFileName );
|
||||
}
|
||||
}
|
||||
|
||||
m_summaryEclipseRftReader = RimFileSummaryCase::findRftDataAndCreateReader( rftFileName, m_rftCase->dataDeckFilePath() );
|
||||
// Usually, the data deck file path is empty at this point. If the user has specified the path manually, we use that.
|
||||
// The intention is to use searchForWseglinkAndRecreateRftReader() to search for the data deck file path. Here we avoid searching for
|
||||
// the data deck file by default, as this is a time consuming operation.
|
||||
m_summaryEclipseRftReader = RimFileSummaryCase::createOpmRftReader( rftFileName, m_rftCase->dataDeckFilePath() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -230,7 +206,7 @@ RifSummaryReaderInterface* RimFileSummaryCase::findRelatedFilesAndCreateReader(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderOpmRft* RimFileSummaryCase::findRftDataAndCreateReader( const QString& rftFileName, const QString& dataDeckFileName )
|
||||
RifReaderOpmRft* RimFileSummaryCase::createOpmRftReader( const QString& rftFileName, const QString& dataDeckFileName )
|
||||
{
|
||||
QFileInfo fi( rftFileName );
|
||||
|
||||
@@ -419,6 +395,52 @@ QString RimFileSummaryCase::createAdditionalSummaryFileName()
|
||||
return filePath;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFileSummaryCase::searchForWseglinkAndRecreateRftReader()
|
||||
{
|
||||
if ( m_hasParsedForWeseglink ) return;
|
||||
|
||||
if ( m_rftCase->dataDeckFilePath().isEmpty() )
|
||||
{
|
||||
QFileInfo fileInfo( summaryHeaderFilename() );
|
||||
QString folder = fileInfo.absolutePath();
|
||||
|
||||
// Search for *.DATA file in same folder as summary file. If not found, search for a schedule file.
|
||||
QString validDataDeckFileName;
|
||||
|
||||
QString dataDeckFileName = folder + "/" + fileInfo.completeBaseName() + ".DATA";
|
||||
QFileInfo fi( dataDeckFileName );
|
||||
|
||||
if ( fi.exists() )
|
||||
{
|
||||
validDataDeckFileName = dataDeckFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
QString scheduleFileName = folder + "/" + fileInfo.completeBaseName() + ".SCH";
|
||||
QFileInfo fi( scheduleFileName );
|
||||
|
||||
if ( fi.exists() )
|
||||
{
|
||||
validDataDeckFileName = scheduleFileName;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !validDataDeckFileName.isEmpty() )
|
||||
{
|
||||
m_rftCase->setDataDeckFileName( dataDeckFileName );
|
||||
|
||||
// Create a new reader including the file path to the data deck file
|
||||
// NB! This can be a time consuming operation
|
||||
m_summaryEclipseRftReader = RimFileSummaryCase::createOpmRftReader( m_rftCase->rftFilePath(), m_rftCase->dataDeckFilePath() );
|
||||
}
|
||||
}
|
||||
|
||||
m_hasParsedForWeseglink = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user