Extract method for reading input property data for remaing keywords.

This commit is contained in:
Kristian Bendiksen
2019-10-30 22:13:41 +01:00
parent 9c53cfb44f
commit f1e987f0b9
2 changed files with 29 additions and 19 deletions

View File

@@ -72,25 +72,9 @@ void RifEclipseInputPropertyLoader::loadAndSyncronizeInputProperties(
progInfo.setProgress( static_cast<int>( progress + inputPropCount ) );
// Check if there are more known property keywords left on file. If it is, read them and create inputProperty
// objects
for ( const QString& fileKeyword : fileKeywordSet )
{
{
QString resultName = eclipseCaseData->results( RiaDefines::MATRIX_MODEL )->makeResultNameUnique( fileKeyword );
if ( RifEclipseInputFileTools::readProperty( filename, eclipseCaseData, fileKeyword, resultName ) )
{
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = resultName;
inputProperty->eclipseKeyword = fileKeyword;
inputProperty->fileName = filename;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
inputPropertyCollection->inputProperties.push_back( inputProperty );
}
}
progInfo.setProgress( static_cast<int>( progress + inputPropCount ) );
}
// Check if there are more known property keywords left on file.
// If it is, read them and create inputProperty objects
readInputPropertiesForRemainingKeywords( inputPropertyCollection, eclipseCaseData, filename, &fileKeywordSet );
i++;
}
@@ -202,3 +186,24 @@ void RifEclipseInputPropertyLoader::readDataForEachInputProperty( RimEclipseInpu
progress++;
}
}
void RifEclipseInputPropertyLoader::readInputPropertiesForRemainingKeywords(
RimEclipseInputPropertyCollection* inputPropertyCollection,
RigEclipseCaseData* eclipseCaseData,
const QString& filename,
std::set<QString>* fileKeywordSet )
{
for ( const QString& fileKeyword : *fileKeywordSet )
{
QString resultName = eclipseCaseData->results( RiaDefines::MATRIX_MODEL )->makeResultNameUnique( fileKeyword );
if ( RifEclipseInputFileTools::readProperty( filename, eclipseCaseData, fileKeyword, resultName ) )
{
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = resultName;
inputProperty->eclipseKeyword = fileKeyword;
inputProperty->fileName = filename;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
inputPropertyCollection->inputProperties.push_back( inputProperty );
}
}
}

View File

@@ -66,4 +66,9 @@ private:
std::set<QString>* fileKeywordSet,
caf::ProgressInfo* progressInfo,
int progressOffset );
static void readInputPropertiesForRemainingKeywords( RimEclipseInputPropertyCollection* inputPropertyCollection,
RigEclipseCaseData* eclipseCaseData,
const QString& filename,
std::set<QString>* fileKeywordSet );
};