diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp index 7213a562cd..50e4ab341d 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp @@ -165,6 +165,12 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport( textStream << tableText; textStream << lineStart << "\n"; } + + { + QString tableText = createConnectionsPerWellText(wellPathFractureReportItems); + textStream << tableText; + textStream << lineStart << "\n"; + } } return text; @@ -645,6 +651,54 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar return tableText; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RicWellPathFractureTextReportFeatureImpl::createConnectionsPerWellText(const std::vector& wellPathFractureReportItems) const +{ + QString tableText; + + RiaEclipseUnitTools::UnitSystem unitSystem = wellPathFractureReportItems.front().unitSystem(); + bool isFieldUnits = unitSystem == RiaEclipseUnitTools::UNITS_FIELD; + + QTextStream stream(&tableText); + RifEclipseDataTableFormatter formatter(stream); + configureFormatter(&formatter); + + std::vector header = { + RifEclipseOutputTableColumn("Well"), + floatNumberColumn("#con") + }; + + formatter.header(header); + formatter.addHorizontalLine('-'); + + std::map wellConnectionCounts; + for (const auto& reportItem : wellPathFractureReportItems) + { + QString wellPathName, fractureName, fractureTemplateName; + reportItem.getNames(wellPathName, fractureName, fractureTemplateName); + if (wellConnectionCounts.find(wellPathName) == wellConnectionCounts.end()) + { + wellConnectionCounts.insert(std::make_pair(wellPathName, 0)); + } + + wellConnectionCounts[wellPathName] += reportItem.connectionCount(); + } + + for (const auto& connCount : wellConnectionCounts) + { + formatter.add(connCount.first); + formatter.add(connCount.second); + + formatter.rowCompleted(); + } + + formatter.tableCompleted(); + + return tableText; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.h b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.h index 6e0bceb0a2..37c10798d5 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.h @@ -51,6 +51,7 @@ private: QString createFractureCompletionSummaryText(const std::vector& wellPathFractureReportItems) const; + QString createConnectionsPerWellText(const std::vector& wellPathFractureReportItems) const; void configureFormatter(RifEclipseDataTableFormatter* formatter) const; };