2016-05-09 05:13:54 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016 Statoil ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimSummaryCurve.h"
|
|
|
|
|
|
|
|
#include "RiaApplication.h"
|
2017-10-18 04:19:31 -05:00
|
|
|
#include "RiaDefines.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
#include "RifReaderEclipseSummary.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
#include "RimEclipseResultCase.h"
|
|
|
|
#include "RimProject.h"
|
2017-11-08 06:09:05 -06:00
|
|
|
#include "RimSummaryAddress.h"
|
|
|
|
#include "RimSummaryCalculationCollection.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
#include "RimSummaryCase.h"
|
2017-11-14 05:58:24 -06:00
|
|
|
#include "RimSummaryCrossPlot.h"
|
2016-11-04 08:32:39 -05:00
|
|
|
#include "RimSummaryCurveAutoName.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
#include "RimSummaryFilter.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
#include "RimSummaryPlot.h"
|
2017-03-09 00:08:42 -06:00
|
|
|
#include "RimSummaryTimeAxisProperties.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
|
|
|
|
#include "RiuLineSegmentQwtPlotCurve.h"
|
2017-11-15 08:20:47 -06:00
|
|
|
#include "RiuSummaryCurveDefSelectionDialog.h"
|
2016-05-26 06:17:26 -05:00
|
|
|
#include "RiuSummaryQwtPlot.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
|
|
|
|
#include "cafPdmUiComboBoxEditor.h"
|
|
|
|
#include "cafPdmUiListEditor.h"
|
2017-11-15 08:20:47 -06:00
|
|
|
#include "cafPdmUiPushButtonEditor.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2016-05-25 06:15:17 -05:00
|
|
|
#include "qwt_date.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2017-09-23 01:01:46 -05:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
// See also corresponding fake implementations in RimSummaryCurveFilter
|
2017-09-23 01:01:46 -05:00
|
|
|
QTextStream& operator << (QTextStream& str, const RifEclipseSummaryAddress& sobj)
|
|
|
|
{
|
|
|
|
CVF_ASSERT(false);
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
QTextStream& operator >> (QTextStream& str, RifEclipseSummaryAddress& sobj)
|
|
|
|
{
|
|
|
|
CVF_ASSERT(false);
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2016-05-31 06:42:27 -05:00
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2016-06-07 08:12:14 -05:00
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
CAF_PDM_SOURCE_INIT(RimSummaryCurve, "SummaryCurve");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSummaryCurve::RimSummaryCurve()
|
|
|
|
{
|
2016-06-21 07:17:50 -05:00
|
|
|
CAF_PDM_InitObject("Summary Curve", ":/SummaryCurve16x16.png", "", "");
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2017-11-08 08:12:53 -06:00
|
|
|
// Y Values
|
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_yValuesSummaryCase, "SummaryCase", "Case", "", "", "");
|
|
|
|
m_yValuesSummaryCase.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
m_yValuesSummaryCase.uiCapability()->setAutoAddingOptionFromValue(false);
|
2017-10-18 05:47:07 -05:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_yValuesSelectedVariableDisplayField, "SelectedVariableDisplayVar", "Vector", "", "", "");
|
|
|
|
m_yValuesSelectedVariableDisplayField.xmlCapability()->setIOWritable(false);
|
|
|
|
m_yValuesSelectedVariableDisplayField.xmlCapability()->setIOReadable(false);
|
|
|
|
m_yValuesSelectedVariableDisplayField.uiCapability()->setUiReadOnly(true);
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_yValuesSummaryFilter, "VarListFilter", "Filter", "", "", "");
|
|
|
|
m_yValuesSummaryFilter.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
m_yValuesSummaryFilter.uiCapability()->setUiHidden(true);
|
2016-06-15 10:31:50 -05:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
m_yValuesSummaryFilter = new RimSummaryFilter;
|
2016-06-15 10:31:50 -05:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_yValuesUiFilterResultSelection, "FilterResultSelection", "Filter Result", "", "", "");
|
|
|
|
m_yValuesUiFilterResultSelection.xmlCapability()->setIOWritable(false);
|
|
|
|
m_yValuesUiFilterResultSelection.xmlCapability()->setIOReadable(false);
|
|
|
|
m_yValuesUiFilterResultSelection.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
|
|
|
m_yValuesUiFilterResultSelection.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
|
|
|
m_yValuesUiFilterResultSelection.uiCapability()->setAutoAddingOptionFromValue(false);
|
2016-06-10 05:30:20 -05:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_yValuesCurveVariable, "SummaryAddress", "SummaryAddress", "", "", "");
|
|
|
|
m_yValuesCurveVariable.uiCapability()->setUiHidden(true);
|
|
|
|
m_yValuesCurveVariable.uiCapability()->setUiTreeChildrenHidden(true);
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2017-11-15 08:20:47 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_yPushButtonSelectSummaryAddress, "SelectAddress", "", "", "", "");
|
2017-11-16 04:41:21 -06:00
|
|
|
caf::PdmUiPushButtonEditor::configureEditorForField(&m_yPushButtonSelectSummaryAddress);
|
2017-11-15 08:20:47 -06:00
|
|
|
m_yPushButtonSelectSummaryAddress = false;
|
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
m_yValuesCurveVariable = new RimSummaryAddress;
|
2016-11-04 08:32:39 -05:00
|
|
|
|
2017-11-08 08:12:53 -06:00
|
|
|
|
|
|
|
// X Values
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_xValuesSummaryCase, "x_SummaryCase", "Case", "", "", "");
|
|
|
|
m_xValuesSummaryCase.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
m_xValuesSummaryCase.uiCapability()->setAutoAddingOptionFromValue(false);
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_xValuesSelectedVariableDisplayField, "x_SelectedVariableDisplayVar", "Vector", "", "", "");
|
|
|
|
m_xValuesSelectedVariableDisplayField.xmlCapability()->setIOWritable(false);
|
|
|
|
m_xValuesSelectedVariableDisplayField.xmlCapability()->setIOReadable(false);
|
|
|
|
m_xValuesSelectedVariableDisplayField.uiCapability()->setUiReadOnly(true);
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_xValuesSummaryFilter, "x_VarListFilter", "Filter", "", "", "");
|
|
|
|
m_xValuesSummaryFilter.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
m_xValuesSummaryFilter.uiCapability()->setUiHidden(true);
|
|
|
|
|
|
|
|
m_xValuesSummaryFilter = new RimSummaryFilter;
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_xValuesUiFilterResultSelection, "x_FilterResultSelection", "Filter Result", "", "", "");
|
|
|
|
m_xValuesUiFilterResultSelection.xmlCapability()->setIOWritable(false);
|
|
|
|
m_xValuesUiFilterResultSelection.xmlCapability()->setIOReadable(false);
|
|
|
|
m_xValuesUiFilterResultSelection.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
|
|
|
m_xValuesUiFilterResultSelection.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
|
|
|
m_xValuesUiFilterResultSelection.uiCapability()->setAutoAddingOptionFromValue(false);
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_xValuesCurveVariable, "x_SummaryAddress", "SummaryAddress", "", "", "");
|
|
|
|
m_xValuesCurveVariable.uiCapability()->setUiHidden(true);
|
|
|
|
m_xValuesCurveVariable.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
|
2017-11-15 08:20:47 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_xPushButtonSelectSummaryAddress, "x_SelectAddress", "", "", "", "");
|
2017-11-16 04:41:21 -06:00
|
|
|
caf::PdmUiPushButtonEditor::configureEditorForField(&m_xPushButtonSelectSummaryAddress);
|
2017-11-15 08:20:47 -06:00
|
|
|
m_xPushButtonSelectSummaryAddress = false;
|
|
|
|
|
2017-11-08 08:12:53 -06:00
|
|
|
m_xValuesCurveVariable = new RimSummaryAddress;
|
|
|
|
|
|
|
|
|
|
|
|
// Other members
|
|
|
|
|
2016-10-10 04:05:45 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_plotAxis, "PlotAxis", "Axis", "", "", "");
|
|
|
|
|
2016-11-04 08:32:39 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_curveNameConfig, "SummaryCurveNameConfig", "SummaryCurveNameConfig", "", "", "");
|
|
|
|
m_curveNameConfig.uiCapability()->setUiHidden(true);
|
|
|
|
m_curveNameConfig.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
|
2017-03-09 00:08:42 -06:00
|
|
|
m_curveNameConfig = new RimSummaryCurveAutoName;
|
2016-07-01 04:29:48 -05:00
|
|
|
|
2016-06-22 03:42:45 -05:00
|
|
|
m_symbolSkipPixelDistance = 10.0f;
|
2016-09-12 04:37:09 -05:00
|
|
|
m_curveThickness = 2;
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSummaryCurve::~RimSummaryCurve()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-05-31 06:42:27 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
void RimSummaryCurve::setSummaryCaseY(RimSummaryCase* sumCase)
|
2016-05-31 06:42:27 -05:00
|
|
|
{
|
2017-11-08 06:09:05 -06:00
|
|
|
m_yValuesSummaryCase = sumCase;
|
2016-05-31 06:42:27 -05:00
|
|
|
}
|
|
|
|
|
2016-06-16 09:10:16 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
RimSummaryCase* RimSummaryCurve::summaryCaseY() const
|
2016-06-16 09:10:16 -05:00
|
|
|
{
|
2017-11-08 06:09:05 -06:00
|
|
|
return m_yValuesSummaryCase();
|
2016-06-16 09:10:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
RifEclipseSummaryAddress RimSummaryCurve::summaryAddressX() const
|
|
|
|
{
|
|
|
|
return m_xValuesCurveVariable->address();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RifEclipseSummaryAddress RimSummaryCurve::summaryAddressY() const
|
2016-06-16 09:10:16 -05:00
|
|
|
{
|
2017-11-08 06:09:05 -06:00
|
|
|
return m_yValuesCurveVariable->address();
|
2016-06-16 09:10:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
void RimSummaryCurve::setSummaryAddressY(const RifEclipseSummaryAddress& address)
|
2016-06-16 09:10:16 -05:00
|
|
|
{
|
2017-11-08 06:09:05 -06:00
|
|
|
m_yValuesCurveVariable->setAddress(address);
|
2017-03-09 01:04:02 -06:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
m_yValuesSummaryFilter->updateFromAddress(address);
|
2017-08-22 08:24:35 -05:00
|
|
|
|
|
|
|
calculateCurveInterpolationFromAddress();
|
2016-06-16 09:10:16 -05:00
|
|
|
}
|
|
|
|
|
2016-06-22 07:34:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
std::string RimSummaryCurve::unitNameY() const
|
|
|
|
{
|
|
|
|
RifSummaryReaderInterface* reader = valuesSummaryReaderY();
|
|
|
|
if (reader) return reader->unitName(this->summaryAddressY());
|
|
|
|
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::string RimSummaryCurve::unitNameX() const
|
2016-06-22 07:34:56 -05:00
|
|
|
{
|
2017-11-15 04:36:33 -06:00
|
|
|
RifSummaryReaderInterface* reader = valuesSummaryReaderX();
|
|
|
|
if (reader) return reader->unitName(this->summaryAddressX());
|
2017-11-08 08:12:53 -06:00
|
|
|
|
2016-06-22 07:34:56 -05:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2016-10-10 04:05:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
std::vector<double> RimSummaryCurve::valuesY() const
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
|
|
|
std::vector<double> values;
|
|
|
|
|
2017-11-15 04:36:33 -06:00
|
|
|
RifSummaryReaderInterface* reader = valuesSummaryReaderY();
|
2016-11-22 04:13:34 -06:00
|
|
|
|
|
|
|
if ( !reader ) return values;
|
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
RifEclipseSummaryAddress addr = m_yValuesCurveVariable()->address();
|
2016-11-22 04:13:34 -06:00
|
|
|
reader->values(addr, &values);
|
2016-10-10 04:05:45 -05:00
|
|
|
|
|
|
|
return values;
|
|
|
|
}
|
|
|
|
|
2017-11-09 05:49:27 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
std::vector<double> RimSummaryCurve::valuesX() const
|
2017-11-09 05:49:27 -06:00
|
|
|
{
|
|
|
|
std::vector<double> values;
|
|
|
|
|
|
|
|
if (m_xValuesSummaryCase() && m_xValuesSummaryCase()->summaryReader())
|
|
|
|
{
|
|
|
|
RifSummaryReaderInterface* reader = m_xValuesSummaryCase()->summaryReader();
|
|
|
|
|
|
|
|
RifEclipseSummaryAddress addr = m_xValuesCurveVariable()->address();
|
|
|
|
reader->values(addr, &values);
|
|
|
|
}
|
|
|
|
|
|
|
|
return values;
|
|
|
|
}
|
|
|
|
|
2016-11-22 04:13:34 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const std::vector<time_t>& RimSummaryCurve::timeSteps() const
|
|
|
|
{
|
|
|
|
static std::vector<time_t> emptyVector;
|
2017-11-15 04:36:33 -06:00
|
|
|
RifSummaryReaderInterface* reader = valuesSummaryReaderY();
|
2016-11-22 04:13:34 -06:00
|
|
|
|
|
|
|
if ( !reader ) return emptyVector;
|
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
RifEclipseSummaryAddress addr = m_yValuesCurveVariable()->address();
|
2017-11-08 08:12:53 -06:00
|
|
|
|
2017-09-21 08:51:14 -05:00
|
|
|
return reader->timeSteps(addr);
|
2016-11-22 04:13:34 -06:00
|
|
|
}
|
|
|
|
|
2016-10-10 04:05:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
void RimSummaryCurve::setLeftOrRightAxisY(RiaDefines::PlotAxis plotAxis)
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
|
|
|
m_plotAxis = plotAxis;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
RiaDefines::PlotAxis RimSummaryCurve::axisY() const
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
|
|
|
return m_plotAxis();
|
|
|
|
}
|
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QList<caf::PdmOptionItemInfo> RimSummaryCurve::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
|
|
|
|
{
|
2017-11-08 08:12:53 -06:00
|
|
|
QList<caf::PdmOptionItemInfo> options = this->RimPlotCurve::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
|
2017-01-05 00:57:37 -06:00
|
|
|
if (!options.isEmpty()) return options;
|
2016-05-24 03:33:47 -05:00
|
|
|
|
2017-11-08 08:12:53 -06:00
|
|
|
if (fieldNeedingOptions == &m_yValuesSummaryCase ||
|
|
|
|
fieldNeedingOptions == &m_xValuesSummaryCase)
|
2016-05-09 05:13:54 -05:00
|
|
|
{
|
|
|
|
RimProject* proj = RiaApplication::instance()->project();
|
2016-05-31 06:42:27 -05:00
|
|
|
std::vector<RimSummaryCase*> cases;
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2016-05-31 06:42:27 -05:00
|
|
|
proj->allSummaryCases(cases);
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2017-10-18 04:19:31 -05:00
|
|
|
cases.push_back(proj->calculationCollection->calculationSummaryCase());
|
|
|
|
|
2017-01-05 00:53:14 -06:00
|
|
|
for (RimSummaryCase* rimCase : cases)
|
2016-05-09 05:13:54 -05:00
|
|
|
{
|
2017-01-05 00:57:37 -06:00
|
|
|
options.push_back(caf::PdmOptionItemInfo(rimCase->caseName(), rimCase));
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
|
2017-01-05 00:57:37 -06:00
|
|
|
if (options.size() > 0)
|
2016-05-09 05:13:54 -05:00
|
|
|
{
|
2017-01-05 00:57:37 -06:00
|
|
|
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
}
|
2017-11-08 06:09:05 -06:00
|
|
|
else if(fieldNeedingOptions == &m_yValuesUiFilterResultSelection)
|
2016-05-31 06:42:27 -05:00
|
|
|
{
|
2017-11-08 08:12:53 -06:00
|
|
|
appendOptionItemsForSummaryAddresses(&options, m_yValuesSummaryCase(), m_yValuesSummaryFilter());
|
|
|
|
}
|
|
|
|
else if (fieldNeedingOptions == &m_xValuesUiFilterResultSelection)
|
|
|
|
{
|
|
|
|
appendOptionItemsForSummaryAddresses(&options, m_xValuesSummaryCase(), m_xValuesSummaryFilter());
|
2016-05-31 06:42:27 -05:00
|
|
|
}
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2017-11-08 08:12:53 -06:00
|
|
|
return options;
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
|
2016-05-24 03:33:47 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimSummaryCurve::createCurveAutoName()
|
|
|
|
{
|
2017-11-15 04:36:33 -06:00
|
|
|
QString name = m_curveNameConfig->curveName(m_yValuesCurveVariable->address());
|
|
|
|
|
|
|
|
if (isCrossPlotCurve())
|
|
|
|
{
|
|
|
|
QString xCurveName = m_curveNameConfig->curveName(m_xValuesCurveVariable->address());
|
|
|
|
|
|
|
|
name += " | " + xCurveName;
|
|
|
|
}
|
|
|
|
|
|
|
|
return name;
|
2016-05-24 03:33:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2016-09-13 02:59:34 -05:00
|
|
|
void RimSummaryCurve::updateZoomInParentPlot()
|
2016-05-24 03:33:47 -05:00
|
|
|
{
|
2016-07-05 03:47:03 -05:00
|
|
|
RimSummaryPlot* plot = nullptr;
|
2017-11-15 01:20:54 -06:00
|
|
|
firstAncestorOrThisOfTypeAsserted(plot);
|
2016-05-25 06:15:17 -05:00
|
|
|
|
2016-10-05 06:56:27 -05:00
|
|
|
plot->updateZoomInQwt();
|
2016-05-24 03:33:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-23 01:47:04 -05:00
|
|
|
void RimSummaryCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
2016-05-24 03:33:47 -05:00
|
|
|
{
|
2017-11-11 16:15:13 -06:00
|
|
|
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
|
2016-06-10 05:30:20 -05:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
m_yValuesSelectedVariableDisplayField = QString::fromStdString(m_yValuesCurveVariable->address().uiText());
|
|
|
|
m_yValuesUiFilterResultSelection = m_yValuesCurveVariable->address();
|
2017-11-15 01:20:54 -06:00
|
|
|
|
|
|
|
m_xValuesSelectedVariableDisplayField = QString::fromStdString(m_xValuesCurveVariable->address().uiText());
|
|
|
|
m_xValuesUiFilterResultSelection = m_xValuesCurveVariable->address();
|
|
|
|
|
2017-09-23 01:01:46 -05:00
|
|
|
updateConnectedEditors();
|
2016-11-06 01:24:14 -06:00
|
|
|
|
2016-05-24 03:33:47 -05:00
|
|
|
if (isCurveVisible())
|
|
|
|
{
|
2017-11-15 04:36:33 -06:00
|
|
|
std::vector<double> yValues = this->valuesY();
|
2016-05-24 03:33:47 -05:00
|
|
|
|
2016-10-12 06:49:57 -05:00
|
|
|
RimSummaryPlot* plot = nullptr;
|
|
|
|
firstAncestorOrThisOfType(plot);
|
2017-11-15 04:36:33 -06:00
|
|
|
bool isLogCurve = plot->isLogarithmicScaleEnabled(this->axisY());
|
2016-10-12 06:49:57 -05:00
|
|
|
|
2017-11-09 05:49:27 -06:00
|
|
|
bool shouldPopulateViewWithEmptyData = false;
|
|
|
|
|
2017-11-14 05:58:24 -06:00
|
|
|
if (isCrossPlotCurve())
|
2016-06-10 05:30:20 -05:00
|
|
|
{
|
2017-11-15 04:36:33 -06:00
|
|
|
std::vector<double> xValues = this->valuesX();
|
2017-11-09 05:49:27 -06:00
|
|
|
|
|
|
|
if (!yValues.empty() && yValues.size() == xValues.size())
|
2016-11-22 04:13:34 -06:00
|
|
|
{
|
2017-11-09 05:49:27 -06:00
|
|
|
m_qwtPlotCurve->setSamplesFromXValuesAndYValues(xValues, yValues, isLogCurve);
|
2016-11-22 04:13:34 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-11-09 05:49:27 -06:00
|
|
|
shouldPopulateViewWithEmptyData = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-11-15 01:20:54 -06:00
|
|
|
std::vector<time_t> dateTimes = this->timeSteps();
|
2017-11-09 05:49:27 -06:00
|
|
|
if (dateTimes.size() > 0 && dateTimes.size() == yValues.size())
|
|
|
|
{
|
|
|
|
if (plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE)
|
|
|
|
{
|
|
|
|
m_qwtPlotCurve->setSamplesFromTimeTAndYValues(dateTimes, yValues, isLogCurve);
|
|
|
|
}
|
|
|
|
else
|
2016-11-22 04:13:34 -06:00
|
|
|
{
|
2017-11-09 05:49:27 -06:00
|
|
|
double timeScale = plot->timeAxisProperties()->fromTimeTToDisplayUnitScale();
|
|
|
|
|
|
|
|
std::vector<double> times;
|
|
|
|
if ( dateTimes.size() )
|
2016-11-22 04:13:34 -06:00
|
|
|
{
|
2017-11-09 05:49:27 -06:00
|
|
|
time_t startDate = dateTimes[0];
|
|
|
|
for ( time_t& date: dateTimes )
|
|
|
|
{
|
|
|
|
times.push_back(timeScale*(date - startDate));
|
|
|
|
}
|
2016-11-22 04:13:34 -06:00
|
|
|
}
|
|
|
|
|
2017-11-09 05:49:27 -06:00
|
|
|
m_qwtPlotCurve->setSamplesFromXValuesAndYValues(times, yValues, isLogCurve);
|
|
|
|
}
|
2016-11-22 04:13:34 -06:00
|
|
|
|
2017-11-09 05:49:27 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
shouldPopulateViewWithEmptyData = true;
|
|
|
|
}
|
2016-06-10 05:30:20 -05:00
|
|
|
}
|
2017-11-09 05:49:27 -06:00
|
|
|
|
|
|
|
if (shouldPopulateViewWithEmptyData)
|
2016-06-10 05:30:20 -05:00
|
|
|
{
|
2017-11-09 05:49:27 -06:00
|
|
|
m_qwtPlotCurve->setSamplesFromXValuesAndYValues(std::vector<double>(), std::vector<double>(), isLogCurve);
|
2016-06-10 05:30:20 -05:00
|
|
|
}
|
2016-05-24 03:33:47 -05:00
|
|
|
|
2017-11-15 01:20:54 -06:00
|
|
|
if (updateParentPlot && m_parentQwtPlot)
|
2017-09-23 01:47:04 -05:00
|
|
|
{
|
|
|
|
updateZoomInParentPlot();
|
|
|
|
m_parentQwtPlot->replot();
|
|
|
|
}
|
2016-05-24 03:33:47 -05:00
|
|
|
}
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2017-09-23 01:47:04 -05:00
|
|
|
if (updateParentPlot) updateQwtPlotAxis();
|
2016-05-24 03:33:47 -05:00
|
|
|
}
|
|
|
|
|
2017-11-15 08:20:47 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCurve::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
|
|
|
{
|
|
|
|
if (&m_yPushButtonSelectSummaryAddress == field ||
|
|
|
|
&m_xPushButtonSelectSummaryAddress == field)
|
|
|
|
{
|
|
|
|
caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*> (attribute);
|
|
|
|
if (attrib)
|
|
|
|
{
|
|
|
|
attrib->m_buttonText = "Select Address";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-31 06:42:27 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
|
|
|
{
|
2017-03-17 09:51:32 -05:00
|
|
|
RimPlotCurve::updateOptionSensitivity();
|
|
|
|
|
2017-11-08 08:12:53 -06:00
|
|
|
{
|
|
|
|
QString curveDataGroupName = "Summary Vector";
|
2017-11-14 05:58:24 -06:00
|
|
|
if (isCrossPlotCurve()) curveDataGroupName += " Y";
|
2017-11-08 08:12:53 -06:00
|
|
|
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword(curveDataGroupName, "Summary Vector Y");
|
|
|
|
curveDataGroup->add(&m_yValuesSummaryCase);
|
|
|
|
curveDataGroup->add(&m_yValuesSelectedVariableDisplayField);
|
|
|
|
|
|
|
|
QString curveVarSelectionGroupName = "Vector Selection";
|
2017-11-14 05:58:24 -06:00
|
|
|
if (isCrossPlotCurve()) curveVarSelectionGroupName += " Y";
|
2017-11-08 08:12:53 -06:00
|
|
|
caf::PdmUiGroup* curveVarSelectionGroup = curveDataGroup->addNewGroupWithKeyword(curveVarSelectionGroupName, "Vector Selection Y");
|
|
|
|
curveVarSelectionGroup->setCollapsedByDefault(true);
|
|
|
|
m_yValuesSummaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
|
|
|
|
curveVarSelectionGroup->add(&m_yValuesUiFilterResultSelection);
|
2017-11-15 08:20:47 -06:00
|
|
|
|
|
|
|
curveDataGroup->add(&m_yPushButtonSelectSummaryAddress);
|
2017-11-08 08:12:53 -06:00
|
|
|
}
|
|
|
|
|
2017-11-14 05:58:24 -06:00
|
|
|
if (isCrossPlotCurve())
|
2017-11-08 08:12:53 -06:00
|
|
|
{
|
|
|
|
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Summary Vector X");
|
|
|
|
curveDataGroup->add(&m_xValuesSummaryCase);
|
|
|
|
curveDataGroup->add(&m_xValuesSelectedVariableDisplayField);
|
|
|
|
|
|
|
|
caf::PdmUiGroup* curveVarSelectionGroup = curveDataGroup->addNewGroup("Vector Selection X");
|
|
|
|
curveVarSelectionGroup->setCollapsedByDefault(true);
|
|
|
|
m_xValuesSummaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
|
|
|
|
curveVarSelectionGroup->add(&m_xValuesUiFilterResultSelection);
|
2017-11-15 08:20:47 -06:00
|
|
|
|
|
|
|
curveDataGroup->add(&m_xPushButtonSelectSummaryAddress);
|
2017-11-08 08:12:53 -06:00
|
|
|
}
|
2016-05-31 06:42:27 -05:00
|
|
|
|
2017-04-07 05:10:27 -05:00
|
|
|
uiOrdering.add(&m_plotAxis);
|
|
|
|
|
2016-05-31 06:42:27 -05:00
|
|
|
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance");
|
2017-04-07 07:43:26 -05:00
|
|
|
RimPlotCurve::appearanceUiOrdering(*appearanceGroup);
|
2017-04-07 05:10:27 -05:00
|
|
|
|
|
|
|
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Curve Name");
|
|
|
|
nameGroup->setCollapsedByDefault(true);
|
2017-04-27 04:35:05 -05:00
|
|
|
nameGroup->add(&m_showLegend);
|
2017-04-07 07:43:26 -05:00
|
|
|
RimPlotCurve::curveNameUiOrdering(*nameGroup);
|
2016-11-04 08:32:39 -05:00
|
|
|
|
2016-07-01 04:29:48 -05:00
|
|
|
if (m_isUsingAutoName)
|
|
|
|
{
|
2017-04-07 05:10:27 -05:00
|
|
|
m_curveNameConfig->uiOrdering(uiConfigName, *nameGroup);
|
2016-07-01 04:29:48 -05:00
|
|
|
}
|
2016-05-31 06:42:27 -05:00
|
|
|
|
2017-03-22 09:02:42 -05:00
|
|
|
uiOrdering.skipRemainingFields(); // For now.
|
2016-05-31 06:42:27 -05:00
|
|
|
}
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2017-11-08 08:12:53 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCurve::appendOptionItemsForSummaryAddresses(QList<caf::PdmOptionItemInfo>* options,
|
|
|
|
RimSummaryCase* summaryCase,
|
|
|
|
RimSummaryFilter* summaryFilter)
|
|
|
|
{
|
|
|
|
if (summaryCase)
|
|
|
|
{
|
|
|
|
RifSummaryReaderInterface* reader = summaryCase->summaryReader();
|
|
|
|
if (reader)
|
|
|
|
{
|
|
|
|
const std::vector<RifEclipseSummaryAddress> allAddresses = reader->allResultAddresses();
|
|
|
|
|
|
|
|
for (auto& address : allAddresses)
|
|
|
|
{
|
|
|
|
if (summaryFilter && !summaryFilter->isIncludedByFilter(address)) continue;
|
|
|
|
|
|
|
|
std::string name = address.uiText();
|
|
|
|
QString s = QString::fromStdString(name);
|
|
|
|
options->push_back(caf::PdmOptionItemInfo(s, QVariant::fromValue(address)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
options->push_front(caf::PdmOptionItemInfo(RiaDefines::undefinedResultName(), QVariant::fromValue(RifEclipseSummaryAddress())));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 05:58:24 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimSummaryCurve::isCrossPlotCurve() const
|
|
|
|
{
|
|
|
|
RimSummaryCrossPlot* crossPlot = nullptr;
|
|
|
|
this->firstAncestorOrThisOfType(crossPlot);
|
|
|
|
if (crossPlot) return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-10-10 04:05:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCurve::updateQwtPlotAxis()
|
|
|
|
{
|
|
|
|
if (m_qwtPlotCurve)
|
|
|
|
{
|
2017-11-15 04:36:33 -06:00
|
|
|
if (this->axisY() == RiaDefines::PLOT_AXIS_LEFT)
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
|
|
|
m_qwtPlotCurve->setYAxis(QwtPlot::yLeft);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_qwtPlotCurve->setYAxis(QwtPlot::yRight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2016-11-04 09:23:44 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCurve::applyCurveAutoNameSettings(const RimSummaryCurveAutoName& autoNameSettings)
|
|
|
|
{
|
|
|
|
m_curveNameConfig->applySettings(autoNameSettings);
|
|
|
|
}
|
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
|
|
|
{
|
2017-11-15 08:20:47 -06:00
|
|
|
this->RimPlotCurve::fieldChangedByUi(changedField, oldValue, newValue);
|
2016-06-22 07:34:56 -05:00
|
|
|
|
2016-10-10 04:05:45 -05:00
|
|
|
RimSummaryPlot* plot = nullptr;
|
|
|
|
firstAncestorOrThisOfType(plot);
|
|
|
|
CVF_ASSERT(plot);
|
|
|
|
|
2017-11-15 08:20:47 -06:00
|
|
|
bool loadAndUpdate = false;
|
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
if(changedField == &m_yValuesUiFilterResultSelection)
|
2016-05-24 03:33:47 -05:00
|
|
|
{
|
2017-11-08 06:09:05 -06:00
|
|
|
m_yValuesCurveVariable->setAddress(m_yValuesUiFilterResultSelection());
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2017-08-22 08:24:35 -05:00
|
|
|
this->calculateCurveInterpolationFromAddress();
|
2016-06-22 07:34:56 -05:00
|
|
|
|
2017-11-15 08:20:47 -06:00
|
|
|
loadAndUpdate = true;
|
2016-06-22 07:34:56 -05:00
|
|
|
}
|
2017-11-08 08:12:53 -06:00
|
|
|
else if (changedField == &m_xValuesUiFilterResultSelection)
|
|
|
|
{
|
|
|
|
m_xValuesCurveVariable->setAddress(m_xValuesUiFilterResultSelection());
|
|
|
|
|
|
|
|
this->calculateCurveInterpolationFromAddress();
|
|
|
|
|
2017-11-15 08:20:47 -06:00
|
|
|
loadAndUpdate = true;
|
2017-11-08 08:12:53 -06:00
|
|
|
}
|
2016-06-22 07:34:56 -05:00
|
|
|
else if (&m_showCurve == changedField)
|
|
|
|
{
|
2016-10-11 12:40:45 -05:00
|
|
|
plot->updateAxes();
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
2016-10-10 04:05:45 -05:00
|
|
|
else if (changedField == &m_plotAxis)
|
|
|
|
{
|
|
|
|
updateQwtPlotAxis();
|
|
|
|
|
2016-10-11 12:40:45 -05:00
|
|
|
plot->updateAxes();
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
2017-11-08 06:09:05 -06:00
|
|
|
else if (changedField == &m_yValuesSummaryCase)
|
2017-09-12 08:26:11 -05:00
|
|
|
{
|
|
|
|
plot->updateCaseNameHasChanged();
|
2017-09-23 01:47:04 -05:00
|
|
|
this->onLoadDataAndUpdate(true);
|
2017-09-12 08:26:11 -05:00
|
|
|
}
|
2017-11-15 08:20:47 -06:00
|
|
|
else if (changedField == &m_yPushButtonSelectSummaryAddress)
|
|
|
|
{
|
|
|
|
RiuSummaryCurveDefSelectionDialog dlg(nullptr);
|
|
|
|
dlg.setCaseAndAddress(m_yValuesSummaryCase(), m_yValuesCurveVariable->address());
|
|
|
|
|
|
|
|
if (dlg.exec() == QDialog::Accepted)
|
|
|
|
{
|
|
|
|
auto curveSelection = dlg.curveSelection();
|
|
|
|
if (curveSelection.size() > 0)
|
|
|
|
{
|
|
|
|
m_yValuesSummaryCase = curveSelection[0].summaryCase();
|
|
|
|
m_yValuesCurveVariable->setAddress(curveSelection[0].summaryAddress());
|
|
|
|
|
|
|
|
loadAndUpdate = true;
|
|
|
|
}
|
|
|
|
}
|
2017-11-16 06:06:16 -06:00
|
|
|
|
|
|
|
m_yPushButtonSelectSummaryAddress = false;
|
2017-11-15 08:20:47 -06:00
|
|
|
}
|
|
|
|
else if (changedField == &m_xPushButtonSelectSummaryAddress)
|
|
|
|
{
|
|
|
|
RiuSummaryCurveDefSelectionDialog dlg(nullptr);
|
|
|
|
dlg.setCaseAndAddress(m_xValuesSummaryCase(), m_xValuesCurveVariable->address());
|
|
|
|
|
|
|
|
if (dlg.exec() == QDialog::Accepted)
|
|
|
|
{
|
|
|
|
auto curveSelection = dlg.curveSelection();
|
|
|
|
if (curveSelection.size() > 0)
|
|
|
|
{
|
|
|
|
m_xValuesSummaryCase = curveSelection[0].summaryCase();
|
|
|
|
m_xValuesCurveVariable->setAddress(curveSelection[0].summaryAddress());
|
|
|
|
|
|
|
|
loadAndUpdate = true;
|
|
|
|
}
|
|
|
|
}
|
2017-11-16 06:06:16 -06:00
|
|
|
|
|
|
|
m_xPushButtonSelectSummaryAddress = false;
|
2017-11-15 08:20:47 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
if (loadAndUpdate)
|
|
|
|
{
|
|
|
|
this->loadDataAndUpdate(true);
|
|
|
|
|
|
|
|
plot->updateAxes();
|
|
|
|
}
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 04:36:33 -06:00
|
|
|
RifSummaryReaderInterface* RimSummaryCurve::valuesSummaryReaderX() const
|
|
|
|
{
|
|
|
|
if (!m_xValuesSummaryCase()) return nullptr;
|
|
|
|
|
|
|
|
return m_xValuesSummaryCase()->summaryReader();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RifSummaryReaderInterface* RimSummaryCurve::valuesSummaryReaderY() const
|
2016-05-09 05:13:54 -05:00
|
|
|
{
|
2017-11-08 06:09:05 -06:00
|
|
|
if (!m_yValuesSummaryCase()) return nullptr;
|
2016-05-31 06:42:27 -05:00
|
|
|
|
2017-11-08 06:09:05 -06:00
|
|
|
return m_yValuesSummaryCase()->summaryReader();
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
|
2017-08-22 08:24:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCurve::calculateCurveInterpolationFromAddress()
|
|
|
|
{
|
2017-11-08 06:09:05 -06:00
|
|
|
if (m_yValuesCurveVariable())
|
2017-08-22 08:24:35 -05:00
|
|
|
{
|
2017-11-08 06:09:05 -06:00
|
|
|
QString quantityName = QString::fromUtf8(m_yValuesCurveVariable()->address().quantityName().c_str());
|
2017-08-22 08:24:35 -05:00
|
|
|
if (quantityName.endsWith("T"))
|
|
|
|
{
|
|
|
|
m_curveInterpolation = INTERPOLATION_POINT_TO_POINT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_curveInterpolation = INTERPOLATION_STEP_LEFT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|