mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1793 Ensure case name is included in filename when exporting well segments
This commit is contained in:
parent
2a5a03bc93
commit
d5e8e85bea
@ -38,6 +38,7 @@
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include "cvfMath.h"
|
||||
|
||||
@ -157,15 +158,17 @@ bool RicExportFishbonesWellSegmentsFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs, const RicCaseAndFileExportSettingsUi& settings)
|
||||
{
|
||||
QString filePath = QDir(settings.folder()).filePath("Welsegs");
|
||||
QFile exportFile(filePath);
|
||||
|
||||
if (settings.caseToApply() == nullptr)
|
||||
{
|
||||
RiaLogging::error("Export Well Segments: Cannot export completions data without specified eclipse case");
|
||||
return;
|
||||
}
|
||||
|
||||
QString fileName = QString("%1-Welsegs").arg(settings.caseToApply()->caseUserDescription());
|
||||
fileName = caf::Utils::makeValidFileBasename(fileName);
|
||||
QString filePath = QDir(settings.folder()).filePath(fileName);
|
||||
QFile exportFile(filePath);
|
||||
|
||||
if (!exportFile.open(QIODevice::WriteOnly))
|
||||
{
|
||||
RiaLogging::error(QString("Export Well Segments: Could not open the file: %1").arg(filePath));
|
||||
|
Loading…
Reference in New Issue
Block a user