Files
ResInsight/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp
T

114 lines
4.7 KiB
C++
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
2017-05-16 12:49:36 +02:00
// Copyright (C) 2017 Statoil ASA
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewFishbonesSubsAtMeasuredDepthFeature.h"
2025-11-07 12:26:42 +01:00
#include "RiaLogging.h"
#include "RicFishbonesCreateHelper.h"
#include "RicNewFishbonesSubsFeature.h"
2017-06-07 11:57:25 +02:00
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
#include "RimFishbones.h"
#include "RimFishbonesCollection.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "Riu3DMainWindowTools.h"
#include "Riu3dSelectionManager.h"
#include "cafSelectionManager.h"
#include <QAction>
#include <QMenu>
CAF_CMD_SOURCE_INIT( RicNewFishbonesSubsAtMeasuredDepthFeature, "RicNewFishbonesSubsAtMeasuredDepthFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered( bool isChecked )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook( QAction* actionToSetup )
{
2025-11-07 12:26:42 +01:00
RicFishbonesCreateHelper::setupFishbonesSubMenu( actionToSetup, "Create Fishbones at this Depth" );
2025-11-07 12:26:42 +01:00
QMenu* subMenu = actionToSetup->menu();
auto actions = subMenu->actions();
2025-11-07 12:26:42 +01:00
if ( actions.size() < 3 )
{
2025-11-07 12:26:42 +01:00
RiaLogging::error( "RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook: Unexpected number of actions in submenu." );
return;
}
2025-11-07 12:26:42 +01:00
connect( actions[0], &QAction::triggered, this, &RicNewFishbonesSubsAtMeasuredDepthFeature::onDrillingStandard );
connect( actions[1], &QAction::triggered, this, &RicNewFishbonesSubsAtMeasuredDepthFeature::onDrillingExtended );
connect( actions[2], &QAction::triggered, this, &RicNewFishbonesSubsAtMeasuredDepthFeature::onAcidJetting );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewFishbonesSubsAtMeasuredDepthFeature::isCommandEnabled() const
{
return RiuWellPathSelectionItem::wellPathSelectionItem() != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2025-03-25 08:31:08 +01:00
void RicNewFishbonesSubsAtMeasuredDepthFeature::createFishbones( const RimFishbonesDefines::RicFishbonesSystemParameters& customParameters )
{
RiuWellPathSelectionItem* wellPathSelItem = RiuWellPathSelectionItem::wellPathSelectionItem();
CVF_ASSERT( wellPathSelItem );
RimWellPath* wellPath = wellPathSelItem->m_wellpath;
CVF_ASSERT( wellPath );
2017-06-07 11:57:25 +02:00
2025-11-07 12:26:42 +01:00
RicFishbonesCreateHelper::createAndConfigureFishbones( wellPath->fishbonesCollection(), customParameters, wellPathSelItem->m_measuredDepth );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsAtMeasuredDepthFeature::onDrillingStandard()
{
2025-03-25 08:31:08 +01:00
createFishbones( RimFishbonesDefines::drillingStandardParameters() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsAtMeasuredDepthFeature::onDrillingExtended()
{
2025-03-25 08:31:08 +01:00
createFishbones( RimFishbonesDefines::drillingExtendedParameters() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsAtMeasuredDepthFeature::onAcidJetting()
{
2025-03-25 08:31:08 +01:00
createFishbones( RimFishbonesDefines::acidJettingParameters() );
}