mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Moved static method to the class where it belongs (more than it did).
This commit is contained in:
parent
803cc4328d
commit
aa36a3f5e6
@ -24,8 +24,11 @@
|
|||||||
|
|
||||||
#include "RigWellLogFile.h"
|
#include "RigWellLogFile.h"
|
||||||
|
|
||||||
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimWellLogFile, "WellLogFile");
|
CAF_PDM_SOURCE_INIT(RimWellLogFile, "WellLogFile");
|
||||||
@ -64,6 +67,42 @@ RimWellLogFile::~RimWellLogFile()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellLogFile* RimWellLogFile::readWellLogFile(const QString& logFilePath)
|
||||||
|
{
|
||||||
|
QFileInfo fi(logFilePath);
|
||||||
|
|
||||||
|
RimWellLogFile* wellLogFile = NULL;
|
||||||
|
|
||||||
|
if (fi.suffix().toUpper().compare("LAS") == 0)
|
||||||
|
{
|
||||||
|
QString errorMessage;
|
||||||
|
wellLogFile = new RimWellLogFile();
|
||||||
|
wellLogFile->setFileName(logFilePath);
|
||||||
|
if (!wellLogFile->readFile(&errorMessage))
|
||||||
|
{
|
||||||
|
QString displayMessage = "Could not open the LAS file: \n" + logFilePath;
|
||||||
|
|
||||||
|
if (!errorMessage.isEmpty())
|
||||||
|
{
|
||||||
|
displayMessage += "\n\n";
|
||||||
|
displayMessage += errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMessageBox::warning(RiuMainWindow::instance(),
|
||||||
|
"File open error",
|
||||||
|
displayMessage);
|
||||||
|
|
||||||
|
delete wellLogFile;
|
||||||
|
wellLogFile = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return wellLogFile;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -43,6 +43,9 @@ public:
|
|||||||
RimWellLogFile();
|
RimWellLogFile();
|
||||||
virtual ~RimWellLogFile();
|
virtual ~RimWellLogFile();
|
||||||
|
|
||||||
|
static RimWellLogFile* readWellLogFile(const QString& logFilePath);
|
||||||
|
|
||||||
|
|
||||||
void setFileName(const QString& fileName);
|
void setFileName(const QString& fileName);
|
||||||
QString fileName() const { return m_fileName; }
|
QString fileName() const { return m_fileName; }
|
||||||
|
|
||||||
|
@ -175,42 +175,6 @@ void RimWellPath::readWellPathFile()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RimWellLogFile* RimWellPath::readWellLogFile(const QString& logFilePath)
|
|
||||||
{
|
|
||||||
QFileInfo fi(logFilePath);
|
|
||||||
|
|
||||||
RimWellLogFile* wellLogFile = NULL;
|
|
||||||
|
|
||||||
if (fi.suffix().toUpper().compare("LAS") == 0)
|
|
||||||
{
|
|
||||||
QString errorMessage;
|
|
||||||
wellLogFile = new RimWellLogFile();
|
|
||||||
wellLogFile->setFileName(logFilePath);
|
|
||||||
if (!wellLogFile->readFile(&errorMessage))
|
|
||||||
{
|
|
||||||
QString displayMessage = "Could not open the LAS file: \n" + logFilePath;
|
|
||||||
|
|
||||||
if (!errorMessage.isEmpty())
|
|
||||||
{
|
|
||||||
displayMessage += "\n\n";
|
|
||||||
displayMessage += errorMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
QMessageBox::warning(RiuMainWindow::instance(),
|
|
||||||
"File open error",
|
|
||||||
displayMessage);
|
|
||||||
|
|
||||||
delete wellLogFile;
|
|
||||||
wellLogFile = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return wellLogFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Read JSON file containing well path data
|
/// Read JSON file containing well path data
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -74,7 +74,6 @@ public:
|
|||||||
RivWellPathPartMgr* partMgr();
|
RivWellPathPartMgr* partMgr();
|
||||||
|
|
||||||
void readWellPathFile();
|
void readWellPathFile();
|
||||||
static RimWellLogFile* readWellLogFile(const QString& logFilePath);
|
|
||||||
void updateFilePathsFromProjectPath();
|
void updateFilePathsFromProjectPath();
|
||||||
|
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ void RimWellPathCollection::addWellLogs(const QStringList& filePaths)
|
|||||||
{
|
{
|
||||||
foreach (QString filePath, filePaths)
|
foreach (QString filePath, filePaths)
|
||||||
{
|
{
|
||||||
RimWellLogFile* logFileInfo = RimWellPath::readWellLogFile(filePath);
|
RimWellLogFile* logFileInfo = RimWellLogFile::readWellLogFile(filePath);
|
||||||
if (logFileInfo)
|
if (logFileInfo)
|
||||||
{
|
{
|
||||||
RimWellPath* wellPath = wellPathByName(logFileInfo->wellName());
|
RimWellPath* wellPath = wellPathByName(logFileInfo->wellName());
|
||||||
|
Loading…
Reference in New Issue
Block a user