mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1947 RFT/PLT Plot: Use AppEnum for wellLogChannel and remove qwtPlot field in rftCurve
This commit is contained in:
@@ -18,20 +18,10 @@
|
||||
|
||||
#include "RifEclipseRftAddress.h"
|
||||
|
||||
|
||||
const QString RifEclipseRftAddress::DEPTH = "Depth";
|
||||
const QString RifEclipseRftAddress::PRESSURE = "Pressure";
|
||||
const QString RifEclipseRftAddress::SWAT = "Water Saturation";
|
||||
const QString RifEclipseRftAddress::SOIL = "Oil Saturation";
|
||||
const QString RifEclipseRftAddress::SGAS = "Gas Saturation";
|
||||
const QString RifEclipseRftAddress::WRAT = "Water Flow";
|
||||
const QString RifEclipseRftAddress::ORAT = "Oil Flow";
|
||||
const QString RifEclipseRftAddress::GRAT = "Gas Flow";
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseRftAddress::RifEclipseRftAddress(QString wellName, QDateTime timeStep, QString wellLogChannelName) :
|
||||
RifEclipseRftAddress::RifEclipseRftAddress(QString wellName, QDateTime timeStep, RftWellLogChannelName wellLogChannelName) :
|
||||
m_wellName(wellName), m_wellLogChannelName(wellLogChannelName)
|
||||
{
|
||||
timeStep.setTimeSpec(Qt::TimeSpec::UTC);
|
||||
@@ -40,23 +30,6 @@ RifEclipseRftAddress::RifEclipseRftAddress(QString wellName, QDateTime timeStep,
|
||||
m_timeStep = timeStep;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RifEclipseRftAddress::allWellLogChannelNamesExDepth()
|
||||
{
|
||||
std::vector<QString> channelNames;
|
||||
channelNames.push_back(RifEclipseRftAddress::PRESSURE);
|
||||
channelNames.push_back(RifEclipseRftAddress::SWAT);
|
||||
channelNames.push_back(RifEclipseRftAddress::SOIL);
|
||||
channelNames.push_back(RifEclipseRftAddress::SGAS);
|
||||
channelNames.push_back(RifEclipseRftAddress::WRAT);
|
||||
channelNames.push_back(RifEclipseRftAddress::ORAT);
|
||||
channelNames.push_back(RifEclipseRftAddress::GRAT);
|
||||
|
||||
return channelNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -31,27 +31,31 @@
|
||||
class RifEclipseRftAddress
|
||||
{
|
||||
public:
|
||||
static const QString DEPTH;
|
||||
static const QString PRESSURE;
|
||||
static const QString SWAT;
|
||||
static const QString SOIL;
|
||||
static const QString SGAS;
|
||||
static const QString WRAT;
|
||||
static const QString ORAT;
|
||||
static const QString GRAT;
|
||||
|
||||
enum RftWellLogChannelName
|
||||
{
|
||||
NONE,
|
||||
DEPTH,
|
||||
PRESSURE,
|
||||
SWAT,
|
||||
SOIL,
|
||||
SGAS,
|
||||
WRAT,
|
||||
ORAT,
|
||||
GRAT
|
||||
};
|
||||
|
||||
public:
|
||||
RifEclipseRftAddress(QString wellName, QDateTime timeStep, QString wellLogChannelName);
|
||||
RifEclipseRftAddress(QString wellName, QDateTime timeStep, RftWellLogChannelName wellLogChannelName);
|
||||
|
||||
static std::vector<QString> allWellLogChannelNamesExDepth();
|
||||
|
||||
const QString& wellName() const { return m_wellName; }
|
||||
QDateTime timeStep() const { return m_timeStep; }
|
||||
const QString& wellLogChannelName() const { return m_wellLogChannelName; }
|
||||
const QString& wellName() const { return m_wellName; }
|
||||
QDateTime timeStep() const { return m_timeStep; }
|
||||
const RftWellLogChannelName& wellLogChannelName() const { return m_wellLogChannelName; }
|
||||
|
||||
private:
|
||||
QString m_wellName;
|
||||
QDateTime m_timeStep;
|
||||
QString m_wellLogChannelName;
|
||||
QString m_wellName;
|
||||
QDateTime m_timeStep;
|
||||
RftWellLogChannelName m_wellLogChannelName;
|
||||
};
|
||||
|
||||
bool operator==(const RifEclipseRftAddress& first, const RifEclipseRftAddress& second);
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include "RifReaderEclipseRft.h"
|
||||
|
||||
#include "RifEclipseRftAddress.h"
|
||||
|
||||
#include "ert/ecl/ecl_rft_file.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -91,13 +89,13 @@ void RifReaderEclipseRft::open()
|
||||
m_eclipseRftAddresses.push_back(addressWrat);
|
||||
m_rftAddressToLibeclNodeIdx[addressWrat] = i;
|
||||
|
||||
RifEclipseRftAddress addressGrat(wellName, timeStep, RifEclipseRftAddress::GRAT);
|
||||
m_eclipseRftAddresses.push_back(addressGrat);
|
||||
m_rftAddressToLibeclNodeIdx[addressGrat] = i;
|
||||
|
||||
RifEclipseRftAddress addressOrat(wellName, timeStep, RifEclipseRftAddress::ORAT);
|
||||
m_eclipseRftAddresses.push_back(addressOrat);
|
||||
m_rftAddressToLibeclNodeIdx[addressOrat] = i;
|
||||
|
||||
RifEclipseRftAddress addressGrat(wellName, timeStep, RifEclipseRftAddress::GRAT);
|
||||
m_eclipseRftAddresses.push_back(addressGrat);
|
||||
m_rftAddressToLibeclNodeIdx[addressGrat] = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,84 +120,106 @@ const std::vector<RifEclipseRftAddress>& RifReaderEclipseRft::eclipseRftAddresse
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderEclipseRft::values(const RifEclipseRftAddress& rftAddress, std::vector<double>* values)
|
||||
{
|
||||
CVF_ASSERT(values);
|
||||
|
||||
if (!m_ecl_rft_file)
|
||||
{
|
||||
open();
|
||||
}
|
||||
|
||||
values->clear();
|
||||
|
||||
int index = indexFromAddress(rftAddress);
|
||||
if (index < 0) return;
|
||||
|
||||
ecl_rft_node_type* node = ecl_rft_file_iget_node(m_ecl_rft_file, index);
|
||||
|
||||
QString wellLogChannelName = rftAddress.wellLogChannelName();
|
||||
RifEclipseRftAddress::RftWellLogChannelName wellLogChannelName = rftAddress.wellLogChannelName();
|
||||
|
||||
if (wellLogChannelName == RifEclipseRftAddress::DEPTH)
|
||||
switch (wellLogChannelName)
|
||||
{
|
||||
case RifEclipseRftAddress::DEPTH:
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_depth(node, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (wellLogChannelName == RifEclipseRftAddress::PRESSURE)
|
||||
case RifEclipseRftAddress::PRESSURE:
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_pressure(node, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (wellLogChannelName == RifEclipseRftAddress::SWAT)
|
||||
case RifEclipseRftAddress::SWAT:
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_swat(node, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (wellLogChannelName == RifEclipseRftAddress::SOIL)
|
||||
case RifEclipseRftAddress::SOIL:
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_soil(node, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (wellLogChannelName == RifEclipseRftAddress::SGAS)
|
||||
case RifEclipseRftAddress::SGAS:
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_sgas(node, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (wellLogChannelName == RifEclipseRftAddress::WRAT)
|
||||
case RifEclipseRftAddress::WRAT:
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_wrat(node, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (wellLogChannelName == RifEclipseRftAddress::GRAT)
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_grat(node, i));
|
||||
}
|
||||
}
|
||||
else if (wellLogChannelName == RifEclipseRftAddress::ORAT)
|
||||
case RifEclipseRftAddress::ORAT:
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_orat(node, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RifEclipseRftAddress::GRAT:
|
||||
{
|
||||
for (int i = 0; i < ecl_rft_node_get_size(node); i++)
|
||||
{
|
||||
values->push_back(ecl_rft_node_iget_grat(node, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QDateTime> RifReaderEclipseRft::availableTimeSteps(const QString& wellName, const QString& wellLogChannelName) const
|
||||
std::vector<QDateTime> RifReaderEclipseRft::availableTimeSteps(const QString& wellName, const RifEclipseRftAddress::RftWellLogChannelName& wellLogChannelName)
|
||||
{
|
||||
if (!m_ecl_rft_file)
|
||||
{
|
||||
open();
|
||||
}
|
||||
|
||||
std::vector<QDateTime> timeSteps;
|
||||
|
||||
if (wellName == "" || wellLogChannelName == "") return timeSteps;
|
||||
if (wellName == "") return timeSteps;
|
||||
|
||||
for (const RifEclipseRftAddress& address : m_eclipseRftAddresses)
|
||||
{
|
||||
@@ -214,8 +234,41 @@ std::vector<QDateTime> RifReaderEclipseRft::availableTimeSteps(const QString& we
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::set<QString>& RifReaderEclipseRft::wellNames() const
|
||||
std::vector<RifEclipseRftAddress::RftWellLogChannelName> RifReaderEclipseRft::availableWellLogChannels(const QString& wellName)
|
||||
{
|
||||
if (!m_ecl_rft_file)
|
||||
{
|
||||
open();
|
||||
}
|
||||
|
||||
std::vector<RifEclipseRftAddress::RftWellLogChannelName> wellLogChannelNames;
|
||||
|
||||
if (wellName == "") return wellLogChannelNames;
|
||||
|
||||
for (const RifEclipseRftAddress& address : m_eclipseRftAddresses)
|
||||
{
|
||||
if (address.wellName() == wellName)
|
||||
{
|
||||
RifEclipseRftAddress::RftWellLogChannelName name = address.wellLogChannelName();
|
||||
if (name != RifEclipseRftAddress::RftWellLogChannelName::DEPTH)
|
||||
{
|
||||
wellLogChannelNames.push_back(address.wellLogChannelName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return wellLogChannelNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::set<QString>& RifReaderEclipseRft::wellNames()
|
||||
{
|
||||
if (!m_ecl_rft_file)
|
||||
{
|
||||
open();
|
||||
}
|
||||
|
||||
return m_wellNames;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RifEclipseRftAddress.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -27,8 +29,6 @@
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
class RifEclipseRftAddress;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
@@ -42,8 +42,9 @@ public:
|
||||
const std::vector<RifEclipseRftAddress>& eclipseRftAddresses();
|
||||
void values(const RifEclipseRftAddress& rftAddress, std::vector<double>* values);
|
||||
|
||||
std::vector<QDateTime> availableTimeSteps(const QString& wellName, const QString& wellLogChannelName) const;
|
||||
const std::set<QString>& wellNames() const;
|
||||
std::vector<QDateTime> availableTimeSteps(const QString& wellName, const RifEclipseRftAddress::RftWellLogChannelName& wellLogChannelName);
|
||||
std::vector<RifEclipseRftAddress::RftWellLogChannelName> availableWellLogChannels(const QString& wellName);
|
||||
const std::set<QString>& wellNames();
|
||||
|
||||
private:
|
||||
void open();
|
||||
@@ -58,6 +59,5 @@ private:
|
||||
std::vector<RifEclipseRftAddress> m_eclipseRftAddresses;
|
||||
std::set<QString> m_wellNames;
|
||||
std::map<RifEclipseRftAddress, int> m_rftAddressToLibeclNodeIdx;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user