diff --git a/ApplicationCode/Commands/RicExportToLasFileFeature.cpp b/ApplicationCode/Commands/RicExportToLasFileFeature.cpp index 46e3951d1d..45824fe3ee 100644 --- a/ApplicationCode/Commands/RicExportToLasFileFeature.cpp +++ b/ApplicationCode/Commands/RicExportToLasFileFeature.cpp @@ -19,26 +19,25 @@ #include "RicExportToLasFileFeature.h" -#include "RimWellLogCurve.h" -#include "RigWellLogFile.h" - -#include "RiuMainWindow.h" #include "RiaApplication.h" +#include "RigLasFileExporter.h" +#include "RimWellLogCurve.h" #include "cafSelectionManager.h" #include #include -#include CAF_CMD_SOURCE_INIT(RicExportToLasFileFeature, "RicExportToLasFileFeature"); + + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RicExportToLasFileFeature::isCommandEnabled() { - return selectedWellLogPlotCurve() != NULL; + return selectedWellLogPlotCurves().size() > 0; } //-------------------------------------------------------------------------------------------------- @@ -46,29 +45,18 @@ bool RicExportToLasFileFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicExportToLasFileFeature::onActionTriggered(bool isChecked) { - RimWellLogCurve* curve = selectedWellLogPlotCurve(); - if (curve) + std::vector curves = selectedWellLogPlotCurves(); + if (curves.size() == 0) return; + + QString defaultDir = RiaApplication::instance()->defaultFileDialogDirectory("WELL_LOGS_DIR"); + QString exportFolder = QFileDialog::getExistingDirectory(NULL, "Select destination folder for LAS export"); + if (!exportFolder.isEmpty()) { - QString defaultDir = RiaApplication::instance()->defaultFileDialogDirectory("WELL_LOGS_DIR"); - - QString defaultFileName = curve->curveName().trimmed(); - defaultFileName.replace(".", "_"); - defaultFileName.replace(",", "_"); - defaultFileName.replace(":", "_"); - defaultFileName.replace(";", "_"); - defaultFileName.replace(" ", "_"); - defaultFileName.replace("/", "_"); - defaultFileName.replace(QRegExp("_+"), "_"); - defaultFileName.append(".las"); + RigLasFileExporter lasExporter(curves); + lasExporter.writeToFolder(exportFolder); - QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export Curve Data To LAS File"), QDir(defaultDir).absoluteFilePath(defaultFileName), tr("LAS Files (*.las);;All files(*.*)")); - if (!fileName.isEmpty()) - { - RigWellLogFile::exportToLasFile(curve, fileName); - - // Remember the path to next time - RiaApplication::instance()->setDefaultFileDialogDirectory("WELL_LOGS_DIR", QFileInfo(fileName).absolutePath()); - } + // Remember the path to next time + RiaApplication::instance()->setDefaultFileDialogDirectory("WELL_LOGS_DIR", exportFolder); } } @@ -83,15 +71,11 @@ void RicExportToLasFileFeature::setupActionLook(QAction* actionToSetup) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellLogCurve* RicExportToLasFileFeature::selectedWellLogPlotCurve() const +std::vector RicExportToLasFileFeature::selectedWellLogPlotCurves() const { std::vector selection; caf::SelectionManager::instance()->objectsByType(&selection); - if (selection.size() > 0) - { - return selection[0]; - } - - return NULL; + return selection; } + diff --git a/ApplicationCode/Commands/RicExportToLasFileFeature.h b/ApplicationCode/Commands/RicExportToLasFileFeature.h index 78ab3603b9..399a7529d4 100644 --- a/ApplicationCode/Commands/RicExportToLasFileFeature.h +++ b/ApplicationCode/Commands/RicExportToLasFileFeature.h @@ -39,7 +39,6 @@ protected: virtual void setupActionLook( QAction* actionToSetup ); private: - RimWellLogCurve* selectedWellLogPlotCurve() const; + std::vector selectedWellLogPlotCurves() const; }; - diff --git a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp index 4511606468..e73eec20b1 100644 --- a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -264,7 +264,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection() } else if (dynamic_cast(uiItem)) { - commandIds << "RicExportToLasFileFeature"; commandIds << "RicDeleteItemFeature"; } else if (dynamic_cast(uiItem)) @@ -352,6 +351,10 @@ QStringList RimContextCommandBuilder::commandsFromSelection() { commandIds << "RicExecuteScriptForCasesFeature"; } + else if (dynamic_cast(uiItem)) + { + commandIds << "RicExportToLasFileFeature"; + } } if (RicToggleItemsFeatureImpl::isToggleCommandsAvailable()) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index 59bc3da31f..2eedf42993 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -607,3 +607,30 @@ QString RimWellLogExtractionCurve::wellDate() const return (m_timeStep < timeStepNames.size()) ? timeStepNames[m_timeStep] : ""; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellLogExtractionCurve::isEclipseCurve() const +{ + RimEclipseCase* eclipseCase = dynamic_cast(m_case.value()); + if (eclipseCase) + { + return true; + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimWellLogExtractionCurve::caseName() const +{ + if (m_case) + { + return m_case->caseUserDescription(); + } + + return QString(); +} diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h index aaa6830b9d..c4aeda0d5b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h @@ -49,6 +49,9 @@ public: virtual QString wellLogChannelName() const; virtual QString wellDate() const; + bool isEclipseCurve() const; + QString caseName() const; + protected: virtual QString createCurveAutoName(); virtual void onLoadDataAndUpdate(); diff --git a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake index b7c6b0f803..6f63e66697 100644 --- a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake @@ -41,6 +41,7 @@ ${CEE_CURRENT_LIST_DIR}RigWellLogCurveData.h ${CEE_CURRENT_LIST_DIR}RigTimeHistoryResultAccessor.h ${CEE_CURRENT_LIST_DIR}RigCurveDataTools.h ${CEE_CURRENT_LIST_DIR}RigSummaryCaseData.h +${CEE_CURRENT_LIST_DIR}RigLasFileExporter.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -77,6 +78,7 @@ ${CEE_CURRENT_LIST_DIR}RigWellLogCurveData.cpp ${CEE_CURRENT_LIST_DIR}RigTimeHistoryResultAccessor.cpp ${CEE_CURRENT_LIST_DIR}RigCurveDataTools.cpp ${CEE_CURRENT_LIST_DIR}RigSummaryCaseData.cpp +${CEE_CURRENT_LIST_DIR}RigLasFileExporter.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp b/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp new file mode 100644 index 0000000000..ea1e7ad25f --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp @@ -0,0 +1,607 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RigLasFileExporter.h" + +#include "RigWellLogCurveData.h" +#include "RimCase.h" +#include "RimDefines.h" +#include "RimWellLogCurve.h" +#include "RimWellLogExtractionCurve.h" + +#include "cvfAssert.h" + +#include "laswell.hpp" + +#include +#include + +#include // Needed for HUGE_VAL on Linux + + +namespace NRLib +{ + class LasWell; +}; + + +class SingleChannelData +{ +public: + SingleChannelData(const std::string& channelName, const std::string& unit, const std::string& comment, const RigWellLogCurveData* curveData) + : m_channelName(channelName), + m_unit(unit), + m_comment(comment), + m_curveData(curveData) + { + } + + void appendDataToLasFile(NRLib::LasWell* lasFile) const + { + CVF_ASSERT(lasFile); + + double minX = HUGE_VAL; + + double absentValue = SingleChannelData::createAbsentValue(minX); + + std::vector wellLogValues = m_curveData->xValues(); + for (size_t vIdx = 0; vIdx < wellLogValues.size(); vIdx++) + { + double value = wellLogValues[vIdx]; + if (value == HUGE_VAL || value == -HUGE_VAL || value != value) + { + wellLogValues[vIdx] = absentValue; + } + } + + lasFile->AddLog(m_channelName, m_unit, m_comment, wellLogValues); + } + + std::string channelName() const + { + return m_channelName; + } + + const RigWellLogCurveData* curveData() const + { + return m_curveData; + } + +private: + static double createAbsentValue(double lowestDataValue) + { + double absentValue = -999.0; + + while (absentValue > lowestDataValue) + { + absentValue *= 10; + absentValue -= 9; + } + + return absentValue - 0.25; + } + +private: + std::string m_channelName; + std::string m_unit; + std::string m_comment; + + const RigWellLogCurveData* m_curveData; +}; + +class SingleLasFileMetaData +{ +public: + SingleLasFileMetaData() + { + } + + void setWellName(const QString& wellName) + { + m_wellName = wellName; + } + + void setCaseName(const QString& caseName) + { + m_caseName = caseName; + } + + void setDate(const QString& date) + { + m_date = date; + } + + void setDepthValues(RimDefines::DepthUnitType depthUnit, const std::vector& depthValues) + { + m_depthUnit = depthUnit; + m_depthValues = depthValues; + } + + void addLogData(const std::string& channelName, const std::string& unit, const std::string& comment, const RigWellLogCurveData* curveData) + { + m_logCurveData.push_back(SingleChannelData(channelName, unit, comment, curveData)); + } + + std::string generateFilename() const + { + QString f; + QString separator("-"); + + if (!m_wellName.isEmpty()) + { + f += m_wellName; + } + + if (!m_caseName.isEmpty()) + { + if (!f.isEmpty()) f += separator; + f += m_caseName; + } + + // Add property name if only one curve is exported + if (m_logCurveData.size() == 1) + { + if (!f.isEmpty()) f += separator; + f += QString::fromStdString(m_logCurveData[0].channelName()); + } + + if (!m_date.isEmpty()) + { + if (!f.isEmpty()) f += separator; + f += m_date; + } + + QString cleanFileName = f.trimmed(); + cleanFileName.replace(".", "_"); + cleanFileName.replace(",", "_"); + cleanFileName.replace(":", "_"); + cleanFileName.replace(";", "_"); + cleanFileName.replace(" ", "_"); + cleanFileName.replace("/", "_"); + cleanFileName.replace(QRegExp("_+"), "_"); + + cleanFileName += ".las"; + + return cleanFileName.toStdString(); + } + + void appendDataToLasFile(NRLib::LasWell* lasFile) const + { + if (m_logCurveData.size() == 0) return; + + lasFile->addWellInfo("WELL", m_wellName.toStdString()); + + QString wellLogDate = m_date; + wellLogDate.replace(".", "_"); + wellLogDate.replace(" ", "_"); + + lasFile->addWellInfo("DATE", wellLogDate.toStdString()); + + const RigWellLogCurveData* firstCurveData = curveDataForFirstCurve(); + + if (firstCurveData->depthUnit() == RimDefines::UNIT_METER) + { + lasFile->AddLog("DEPTH", "M", "Depth in meters", firstCurveData->measuredDepths()); + } + else if (firstCurveData->depthUnit() == RimDefines::UNIT_FEET) + { + lasFile->AddLog("DEPTH", "FT", "Depth in feet", firstCurveData->measuredDepths()); + } + + if (firstCurveData->tvDepths().size()) + { + lasFile->AddLog("TVDMSL", "M", "True vertical depth in meters", firstCurveData->tvDepths()); + } + + double minDepth = 0.0; + double maxDepth = 0.0; + firstCurveData->calculateMDRange(&minDepth, &maxDepth); + + lasFile->setStartDepth(minDepth); + lasFile->setStopDepth(maxDepth); + + if (firstCurveData->depthUnit() == RimDefines::UNIT_METER) + { + lasFile->setDepthUnit("M"); + } + else if (firstCurveData->depthUnit() == RimDefines::UNIT_FEET) + { + lasFile->setDepthUnit("FT"); + } + + for (auto curveData : m_logCurveData) + { + curveData.appendDataToLasFile(lasFile); + } + } + + +private: + const RigWellLogCurveData* curveDataForFirstCurve() const + { + CVF_ASSERT(m_logCurveData.size() > 0); + + return m_logCurveData[0].curveData(); + } + +private: + QString m_wellName; + QString m_caseName; + QString m_date; + + RimDefines::DepthUnitType m_depthUnit; + std::vector m_depthValues; + + std::vector m_logCurveData; +}; + + +/* +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +SingleChannelData::SingleChannelData(const std::string& channelName, const std::string& unit, const std::string& comment, const RigWellLogCurveData* curveData) + : m_channelName(channelName), + m_unit(unit), + m_comment(comment), + m_curveData(curveData) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void SingleChannelData::appendDataToLasFile(NRLib::LasWell* lasFile) const +{ + CVF_ASSERT(lasFile); + + double minX = HUGE_VAL; + + double absentValue = SingleChannelData::createAbsentValue(minX); + + std::vector wellLogValues = m_curveData->xValues(); + for (size_t vIdx = 0; vIdx < wellLogValues.size(); vIdx++) + { + double value = wellLogValues[vIdx]; + if (value == HUGE_VAL || value == -HUGE_VAL || value != value) + { + wellLogValues[vIdx] = absentValue; + } + } + + lasFile->AddLog(m_channelName, m_unit, m_comment, wellLogValues); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::string SingleChannelData::channelName() const +{ + return m_channelName; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RigWellLogCurveData* SingleChannelData::curveData() const +{ + return m_curveData; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double SingleChannelData::createAbsentValue(double lowestDataValue) +{ + double absentValue = -999.0; + + while (absentValue > lowestDataValue) + { + absentValue *= 10; + absentValue -= 9; + } + + return absentValue - 0.25; +} +*/ + +/* +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::string SingleLasFileMetaData::generateFilename() const +{ + QString f; + QString separator("-"); + + if (!m_wellName.isEmpty()) + { + f += m_wellName; + } + + if (!m_caseName.isEmpty()) + { + if (!f.isEmpty()) f += separator; + f += m_caseName; + } + + // Add property name if only one curve is exported + if (m_logCurveData.size() == 1) + { + if (!f.isEmpty()) f += separator; + f += QString::fromStdString(m_logCurveData[0].channelName()); + } + + if (!m_date.isEmpty()) + { + if (!f.isEmpty()) f += separator; + f += m_date; + } + + QString cleanFileName = f.trimmed(); + cleanFileName.replace(".", "_"); + cleanFileName.replace(",", "_"); + cleanFileName.replace(":", "_"); + cleanFileName.replace(";", "_"); + cleanFileName.replace(" ", "_"); + cleanFileName.replace("/", "_"); + cleanFileName.replace(QRegExp("_+"), "_"); + + cleanFileName += ".las"; + + return cleanFileName.toStdString(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void SingleLasFileMetaData::appendDataToLasFile(NRLib::LasWell* lasFile) const +{ + if (m_logCurveData.size() == 0) return; + + lasFile->addWellInfo("WELL", m_wellName.toStdString()); + + QString wellLogDate = m_date; + wellLogDate.replace(".", "_"); + wellLogDate.replace(" ", "_"); + + lasFile->addWellInfo("DATE", wellLogDate.toStdString()); + + const RigWellLogCurveData* firstCurveData = curveDataForFirstCurve(); + + if (firstCurveData->depthUnit() == RimDefines::UNIT_METER) + { + lasFile->AddLog("DEPTH", "M", "Depth in meters", firstCurveData->measuredDepths()); + } + else if (firstCurveData->depthUnit() == RimDefines::UNIT_FEET) + { + lasFile->AddLog("DEPTH", "FT", "Depth in feet", firstCurveData->measuredDepths()); + } + + if (firstCurveData->tvDepths().size()) + { + lasFile->AddLog("TVDMSL", "M", "True vertical depth in meters", firstCurveData->tvDepths()); + } + + double minDepth = 0.0; + double maxDepth = 0.0; + firstCurveData->calculateMDRange(&minDepth, &maxDepth); + + lasFile->setStartDepth(minDepth); + lasFile->setStopDepth(maxDepth); + + if (firstCurveData->depthUnit() == RimDefines::UNIT_METER) + { + lasFile->setDepthUnit("M"); + } + else if (firstCurveData->depthUnit() == RimDefines::UNIT_FEET) + { + lasFile->setDepthUnit("FT"); + } + + for (auto curveData : m_logCurveData) + { + curveData.appendDataToLasFile(lasFile); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RigWellLogCurveData* SingleLasFileMetaData::curveDataForFirstCurve() const +{ + CVF_ASSERT(m_logCurveData.size() > 0); + + return m_logCurveData[0].curveData(); +} +*/ + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigLasFileExporter::RigLasFileExporter(const std::vector& curves) + : m_curves(curves) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RigLasFileExporter::writeToFolder(const QString& exportFolder) +{ + std::vector lasFileDescriptions = createLasFileDescriptions(m_curves); + + for (auto lasFileDescr : lasFileDescriptions) + { + NRLib::LasWell lasFile; + lasFile.setVersionInfo("2.0"); + + lasFileDescr.appendDataToLasFile(&lasFile); + + QDir dir(exportFolder); + QString fileName = dir.absoluteFilePath(QString::fromStdString(lasFileDescr.generateFilename())); + if (QFile::exists(fileName)) + { + QString txt = QString("File %1 exists.\n\nDo you want to overwrite the file?").arg(fileName); + int ret = QMessageBox::question(NULL, "LAS File Export", + txt, + QMessageBox::Yes | QMessageBox::No, + QMessageBox::Yes); + + if (ret != QMessageBox::Yes) continue; + } + + std::vector commentHeader; + lasFile.WriteToFile(fileName.toStdString(), commentHeader); + } + + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigLasFileExporter::createLasFileDescriptions(const std::vector& curves) +{ + std::vector eclipseCurves; + std::vector geoMechCurves; + std::vector externalLasCurves; + + for (auto curve : curves) + { + RimWellLogExtractionCurve* extractionCurve = dynamic_cast(curve); + if (extractionCurve) + { + if (extractionCurve->isEclipseCurve()) + { + eclipseCurves.push_back(extractionCurve); + } + else + { + geoMechCurves.push_back(extractionCurve); + } + } + else + { + externalLasCurves.push_back(curve); + } + } + + // External LAS files + + std::vector lasFileDescriptions; + + appendLasFileDescriptions(externalLasCurves, &lasFileDescriptions); + appendLasFileDescriptions(eclipseCurves, &lasFileDescriptions); + appendLasFileDescriptions(geoMechCurves, &lasFileDescriptions); + + return lasFileDescriptions; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigLasFileExporter::appendLasFileDescriptions(const std::vector& curves, std::vector* lasFileDescriptions) +{ + CVF_ASSERT(lasFileDescriptions); + + struct CurveCollectionDefinition + { + CurveCollectionDefinition(const QString& wellName, const QString& caseName, const QString& date) + : m_wellName(wellName), + m_caseName(caseName), + m_date(date) + {} + + bool isEqual(RimWellLogCurve* curve, const QString& caseName) + { + if (m_wellName == curve->wellName() && + m_caseName == caseName && + m_date == curve->wellDate()) + { + return true; + } + + return false; + } + + QString m_wellName; + QString m_caseName; + QString m_date; + }; + + std::vector curveDefinitions; + for (auto curve : curves) + { + QString caseName = caseNameFromCurve(curve); + + bool found = false; + for (auto curveDef : curveDefinitions) + { + if (curveDef.isEqual(curve, caseName)) + { + found = true; + } + } + + if (!found) + { + CurveCollectionDefinition curveDefCandidate(curve->wellName(), caseName, curve->wellDate()); + curveDefinitions.push_back(curveDefCandidate); + } + } + + for (auto curveDef : curveDefinitions) + { + SingleLasFileMetaData singleLasFileMeta; + singleLasFileMeta.setWellName(curveDef.m_wellName); + singleLasFileMeta.setCaseName(curveDef.m_caseName); + singleLasFileMeta.setDate(curveDef.m_date); + + for (auto curve : curves) + { + if (curveDef.isEqual(curve, caseNameFromCurve(curve))) + { + singleLasFileMeta.addLogData(curve->wellLogChannelName().toStdString(), "NO_UNIT", "", curve->curveData()); + } + } + + lasFileDescriptions->push_back(singleLasFileMeta); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RigLasFileExporter::caseNameFromCurve(RimWellLogCurve* curve) +{ + QString caseName; + + RimWellLogExtractionCurve* extractionCurve = dynamic_cast(curve); + if (extractionCurve) + { + caseName = extractionCurve->caseName(); + } + else + { + caseName = "unnamed"; + } + + return caseName; +} + diff --git a/ApplicationCode/ReservoirDataModel/RigLasFileExporter.h b/ApplicationCode/ReservoirDataModel/RigLasFileExporter.h new file mode 100644 index 0000000000..a63305ed14 --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigLasFileExporter.h @@ -0,0 +1,43 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include + +#include + +class RimWellLogCurve; +class SingleLasFileMetaData; + +class RigLasFileExporter +{ +public: + RigLasFileExporter(const std::vector& curves); + + bool writeToFolder(const QString& exportFolder); + +private: + std::vector createLasFileDescriptions(const std::vector& curves); + void appendLasFileDescriptions(const std::vector& curves, + std::vector* lasFileDescriptions); + QString caseNameFromCurve(RimWellLogCurve* curve); + +private: + std::vector m_curves; +};