mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-27 00:36:53 -06:00
#4136 Export of Flow Characteristics : Use CSV text export
This commit is contained in:
parent
5dc4e08a03
commit
3c644629df
@ -125,6 +125,8 @@ RiaPreferences::RiaPreferences(void)
|
||||
CAF_PDM_InitField(&holoLensDisableCertificateVerification, "holoLensDisableCertificateVerification", false, "Disable SSL Certificate Verification (HoloLens)", "", "", "");
|
||||
holoLensDisableCertificateVerification.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
CAF_PDM_InitField(&csvTextExportFieldSeparator, "csvTextExportFieldSeparator", QString(","), "CSV Text Export Field Separator", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_showProjectChangedDialog, "showProjectChangedDialog", true, "Show 'Project has changed' dialog", "", "", "");
|
||||
m_showProjectChangedDialog.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
@ -134,6 +136,7 @@ RiaPreferences::RiaPreferences(void)
|
||||
m_tabNames << "General";
|
||||
m_tabNames << "Eclipse";
|
||||
m_tabNames << "Scripting";
|
||||
m_tabNames << "Export";
|
||||
if (RiaApplication::enableDevelopmentFeatures())
|
||||
{
|
||||
m_tabNames << "System";
|
||||
@ -274,7 +277,11 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
scriptGroup->add(&scriptDirectories);
|
||||
scriptGroup->add(&scriptEditorExecutable);
|
||||
}
|
||||
else if (RiaApplication::enableDevelopmentFeatures() && uiConfigName == m_tabNames[3])
|
||||
else if (uiConfigName == m_tabNames[3])
|
||||
{
|
||||
uiOrdering.add(&csvTextExportFieldSeparator);
|
||||
}
|
||||
else if (RiaApplication::enableDevelopmentFeatures() && uiConfigName == m_tabNames[4])
|
||||
{
|
||||
uiOrdering.add(&m_appendClassNameToUiText);
|
||||
uiOrdering.add(&m_appendFieldKeywordToToolTipText);
|
||||
|
@ -109,6 +109,7 @@ public: // Pdm Fields
|
||||
caf::PdmField<SummaryRestartFilesImportModeType> summaryEnsembleImportMode;
|
||||
|
||||
caf::PdmField<bool> holoLensDisableCertificateVerification;
|
||||
caf::PdmField<QString> csvTextExportFieldSeparator;
|
||||
|
||||
protected:
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
|
@ -211,7 +211,7 @@ void RicShowPlotDataFeature::onActionTriggered(bool isChecked)
|
||||
QString title = "Data Content";
|
||||
{
|
||||
QString titleCandidate = RiaFeatureCommandContext::instance()->titleString();
|
||||
if (!titleCandidate.isEmpty()) titleCandidate = titleCandidate;
|
||||
if (!titleCandidate.isEmpty()) title = titleCandidate;
|
||||
}
|
||||
|
||||
RicShowPlotDataFeature::showTextWindow(title, content);
|
||||
|
@ -18,7 +18,10 @@
|
||||
|
||||
#include "RimFlowCharacteristicsPlot.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RifCsvDataTableFormatter.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
@ -697,10 +700,11 @@ double interpolate(std::vector<double>& xData, std::vector<double>& yData, doubl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFlowCharacteristicsPlot::curveDataAsText() const
|
||||
{
|
||||
QString fieldSeparator = RiaApplication::instance()->preferences()->csvTextExportFieldSeparator;
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream(&tableText);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
QTextStream stream(&tableText);
|
||||
RifCsvDataTableFormatter formatter(stream, fieldSeparator);
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("Date"),
|
||||
@ -720,7 +724,7 @@ QString RimFlowCharacteristicsPlot::curveDataAsText() const
|
||||
|
||||
for (const auto& timeIndex : m_currentlyPlottedTimeSteps)
|
||||
{
|
||||
QString dateString = timeStepDates[timeIndex].toString("yyyy-MM-DD");
|
||||
QString dateString = timeStepDates[timeIndex].toString("yyyy-MM-dd");
|
||||
|
||||
auto a = m_timeStepToFlowResultMap.find(timeIndex);
|
||||
if (a != m_timeStepToFlowResultMap.end())
|
||||
|
Loading…
Reference in New Issue
Block a user