mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1835 Tof Acc Sat Plot: Add a max TOF range field
This commit is contained in:
@@ -53,6 +53,8 @@ RimTofAccumulatedPhaseFractionsPlot::RimTofAccumulatedPhaseFractionsPlot()
|
|||||||
|
|
||||||
CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "");
|
CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "");
|
||||||
m_showPlotTitle.uiCapability()->setUiHidden(true);
|
m_showPlotTitle.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_maxTof, "MaxTof", 50, "Max Time of Flight [year]", "", "", "");
|
||||||
m_showWindow = false;
|
m_showWindow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +150,10 @@ void RimTofAccumulatedPhaseFractionsPlot::fieldChangedByUi(const caf::PdmFieldHa
|
|||||||
{
|
{
|
||||||
updateMdiWindowTitle();
|
updateMdiWindowTitle();
|
||||||
}
|
}
|
||||||
|
else if (changedField == &m_maxTof)
|
||||||
|
{
|
||||||
|
loadDataAndUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +203,7 @@ void RimTofAccumulatedPhaseFractionsPlot::loadDataAndUpdate()
|
|||||||
const std::vector<double>& oilValues = calc.accumulatedPhaseFractionsSoil();
|
const std::vector<double>& oilValues = calc.accumulatedPhaseFractionsSoil();
|
||||||
const std::vector<double>& gasValues = calc.accumulatedPhaseFractionsSgas();
|
const std::vector<double>& gasValues = calc.accumulatedPhaseFractionsSgas();
|
||||||
|
|
||||||
m_tofAccumulatedPhaseFractionsPlotWidget->setSamples(xValues, watValues, oilValues, gasValues);
|
m_tofAccumulatedPhaseFractionsPlotWidget->setSamples(xValues, watValues, oilValues, gasValues, m_maxTof());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
caf::PdmField<bool> m_showPlotTitle;
|
caf::PdmField<bool> m_showPlotTitle;
|
||||||
caf::PdmField<QString> m_userName;
|
caf::PdmField<QString> m_userName;
|
||||||
|
caf::PdmField<int> m_maxTof;
|
||||||
|
|
||||||
QPointer<RiuTofAccumulatedPhaseFractionsPlot> m_tofAccumulatedPhaseFractionsPlotWidget;
|
QPointer<RiuTofAccumulatedPhaseFractionsPlot> m_tofAccumulatedPhaseFractionsPlotWidget;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -154,7 +154,8 @@ RimViewWindow* RiuTofAccumulatedPhaseFractionsPlot::ownerViewWindow() const
|
|||||||
void RiuTofAccumulatedPhaseFractionsPlot::setSamples(std::vector<double> xSamples,
|
void RiuTofAccumulatedPhaseFractionsPlot::setSamples(std::vector<double> xSamples,
|
||||||
std::vector<double> watValues,
|
std::vector<double> watValues,
|
||||||
std::vector<double> oilValues,
|
std::vector<double> oilValues,
|
||||||
std::vector<double> gasValues)
|
std::vector<double> gasValues,
|
||||||
|
int maxTofYears)
|
||||||
{
|
{
|
||||||
m_xValues.clear();
|
m_xValues.clear();
|
||||||
m_watValues.clear();
|
m_watValues.clear();
|
||||||
@@ -164,9 +165,13 @@ void RiuTofAccumulatedPhaseFractionsPlot::setSamples(std::vector<double> xSample
|
|||||||
m_watValues.swap(watValues);
|
m_watValues.swap(watValues);
|
||||||
for (size_t i = 0; i < xSamples.size(); ++i)
|
for (size_t i = 0; i < xSamples.size(); ++i)
|
||||||
{
|
{
|
||||||
m_xValues.push_back(xSamples[i] / 365.2425);
|
double tofYears = xSamples[i] / 365.2425;
|
||||||
m_oilValues.push_back(oilValues[i] + m_watValues[i]);
|
if (tofYears <= maxTofYears)
|
||||||
m_gasValues.push_back(gasValues[i] + m_oilValues[i]);
|
{
|
||||||
|
m_xValues.push_back(tofYears);
|
||||||
|
m_oilValues.push_back(oilValues[i] + m_watValues[i]);
|
||||||
|
m_gasValues.push_back(gasValues[i] + m_oilValues[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_watCurve->setSamples(m_xValues.data(), m_watValues.data(), static_cast<int>(m_xValues.size()));
|
m_watCurve->setSamples(m_xValues.data(), m_watValues.data(), static_cast<int>(m_xValues.size()));
|
||||||
m_oilCurve->setSamples(m_xValues.data(), m_oilValues.data(), static_cast<int>(m_xValues.size()));
|
m_oilCurve->setSamples(m_xValues.data(), m_oilValues.data(), static_cast<int>(m_xValues.size()));
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ public:
|
|||||||
void setSamples(std::vector<double> xSamples,
|
void setSamples(std::vector<double> xSamples,
|
||||||
std::vector<double> watValues,
|
std::vector<double> watValues,
|
||||||
std::vector<double> oilValues,
|
std::vector<double> oilValues,
|
||||||
std::vector<double> gasValues);
|
std::vector<double> gasValues,
|
||||||
|
int maxTofYears);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QSize sizeHint() const override;
|
virtual QSize sizeHint() const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user