Added ssihubInterface library and framework files

p4#: 21763
This commit is contained in:
Magne Sjaastad
2013-05-29 12:59:08 +02:00
parent 80e8b54898
commit ada9819870
13 changed files with 346 additions and 2 deletions

View File

@@ -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();
}
}

View File

@@ -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;
};