#5063 Improve auto name for well log plots and use it for well allocation plots

This commit is contained in:
Gaute Lindkvist 2019-11-26 08:45:17 +01:00
parent 431f0ff347
commit 3db9948a3b
5 changed files with 42 additions and 17 deletions

View File

@ -272,7 +272,12 @@ void RimMultiPlotWindow::doUpdateLayout()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// Empty default implementation /// Empty default implementation
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimMultiPlotWindow::updatePlotNames() {} void RimMultiPlotWindow::updateSubPlotNames() {}
//--------------------------------------------------------------------------------------------------
/// Empty default implementation
//--------------------------------------------------------------------------------------------------
void RimMultiPlotWindow::updatePlotWindowTitle() {}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
@ -284,7 +289,7 @@ void RimMultiPlotWindow::updatePlotOrderFromGridWidget()
auto indexRhs = m_viewer->indexOfPlotWidget( rhs->viewer() ); auto indexRhs = m_viewer->indexOfPlotWidget( rhs->viewer() );
return indexLhs < indexRhs; return indexLhs < indexRhs;
} ); } );
updatePlotNames(); updateSubPlotNames();
updateConnectedEditors(); updateConnectedEditors();
} }
@ -371,7 +376,9 @@ QString RimMultiPlotWindow::asciiDataForPlotExport() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimMultiPlotWindow::onPlotAdditionOrRemoval() void RimMultiPlotWindow::onPlotAdditionOrRemoval()
{ {
updatePlotNames(); updateSubPlotNames();
updatePlotWindowTitle();
applyPlotWindowTitleToWidgets();
updateConnectedEditors(); updateConnectedEditors();
updateLayout(); updateLayout();
RiuPlotMainWindowTools::refreshToolbars(); RiuPlotMainWindowTools::refreshToolbars();
@ -455,7 +462,8 @@ void RimMultiPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
} }
else if ( changedField == &m_showPlotWindowTitle || changedField == &m_plotWindowTitle ) else if ( changedField == &m_showPlotWindowTitle || changedField == &m_plotWindowTitle )
{ {
updatePlotTitleInWidgets(); updatePlotWindowTitle();
applyPlotWindowTitleToWidgets();
} }
else if ( changedField == &m_columnCountEnum ) else if ( changedField == &m_columnCountEnum )
{ {
@ -526,7 +534,8 @@ QList<caf::PdmOptionItemInfo> RimMultiPlotWindow::calculateValueOptions( const c
void RimMultiPlotWindow::onLoadDataAndUpdate() void RimMultiPlotWindow::onLoadDataAndUpdate()
{ {
updateMdiWindowVisibility(); updateMdiWindowVisibility();
updatePlotTitleInWidgets(); updatePlotWindowTitle();
applyPlotWindowTitleToWidgets();
updatePlots(); updatePlots();
updateLayout(); updateLayout();
} }
@ -542,7 +551,7 @@ void RimMultiPlotWindow::initAfterRead()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimMultiPlotWindow::updatePlotTitleInWidgets() void RimMultiPlotWindow::applyPlotWindowTitleToWidgets()
{ {
if ( m_viewer ) if ( m_viewer )
{ {

View File

@ -76,8 +76,7 @@ public:
std::vector<RimPlot*> plots() const; std::vector<RimPlot*> plots() const;
std::vector<RimPlot*> visiblePlots() const; std::vector<RimPlot*> visiblePlots() const;
virtual void updatePlotNames(); void updatePlotOrderFromGridWidget();
void updatePlotOrderFromGridWidget();
void setAutoScaleXEnabled( bool enabled ); void setAutoScaleXEnabled( bool enabled );
void setAutoScaleYEnabled( bool enabled ); void setAutoScaleYEnabled( bool enabled );
@ -113,7 +112,7 @@ protected:
void onLoadDataAndUpdate() override; void onLoadDataAndUpdate() override;
void initAfterRead() override; void initAfterRead() override;
void updatePlotTitleInWidgets(); void applyPlotWindowTitleToWidgets();
void updatePlots(); void updatePlots();
virtual void updateZoom(); virtual void updateZoom();
void recreatePlotWidgets(); void recreatePlotWidgets();
@ -125,8 +124,10 @@ protected:
bool forceChange = false ) override; bool forceChange = false ) override;
private: private:
void cleanupBeforeClose(); void cleanupBeforeClose();
void doUpdateLayout() override; void doUpdateLayout() override;
virtual void updateSubPlotNames();
virtual void updatePlotWindowTitle();
protected: protected:
caf::PdmField<bool> m_showPlotWindowTitle; caf::PdmField<bool> m_showPlotWindowTitle;

View File

@ -133,6 +133,9 @@ RimWellBoreStabilityPlot::RimWellBoreStabilityPlot()
setParameterSource( parameterFieldPair.first, sources.front() ); setParameterSource( parameterFieldPair.first, sources.front() );
} }
} }
m_nameConfig->setCustomName( "Well Bore Stability" );
m_nameConfig->enableAllAutoNameTags( true );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -223,9 +226,10 @@ void RimWellBoreStabilityPlot::defineUiOrdering( QString uiConfigName, caf::PdmU
parameterSources->add( &m_userDefinedK0FG ); parameterSources->add( &m_userDefinedK0FG );
} }
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup( "Title, Legend and Axis" ); caf::PdmUiGroup* titleLegendAndAxisGroup = uiOrdering.addNewGroup( "Title, Legend and Axis" );
RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *legendAndAxisGroup ); RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *titleLegendAndAxisGroup );
uiOrderingForDepthAxis( uiConfigName, *legendAndAxisGroup ); RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *titleLegendAndAxisGroup );
uiOrderingForDepthAxis( uiConfigName, *titleLegendAndAxisGroup );
uiOrdering.skipRemainingFields( true ); uiOrdering.skipRemainingFields( true );
} }

View File

@ -418,7 +418,7 @@ void RimWellLogPlot::performAutoNameUpdate()
{ {
updateCommonDataSource(); updateCommonDataSource();
setMultiPlotTitle( createAutoName() ); setMultiPlotTitle( createAutoName() );
updatePlotTitleInWidgets(); applyPlotWindowTitleToWidgets();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -517,7 +517,7 @@ void RimWellLogPlot::onPlotAdditionOrRemoval()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updatePlotNames() void RimWellLogPlot::updateSubPlotNames()
{ {
auto plotVector = plots(); auto plotVector = plots();
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx ) for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
@ -534,6 +534,14 @@ void RimWellLogPlot::updatePlotNames()
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updatePlotWindowTitle()
{
performAutoNameUpdate();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -103,7 +103,6 @@ public:
void onPlotAdditionOrRemoval() override; void onPlotAdditionOrRemoval() override;
void updatePlotNames() override;
void handleKeyPressEvent( QKeyEvent* keyEvent ); void handleKeyPressEvent( QKeyEvent* keyEvent );
protected: protected:
@ -125,6 +124,10 @@ protected:
QImage snapshotWindowContent() override; QImage snapshotWindowContent() override;
private:
void updateSubPlotNames() override;
void updatePlotWindowTitle() override;
protected: protected:
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource; caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
bool m_commonDataSourceEnabled; bool m_commonDataSourceEnabled;