2013-09-02 08:39:29 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2024-02-28 08:10:52 +01:00
|
|
|
// Copyright (C) 2024 Equinor ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-09-02 08:39:29 +02:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-09-02 08:39:29 +02:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2013-09-02 08:39:29 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#include "RimWellPathImport.h"
|
2017-02-24 13:32:25 +01:00
|
|
|
|
2019-12-11 11:39:02 +01:00
|
|
|
#include "RimFileWellPath.h"
|
2017-02-24 13:32:25 +01:00
|
|
|
#include "RimOilFieldEntry.h"
|
|
|
|
|
#include "RimOilRegionEntry.h"
|
2013-10-24 09:50:16 +02:00
|
|
|
#include "RimTools.h"
|
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
|
#include "RimWellPathCollection.h"
|
|
|
|
|
|
2023-01-06 14:56:41 +01:00
|
|
|
#include "cafPdmUiCheckBoxEditor.h"
|
2022-02-04 15:49:22 +01:00
|
|
|
#include "cafPdmUiTreeAttributes.h"
|
2013-09-26 10:57:35 +02:00
|
|
|
#include "cafPdmUiTreeViewEditor.h"
|
2013-09-02 08:39:29 +02:00
|
|
|
|
2013-10-24 09:50:16 +02:00
|
|
|
#include <QFileInfo>
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
namespace caf
|
|
|
|
|
{
|
|
|
|
|
template <>
|
|
|
|
|
void caf::AppEnum<RimWellPathImport::UtmFilterEnum>::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 );
|
|
|
|
|
}
|
2013-09-02 08:39:29 +02:00
|
|
|
|
|
|
|
|
} // End namespace caf
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_SOURCE_INIT( RimWellPathImport, "RimWellPathImport" );
|
2013-09-02 08:39:29 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2013-09-02 08:39:29 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RimWellPathImport::RimWellPathImport()
|
|
|
|
|
{
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitObject( "RimWellPathImport" );
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2013-09-02 08:39:29 +02:00
|
|
|
caf::AppEnum<RimWellPathImport::UtmFilterEnum> defaultUtmMode = UTM_FILTER_OFF;
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &utmFilterMode, "UtmMode", defaultUtmMode, "Utm Filter" );
|
2013-09-02 08:39:29 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
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" );
|
2013-09-02 08:39:29 +02:00
|
|
|
|
2024-02-28 08:10:52 +01:00
|
|
|
CAF_PDM_InitFieldNoDefault( ®ions_OBSOLETE, "Regions", "" );
|
2013-09-02 08:39:29 +02:00
|
|
|
}
|
|
|
|
|
|
2013-09-07 19:38:52 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2013-09-07 19:38:52 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimWellPathImport::initAfterRead()
|
|
|
|
|
{
|
|
|
|
|
updateFieldVisibility();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2013-09-07 19:38:52 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimWellPathImport::updateFieldVisibility()
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( utmFilterMode == UTM_FILTER_CUSTOM )
|
2013-09-07 19:38:52 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
north.uiCapability()->setUiReadOnly( false );
|
|
|
|
|
south.uiCapability()->setUiReadOnly( false );
|
|
|
|
|
east.uiCapability()->setUiReadOnly( false );
|
|
|
|
|
west.uiCapability()->setUiReadOnly( false );
|
2013-09-07 19:38:52 +02:00
|
|
|
}
|
2013-09-08 10:53:25 +02:00
|
|
|
else
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
north.uiCapability()->setUiReadOnly( true );
|
|
|
|
|
south.uiCapability()->setUiReadOnly( true );
|
|
|
|
|
east.uiCapability()->setUiReadOnly( true );
|
|
|
|
|
west.uiCapability()->setUiReadOnly( true );
|
2013-09-08 10:53:25 +02:00
|
|
|
}
|
2013-09-07 19:38:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2013-09-07 19:38:52 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 10:48:40 +01:00
|
|
|
void RimWellPathImport::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
2013-09-07 19:38:52 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( changedField == &utmFilterMode )
|
2013-09-07 19:38:52 +02:00
|
|
|
{
|
|
|
|
|
updateFieldVisibility();
|
|
|
|
|
}
|
|
|
|
|
}
|