mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2898 Ensemble curves. Add vector selection button and dialog
This commit is contained in:
@@ -35,7 +35,9 @@
|
||||
#include "RimSummaryFilter.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
#include "RiuSummaryCurveDefSelectionDialog.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cafPdmUiListEditor.h"
|
||||
@@ -112,8 +114,6 @@ RimEnsembleCurveSet::RimEnsembleCurveSet()
|
||||
CAF_PDM_InitFieldNoDefault(&m_yPushButtonSelectSummaryAddress, "SelectAddress", "", "", "", "");
|
||||
caf::PdmUiPushButtonEditor::configureEditorForField(&m_yPushButtonSelectSummaryAddress);
|
||||
m_yPushButtonSelectSummaryAddress = false;
|
||||
m_yPushButtonSelectSummaryAddress.uiCapability()->setUiReadOnly(true);
|
||||
m_yPushButtonSelectSummaryAddress.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_yValuesCurveVariable = new RimSummaryAddress;
|
||||
|
||||
@@ -418,6 +418,37 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
{
|
||||
m_userDefinedName = createAutoName();
|
||||
}
|
||||
else if (changedField == &m_yPushButtonSelectSummaryAddress)
|
||||
{
|
||||
RiuSummaryCurveDefSelectionDialog dlg(nullptr);
|
||||
RimSummaryCaseCollection* candidateEnsemble = m_yValuesSummaryGroup();
|
||||
RifEclipseSummaryAddress candicateAddress = m_yValuesCurveVariable->address();
|
||||
|
||||
dlg.hideSummaryCases();
|
||||
dlg.setEnsembleAndAddress(candidateEnsemble, candicateAddress);
|
||||
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
auto curveSelection = dlg.curveSelection();
|
||||
if (curveSelection.size() > 0)
|
||||
{
|
||||
m_yValuesSummaryGroup = curveSelection[0].ensemble();
|
||||
m_yValuesCurveVariable->setAddress(curveSelection[0].summaryAddress());
|
||||
|
||||
this->loadDataAndUpdate(true);
|
||||
|
||||
plot->updateAxes();
|
||||
plot->updatePlotTitle();
|
||||
plot->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||
mainPlotWindow->updateSummaryPlotToolBar();
|
||||
}
|
||||
}
|
||||
|
||||
m_yPushButtonSelectSummaryAddress = false;
|
||||
}
|
||||
|
||||
|
||||
if (changedField == &m_isUsingAutoName ||
|
||||
changedField == &m_userDefinedName ||
|
||||
|
||||
@@ -697,6 +697,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
candicateAddress = m_xValuesCurveVariable->address();
|
||||
}
|
||||
|
||||
dlg.hideEnsembles();
|
||||
dlg.setCaseAndAddress(candidateCase, candicateAddress);
|
||||
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
@@ -730,6 +731,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
candicateAddress = m_yValuesCurveVariable->address();
|
||||
}
|
||||
|
||||
dlg.hideEnsembles();
|
||||
dlg.setCaseAndAddress(candidateCase, candicateAddress);
|
||||
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
|
||||
Reference in New Issue
Block a user