2015-08-28 03:42:57 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-08-28 03:42:57 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-08-28 03:42:57 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-08-28 03:42:57 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimWellLogPlotCollection.h"
|
2015-08-28 05:10:36 -05:00
|
|
|
|
2016-08-11 02:10:56 -05:00
|
|
|
#include "RigEclipseWellLogExtractor.h"
|
2015-10-22 04:31:34 -05:00
|
|
|
#include "RigGeoMechCaseData.h"
|
2016-08-11 02:10:56 -05:00
|
|
|
#include "RigGeoMechWellLogExtractor.h"
|
|
|
|
|
2015-09-03 13:13:08 -05:00
|
|
|
#include "RimEclipseCase.h"
|
2015-09-04 08:30:04 -05:00
|
|
|
#include "RimGeoMechCase.h"
|
2016-08-11 02:10:56 -05:00
|
|
|
#include "RimWellLogPlot.h"
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
#include "RimWellPathCollection.h"
|
2015-08-28 03:42:57 -05:00
|
|
|
|
2015-09-07 12:22:11 -05:00
|
|
|
#include "cvfAssert.h"
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimWellLogPlotCollection, "WellLogPlotCollection" );
|
2015-08-28 03:42:57 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-08-28 03:42:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellLogPlotCollection::RimWellLogPlotCollection()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitObject( "Well Log Plots", ":/WellLogPlots16x16.png", "", "" );
|
2015-08-28 03:42:57 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &wellLogPlots, "WellLogPlots", "", "", "", "" );
|
|
|
|
wellLogPlots.uiCapability()->setUiHidden( true );
|
2015-08-28 03:42:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-08-28 03:42:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellLogPlotCollection::~RimWellLogPlotCollection()
|
|
|
|
{
|
2015-09-03 01:09:06 -05:00
|
|
|
wellLogPlots.deleteAllChildObjects();
|
2015-08-28 03:42:57 -05:00
|
|
|
}
|
2015-09-03 13:13:08 -05:00
|
|
|
|
2017-04-25 05:31:49 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-04-25 05:31:49 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateSimWellExtractor( const QString& simWellName,
|
|
|
|
const QString& caseUserDescription,
|
|
|
|
const RigWellPath* wellPathGeom,
|
|
|
|
const RigEclipseCaseData* eclCaseData )
|
2017-04-25 05:31:49 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !( wellPathGeom && eclCaseData ) )
|
2017-04-25 05:31:49 -05:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t exIdx = 0; exIdx < m_extractors.size(); ++exIdx )
|
2017-04-25 05:31:49 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_extractors[exIdx]->caseData() == eclCaseData && m_extractors[exIdx]->wellPathData() == wellPathGeom )
|
2017-04-25 05:31:49 -05:00
|
|
|
{
|
|
|
|
return m_extractors[exIdx].p();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string errorIdName = ( simWellName + " " + caseUserDescription ).toStdString();
|
2020-02-12 04:43:15 -06:00
|
|
|
cvf::ref<RigEclipseWellLogExtractor> extractor =
|
|
|
|
new RigEclipseWellLogExtractor( eclCaseData, wellPathGeom, errorIdName );
|
2019-09-06 03:40:57 -05:00
|
|
|
m_extractors.push_back( extractor.p() );
|
2017-04-25 05:31:49 -05:00
|
|
|
|
|
|
|
return extractor.p();
|
|
|
|
}
|
|
|
|
|
2015-09-03 13:13:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-03 13:13:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:43:15 -06:00
|
|
|
RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( RimWellPath* wellPath, RimEclipseCase* eclCase )
|
2015-09-03 13:13:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !( wellPath && eclCase && wellPath->wellPathGeometry() && eclCase->eclipseCaseData() ) )
|
2015-09-03 13:13:08 -05:00
|
|
|
{
|
2018-02-18 11:56:43 -06:00
|
|
|
return nullptr;
|
2015-09-03 13:13:08 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RigEclipseCaseData* eclCaseData = eclCase->eclipseCaseData();
|
|
|
|
RigWellPath* wellPathGeom = wellPath->wellPathGeometry();
|
|
|
|
for ( size_t exIdx = 0; exIdx < m_extractors.size(); ++exIdx )
|
2015-09-03 13:13:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_extractors[exIdx]->caseData() == eclCaseData && m_extractors[exIdx]->wellPathData() == wellPathGeom )
|
|
|
|
{
|
2015-09-03 13:13:08 -05:00
|
|
|
return m_extractors[exIdx].p();
|
2019-09-06 03:40:57 -05:00
|
|
|
}
|
2015-09-03 13:13:08 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string errorIdName = ( wellPath->name() + " " + eclCase->caseUserDescription() ).toStdString();
|
2020-02-12 04:43:15 -06:00
|
|
|
cvf::ref<RigEclipseWellLogExtractor> extractor =
|
|
|
|
new RigEclipseWellLogExtractor( eclCaseData, wellPathGeom, errorIdName );
|
2019-09-06 03:40:57 -05:00
|
|
|
m_extractors.push_back( extractor.p() );
|
2015-09-03 13:13:08 -05:00
|
|
|
|
|
|
|
return extractor.p();
|
|
|
|
}
|
2015-09-04 08:30:04 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-04 08:30:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:43:15 -06:00
|
|
|
RigGeoMechWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( RimWellPath* wellPath, RimGeoMechCase* geomCase )
|
2015-09-04 08:30:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !( wellPath && geomCase && wellPath->wellPathGeometry() && geomCase->geoMechData() ) )
|
2015-09-04 08:30:04 -05:00
|
|
|
{
|
2018-02-18 11:56:43 -06:00
|
|
|
return nullptr;
|
2015-09-04 08:30:04 -05:00
|
|
|
}
|
|
|
|
|
2015-09-07 03:32:54 -05:00
|
|
|
RigGeoMechCaseData* geomCaseData = geomCase->geoMechData();
|
2019-09-06 03:40:57 -05:00
|
|
|
RigWellPath* wellPathGeom = wellPath->wellPathGeometry();
|
|
|
|
for ( size_t exIdx = 0; exIdx < m_geomExtractors.size(); ++exIdx )
|
2015-09-04 08:30:04 -05:00
|
|
|
{
|
2020-02-12 04:43:15 -06:00
|
|
|
if ( m_geomExtractors[exIdx]->caseData() == geomCaseData && m_geomExtractors[exIdx]->wellPathData() == wellPathGeom )
|
2019-09-06 03:40:57 -05:00
|
|
|
{
|
2015-09-04 08:30:04 -05:00
|
|
|
return m_geomExtractors[exIdx].p();
|
2019-09-06 03:40:57 -05:00
|
|
|
}
|
2015-09-04 08:30:04 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string errorIdName = ( wellPath->name() + " " + geomCase->caseUserDescription() ).toStdString();
|
2020-02-12 04:43:15 -06:00
|
|
|
cvf::ref<RigGeoMechWellLogExtractor> extractor =
|
|
|
|
new RigGeoMechWellLogExtractor( geomCaseData, wellPathGeom, errorIdName );
|
2019-09-06 03:40:57 -05:00
|
|
|
m_geomExtractors.push_back( extractor.p() );
|
2015-09-04 08:30:04 -05:00
|
|
|
|
|
|
|
return extractor.p();
|
|
|
|
}
|
2015-09-07 12:22:11 -05:00
|
|
|
|
2018-10-24 05:59:43 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-10-24 05:59:43 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogPlotCollection::reloadAllPlots()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& w : wellLogPlots() )
|
2018-10-24 05:59:43 -05:00
|
|
|
{
|
|
|
|
w->loadDataAndUpdate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-10-24 05:59:43 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogPlotCollection::deleteAllExtractors()
|
|
|
|
{
|
|
|
|
m_extractors.clear();
|
|
|
|
m_geomExtractors.clear();
|
|
|
|
}
|
|
|
|
|
2015-10-22 04:31:34 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-22 04:31:34 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogPlotCollection::removeExtractors( const RigWellPath* wellPath )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( int eIdx = (int)m_extractors.size() - 1; eIdx >= 0; eIdx-- )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_extractors[eIdx]->wellPathData() == wellPath )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_extractors.eraseAt( eIdx );
|
2015-10-22 04:31:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( int eIdx = (int)m_geomExtractors.size() - 1; eIdx >= 0; eIdx-- )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_geomExtractors[eIdx]->wellPathData() == wellPath )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_geomExtractors.eraseAt( eIdx );
|
2015-10-22 04:31:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-22 04:31:34 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogPlotCollection::removeExtractors( const RigEclipseCaseData* caseData )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( int eIdx = (int)m_extractors.size() - 1; eIdx >= 0; eIdx-- )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_extractors[eIdx]->caseData() == caseData )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_extractors.eraseAt( eIdx );
|
2015-10-22 04:31:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-22 04:31:34 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogPlotCollection::removeExtractors( const RigGeoMechCaseData* caseData )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( int eIdx = (int)m_geomExtractors.size() - 1; eIdx >= 0; eIdx-- )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_geomExtractors[eIdx]->caseData() == caseData )
|
2015-10-22 04:31:34 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_geomExtractors.eraseAt( eIdx );
|
2015-10-22 04:31:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|