mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Support different units when importing and exporting WBS LAS.
This commit is contained in:
@@ -49,7 +49,8 @@ std::vector<QString> RicExportToLasFileFeature::exportToLasFiles( const QString&
|
||||
bool exportTvdRkb,
|
||||
bool capitalizeFileNames,
|
||||
bool alwaysOverwrite,
|
||||
double resampleInterval )
|
||||
double resampleInterval,
|
||||
bool convertCurveUnits )
|
||||
{
|
||||
std::vector<RimWellLogCurve*> allCurves;
|
||||
std::vector<RimPlot*> plots = plotWindow->visiblePlots();
|
||||
@@ -77,7 +78,8 @@ std::vector<QString> RicExportToLasFileFeature::exportToLasFiles( const QString&
|
||||
rkbDiffs,
|
||||
capitalizeFileNames,
|
||||
alwaysOverwrite,
|
||||
resampleInterval );
|
||||
resampleInterval,
|
||||
convertCurveUnits );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +93,8 @@ std::vector<QString> RicExportToLasFileFeature::exportToLasFiles( const QString&
|
||||
const std::vector<double>& rkbDiffs,
|
||||
bool capitalizeFileNames,
|
||||
bool alwaysOverwrite,
|
||||
double resampleInterval )
|
||||
double resampleInterval,
|
||||
bool convertCurveUnits )
|
||||
{
|
||||
RigLasFileExporter lasExporter( curves );
|
||||
|
||||
@@ -107,7 +110,8 @@ std::vector<QString> RicExportToLasFileFeature::exportToLasFiles( const QString&
|
||||
lasExporter.setRkbDiffs( wellNames, rkbDiffs );
|
||||
}
|
||||
|
||||
writtenFiles = lasExporter.writeToFolder( exportFolder, filePrefix, capitalizeFileNames, alwaysOverwrite );
|
||||
writtenFiles =
|
||||
lasExporter.writeToFolder( exportFolder, filePrefix, capitalizeFileNames, alwaysOverwrite, convertCurveUnits );
|
||||
|
||||
// Remember the path to next time
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory( "WELL_LOGS_DIR", exportFolder );
|
||||
@@ -148,6 +152,7 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
featureUi.filePrefix = "WBS_";
|
||||
featureUi.capitalizeFileName = true;
|
||||
featureUi.setUnitConversionOptionEnabled( true );
|
||||
}
|
||||
|
||||
{
|
||||
@@ -163,7 +168,7 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
|
||||
"",
|
||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
||||
RicExportFeatureImpl::configureForExport( propertyDialog.dialogButtonBox() );
|
||||
propertyDialog.resize( QSize( 400, 330 ) );
|
||||
propertyDialog.resize( QSize( 400, 360 ) );
|
||||
|
||||
if ( propertyDialog.exec() == QDialog::Accepted && !featureUi.exportFolder().isEmpty() )
|
||||
{
|
||||
@@ -190,7 +195,9 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
|
||||
rkbDiffs,
|
||||
featureUi.capitalizeFileName,
|
||||
false,
|
||||
resampleInterval );
|
||||
resampleInterval,
|
||||
featureUi.curveUnitConversion() ==
|
||||
RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_WITH_STANDARD_UNITS );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ public:
|
||||
bool exportTvdRkb,
|
||||
bool capitalizeFileNames,
|
||||
bool alwaysOverwrite,
|
||||
double resampleInterval );
|
||||
double resampleInterval,
|
||||
bool convertCurveUnits );
|
||||
|
||||
static std::vector<QString> exportToLasFiles( const QString& exportFolder,
|
||||
const QString& filePrefix,
|
||||
@@ -51,7 +52,8 @@ public:
|
||||
const std::vector<double>& rkbDiffs,
|
||||
bool capitalizeFileNames,
|
||||
bool alwaysOverwrite,
|
||||
double resampleInterval );
|
||||
double resampleInterval,
|
||||
bool convertCurveUnits );
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
|
||||
@@ -24,6 +24,20 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void RicExportToLasFileResampleUi::CurveUnitConversionEnum::setUp()
|
||||
{
|
||||
addItem( RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_NORMALIZED, "NORMALIZED", "Current Plot Units" );
|
||||
addItem( RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_WITH_STANDARD_UNITS,
|
||||
"STANDARD_UNITS",
|
||||
"Convert to Standard Import Units" );
|
||||
setDefault( RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_WITH_STANDARD_UNITS );
|
||||
}
|
||||
|
||||
} // End namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicExportToLasFileObj, "RicExportToLasFileObj" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -42,6 +56,7 @@ CAF_PDM_SOURCE_INIT( RicExportToLasFileResampleUi, "RicExportToLasFileResampleUi
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicExportToLasFileResampleUi::RicExportToLasFileResampleUi( void )
|
||||
: m_enableCurveUnitConversion( false )
|
||||
{
|
||||
CAF_PDM_InitObject( "Resample LAS curves for export", "", "", "" );
|
||||
|
||||
@@ -49,6 +64,7 @@ RicExportToLasFileResampleUi::RicExportToLasFileResampleUi( void )
|
||||
exportFolder.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitField( &filePrefix, "FilePrefix", QString( "" ), "File Prefix", "", "", "" );
|
||||
CAF_PDM_InitField( &capitalizeFileName, "CapitalizeFileName", false, "Capitalize File Name", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &curveUnitConversion, "CurveUnitConversion", "Curve Units", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &activateResample, "ActivateResample", false, "Resample Curve Data", "", "", "" );
|
||||
activateResample.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
@@ -108,6 +124,14 @@ void RicExportToLasFileResampleUi::setRkbDiffs( const std::vector<QString>& well
|
||||
updateFieldVisibility();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportToLasFileResampleUi::setUnitConversionOptionEnabled( bool enabled )
|
||||
{
|
||||
m_enableCurveUnitConversion = enabled;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -172,6 +196,12 @@ void RicExportToLasFileResampleUi::defineUiOrdering( QString uiConfigName, caf::
|
||||
uiOrdering.add( &exportFolder );
|
||||
uiOrdering.add( &filePrefix );
|
||||
uiOrdering.add( &capitalizeFileName );
|
||||
|
||||
if ( m_enableCurveUnitConversion )
|
||||
{
|
||||
uiOrdering.add( &curveUnitConversion );
|
||||
}
|
||||
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Resampling" );
|
||||
|
||||
@@ -188,4 +218,6 @@ void RicExportToLasFileResampleUi::defineUiOrdering( QString uiConfigName, caf::
|
||||
{
|
||||
group->add( &obj->tvdrkbOffset );
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
@@ -42,6 +43,14 @@ class RicExportToLasFileResampleUi : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum class CurveUnitConversion
|
||||
{
|
||||
EXPORT_NORMALIZED,
|
||||
EXPORT_WITH_STANDARD_UNITS
|
||||
};
|
||||
using CurveUnitConversionEnum = caf::AppEnum<CurveUnitConversion>;
|
||||
|
||||
public:
|
||||
RicExportToLasFileResampleUi( void );
|
||||
~RicExportToLasFileResampleUi() override;
|
||||
@@ -53,10 +62,12 @@ public:
|
||||
caf::PdmField<bool> activateResample;
|
||||
caf::PdmField<double> resampleInterval;
|
||||
|
||||
caf::PdmField<bool> exportTvdrkb;
|
||||
caf::PdmField<bool> exportTvdrkb;
|
||||
caf::PdmField<CurveUnitConversionEnum> curveUnitConversion;
|
||||
|
||||
void tvdrkbDiffForWellPaths( std::vector<double>* rkbDiffs );
|
||||
void setRkbDiffs( const std::vector<QString>& wellNames, const std::vector<double>& rkbDiffs );
|
||||
void setUnitConversionOptionEnabled( bool enabled );
|
||||
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
@@ -73,4 +84,6 @@ private:
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RicExportToLasFileObj*> m_tvdrkbOffsets;
|
||||
|
||||
bool m_enableCurveUnitConversion;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user