Adds default property filter on well target creation

Adds a default property filter to the eclipse view when a well target is created. This ensures that cells with undefined values are hidden.

Also generates results on project load, so results are visible on startup.
This commit is contained in:
Magne Sjaastad committed 2025-04-07 09:25:46 +02:00
1 parent 1a89d59ebc
commit fdb5d5605e
1 file changed
+15 -2
@@ -38,6 +38,7 @@
#include "RimEclipseCaseCollection.h"
#include "RimEclipseCaseEnsemble.h"
#include "RimEclipseCellColors.h"
#include "RimEclipsePropertyFilterCollection.h"
#include "RimEclipseResultDefinition.h"
#include "RimEclipseView.h"
#include "RimRegularGridCase.h"
@@ -205,6 +206,12 @@ void RimWellTargetMapping::fieldChangedByUi( const caf::PdmFieldHandle* changedF
eclipseView->cellResult()->setResultType( RiaDefines::ResultCatType::GENERATED );
eclipseView->cellResult()->setResultVariable( RigWellTargetMapping::wellTargetResultName() );
if ( eclipseView->eclipsePropertyFilterCollection()->propertyFilters().empty() )
{
eclipseView->eclipsePropertyFilterCollection()->addFilterLinkedToCellResult();
eclipseView->eclipsePropertyFilterCollection()->updateConnectedEditors();
}
if ( RiaGuiApplication::isRunning() || RiuMainWindow::instance() )
{
RiuMainWindow::instance()->selectAsCurrentItem( eclipseView->cellResult() );
@@ -606,8 +613,14 @@ RimEclipseCase* RimWellTargetMapping::firstCase() const
//--------------------------------------------------------------------------------------------------
void RimWellTargetMapping::initAfterRead()
{
RimEclipseCase* eclipseCase = firstCase();
if ( eclipseCase ) m_resultDefinition->setEclipseCase( eclipseCase );
if ( RimEclipseCase* eclipseCase = firstCase() )
{
m_resultDefinition->setEclipseCase( eclipseCase );
// Automatically generate results on project load
// Consider to also do this for ensemble cases, but this will be more expensive
generateCandidates( eclipseCase );
}
}
//--------------------------------------------------------------------------------------------------