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:
parent
80e8b54898
commit
ada9819870
@ -39,6 +39,8 @@ RiaPreferences::RiaPreferences(void)
|
||||
CAF_PDM_InitField(&octaveExecutable, "octaveExecutable", QString("octave"), "Octave", "", "", "");
|
||||
octaveExecutable.setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitField(&ssihubAddress, "ssihubAddress", QString("http://"), "ssihub Address", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&defaultGridLines, "defaultGridLines", true, "Gridlines", "", "", "");
|
||||
CAF_PDM_InitField(&defaultGridLineColors, "defaultGridLineColors", cvf::Color3f(0.92f, 0.92f, 0.92f), "Mesh color", "", "", "");
|
||||
CAF_PDM_InitField(&defaultFaultGridLineColors, "defaultFaultGridLineColors", cvf::Color3f(0.08f, 0.08f, 0.08f), "Mesh color along faults", "", "", "");
|
||||
|
@ -41,6 +41,7 @@ public: // Pdm Fields
|
||||
caf::PdmField<QString> scriptDirectories;
|
||||
caf::PdmField<QString> scriptEditorExecutable;
|
||||
caf::PdmField<QString> octaveExecutable;
|
||||
caf::PdmField<QString> ssihubAddress;
|
||||
|
||||
caf::PdmField<int> defaultScaleFactorZ;
|
||||
caf::PdmField<bool> defaultGridLines;
|
||||
|
@ -82,6 +82,8 @@ list( APPEND CPP_SOURCES
|
||||
${CODE_SOURCE_FILES}
|
||||
)
|
||||
|
||||
add_subdirectory(ssihubInterface)
|
||||
|
||||
|
||||
# Define files for MOC-ing
|
||||
set ( QT_MOC_HEADERS
|
||||
@ -213,6 +215,8 @@ set( LINK_LIBRARIES
|
||||
LibGeometry
|
||||
LibCore
|
||||
|
||||
ssihubInterface
|
||||
|
||||
ecl
|
||||
ert_util
|
||||
ert_geometry
|
||||
|
@ -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;
|
||||
};
|
||||
|
20
ApplicationCode/ssihubInterface/CMakeLists.txt
Normal file
20
ApplicationCode/ssihubInterface/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
project (ssihubInterface)
|
||||
|
||||
# These headers need to go through Qt's MOC compiler
|
||||
set( QOBJECT_HEADERS
|
||||
ssihubDialog.h
|
||||
)
|
||||
|
||||
if ( (${CMAKE_VERSION} VERSION_LESS 2.8.6) OR (NOT CMAKE_AUTOMOC) )
|
||||
qt4_wrap_cpp( MOC_FILES_CPP ${QOBJECT_HEADERS} )
|
||||
endif()
|
||||
|
||||
|
||||
add_library( ${PROJECT_NAME}
|
||||
ssihubInterface.cpp
|
||||
ssihubWebServiceInterface.cpp
|
||||
ssihubDialog.cpp
|
||||
${MOC_FILES_CPP}
|
||||
)
|
41
ApplicationCode/ssihubInterface/ssihubDialog.cpp
Normal file
41
ApplicationCode/ssihubInterface/ssihubDialog.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// 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 "ssihubDialog.h"
|
||||
|
||||
|
||||
namespace ssihub {
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
BasicAboutDialog::BasicAboutDialog(QWidget* parent)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace ssihub
|
||||
|
||||
|
42
ApplicationCode/ssihubInterface/ssihubDialog.h
Normal file
42
ApplicationCode/ssihubInterface/ssihubDialog.h
Normal file
@ -0,0 +1,42 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// 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 <QtGui/QDialog>
|
||||
#include <QtGui/QIcon>
|
||||
|
||||
class QGridLayout;
|
||||
|
||||
|
||||
namespace ssihub {
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class BasicAboutDialog : public QDialog
|
||||
{
|
||||
public:
|
||||
BasicAboutDialog(QWidget* parent);
|
||||
|
||||
};
|
||||
|
||||
}
|
69
ApplicationCode/ssihubInterface/ssihubInterface.cpp
Normal file
69
ApplicationCode/ssihubInterface/ssihubInterface.cpp
Normal file
@ -0,0 +1,69 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// 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 "ssihubInterface.h"
|
||||
|
||||
|
||||
namespace ssihub {
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Interface::Interface()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Interface::setWebServiceAdress(const QString& wsAdress)
|
||||
{
|
||||
m_webServiceAdress = wsAdress;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Interface::setJsonDestinationFolder(const QString& folder)
|
||||
{
|
||||
m_jsonDestinationFolder = folder;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Interface::setRegion(int east, int west, int north, int south)
|
||||
{
|
||||
m_east = east;
|
||||
m_west = west;
|
||||
m_north = north;
|
||||
m_south = south;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList Interface::jsonWellPaths()
|
||||
{
|
||||
return m_importedWellPathFiles;
|
||||
}
|
||||
|
||||
}; // namespace ssihub
|
50
ApplicationCode/ssihubInterface/ssihubInterface.h
Normal file
50
ApplicationCode/ssihubInterface/ssihubInterface.h
Normal file
@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// 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 <QString>
|
||||
#include <QStringList>
|
||||
|
||||
namespace ssihub {
|
||||
|
||||
class Interface
|
||||
{
|
||||
public:
|
||||
Interface();
|
||||
|
||||
void setWebServiceAdress(const QString& wsAdress);
|
||||
void setJsonDestinationFolder(const QString& folder);
|
||||
void setRegion(int east, int west, int north, int south);
|
||||
|
||||
QStringList jsonWellPaths();
|
||||
|
||||
private:
|
||||
QString m_webServiceAdress;
|
||||
QString m_jsonDestinationFolder;
|
||||
|
||||
int m_east;
|
||||
int m_west;
|
||||
int m_north;
|
||||
int m_south;
|
||||
|
||||
QStringList m_importedWellPathFiles;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// 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 "ssihubWebServiceInterface.h"
|
32
ApplicationCode/ssihubInterface/ssihubWebServiceInterface.h
Normal file
32
ApplicationCode/ssihubInterface/ssihubWebServiceInterface.h
Normal file
@ -0,0 +1,32 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// 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
|
||||
|
||||
|
||||
namespace ssihub {
|
||||
|
||||
class WebServiceInterface
|
||||
{
|
||||
public:
|
||||
WebServiceInterface();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
set(CMAKE_MAJOR_VERSION 0)
|
||||
set(CMAKE_MINOR_VERSION 9)
|
||||
set(CMAKE_PATCH_VERSION 14)
|
||||
set(CMAKE_PATCH_VERSION 15)
|
||||
|
||||
set(PRODUCTVER ${CMAKE_MAJOR_VERSION},${CMAKE_MINOR_VERSION},0,${CMAKE_PATCH_VERSION})
|
||||
set(STRPRODUCTVER ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION})
|
||||
|
Loading…
Reference in New Issue
Block a user