mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #4870 from OPM/system-refactor-EclipseDataTableFormatter-rename
Rename RifEclipseOutputDataTable* to RifTextDataTable*
This commit is contained in:
commit
3cbbf1fd6e
@ -21,7 +21,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RicExportFeatureImpl.h"
|
||||
#include "RicMswExportInfo.h"
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "RicWellPathFractureReportItem.h"
|
||||
#include "RicWellPathFractureTextReportFeatureImpl.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
@ -719,22 +719,22 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile( RimEclips
|
||||
{
|
||||
QTextStream stream( exportFile.get() );
|
||||
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.setColumnSpacing( 2 );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "Grp" ),
|
||||
RifEclipseOutputTableColumn( "I" ),
|
||||
RifEclipseOutputTableColumn( "J" ),
|
||||
RifEclipseOutputTableColumn( "RefDepth" ),
|
||||
RifEclipseOutputTableColumn( "Type" ),
|
||||
RifEclipseOutputTableColumn( "DrainRad" ),
|
||||
RifEclipseOutputTableColumn( "GasInEq" ),
|
||||
RifEclipseOutputTableColumn( "AutoShut" ),
|
||||
RifEclipseOutputTableColumn( "XFlow" ),
|
||||
RifEclipseOutputTableColumn( "FluidPVT" ),
|
||||
RifEclipseOutputTableColumn( "HydSDens" ),
|
||||
RifEclipseOutputTableColumn( "FluidInPlReg" )};
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Grp" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "RefDepth" ),
|
||||
RifTextDataTableColumn( "Type" ),
|
||||
RifTextDataTableColumn( "DrainRad" ),
|
||||
RifTextDataTableColumn( "GasInEq" ),
|
||||
RifTextDataTableColumn( "AutoShut" ),
|
||||
RifTextDataTableColumn( "XFlow" ),
|
||||
RifTextDataTableColumn( "FluidPVT" ),
|
||||
RifTextDataTableColumn( "HydSDens" ),
|
||||
RifTextDataTableColumn( "FluidInPlReg" )};
|
||||
|
||||
formatter.keyword( "WELSPECS" );
|
||||
formatter.header( header );
|
||||
@ -784,23 +784,23 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(
|
||||
{
|
||||
QTextStream stream( exportFile.get() );
|
||||
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.setColumnSpacing( 2 );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "Grp" ),
|
||||
RifEclipseOutputTableColumn( "LGR" ),
|
||||
RifEclipseOutputTableColumn( "I" ),
|
||||
RifEclipseOutputTableColumn( "J" ),
|
||||
RifEclipseOutputTableColumn( "RefDepth" ),
|
||||
RifEclipseOutputTableColumn( "Type" ),
|
||||
RifEclipseOutputTableColumn( "DrainRad" ),
|
||||
RifEclipseOutputTableColumn( "GasInEq" ),
|
||||
RifEclipseOutputTableColumn( "AutoShut" ),
|
||||
RifEclipseOutputTableColumn( "XFlow" ),
|
||||
RifEclipseOutputTableColumn( "FluidPVT" ),
|
||||
RifEclipseOutputTableColumn( "HydSDens" ),
|
||||
RifEclipseOutputTableColumn( "FluidInPlReg" )};
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Grp" ),
|
||||
RifTextDataTableColumn( "LGR" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "RefDepth" ),
|
||||
RifTextDataTableColumn( "Type" ),
|
||||
RifTextDataTableColumn( "DrainRad" ),
|
||||
RifTextDataTableColumn( "GasInEq" ),
|
||||
RifTextDataTableColumn( "AutoShut" ),
|
||||
RifTextDataTableColumn( "XFlow" ),
|
||||
RifTextDataTableColumn( "FluidPVT" ),
|
||||
RifTextDataTableColumn( "HydSDens" ),
|
||||
RifTextDataTableColumn( "FluidInPlReg" )};
|
||||
|
||||
formatter.keyword( "WELSPECL" );
|
||||
formatter.header( header );
|
||||
@ -931,7 +931,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatAndWpimultTables(
|
||||
|
||||
QTextStream stream( exportFile.get() );
|
||||
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.setColumnSpacing( 3 );
|
||||
|
||||
for ( const auto& gridCompletions : completionsPerGrid )
|
||||
@ -958,56 +958,52 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatAndWpimultTables(
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatter(
|
||||
RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData )
|
||||
RifTextDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData )
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header;
|
||||
std::vector<RifTextDataTableColumn> header;
|
||||
|
||||
if ( gridName.isEmpty() )
|
||||
{
|
||||
header = {RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "I" ),
|
||||
RifEclipseOutputTableColumn( "J" ),
|
||||
RifEclipseOutputTableColumn( "K1" ),
|
||||
RifEclipseOutputTableColumn( "K2" ),
|
||||
RifEclipseOutputTableColumn( "Status" ),
|
||||
RifEclipseOutputTableColumn( "SAT" ),
|
||||
RifEclipseOutputTableColumn( "TR",
|
||||
RifEclipseOutputTableDoubleFormatting(
|
||||
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifEclipseOutputTableColumn( "DIAM" ),
|
||||
RifEclipseOutputTableColumn( "KH",
|
||||
RifEclipseOutputTableDoubleFormatting(
|
||||
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifEclipseOutputTableColumn( "S" ),
|
||||
RifEclipseOutputTableColumn( "Df",
|
||||
RifEclipseOutputTableDoubleFormatting(
|
||||
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifEclipseOutputTableColumn( "DIR" )};
|
||||
header =
|
||||
{RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K1" ),
|
||||
RifTextDataTableColumn( "K2" ),
|
||||
RifTextDataTableColumn( "Status" ),
|
||||
RifTextDataTableColumn( "SAT" ),
|
||||
RifTextDataTableColumn( "TR",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIAM" ),
|
||||
RifTextDataTableColumn( "KH",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "S" ),
|
||||
RifTextDataTableColumn( "Df",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIR" )};
|
||||
|
||||
formatter.keyword( "COMPDAT" );
|
||||
}
|
||||
else
|
||||
{
|
||||
header = {RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "LgrName" ),
|
||||
RifEclipseOutputTableColumn( "I" ),
|
||||
RifEclipseOutputTableColumn( "J" ),
|
||||
RifEclipseOutputTableColumn( "K1" ),
|
||||
RifEclipseOutputTableColumn( "K2" ),
|
||||
RifEclipseOutputTableColumn( "Status" ),
|
||||
RifEclipseOutputTableColumn( "SAT" ),
|
||||
RifEclipseOutputTableColumn( "TR",
|
||||
RifEclipseOutputTableDoubleFormatting(
|
||||
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifEclipseOutputTableColumn( "DIAM" ),
|
||||
RifEclipseOutputTableColumn( "KH",
|
||||
RifEclipseOutputTableDoubleFormatting(
|
||||
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifEclipseOutputTableColumn( "S" ),
|
||||
RifEclipseOutputTableColumn( "Df",
|
||||
RifEclipseOutputTableDoubleFormatting(
|
||||
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifEclipseOutputTableColumn( "DIR" )};
|
||||
header =
|
||||
{RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "LgrName" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K1" ),
|
||||
RifTextDataTableColumn( "K2" ),
|
||||
RifTextDataTableColumn( "Status" ),
|
||||
RifTextDataTableColumn( "SAT" ),
|
||||
RifTextDataTableColumn( "TR",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIAM" ),
|
||||
RifTextDataTableColumn( "KH",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "S" ),
|
||||
RifTextDataTableColumn( "Df",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIR" )};
|
||||
|
||||
formatter.keyword( "COMPDATL" );
|
||||
}
|
||||
@ -1098,30 +1094,30 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeatureImpl::exportWpimultTableUsingFormatter(
|
||||
RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData )
|
||||
RifTextDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData )
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header;
|
||||
std::vector<RifTextDataTableColumn> header;
|
||||
|
||||
if ( gridName.isEmpty() )
|
||||
{
|
||||
header = {
|
||||
RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "Mult" ),
|
||||
RifEclipseOutputTableColumn( "I" ),
|
||||
RifEclipseOutputTableColumn( "J" ),
|
||||
RifEclipseOutputTableColumn( "K" ),
|
||||
RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Mult" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K" ),
|
||||
};
|
||||
formatter.keyword( "WPIMULT" );
|
||||
}
|
||||
else
|
||||
{
|
||||
header = {
|
||||
RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "LgrName" ),
|
||||
RifEclipseOutputTableColumn( "Mult" ),
|
||||
RifEclipseOutputTableColumn( "I" ),
|
||||
RifEclipseOutputTableColumn( "J" ),
|
||||
RifEclipseOutputTableColumn( "K" ),
|
||||
RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "LgrName" ),
|
||||
RifTextDataTableColumn( "Mult" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K" ),
|
||||
};
|
||||
formatter.keyword( "WPIMULTL" );
|
||||
}
|
||||
@ -1727,4 +1723,4 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCarfinForTemporaryLgrs( c
|
||||
{
|
||||
RicExportLgrFeature::exportLgrs( folder, lgrInfoForWell.first, lgrInfoForWell.second );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class RimWellPath;
|
||||
class RimWellPathValve;
|
||||
class RimWellPathFracture;
|
||||
class RimNonDarcyPerforationParameters;
|
||||
class RifEclipseDataTableFormatter;
|
||||
class RifTextDataTableFormatter;
|
||||
class RigVirtualPerforationTransmissibilities;
|
||||
class SubSegmentIntersectionInfo;
|
||||
|
||||
@ -189,11 +189,11 @@ private:
|
||||
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType );
|
||||
|
||||
static void exportCompdatTableUsingFormatter( RifEclipseDataTableFormatter& formatter,
|
||||
static void exportCompdatTableUsingFormatter( RifTextDataTableFormatter& formatter,
|
||||
const QString& gridName,
|
||||
const std::vector<RigCompletionData>& completionData );
|
||||
|
||||
static void exportWpimultTableUsingFormatter( RifEclipseDataTableFormatter& formatter,
|
||||
static void exportWpimultTableUsingFormatter( RifTextDataTableFormatter& formatter,
|
||||
const QString& gridName,
|
||||
const std::vector<RigCompletionData>& completionData );
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "RicMswValveAccumulators.h"
|
||||
#include "RicWellPathExportCompletionsFileTools.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
@ -190,8 +190,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEcl
|
||||
|
||||
RicMswExportInfo exportInfo = generateFracturesMswExportInfo( eclipseCase, wellPath, fractures );
|
||||
|
||||
QTextStream stream( exportFile.get() );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( exportFile.get() );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
generateWelsegsTable( formatter, exportInfo );
|
||||
generateCompsegTables( formatter, exportInfo );
|
||||
}
|
||||
@ -213,8 +213,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFishbones(
|
||||
|
||||
RicMswExportInfo exportInfo = generateFishbonesMswExportInfo( eclipseCase, wellPath, fishbonesSubs, true );
|
||||
|
||||
QTextStream stream( exportFile.get() );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( exportFile.get() );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
|
||||
generateWelsegsTable( formatter, exportInfo );
|
||||
generateCompsegTables( formatter, exportInfo );
|
||||
@ -239,8 +239,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations(
|
||||
|
||||
RicMswExportInfo exportInfo = generatePerforationsMswExportInfo( eclipseCase, wellPath, timeStep, perforationIntervals );
|
||||
|
||||
QTextStream stream( exportFile.get() );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( exportFile.get() );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
|
||||
generateWelsegsTable( formatter, exportInfo );
|
||||
generateCompsegTables( formatter, exportInfo );
|
||||
@ -251,8 +251,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifEclipseDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo )
|
||||
void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo )
|
||||
{
|
||||
formatter.keyword( "WELSEGS" );
|
||||
|
||||
@ -260,13 +260,13 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifEclipseDataTa
|
||||
double startTVD = exportInfo.initialTVD();
|
||||
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "Name" ),
|
||||
RifEclipseOutputTableColumn( "Dep 1" ),
|
||||
RifEclipseOutputTableColumn( "Tlen 1" ),
|
||||
RifEclipseOutputTableColumn( "Vol 1" ),
|
||||
RifEclipseOutputTableColumn( "Len&Dep" ),
|
||||
RifEclipseOutputTableColumn( "PresDrop" ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "Name" ),
|
||||
RifTextDataTableColumn( "Dep 1" ),
|
||||
RifTextDataTableColumn( "Tlen 1" ),
|
||||
RifTextDataTableColumn( "Vol 1" ),
|
||||
RifTextDataTableColumn( "Len&Dep" ),
|
||||
RifTextDataTableColumn( "PresDrop" ),
|
||||
};
|
||||
formatter.header( header );
|
||||
|
||||
@ -281,15 +281,15 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifEclipseDataTa
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "First Seg" ),
|
||||
RifEclipseOutputTableColumn( "Last Seg" ),
|
||||
RifEclipseOutputTableColumn( "Branch Num" ),
|
||||
RifEclipseOutputTableColumn( "Outlet Seg" ),
|
||||
RifEclipseOutputTableColumn( "Length" ),
|
||||
RifEclipseOutputTableColumn( "Depth Change" ),
|
||||
RifEclipseOutputTableColumn( "Diam" ),
|
||||
RifEclipseOutputTableColumn( "Rough" ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "First Seg" ),
|
||||
RifTextDataTableColumn( "Last Seg" ),
|
||||
RifTextDataTableColumn( "Branch Num" ),
|
||||
RifTextDataTableColumn( "Outlet Seg" ),
|
||||
RifTextDataTableColumn( "Length" ),
|
||||
RifTextDataTableColumn( "Depth Change" ),
|
||||
RifTextDataTableColumn( "Diam" ),
|
||||
RifTextDataTableColumn( "Rough" ),
|
||||
};
|
||||
formatter.header( header );
|
||||
}
|
||||
@ -351,7 +351,7 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifEclipseDataTa
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportMswCompletionsImpl::generateWelsegsSegments(
|
||||
RifEclipseDataTableFormatter& formatter,
|
||||
RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo,
|
||||
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes )
|
||||
{
|
||||
@ -436,7 +436,7 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsSegments(
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportMswCompletionsImpl::generateWelsegsCompletionCommentHeader(
|
||||
RifEclipseDataTableFormatter& formatter, RigCompletionData::CompletionType completionType )
|
||||
RifTextDataTableFormatter& formatter, RigCompletionData::CompletionType completionType )
|
||||
{
|
||||
if ( completionType == RigCompletionData::CT_UNDEFINED )
|
||||
{
|
||||
@ -465,8 +465,8 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsCompletionCommentHeader
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifEclipseDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo )
|
||||
void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo )
|
||||
{
|
||||
/*
|
||||
* TODO: Creating the regular perforation COMPSEGS table should come in here, before the others
|
||||
@ -509,7 +509,7 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifEclipseDataT
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportMswCompletionsImpl::generateCompsegTable(
|
||||
RifEclipseDataTableFormatter& formatter,
|
||||
RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo,
|
||||
bool exportSubGridIntersections,
|
||||
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes )
|
||||
@ -576,7 +576,7 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTable(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifEclipseDataTableFormatter& formatter,
|
||||
void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo,
|
||||
RigCompletionData::CompletionType completionType,
|
||||
bool exportSubGridIntersections )
|
||||
@ -600,28 +600,28 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifEclipseDataT
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Name" )};
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Name" )};
|
||||
formatter.header( header );
|
||||
formatter.add( exportInfo.wellPath()->completions()->wellNameForExport() );
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> allHeaders;
|
||||
std::vector<RifTextDataTableColumn> allHeaders;
|
||||
if ( exportSubGridIntersections )
|
||||
{
|
||||
allHeaders.push_back( RifEclipseOutputTableColumn( "Grid" ) );
|
||||
allHeaders.push_back( RifTextDataTableColumn( "Grid" ) );
|
||||
}
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> commonHeaders = {RifEclipseOutputTableColumn( "I" ),
|
||||
RifEclipseOutputTableColumn( "J" ),
|
||||
RifEclipseOutputTableColumn( "K" ),
|
||||
RifEclipseOutputTableColumn( "Branch no" ),
|
||||
RifEclipseOutputTableColumn( "Start Length" ),
|
||||
RifEclipseOutputTableColumn( "End Length" ),
|
||||
RifEclipseOutputTableColumn( "Dir Pen" ),
|
||||
RifEclipseOutputTableColumn( "End Range" ),
|
||||
RifEclipseOutputTableColumn( "Connection Depth" )};
|
||||
std::vector<RifTextDataTableColumn> commonHeaders = {RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K" ),
|
||||
RifTextDataTableColumn( "Branch no" ),
|
||||
RifTextDataTableColumn( "Start Length" ),
|
||||
RifTextDataTableColumn( "End Length" ),
|
||||
RifTextDataTableColumn( "Dir Pen" ),
|
||||
RifTextDataTableColumn( "End Range" ),
|
||||
RifTextDataTableColumn( "Connection Depth" )};
|
||||
allHeaders.insert( allHeaders.end(), commonHeaders.begin(), commonHeaders.end() );
|
||||
formatter.header( allHeaders );
|
||||
}
|
||||
@ -630,8 +630,8 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifEclipseDataT
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportMswCompletionsImpl::generateWsegvalvTable( RifEclipseDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo )
|
||||
void RicWellPathExportMswCompletionsImpl::generateWsegvalvTable( RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo )
|
||||
{
|
||||
bool foundValve = false;
|
||||
|
||||
@ -644,11 +644,11 @@ void RicWellPathExportMswCompletionsImpl::generateWsegvalvTable( RifEclipseDataT
|
||||
if ( !foundValve )
|
||||
{
|
||||
formatter.keyword( "WSEGVALV" );
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "Well Name" ),
|
||||
RifEclipseOutputTableColumn( "Seg No" ),
|
||||
RifEclipseOutputTableColumn( "Cv" ),
|
||||
RifEclipseOutputTableColumn( "Ac" ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "Well Name" ),
|
||||
RifTextDataTableColumn( "Seg No" ),
|
||||
RifTextDataTableColumn( "Cv" ),
|
||||
RifTextDataTableColumn( "Ac" ),
|
||||
};
|
||||
formatter.header( header );
|
||||
|
||||
@ -682,10 +682,10 @@ void RicWellPathExportMswCompletionsImpl::generateWsegvalvTable( RifEclipseDataT
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportMswCompletionsImpl::generateWsegAicdTable( RifEclipseDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo )
|
||||
void RicWellPathExportMswCompletionsImpl::generateWsegAicdTable( RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo )
|
||||
{
|
||||
RifEclipseDataTableFormatter tighterFormatter( formatter );
|
||||
RifTextDataTableFormatter tighterFormatter( formatter );
|
||||
tighterFormatter.setColumnSpacing( 1 );
|
||||
tighterFormatter.setTableRowPrependText( " " );
|
||||
|
||||
@ -739,14 +739,14 @@ void RicWellPathExportMswCompletionsImpl::generateWsegAicdTable( RifEclipseDataT
|
||||
QString( "%1: %2" ).arg( i + 1, 2, 10, QChar( '0' ) ).arg( columnDescriptions[i] ) );
|
||||
}
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header;
|
||||
std::vector<RifTextDataTableColumn> header;
|
||||
for ( size_t i = 1; i <= 21; ++i )
|
||||
{
|
||||
QString cName = QString( "%1" ).arg( i, 2, 10, QChar( '0' ) );
|
||||
RifEclipseOutputTableColumn col( cName,
|
||||
RifEclipseOutputTableDoubleFormatting(
|
||||
RifEclipseOutputTableDoubleFormat::RIF_CONSISE ),
|
||||
RIGHT );
|
||||
QString cName = QString( "%1" ).arg( i, 2, 10, QChar( '0' ) );
|
||||
RifTextDataTableColumn col( cName,
|
||||
RifTextDataTableDoubleFormatting(
|
||||
RifTextDataTableDoubleFormat::RIF_CONSISE ),
|
||||
RIGHT );
|
||||
header.push_back( col );
|
||||
}
|
||||
tighterFormatter.header( header );
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "RigCompletionData.h"
|
||||
|
||||
class RicExportCompletionDataSettingsUi;
|
||||
class RifEclipseDataTableFormatter;
|
||||
class RifTextDataTableFormatter;
|
||||
class RimEclipseCase;
|
||||
class RimFishbonesMultipleSubs;
|
||||
class RimPerforationInterval;
|
||||
@ -76,24 +76,24 @@ private:
|
||||
int timeStep,
|
||||
const std::vector<const RimPerforationInterval*>& perforationIntervals );
|
||||
|
||||
static void generateWelsegsTable( RifEclipseDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
|
||||
static void generateWelsegsTable( RifTextDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
|
||||
|
||||
static void generateWelsegsSegments( RifEclipseDataTableFormatter& formatter,
|
||||
static void generateWelsegsSegments( RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo,
|
||||
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes );
|
||||
static void generateWelsegsCompletionCommentHeader( RifEclipseDataTableFormatter& formatter,
|
||||
static void generateWelsegsCompletionCommentHeader( RifTextDataTableFormatter& formatter,
|
||||
RigCompletionData::CompletionType completionType );
|
||||
static void generateCompsegTables( RifEclipseDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
|
||||
static void generateCompsegTable( RifEclipseDataTableFormatter& formatter,
|
||||
static void generateCompsegTables( RifTextDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
|
||||
static void generateCompsegTable( RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo,
|
||||
bool exportSubGridIntersections,
|
||||
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes );
|
||||
static void generateCompsegHeader( RifEclipseDataTableFormatter& formatter,
|
||||
static void generateCompsegHeader( RifTextDataTableFormatter& formatter,
|
||||
const RicMswExportInfo& exportInfo,
|
||||
RigCompletionData::CompletionType completionType,
|
||||
bool exportSubGridIntersections );
|
||||
static void generateWsegvalvTable( RifEclipseDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
|
||||
static void generateWsegAicdTable( RifEclipseDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
|
||||
static void generateWsegvalvTable( RifTextDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
|
||||
static void generateWsegAicdTable( RifTextDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
|
||||
|
||||
private:
|
||||
typedef std::vector<std::shared_ptr<RicMswSegment>> MainBoreSegments;
|
||||
@ -152,4 +152,4 @@ private:
|
||||
int* branchNum,
|
||||
int* segmentNum );
|
||||
static void assignBranchAndSegmentNumbers( const RimEclipseCase* caseToApply, RicMswExportInfo* exportInfo );
|
||||
};
|
||||
};
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "RicExportFractureCompletionsImpl.h"
|
||||
#include "RicWellPathFractureReportItem.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigCompletionData.h"
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
@ -55,9 +55,9 @@ QString orientationText( RimFractureTemplate::FracOrientationEnum orientation )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseOutputTableColumn floatNumberColumn( const QString& text )
|
||||
RifTextDataTableColumn floatNumberColumn( const QString& text )
|
||||
{
|
||||
return RifEclipseOutputTableColumn( text, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 3 ), RIGHT );
|
||||
return RifTextDataTableColumn( text, RifTextDataTableDoubleFormatting( RIF_FLOAT, 3 ), RIGHT );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -233,13 +233,13 @@ QString RicWellPathFractureTextReportFeatureImpl::createWellFileLocationText( co
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "Location" ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Location" ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
@ -275,13 +275,13 @@ QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFileLocationText
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "StimPlan Name" ),
|
||||
RifEclipseOutputTableColumn( "Location" ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "StimPlan Name" ),
|
||||
RifTextDataTableColumn( "Location" ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
@ -316,13 +316,13 @@ QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFractureText(
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem = stimPlanTemplates.front()->fractureTemplateUnit();
|
||||
bool isFieldUnits = unitSystem == RiaEclipseUnitTools::UNITS_FIELD;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "StimPlan" ),
|
||||
RifEclipseOutputTableColumn( " " ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "StimPlan" ),
|
||||
RifTextDataTableColumn( " " ),
|
||||
floatNumberColumn( "WDiam" ),
|
||||
floatNumberColumn( "Skin" ),
|
||||
};
|
||||
@ -368,13 +368,13 @@ QString RicWellPathFractureTextReportFeatureImpl::createEllipseFractureText(
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem = ellipseTemplates.front()->fractureTemplateUnit();
|
||||
bool isFieldUnits = unitSystem == RiaEclipseUnitTools::UNITS_FIELD;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "Ellipse" ),
|
||||
RifEclipseOutputTableColumn( " " ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "Ellipse" ),
|
||||
RifTextDataTableColumn( " " ),
|
||||
floatNumberColumn( "Xf" ),
|
||||
floatNumberColumn( "Height" ),
|
||||
floatNumberColumn( "Kf" ),
|
||||
@ -433,12 +433,12 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureText(
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( " " ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( " " ),
|
||||
floatNumberColumn( "Top" ),
|
||||
floatNumberColumn( "Bot" ),
|
||||
floatNumberColumn( "Fault" ),
|
||||
@ -517,24 +517,23 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureInstancesText(
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "" ),
|
||||
RifEclipseOutputTableColumn( "" ),
|
||||
RifEclipseOutputTableColumn( "" ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "" ),
|
||||
RifTextDataTableColumn( "" ),
|
||||
RifTextDataTableColumn( "" ),
|
||||
floatNumberColumn( "MD" ),
|
||||
floatNumberColumn( "Dip" ),
|
||||
floatNumberColumn( "Tilt" ),
|
||||
floatNumberColumn( "LPerf" ),
|
||||
floatNumberColumn( "PerfEff" ),
|
||||
floatNumberColumn( "Wdia" ),
|
||||
RifEclipseOutputTableColumn( "Dfac",
|
||||
RifEclipseOutputTableDoubleFormatting(
|
||||
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ),
|
||||
RIGHT ),
|
||||
RifTextDataTableColumn( "Dfac",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ),
|
||||
RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
@ -627,25 +626,25 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem = wellPathFractureReportItems.front().unitSystem();
|
||||
bool isFieldUnits = unitSystem == RiaEclipseUnitTools::UNITS_FIELD;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
const QString meanText = "Mean";
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "" ), // Well
|
||||
RifEclipseOutputTableColumn( "" ), // Fracture
|
||||
RifEclipseOutputTableColumn( "" ), // Template
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "" ), // Well
|
||||
RifTextDataTableColumn( "" ), // Fracture
|
||||
RifTextDataTableColumn( "" ), // Template
|
||||
floatNumberColumn( "" ), // Tr
|
||||
floatNumberColumn( "" ), //#con
|
||||
floatNumberColumn( "" ), // Fcd
|
||||
RifEclipseOutputTableColumn( "", RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Area
|
||||
RifEclipseOutputTableColumn( meanText, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // KfWf
|
||||
RifEclipseOutputTableColumn( meanText, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Kf
|
||||
RifTextDataTableColumn( "", RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Area
|
||||
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // KfWf
|
||||
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Kf
|
||||
floatNumberColumn( meanText ), // wf
|
||||
RifEclipseOutputTableColumn( meanText, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // xf
|
||||
RifEclipseOutputTableColumn( meanText, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // H
|
||||
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // xf
|
||||
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // H
|
||||
floatNumberColumn( meanText ), // Km
|
||||
};
|
||||
|
||||
@ -724,15 +723,15 @@ QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletio
|
||||
{
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "Fracture" ),
|
||||
RifEclipseOutputTableColumn( "Actual WBHP" ),
|
||||
RifEclipseOutputTableColumn( "Min Pressure Drop" ),
|
||||
RifEclipseOutputTableColumn( "Max Pressure Drop" )};
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Fracture" ),
|
||||
RifTextDataTableColumn( "Actual WBHP" ),
|
||||
RifTextDataTableColumn( "Min Pressure Drop" ),
|
||||
RifTextDataTableColumn( "Max Pressure Drop" )};
|
||||
|
||||
bool createdTable = false;
|
||||
|
||||
@ -775,12 +774,11 @@ QString RicWellPathFractureTextReportFeatureImpl::createConnectionsPerWellText(
|
||||
{
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
configureFormatter( &formatter );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Well" ),
|
||||
floatNumberColumn( "ConnCount" )};
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ), floatNumberColumn( "ConnCount" )};
|
||||
|
||||
formatter.header( header );
|
||||
formatter.addHorizontalLine( '-' );
|
||||
@ -813,7 +811,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createConnectionsPerWellText(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathFractureTextReportFeatureImpl::configureFormatter( RifEclipseDataTableFormatter* formatter ) const
|
||||
void RicWellPathFractureTextReportFeatureImpl::configureFormatter( RifTextDataTableFormatter* formatter ) const
|
||||
{
|
||||
if ( !formatter ) return;
|
||||
|
||||
|
@ -26,7 +26,7 @@ class RimEclipseCase;
|
||||
class RimFractureTemplate;
|
||||
class RimEllipseFractureTemplate;
|
||||
class RimStimPlanFractureTemplate;
|
||||
class RifEclipseDataTableFormatter;
|
||||
class RifTextDataTableFormatter;
|
||||
class RicWellPathFractureReportItem;
|
||||
|
||||
//==================================================================================================
|
||||
@ -57,5 +57,5 @@ private:
|
||||
QString createConnectionsPerWellText(
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems ) const;
|
||||
|
||||
void configureFormatter( RifEclipseDataTableFormatter* formatter ) const;
|
||||
void configureFormatter( RifTextDataTableFormatter* formatter ) const;
|
||||
};
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "RicExportCarfinUi.h"
|
||||
#include "RicExportFeatureImpl.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RimDialogData.h"
|
||||
#include "RimEclipseCase.h"
|
||||
@ -79,20 +79,20 @@ void RicExportCarfin::onActionTriggered( bool isChecked )
|
||||
return;
|
||||
}
|
||||
|
||||
QTextStream stream( &exportFile );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &exportFile );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "I1" ),
|
||||
RifEclipseOutputTableColumn( "I2" ),
|
||||
RifEclipseOutputTableColumn( "J1" ),
|
||||
RifEclipseOutputTableColumn( "J2" ),
|
||||
RifEclipseOutputTableColumn( "K1" ),
|
||||
RifEclipseOutputTableColumn( "K2" ),
|
||||
RifEclipseOutputTableColumn( "NX" ),
|
||||
RifEclipseOutputTableColumn( "NY" ),
|
||||
RifEclipseOutputTableColumn( "NZ" ),
|
||||
RifEclipseOutputTableColumn( "NWMAX" ),
|
||||
RifEclipseOutputTableColumn( "Parent LGR" )};
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "I1" ),
|
||||
RifTextDataTableColumn( "I2" ),
|
||||
RifTextDataTableColumn( "J1" ),
|
||||
RifTextDataTableColumn( "J2" ),
|
||||
RifTextDataTableColumn( "K1" ),
|
||||
RifTextDataTableColumn( "K2" ),
|
||||
RifTextDataTableColumn( "NX" ),
|
||||
RifTextDataTableColumn( "NY" ),
|
||||
RifTextDataTableColumn( "NZ" ),
|
||||
RifTextDataTableColumn( "NWMAX" ),
|
||||
RifTextDataTableColumn( "Parent LGR" )};
|
||||
|
||||
formatter.keyword( "CARFIN" );
|
||||
formatter.header( header );
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeature.h"
|
||||
#include "RicExportLgrUi.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigMainGrid.h"
|
||||
@ -367,19 +367,19 @@ void RicExportLgrFeature::writeLgrs( QTextStream& stream, const std::vector<LgrI
|
||||
for ( auto lgrInfo : lgrInfos )
|
||||
{
|
||||
{
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.comment( QString( "LGR: " ) + lgrInfo.name );
|
||||
formatter.keyword( "CARFIN" );
|
||||
formatter.header( {RifEclipseOutputTableColumn( "Name" ),
|
||||
RifEclipseOutputTableColumn( "I1" ),
|
||||
RifEclipseOutputTableColumn( "I2" ),
|
||||
RifEclipseOutputTableColumn( "J1" ),
|
||||
RifEclipseOutputTableColumn( "J2" ),
|
||||
RifEclipseOutputTableColumn( "K1" ),
|
||||
RifEclipseOutputTableColumn( "K2" ),
|
||||
RifEclipseOutputTableColumn( "NX" ),
|
||||
RifEclipseOutputTableColumn( "NY" ),
|
||||
RifEclipseOutputTableColumn( "NZ" )} );
|
||||
formatter.header( {RifTextDataTableColumn( "Name" ),
|
||||
RifTextDataTableColumn( "I1" ),
|
||||
RifTextDataTableColumn( "I2" ),
|
||||
RifTextDataTableColumn( "J1" ),
|
||||
RifTextDataTableColumn( "J2" ),
|
||||
RifTextDataTableColumn( "K1" ),
|
||||
RifTextDataTableColumn( "K2" ),
|
||||
RifTextDataTableColumn( "NX" ),
|
||||
RifTextDataTableColumn( "NY" ),
|
||||
RifTextDataTableColumn( "NZ" )} );
|
||||
|
||||
formatter.add( lgrInfo.name );
|
||||
formatter.addOneBasedCellIndex( lgrInfo.mainGridStartCell.i() );
|
||||
@ -396,7 +396,7 @@ void RicExportLgrFeature::writeLgrs( QTextStream& stream, const std::vector<LgrI
|
||||
}
|
||||
|
||||
{
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.keyword( "ENDFIN" );
|
||||
formatter.tableCompleted( "", true );
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include "RicExportWellPathsUi.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
@ -103,7 +103,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre
|
||||
double currMd = wellPathGeom->measureDepths().front() - mdStepSize;
|
||||
double endMd = wellPathGeom->measureDepths().back();
|
||||
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.setCommentPrefix( "# " );
|
||||
formatter.setTableRowPrependText( " " );
|
||||
|
||||
@ -115,7 +115,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre
|
||||
|
||||
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename( exportName ) << "'" << endl;
|
||||
|
||||
auto numberFormat = RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 2 );
|
||||
auto numberFormat = RifTextDataTableDoubleFormatting( RIF_FLOAT, 2 );
|
||||
formatter.header( {{"X", numberFormat, RIGHT},
|
||||
{"Y", numberFormat, RIGHT},
|
||||
{"TVDMSL", numberFormat, RIGHT},
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "RicCreateMultipleFracturesUi.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
@ -239,19 +239,19 @@ QString RiuCreateMultipleFractionsUi::summaryText() const
|
||||
QString tableText;
|
||||
|
||||
{
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.setTableRowLineAppendText( "" );
|
||||
formatter.setTableRowPrependText( " " );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header;
|
||||
header.push_back( RifEclipseOutputTableColumn( "Selected Wells" ) );
|
||||
std::vector<RifTextDataTableColumn> header;
|
||||
header.push_back( RifTextDataTableColumn( "Selected Wells" ) );
|
||||
|
||||
for ( auto fracTemplate : fracTemplateSet )
|
||||
{
|
||||
header.push_back( RifEclipseOutputTableColumn( fracTemplate->name(),
|
||||
RifEclipseOutputTableDoubleFormatting(),
|
||||
RifEclipseOutputTableAlignment::RIGHT ) );
|
||||
header.push_back( RifTextDataTableColumn( fracTemplate->name(),
|
||||
RifTextDataTableDoubleFormatting(),
|
||||
RifTextDataTableAlignment::RIGHT ) );
|
||||
}
|
||||
|
||||
formatter.header( header );
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "ExportCommands/RicExportLgrUi.h"
|
||||
#include "RicDeleteTemporaryLgrsFeature.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseDataTableFormatter.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartDataAccess.h
|
||||
@ -55,7 +55,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseDataTableFormatter.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartDataAccess.cpp
|
||||
|
@ -30,7 +30,7 @@ RifCsvDataTableFormatter::RifCsvDataTableFormatter( QTextStream& out, const QStr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifCsvDataTableFormatter& RifCsvDataTableFormatter::header( const std::vector<RifEclipseOutputTableColumn>& tableHeader )
|
||||
RifCsvDataTableFormatter& RifCsvDataTableFormatter::header( const std::vector<RifTextDataTableColumn>& tableHeader )
|
||||
{
|
||||
outputBuffer();
|
||||
m_columnHeaders = tableHeader;
|
||||
@ -54,7 +54,7 @@ RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( const QString& str )
|
||||
RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( double num )
|
||||
{
|
||||
size_t column = m_lineBuffer.size();
|
||||
m_lineBuffer.push_back( RifEclipseDataTableFormatter::format( num, m_columnHeaders[column].doubleFormat ) );
|
||||
m_lineBuffer.push_back( RifTextDataTableFormatter::format( num, m_columnHeaders[column].doubleFormat ) );
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( double num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( int num )
|
||||
{
|
||||
m_lineBuffer.push_back( RifEclipseDataTableFormatter::format( num ) );
|
||||
m_lineBuffer.push_back( RifTextDataTableFormatter::format( num ) );
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( int num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( size_t num )
|
||||
{
|
||||
m_lineBuffer.push_back( RifEclipseDataTableFormatter::format( num ) );
|
||||
m_lineBuffer.push_back( RifTextDataTableFormatter::format( num ) );
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( size_t num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifCsvDataTableFormatter::rowCompleted()
|
||||
{
|
||||
RifEclipseOutputTableLine line;
|
||||
RifTextDataTableLine line;
|
||||
line.data = m_lineBuffer;
|
||||
line.lineType = CONTENTS;
|
||||
line.appendTextSet = false;
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
@ -30,7 +30,7 @@ class RifCsvDataTableFormatter
|
||||
public:
|
||||
RifCsvDataTableFormatter( QTextStream& out, const QString fieldSeparator = "," );
|
||||
|
||||
RifCsvDataTableFormatter& header( const std::vector<RifEclipseOutputTableColumn>& tableHeader );
|
||||
RifCsvDataTableFormatter& header( const std::vector<RifTextDataTableColumn>& tableHeader );
|
||||
RifCsvDataTableFormatter& add( const QString& str );
|
||||
RifCsvDataTableFormatter& add( double num );
|
||||
RifCsvDataTableFormatter& add( int num );
|
||||
@ -42,9 +42,9 @@ private:
|
||||
void outputBuffer();
|
||||
|
||||
private:
|
||||
QTextStream& m_out;
|
||||
std::vector<RifEclipseOutputTableColumn> m_columnHeaders;
|
||||
std::vector<RifEclipseOutputTableLine> m_buffer;
|
||||
std::vector<QString> m_lineBuffer;
|
||||
QString m_fieldSeparator;
|
||||
QTextStream& m_out;
|
||||
std::vector<RifTextDataTableColumn> m_columnHeaders;
|
||||
std::vector<RifTextDataTableLine> m_buffer;
|
||||
std::vector<QString> m_lineBuffer;
|
||||
QString m_fieldSeparator;
|
||||
};
|
||||
|
@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter::RifEclipseDataTableFormatter( QTextStream& out )
|
||||
RifTextDataTableFormatter::RifTextDataTableFormatter( QTextStream& out )
|
||||
: m_out( out )
|
||||
, m_colSpacing( 5 )
|
||||
, m_tableRowPrependText( " " )
|
||||
@ -40,7 +40,7 @@ RifEclipseDataTableFormatter::RifEclipseDataTableFormatter( QTextStream& out )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter::RifEclipseDataTableFormatter( const RifEclipseDataTableFormatter& rhs )
|
||||
RifTextDataTableFormatter::RifTextDataTableFormatter( const RifTextDataTableFormatter& rhs )
|
||||
: m_out( rhs.m_out )
|
||||
, m_colSpacing( rhs.m_colSpacing )
|
||||
, m_tableRowPrependText( rhs.m_tableRowPrependText )
|
||||
@ -53,7 +53,7 @@ RifEclipseDataTableFormatter::RifEclipseDataTableFormatter( const RifEclipseData
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter::~RifEclipseDataTableFormatter()
|
||||
RifTextDataTableFormatter::~RifTextDataTableFormatter()
|
||||
{
|
||||
CVF_ASSERT( m_buffer.empty() );
|
||||
CVF_ASSERT( m_columns.empty() );
|
||||
@ -62,7 +62,7 @@ RifEclipseDataTableFormatter::~RifEclipseDataTableFormatter()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RifEclipseDataTableFormatter::columnSpacing() const
|
||||
int RifTextDataTableFormatter::columnSpacing() const
|
||||
{
|
||||
return m_colSpacing;
|
||||
}
|
||||
@ -70,7 +70,7 @@ int RifEclipseDataTableFormatter::columnSpacing() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::setColumnSpacing( int spacing )
|
||||
void RifTextDataTableFormatter::setColumnSpacing( int spacing )
|
||||
{
|
||||
m_colSpacing = spacing;
|
||||
}
|
||||
@ -78,7 +78,7 @@ void RifEclipseDataTableFormatter::setColumnSpacing( int spacing )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::tableRowPrependText() const
|
||||
QString RifTextDataTableFormatter::tableRowPrependText() const
|
||||
{
|
||||
return m_tableRowPrependText;
|
||||
}
|
||||
@ -86,7 +86,7 @@ QString RifEclipseDataTableFormatter::tableRowPrependText() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::tableRowAppendText() const
|
||||
QString RifTextDataTableFormatter::tableRowAppendText() const
|
||||
{
|
||||
return m_tableRowAppendText;
|
||||
}
|
||||
@ -94,7 +94,7 @@ QString RifEclipseDataTableFormatter::tableRowAppendText() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::setTableRowPrependText( const QString& text )
|
||||
void RifTextDataTableFormatter::setTableRowPrependText( const QString& text )
|
||||
{
|
||||
m_tableRowPrependText = text;
|
||||
}
|
||||
@ -102,7 +102,7 @@ void RifEclipseDataTableFormatter::setTableRowPrependText( const QString& text )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::setTableRowLineAppendText( const QString& text )
|
||||
void RifTextDataTableFormatter::setTableRowLineAppendText( const QString& text )
|
||||
{
|
||||
m_tableRowAppendText = text;
|
||||
}
|
||||
@ -110,7 +110,7 @@ void RifEclipseDataTableFormatter::setTableRowLineAppendText( const QString& tex
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::commentPrefix() const
|
||||
QString RifTextDataTableFormatter::commentPrefix() const
|
||||
{
|
||||
return m_commentPrefix;
|
||||
}
|
||||
@ -118,7 +118,7 @@ QString RifEclipseDataTableFormatter::commentPrefix() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::setCommentPrefix( const QString& commentPrefix )
|
||||
void RifTextDataTableFormatter::setCommentPrefix( const QString& commentPrefix )
|
||||
{
|
||||
m_commentPrefix = commentPrefix;
|
||||
}
|
||||
@ -126,7 +126,7 @@ void RifEclipseDataTableFormatter::setCommentPrefix( const QString& commentPrefi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::setUnlimitedDataRowWidth()
|
||||
void RifTextDataTableFormatter::setUnlimitedDataRowWidth()
|
||||
{
|
||||
m_maxDataRowWidth = std::numeric_limits<int>::max();
|
||||
}
|
||||
@ -134,7 +134,7 @@ void RifEclipseDataTableFormatter::setUnlimitedDataRowWidth()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RifEclipseDataTableFormatter::maxDataRowWidth() const
|
||||
int RifTextDataTableFormatter::maxDataRowWidth() const
|
||||
{
|
||||
return m_maxDataRowWidth;
|
||||
}
|
||||
@ -142,7 +142,7 @@ int RifEclipseDataTableFormatter::maxDataRowWidth() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::outputBuffer()
|
||||
void RifTextDataTableFormatter::outputBuffer()
|
||||
{
|
||||
if ( !m_columns.empty() && !isAllHeadersEmpty( m_columns ) )
|
||||
{
|
||||
@ -196,7 +196,7 @@ void RifEclipseDataTableFormatter::outputBuffer()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::outputComment( RifEclipseOutputTableLine& comment )
|
||||
void RifTextDataTableFormatter::outputComment( RifTextDataTableLine& comment )
|
||||
{
|
||||
m_out << m_commentPrefix << comment.data[0] << "\n";
|
||||
}
|
||||
@ -204,7 +204,7 @@ void RifEclipseDataTableFormatter::outputComment( RifEclipseOutputTableLine& com
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::outputHorizontalLine( RifEclipseOutputTableLine& comment )
|
||||
void RifTextDataTableFormatter::outputHorizontalLine( RifTextDataTableLine& comment )
|
||||
{
|
||||
if ( comment.lineType == HORIZONTAL_LINE )
|
||||
{
|
||||
@ -230,7 +230,7 @@ void RifEclipseDataTableFormatter::outputHorizontalLine( RifEclipseOutputTableLi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifEclipseDataTableFormatter::isAllHeadersEmpty( const std::vector<RifEclipseOutputTableColumn>& headers )
|
||||
bool RifTextDataTableFormatter::isAllHeadersEmpty( const std::vector<RifTextDataTableColumn>& headers )
|
||||
{
|
||||
for ( auto& header : headers )
|
||||
{
|
||||
@ -242,7 +242,7 @@ bool RifEclipseDataTableFormatter::isAllHeadersEmpty( const std::vector<RifEclip
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::tableCompleted()
|
||||
void RifTextDataTableFormatter::tableCompleted()
|
||||
{
|
||||
outputBuffer();
|
||||
|
||||
@ -253,7 +253,7 @@ void RifEclipseDataTableFormatter::tableCompleted()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::tableCompleted( const QString& appendText, bool appendNewline )
|
||||
void RifTextDataTableFormatter::tableCompleted( const QString& appendText, bool appendNewline )
|
||||
{
|
||||
outputBuffer();
|
||||
|
||||
@ -267,7 +267,7 @@ void RifEclipseDataTableFormatter::tableCompleted( const QString& appendText, bo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::keyword( const QString& keyword )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::keyword( const QString& keyword )
|
||||
{
|
||||
CVF_ASSERT( m_buffer.empty() );
|
||||
CVF_ASSERT( m_columns.empty() );
|
||||
@ -278,7 +278,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::keyword( const QStri
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::header( const std::vector<RifEclipseOutputTableColumn> header )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::header( const std::vector<RifTextDataTableColumn> header )
|
||||
{
|
||||
outputBuffer();
|
||||
m_columns = header;
|
||||
@ -293,9 +293,9 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::header( const std::v
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::comment( const QString& comment )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::comment( const QString& comment )
|
||||
{
|
||||
RifEclipseOutputTableLine line;
|
||||
RifTextDataTableLine line;
|
||||
line.data.push_back( comment );
|
||||
line.lineType = COMMENT;
|
||||
line.appendTextSet = false;
|
||||
@ -313,10 +313,10 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::comment( const QStri
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addHorizontalLine( const QChar& character )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::addHorizontalLine( const QChar& character )
|
||||
{
|
||||
RifEclipseOutputTableLine line;
|
||||
QString data;
|
||||
RifTextDataTableLine line;
|
||||
QString data;
|
||||
data += character;
|
||||
line.data.push_back( data );
|
||||
line.lineType = HORIZONTAL_LINE;
|
||||
@ -335,7 +335,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addHorizontalLine( c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( const QString& str )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::add( const QString& str )
|
||||
{
|
||||
size_t column = m_lineBuffer.size();
|
||||
CVF_ASSERT( column < m_columns.size() );
|
||||
@ -347,7 +347,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( const QString&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( double num )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::add( double num )
|
||||
{
|
||||
size_t column = m_lineBuffer.size();
|
||||
CVF_ASSERT( column < m_columns.size() );
|
||||
@ -359,7 +359,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( double num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( int num )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::add( int num )
|
||||
{
|
||||
size_t column = m_lineBuffer.size();
|
||||
CVF_ASSERT( column < m_columns.size() );
|
||||
@ -371,7 +371,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( int num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( size_t num )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::add( size_t num )
|
||||
{
|
||||
size_t column = m_lineBuffer.size();
|
||||
CVF_ASSERT( column < m_columns.size() );
|
||||
@ -383,7 +383,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( size_t num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addOneBasedCellIndex( size_t zeroBasedIndex )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::addOneBasedCellIndex( size_t zeroBasedIndex )
|
||||
{
|
||||
size_t column = m_lineBuffer.size();
|
||||
CVF_ASSERT( column < m_columns.size() );
|
||||
@ -399,7 +399,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addOneBasedCellIndex
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Add default marker if the value equals the defaultValue, otherwise add value.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addValueOrDefaultMarker( double value, double defaultValue )
|
||||
RifTextDataTableFormatter& RifTextDataTableFormatter::addValueOrDefaultMarker( double value, double defaultValue )
|
||||
{
|
||||
if ( value == defaultValue )
|
||||
{
|
||||
@ -411,9 +411,9 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addValueOrDefaultMar
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::rowCompleted()
|
||||
void RifTextDataTableFormatter::rowCompleted()
|
||||
{
|
||||
RifEclipseOutputTableLine line;
|
||||
RifTextDataTableLine line;
|
||||
line.data = m_lineBuffer;
|
||||
line.lineType = CONTENTS;
|
||||
line.appendTextSet = false;
|
||||
@ -424,9 +424,9 @@ void RifEclipseDataTableFormatter::rowCompleted()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseDataTableFormatter::rowCompleted( const QString& appendText )
|
||||
void RifTextDataTableFormatter::rowCompleted( const QString& appendText )
|
||||
{
|
||||
RifEclipseOutputTableLine line;
|
||||
RifTextDataTableLine line;
|
||||
line.data = m_lineBuffer;
|
||||
line.lineType = CONTENTS;
|
||||
line.appendTextSet = true;
|
||||
@ -438,7 +438,7 @@ void RifEclipseDataTableFormatter::rowCompleted( const QString& appendText )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RifEclipseDataTableFormatter::measure( const QString str )
|
||||
int RifTextDataTableFormatter::measure( const QString str )
|
||||
{
|
||||
return str.length();
|
||||
}
|
||||
@ -446,7 +446,7 @@ int RifEclipseDataTableFormatter::measure( const QString str )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RifEclipseDataTableFormatter::measure( double num, RifEclipseOutputTableDoubleFormatting doubleFormat )
|
||||
int RifTextDataTableFormatter::measure( double num, RifTextDataTableDoubleFormatting doubleFormat )
|
||||
{
|
||||
return format( num, doubleFormat ).length();
|
||||
}
|
||||
@ -454,7 +454,7 @@ int RifEclipseDataTableFormatter::measure( double num, RifEclipseOutputTableDoub
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RifEclipseDataTableFormatter::measure( int num )
|
||||
int RifTextDataTableFormatter::measure( int num )
|
||||
{
|
||||
return format( num ).length();
|
||||
}
|
||||
@ -462,7 +462,7 @@ int RifEclipseDataTableFormatter::measure( int num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RifEclipseDataTableFormatter::measure( size_t num )
|
||||
int RifTextDataTableFormatter::measure( size_t num )
|
||||
{
|
||||
return format( num ).length();
|
||||
}
|
||||
@ -470,7 +470,7 @@ int RifEclipseDataTableFormatter::measure( size_t num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RifEclipseDataTableFormatter::tableWidth() const
|
||||
int RifTextDataTableFormatter::tableWidth() const
|
||||
{
|
||||
int characterCount = m_tableRowPrependText.length();
|
||||
|
||||
@ -486,15 +486,15 @@ int RifEclipseDataTableFormatter::tableWidth() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::format( double num, RifEclipseOutputTableDoubleFormatting doubleFormat )
|
||||
QString RifTextDataTableFormatter::format( double num, RifTextDataTableDoubleFormatting doubleFormat )
|
||||
{
|
||||
switch ( doubleFormat.format )
|
||||
{
|
||||
case RifEclipseOutputTableDoubleFormat::RIF_FLOAT:
|
||||
case RifTextDataTableDoubleFormat::RIF_FLOAT:
|
||||
return QString( "%1" ).arg( num, 0, 'f', doubleFormat.precision );
|
||||
case RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC:
|
||||
case RifTextDataTableDoubleFormat::RIF_SCIENTIFIC:
|
||||
return QString( "%1" ).arg( num, 0, 'E' );
|
||||
case RifEclipseOutputTableDoubleFormat::RIF_CONSISE:
|
||||
case RifTextDataTableDoubleFormat::RIF_CONSISE:
|
||||
return QString::number( num, 'g', doubleFormat.precision );
|
||||
default:
|
||||
return QString( "%1" );
|
||||
@ -504,7 +504,7 @@ QString RifEclipseDataTableFormatter::format( double num, RifEclipseOutputTableD
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::format( int num )
|
||||
QString RifTextDataTableFormatter::format( int num )
|
||||
{
|
||||
return QString( "%1" ).arg( num );
|
||||
}
|
||||
@ -512,7 +512,7 @@ QString RifEclipseDataTableFormatter::format( int num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::format( size_t num )
|
||||
QString RifTextDataTableFormatter::format( size_t num )
|
||||
{
|
||||
return QString( "%1" ).arg( num );
|
||||
}
|
||||
@ -520,9 +520,9 @@ QString RifEclipseDataTableFormatter::format( size_t num )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::formatColumn( const QString str, size_t columnIndex ) const
|
||||
QString RifTextDataTableFormatter::formatColumn( const QString str, size_t columnIndex ) const
|
||||
{
|
||||
const RifEclipseOutputTableColumn& column = m_columns[columnIndex];
|
||||
const RifTextDataTableColumn& column = m_columns[columnIndex];
|
||||
|
||||
if ( column.alignment == LEFT )
|
||||
{
|
@ -26,7 +26,7 @@
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
enum RifEclipseOutputTableLineType
|
||||
enum RifTextDataTableLineType
|
||||
{
|
||||
COMMENT,
|
||||
CONTENTS,
|
||||
@ -36,7 +36,7 @@ enum RifEclipseOutputTableLineType
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
enum RifEclipseOutputTableAlignment
|
||||
enum RifTextDataTableAlignment
|
||||
{
|
||||
LEFT,
|
||||
RIGHT
|
||||
@ -45,7 +45,7 @@ enum RifEclipseOutputTableAlignment
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
enum RifEclipseOutputTableDoubleFormat
|
||||
enum RifTextDataTableDoubleFormat
|
||||
{
|
||||
RIF_SCIENTIFIC,
|
||||
RIF_FLOAT,
|
||||
@ -55,39 +55,38 @@ enum RifEclipseOutputTableDoubleFormat
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
struct RifEclipseOutputTableLine
|
||||
struct RifTextDataTableLine
|
||||
{
|
||||
RifEclipseOutputTableLineType lineType;
|
||||
std::vector<QString> data;
|
||||
bool appendTextSet;
|
||||
QString appendText;
|
||||
RifTextDataTableLineType lineType;
|
||||
std::vector<QString> data;
|
||||
bool appendTextSet;
|
||||
QString appendText;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
struct RifEclipseOutputTableDoubleFormatting
|
||||
struct RifTextDataTableDoubleFormatting
|
||||
{
|
||||
RifEclipseOutputTableDoubleFormatting( RifEclipseOutputTableDoubleFormat format = RIF_FLOAT, int precision = 5 )
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat format = RIF_FLOAT, int precision = 5 )
|
||||
: format( format )
|
||||
, precision( precision )
|
||||
{
|
||||
}
|
||||
|
||||
RifEclipseOutputTableDoubleFormat format;
|
||||
int precision;
|
||||
RifTextDataTableDoubleFormat format;
|
||||
int precision;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
struct RifEclipseOutputTableColumn
|
||||
struct RifTextDataTableColumn
|
||||
{
|
||||
RifEclipseOutputTableColumn(
|
||||
const QString& title,
|
||||
RifEclipseOutputTableDoubleFormatting doubleFormat = RifEclipseOutputTableDoubleFormatting(),
|
||||
RifEclipseOutputTableAlignment alignment = LEFT,
|
||||
int width = -1 )
|
||||
RifTextDataTableColumn( const QString& title,
|
||||
RifTextDataTableDoubleFormatting doubleFormat = RifTextDataTableDoubleFormatting(),
|
||||
RifTextDataTableAlignment alignment = LEFT,
|
||||
int width = -1 )
|
||||
: title( title )
|
||||
, doubleFormat( doubleFormat )
|
||||
, alignment( alignment )
|
||||
@ -95,22 +94,22 @@ struct RifEclipseOutputTableColumn
|
||||
{
|
||||
}
|
||||
|
||||
QString title;
|
||||
RifEclipseOutputTableDoubleFormatting doubleFormat;
|
||||
RifEclipseOutputTableAlignment alignment;
|
||||
int width;
|
||||
QString title;
|
||||
RifTextDataTableDoubleFormatting doubleFormat;
|
||||
RifTextDataTableAlignment alignment;
|
||||
int width;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RifEclipseDataTableFormatter
|
||||
class RifTextDataTableFormatter
|
||||
{
|
||||
public:
|
||||
RifEclipseDataTableFormatter( QTextStream& out );
|
||||
RifEclipseDataTableFormatter( const RifEclipseDataTableFormatter& rhs );
|
||||
RifTextDataTableFormatter( QTextStream& out );
|
||||
RifTextDataTableFormatter( const RifTextDataTableFormatter& rhs );
|
||||
|
||||
virtual ~RifEclipseDataTableFormatter();
|
||||
virtual ~RifTextDataTableFormatter();
|
||||
|
||||
int columnSpacing() const;
|
||||
void setColumnSpacing( int spacing );
|
||||
@ -123,20 +122,20 @@ public:
|
||||
void setUnlimitedDataRowWidth();
|
||||
int maxDataRowWidth() const;
|
||||
|
||||
RifEclipseDataTableFormatter& keyword( const QString& keyword );
|
||||
RifEclipseDataTableFormatter& header( std::vector<RifEclipseOutputTableColumn> tableHeader );
|
||||
RifEclipseDataTableFormatter& add( const QString& str );
|
||||
RifEclipseDataTableFormatter& add( double num );
|
||||
RifEclipseDataTableFormatter& add( int num );
|
||||
RifEclipseDataTableFormatter& add( size_t num );
|
||||
RifEclipseDataTableFormatter& addOneBasedCellIndex( size_t zeroBasedIndex );
|
||||
RifEclipseDataTableFormatter& addValueOrDefaultMarker( double value, double defaultValue );
|
||||
RifEclipseDataTableFormatter& comment( const QString& str );
|
||||
RifEclipseDataTableFormatter& addHorizontalLine( const QChar& str );
|
||||
void rowCompleted();
|
||||
void rowCompleted( const QString& appendText );
|
||||
void tableCompleted();
|
||||
void tableCompleted( const QString& appendText, bool appendNewline );
|
||||
RifTextDataTableFormatter& keyword( const QString& keyword );
|
||||
RifTextDataTableFormatter& header( std::vector<RifTextDataTableColumn> tableHeader );
|
||||
RifTextDataTableFormatter& add( const QString& str );
|
||||
RifTextDataTableFormatter& add( double num );
|
||||
RifTextDataTableFormatter& add( int num );
|
||||
RifTextDataTableFormatter& add( size_t num );
|
||||
RifTextDataTableFormatter& addOneBasedCellIndex( size_t zeroBasedIndex );
|
||||
RifTextDataTableFormatter& addValueOrDefaultMarker( double value, double defaultValue );
|
||||
RifTextDataTableFormatter& comment( const QString& str );
|
||||
RifTextDataTableFormatter& addHorizontalLine( const QChar& str );
|
||||
void rowCompleted();
|
||||
void rowCompleted( const QString& appendText );
|
||||
void tableCompleted();
|
||||
void tableCompleted( const QString& appendText, bool appendNewline );
|
||||
|
||||
int tableWidth() const;
|
||||
|
||||
@ -144,29 +143,29 @@ protected:
|
||||
friend class RifCsvDataTableFormatter;
|
||||
|
||||
int measure( const QString str );
|
||||
int measure( double num, RifEclipseOutputTableDoubleFormatting doubleFormat );
|
||||
int measure( double num, RifTextDataTableDoubleFormatting doubleFormat );
|
||||
int measure( int num );
|
||||
int measure( size_t num );
|
||||
|
||||
static QString format( double num, RifEclipseOutputTableDoubleFormatting doubleFormat );
|
||||
static QString format( double num, RifTextDataTableDoubleFormatting doubleFormat );
|
||||
static QString format( int num );
|
||||
static QString format( size_t num );
|
||||
QString formatColumn( const QString str, size_t columnIndex ) const;
|
||||
|
||||
void outputBuffer();
|
||||
void outputComment( RifEclipseOutputTableLine& comment );
|
||||
void outputHorizontalLine( RifEclipseOutputTableLine& comment );
|
||||
void outputComment( RifTextDataTableLine& comment );
|
||||
void outputHorizontalLine( RifTextDataTableLine& comment );
|
||||
|
||||
bool isAllHeadersEmpty( const std::vector<RifEclipseOutputTableColumn>& headers );
|
||||
bool isAllHeadersEmpty( const std::vector<RifTextDataTableColumn>& headers );
|
||||
|
||||
private:
|
||||
std::vector<RifEclipseOutputTableColumn> m_columns;
|
||||
std::vector<RifEclipseOutputTableLine> m_buffer;
|
||||
std::vector<QString> m_lineBuffer;
|
||||
QTextStream& m_out;
|
||||
int m_colSpacing;
|
||||
QString m_tableRowPrependText;
|
||||
QString m_tableRowAppendText;
|
||||
QString m_commentPrefix;
|
||||
int m_maxDataRowWidth;
|
||||
std::vector<RifTextDataTableColumn> m_columns;
|
||||
std::vector<RifTextDataTableLine> m_buffer;
|
||||
std::vector<QString> m_lineBuffer;
|
||||
QTextStream& m_out;
|
||||
int m_colSpacing;
|
||||
QString m_tableRowPrependText;
|
||||
QString m_tableRowAppendText;
|
||||
QString m_commentPrefix;
|
||||
int m_maxDataRowWidth;
|
||||
};
|
@ -774,13 +774,13 @@ QString RimFlowCharacteristicsPlot::curveDataAsText() const
|
||||
QTextStream stream( &tableText );
|
||||
RifCsvDataTableFormatter formatter( stream, fieldSeparator );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "Date" ),
|
||||
RifEclipseOutputTableColumn( "StorageCapacity" ),
|
||||
RifEclipseOutputTableColumn( "FlowCapacity" ),
|
||||
RifEclipseOutputTableColumn( "SweepEfficiency" ),
|
||||
RifEclipseOutputTableColumn( "DimensionlessTime" ),
|
||||
RifEclipseOutputTableColumn( "LorentzCoefficient" ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "Date" ),
|
||||
RifTextDataTableColumn( "StorageCapacity" ),
|
||||
RifTextDataTableColumn( "FlowCapacity" ),
|
||||
RifTextDataTableColumn( "SweepEfficiency" ),
|
||||
RifTextDataTableColumn( "DimensionlessTime" ),
|
||||
RifTextDataTableColumn( "LorentzCoefficient" ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "RiaFontCache.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
#include "RiuGridCrossQwtPlot.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuQwtPlotTools.h"
|
||||
@ -604,7 +604,7 @@ QString RimGridCrossPlot::asciiDataForPlotExport( int dataSetIndex ) const
|
||||
QString asciiData;
|
||||
QTextStream stringStream( &asciiData );
|
||||
|
||||
RifEclipseDataTableFormatter formatter( stringStream );
|
||||
RifTextDataTableFormatter formatter( stringStream );
|
||||
formatter.setCommentPrefix( "" );
|
||||
formatter.setTableRowPrependText( "" );
|
||||
formatter.setTableRowLineAppendText( "" );
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigActiveCellsResultAccessor.h"
|
||||
@ -1093,7 +1093,7 @@ void RimGridCrossPlotDataSet::swapAxisProperties( bool updatePlot )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlotDataSet::exportFormattedData( RifEclipseDataTableFormatter& formatter ) const
|
||||
void RimGridCrossPlotDataSet::exportFormattedData( RifTextDataTableFormatter& formatter ) const
|
||||
{
|
||||
if ( m_groupedResults.empty() ) return;
|
||||
|
||||
@ -1102,17 +1102,16 @@ void RimGridCrossPlotDataSet::exportFormattedData( RifEclipseDataTableFormatter&
|
||||
|
||||
if ( m_grouping != NO_GROUPING )
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( xTitle ),
|
||||
RifEclipseOutputTableColumn( yTitle ),
|
||||
RifEclipseOutputTableColumn( "Group Index" ),
|
||||
RifEclipseOutputTableColumn( "Group Description" )};
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( xTitle ),
|
||||
RifTextDataTableColumn( yTitle ),
|
||||
RifTextDataTableColumn( "Group Index" ),
|
||||
RifTextDataTableColumn( "Group Description" )};
|
||||
|
||||
formatter.header( header );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( xTitle ),
|
||||
RifEclipseOutputTableColumn( yTitle )};
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( xTitle ), RifTextDataTableColumn( yTitle )};
|
||||
formatter.header( header );
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <QList>
|
||||
#include <map>
|
||||
|
||||
class RifEclipseDataTableFormatter;
|
||||
class RifTextDataTableFormatter;
|
||||
class RimCase;
|
||||
class RimGridCrossPlotCurve;
|
||||
class RimGridView;
|
||||
@ -122,7 +122,7 @@ public:
|
||||
bool groupingByCategoryResult() const;
|
||||
bool groupingEnabled() const;
|
||||
void swapAxisProperties( bool updatePlot );
|
||||
void exportFormattedData( RifEclipseDataTableFormatter& formatter ) const;
|
||||
void exportFormattedData( RifTextDataTableFormatter& formatter ) const;
|
||||
|
||||
bool isXAxisLogarithmic() const;
|
||||
bool isYAxisLogarithmic() const;
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RiaCompletionTypeCalculationScheduler.h"
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
#include "RimIntersection.h"
|
||||
#include "RimPlotCurve.h"
|
||||
#include "RimWellPath.h"
|
||||
@ -120,12 +120,12 @@ QString RimModeledWellPath::wellPlanText()
|
||||
QString planText;
|
||||
QTextStream qtxtStream( &planText );
|
||||
|
||||
RifEclipseDataTableFormatter formatter( qtxtStream );
|
||||
RifTextDataTableFormatter formatter( qtxtStream );
|
||||
formatter.setUnlimitedDataRowWidth();
|
||||
formatter.setTableRowPrependText( "" );
|
||||
formatter.setTableRowLineAppendText( "" );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> tableHeader;
|
||||
std::vector<RifTextDataTableColumn> tableHeader;
|
||||
tableHeader.push_back( {"MDRKB"} );
|
||||
tableHeader.push_back( {"CL"} );
|
||||
tableHeader.push_back( {"Inc"} );
|
||||
|
@ -47,7 +47,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveTools-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/SolveSpaceSolver-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseDataTableFormatter-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMean-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator-Test.cpp
|
||||
|
@ -11,12 +11,12 @@ TEST( RifCsvDataTableFormatter, BasicUsage )
|
||||
QTextStream stream( &tableText );
|
||||
RifCsvDataTableFormatter formatter( stream, ";" );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "Integer Number" ),
|
||||
RifEclipseOutputTableColumn( "sci", RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ),
|
||||
RifEclipseOutputTableColumn( "float", RifEclipseOutputTableDoubleFormat::RIF_FLOAT ),
|
||||
RifEclipseOutputTableColumn( "consise", RifEclipseOutputTableDoubleFormat::RIF_CONSISE ),
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Integer Number" ),
|
||||
RifTextDataTableColumn( "sci", RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ),
|
||||
RifTextDataTableColumn( "float", RifTextDataTableDoubleFormat::RIF_FLOAT ),
|
||||
RifTextDataTableColumn( "consise", RifTextDataTableDoubleFormat::RIF_CONSISE ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
|
@ -1,212 +0,0 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
TEST( RifEclipseDataTableFormatter, BasicUsage )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "Integer Number" ),
|
||||
RifEclipseOutputTableColumn( "IntNumer 2" ),
|
||||
RifEclipseOutputTableColumn( "IntNumer 3" ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
|
||||
formatter.add( "well a" );
|
||||
formatter.add( 1 );
|
||||
formatter.add( 2 );
|
||||
formatter.add( 3 );
|
||||
formatter.rowCompleted();
|
||||
|
||||
formatter.add( "well B" );
|
||||
formatter.add( 12 );
|
||||
formatter.add( 23 );
|
||||
formatter.add( 233 );
|
||||
formatter.rowCompleted();
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
std::cout << tableText.toStdString();
|
||||
}
|
||||
|
||||
TEST( RifEclipseDataTableFormatter, NoPrefix )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
|
||||
formatter.setTableRowPrependText( " " );
|
||||
formatter.setTableRowLineAppendText( "" );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "Well" ),
|
||||
RifEclipseOutputTableColumn( "Integer Number", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "IntNumer 2", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "IntNumer 3", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
|
||||
formatter.add( "well a" );
|
||||
formatter.add( 1 );
|
||||
formatter.add( 2 );
|
||||
formatter.add( 3 );
|
||||
formatter.rowCompleted();
|
||||
|
||||
formatter.add( "well B" );
|
||||
formatter.add( 12 );
|
||||
formatter.add( 231 );
|
||||
formatter.add( 23123 );
|
||||
formatter.rowCompleted();
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
std::cout << tableText.toStdString();
|
||||
}
|
||||
|
||||
TEST( RifEclipseDataTableFormatter, LongLine )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "50 Character Well Name" ),
|
||||
RifEclipseOutputTableColumn( "10 Int #1", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #2", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #3", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #4", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #5", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #6", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #7", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #8", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
QString fiftyCharacterWellName = "01234567890123456789012345678901234567890123456789";
|
||||
formatter.add( fiftyCharacterWellName );
|
||||
for ( int i = 0; i < 8; ++i )
|
||||
{
|
||||
formatter.add( std::numeric_limits<int>::max() ); // 10 characters
|
||||
}
|
||||
int fullLineLength = formatter.tableRowPrependText().length() + 9 * formatter.columnSpacing() + 50 + 8 * 10 +
|
||||
formatter.tableRowAppendText().length();
|
||||
int tableWidth = formatter.tableWidth();
|
||||
EXPECT_EQ( tableWidth, fullLineLength );
|
||||
EXPECT_GT( tableWidth, formatter.maxDataRowWidth() );
|
||||
|
||||
formatter.rowCompleted();
|
||||
formatter.tableCompleted();
|
||||
|
||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
||||
for ( QString line : tableLines )
|
||||
{
|
||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||
if ( !line.startsWith( formatter.commentPrefix() ) )
|
||||
{
|
||||
EXPECT_LE( line.length(), formatter.maxDataRowWidth() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST( RifEclipseDataTableFormatter, LongLine132 )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "10 Char" ),
|
||||
RifEclipseOutputTableColumn( "10 Int #1", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #2", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #3", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #4", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #5", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #6", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #7", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "I", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
QString tenCharacterWellName = "0123456789";
|
||||
formatter.add( tenCharacterWellName );
|
||||
for ( int i = 0; i < 7; ++i )
|
||||
{
|
||||
formatter.add( std::numeric_limits<int>::max() ); // 10 characters
|
||||
}
|
||||
formatter.add( 11 );
|
||||
|
||||
int fullLineLength = formatter.tableRowPrependText().length() + 9 * formatter.columnSpacing() + 10 + 7 * 10 + 2 +
|
||||
formatter.tableRowAppendText().length();
|
||||
int tableWidth = formatter.tableWidth();
|
||||
EXPECT_GE( tableWidth, fullLineLength );
|
||||
EXPECT_EQ( formatter.maxDataRowWidth(), fullLineLength );
|
||||
|
||||
formatter.rowCompleted();
|
||||
formatter.tableCompleted();
|
||||
|
||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
||||
for ( QString line : tableLines )
|
||||
{
|
||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||
if ( line.startsWith( "0" ) )
|
||||
{
|
||||
EXPECT_EQ( line.length(), formatter.maxDataRowWidth() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST( RifEclipseDataTableFormatter, LongLine133 )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifEclipseDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn( "10 Char" ),
|
||||
RifEclipseOutputTableColumn( "10 Int #1", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #2", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #3", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #4", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #5", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #6", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "10 Int #7", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
RifEclipseOutputTableColumn( "I", RifEclipseOutputTableDoubleFormatting(), RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
QString fiftyCharacterWellName = "0123456789";
|
||||
formatter.add( fiftyCharacterWellName );
|
||||
for ( int i = 0; i < 7; ++i )
|
||||
{
|
||||
formatter.add( std::numeric_limits<int>::max() ); // 10 characters
|
||||
}
|
||||
formatter.add( 111 );
|
||||
|
||||
int fullLineLength = formatter.tableRowPrependText().length() + 9 * formatter.columnSpacing() + 10 + 7 * 10 + 3 +
|
||||
formatter.tableRowAppendText().length();
|
||||
int tableWidth = formatter.tableWidth();
|
||||
EXPECT_GE( tableWidth, fullLineLength );
|
||||
EXPECT_LT( formatter.maxDataRowWidth(), fullLineLength );
|
||||
|
||||
formatter.rowCompleted();
|
||||
formatter.tableCompleted();
|
||||
|
||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
||||
for ( QString line : tableLines )
|
||||
{
|
||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||
if ( line.startsWith( "0" ) )
|
||||
{
|
||||
EXPECT_LE( line.length(), formatter.maxDataRowWidth() );
|
||||
}
|
||||
}
|
||||
}
|
212
ApplicationCode/UnitTests/RifTextDataTableFormatter-Test.cpp
Normal file
212
ApplicationCode/UnitTests/RifTextDataTableFormatter-Test.cpp
Normal file
@ -0,0 +1,212 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
TEST( RifTextDataTableFormatter, BasicUsage )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Integer Number" ),
|
||||
RifTextDataTableColumn( "IntNumer 2" ),
|
||||
RifTextDataTableColumn( "IntNumer 3" ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
|
||||
formatter.add( "well a" );
|
||||
formatter.add( 1 );
|
||||
formatter.add( 2 );
|
||||
formatter.add( 3 );
|
||||
formatter.rowCompleted();
|
||||
|
||||
formatter.add( "well B" );
|
||||
formatter.add( 12 );
|
||||
formatter.add( 23 );
|
||||
formatter.add( 233 );
|
||||
formatter.rowCompleted();
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
std::cout << tableText.toStdString();
|
||||
}
|
||||
|
||||
TEST( RifTextDataTableFormatter, NoPrefix )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
|
||||
formatter.setTableRowPrependText( " " );
|
||||
formatter.setTableRowLineAppendText( "" );
|
||||
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Integer Number", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "IntNumer 2", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "IntNumer 3", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
|
||||
formatter.add( "well a" );
|
||||
formatter.add( 1 );
|
||||
formatter.add( 2 );
|
||||
formatter.add( 3 );
|
||||
formatter.rowCompleted();
|
||||
|
||||
formatter.add( "well B" );
|
||||
formatter.add( 12 );
|
||||
formatter.add( 231 );
|
||||
formatter.add( 23123 );
|
||||
formatter.rowCompleted();
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
std::cout << tableText.toStdString();
|
||||
}
|
||||
|
||||
TEST( RifTextDataTableFormatter, LongLine )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "50 Character Well Name" ),
|
||||
RifTextDataTableColumn( "10 Int #1", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #2", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #3", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #4", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #5", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #6", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #7", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #8", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
QString fiftyCharacterWellName = "01234567890123456789012345678901234567890123456789";
|
||||
formatter.add( fiftyCharacterWellName );
|
||||
for ( int i = 0; i < 8; ++i )
|
||||
{
|
||||
formatter.add( std::numeric_limits<int>::max() ); // 10 characters
|
||||
}
|
||||
int fullLineLength = formatter.tableRowPrependText().length() + 9 * formatter.columnSpacing() + 50 + 8 * 10 +
|
||||
formatter.tableRowAppendText().length();
|
||||
int tableWidth = formatter.tableWidth();
|
||||
EXPECT_EQ( tableWidth, fullLineLength );
|
||||
EXPECT_GT( tableWidth, formatter.maxDataRowWidth() );
|
||||
|
||||
formatter.rowCompleted();
|
||||
formatter.tableCompleted();
|
||||
|
||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
||||
for ( QString line : tableLines )
|
||||
{
|
||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||
if ( !line.startsWith( formatter.commentPrefix() ) )
|
||||
{
|
||||
EXPECT_LE( line.length(), formatter.maxDataRowWidth() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST( RifTextDataTableFormatter, LongLine132 )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "10 Char" ),
|
||||
RifTextDataTableColumn( "10 Int #1", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #2", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #3", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #4", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #5", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #6", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #7", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "I", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
QString tenCharacterWellName = "0123456789";
|
||||
formatter.add( tenCharacterWellName );
|
||||
for ( int i = 0; i < 7; ++i )
|
||||
{
|
||||
formatter.add( std::numeric_limits<int>::max() ); // 10 characters
|
||||
}
|
||||
formatter.add( 11 );
|
||||
|
||||
int fullLineLength = formatter.tableRowPrependText().length() + 9 * formatter.columnSpacing() + 10 + 7 * 10 + 2 +
|
||||
formatter.tableRowAppendText().length();
|
||||
int tableWidth = formatter.tableWidth();
|
||||
EXPECT_GE( tableWidth, fullLineLength );
|
||||
EXPECT_EQ( formatter.maxDataRowWidth(), fullLineLength );
|
||||
|
||||
formatter.rowCompleted();
|
||||
formatter.tableCompleted();
|
||||
|
||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
||||
for ( QString line : tableLines )
|
||||
{
|
||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||
if ( line.startsWith( "0" ) )
|
||||
{
|
||||
EXPECT_EQ( line.length(), formatter.maxDataRowWidth() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST( RifTextDataTableFormatter, LongLine133 )
|
||||
{
|
||||
QString tableText;
|
||||
QTextStream stream( &tableText );
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
|
||||
std::vector<RifTextDataTableColumn> header = {
|
||||
RifTextDataTableColumn( "10 Char" ),
|
||||
RifTextDataTableColumn( "10 Int #1", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #2", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #3", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #4", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #5", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #6", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "10 Int #7", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
RifTextDataTableColumn( "I", RifTextDataTableDoubleFormatting(), RIGHT ),
|
||||
};
|
||||
|
||||
formatter.header( header );
|
||||
QString fiftyCharacterWellName = "0123456789";
|
||||
formatter.add( fiftyCharacterWellName );
|
||||
for ( int i = 0; i < 7; ++i )
|
||||
{
|
||||
formatter.add( std::numeric_limits<int>::max() ); // 10 characters
|
||||
}
|
||||
formatter.add( 111 );
|
||||
|
||||
int fullLineLength = formatter.tableRowPrependText().length() + 9 * formatter.columnSpacing() + 10 + 7 * 10 + 3 +
|
||||
formatter.tableRowAppendText().length();
|
||||
int tableWidth = formatter.tableWidth();
|
||||
EXPECT_GE( tableWidth, fullLineLength );
|
||||
EXPECT_LT( formatter.maxDataRowWidth(), fullLineLength );
|
||||
|
||||
formatter.rowCompleted();
|
||||
formatter.tableCompleted();
|
||||
|
||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
||||
for ( QString line : tableLines )
|
||||
{
|
||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||
if ( line.startsWith( "0" ) )
|
||||
{
|
||||
EXPECT_LE( line.length(), formatter.maxDataRowWidth() );
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user