#3958 Refactoring: Remove scalarResultIndex from RigEclipseResultAddress

and real external use (outside CaseCellResultsData)
Regression tests OK.
This commit is contained in:
Jacob Støren
2019-01-25 12:58:07 +01:00
parent 98f2b50180
commit 3e3d3871ed
35 changed files with 304 additions and 297 deletions

View File

@@ -105,7 +105,7 @@ bool RimWellPlotTools::hasPressureData(RimWellPath* wellPath)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<size_t, QString> RimWellPlotTools::pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData)
std::pair<RigEclipseResultAddress, QString> RimWellPlotTools::pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData)
{
if (eclipseCaseData != nullptr)
{
@@ -115,11 +115,11 @@ std::pair<size_t, QString> RimWellPlotTools::pressureResultDataInfo(const RigEcl
->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, pressureDataName);
if (index != cvf::UNDEFINED_SIZE_T)
{
return std::make_pair(index, pressureDataName);
return std::make_pair(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, pressureDataName), pressureDataName);
}
}
}
return std::make_pair(cvf::UNDEFINED_SIZE_T, "");
return std::make_pair(RigEclipseResultAddress(), "");
}
//--------------------------------------------------------------------------------------------------
@@ -139,7 +139,7 @@ bool RimWellPlotTools::isPressureChannel(RimWellLogFileChannel* channel)
//--------------------------------------------------------------------------------------------------
bool RimWellPlotTools::hasPressureData(RimEclipseResultCase* gridCase)
{
return pressureResultDataInfo(gridCase->eclipseCaseData()).first != cvf::UNDEFINED_SIZE_T;
return pressureResultDataInfo(gridCase->eclipseCaseData()).first.isValid();
}
//--------------------------------------------------------------------------------------------------
///
@@ -413,12 +413,12 @@ std::vector<RimEclipseResultCase*> RimWellPlotTools::rftCasesForWell(const QStri
std::map<QDateTime, std::set<RifDataSourceForRftPlt>> RimWellPlotTools::timeStepsMapFromGridCase(RimEclipseCase* gridCase)
{
const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData();
std::pair<size_t, QString> resultDataInfo = pressureResultDataInfo(eclipseCaseData);
std::pair<RigEclipseResultAddress, QString> resultDataInfo = pressureResultDataInfo(eclipseCaseData);
std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMap;
if (resultDataInfo.first != cvf::UNDEFINED_SIZE_T)
if (resultDataInfo.first.isValid())
{
for (const QDateTime& timeStep : eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->timeStepDates(RigEclipseResultAddress(resultDataInfo.first)))
for (const QDateTime& timeStep : eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->timeStepDates(resultDataInfo.first))
{
if (timeStepsMap.count(timeStep) == 0)
{

View File

@@ -29,6 +29,7 @@
#include "RifEclipseRftAddress.h"
#include "RimWellLogFile.h"
#include "RiaEclipseUnitTools.h"
#include "RigEclipseResultAddress.h"
class RimEclipseCase;
class RimEclipseResultCase;
@@ -62,7 +63,9 @@ public:
static RimWellPath* wellPathByWellPathNameOrSimWellName(const QString& wellPathNameOrSimwellName);
// RFT Only
static std::pair<size_t, QString> pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData);
private:
static std::pair<RigEclipseResultAddress, QString> pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData);
public:
static void addTimeStepsToMap(std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepsToAdd);
static std::vector<RimWellLogFile*> wellLogFilesContainingPressure(const QString& wellPathNameOrSimWellName);