From 7b5594ce7c53785241cd370e79c2189dd261c488 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 10 Dec 2020 10:44:23 +0100 Subject: [PATCH] Updates after 2020.10.1 release (#7104) * Set version to 2020.10.1-RC03 * #6780 Flow Vector Result: Check if data exists before using * #7031 Delta Summary Case: Fix crash when updating case name * #7036 Well Picks : Skip import of empty lines * #7003 Python: Guard nullpointer access for summary methods * #7014 Python: Resize the result container before assigning data * #7042 File Import Dialog : Sort by numbers instead of text * Set version to 2020.10.1-RC04 * #7008 Python: Avoid terminating process as part of open/closeProject When running scripts, a project file can be opened. If other operations are issued after, the process monitor window was disconnected from the script process, and no text output from the script was visible in the process monitor text window. New behavior : Never terminate a process automatically. Never terminate process as part of open/close project. If a process is left unresponsive, the user is now responsible for manual termination of this process. * #7045 Contour map : Disable clipping of smoothed contour lines * #7046 Cross Plot : Avoid reset of curve visibility when color legend visibility changes * #7048 Grid Cross Plot: Fix inverted Y-axis for user-defined min/max range * #7055 Contour Map: Label format it should match the legend format * #7059 Well Targets : Fix index of of bound crash when building well path * Set version to 2020.10.1-RC05 * #6814 Correlation Report: Missing update of plots when changing ensemble * Set version to 2020.10.1-RC06 * #7055 Contour Map: Label format it should match the legend format * #7068 Fix missing import surface File -> Import Surface * Set version to 2020.10.1-RC07 * Prepare for release of 2020.10.1 * #5641 Avoid unnecessary regeneration of contour map * Move clearGeometry to a scheduleGeometryRegen override * Trigger update of contour maps following legend changes * Make legend config changed signal more fine grained for Contour Maps * Set version to 2020.10.1-RC08 * Prepare for release of 2020.10.1 * Set dev version after patch release Co-authored-by: Gaute Lindkvist --- .../Application/RiaSummaryCurveDefinition.cpp | 9 ++- .../RicNewDerivedSummaryFeature.cpp | 24 ++++++- .../RicImportSurfacesFeature.cpp | 19 ++++-- .../RifWellPathFormationReader.cpp | 2 + .../RivElementVectorResultPartMgr.cpp | 63 ++++++++++++------- .../RimRegularLegendConfig.cpp | 2 +- .../RimDerivedEnsembleCaseCollection.cpp | 16 +++-- .../Summary/RimDerivedSummaryCase.cpp | 4 +- ResInsightVersion.cmake | 6 +- 9 files changed, 104 insertions(+), 41 deletions(-) diff --git a/ApplicationCode/Application/RiaSummaryCurveDefinition.cpp b/ApplicationCode/Application/RiaSummaryCurveDefinition.cpp index 51f338f7ae..3071513a1a 100644 --- a/ApplicationCode/Application/RiaSummaryCurveDefinition.cpp +++ b/ApplicationCode/Application/RiaSummaryCurveDefinition.cpp @@ -44,9 +44,12 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( gsl::not_nullfirstAncestorOfType( ensemble ); - m_ensemble = ensemble; + if ( summaryCase ) + { + RimSummaryCaseCollection* ensemble = nullptr; + summaryCase->firstAncestorOfType( ensemble ); + m_ensemble = ensemble; + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicNewDerivedSummaryFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicNewDerivedSummaryFeature.cpp index 9b90828fcd..890ec75042 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicNewDerivedSummaryFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicNewDerivedSummaryFeature.cpp @@ -51,9 +51,31 @@ void RicNewDerivedSummaryFeature::onActionTriggered( bool isChecked ) auto derivedCase = new RimDerivedSummaryCase; auto selectedCases = twoSelectedSummaryCases(); + if ( selectedCases.empty() ) + { + auto allCases = mainColl->allSummaryCases(); + + if ( allCases.size() > 0 ) + { + selectedCases.push_back( allCases[0] ); + } + if ( allCases.size() > 1 ) + { + selectedCases.push_back( allCases[1] ); + } + } + if ( !selectedCases.empty() ) { - derivedCase->setSummaryCases( selectedCases[0], selectedCases[1] ); + RimSummaryCase* sumCase1 = selectedCases[0]; + RimSummaryCase* sumCase2 = nullptr; + + if ( selectedCases.size() > 1 ) + { + sumCase2 = selectedCases[1]; + } + + derivedCase->setSummaryCases( sumCase1, sumCase2 ); derivedCase->createSummaryReaderInterface(); } diff --git a/ApplicationCode/Commands/SurfaceCommands/RicImportSurfacesFeature.cpp b/ApplicationCode/Commands/SurfaceCommands/RicImportSurfacesFeature.cpp index 095cb8eb02..9216528b6d 100644 --- a/ApplicationCode/Commands/SurfaceCommands/RicImportSurfacesFeature.cpp +++ b/ApplicationCode/Commands/SurfaceCommands/RicImportSurfacesFeature.cpp @@ -62,11 +62,22 @@ void RicImportSurfacesFeature::onActionTriggered( bool isChecked ) app->setLastUsedDialogDirectory( "BINARY_GRID", QFileInfo( fileNames.last() ).absolutePath() ); // Find the selected SurfaceCollection - std::vector colls = caf::selectedObjectsByTypeStrict(); - if ( colls.empty() ) return; - RimSurfaceCollection* surfColl = colls[0]; + RimSurfaceCollection* surfColl = nullptr; + { + std::vector colls = caf::selectedObjectsByTypeStrict(); + if ( !colls.empty() ) + { + surfColl = colls.front(); + } + } - // For each file, + if ( !surfColl ) + { + auto proj = RimProject::current(); + surfColl = proj->activeOilField()->surfaceCollection(); + } + + if ( !surfColl ) return; RimSurface* lastCreatedOrUpdated = surfColl->importSurfacesFromFiles( fileNames ); diff --git a/ApplicationCode/FileInterface/RifWellPathFormationReader.cpp b/ApplicationCode/FileInterface/RifWellPathFormationReader.cpp index fe0735f910..bc488c18d7 100644 --- a/ApplicationCode/FileInterface/RifWellPathFormationReader.cpp +++ b/ApplicationCode/FileInterface/RifWellPathFormationReader.cpp @@ -231,6 +231,8 @@ void RifWellPathFormationReader::readFile( const QString& filePath, QString unitName = dataLine[unitNameIndex]; unitName = unitName.trimmed(); + if ( wellName.trimmed().isEmpty() && unitName.isEmpty() ) continue; + if ( mdIsPresent ) { double mdTopValue = dataLine[measuredDepthTopIndex].toDouble(); diff --git a/ApplicationCode/ModelVisualization/RivElementVectorResultPartMgr.cpp b/ApplicationCode/ModelVisualization/RivElementVectorResultPartMgr.cpp index c4798fe270..2da1d9f325 100644 --- a/ApplicationCode/ModelVisualization/RivElementVectorResultPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivElementVectorResultPartMgr.cpp @@ -115,32 +115,46 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode arrowScaling = result->sizeScale() * scaleLogarithmically( maxAbsResult ); } - std::vector addresses; - result->resultAddressesIJK( addresses ); - - std::vector directions; std::vector resultAddresses; - - for ( size_t fluidIndex = 0; fluidIndex < addresses.size(); fluidIndex += 3 ) + std::vector directions; + RigCaseCellResultsData* resultsData = eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ); { - if ( result->showVectorI() ) + std::vector addresses; + result->resultAddressesIJK( addresses ); + + for ( size_t fluidIndex = 0; fluidIndex < addresses.size(); fluidIndex += 3 ) { - if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_I ); - resultAddresses.push_back( addresses[0 + fluidIndex] ); - } - if ( result->showVectorJ() ) - { - if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_J ); - resultAddresses.push_back( addresses[1 + fluidIndex] ); - } - if ( result->showVectorK() ) - { - if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_K ); - resultAddresses.push_back( addresses[2 + fluidIndex] ); + if ( result->showVectorI() ) + { + if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_I ); + + auto candidate = addresses[0 + fluidIndex]; + if ( resultsData->hasResultEntry( candidate ) ) + { + resultAddresses.push_back( candidate ); + } + } + if ( result->showVectorJ() ) + { + if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_J ); + auto candidate = addresses[1 + fluidIndex]; + if ( resultsData->hasResultEntry( candidate ) ) + { + resultAddresses.push_back( candidate ); + } + } + if ( result->showVectorK() ) + { + if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_K ); + auto candidate = addresses[2 + fluidIndex]; + if ( resultsData->hasResultEntry( candidate ) ) + { + resultAddresses.push_back( candidate ); + } + } } } - RigCaseCellResultsData* resultsData = eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ); RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL ); const std::vector& cells = eclipseCase->mainGrid()->globalCellArray(); @@ -250,11 +264,14 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode std::vector combinedAddresses; result->resultAddressesCombined( combinedAddresses ); - for ( size_t flIdx = 0; flIdx < combinedAddresses.size(); flIdx++ ) + for ( auto candidate : combinedAddresses ) { - if ( combinedAddresses[flIdx].m_resultCatType == RiaDefines::ResultCatType::DYNAMIC_NATIVE ) + if ( candidate.m_resultCatType == RiaDefines::ResultCatType::DYNAMIC_NATIVE ) { - nncResultVals.push_back( nncData->dynamicConnectionScalarResult( combinedAddresses[flIdx] ) ); + if ( nncData->hasScalarValues( candidate ) ) + { + nncResultVals.push_back( nncData->dynamicConnectionScalarResult( candidate ) ); + } } } diff --git a/ApplicationCode/ProjectDataModel/RimRegularLegendConfig.cpp b/ApplicationCode/ProjectDataModel/RimRegularLegendConfig.cpp index 4a0015b385..f622925b31 100644 --- a/ApplicationCode/ProjectDataModel/RimRegularLegendConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimRegularLegendConfig.cpp @@ -1219,7 +1219,7 @@ QString RimRegularLegendConfig::valueToText( double value, NumberFormatType numb //-------------------------------------------------------------------------------------------------- QString RimRegularLegendConfig::valueToText( double value ) const { - return RimRegularLegendConfig::valueToText( value, m_tickNumberFormat(), m_precision() ); + return RimRegularLegendConfig::valueToText( value, m_tickNumberFormat(), m_significantDigitsInData ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Summary/RimDerivedEnsembleCaseCollection.cpp b/ApplicationCode/ProjectDataModel/Summary/RimDerivedEnsembleCaseCollection.cpp index 8adb2955c4..bbdf392470 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimDerivedEnsembleCaseCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimDerivedEnsembleCaseCollection.cpp @@ -205,14 +205,22 @@ void RimDerivedEnsembleCaseCollection::createDerivedEnsembleCases() //-------------------------------------------------------------------------------------------------- bool RimDerivedEnsembleCaseCollection::hasCaseReference( const RimSummaryCase* sumCase ) const { - for ( auto currCase : m_ensemble1->allSummaryCases() ) + if ( m_ensemble1 ) { - if ( currCase == sumCase ) return true; + for ( auto currCase : m_ensemble1->allSummaryCases() ) + { + if ( currCase == sumCase ) return true; + } } - for ( auto currCase : m_ensemble2->allSummaryCases() ) + + if ( m_ensemble2 ) { - if ( currCase == sumCase ) return true; + for ( auto currCase : m_ensemble2->allSummaryCases() ) + { + if ( currCase == sumCase ) return true; + } } + return false; } diff --git a/ApplicationCode/ProjectDataModel/Summary/RimDerivedSummaryCase.cpp b/ApplicationCode/ProjectDataModel/Summary/RimDerivedSummaryCase.cpp index d71ab1ae1f..e64cab9f84 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimDerivedSummaryCase.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimDerivedSummaryCase.cpp @@ -111,7 +111,6 @@ bool RimDerivedSummaryCase::isInUse() const //-------------------------------------------------------------------------------------------------- void RimDerivedSummaryCase::setSummaryCases( RimSummaryCase* sumCase1, RimSummaryCase* sumCase2 ) { - if ( !sumCase1 || !sumCase2 ) return; m_summaryCase1 = sumCase1; m_summaryCase2 = sumCase2; } @@ -421,7 +420,8 @@ void RimDerivedSummaryCase::updateDisplayNameFromCases() operatorText = "Sum"; QString name; - if ( case1Name == case2Name && m_summaryCase1->ensemble() && m_summaryCase2->ensemble() ) + if ( case1Name == case2Name && m_summaryCase1 && m_summaryCase2 && m_summaryCase1->ensemble() && + m_summaryCase2->ensemble() ) { QString ensembleName1 = m_summaryCase1->ensemble()->name(); QString ensembleName2 = m_summaryCase2->ensemble()->name(); diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index f307873d7d..b65a8758ee 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -1,16 +1,16 @@ set(RESINSIGHT_MAJOR_VERSION 2020) set(RESINSIGHT_MINOR_VERSION 10) -set(RESINSIGHT_PATCH_VERSION 0) +set(RESINSIGHT_PATCH_VERSION 1) # Opional text with no restrictions -set(RESINSIGHT_VERSION_TEXT "-dev") +#set(RESINSIGHT_VERSION_TEXT "-RC08") # Optional text # Must be unique and increasing within one combination of major/minor/patch version # The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT # Format of text must be ".xx" -set(RESINSIGHT_DEV_VERSION ".02") +set(RESINSIGHT_DEV_VERSION ".01") # https://github.com/CRAVA/crava/tree/master/libs/nrlib set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")