From ebd922836bc30bac29907808e326c8cf8cf6cd51 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 26 Aug 2020 12:04:11 +0200 Subject: [PATCH] #6374 Update Geological.FRK file export to new xml format. --- .../RifFractureModelPlotExporter.cpp | 40 ++++++++++++------- .../RifFractureModelPlotExporter.h | 2 + 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/ApplicationCode/FileInterface/RifFractureModelPlotExporter.cpp b/ApplicationCode/FileInterface/RifFractureModelPlotExporter.cpp index ddfd8b58d2..fa575b3214 100644 --- a/ApplicationCode/FileInterface/RifFractureModelPlotExporter.cpp +++ b/ApplicationCode/FileInterface/RifFractureModelPlotExporter.cpp @@ -114,33 +114,45 @@ bool RifFractureModelPlotExporter::writeToFile( RimFractureModelPlot* plot, bool } QTextStream stream( &data ); + appendHeaderToStream( stream ); for ( QString label : labels ) { appendToStream( stream, label, values[label] ); } + appendFooterToStream( stream ); + return true; } +void RifFractureModelPlotExporter::appendHeaderToStream( QTextStream& stream ) +{ + stream << "" << endl << "" << endl; +} + void RifFractureModelPlotExporter::appendToStream( QTextStream& stream, const QString& label, const std::vector& values ) { - stream << "" - << "\n" - << label << "\n" - << "" - << "\n" - << 1 << "\n" - << "" - << "\n" - << values.size() << "\n" - << "" - << "\n"; + stream << "" << endl + << "" << endl + << label << endl + << "" << endl + << "" << endl + << 1 << endl + << "" << endl + << "" << endl + << values.size() << endl + << "" << endl + << "" << endl; for ( auto val : values ) { - stream << val << "\n"; + stream << val << endl; } - stream << "" - << "\n"; + stream << "" << endl << "" << endl; +} + +void RifFractureModelPlotExporter::appendFooterToStream( QTextStream& stream ) +{ + stream << "" << endl; } diff --git a/ApplicationCode/FileInterface/RifFractureModelPlotExporter.h b/ApplicationCode/FileInterface/RifFractureModelPlotExporter.h index 98c153125e..bd7a54ea92 100644 --- a/ApplicationCode/FileInterface/RifFractureModelPlotExporter.h +++ b/ApplicationCode/FileInterface/RifFractureModelPlotExporter.h @@ -33,5 +33,7 @@ public: static bool writeToFile( RimFractureModelPlot* plot, bool useDetailedFluidLoss, const QString& filepath ); private: + static void appendHeaderToStream( QTextStream& stream ); static void appendToStream( QTextStream& stream, const QString& label, const std::vector& values ); + static void appendFooterToStream( QTextStream& stream ); };