mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 07:26:03 -06:00
#2076 RFT Plot. Support PRES_FORM las channel name
This commit is contained in:
parent
5a0bab86a8
commit
dc93767683
@ -53,7 +53,7 @@ CAF_PDM_SOURCE_INIT(RimWellRftPlot, "WellRftPlot");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const char RimWellRftPlot::PRESSURE_DATA_NAME[] = "PRESSURE";
|
||||
const std::set<QString> RimWellRftPlot::PRESSURE_DATA_NAMES = { "PRESSURE", "PRES_FORM" };
|
||||
const char RimWellRftPlot::PLOT_NAME_QFORMAT_STRING[] = "RFT: %1";
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -557,14 +557,12 @@ std::map<QDateTime, std::set<RifWellRftAddress>> RimWellRftPlot::timeStepsFromRf
|
||||
std::map<QDateTime, std::set<RifWellRftAddress>> RimWellRftPlot::timeStepsFromGridCase(RimEclipseCase* gridCase) const
|
||||
{
|
||||
const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData();
|
||||
size_t resultIndex = eclipseCaseData != nullptr ?
|
||||
eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, PRESSURE_DATA_NAME) :
|
||||
cvf::UNDEFINED_SIZE_T;
|
||||
std::pair<size_t, QString> resultDataInfo = pressureResultDataInfo(eclipseCaseData);
|
||||
|
||||
std::map<QDateTime, std::set<RifWellRftAddress>> timeStepsMap;
|
||||
if (resultIndex != cvf::UNDEFINED_SIZE_T)
|
||||
if (resultDataInfo.first != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
for (const QDateTime& timeStep : eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->timeStepDates(resultIndex))
|
||||
for (const QDateTime& timeStep : eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->timeStepDates(resultDataInfo.first))
|
||||
{
|
||||
if (timeStepsMap.count(timeStep) == 0)
|
||||
{
|
||||
@ -802,12 +800,14 @@ void RimWellRftPlot::updateCurvesInPlot(const std::set<std::pair<RifWellRftAddre
|
||||
auto gridCase = curveDefToAdd.first.eclCase();
|
||||
if (gridCase != nullptr)
|
||||
{
|
||||
std::pair<size_t, QString> resultDataInfo = pressureResultDataInfo(gridCase->eclipseCaseData());
|
||||
|
||||
// Case
|
||||
curve->setCase(gridCase);
|
||||
|
||||
// Result definition
|
||||
RimEclipseResultDefinition* resultDef = new RimEclipseResultDefinition();
|
||||
resultDef->setResultVariable(PRESSURE_DATA_NAME);
|
||||
resultDef->setResultVariable(resultDataInfo.second);
|
||||
curve->setEclipseResultDefinition(resultDef);
|
||||
|
||||
// Time step
|
||||
@ -957,13 +957,36 @@ bool RimWellRftPlot::hasPressureData(RimWellPath* wellPath)
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<size_t, QString> RimWellRftPlot::pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData)
|
||||
{
|
||||
if (eclipseCaseData != nullptr)
|
||||
{
|
||||
for (const auto& pressureDataName : PRESSURE_DATA_NAMES)
|
||||
{
|
||||
size_t index = eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->
|
||||
findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, pressureDataName);
|
||||
if (index != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return std::make_pair(index, pressureDataName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::make_pair(cvf::UNDEFINED_SIZE_T, "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellRftPlot::isPressureChannel(RimWellLogFileChannel* channel)
|
||||
{
|
||||
// Todo: read pressure channel names from config/defines
|
||||
return QString::compare(channel->name(), PRESSURE_DATA_NAME) == 0;
|
||||
for (const auto& pressureDataName : PRESSURE_DATA_NAMES)
|
||||
{
|
||||
if (QString::compare(channel->name(), pressureDataName, Qt::CaseInsensitive) == 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -971,10 +994,7 @@ bool RimWellRftPlot::isPressureChannel(RimWellLogFileChannel* channel)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellRftPlot::hasPressureData(RimEclipseResultCase* gridCase)
|
||||
{
|
||||
const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData();
|
||||
size_t resultIndex = eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->
|
||||
findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, PRESSURE_DATA_NAME);
|
||||
return resultIndex != cvf::UNDEFINED_SIZE_T;
|
||||
return pressureResultDataInfo(gridCase->eclipseCaseData()).first != cvf::UNDEFINED_SIZE_T;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include <QMetaType>
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
#include <utility>
|
||||
|
||||
class RimEclipseCase;
|
||||
class RimEclipseResultCase;
|
||||
@ -43,6 +43,7 @@ class RimWellLogFileChannel;
|
||||
class RimWellLogPlot;
|
||||
class RimWellPath;
|
||||
class RiuWellRftPlot;
|
||||
class RigEclipseCaseData;
|
||||
|
||||
namespace cvf {
|
||||
class Color3f;
|
||||
@ -61,7 +62,7 @@ class RimWellRftPlot : public RimViewWindow
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
static const char PRESSURE_DATA_NAME[];
|
||||
static const std::set<QString> PRESSURE_DATA_NAMES;
|
||||
static const char PLOT_NAME_QFORMAT_STRING[];
|
||||
|
||||
public:
|
||||
@ -83,6 +84,7 @@ public:
|
||||
static bool isPressureChannel(RimWellLogFileChannel* channel);
|
||||
static bool hasPressureData(RimEclipseResultCase* gridCase);
|
||||
static bool hasPressureData(RimWellPath* wellPath);
|
||||
static std::pair<size_t, QString> pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData);
|
||||
static const char* plotNameFormatString();
|
||||
|
||||
void applyInitialSelections();
|
||||
|
Loading…
Reference in New Issue
Block a user