#1981 RFT Plot. Disabled several commands

This commit is contained in:
Bjørn Erik Jensen
2017-10-10 11:18:35 +02:00
parent ac10f21597
commit 886c1ea256
10 changed files with 26 additions and 6 deletions

View File

@@ -46,6 +46,7 @@ CAF_CMD_SOURCE_INIT(RicExportToLasFileFeature, "RicExportToLasFileFeature");
bool RicExportToLasFileFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
return RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves().size() > 0;
}

View File

@@ -28,6 +28,7 @@
#include "RimWellAllocationPlot.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RimWellRftPlot.h"
#include "cafPdmObject.h"
#include "cafPdmUiItem.h"
@@ -119,7 +120,9 @@ bool RicCopyReferencesToClipboardFeature::isAnyCopyableObjectSelected()
bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(caf::PdmObject* pdmObject)
{
RimWellAllocationPlot* wellAllocPlot = nullptr;
RimWellRftPlot* rftPlot = nullptr;
pdmObject->firstAncestorOrThisOfType(wellAllocPlot);
pdmObject->firstAncestorOrThisOfType(rftPlot);
if (dynamic_cast<RimGeoMechView*>(pdmObject))
{
@@ -139,7 +142,7 @@ bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(caf::PdmObject
}
else if (dynamic_cast<RimPlotCurve*>(pdmObject))
{
return true;
if(!rftPlot) return true;
}
else if (dynamic_cast<RimSummaryCurveFilter*>(pdmObject))
{
@@ -147,11 +150,11 @@ bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(caf::PdmObject
}
else if (dynamic_cast<RimWellLogTrack*>(pdmObject))
{
if (!wellAllocPlot) return true;
if (!wellAllocPlot && !rftPlot) return true;
}
else if (dynamic_cast<RimWellLogPlot*>(pdmObject))
{
if (!wellAllocPlot) return true;
if (!wellAllocPlot && !rftPlot) return true;
}
return false;

View File

@@ -47,6 +47,8 @@
#include "RimPerforationInterval.h"
#include "RimFlowCharacteristicsPlot.h"
#include "RimAsciiDataCurve.h"
#include "RimWellLogRftCurve.h"
#include "RimWellRftPlot.h"
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
#include "RimEllipseFractureTemplate.h"
@@ -80,9 +82,11 @@ bool isDeletable(caf::PdmUiItem* uiItem)
if (destinationObject)
{
RimWellAllocationPlot* wellAllocationPlot = nullptr;
RimWellRftPlot* rftPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(wellAllocationPlot);
destinationObject->firstAncestorOrThisOfType(rftPlot);
if (wellAllocationPlot)
if (wellAllocationPlot || rftPlot)
{
return false;
}

View File

@@ -38,6 +38,7 @@ CAF_CMD_SOURCE_INIT(RicChangeDataSourceFeature, "RicChangeDataSourceFeature");
bool RicChangeDataSourceFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
std::vector<RimWellLogExtractionCurve*> extrCurves = extractionCurves();

View File

@@ -54,6 +54,7 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogCurveExtractionFeature, "RicNewWellLogCurveExtr
bool RicNewWellLogCurveExtractionFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
int branchIndex;
return (RicWellLogTools::selectedWellLogPlotTrack() != nullptr || RicWellLogTools::selectedWellPath() != nullptr || RicWellLogTools::selectedSimulationWell(&branchIndex) != nullptr) && caseAvailable();
}

View File

@@ -50,6 +50,7 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogFileCurveFeature, "RicNewWellLogFileCurveFeatur
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogFileCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
return (RicWellLogTools::selectedWellLogPlotTrack() != nullptr && wellLogFilesAvailable()) || RicWellLogTools::selectedWellPathWithLogFile() != nullptr;
}

View File

@@ -38,7 +38,11 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogPlotTrackFeature, "RicNewWellLogPlotTrackFeatur
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogPlotTrackFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ||
RicWellLogPlotCurveFeatureImpl::parentWellRftPlot())
{
return false;
}
return selectedWellLogPlot() != NULL;
}

View File

@@ -47,6 +47,7 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogRftCurveFeature, "RicNewWellLogRftCurveFeature"
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogRftCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
if (RicWellLogTools::selectedWellLogPlotTrack() != nullptr)
{
return true;

View File

@@ -43,6 +43,7 @@ CAF_CMD_SOURCE_INIT(RicPasteWellLogCurveFeature, "RicPasteWellLogCurveFeature");
bool RicPasteWellLogCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());

View File

@@ -23,6 +23,7 @@
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RimWellRftPlot.h"
#include "cafPdmObjectGroup.h"
#include "cafPdmObjectHandle.h"
@@ -45,8 +46,10 @@ bool RicPasteWellLogTrackFeature::isCommandEnabled()
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimWellLogPlot* wellLogPlot = nullptr;
RimWellRftPlot* rftPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(wellLogPlot);
if (!wellLogPlot)
destinationObject->firstAncestorOrThisOfType(rftPlot);
if (!wellLogPlot || rftPlot)
{
return false;
}