Make selection of part id into dropdown list for WellLogExtractionCurves

This commit is contained in:
Jørgen Herje 2023-05-25 13:43:31 +02:00 committed by Magne Sjaastad
parent 803b67506a
commit ee5f89c343

View File

@ -23,12 +23,13 @@
#include "RiaLogging.h"
#include "RiaResultNames.h"
#include "RiaSimWellBranchTools.h"
#include "RiaWellLogUnitTools.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RigEclipseResultAddress.h"
#include "RigEclipseWellLogExtractor.h"
#include "RigFemPartCollection.h"
#include "RigFemPartResultsCollection.h"
#include "RigGeoMechCaseData.h"
#include "RigGeoMechWellLogExtractor.h"
@ -67,6 +68,7 @@
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObjectScriptingCapability.h"
#include "cafPdmUiComboBoxEditor.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafUtils.h"
@ -132,6 +134,7 @@ RimWellLogExtractionCurve::RimWellLogExtractionCurve()
CAF_PDM_InitField( &m_timeStep, "CurveTimeStep", 0, "Time Step" );
CAF_PDM_InitField( &m_geomPartId, "GeomPartId", 0, "Part Id" );
m_geomPartId.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
// Add some space before name to indicate these belong to the Auto Name field
CAF_PDM_InitField( &m_addCaseNameToCurveName, "AddCaseNameToCurveName", true, " Case Name" );
@ -998,6 +1001,17 @@ QList<caf::PdmOptionItemInfo> RimWellLogExtractionCurve::calculateValueOptions(
{
RimTools::timeStepsForCase( m_case, &options );
}
else if ( fieldNeedingOptions == &m_geomPartId && m_case )
{
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() );
if ( !geomCase || !geomCase->geoMechData() || !geomCase->geoMechData()->femParts() ) return options;
const auto numGeomParts = geomCase->geoMechData()->femParts()->partCount();
for ( int i = 0; i < numGeomParts; ++i )
{
options.push_back( caf::PdmOptionItemInfo( QString( "%1" ).arg( i ), i ) );
}
}
else if ( fieldNeedingOptions == &m_simWellName )
{
std::set<QString> sortedWellNames = this->sortedSimWellNames();