mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4185 Implement data export for Grid Cross Plot
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimGridCrossPlot.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RiuGridCrossQwtPlot.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuQwtPlotTools.h"
|
||||
@@ -28,6 +29,7 @@
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include "qwt_legend.h"
|
||||
@@ -520,6 +522,45 @@ void RimGridCrossPlot::swapAllAxisProperties()
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridCrossPlot::asciiTitleForPlotExport(int curveSetIndex) const
|
||||
{
|
||||
if ((size_t)curveSetIndex < m_crossPlotCurveSets.size())
|
||||
{
|
||||
return m_crossPlotCurveSets[curveSetIndex]->createAutoName();
|
||||
}
|
||||
return "Data invalid";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridCrossPlot::asciiDataForPlotExport(int curveSetIndex) const
|
||||
{
|
||||
if ((size_t)curveSetIndex < m_crossPlotCurveSets.size())
|
||||
{
|
||||
QString asciiData;
|
||||
QTextStream stringStream(&asciiData);
|
||||
|
||||
RifEclipseDataTableFormatter formatter(stringStream);
|
||||
formatter.setCommentPrefix("");
|
||||
formatter.setTableRowPrependText("");
|
||||
formatter.setTableRowLineAppendText("");
|
||||
formatter.setColumnSpacing(3);
|
||||
|
||||
|
||||
m_crossPlotCurveSets[curveSetIndex]->exportFormattedData(formatter);
|
||||
formatter.tableCompleted();
|
||||
return asciiData;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Data invalid and may have been deleted.";
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user