2015-09-15 08:23:25 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-09-15 08:23:25 -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-09-15 08:23:25 -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-09-15 08:23:25 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimWellLogFileCurve.h"
|
|
|
|
|
2017-02-24 07:14:29 -06:00
|
|
|
#include "RigWellLogCurveData.h"
|
2017-10-12 10:05:52 -05:00
|
|
|
#include "RigWellPath.h"
|
2017-02-24 07:14:29 -06:00
|
|
|
|
|
|
|
#include "RimProject.h"
|
2018-06-26 03:12:49 -05:00
|
|
|
#include "RimTools.h"
|
2015-09-16 09:06:06 -05:00
|
|
|
#include "RimWellLogFile.h"
|
2017-02-24 07:14:29 -06:00
|
|
|
#include "RimWellLogFileChannel.h"
|
2015-09-16 08:31:04 -05:00
|
|
|
#include "RimWellLogPlot.h"
|
2017-02-24 07:14:29 -06:00
|
|
|
#include "RimWellLogTrack.h"
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
#include "RimWellPathCollection.h"
|
2017-11-08 03:30:55 -06:00
|
|
|
#include "RimWellPlotTools.h"
|
2018-06-26 03:12:49 -05:00
|
|
|
#include "RimWellRftPlot.h"
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2018-09-04 02:08:29 -05:00
|
|
|
#include "RiuQwtPlotCurve.h"
|
2019-10-11 08:54:19 -05:00
|
|
|
#include "RiuQwtPlotWidget.h"
|
2015-09-16 08:31:04 -05:00
|
|
|
|
|
|
|
#include "RiaApplication.h"
|
2020-01-22 06:20:18 -06:00
|
|
|
#include "RiaLogging.h"
|
2015-10-30 05:42:11 -05:00
|
|
|
#include "RiaPreferences.h"
|
2015-09-16 08:31:04 -05:00
|
|
|
|
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
#include <QFileInfo>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <QMessageBox>
|
2015-10-30 05:42:11 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimWellLogFileCurve, "WellLogFileCurve" );
|
2015-09-15 08:23:25 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-15 08:23:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellLogFileCurve::RimWellLogFileCurve()
|
|
|
|
{
|
2020-04-27 23:46:06 -05:00
|
|
|
CAF_PDM_InitObject( "Well Log File Curve", RimWellLogCurve::wellLogCurveIconName(), "", "" );
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_wellPath, "CurveWellPath", "Well Path", "", "", "" );
|
|
|
|
m_wellPath.uiCapability()->setUiTreeChildrenHidden( true );
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2020-01-29 05:52:07 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_wellLogChannelName, "CurveWellLogChannel", "Well Log Channel", "", "", "" );
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_wellLogFile, "WellLogFile", "Well Log File", "", "", "" );
|
2017-10-19 09:12:22 -05:00
|
|
|
|
2017-10-12 10:05:52 -05:00
|
|
|
m_wellPath = nullptr;
|
2015-09-15 08:23:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-15 08:23:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RimWellLogFileCurve::~RimWellLogFileCurve()
|
|
|
|
{
|
|
|
|
}
|
2015-09-15 08:23:25 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-15 08:23:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
2015-09-15 08:23:25 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( isCurveVisible() )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2015-10-30 05:42:11 -05:00
|
|
|
RimWellLogPlot* wellLogPlot;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfType( wellLogPlot );
|
|
|
|
CVF_ASSERT( wellLogPlot );
|
2015-10-30 05:42:11 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellPath && m_wellLogFile )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2017-11-15 09:17:55 -06:00
|
|
|
RigWellLogFile* wellLogFile = m_wellLogFile->wellLogFileData();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellLogFile )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2020-01-29 05:52:07 -06:00
|
|
|
std::vector<double> values = wellLogFile->values( m_wellLogChannelName );
|
2017-10-19 09:12:22 -05:00
|
|
|
std::vector<double> measuredDepthValues = wellLogFile->depthValues();
|
2020-01-22 06:20:18 -06:00
|
|
|
std::vector<double> tvdMslValues = wellLogFile->tvdMslValues();
|
|
|
|
std::vector<double> tvdRkbValues = wellLogFile->tvdRkbValues();
|
2017-10-12 10:05:52 -05:00
|
|
|
|
2020-01-22 06:20:18 -06:00
|
|
|
bool rkbDiff = m_wellPath->wellPathGeometry() ? m_wellPath->wellPathGeometry()->rkbDiff() : 0.0;
|
|
|
|
|
|
|
|
if ( tvdMslValues.size() != values.size() )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2020-01-22 06:20:18 -06:00
|
|
|
RigWellPath* rigWellPath = m_wellPath->wellPathGeometry();
|
|
|
|
if ( rigWellPath )
|
2017-10-12 10:05:52 -05:00
|
|
|
{
|
2020-01-22 06:20:18 -06:00
|
|
|
tvdMslValues.clear();
|
|
|
|
for ( double measuredDepthValue : measuredDepthValues )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2020-02-12 04:43:15 -06:00
|
|
|
tvdMslValues.push_back( -rigWellPath->interpolatedPointAlongWellPath( measuredDepthValue ).z() );
|
2017-10-16 01:38:38 -05:00
|
|
|
}
|
2017-10-19 09:12:22 -05:00
|
|
|
}
|
2020-01-22 06:20:18 -06:00
|
|
|
}
|
2020-03-02 05:55:46 -06:00
|
|
|
if ( tvdRkbValues.size() != values.size() )
|
|
|
|
{
|
|
|
|
RigWellPath* rigWellPath = m_wellPath->wellPathGeometry();
|
|
|
|
if ( rigWellPath )
|
|
|
|
{
|
|
|
|
tvdRkbValues.clear();
|
|
|
|
for ( double measuredDepthValue : measuredDepthValues )
|
|
|
|
{
|
|
|
|
tvdRkbValues.push_back( -rigWellPath->interpolatedPointAlongWellPath( measuredDepthValue ).z() +
|
|
|
|
m_wellPath->wellPathGeometry()->rkbDiff() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-10-16 01:38:38 -05:00
|
|
|
|
2020-01-22 06:20:18 -06:00
|
|
|
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> validDepths;
|
|
|
|
if ( values.size() == measuredDepthValues.size() )
|
|
|
|
{
|
2020-04-24 00:13:33 -05:00
|
|
|
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepthValues ) );
|
2020-01-22 06:20:18 -06:00
|
|
|
}
|
|
|
|
if ( values.size() == tvdMslValues.size() )
|
|
|
|
{
|
2020-04-24 00:13:33 -05:00
|
|
|
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvdMslValues ) );
|
2020-01-22 06:20:18 -06:00
|
|
|
}
|
|
|
|
if ( values.size() == tvdRkbValues.size() )
|
|
|
|
{
|
2020-04-24 00:13:33 -05:00
|
|
|
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB, tvdRkbValues ) );
|
2020-01-22 06:20:18 -06:00
|
|
|
}
|
2017-10-19 09:12:22 -05:00
|
|
|
|
2020-01-22 06:20:18 -06:00
|
|
|
this->setValuesAndDepths( values, validDepths, rkbDiff, wellLogFile->depthUnit(), false );
|
2017-10-19 09:12:22 -05:00
|
|
|
|
2020-01-22 06:20:18 -06:00
|
|
|
QString errMsg;
|
|
|
|
if ( wellLogPlot && !this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) )
|
|
|
|
{
|
|
|
|
QString depthTitle = wellLogPlot->depthAxisTitle();
|
|
|
|
errMsg = QString( "Display of %1 for LAS curves is not possible without %1 "
|
|
|
|
"values in the LAS-file or a well path to derive them from." )
|
|
|
|
.arg( depthTitle )
|
|
|
|
.arg( depthTitle );
|
2015-09-18 02:05:15 -05:00
|
|
|
}
|
2020-01-22 06:20:18 -06:00
|
|
|
|
|
|
|
bool showWarning = !RiaApplication::instance()->preferences()->showLasCurveWithoutTvdWarning();
|
|
|
|
if ( !errMsg.isEmpty() && showWarning )
|
2015-09-22 08:45:58 -05:00
|
|
|
{
|
2020-01-22 06:20:18 -06:00
|
|
|
QString tmp = QString( "The LAS curve can not be displayed.\n%1\n" ).arg( errMsg );
|
|
|
|
tmp += "Control display of this warning from \"Preferences->Show LAS curve without TVD "
|
|
|
|
"warning\"";
|
|
|
|
|
|
|
|
QMessageBox::warning( nullptr, "LAS curve without current depth type", tmp );
|
2015-09-22 08:45:58 -05:00
|
|
|
}
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
2015-10-15 04:27:12 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_isUsingAutoName )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_qwtPlotCurve->setTitle( createCurveAutoName() );
|
2017-10-19 09:12:22 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-12 10:05:52 -05:00
|
|
|
|
2020-04-24 00:13:33 -05:00
|
|
|
RiaDefines::DepthUnitType displayUnit = RiaDefines::DepthUnitType::UNIT_METER;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellLogPlot )
|
2015-12-02 06:39:16 -06:00
|
|
|
{
|
|
|
|
displayUnit = wellLogPlot->depthUnit();
|
|
|
|
}
|
2020-01-08 03:31:01 -06:00
|
|
|
|
2020-04-24 00:13:33 -05:00
|
|
|
RiaDefines::DepthTypeEnum depthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
|
2020-01-08 03:31:01 -06:00
|
|
|
if ( wellLogPlot && this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) )
|
2017-10-12 10:05:52 -05:00
|
|
|
{
|
2020-01-08 03:31:01 -06:00
|
|
|
depthType = wellLogPlot->depthType();
|
2017-10-12 10:05:52 -05:00
|
|
|
}
|
2020-01-08 03:31:01 -06:00
|
|
|
|
|
|
|
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
|
|
|
|
this->curveData()->depthPlotValues( depthType, displayUnit ).data(),
|
|
|
|
static_cast<int>( this->curveData()->xPlotValues().size() ) );
|
2019-09-30 02:48:05 -05:00
|
|
|
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
2015-09-22 04:17:24 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( updateParentPlot )
|
2018-05-23 04:28:57 -05:00
|
|
|
{
|
|
|
|
updateZoomInParentPlot();
|
|
|
|
}
|
2015-09-22 04:17:24 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_parentQwtPlot )
|
2018-05-23 04:28:57 -05:00
|
|
|
{
|
|
|
|
m_parentQwtPlot->replot();
|
|
|
|
}
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-16 08:31:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogFileCurve::setWellPath( RimWellPath* wellPath )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
|
|
|
m_wellPath = wellPath;
|
2015-09-15 08:23:25 -05:00
|
|
|
}
|
|
|
|
|
2017-10-05 03:54:52 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-05 03:54:52 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellPath* RimWellLogFileCurve::wellPath() const
|
|
|
|
{
|
|
|
|
return m_wellPath;
|
|
|
|
}
|
|
|
|
|
2015-09-15 08:23:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-15 08:23:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogFileCurve::setWellLogChannelName( const QString& name )
|
2015-09-15 08:23:25 -05:00
|
|
|
{
|
2020-01-29 05:52:07 -06:00
|
|
|
m_wellLogChannelName = name;
|
2015-09-15 08:23:25 -05:00
|
|
|
}
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogFileCurve::setWellLogFile( RimWellLogFile* wellLogFile )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
|
|
|
m_wellLogFile = wellLogFile;
|
|
|
|
}
|
|
|
|
|
2015-09-16 08:31:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-16 08:31:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellLogCurve::fieldChangedByUi( changedField, oldValue, newValue );
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( changedField == &m_wellPath )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
this->loadDataAndUpdate( true );
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
2020-01-29 05:52:07 -06:00
|
|
|
else if ( changedField == &m_wellLogChannelName )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
this->loadDataAndUpdate( true );
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_wellLogFile )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
this->loadDataAndUpdate( true );
|
2017-10-19 09:12:22 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_parentQwtPlot ) m_parentQwtPlot->replot();
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-16 08:31:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogFileCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2017-03-17 09:51:32 -05:00
|
|
|
RimPlotCurve::updateOptionSensitivity();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Curve Data" );
|
|
|
|
curveDataGroup->add( &m_wellPath );
|
|
|
|
curveDataGroup->add( &m_wellLogFile );
|
2020-01-29 05:52:07 -06:00
|
|
|
curveDataGroup->add( &m_wellLogChannelName );
|
2017-04-07 07:43:26 -05:00
|
|
|
|
2020-08-11 02:11:10 -05:00
|
|
|
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
|
|
|
|
RimStackablePlotCurve::stackingUiOrdering( *stackingGroup );
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
|
|
|
|
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
|
2017-04-07 07:43:26 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Curve Name" );
|
|
|
|
nameGroup->add( &m_showLegend );
|
|
|
|
RimPlotCurve::curveNameUiOrdering( *nameGroup );
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-16 08:31:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogFileCurve::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
uiTreeOrdering.skipRemainingChildren( true );
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-16 08:31:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
bool* useOptionsOnly )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2017-01-05 00:57:37 -06:00
|
|
|
QList<caf::PdmOptionItemInfo> options;
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
options = RimWellLogCurve::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
|
|
|
|
if ( options.size() > 0 ) return options;
|
2015-12-01 09:22:18 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fieldNeedingOptions == &m_wellPath )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2018-06-26 03:12:49 -05:00
|
|
|
auto wellPathColl = RimTools::wellPathCollection();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellPathColl )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2018-06-26 03:12:49 -05:00
|
|
|
caf::PdmChildArrayField<RimWellPath*>& wellPaths = wellPathColl->wellPaths;
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < wellPaths.size(); i++ )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2017-01-05 00:53:14 -06:00
|
|
|
// Only include well paths coming from a well log file
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellPaths[i]->wellLogFiles().size() > 0 )
|
2015-09-25 11:04:10 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( wellPaths[i]->name(), wellPaths[i] ) );
|
2015-09-25 11:04:10 -05:00
|
|
|
}
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( options.size() > 0 )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) );
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-29 05:52:07 -06:00
|
|
|
if ( fieldNeedingOptions == &m_wellLogChannelName )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellPath() )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogFile )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
std::vector<RimWellLogFileChannel*> fileLogs = m_wellLogFile->wellLogChannels();
|
2015-09-16 08:31:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < fileLogs.size(); i++ )
|
2015-09-16 08:31:04 -05:00
|
|
|
{
|
2017-10-06 06:34:45 -05:00
|
|
|
QString wellLogChannelName = fileLogs[i]->name();
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( wellLogChannelName, wellLogChannelName ) );
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-09-18 02:05:15 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( options.size() == 0 )
|
2015-09-18 02:05:15 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( "None", "None" ) );
|
2015-09-18 02:05:15 -05:00
|
|
|
}
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
|
2017-11-15 10:06:46 -06:00
|
|
|
if ( fieldNeedingOptions == &m_wellLogFile )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2017-11-15 10:06:46 -06:00
|
|
|
if ( m_wellPath() && m_wellPath->wellLogFiles().size() > 0 )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2017-11-15 10:06:46 -06:00
|
|
|
for ( RimWellLogFile* const wellLogFile : m_wellPath->wellLogFiles() )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QFileInfo fileInfo( wellLogFile->fileName() );
|
|
|
|
options.push_back( caf::PdmOptionItemInfo( fileInfo.baseName(), wellLogFile ) );
|
2017-10-19 09:12:22 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 00:57:37 -06:00
|
|
|
return options;
|
2015-09-16 08:31:04 -05:00
|
|
|
}
|
|
|
|
|
2017-10-20 03:17:30 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-20 03:17:30 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogFileCurve::initAfterRead()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_wellPath ) return;
|
|
|
|
|
|
|
|
if ( m_wellPath->wellLogFiles().size() == 1 )
|
2017-10-20 03:17:30 -05:00
|
|
|
{
|
|
|
|
m_wellLogFile = m_wellPath->wellLogFiles().front();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-23 12:09:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-23 12:09:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-24 04:36:52 -05:00
|
|
|
bool RimWellLogFileCurve::isRftPlotChild() const
|
2017-10-23 12:09:08 -05:00
|
|
|
{
|
|
|
|
RimWellRftPlot* rftPlot;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfType( rftPlot );
|
2017-10-23 12:09:08 -05:00
|
|
|
return rftPlot != nullptr;
|
|
|
|
}
|
|
|
|
|
2015-09-18 06:02:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-18 06:02:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2016-05-23 10:13:03 -05:00
|
|
|
QString RimWellLogFileCurve::createCurveAutoName()
|
2015-09-18 06:02:33 -05:00
|
|
|
{
|
2017-11-01 09:59:27 -05:00
|
|
|
QStringList name;
|
2019-09-06 03:40:57 -05:00
|
|
|
QString unit;
|
|
|
|
bool channelNameAvailable = false;
|
2017-11-01 09:59:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellPath )
|
2015-09-18 06:43:09 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
name.push_back( wellName() );
|
|
|
|
name.push_back( "LAS" );
|
2015-09-18 06:43:09 -05:00
|
|
|
|
2020-01-29 05:52:07 -06:00
|
|
|
if ( !m_wellLogChannelName().isEmpty() )
|
2017-11-01 09:59:27 -05:00
|
|
|
{
|
2020-01-29 05:52:07 -06:00
|
|
|
name.push_back( m_wellLogChannelName );
|
2017-11-01 09:59:27 -05:00
|
|
|
channelNameAvailable = true;
|
|
|
|
}
|
2015-09-18 06:43:09 -05:00
|
|
|
|
2017-11-15 09:17:55 -06:00
|
|
|
RigWellLogFile* wellLogFile = m_wellLogFile ? m_wellLogFile->wellLogFileData() : nullptr;
|
2017-11-01 09:59:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellLogFile )
|
2015-09-21 03:10:25 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( channelNameAvailable )
|
2017-11-01 09:59:27 -05:00
|
|
|
{
|
|
|
|
RimWellLogPlot* wellLogPlot;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfType( wellLogPlot );
|
|
|
|
CVF_ASSERT( wellLogPlot );
|
2020-01-29 05:52:07 -06:00
|
|
|
QString unitName = wellLogFile->wellLogChannelUnitString( m_wellLogChannelName, wellLogPlot->depthUnit() );
|
2015-12-02 07:21:22 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !unitName.isEmpty() )
|
2017-11-01 09:59:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
name.back() += QString( " [%1]" ).arg( unitName );
|
2017-11-01 09:59:27 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString date = wellLogFile->date();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !date.isEmpty() )
|
2015-09-22 08:12:33 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
name.push_back( wellLogFile->date() );
|
2015-09-22 08:12:33 -05:00
|
|
|
}
|
2015-09-21 03:10:25 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return name.join( ", " );
|
2015-09-18 06:43:09 -05:00
|
|
|
}
|
2017-10-12 10:05:52 -05:00
|
|
|
|
2015-09-18 06:43:09 -05:00
|
|
|
return "Empty curve";
|
2015-09-18 06:02:33 -05:00
|
|
|
}
|
|
|
|
|
2015-10-15 07:37:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-15 07:37:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-01-28 03:09:23 -06:00
|
|
|
QString RimWellLogFileCurve::wellLogChannelUiName() const
|
2015-10-15 07:37:57 -05:00
|
|
|
{
|
2020-01-29 05:52:07 -06:00
|
|
|
return m_wellLogChannelName;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimWellLogFileCurve::wellLogChannelUnits() const
|
|
|
|
{
|
|
|
|
if ( m_wellLogFile && m_wellLogFile->wellLogFileData() )
|
|
|
|
{
|
|
|
|
return m_wellLogFile->wellLogFileData()->wellLogChannelUnitString( m_wellLogChannelName );
|
|
|
|
}
|
2020-03-10 12:43:11 -05:00
|
|
|
return RiaWellLogUnitTools<double>::noUnitString();
|
2015-10-15 07:37:57 -05:00
|
|
|
}
|
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellLogFile* RimWellLogFileCurve::wellLogFile() const
|
|
|
|
{
|
|
|
|
return m_wellLogFile();
|
|
|
|
}
|
|
|
|
|
2015-10-16 04:15:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-16 04:15:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimWellLogFileCurve::wellName() const
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellPath )
|
2018-03-14 07:38:59 -05:00
|
|
|
{
|
|
|
|
return m_wellPath->name();
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return QString( "" );
|
2015-10-16 04:15:04 -05:00
|
|
|
}
|