mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 23:20:29 -05:00
#14198 Remove generated cell result entry when fault distance is deleted
When a fault distance object is deleted or renamed, the generated cell result was only emptied via clearScalarResult, leaving its name in the GENERATED result-variable dropdown. Follow the RimGridCalculation deletion pattern: reset any view displaying the result to None and tag the result entry as REMOVED so it disappears from the dropdown.
This commit is contained in:
1 parent
01ce94d539
commit
5b6658f099
1 file changed
+18
-1
@@ -235,7 +235,24 @@ void RimFaultDistance::removeGeneratedResult( const QString& name )
|
||||
RigCaseCellResultsData* resultsData = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
if ( !resultsData ) return;
|
||||
|
||||
resultsData->clearScalarResult( RiaDefines::ResultCatType::GENERATED, name );
|
||||
RigEclipseResultAddress resultAddress( RiaDefines::ResultCatType::GENERATED, name );
|
||||
|
||||
// Select "None" result in any view currently displaying the result being removed.
|
||||
for ( RimEclipseView* view : eclipseCase->reservoirViews() )
|
||||
{
|
||||
if ( !view ) continue;
|
||||
|
||||
RimEclipseCellColors* cellResult = view->cellResult();
|
||||
if ( cellResult && cellResult->resultType() == RiaDefines::ResultCatType::GENERATED && cellResult->resultVariable() == name )
|
||||
{
|
||||
cellResult->setResultVariable( "None" );
|
||||
cellResult->updateConnectedEditors();
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
resultsData->clearScalarResult( resultAddress );
|
||||
resultsData->setRemovedTagOnGeneratedResult( resultAddress );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user