#8103 Ensemble Well Logs: Index_K not available as property for geogrid

Made "Index K" available for grdecl, fixed crash, and disabled the depth
equalization when "Index K" is missing in the las files.

Fixes #8103.
This commit is contained in:
Kristian Bendiksen
2021-10-14 19:25:25 +02:00
parent db45b47121
commit 6069a771ea
5 changed files with 40 additions and 0 deletions

View File

@@ -472,6 +472,9 @@ void RimEnsembleWellLogCurveSet::defineUiOrdering( QString uiConfigName, caf::Pd
uiOrdering.add( &m_ensembleCurveSet );
uiOrdering.add( &m_depthEqualization );
bool hasKLayerIndex = hasPropertyInFile( RiaResultNames::indexKResultName() );
m_depthEqualization.uiCapability()->setUiReadOnly( !hasKLayerIndex );
appendColorGroup( uiOrdering );
{
@@ -1265,3 +1268,27 @@ cvf::ref<RigWellPathFormations>
new RigWellPathFormations( wellPathFormationItems, unusedFilePath, "Ensemble formation" );
return wellPathFormations;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimEnsembleWellLogCurveSet::hasPropertyInFile( const QString& property ) const
{
RimEnsembleWellLogs* group = m_ensembleWellLogs;
if ( !group ) return false;
std::vector<RimWellLogFile*> allWellLogFiles = group->wellLogFiles();
for ( auto& wellLogFile : allWellLogFiles )
{
QString errorMessage;
if ( !wellLogFile->readFile( &errorMessage ) ) return false;
RigWellLogFile* wellLogDataFile = wellLogFile->wellLogFileData();
CVF_ASSERT( wellLogDataFile );
std::vector<double> values = wellLogDataFile->values( RiaResultNames::indexKResultName() );
if ( values.empty() ) return false;
}
return true;
}