mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2170 Summary Cross Plot : Improve update and visibility of UI when stepping
This commit is contained in:
parent
a5b361f8c9
commit
eb6b0997c8
@ -353,7 +353,7 @@ void RimSummaryCurveCollection::defineUiOrdering(QString uiConfigName, caf::PdmU
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto group = uiOrdering.addNewGroup("Union Source Stepping");
|
auto group = uiOrdering.addNewGroup("XY Union Source Stepping");
|
||||||
|
|
||||||
m_unionSourceStepping()->uiOrdering(uiConfigName, *group);
|
m_unionSourceStepping()->uiOrdering(uiConfigName, *group);
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,12 @@
|
|||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
#include "RimSummaryCaseMainCollection.h"
|
#include "RimSummaryCaseMainCollection.h"
|
||||||
|
#include "RimSummaryCrossPlot.h"
|
||||||
#include "RimSummaryCurve.h"
|
#include "RimSummaryCurve.h"
|
||||||
#include "RimSummaryCurveCollection.h"
|
#include "RimSummaryCurveCollection.h"
|
||||||
#include "RimSummaryPlot.h"
|
#include "RimSummaryPlot.h"
|
||||||
|
|
||||||
|
#include "RiuMainPlotWindow.h"
|
||||||
#include "cafPdmUiComboBoxEditor.h"
|
#include "cafPdmUiComboBoxEditor.h"
|
||||||
#include "cafPdmUiItem.h"
|
#include "cafPdmUiItem.h"
|
||||||
#include "cafPdmUiListEditor.h"
|
#include "cafPdmUiListEditor.h"
|
||||||
@ -449,8 +451,18 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
||||||
|
|
||||||
summaryPlot->updatePlotTitle();
|
summaryPlot->updatePlotTitle();
|
||||||
|
|
||||||
summaryPlot->loadDataAndUpdate();
|
summaryPlot->loadDataAndUpdate();
|
||||||
|
|
||||||
|
RimSummaryCrossPlot* summaryCrossPlot = dynamic_cast<RimSummaryCrossPlot*>(summaryPlot);
|
||||||
|
if (summaryCrossPlot)
|
||||||
|
{
|
||||||
|
// Trigger update of curve collection (and summary toolbar in main window), as the visibility of combo boxes might
|
||||||
|
// have been changed due to the updates in this function
|
||||||
|
curveCollection->updateConnectedEditors();
|
||||||
|
|
||||||
|
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||||
|
mainPlotWindow->updateSummaryPlotToolBar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,6 +416,34 @@ void RiuMainPlotWindow::addToTemporaryWidgets(QWidget* widget)
|
|||||||
m_temporaryWidgets.push_back(widget);
|
m_temporaryWidgets.push_back(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMainPlotWindow::updateSummaryPlotToolBar()
|
||||||
|
{
|
||||||
|
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(m_activePlotViewWindow);
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
||||||
|
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||||
|
|
||||||
|
if (!m_summaryPlotToolBarEditor->isEditorDataValid(toolBarFields))
|
||||||
|
{
|
||||||
|
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
||||||
|
m_summaryPlotToolBarEditor->updateUi();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_summaryPlotToolBarEditor->show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_summaryPlotToolBarEditor->clear();
|
||||||
|
|
||||||
|
m_summaryPlotToolBarEditor->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -527,23 +555,7 @@ void RiuMainPlotWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
|
|||||||
m_activePlotViewWindow = viewWindow;
|
m_activePlotViewWindow = viewWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(viewWindow);
|
updateSummaryPlotToolBar();
|
||||||
if (summaryPlot)
|
|
||||||
{
|
|
||||||
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
|
||||||
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
|
||||||
|
|
||||||
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
|
||||||
m_summaryPlotToolBarEditor->updateUi();
|
|
||||||
|
|
||||||
m_summaryPlotToolBarEditor->show();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_summaryPlotToolBarEditor->clear();
|
|
||||||
|
|
||||||
m_summaryPlotToolBarEditor->hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -83,6 +83,8 @@ public:
|
|||||||
|
|
||||||
void addToTemporaryWidgets(QWidget* widget);
|
void addToTemporaryWidgets(QWidget* widget);
|
||||||
|
|
||||||
|
void updateSummaryPlotToolBar();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent* event);
|
virtual void closeEvent(QCloseEvent* event);
|
||||||
|
|
||||||
|
@ -73,6 +73,33 @@ PdmUiToolBarEditor::~PdmUiToolBarEditor()
|
|||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool PdmUiToolBarEditor::isEditorDataValid(const std::vector<caf::PdmFieldHandle*>& fields) const
|
||||||
|
{
|
||||||
|
if (m_fields.size() == fields.size() &&
|
||||||
|
m_fieldViews.size() == fields.size())
|
||||||
|
{
|
||||||
|
bool equalContent = true;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < m_fields.size(); i++)
|
||||||
|
{
|
||||||
|
if (m_fields[i] != fields[i])
|
||||||
|
{
|
||||||
|
equalContent = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equalContent)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -61,6 +61,7 @@ public:
|
|||||||
PdmUiToolBarEditor(const QString& title, QMainWindow* mainWindow);
|
PdmUiToolBarEditor(const QString& title, QMainWindow* mainWindow);
|
||||||
~PdmUiToolBarEditor();
|
~PdmUiToolBarEditor();
|
||||||
|
|
||||||
|
bool isEditorDataValid(const std::vector<caf::PdmFieldHandle*>& fields) const;
|
||||||
void setFields(std::vector<caf::PdmFieldHandle*>& fields);
|
void setFields(std::vector<caf::PdmFieldHandle*>& fields);
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user