Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimWellPathCollection.h"
|
|
|
|
|
2017-05-22 08:52:32 -05:00
|
|
|
#include "RiaColorTables.h"
|
2019-07-25 08:54:20 -05:00
|
|
|
#include "RiaGuiApplication.h"
|
2017-12-05 01:58:51 -06:00
|
|
|
#include "RiaLogging.h"
|
2017-11-24 03:01:05 -06:00
|
|
|
#include "RiaPreferences.h"
|
2020-10-09 01:38:18 -05:00
|
|
|
#include "RiaTextStringTools.h"
|
2017-10-27 08:01:55 -05:00
|
|
|
#include "RiaWellNameComparer.h"
|
2016-12-20 02:53:19 -06:00
|
|
|
|
2021-02-26 07:27:59 -06:00
|
|
|
#include "RifWellPathFormationsImporter.h"
|
|
|
|
#include "RifWellPathImporter.h"
|
|
|
|
|
2017-06-07 04:57:25 -05:00
|
|
|
#include "RigEclipseCaseData.h"
|
|
|
|
#include "RigMainGrid.h"
|
2017-11-24 03:01:05 -06:00
|
|
|
#include "RigWellPath.h"
|
2017-02-24 07:31:06 -06:00
|
|
|
|
2017-11-24 03:01:05 -06:00
|
|
|
#include "RimEclipseCase.h"
|
|
|
|
#include "RimEclipseCaseCollection.h"
|
|
|
|
#include "RimEclipseView.h"
|
2021-02-26 07:27:59 -06:00
|
|
|
#include "RimFileWellPath.h"
|
|
|
|
#include "RimModeledWellPath.h"
|
2017-11-24 03:01:05 -06:00
|
|
|
#include "RimOilField.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimPerforationCollection.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RimProject.h"
|
2020-11-04 06:46:17 -06:00
|
|
|
#include "RimStimPlanModel.h"
|
|
|
|
#include "RimStimPlanModelCollection.h"
|
2015-09-16 09:06:06 -05:00
|
|
|
#include "RimWellLogFile.h"
|
2019-11-25 05:18:39 -06:00
|
|
|
#include "RimWellMeasurementCollection.h"
|
2017-02-24 07:31:06 -06:00
|
|
|
#include "RimWellPath.h"
|
2021-02-26 07:27:59 -06:00
|
|
|
#include "RimWellPathCompletionSettings.h"
|
2021-05-10 08:12:29 -05:00
|
|
|
#include "RimWellPathTieIn.h"
|
|
|
|
|
|
|
|
#include "cafTreeNode.h" // TODO: Move to caf
|
2015-09-24 02:37:26 -05:00
|
|
|
|
2021-02-26 07:27:59 -06:00
|
|
|
#include "Riu3DMainWindowTools.h"
|
2017-05-10 05:19:46 -05:00
|
|
|
|
2021-06-25 07:18:36 -05:00
|
|
|
#include "cafPdmFieldScriptingCapability.h"
|
|
|
|
#include "cafPdmObjectScriptingCapability.h"
|
2015-08-12 13:59:38 -05:00
|
|
|
#include "cafPdmUiEditorHandle.h"
|
2020-01-10 03:00:08 -06:00
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "cafProgressInfo.h"
|
|
|
|
|
2021-06-28 07:17:46 -05:00
|
|
|
#include <QCollator>
|
2014-07-24 03:11:43 -05:00
|
|
|
#include <QFile>
|
|
|
|
#include <QFileInfo>
|
2017-11-24 03:01:05 -06:00
|
|
|
#include <QString>
|
2014-07-24 03:11:43 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <cmath>
|
|
|
|
#include <fstream>
|
2013-10-01 04:44:10 -05:00
|
|
|
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
namespace caf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
template <>
|
|
|
|
void RimWellPathCollection::WellVisibilityEnum::setUp()
|
|
|
|
{
|
|
|
|
addItem( RimWellPathCollection::FORCE_ALL_OFF, "FORCE_ALL_OFF", "Off" );
|
|
|
|
addItem( RimWellPathCollection::ALL_ON, "ALL_ON", "Individual" );
|
|
|
|
addItem( RimWellPathCollection::FORCE_ALL_ON, "FORCE_ALL_ON", "On" );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
} // namespace caf
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimWellPathCollection, "WellPaths" );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellPathCollection::RimWellPathCollection()
|
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
CAF_PDM_InitScriptableObjectWithNameAndComment( "Wells", ":/WellCollection.png", "", "", "WellPathCollection", "Collection of Well Paths" );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &isActive, "Active", true, "Active" );
|
2019-09-06 03:40:57 -05:00
|
|
|
isActive.uiCapability()->setUiHidden( true );
|
2013-10-22 08:30:12 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &showWellPathLabel, "ShowWellPathLabel", true, "Show Well Path Labels" );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
|
2021-04-28 03:29:53 -05:00
|
|
|
cvf::Color3f defWellLabelColor = RiaPreferences::current()->defaultWellLabelColor();
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &wellPathLabelColor, "WellPathLabelColor", defWellLabelColor, "Well label color" );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
CAF_PDM_InitField( &wellPathVisibility, "GlobalWellPathVisibility", WellVisibilityEnum( ALL_ON ), "Global Well Path Visibility" );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &wellPathRadiusScaleFactor, "WellPathRadiusScale", 0.1, "Well Path Radius Scale" );
|
|
|
|
CAF_PDM_InitField( &wellPathCrossSectionVertexCount, "WellPathVertexCount", 12, "Well Path Vertex Count" );
|
2018-11-05 07:27:34 -06:00
|
|
|
wellPathCrossSectionVertexCount.xmlCapability()->disableIO();
|
2019-09-06 03:40:57 -05:00
|
|
|
wellPathCrossSectionVertexCount.uiCapability()->setUiHidden( true );
|
2018-11-05 07:27:34 -06:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &wellPathClip, "WellPathClip", true, "Clip Well Paths" );
|
|
|
|
CAF_PDM_InitField( &wellPathClipZDistance, "WellPathClipZDistance", 100, "Well Path Clipping Depth Distance" );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitScriptableFieldNoDefault( &m_wellPaths, "WellPaths", "Well Paths" );
|
2021-05-10 08:12:29 -05:00
|
|
|
m_wellPaths.uiCapability()->setUiTreeHidden( true );
|
|
|
|
m_wellPaths.uiCapability()->setUiTreeChildrenHidden( true );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_wellMeasurements, "WellMeasurements", "Measurements" );
|
2019-11-25 05:18:39 -06:00
|
|
|
m_wellMeasurements = new RimWellMeasurementCollection;
|
2020-01-11 01:05:03 -06:00
|
|
|
m_wellMeasurements.uiCapability()->setUiTreeHidden( true );
|
2019-11-25 05:18:39 -06:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_wellPathNodes, "WellPathNodes", "Well Path Nodes" );
|
2021-05-10 08:12:29 -05:00
|
|
|
m_wellPathNodes.xmlCapability()->disableIO();
|
|
|
|
|
2020-10-06 08:00:39 -05:00
|
|
|
m_wellPathImporter = std::make_unique<RifWellPathImporter>();
|
|
|
|
m_wellPathFormationsImporter = std::make_unique<RifWellPathFormationsImporter>();
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellPathCollection::~RimWellPathCollection()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
void RimWellPathCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
{
|
2017-06-21 10:13:19 -05:00
|
|
|
scheduleRedrawAffectedViews();
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-07-02 09:55:32 -05:00
|
|
|
/// Read files containing well path data, or create geometry based on the targets
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-07-02 09:55:32 -05:00
|
|
|
void RimWellPathCollection::loadDataAndUpdate()
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
caf::ProgressInfo progress( m_wellPaths.size(), "Reading well paths from file" );
|
2013-09-26 07:49:28 -05:00
|
|
|
|
2020-09-21 03:59:08 -05:00
|
|
|
readWellPathFormationFiles();
|
|
|
|
|
2020-10-07 09:18:24 -05:00
|
|
|
for ( RimWellPath* wellPath : allWellPaths() )
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
{
|
2020-09-21 03:59:08 -05:00
|
|
|
progress.setProgressDescription( QString( "Reading file %1" ).arg( wellPath->name() ) );
|
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
auto* fWPath = dynamic_cast<RimFileWellPath*>( wellPath );
|
|
|
|
auto* mWPath = dynamic_cast<RimModeledWellPath*>( wellPath );
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fWPath )
|
2018-06-20 01:55:27 -05:00
|
|
|
{
|
2019-12-12 09:15:24 -06:00
|
|
|
if ( !fWPath->filePath().isEmpty() )
|
2015-10-12 05:40:10 -05:00
|
|
|
{
|
2018-07-02 09:55:32 -05:00
|
|
|
QString errorMessage;
|
2020-10-06 08:00:39 -05:00
|
|
|
if ( !fWPath->readWellPathFile( &errorMessage, m_wellPathImporter.get(), false ) )
|
2018-07-02 09:55:32 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RiaLogging::warning( errorMessage );
|
2018-07-02 09:55:32 -05:00
|
|
|
}
|
2015-10-12 05:40:10 -05:00
|
|
|
}
|
2020-09-21 03:59:08 -05:00
|
|
|
}
|
|
|
|
else if ( mWPath )
|
|
|
|
{
|
|
|
|
mWPath->createWellPathGeometry();
|
|
|
|
}
|
2015-09-14 09:33:28 -05:00
|
|
|
|
2020-09-21 03:59:08 -05:00
|
|
|
if ( wellPath )
|
|
|
|
{
|
|
|
|
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() )
|
2015-09-24 02:37:26 -05:00
|
|
|
{
|
2018-07-02 09:55:32 -05:00
|
|
|
if ( wellLogFile )
|
2015-09-24 03:08:45 -05:00
|
|
|
{
|
2018-07-02 09:55:32 -05:00
|
|
|
QString errorMessage;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !wellLogFile->readFile( &errorMessage ) )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RiaLogging::warning( errorMessage );
|
2018-07-02 09:55:32 -05:00
|
|
|
}
|
2017-10-19 09:12:22 -05:00
|
|
|
}
|
2015-09-24 02:37:26 -05:00
|
|
|
}
|
2018-07-02 09:55:32 -05:00
|
|
|
|
2020-11-04 06:46:17 -06:00
|
|
|
RimStimPlanModelCollection* stimPlanModelCollection = wellPath->stimPlanModelCollection();
|
|
|
|
if ( stimPlanModelCollection )
|
2020-09-21 03:59:08 -05:00
|
|
|
{
|
2020-11-04 06:46:17 -06:00
|
|
|
for ( RimStimPlanModel* stimPlanModel : stimPlanModelCollection->allStimPlanModels() )
|
2020-09-21 03:59:08 -05:00
|
|
|
{
|
2020-11-04 06:46:17 -06:00
|
|
|
stimPlanModel->loadDataAndUpdate();
|
2020-09-21 03:59:08 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-09-26 07:49:28 -05:00
|
|
|
progress.incrementProgress();
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
}
|
2021-02-26 07:27:59 -06:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
rebuildWellPathNodes();
|
2021-02-26 07:27:59 -06:00
|
|
|
|
2015-11-30 07:32:34 -06:00
|
|
|
this->sortWellsByName();
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-03-07 05:51:14 -06:00
|
|
|
std::vector<RimWellPath*> RimWellPathCollection::addWellPaths( QStringList filePaths, QStringList* errorMessages )
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
{
|
2019-10-09 02:21:28 -05:00
|
|
|
CAF_ASSERT( errorMessages );
|
|
|
|
|
2018-06-20 01:55:27 -05:00
|
|
|
std::vector<RimFileWellPath*> wellPathArray;
|
2015-09-15 04:49:09 -05:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const QString& filePath : filePaths )
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
{
|
|
|
|
// Check if this file is already open
|
|
|
|
bool alreadyOpen = false;
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& wellPath : m_wellPaths )
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
auto* fWPath = dynamic_cast<RimFileWellPath*>( wellPath.p() );
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !fWPath ) continue;
|
2018-06-20 01:55:27 -05:00
|
|
|
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
QFile f1;
|
2019-09-06 03:40:57 -05:00
|
|
|
f1.setFileName( filePath );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
QString s1 = f1.fileName();
|
2019-09-06 03:40:57 -05:00
|
|
|
QFile f2;
|
2019-12-12 09:15:24 -06:00
|
|
|
f2.setFileName( fWPath->filePath() );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
QString s2 = f2.fileName();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( s1 == s2 )
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
{
|
2019-11-25 05:18:39 -06:00
|
|
|
// printf("Attempting to open well path JSON file that is already open:\n %s\n", (const char*)
|
|
|
|
// filePath.toLocal8Bit());
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
alreadyOpen = true;
|
2019-10-09 02:21:28 -05:00
|
|
|
errorMessages->push_back( QString( "%1 is already loaded" ).arg( filePath ) );
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !alreadyOpen )
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QFileInfo fi( filePath );
|
2013-06-26 05:01:53 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fi.suffix().compare( "json" ) == 0 )
|
2013-06-24 15:04:52 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
auto* wellPath = new RimFileWellPath();
|
2019-09-06 03:40:57 -05:00
|
|
|
wellPath->setFilepath( filePath );
|
|
|
|
wellPathArray.push_back( wellPath );
|
2013-06-24 15:04:52 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Create Well path objects for all the paths in the assumed ascii file
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t wellPathCount = m_wellPathImporter->wellDataCount( filePath );
|
|
|
|
for ( size_t i = 0; i < wellPathCount; ++i )
|
2013-06-24 15:04:52 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
auto* wellPath = new RimFileWellPath();
|
2019-09-06 03:40:57 -05:00
|
|
|
wellPath->setFilepath( filePath );
|
|
|
|
wellPath->setWellPathIndexInFile( static_cast<int>( i ) );
|
|
|
|
wellPathArray.push_back( wellPath );
|
2013-06-24 15:04:52 -05:00
|
|
|
}
|
|
|
|
}
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
p4#: 21651
2013-05-16 05:59:35 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
readAndAddWellPaths( wellPathArray );
|
2019-11-30 03:23:24 -06:00
|
|
|
CAF_ASSERT( wellPathArray.empty() );
|
2017-05-31 09:16:28 -05:00
|
|
|
|
2019-09-18 10:41:03 -05:00
|
|
|
scheduleRedrawAffectedViews();
|
|
|
|
updateAllRequiredEditors();
|
2019-10-09 02:21:28 -05:00
|
|
|
|
2021-05-27 04:25:13 -05:00
|
|
|
return allWellPaths();
|
2020-10-06 08:00:39 -05:00
|
|
|
}
|
|
|
|
|
2020-10-06 08:05:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-03-07 05:51:14 -06:00
|
|
|
void RimWellPathCollection::addWellPath( gsl::not_null<RimWellPath*> wellPath )
|
2020-10-06 08:05:04 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
m_wellPaths.push_back( wellPath );
|
|
|
|
|
|
|
|
rebuildWellPathNodes();
|
2020-10-19 06:16:00 -05:00
|
|
|
|
2020-10-06 08:05:04 -05:00
|
|
|
m_mostRecentlyUpdatedWellPath = wellPath;
|
|
|
|
}
|
|
|
|
|
2020-10-07 09:18:24 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimWellPath*> RimWellPathCollection::allWellPaths() const
|
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
return m_wellPaths.childrenByType();
|
2020-10-07 09:18:24 -05:00
|
|
|
}
|
|
|
|
|
2015-09-15 04:49:09 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-15 04:49:09 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-03-07 05:51:14 -06:00
|
|
|
void RimWellPathCollection::readAndAddWellPaths( std::vector<RimFileWellPath*>& wellPathArray )
|
2015-09-15 04:49:09 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::ProgressInfo progress( wellPathArray.size(), "Reading well paths from file" );
|
2015-09-15 04:49:09 -05:00
|
|
|
|
2022-11-04 04:11:08 -05:00
|
|
|
for ( RimFileWellPath* wellPath : wellPathArray )
|
2015-09-15 04:49:09 -05:00
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
wellPath->readWellPathFile( nullptr, m_wellPathImporter.get(), true );
|
2015-09-15 04:49:09 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
progress.setProgressDescription( QString( "Reading file %1" ).arg( wellPath->name() ) );
|
2015-09-15 04:49:09 -05:00
|
|
|
|
2022-11-04 04:11:08 -05:00
|
|
|
// If a well path with this name exists already, make it read the well path file. This is useful if a well log
|
|
|
|
// file has been imported before a well path file containing the full geometry for the well path.
|
|
|
|
// NB! Do not use tryFindMatchingWellPath(), as this function will remove the prefix and will return an false
|
|
|
|
// match in many cases.
|
|
|
|
auto* existingWellPath = dynamic_cast<RimFileWellPath*>( wellPathByName( wellPath->name() ) );
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( existingWellPath )
|
2015-09-15 04:49:09 -05:00
|
|
|
{
|
2019-12-12 09:15:24 -06:00
|
|
|
existingWellPath->setFilepath( wellPath->filePath() );
|
2019-09-06 03:40:57 -05:00
|
|
|
existingWellPath->setWellPathIndexInFile( wellPath->wellPathIndexInFile() );
|
2020-10-06 08:00:39 -05:00
|
|
|
existingWellPath->readWellPathFile( nullptr, m_wellPathImporter.get(), true );
|
2015-09-15 04:49:09 -05:00
|
|
|
|
2017-10-27 08:01:55 -05:00
|
|
|
// Let name from well path file override name from well log file
|
2019-09-06 03:40:57 -05:00
|
|
|
existingWellPath->setName( wellPath->name() );
|
2017-10-27 08:01:55 -05:00
|
|
|
|
2018-01-29 04:24:12 -06:00
|
|
|
m_mostRecentlyUpdatedWellPath = existingWellPath;
|
2015-09-15 04:49:09 -05:00
|
|
|
delete wellPath;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
wellPath->setWellPathColor( RiaColorTables::wellPathsPaletteColors().cycledColor3f( m_wellPaths.size() ) );
|
2019-09-06 03:40:57 -05:00
|
|
|
wellPath->setUnitSystem( findUnitSystemForWellPath( wellPath ) );
|
2023-03-07 05:51:14 -06:00
|
|
|
addWellPath( wellPath );
|
2015-09-15 04:49:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
progress.incrementProgress();
|
|
|
|
}
|
2019-11-30 03:23:24 -06:00
|
|
|
wellPathArray.clear(); // This should not be used again. We may have deleted items
|
2021-05-10 08:12:29 -05:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
groupWellPaths( allWellPaths() );
|
2021-05-10 08:12:29 -05:00
|
|
|
sortWellsByName();
|
|
|
|
rebuildWellPathNodes();
|
2015-09-15 04:49:09 -05:00
|
|
|
}
|
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-09-29 04:24:18 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-03-07 05:51:14 -06:00
|
|
|
void RimWellPathCollection::addWellPaths( const std::vector<RimWellPath*> incomingWellPaths )
|
2017-09-29 04:24:18 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& wellPath : incomingWellPaths )
|
2017-09-29 04:24:18 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
addWellPath( wellPath );
|
2017-09-29 04:24:18 -05:00
|
|
|
}
|
2021-05-10 08:12:29 -05:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
groupWellPaths( allWellPaths() );
|
2021-05-10 08:12:29 -05:00
|
|
|
sortWellsByName();
|
|
|
|
rebuildWellPathNodes();
|
2019-09-18 10:41:03 -05:00
|
|
|
|
|
|
|
updateAllRequiredEditors();
|
2017-09-29 04:24:18 -05:00
|
|
|
}
|
2015-09-15 04:49:09 -05:00
|
|
|
|
2015-09-14 09:33:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-14 09:33:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-10-09 02:21:28 -05:00
|
|
|
std::vector<RimWellLogFile*> RimWellPathCollection::addWellLogs( const QStringList& filePaths, QStringList* errorMessages )
|
2015-09-14 09:33:28 -05:00
|
|
|
{
|
2019-10-09 02:21:28 -05:00
|
|
|
CAF_ASSERT( errorMessages );
|
|
|
|
|
|
|
|
std::vector<RimWellLogFile*> logFileInfos;
|
2017-10-20 07:05:42 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
foreach ( QString filePath, filePaths )
|
2015-09-14 09:33:28 -05:00
|
|
|
{
|
2019-10-09 02:21:28 -05:00
|
|
|
QString errorMessage;
|
|
|
|
RimWellLogFile* logFileInfo = RimWellLogFile::readWellLogFile( filePath, &errorMessage );
|
|
|
|
if ( !errorMessage.isEmpty() )
|
|
|
|
{
|
|
|
|
errorMessages->push_back( errorMessage );
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( logFileInfo )
|
2015-09-14 09:33:28 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellPath* wellPath = tryFindMatchingWellPath( logFileInfo->wellName() );
|
|
|
|
if ( !wellPath )
|
2015-09-14 10:05:28 -05:00
|
|
|
{
|
2015-09-15 04:01:19 -05:00
|
|
|
wellPath = new RimWellPath();
|
2023-03-07 05:51:14 -06:00
|
|
|
addWellPath( wellPath );
|
2015-09-14 10:05:28 -05:00
|
|
|
}
|
2015-09-14 09:33:28 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
wellPath->addWellLogFile( logFileInfo );
|
2019-10-09 02:21:28 -05:00
|
|
|
logFileInfos.push_back( logFileInfo );
|
2015-09-14 09:33:28 -05:00
|
|
|
}
|
|
|
|
}
|
2015-11-30 07:32:34 -06:00
|
|
|
|
|
|
|
this->sortWellsByName();
|
2019-09-18 10:41:03 -05:00
|
|
|
updateAllRequiredEditors();
|
2017-10-20 07:05:42 -05:00
|
|
|
|
2019-10-09 02:21:28 -05:00
|
|
|
return logFileInfos;
|
2015-09-14 09:33:28 -05:00
|
|
|
}
|
|
|
|
|
2017-11-24 03:01:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-24 03:01:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellPathCollection::addWellPathFormations( const QStringList& filePaths )
|
2017-11-24 03:01:05 -06:00
|
|
|
{
|
2017-12-07 01:34:12 -06:00
|
|
|
QString outputMessage = "Well Picks Import\n";
|
|
|
|
outputMessage += "-----------------------------------------------\n";
|
|
|
|
outputMessage += "Well Name \tDetected Well Path \tCount\n";
|
|
|
|
|
2017-12-08 02:27:30 -06:00
|
|
|
bool fileReadSuccess = false;
|
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const QString& filePath : filePaths )
|
2017-11-24 03:01:05 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<QString, cvf::ref<RigWellPathFormations>> newFormations =
|
|
|
|
m_wellPathFormationsImporter->readWellPathFormationsFromPath( filePath );
|
2017-11-27 03:33:41 -06:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& newFormation : newFormations )
|
2017-11-24 03:01:05 -06:00
|
|
|
{
|
2017-12-08 02:27:30 -06:00
|
|
|
fileReadSuccess = true;
|
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
RimWellPath* wellPath = tryFindMatchingWellPath( newFormation.first );
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !wellPath )
|
2017-11-24 03:01:05 -06:00
|
|
|
{
|
|
|
|
wellPath = new RimWellPath();
|
2023-03-07 05:51:14 -06:00
|
|
|
wellPath->setName( newFormation.first );
|
|
|
|
addWellPath( wellPath );
|
2019-09-06 03:40:57 -05:00
|
|
|
RiaLogging::info( QString( "Created new well: %1" ).arg( wellPath->name() ) );
|
2017-11-24 03:01:05 -06:00
|
|
|
}
|
2023-03-07 05:51:14 -06:00
|
|
|
wellPath->setFormationsGeometry( newFormation.second );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
QString wellFormationsCount = QString( "%1" ).arg( newFormation.second->formationNamesCount() );
|
2017-12-07 01:34:12 -06:00
|
|
|
|
2018-01-29 04:24:12 -06:00
|
|
|
m_mostRecentlyUpdatedWellPath = wellPath;
|
2017-12-07 01:34:12 -06:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
outputMessage += newFormation.first + "\t\t";
|
2017-12-07 01:34:12 -06:00
|
|
|
outputMessage += wellPath->name() + " \t\t\t";
|
|
|
|
outputMessage += wellFormationsCount + "\n";
|
2017-11-24 03:01:05 -06:00
|
|
|
}
|
|
|
|
}
|
2017-12-07 01:34:12 -06:00
|
|
|
outputMessage += "-----------------------------------------------";
|
2017-12-08 02:27:30 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fileReadSuccess )
|
2017-12-08 02:27:30 -06:00
|
|
|
{
|
2020-10-13 04:19:51 -05:00
|
|
|
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Well Picks Import", outputMessage );
|
2017-12-08 02:27:30 -06:00
|
|
|
}
|
2017-11-24 03:01:05 -06:00
|
|
|
|
2017-11-27 03:33:41 -06:00
|
|
|
this->sortWellsByName();
|
2019-09-18 10:41:03 -05:00
|
|
|
updateAllRequiredEditors();
|
2017-11-24 03:01:05 -06:00
|
|
|
}
|
|
|
|
|
2013-10-17 06:37:59 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-10-17 06:37:59 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellPathCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2013-10-17 06:37:59 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* wellHeadGroup = uiOrdering.addNewGroup( "Well labels" );
|
|
|
|
wellHeadGroup->add( &showWellPathLabel );
|
|
|
|
wellHeadGroup->add( &wellPathLabelColor );
|
2013-10-17 06:37:59 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* wellPipe = uiOrdering.addNewGroup( "Well pipe" );
|
|
|
|
wellPipe->add( &wellPathVisibility );
|
|
|
|
wellPipe->add( &wellPathRadiusScaleFactor );
|
2013-10-17 06:37:59 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup( "Clipping" );
|
|
|
|
advancedGroup->add( &wellPathClip );
|
|
|
|
advancedGroup->add( &wellPathClipZDistance );
|
2013-10-17 06:37:59 -05:00
|
|
|
}
|
|
|
|
|
2020-01-10 03:00:08 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
|
|
|
{
|
2020-01-11 01:05:03 -06:00
|
|
|
if ( !m_wellMeasurements->isEmpty() )
|
2020-01-10 03:00:08 -06:00
|
|
|
{
|
2020-01-11 01:05:03 -06:00
|
|
|
uiTreeOrdering.add( &m_wellMeasurements );
|
2020-01-10 03:00:08 -06:00
|
|
|
}
|
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
for ( const auto& wellPathNode : m_wellPathNodes() )
|
2020-01-10 03:00:08 -06:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
RimWellPathCollection::buildUiTreeOrdering( wellPathNode, &uiTreeOrdering, uiConfigName );
|
2020-01-10 03:00:08 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
uiTreeOrdering.skipRemainingChildren( true );
|
|
|
|
}
|
|
|
|
|
2013-10-22 08:30:12 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-10-22 08:30:12 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
|
|
|
|
{
|
|
|
|
return &isActive;
|
|
|
|
}
|
|
|
|
|
2013-10-23 01:07:11 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-10-23 01:07:11 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-06-21 10:13:19 -05:00
|
|
|
void RimWellPathCollection::scheduleRedrawAffectedViews()
|
2013-10-23 01:07:11 -05:00
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
RimProject* proj = RimProject::current();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( proj ) proj->reloadCompletionTypeResultsInAllViews();
|
2013-10-23 01:07:11 -05:00
|
|
|
}
|
|
|
|
|
2018-01-31 08:34:50 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-01-31 08:34:50 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellPathCollection::anyWellsContainingPerforationIntervals() const
|
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& wellPath : m_wellPaths )
|
2018-01-31 08:34:50 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !wellPath->perforationIntervalCollection()->perforations().empty() ) return true;
|
2018-01-31 08:34:50 -06:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-08-14 06:22:42 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-08-14 06:22:42 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
size_t RimWellPathCollection::modelledWellPathCount() const
|
|
|
|
{
|
|
|
|
size_t count = 0;
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& wellPath : m_wellPaths )
|
2018-08-14 06:22:42 -05:00
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
if ( dynamic_cast<const RimModeledWellPath*>( wellPath.p() ) )
|
2018-08-14 06:22:42 -05:00
|
|
|
{
|
|
|
|
count++;
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
}
|
2018-08-14 06:22:42 -05:00
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2015-09-14 10:05:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-14 10:05:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellPath* RimWellPathCollection::wellPathByName( const QString& wellPathName ) const
|
2015-09-14 10:05:28 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& wellPath : m_wellPaths )
|
2015-09-14 10:05:28 -05:00
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
if ( wellPath->name() == wellPathName )
|
2015-09-14 10:05:28 -05:00
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
return wellPath;
|
2015-09-14 10:05:28 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-27 08:01:55 -05:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-27 08:01:55 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellPath* RimWellPathCollection::tryFindMatchingWellPath( const QString& wellName ) const
|
2017-10-27 08:01:55 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString matchedWellPath = RiaWellNameComparer::tryFindMatchingWellPath( wellName );
|
2017-10-27 08:01:55 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return !matchedWellPath.isEmpty() ? wellPathByName( matchedWellPath ) : nullptr;
|
2015-09-14 10:05:28 -05:00
|
|
|
}
|
|
|
|
|
2013-06-24 15:04:52 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-06-24 15:04:52 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-10-29 07:12:55 -05:00
|
|
|
void RimWellPathCollection::deleteAllWellPaths()
|
|
|
|
{
|
2022-05-31 06:08:07 -05:00
|
|
|
m_wellPaths.deleteChildren();
|
|
|
|
m_wellPathNodes.deleteChildren();
|
2015-10-29 07:12:55 -05:00
|
|
|
|
2017-05-10 05:19:46 -05:00
|
|
|
m_wellPathImporter->clear();
|
2019-09-18 10:41:03 -05:00
|
|
|
updateAllRequiredEditors();
|
2015-10-29 07:12:55 -05:00
|
|
|
}
|
|
|
|
|
2021-08-13 09:48:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathCollection::deleteWell( RimWellPath* wellPath )
|
|
|
|
{
|
2022-11-04 04:11:08 -05:00
|
|
|
removeWellPath( wellPath );
|
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
m_wellPaths.removeChild( wellPath );
|
2021-08-13 09:48:33 -05:00
|
|
|
delete wellPath;
|
|
|
|
}
|
|
|
|
|
2017-11-29 01:42:37 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-10-19 07:53:38 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-05-10 08:12:29 -05:00
|
|
|
void RimWellPathCollection::groupWellPaths( const std::vector<RimWellPath*>& wellPaths )
|
2020-10-19 07:53:38 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
const auto& rootWells = wellPathsForWellNameStem( wellPaths );
|
2020-10-22 01:19:00 -05:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& [groupName, wellPathsInGroup] : rootWells )
|
2020-10-22 01:19:00 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
if ( groupName == unGroupedText() ) continue;
|
2021-02-26 07:27:59 -06:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& wellPathToConnect : wellPathsInGroup )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
2021-05-11 00:43:18 -05:00
|
|
|
// Assign the group names as well name for export
|
2023-03-07 05:51:14 -06:00
|
|
|
wellPathToConnect->completionSettings()->setWellNameForExport( groupName );
|
2021-05-11 00:43:18 -05:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
const auto wellPathGeometry = wellPathToConnect->wellPathGeometry();
|
2021-05-10 08:12:29 -05:00
|
|
|
if ( wellPathGeometry )
|
2020-10-22 01:19:00 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
std::map<RimWellPath*, double> sharedWellPathLengths;
|
2020-10-20 06:46:05 -05:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& otherWellPath : wellPathsInGroup )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
if ( otherWellPath == wellPathToConnect ) continue;
|
2021-01-04 04:09:01 -06:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
if ( otherWellPath && otherWellPath->wellPathGeometry() )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
const double sharedWellPathLength = otherWellPath->wellPathGeometry()->identicalTubeLength( *wellPathGeometry );
|
|
|
|
const double eps = 1.0e-2;
|
|
|
|
if ( sharedWellPathLength > eps )
|
|
|
|
{
|
|
|
|
sharedWellPathLengths[otherWellPath] = sharedWellPathLength;
|
|
|
|
}
|
2021-05-10 08:12:29 -05:00
|
|
|
}
|
|
|
|
}
|
2021-01-04 04:09:01 -06:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
RimWellPath* longestSharedWellPath = nullptr;
|
|
|
|
double longestSharedWellPathLength = 0.0;
|
|
|
|
for ( const auto& [wellPathCandidate, sharedWellPathLength] : sharedWellPathLengths )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
if ( wellPathCandidate )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
const double distanceDifference = fabs( sharedWellPathLength - longestSharedWellPathLength );
|
|
|
|
|
|
|
|
const double differenceThreshold = 1.0;
|
|
|
|
if ( longestSharedWellPath && ( distanceDifference < differenceThreshold ) )
|
|
|
|
{
|
|
|
|
// If the main well is named WELL_A, each side steps of a MSW can be given the following names
|
|
|
|
// WELL_A_Y1
|
|
|
|
// WELL_A_Y2
|
|
|
|
// WELL_A_Y3
|
|
|
|
//
|
|
|
|
// If Y3 has equal shared geometry with both Y2 and Y1, make sure that Y3 is connected to Y1.
|
|
|
|
if ( wellPathCandidate->name() < longestSharedWellPath->name() )
|
|
|
|
{
|
|
|
|
longestSharedWellPath = wellPathCandidate;
|
|
|
|
longestSharedWellPathLength = sharedWellPathLength;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( sharedWellPathLength > longestSharedWellPathLength )
|
|
|
|
{
|
|
|
|
longestSharedWellPath = wellPathCandidate;
|
|
|
|
longestSharedWellPathLength = sharedWellPathLength;
|
|
|
|
}
|
2021-05-10 08:12:29 -05:00
|
|
|
}
|
|
|
|
}
|
2021-01-04 04:09:01 -06:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
if ( longestSharedWellPath )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
if ( wellPathToConnect->name() > longestSharedWellPath->name() )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
wellPathToConnect->connectWellPaths( longestSharedWellPath, longestSharedWellPathLength );
|
2021-05-10 08:12:29 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-03-07 05:51:14 -06:00
|
|
|
longestSharedWellPath->connectWellPaths( wellPathToConnect, longestSharedWellPathLength );
|
2021-05-10 08:12:29 -05:00
|
|
|
}
|
|
|
|
}
|
2020-10-22 01:19:00 -05:00
|
|
|
}
|
|
|
|
}
|
2020-10-20 06:01:46 -05:00
|
|
|
}
|
2020-10-19 07:53:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-29 01:42:37 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-29 04:24:12 -06:00
|
|
|
RimWellPath* RimWellPathCollection::mostRecentlyUpdatedWellPath()
|
2017-11-29 01:42:37 -06:00
|
|
|
{
|
2018-01-29 04:24:12 -06:00
|
|
|
return m_mostRecentlyUpdatedWellPath;
|
2017-11-29 01:42:37 -06:00
|
|
|
}
|
|
|
|
|
2017-11-24 03:01:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-24 03:01:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathCollection::readWellPathFormationFiles()
|
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
caf::ProgressInfo progress( m_wellPaths.size(), "Reading well picks from file" );
|
2017-11-24 03:01:05 -06:00
|
|
|
|
2020-10-06 08:00:39 -05:00
|
|
|
for ( size_t wpIdx = 0; wpIdx < m_wellPaths.size(); wpIdx++ )
|
2017-11-24 03:01:05 -06:00
|
|
|
{
|
2017-11-27 03:33:41 -06:00
|
|
|
QString errorMessage;
|
2020-10-06 08:00:39 -05:00
|
|
|
if ( !m_wellPaths[wpIdx]->readWellPathFormationsFile( &errorMessage, m_wellPathFormationsImporter.get() ) )
|
2017-11-24 03:01:05 -06:00
|
|
|
{
|
2020-10-13 04:19:51 -05:00
|
|
|
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
|
2017-11-24 03:01:05 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
progress.setProgressDescription( QString( "Reading formation file %1" ).arg( wpIdx ) );
|
2017-11-24 03:01:05 -06:00
|
|
|
progress.incrementProgress();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-06 05:01:15 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-12-06 05:01:15 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathCollection::reloadAllWellPathFormations()
|
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
caf::ProgressInfo progress( m_wellPaths.size(), "Reloading well picks from file" );
|
2017-12-06 05:01:15 -06:00
|
|
|
|
2023-03-07 05:51:14 -06:00
|
|
|
for ( const auto& wellPath : m_wellPaths )
|
2017-12-06 05:01:15 -06:00
|
|
|
{
|
|
|
|
QString errorMessage;
|
2020-10-06 08:00:39 -05:00
|
|
|
if ( !wellPath->reloadWellPathFormationsFile( &errorMessage, m_wellPathFormationsImporter.get() ) )
|
2017-12-06 05:01:15 -06:00
|
|
|
{
|
2020-10-13 04:19:51 -05:00
|
|
|
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
|
2017-12-06 05:01:15 -06:00
|
|
|
}
|
|
|
|
|
2020-10-06 08:00:39 -05:00
|
|
|
progress.setProgressDescription( QString( "Reloading formation file for %1" ).arg( wellPath->name() ) );
|
2017-12-06 05:01:15 -06:00
|
|
|
progress.incrementProgress();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-29 07:12:55 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-29 07:12:55 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-11-04 04:11:08 -05:00
|
|
|
void RimWellPathCollection::removeWellPath( gsl::not_null<RimWellPath*> wellToRemove )
|
2015-10-29 07:12:55 -05:00
|
|
|
{
|
2022-11-04 04:11:08 -05:00
|
|
|
auto* fileWellToRemove = dynamic_cast<RimFileWellPath*>( wellToRemove.get() );
|
|
|
|
if ( fileWellToRemove )
|
2015-10-29 07:12:55 -05:00
|
|
|
{
|
2018-06-20 01:55:27 -05:00
|
|
|
bool isFilePathUsed = false;
|
2022-11-04 04:11:08 -05:00
|
|
|
for ( const auto& well : m_wellPaths )
|
2015-10-29 07:12:55 -05:00
|
|
|
{
|
2022-11-04 04:11:08 -05:00
|
|
|
auto fileWell = dynamic_cast<RimFileWellPath*>( well.p() );
|
|
|
|
if ( fileWell == fileWellToRemove ) continue;
|
|
|
|
|
|
|
|
if ( fileWell && fileWell->filePath() == fileWellToRemove->filePath() )
|
2018-06-20 01:55:27 -05:00
|
|
|
{
|
|
|
|
isFilePathUsed = true;
|
|
|
|
break;
|
|
|
|
}
|
2015-10-29 07:12:55 -05:00
|
|
|
}
|
|
|
|
|
2018-06-20 01:55:27 -05:00
|
|
|
if ( !isFilePathUsed )
|
|
|
|
{
|
|
|
|
// One file can have multiple well paths
|
|
|
|
// If no other well paths are referencing the filepath, remove cached data from the file reader
|
2022-11-04 04:11:08 -05:00
|
|
|
m_wellPathImporter->removeFilePath( fileWellToRemove->filePath() );
|
2018-06-20 01:55:27 -05:00
|
|
|
}
|
2015-10-29 07:12:55 -05:00
|
|
|
}
|
2019-09-18 10:41:03 -05:00
|
|
|
updateAllRequiredEditors();
|
2015-10-29 07:12:55 -05:00
|
|
|
}
|
|
|
|
|
2017-06-07 04:57:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-06-07 04:57:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool lessWellPath( const caf::PdmPointer<RimWellPath>& w1, const caf::PdmPointer<RimWellPath>& w2 )
|
2015-11-30 07:32:34 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( w1.notNull() && w2.notNull() )
|
2021-06-28 07:17:46 -05:00
|
|
|
{
|
|
|
|
// Use QCollator to sort integer values in addition to text
|
|
|
|
|
|
|
|
QCollator collator;
|
|
|
|
collator.setNumericMode( true );
|
|
|
|
return collator.compare( w1->name(), w2->name() ) < 0;
|
|
|
|
}
|
2023-03-07 05:51:14 -06:00
|
|
|
|
|
|
|
if ( w1.notNull() ) return true;
|
|
|
|
|
|
|
|
return false;
|
2015-11-30 07:32:34 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-11-30 07:32:34 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathCollection::sortWellsByName()
|
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
std::sort( m_wellPaths.begin(), m_wellPaths.end(), lessWellPath );
|
2015-11-30 07:32:34 -06:00
|
|
|
}
|
2017-06-07 04:57:25 -05:00
|
|
|
|
2020-10-16 00:36:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-05-10 08:12:29 -05:00
|
|
|
caf::AppEnum<RiaDefines::EclipseUnitSystem> RimWellPathCollection::findUnitSystemForWellPath( const RimWellPath* wellPath )
|
2020-10-16 00:36:29 -05:00
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
RimProject* project = RimProject::current();
|
2021-05-10 08:12:29 -05:00
|
|
|
if ( project->activeOilField()->analysisModels->cases.empty() )
|
|
|
|
{
|
|
|
|
return RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
const RigEclipseCaseData* eclipseCaseData = project->activeOilField()->analysisModels->cases()[0]->eclipseCaseData();
|
|
|
|
cvf::BoundingBox caseBoundingBox = eclipseCaseData->mainGrid()->boundingBox();
|
|
|
|
cvf::BoundingBox wellPathBoundingBox;
|
|
|
|
for ( const auto& wellPathPoint : wellPath->wellPathGeometry()->wellPathPoints() )
|
|
|
|
{
|
|
|
|
wellPathBoundingBox.add( wellPathPoint );
|
|
|
|
}
|
|
|
|
|
2021-05-27 02:19:24 -05:00
|
|
|
if ( wellPathBoundingBox.isValid() && caseBoundingBox.isValid() && caseBoundingBox.intersects( wellPathBoundingBox ) )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
|
|
|
return eclipseCaseData->unitsType();
|
|
|
|
}
|
2021-05-27 02:19:24 -05:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
return RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathCollection::rebuildWellPathNodes()
|
|
|
|
{
|
2022-05-31 06:08:07 -05:00
|
|
|
m_wellPathNodes.deleteChildren();
|
2021-05-10 08:12:29 -05:00
|
|
|
|
2023-05-12 14:41:34 -05:00
|
|
|
std::map<QString, std::vector<RimWellPath*>> rootWells = wellPathsForWellNameStem( m_wellPaths.childrenByType() );
|
2021-05-10 08:12:29 -05:00
|
|
|
for ( auto [groupName, wellPathGroup] : rootWells )
|
2020-10-16 00:36:29 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
if ( groupName == unGroupedText() )
|
|
|
|
{
|
|
|
|
// For single wells, create well paths directly in the well collection folder
|
|
|
|
|
|
|
|
for ( auto wellPath : wellPathGroup )
|
|
|
|
{
|
|
|
|
if ( !wellPath ) continue;
|
|
|
|
if ( !wellPath->isTopLevelWellPath() ) continue;
|
|
|
|
|
|
|
|
auto node = addWellToWellNode( nullptr, wellPath );
|
|
|
|
m_wellPathNodes.push_back( node );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2020-10-16 00:36:29 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
// Create a group node with group name and put related wells into this group
|
|
|
|
|
|
|
|
auto rootNode = new cafNamedTreeNode;
|
|
|
|
rootNode->setName( groupName );
|
|
|
|
rootNode->setIcon( ":/WellPathGroup.svg" );
|
|
|
|
m_wellPathNodes.push_back( rootNode );
|
|
|
|
|
|
|
|
for ( auto wellPath : wellPathsWithNoParent( wellPathGroup ) )
|
|
|
|
{
|
|
|
|
if ( !wellPath ) continue;
|
|
|
|
|
|
|
|
addWellToWellNode( rootNode, wellPath );
|
|
|
|
}
|
2020-10-16 00:36:29 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-09 01:38:18 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-05-10 08:12:29 -05:00
|
|
|
cafTreeNode* RimWellPathCollection::addWellToWellNode( cafTreeNode* parent, RimWellPath* wellPath )
|
2020-10-09 01:38:18 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
if ( wellPath == nullptr ) return nullptr;
|
2020-10-20 08:15:46 -05:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
std::vector<RimWellPath*> wellPaths = connectedWellPathLaterals( wellPath );
|
2020-10-09 01:38:18 -05:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
auto node = new cafObjectReferenceTreeNode;
|
|
|
|
node->setReferencedObject( wellPath );
|
|
|
|
if ( parent ) parent->addChild( node );
|
2020-10-09 01:38:18 -05:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
for ( auto w : wellPaths )
|
2020-10-14 11:55:17 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
addWellToWellNode( node, w );
|
2020-10-09 01:38:18 -05:00
|
|
|
}
|
2020-10-07 06:53:36 -05:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimWellPath*> RimWellPathCollection::wellPathsWithNoParent( const std::vector<RimWellPath*>& sourceWellPaths ) const
|
|
|
|
{
|
|
|
|
std::vector<RimWellPath*> wellPaths;
|
|
|
|
|
|
|
|
for ( const auto& w : sourceWellPaths )
|
2020-10-14 11:55:17 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
if ( !w ) continue;
|
|
|
|
|
|
|
|
if ( w->isTopLevelWellPath() )
|
2020-10-14 11:55:17 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
wellPaths.push_back( w );
|
2020-10-14 11:55:17 -05:00
|
|
|
}
|
|
|
|
}
|
2020-10-07 06:53:36 -05:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
return wellPaths;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimWellPath*> RimWellPathCollection::connectedWellPathLaterals( const RimWellPath* parentWellPath ) const
|
|
|
|
{
|
|
|
|
if ( !parentWellPath ) return {};
|
|
|
|
|
|
|
|
std::vector<RimWellPath*> wellPaths;
|
|
|
|
|
|
|
|
for ( const auto& w : m_wellPaths )
|
2020-10-14 11:55:17 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
if ( !w ) continue;
|
2020-10-14 11:55:17 -05:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
if ( w->wellPathTieIn() && ( w->wellPathTieIn()->parentWell() == parentWellPath ) )
|
2020-10-07 06:53:36 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
wellPaths.push_back( w );
|
2020-10-07 06:53:36 -05:00
|
|
|
}
|
|
|
|
}
|
2021-05-10 08:12:29 -05:00
|
|
|
|
|
|
|
return wellPaths;
|
2020-10-07 06:53:36 -05:00
|
|
|
}
|
|
|
|
|
2017-06-07 04:57:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-06-07 04:57:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-05-10 08:12:29 -05:00
|
|
|
std::map<QString, std::vector<RimWellPath*>>
|
|
|
|
RimWellPathCollection::wellPathsForWellNameStem( const std::vector<RimWellPath*>& sourceWellPaths ) const
|
2017-06-07 04:57:25 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
std::map<QString, std::vector<RimWellPath*>> rootWells;
|
|
|
|
|
|
|
|
QString multiLateralWellPathPattern = RiaPreferences::current()->multiLateralWellNamePattern();
|
|
|
|
QRegExp re( multiLateralWellPathPattern, Qt::CaseInsensitive, QRegExp::Wildcard );
|
|
|
|
|
|
|
|
for ( auto wellPath : sourceWellPaths )
|
2017-06-07 04:57:25 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
QString name = wellPath->name();
|
|
|
|
if ( re.exactMatch( name ) )
|
|
|
|
{
|
|
|
|
int indexOfLateralStart = name.indexOf( 'Y' );
|
|
|
|
if ( indexOfLateralStart > 0 )
|
|
|
|
{
|
|
|
|
QString rootWellName = wellPath->name().left( indexOfLateralStart );
|
|
|
|
|
|
|
|
rootWells[rootWellName].push_back( wellPath );
|
2021-06-24 06:17:43 -05:00
|
|
|
continue;
|
2021-05-10 08:12:29 -05:00
|
|
|
}
|
|
|
|
}
|
2021-06-24 06:17:43 -05:00
|
|
|
|
|
|
|
rootWells[RimWellPathCollection::unGroupedText()].push_back( wellPath );
|
2017-06-07 04:57:25 -05:00
|
|
|
}
|
|
|
|
|
2021-06-28 07:17:46 -05:00
|
|
|
for ( auto [groupName, wellPaths] : rootWells )
|
|
|
|
{
|
|
|
|
std::sort( wellPaths.begin(), wellPaths.end(), lessWellPath );
|
|
|
|
}
|
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
return rootWells;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
void RimWellPathCollection::buildUiTreeOrdering( cafTreeNode* treeNode, caf::PdmUiTreeOrdering* parentUiTreeNode, const QString& uiConfigName )
|
2021-05-10 08:12:29 -05:00
|
|
|
{
|
|
|
|
CAF_ASSERT( treeNode );
|
|
|
|
CAF_ASSERT( parentUiTreeNode );
|
|
|
|
|
|
|
|
if ( auto obj = treeNode->referencedObject() )
|
2017-06-07 04:57:25 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
// Create the standard uiTreeOrdering with no relationship to parent using the helper function in
|
|
|
|
// PdmUiObjectHandle. This will ensure that any child objects will be created correctly including any
|
|
|
|
// recursive children. If a PdmUiTreeOrdering is created directly based on the PdmObject, andy child objects
|
|
|
|
// must be added manually.
|
2017-06-07 04:57:25 -05:00
|
|
|
|
2021-05-10 08:12:29 -05:00
|
|
|
auto uiTreeNode = obj->uiCapability()->uiTreeOrdering( uiConfigName );
|
|
|
|
parentUiTreeNode->appendChild( uiTreeNode );
|
|
|
|
|
|
|
|
// Build additional child nodes recursively
|
|
|
|
for ( auto childNode : treeNode->childNodes() )
|
|
|
|
{
|
|
|
|
buildUiTreeOrdering( childNode, uiTreeNode, uiConfigName );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2017-06-07 04:57:25 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
// If no referenced object is attached, fallback to the node. Not sure if this is the best solution
|
|
|
|
auto uiTreeNode = parentUiTreeNode->add( treeNode );
|
|
|
|
|
|
|
|
// Build additional child nodes recursively
|
|
|
|
for ( auto childNode : treeNode->childNodes() )
|
|
|
|
{
|
|
|
|
buildUiTreeOrdering( childNode, uiTreeNode, uiConfigName );
|
|
|
|
}
|
2017-06-07 04:57:25 -05:00
|
|
|
}
|
2021-05-10 08:12:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimWellPathCollection::unGroupedText()
|
|
|
|
{
|
|
|
|
return "UnGrouped";
|
2017-06-07 04:57:25 -05:00
|
|
|
}
|
2019-11-25 05:18:39 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellMeasurementCollection* RimWellPathCollection::measurementCollection()
|
|
|
|
{
|
|
|
|
return m_wellMeasurements;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const RimWellMeasurementCollection* RimWellPathCollection::measurementCollection() const
|
|
|
|
{
|
|
|
|
return m_wellMeasurements;
|
|
|
|
}
|
2020-05-18 09:02:27 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
void RimWellPathCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects )
|
2020-05-18 09:02:27 -05:00
|
|
|
{
|
2021-05-10 08:12:29 -05:00
|
|
|
rebuildWellPathNodes();
|
|
|
|
|
2020-05-18 09:02:27 -05:00
|
|
|
scheduleRedrawAffectedViews();
|
|
|
|
uiCapability()->updateConnectedEditors();
|
|
|
|
}
|
2021-06-25 07:18:36 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathCollection::onChildAdded( caf::PdmFieldHandle* containerForNewObject )
|
|
|
|
{
|
|
|
|
rebuildWellPathNodes();
|
|
|
|
|
|
|
|
scheduleRedrawAffectedViews();
|
|
|
|
uiCapability()->updateConnectedEditors();
|
|
|
|
}
|