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")