mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2170 Summary Source Stepping : Do not show summary case step if only one case is available
This commit is contained in:
parent
6103f290bf
commit
a431d10457
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include "RifSummaryReaderInterface.h"
|
#include "RifSummaryReaderInterface.h"
|
||||||
|
|
||||||
#include "RimOilField.h"
|
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
#include "RimSummaryCaseMainCollection.h"
|
#include "RimSummaryCaseMainCollection.h"
|
||||||
@ -174,9 +173,13 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::fieldsToShowInTo
|
|||||||
analyzer.analyzeCurves(curveCollection);
|
analyzer.analyzeCurves(curveCollection);
|
||||||
|
|
||||||
if (analyzer.summaryCases().size() == 1)
|
if (analyzer.summaryCases().size() == 1)
|
||||||
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allSummaryCases().size() > 1)
|
||||||
{
|
{
|
||||||
fields.push_back(&m_summaryCase);
|
fields.push_back(&m_summaryCase);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (analyzer.wellNames().size() == 1)
|
if (analyzer.wellNames().size() == 1)
|
||||||
{
|
{
|
||||||
@ -221,15 +224,10 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
|
|||||||
|
|
||||||
RimProject* proj = RiaApplication::instance()->project();
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
|
||||||
RimSummaryCaseMainCollection* sumCaseColl =
|
for (auto sumCase : proj->allSummaryCases())
|
||||||
proj->activeOilField() ? proj->activeOilField()->summaryCaseMainCollection() : nullptr;
|
|
||||||
if (sumCaseColl)
|
|
||||||
{
|
|
||||||
for (auto sumCase : sumCaseColl->allSummaryCases())
|
|
||||||
{
|
{
|
||||||
options.append(caf::PdmOptionItemInfo(sumCase->caseName(), sumCase));
|
options.append(caf::PdmOptionItemInfo(sumCase->caseName(), sumCase));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
@ -458,9 +456,19 @@ void RimSummaryPlotSourceStepping::updateUiFromCurves()
|
|||||||
|
|
||||||
if (analyzer.summaryCases().size() == 1)
|
if (analyzer.summaryCases().size() == 1)
|
||||||
{
|
{
|
||||||
m_summaryCase = *(analyzer.summaryCases().begin());
|
std::set<RimSummaryCase*> sumCases = analyzer.summaryCases();
|
||||||
|
|
||||||
|
if (sumCases.find(m_summaryCase) == sumCases.end())
|
||||||
|
{
|
||||||
|
m_summaryCase = *(sumCases.begin());
|
||||||
|
}
|
||||||
|
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allSummaryCases().size() > 1)
|
||||||
|
{
|
||||||
m_summaryCase.uiCapability()->setUiHidden(false);
|
m_summaryCase.uiCapability()->setUiHidden(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||||
{
|
{
|
||||||
@ -535,9 +543,13 @@ caf::PdmFieldHandle* RimSummaryPlotSourceStepping::fieldToModify()
|
|||||||
// A pointer field is no a value field, so this must be improved
|
// A pointer field is no a value field, so this must be improved
|
||||||
// to be able to step between summary cases
|
// to be able to step between summary cases
|
||||||
if (analyzer.summaryCases().size() == 1)
|
if (analyzer.summaryCases().size() == 1)
|
||||||
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allSummaryCases().size() > 1)
|
||||||
{
|
{
|
||||||
return &m_summaryCase;
|
return &m_summaryCase;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user