#3279 Completion export fracture header. Add well connections table

This commit is contained in:
Bjørn Erik Jensen 2018-09-03 12:48:06 +02:00
parent 248530ce95
commit 12e252209a
2 changed files with 55 additions and 0 deletions

View File

@ -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<RicWellPathFractureReportItem>& 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<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn("Well"),
floatNumberColumn("#con")
};
formatter.header(header);
formatter.addHorizontalLine('-');
std::map<QString /*Well*/, size_t> 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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -51,6 +51,7 @@ private:
QString
createFractureCompletionSummaryText(const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems) const;
QString createConnectionsPerWellText(const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems) const;
void configureFormatter(RifEclipseDataTableFormatter* formatter) const;
};