#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
//--------------------------------------------------------------------------------------------------
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() );
return indexLhs < indexRhs;
} );
updatePlotNames();
updateSubPlotNames();
updateConnectedEditors();
}
@ -371,7 +376,9 @@ QString RimMultiPlotWindow::asciiDataForPlotExport() const
//--------------------------------------------------------------------------------------------------
void RimMultiPlotWindow::onPlotAdditionOrRemoval()
{
updatePlotNames();
updateSubPlotNames();
updatePlotWindowTitle();
applyPlotWindowTitleToWidgets();
updateConnectedEditors();
updateLayout();
RiuPlotMainWindowTools::refreshToolbars();
@ -455,7 +462,8 @@ void RimMultiPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
}
else if ( changedField == &m_showPlotWindowTitle || changedField == &m_plotWindowTitle )
{
updatePlotTitleInWidgets();
updatePlotWindowTitle();
applyPlotWindowTitleToWidgets();
}
else if ( changedField == &m_columnCountEnum )
{
@ -526,7 +534,8 @@ QList<caf::PdmOptionItemInfo> RimMultiPlotWindow::calculateValueOptions( const c
void RimMultiPlotWindow::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updatePlotTitleInWidgets();
updatePlotWindowTitle();
applyPlotWindowTitleToWidgets();
updatePlots();
updateLayout();
}
@ -542,7 +551,7 @@ void RimMultiPlotWindow::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMultiPlotWindow::updatePlotTitleInWidgets()
void RimMultiPlotWindow::applyPlotWindowTitleToWidgets()
{
if ( m_viewer )
{

View File

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

View File

@ -133,6 +133,9 @@ RimWellBoreStabilityPlot::RimWellBoreStabilityPlot()
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 );
}
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup( "Title, Legend and Axis" );
RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *legendAndAxisGroup );
uiOrderingForDepthAxis( uiConfigName, *legendAndAxisGroup );
caf::PdmUiGroup* titleLegendAndAxisGroup = uiOrdering.addNewGroup( "Title, Legend and Axis" );
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *titleLegendAndAxisGroup );
RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *titleLegendAndAxisGroup );
uiOrderingForDepthAxis( uiConfigName, *titleLegendAndAxisGroup );
uiOrdering.skipRemainingFields( true );
}

View File

@ -418,7 +418,7 @@ void RimWellLogPlot::performAutoNameUpdate()
{
updateCommonDataSource();
setMultiPlotTitle( createAutoName() );
updatePlotTitleInWidgets();
applyPlotWindowTitleToWidgets();
}
//--------------------------------------------------------------------------------------------------
@ -517,7 +517,7 @@ void RimWellLogPlot::onPlotAdditionOrRemoval()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updatePlotNames()
void RimWellLogPlot::updateSubPlotNames()
{
auto plotVector = plots();
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 updatePlotNames() override;
void handleKeyPressEvent( QKeyEvent* keyEvent );
protected:
@ -125,6 +124,10 @@ protected:
QImage snapshotWindowContent() override;
private:
void updateSubPlotNames() override;
void updatePlotWindowTitle() override;
protected:
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
bool m_commonDataSourceEnabled;