mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-07 14:43:10 -06:00
#3914 Source Stepping : Add checkbox for include of ensemble cases
This commit is contained in:
parent
1ac998973e
commit
bc86158ff6
@ -54,6 +54,15 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
||||
CAF_PDM_InitObject("Summary Curves Modifier", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_summaryCase, "CurveCase", "Case", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_includeEnsembleCasesForCaseStepping,
|
||||
"IncludeEnsembleCasesForCaseStepping",
|
||||
false,
|
||||
"Allow Stepping on Ensemble cases",
|
||||
"",
|
||||
"",
|
||||
"");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellName, "WellName", "Well Name", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellGroupName, "GroupName", "Group Name", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_region, "Region", "Region", "", "", "");
|
||||
@ -185,12 +194,15 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if (fieldNeedingOptions == &m_placeholderForLabel)
|
||||
if (fieldNeedingOptions == &m_includeEnsembleCasesForCaseStepping)
|
||||
{
|
||||
return caf::PdmObject::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_placeholderForLabel)
|
||||
{
|
||||
options;
|
||||
}
|
||||
|
||||
if (fieldNeedingOptions == &m_summaryCase)
|
||||
else if (fieldNeedingOptions == &m_summaryCase)
|
||||
{
|
||||
auto summaryCases = RimSummaryPlotSourceStepping::summaryCasesForSourceStepping();
|
||||
for (auto sumCase : summaryCases)
|
||||
@ -356,6 +368,25 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
||||
RimEnsembleCurveSetCollection* ensembleCurveColl = nullptr;
|
||||
this->firstAncestorOrThisOfType(ensembleCurveColl);
|
||||
|
||||
if (changedField == &m_includeEnsembleCasesForCaseStepping)
|
||||
{
|
||||
if (curveCollection)
|
||||
{
|
||||
curveCollection->updateConnectedEditors();
|
||||
}
|
||||
|
||||
if (ensembleCurveColl)
|
||||
{
|
||||
ensembleCurveColl->updateConnectedEditors();
|
||||
}
|
||||
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateMainPlotWindow();
|
||||
bool forceUpdateOfFieldsInToolbar = true;
|
||||
mainPlotWindow->updateSummaryPlotToolBar(forceUpdateOfFieldsInToolbar);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool triggerLoadDataAndUpdate = false;
|
||||
|
||||
std::string oldValueString = oldValue.toString().toStdString();
|
||||
@ -721,6 +752,7 @@ std::set<RimSummaryCase*> RimSummaryPlotSourceStepping::summaryCasesCurveCollect
|
||||
std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFieldsAndSetFieldVisibility()
|
||||
{
|
||||
m_summaryCase.uiCapability()->setUiHidden(true);
|
||||
m_includeEnsembleCasesForCaseStepping.uiCapability()->setUiHidden(true);
|
||||
m_wellName.uiCapability()->setUiHidden(true);
|
||||
m_wellGroupName.uiCapability()->setUiHidden(true);
|
||||
m_region.uiCapability()->setUiHidden(true);
|
||||
@ -740,6 +772,8 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
||||
m_summaryCase.uiCapability()->setUiHidden(false);
|
||||
|
||||
fields.push_back(&m_summaryCase);
|
||||
|
||||
m_includeEnsembleCasesForCaseStepping.uiCapability()->setUiHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -989,10 +1023,17 @@ std::vector<RimSummaryCase*> RimSummaryPlotSourceStepping::summaryCasesForSource
|
||||
RimSummaryCaseCollection* sumCaseColl = nullptr;
|
||||
sumCase->firstAncestorOrThisOfType(sumCaseColl);
|
||||
|
||||
if (sumCaseColl && sumCaseColl->isEnsemble()) continue;
|
||||
;
|
||||
|
||||
cases.push_back(sumCase);
|
||||
if (sumCaseColl && sumCaseColl->isEnsemble())
|
||||
{
|
||||
if (m_includeEnsembleCasesForCaseStepping())
|
||||
{
|
||||
cases.push_back(sumCase);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cases.push_back(sumCase);
|
||||
}
|
||||
}
|
||||
|
||||
return cases;
|
||||
|
@ -106,7 +106,7 @@ private:
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress* adr);
|
||||
|
||||
static std::vector<RimSummaryCase*> summaryCasesForSourceStepping();
|
||||
std::vector<RimSummaryCase*> summaryCasesForSourceStepping();
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
|
||||
@ -117,6 +117,9 @@ private:
|
||||
caf::PdmField<int> m_region;
|
||||
caf::PdmField<QString> m_quantity;
|
||||
caf::PdmField<QString> m_placeholderForLabel;
|
||||
|
||||
caf::PdmField<bool> m_includeEnsembleCasesForCaseStepping;
|
||||
|
||||
SourceSteppingType m_sourceSteppingType;
|
||||
|
||||
std::pair<RifSummaryReaderInterface*, RiaSummaryCurveAnalyzer> m_curveAnalyzerForReader;
|
||||
|
@ -496,7 +496,7 @@ void RiuPlotMainWindow::updateWellLogPlotToolBar()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::updateSummaryPlotToolBar()
|
||||
void RiuPlotMainWindow::updateSummaryPlotToolBar(bool forceUpdateUi)
|
||||
{
|
||||
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(m_activePlotViewWindow.p());
|
||||
if (summaryPlot)
|
||||
@ -526,6 +526,10 @@ void RiuPlotMainWindow::updateSummaryPlotToolBar()
|
||||
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
||||
m_summaryPlotToolBarEditor->updateUi();
|
||||
}
|
||||
else if (forceUpdateUi)
|
||||
{
|
||||
m_summaryPlotToolBarEditor->updateUi();
|
||||
}
|
||||
|
||||
m_summaryPlotToolBarEditor->show();
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
void addToTemporaryWidgets(QWidget* widget);
|
||||
|
||||
void updateWellLogPlotToolBar();
|
||||
void updateSummaryPlotToolBar();
|
||||
void updateSummaryPlotToolBar(bool forceUpdateUi = false);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
Loading…
Reference in New Issue
Block a user