mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1947 RFT/PLT Plot: Add fieldChangedByUi function
This commit is contained in:
parent
e3c330d612
commit
9b54c26c4b
@ -80,40 +80,6 @@ QString RimWellLogRftCurve::wellLogChannelName() const
|
||||
return m_wellLogChannelName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimWellLogRftCurve::xValues()
|
||||
{
|
||||
RifReaderEclipseRft* reader = rftReader();
|
||||
std::vector<double> values;
|
||||
|
||||
if (!reader) return values;
|
||||
|
||||
RifEclipseRftAddress address(m_wellName().toStdString(), m_timeStep, m_wellLogChannelName().toStdString());
|
||||
|
||||
reader->values(address, &values);
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimWellLogRftCurve::depthValues()
|
||||
{
|
||||
RifReaderEclipseRft* reader = rftReader();
|
||||
std::vector<double> values;
|
||||
|
||||
if (!reader) return values;
|
||||
|
||||
RifEclipseRftAddress address(m_wellName().toStdString(), m_timeStep, "DEPTH");
|
||||
|
||||
reader->values(address, &values);
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -206,6 +172,26 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions(const ca
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogRftCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
RimWellLogCurve::fieldChangedByUi(changedField, oldValue, newValue);
|
||||
|
||||
if (changedField == &m_wellName)
|
||||
{
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_wellLogChannelName)
|
||||
{
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_timeStep)
|
||||
{
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -215,4 +201,38 @@ RifReaderEclipseRft* RimWellLogRftCurve::rftReader() const
|
||||
if (!m_eclipseResultCase()) return nullptr;
|
||||
|
||||
return m_eclipseResultCase()->rftReader();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimWellLogRftCurve::xValues()
|
||||
{
|
||||
RifReaderEclipseRft* reader = rftReader();
|
||||
std::vector<double> values;
|
||||
|
||||
if (!reader) return values;
|
||||
|
||||
RifEclipseRftAddress address(m_wellName().toStdString(), m_timeStep, m_wellLogChannelName().toStdString());
|
||||
|
||||
reader->values(address, &values);
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimWellLogRftCurve::depthValues()
|
||||
{
|
||||
RifReaderEclipseRft* reader = rftReader();
|
||||
std::vector<double> values;
|
||||
|
||||
if (!reader) return values;
|
||||
|
||||
RifEclipseRftAddress address(m_wellName().toStdString(), m_timeStep, "DEPTH");
|
||||
|
||||
reader->values(address, &values);
|
||||
|
||||
return values;
|
||||
}
|
@ -45,24 +45,25 @@ public:
|
||||
virtual QString wellName() const override;
|
||||
virtual QString wellLogChannelName() const override;
|
||||
|
||||
std::vector<double> xValues();
|
||||
std::vector<double> depthValues();
|
||||
int currentTimeStep() const;
|
||||
|
||||
int currentTimeStep() const;
|
||||
|
||||
void setEclipseResultCase(RimEclipseResultCase* eclipseResultCase);
|
||||
RimEclipseResultCase* eclipseResultCase() const;
|
||||
void setEclipseResultCase(RimEclipseResultCase* eclipseResultCase);
|
||||
RimEclipseResultCase* eclipseResultCase() const;
|
||||
|
||||
protected:
|
||||
// Overrides from RimWellLogPlotCurve
|
||||
virtual QString createCurveAutoName() override;
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
RifReaderEclipseRft* rftReader() const;
|
||||
|
||||
std::vector<double> xValues();
|
||||
std::vector<double> depthValues();
|
||||
|
||||
private:
|
||||
RiuLineSegmentQwtPlotCurve* m_qwtPlotCurve;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user