mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#846 Created ImportGeoMechCaseFeature
This commit is contained in:
@@ -50,6 +50,7 @@ ${CEE_CURRENT_LIST_DIR}RicExportToLasFileResampleUi.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.h
|
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicSnapshotViewToClipboardFeature.h
|
${CEE_CURRENT_LIST_DIR}RicSnapshotViewToClipboardFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicAddOpmInputPropertyFeature.h
|
${CEE_CURRENT_LIST_DIR}RicAddOpmInputPropertyFeature.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicImportGeoMechCaseFeature.h
|
||||||
|
|
||||||
# General delete of any object in a child array field
|
# General delete of any object in a child array field
|
||||||
${CEE_CURRENT_LIST_DIR}RicDeleteItemExec.h
|
${CEE_CURRENT_LIST_DIR}RicDeleteItemExec.h
|
||||||
@@ -102,6 +103,7 @@ ${CEE_CURRENT_LIST_DIR}RicExportToLasFileResampleUi.cpp
|
|||||||
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicSnapshotViewToClipboardFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicSnapshotViewToClipboardFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicAddOpmInputPropertyFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicAddOpmInputPropertyFeature.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicImportGeoMechCaseFeature.cpp
|
||||||
|
|
||||||
|
|
||||||
# General delete of any object in a child array field
|
# General delete of any object in a child array field
|
||||||
|
|||||||
69
ApplicationCode/Commands/RicImportGeoMechCaseFeature.cpp
Normal file
69
ApplicationCode/Commands/RicImportGeoMechCaseFeature.cpp
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016- 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 "RicImportGeoMechCaseFeature.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
#include <QFileDialog>
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicImportGeoMechCaseFeature, "RicImportGeoMechCaseFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicImportGeoMechCaseFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicImportGeoMechCaseFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
RiaApplication* app = RiaApplication::instance();
|
||||||
|
|
||||||
|
QString defaultDir = app->lastUsedDialogDirectory("GEOMECH_MODEL");
|
||||||
|
QStringList fileNames = QFileDialog::getOpenFileNames(NULL, "Import Geo-Mechanical Model", defaultDir, "Abaqus results (*.odb)");
|
||||||
|
if (fileNames.size()) defaultDir = QFileInfo(fileNames.last()).absolutePath();
|
||||||
|
app->setLastUsedDialogDirectory("GEOMECH_MODEL", defaultDir);
|
||||||
|
|
||||||
|
for (int i = 0; i < fileNames.size(); i++)
|
||||||
|
{
|
||||||
|
QString fileName = fileNames[i];
|
||||||
|
|
||||||
|
if (!fileNames.isEmpty())
|
||||||
|
{
|
||||||
|
if (app->openOdbCaseFromFile(fileName))
|
||||||
|
{
|
||||||
|
app->addToRecentFiles(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicImportGeoMechCaseFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setIcon(QIcon(":/GeoMechCase48x48.png"));
|
||||||
|
actionToSetup->setText("Import &Geo Mechanical Model");
|
||||||
|
}
|
||||||
37
ApplicationCode/Commands/RicImportGeoMechCaseFeature.h
Normal file
37
ApplicationCode/Commands/RicImportGeoMechCaseFeature.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2016- 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 RicImportGeoMechCaseFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Overrides
|
||||||
|
virtual bool isCommandEnabled() override;
|
||||||
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -232,8 +232,6 @@ void RiuMainWindow::closeEvent(QCloseEvent* event)
|
|||||||
void RiuMainWindow::createActions()
|
void RiuMainWindow::createActions()
|
||||||
{
|
{
|
||||||
// File actions
|
// File actions
|
||||||
m_importGeoMechCaseAction = new QAction(QIcon(":/GeoMechCase48x48.png"), "Import &Geo Mechanical Model", this);
|
|
||||||
|
|
||||||
m_mockModelAction = new QAction("&Mock Model", this);
|
m_mockModelAction = new QAction("&Mock Model", this);
|
||||||
m_mockResultsModelAction = new QAction("Mock Model With &Results", this);
|
m_mockResultsModelAction = new QAction("Mock Model With &Results", this);
|
||||||
m_mockLargeResultsModelAction = new QAction("Large Mock Model", this);
|
m_mockLargeResultsModelAction = new QAction("Large Mock Model", this);
|
||||||
@@ -248,8 +246,6 @@ void RiuMainWindow::createActions()
|
|||||||
m_showRegressionTestDialog = new QAction("Regression Test Dialog", this);
|
m_showRegressionTestDialog = new QAction("Regression Test Dialog", this);
|
||||||
m_executePaintEventPerformanceTest = new QAction("&Paint Event Performance Test", this);
|
m_executePaintEventPerformanceTest = new QAction("&Paint Event Performance Test", this);
|
||||||
|
|
||||||
connect(m_importGeoMechCaseAction, SIGNAL(triggered()), SLOT(slotImportGeoMechModel()));
|
|
||||||
|
|
||||||
connect(m_mockModelAction, SIGNAL(triggered()), SLOT(slotMockModel()));
|
connect(m_mockModelAction, SIGNAL(triggered()), SLOT(slotMockModel()));
|
||||||
connect(m_mockResultsModelAction, SIGNAL(triggered()), SLOT(slotMockResultsModel()));
|
connect(m_mockResultsModelAction, SIGNAL(triggered()), SLOT(slotMockResultsModel()));
|
||||||
connect(m_mockLargeResultsModelAction, SIGNAL(triggered()), SLOT(slotMockLargeResultsModel()));
|
connect(m_mockLargeResultsModelAction, SIGNAL(triggered()), SLOT(slotMockLargeResultsModel()));
|
||||||
@@ -371,7 +367,7 @@ void RiuMainWindow::createMenus()
|
|||||||
importMenu->addAction(cmdFeatureMgr->action("RicCreateGridCaseGroupFeature"));
|
importMenu->addAction(cmdFeatureMgr->action("RicCreateGridCaseGroupFeature"));
|
||||||
importMenu->addSeparator();
|
importMenu->addSeparator();
|
||||||
#ifdef USE_ODB_API
|
#ifdef USE_ODB_API
|
||||||
importMenu->addAction(m_importGeoMechCaseAction);
|
importMenu->addAction(cmdFeatureMgr->action("RicImportGeoMechCaseFeature"));
|
||||||
importMenu->addSeparator();
|
importMenu->addSeparator();
|
||||||
#endif
|
#endif
|
||||||
importMenu->addAction(cmdFeatureMgr->action("RicWellPathsImportFileFeature"));
|
importMenu->addAction(cmdFeatureMgr->action("RicWellPathsImportFileFeature"));
|
||||||
@@ -795,49 +791,6 @@ void RiuMainWindow::slotAbout()
|
|||||||
dlg.exec();
|
dlg.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMainWindow::slotImportGeoMechModel()
|
|
||||||
{
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
|
||||||
|
|
||||||
QString defaultDir = app->lastUsedDialogDirectory("GEOMECH_MODEL");
|
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Import Geo-Mechanical Model", defaultDir, "Abaqus results (*.odb)");
|
|
||||||
if (fileNames.size()) defaultDir = QFileInfo(fileNames.last()).absolutePath();
|
|
||||||
app->setLastUsedDialogDirectory("GEOMECH_MODEL", defaultDir);
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < fileNames.size(); i++)
|
|
||||||
{
|
|
||||||
QString fileName = fileNames[i];
|
|
||||||
|
|
||||||
if (!fileNames.isEmpty())
|
|
||||||
{
|
|
||||||
if (app->openOdbCaseFromFile(fileName))
|
|
||||||
{
|
|
||||||
app->addToRecentFiles(fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMainWindow::slotOpenLastUsedProject()
|
|
||||||
{
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
|
||||||
QString fileName = app->preferences()->lastUsedProjectFileName;
|
|
||||||
|
|
||||||
if (app->loadProject(fileName))
|
|
||||||
{
|
|
||||||
app->addToRecentFiles(fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -884,16 +837,6 @@ void RiuMainWindow::slotInputMockModel()
|
|||||||
app->createInputMockModel();
|
app->createInputMockModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMainWindow::slotCloseProject()
|
|
||||||
{
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
|
||||||
|
|
||||||
app->closeProject();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -995,31 +938,6 @@ void RiuMainWindow::addViewer(QWidget* viewer, const RimMdiWindowGeometry& windo
|
|||||||
slotRefreshViewActions();
|
slotRefreshViewActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMainWindow::slotSaveProject()
|
|
||||||
{
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
|
||||||
|
|
||||||
storeTreeViewState();
|
|
||||||
|
|
||||||
app->saveProject();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMainWindow::slotSaveProjectAs()
|
|
||||||
{
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
|
||||||
|
|
||||||
storeTreeViewState();
|
|
||||||
|
|
||||||
app->saveProjectPromptForFileName();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// This method needs to handle memory deallocation !!!
|
/// This method needs to handle memory deallocation !!!
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -138,9 +138,6 @@ private:
|
|||||||
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
|
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// File actions
|
|
||||||
QAction* m_importGeoMechCaseAction;
|
|
||||||
|
|
||||||
// Edit actions
|
// Edit actions
|
||||||
QAction* m_editPreferences;
|
QAction* m_editPreferences;
|
||||||
QAction* m_newPropertyView;
|
QAction* m_newPropertyView;
|
||||||
@@ -199,12 +196,6 @@ private slots:
|
|||||||
friend class RiuMdiSubWindow;
|
friend class RiuMdiSubWindow;
|
||||||
|
|
||||||
// File slots
|
// File slots
|
||||||
void slotImportGeoMechModel();
|
|
||||||
void slotOpenLastUsedProject();
|
|
||||||
void slotSaveProject();
|
|
||||||
void slotSaveProjectAs();
|
|
||||||
void slotCloseProject();
|
|
||||||
|
|
||||||
void slotRefreshFileActions();
|
void slotRefreshFileActions();
|
||||||
|
|
||||||
// Edit slots
|
// Edit slots
|
||||||
|
|||||||
Reference in New Issue
Block a user