From 8dd0df79016b375c11edeef090212e030c7665cc Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 19 May 2017 09:13:22 +0200 Subject: [PATCH] #1501 Fishbones : Increase number of coordinate digits when exporting laterals --- .../RicExportFishbonesLateralsFeature.cpp | 15 ++++++++++++++- .../RicExportFishbonesLateralsFeature.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.cpp b/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.cpp index 7b42466127..458dc70047 100644 --- a/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.cpp +++ b/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.cpp @@ -96,8 +96,13 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked) for (auto coordMD : coordsAndMD) { + int numberOfDecimals = 2; + // Export X and Y unchanged, invert sign of Z to get TVD, export MD unchanged - stream << coordMD.first.x() << " " << coordMD.first.y() << " " << -coordMD.first.z() << " " << coordMD.second << endl; + stream << formatNumber( coordMD.first.x(), numberOfDecimals); + stream << " " << formatNumber( coordMD.first.y(), numberOfDecimals); + stream << " " << formatNumber(-coordMD.first.z(), numberOfDecimals); + stream << " " << formatNumber( coordMD.second, numberOfDecimals) << endl; } stream << -999 << endl << endl; } @@ -107,6 +112,14 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked) RiaLogging::info("Completed export of Fishbones well path laterals to : " + completeFilename); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RicExportFishbonesLateralsFeature::formatNumber(double val, int numberOfDecimals) +{ + return QString("%1").arg(val, 0, 'f', numberOfDecimals); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.h b/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.h index 8715f4cfdc..1fa1472b84 100644 --- a/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.h +++ b/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.h @@ -35,5 +35,6 @@ protected: virtual bool isCommandEnabled() override; private: + static QString formatNumber(double val, int numberOfDecimals); static RimWellPath* selectedWellPath(); };