mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added command feature for addition of a new trace to a well log plot
This commit is contained in:
parent
af9bbfdede
commit
0fdf5292d0
@ -44,6 +44,7 @@ ${CEE_CURRENT_LIST_DIR}RicCreateGridCaseGroupFeature.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RicNewStatisticsCaseFeature.h
|
${CEE_CURRENT_LIST_DIR}RicNewStatisticsCaseFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.h
|
${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotFeature.h
|
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotFeature.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotTraceFeature.h
|
||||||
|
|
||||||
${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.h
|
${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.h
|
${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.h
|
||||||
@ -94,6 +95,7 @@ ${CEE_CURRENT_LIST_DIR}RicCreateGridCaseGroupFeature.cpp
|
|||||||
${CEE_CURRENT_LIST_DIR}RicNewStatisticsCaseFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicNewStatisticsCaseFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotFeature.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotTraceFeature.cpp
|
||||||
|
|
||||||
${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.cpp
|
||||||
|
67
ApplicationCode/Commands/RicNewWellLogPlotTraceFeature.cpp
Normal file
67
ApplicationCode/Commands/RicNewWellLogPlotTraceFeature.cpp
Normal 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 "RicNewWellLogPlotTraceFeature.h"
|
||||||
|
|
||||||
|
#include "RimWellLogPlot.h"
|
||||||
|
|
||||||
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicNewWellLogPlotTraceFeature, "RicNewWellLogPlotTraceFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicNewWellLogPlotTraceFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
return selectedWellLogPlot() != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicNewWellLogPlotTraceFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
RimWellLogPlot* wellLogPlot = selectedWellLogPlot();
|
||||||
|
if (wellLogPlot)
|
||||||
|
{
|
||||||
|
wellLogPlot->addTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicNewWellLogPlotTraceFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setText("New Trace");
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellLogPlot* RicNewWellLogPlotTraceFeature::selectedWellLogPlot()
|
||||||
|
{
|
||||||
|
std::vector<RimWellLogPlot*> selection;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||||
|
return selection.size() > 0 ? selection[0] : NULL;
|
||||||
|
}
|
41
ApplicationCode/Commands/RicNewWellLogPlotTraceFeature.h
Normal file
41
ApplicationCode/Commands/RicNewWellLogPlotTraceFeature.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
class RimWellLogPlot;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicNewWellLogPlotTraceFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Overrides
|
||||||
|
virtual bool isCommandEnabled();
|
||||||
|
virtual void onActionTriggered( bool isChecked );
|
||||||
|
virtual void setupActionLook( QAction* actionToSetup );
|
||||||
|
|
||||||
|
private:
|
||||||
|
RimWellLogPlot* selectedWellLogPlot();
|
||||||
|
};
|
@ -552,6 +552,7 @@ void RimProject::computeUtmAreaOfInterest()
|
|||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
#include "RimEclipseCellColors.h"
|
#include "RimEclipseCellColors.h"
|
||||||
#include "RimEclipseFaultColors.h"
|
#include "RimEclipseFaultColors.h"
|
||||||
|
#include "RimWellLogPlot.h"
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
|
|
||||||
@ -722,6 +723,10 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
|
|||||||
{
|
{
|
||||||
commandIds << "RicDeleteItemFeature";
|
commandIds << "RicDeleteItemFeature";
|
||||||
}
|
}
|
||||||
|
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
|
||||||
|
{
|
||||||
|
commandIds << "RicNewWellLogPlotTraceFeature";
|
||||||
|
}
|
||||||
|
|
||||||
if (dynamic_cast<RimManagedViewCollection*>(uiItem))
|
if (dynamic_cast<RimManagedViewCollection*>(uiItem))
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
#include "RiuWellLogPlot.h"
|
#include "RiuWellLogPlot.h"
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
#include "cafPdmUiTreeView.h"
|
||||||
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimWellLogPlot, "WellLogPlot");
|
CAF_PDM_SOURCE_INIT(RimWellLogPlot, "WellLogPlot");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -92,3 +95,15 @@ caf::PdmFieldHandle* RimWellLogPlot::objectToggleField()
|
|||||||
{
|
{
|
||||||
return &showWindow;
|
return &showWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogPlot::addTrace()
|
||||||
|
{
|
||||||
|
RimWellLogPlotTrace* trace = new RimWellLogPlotTrace();
|
||||||
|
traces.push_back(trace);
|
||||||
|
|
||||||
|
RiuMainWindow::instance()->projectTreeView()->setExpanded(this, true);
|
||||||
|
updateConnectedEditors();
|
||||||
|
}
|
||||||
|
@ -40,6 +40,8 @@ public:
|
|||||||
RimWellLogPlot();
|
RimWellLogPlot();
|
||||||
virtual ~RimWellLogPlot();
|
virtual ~RimWellLogPlot();
|
||||||
|
|
||||||
|
void addTrace();
|
||||||
|
|
||||||
caf::PdmField<bool> showWindow;
|
caf::PdmField<bool> showWindow;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user