diff --git a/ApplicationCode/ProjectDataModel/RimWellLogCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogCurve.h index b1966c0ea0..85ab089fdd 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogCurve.h @@ -83,8 +83,8 @@ protected: virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly); - QPointer m_ownerQwtTrack; - RiuLineSegmentQwtPlotCurve* m_qwtPlotCurve; + QPointer m_ownerQwtTrack; + RiuLineSegmentQwtPlotCurve* m_qwtPlotCurve; cvf::ref m_curveData; caf::PdmField m_showCurve; diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogFile.cpp b/ApplicationCode/ReservoirDataModel/RigWellLogFile.cpp index f5eaed1157..8c3dc5d36a 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogFile.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellLogFile.cpp @@ -30,8 +30,6 @@ #include #include // Needed for HUGE_VAL on Linux -#define RIG_WELL_FOOTPERMETER 3.2808399 - //-------------------------------------------------------------------------------------------------- /// Find the largest possible "ususal" value to use for absent data (-999.25, -9999.25, etc.) @@ -172,33 +170,18 @@ std::vector RigWellLogFile::values(const QString& name) const if (m_wellLogFile->HasContLog(name.toStdString())) { - if (name == m_depthLogName && (depthUnitString().toUpper() == "F" || depthUnitString().toUpper() == "FT")) - { - std::vector footValues = m_wellLogFile->GetContLog(name.toStdString()); - - std::vector meterValues; - meterValues.reserve(footValues.size()); - - for (size_t vIdx = 0; vIdx < footValues.size(); vIdx++) - { - meterValues.push_back(footValues[vIdx]/RIG_WELL_FOOTPERMETER); - } - - return meterValues; - } - - std::vector values = m_wellLogFile->GetContLog(name.toStdString()); + std::vector logValues = m_wellLogFile->GetContLog(name.toStdString()); - for (size_t vIdx = 0; vIdx < values.size(); vIdx++) + for (size_t vIdx = 0; vIdx < logValues.size(); vIdx++) { - if (m_wellLogFile->IsMissing(values[vIdx])) + if (m_wellLogFile->IsMissing(logValues[vIdx])) { // Convert missing ("NULL") values to HUGE_VAL - values[vIdx] = HUGE_VAL; + logValues[vIdx] = HUGE_VAL; } } - return values; + return logValues; } return std::vector(); @@ -279,7 +262,16 @@ bool RigWellLogFile::exportToLasFile(const RimWellLogCurve* curve, const QString NRLib::LasWell lasFile; lasFile.addWellInfo("WELL", curve->wellName().trimmed().toStdString()); lasFile.addWellInfo("DATE", wellLogDate.toStdString()); - lasFile.AddLog("DEPTH", "M", "Depth in meters", curveData->measuredDepths()); + + if (curveData->depthUnit() == RimDefines::UNIT_METER) + { + lasFile.AddLog("DEPTH", "M", "Depth in meters", curveData->measuredDepths()); + } + else if (curveData->depthUnit() == RimDefines::UNIT_FEET) + { + lasFile.AddLog("DEPTH", "FT", "Depth in feet", curveData->measuredDepths()); + } + lasFile.AddLog(wellLogChannelName.trimmed().toStdString(), "NO_UNIT", "", wellLogValues); lasFile.SetMissing(absentValue); @@ -289,7 +281,15 @@ bool RigWellLogFile::exportToLasFile(const RimWellLogCurve* curve, const QString lasFile.setStartDepth(minDepth); lasFile.setStopDepth(maxDepth); - lasFile.setDepthUnit("M"); + + if (curveData->depthUnit() == RimDefines::UNIT_METER) + { + lasFile.setDepthUnit("M"); + } + else if (curveData->depthUnit() == RimDefines::UNIT_FEET) + { + lasFile.setDepthUnit("FT"); + } lasFile.setVersionInfo("2.0"); diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogFile.h b/ApplicationCode/ReservoirDataModel/RigWellLogFile.h index 3d83d94f88..d269eba7d1 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogFile.h +++ b/ApplicationCode/ReservoirDataModel/RigWellLogFile.h @@ -51,14 +51,14 @@ public: std::vector depthValues() const; std::vector values(const QString& name) const; - QString depthUnitString() const; QString wellLogChannelUnitString(const QString& wellLogChannelName) const; RimDefines::DepthUnitType depthUnit() const; static bool exportToLasFile(const RimWellLogCurve* curve, const QString& fileName); private: - void close(); + void close(); + QString depthUnitString() const; NRLib::Well* m_wellLogFile; QStringList m_wellLogChannelNames;