#3309 Toolbar buttons for well log plot data source and make sure only visible curves and zonation/attributes affect the data source.

* This also required adding some updateConnectedEditors for updating the selected property views when changing the toolbar.
This commit is contained in:
Gaute Lindkvist
2018-09-10 09:55:07 +02:00
parent 742b7aab11
commit 0460eb2ac2
12 changed files with 136 additions and 20 deletions

View File

@@ -27,6 +27,7 @@
#include "RimSummaryPlot.h"
#include "RimViewWindow.h"
#include "RimWellAllocationPlot.h"
#include "RimWellLogCurveCommonDataSource.h"
#include "RimWellLogPlot.h"
#include "RiuDragDrop.h"
@@ -114,6 +115,7 @@ void RiuPlotMainWindow::cleanupGuiBeforeProjectClose()
cleanUpTemporaryWidgets();
m_wellLogPlotToolBarEditor->clear();
m_summaryPlotToolBarEditor->clear();
setWindowTitle("Plots - ResInsight");
@@ -317,6 +319,9 @@ void RiuPlotMainWindow::createToolBars()
}
}
m_wellLogPlotToolBarEditor = new caf::PdmUiToolBarEditor("Well Log Plot", this);
m_wellLogPlotToolBarEditor->hide();
m_summaryPlotToolBarEditor = new caf::PdmUiToolBarEditor("Summary Plot", this);
m_summaryPlotToolBarEditor->hide();
}
@@ -461,6 +466,32 @@ void RiuPlotMainWindow::addToTemporaryWidgets(QWidget* widget)
m_temporaryWidgets.push_back(widget);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::updateWellLogPlotToolBar()
{
RimWellLogPlot* wellLogPlot = dynamic_cast<RimWellLogPlot*>(m_activePlotViewWindow.p());
if (wellLogPlot)
{
std::vector<caf::PdmFieldHandle*> toolBarFields;
toolBarFields = wellLogPlot->commonDataSource()->fieldsToShowInToolbar();
m_wellLogPlotToolBarEditor->setFields(toolBarFields);
m_wellLogPlotToolBarEditor->updateUi();
m_wellLogPlotToolBarEditor->show();
}
else
{
m_wellLogPlotToolBarEditor->clear();
m_wellLogPlotToolBarEditor->hide();
}
refreshToolbars();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -603,6 +634,7 @@ void RiuPlotMainWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
m_activePlotViewWindow = viewWindow;
}
updateWellLogPlotToolBar();
updateSummaryPlotToolBar();
}