2017-02-13 01:37:31 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-02-13 01:37:31 -06: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
|
|
|
//
|
2017-02-13 01:37:31 -06: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>
|
2017-02-13 01:37:31 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimWellLogTrack.h"
|
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
#include "RiaApplication.h"
|
2018-08-30 07:03:58 -05:00
|
|
|
#include "RiaColorTables.h"
|
2018-06-28 01:23:16 -05:00
|
|
|
#include "RiaExtractionTools.h"
|
|
|
|
#include "RiaSimWellBranchTools.h"
|
2017-10-25 07:41:54 -05:00
|
|
|
|
|
|
|
#include "RigEclipseCaseData.h"
|
2019-02-11 13:19:19 -06:00
|
|
|
#include "RigEclipseResultAddress.h"
|
2017-10-25 07:41:54 -05:00
|
|
|
#include "RigEclipseWellLogExtractor.h"
|
|
|
|
#include "RigFemPartResultsCollection.h"
|
|
|
|
#include "RigFemResultAddress.h"
|
|
|
|
#include "RigFormationNames.h"
|
|
|
|
#include "RigGeoMechCaseData.h"
|
|
|
|
#include "RigGeoMechWellLogExtractor.h"
|
|
|
|
#include "RigResultAccessorFactory.h"
|
|
|
|
#include "RigSimWellData.h"
|
|
|
|
#include "RigSimulationWellCenterLineCalculator.h"
|
|
|
|
#include "RigSimulationWellCoordsAndMD.h"
|
2017-02-13 01:37:31 -06:00
|
|
|
#include "RigStatisticsCalculator.h"
|
2017-02-24 07:14:29 -06:00
|
|
|
#include "RigWellLogCurveData.h"
|
2017-10-25 07:41:54 -05:00
|
|
|
#include "RigWellPath.h"
|
2017-11-27 08:23:26 -06:00
|
|
|
#include "RigWellPathFormations.h"
|
2017-10-25 07:41:54 -05:00
|
|
|
|
|
|
|
#include "RimCase.h"
|
|
|
|
#include "RimEclipseCase.h"
|
2018-10-03 08:57:09 -05:00
|
|
|
#include "RimFishbonesCollection.h"
|
|
|
|
#include "RimFishbonesMultipleSubs.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimGeoMechCase.h"
|
|
|
|
#include "RimMainPlotCollection.h"
|
2018-10-03 08:57:09 -05:00
|
|
|
#include "RimPerforationCollection.h"
|
|
|
|
#include "RimPerforationInterval.h"
|
2017-10-25 07:41:54 -05:00
|
|
|
#include "RimProject.h"
|
|
|
|
#include "RimTools.h"
|
2017-02-24 07:14:29 -06:00
|
|
|
#include "RimWellFlowRateCurve.h"
|
2017-02-13 01:37:31 -06:00
|
|
|
#include "RimWellLogCurve.h"
|
2017-10-25 07:41:54 -05:00
|
|
|
#include "RimWellLogPlotCollection.h"
|
|
|
|
#include "RimWellPath.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimWellPathAttribute.h"
|
|
|
|
#include "RimWellPathAttributeCollection.h"
|
2018-10-03 08:57:09 -05:00
|
|
|
#include "RimWellPathCompletions.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimWellPathFracture.h"
|
|
|
|
#include "RimWellPathFractureCollection.h"
|
2017-11-07 02:59:58 -06:00
|
|
|
#include "RimWellPltPlot.h"
|
|
|
|
#include "RimWellRftPlot.h"
|
2017-02-13 01:37:31 -06:00
|
|
|
|
|
|
|
#include "RiuMainWindow.h"
|
2017-10-25 07:41:54 -05:00
|
|
|
#include "RiuPlotAnnotationTool.h"
|
2018-09-10 02:55:07 -05:00
|
|
|
#include "RiuPlotMainWindowTools.h"
|
2017-02-24 07:14:29 -06:00
|
|
|
#include "RiuWellLogPlot.h"
|
|
|
|
#include "RiuWellLogTrack.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RiuWellPathComponentPlotItem.h"
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2018-06-28 01:23:16 -05:00
|
|
|
#include "RiuQwtLinearScaleEngine.h"
|
2019-09-10 08:21:58 -05:00
|
|
|
|
|
|
|
#include "cafPdmUiSliderEditor.h"
|
2017-02-13 01:37:31 -06:00
|
|
|
#include "cvfAssert.h"
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#define RI_LOGPLOTTRACK_MINX_DEFAULT -10.0
|
|
|
|
#define RI_LOGPLOTTRACK_MAXX_DEFAULT 100.0
|
|
|
|
#define RI_LOGPLOTTRACK_MINOR_TICK_DEFAULT
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimWellLogTrack, "WellLogPlotTrack" );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
namespace caf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
template <>
|
|
|
|
void AppEnum<RimWellLogTrack::TrajectoryType>::setUp()
|
|
|
|
{
|
|
|
|
addItem( RimWellLogTrack::WELL_PATH, "WELL_PATH", "Well Path" );
|
|
|
|
addItem( RimWellLogTrack::SIMULATION_WELL, "SIMULATION_WELL", "Simulation Well" );
|
|
|
|
setDefault( RimWellLogTrack::WELL_PATH );
|
|
|
|
}
|
2017-11-27 07:41:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
template <>
|
|
|
|
void AppEnum<RimWellLogTrack::FormationSource>::setUp()
|
|
|
|
{
|
|
|
|
addItem( RimWellLogTrack::CASE, "CASE", "Case" );
|
|
|
|
addItem( RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Picks for Well Path" );
|
|
|
|
setDefault( RimWellLogTrack::CASE );
|
|
|
|
}
|
2018-06-26 09:23:06 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
template <>
|
|
|
|
void AppEnum<RigWellPathFormations::FormationLevel>::setUp()
|
|
|
|
{
|
|
|
|
addItem( RigWellPathFormations::NONE, "NONE", "None" );
|
|
|
|
addItem( RigWellPathFormations::ALL, "ALL", "All" );
|
|
|
|
addItem( RigWellPathFormations::GROUP, "GROUP", "Formation Group" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL0, "LEVEL0", "Formation" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL1, "LEVEL1", "Formation 1" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL2, "LEVEL2", "Formation 2" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL3, "LEVEL3", "Formation 3" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL4, "LEVEL4", "Formation 4" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL5, "LEVEL5", "Formation 5" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL6, "LEVEL6", "Formation 6" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL7, "LEVEL7", "Formation 7" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL8, "LEVEL8", "Formation 8" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL9, "LEVEL9", "Formation 9" );
|
|
|
|
addItem( RigWellPathFormations::LEVEL10, "LEVEL10", "Formation 10" );
|
|
|
|
setDefault( RigWellPathFormations::ALL );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
template <>
|
|
|
|
void AppEnum<RimWellLogTrack::WidthScaleFactor>::setUp()
|
|
|
|
{
|
|
|
|
addItem( RimWellLogTrack::EXTRA_NARROW_TRACK, "EXTRA_NARROW_TRACK", "Extra Narrow" );
|
|
|
|
addItem( RimWellLogTrack::NARROW_TRACK, "NARROW_TRACK", "Narrow" );
|
|
|
|
addItem( RimWellLogTrack::NORMAL_TRACK, "NORMAL_TRACK", "Normal" );
|
|
|
|
addItem( RimWellLogTrack::WIDE_TRACK, "WIDE_TRACK", "Wide" );
|
|
|
|
addItem( RimWellLogTrack::EXTRA_WIDE_TRACK, "EXTRA_WIDE_TRACK", "Extra wide" );
|
|
|
|
setDefault( RimWellLogTrack::NORMAL_TRACK );
|
|
|
|
}
|
2019-09-10 06:23:29 -05:00
|
|
|
|
|
|
|
template <>
|
|
|
|
void AppEnum<RiuPlotAnnotationTool::FormationDisplay>::setUp()
|
|
|
|
{
|
|
|
|
addItem( RiuPlotAnnotationTool::NONE, "NONE", "None" );
|
|
|
|
addItem( RiuPlotAnnotationTool::DARK_LINES, "DARK_LINES", "Dark Lines" );
|
|
|
|
addItem( RiuPlotAnnotationTool::COLORED_LINES, "COLORED_LINES", "Colored Lines" );
|
|
|
|
addItem( RiuPlotAnnotationTool::COLOR_SHADING, "COLOR_SHADING", "Color Shading" );
|
|
|
|
addItem( RiuPlotAnnotationTool::COLOR_SHADING_AND_LINES, "SHADING_AND_LINES", "Color Shading and Lines" );
|
|
|
|
setDefault( RiuPlotAnnotationTool::NONE );
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
} // namespace caf
|
2017-11-27 07:41:11 -06:00
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellLogTrack::RimWellLogTrack()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitObject( "Track", ":/WellLogTrack16x16.png", "", "" );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_userName, "TrackDescription", "Name", "", "", "" );
|
|
|
|
m_userName.uiCapability()->setUiReadOnly( true );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_show, "Show", true, "Show Track", "", "", "" );
|
|
|
|
m_show.uiCapability()->setUiHidden( true );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &curves, "Curves", "", "", "", "" );
|
|
|
|
curves.uiCapability()->setUiHidden( true );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_visibleXRangeMin, "VisibleXRangeMin", RI_LOGPLOTTRACK_MINX_DEFAULT, "Min", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_visibleXRangeMax, "VisibleXRangeMax", RI_LOGPLOTTRACK_MAXX_DEFAULT, "Max", "", "", "" );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_isAutoScaleXEnabled, "AutoScaleX", true, "Auto Scale", "", "", "" );
|
|
|
|
m_isAutoScaleXEnabled.uiCapability()->setUiHidden( true );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_isLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale", "", "", "" );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_xAxisGridVisibility, "ShowXGridLines", "Show Grid Lines", "", "", "" );
|
2018-06-27 05:42:11 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_explicitTickIntervals, "ExplicitTickIntervals", false, "Manually Set Tick Intervals", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_majorTickInterval, "MajorTickIntervals", 0.0, "Major Tick Interval", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_minorTickInterval, "MinorTickIntervals", 0.0, "Minor Tick Interval", "", "", "" );
|
|
|
|
m_majorTickInterval.uiCapability()->setUiHidden( true );
|
|
|
|
m_minorTickInterval.uiCapability()->setUiHidden( true );
|
2018-06-28 01:23:16 -05:00
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_formationDisplay, "FormationDisplay", "Show Formations", "", "", "" );
|
2019-09-10 08:21:58 -05:00
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_colorShadingPalette, "ColorShadingPalette", "Colors", "", "", "" );
|
|
|
|
m_colorShadingPalette = RimRegularLegendConfig::CATEGORY;
|
|
|
|
|
|
|
|
CAF_PDM_InitField( &m_colorShadingTransparency, "ColorShadingTransparency", 50, "Color Transparency", "", "", "" );
|
|
|
|
m_colorShadingTransparency.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() );
|
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
CAF_PDM_InitField( &m_showFormations_OBSOLETE, "ShowFormations", false, "Show Lines", "", "", "" );
|
|
|
|
m_showFormations_OBSOLETE.xmlCapability()->setIOWritable( false );
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_showFormationLabels, "ShowFormationLabels", true, "Show Labels", "", "", "" );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_formationSource, "FormationSource", "Source", "", "", "" );
|
2017-11-27 07:41:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_formationTrajectoryType, "FormationTrajectoryType", "Trajectory", "", "", "" );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_formationWellPathForSourceCase, "FormationWellPath", "Well Path", "", "", "" );
|
|
|
|
m_formationWellPathForSourceCase.uiCapability()->setUiTreeChildrenHidden( true );
|
2018-01-04 09:42:57 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_formationWellPathForSourceWellPath,
|
|
|
|
"FormationWellPathForSourceWellPath",
|
|
|
|
"Well Path",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"" );
|
|
|
|
m_formationWellPathForSourceWellPath.uiCapability()->setUiTreeChildrenHidden( true );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_formationSimWellName,
|
|
|
|
"FormationSimulationWellName",
|
|
|
|
QString( "None" ),
|
|
|
|
"Simulation Well",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"" );
|
|
|
|
CAF_PDM_InitField( &m_formationBranchIndex, "FormationBranchIndex", 0, " ", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_formationBranchDetection,
|
|
|
|
"FormationBranchDetection",
|
|
|
|
true,
|
|
|
|
"Branch Detection",
|
|
|
|
"",
|
|
|
|
"Compute branches based on how simulation well cells are organized",
|
|
|
|
"" );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_formationCase, "FormationCase", "Formation Case", "", "", "" );
|
|
|
|
m_formationCase.uiCapability()->setUiTreeChildrenHidden( true );
|
2017-12-08 08:46:16 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_formationLevel, "FormationLevel", "Well Pick Filter", "", "", "" );
|
2017-12-08 08:46:16 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_showformationFluids, "ShowFormationFluids", false, "Show Fluids", "", "", "" );
|
2018-01-26 03:28:24 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_showWellPathAttributes, "ShowWellPathAttributes", false, "Show Well Attributes", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_wellPathAttributesInLegend, "WellPathAttributesInLegend", false, "Attributes in Legend", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_showWellPathCompletions, "ShowWellPathCompletions", true, "Show Well Completions", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_wellPathCompletionsInLegend,
|
|
|
|
"WellPathCompletionsInLegend",
|
|
|
|
false,
|
|
|
|
"Completions in Legend",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"" );
|
|
|
|
CAF_PDM_InitField( &m_showWellPathComponentsBothSides, "ShowWellPathAttrBothSides", true, "Show Both Sides", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_showWellPathComponentLabels, "ShowWellPathAttrLabels", false, "Show Labels", "", "", "" );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_wellPathComponentSource, "AttributesWellPathSource", "Well Path", "", "", "" );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_wellPathAttributeCollection, "AttributesCollection", "Well Attributes", "", "", "" );
|
2018-08-30 07:03:58 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_widthScaleFactor, "Width", "Track Width", "", "Set width of track. ", "" );
|
2018-06-26 04:18:24 -05:00
|
|
|
|
2018-01-26 03:28:24 -06:00
|
|
|
m_formationsForCaseWithSimWellOnly = false;
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellLogTrack::~RimWellLogTrack()
|
|
|
|
{
|
|
|
|
curves.deleteAllChildObjects();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
m_wellLogTrackPlotWidget->deleteLater();
|
|
|
|
m_wellLogTrackPlotWidget = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setDescription( const QString& description )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
m_userName = description;
|
|
|
|
}
|
|
|
|
|
2017-10-26 03:01:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-26 03:01:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::simWellOptionItems( QList<caf::PdmOptionItemInfo>* options, RimCase* rimCase )
|
2017-10-26 03:01:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( options );
|
|
|
|
if ( !options ) return;
|
2017-10-26 03:01:56 -05:00
|
|
|
|
|
|
|
std::set<QString> sortedWellNames;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( rimCase );
|
2017-10-26 03:01:56 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclipseCase && eclipseCase->eclipseCaseData() )
|
2017-10-26 03:01:56 -05:00
|
|
|
{
|
|
|
|
sortedWellNames = eclipseCase->eclipseCaseData()->findSortedWellNames();
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::QIconProvider simWellIcon( ":/Well.png" );
|
|
|
|
for ( const QString& wname : sortedWellNames )
|
2017-10-26 03:01:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options->push_back( caf::PdmOptionItemInfo( wname, wname, false, simWellIcon ) );
|
2017-10-26 03:01:56 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( changedField == &m_show )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setVisible( m_show() );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
2018-06-26 04:18:24 -05:00
|
|
|
updateParentPlotLayout();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_widthScaleFactor )
|
2018-06-26 04:18:24 -05:00
|
|
|
{
|
|
|
|
updateParentPlotLayout();
|
2018-06-27 03:01:44 -05:00
|
|
|
updateAxisAndGridTickIntervals();
|
2018-10-05 08:59:19 -05:00
|
|
|
applyXZoomFromVisibleRange();
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_explicitTickIntervals )
|
2018-06-28 01:23:16 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget )
|
2018-06-28 01:23:16 -05:00
|
|
|
{
|
|
|
|
m_majorTickInterval = m_wellLogTrackPlotWidget->getCurrentMajorTickInterval();
|
|
|
|
m_minorTickInterval = m_wellLogTrackPlotWidget->getCurrentMinorTickInterval();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
m_majorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() );
|
|
|
|
m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() );
|
|
|
|
if ( !m_explicitTickIntervals() )
|
2018-06-28 01:23:16 -05:00
|
|
|
{
|
|
|
|
updateAxisAndGridTickIntervals();
|
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_xAxisGridVisibility || changedField == &m_majorTickInterval ||
|
|
|
|
changedField == &m_minorTickInterval )
|
2018-06-27 05:42:11 -05:00
|
|
|
{
|
|
|
|
updateAxisAndGridTickIntervals();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_visibleXRangeMin || changedField == &m_visibleXRangeMax )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setXRange( m_visibleXRangeMin, m_visibleXRangeMax );
|
2018-06-29 04:47:28 -05:00
|
|
|
m_wellLogTrackPlotWidget->replot();
|
2017-02-13 01:37:31 -06:00
|
|
|
m_isAutoScaleXEnabled = false;
|
2019-09-06 03:40:57 -05:00
|
|
|
bool emptyRange = std::abs( m_visibleXRangeMax() - m_visibleXRangeMin ) <
|
|
|
|
1.0e-6 * std::max( 1.0, std::max( m_visibleXRangeMax(), m_visibleXRangeMin() ) );
|
|
|
|
m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange );
|
|
|
|
m_xAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
|
2018-07-02 02:49:05 -05:00
|
|
|
|
2018-05-23 04:28:57 -05:00
|
|
|
updateEditors();
|
2018-06-28 01:23:16 -05:00
|
|
|
updateParentPlotLayout();
|
|
|
|
updateAxisAndGridTickIntervals();
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_isAutoScaleXEnabled )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_isAutoScaleXEnabled() )
|
|
|
|
{
|
2018-05-23 04:28:57 -05:00
|
|
|
this->calculateXZoomRangeAndUpdateQwt();
|
2017-02-13 01:37:31 -06:00
|
|
|
computeAndSetXRangeMinForLogarithmicScale();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget ) m_wellLogTrackPlotWidget->replot();
|
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_isLogarithmicScaleEnabled )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
updateAxisScaleEngine();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_isLogarithmicScaleEnabled() )
|
2018-06-28 01:23:16 -05:00
|
|
|
{
|
|
|
|
m_explicitTickIntervals = false;
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
m_explicitTickIntervals.uiCapability()->setUiHidden( m_isLogarithmicScaleEnabled() );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2018-05-23 04:28:57 -05:00
|
|
|
this->calculateXZoomRangeAndUpdateQwt();
|
2017-02-13 01:37:31 -06:00
|
|
|
computeAndSetXRangeMinForLogarithmicScale();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setXRange( m_visibleXRangeMin, m_visibleXRangeMax );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
|
|
|
m_wellLogTrackPlotWidget->replot();
|
|
|
|
}
|
2019-09-10 08:21:58 -05:00
|
|
|
else if ( changedField == &m_formationDisplay || changedField == &m_formationSource ||
|
|
|
|
changedField == &m_colorShadingTransparency || changedField == &m_colorShadingPalette )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( changedField == &m_formationSource && m_formationSource == WELL_PICK_FILTER )
|
2018-01-04 09:42:57 -06:00
|
|
|
{
|
2018-01-05 01:36:17 -06:00
|
|
|
std::vector<RimWellPath*> wellPaths;
|
2019-09-06 03:40:57 -05:00
|
|
|
RimTools::wellPathWithFormations( &wellPaths );
|
|
|
|
for ( RimWellPath* wellPath : wellPaths )
|
2018-01-04 09:42:57 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellPath == m_formationWellPathForSourceCase )
|
2018-01-05 01:36:17 -06:00
|
|
|
{
|
|
|
|
m_formationWellPathForSourceWellPath = m_formationWellPathForSourceCase();
|
|
|
|
break;
|
|
|
|
}
|
2018-01-04 09:42:57 -06:00
|
|
|
}
|
|
|
|
}
|
2017-11-07 02:59:58 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
loadDataAndUpdate( true );
|
2018-09-10 02:55:07 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellRftPlot* rftPlot( nullptr );
|
2017-11-07 03:02:43 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfType( rftPlot );
|
2017-11-07 02:59:58 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( rftPlot )
|
2017-11-07 03:02:43 -06:00
|
|
|
{
|
|
|
|
rftPlot->updateConnectedEditors();
|
|
|
|
}
|
2017-11-07 02:59:58 -06:00
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellPltPlot* pltPlot( nullptr );
|
|
|
|
firstAncestorOrThisOfType( pltPlot );
|
2018-01-05 01:36:17 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( pltPlot )
|
2017-11-07 03:02:43 -06:00
|
|
|
{
|
|
|
|
pltPlot->updateConnectedEditors();
|
|
|
|
}
|
2017-11-07 02:59:58 -06:00
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_showFormationLabels )
|
2018-07-06 02:16:03 -05:00
|
|
|
{
|
|
|
|
loadDataAndUpdate();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_formationCase )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2017-10-26 03:01:56 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> options;
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellLogTrack::simWellOptionItems( &options, m_formationCase );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( options.isEmpty() || m_formationCase == nullptr )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_formationSimWellName = QString( "None" );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
loadDataAndUpdate( true );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_formationWellPathForSourceCase )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
loadDataAndUpdate( true );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_formationSimWellName )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
loadDataAndUpdate( true );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_formationTrajectoryType )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationTrajectoryType == WELL_PATH )
|
2018-01-04 09:42:57 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimProject* proj = RiaApplication::instance()->project();
|
|
|
|
m_formationWellPathForSourceCase = proj->wellPathFromSimWellName( m_formationSimWellName );
|
2018-01-04 09:42:57 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationWellPathForSourceCase )
|
2018-01-04 09:42:57 -06:00
|
|
|
{
|
2018-06-18 10:13:30 -05:00
|
|
|
m_formationSimWellName = m_formationWellPathForSourceCase->associatedSimulationWellName();
|
2018-01-04 09:42:57 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
loadDataAndUpdate( true );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_formationBranchIndex || changedField == &m_formationBranchDetection )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_formationBranchIndex = RiaSimWellBranchTools::clampBranchIndex( m_formationSimWellName,
|
|
|
|
m_formationBranchIndex,
|
|
|
|
m_formationBranchDetection );
|
2017-12-08 03:23:36 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
loadDataAndUpdate( true );
|
2017-11-07 03:02:43 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_formationWellPathForSourceWellPath )
|
2018-01-04 09:42:57 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
loadDataAndUpdate( true );
|
2018-01-04 09:42:57 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_formationLevel )
|
2017-12-08 08:46:16 -06:00
|
|
|
{
|
|
|
|
loadDataAndUpdate();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_showformationFluids )
|
2017-12-08 08:46:16 -06:00
|
|
|
{
|
|
|
|
loadDataAndUpdate();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_showWellPathAttributes || changedField == &m_showWellPathCompletions ||
|
|
|
|
changedField == &m_showWellPathComponentsBothSides || changedField == &m_showWellPathComponentLabels ||
|
|
|
|
changedField == &m_wellPathAttributesInLegend || changedField == &m_wellPathCompletionsInLegend )
|
2018-08-30 07:03:58 -05:00
|
|
|
{
|
|
|
|
updateWellPathAttributesOnPlot();
|
2018-09-10 02:55:07 -05:00
|
|
|
updateParentPlotLayout();
|
|
|
|
RiuPlotMainWindowTools::refreshToolbars();
|
2018-08-30 07:03:58 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( changedField == &m_wellPathComponentSource )
|
|
|
|
{
|
2018-09-05 07:03:18 -05:00
|
|
|
updateWellPathAttributesCollection();
|
2018-08-30 07:03:58 -05:00
|
|
|
updateWellPathAttributesOnPlot();
|
2018-09-10 02:55:07 -05:00
|
|
|
updateParentPlotLayout();
|
|
|
|
RiuPlotMainWindowTools::refreshToolbars();
|
2018-08-30 07:03:58 -05:00
|
|
|
}
|
2017-11-07 03:02:43 -06:00
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2018-06-26 04:18:24 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::updateParentPlotLayout()
|
|
|
|
{
|
|
|
|
RimWellLogPlot* wellLogPlot;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( wellLogPlot );
|
|
|
|
if ( wellLogPlot )
|
2018-06-26 04:18:24 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RiuWellLogPlot* wellLogPlotViewer = dynamic_cast<RiuWellLogPlot*>( wellLogPlot->viewWidget() );
|
|
|
|
if ( wellLogPlotViewer )
|
2018-06-26 04:18:24 -05:00
|
|
|
{
|
|
|
|
wellLogPlotViewer->updateChildrenLayout();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-27 03:01:44 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::updateAxisAndGridTickIntervals()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_wellLogTrackPlotWidget ) return;
|
2018-06-27 03:01:44 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_explicitTickIntervals )
|
2018-06-27 03:01:44 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setMajorAndMinorTickIntervals( m_majorTickInterval(), m_minorTickInterval() );
|
2018-06-27 03:01:44 -05:00
|
|
|
}
|
2018-06-28 01:23:16 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
int xMajorTickIntervals = 3;
|
|
|
|
int xMinorTickIntervals = 0;
|
2019-09-06 03:40:57 -05:00
|
|
|
switch ( m_widthScaleFactor() )
|
2018-06-28 01:23:16 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
case EXTRA_NARROW_TRACK:
|
|
|
|
xMajorTickIntervals = 3;
|
|
|
|
xMinorTickIntervals = 2;
|
|
|
|
break;
|
|
|
|
case NARROW_TRACK:
|
|
|
|
xMajorTickIntervals = 3;
|
|
|
|
xMinorTickIntervals = 5;
|
|
|
|
break;
|
|
|
|
case NORMAL_TRACK:
|
|
|
|
xMajorTickIntervals = 5;
|
|
|
|
xMinorTickIntervals = 5;
|
|
|
|
break;
|
|
|
|
case WIDE_TRACK:
|
|
|
|
xMajorTickIntervals = 5;
|
|
|
|
xMinorTickIntervals = 10;
|
|
|
|
break;
|
|
|
|
case EXTRA_WIDE_TRACK:
|
|
|
|
xMajorTickIntervals = 10;
|
|
|
|
xMinorTickIntervals = 10;
|
|
|
|
break;
|
2018-06-28 01:23:16 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setAutoTickIntervalCounts( xMajorTickIntervals, xMinorTickIntervals );
|
2018-06-28 01:23:16 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
switch ( m_xAxisGridVisibility() )
|
2018-07-06 04:22:18 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
case RimWellLogPlot::AXIS_GRID_NONE:
|
|
|
|
m_wellLogTrackPlotWidget->enableXGridLines( false, false );
|
|
|
|
break;
|
|
|
|
case RimWellLogPlot::AXIS_GRID_MAJOR:
|
|
|
|
m_wellLogTrackPlotWidget->enableXGridLines( true, false );
|
|
|
|
break;
|
|
|
|
case RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR:
|
|
|
|
m_wellLogTrackPlotWidget->enableXGridLines( true, true );
|
|
|
|
break;
|
2018-07-06 04:22:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
RimWellLogPlot* plot = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfTypeAsserted( plot );
|
|
|
|
switch ( plot->depthGridLinesVisibility() )
|
|
|
|
{
|
|
|
|
case RimWellLogPlot::AXIS_GRID_NONE:
|
|
|
|
m_wellLogTrackPlotWidget->enableDepthGridLines( false, false );
|
|
|
|
break;
|
|
|
|
case RimWellLogPlot::AXIS_GRID_MAJOR:
|
|
|
|
m_wellLogTrackPlotWidget->enableDepthGridLines( true, false );
|
|
|
|
break;
|
|
|
|
case RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR:
|
|
|
|
m_wellLogTrackPlotWidget->enableDepthGridLines( true, true );
|
|
|
|
break;
|
2018-06-27 05:42:11 -05:00
|
|
|
}
|
2018-07-09 01:54:59 -05:00
|
|
|
m_wellLogTrackPlotWidget->replot();
|
2018-06-27 03:01:44 -05:00
|
|
|
}
|
|
|
|
|
2018-09-07 06:39:50 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::updateAllLegendItems()
|
|
|
|
{
|
|
|
|
reattachAllCurves();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget )
|
2018-09-07 08:18:41 -05:00
|
|
|
{
|
|
|
|
m_wellLogTrackPlotWidget->updateLegend();
|
|
|
|
}
|
2018-09-07 06:39:50 -05:00
|
|
|
}
|
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-25 07:41:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
bool* useOptionsOnly )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
|
|
|
QList<caf::PdmOptionItemInfo> options;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( options.size() > 0 ) return options;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fieldNeedingOptions == &m_formationWellPathForSourceCase )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimTools::wellPathOptionItems( &options );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_formationWellPathForSourceWellPath )
|
2018-01-04 09:42:57 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimTools::wellPathWithFormationsOptionItems( &options );
|
2018-01-04 09:42:57 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_formationCase )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimTools::caseOptionItems( &options );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_formationSimWellName )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellLogTrack::simWellOptionItems( &options, m_formationCase );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_formationBranchIndex )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
auto simulationWellBranches = RiaSimWellBranchTools::simulationWellBranches( m_formationSimWellName(),
|
|
|
|
m_formationBranchDetection );
|
|
|
|
options = RiaSimWellBranchTools::valueOptionsForBranchIndexField( simulationWellBranches );
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_formationLevel )
|
2017-12-11 03:46:29 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationWellPathForSourceWellPath )
|
2017-12-11 03:46:29 -06:00
|
|
|
{
|
2018-01-04 09:42:57 -06:00
|
|
|
const RigWellPathFormations* formations = m_formationWellPathForSourceWellPath->formationsGeometry();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( formations )
|
2017-12-11 03:46:29 -06:00
|
|
|
{
|
2017-12-11 05:59:03 -06:00
|
|
|
using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>;
|
2017-12-11 03:46:29 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiText( RigWellPathFormations::NONE ),
|
|
|
|
RigWellPathFormations::NONE ) );
|
2017-12-11 05:59:03 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiText( RigWellPathFormations::ALL ),
|
|
|
|
RigWellPathFormations::ALL ) );
|
|
|
|
|
|
|
|
for ( const RigWellPathFormations::FormationLevel& level : formations->formationsLevelsPresent() )
|
2017-12-11 03:46:29 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t index = FormationLevelEnum::index( level );
|
|
|
|
if ( index >= FormationLevelEnum::size() ) continue;
|
2017-12-11 03:46:29 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiTextFromIndex( index ),
|
|
|
|
FormationLevelEnum::fromIndex( index ) ) );
|
2017-12-11 03:46:29 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_wellPathComponentSource )
|
2018-08-30 07:03:58 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimTools::wellPathOptionItems( &options );
|
|
|
|
options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) );
|
2018-08-30 07:03:58 -05:00
|
|
|
}
|
2019-09-10 08:21:58 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_colorShadingPalette )
|
|
|
|
{
|
|
|
|
std::vector<RimRegularLegendConfig::ColorRangesType> rangeTypes;
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::NORMAL );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::OPPOSITE_NORMAL );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::WHITE_PINK );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::PINK_WHITE );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::BLUE_WHITE_RED );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::RED_WHITE_BLUE );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::WHITE_BLACK );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::BLACK_WHITE );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::ANGULAR );
|
|
|
|
rangeTypes.push_back( RimRegularLegendConfig::CATEGORY );
|
|
|
|
|
|
|
|
for ( RimRegularLegendConfig::ColorRangesType colType : rangeTypes )
|
|
|
|
{
|
|
|
|
options.push_back(
|
|
|
|
caf::PdmOptionItemInfo( RimRegularLegendConfig::ColorRangeEnum::uiText( colType ), colType ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
return options;
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
caf::PdmFieldHandle* RimWellLogTrack::objectToggleField()
|
|
|
|
{
|
|
|
|
return &m_show;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
caf::PdmFieldHandle* RimWellLogTrack::userDescriptionField()
|
|
|
|
{
|
|
|
|
return &m_userName;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::addCurve( RimWellLogCurve* curve )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
curves.push_back( curve );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
curve->setParentQwtPlotAndReplot( m_wellLogTrackPlotWidget );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::insertCurve( RimWellLogCurve* curve, size_t index )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
curves.insert( index, curve );
|
2017-02-13 01:37:31 -06:00
|
|
|
// Todo: Mark curve data to use either TVD or MD
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
curve->setParentQwtPlotAndReplot( m_wellLogTrackPlotWidget );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::takeOutCurve( RimWellLogCurve* curve )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t index = curves.index( curve );
|
|
|
|
if ( index < curves.size() )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
curves[index]->detachQwtCurve();
|
2019-09-06 03:40:57 -05:00
|
|
|
curves.removeChildObject( curve );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-15 03:41:00 -06:00
|
|
|
void RimWellLogTrack::deleteAllCurves()
|
|
|
|
{
|
|
|
|
curves.deleteAllChildObjects();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 03:41:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-02-13 01:37:31 -06:00
|
|
|
RiuWellLogTrack* RimWellLogTrack::viewer()
|
|
|
|
{
|
|
|
|
return m_wellLogTrackPlotWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::availableDepthRange( double* minimumDepth, double* maximumDepth )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
double minDepth = HUGE_VAL;
|
|
|
|
double maxDepth = -HUGE_VAL;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimPlotCurve* curve : curves )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
double minCurveDepth = HUGE_VAL;
|
|
|
|
double maxCurveDepth = -HUGE_VAL;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( curve->isCurveVisible() && curve->yValueRange( &minCurveDepth, &maxCurveDepth ) )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( minCurveDepth < minDepth )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
minDepth = minCurveDepth;
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( maxCurveDepth > maxDepth )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
maxDepth = maxCurveDepth;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_showWellPathAttributes || m_showWellPathCompletions )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const std::unique_ptr<RiuWellPathComponentPlotItem>& plotObject : m_wellPathAttributePlotObjects )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
|
|
|
double minObjectDepth = HUGE_VAL;
|
|
|
|
double maxObjectDepth = -HUGE_VAL;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( plotObject->yValueRange( &minObjectDepth, &maxObjectDepth ) )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( minObjectDepth < minDepth )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
|
|
|
minDepth = minObjectDepth;
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( maxObjectDepth > maxDepth )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
|
|
|
maxDepth = maxObjectDepth;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
*minimumDepth = minDepth;
|
|
|
|
*maximumDepth = maxDepth;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::loadDataAndUpdate( bool updateParentPlotAndToolbars )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2017-11-28 04:00:36 -06:00
|
|
|
RimWellLogPlot* wellLogPlot = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfType( wellLogPlot );
|
2017-11-11 16:15:13 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellLogPlot && m_wellLogTrackPlotWidget )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( isFirstVisibleTrackInPlot() )
|
2018-07-06 02:17:16 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setDepthTitle( wellLogPlot->depthPlotTitle() );
|
2018-07-06 02:17:16 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setXTitle( m_xAxisTitle );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
2017-11-11 16:15:13 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t cIdx = 0; cIdx < curves.size(); ++cIdx )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
curves[cIdx]->loadDataAndUpdate( false );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
if ( m_formationDisplay == RiuPlotAnnotationTool::NONE )
|
2017-11-03 08:53:00 -05:00
|
|
|
{
|
2019-09-10 06:23:29 -05:00
|
|
|
setFormationFieldsUiReadOnly( true );
|
2017-11-03 08:53:00 -05:00
|
|
|
}
|
2017-11-06 02:27:26 -06:00
|
|
|
else
|
2017-11-01 02:53:57 -05:00
|
|
|
{
|
2019-09-10 06:23:29 -05:00
|
|
|
setFormationFieldsUiReadOnly( false );
|
2017-11-01 02:53:57 -05:00
|
|
|
}
|
2017-11-11 16:15:13 -06:00
|
|
|
|
|
|
|
if ( m_wellLogTrackPlotWidget )
|
|
|
|
{
|
2018-09-05 07:03:18 -05:00
|
|
|
this->updateWellPathAttributesCollection();
|
2018-08-30 07:03:58 -05:00
|
|
|
this->updateWellPathAttributesOnPlot();
|
2017-11-11 16:15:13 -06:00
|
|
|
m_wellLogTrackPlotWidget->updateLegend();
|
2018-08-30 07:03:58 -05:00
|
|
|
|
2017-11-11 16:15:13 -06:00
|
|
|
this->updateAxisScaleEngine();
|
|
|
|
this->updateFormationNamesOnPlot();
|
2018-05-23 04:28:57 -05:00
|
|
|
this->applyXZoomFromVisibleRange();
|
2017-11-11 16:15:13 -06:00
|
|
|
}
|
2018-06-28 01:23:16 -05:00
|
|
|
|
2018-07-02 02:49:05 -05:00
|
|
|
this->updateAxisAndGridTickIntervals();
|
2019-09-06 03:40:57 -05:00
|
|
|
m_majorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() );
|
|
|
|
m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() );
|
2018-07-02 02:49:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool emptyRange = std::abs( m_visibleXRangeMax() - m_visibleXRangeMin ) <
|
|
|
|
1.0e-6 * std::max( 1.0, std::max( m_visibleXRangeMax(), m_visibleXRangeMin() ) );
|
|
|
|
m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange );
|
|
|
|
m_xAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
|
2018-09-07 06:39:50 -05:00
|
|
|
|
|
|
|
updateAllLegendItems();
|
2018-09-10 02:55:07 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( updateParentPlotAndToolbars )
|
2018-09-10 02:55:07 -05:00
|
|
|
{
|
|
|
|
updateParentPlotLayout();
|
|
|
|
RiuPlotMainWindowTools::refreshToolbars();
|
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
2017-11-06 05:49:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-06 05:49:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setAndUpdateWellPathFormationNamesData( RimCase* rimCase, RimWellPath* wellPath )
|
2017-11-06 05:49:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_formationCase = rimCase;
|
|
|
|
m_formationTrajectoryType = RimWellLogTrack::WELL_PATH;
|
2018-01-04 09:42:57 -06:00
|
|
|
m_formationWellPathForSourceCase = wellPath;
|
2019-09-06 03:40:57 -05:00
|
|
|
m_formationSimWellName = "";
|
|
|
|
m_formationBranchIndex = -1;
|
2017-11-09 06:36:14 -06:00
|
|
|
|
|
|
|
updateConnectedEditors();
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
if ( m_formationDisplay != RiuPlotAnnotationTool::NONE )
|
2017-11-09 06:36:14 -06:00
|
|
|
{
|
|
|
|
updateFormationNamesOnPlot();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-09 06:36:14 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setAndUpdateSimWellFormationNamesAndBranchData( RimCase* rimCase,
|
|
|
|
const QString& simWellName,
|
|
|
|
int branchIndex,
|
|
|
|
bool useBranchDetection )
|
2017-12-07 07:51:58 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_formationBranchIndex = branchIndex;
|
2017-12-07 07:51:58 -06:00
|
|
|
m_formationBranchDetection = useBranchDetection;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
setAndUpdateSimWellFormationNamesData( rimCase, simWellName );
|
2017-12-07 07:51:58 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-12-07 07:51:58 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setAndUpdateSimWellFormationNamesData( RimCase* rimCase, const QString& simWellName )
|
2017-11-09 06:36:14 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_formationCase = rimCase;
|
|
|
|
m_formationTrajectoryType = RimWellLogTrack::SIMULATION_WELL;
|
2018-01-04 09:42:57 -06:00
|
|
|
m_formationWellPathForSourceCase = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
m_formationSimWellName = simWellName;
|
2017-11-06 09:08:28 -06:00
|
|
|
|
2017-11-06 06:39:14 -06:00
|
|
|
updateConnectedEditors();
|
2017-11-09 06:36:14 -06:00
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
if ( m_formationDisplay != RiuPlotAnnotationTool::NONE )
|
2017-11-06 09:08:28 -06:00
|
|
|
{
|
|
|
|
updateFormationNamesOnPlot();
|
|
|
|
}
|
2017-11-06 05:49:06 -06:00
|
|
|
}
|
|
|
|
|
2018-05-23 04:28:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-05-23 04:28:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setAutoScaleXEnabled( bool enabled )
|
2018-05-23 04:28:57 -05:00
|
|
|
{
|
|
|
|
m_isAutoScaleXEnabled = enabled;
|
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setXAxisTitle( const QString& text )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
m_xAxisTitle = text;
|
|
|
|
}
|
|
|
|
|
2017-11-28 04:00:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-06-26 03:38:44 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimWellLogTrack::depthPlotTitle() const
|
|
|
|
{
|
|
|
|
RimWellLogPlot* parent;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfTypeAsserted( parent );
|
2018-06-26 03:38:44 -05:00
|
|
|
|
|
|
|
return parent->depthPlotTitle();
|
|
|
|
}
|
|
|
|
|
2018-06-26 04:18:24 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
int RimWellLogTrack::widthScaleFactor() const
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return static_cast<int>( m_widthScaleFactor() );
|
2018-06-26 04:18:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setWidthScaleFactor( WidthScaleFactor scaleFactor )
|
2018-06-26 04:18:24 -05:00
|
|
|
{
|
|
|
|
m_widthScaleFactor = scaleFactor;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-28 04:00:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setFormationWellPath( RimWellPath* wellPath )
|
2017-11-28 04:00:36 -06:00
|
|
|
{
|
2018-01-04 09:42:57 -06:00
|
|
|
m_formationWellPathForSourceCase = wellPath;
|
2017-11-28 04:00:36 -06:00
|
|
|
}
|
|
|
|
|
2018-09-07 07:37:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellPath* RimWellLogTrack::formationWellPath() const
|
|
|
|
{
|
|
|
|
return m_formationWellPathForSourceCase;
|
|
|
|
}
|
|
|
|
|
2017-11-28 04:00:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-28 04:00:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setFormationSimWellName( const QString& simWellName )
|
2017-11-28 04:00:36 -06:00
|
|
|
{
|
|
|
|
m_formationSimWellName = simWellName;
|
|
|
|
}
|
|
|
|
|
2019-09-11 05:51:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimWellLogTrack::formationSimWellName() const
|
|
|
|
{
|
|
|
|
return m_formationSimWellName;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::setFormationBranchDetection( bool branchDetection )
|
|
|
|
{
|
|
|
|
m_formationBranchDetection = branchDetection;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellLogTrack::formationBranchDetection() const
|
|
|
|
{
|
|
|
|
return m_formationBranchDetection();
|
|
|
|
}
|
|
|
|
|
2017-11-05 05:26:27 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-05 05:26:27 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setFormationBranchIndex( int branchIndex )
|
2017-11-05 05:26:27 -06:00
|
|
|
{
|
2017-11-06 03:30:38 -06:00
|
|
|
m_formationBranchIndex = branchIndex;
|
2017-11-05 05:26:27 -06:00
|
|
|
}
|
|
|
|
|
2019-09-11 05:51:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
int RimWellLogTrack::formationBranchIndex() const
|
|
|
|
{
|
|
|
|
return m_formationBranchIndex;
|
|
|
|
}
|
|
|
|
|
2017-11-28 04:00:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-28 04:00:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setFormationCase( RimCase* rimCase )
|
2017-11-28 04:00:36 -06:00
|
|
|
{
|
|
|
|
m_formationCase = rimCase;
|
|
|
|
}
|
|
|
|
|
2019-09-11 05:51:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimCase* RimWellLogTrack::formationNamesCase() const
|
|
|
|
{
|
|
|
|
return m_formationCase();
|
|
|
|
}
|
|
|
|
|
2017-11-28 04:00:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-28 04:00:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setFormationTrajectoryType( TrajectoryType trajectoryType )
|
2017-11-28 04:00:36 -06:00
|
|
|
{
|
|
|
|
m_formationTrajectoryType = trajectoryType;
|
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-12 07:45:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-11 05:51:25 -05:00
|
|
|
RimWellLogTrack::TrajectoryType RimWellLogTrack::formationTrajectoryType() const
|
2017-11-12 07:45:06 -06:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
return m_formationTrajectoryType();
|
2017-11-12 07:45:06 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::recreateViewer()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget == nullptr )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget = new RiuWellLogTrack( this );
|
2017-02-13 01:37:31 -06:00
|
|
|
updateAxisScaleEngine();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t cIdx = 0; cIdx < curves.size(); ++cIdx )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
curves[cIdx]->setParentQwtPlotNoReplot( this->m_wellLogTrackPlotWidget );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
2017-09-23 01:47:04 -05:00
|
|
|
|
|
|
|
this->m_wellLogTrackPlotWidget->replot();
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::detachAllCurves()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimPlotCurve* curve : curves )
|
2018-09-07 06:39:50 -05:00
|
|
|
{
|
|
|
|
curve->detachQwtCurve();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( auto& plotObjects : m_wellPathAttributePlotObjects )
|
2018-09-07 06:39:50 -05:00
|
|
|
{
|
2018-10-05 08:59:19 -05:00
|
|
|
plotObjects->detachFromQwt();
|
2018-09-07 06:39:50 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::reattachAllCurves()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimPlotCurve* curve : curves )
|
2018-09-07 06:39:50 -05:00
|
|
|
{
|
|
|
|
curve->reattachQwtCurve();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( auto& plotObjects : m_wellPathAttributePlotObjects )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2018-10-05 08:59:19 -05:00
|
|
|
plotObjects->reattachToQwt();
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-05-23 04:28:57 -05:00
|
|
|
void RimWellLogTrack::updateParentPlotZoom()
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellLogTrackPlotWidget )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
RimWellLogPlot* wellLogPlot;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfType( wellLogPlot );
|
|
|
|
if ( wellLogPlot )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
wellLogPlot->updateDepthZoom();
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
2018-05-23 04:28:57 -05:00
|
|
|
}
|
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2018-05-23 04:28:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-05-23 04:28:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::calculateXZoomRangeAndUpdateQwt()
|
|
|
|
{
|
|
|
|
this->calculateXZoomRange();
|
|
|
|
this->applyXZoomFromVisibleRange();
|
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2018-05-23 04:28:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-05-23 04:28:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::applyXZoomFromVisibleRange()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_wellLogTrackPlotWidget ) return;
|
2018-06-26 06:14:29 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setXRange( m_visibleXRangeMin, m_visibleXRangeMax );
|
2018-08-30 07:03:58 -05:00
|
|
|
|
2018-10-09 08:27:46 -05:00
|
|
|
// Attribute range. Fixed range where well components are positioned [-1, 1].
|
2018-10-05 08:59:19 -05:00
|
|
|
// Set an extended range here to allow for some label space.
|
2019-09-06 03:40:57 -05:00
|
|
|
double componentRangeMax = 1.5 * ( 10.0 / ( m_widthScaleFactor() ) );
|
2018-10-09 08:27:46 -05:00
|
|
|
double componentRangeMin = -0.25;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_showWellPathComponentsBothSides )
|
2018-08-30 07:03:58 -05:00
|
|
|
{
|
2018-10-18 13:11:00 -05:00
|
|
|
componentRangeMin = -1.5;
|
2018-09-05 07:03:18 -05:00
|
|
|
}
|
2018-10-03 08:57:09 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setXRange( componentRangeMin, componentRangeMax, QwtPlot::xBottom );
|
2018-08-30 07:03:58 -05:00
|
|
|
|
2018-05-23 04:28:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->replot();
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-05-23 04:28:57 -05:00
|
|
|
void RimWellLogTrack::calculateXZoomRange()
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2017-10-27 08:17:24 -05:00
|
|
|
std::map<int, std::vector<RimWellFlowRateCurve*>> stackCurveGroups = visibleStackedCurves();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const std::pair<int, std::vector<RimWellFlowRateCurve*>>& curveGroup : stackCurveGroups )
|
2017-10-27 08:17:24 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimWellFlowRateCurve* stCurve : curveGroup.second )
|
|
|
|
stCurve->updateStackedPlotData();
|
2017-10-27 08:17:24 -05:00
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_isAutoScaleXEnabled() )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
double minValue = HUGE_VAL;
|
|
|
|
double maxValue = -HUGE_VAL;
|
|
|
|
|
2018-06-27 05:42:11 -05:00
|
|
|
size_t visibleCurves = 0u;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( auto curve : curves )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
double minCurveValue = HUGE_VAL;
|
|
|
|
double maxCurveValue = -HUGE_VAL;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( curve->isCurveVisible() )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2018-06-27 05:42:11 -05:00
|
|
|
visibleCurves++;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( curve->xValueRange( &minCurveValue, &maxCurveValue ) )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( minCurveValue < minValue )
|
2018-06-27 05:42:11 -05:00
|
|
|
{
|
|
|
|
minValue = minCurveValue;
|
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( maxCurveValue > maxValue )
|
2018-06-27 05:42:11 -05:00
|
|
|
{
|
|
|
|
maxValue = maxCurveValue;
|
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( minValue == HUGE_VAL )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( visibleCurves )
|
2018-06-27 05:42:11 -05:00
|
|
|
{
|
|
|
|
minValue = RI_LOGPLOTTRACK_MINX_DEFAULT;
|
|
|
|
maxValue = RI_LOGPLOTTRACK_MAXX_DEFAULT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Empty axis when there are no curves
|
|
|
|
minValue = 0;
|
|
|
|
maxValue = 0;
|
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_minorTickInterval() != 0.0 )
|
2018-07-09 01:54:59 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::tie( minValue, maxValue ) = adjustXRange( minValue, maxValue, m_minorTickInterval() );
|
2018-07-09 01:54:59 -05:00
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
m_visibleXRangeMin = minValue;
|
|
|
|
m_visibleXRangeMax = maxValue;
|
|
|
|
|
|
|
|
computeAndSetXRangeMinForLogarithmicScale();
|
2018-05-23 04:28:57 -05:00
|
|
|
updateEditors();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-05-23 04:28:57 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::updateEditors()
|
|
|
|
{
|
|
|
|
this->updateConnectedEditors();
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2018-05-23 04:28:57 -05:00
|
|
|
RimWellLogPlot* plot = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfTypeAsserted( plot );
|
2018-05-23 04:28:57 -05:00
|
|
|
plot->updateConnectedEditors();
|
2017-02-13 01:37:31 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellRftPlot* rftPlot( nullptr );
|
2018-05-23 04:28:57 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfType( rftPlot );
|
2018-05-23 04:28:57 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( rftPlot )
|
2018-05-23 04:28:57 -05:00
|
|
|
{
|
|
|
|
rftPlot->updateConnectedEditors();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellPltPlot* pltPlot( nullptr );
|
|
|
|
firstAncestorOrThisOfType( pltPlot );
|
2018-05-23 04:28:57 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( pltPlot )
|
2018-05-23 04:28:57 -05:00
|
|
|
{
|
|
|
|
pltPlot->updateConnectedEditors();
|
|
|
|
}
|
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
2018-06-29 04:41:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setVisibleXRange( double minValue, double maxValue )
|
2018-06-29 04:41:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
this->setAutoScaleXEnabled( false );
|
2018-06-29 04:41:08 -05:00
|
|
|
m_visibleXRangeMin = minValue;
|
|
|
|
m_visibleXRangeMax = maxValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setTickIntervals( double majorTickInterval, double minorTickInterval )
|
2018-06-29 04:41:08 -05:00
|
|
|
{
|
|
|
|
m_explicitTickIntervals = true;
|
2019-09-06 03:40:57 -05:00
|
|
|
m_majorTickInterval = majorTickInterval;
|
|
|
|
m_minorTickInterval = minorTickInterval;
|
2018-06-29 04:41:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines )
|
2018-06-29 04:41:08 -05:00
|
|
|
{
|
2018-07-06 04:22:18 -05:00
|
|
|
m_xAxisGridVisibility = gridLines;
|
2018-06-29 04:41:08 -05:00
|
|
|
}
|
|
|
|
|
2017-11-12 14:22:12 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-12 14:22:12 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-11 05:51:25 -05:00
|
|
|
void RimWellLogTrack::setShowFormations( RiuPlotAnnotationTool::FormationDisplay formationDisplay )
|
2017-11-12 14:22:12 -06:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
m_formationDisplay = formationDisplay;
|
2017-11-12 14:22:12 -06:00
|
|
|
}
|
|
|
|
|
2018-09-07 07:37:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellLogTrack::showFormations() const
|
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
return m_formationDisplay() != RiuPlotAnnotationTool::NONE;
|
2018-09-07 07:37:35 -05:00
|
|
|
}
|
|
|
|
|
2018-07-06 02:16:03 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setShowFormationLabels( bool on )
|
2018-07-06 02:16:03 -05:00
|
|
|
{
|
|
|
|
m_showFormationLabels = on;
|
|
|
|
}
|
|
|
|
|
2018-09-05 07:03:18 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-10-03 08:57:09 -05:00
|
|
|
bool RimWellLogTrack::showWellPathAttributes() const
|
2018-09-05 07:03:18 -05:00
|
|
|
{
|
2018-10-03 08:57:09 -05:00
|
|
|
return m_showWellPathAttributes;
|
2018-09-05 07:03:18 -05:00
|
|
|
}
|
|
|
|
|
2018-10-03 08:57:09 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setShowWellPathAttributes( bool on )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
|
|
|
m_showWellPathAttributes = on;
|
2018-09-07 07:37:35 -05:00
|
|
|
}
|
|
|
|
|
2018-09-05 07:03:18 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setWellPathAttributesSource( RimWellPath* wellPath )
|
2018-09-05 07:03:18 -05:00
|
|
|
{
|
2018-10-09 08:27:46 -05:00
|
|
|
m_wellPathComponentSource = wellPath;
|
2018-09-05 07:03:18 -05:00
|
|
|
updateWellPathAttributesCollection();
|
|
|
|
}
|
|
|
|
|
2018-09-07 07:37:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellPath* RimWellLogTrack::wellPathAttributeSource() const
|
|
|
|
{
|
2018-10-09 08:27:46 -05:00
|
|
|
return m_wellPathComponentSource;
|
2018-09-07 07:37:35 -05:00
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellLogCurve* RimWellLogTrack::curveDefinitionFromCurve( const QwtPlotCurve* curve ) const
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t idx = 0; idx < curves.size(); idx++ )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( curves[idx]->qwtPlotCurve() == curve )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
return curves[idx];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
uiOrdering.add( &m_userName );
|
2019-09-11 05:51:25 -05:00
|
|
|
caf::PdmUiGroup* annotationGroup = uiOrdering.addNewGroup( "Regions/Annotations" );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_formationDisplay );
|
2019-09-10 08:21:58 -05:00
|
|
|
if ( m_formationDisplay() & RiuPlotAnnotationTool::COLOR_SHADING ||
|
|
|
|
m_formationDisplay() & RiuPlotAnnotationTool::COLORED_LINES )
|
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_colorShadingPalette );
|
2019-09-10 08:21:58 -05:00
|
|
|
if ( m_formationDisplay() & RiuPlotAnnotationTool::COLOR_SHADING )
|
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_colorShadingTransparency );
|
2019-09-10 08:21:58 -05:00
|
|
|
}
|
|
|
|
}
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_showFormationLabels );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
if ( !m_formationsForCaseWithSimWellOnly )
|
2018-01-26 03:28:24 -06:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_formationSource );
|
2018-01-26 03:28:24 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_formationSource = CASE;
|
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationSource() == CASE )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_formationCase );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_formationsForCaseWithSimWellOnly )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_formationTrajectoryType );
|
2018-01-26 03:28:24 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationTrajectoryType() == WELL_PATH )
|
2018-01-26 03:28:24 -06:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_formationWellPathForSourceCase );
|
2018-01-26 03:28:24 -06:00
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2018-01-26 03:28:24 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationsForCaseWithSimWellOnly || m_formationTrajectoryType() == SIMULATION_WELL )
|
2017-11-27 07:41:11 -06:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_formationSimWellName );
|
2018-01-26 03:28:24 -06:00
|
|
|
|
2019-09-11 05:51:25 -05:00
|
|
|
RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromSimWellName( annotationGroup,
|
2019-09-06 03:40:57 -05:00
|
|
|
m_formationSimWellName,
|
|
|
|
m_formationBranchDetection,
|
|
|
|
m_formationBranchIndex );
|
2017-11-27 07:41:11 -06:00
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( m_formationSource() == WELL_PICK_FILTER )
|
2017-12-08 08:46:16 -06:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_formationWellPathForSourceWellPath );
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationWellPathForSourceWellPath() )
|
2017-12-11 03:46:29 -06:00
|
|
|
{
|
2019-09-11 05:51:25 -05:00
|
|
|
annotationGroup->add( &m_formationLevel );
|
|
|
|
annotationGroup->add( &m_showformationFluids );
|
2017-12-11 03:46:29 -06:00
|
|
|
}
|
2017-12-08 08:46:16 -06:00
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* componentGroup = uiOrdering.addNewGroup( "Well Path Components" );
|
|
|
|
componentGroup->add( &m_showWellPathAttributes );
|
|
|
|
componentGroup->add( &m_showWellPathCompletions );
|
|
|
|
componentGroup->add( &m_wellPathAttributesInLegend );
|
|
|
|
componentGroup->add( &m_wellPathCompletionsInLegend );
|
|
|
|
componentGroup->add( &m_showWellPathComponentsBothSides );
|
|
|
|
componentGroup->add( &m_showWellPathComponentLabels );
|
|
|
|
|
|
|
|
componentGroup->add( &m_wellPathComponentSource );
|
2018-08-30 07:03:58 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
uiOrderingForXAxisSettings( uiOrdering );
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* trackSettingsGroup = uiOrdering.addNewGroup( "Track Settings" );
|
|
|
|
trackSettingsGroup->add( &m_widthScaleFactor );
|
2018-06-26 09:23:06 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
uiOrdering.skipRemainingFields( true );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::initAfterRead()
|
|
|
|
{
|
|
|
|
if ( m_showFormations_OBSOLETE() && m_formationDisplay() == RiuPlotAnnotationTool::NONE )
|
|
|
|
{
|
|
|
|
m_formationDisplay = RiuPlotAnnotationTool::COLORED_LINES;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-10 08:21:58 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
|
|
|
QString uiConfigName,
|
|
|
|
caf::PdmUiEditorAttribute* attribute )
|
|
|
|
{
|
|
|
|
if ( field == &m_colorShadingTransparency )
|
|
|
|
{
|
|
|
|
auto sliderAttrib = dynamic_cast<caf::PdmUiSliderEditorAttribute*>( attribute );
|
|
|
|
if ( sliderAttrib )
|
|
|
|
{
|
|
|
|
sliderAttrib->m_minimum = 0;
|
|
|
|
sliderAttrib->m_maximum = 100;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t RimWellLogTrack::curveIndex( RimWellLogCurve* curve )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return curves.index( curve );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellLogTrack::isVisible()
|
|
|
|
{
|
|
|
|
return m_show;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::updateAxisScaleEngine()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_isLogarithmicScaleEnabled )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setAxisScaleEngine( QwtPlot::xTop, new QwtLogScaleEngine );
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
// NB! Must assign scale engine to bottom in order to make QwtPlotGrid work
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setAxisScaleEngine( QwtPlot::xBottom, new QwtLogScaleEngine );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setAxisScaleEngine( QwtPlot::xTop, new RiuQwtLinearScaleEngine );
|
2017-02-13 01:37:31 -06:00
|
|
|
|
|
|
|
// NB! Must assign scale engine to bottom in order to make QwtPlotGrid work
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellLogTrackPlotWidget->setAxisScaleEngine( QwtPlot::xBottom, new RiuQwtLinearScaleEngine );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-06 02:17:16 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellLogTrack::isFirstVisibleTrackInPlot() const
|
|
|
|
{
|
|
|
|
RimWellLogPlot* plot = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfTypeAsserted( plot );
|
|
|
|
size_t ownIndex = plot->trackIndex( this );
|
2018-07-06 02:17:16 -05:00
|
|
|
return plot->firstVisibleTrackIndex() == ownIndex;
|
|
|
|
}
|
|
|
|
|
2018-07-09 01:54:59 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
std::pair<double, double> RimWellLogTrack::adjustXRange( double minValue, double maxValue, double tickInterval )
|
2018-07-09 01:54:59 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
double minRemainder = std::fmod( minValue, tickInterval );
|
|
|
|
double maxRemainder = std::fmod( maxValue, tickInterval );
|
|
|
|
double adjustedMin = minValue - minRemainder;
|
|
|
|
double adjustedMax = maxValue + ( tickInterval - maxRemainder );
|
|
|
|
return std::make_pair( adjustedMin, adjustedMax );
|
2018-07-09 01:54:59 -05:00
|
|
|
}
|
|
|
|
|
2018-09-05 07:03:18 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::updateWellPathAttributesCollection()
|
|
|
|
{
|
|
|
|
m_wellPathAttributeCollection = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellPathComponentSource )
|
2018-09-05 07:03:18 -05:00
|
|
|
{
|
|
|
|
std::vector<RimWellPathAttributeCollection*> attributeCollection;
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellPathComponentSource->descendantsIncludingThisOfType( attributeCollection );
|
|
|
|
if ( !attributeCollection.empty() )
|
2018-09-05 07:03:18 -05:00
|
|
|
{
|
|
|
|
m_wellPathAttributeCollection = attributeCollection.front();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::computeAndSetXRangeMinForLogarithmicScale()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_isAutoScaleXEnabled && m_isLogarithmicScaleEnabled )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
double pos = HUGE_VAL;
|
|
|
|
double neg = -HUGE_VAL;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t cIdx = 0; cIdx < curves.size(); cIdx++ )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( curves[cIdx]->isCurveVisible() && curves[cIdx]->curveData() )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RigStatisticsCalculator::posNegClosestToZero( curves[cIdx]->curveData()->xPlotValues(), pos, neg );
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( pos != HUGE_VAL )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
m_visibleXRangeMin = pos;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setLogarithmicScale( bool enable )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
|
|
|
m_isLogarithmicScaleEnabled = enable;
|
|
|
|
|
|
|
|
updateAxisScaleEngine();
|
|
|
|
computeAndSetXRangeMinForLogarithmicScale();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 01:37:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-27 08:17:24 -05:00
|
|
|
std::map<int, std::vector<RimWellFlowRateCurve*>> RimWellLogTrack::visibleStackedCurves()
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2017-10-27 08:17:24 -05:00
|
|
|
std::map<int, std::vector<RimWellFlowRateCurve*>> stackedCurves;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimWellLogCurve* curve : curves )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( curve && curve->isCurveVisible() )
|
2017-02-13 01:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellFlowRateCurve* wfrCurve = dynamic_cast<RimWellFlowRateCurve*>( curve );
|
|
|
|
if ( wfrCurve != nullptr )
|
2017-10-27 08:17:24 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
stackedCurves[wfrCurve->groupId()].push_back( wfrCurve );
|
2017-10-27 08:17:24 -05:00
|
|
|
}
|
2017-02-13 01:37:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return stackedCurves;
|
|
|
|
}
|
2017-03-09 07:27:41 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-09 07:27:41 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimWellLogTrack::description()
|
|
|
|
{
|
|
|
|
return m_userName;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-09 07:27:41 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<RimWellLogCurve*> RimWellLogTrack::curvesVector()
|
2017-03-09 07:27:41 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<RimWellLogCurve*> curvesVector;
|
2017-03-09 07:27:41 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimWellLogCurve* curve : curves )
|
2017-03-09 07:27:41 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
curvesVector.push_back( curve );
|
2017-03-09 07:27:41 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
return curvesVector;
|
|
|
|
}
|
|
|
|
|
2017-11-03 02:58:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-03 02:58:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::uiOrderingForRftPltFormations( caf::PdmUiOrdering& uiOrdering )
|
2017-11-03 02:58:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup( "Zonation/Formation Names" );
|
|
|
|
formationGroup->setCollapsedByDefault( true );
|
2019-09-10 06:23:29 -05:00
|
|
|
formationGroup->add( &m_formationDisplay );
|
2019-09-06 03:40:57 -05:00
|
|
|
formationGroup->add( &m_formationSource );
|
|
|
|
if ( m_formationSource == CASE )
|
2017-11-27 07:41:11 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
formationGroup->add( &m_formationCase );
|
2017-11-27 07:41:11 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationSource == WELL_PICK_FILTER )
|
2017-12-11 05:59:03 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationWellPathForSourceWellPath() && m_formationWellPathForSourceWellPath()->hasFormations() )
|
2017-12-11 05:59:03 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
formationGroup->add( &m_formationLevel );
|
|
|
|
formationGroup->add( &m_showformationFluids );
|
2017-12-11 05:59:03 -06:00
|
|
|
}
|
|
|
|
}
|
2017-11-03 02:58:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-03 02:58:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering )
|
2017-11-03 02:58:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "X Axis Settings" );
|
|
|
|
gridGroup->add( &m_isLogarithmicScaleEnabled );
|
|
|
|
gridGroup->add( &m_visibleXRangeMin );
|
|
|
|
gridGroup->add( &m_visibleXRangeMax );
|
|
|
|
gridGroup->add( &m_xAxisGridVisibility );
|
2019-04-26 02:30:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
// TODO Revisit if these settings are required
|
2019-04-26 02:30:23 -05:00
|
|
|
// See issue https://github.com/OPM/ResInsight/issues/4367
|
|
|
|
// gridGroup->add(&m_explicitTickIntervals);
|
|
|
|
// gridGroup->add(&m_majorTickInterval);
|
|
|
|
// gridGroup->add(&m_minorTickInterval);
|
2017-11-03 02:58:08 -05:00
|
|
|
}
|
|
|
|
|
2018-01-26 03:28:24 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-01-26 03:28:24 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setFormationsForCaseWithSimWellOnly( bool caseWithSimWellOnly )
|
2018-01-26 03:28:24 -06:00
|
|
|
{
|
|
|
|
m_formationsForCaseWithSimWellOnly = caseWithSimWellOnly;
|
|
|
|
}
|
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-25 07:41:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RigEclipseWellLogExtractor* RimWellLogTrack::createSimWellExtractor( RimWellLogPlotCollection* wellLogCollection,
|
|
|
|
RimCase* rimCase,
|
|
|
|
const QString& simWellName,
|
|
|
|
int branchIndex,
|
|
|
|
bool useBranchDetection )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !wellLogCollection ) return nullptr;
|
|
|
|
|
|
|
|
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( rimCase );
|
|
|
|
if ( !eclipseCase ) return nullptr;
|
|
|
|
|
|
|
|
std::vector<const RigWellPath*> wellPaths = RiaSimWellBranchTools::simulationWellBranches( simWellName,
|
|
|
|
useBranchDetection );
|
|
|
|
|
|
|
|
if ( wellPaths.size() == 0 ) return nullptr;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-11 05:51:25 -05:00
|
|
|
CVF_ASSERT( branchIndex >= 0 && branchIndex < static_cast<int>( wellPaths.size() ) );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
return ( wellLogCollection->findOrCreateSimWellExtractor( simWellName,
|
|
|
|
QString( "Find or create sim well extractor" ),
|
|
|
|
wellPaths[branchIndex],
|
|
|
|
eclipseCase->eclipseCaseData() ) );
|
2017-10-27 04:41:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-27 04:41:19 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigEclipseWellLogExtractor* extractor,
|
|
|
|
RigResultAccessor* resultAccessor )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
|
|
|
CurveSamplingPointData curveData;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
curveData.md = extractor->cellIntersectionMDs();
|
2018-09-04 04:40:21 -05:00
|
|
|
curveData.tvd = extractor->cellIntersectionTVDs();
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
extractor->curveData( resultAccessor, &curveData.data );
|
|
|
|
|
2017-10-27 04:41:19 -05:00
|
|
|
return curveData;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-27 04:41:19 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigGeoMechWellLogExtractor* extractor,
|
|
|
|
const RigFemResultAddress& resultAddress )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
|
|
|
CurveSamplingPointData curveData;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
curveData.md = extractor->cellIntersectionMDs();
|
2018-09-04 04:40:21 -05:00
|
|
|
curveData.tvd = extractor->cellIntersectionTVDs();
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
extractor->curveData( resultAddress, 0, &curveData.data );
|
2017-10-27 04:41:19 -05:00
|
|
|
return curveData;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-27 04:41:19 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::findFormationNamesToPlot( const CurveSamplingPointData& curveData,
|
|
|
|
const std::vector<QString>& formationNamesVector,
|
|
|
|
RimWellLogPlot::DepthTypeEnum depthType,
|
|
|
|
std::vector<QString>* formationNamesToPlot,
|
|
|
|
std::vector<std::pair<double, double>>* yValues )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( formationNamesVector.empty() ) return;
|
2017-11-01 05:46:36 -05:00
|
|
|
|
2017-10-27 04:41:19 -05:00
|
|
|
std::vector<size_t> formationNameIndicesFromCurve;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( double nameIdx : curveData.data )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( nameIdx != std::numeric_limits<double>::infinity() )
|
2018-06-29 05:35:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
formationNameIndicesFromCurve.push_back( static_cast<size_t>( round( nameIdx ) ) );
|
2018-09-05 07:03:52 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
formationNameIndicesFromCurve.push_back( std::numeric_limits<size_t>::max() );
|
2018-06-29 05:35:08 -05:00
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( formationNameIndicesFromCurve.empty() ) return;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2017-10-27 04:41:19 -05:00
|
|
|
std::vector<double> depthVector;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( depthType == RimWellLogPlot::MEASURED_DEPTH || depthType == RimWellLogPlot::PSEUDO_LENGTH )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
|
|
|
depthVector = curveData.md;
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
|
|
|
depthVector = curveData.tvd;
|
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( depthVector.empty() ) return;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2017-10-27 04:41:19 -05:00
|
|
|
double currentYStart = depthVector[0];
|
2018-09-05 07:03:52 -05:00
|
|
|
size_t prevNameIndex = formationNameIndicesFromCurve[0];
|
|
|
|
size_t currentNameIndex;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 1; i < formationNameIndicesFromCurve.size(); i++ )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2017-10-27 04:41:19 -05:00
|
|
|
currentNameIndex = formationNameIndicesFromCurve[i];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( currentNameIndex != std::numeric_limits<size_t>::max() && currentNameIndex != prevNameIndex )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( prevNameIndex < formationNamesVector.size() )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
formationNamesToPlot->push_back( formationNamesVector[prevNameIndex] );
|
|
|
|
yValues->push_back( std::make_pair( currentYStart, depthVector[i - 1] ) );
|
2017-10-27 04:41:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
currentYStart = depthVector[i];
|
|
|
|
prevNameIndex = currentNameIndex;
|
2017-10-25 07:41:54 -05:00
|
|
|
}
|
2017-10-27 04:41:19 -05:00
|
|
|
}
|
|
|
|
|
2018-09-05 07:03:52 -05:00
|
|
|
size_t lastFormationIdx = formationNameIndicesFromCurve.back();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( lastFormationIdx < formationNamesVector.size() )
|
2018-09-05 07:03:52 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
formationNamesToPlot->push_back( formationNamesVector[lastFormationIdx] );
|
|
|
|
yValues->push_back( std::make_pair( currentYStart, depthVector.back() ) );
|
2018-09-05 07:03:52 -05:00
|
|
|
}
|
2017-10-27 04:41:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-27 04:41:19 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<QString> RimWellLogTrack::formationNamesVector( RimCase* rimCase )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( rimCase );
|
|
|
|
RimGeoMechCase* geoMechCase = dynamic_cast<RimGeoMechCase*>( rimCase );
|
2017-10-27 04:41:19 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclipseCase )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclipseCase->eclipseCaseData()->activeFormationNames() )
|
2017-11-01 05:46:36 -05:00
|
|
|
{
|
|
|
|
return eclipseCase->eclipseCaseData()->activeFormationNames()->formationNames();
|
|
|
|
}
|
2017-10-27 04:41:19 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( geoMechCase )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( geoMechCase->geoMechData()->femPartResults()->activeFormationNames() )
|
2017-11-01 05:46:36 -05:00
|
|
|
{
|
|
|
|
return geoMechCase->geoMechData()->femPartResults()->activeFormationNames()->formationNames();
|
|
|
|
}
|
2017-10-27 04:41:19 -05:00
|
|
|
}
|
2017-11-01 05:46:36 -05:00
|
|
|
|
|
|
|
return std::vector<QString>();
|
2017-10-27 04:41:19 -05:00
|
|
|
}
|
2017-10-26 03:18:42 -05:00
|
|
|
|
2017-11-05 05:26:27 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-05 05:26:27 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellLogTrack::setFormationFieldsUiReadOnly( bool readOnly /*= true*/ )
|
2017-11-05 05:26:27 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_showFormationLabels.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationSource.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationTrajectoryType.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationSimWellName.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationCase.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationWellPathForSourceCase.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationWellPathForSourceWellPath.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationBranchDetection.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationBranchIndex.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_formationLevel.uiCapability()->setUiReadOnly( readOnly );
|
|
|
|
m_showformationFluids.uiCapability()->setUiReadOnly( readOnly );
|
2017-11-05 05:26:27 -06:00
|
|
|
}
|
|
|
|
|
2017-11-27 08:23:26 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-27 08:23:26 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::updateFormationNamesOnPlot()
|
|
|
|
{
|
|
|
|
removeFormationNames();
|
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
if ( m_formationDisplay == RiuPlotAnnotationTool::NONE ) return;
|
2017-10-27 04:41:19 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_annotationTool == nullptr )
|
2017-10-27 04:41:19 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_annotationTool = std::unique_ptr<RiuPlotAnnotationTool>( new RiuPlotAnnotationTool() );
|
2017-10-27 04:41:19 -05:00
|
|
|
}
|
|
|
|
|
2017-11-27 08:23:26 -06:00
|
|
|
std::vector<QString> formationNamesToPlot;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2017-11-28 04:32:54 -06:00
|
|
|
RimWellLogPlot* plot = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfTypeAsserted( plot );
|
2017-11-28 04:32:54 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationSource == CASE )
|
2017-11-27 08:23:26 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) ||
|
|
|
|
m_formationCase == nullptr )
|
|
|
|
return;
|
2017-11-27 07:41:11 -06:00
|
|
|
|
2017-11-27 08:23:26 -06:00
|
|
|
RimMainPlotCollection* mainPlotCollection;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfTypeAsserted( mainPlotCollection );
|
2017-10-27 04:41:19 -05:00
|
|
|
|
2017-11-27 08:23:26 -06:00
|
|
|
RimWellLogPlotCollection* wellLogCollection = mainPlotCollection->wellLogPlotCollection();
|
2017-10-27 04:41:19 -05:00
|
|
|
|
2017-11-27 08:23:26 -06:00
|
|
|
CurveSamplingPointData curveData;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RigEclipseWellLogExtractor* eclWellLogExtractor = nullptr;
|
2017-11-28 04:32:54 -06:00
|
|
|
RigGeoMechWellLogExtractor* geoMechWellLogExtractor = nullptr;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationTrajectoryType == SIMULATION_WELL )
|
2017-11-27 08:23:26 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
eclWellLogExtractor = RimWellLogTrack::createSimWellExtractor( wellLogCollection,
|
|
|
|
m_formationCase,
|
|
|
|
m_formationSimWellName,
|
|
|
|
m_formationBranchIndex,
|
|
|
|
m_formationBranchDetection );
|
2017-11-27 08:23:26 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
eclWellLogExtractor = RiaExtractionTools::wellLogExtractorEclipseCase( m_formationWellPathForSourceCase,
|
|
|
|
dynamic_cast<RimEclipseCase*>(
|
|
|
|
m_formationCase() ) );
|
2017-11-27 08:23:26 -06:00
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclWellLogExtractor )
|
2017-11-27 08:23:26 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_formationCase() );
|
|
|
|
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::
|
|
|
|
createFromResultAddress( eclipseCase->eclipseCaseData(),
|
|
|
|
0,
|
|
|
|
RiaDefines::PorosityModelType::MATRIX_MODEL,
|
|
|
|
0,
|
|
|
|
RigEclipseResultAddress( RiaDefines::FORMATION_NAMES,
|
|
|
|
RiaDefines::activeFormationNamesResultName() ) );
|
|
|
|
|
|
|
|
curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() );
|
2017-11-27 08:23:26 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
geoMechWellLogExtractor = RiaExtractionTools::wellLogExtractorGeoMechCase( m_formationWellPathForSourceCase,
|
|
|
|
dynamic_cast<RimGeoMechCase*>(
|
|
|
|
m_formationCase() ) );
|
|
|
|
if ( !geoMechWellLogExtractor ) return;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2017-11-27 08:23:26 -06:00
|
|
|
std::string activeFormationNamesResultName = RiaDefines::activeFormationNamesResultName().toStdString();
|
2019-09-06 03:40:57 -05:00
|
|
|
curveData = RimWellLogTrack::curveSamplingPointData( geoMechWellLogExtractor,
|
|
|
|
RigFemResultAddress( RIG_FORMATION_NAMES,
|
|
|
|
activeFormationNamesResultName,
|
|
|
|
"" ) );
|
2017-11-27 08:23:26 -06:00
|
|
|
}
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2018-09-27 03:01:45 -05:00
|
|
|
std::vector<std::pair<double, double>> yValues;
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<QString> formationNamesVector = RimWellLogTrack::formationNamesVector( m_formationCase );
|
|
|
|
|
|
|
|
RimWellLogTrack::findFormationNamesToPlot( curveData,
|
|
|
|
formationNamesVector,
|
|
|
|
plot->depthType(),
|
|
|
|
&formationNamesToPlot,
|
|
|
|
&yValues );
|
2017-11-27 07:41:11 -06:00
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
|
|
|
|
|
2019-09-10 08:21:58 -05:00
|
|
|
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
|
|
|
|
|
2019-09-10 06:23:29 -05:00
|
|
|
m_annotationTool->attachFormationNames( this->viewer(),
|
|
|
|
formationNamesToPlot,
|
|
|
|
xRange,
|
|
|
|
yValues,
|
|
|
|
m_formationDisplay(),
|
2019-09-10 08:21:58 -05:00
|
|
|
colorTable,
|
|
|
|
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100,
|
2019-09-10 06:23:29 -05:00
|
|
|
m_showFormationLabels() );
|
2017-12-08 08:46:16 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( m_formationSource() == WELL_PICK_FILTER )
|
2017-12-08 08:46:16 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_formationWellPathForSourceWellPath == nullptr ) return;
|
2018-01-24 01:21:22 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !( plot->depthType() == RimWellLogPlot::MEASURED_DEPTH ||
|
|
|
|
plot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH ) )
|
2018-01-24 01:21:22 -06:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2017-12-08 08:46:16 -06:00
|
|
|
|
|
|
|
std::vector<double> yValues;
|
|
|
|
|
2018-01-04 09:42:57 -06:00
|
|
|
const RigWellPathFormations* formations = m_formationWellPathForSourceWellPath->formationsGeometry();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !formations ) return;
|
2017-12-08 08:46:16 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
formations->depthAndFormationNamesUpToLevel( m_formationLevel(),
|
|
|
|
&formationNamesToPlot,
|
|
|
|
&yValues,
|
|
|
|
m_showformationFluids(),
|
|
|
|
plot->depthType() );
|
2018-01-24 01:21:22 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_annotationTool->attachWellPicks( this->viewer(), formationNamesToPlot, yValues );
|
2017-11-27 07:41:11 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-30 07:03:58 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::updateWellPathAttributesOnPlot()
|
2019-09-06 03:40:57 -05:00
|
|
|
{
|
2018-10-03 08:57:09 -05:00
|
|
|
m_wellPathAttributePlotObjects.clear();
|
2018-08-30 07:03:58 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellPathAttributeSource() )
|
2018-10-09 08:27:46 -05:00
|
|
|
{
|
2018-12-05 02:11:24 -06:00
|
|
|
std::vector<const RimWellPathComponentInterface*> allWellPathComponents;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_showWellPathAttributes || m_showWellPathCompletions )
|
2018-08-30 07:03:58 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellPathAttributePlotObjects.push_back( std::unique_ptr<RiuWellPathComponentPlotItem>(
|
|
|
|
new RiuWellPathComponentPlotItem( wellPathAttributeSource() ) ) );
|
2018-10-09 08:27:46 -05:00
|
|
|
}
|
2018-10-03 08:57:09 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_showWellPathAttributes )
|
2018-10-09 08:27:46 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_wellPathAttributeCollection )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
2018-10-09 08:27:46 -05:00
|
|
|
std::vector<RimWellPathAttribute*> attributes = m_wellPathAttributeCollection->attributes();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const RimWellPathAttribute* attribute : attributes )
|
2018-10-09 08:27:46 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( attribute->isEnabled() )
|
2018-11-22 05:57:11 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
allWellPathComponents.push_back( attribute );
|
2018-11-22 05:57:11 -06:00
|
|
|
}
|
2018-10-09 08:27:46 -05:00
|
|
|
}
|
2018-10-03 08:57:09 -05:00
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_showWellPathCompletions )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
const RimWellPathCompletions* completionsCollection = wellPathAttributeSource()->completions();
|
2018-10-09 06:42:03 -05:00
|
|
|
std::vector<const RimWellPathComponentInterface*> allCompletions = completionsCollection->allCompletions();
|
2018-10-09 08:27:46 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const RimWellPathComponentInterface* completion : allCompletions )
|
2018-10-03 08:57:09 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( completion->isEnabled() )
|
2018-11-22 05:57:11 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
allWellPathComponents.push_back( completion );
|
2018-11-22 05:57:11 -06:00
|
|
|
}
|
2018-08-30 07:03:58 -05:00
|
|
|
}
|
|
|
|
}
|
2018-10-03 08:57:09 -05:00
|
|
|
|
2018-12-05 02:11:24 -06:00
|
|
|
const std::map<RiaDefines::WellPathComponentType, int> sortIndices = {{RiaDefines::WELL_PATH, 0},
|
|
|
|
{RiaDefines::CASING, 1},
|
|
|
|
{RiaDefines::LINER, 2},
|
|
|
|
{RiaDefines::PERFORATION_INTERVAL, 3},
|
|
|
|
{RiaDefines::FISHBONES, 4},
|
|
|
|
{RiaDefines::FRACTURE, 5},
|
|
|
|
{RiaDefines::PACKER, 6},
|
|
|
|
{RiaDefines::ICD, 7},
|
|
|
|
{RiaDefines::AICD, 8},
|
|
|
|
{RiaDefines::ICV, 9}};
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::stable_sort( allWellPathComponents.begin(),
|
|
|
|
allWellPathComponents.end(),
|
|
|
|
[&sortIndices]( const RimWellPathComponentInterface* lhs,
|
|
|
|
const RimWellPathComponentInterface* rhs ) {
|
|
|
|
return sortIndices.at( lhs->componentType() ) < sortIndices.at( rhs->componentType() );
|
|
|
|
} );
|
2018-12-05 02:11:24 -06:00
|
|
|
|
|
|
|
std::set<QString> completionsAssignedToLegend;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const RimWellPathComponentInterface* component : allWellPathComponents )
|
2018-12-05 02:11:24 -06:00
|
|
|
{
|
|
|
|
std::unique_ptr<RiuWellPathComponentPlotItem> plotItem(
|
2019-09-06 03:40:57 -05:00
|
|
|
new RiuWellPathComponentPlotItem( wellPathAttributeSource(), component ) );
|
2018-12-05 02:11:24 -06:00
|
|
|
QString legendTitle = plotItem->legendTitle();
|
2019-09-06 03:40:57 -05:00
|
|
|
bool contributeToLegend = m_wellPathCompletionsInLegend() &&
|
|
|
|
!completionsAssignedToLegend.count( legendTitle );
|
|
|
|
plotItem->setContributeToLegend( contributeToLegend );
|
|
|
|
m_wellPathAttributePlotObjects.push_back( std::move( plotItem ) );
|
|
|
|
completionsAssignedToLegend.insert( legendTitle );
|
2018-12-05 02:11:24 -06:00
|
|
|
}
|
|
|
|
|
2018-10-03 08:57:09 -05:00
|
|
|
RimWellLogPlot* wellLogPlot;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
|
2018-10-03 08:57:09 -05:00
|
|
|
RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( auto& attributePlotObject : m_wellPathAttributePlotObjects )
|
2018-08-30 07:03:58 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
attributePlotObject->setDepthType( depthType );
|
|
|
|
attributePlotObject->setShowLabel( m_showWellPathComponentLabels() );
|
|
|
|
attributePlotObject->loadDataAndUpdate( false );
|
|
|
|
attributePlotObject->setParentQwtPlotNoReplot( m_wellLogTrackPlotWidget );
|
|
|
|
}
|
2018-10-03 08:57:09 -05:00
|
|
|
}
|
|
|
|
applyXZoomFromVisibleRange();
|
2018-08-30 07:03:58 -05:00
|
|
|
}
|
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-25 07:41:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellLogTrack::removeFormationNames()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_annotationTool )
|
2017-10-25 07:41:54 -05:00
|
|
|
{
|
|
|
|
m_annotationTool->detachAllAnnotations();
|
|
|
|
}
|
|
|
|
}
|