mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1190 Make sure well log features are disabled for well allocation objects
This commit is contained in:
parent
b8e838614c
commit
4313409c57
@ -41,6 +41,8 @@ CAF_CMD_SOURCE_INIT(RicExportToLasFileFeature, "RicExportToLasFileFeature");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportToLasFileFeature::isCommandEnabled()
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
|
||||
|
||||
return RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves().size() > 0;
|
||||
}
|
||||
|
||||
@ -49,6 +51,8 @@ bool RicExportToLasFileFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
|
||||
|
||||
std::vector<RimWellLogCurve*> curves = RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves();
|
||||
if (curves.size() == 0) return;
|
||||
|
||||
|
@ -37,6 +37,8 @@ CAF_CMD_SOURCE_INIT(RicChangeDataSourceFeature, "RicChangeDataSourceFeature");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicChangeDataSourceFeature::isCommandEnabled()
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
|
||||
|
||||
std::vector<RimWellLogExtractionCurve*> extrCurves = extractionCurves();
|
||||
|
||||
return extrCurves.size() > 0;
|
||||
@ -47,6 +49,8 @@ bool RicChangeDataSourceFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicChangeDataSourceFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
|
||||
|
||||
std::vector<RimWellLogExtractionCurve*> extrCurves = extractionCurves();
|
||||
if (extrCurves.size() == 0) return;
|
||||
|
||||
|
@ -47,6 +47,8 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogCurveExtractionFeature, "RicNewWellLogCurveExtr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellLogCurveExtractionFeature::isCommandEnabled()
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
|
||||
|
||||
return (selectedWellLogPlotTrack() != NULL || selectedWellPath() != NULL) && caseAvailable();
|
||||
}
|
||||
|
||||
@ -55,6 +57,8 @@ bool RicNewWellLogCurveExtractionFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
|
||||
|
||||
RimWellLogTrack* wellLogPlotTrack = selectedWellLogPlotTrack();
|
||||
if (wellLogPlotTrack)
|
||||
{
|
||||
|
@ -19,11 +19,12 @@
|
||||
|
||||
#include "RicNewWellLogPlotTrackFeature.h"
|
||||
|
||||
#include "RicNewWellLogCurveExtractionFeature.h"
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RicNewWellLogCurveExtractionFeature.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -36,6 +37,8 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogPlotTrackFeature, "RicNewWellLogPlotTrackFeatur
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellLogPlotTrackFeature::isCommandEnabled()
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
|
||||
|
||||
return selectedWellLogPlot() != NULL;
|
||||
}
|
||||
|
||||
@ -44,6 +47,8 @@ bool RicNewWellLogPlotTrackFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
|
||||
|
||||
RimWellLogPlot* wellLogPlot = selectedWellLogPlot();
|
||||
if (wellLogPlot)
|
||||
{
|
||||
|
@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicPasteWellLogCurveFeature.h"
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
|
||||
|
||||
@ -41,6 +42,8 @@ CAF_CMD_SOURCE_INIT(RicPasteWellLogCurveFeature, "RicPasteWellLogCurveFeature");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicPasteWellLogCurveFeature::isCommandEnabled()
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
|
||||
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||
|
||||
RimWellLogTrack* wellLogTrack = nullptr;
|
||||
@ -58,6 +61,8 @@ bool RicPasteWellLogCurveFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicPasteWellLogCurveFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
|
||||
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||
|
||||
RimWellLogTrack* wellLogTrack = nullptr;
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "RicPasteWellLogTrackFeature.h"
|
||||
|
||||
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
@ -39,6 +40,8 @@ CAF_CMD_SOURCE_INIT(RicPasteWellLogTrackFeature, "RicPasteWellLogTrackFeature");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicPasteWellLogTrackFeature::isCommandEnabled()
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
|
||||
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||
|
||||
RimWellLogPlot* wellLogPlot = nullptr;
|
||||
@ -56,6 +59,8 @@ bool RicPasteWellLogTrackFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicPasteWellLogTrackFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
|
||||
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||
|
||||
RimWellLogPlot* wellLogPlot = nullptr;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
@ -92,3 +93,17 @@ std::vector<RimWellLogCurve*> RicWellLogPlotCurveFeatureImpl::selectedWellLogCur
|
||||
|
||||
return allCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlot* RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()
|
||||
{
|
||||
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||
if (!destinationObject) return nullptr;
|
||||
|
||||
RimWellAllocationPlot* wellAllocationPlot = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType(wellAllocationPlot);
|
||||
|
||||
return wellAllocationPlot;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
|
||||
class RimWellLogCurve;
|
||||
class RimWellAllocationPlot;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -31,4 +32,5 @@ class RicWellLogPlotCurveFeatureImpl
|
||||
public:
|
||||
static cvf::Color3f curveColorFromTable();
|
||||
static std::vector<RimWellLogCurve*> selectedWellLogCurves();
|
||||
static RimWellAllocationPlot* parentWellAllocationPlot();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user