#6878 Export Completion: Make subset of settings available from Python

Python code linting changes detected by black
This commit is contained in:
Magne Sjaastad
2021-05-03 13:21:36 +02:00
parent 69a03df9da
commit 010e964ea8
13 changed files with 1780 additions and 130 deletions

View File

@@ -38,7 +38,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfNewWellBoreStabilityPlotFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicfImportWellLogFiles.h
${CMAKE_CURRENT_LIST_DIR}/RicfImportFormationNames.h
${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.h
${CMAKE_CURRENT_LIST_DIR}/RicfEnableDataSourceAsComment.h
)
set (SOURCE_GROUP_SOURCE_FILES
@@ -80,7 +79,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfCreateWellBoreStabilityPlotFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfImportWellLogFiles.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfImportFormationNames.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfEnableDataSourceAsComment.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -150,22 +150,6 @@ QString RicfCommandFileExecutor::getLastProjectPath() const
return m_lastProjectPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicfCommandFileExecutor::setExportDataSouceAsComment( bool enable )
{
m_exportDataSourceAsComment = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicfCommandFileExecutor::exportDataSouceAsComment() const
{
return m_exportDataSourceAsComment;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -57,9 +57,6 @@ public:
void setLastProjectPath( const QString& path );
QString getLastProjectPath() const;
void setExportDataSouceAsComment( bool enable );
bool exportDataSouceAsComment() const;
static RicfCommandFileExecutor* instance();
static std::vector<RicfCommandObject*>

View File

@@ -1,52 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicfEnableDataSourceAsComment.h"
#include "RiaLogging.h"
#include "cafPdmFieldScriptingCapability.h"
#include <QDir>
CAF_PDM_SOURCE_INIT( RicfEnableDataSourceAsComment, "enableDataSourceAsComment" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicfEnableDataSourceAsComment::RicfEnableDataSourceAsComment()
{
CAF_PDM_InitScriptableField( &m_enableDataSourceAsComment,
"enableDataSourceAsComment",
true,
"Enable Data Source as Comment",
"",
"",
"" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmScriptResponse RicfEnableDataSourceAsComment::execute()
{
RicfCommandFileExecutor* executor = RicfCommandFileExecutor::instance();
executor->setExportDataSouceAsComment( m_enableDataSourceAsComment );
return caf::PdmScriptResponse();
}

View File

@@ -1,43 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RicfCommandObject.h"
#include "RicfCommandFileExecutor.h"
#include "cafPdmField.h"
//==================================================================================================
//
//
//
//==================================================================================================
class RicfEnableDataSourceAsComment : public RicfCommandObject
{
CAF_PDM_HEADER_INIT;
public:
RicfEnableDataSourceAsComment();
caf::PdmScriptResponse execute() override;
private:
caf::PdmField<bool> m_enableDataSourceAsComment;
};

View File

@@ -85,7 +85,7 @@ caf::PdmScriptResponse RicfExportSimWellFractureCompletions::execute()
exportSettings.timeStep = m_timeStep;
exportSettings.fileSplit = m_fileSplit;
exportSettings.compdatExport = m_compdatExport;
exportSettings.setExportDataSourceAsComment( RicfCommandFileExecutor::instance()->exportDataSouceAsComment() );
exportSettings.setExportDataSourceAsComment( true );
{
auto eclipseCase = TOOLS::caseFromId( m_caseId() );

View File

@@ -112,14 +112,14 @@ RicfExportWellPathCompletions::RicfExportWellPathCompletions()
"",
"" );
CAF_PDM_InitScriptableField( &m_exportWelspec, "exportWelspec", true, "Export WELSPEC keyword", "", "", "" );
CAF_PDM_InitScriptableField( &m_completionWelspecAfterMainBore,
"completionWelspecAfterMainBore",
false,
"WELSEGS per Completion Type",
CAF_PDM_InitScriptableField( &m_exportDataSourceAsComments,
"exportComments",
true,
"Export Data Source as Comments",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_exportWelspec, "exportWelspec", true, "Export WELSPEC keyword", "", "", "" );
CAF_PDM_InitScriptableField( &m_customFileName, "customFileName", QString(), "Custom Filename", "", "", "" );
}
@@ -143,7 +143,6 @@ caf::PdmScriptResponse RicfExportWellPathCompletions::execute()
exportSettings.fileSplit = m_fileSplit;
exportSettings.compdatExport = m_compdatExport;
exportSettings.setExportDataSourceAsComment( RicfCommandFileExecutor::instance()->exportDataSouceAsComment() );
exportSettings.performTransScaling = m_performTransScaling;
exportSettings.transScalingTimeStep = m_transScalingTimeStep;
@@ -159,8 +158,8 @@ caf::PdmScriptResponse RicfExportWellPathCompletions::execute()
exportSettings.setCombinationMode( m_combinationMode() );
exportSettings.setExportDataSourceAsComment( m_exportDataSourceAsComments );
exportSettings.setExportWelspec( m_exportWelspec );
exportSettings.setExportCompletionWelspecAfterMainBore( m_completionWelspecAfterMainBore );
exportSettings.setCustomFileName( m_customFileName );
{

View File

@@ -60,10 +60,7 @@ private:
caf::PdmField<bool> m_includeFractures;
caf::PdmField<bool> m_excludeMainBoreForFishbones;
// This is handeled by RicfCommandFileExecutor::exportDataSouceAsComment()
// caf::PdmField<bool> m_exportDataSourceAsComment;
caf::PdmField<bool> m_exportDataSourceAsComments;
caf::PdmField<bool> m_exportWelspec;
caf::PdmField<bool> m_completionWelspecAfterMainBore;
caf::PdmField<QString> m_customFileName;
};