mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3279 Completion export fracture header. Add well connections table
This commit is contained in:
parent
248530ce95
commit
12e252209a
@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user