#1532 Move export settings classes to commands folder

This commit is contained in:
Bjørnar Grip Fjær
2017-05-30 14:37:51 +02:00
parent bd74a942fd
commit c55d381cbf
12 changed files with 57 additions and 58 deletions

View File

@@ -5,8 +5,11 @@ if (${CMAKE_VERSION} VERSION_GREATER "2.8.2")
endif()
set (SOURCE_GROUP_HEADER_FILES
${CEE_CURRENT_LIST_DIR}RicCaseAndFileExportSettingsUi.h
${CEE_CURRENT_LIST_DIR}RicExportCompletionDataSettingsUi.h
${CEE_CURRENT_LIST_DIR}RicExportFishbonesLateralsFeature.h
${CEE_CURRENT_LIST_DIR}RicExportFishbonesWellSegmentsFeature.h
${CEE_CURRENT_LIST_DIR}RicExportWellSegmentsSettingsUi.h
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsAtMeasuredDepthFeature.h
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsFeature.h
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.h
@@ -15,8 +18,11 @@ ${CEE_CURRENT_LIST_DIR}RicWellPathImportPerforationIntervalsFeature.h
)
set (SOURCE_GROUP_SOURCE_FILES
${CEE_CURRENT_LIST_DIR}RicCaseAndFileExportSettingsUi.cpp
${CEE_CURRENT_LIST_DIR}RicExportCompletionDataSettingsUi.cpp
${CEE_CURRENT_LIST_DIR}RicExportFishbonesLateralsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicExportFishbonesWellSegmentsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicExportWellSegmentsSettingsUi.cpp
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsAtMeasuredDepthFeature.cpp
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.cpp

View File

@@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicCaseAndFileExportSettingsUi.h"
#include "RimTools.h"
#include "cafPdmUiFilePathEditor.h"
CAF_PDM_SOURCE_INIT(RicCaseAndFileExportSettingsUi, "RicCaseAndFileExportSettingsUi");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicCaseAndFileExportSettingsUi::RicCaseAndFileExportSettingsUi()
{
CAF_PDM_InitObject("RimCaseAndFileExportSettings", "", "", "");
CAF_PDM_InitFieldNoDefault(&fileName, "Filename", "Export Filename", "", "", "");
fileName.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
CAF_PDM_InitFieldNoDefault(&caseToApply, "CaseToApply", "Case to Apply", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RicCaseAndFileExportSettingsUi::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
{
QList<caf::PdmOptionItemInfo> options;
if (fieldNeedingOptions == &caseToApply)
{
RimTools::caseOptionItems(&options);
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCaseAndFileExportSettingsUi::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
{
if (field == &fileName)
{
caf::PdmUiFilePathEditorAttribute* myAttr = static_cast<caf::PdmUiFilePathEditorAttribute*>(attribute);
if (myAttr)
{
myAttr->m_selectSaveFileName = true;
}
}
}

View File

@@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimEclipseCase.h"
#include "cafPdmObject.h"
#include "cafPdmField.h"
#include "cafPdmPtrField.h"
//==================================================================================================
///
///
//==================================================================================================
class RicCaseAndFileExportSettingsUi : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RicCaseAndFileExportSettingsUi();
caf::PdmField<QString> fileName;
caf::PdmPtrField<RimEclipseCase*> caseToApply;
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
protected:
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
};

View File

@@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicExportCompletionDataSettingsUi.h"
CAF_PDM_SOURCE_INIT(RicExportCompletionDataSettingsUi, "RicExportCompletionDataSettingsUi");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
{
CAF_PDM_InitObject("RimExportCompletionDataSettings", "", "", "");
CAF_PDM_InitField(&includePerforations, "IncludePerforations", true, "Include Perforations", "", "", "");
CAF_PDM_InitField(&includeFishbones, "IncludeFishbones", true, "Include Fishbones", "", "", "");
CAF_PDM_InitField(&includeWpimult, "IncludeWPIMULT", true, "Include WPIMLUT", "", "", "");
CAF_PDM_InitField(&removeLateralsInMainBoreCells, "RemoveLateralsInMainBoreCells", false, "Remove Laterals in Main Bore Cells", "", "", "");
}

View File

@@ -0,0 +1,41 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RicCaseAndFileExportSettingsUi.h"
#include "cafPdmField.h"
//==================================================================================================
///
///
//==================================================================================================
class RicExportCompletionDataSettingsUi : public RicCaseAndFileExportSettingsUi
{
CAF_PDM_HEADER_INIT;
public:
RicExportCompletionDataSettingsUi();
caf::PdmField<bool> includePerforations;
caf::PdmField<bool> includeFishbones;
caf::PdmField<bool> includeWpimult;
caf::PdmField<bool> removeLateralsInMainBoreCells;
};

View File

@@ -58,7 +58,7 @@ void RicExportFishbonesWellSegmentsFeature::onActionTriggered(bool isChecked)
QString projectFolder = app->currentProjectPath();
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder);
RimExportWellSegmentsSettings exportSettings;
RicExportWellSegmentsSettingsUi exportSettings;
std::vector<RimCase*> cases;
app->project()->allCases(cases);
for (auto c : cases)
@@ -148,7 +148,7 @@ bool RicExportFishbonesWellSegmentsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs, const RimExportWellSegmentsSettings& settings)
void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs, const RicExportWellSegmentsSettingsUi& settings)
{
QFile exportFile(settings.fileName());
@@ -175,7 +175,7 @@ void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportWellSegmentsSettings& settings, const std::vector<WellSegmentLocation>& locations)
void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector<WellSegmentLocation>& locations)
{
formatter.keyword("WELSEGS");
@@ -227,7 +227,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseOutpu
{
const WellSegmentLocation& location = locations[i];
if (settings.lengthAndDepth() == RimExportWellSegmentsSettings::INC)
if (settings.lengthAndDepth() == RicExportWellSegmentsSettingsUi::INC)
{
depth = location.trueVerticalDepth - previousLocation.trueVerticalDepth;
length = location.fishbonesSubs->locationOfSubs()[location.subIndex] - previousLocation.fishbonesSubs->locationOfSubs()[previousLocation.subIndex];
@@ -267,7 +267,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseOutpu
for (const WellSegmentLateralIntersection& intersection : lateral.intersections)
{
if (settings.lengthAndDepth() == RimExportWellSegmentsSettings::INC)
if (settings.lengthAndDepth() == RicExportWellSegmentsSettingsUi::INC)
{
depth = intersection.depth;
length = intersection.length;
@@ -297,7 +297,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseOutpu
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportWellSegmentsSettings& settings, const std::vector<WellSegmentLocation>& locations)
void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector<WellSegmentLocation>& locations)
{
RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid();
formatter.keyword("COMPSEGS");

View File

@@ -20,7 +20,7 @@
#include "RifEclipseOutputTableFormatter.h"
#include "RimExportWellSegmentsSettings.h"
#include "RicExportWellSegmentsSettingsUi.h"
#include "RicWellPathExportCompletionDataFeature.h"
@@ -46,7 +46,7 @@ private:
static RimFishbonesCollection* selectedFishbonesCollection();
static RimWellPath* selectedWellPath();
static void exportWellSegments(const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs, const RimExportWellSegmentsSettings& settings);
static void generateWelsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportWellSegmentsSettings& settings, const std::vector<WellSegmentLocation>& locations);
static void generateCompsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportWellSegmentsSettings& settings, const std::vector<WellSegmentLocation>& locations);
static void exportWellSegments(const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs, const RicExportWellSegmentsSettingsUi& settings);
static void generateWelsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector<WellSegmentLocation>& locations);
static void generateCompsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector<WellSegmentLocation>& locations);
};

View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicExportWellSegmentsSettingsUi.h"
namespace caf {
template<>
void RicExportWellSegmentsSettingsUi::PressureDropEnum::setUp()
{
addItem(RicExportWellSegmentsSettingsUi::HYDROSTATIC, "H--", "Hydrostatic");
addItem(RicExportWellSegmentsSettingsUi::HYDROSTATIC_FRICTION, "HF-", "Hydrostatic + Friction");
addItem(RicExportWellSegmentsSettingsUi::HYDROSTATIC_FRICTION_ACCELERATION, "HFA", "Hydrostatic + Friction + Acceleration");
setDefault(RicExportWellSegmentsSettingsUi::HYDROSTATIC);
}
template<>
void RicExportWellSegmentsSettingsUi::LengthAndDepthEnum::setUp()
{
addItem(RicExportWellSegmentsSettingsUi::INC, "INC", "Incremental");
addItem(RicExportWellSegmentsSettingsUi::ABS, "ABS", "Absolute");
setDefault(RicExportWellSegmentsSettingsUi::INC);
}
}
CAF_PDM_SOURCE_INIT(RicExportWellSegmentsSettingsUi, "RicExportWellSegmentsSettingsUi");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicExportWellSegmentsSettingsUi::RicExportWellSegmentsSettingsUi()
{
CAF_PDM_InitObject("RimExportWellSegmentsSettings", "", "", "");
CAF_PDM_InitFieldNoDefault(&pressureDrop, "PressureDrop", "Pressure Drop", "", "", "");
CAF_PDM_InitFieldNoDefault(&lengthAndDepth, "LengthAndDepth", "Length and Depth", "", "", "");
}

View File

@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RicCaseAndFileExportSettingsUi.h"
#include "cafPdmField.h"
//==================================================================================================
///
///
//==================================================================================================
class RicExportWellSegmentsSettingsUi : public RicCaseAndFileExportSettingsUi
{
CAF_PDM_HEADER_INIT;
public:
enum PressureDropType {
HYDROSTATIC,
HYDROSTATIC_FRICTION,
HYDROSTATIC_FRICTION_ACCELERATION
};
typedef caf::AppEnum<RicExportWellSegmentsSettingsUi::PressureDropType> PressureDropEnum;
enum LengthAndDepthType {
ABS,
INC
};
typedef caf::AppEnum<RicExportWellSegmentsSettingsUi::LengthAndDepthType> LengthAndDepthEnum;
RicExportWellSegmentsSettingsUi();
caf::PdmField<PressureDropEnum> pressureDrop;
caf::PdmField<LengthAndDepthEnum> lengthAndDepth;
};

View File

@@ -30,7 +30,7 @@
#include "RimFishboneWellPathCollection.h"
#include "RimPerforationInterval.h"
#include "RimPerforationCollection.h"
#include "RimExportCompletionDataSettings.h"
#include "RicExportCompletionDataSettingsUi.h"
#include "RiuMainWindow.h"
@@ -73,7 +73,7 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
QString projectFolder = app->currentProjectPath();
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder);
RimExportCompletionDataSettings exportSettings;
RicExportCompletionDataSettingsUi exportSettings;
std::vector<RimCase*> cases;
app->project()->allCases(cases);
for (auto c : cases)
@@ -132,7 +132,7 @@ std::vector<RimWellPath*> RicWellPathExportCompletionDataFeature::selectedWellPa
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector<RimWellPath*>& wellPaths, const RimExportCompletionDataSettings& exportSettings)
void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector<RimWellPath*>& wellPaths, const RicExportCompletionDataSettingsUi& exportSettings)
{
QFile exportFile(exportSettings.fileName());
@@ -297,7 +297,7 @@ void RicWellPathExportCompletionDataFeature::generateWpimultTable(RifEclipseOutp
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateFishbonesCompdatValues(const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings)
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateFishbonesCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings)
{
// Generate data
const RigEclipseCaseData* caseData = settings.caseToApply()->eclipseCaseData();
@@ -340,7 +340,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateF
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateFishbonesWellPathCompdatValues(const RimWellPath* wellPath, const RimExportCompletionDataSettings & settings)
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateFishbonesWellPathCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi & settings)
{
std::vector<RigCompletionData> completionData;
@@ -366,7 +366,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateF
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generatePerforationsCompdatValues(const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings)
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generatePerforationsCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings)
{
std::vector<RigCompletionData> completionData;

View File

@@ -24,7 +24,7 @@
#include "RigWellPathIntersectionTools.h"
#include "RigCompletionData.h"
#include "RimExportCompletionDataSettings.h"
#include "RicExportCompletionDataSettingsUi.h"
#include "cafCmdFeature.h"
@@ -128,14 +128,14 @@ public:
static std::vector<WellSegmentLocation> findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs);
private:
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths, const RimExportCompletionDataSettings& exportSettings);
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths, const RicExportCompletionDataSettingsUi& exportSettings);
static void generateCompdatTable(RifEclipseOutputTableFormatter& formatter, const std::vector<RigCompletionData>& completionData);
static void generateWpimultTable(RifEclipseOutputTableFormatter& formatter, const std::vector<RigCompletionData>& completionData);
static std::vector<RigCompletionData> generateFishbonesCompdatValues(const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings);
static std::vector<RigCompletionData> generateFishbonesWellPathCompdatValues(const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings);
static std::vector<RigCompletionData> generatePerforationsCompdatValues(const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings);
static std::vector<RigCompletionData> generateFishbonesCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings);
static std::vector<RigCompletionData> generateFishbonesWellPathCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings);
static std::vector<RigCompletionData> generatePerforationsCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings);
static std::map<size_t, double> computeLateralsPerCell(const std::vector<WellSegmentLocation>& segmentLocations, bool removeMainBoreCells);
static std::vector<size_t> findIntersectingCells(const RigEclipseCaseData* grid, const std::vector<cvf::Vec3d>& coords);