mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#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:
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
virtual void zoomAll() override;
|
||||
virtual QWidget* viewWidget() override;
|
||||
|
||||
QString asciiDataForPlotExport();
|
||||
|
||||
protected:
|
||||
|
||||
// Overridden PDM methods
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user