From 88ca478babc0b1f824776836e19447585df0e7ae Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 23 Nov 2021 14:55:54 +0100 Subject: [PATCH] Janitor : Rename variable and function names --- .../RicExportSelectedWellPathsFeature.cpp | 28 ++++++++++---- .../RicExportSelectedWellPathsFeature.h | 4 +- .../RifStimPlanModelDeviationFrkExporter.cpp | 12 ++++-- .../RigWellPathGeometryExporter.cpp | 38 +++++++++---------- .../RigWellPathGeometryExporter.h | 28 +++++++------- .../RigWellPathGeometryExporter-Test.cpp | 8 +++- 6 files changed, 71 insertions(+), 47 deletions(-) diff --git a/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.cpp index 18cd995f7b..47bf6e2bbd 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.cpp @@ -65,10 +65,16 @@ void RicExportSelectedWellPathsFeature::exportWellPath( gsl::not_null tvdValues; std::vector mdValues; - bool useMdRkb = false; - RigWellPathGeometryExporter::exportWellPathGeometry( wellPath, mdStepSize, xValues, yValues, tvdValues, mdValues, useMdRkb ); + bool showTextMdRkb = false; + RigWellPathGeometryExporter::computeWellPathDataForExport( wellPath, + mdStepSize, + xValues, + yValues, + tvdValues, + mdValues, + showTextMdRkb ); - writeWellPathGeometryToStream( *stream, wellPath->name(), xValues, yValues, tvdValues, mdValues, useMdRkb, writeProjectInfo ); + writeWellPathGeometryToStream( *stream, wellPath->name(), xValues, yValues, tvdValues, mdValues, showTextMdRkb, writeProjectInfo ); filePtr->close(); RiaLogging::info( QString( "Exported well geometry to %1" ).arg( filePtr->fileName() ) ); @@ -81,7 +87,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre const RigWellPath& wellPathGeom, const QString& exportName, double mdStepSize, - bool useMdRkb, + bool showTextMdRkb, double rkbOffset, bool writeProjectInfo ) { @@ -90,8 +96,14 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre std::vector tvdValues; std::vector mdValues; - RigWellPathGeometryExporter::exportWellPathGeometry( wellPathGeom, mdStepSize, rkbOffset, xValues, yValues, tvdValues, mdValues ); - writeWellPathGeometryToStream( stream, exportName, xValues, yValues, tvdValues, mdValues, useMdRkb, writeProjectInfo ); + RigWellPathGeometryExporter::computeWellPathDataForExport( wellPathGeom, + mdStepSize, + rkbOffset, + xValues, + yValues, + tvdValues, + mdValues ); + writeWellPathGeometryToStream( stream, exportName, xValues, yValues, tvdValues, mdValues, showTextMdRkb, writeProjectInfo ); } //-------------------------------------------------------------------------------------------------- @@ -103,7 +115,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre const std::vector& yValues, const std::vector& tvdValues, const std::vector& mdValues, - bool useMdRkb, + bool showTextMdRkb, bool writeProjectInfo ) { RifTextDataTableFormatter formatter( stream ); @@ -124,7 +136,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre formatter.header( { { "X", numberFormat, RIGHT }, { "Y", numberFormat, RIGHT }, { "TVDMSL", numberFormat, RIGHT }, - { useMdRkb ? "MDRKB" : "MDMSL", numberFormat, RIGHT } } ); + { showTextMdRkb ? "MDRKB" : "MDMSL", numberFormat, RIGHT } } ); for ( size_t i = 0; i < xValues.size(); i++ ) { diff --git a/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.h b/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.h index c169cebf2b..985a25fd5d 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.h +++ b/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.h @@ -65,7 +65,7 @@ class RicExportSelectedWellPathsFeature : public caf::CmdFeature const RigWellPath& wellPath, const QString& exportName, double mdStepSize, - bool useMdRkb, + bool showTextMdRkb, double rkbOffset, bool writeProjectInfo ); @@ -76,7 +76,7 @@ private: const std::vector& yValues, const std::vector& tvdValues, const std::vector& mdValues, - bool useMdRkb, + bool showTextMdRkb, bool writeProjectInfo ); bool isCommandEnabled() override; diff --git a/ApplicationLibCode/FileInterface/RifStimPlanModelDeviationFrkExporter.cpp b/ApplicationLibCode/FileInterface/RifStimPlanModelDeviationFrkExporter.cpp index a1120f8f8e..d22e3416ce 100644 --- a/ApplicationLibCode/FileInterface/RifStimPlanModelDeviationFrkExporter.cpp +++ b/ApplicationLibCode/FileInterface/RifStimPlanModelDeviationFrkExporter.cpp @@ -48,13 +48,19 @@ bool RifStimPlanModelDeviationFrkExporter::writeToFile( RimStimPlanModel* stimPl QTextStream stream( &data ); appendHeaderToStream( stream ); - bool useMdRkb = false; - double mdStepSize = 5.0; + bool showTextMdRkb = false; + double mdStepSize = 5.0; std::vector xValues; std::vector yValues; std::vector tvdValues; std::vector mdValues; - RigWellPathGeometryExporter::exportWellPathGeometry( wellPath, mdStepSize, xValues, yValues, tvdValues, mdValues, useMdRkb ); + RigWellPathGeometryExporter::computeWellPathDataForExport( wellPath, + mdStepSize, + xValues, + yValues, + tvdValues, + mdValues, + showTextMdRkb ); convertFromMeterToFeet( mdValues ); convertFromMeterToFeet( tvdValues ); diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.cpp b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.cpp index 872b8b177d..313500285a 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.cpp @@ -28,18 +28,18 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigWellPathGeometryExporter::exportWellPathGeometry( gsl::not_null wellPath, - double mdStepSize, - std::vector& xValues, - std::vector& yValues, - std::vector& tvdValues, - std::vector& mdValues, - bool& useMdRkb ) +void RigWellPathGeometryExporter::computeWellPathDataForExport( gsl::not_null wellPath, + double mdStepSize, + std::vector& xValues, + std::vector& yValues, + std::vector& tvdValues, + std::vector& mdValues, + bool& showTextMdRkb ) { auto wellPathGeom = wellPath->wellPathGeometry(); if ( !wellPathGeom ) return; - useMdRkb = false; + showTextMdRkb = false; double rkbOffset = 0.0; { @@ -52,30 +52,30 @@ void RigWellPathGeometryExporter::exportWellPathGeometry( gsl::not_nullgeometryDefinition()->airGap() != 0.0 ) { - useMdRkb = true; - rkbOffset = modeledWellPath->geometryDefinition()->airGap(); + showTextMdRkb = true; + rkbOffset = modeledWellPath->geometryDefinition()->airGap(); } } if ( dynamic_cast( topLevelWellPath ) ) { - useMdRkb = true; + showTextMdRkb = true; } } - exportWellPathGeometry( *wellPathGeom, mdStepSize, rkbOffset, xValues, yValues, tvdValues, mdValues ); + computeWellPathDataForExport( *wellPathGeom, mdStepSize, rkbOffset, xValues, yValues, tvdValues, mdValues ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigWellPathGeometryExporter::exportWellPathGeometry( const RigWellPath& wellPathGeom, - double mdStepSize, - double rkbOffset, - std::vector& xValues, - std::vector& yValues, - std::vector& tvdValues, - std::vector& mdValues ) +void RigWellPathGeometryExporter::computeWellPathDataForExport( const RigWellPath& wellPathGeom, + double mdStepSize, + double rkbOffset, + std::vector& xValues, + std::vector& yValues, + std::vector& tvdValues, + std::vector& mdValues ) { double currMd = wellPathGeom.measuredDepths().front() - mdStepSize; double endMd = wellPathGeom.measuredDepths().back(); diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.h b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.h index f367924c70..25637bf69e 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.h +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.h @@ -31,19 +31,19 @@ class RigWellPath; class RigWellPathGeometryExporter { public: - static void exportWellPathGeometry( gsl::not_null wellPath, - double mdStepSize, - std::vector& xValues, - std::vector& yValues, - std::vector& tvdValues, - std::vector& mdValues, - bool& useMdRkb ); + static void computeWellPathDataForExport( gsl::not_null wellPath, + double mdStepSize, + std::vector& xValues, + std::vector& yValues, + std::vector& tvdValues, + std::vector& mdValues, + bool& showTextMdRkb ); - static void exportWellPathGeometry( const RigWellPath& wellPath, - double mdStepSize, - double rkbOffset, - std::vector& xValues, - std::vector& yValues, - std::vector& tvdValues, - std::vector& mdValues ); + static void computeWellPathDataForExport( const RigWellPath& wellPath, + double mdStepSize, + double rkbOffset, + std::vector& xValues, + std::vector& yValues, + std::vector& tvdValues, + std::vector& mdValues ); }; diff --git a/ApplicationLibCode/UnitTests/RigWellPathGeometryExporter-Test.cpp b/ApplicationLibCode/UnitTests/RigWellPathGeometryExporter-Test.cpp index c293643933..c3d9ea5932 100644 --- a/ApplicationLibCode/UnitTests/RigWellPathGeometryExporter-Test.cpp +++ b/ApplicationLibCode/UnitTests/RigWellPathGeometryExporter-Test.cpp @@ -49,7 +49,13 @@ TEST( RigWellPathGeometryExporter, VerticalPath ) std::vector yValues; std::vector tvdValues; std::vector mdValues; - RigWellPathGeometryExporter::exportWellPathGeometry( rigWellPath, mdStepSize, rkbOffset, xValues, yValues, tvdValues, mdValues ); + RigWellPathGeometryExporter::computeWellPathDataForExport( rigWellPath, + mdStepSize, + rkbOffset, + xValues, + yValues, + tvdValues, + mdValues ); double firstMd = inputMds.front(); double lastMd = inputMds.back();