mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added collection class for well log plots
This commit is contained in:
parent
75a34e605f
commit
af9bbfdede
@ -19,9 +19,11 @@
|
|||||||
|
|
||||||
#include "RicNewWellLogPlotFeature.h"
|
#include "RicNewWellLogPlotFeature.h"
|
||||||
|
|
||||||
|
#include "RimProject.h"
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
|
#include "RimWellLogPlotCollection.h"
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
@ -33,7 +35,7 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogPlotFeature, "RicNewWellLogPlotFeature");
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicNewWellLogPlotFeature::isCommandEnabled()
|
bool RicNewWellLogPlotFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
return selectedMainPlotCollection() != NULL;
|
return wellLogPlotCollection() != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -41,10 +43,10 @@ bool RicNewWellLogPlotFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked)
|
void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RimMainPlotCollection* mainPlotCollection = selectedMainPlotCollection();
|
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
|
||||||
if (mainPlotCollection)
|
if (wellLogPlotColl)
|
||||||
{
|
{
|
||||||
mainPlotCollection->addWellLogPlot();
|
wellLogPlotColl->addWellLogPlot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,9 +61,10 @@ void RicNewWellLogPlotFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimMainPlotCollection* RicNewWellLogPlotFeature::selectedMainPlotCollection()
|
RimWellLogPlotCollection* RicNewWellLogPlotFeature::wellLogPlotCollection()
|
||||||
{
|
{
|
||||||
std::vector<RimMainPlotCollection*> selection;
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
RimMainPlotCollection* mainPlotCollection = project ? project->mainPlotCollection() : NULL;
|
||||||
return selection.size() > 0 ? selection[0] : NULL;
|
|
||||||
|
return mainPlotCollection ? mainPlotCollection->wellLogPlotCollection() : NULL;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
class RimMainPlotCollection;
|
class RimWellLogPlotCollection;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -37,6 +37,5 @@ protected:
|
|||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
RimWellLogPlotCollection* wellLogPlotCollection();
|
||||||
RimMainPlotCollection* selectedMainPlotCollection();
|
|
||||||
};
|
};
|
||||||
|
@ -62,6 +62,7 @@ ${CEE_CURRENT_LIST_DIR}RimTreeViewStateSerializer.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RimManagedViewConfig.h
|
${CEE_CURRENT_LIST_DIR}RimManagedViewConfig.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimManagedViewCollection.h
|
${CEE_CURRENT_LIST_DIR}RimManagedViewCollection.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimMainPlotCollection.h
|
${CEE_CURRENT_LIST_DIR}RimMainPlotCollection.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCollection.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlot.h
|
${CEE_CURRENT_LIST_DIR}RimWellLogPlot.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotTrace.h
|
${CEE_CURRENT_LIST_DIR}RimWellLogPlotTrace.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCurve.h
|
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCurve.h
|
||||||
@ -125,6 +126,7 @@ ${CEE_CURRENT_LIST_DIR}RimTreeViewStateSerializer.cpp
|
|||||||
${CEE_CURRENT_LIST_DIR}RimManagedViewConfig.cpp
|
${CEE_CURRENT_LIST_DIR}RimManagedViewConfig.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimManagedViewCollection.cpp
|
${CEE_CURRENT_LIST_DIR}RimManagedViewCollection.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimMainPlotCollection.cpp
|
${CEE_CURRENT_LIST_DIR}RimMainPlotCollection.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCollection.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlot.cpp
|
${CEE_CURRENT_LIST_DIR}RimWellLogPlot.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotTrace.cpp
|
${CEE_CURRENT_LIST_DIR}RimWellLogPlotTrace.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCurve.cpp
|
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCurve.cpp
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimWellLogPlot.h"
|
#include "RimWellLogPlotCollection.h"
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
@ -36,8 +36,10 @@ RimMainPlotCollection::RimMainPlotCollection()
|
|||||||
CAF_PDM_InitField(&show, "Show", true, "Show plots", "", "", "");
|
CAF_PDM_InitField(&show, "Show", true, "Show plots", "", "", "");
|
||||||
show.uiCapability()->setUiHidden(true);
|
show.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&wellLogPlots, "WellLogPlots", "", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&wellLogPlotCollection, "WellLogPlotCollection", "", "", "", "");
|
||||||
wellLogPlots.uiCapability()->setUiHidden(true);
|
wellLogPlotCollection.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
|
wellLogPlotCollection = new RimWellLogPlotCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -45,6 +47,7 @@ RimMainPlotCollection::RimMainPlotCollection()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimMainPlotCollection::~RimMainPlotCollection()
|
RimMainPlotCollection::~RimMainPlotCollection()
|
||||||
{
|
{
|
||||||
|
if (wellLogPlotCollection()) delete wellLogPlotCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -61,15 +64,3 @@ caf::PdmFieldHandle* RimMainPlotCollection::objectToggleField()
|
|||||||
{
|
{
|
||||||
return &show;
|
return &show;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimMainPlotCollection::addWellLogPlot()
|
|
||||||
{
|
|
||||||
RimWellLogPlot* view = new RimWellLogPlot();
|
|
||||||
wellLogPlots.push_back(view);
|
|
||||||
|
|
||||||
RiuMainWindow::instance()->projectTreeView()->setExpanded(this, true);
|
|
||||||
updateConnectedEditors();
|
|
||||||
}
|
|
||||||
|
@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildField.h"
|
||||||
|
|
||||||
class RimWellLogPlot;
|
class RimWellLogPlotCollection;
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@ -37,7 +37,7 @@ public:
|
|||||||
RimMainPlotCollection();
|
RimMainPlotCollection();
|
||||||
virtual ~RimMainPlotCollection();
|
virtual ~RimMainPlotCollection();
|
||||||
|
|
||||||
void addWellLogPlot();
|
caf::PdmChildField<RimWellLogPlotCollection*> wellLogPlotCollection;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -49,5 +49,4 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<bool> show;
|
caf::PdmField<bool> show;
|
||||||
caf::PdmChildArrayField<RimWellLogPlot*> wellLogPlots;
|
|
||||||
};
|
};
|
||||||
|
@ -565,7 +565,11 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
|
|||||||
std::vector<caf::PdmUiItem*> uiItems;
|
std::vector<caf::PdmUiItem*> uiItems;
|
||||||
caf::SelectionManager::instance()->selectedItems(uiItems);
|
caf::SelectionManager::instance()->selectedItems(uiItems);
|
||||||
|
|
||||||
if (uiItems.size() > 1)
|
if (uiItems.size() == 0)
|
||||||
|
{
|
||||||
|
commandIds << "RicNewWellLogPlotFeature";
|
||||||
|
}
|
||||||
|
else if (uiItems.size() > 1)
|
||||||
{
|
{
|
||||||
commandIds << "RicCopyReferencesToClipboardFeature";
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
||||||
}
|
}
|
||||||
@ -718,10 +722,6 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
|
|||||||
{
|
{
|
||||||
commandIds << "RicDeleteItemFeature";
|
commandIds << "RicDeleteItemFeature";
|
||||||
}
|
}
|
||||||
else if (dynamic_cast<RimMainPlotCollection*>(uiItem))
|
|
||||||
{
|
|
||||||
commandIds << "RicNewWellLogPlotFeature";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dynamic_cast<RimManagedViewCollection*>(uiItem))
|
if (dynamic_cast<RimManagedViewCollection*>(uiItem))
|
||||||
{
|
{
|
||||||
|
@ -62,6 +62,7 @@ public:
|
|||||||
caf::PdmChildArrayField<RimOilField*> oilFields;
|
caf::PdmChildArrayField<RimOilField*> oilFields;
|
||||||
caf::PdmChildField<RimScriptCollection*> scriptCollection;
|
caf::PdmChildField<RimScriptCollection*> scriptCollection;
|
||||||
caf::PdmChildField<RimWellPathImport*> wellPathImport;
|
caf::PdmChildField<RimWellPathImport*> wellPathImport;
|
||||||
|
caf::PdmChildField<RimMainPlotCollection*> mainPlotCollection;
|
||||||
caf::PdmChildArrayField<RimCommandObject*> commandObjects;
|
caf::PdmChildArrayField<RimCommandObject*> commandObjects;
|
||||||
caf::PdmField<QString> treeViewState;
|
caf::PdmField<QString> treeViewState;
|
||||||
caf::PdmField<QString> currentModelIndexPath;
|
caf::PdmField<QString> currentModelIndexPath;
|
||||||
@ -104,6 +105,4 @@ private:
|
|||||||
|
|
||||||
caf::PdmChildArrayField<RimEclipseCase*> casesObsolete; // obsolete
|
caf::PdmChildArrayField<RimEclipseCase*> casesObsolete; // obsolete
|
||||||
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroupsObsolete; // obsolete
|
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroupsObsolete; // obsolete
|
||||||
|
|
||||||
caf::PdmChildField<RimMainPlotCollection*> mainPlotCollection;
|
|
||||||
};
|
};
|
||||||
|
@ -0,0 +1,75 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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 "RimWellLogPlotCollection.h"
|
||||||
|
#include "RimWellLogPlot.h"
|
||||||
|
|
||||||
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
#include "cafPdmUiTreeView.h"
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT(RimWellLogPlotCollection, "WellLogPlotCollection");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellLogPlotCollection::RimWellLogPlotCollection()
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject("Well Log Plots", "", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&show, "Show", true, "Show plots", "", "", "");
|
||||||
|
show.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&wellLogPlots, "WellLogPlots", "", "", "", "");
|
||||||
|
wellLogPlots.uiCapability()->setUiHidden(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellLogPlotCollection::~RimWellLogPlotCollection()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogPlotCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
caf::PdmFieldHandle* RimWellLogPlotCollection::objectToggleField()
|
||||||
|
{
|
||||||
|
return &show;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogPlotCollection::addWellLogPlot()
|
||||||
|
{
|
||||||
|
RimWellLogPlot* view = new RimWellLogPlot();
|
||||||
|
wellLogPlots.push_back(view);
|
||||||
|
|
||||||
|
RiuMainWindow::instance()->projectTreeView()->setExpanded(this, true);
|
||||||
|
updateConnectedEditors();
|
||||||
|
}
|
53
ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h
Normal file
53
ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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 "cafPdmObject.h"
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmChildArrayField.h"
|
||||||
|
|
||||||
|
class RimWellLogPlot;
|
||||||
|
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimWellLogPlotCollection : public caf::PdmObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
public:
|
||||||
|
RimWellLogPlotCollection();
|
||||||
|
virtual ~RimWellLogPlotCollection();
|
||||||
|
|
||||||
|
void addWellLogPlot();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Overridden PDM methods
|
||||||
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual caf::PdmFieldHandle* objectToggleField();
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmField<bool> show;
|
||||||
|
caf::PdmChildArrayField<RimWellLogPlot*> wellLogPlots;
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user