#4189 RFT Plot : Move common code to RifEclipseRftAddress

This commit is contained in:
Magne Sjaastad 2019-03-12 08:26:42 +01:00
parent 564ab1d84b
commit 246326229e
3 changed files with 27 additions and 13 deletions

View File

@ -21,6 +21,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <set>
#include <QDateTime> #include <QDateTime>
@ -52,6 +53,16 @@ public:
QDateTime timeStep() const { return m_timeStep; } QDateTime timeStep() const { return m_timeStep; }
const RftWellLogChannelType& wellLogChannel() const { return m_wellLogChannel; } const RftWellLogChannelType& wellLogChannel() const { return m_wellLogChannel; }
static std::set<RftWellLogChannelType> rftPlotChannelTypes()
{
return {RifEclipseRftAddress::PRESSURE};
}
static std::set<RftWellLogChannelType> pltPlotChannelTypes()
{
return {RifEclipseRftAddress::ORAT, RifEclipseRftAddress::WRAT, RifEclipseRftAddress::GRAT};
}
private: private:
QString m_wellName; QString m_wellName;
QDateTime m_timeStep; QDateTime m_timeStep;

View File

@ -279,8 +279,7 @@ void RimWellPltPlot::updateWidgetTitleWindowTitle()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::set < RiaRftPltCurveDefinition > RimWellPltPlot::selectedCurveDefs() const std::set < RiaRftPltCurveDefinition > RimWellPltPlot::selectedCurveDefs() const
{ {
std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse{ std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse = RifEclipseRftAddress::pltPlotChannelTypes();
RifEclipseRftAddress::ORAT, RifEclipseRftAddress::WRAT, RifEclipseRftAddress::GRAT};
return RimWellPlotTools::curveDefsFromTimesteps(RimWellPlotTools::simWellName(m_wellPathName), return RimWellPlotTools::curveDefsFromTimesteps(RimWellPlotTools::simWellName(m_wellPathName),
m_selectedTimeSteps.v(), m_selectedTimeSteps.v(),
@ -820,9 +819,9 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::P
for (const auto& rftCase : rftCases) for (const auto& rftCase : rftCases)
{ {
std::set<QDateTime> rftTimes = rftCase->rftReader()->availableTimeSteps(simWellName, { RifEclipseRftAddress::ORAT, std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse = RifEclipseRftAddress::pltPlotChannelTypes();
RifEclipseRftAddress::WRAT,
RifEclipseRftAddress::GRAT }); std::set<QDateTime> rftTimes = rftCase->rftReader()->availableTimeSteps(simWellName, channelTypesToUse);
if (rftTimes.size()) if (rftTimes.size())
{ {
availableRftSources.insert(RifDataSourceForRftPlt(RifDataSourceForRftPlt::RFT, rftCase)); availableRftSources.insert(RifDataSourceForRftPlt(RifDataSourceForRftPlt::RFT, rftCase));
@ -868,11 +867,11 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::P
} }
else if (fieldNeedingOptions == &m_selectedTimeSteps) else if (fieldNeedingOptions == &m_selectedTimeSteps)
{ {
std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse = RifEclipseRftAddress::pltPlotChannelTypes();
RimWellPlotTools::calculateValueOptionsForTimeSteps(RimWellPlotTools::simWellName(m_wellPathName), RimWellPlotTools::calculateValueOptionsForTimeSteps(RimWellPlotTools::simWellName(m_wellPathName),
selectedSourcesExpanded(), selectedSourcesExpanded(),
{ RifEclipseRftAddress::ORAT, channelTypesToUse,
RifEclipseRftAddress::WRAT,
RifEclipseRftAddress::GRAT },
options); options);
} }

View File

@ -301,8 +301,10 @@ void RimWellRftPlot::applyInitialSelections()
m_selectedSources = sourcesToSelect; m_selectedSources = sourcesToSelect;
{ {
auto relevantTimeSteps = RimWellPlotTools::calculateRelevantTimeStepsFromCases( std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse = RifEclipseRftAddress::rftPlotChannelTypes();
associatedSimWellName(), m_selectedSources, {RifEclipseRftAddress::PRESSURE});
auto relevantTimeSteps =
RimWellPlotTools::calculateRelevantTimeStepsFromCases(associatedSimWellName(), m_selectedSources, channelTypesToUse);
std::vector<QDateTime> timeStepVector; std::vector<QDateTime> timeStepVector;
for (const auto& item : relevantTimeSteps) for (const auto& item : relevantTimeSteps)
@ -411,10 +413,10 @@ void RimWellRftPlot::syncCurvesFromUiSelection()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::set<RiaRftPltCurveDefinition> RimWellRftPlot::selectedCurveDefs() const std::set<RiaRftPltCurveDefinition> RimWellRftPlot::selectedCurveDefs() const
{ {
std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse{RifEclipseRftAddress::PRESSURE}; std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse = RifEclipseRftAddress::rftPlotChannelTypes();
return RimWellPlotTools::curveDefsFromTimesteps( return RimWellPlotTools::curveDefsFromTimesteps(
associatedSimWellName(), m_selectedTimeSteps.v(), true, selectedSourcesExpanded()); associatedSimWellName(), m_selectedTimeSteps.v(), true, selectedSourcesExpanded(), channelTypesToUse);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -660,8 +662,10 @@ QList<caf::PdmOptionItemInfo> RimWellRftPlot::calculateValueOptions(const caf::P
} }
else if (fieldNeedingOptions == &m_selectedTimeSteps) else if (fieldNeedingOptions == &m_selectedTimeSteps)
{ {
std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse = RifEclipseRftAddress::rftPlotChannelTypes();
RimWellPlotTools::calculateValueOptionsForTimeSteps( RimWellPlotTools::calculateValueOptionsForTimeSteps(
associatedSimWellName(), selectedSourcesExpanded(), {RifEclipseRftAddress::PRESSURE}, options); associatedSimWellName(), selectedSourcesExpanded(), channelTypesToUse, options);
} }
else if (fieldNeedingOptions == &m_branchIndex) else if (fieldNeedingOptions == &m_branchIndex)
{ {