diff --git a/ApplicationLibCode/ProjectDataModel/RimContourMapProjection.cpp b/ApplicationLibCode/ProjectDataModel/RimContourMapProjection.cpp index 7c4cd010f1..170befd512 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContourMapProjection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContourMapProjection.cpp @@ -509,8 +509,8 @@ void RimContourMapProjection::defineEditorAttribute( const caf::PdmFieldHandle* if ( myAttr ) { myAttr->m_minimum = 0.2; - myAttr->m_maximum = 2.0; - myAttr->m_sliderTickCount = 9; + myAttr->m_maximum = 20.0; + myAttr->m_sliderTickCount = 20; myAttr->m_delaySliderUpdateUntilRelease = true; } } diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.cpp index 90c3579bbe..ae25b1f351 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.cpp @@ -47,8 +47,6 @@ RimEclipseCaseEnsemble::RimEclipseCaseEnsemble() m_caseCollection->uiCapability()->setUiName( "Cases" ); m_caseCollection->uiCapability()->setUiIconFromResourceString( ":/Cases16x16.png" ); - CAF_PDM_InitFieldNoDefault( &m_selectedCase, "SelectedCase", "Selected Case" ); - CAF_PDM_InitFieldNoDefault( &m_viewCollection, "ViewCollection", "Views" ); m_viewCollection = new RimEclipseViewCollection; @@ -168,43 +166,6 @@ RimEclipseView* RimEclipseCaseEnsemble::addViewForCase( RimEclipseCase* eclipseC return m_viewCollection->addView( eclipseCase ); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QList RimEclipseCaseEnsemble::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) -{ - QList options; - - if ( fieldNeedingOptions == &m_selectedCase ) - { - for ( auto eclCase : cases() ) - { - options.push_back( caf::PdmOptionItemInfo( eclCase->caseUserDescription(), eclCase, false, eclCase->uiIconProvider() ) ); - } - - return options; - } - - return options; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseCaseEnsemble::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) -{ - if ( changedField == &m_selectedCase ) - { - for ( auto view : m_viewCollection->views() ) - { - view->setEclipseCase( m_selectedCase() ); - view->loadDataAndUpdate(); - view->updateGridBoxData(); - view->updateAnnotationItems(); - } - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -240,3 +201,12 @@ void RimEclipseCaseEnsemble::addStatisticsContourMap( RimStatisticsContourMap* s m_statisticsContourMaps.push_back( statisticsContourMap ); statisticsContourMap->setName( QString( "Statistics Contour Map #%1" ).arg( m_statisticsContourMaps.size() ) ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseCaseEnsemble::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +{ + uiOrdering.add( nameField() ); + uiOrdering.skipRemainingFields(); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.h b/ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.h index 6be3f38506..798b21f6d2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.h +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.h @@ -54,8 +54,7 @@ class RimEclipseCaseEnsemble : public RimNamedObject RimEclipseCase* findByDescription( const QString& description ) const; std::vector cases() const; - - std::set casesInViews() const; + std::set casesInViews() const; void addView( RimEclipseView* view ); RimEclipseView* addViewForCase( RimEclipseCase* eclipseCase ); @@ -68,9 +67,8 @@ class RimEclipseCaseEnsemble : public RimNamedObject void addStatisticsContourMap( RimStatisticsContourMap* statisticsContourMap ); protected: - QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const override; + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; private: caf::PdmField m_groupId; diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMap.cpp b/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMap.cpp index de72b32e2b..7dee3cd8e5 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMap.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMap.cpp @@ -82,7 +82,7 @@ RimStatisticsContourMap::RimStatisticsContourMap() CAF_PDM_InitField( &m_boundingBoxExpPercent, "BoundingBoxExpPercent", 5.0, "Bounding Box Expansion (%)" ); m_boundingBoxExpPercent.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); - CAF_PDM_InitField( &m_relativeSampleSpacing, "SampleSpacing", 0.9, "Sample Spacing Factor" ); + CAF_PDM_InitField( &m_relativeSampleSpacing, "SampleSpacing", 2.0, "Sample Spacing Factor" ); m_relativeSampleSpacing.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); CAF_PDM_InitFieldNoDefault( &m_resultAggregation, "ResultAggregation", "Result Aggregation" ); @@ -97,7 +97,12 @@ RimStatisticsContourMap::RimStatisticsContourMap() m_resultDefinition->setResultType( RiaDefines::ResultCatType::DYNAMIC_NATIVE ); m_resultDefinition->setResultVariable( "SOIL" ); - CAF_PDM_InitField( &m_uiDataSourceCase, "UiDataSourceCase", RiaResultNames::undefinedResultName(), "UI Data Source Case" ); + CAF_PDM_InitField( &m_primaryCase, + "PrimaryCase", + RiaResultNames::undefinedResultName(), + "Primary Case", + "", + "Eclipse Case used for wells and faults shown in views, initializing available result list, timesteps, etc." ); CAF_PDM_InitFieldNoDefault( &m_computeStatisticsButton, "ComputeStatisticsButton", "" ); caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_computeStatisticsButton ); @@ -117,20 +122,22 @@ void RimStatisticsContourMap::defineUiOrdering( QString uiConfigName, caf::PdmUi { auto selCase = ensemble()->cases().front(); setEclipseCase( selCase ); - m_uiDataSourceCase = selCase->caseUserDescription(); + m_primaryCase = selCase->caseUserDescription(); } uiOrdering.add( nameField() ); - uiOrdering.add( &m_resultAggregation ); - uiOrdering.add( &m_uiDataSourceCase ); + + auto genGrp = uiOrdering.addNewGroup( "General" ); + + genGrp->add( &m_resultAggregation ); + genGrp->add( &m_primaryCase ); + genGrp->add( &m_relativeSampleSpacing ); + genGrp->add( &m_boundingBoxExpPercent ); auto tsGroup = uiOrdering.addNewGroup( "Time Step Selection" ); tsGroup->setCollapsedByDefault(); tsGroup->add( &m_selectedTimeSteps ); - uiOrdering.add( &m_relativeSampleSpacing ); - uiOrdering.add( &m_boundingBoxExpPercent ); - if ( !isColumnResult() ) { auto resultDefinitionGroup = uiOrdering.addNewGroup( "Result Definition" ); @@ -146,6 +153,7 @@ void RimStatisticsContourMap::defineUiOrdering( QString uiConfigName, caf::PdmUi void RimStatisticsContourMap::setEclipseCase( RimEclipseCase* eclipseCase ) { m_resultDefinition->setEclipseCase( eclipseCase ); + if ( eclipseCase ) m_primaryCase = eclipseCase->caseUserDescription(); for ( auto& view : m_views ) { @@ -192,7 +200,7 @@ void RimStatisticsContourMap::fieldChangedByUi( const caf::PdmFieldHandle* chang } } } - else if ( &m_uiDataSourceCase == changedField ) + else if ( &m_primaryCase == changedField ) { switchToSelectedSourceCase(); @@ -211,7 +219,7 @@ void RimStatisticsContourMap::fieldChangedByUi( const caf::PdmFieldHandle* chang //-------------------------------------------------------------------------------------------------- RimEclipseCase* RimStatisticsContourMap::switchToSelectedSourceCase() { - RimEclipseCase* sourceResultCase = ensemble()->findByDescription( m_uiDataSourceCase ); + RimEclipseCase* sourceResultCase = ensemble()->findByDescription( m_primaryCase ); if ( sourceResultCase == nullptr ) { setEclipseCase( nullptr ); @@ -254,7 +262,7 @@ QList RimStatisticsContourMap::calculateValueOptions( co } return options; } - else if ( &m_uiDataSourceCase == fieldNeedingOptions ) + else if ( &m_primaryCase == fieldNeedingOptions ) { QStringList sourceCaseNames; sourceCaseNames += RiaResultNames::undefinedResultName(); @@ -286,8 +294,8 @@ void RimStatisticsContourMap::defineEditorAttribute( const caf::PdmFieldHandle* if ( auto myAttr = dynamic_cast( attribute ) ) { myAttr->m_minimum = 0.2; - myAttr->m_maximum = 2.0; - myAttr->m_sliderTickCount = 9; + myAttr->m_maximum = 20.0; + myAttr->m_sliderTickCount = 20; myAttr->m_delaySliderUpdateUntilRelease = true; } } @@ -517,9 +525,12 @@ std::vector RimStatisticsContourMap::selectedTimeSteps() const auto steps = m_selectedTimeSteps(); if ( m_selectedTimeSteps().empty() ) { - for ( int i = 0; i < (int)eclipseCase()->timeStepStrings().size(); i++ ) + if ( eclipseCase() ) { - steps.push_back( i ); + for ( int i = 0; i < (int)eclipseCase()->timeStepStrings().size(); i++ ) + { + steps.push_back( i ); + } } } else diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMap.h b/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMap.h index 7e27dda549..5a73587c2c 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMap.h +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMap.h @@ -95,7 +95,7 @@ class RimStatisticsContourMap : public RimNamedObject caf::PdmChildField m_resultDefinition; caf::PdmField m_computeStatisticsButton; - caf::PdmField m_uiDataSourceCase; + caf::PdmField m_primaryCase; std::unique_ptr m_contourMapGrid; std::map>> m_timeResults; diff --git a/ApplicationLibCode/ReservoirDataModel/RigEclipseContourMapProjection.cpp b/ApplicationLibCode/ReservoirDataModel/RigEclipseContourMapProjection.cpp index d47bfae6a4..0d81fd1cdb 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigEclipseContourMapProjection.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigEclipseContourMapProjection.cpp @@ -124,7 +124,6 @@ std::pair> } else { - // TODO: this was RimEclipseCellColors->hasStaticResult() if ( resultAddress.resultCatType() == RiaDefines::ResultCatType::STATIC_NATIVE && timeStep > 0 ) timeStep = 0; resultData.ensureKnownResultLoaded( resultAddress );