mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3604 Export completions. New feature 'Export Completion Data for Temporary LGRs'
This commit is contained in:
@@ -13,6 +13,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicMultiSegmentWellExportInfo.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.h
|
||||
)
|
||||
|
||||
|
||||
@@ -30,6 +31,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicMultiSegmentWellExportInfo.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicExportCompletionsForTemporaryLgrsFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RicWellPathExportCompletionDataFeature.h"
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "RimGridCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicExportCompletionsForTemporaryLgrsFeature, "RicExportCompletionsForTemporaryLgrsFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportCompletionsForTemporaryLgrsFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimGridInfoCollection*> selGridInfos = caf::selectedObjectsByTypeStrict<RimGridInfoCollection*>();
|
||||
return selGridInfos.size() == 1 && selGridInfos.front()->uiName() == RimGridCollection::temporaryGridUiName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportCompletionsForTemporaryLgrsFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths = wellPathsAssociatedWithLgrs();
|
||||
CVF_ASSERT(wellPaths.size() > 0);
|
||||
|
||||
std::vector<RimSimWellInView*> simWells;
|
||||
QString dialogTitle = "Export Completion Data for Temporary LGRs";
|
||||
|
||||
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions(dialogTitle, wellPaths, simWells);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportCompletionsForTemporaryLgrsFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Export Completion Data");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPath*> RicExportCompletionsForTemporaryLgrsFeature::wellPathsAssociatedWithLgrs()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
|
||||
auto selectedEclipseCase = caf::firstAncestorOfTypeFromSelectedObject<RimEclipseCase*>();
|
||||
auto mainGrid = selectedEclipseCase->mainGrid();
|
||||
|
||||
std::set<QString> wellPathNames;
|
||||
|
||||
for (size_t i = 0; i < mainGrid->gridCount(); i++)
|
||||
{
|
||||
const RigGridBase* grid = mainGrid->gridByIndex(i);
|
||||
|
||||
if (!grid->associatedWellPathName().empty())
|
||||
{
|
||||
wellPathNames.insert(QString::fromStdString(grid->associatedWellPathName()));
|
||||
}
|
||||
}
|
||||
|
||||
auto project = RiaApplication::instance()->project();
|
||||
for (const auto& wellPathName : wellPathNames)
|
||||
{
|
||||
auto wellPath = project->wellPathByName(wellPathName);
|
||||
if (wellPath)
|
||||
{
|
||||
wellPaths.push_back(wellPath);
|
||||
}
|
||||
}
|
||||
return wellPaths;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil 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 RimSimWellInView;
|
||||
class RimWellPath;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicExportCompletionsForTemporaryLgrsFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered(bool isChecked) override;
|
||||
void setupActionLook(QAction* actionToSetup) override;
|
||||
|
||||
public:
|
||||
static std::vector<RimWellPath*> wellPathsAssociatedWithLgrs();
|
||||
};
|
||||
Reference in New Issue
Block a user