diff --git a/ApplicationCode/Commands/CompletionCommands/CMakeLists_files.cmake b/ApplicationCode/Commands/CompletionCommands/CMakeLists_files.cmake index 28424d8825..5491ef2213 100644 --- a/ApplicationCode/Commands/CompletionCommands/CMakeLists_files.cmake +++ b/ApplicationCode/Commands/CompletionCommands/CMakeLists_files.cmake @@ -10,7 +10,6 @@ ${CEE_CURRENT_LIST_DIR}RicEditPerforationCollectionFeature.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}RicNewPerforationIntervalFeature.h @@ -27,7 +26,6 @@ ${CEE_CURRENT_LIST_DIR}RicEditPerforationCollectionFeature.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}RicNewPerforationIntervalFeature.cpp diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp index 1bcc963e9f..6807f0bc08 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp @@ -63,7 +63,7 @@ void RicExportFishbonesWellSegmentsFeature::onActionTriggered(bool isChecked) QString projectFolder = app->currentProjectPath(); QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder); - RicExportWellSegmentsSettingsUi exportSettings; + RicCaseAndFileExportSettingsUi exportSettings; std::vector cases; app->project()->allCases(cases); for (auto c : cases) @@ -155,7 +155,7 @@ bool RicExportFishbonesWellSegmentsFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath* wellPath, const std::vector& fishbonesSubs, const RicExportWellSegmentsSettingsUi& settings) +void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath* wellPath, const std::vector& fishbonesSubs, const RicCaseAndFileExportSettingsUi& settings) { QString filePath = QDir(settings.folder()).filePath("Welsegs"); QFile exportFile(filePath); @@ -186,7 +186,7 @@ void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath //-------------------------------------------------------------------------------------------------- void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, - const RicExportWellSegmentsSettingsUi& settings, + const RicCaseAndFileExportSettingsUi& settings, const std::vector& locations) { RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType(); @@ -211,8 +211,8 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT formatter.add(startTVD); formatter.add(startMD); formatter.add("1*"); - formatter.add(settings.lengthAndDepth().text()); - formatter.add(settings.pressureDrop().text()); + formatter.add(wellPath->fishbonesCollection()->lengthAndDepth().text()); + formatter.add(wellPath->fishbonesCollection()->pressureDrop().text()); formatter.rowCompleted(); } @@ -241,7 +241,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT for (const WellSegmentLocation& location : locations) { - if (settings.lengthAndDepth() == RicExportWellSegmentsSettingsUi::INC) + if (wellPath->fishbonesCollection()->lengthAndDepth() == RimFishbonesCollection::INC) { depth = location.trueVerticalDepth - previousTVD; length = location.fishbonesSubs->measuredDepth(location.subIndex) - previousMD; @@ -292,7 +292,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT for (const WellSegmentLateralIntersection& intersection : lateral.intersections) { - if (settings.lengthAndDepth() == RicExportWellSegmentsSettingsUi::INC) + if (wellPath->fishbonesCollection()->lengthAndDepth() == RimFishbonesCollection::INC) { depth = intersection.depth; length = intersection.length; @@ -325,7 +325,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT //-------------------------------------------------------------------------------------------------- void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, - const RicExportWellSegmentsSettingsUi& settings, + const RicCaseAndFileExportSettingsUi& settings, const std::vector& locations) { RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid(); @@ -383,7 +383,7 @@ void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseData //-------------------------------------------------------------------------------------------------- void RicExportFishbonesWellSegmentsFeature::generateWsegvalvTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, - const RicExportWellSegmentsSettingsUi& settings, + const RicCaseAndFileExportSettingsUi& settings, const std::vector& locations) { RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType(); diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.h b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.h index fa1222a038..c54fc01eab 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.h +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.h @@ -20,7 +20,7 @@ #include "RifEclipseDataTableFormatter.h" -#include "RicExportWellSegmentsSettingsUi.h" +#include "RicCaseAndFileExportSettingsUi.h" #include "RicWellPathExportCompletionDataFeature.h" @@ -46,10 +46,10 @@ private: static RimFishbonesCollection* selectedFishbonesCollection(); static RimWellPath* selectedWellPath(); - static void exportWellSegments(const RimWellPath* wellPath, const std::vector& fishbonesSubs, const RicExportWellSegmentsSettingsUi& settings); - static void generateWelsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector& locations); - static void generateCompsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector& locations); - static void generateWsegvalvTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector& locations); + static void exportWellSegments(const RimWellPath* wellPath, const std::vector& fishbonesSubs, const RicCaseAndFileExportSettingsUi& settings); + static void generateWelsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicCaseAndFileExportSettingsUi& settings, const std::vector& locations); + static void generateCompsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicCaseAndFileExportSettingsUi& settings, const std::vector& locations); + static void generateWsegvalvTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicCaseAndFileExportSettingsUi& settings, const std::vector& locations); static double computeEffectiveDiameter(double innerDiameter, double outerDiameter); }; diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportWellSegmentsSettingsUi.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportWellSegmentsSettingsUi.cpp deleted file mode 100644 index 6bd19f2072..0000000000 --- a/ApplicationCode/Commands/CompletionCommands/RicExportWellSegmentsSettingsUi.cpp +++ /dev/null @@ -1,51 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 -// 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", "", "", ""); -} diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportWellSegmentsSettingsUi.h b/ApplicationCode/Commands/CompletionCommands/RicExportWellSegmentsSettingsUi.h deleted file mode 100644 index b0768356e3..0000000000 --- a/ApplicationCode/Commands/CompletionCommands/RicExportWellSegmentsSettingsUi.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 -// 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 PressureDropEnum; - - enum LengthAndDepthType { - ABS, - INC - }; - - typedef caf::AppEnum LengthAndDepthEnum; - - RicExportWellSegmentsSettingsUi(); - - caf::PdmField pressureDrop; - caf::PdmField lengthAndDepth; -}; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.cpp index ced0798ed3..fd03f3165e 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.cpp @@ -31,6 +31,25 @@ #include +namespace caf { + template<> + void RimFishbonesCollection::PressureDropEnum::setUp() + { + addItem(RimFishbonesCollection::HYDROSTATIC, "H--", "Hydrostatic"); + addItem(RimFishbonesCollection::HYDROSTATIC_FRICTION, "HF-", "Hydrostatic + Friction"); + addItem(RimFishbonesCollection::HYDROSTATIC_FRICTION_ACCELERATION, "HFA", "Hydrostatic + Friction + Acceleration"); + setDefault(RimFishbonesCollection::HYDROSTATIC); + } + + template<> + void RimFishbonesCollection::LengthAndDepthEnum::setUp() + { + addItem(RimFishbonesCollection::INC, "INC", "Incremental"); + addItem(RimFishbonesCollection::ABS, "ABS", "Absolute"); + setDefault(RimFishbonesCollection::INC); + } +} + CAF_PDM_SOURCE_INIT(RimFishbonesCollection, "FishbonesCollection"); //-------------------------------------------------------------------------------------------------- @@ -56,6 +75,9 @@ RimFishbonesCollection::RimFishbonesCollection() CAF_PDM_InitField(&m_linerDiameter, "LinerDiameter", 0.152, "Liner Inner Diameter", "", "", ""); CAF_PDM_InitField(&m_roughnessFactor, "RoughnessFactor", 1e-05, "Roughness Factor", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_pressureDrop, "PressureDrop", "Pressure Drop", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_lengthAndDepth, "LengthAndDepth", "Length and Depth", "", "", ""); + manuallyModifiedStartMD = false; } @@ -118,6 +140,8 @@ void RimFishbonesCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOr caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup("Multi Segment Wells"); mswGroup->add(&m_linerDiameter); mswGroup->add(&m_roughnessFactor); + mswGroup->add(&m_pressureDrop); + mswGroup->add(&m_lengthAndDepth); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.h b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.h index 51d8171909..815893c0c8 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.h @@ -41,6 +41,21 @@ class RimFishbonesCollection : public RimCheckableNamedObject CAF_PDM_HEADER_INIT; public: + enum PressureDropType { + HYDROSTATIC, + HYDROSTATIC_FRICTION, + HYDROSTATIC_FRICTION_ACCELERATION + }; + + typedef caf::AppEnum PressureDropEnum; + + enum LengthAndDepthType { + ABS, + INC + }; + + typedef caf::AppEnum LengthAndDepthEnum; + RimFishbonesCollection(); RimFishboneWellPathCollection* wellPathCollection() const; @@ -54,6 +69,9 @@ public: double linerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const; double roughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const; + PressureDropEnum pressureDrop() const { return m_pressureDrop(); } + LengthAndDepthEnum lengthAndDepth() const { return m_lengthAndDepth(); } + void setUnitSystemSpecificDefaults(); protected: @@ -71,5 +89,8 @@ private: caf::PdmField m_linerDiameter; caf::PdmField m_roughnessFactor; + caf::PdmField m_pressureDrop; + caf::PdmField m_lengthAndDepth; + bool manuallyModifiedStartMD; };