#1294 - Renaming and moving ascii export feature, now RicAsciiExportWellLogPlotFeature. Adding functionality for getting data to export (but formatting is still missing)

This commit is contained in:
astridkbjorke
2017-03-09 14:27:41 +01:00
parent 7f511f7004
commit b89efbf73e
9 changed files with 91 additions and 20 deletions

View File

@@ -257,6 +257,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
commandIds << "RicPasteWellLogTrackFeature";
commandIds << "Separator";
commandIds << "RicNewWellLogPlotTrackFeature";
commandIds << "RicAsciiExportWellLogPlotFeature";
}
else if (dynamic_cast<RimWellLogTrack*>(uiItem))
{
@@ -355,7 +356,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
else if (dynamic_cast<RimWellAllocationPlot*>(uiItem))
{
commandIds << "RicAddStoredWellAllocationPlotFeature";
commandIds << "RicAsciiExportWellAllocationPlotFeature";
}

View File

@@ -31,6 +31,8 @@
#include <math.h>
#include "RimWellAllocationPlot.h"
#include "RimWellLogCurve.h"
#include "RigWellLogCurveData.h"
#define RI_LOGPLOT_MINDEPTH_DEFAULT 0.0
#define RI_LOGPLOT_MAXDEPTH_DEFAULT 1000.0
@@ -383,6 +385,42 @@ QWidget* RimWellLogPlot::viewWidget()
return m_viewer;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellLogPlot::asciiDataForPlotExport()
{
QString out;
for (RimWellLogTrack* track : m_tracks)
{
out += "\n" + track->description() + "\n";
std::vector<RimWellLogCurve* > curves = track->curvesVector();
for (RimWellLogCurve* curve : curves)
{
out += curve->curveName() + "\n";
const RigWellLogCurveData* curveData = curve->curveData();
std::vector<double> xPlotValues = curveData->xPlotValues();
std::vector<double> depths;
depths = curveData->measuredDepthPlotValues(RimDefines::UNIT_NONE);
if (!(depths.size() == xPlotValues.size())) return out;
for (int i = xPlotValues.size()-1; i >= 0; i--)
{
out += QString::number(depths[i]) + " " + QString::number(xPlotValues[i]) + " \n";
}
}
}
return out;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -99,6 +99,8 @@ public:
virtual void zoomAll() override;
virtual QWidget* viewWidget() override;
QString asciiDataForPlotExport();
protected:
// Overridden PDM methods

View File

@@ -491,3 +491,27 @@ std::vector<RimWellFlowRateCurve*> RimWellLogTrack::visibleStackedCurves()
return stackedCurves;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellLogTrack::description()
{
return m_userName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogCurve* > RimWellLogTrack::curvesVector()
{
std::vector<RimWellLogCurve* > curvesVector;
for (RimWellLogCurve* curve : curves)
{
curvesVector.push_back(curve);
}
return curvesVector;
}

View File

@@ -69,6 +69,11 @@ public:
void setLogarithmicScale(bool enable);
std::vector<RimWellFlowRateCurve*> visibleStackedCurves();
QString description();
std::vector<RimWellLogCurve* > curvesVector();
protected:
// Overridden PDM methods
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);