mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added ssihubInterface library and framework files
p4#: 21763
This commit is contained in:
@@ -57,6 +57,8 @@
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
|
||||
#include "ssihubInterface/ssihubInterface.h"
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@@ -1568,3 +1570,58 @@ void RiuMainWindow::selectedCases(std::vector<RimCase*>& cases)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::slotImportWellPaths()
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
if (!app->project())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_ssihubInterface)
|
||||
{
|
||||
m_ssihubInterface = new ssihub::Interface;
|
||||
}
|
||||
|
||||
|
||||
//m_ssihubInterface->setJsonDestinationFolder(dir);
|
||||
//m_ssihubInterface->setRegion(int east, int west, int north, int south);
|
||||
|
||||
|
||||
QStringList wellPaths = m_ssihubInterface->jsonWellPaths();
|
||||
|
||||
|
||||
QString dir;
|
||||
QString projectFileName = app->project()->fileName();
|
||||
QFileInfo fileInfo(projectFileName);
|
||||
dir = fileInfo.canonicalPath();
|
||||
dir += "/" + fileInfo.completeBaseName() + "_wellpaths";
|
||||
|
||||
|
||||
QStringList wellPathFileNames;
|
||||
for (int i = 0; i < wellPaths.size(); i++)
|
||||
{
|
||||
QUuid guid = QUuid::createUuid();
|
||||
|
||||
QString filename = projectFileName + QString("/%1.json").arg(guid);
|
||||
|
||||
QFile file(filename);
|
||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
QTextStream out(&file);
|
||||
out << wellPaths[i];
|
||||
|
||||
wellPathFileNames.push_back(filename);
|
||||
}
|
||||
}
|
||||
|
||||
if (wellPathFileNames.size() > 0)
|
||||
{
|
||||
app->addWellPathsToModel(wellPathFileNames);
|
||||
if (app->project()) app->project()->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,11 @@ namespace caf
|
||||
class PdmUiPropertyView;
|
||||
}
|
||||
|
||||
namespace ssihub
|
||||
{
|
||||
class Interface;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
@@ -179,6 +184,7 @@ private slots:
|
||||
void slotOpenProject();
|
||||
void slotOpenLastUsedProject();
|
||||
void slotOpenWellPaths();
|
||||
void slotImportWellPaths();
|
||||
void slotSaveProject();
|
||||
void slotSaveProjectAs();
|
||||
void slotCloseProject();
|
||||
@@ -253,5 +259,6 @@ private:
|
||||
|
||||
std::vector<QPointer<QDockWidget> > additionalProjectTrees;
|
||||
std::vector<QPointer<QDockWidget> > additionalPropertyEditors;
|
||||
|
||||
|
||||
ssihub::Interface* m_ssihubInterface;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user