2017-05-16 09:43:41 +02:00
/////////////////////////////////////////////////////////////////////////////////
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
2017-05-30 14:37:51 +02:00
#include "RicExportCompletionDataSettingsUi.h"
2017-05-16 09:43:41 +02:00
2017-06-14 15:30:50 +02:00
namespace caf
{
template <>
void RicExportCompletionDataSettingsUi :: ExportSplitType :: setUp ()
{
addItem ( RicExportCompletionDataSettingsUi :: UNIFIED_FILE , "UNIFIED_FILE" , "Unified File" );
addItem ( RicExportCompletionDataSettingsUi :: SPLIT_ON_WELL , "SPLIT_ON_WELL" , "Split on Well" );
addItem ( RicExportCompletionDataSettingsUi :: SPLIT_ON_WELL_AND_COMPLETION_TYPE , "SPLIT_ON_WELL_AND_COMPLETION_TYPE" , "Split on Well and Completion Type" );
setDefault ( RicExportCompletionDataSettingsUi :: UNIFIED_FILE );
}
2017-06-15 11:37:00 +02:00
template <>
void RicExportCompletionDataSettingsUi :: WellSelectionType :: setUp ()
{
addItem ( RicExportCompletionDataSettingsUi :: ALL_WELLS , "ALL_WELLS" , "All Wells" );
addItem ( RicExportCompletionDataSettingsUi :: CHECKED_WELLS , "CHECKED_WELLS" , "Checked Wells" );
2017-06-22 13:39:30 +02:00
addItem ( RicExportCompletionDataSettingsUi :: SELECTED_WELLS , "SELECTED_WELLS" , "Selected Wells" );
2017-06-15 11:37:00 +02:00
setDefault ( RicExportCompletionDataSettingsUi :: ALL_WELLS );
}
2017-06-21 10:58:02 +02:00
template <>
void RicExportCompletionDataSettingsUi :: CompdatExportType :: setUp ()
{
2017-06-21 15:54:18 +02:00
addItem ( RicExportCompletionDataSettingsUi :: TRANSMISSIBILITIES , "TRANSMISSIBILITIES" , "Calculated Transmissibilities" );
addItem ( RicExportCompletionDataSettingsUi :: WPIMULT_AND_DEFAULT_CONNECTION_FACTORS , "WPIMULT_AND_DEFAULT_CONNECTION_FACTORS" , "Default Connection Factors and WPIMULT" );
2017-06-21 10:58:02 +02:00
setDefault ( RicExportCompletionDataSettingsUi :: TRANSMISSIBILITIES );
}
2017-06-14 15:30:50 +02:00
}
2017-05-30 14:37:51 +02:00
CAF_PDM_SOURCE_INIT ( RicExportCompletionDataSettingsUi , "RicExportCompletionDataSettingsUi" );
2017-05-16 09:43:41 +02:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-05-30 14:37:51 +02:00
RicExportCompletionDataSettingsUi :: RicExportCompletionDataSettingsUi ()
2017-06-22 13:39:30 +02:00
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicExportCompletionDataSettingsUi :: RicExportCompletionDataSettingsUi ( bool onlyWellPathCollectionSelected )
2017-05-16 09:43:41 +02:00
{
CAF_PDM_InitObject ( "RimExportCompletionDataSettings" , "" , "" , "" );
2017-06-14 15:30:50 +02:00
CAF_PDM_InitFieldNoDefault ( & fileSplit , "FileSplit" , "File Split" , "" , "" , "" );
2017-06-15 11:37:00 +02:00
CAF_PDM_InitFieldNoDefault ( & wellSelection , "WellSelection" , "Well Selection" , "" , "" , "" );
2017-06-21 15:54:18 +02:00
CAF_PDM_InitFieldNoDefault ( & compdatExport , "compdatExport" , "Export" , "" , " " , "" );
2017-06-14 15:30:50 +02:00
2017-05-30 15:42:05 +02:00
CAF_PDM_InitField ( & timeStep , "TimeStepIndex" , 0 , "Time Step" , "" , "" , "" );
2017-05-29 13:13:25 +02:00
CAF_PDM_InitField ( & includePerforations , "IncludePerforations" , true , "Include Perforations" , "" , "" , "" );
CAF_PDM_InitField ( & includeFishbones , "IncludeFishbones" , true , "Include Fishbones" , "" , "" , "" );
2017-06-21 15:54:18 +02:00
CAF_PDM_InitField ( & excludeMainBoreForFishbones , "ExcludeMainBoreForFishbones" , false , "Exclude Main Bore Transmissibility For Fishbones" , "" , "" , "" );
2017-06-22 13:39:30 +02:00
m_onlyWellPathCollectionSelected = onlyWellPathCollectionSelected ;
2017-05-30 15:42:05 +02:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList < caf :: PdmOptionItemInfo > RicExportCompletionDataSettingsUi :: calculateValueOptions ( const caf :: PdmFieldHandle * fieldNeedingOptions , bool * useOptionsOnly )
{
QList < caf :: PdmOptionItemInfo > options ;
if ( fieldNeedingOptions == & timeStep )
{
QStringList timeStepNames ;
if ( caseToApply )
{
timeStepNames = caseToApply -> timeStepStrings ();
}
for ( int i = 0 ; i < timeStepNames . size (); i ++ )
{
options . push_back ( caf :: PdmOptionItemInfo ( timeStepNames [ i ], i ));
}
}
2017-06-22 13:39:30 +02:00
else if ( fieldNeedingOptions == & wellSelection )
{
if ( m_onlyWellPathCollectionSelected )
{
options . push_back ( caf :: PdmOptionItemInfo ( "All Wells" , ALL_WELLS ));
options . push_back ( caf :: PdmOptionItemInfo ( "Checked Wells" , CHECKED_WELLS ));
}
else
{
options . push_back ( caf :: PdmOptionItemInfo ( "Selected Wells" , SELECTED_WELLS ));
}
}
2017-05-30 15:42:05 +02:00
else
{
options = RicCaseAndFileExportSettingsUi :: calculateValueOptions ( fieldNeedingOptions , useOptionsOnly );
}
return options ;
2017-05-16 09:43:41 +02:00
}
2017-06-21 10:58:02 +02:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi :: defineUiOrdering ( QString uiConfigName , caf :: PdmUiOrdering & uiOrdering )
{
2017-06-22 13:39:30 +02:00
2017-06-21 15:54:18 +02:00
caf :: PdmUiGroup * generalExportSettings = uiOrdering . addNewGroup ( "General Export Settings" );
generalExportSettings -> add ( & folder );
generalExportSettings -> add ( & caseToApply );
generalExportSettings -> add ( & compdatExport );
2017-06-22 13:39:30 +02:00
2017-06-21 15:54:18 +02:00
generalExportSettings -> add ( & wellSelection );
2017-06-22 13:39:30 +02:00
if ( ! m_onlyWellPathCollectionSelected ) wellSelection . setValue ( SELECTED_WELLS );
2017-06-21 15:54:18 +02:00
generalExportSettings -> add ( & fileSplit );
caf :: PdmUiGroup * fishboneGroup = uiOrdering . addNewGroup ( "Export of Fishbone Completions" );
fishboneGroup -> add ( & includeFishbones );
fishboneGroup -> add ( & excludeMainBoreForFishbones );
caf :: PdmUiGroup * perfIntervalGroup = uiOrdering . addNewGroup ( "Export of Perforation Completions" );
perfIntervalGroup -> add ( & includePerforations );
2017-06-22 13:39:30 +02:00
perfIntervalGroup -> add ( & timeStep );
2017-06-21 10:58:02 +02:00
}