From 06b5c9afbfb35516f37156da99f6a5e3afafc4bb Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 16 Jun 2023 09:27:35 +0200 Subject: [PATCH] Adjustments for release * Add notification of parent object when multiple objects are updated * Make sure unchecked curves are removed from track * Use object names instead of "Sub Items" when possible * Set default simulation well visualization to top of reservoir * Show plot window after plot is created * Allow setting plot rendering flags * Add more plots for update when clicking in 3D view * Seismic Difference: Fix typo for poly line data extraction * Version RC_5 --- .../RicShowCumulativePhasePlotFeature.cpp | 8 +++ .../ToggleCommands/RicToggleItemsFeature.cpp | 4 +- .../RicToggleItemsFeatureImpl.cpp | 54 ++++++++++++++++++- .../RicToggleItemsFeatureImpl.h | 3 ++ .../RicWellPathPickEventHandler.cpp | 2 +- .../Flow/RimWellAllocationOverTimePlot.cpp | 9 ++++ .../Flow/RimWellAllocationOverTimePlot.h | 1 + .../Flow/RimWellAllocationPlot.cpp | 20 +++++++ .../Flow/RimWellAllocationPlot.h | 2 + .../Flow/RimWellDistributionPlot.cpp | 18 ++----- .../RimWellDistributionPlotCollection.cpp | 29 ++++++++++ .../Flow/RimWellDistributionPlotCollection.h | 2 + .../ProjectDataModel/RimDepthTrackPlot.cpp | 2 +- .../RimMainPlotCollection.cpp | 22 +++++++- .../ProjectDataModel/RimMainPlotCollection.h | 2 +- .../RimSimWellInViewCollection.cpp | 2 +- .../Seismic/RimSeismicDifferenceData.cpp | 2 +- .../Summary/RimSummaryCurveCollection.cpp | 2 +- .../WellLog/RimWellLogTrack.cpp | 6 ++- .../UserInterface/RiuPlotMainWindow.cpp | 4 +- .../UserInterface/RiuPlotMainWindow.h | 2 +- .../UserInterface/RiuQwtPlotWidget.cpp | 12 ++++- .../UserInterface/RiuQwtPlotWidget.h | 3 ++ .../UserInterface/RiuViewerCommands.cpp | 3 +- ResInsightVersion.cmake | 2 +- 25 files changed, 184 insertions(+), 32 deletions(-) diff --git a/ApplicationLibCode/Commands/FlowCommands/RicShowCumulativePhasePlotFeature.cpp b/ApplicationLibCode/Commands/FlowCommands/RicShowCumulativePhasePlotFeature.cpp index 40a5762d4e..1b218d6755 100644 --- a/ApplicationLibCode/Commands/FlowCommands/RicShowCumulativePhasePlotFeature.cpp +++ b/ApplicationLibCode/Commands/FlowCommands/RicShowCumulativePhasePlotFeature.cpp @@ -26,6 +26,8 @@ #include "RimWellAllocationPlot.h" #include "RimWellDistributionPlotCollection.h" +#include "RiuPlotMainWindowTools.h" + #include "cafSelectionManager.h" #include @@ -77,9 +79,15 @@ void RicShowCumulativePhasePlotFeature::onActionTriggered( bool isChecked ) RimWellDistributionPlotCollection* wdp = flowPlotColl->wellDistributionPlotCollection(); if ( wdp && eclipseResultCase ) { + RiuPlotMainWindowTools::showPlotMainWindow(); + wdp->setData( eclipseResultCase, wellName, timeStep ); wdp->setShowWindow( true ); wdp->loadDataAndUpdate(); + + wdp->updateConnectedEditors(); + + RiuPlotMainWindowTools::onObjectAppended( wdp ); } } diff --git a/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeature.cpp b/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeature.cpp index c0300e8f06..d612f8146e 100644 --- a/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeature.cpp +++ b/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeature.cpp @@ -50,8 +50,8 @@ void RicToggleItemsFeature::setupActionLook( QAction* actionToSetup ) { if ( RicToggleItemsFeatureImpl::isToggleCommandsForSubItems() ) { - QString objectName = "Sub Items"; - auto collectionName = RicToggleItemsFeatureImpl::findCollectionName( RicToggleItemsFeatureImpl::SelectionToggleType::TOGGLE ); + QString objectName = "Sub Items"; + auto collectionName = RicToggleItemsFeatureImpl::findCollectionName( RicToggleItemsFeatureImpl::SelectionToggleType::TOGGLE_SUBITEMS ); if ( !collectionName.isEmpty() ) objectName = collectionName; actionToSetup->setText( "Toggle " + objectName ); diff --git a/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeatureImpl.cpp b/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeatureImpl.cpp index b73ca6fcd6..f76c4b5d61 100644 --- a/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeatureImpl.cpp @@ -148,6 +148,18 @@ void RicToggleItemsFeatureImpl::setObjectToggleStateForSelection( SelectionToggl field->setValue( value ); } } + + // If multiple fields are updated, we call onChildrenUpdated() on the owner of the first field + // Example: Trigger replot of curves when multiple curves are toggled + if ( fieldsToUpdate.size() > 1 ) + { + auto [ownerOfChildArrayField, childArrayFieldHandle] = RicToggleItemsFeatureImpl::findOwnerAndChildArrayField( fieldsToUpdate.front() ); + if ( ownerOfChildArrayField && childArrayFieldHandle ) + { + std::vector objs; + ownerOfChildArrayField->onChildrenUpdated( childArrayFieldHandle, objs ); + } + } } //-------------------------------------------------------------------------------------------------- @@ -178,7 +190,7 @@ QString RicToggleItemsFeatureImpl::findCollectionName( SelectionToggleType state auto arrayField = dynamic_cast( childObj->parentField() ); if ( arrayField && arrayField->ownerObject() ) { - return arrayField->ownerObject()->uiCapability()->uiName(); + return arrayField->uiCapability()->uiName(); } } } @@ -310,3 +322,43 @@ std::vector*> RicToggleItemsFeatureImpl::findToggleFieldsFro return fields; } + +//-------------------------------------------------------------------------------------------------- +/// Based on code in CmdUiCommandSystemImpl::fieldChangedCommand() +/// Could be merged and put into a tool class +//-------------------------------------------------------------------------------------------------- +std::pair + RicToggleItemsFeatureImpl::findOwnerAndChildArrayField( caf::PdmFieldHandle* fieldHandle ) +{ + if ( !fieldHandle ) return {}; + + caf::PdmChildArrayFieldHandle* childArrayFieldHandle = nullptr; + caf::PdmObjectHandle* ownerOfChildArrayField = nullptr; + + // Find the first childArrayField by traversing parent field and objects. Usually, the childArrayField is + // the parent, but in some cases when we change fields in a sub-object of the object we need to traverse + // more levels + + ownerOfChildArrayField = fieldHandle->ownerObject(); + while ( ownerOfChildArrayField ) + { + if ( ownerOfChildArrayField->parentField() ) + { + childArrayFieldHandle = dynamic_cast( ownerOfChildArrayField->parentField() ); + ownerOfChildArrayField = ownerOfChildArrayField->parentField()->ownerObject(); + + if ( childArrayFieldHandle && ownerOfChildArrayField ) break; + } + else + { + ownerOfChildArrayField = nullptr; + } + } + + if ( ownerOfChildArrayField && childArrayFieldHandle ) + { + return { ownerOfChildArrayField, childArrayFieldHandle }; + } + + return {}; +} diff --git a/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeatureImpl.h b/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeatureImpl.h index f2ce3f874b..a4eeac73ab 100644 --- a/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeatureImpl.h +++ b/ApplicationLibCode/Commands/ToggleCommands/RicToggleItemsFeatureImpl.h @@ -28,6 +28,7 @@ namespace caf class PdmUiItem; class PdmUiTreeOrdering; class PdmUiTreeView; +class PdmChildArrayFieldHandle; }; // namespace caf //================================================================================================== @@ -55,4 +56,6 @@ private: static caf::PdmUiTreeView* findTreeView( const caf::PdmUiItem* uiItem ); static caf::PdmUiTreeOrdering* findTreeItemFromSelectedUiItem( const caf::PdmUiItem* uiItem ); static std::vector*> findToggleFieldsFromSelection( SelectionToggleType state ); + + static std::pair findOwnerAndChildArrayField( caf::PdmFieldHandle* fieldHandle ); }; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicWellPathPickEventHandler.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicWellPathPickEventHandler.cpp index 303e7ac5a9..48b8b636fe 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicWellPathPickEventHandler.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicWellPathPickEventHandler.cpp @@ -220,7 +220,7 @@ bool RicWellPathPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& event RiuMainWindow::instance()->setResultInfo( wellPathText ); - RiuPlotMainWindow::onWellSelected( wellPathSourceInfo->wellPath()->name() ); + RiuPlotMainWindow::onWellSelected( wellPathSourceInfo->wellPath()->name(), rimView->currentTimeStep() ); if ( objectToSelect ) { diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp index 0307f04800..16d6694c38 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp @@ -170,6 +170,15 @@ void RimWellAllocationOverTimePlot::setFromSimulationWell( RimSimWellInView* sim onLoadDataAndUpdate(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellAllocationOverTimePlot::setWellName( const QString& wellName ) +{ + m_wellName = wellName; + onLoadDataAndUpdate(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.h b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.h index a04c3ab858..a376fbe6e8 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.h +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.h @@ -68,6 +68,7 @@ public: void setDescription( const QString& description ); void setFromSimulationWell( RimSimWellInView* simWell ); + void setWellName( const QString& wellName ); // RimPlot implementations RiuPlotWidget* plotWidget() override; diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 63ea016714..d20ae95b77 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -185,6 +185,26 @@ void RimWellAllocationPlot::setFromSimulationWell( RimSimWellInView* simWell ) onLoadDataAndUpdate(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellAllocationPlot::setWellName( const QString& wellName ) +{ + m_wellName = wellName; + onLoadDataAndUpdate(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellAllocationPlot::setTimeStep( int timeStep ) +{ + if ( timeStep < 0 ) return; + + m_timeStep = timeStep; + onLoadDataAndUpdate(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.h b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.h index f443c774c6..410be11526 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.h @@ -68,6 +68,8 @@ public: int id() const final; void setFromSimulationWell( RimSimWellInView* simWell ); + void setWellName( const QString& wellName ); + void setTimeStep( int timeStep ); void setDescription( const QString& description ); QString description() const; diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp index c889e4903b..c3b70121d6 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp @@ -150,13 +150,7 @@ void RimWellDistributionPlot::updateLegend() return; } - // Hide the legend when in multiplot mode, as the legend is handeled by the multi plot grid layout - bool doShowLegend = false; - if ( isMdiWindow() ) - { - doShowLegend = m_showPlotLegends; - } - + bool doShowLegend = true; if ( doShowLegend ) { QwtLegend* legend = new QwtLegend( m_plotWidget ); @@ -315,14 +309,7 @@ void RimWellDistributionPlot::onLoadDataAndUpdate() // cvf::Trace::show("RimWellDistributionPlot::onLoadDataAndUpdate()"); // cvf::DebugTimer tim("RimWellDistributionPlot::onLoadDataAndUpdate()"); - if ( isMdiWindow() ) - { - updateMdiWindowVisibility(); - } - else - { - updateParentLayout(); - } + updateParentLayout(); if ( !m_plotWidget ) { @@ -363,6 +350,7 @@ void RimWellDistributionPlot::onLoadDataAndUpdate() const QString timeStepName = m_case ? m_case->timeStepName( m_timeStepIndex ) : "N/A"; const QString plotTitleStr = QString( "%1 Distribution: %2, %3" ).arg( phaseString ).arg( m_wellName ).arg( timeStepName ); + m_plotWidget->setPlotTitleRenderingFlags( Qt::AlignHCenter | Qt::TextWordWrap ); m_plotWidget->setPlotTitle( plotTitleStr ); m_plotWidget->setAxisTitleText( RiuPlotAxis::defaultBottom(), "TOF [years]" ); diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.cpp index 73497e1188..eb9269e24c 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.cpp @@ -110,6 +110,30 @@ void RimWellDistributionPlotCollection::setData( RimEclipseResultCase* eclipseCa applyPlotParametersToContainedPlots(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellDistributionPlotCollection::setWellName( const QString& wellName ) +{ + m_wellName = wellName; + applyPlotParametersToContainedPlots(); + loadDataAndUpdate(); + if ( m_viewer ) m_viewer->scheduleUpdate(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellDistributionPlotCollection::setTimeStep( int timeStep ) +{ + if ( timeStep < 0 ) return; + + m_timeStepIndex = timeStep; + applyPlotParametersToContainedPlots(); + loadDataAndUpdate(); + if ( m_viewer ) m_viewer->scheduleUpdate(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -308,6 +332,11 @@ void RimWellDistributionPlotCollection::fieldChangedByUi( const caf::PdmFieldHan { applyPlotParametersToContainedPlots(); shouldRecalculatePlotData = true; + + if ( changedField == &m_showOil || changedField == &m_showGas || changedField == &m_showWater || changedField == &m_showWindow ) + { + if ( m_viewer ) m_viewer->scheduleUpdate(); + } } RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue ); diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.h b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.h index fd82799f4d..7c7b900f05 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.h @@ -52,6 +52,8 @@ public: ~RimWellDistributionPlotCollection() override; void setData( RimEclipseResultCase* eclipseCase, QString wellName, int timeStepIndex ); + void setWellName( const QString& wellName ); + void setTimeStep( int timeStep ); QWidget* viewWidget() override; QString description() const override; diff --git a/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp index b7ddd21985..1bb192e92c 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp @@ -154,7 +154,7 @@ RimDepthTrackPlot::RimDepthTrackPlot() CAF_PDM_InitFieldNoDefault( &m_ensembleCurveSet, "FilterEnsembleCurveSet", "Filter by Ensemble Curve Set" ); CAF_PDM_InitFieldNoDefault( &m_depthEqualization, "DepthEqualization", "Depth Equalization" ); - CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "" ); + CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "Tracks" ); m_plots.uiCapability()->setUiTreeHidden( true ); auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_plots ); reorderability->orderChanged.connect( this, &RimDepthTrackPlot::onPlotsReordered ); diff --git a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp index 7e740ca615..e3999857f8 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp @@ -48,6 +48,9 @@ #include "RimSummaryTableCollection.h" #include "RimVfpPlotCollection.h" #include "RimViewWindow.h" +#include "RimWellAllocationOverTimePlot.h" +#include "RimWellAllocationPlot.h" +#include "RimWellDistributionPlotCollection.h" #include "RimWellLogPlot.h" #include "RimWellLogPlotCollection.h" #include "RimWellPltPlot.h" @@ -399,7 +402,7 @@ void RimMainPlotCollection::loadDataAndUpdateAllPlots() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimMainPlotCollection::updateSelectedWell( QString wellName ) +void RimMainPlotCollection::updateSelectedWell( const QString& wellName, int timeStep ) { for ( auto plot : summaryMultiPlotCollection()->multiPlots() ) { @@ -410,6 +413,23 @@ void RimMainPlotCollection::updateSelectedWell( QString wellName ) { plot->selectWell( wellName ); } + + if ( auto plot = flowPlotCollection()->defaultWellAllocOverTimePlot() ) + { + plot->setWellName( wellName ); + } + + if ( auto plot = flowPlotCollection()->defaultWellAllocPlot() ) + { + plot->setWellName( wellName ); + plot->setTimeStep( timeStep ); + } + + if ( auto plot = flowPlotCollection()->wellDistributionPlotCollection() ) + { + plot->setWellName( wellName ); + plot->setTimeStep( timeStep ); + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h index 2c7ed7f63b..3dc02afb02 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h +++ b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h @@ -91,7 +91,7 @@ public: void deleteAllCachedData(); void ensureDefaultFlowPlotsAreCreated(); void loadDataAndUpdateAllPlots(); - void updateSelectedWell( QString wellName ); + void updateSelectedWell( const QString& wellName, int timeStep ); protected: void initAfterRead() override; diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp index 83ee0934ae..6254348744 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp @@ -203,7 +203,7 @@ RimSimWellInViewCollection::RimSimWellInViewCollection() "Toggle whether the well pipe visualization will try to detect when a part of the well \nis " "really a branch, and thus is starting from wellhead", "" ); - CAF_PDM_InitField( &wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum( WELLHEAD_POS_TOP_COLUMN ), "Well Head Position" ); + CAF_PDM_InitField( &wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum( WELLHEAD_POS_ACTIVE_CELLS_BB ), "Well Head Position" ); CAF_PDM_InitFieldNoDefault( &wells, "Wells", "Wells" ); wells.uiCapability()->setUiTreeHidden( true ); diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDifferenceData.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDifferenceData.cpp index 1927248eb5..df9c9242b1 100644 --- a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDifferenceData.cpp +++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDifferenceData.cpp @@ -462,7 +462,7 @@ std::shared_ptr if ( !isInputDataOK() ) return nullptr; auto data1 = m_seismicData1->sliceData( worldX1, worldY1, worldX2, worldY2, zMin, zMax ); - auto data2 = m_seismicData1->sliceData( worldX1, worldY1, worldX2, worldY2, zMin, zMax ); + auto data2 = m_seismicData2->sliceData( worldX1, worldY1, worldX2, worldY2, zMin, zMax ); if ( ( data1 == nullptr ) || ( data2 == nullptr ) ) return nullptr; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp index fcfc31fbd9..987066a04b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp @@ -51,7 +51,7 @@ RimSummaryCurveCollection::RimSummaryCurveCollection() { CAF_PDM_InitObject( "Summary Curves", ":/SummaryCurveFilter16x16.png" ); - CAF_PDM_InitFieldNoDefault( &m_curves, "CollectionCurves", "Collection Curves" ); + CAF_PDM_InitFieldNoDefault( &m_curves, "CollectionCurves", "Curves" ); m_curves.uiCapability()->setUiTreeHidden( true ); m_curves.uiCapability()->setUiTreeChildrenHidden( false ); caf::PdmFieldReorderCapability::addToFieldWithCallback( &m_curves, this, &RimSummaryCurveCollection::onCurvesReordered ); diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp index a1b5e2b2cb..2d85d3ed94 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp @@ -185,7 +185,7 @@ RimWellLogTrack::RimWellLogTrack() CAF_PDM_InitFieldNoDefault( &m_description, "TrackDescription", "Name" ); - CAF_PDM_InitFieldNoDefault( &m_curves, "Curves", "" ); + CAF_PDM_InitFieldNoDefault( &m_curves, "Curves", "Curves" ); m_curves.uiCapability()->setUiTreeHidden( true ); auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_curves ); reorderability->orderChanged.connect( this, &RimWellLogTrack::curveDataChanged ); @@ -1368,6 +1368,10 @@ void RimWellLogTrack::onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArr { if ( childArray == &m_curves ) { + // If multiple curves are unchecked, we need to attach/reattach to make sure the unchecked curves are not visible + detachAllCurves(); + reattachAllCurves(); + loadDataAndUpdate(); } } diff --git a/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp b/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp index f035d87a06..ed8cdb5dd0 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp +++ b/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp @@ -156,14 +156,14 @@ RiuPlotMainWindow* RiuPlotMainWindow::instance() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiuPlotMainWindow::onWellSelected( QString wellName ) +void RiuPlotMainWindow::onWellSelected( const QString& wellName, int timeStep ) { RiuPlotMainWindow* plotWnd = instance(); if ( !plotWnd ) return; if ( !plotWnd->selection3DLinkEnabled() ) return; - RimMainPlotCollection::current()->updateSelectedWell( wellName ); + RimMainPlotCollection::current()->updateSelectedWell( wellName, timeStep ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/RiuPlotMainWindow.h b/ApplicationLibCode/UserInterface/RiuPlotMainWindow.h index 29f5cbb81c..0d33a5a6e3 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotMainWindow.h +++ b/ApplicationLibCode/UserInterface/RiuPlotMainWindow.h @@ -60,7 +60,7 @@ public: ~RiuPlotMainWindow() override; static RiuPlotMainWindow* instance(); - static void onWellSelected( QString wellName ); + static void onWellSelected( const QString& wellName, int timeStep ); QString mainWindowName() override; diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp index a2dcd8928b..716d665ac7 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp @@ -78,6 +78,7 @@ //-------------------------------------------------------------------------------------------------- RiuQwtPlotWidget::RiuQwtPlotWidget( RimPlot* plotDefinition, QWidget* parent ) : RiuPlotWidget( plotDefinition, parent ) + , m_titleRenderingFlags( Qt::AlignHCenter | Qt::TextSingleLine ) { auto* layout = new QVBoxLayout; layout->setContentsMargins( 0, 0, 0, 0 ); @@ -248,9 +249,18 @@ void RiuQwtPlotWidget::setPlotTitleFontSize( int titleFontSize ) QFont font = title.font(); font.setPixelSize( caf::FontTools::pointSizeToPixelSize( titleFontSize ) ); title.setFont( font ); + title.setRenderFlags( title.renderFlags() | Qt::TextWordWrap ); m_plot->setTitle( title ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuQwtPlotWidget::setPlotTitleRenderingFlags( int flags ) +{ + m_titleRenderingFlags = flags; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -668,7 +678,7 @@ void RiuQwtPlotWidget::applyPlotTitleToQwt() { QString plotTitleToApply = m_plotTitleEnabled ? m_plotTitle : QString( "" ); QwtText plotTitle = m_plot->title(); - plotTitle.setRenderFlags( Qt::AlignHCenter | Qt::TextSingleLine ); + plotTitle.setRenderFlags( m_titleRenderingFlags ); if ( plotTitleToApply != plotTitle.text() ) { plotTitle.setText( plotTitleToApply ); diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.h b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.h index 7587393287..77ca886879 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.h +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.h @@ -101,6 +101,7 @@ public: void setPlotTitleEnabled( bool enabled ) override; bool plotTitleEnabled() const override; void setPlotTitleFontSize( int titleFontSize ) override; + void setPlotTitleRenderingFlags( int flags ); void setLegendFontSize( int fontSize ) override; void setInternalLegendVisible( bool visible ) override; @@ -234,4 +235,6 @@ private: std::map m_axisMapping; QPointer m_plot; + + int m_titleRenderingFlags; }; diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp index 202f433bc5..84d07f1b40 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp @@ -832,7 +832,8 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard { bool allowActiveViewChange = dynamic_cast( m_viewer->ownerViewWindow() ) == nullptr; - RiuPlotMainWindow::onWellSelected( eclipseWellSourceInfo->well()->name() ); + RiuPlotMainWindow::onWellSelected( eclipseWellSourceInfo->well()->name(), mainOrComparisonView->currentTimeStep() ); + RiuMainWindow::instance()->selectAsCurrentItem( eclipseWellSourceInfo->well(), allowActiveViewChange ); } else if ( wellConnectionSourceInfo ) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index d25c08e670..9f827525a8 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -5,7 +5,7 @@ set(RESINSIGHT_PATCH_VERSION 0) # Opional text with no restrictions #set(RESINSIGHT_VERSION_TEXT "-dev") -set(RESINSIGHT_VERSION_TEXT "-RC_04") +set(RESINSIGHT_VERSION_TEXT "-RC_05") # Optional text # Must be unique and increasing within one combination of major/minor/patch version