mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
This commit is contained in:
committed by
GitHub
parent
200d5c65a3
commit
503d946bc1
@@ -33,11 +33,12 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifEnsembleFractureStatisticsExporter::writeAsStimPlanXml( const std::vector<std::shared_ptr<RigSlice2D>>& statistics,
|
||||
const std::vector<std::pair<QString, QString>>& properties,
|
||||
const QString& filePath,
|
||||
const std::vector<double>& gridXs,
|
||||
const std::vector<double>& gridYs,
|
||||
double time,
|
||||
RiaDefines::EclipseUnitSystem unitSystem )
|
||||
const QString& filePath,
|
||||
const std::vector<double>& gridXs,
|
||||
const std::vector<double>& gridYs,
|
||||
double time,
|
||||
RiaDefines::EclipseUnitSystem unitSystem,
|
||||
RigStimPlanFractureDefinition::Orientation orientation )
|
||||
{
|
||||
QFile data( filePath );
|
||||
if ( !data.open( QFile::WriteOnly | QFile::Truncate ) )
|
||||
@@ -47,6 +48,7 @@ bool RifEnsembleFractureStatisticsExporter::writeAsStimPlanXml( const std::vecto
|
||||
|
||||
QTextStream stream( &data );
|
||||
appendHeaderToStream( stream );
|
||||
appendOrientationToStream( stream, orientation );
|
||||
appendGridDimensionsToStream( stream, gridXs, gridYs, unitSystem );
|
||||
appendPropertiesToStream( stream, statistics, properties, gridYs, time );
|
||||
appendFooterToStream( stream );
|
||||
@@ -105,6 +107,19 @@ void RifEnsembleFractureStatisticsExporter::appendPropertiesToStream(
|
||||
stream << "</properties>" << endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEnsembleFractureStatisticsExporter::appendOrientationToStream( QTextStream& stream,
|
||||
RigStimPlanFractureDefinition::Orientation orientation )
|
||||
{
|
||||
if ( orientation != RigStimPlanFractureDefinition::Orientation::UNDEFINED )
|
||||
{
|
||||
QString orientationString = getStringForOrientation( orientation );
|
||||
stream << QString( "<orientation>%1</orientation>" ).arg( orientationString ) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -150,3 +165,16 @@ QString RifEnsembleFractureStatisticsExporter::getStringForUnitSystem( RiaDefine
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEnsembleFractureStatisticsExporter::getStringForOrientation( RigStimPlanFractureDefinition::Orientation orientation )
|
||||
{
|
||||
if ( orientation == RigStimPlanFractureDefinition::Orientation::TRANSVERSE )
|
||||
return "transverse";
|
||||
else if ( orientation == RigStimPlanFractureDefinition::Orientation::LONGITUDINAL )
|
||||
return "longitudinal";
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "RigStimPlanFractureDefinition.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
@@ -40,10 +42,12 @@ public:
|
||||
const std::vector<double>& gridXs,
|
||||
const std::vector<double>& gridYs,
|
||||
double time,
|
||||
RiaDefines::EclipseUnitSystem unitSystem );
|
||||
RiaDefines::EclipseUnitSystem unitSystem,
|
||||
RigStimPlanFractureDefinition::Orientation orientation );
|
||||
|
||||
private:
|
||||
static void appendHeaderToStream( QTextStream& stream );
|
||||
static void appendOrientationToStream( QTextStream& stream, RigStimPlanFractureDefinition::Orientation orientation );
|
||||
static void appendGridDimensionsToStream( QTextStream& stream,
|
||||
const std::vector<double>& gridXs,
|
||||
const std::vector<double>& gridYs,
|
||||
@@ -56,4 +60,6 @@ private:
|
||||
static void appendFooterToStream( QTextStream& stream );
|
||||
|
||||
static QString getStringForUnitSystem( RiaDefines::EclipseUnitSystem unitSystem );
|
||||
|
||||
static QString getStringForOrientation( RigStimPlanFractureDefinition::Orientation orientation );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user