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

@ -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", "", "", "");

View File

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

View File

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

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

View 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}
)

View 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

View 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);
};
}

View 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

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

View File

@ -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"

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

View File

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