mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1092 - pre-proto - Added feature for exporting fracture data to file. File is written, but not with any useful information yet.
This commit is contained in:
@@ -46,6 +46,7 @@ ${CEE_CURRENT_LIST_DIR}RicFractureDefinitionsDeleteAllFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicFracturesDeleteAllFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathFracturesDeleteAllFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSimWellFracturesDeleteAllFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFractureWellCompletionFeature.h
|
||||
|
||||
|
||||
# General delete of any object in a child array field
|
||||
@@ -95,6 +96,8 @@ ${CEE_CURRENT_LIST_DIR}RicNewWellPathFractureAtPosFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicFractureDefinitionsDeleteAllFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathFracturesDeleteAllFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSimWellFracturesDeleteAllFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFractureWellCompletionFeature.cpp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RicExportFractureWellCompletionFeature.h"
|
||||
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RifEclipseExportTools.h"
|
||||
#include "RifEclipseExportTools.h"
|
||||
|
||||
#include "RimBinaryExportSettings.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
#include "RimFractureExportSettings.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafPdmObjectHandle.h"
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QMessageBox>
|
||||
#include <QString>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicExportFractureWellCompletionFeature, "RicExportFractureWellCompletionFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportFractureWellCompletionFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if (!pdmUiItem) return;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
|
||||
if (!objHandle) return;
|
||||
|
||||
RimEclipseWellCollection* eclipseWellColl = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(eclipseWellColl);
|
||||
|
||||
RimEclipseView* eclipseWiew = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(eclipseWiew);
|
||||
|
||||
RimFractureExportSettings exportSettings;
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QString projectFolder = app->currentProjectPath();
|
||||
if (projectFolder.isEmpty())
|
||||
{
|
||||
projectFolder = eclipseWiew->eclipseCase()->locationOnDisc();
|
||||
}
|
||||
|
||||
QString outputFileName = projectFolder + "/Fractures";
|
||||
exportSettings.fileName = outputFileName;
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Fracture Well Completion Data", "");
|
||||
if (propertyDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
bool isOk = RifEclipseExportTools::writeFracturesToTextFile(exportSettings.fileName, eclipseWellColl);
|
||||
|
||||
if (!isOk)
|
||||
{
|
||||
QMessageBox::critical(NULL, "File export", "Failed to exported current result to " + exportSettings.fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportFractureWellCompletionFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/FractureTemplate16x16.png"));
|
||||
actionToSetup->setText("Export Fracture Well Completion Data");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportFractureWellCompletionFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicExportFractureWellCompletionFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
virtual bool isCommandEnabled() override;
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user