From 1d7b40fbddd0ecb1d1a59b0c88b95ce3a4a11587 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 29 Jul 2024 11:30:28 +0200 Subject: [PATCH] Remove SSIHUB-related classes. --- .../OsduImportCommands/CMakeLists_files.cmake | 8 -- .../RicWellPathsImportOsduFeature.cpp | 18 +-- .../OsduImportCommands/RimOilFieldEntry.cpp | 119 ------------------ .../OsduImportCommands/RimOilFieldEntry.h | 50 -------- .../OsduImportCommands/RimOilRegionEntry.cpp | 75 ----------- .../OsduImportCommands/RimOilRegionEntry.h | 44 ------- .../OsduImportCommands/RimWellPathImport.cpp | 105 ---------------- .../OsduImportCommands/RimWellPathImport.h | 56 --------- .../OsduImportCommands/RimWellsEntry.cpp | 117 ----------------- .../OsduImportCommands/RimWellsEntry.h | 61 --------- .../RiuWellImportWizard.cpp | 36 ++---- .../OsduImportCommands/RiuWellImportWizard.h | 35 ++---- .../ProjectDataModel/RimProject.cpp | 46 ------- .../ProjectDataModel/RimProject.h | 4 - 14 files changed, 17 insertions(+), 757 deletions(-) delete mode 100644 ApplicationLibCode/Commands/OsduImportCommands/RimOilFieldEntry.cpp delete mode 100644 ApplicationLibCode/Commands/OsduImportCommands/RimOilFieldEntry.h delete mode 100644 ApplicationLibCode/Commands/OsduImportCommands/RimOilRegionEntry.cpp delete mode 100644 ApplicationLibCode/Commands/OsduImportCommands/RimOilRegionEntry.h delete mode 100644 ApplicationLibCode/Commands/OsduImportCommands/RimWellPathImport.cpp delete mode 100644 ApplicationLibCode/Commands/OsduImportCommands/RimWellPathImport.h delete mode 100644 ApplicationLibCode/Commands/OsduImportCommands/RimWellsEntry.cpp delete mode 100644 ApplicationLibCode/Commands/OsduImportCommands/RimWellsEntry.h diff --git a/ApplicationLibCode/Commands/OsduImportCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/OsduImportCommands/CMakeLists_files.cmake index dc30cc6baa..185ab41659 100644 --- a/ApplicationLibCode/Commands/OsduImportCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/OsduImportCommands/CMakeLists_files.cmake @@ -1,19 +1,11 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportOsduFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RimOilFieldEntry.h - ${CMAKE_CURRENT_LIST_DIR}/RimOilRegionEntry.h - ${CMAKE_CURRENT_LIST_DIR}/RimWellPathImport.h - ${CMAKE_CURRENT_LIST_DIR}/RimWellsEntry.h ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogImportWizard.h ) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportOsduFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimOilFieldEntry.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimOilRegionEntry.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimWellPathImport.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimWellsEntry.cpp ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.cpp ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogImportWizard.cpp ) diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RicWellPathsImportOsduFeature.cpp b/ApplicationLibCode/Commands/OsduImportCommands/RicWellPathsImportOsduFeature.cpp index f76cdd8861..f0b7356989 100644 --- a/ApplicationLibCode/Commands/OsduImportCommands/RicWellPathsImportOsduFeature.cpp +++ b/ApplicationLibCode/Commands/OsduImportCommands/RicWellPathsImportOsduFeature.cpp @@ -33,7 +33,6 @@ #include "RimProject.h" #include "RimTools.h" #include "RimWellPathCollection.h" -#include "RimWellPathImport.h" #include "RiuMainWindow.h" #include "RiuWellImportWizard.h" @@ -55,17 +54,6 @@ void RicWellPathsImportOsduFeature::onActionTriggered( bool isChecked ) RiaApplication* app = RiaApplication::instance(); if ( !app->project() ) return; - // Update the UTM bounding box from the reservoir - app->project()->computeUtmAreaOfInterest(); - - QString wellPathsFolderPath = QStandardPaths::writableLocation( QStandardPaths::CacheLocation ) + QString( "/wellpaths/" ); - QDir::root().mkpath( wellPathsFolderPath ); - - if ( !app->project()->wellPathImport() ) return; - - // Keep a copy of the import settings, and restore if cancel is pressed in the import wizard - QString copyOfOriginalObject = app->project()->wellPathImport()->writeObjectToXmlString(); - if ( !app->preferences() ) return; RimProject* project = RimProject::current(); @@ -78,7 +66,7 @@ void RicWellPathsImportOsduFeature::onActionTriggered( bool isChecked ) RiaOsduConnector* osduConnector = app->makeOsduConnector(); - RiuWellImportWizard wellImportwizard( wellPathsFolderPath, osduConnector, app->project()->wellPathImport(), RiuMainWindow::instance() ); + RiuWellImportWizard wellImportwizard( osduConnector, RiuMainWindow::instance() ); if ( QDialog::Accepted == wellImportwizard.exec() ) { @@ -115,10 +103,6 @@ void RicWellPathsImportOsduFeature::onActionTriggered( bool isChecked ) project->updateConnectedEditors(); app->project()->scheduleCreateDisplayModelAndRedrawAllViews(); } - else - { - app->project()->wellPathImport()->readObjectFromXmlString( copyOfOriginalObject, caf::PdmDefaultObjectFactory::instance() ); - } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RimOilFieldEntry.cpp b/ApplicationLibCode/Commands/OsduImportCommands/RimOilFieldEntry.cpp deleted file mode 100644 index e3410cb72d..0000000000 --- a/ApplicationLibCode/Commands/OsduImportCommands/RimOilFieldEntry.cpp +++ /dev/null @@ -1,119 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011- Statoil ASA -// Copyright (C) 2013- Ceetron Solutions AS -// Copyright (C) 2011-2012 Ceetron AS -// -// 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 "RimOilFieldEntry.h" -#include "RimWellPathImport.h" - -#include "RifJsonEncodeDecode.h" - -#include -#include -#include -#include - -CAF_PDM_SOURCE_INIT( RimOilFieldEntry, "RimOilFieldEntry" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimOilFieldEntry::RimOilFieldEntry() -{ - CAF_PDM_InitObject( "OilFieldEntry" ); - - CAF_PDM_InitFieldNoDefault( &name, "OilFieldName", "Oil Field Name" ); - CAF_PDM_InitFieldNoDefault( &edmId, "EdmId", "Edm ID" ); - CAF_PDM_InitField( &selected, "Selected", false, "Selected" ); - - CAF_PDM_InitFieldNoDefault( &wellsFilePath, "wellsFilePath", "Wells File Path" ); - - CAF_PDM_InitFieldNoDefault( &wells, "Wells", "" ); - wells.uiCapability()->setUiTreeChildrenHidden( true ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimOilFieldEntry::userDescriptionField() -{ - return &name; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimOilFieldEntry::objectToggleField() -{ - return &selected; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimOilFieldEntry::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) -{ - if ( changedField == &selected ) - { - updateEnabledState(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimOilFieldEntry::initAfterRead() -{ - updateEnabledState(); - - updateUiIconFromToggleField(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimOilFieldEntry::updateEnabledState() -{ - bool wellsReadOnly = !selected; - if ( isUiReadOnly() ) - { - wellsReadOnly = true; - } - - for ( size_t i = 0; i < wells.size(); i++ ) - { - wells[i]->setUiReadOnly( wellsReadOnly ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimWellPathEntry* RimOilFieldEntry::find( const QString& entryName, RimWellPathEntry::WellTypeEnum wellPathType ) -{ - for ( size_t i = 0; i < wells.size(); i++ ) - { - RimWellPathEntry* wellPathEntry = wells[i]; - if ( wellPathEntry->name == entryName && wellPathEntry->wellPathType == wellPathType ) - { - return wellPathEntry; - } - } - - return nullptr; -} diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RimOilFieldEntry.h b/ApplicationLibCode/Commands/OsduImportCommands/RimOilFieldEntry.h deleted file mode 100644 index b0c71c6706..0000000000 --- a/ApplicationLibCode/Commands/OsduImportCommands/RimOilFieldEntry.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS -// -// 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 "cafPdmChildArrayField.h" -#include "cafPdmField.h" -#include "cafPdmObject.h" - -#include "RimWellsEntry.h" - -class RimOilFieldEntry : public caf::PdmObject -{ - CAF_PDM_HEADER_INIT; - -public: - RimOilFieldEntry(); - - caf::PdmField name; - caf::PdmField edmId; - caf::PdmField selected; - caf::PdmField wellsFilePath; // Location of the response file from request "/wells" - - caf::PdmChildArrayField wells; - - RimWellPathEntry* find( const QString& name, RimWellPathEntry::WellTypeEnum wellPathType ); - - caf::PdmFieldHandle* userDescriptionField() override; - caf::PdmFieldHandle* objectToggleField() override; - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; - void initAfterRead() override; - - // private: - void updateEnabledState(); -}; diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RimOilRegionEntry.cpp b/ApplicationLibCode/Commands/OsduImportCommands/RimOilRegionEntry.cpp deleted file mode 100644 index bc8875233b..0000000000 --- a/ApplicationLibCode/Commands/OsduImportCommands/RimOilRegionEntry.cpp +++ /dev/null @@ -1,75 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS -// -// 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 "RimOilRegionEntry.h" -#include "RimOilFieldEntry.h" - -CAF_PDM_SOURCE_INIT( RimOilRegionEntry, "RimOilRegionEntry" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimOilRegionEntry::RimOilRegionEntry() -{ - CAF_PDM_InitObject( "OilRegionEntry" ); - - CAF_PDM_InitFieldNoDefault( &name, "OilRegionEntry", "OilRegionEntry" ); - - CAF_PDM_InitFieldNoDefault( &fields, "Fields", "" ); - - CAF_PDM_InitField( &selected, "Selected", false, "Selected" ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimOilRegionEntry::userDescriptionField() -{ - return &name; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimOilRegionEntry::objectToggleField() -{ - return &selected; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimOilRegionEntry::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) -{ - if ( &selected == changedField ) - { - updateState(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimOilRegionEntry::updateState() -{ - for ( size_t i = 0; i < fields.size(); i++ ) - { - fields[i]->setUiReadOnly( !selected ); - fields[i]->updateEnabledState(); - } -} diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RimOilRegionEntry.h b/ApplicationLibCode/Commands/OsduImportCommands/RimOilRegionEntry.h deleted file mode 100644 index 897286bb56..0000000000 --- a/ApplicationLibCode/Commands/OsduImportCommands/RimOilRegionEntry.h +++ /dev/null @@ -1,44 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS -// -// 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 "cafPdmChildArrayField.h" -#include "cafPdmField.h" -#include "cafPdmObject.h" - -class RimOilFieldEntry; - -class RimOilRegionEntry : public caf::PdmObject -{ - CAF_PDM_HEADER_INIT; - -public: - RimOilRegionEntry(); - - caf::PdmFieldHandle* userDescriptionField() override; - caf::PdmFieldHandle* objectToggleField() override; - - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; - - void updateState(); - - caf::PdmField name; - caf::PdmField selected; - caf::PdmChildArrayField fields; -}; diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RimWellPathImport.cpp b/ApplicationLibCode/Commands/OsduImportCommands/RimWellPathImport.cpp deleted file mode 100644 index f78dc3edc9..0000000000 --- a/ApplicationLibCode/Commands/OsduImportCommands/RimWellPathImport.cpp +++ /dev/null @@ -1,105 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2024 Equinor 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 "RimWellPathImport.h" - -#include "RimFileWellPath.h" -#include "RimOilFieldEntry.h" -#include "RimOilRegionEntry.h" -#include "RimTools.h" -#include "RimWellPath.h" -#include "RimWellPathCollection.h" - -#include "cafPdmUiCheckBoxEditor.h" -#include "cafPdmUiTreeAttributes.h" -#include "cafPdmUiTreeViewEditor.h" - -#include - -namespace caf -{ -template <> -void caf::AppEnum::setUp() -{ - addItem( RimWellPathImport::UTM_FILTER_OFF, "UTM_FILTER_OFF", "Off" ); - addItem( RimWellPathImport::UTM_FILTER_PROJECT, "UTM_FILTER_PROJECT", "Project" ); - addItem( RimWellPathImport::UTM_FILTER_CUSTOM, "UTM_FILTER_CUSTOM", "Custom" ); - setDefault( RimWellPathImport::UTM_FILTER_PROJECT ); -} - -} // End namespace caf - -CAF_PDM_SOURCE_INIT( RimWellPathImport, "RimWellPathImport" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimWellPathImport::RimWellPathImport() -{ - CAF_PDM_InitObject( "RimWellPathImport" ); - - caf::AppEnum defaultUtmMode = UTM_FILTER_OFF; - CAF_PDM_InitField( &utmFilterMode, "UtmMode", defaultUtmMode, "Utm Filter" ); - - CAF_PDM_InitField( &north, "UtmNorth", 0.0, "North" ); - CAF_PDM_InitField( &south, "UtmSouth", 0.0, "South" ); - CAF_PDM_InitField( &east, "UtmEast", 0.0, "East" ); - CAF_PDM_InitField( &west, "UtmWest", 0.0, "West" ); - - CAF_PDM_InitFieldNoDefault( ®ions_OBSOLETE, "Regions", "" ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellPathImport::initAfterRead() -{ - updateFieldVisibility(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellPathImport::updateFieldVisibility() -{ - if ( utmFilterMode == UTM_FILTER_CUSTOM ) - { - north.uiCapability()->setUiReadOnly( false ); - south.uiCapability()->setUiReadOnly( false ); - east.uiCapability()->setUiReadOnly( false ); - west.uiCapability()->setUiReadOnly( false ); - } - else - { - north.uiCapability()->setUiReadOnly( true ); - south.uiCapability()->setUiReadOnly( true ); - east.uiCapability()->setUiReadOnly( true ); - west.uiCapability()->setUiReadOnly( true ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellPathImport::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) -{ - if ( changedField == &utmFilterMode ) - { - updateFieldVisibility(); - } -} diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RimWellPathImport.h b/ApplicationLibCode/Commands/OsduImportCommands/RimWellPathImport.h deleted file mode 100644 index abaf3f0a09..0000000000 --- a/ApplicationLibCode/Commands/OsduImportCommands/RimWellPathImport.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS -// -// 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 "cafAppEnum.h" -#include "cafPdmChildArrayField.h" -#include "cafPdmField.h" -#include "cafPdmObject.h" - -class RimOilRegionEntry; - -class RimWellPathImport : public caf::PdmObject -{ - CAF_PDM_HEADER_INIT; - -public: - enum UtmFilterEnum - { - UTM_FILTER_OFF, - UTM_FILTER_PROJECT, - UTM_FILTER_CUSTOM - }; - -public: - RimWellPathImport(); - - caf::PdmField> utmFilterMode; - caf::PdmField north; - caf::PdmField south; - caf::PdmField east; - caf::PdmField west; - -protected: - void initAfterRead() override; - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; - - void updateFieldVisibility(); - - caf::PdmChildArrayField regions_OBSOLETE; -}; diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RimWellsEntry.cpp b/ApplicationLibCode/Commands/OsduImportCommands/RimWellsEntry.cpp deleted file mode 100644 index 4da94f883d..0000000000 --- a/ApplicationLibCode/Commands/OsduImportCommands/RimWellsEntry.cpp +++ /dev/null @@ -1,117 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS -// -// 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 "RimWellsEntry.h" -#include "cafAppEnum.h" - -namespace caf -{ -template <> -void caf::AppEnum::setUp() -{ - addItem( RimWellPathEntry::WELL_ALL, "WELL_ALL", "All" ); - addItem( RimWellPathEntry::WELL_SURVEY, "WELL_SURVEY", "Survey" ); - addItem( RimWellPathEntry::WELL_PLAN, "WELL_PLAN", "Plan" ); - setDefault( RimWellPathEntry::WELL_ALL ); -} - -} // End namespace caf - -CAF_PDM_SOURCE_INIT( RimWellPathEntry, "RimWellPathEntry" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimWellPathEntry::RimWellPathEntry() -{ - CAF_PDM_InitObject( "WellPathEntry" ); - - CAF_PDM_InitFieldNoDefault( &name, "Name", "Name" ); - CAF_PDM_InitField( &selected, "Selected", false, "Selected" ); - - caf::AppEnum wellType = WELL_ALL; - CAF_PDM_InitField( &wellPathType, "WellPathType", wellType, "Well path type" ); - - CAF_PDM_InitFieldNoDefault( &surveyType, "surveyType", "surveyType" ); - CAF_PDM_InitFieldNoDefault( &requestUrl, "requestUrl", "requestUrl" ); - - CAF_PDM_InitFieldNoDefault( &wellPathFilePath, "wellPathFilePath", "wellPathFilePath" ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimWellPathEntry::userDescriptionField() -{ - return &name; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimWellPathEntry::objectToggleField() -{ - return &selected; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimWellPathEntry* RimWellPathEntry::createWellPathEntry( const QString& name, - const QString& surveyType, - const QString& requestUrl, - const QString& absolutePath, - WellTypeEnum wellType ) -{ - RimWellPathEntry* entry = new RimWellPathEntry(); - entry->name = name; - entry->surveyType = surveyType; - entry->requestUrl = requestUrl; - entry->wellPathType = wellType; - - QString responseFilePath = undefinedWellPathLocation(); - - int strIndex = requestUrl.indexOf( "edm/" ); - if ( strIndex >= 0 ) - { - QString lastPart = requestUrl.right( requestUrl.size() - strIndex ); - lastPart = lastPart.replace( '/', '_' ); - - responseFilePath = absolutePath + "/" + lastPart + ".json"; - } - - entry->wellPathFilePath = responseFilePath; - - return entry; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimWellPathEntry::undefinedWellPathLocation() -{ - return "UNDEFIED_WELLPATH_FILE"; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimWellPathEntry::isWellPathValid() -{ - return ( wellPathFilePath().compare( undefinedWellPathLocation() ) != 0 ); -} diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RimWellsEntry.h b/ApplicationLibCode/Commands/OsduImportCommands/RimWellsEntry.h deleted file mode 100644 index 85fb7a2cdd..0000000000 --- a/ApplicationLibCode/Commands/OsduImportCommands/RimWellsEntry.h +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS -// -// 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 "cafAppEnum.h" -#include "cafPdmField.h" -#include "cafPdmObject.h" - -class RimWellPathEntry : public caf::PdmObject -{ - CAF_PDM_HEADER_INIT; - -public: - enum WellTypeEnum - { - WELL_SURVEY, - WELL_PLAN, - WELL_ALL - }; - -public: - RimWellPathEntry(); - - static RimWellPathEntry* createWellPathEntry( const QString& name, - const QString& surveyType, - const QString& requestUrl, - const QString& absolutePath, - WellTypeEnum wellType ); - - caf::PdmFieldHandle* userDescriptionField() override; - caf::PdmFieldHandle* objectToggleField() override; - - caf::PdmField name; - caf::PdmField selected; - - caf::PdmField> wellPathType; - caf::PdmField surveyType; - caf::PdmField requestUrl; - - bool isWellPathValid(); - caf::PdmField wellPathFilePath; // Location of the well path response - -private: - static QString undefinedWellPathLocation(); -}; diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RiuWellImportWizard.cpp b/ApplicationLibCode/Commands/OsduImportCommands/RiuWellImportWizard.cpp index 5cc7a20eb1..9a1e2c79c8 100644 --- a/ApplicationLibCode/Commands/OsduImportCommands/RiuWellImportWizard.cpp +++ b/ApplicationLibCode/Commands/OsduImportCommands/RiuWellImportWizard.cpp @@ -20,15 +20,7 @@ #include "RiaFeatureCommandContext.h" -#include "RimWellPathImport.h" - #include "cafCmdFeatureMenuBuilder.h" -#include "cafPdmUiListView.h" -#include "cafPdmUiPropertyView.h" -#include "cafPdmUiTreeAttributes.h" -#include "cafPdmUiTreeView.h" -#include "cafPdmUiTreeViewEditor.h" -#include "cafUtils.h" #include #include @@ -44,23 +36,17 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiuWellImportWizard::RiuWellImportWizard( const QString& downloadFolder, - RiaOsduConnector* osduConnector, - RimWellPathImport* wellPathImportObject, - QWidget* parent /*= 0*/ ) +RiuWellImportWizard::RiuWellImportWizard( RiaOsduConnector* osduConnector, QWidget* parent /*= 0*/ ) : QWizard( parent ) { - m_wellPathImportObject = wellPathImportObject; - - m_osduConnector = osduConnector; - m_destinationFolder = downloadFolder; + m_osduConnector = osduConnector; m_firstTimeRequestingAuthentication = true; addPage( new AuthenticationPage( m_osduConnector, this ) ); - addPage( new FieldSelectionPage( m_wellPathImportObject, m_osduConnector, this ) ); - addPage( new WellSelectionPage( m_wellPathImportObject, m_osduConnector, this ) ); - addPage( new WellSummaryPage( m_wellPathImportObject, m_osduConnector, this ) ); + addPage( new FieldSelectionPage( m_osduConnector, this ) ); + addPage( new WellSelectionPage( m_osduConnector, this ) ); + addPage( new WellSummaryPage( m_osduConnector, this ) ); } //-------------------------------------------------------------------------------------------------- @@ -75,7 +61,6 @@ RiuWellImportWizard::~RiuWellImportWizard() //-------------------------------------------------------------------------------------------------- void RiuWellImportWizard::downloadFields( const QString& fieldName ) { - // TODO: filter by user input m_osduConnector->requestFieldsByName( fieldName ); } @@ -234,7 +219,7 @@ void AuthenticationPage::accessOk() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -FieldSelectionPage::FieldSelectionPage( RimWellPathImport* wellPathImport, RiaOsduConnector* osduConnector, QWidget* parent /*= 0*/ ) +FieldSelectionPage::FieldSelectionPage( RiaOsduConnector* osduConnector, QWidget* parent /*= 0*/ ) { setTitle( "Field Selection" ); @@ -349,7 +334,7 @@ FieldSelectionPage::~FieldSelectionPage() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -WellSelectionPage::WellSelectionPage( RimWellPathImport* wellPathImport, RiaOsduConnector* osduConnector, QWidget* parent /*= 0*/ ) +WellSelectionPage::WellSelectionPage( RiaOsduConnector* osduConnector, QWidget* parent /*= 0*/ ) { QVBoxLayout* layout = new QVBoxLayout; setLayout( layout ); @@ -389,8 +374,6 @@ WellSelectionPage::WellSelectionPage( RimWellPathImport* wellPathImport, RiaOsdu QObject::connect( filterLineEdit, &QLineEdit::textChanged, m_proxyModel, &QSortFilterProxyModel::setFilterWildcard ); - m_wellPathImportObject = wellPathImport; - m_osduConnector = osduConnector; connect( m_osduConnector, SIGNAL( wellsFinished() ), SLOT( wellsFinished() ) ); connect( m_osduConnector, SIGNAL( wellboresFinished( const QString& ) ), SLOT( wellboresFinished( const QString& ) ) ); @@ -483,11 +466,8 @@ void WellSelectionPage::selectWellbore( const QItemSelection& newSelection, cons //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -WellSummaryPage::WellSummaryPage( RimWellPathImport* wellPathImport, RiaOsduConnector* osduConnector, QWidget* parent /*= 0*/ ) +WellSummaryPage::WellSummaryPage( RiaOsduConnector* osduConnector, QWidget* parent /*= 0*/ ) { - m_wellPathImportObject = wellPathImport; - m_wellPathImportObject->setUiHidden( true ); - m_osduConnector = osduConnector; QVBoxLayout* layout = new QVBoxLayout; diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RiuWellImportWizard.h b/ApplicationLibCode/Commands/OsduImportCommands/RiuWellImportWizard.h index e1471237e1..7b2583167c 100644 --- a/ApplicationLibCode/Commands/OsduImportCommands/RiuWellImportWizard.h +++ b/ApplicationLibCode/Commands/OsduImportCommands/RiuWellImportWizard.h @@ -35,15 +35,6 @@ class QLabel; class QTextEdit; class QTableView; -class RimWellPathImport; - -namespace caf -{ -class PdmUiTreeView; -class PdmUiListView; -class PdmUiPropertyView; -} // namespace caf - class OsduFieldTableModel : public QAbstractTableModel { Q_OBJECT @@ -285,7 +276,7 @@ class FieldSelectionPage : public QWizardPage Q_OBJECT public: - FieldSelectionPage( RimWellPathImport* wellPathImport, RiaOsduConnector* m_osduConnector, QWidget* parent = nullptr ); + FieldSelectionPage( RiaOsduConnector* m_osduConnector, QWidget* parent = nullptr ); ~FieldSelectionPage() override; bool isComplete() const override; @@ -313,7 +304,7 @@ class WellSelectionPage : public QWizardPage Q_OBJECT public: - WellSelectionPage( RimWellPathImport* wellPathImport, RiaOsduConnector* m_osduConnector, QWidget* parent = nullptr ); + WellSelectionPage( RiaOsduConnector* m_osduConnector, QWidget* parent = nullptr ); ~WellSelectionPage() override; void initializePage() override; @@ -325,7 +316,6 @@ private slots: void selectWellbore( const QItemSelection& newSelection, const QItemSelection& oldSelection ); private: - RimWellPathImport* m_wellPathImportObject; RiaOsduConnector* m_osduConnector; QTableView* m_tableView; OsduWellboreTableModel* m_osduWellboresModel; @@ -340,7 +330,7 @@ class WellSummaryPage : public QWizardPage Q_OBJECT public: - WellSummaryPage( RimWellPathImport* wellPathImport, RiaOsduConnector* osduConnector, QWidget* parent = nullptr ); + WellSummaryPage( RiaOsduConnector* osduConnector, QWidget* parent = nullptr ); void initializePage() override; bool isComplete() const override; @@ -349,11 +339,10 @@ private slots: void wellboreTrajectoryFinished( const QString& wellboreId, int numTrajectories, const QString& errorMessage ); private: - RimWellPathImport* m_wellPathImportObject; - RiaOsduConnector* m_osduConnector; - QTextEdit* m_textEdit; - std::set m_pendingWellboreIds; - mutable QMutex m_mutex; + RiaOsduConnector* m_osduConnector; + QTextEdit* m_textEdit; + std::set m_pendingWellboreIds; + mutable QMutex m_mutex; }; //-------------------------------------------------------------------------------------------------- @@ -373,10 +362,7 @@ public: double datumElevation; }; - RiuWellImportWizard( const QString& downloadFolder, - RiaOsduConnector* osduConnector, - RimWellPathImport* wellPathImportObject, - QWidget* parent = nullptr ); + RiuWellImportWizard( RiaOsduConnector* osduConnector, QWidget* parent = nullptr ); ~RiuWellImportWizard() override; // Methods used from the wizard pages @@ -402,11 +388,6 @@ private: QString m_selectedFieldId; std::vector m_selectedWellboreIds; - QString m_destinationFolder; - - RimWellPathImport* m_wellPathImportObject; - caf::PdmUiTreeView* m_pdmTreeView; - bool m_firstTimeRequestingAuthentication; std::vector m_wellInfos; diff --git a/ApplicationLibCode/ProjectDataModel/RimProject.cpp b/ApplicationLibCode/ProjectDataModel/RimProject.cpp index 5377b8079f..2d0762ecb6 100644 --- a/ApplicationLibCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimProject.cpp @@ -113,8 +113,6 @@ #include "RimGridStatisticsPlotCollection.h" #endif -#include "OsduImportCommands/RimWellPathImport.h" - #include "RiuMainWindow.h" #include "RiuPlotMainWindow.h" @@ -161,10 +159,6 @@ RimProject::RimProject() CAF_PDM_InitFieldNoDefault( &scriptCollection, "ScriptCollection", "Octave Scripts", ":/octave.png" ); scriptCollection.xmlCapability()->disableIO(); - CAF_PDM_InitFieldNoDefault( &wellPathImport, "WellPathImport", "WellPathImport" ); - wellPathImport = new RimWellPathImport(); - wellPathImport.uiCapability()->setUiTreeChildrenHidden( true ); - CAF_PDM_InitFieldNoDefault( &m_mainPlotCollection, "MainPlotCollection", "Plots" ); CAF_PDM_InitFieldNoDefault( &viewLinkerCollection, "LinkedViews", "Linked Views", ":/LinkView.svg" ); @@ -914,46 +908,6 @@ const RimOilField* RimProject::activeOilField() const return oilFields[0]; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimProject::computeUtmAreaOfInterest() -{ - cvf::BoundingBox projectBB; - for ( RimCase* rimCase : allGridCases() ) - { - RimEclipseCase* eclipseCase = dynamic_cast( rimCase ); - if ( eclipseCase && eclipseCase->eclipseCaseData() ) - { - for ( size_t gridIdx = 0; gridIdx < eclipseCase->eclipseCaseData()->gridCount(); gridIdx++ ) - { - RigGridBase* rigGrid = eclipseCase->eclipseCaseData()->grid( gridIdx ); - projectBB.add( rigGrid->boundingBox() ); - } - } - else - { - // Todo : calculate BBox of GeoMechCase - } - } - - if ( projectBB.isValid() ) - { - double north, south, east, west; - - north = projectBB.max().y(); - south = projectBB.min().y(); - - west = projectBB.min().x(); - east = projectBB.max().x(); - - wellPathImport->north = north; - wellPathImport->south = south; - wellPathImport->east = east; - wellPathImport->west = west; - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimProject.h b/ApplicationLibCode/ProjectDataModel/RimProject.h index 6c4641c481..a2f77816f0 100644 --- a/ApplicationLibCode/ProjectDataModel/RimProject.h +++ b/ApplicationLibCode/ProjectDataModel/RimProject.h @@ -66,7 +66,6 @@ class RimViewLinker; class RimViewLinkerCollection; class RimViewWindow; class RimWellPath; -class RimWellPathImport; class RimFractureTemplateCollection; class RimFractureTemplate; class RimValveTemplateCollection; @@ -99,7 +98,6 @@ public: caf::PdmChildArrayField oilFields; caf::PdmChildField colorLegendCollection; caf::PdmChildField scriptCollection; - caf::PdmChildField wellPathImport; caf::PdmChildField viewLinkerCollection; caf::PdmChildField calculationCollection; caf::PdmChildField gridCalculationCollection; @@ -146,8 +144,6 @@ public: void scheduleCreateDisplayModelAndRedrawAllViews(); - void computeUtmAreaOfInterest(); - [[nodiscard]] std::vector allOilFields() const; RimOilField* activeOilField(); const RimOilField* activeOilField() const;