2013-05-29 12:59:08 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// 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"
|
2013-05-29 14:49:04 +02:00
|
|
|
#include "ssihubDialog.h"
|
|
|
|
|
#include "ssihubWebServiceInterface.h"
|
2013-05-29 12:59:08 +02:00
|
|
|
|
2013-05-31 14:02:48 +02:00
|
|
|
#include <math.h>
|
2013-05-29 12:59:08 +02:00
|
|
|
|
|
|
|
|
namespace ssihub {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
Interface::Interface()
|
|
|
|
|
{
|
2013-05-31 13:57:16 +02:00
|
|
|
m_north = HUGE_VAL;
|
|
|
|
|
m_south = HUGE_VAL;
|
|
|
|
|
m_east = HUGE_VAL;
|
|
|
|
|
m_west = HUGE_VAL;
|
2013-05-29 12:59:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-05-29 14:49:04 +02:00
|
|
|
void Interface::setWebServiceAddress(const QString wsAdress)
|
2013-05-29 12:59:08 +02:00
|
|
|
{
|
2013-05-29 14:49:04 +02:00
|
|
|
m_webServiceAddress = wsAdress;
|
2013-05-29 12:59:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-05-29 14:49:04 +02:00
|
|
|
void Interface::setJsonDestinationFolder(const QString folder)
|
2013-05-29 12:59:08 +02:00
|
|
|
{
|
|
|
|
|
m_jsonDestinationFolder = folder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-05-31 13:57:16 +02:00
|
|
|
void Interface::setRegion(int north, int south, int east, int west)
|
2013-05-29 12:59:08 +02:00
|
|
|
{
|
|
|
|
|
m_east = east;
|
|
|
|
|
m_west = west;
|
|
|
|
|
m_north = north;
|
|
|
|
|
m_south = south;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
QStringList Interface::jsonWellPaths()
|
|
|
|
|
{
|
2013-05-30 15:33:12 +02:00
|
|
|
FetchWellPathsDialog fetchWellPaths;
|
|
|
|
|
fetchWellPaths.setSsiHubUrl(m_webServiceAddress);
|
|
|
|
|
fetchWellPaths.setDestinationFolder(m_jsonDestinationFolder);
|
2013-05-31 15:37:52 +02:00
|
|
|
fetchWellPaths.setRegion(m_north, m_south, m_east, m_west);
|
2013-05-30 15:33:12 +02:00
|
|
|
|
|
|
|
|
QStringList importedWellPathFiles;
|
|
|
|
|
if (fetchWellPaths.exec() == QDialog::Accepted)
|
|
|
|
|
{
|
|
|
|
|
importedWellPathFiles = fetchWellPaths.downloadedJsonWellPathFiles();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return importedWellPathFiles;
|
2013-05-29 12:59:08 +02:00
|
|
|
}
|
|
|
|
|
|
2013-06-18 13:26:38 +02:00
|
|
|
}; // namespace ssihub
|