mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4716 Summary Case : Guard access to contained summary reader
This commit is contained in:
parent
cdf1b85551
commit
07ab821646
@ -427,7 +427,7 @@ void RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeS
|
|||||||
{
|
{
|
||||||
RimSummaryCase* summaryCase = mainCollection->findSummaryCaseFromEclipseResultCase(resultCase);
|
RimSummaryCase* summaryCase = mainCollection->findSummaryCaseFromEclipseResultCase(resultCase);
|
||||||
|
|
||||||
if (summaryCase)
|
if (summaryCase && summaryCase->summaryReader())
|
||||||
{
|
{
|
||||||
std::vector<double> values;
|
std::vector<double> values;
|
||||||
if (summaryCase->summaryReader()->values(wbhpPressureAddress, &values))
|
if (summaryCase->summaryReader()->values(wbhpPressureAddress, &values))
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimSummaryCurve* RicSummaryPlotFeatureImpl::addDefaultCurveToPlot(RimSummaryPlot* plot, RimSummaryCase* summaryCase)
|
RimSummaryCurve* RicSummaryPlotFeatureImpl::addDefaultCurveToPlot(RimSummaryPlot* plot, RimSummaryCase* summaryCase)
|
||||||
{
|
{
|
||||||
if (plot)
|
if (plot && summaryCase && summaryCase->summaryReader())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress defaultAddressToUse;
|
RifEclipseSummaryAddress defaultAddressToUse;
|
||||||
|
|
||||||
@ -88,6 +88,9 @@ std::vector<RimSummaryCurve*> RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot(
|
|||||||
{
|
{
|
||||||
std::vector<RimSummaryCurve*> defaultCurves;
|
std::vector<RimSummaryCurve*> defaultCurves;
|
||||||
|
|
||||||
|
if (!plot) return defaultCurves;
|
||||||
|
if (!summaryCase || !summaryCase->summaryReader()) return defaultCurves;
|
||||||
|
|
||||||
QString curvesTextFilter = RiaApplication::instance()->preferences()->defaultSummaryCurvesTextFilter;
|
QString curvesTextFilter = RiaApplication::instance()->preferences()->defaultSummaryCurvesTextFilter;
|
||||||
QStringList curveFilters = curvesTextFilter.split(";", QString::SkipEmptyParts);
|
QStringList curveFilters = curvesTextFilter.split(";", QString::SkipEmptyParts);
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ std::set<RifEclipseSummaryAddress> RimSummaryCaseCollection::ensembleSummaryAddr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxAddrIndex >= 0)
|
if (maxAddrIndex >= 0 && m_cases[maxAddrIndex]->summaryReader())
|
||||||
{
|
{
|
||||||
const std::set<RifEclipseSummaryAddress>& addrs = m_cases[maxAddrIndex]->summaryReader()->allResultAddresses();
|
const std::set<RifEclipseSummaryAddress>& addrs = m_cases[maxAddrIndex]->summaryReader()->allResultAddresses();
|
||||||
addresses.insert(addrs.begin(), addrs.end());
|
addresses.insert(addrs.begin(), addrs.end());
|
||||||
|
@ -515,16 +515,19 @@ void RimSummaryCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
|||||||
if (plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE)
|
if (plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE)
|
||||||
{
|
{
|
||||||
auto reader = summaryCaseY()->summaryReader();
|
auto reader = summaryCaseY()->summaryReader();
|
||||||
auto errAddress = reader->errorAddress(summaryAddressY());
|
if (reader)
|
||||||
if (errAddress.isValid())
|
|
||||||
{
|
{
|
||||||
std::vector<double> errValues;
|
auto errAddress = reader->errorAddress(summaryAddressY());
|
||||||
reader->values(errAddress, &errValues);
|
if (errAddress.isValid())
|
||||||
m_qwtPlotCurve->setSamplesFromTimeTAndYValues(curveTimeStepsY, curveValuesY, errValues, isLogCurve);
|
{
|
||||||
}
|
std::vector<double> errValues;
|
||||||
else
|
reader->values(errAddress, &errValues);
|
||||||
{
|
m_qwtPlotCurve->setSamplesFromTimeTAndYValues(curveTimeStepsY, curveValuesY, errValues, isLogCurve);
|
||||||
m_qwtPlotCurve->setSamplesFromTimeTAndYValues(curveTimeStepsY, curveValuesY, isLogCurve);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_qwtPlotCurve->setSamplesFromTimeTAndYValues(curveTimeStepsY, curveValuesY, isLogCurve);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -581,12 +581,12 @@ std::vector<RifSummaryReaderInterface*> RimSummaryPlotSourceStepping::summaryRea
|
|||||||
{
|
{
|
||||||
for (auto curve : curveCollection->curves())
|
for (auto curve : curveCollection->curves())
|
||||||
{
|
{
|
||||||
if (isYAxisStepping() && curve->summaryCaseY())
|
if (isYAxisStepping() && curve->summaryCaseY() && curve->summaryCaseY()->summaryReader())
|
||||||
{
|
{
|
||||||
readers.push_back(curve->summaryCaseY()->summaryReader());
|
readers.push_back(curve->summaryCaseY()->summaryReader());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isXAxisStepping() && curve->summaryCaseX())
|
if (isXAxisStepping() && curve->summaryCaseX() && curve->summaryCaseX()->summaryReader())
|
||||||
{
|
{
|
||||||
readers.push_back(curve->summaryCaseX()->summaryReader());
|
readers.push_back(curve->summaryCaseX()->summaryReader());
|
||||||
}
|
}
|
||||||
@ -602,7 +602,7 @@ std::vector<RifSummaryReaderInterface*> RimSummaryPlotSourceStepping::summaryRea
|
|||||||
{
|
{
|
||||||
for (auto curve : curveSet->curves())
|
for (auto curve : curveSet->curves())
|
||||||
{
|
{
|
||||||
if (isYAxisStepping() && curve->summaryCaseY())
|
if (isYAxisStepping() && curve->summaryCaseY() && curve->summaryCaseY()->summaryReader())
|
||||||
{
|
{
|
||||||
readers.push_back(curve->summaryCaseY()->summaryReader());
|
readers.push_back(curve->summaryCaseY()->summaryReader());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user