mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1373 Add feature ShowTotalAllocationData
This commit is contained in:
@@ -138,6 +138,24 @@ QString RimTotalWellAllocationPlot::description() const
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimTotalWellAllocationPlot::totalAllocationAsText() const
|
||||
{
|
||||
QString txt;
|
||||
|
||||
for (auto a : m_sliceInfo)
|
||||
{
|
||||
txt += a.first;
|
||||
txt += "\t";
|
||||
txt += QString::number(a.second);
|
||||
txt += "\n";
|
||||
}
|
||||
|
||||
return txt;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -150,6 +168,8 @@ void RimTotalWellAllocationPlot::addSlice(const QString& name, const cvf::Color3
|
||||
m_wellTotalAllocationPlotWidget->addItem(name, sliceColor, value);
|
||||
m_wellTotalAllocationPlotWidget->update();
|
||||
}
|
||||
|
||||
m_sliceInfo.push_back(std::make_pair(name, value));
|
||||
}
|
||||
|
||||
|
||||
@@ -163,6 +183,8 @@ void RimTotalWellAllocationPlot::clearSlices()
|
||||
m_wellTotalAllocationPlotWidget->clear();
|
||||
m_wellTotalAllocationPlotWidget->update();
|
||||
}
|
||||
|
||||
m_sliceInfo.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RiuWellAllocationPlot;
|
||||
class RimEclipseWell;
|
||||
class RimWellLogPlot;
|
||||
@@ -55,6 +57,7 @@ public:
|
||||
|
||||
void setDescription(const QString& description);
|
||||
QString description() const;
|
||||
QString totalAllocationAsText() const;
|
||||
|
||||
void addSlice(const QString& name, const cvf::Color3f& color, float value);
|
||||
void clearSlices();
|
||||
@@ -80,4 +83,6 @@ private:
|
||||
caf::PdmField<QString> m_userName;
|
||||
|
||||
QPointer<RiuNightchartsWidget> m_wellTotalAllocationPlotWidget;
|
||||
|
||||
std::vector<std::pair<QString, float> > m_sliceInfo;
|
||||
};
|
||||
|
||||
@@ -660,9 +660,9 @@ void RimWellAllocationPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
||||
}
|
||||
|
||||
if (!m_case) m_timeStep = 0;
|
||||
else if (m_timeStep >= m_case->timeStepDates().size())
|
||||
else if (m_timeStep >= static_cast<int>(m_case->timeStepDates().size()))
|
||||
{
|
||||
m_timeStep = std::max(0, ((int)m_case->timeStepDates().size()) - 1);
|
||||
m_timeStep = std::max(0, ((int)m_case->timeStepDates().size()) - 1);
|
||||
}
|
||||
|
||||
std::set<QString> sortedWellNames = findSortedWellNames();
|
||||
|
||||
Reference in New Issue
Block a user