#3091 Completion export. Ensure WELSPEC appears after well fracture report (if enabled)

This commit is contained in:
Bjørn Erik Jensen 2018-08-29 14:16:20 +02:00
parent 6b2359cb39
commit 93d2a1c640
2 changed files with 47 additions and 39 deletions

View File

@ -999,6 +999,45 @@ RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions(std::vector<RigC
return completions;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::exportWellPathFractureReport(RimEclipseCase* sourceCase,
QFilePtr exportFile,
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems)
{
QTextStream stream(exportFile.get());
if (!wellPathFractureReportItems.empty())
{
std::vector<RimWellPath*> wellPathsToReport;
{
std::set<RimWellPath*> wellPathsSet;
auto allWellPaths = RicWellPathFractureTextReportFeatureImpl::wellPathsWithFractures();
for (const auto& wellPath : allWellPaths)
{
for (const auto& reportItem : wellPathFractureReportItems)
{
if (reportItem.wellPathName() == wellPath->name())
{
wellPathsSet.insert(wellPath);
}
}
}
std::copy(wellPathsSet.begin(), wellPathsSet.end(), std::back_inserter(wellPathsToReport));
RicWellPathFractureTextReportFeatureImpl reportGenerator;
QString summaryText =
reportGenerator.wellPathFractureReport(sourceCase, wellPathsToReport, wellPathFractureReportItems);
stream << summaryText;
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -1145,10 +1184,9 @@ void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
std::map<QString, std::vector<RigCompletionData>> completionsForGrid;
completionsForGrid.insert(std::pair<QString, std::vector<RigCompletionData>>("", completionsForMainGrid));
exportWellPathFractureReport(eclipseCase, exportFile, wellPathFractureReportItems);
exportWelspecsToFile(eclipseCase, exportFile, completionsForMainGrid);
exportCompdatAndWpimultTables(
eclipseCase, exportFile, completionsForGrid, wellPathFractureReportItems, exportType);
exportCompdatAndWpimultTables(eclipseCase, exportFile, completionsForGrid, exportType);
}
catch(OpenFileException)
{ }
@ -1161,10 +1199,9 @@ void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
QString lgrFileName = fileName + "_LGR";
QFilePtr exportFile = openFileForExport(folderName, lgrFileName);
exportWellPathFractureReport(eclipseCase, exportFile, wellPathFractureReportItems);
exportWelspeclToFile(eclipseCase, exportFile, completionsForSubGrids);
exportCompdatAndWpimultTables(
eclipseCase, exportFile, completionsForSubGrids, wellPathFractureReportItems, exportType);
exportCompdatAndWpimultTables(eclipseCase, exportFile, completionsForSubGrids, exportType);
}
catch(OpenFileException)
{ }
@ -1178,42 +1215,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatAndWpimultTables(
RimEclipseCase* sourceCase,
QFilePtr exportFile,
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
{
if (completionsPerGrid.empty()) return;
QTextStream stream(exportFile.get());
if (!wellPathFractureReportItems.empty())
{
std::vector<RimWellPath*> wellPathsToReport;
{
std::set<RimWellPath*> wellPathsSet;
auto allWellPaths = RicWellPathFractureTextReportFeatureImpl::wellPathsWithFractures();
for (const auto& wellPath : allWellPaths)
{
for (const auto& reportItem : wellPathFractureReportItems)
{
if (reportItem.wellPathName() == wellPath->name())
{
wellPathsSet.insert(wellPath);
}
}
}
std::copy(wellPathsSet.begin(), wellPathsSet.end(), std::back_inserter(wellPathsToReport));
RicWellPathFractureTextReportFeatureImpl reportGenerator;
QString summaryText =
reportGenerator.wellPathFractureReport(sourceCase, wellPathsToReport, wellPathFractureReportItems);
stream << summaryText;
}
}
RifEclipseDataTableFormatter formatter(stream);
formatter.setColumnSpacing(3);

View File

@ -135,6 +135,10 @@ private:
static std::map<QString, std::vector<RigCompletionData>> subGridsCompletions(std::vector<RigCompletionData>& allCompletions);
static void exportWellPathFractureReport(RimEclipseCase* sourceCase,
QFilePtr exportFile,
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems);
static void exportWelspecsToFile(RimEclipseCase* gridCase,
QFilePtr exportFile,
const std::vector<RigCompletionData>& completions);
@ -152,10 +156,7 @@ private:
static void exportCompdatAndWpimultTables(RimEclipseCase* sourceCase,
QFilePtr exportFile,
//const QString& folderName,
//const QString& fileName,
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
RicExportCompletionDataSettingsUi::CompdatExportType exportType);
static void exportCompdatTableUsingFormatter(RifEclipseDataTableFormatter& formatter,