mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
Refactor: Extract parser options from RicPasteAsciiDataToSummaryPlotFeatureUi
This commit is contained in:
1 parent
c79f7939b4
commit
d1d3ee129f
18 files changed
+114
-83
No files matched your search
+1
-1
@@ -153,7 +153,7 @@ std::vector<RimAsciiDataCurve*> RicPasteAsciiDataToSummaryPlotFeature::parseCurv
|
|||||||
const RicPasteAsciiDataToSummaryPlotFeatureUi& settings )
|
const RicPasteAsciiDataToSummaryPlotFeatureUi& settings )
|
||||||
{
|
{
|
||||||
std::vector<RimAsciiDataCurve*> curves;
|
std::vector<RimAsciiDataCurve*> curves;
|
||||||
const AsciiDataParseOptions& parseOptions = settings.parseOptions();
|
const RifAsciiDataParseOptions& parseOptions = settings.parseOptions();
|
||||||
RifCsvUserDataPastedTextParser parser = RifCsvUserDataPastedTextParser( data );
|
RifCsvUserDataPastedTextParser parser = RifCsvUserDataPastedTextParser( data );
|
||||||
|
|
||||||
if ( !parser.parse( parseOptions ) )
|
if ( !parser.parse( parseOptions ) )
|
||||||
|
|||||||
+2
-2
@@ -233,9 +233,9 @@ RicPasteAsciiDataToSummaryPlotFeatureUi::UiMode RicPasteAsciiDataToSummaryPlotFe
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
const AsciiDataParseOptions RicPasteAsciiDataToSummaryPlotFeatureUi::parseOptions() const
|
const RifAsciiDataParseOptions RicPasteAsciiDataToSummaryPlotFeatureUi::parseOptions() const
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
|
|
||||||
parseOptions.assumeNumericDataColumns = true;
|
parseOptions.assumeNumericDataColumns = true;
|
||||||
parseOptions.plotTitle = m_plotTitle();
|
parseOptions.plotTitle = m_plotTitle();
|
||||||
|
|||||||
+4
-40
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "RimPlotCurve.h"
|
#include "RimPlotCurve.h"
|
||||||
|
|
||||||
|
#include "RifAsciiDataParseOptions.h"
|
||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
#include "RifEclipseSummaryAddressDefines.h"
|
#include "RifEclipseSummaryAddressDefines.h"
|
||||||
|
|
||||||
@@ -32,43 +33,6 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
//==================================================================================================
|
|
||||||
///
|
|
||||||
//==================================================================================================
|
|
||||||
class AsciiDataParseOptions
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
AsciiDataParseOptions()
|
|
||||||
: useCustomDateTimeFormat( false )
|
|
||||||
, assumeNumericDataColumns( false )
|
|
||||||
, curveSymbolSkipDistance( 0.0f )
|
|
||||||
, defaultCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QString plotTitle;
|
|
||||||
QString curvePrefix;
|
|
||||||
QString decimalSeparator;
|
|
||||||
QLocale locale;
|
|
||||||
|
|
||||||
bool useCustomDateTimeFormat;
|
|
||||||
QString dateFormat;
|
|
||||||
QString timeFormat;
|
|
||||||
QString fallbackDateTimeFormat;
|
|
||||||
QString dateTimeFormat;
|
|
||||||
QString cellSeparator;
|
|
||||||
QString timeSeriesColumnName;
|
|
||||||
|
|
||||||
QDateTime startDateTime;
|
|
||||||
bool assumeNumericDataColumns;
|
|
||||||
|
|
||||||
RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory;
|
|
||||||
|
|
||||||
RiuQwtPlotCurveDefines::LineStyleEnum curveLineStyle;
|
|
||||||
RiuPlotCurveSymbol::PointSymbolEnum curveSymbol;
|
|
||||||
float curveSymbolSkipDistance;
|
|
||||||
};
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@@ -132,9 +96,9 @@ public:
|
|||||||
void setUiModeImport( const QString& fileName );
|
void setUiModeImport( const QString& fileName );
|
||||||
void setUiModePasteText( const QString& text );
|
void setUiModePasteText( const QString& text );
|
||||||
|
|
||||||
UiMode uiModeImport() const;
|
UiMode uiModeImport() const;
|
||||||
const AsciiDataParseOptions parseOptions() const;
|
const RifAsciiDataParseOptions parseOptions() const;
|
||||||
void setCreateNewPlot();
|
void setCreateNewPlot();
|
||||||
|
|
||||||
QString contextString() const;
|
QString contextString() const;
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RifSummaryCalculationExporter.h
|
${CMAKE_CURRENT_LIST_DIR}/RifSummaryCalculationExporter.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RifPolygonReader.h
|
${CMAKE_CURRENT_LIST_DIR}/RifPolygonReader.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RifOsduWellPathReader.h
|
${CMAKE_CURRENT_LIST_DIR}/RifOsduWellPathReader.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RifAsciiDataParseOptions.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCE_GROUP_SOURCE_FILES
|
set(SOURCE_GROUP_SOURCE_FILES
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2024- Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "RiuPlotCurveSymbol.h"
|
||||||
|
#include "RiuQwtPlotCurveDefines.h"
|
||||||
|
|
||||||
|
#include "RifEclipseSummaryAddressDefines.h"
|
||||||
|
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RifAsciiDataParseOptions
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RifAsciiDataParseOptions()
|
||||||
|
: useCustomDateTimeFormat( false )
|
||||||
|
, assumeNumericDataColumns( false )
|
||||||
|
, curveSymbolSkipDistance( 0.0f )
|
||||||
|
, defaultCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QString plotTitle;
|
||||||
|
QString curvePrefix;
|
||||||
|
QString decimalSeparator;
|
||||||
|
QLocale locale;
|
||||||
|
|
||||||
|
bool useCustomDateTimeFormat;
|
||||||
|
QString dateFormat;
|
||||||
|
QString timeFormat;
|
||||||
|
QString fallbackDateTimeFormat;
|
||||||
|
QString dateTimeFormat;
|
||||||
|
QString cellSeparator;
|
||||||
|
QString timeSeriesColumnName;
|
||||||
|
|
||||||
|
QDateTime startDateTime;
|
||||||
|
bool assumeNumericDataColumns;
|
||||||
|
|
||||||
|
RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory;
|
||||||
|
|
||||||
|
RiuQwtPlotCurveDefines::LineStyleEnum curveLineStyle;
|
||||||
|
RiuPlotCurveSymbol::PointSymbolEnum curveSymbol;
|
||||||
|
float curveSymbolSkipDistance;
|
||||||
|
};
|
||||||
@@ -49,7 +49,7 @@ RifCsvUserData::~RifCsvUserData()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifCsvUserData::parse( const QString& fileName, const AsciiDataParseOptions& parseOptions, QString* errorText )
|
bool RifCsvUserData::parse( const QString& fileName, const RifAsciiDataParseOptions& parseOptions, QString* errorText )
|
||||||
{
|
{
|
||||||
m_allResultAddresses.clear();
|
m_allResultAddresses.clear();
|
||||||
m_mapFromAddressToResultIndex.clear();
|
m_mapFromAddressToResultIndex.clear();
|
||||||
|
|||||||
@@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
#include "RifSummaryReaderInterface.h"
|
#include "RifSummaryReaderInterface.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -30,6 +28,7 @@ class QString;
|
|||||||
|
|
||||||
class RifCsvUserDataParser;
|
class RifCsvUserDataParser;
|
||||||
class RifEclipseSummaryAddress;
|
class RifEclipseSummaryAddress;
|
||||||
|
class RifAsciiDataParseOptions;
|
||||||
class TableData;
|
class TableData;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@@ -42,7 +41,7 @@ public:
|
|||||||
RifCsvUserData();
|
RifCsvUserData();
|
||||||
~RifCsvUserData() override;
|
~RifCsvUserData() override;
|
||||||
|
|
||||||
bool parse( const QString& fileName, const AsciiDataParseOptions& parseOptions, QString* errorText = nullptr );
|
bool parse( const QString& fileName, const RifAsciiDataParseOptions& parseOptions, QString* errorText = nullptr );
|
||||||
|
|
||||||
std::vector<time_t> timeSteps( const RifEclipseSummaryAddress& resultAddress ) const override;
|
std::vector<time_t> timeSteps( const RifEclipseSummaryAddress& resultAddress ) const override;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
|
|
||||||
|
#include "RifAsciiDataParseOptions.h"
|
||||||
#include "RifEclipseSummaryAddress.h"
|
#include "RifEclipseSummaryAddress.h"
|
||||||
#include "RifEclipseUserDataKeywordTools.h"
|
#include "RifEclipseUserDataKeywordTools.h"
|
||||||
#include "RifEclipseUserDataParserTools.h"
|
#include "RifEclipseUserDataParserTools.h"
|
||||||
@@ -29,8 +30,6 @@
|
|||||||
#include "RiaStdStringTools.h"
|
#include "RiaStdStringTools.h"
|
||||||
#include "RiaTextStringTools.h"
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
|
||||||
|
|
||||||
#include "caf.h"
|
#include "caf.h"
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
@@ -85,7 +84,7 @@ RifCsvUserDataParser::~RifCsvUserDataParser()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifCsvUserDataParser::parse( const AsciiDataParseOptions& parseOptions,
|
bool RifCsvUserDataParser::parse( const RifAsciiDataParseOptions& parseOptions,
|
||||||
const std::map<QString, QString>& nameMapping,
|
const std::map<QString, QString>& nameMapping,
|
||||||
const std::map<QString, std::pair<QString, double>>& unitMapping )
|
const std::map<QString, std::pair<QString, double>>& unitMapping )
|
||||||
{
|
{
|
||||||
@@ -152,7 +151,7 @@ std::vector<int> RifCsvUserDataParser::parseLineBasedHeader( QStringList headerC
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifCsvUserDataParser::parseColumnInfo( const AsciiDataParseOptions& parseOptions )
|
bool RifCsvUserDataParser::parseColumnInfo( const RifAsciiDataParseOptions& parseOptions )
|
||||||
{
|
{
|
||||||
QTextStream* dataStream = openDataStream();
|
QTextStream* dataStream = openDataStream();
|
||||||
std::vector<Column> columnInfoList;
|
std::vector<Column> columnInfoList;
|
||||||
@@ -169,7 +168,7 @@ bool RifCsvUserDataParser::parseColumnInfo( const AsciiDataParseOptions& parseOp
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RifCsvUserDataParser::previewText( int lineCount, const AsciiDataParseOptions& parseOptions )
|
QString RifCsvUserDataParser::previewText( int lineCount, const RifAsciiDataParseOptions& parseOptions )
|
||||||
{
|
{
|
||||||
QTextStream* stream = openDataStream();
|
QTextStream* stream = openDataStream();
|
||||||
|
|
||||||
@@ -230,7 +229,7 @@ QString RifCsvUserDataParser::previewText( int lineCount, const AsciiDataParseOp
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QStringList RifCsvUserDataParser::timeColumnPreviewData( int lineCount, const AsciiDataParseOptions& parseOptions )
|
QStringList RifCsvUserDataParser::timeColumnPreviewData( int lineCount, const RifAsciiDataParseOptions& parseOptions )
|
||||||
{
|
{
|
||||||
QStringList timeStrings;
|
QStringList timeStrings;
|
||||||
|
|
||||||
@@ -307,7 +306,7 @@ RifCsvUserDataParser::CsvLayout RifCsvUserDataParser::determineCsvLayout()
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifCsvUserDataParser::parseColumnInfo( QTextStream* dataStream,
|
bool RifCsvUserDataParser::parseColumnInfo( QTextStream* dataStream,
|
||||||
const AsciiDataParseOptions& parseOptions,
|
const RifAsciiDataParseOptions& parseOptions,
|
||||||
std::vector<Column>* columnInfoList,
|
std::vector<Column>* columnInfoList,
|
||||||
const std::map<QString, QString>& nameMapping,
|
const std::map<QString, QString>& nameMapping,
|
||||||
const std::map<QString, std::pair<QString, double>>& unitMapping )
|
const std::map<QString, std::pair<QString, double>>& unitMapping )
|
||||||
@@ -465,7 +464,7 @@ bool RifCsvUserDataParser::parseColumnInfo( QTextStream*
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifCsvUserDataParser::parseColumnBasedData( const AsciiDataParseOptions& parseOptions,
|
bool RifCsvUserDataParser::parseColumnBasedData( const RifAsciiDataParseOptions& parseOptions,
|
||||||
const std::map<QString, QString>& nameMapping,
|
const std::map<QString, QString>& nameMapping,
|
||||||
const std::map<QString, std::pair<QString, double>>& unitMapping )
|
const std::map<QString, std::pair<QString, double>>& unitMapping )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class Column;
|
class Column;
|
||||||
class AsciiDataParseOptions;
|
class RifAsciiDataParseOptions;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
RifCsvUserDataParser( QString* errorText = nullptr );
|
RifCsvUserDataParser( QString* errorText = nullptr );
|
||||||
virtual ~RifCsvUserDataParser();
|
virtual ~RifCsvUserDataParser();
|
||||||
|
|
||||||
bool parse( const AsciiDataParseOptions& parseOptions,
|
bool parse( const RifAsciiDataParseOptions& parseOptions,
|
||||||
const std::map<QString, QString>& nameMapping = {},
|
const std::map<QString, QString>& nameMapping = {},
|
||||||
const std::map<QString, std::pair<QString, double>>& unitMapping = {} );
|
const std::map<QString, std::pair<QString, double>>& unitMapping = {} );
|
||||||
const TableData& tableData() const;
|
const TableData& tableData() const;
|
||||||
@@ -57,9 +57,9 @@ public:
|
|||||||
const Column* columnInfo( size_t columnIndex ) const;
|
const Column* columnInfo( size_t columnIndex ) const;
|
||||||
const Column* dateTimeColumn() const;
|
const Column* dateTimeColumn() const;
|
||||||
|
|
||||||
bool parseColumnInfo( const AsciiDataParseOptions& parseOptions );
|
bool parseColumnInfo( const RifAsciiDataParseOptions& parseOptions );
|
||||||
QString previewText( int lineCount, const AsciiDataParseOptions& parseOptions );
|
QString previewText( int lineCount, const RifAsciiDataParseOptions& parseOptions );
|
||||||
QStringList timeColumnPreviewData( int lineCount, const AsciiDataParseOptions& parseOptions );
|
QStringList timeColumnPreviewData( int lineCount, const RifAsciiDataParseOptions& parseOptions );
|
||||||
|
|
||||||
CsvLayout determineCsvLayout();
|
CsvLayout determineCsvLayout();
|
||||||
|
|
||||||
@@ -76,11 +76,11 @@ private:
|
|||||||
std::vector<int> parseLineBasedHeader( QStringList headerCols );
|
std::vector<int> parseLineBasedHeader( QStringList headerCols );
|
||||||
|
|
||||||
bool parseColumnInfo( QTextStream* dataStream,
|
bool parseColumnInfo( QTextStream* dataStream,
|
||||||
const AsciiDataParseOptions& parseOptions,
|
const RifAsciiDataParseOptions& parseOptions,
|
||||||
std::vector<Column>* columnInfoList,
|
std::vector<Column>* columnInfoList,
|
||||||
const std::map<QString, QString>& nameMapping = {},
|
const std::map<QString, QString>& nameMapping = {},
|
||||||
const std::map<QString, std::pair<QString, double>>& unitMapping = {} );
|
const std::map<QString, std::pair<QString, double>>& unitMapping = {} );
|
||||||
bool parseColumnBasedData( const AsciiDataParseOptions& parseOptions,
|
bool parseColumnBasedData( const RifAsciiDataParseOptions& parseOptions,
|
||||||
const std::map<QString, QString>& nameMapping = {},
|
const std::map<QString, QString>& nameMapping = {},
|
||||||
const std::map<QString, std::pair<QString, double>>& unitMapping = {} );
|
const std::map<QString, std::pair<QString, double>>& unitMapping = {} );
|
||||||
bool parseLineBasedData();
|
bool parseLineBasedData();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "RiaTextStringTools.h"
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "RifAsciiDataParseOptions.h"
|
||||||
|
|
||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ std::pair<cvf::ref<RigWellPath>, QString> RifOsduWellPathReader::parseCsv( const
|
|||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
RifCsvUserDataPastedTextParser parser( content, &errorMessage );
|
RifCsvUserDataPastedTextParser parser( content, &errorMessage );
|
||||||
|
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.cellSeparator = ",";
|
parseOptions.cellSeparator = ",";
|
||||||
parseOptions.decimalSeparator = ".";
|
parseOptions.decimalSeparator = ".";
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "RiaTextStringTools.h"
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "RifAsciiDataParseOptions.h"
|
||||||
|
|
||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ std::vector<std::pair<int, std::vector<cvf::Vec3d>>> RifPolygonReader::parseText
|
|||||||
{
|
{
|
||||||
RifCsvUserDataPastedTextParser parser( content, errorMessage );
|
RifCsvUserDataPastedTextParser parser( content, errorMessage );
|
||||||
|
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.cellSeparator = ",";
|
parseOptions.cellSeparator = ",";
|
||||||
parseOptions.decimalSeparator = ".";
|
parseOptions.decimalSeparator = ".";
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
#include "RifEclipseSummaryAddress.h"
|
#include "RifEclipseSummaryAddress.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "RifAsciiDataParseOptions.h"
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
@@ -49,7 +49,7 @@ bool RifReaderObservedData::open( const QString&
|
|||||||
const QString& identifierName,
|
const QString& identifierName,
|
||||||
RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory )
|
RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory )
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yyyy-MM-dd";
|
parseOptions.dateFormat = "yyyy-MM-dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = caf::norwegianLocale();
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include "RifEclipseUserDataKeywordTools.h"
|
#include "RifEclipseUserDataKeywordTools.h"
|
||||||
#include "RifEclipseUserDataParserTools.h"
|
#include "RifEclipseUserDataParserTools.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "RifAsciiDataParseOptions.h"
|
||||||
|
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ bool RifRevealCsvSectionSummaryReader::parse( const QString&
|
|||||||
m_allResultAddresses.clear();
|
m_allResultAddresses.clear();
|
||||||
m_mapFromAddressToResultIndex.clear();
|
m_mapFromAddressToResultIndex.clear();
|
||||||
|
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.useCustomDateTimeFormat = true;
|
parseOptions.useCustomDateTimeFormat = true;
|
||||||
parseOptions.dateTimeFormat = "dd.MM.yyyy hh:mm:ss";
|
parseOptions.dateTimeFormat = "dd.MM.yyyy hh:mm:ss";
|
||||||
parseOptions.fallbackDateTimeFormat = "dd.MM.yyyy";
|
parseOptions.fallbackDateTimeFormat = "dd.MM.yyyy";
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "RifEclipseUserDataKeywordTools.h"
|
#include "RifEclipseUserDataKeywordTools.h"
|
||||||
#include "RifEclipseUserDataParserTools.h"
|
#include "RifEclipseUserDataParserTools.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "RifAsciiDataParseOptions.h"
|
||||||
|
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ std::pair<bool, QString> RifStimPlanCsvSummaryReader::parse( const QString& file
|
|||||||
// Split files on strange header line (starts with ",Date").
|
// Split files on strange header line (starts with ",Date").
|
||||||
QString fileContents = in.readAll();
|
QString fileContents = in.readAll();
|
||||||
|
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.useCustomDateTimeFormat = true;
|
parseOptions.useCustomDateTimeFormat = true;
|
||||||
parseOptions.dateTimeFormat = "m.zzz";
|
parseOptions.dateTimeFormat = "m.zzz";
|
||||||
parseOptions.cellSeparator = ",";
|
parseOptions.cellSeparator = ",";
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#include "RifSummaryReaderInterface.h"
|
#include "RifSummaryReaderInterface.h"
|
||||||
#include "RifSummaryReaderMultipleFiles.h"
|
#include "RifSummaryReaderMultipleFiles.h"
|
||||||
|
|
||||||
|
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||||
|
|
||||||
#include "RimCalculatedSummaryCurveReader.h"
|
#include "RimCalculatedSummaryCurveReader.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCalculationCollection.h"
|
#include "RimSummaryCalculationCollection.h"
|
||||||
|
|||||||
@@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
#include "RimObservedSummaryData.h"
|
#include "RimObservedSummaryData.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
|
||||||
|
|
||||||
#include "cafPdmChildField.h"
|
#include "cafPdmChildField.h"
|
||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
@@ -30,6 +28,7 @@
|
|||||||
class RifSummaryReaderInterface;
|
class RifSummaryReaderInterface;
|
||||||
class RifCalculatedSummaryCurveReader;
|
class RifCalculatedSummaryCurveReader;
|
||||||
class RifMultipleSummaryReaders;
|
class RifMultipleSummaryReaders;
|
||||||
|
class RicPasteAsciiDataToSummaryPlotFeatureUi;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "RigWellLogCurveData.h"
|
#include "RigWellLogCurveData.h"
|
||||||
#include "RigWellPathGeometryTools.h"
|
#include "RigWellPathGeometryTools.h"
|
||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "RifAsciiDataParseOptions.h"
|
||||||
|
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaStringEncodingTools.h"
|
#include "RiaStringEncodingTools.h"
|
||||||
@@ -63,7 +63,7 @@ bool RigWellLogCsvFile::open( const QString& fileName, RigWellPath* wellPath, QS
|
|||||||
|
|
||||||
RifCsvUserDataFileParser parser( fileName, errorMessage );
|
RifCsvUserDataFileParser parser( fileName, errorMessage );
|
||||||
|
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.useCustomDateTimeFormat = true;
|
parseOptions.useCustomDateTimeFormat = true;
|
||||||
parseOptions.dateTimeFormat = "dd.MM.yyyy hh:mm:ss";
|
parseOptions.dateTimeFormat = "dd.MM.yyyy hh:mm:ss";
|
||||||
parseOptions.fallbackDateTimeFormat = "dd.MM.yyyy";
|
parseOptions.fallbackDateTimeFormat = "dd.MM.yyyy";
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
#include "RiaQDateTimeTools.h"
|
#include "RiaQDateTimeTools.h"
|
||||||
|
|
||||||
|
#include "RifAsciiDataParseOptions.h"
|
||||||
#include "RifColumnBasedUserData.h"
|
#include "RifColumnBasedUserData.h"
|
||||||
#include "RifColumnBasedUserDataParser.h"
|
#include "RifColumnBasedUserDataParser.h"
|
||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
@@ -21,7 +23,7 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RifColumnBasedAsciiParserTest, TestDateFormatYyyymmddWithDash )
|
TEST( RifColumnBasedAsciiParserTest, TestDateFormatYyyymmddWithDash )
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yyyy-MM-dd";
|
parseOptions.dateFormat = "yyyy-MM-dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = caf::norwegianLocale();
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
@@ -78,7 +80,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDateFormatYyyymmddWithDash )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RifColumnBasedAsciiParserTest, TestDateFormatYymmddWithDot )
|
TEST( RifColumnBasedAsciiParserTest, TestDateFormatYymmddWithDot )
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yy.MM.dd";
|
parseOptions.dateFormat = "yy.MM.dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = caf::norwegianLocale();
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
@@ -133,7 +135,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDateFormatYymmddWithDot )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RifColumnBasedAsciiParserTest, TestDateFormatDdmmyyWithDot )
|
TEST( RifColumnBasedAsciiParserTest, TestDateFormatDdmmyyWithDot )
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "dd.MM.yy";
|
parseOptions.dateFormat = "dd.MM.yy";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = caf::norwegianLocale();
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
@@ -187,7 +189,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDateFormatDdmmyyWithDot )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RifColumnBasedAsciiParserTest, TestDecimalLocaleNorwegian )
|
TEST( RifColumnBasedAsciiParserTest, TestDecimalLocaleNorwegian )
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yy.MM.dd";
|
parseOptions.dateFormat = "yy.MM.dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.decimalSeparator = ",";
|
parseOptions.decimalSeparator = ",";
|
||||||
@@ -255,7 +257,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDecimalLocaleNorwegian )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RifColumnBasedAsciiParserTest, TestDecimalLocaleC )
|
TEST( RifColumnBasedAsciiParserTest, TestDecimalLocaleC )
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yy.MM.dd";
|
parseOptions.dateFormat = "yy.MM.dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = QLocale::c();
|
parseOptions.locale = QLocale::c();
|
||||||
@@ -339,7 +341,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDecimalLocaleC )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RifColumnBasedAsciiParserTest, TestCellSeparatorComma )
|
TEST( RifColumnBasedAsciiParserTest, TestCellSeparatorComma )
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yy.MM.dd";
|
parseOptions.dateFormat = "yy.MM.dd";
|
||||||
parseOptions.cellSeparator = ",";
|
parseOptions.cellSeparator = ",";
|
||||||
parseOptions.locale = QLocale::c();
|
parseOptions.locale = QLocale::c();
|
||||||
@@ -406,7 +408,7 @@ TEST( RifColumnBasedAsciiParserTest, TestCellSeparatorComma )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RifColumnBasedAsciiParserTest, ThreeLinesHeader )
|
TEST( RifColumnBasedAsciiParserTest, ThreeLinesHeader )
|
||||||
{
|
{
|
||||||
AsciiDataParseOptions parseOptions;
|
RifAsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "dd.MM.yyyy";
|
parseOptions.dateFormat = "dd.MM.yyyy";
|
||||||
parseOptions.cellSeparator = ";";
|
parseOptions.cellSeparator = ";";
|
||||||
parseOptions.locale = QLocale::c();
|
parseOptions.locale = QLocale::c();
|
||||||
|
|||||||
Reference in new issue
Block a user