2017-05-16 03:21:36 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2017-05-16 05:49:36 -05:00
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-05-16 03:21:36 -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
|
|
|
//
|
2017-05-16 03:21:36 -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>
|
2017-05-16 03:21:36 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RicNewFishbonesSubsAtMeasuredDepthFeature.h"
|
|
|
|
|
2017-05-20 13:21:19 -05:00
|
|
|
#include "RicNewFishbonesSubsFeature.h"
|
2017-06-07 04:57:25 -05:00
|
|
|
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
|
2017-05-20 13:21:19 -05:00
|
|
|
|
2021-02-26 07:27:59 -06:00
|
|
|
#include "RimFishbones.h"
|
2017-05-19 08:44:32 -05:00
|
|
|
#include "RimFishbonesCollection.h"
|
2017-05-16 03:21:36 -05:00
|
|
|
#include "RimProject.h"
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
|
2018-02-27 08:21:14 -06:00
|
|
|
#include "Riu3DMainWindowTools.h"
|
2018-11-30 05:53:46 -06:00
|
|
|
#include "Riu3dSelectionManager.h"
|
2017-05-16 03:21:36 -05:00
|
|
|
|
|
|
|
#include "cafSelectionManager.h"
|
|
|
|
|
|
|
|
#include <QAction>
|
2023-10-19 06:02:53 -05:00
|
|
|
#include <QMenu>
|
2017-05-16 03:21:36 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_CMD_SOURCE_INIT( RicNewFishbonesSubsAtMeasuredDepthFeature, "RicNewFishbonesSubsAtMeasuredDepthFeature" );
|
2017-05-16 03:21:36 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-05-16 03:21:36 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered( bool isChecked )
|
2023-10-19 06:02:53 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook( QAction* actionToSetup )
|
|
|
|
{
|
|
|
|
auto icon = QIcon( ":/FishBoneGroup16x16.png" );
|
|
|
|
actionToSetup->setIcon( icon );
|
|
|
|
actionToSetup->setText( "Create Fishbones at this Depth" );
|
|
|
|
|
|
|
|
auto subMenu = new QMenu;
|
|
|
|
|
|
|
|
{
|
|
|
|
auto action = subMenu->addAction( "Drilling Standard" );
|
|
|
|
action->setIcon( icon );
|
|
|
|
connect( action, &QAction::triggered, this, &RicNewFishbonesSubsAtMeasuredDepthFeature::onDrillingStandard );
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
auto action = subMenu->addAction( "Drilling Extended" );
|
|
|
|
action->setIcon( icon );
|
|
|
|
connect( action, &QAction::triggered, this, &RicNewFishbonesSubsAtMeasuredDepthFeature::onDrillingExtended );
|
|
|
|
}
|
|
|
|
{
|
|
|
|
auto action = subMenu->addAction( "Acid Jetting" );
|
|
|
|
action->setIcon( icon );
|
|
|
|
connect( action, &QAction::triggered, this, &RicNewFishbonesSubsAtMeasuredDepthFeature::onAcidJetting );
|
|
|
|
}
|
|
|
|
|
|
|
|
actionToSetup->setMenu( subMenu );
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RicNewFishbonesSubsAtMeasuredDepthFeature::isCommandEnabled() const
|
|
|
|
{
|
|
|
|
return RiuWellPathSelectionItem::wellPathSelectionItem() != nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicNewFishbonesSubsAtMeasuredDepthFeature::createFishbones( const RicFishbonesSystemParameters& customParameters )
|
2017-05-16 03:21:36 -05:00
|
|
|
{
|
2021-06-29 02:59:45 -05:00
|
|
|
RiuWellPathSelectionItem* wellPathSelItem = RiuWellPathSelectionItem::wellPathSelectionItem();
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( wellPathSelItem );
|
2017-05-16 03:21:36 -05:00
|
|
|
|
|
|
|
RimWellPath* wellPath = wellPathSelItem->m_wellpath;
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( wellPath );
|
2017-06-07 04:57:25 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
|
2017-05-16 03:21:36 -05:00
|
|
|
|
2023-10-19 06:02:53 -05:00
|
|
|
auto* obj = new RimFishbones;
|
2019-09-06 03:40:57 -05:00
|
|
|
wellPath->fishbonesCollection()->appendFishbonesSubs( obj );
|
2017-05-16 03:21:36 -05:00
|
|
|
|
2023-10-19 06:02:53 -05:00
|
|
|
obj->setSystemParameters( customParameters.lateralsPerSub,
|
|
|
|
customParameters.lateralLength,
|
|
|
|
customParameters.holeDiameter,
|
|
|
|
customParameters.buildAngle,
|
|
|
|
customParameters.icdsPerSub );
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
obj->setMeasuredDepthAndCount( wellPathSelItem->m_measuredDepth, 12.5, 13 );
|
2017-05-31 09:16:28 -05:00
|
|
|
|
2021-04-23 01:06:56 -05:00
|
|
|
RicNewFishbonesSubsFeature::adjustWellPathScaling( wellPath->fishbonesCollection() );
|
2017-05-20 13:21:19 -05:00
|
|
|
|
2017-05-16 03:21:36 -05:00
|
|
|
wellPath->updateConnectedEditors();
|
2019-09-06 03:40:57 -05:00
|
|
|
Riu3DMainWindowTools::selectAsCurrentItem( obj );
|
2017-05-16 03:21:36 -05:00
|
|
|
|
2023-05-12 14:41:34 -05:00
|
|
|
RimProject* proj = RimProject::current();
|
2017-06-02 03:35:52 -05:00
|
|
|
proj->reloadCompletionTypeResultsInAllViews();
|
2017-05-16 03:21:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-05-16 03:21:36 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-10-19 06:02:53 -05:00
|
|
|
void RicNewFishbonesSubsAtMeasuredDepthFeature::onDrillingStandard()
|
2017-05-16 03:21:36 -05:00
|
|
|
{
|
2023-10-19 06:02:53 -05:00
|
|
|
createFishbones( RicNewFishbonesSubsFeature::drillingStandardParameters() );
|
2017-05-16 03:21:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-05-16 03:21:36 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-10-19 06:02:53 -05:00
|
|
|
void RicNewFishbonesSubsAtMeasuredDepthFeature::onDrillingExtended()
|
2017-05-16 03:21:36 -05:00
|
|
|
{
|
2023-10-19 06:02:53 -05:00
|
|
|
createFishbones( RicNewFishbonesSubsFeature::drillingExtendedParameters() );
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicNewFishbonesSubsAtMeasuredDepthFeature::onAcidJetting()
|
|
|
|
{
|
|
|
|
createFishbones( RicNewFishbonesSubsFeature::acidJettingParameters() );
|
2017-05-16 03:21:36 -05:00
|
|
|
}
|