#7716 Ensemble Well Logs: Add context menu for curve set.

This commit is contained in:
Kristian Bendiksen 2021-06-28 14:25:35 +02:00
parent 4d780b4915
commit d79dcafe5a
6 changed files with 115 additions and 1 deletions

View File

@ -27,6 +27,7 @@ ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurveDeleteFeature.h
${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -57,6 +58,7 @@ ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurveDeleteFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.cpp
)
list(APPEND COMMAND_CODE_HEADER_FILES

View File

@ -0,0 +1,67 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// 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 "RicNewEnsembleWellLogCurveSetFeature.h"
#include "RimEnsembleWellLogCurveSet.h"
#include "RimWellLogTrack.h"
#include "RiuPlotMainWindow.h"
#include "RiuPlotMainWindowTools.h"
#include "cafSelectionManager.h"
#include <QAction>
#include <vector>
CAF_CMD_SOURCE_INIT( RicNewEnsembleWellLogCurveSetFeature, "RicNewEnsembleWellLogCurveSetFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewEnsembleWellLogCurveSetFeature::isCommandEnabled()
{
return caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>() != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewEnsembleWellLogCurveSetFeature::onActionTriggered( bool isChecked )
{
RimWellLogTrack* wellLogPlotTrack = caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>();
if ( wellLogPlotTrack )
{
RimEnsembleWellLogCurveSet* curveSet = new RimEnsembleWellLogCurveSet();
wellLogPlotTrack->setEnsembleWellLogCurveSet( curveSet );
wellLogPlotTrack->updateEditors();
RiuPlotMainWindowTools::selectAsCurrentItem( curveSet );
}
RiuPlotMainWindowTools::refreshToolbars();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewEnsembleWellLogCurveSetFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "New Ensemble Well Log Curve Set" );
actionToSetup->setIcon( QIcon( ":/EnsembleCurveSet16x16.png" ) );
}

View File

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Eqinor 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.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
//==================================================================================================
///
//==================================================================================================
class RicNewEnsembleWellLogCurveSetFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
private:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@ -610,6 +610,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
menuBuilder << "RicNewWellLogRftCurveFeature";
menuBuilder << "RicNewWellLogFileCurveFeature";
menuBuilder << "RicNewWellMeasurementCurveFeature";
menuBuilder << "RicNewEnsembleWellLogCurveSetFeature";
menuBuilder << "Separator";
menuBuilder << "RicDeleteSubPlotFeature";
}

View File

@ -276,7 +276,7 @@ RimWellLogTrack::RimWellLogTrack()
"",
"",
"" );
m_ensembleWellLogCurveSet = new RimEnsembleWellLogCurveSet;
m_ensembleWellLogCurveSet.uiCapability()->setUiHidden( true );
m_formationsForCaseWithSimWellOnly = false;
}
@ -3099,3 +3099,11 @@ void RimWellLogTrack::setCurvesTreeVisibility( bool isVisible )
{
m_curves.uiCapability()->setUiTreeChildrenHidden( !isVisible );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* curveSet )
{
m_ensembleWellLogCurveSet = curveSet;
}

View File

@ -233,6 +233,8 @@ public:
void setCurvesTreeVisibility( bool isVisible );
void setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* curveSet );
protected:
// RimViewWindow overrides
void deleteViewWidget() override;