mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge dev into feature-analysis-plots-initial
This commit is contained in:
commit
adb06f229c
51
.github/workflows/AppFwkUnitTest.yml
vendored
Normal file
51
.github/workflows/AppFwkUnitTest.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: Application Framework Build with Unit Tests
|
||||
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
ResInsight-x64:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2.5.0
|
||||
with:
|
||||
version: 5.9.9
|
||||
modules: qtscript
|
||||
mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
|
||||
- name: Install Linux dependencies
|
||||
if: "contains( matrix.os, 'ubuntu')"
|
||||
run: sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev
|
||||
- name: Build AppFwk with Unit Tests
|
||||
uses: lukka/run-cmake@v0
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
cmakeListsTxtPath: '${{ github.workspace }}/Fwk/AppFwk/CMakeLists.txt'
|
||||
cmakeAppendedArgs:
|
||||
buildDirectory: ${{ github.workspace }}/cmakebuild
|
||||
buildWithCMakeArgs: '--config Release'
|
||||
useVcpkgToolchainFile: false
|
||||
- name: dir
|
||||
run: find ${{ runner.workspace }}
|
||||
if: "!contains( matrix.os, 'windows')"
|
||||
- name: dir
|
||||
run: gci -recurse ${{ runner.workspace }}
|
||||
if: contains( matrix.os, 'windows')
|
||||
- name: Run Unit Tests Windows
|
||||
if: contains( matrix.os, 'windows')
|
||||
shell: bash
|
||||
run: |
|
||||
cmakebuild/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/Release/cafPdmCore_UnitTests
|
||||
cmakebuild/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/Release/cafPdmXml_UnitTests
|
||||
cmakebuild/cafProjectDataModel/cafProjectDataModel_UnitTests/Release/cafProjectDataModel_UnitTests
|
||||
- name: Run Unit Tests Linux
|
||||
if: "!contains( matrix.os, 'windows')"
|
||||
shell: bash
|
||||
run: |
|
||||
cmakebuild/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/cafPdmCore_UnitTests
|
||||
cmakebuild/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/cafPdmXml_UnitTests
|
||||
cmakebuild/cafProjectDataModel/cafProjectDataModel_UnitTests/cafProjectDataModel_UnitTests
|
59
.github/workflows/main.yml
vendored
59
.github/workflows/main.yml
vendored
@ -10,9 +10,9 @@ jobs:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
include:
|
||||
- os: windows-latest
|
||||
triplet: x64-windows
|
||||
vcpkg-response-file: vcpkg_x64-windows.txt
|
||||
- os: ubuntu-latest
|
||||
triplet: x64-linux
|
||||
vcpkg-response-file: vcpkg_x64-linux.txt
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
@ -21,7 +21,7 @@ jobs:
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2.5.0
|
||||
with:
|
||||
version: 5.9
|
||||
version: 5.9.9
|
||||
modules: qtscript
|
||||
mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
|
||||
- name: Install Python dependencies
|
||||
@ -34,49 +34,58 @@ jobs:
|
||||
run: sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev
|
||||
- name: Cache vcpkg artifacts
|
||||
uses: actions/cache@v1
|
||||
env:
|
||||
vcpkgResponseFile: '${{ github.workspace }}/vcpkg_${{ matrix.triplet }}.txt'
|
||||
with:
|
||||
path: ${{ github.workspace }}/vcpkg/
|
||||
# Ensure the cache is invalidated any time vcpkg version changes, or a different set of packages is being used.
|
||||
key: ${{ hashFiles( env.vcpkgResponseFile ) }}-${{ hashFiles('.git/modules/vcpkg/HEAD') }}-${{ runner.os }}
|
||||
key: ${{ hashFiles( format('{0}/{1}', github.workspace, matrix.vcpkg-response-file )) }}-${{ hashFiles('.git/modules/vcpkg/HEAD') }}-${{ runner.os }}
|
||||
- name: Run vcpkg
|
||||
uses: lukka/run-vcpkg@v0
|
||||
id: runvcpkg
|
||||
env:
|
||||
vcpkgResponseFile: '${{ github.workspace }}/vcpkg_${{ matrix.triplet }}.txt'
|
||||
with:
|
||||
vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
|
||||
vcpkgArguments: '@${{ github.workspace }}/${{ matrix.vcpkg-response-file }}'
|
||||
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
||||
- name: Prints outputs of run-vcpkg task
|
||||
run: echo "'${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}' '${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}' "
|
||||
- name: Build ResInsight-x64
|
||||
uses: lukka/run-cmake@v0
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
cmakeAppendedArgs: -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true
|
||||
buildDirectory: ${{ github.workspace }}/cmakebuild
|
||||
buildWithCMakeArgs: '--config Release --target package'
|
||||
useVcpkgToolchainFile: true
|
||||
- name: (Windows) Build ResInsight-x64
|
||||
if: "contains( matrix.os, 'windows')"
|
||||
run: |
|
||||
mkdir cmakebuild
|
||||
cd cmakebuild
|
||||
cmake .. -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true -DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64
|
||||
cmake --build . --config Release --target PACKAGE
|
||||
- name: (Linux) Build ResInsight-x64
|
||||
if: "!contains( matrix.os, 'windows')"
|
||||
run: |
|
||||
mkdir cmakebuild
|
||||
cd cmakebuild
|
||||
cmake .. -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true -DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
cmake --build . --config Release --target package
|
||||
- name: Remove packages/_CPack_Packages
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf packages/_CPack_Packages
|
||||
- name: dir
|
||||
run: find ${{ runner.workspace }}
|
||||
if: "!contains( matrix.os, 'windows')"
|
||||
- name: dir
|
||||
run: gci -recurse ${{ runner.workspace }}
|
||||
if: contains( matrix.os, 'windows')
|
||||
rm -rf cmakebuild/packages/_CPack_Packages
|
||||
- name: Test with pytest
|
||||
if: "contains( matrix.os, 'windows')" # To be used when RESINSIGHT_GRPC_PYTHON_EXECUTABLE can be 'python' without extention in PATH
|
||||
if: "contains( matrix.os, 'windows')"
|
||||
env:
|
||||
RESINSIGHT_EXECUTABLE: ${{ runner.workspace }}/ResInsight/cmakebuild/ApplicationCode/Release/ResInsight.exe
|
||||
run: |
|
||||
cd ApplicationCode/GrpcInterface/Python/rips
|
||||
pytest --console
|
||||
- name: (Windows) Run Unit Tests
|
||||
if: contains( matrix.os, 'windows')
|
||||
shell: bash
|
||||
run: |
|
||||
cmakebuild/ApplicationCode/Release/ResInsight --unittest
|
||||
- name: (Linux) Run Unit Tests
|
||||
if: "!contains( matrix.os, 'windows')"
|
||||
shell: bash
|
||||
run: |
|
||||
cmakebuild/ApplicationCode/ResInsight --unittest
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: ResInsight
|
||||
path: ${{ runner.workspace }}/ResInsight/cmakebuild/packages
|
||||
|
||||
|
||||
|
@ -35,8 +35,7 @@
|
||||
#include "HoloLensCommands/RicHoloLensSessionManager.h"
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
#include "RicfCommandFileExecutor.h"
|
||||
#include "RicfFieldHandle.h"
|
||||
#include "RicfObjectCapability.h"
|
||||
#include "RicfCommandObject.h"
|
||||
|
||||
#include "Rim2dIntersectionViewCollection.h"
|
||||
#include "RimAnalysisPlot.h"
|
||||
@ -99,6 +98,8 @@
|
||||
#include "cafPdmCodeGenerator.h"
|
||||
#include "cafPdmDataValueField.h"
|
||||
#include "cafPdmDefaultObjectFactory.h"
|
||||
#include "cafPdmMarkdownBuilder.h"
|
||||
#include "cafPdmMarkdownGenerator.h"
|
||||
#include "cafPdmScriptIOMessages.h"
|
||||
#include "cafPdmSettings.h"
|
||||
#include "cafPdmUiModelChangeDetector.h"
|
||||
@ -1262,7 +1263,7 @@ QVariant RiaApplication::cacheDataObject( const QString& key ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::executeCommandFile( const QString& commandFile )
|
||||
{
|
||||
QFile file( commandFile );
|
||||
QFile file( commandFile );
|
||||
caf::PdmScriptIOMessages messages;
|
||||
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
||||
{
|
||||
@ -1723,22 +1724,118 @@ bool RiaApplication::generateCode( const QString& fileName, QString* errMsg )
|
||||
{
|
||||
CAF_ASSERT( errMsg );
|
||||
|
||||
QFile outputFile( fileName );
|
||||
if ( !outputFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
||||
{
|
||||
*errMsg = QString( "Could not open file %1 for writing" ).arg( fileName );
|
||||
return false;
|
||||
}
|
||||
QTextStream out( &outputFile );
|
||||
|
||||
std::string fileExt = QFileInfo( fileName ).suffix().toStdString();
|
||||
|
||||
{
|
||||
// TODO: Manually instantiate the markdown generator until cmake issues are fixed
|
||||
// This will make sure the markdown generator is registered in the factory in the cafPdmScripting library
|
||||
caf::PdmMarkdownGenerator testObj;
|
||||
}
|
||||
|
||||
std::unique_ptr<caf::PdmCodeGenerator> generator( caf::PdmCodeGeneratorFactory::instance()->create( fileExt ) );
|
||||
if ( !generator )
|
||||
{
|
||||
*errMsg = QString( "No code generator matches the provided file extension" );
|
||||
return false;
|
||||
}
|
||||
out << generator->generate( caf::PdmDefaultObjectFactory::instance() );
|
||||
|
||||
auto markdownGenerator = dynamic_cast<caf::PdmMarkdownGenerator*>( generator.get() );
|
||||
if ( markdownGenerator )
|
||||
{
|
||||
QFileInfo fi( fileName );
|
||||
QDir dir( fi.absoluteDir() );
|
||||
|
||||
QString baseName = fi.baseName();
|
||||
|
||||
{
|
||||
QString outputFileName = dir.absoluteFilePath( baseName + "_class.md" );
|
||||
|
||||
QFile outputFile( outputFileName );
|
||||
if ( !outputFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
||||
{
|
||||
*errMsg = QString( "Could not open file %1 for writing" ).arg( outputFileName );
|
||||
return false;
|
||||
}
|
||||
QTextStream out( &outputFile );
|
||||
|
||||
{
|
||||
out << "+++ \n";
|
||||
out << "title = \"Python Classes (BETA)\" \n";
|
||||
out << "published = true \n";
|
||||
out << "weight = 95 \n";
|
||||
out << "+++ \n";
|
||||
|
||||
out << "# Introduction\n\n";
|
||||
out << "As the Python interface is growing release by release, we are investigating how to automate "
|
||||
"the building of documentation. This document shows the inheritance relationship between "
|
||||
"objects derived from **PdmObject**. The **PdmObject** is the base object for all "
|
||||
"objects automatically created based on the data model in ResInsight.";
|
||||
}
|
||||
|
||||
out << generator->generate( caf::PdmDefaultObjectFactory::instance() );
|
||||
}
|
||||
|
||||
{
|
||||
QString outputFileName = dir.absoluteFilePath( baseName + "_commands.md" );
|
||||
|
||||
QFile outputFile( outputFileName );
|
||||
if ( !outputFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
||||
{
|
||||
*errMsg = QString( "Could not open file %1 for writing" ).arg( outputFileName );
|
||||
return false;
|
||||
}
|
||||
QTextStream out( &outputFile );
|
||||
|
||||
{
|
||||
out << "+++ \n";
|
||||
out << "title = \"Command Reference (BETA)\" \n";
|
||||
out << "published = true \n";
|
||||
out << "weight = 96 \n";
|
||||
out << "+++ \n";
|
||||
|
||||
out << "# Introduction\n\n";
|
||||
out << "As the Python interface is growing release by release, we are investigating how to automate "
|
||||
"the building of reference documentation. This document is not complete, but will improve as "
|
||||
"the automation "
|
||||
"moves forward.\n";
|
||||
|
||||
out << "## Currently missing features\n\n";
|
||||
out << " - Description of enums\n";
|
||||
out << " - Description of return values/classes\n";
|
||||
out << " - Description of each object\n";
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<const caf::PdmObject>> commandObjects;
|
||||
|
||||
QStringList excludedClassNames{"TestCommand1", "TC2"}; // See RifCommandCore-Text.cpp
|
||||
|
||||
auto allObjects = caf::PdmMarkdownBuilder::createAllObjects( caf::PdmDefaultObjectFactory::instance() );
|
||||
for ( auto classObject : allObjects )
|
||||
{
|
||||
if ( dynamic_cast<const RicfCommandObject*>( classObject.get() ) )
|
||||
{
|
||||
if ( !excludedClassNames.contains( classObject->classKeyword(), Qt::CaseInsensitive ) )
|
||||
{
|
||||
commandObjects.push_back( classObject );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
out << caf::PdmMarkdownBuilder::generateDocCommandObjects( commandObjects );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QFile outputFile( fileName );
|
||||
if ( !outputFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
||||
{
|
||||
*errMsg = QString( "Could not open file %1 for writing" ).arg( fileName );
|
||||
return false;
|
||||
}
|
||||
QTextStream out( &outputFile );
|
||||
|
||||
out << generator->generate( caf::PdmDefaultObjectFactory::instance() );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFontCache.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildField.h"
|
||||
|
@ -42,7 +42,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.h
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -82,7 +82,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaGitDiff.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <QString>
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmUiItem.h"
|
||||
|
||||
#include <cvfAssert.h>
|
||||
|
||||
#include <cmath>
|
||||
@ -506,4 +508,31 @@ QString RiaQDateTimeTools::timeFormatString( const QString& fullTimeFormat, Time
|
||||
}
|
||||
CVF_ASSERT( false && "Time format string is malformed" );
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RiaQDateTimeTools::createOptionItems( const std::vector<time_t>& timeSteps )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
std::vector<QDateTime> dateTimes;
|
||||
for ( time_t timeT : timeSteps )
|
||||
{
|
||||
QDateTime dateTime = RiaQDateTimeTools::fromTime_t( timeT );
|
||||
|
||||
dateTimes.push_back( dateTime );
|
||||
}
|
||||
|
||||
QString formatString = RiaQDateTimeTools::createTimeFormatStringFromDates( dateTimes );
|
||||
|
||||
for ( size_t i = 0; i < dateTimes.size(); i++ )
|
||||
{
|
||||
const auto& dt = dateTimes[i];
|
||||
QString text = RiaQDateTimeTools::toStringUsingApplicationLocale( dt, formatString );
|
||||
options.push_back( {text, static_cast<int>( i )} );
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
@ -35,6 +35,11 @@ class QDate;
|
||||
class QTime;
|
||||
class DateTimeSpan;
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmOptionItemInfo;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
@ -135,6 +140,8 @@ public:
|
||||
static QString dateFormatString( const QString& fullDateFormat, DateFormatComponents dateComponents );
|
||||
static QString timeFormatString( const QString& fullTimeFormat, TimeFormatComponents timeComponents );
|
||||
|
||||
static QList<caf::PdmOptionItemInfo> createOptionItems( const std::vector<time_t>& timeSteps );
|
||||
|
||||
private:
|
||||
static quint64 secondsInDay();
|
||||
static quint64 secondsInYear();
|
||||
|
@ -25,11 +25,13 @@
|
||||
|
||||
class RigWellPath;
|
||||
|
||||
template <typename FloatType>
|
||||
class RiaWellLogUnitTools
|
||||
{
|
||||
public:
|
||||
static const double GRAVITY_ACCEL;
|
||||
static const double UNIT_WEIGHT_OF_WATER;
|
||||
static const FloatType gravityAcceleration();
|
||||
static const FloatType unitWeightOfWater();
|
||||
static bool stringsMatch( const QString& lhs, const QString& rhs );
|
||||
|
||||
static QString noUnitString();
|
||||
static QString sg_emwUnitString();
|
||||
@ -39,35 +41,38 @@ public:
|
||||
static QString gPerCm3UnitString();
|
||||
static QString kgPerM3UnitString();
|
||||
static QString pascalUnitString();
|
||||
static QString pascalUnitStringShort();
|
||||
|
||||
public:
|
||||
static std::vector<double> convertDepths( const std::vector<double>& depthsIn,
|
||||
RiaDefines::DepthUnitType unitsIn,
|
||||
RiaDefines::DepthUnitType unitsOut );
|
||||
static bool convertValues( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesIn,
|
||||
std::vector<double>* valuesOut,
|
||||
const QString& unitsIn,
|
||||
const QString& unitsOut );
|
||||
static bool convertValues( std::vector<std::pair<double, double>>* measuredDepthsAndValues,
|
||||
const QString& unitsIn,
|
||||
const QString& unitsOut,
|
||||
const RigWellPath* wellPath );
|
||||
static std::vector<FloatType> convertDepths( const std::vector<FloatType>& depthsIn,
|
||||
RiaDefines::DepthUnitType unitsIn,
|
||||
RiaDefines::DepthUnitType unitsOut );
|
||||
static bool convertValues( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesIn,
|
||||
std::vector<FloatType>* valuesOut,
|
||||
const QString& unitsIn,
|
||||
const QString& unitsOut );
|
||||
static bool convertValues( std::vector<std::pair<FloatType, FloatType>>* measuredDepthsAndValues,
|
||||
const QString& unitsIn,
|
||||
const QString& unitsOut,
|
||||
const RigWellPath* wellPath );
|
||||
|
||||
static std::vector<double> tvdRKBs( const std::vector<double>& measuredDepths, const RigWellPath* wellPath );
|
||||
static std::vector<FloatType> tvdRKBs( const std::vector<FloatType>& measuredDepths, const RigWellPath* wellPath );
|
||||
|
||||
// Supported conversions
|
||||
static std::vector<double> convertGpcm3ToBar( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesInGpcm3 );
|
||||
static std::vector<double> convertBarToGpcm3( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesInBar );
|
||||
static std::vector<FloatType> convertGpcm3ToBar( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesInGpcm3 );
|
||||
static std::vector<FloatType> convertBarToGpcm3( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesInBar );
|
||||
|
||||
static std::vector<double> convertNormalizedByPPToBar( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesInBar );
|
||||
static std::vector<double> convertBarToNormalizedByPP( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesInBar );
|
||||
static std::vector<double> multiply( const std::vector<double>& values, double factor );
|
||||
static double pascalPerBar();
|
||||
static double MPaPerBar();
|
||||
static double hydrostaticPorePressureBar( double tvdRKB );
|
||||
static std::vector<FloatType> convertNormalizedByPPToBar( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesInBar );
|
||||
static std::vector<FloatType> convertBarToNormalizedByPP( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesInBar );
|
||||
static std::vector<FloatType> multiply( const std::vector<FloatType>& values, FloatType factor );
|
||||
static FloatType pascalPerBar();
|
||||
static FloatType MPaPerBar();
|
||||
static FloatType hydrostaticPorePressureBar( FloatType tvdRKB );
|
||||
};
|
||||
|
||||
#include "RiaWellLogUnitTools.inl"
|
||||
|
@ -15,8 +15,6 @@
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiaWellLogUnitTools.h"
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
@ -24,10 +22,30 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
const double RiaWellLogUnitTools::GRAVITY_ACCEL = 9.81;
|
||||
const double RiaWellLogUnitTools::UNIT_WEIGHT_OF_WATER = RiaWellLogUnitTools::GRAVITY_ACCEL * 1000.0; // N / m^3
|
||||
|
||||
bool stringsMatch( const QString& lhs, const QString& rhs )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template <typename FloatType>
|
||||
const FloatType RiaWellLogUnitTools<FloatType>::gravityAcceleration()
|
||||
{
|
||||
return (FloatType) 9.81;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template <typename FloatType>
|
||||
const FloatType RiaWellLogUnitTools<FloatType>::unitWeightOfWater()
|
||||
{
|
||||
return RiaWellLogUnitTools<FloatType>::gravityAcceleration() * 1000.0; // N / m^3
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template <typename FloatType>
|
||||
bool RiaWellLogUnitTools<FloatType>::stringsMatch( const QString& lhs, const QString& rhs )
|
||||
{
|
||||
return QString::compare( lhs, rhs, Qt::CaseInsensitive ) == 0;
|
||||
}
|
||||
@ -35,7 +53,8 @@ bool stringsMatch( const QString& lhs, const QString& rhs )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaWellLogUnitTools::noUnitString()
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::noUnitString()
|
||||
{
|
||||
return "NO_UNIT";
|
||||
}
|
||||
@ -43,7 +62,8 @@ QString RiaWellLogUnitTools::noUnitString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaWellLogUnitTools::sg_emwUnitString()
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::sg_emwUnitString()
|
||||
{
|
||||
return "sg_EMW";
|
||||
}
|
||||
@ -51,7 +71,8 @@ QString RiaWellLogUnitTools::sg_emwUnitString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaWellLogUnitTools::barUnitString()
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::barUnitString()
|
||||
{
|
||||
return "Bar";
|
||||
}
|
||||
@ -59,7 +80,8 @@ QString RiaWellLogUnitTools::barUnitString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaWellLogUnitTools::barX100UnitString()
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::barX100UnitString()
|
||||
{
|
||||
return "Bar x100";
|
||||
}
|
||||
@ -67,7 +89,8 @@ QString RiaWellLogUnitTools::barX100UnitString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaWellLogUnitTools::MPaUnitString()
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::MPaUnitString()
|
||||
{
|
||||
return "MPa";
|
||||
}
|
||||
@ -75,7 +98,8 @@ QString RiaWellLogUnitTools::MPaUnitString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaWellLogUnitTools::gPerCm3UnitString()
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::gPerCm3UnitString()
|
||||
{
|
||||
return "g/cm3";
|
||||
}
|
||||
@ -83,7 +107,8 @@ QString RiaWellLogUnitTools::gPerCm3UnitString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaWellLogUnitTools::kgPerM3UnitString()
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::kgPerM3UnitString()
|
||||
{
|
||||
return "kg/m3";
|
||||
}
|
||||
@ -91,7 +116,8 @@ QString RiaWellLogUnitTools::kgPerM3UnitString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaWellLogUnitTools::pascalUnitString()
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::pascalUnitString()
|
||||
{
|
||||
return "pascal";
|
||||
}
|
||||
@ -99,7 +125,17 @@ QString RiaWellLogUnitTools::pascalUnitString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RiaWellLogUnitTools::convertDepths( const std::vector<double>& depthsIn,
|
||||
template <typename FloatType>
|
||||
QString RiaWellLogUnitTools<FloatType>::pascalUnitStringShort()
|
||||
{
|
||||
return "pa";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template <typename FloatType>
|
||||
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertDepths( const std::vector<FloatType>& depthsIn,
|
||||
RiaDefines::DepthUnitType unitsIn,
|
||||
RiaDefines::DepthUnitType unitsOut )
|
||||
{
|
||||
@ -117,9 +153,10 @@ std::vector<double> RiaWellLogUnitTools::convertDepths( const std::vector<double
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaWellLogUnitTools::convertValues( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesIn,
|
||||
std::vector<double>* valuesOut,
|
||||
template <typename FloatType>
|
||||
bool RiaWellLogUnitTools<FloatType>::convertValues( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesIn,
|
||||
std::vector<FloatType>* valuesOut,
|
||||
const QString& unitsIn,
|
||||
const QString& unitsOut )
|
||||
{
|
||||
@ -162,13 +199,13 @@ bool RiaWellLogUnitTools::convertValues( const std::vector<double>& tvdRKBs,
|
||||
}
|
||||
else if ( stringsMatch( unitsIn, barX100UnitString() ) && stringsMatch( unitsOut, MPaUnitString() ) )
|
||||
{
|
||||
*valuesOut = multiply( valuesIn, 100.0 );
|
||||
*valuesOut = multiply( valuesIn, (FloatType)100.0 );
|
||||
*valuesOut = multiply( *valuesOut, MPaPerBar() );
|
||||
return true;
|
||||
}
|
||||
else if ( stringsMatch( unitsIn, barX100UnitString() ) && stringsMatch( unitsOut, barUnitString() ) )
|
||||
{
|
||||
*valuesOut = multiply( valuesIn, 100 );
|
||||
*valuesOut = multiply( valuesIn, (FloatType)100 );
|
||||
return true;
|
||||
}
|
||||
else if ( stringsMatch( unitsIn, barUnitString() ) && stringsMatch( unitsOut, MPaUnitString() ) )
|
||||
@ -178,7 +215,7 @@ bool RiaWellLogUnitTools::convertValues( const std::vector<double>& tvdRKBs,
|
||||
}
|
||||
else if ( stringsMatch( unitsIn, barUnitString() ) && stringsMatch( unitsOut, barX100UnitString() ) )
|
||||
{
|
||||
*valuesOut = multiply( valuesIn, 1.0 / 100.0 );
|
||||
*valuesOut = multiply( valuesIn, (FloatType) 0.01 );
|
||||
return true;
|
||||
}
|
||||
else if ( ( stringsMatch( unitsIn, noUnitString() ) || stringsMatch( unitsIn, sg_emwUnitString() ) ) &&
|
||||
@ -193,12 +230,12 @@ bool RiaWellLogUnitTools::convertValues( const std::vector<double>& tvdRKBs,
|
||||
*valuesOut = convertBarToNormalizedByPP( tvdRKBs, valuesIn );
|
||||
return true;
|
||||
}
|
||||
else if ( stringsMatch( unitsIn, pascalUnitString() ) && stringsMatch( unitsOut, barUnitString() ) )
|
||||
else if ( (stringsMatch( unitsIn, pascalUnitString()) || stringsMatch( unitsIn, pascalUnitString() ) && stringsMatch( unitsOut, barUnitString() ) ))
|
||||
{
|
||||
*valuesOut = multiply( valuesIn, 1.0 / pascalPerBar() );
|
||||
return true;
|
||||
}
|
||||
else if ( stringsMatch( unitsIn, barUnitString() ) && stringsMatch( unitsOut, pascalUnitString() ) )
|
||||
else if ( stringsMatch( unitsIn, barUnitString() ) && (stringsMatch( unitsIn, pascalUnitString()) || stringsMatch( unitsIn, pascalUnitString() )) )
|
||||
{
|
||||
*valuesOut = multiply( valuesIn, pascalPerBar() );
|
||||
return true;
|
||||
@ -209,7 +246,8 @@ bool RiaWellLogUnitTools::convertValues( const std::vector<double>& tvdRKBs,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaWellLogUnitTools::convertValues( std::vector<std::pair<double, double>>* measuredDepthsAndValues,
|
||||
template <typename FloatType>
|
||||
bool RiaWellLogUnitTools<FloatType>::convertValues( std::vector<std::pair<FloatType, FloatType>>* measuredDepthsAndValues,
|
||||
const QString& unitsIn,
|
||||
const QString& unitsOut,
|
||||
const RigWellPath* wellPath )
|
||||
@ -217,8 +255,8 @@ bool RiaWellLogUnitTools::convertValues( std::vector<std::pair<double, double>>*
|
||||
CAF_ASSERT( measuredDepthsAndValues );
|
||||
if ( unitsIn == unitsOut ) return true;
|
||||
|
||||
std::vector<double> tvdRKBs( measuredDepthsAndValues->size(), 0.0 );
|
||||
std::vector<double> values( measuredDepthsAndValues->size(), 0.0 );
|
||||
std::vector<FloatType> tvdRKBs( measuredDepthsAndValues->size(), 0.0 );
|
||||
std::vector<FloatType> values( measuredDepthsAndValues->size(), 0.0 );
|
||||
for ( size_t i = 0; i < measuredDepthsAndValues->size(); ++i )
|
||||
{
|
||||
auto depthValuePair = ( *measuredDepthsAndValues )[i];
|
||||
@ -227,7 +265,7 @@ bool RiaWellLogUnitTools::convertValues( std::vector<std::pair<double, double>>*
|
||||
tvdRKBs[i] = -point.z() + wellPath->rkbDiff();
|
||||
values[i] = depthValuePair.second;
|
||||
}
|
||||
std::vector<double> valuesOut;
|
||||
std::vector<FloatType> valuesOut;
|
||||
if ( convertValues( tvdRKBs, values, &valuesOut, unitsIn, unitsOut ) )
|
||||
{
|
||||
CAF_ASSERT( measuredDepthsAndValues->size() == valuesOut.size() );
|
||||
@ -243,7 +281,8 @@ bool RiaWellLogUnitTools::convertValues( std::vector<std::pair<double, double>>*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RiaWellLogUnitTools::tvdRKBs( const std::vector<double>& measuredDepths, const RigWellPath* wellPath )
|
||||
template <typename FloatType>
|
||||
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::tvdRKBs( const std::vector<FloatType>& measuredDepths, const RigWellPath* wellPath )
|
||||
{
|
||||
std::vector<double> tvdRKBs( measuredDepths.size(), 0.0 );
|
||||
for ( size_t i = 0; i < measuredDepths.size(); ++i )
|
||||
@ -251,28 +290,29 @@ std::vector<double> RiaWellLogUnitTools::tvdRKBs( const std::vector<double>& mea
|
||||
cvf::Vec3d point = wellPath->interpolatedPointAlongWellPath( measuredDepths[i] );
|
||||
tvdRKBs[i] = -point.z() + wellPath->rkbDiff();
|
||||
}
|
||||
return tvdRKBs;
|
||||
return std::vector<FloatType>(tvdRKBs.begin(), tvdRKBs.end());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RiaWellLogUnitTools::convertGpcm3ToBar( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesInGpcm3 )
|
||||
template <typename FloatType>
|
||||
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertGpcm3ToBar( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesInGpcm3 )
|
||||
{
|
||||
CAF_ASSERT( tvdRKBs.size() == valuesInGpcm3.size() );
|
||||
|
||||
std::vector<double> valuesInBar( valuesInGpcm3.size(), 0.0 );
|
||||
std::vector<FloatType> valuesInBar( valuesInGpcm3.size(), 0.0 );
|
||||
for ( size_t i = 0; i < tvdRKBs.size(); ++i )
|
||||
{
|
||||
// We need SI as input (kg / m^3), so multiply by 1000:
|
||||
double mudWeightsSI = valuesInGpcm3[i] * 1000;
|
||||
FloatType mudWeightsSI = valuesInGpcm3[i] * 1000;
|
||||
|
||||
// To get specific mudWeight (N / m^3):
|
||||
double specificMudWeight = mudWeightsSI * GRAVITY_ACCEL;
|
||||
FloatType specificMudWeight = mudWeightsSI * gravityAcceleration();
|
||||
|
||||
// Pore pressure in pascal
|
||||
double valuePascal = specificMudWeight * tvdRKBs[i];
|
||||
FloatType valuePascal = specificMudWeight * tvdRKBs[i];
|
||||
|
||||
// Pore pressure in bar
|
||||
valuesInBar[i] = 1.0 / pascalPerBar() * valuePascal;
|
||||
@ -283,22 +323,23 @@ std::vector<double> RiaWellLogUnitTools::convertGpcm3ToBar( const std::vector<do
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RiaWellLogUnitTools::convertBarToGpcm3( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesInBar )
|
||||
template <typename FloatType>
|
||||
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertBarToGpcm3( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesInBar )
|
||||
{
|
||||
CAF_ASSERT( tvdRKBs.size() == valuesInBar.size() );
|
||||
|
||||
std::vector<double> valuesInGpcm3( valuesInBar.size(), 0.0 );
|
||||
std::vector<FloatType> valuesInGpcm3( valuesInBar.size(), 0.0 );
|
||||
for ( size_t i = 0; i < tvdRKBs.size(); ++i )
|
||||
{
|
||||
// Pore pressure in pascal (N / m^2)
|
||||
double valuePascal = pascalPerBar() * valuesInBar[i];
|
||||
FloatType valuePascal = pascalPerBar() * valuesInBar[i];
|
||||
|
||||
// N / m^3:
|
||||
double specificMudWeight = valuePascal / tvdRKBs[i];
|
||||
FloatType specificMudWeight = valuePascal / tvdRKBs[i];
|
||||
|
||||
// Mud weight in SI (kg / m^3):
|
||||
double mudWeightsSI = specificMudWeight / GRAVITY_ACCEL;
|
||||
FloatType mudWeightsSI = specificMudWeight / gravityAcceleration();
|
||||
|
||||
// Mud weights g/cm^3:
|
||||
valuesInGpcm3[i] = mudWeightsSI / 1000;
|
||||
@ -309,12 +350,13 @@ std::vector<double> RiaWellLogUnitTools::convertBarToGpcm3( const std::vector<do
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RiaWellLogUnitTools::convertNormalizedByPPToBar( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& normalizedValues )
|
||||
template<typename FloatType>
|
||||
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertNormalizedByPPToBar( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& normalizedValues )
|
||||
{
|
||||
CAF_ASSERT( tvdRKBs.size() == normalizedValues.size() );
|
||||
|
||||
std::vector<double> valuesInBar( tvdRKBs.size(), 0.0 );
|
||||
std::vector<FloatType> valuesInBar( tvdRKBs.size(), 0.0 );
|
||||
for ( size_t i = 0; i < tvdRKBs.size(); ++i )
|
||||
{
|
||||
valuesInBar[i] = normalizedValues[i] * hydrostaticPorePressureBar( tvdRKBs[i] );
|
||||
@ -325,12 +367,13 @@ std::vector<double> RiaWellLogUnitTools::convertNormalizedByPPToBar( const std::
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RiaWellLogUnitTools::convertBarToNormalizedByPP( const std::vector<double>& tvdRKBs,
|
||||
const std::vector<double>& valuesInBar )
|
||||
template <typename FloatType>
|
||||
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertBarToNormalizedByPP( const std::vector<FloatType>& tvdRKBs,
|
||||
const std::vector<FloatType>& valuesInBar )
|
||||
{
|
||||
CAF_ASSERT( tvdRKBs.size() == valuesInBar.size() );
|
||||
|
||||
std::vector<double> normalizedValues( tvdRKBs.size(), 0.0 );
|
||||
std::vector<FloatType> normalizedValues( tvdRKBs.size(), 0.0 );
|
||||
for ( size_t i = 0; i < tvdRKBs.size(); ++i )
|
||||
{
|
||||
normalizedValues[i] = valuesInBar[i] / hydrostaticPorePressureBar( tvdRKBs[i] );
|
||||
@ -341,9 +384,10 @@ std::vector<double> RiaWellLogUnitTools::convertBarToNormalizedByPP( const std::
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RiaWellLogUnitTools::multiply( const std::vector<double>& valuesIn, double factor )
|
||||
template <typename FloatType>
|
||||
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::multiply( const std::vector<FloatType>& valuesIn, FloatType factor )
|
||||
{
|
||||
std::vector<double> valuesOut( valuesIn.size(), std::numeric_limits<double>::infinity() );
|
||||
std::vector<FloatType> valuesOut( valuesIn.size(), std::numeric_limits<FloatType>::infinity() );
|
||||
for ( size_t i = 0; i < valuesIn.size(); ++i )
|
||||
{
|
||||
valuesOut[i] = valuesIn[i] * factor;
|
||||
@ -354,7 +398,8 @@ std::vector<double> RiaWellLogUnitTools::multiply( const std::vector<double>& va
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaWellLogUnitTools::pascalPerBar()
|
||||
template <typename FloatType>
|
||||
FloatType RiaWellLogUnitTools<FloatType>::pascalPerBar()
|
||||
{
|
||||
return 1.0e5;
|
||||
}
|
||||
@ -362,15 +407,17 @@ double RiaWellLogUnitTools::pascalPerBar()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaWellLogUnitTools::MPaPerBar()
|
||||
template <typename FloatType>
|
||||
FloatType RiaWellLogUnitTools<FloatType>::MPaPerBar()
|
||||
{
|
||||
return 1.0e-1;
|
||||
return (FloatType) 1.0e-1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaWellLogUnitTools::hydrostaticPorePressureBar( double depth )
|
||||
template <typename FloatType>
|
||||
FloatType RiaWellLogUnitTools<FloatType>::hydrostaticPorePressureBar( FloatType depth )
|
||||
{
|
||||
return 1.0 / pascalPerBar() * depth * UNIT_WEIGHT_OF_WATER;
|
||||
return (FloatType) 1.0 / pascalPerBar() * depth * unitWeightOfWater();
|
||||
}
|
@ -83,6 +83,7 @@ include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Measurement
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Summary
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Surfaces
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModelCommands
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ResultStatisticsCache
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ReservoirDataModel
|
||||
@ -151,7 +152,7 @@ list( APPEND REFERENCED_CMAKE_FILES
|
||||
ProjectDataModel/Measurement/CMakeLists_files.cmake
|
||||
ProjectDataModel/PlotTemplates/CMakeLists_files.cmake
|
||||
ProjectDataModel/Surfaces/CMakeLists_files.cmake
|
||||
|
||||
ProjectDataModelCommands/CMakeLists_files.cmake
|
||||
GeoMech/GeoMechVisualization/CMakeLists_files.cmake
|
||||
|
||||
ModelVisualization/CMakeLists_files.cmake
|
||||
|
@ -1,19 +1,11 @@
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfCommandResponse.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfFieldCapability.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfFieldHandle.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfObjectCapability.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfCommandResponse.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfFieldCapability.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfFieldHandle.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfObjectCapability.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.cpp
|
||||
)
|
||||
|
||||
|
@ -18,13 +18,11 @@
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
|
||||
#include "cafPdmPythonGenerator.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandObject::RicfCommandObject()
|
||||
: RicfObjectCapability( this, false )
|
||||
: PdmObjectScriptability( this, false )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -17,66 +17,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
#include "RicfCommandResponse.h"
|
||||
#include "RicfFieldCapability.h"
|
||||
#include "RicfObjectCapability.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmObjectScriptabilityRegister.h"
|
||||
#include "cafPdmPythonGenerator.h"
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RicfCommandObject : public caf::PdmObject, public RicfObjectCapability
|
||||
{
|
||||
public:
|
||||
RicfCommandObject();
|
||||
~RicfCommandObject() override;
|
||||
|
||||
virtual RicfCommandResponse execute() = 0;
|
||||
};
|
||||
|
||||
#define RICF_InitField( field, keyword, default, uiName, iconResourceName, toolTip, whatsThis ) \
|
||||
CAF_PDM_InitField( field, \
|
||||
keyword, \
|
||||
default, \
|
||||
uiName, \
|
||||
iconResourceName, \
|
||||
caf::PdmPythonGenerator::pythonHelpString( toolTip, keyword ), \
|
||||
whatsThis ); \
|
||||
AddRicfCapabilityToField( field, keyword )
|
||||
|
||||
#define RICF_InitFieldNoDefault( field, keyword, uiName, iconResourceName, toolTip, whatsThis ) \
|
||||
CAF_PDM_InitFieldNoDefault( field, \
|
||||
keyword, \
|
||||
uiName, \
|
||||
iconResourceName, \
|
||||
caf::PdmPythonGenerator::pythonHelpString( toolTip, keyword ), \
|
||||
whatsThis ); \
|
||||
AddRicfCapabilityToField( field, keyword )
|
||||
|
||||
#define RICF_InitFieldTranslated( field, keyword, scriptKeyword, default, uiName, iconResourceName, toolTip, whatsThis ) \
|
||||
CAF_PDM_InitField( field, \
|
||||
keyword, \
|
||||
default, \
|
||||
uiName, \
|
||||
iconResourceName, \
|
||||
caf::PdmPythonGenerator::pythonHelpString( toolTip, scriptKeyword ), \
|
||||
whatsThis ); \
|
||||
AddRicfCapabilityToField( field, scriptKeyword )
|
||||
|
||||
#define RICF_InitFieldNoDefaultTranslated( field, keyword, scriptKeyword, uiName, iconResourceName, toolTip, whatsThis ) \
|
||||
CAF_PDM_InitFieldNoDefault( field, \
|
||||
keyword, \
|
||||
uiName, \
|
||||
iconResourceName, \
|
||||
caf::PdmPythonGenerator::pythonHelpString( toolTip, scriptKeyword ), \
|
||||
whatsThis ); \
|
||||
AddRicfCapabilityToField( field, scriptKeyword )
|
||||
#include "cafPdmObjectScriptability.h"
|
||||
#include "cafPdmScriptResponse.h"
|
||||
|
||||
#define RICF_HEADER_INIT \
|
||||
CAF_CMD_HEADER_INIT; \
|
||||
@ -91,3 +36,17 @@ public:
|
||||
} \
|
||||
CAF_FACTORY_REGISTER2( caf::CmdFeature, ClassName, std::string, ClassName::idNameStatic() ); \
|
||||
CAF_PDM_SOURCE_INIT( ClassName, CommandKeyword )
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RicfCommandObject : public caf::PdmObject, public caf::PdmObjectScriptability
|
||||
{
|
||||
public:
|
||||
RicfCommandObject();
|
||||
~RicfCommandObject() override;
|
||||
|
||||
virtual caf::PdmScriptResponse execute() = 0;
|
||||
};
|
||||
|
@ -1,62 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include <memory>
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
// Command response which contains status and possibly a result
|
||||
//
|
||||
//==================================================================================================
|
||||
class RicfCommandResponse
|
||||
{
|
||||
public:
|
||||
// Status in order of severity from ok to critical
|
||||
enum Status
|
||||
{
|
||||
COMMAND_OK,
|
||||
COMMAND_WARNING,
|
||||
COMMAND_ERROR
|
||||
};
|
||||
|
||||
public:
|
||||
RicfCommandResponse( Status status = COMMAND_OK, const QString& message = "" );
|
||||
explicit RicfCommandResponse( caf::PdmObject* ok_result );
|
||||
|
||||
Status status() const;
|
||||
QString sanitizedResponseMessage() const;
|
||||
QStringList messages() const;
|
||||
caf::PdmObject* result() const;
|
||||
void setResult( caf::PdmObject* result );
|
||||
void updateStatus( Status status, const QString& message );
|
||||
|
||||
private:
|
||||
static QString statusLabel( Status status );
|
||||
|
||||
private:
|
||||
Status m_status;
|
||||
QStringList m_messages;
|
||||
std::unique_ptr<caf::PdmObject> m_result;
|
||||
};
|
@ -1,260 +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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RicfFieldHandle.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmScriptIOMessages.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QTextStream>
|
||||
|
||||
template <typename DataType>
|
||||
struct RicfFieldIOHandler
|
||||
{
|
||||
static void writeToField( DataType& fieldValue,
|
||||
QTextStream& inputStream,
|
||||
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||
bool stringsAreQuoted = true )
|
||||
{
|
||||
inputStream >> fieldValue;
|
||||
if ( inputStream.status() == QTextStream::ReadCorruptData )
|
||||
{
|
||||
errorMessageContainer->addError( "Argument value is unreadable in the argument: \"" +
|
||||
errorMessageContainer->currentArgument + "\" in the command: \"" +
|
||||
errorMessageContainer->currentCommand + "\"" );
|
||||
|
||||
inputStream.setStatus( QTextStream::Ok );
|
||||
}
|
||||
}
|
||||
|
||||
static void readFromField( const DataType& fieldValue,
|
||||
QTextStream& outputStream,
|
||||
bool quoteStrings = true,
|
||||
bool quoteNonBuiltins = false )
|
||||
{
|
||||
outputStream << fieldValue;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct RicfFieldIOHandler<QString>
|
||||
{
|
||||
static void writeToField( QString& fieldValue,
|
||||
QTextStream& inputStream,
|
||||
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||
bool stringsAreQuoted = true );
|
||||
static void readFromField( const QString& fieldValue,
|
||||
QTextStream& outputStream,
|
||||
bool quoteStrings = true,
|
||||
bool quoteNonBuiltins = false );
|
||||
};
|
||||
|
||||
template <>
|
||||
struct RicfFieldIOHandler<bool>
|
||||
{
|
||||
static void writeToField( bool& fieldValue,
|
||||
QTextStream& inputStream,
|
||||
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||
bool stringsAreQuoted = true );
|
||||
static void readFromField( const bool& fieldValue,
|
||||
QTextStream& outputStream,
|
||||
bool quoteStrings = true,
|
||||
bool quoteNonBuiltins = false );
|
||||
};
|
||||
|
||||
template <>
|
||||
struct RicfFieldIOHandler<cvf::Color3f>
|
||||
{
|
||||
static void writeToField( cvf::Color3f& fieldValue,
|
||||
QTextStream& inputStream,
|
||||
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||
bool stringsAreQuoted = true );
|
||||
static void readFromField( const cvf::Color3f& fieldValue,
|
||||
QTextStream& outputStream,
|
||||
bool quoteStrings = true,
|
||||
bool quoteNonBuiltins = false );
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct RicfFieldIOHandler<caf::AppEnum<T>>
|
||||
{
|
||||
static void writeToField( caf::AppEnum<T>& fieldValue,
|
||||
QTextStream& inputStream,
|
||||
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||
bool stringsAreQuoted = true )
|
||||
{
|
||||
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
||||
QString accumulatedFieldValue;
|
||||
QChar nextChar;
|
||||
QChar currentChar;
|
||||
while ( !inputStream.atEnd() )
|
||||
{
|
||||
nextChar = errorMessageContainer->peekNextChar( inputStream );
|
||||
if ( nextChar.isLetterOrNumber() || nextChar == QChar( '_' ) )
|
||||
{
|
||||
currentChar = errorMessageContainer->readCharWithLineNumberCount( inputStream );
|
||||
accumulatedFieldValue += currentChar;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !fieldValue.setFromText( accumulatedFieldValue ) )
|
||||
{
|
||||
// Unexpected enum value
|
||||
// Error message
|
||||
errorMessageContainer->addError( "Argument must be valid enum value. " +
|
||||
errorMessageContainer->currentArgument + "\" argument of the command: \"" +
|
||||
errorMessageContainer->currentCommand + "\"" );
|
||||
}
|
||||
}
|
||||
|
||||
static void readFromField( const caf::AppEnum<T>& fieldValue,
|
||||
QTextStream& outputStream,
|
||||
bool quoteStrings = true,
|
||||
bool quoteNonBuiltins = false )
|
||||
{
|
||||
if ( quoteNonBuiltins )
|
||||
{
|
||||
outputStream << "\"" << fieldValue << "\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
outputStream << fieldValue;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct RicfFieldIOHandler<std::vector<T>>
|
||||
{
|
||||
static void writeToField( std::vector<T>& fieldValue,
|
||||
QTextStream& inputStream,
|
||||
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||
bool stringsAreQuoted = true )
|
||||
{
|
||||
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
||||
QChar chr = errorMessageContainer->readCharWithLineNumberCount( inputStream );
|
||||
if ( chr == QChar( '[' ) )
|
||||
{
|
||||
while ( !inputStream.atEnd() )
|
||||
{
|
||||
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
||||
QChar nextChar = errorMessageContainer->peekNextChar( inputStream );
|
||||
if ( nextChar == QChar( ']' ) )
|
||||
{
|
||||
nextChar = errorMessageContainer->readCharWithLineNumberCount( inputStream );
|
||||
break;
|
||||
}
|
||||
else if ( nextChar == QChar( ',' ) )
|
||||
{
|
||||
nextChar = errorMessageContainer->readCharWithLineNumberCount( inputStream );
|
||||
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
||||
}
|
||||
|
||||
T value;
|
||||
RicfFieldIOHandler<T>::writeToField( value, inputStream, errorMessageContainer, true );
|
||||
fieldValue.push_back( value );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMessageContainer->addError( "Array argument is missing start '['. " +
|
||||
errorMessageContainer->currentArgument + "\" argument of the command: \"" +
|
||||
errorMessageContainer->currentCommand + "\"" );
|
||||
}
|
||||
}
|
||||
|
||||
static void readFromField( const std::vector<T>& fieldValue,
|
||||
QTextStream& outputStream,
|
||||
bool quoteStrings = true,
|
||||
bool quoteNonBuiltins = false )
|
||||
{
|
||||
outputStream << "[";
|
||||
for ( size_t i = 0; i < fieldValue.size(); ++i )
|
||||
{
|
||||
RicfFieldIOHandler<T>::readFromField( fieldValue[i], outputStream, quoteNonBuiltins );
|
||||
if ( i < fieldValue.size() - 1 )
|
||||
{
|
||||
outputStream << ", ";
|
||||
}
|
||||
}
|
||||
outputStream << "]";
|
||||
}
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
template <typename FieldType>
|
||||
class RicfFieldCapability : public RicfFieldHandle
|
||||
{
|
||||
public:
|
||||
RicfFieldCapability( FieldType* field, const QString& fieldName, bool giveOwnership )
|
||||
: RicfFieldHandle( field, fieldName, giveOwnership )
|
||||
{
|
||||
m_field = field;
|
||||
}
|
||||
|
||||
// Xml Serializing
|
||||
public:
|
||||
void writeToField( QTextStream& inputStream,
|
||||
caf::PdmObjectFactory* objectFactory,
|
||||
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||
bool stringsAreQuoted = true ) override
|
||||
{
|
||||
typename FieldType::FieldDataType value;
|
||||
RicfFieldIOHandler<typename FieldType::FieldDataType>::writeToField( value,
|
||||
inputStream,
|
||||
errorMessageContainer,
|
||||
stringsAreQuoted );
|
||||
|
||||
if ( this->isIOWriteable() )
|
||||
{
|
||||
m_field->setValue( value );
|
||||
}
|
||||
}
|
||||
|
||||
void readFromField( QTextStream& outputStream, bool quoteStrings = true, bool quoteNonBuiltins = false ) const override
|
||||
{
|
||||
RicfFieldIOHandler<typename FieldType::FieldDataType>::readFromField( m_field->value(),
|
||||
outputStream,
|
||||
quoteStrings,
|
||||
quoteNonBuiltins );
|
||||
}
|
||||
|
||||
private:
|
||||
FieldType* m_field;
|
||||
};
|
||||
|
||||
template <typename FieldType>
|
||||
void AddRicfCapabilityToField( FieldType* field, const QString& fieldName )
|
||||
{
|
||||
if ( field->template capability<RicfFieldCapability<FieldType>>() == nullptr )
|
||||
{
|
||||
new RicfFieldCapability<FieldType>( field, fieldName, true );
|
||||
}
|
||||
}
|
@ -1,35 +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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicfFieldHandle.h"
|
||||
#include "cafPdmFieldHandle.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfFieldHandle::RicfFieldHandle( caf::PdmFieldHandle* owner, const QString& scriptFieldName, bool giveOwnership )
|
||||
: caf::PdmFieldScriptability( owner, scriptFieldName, giveOwnership )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfFieldHandle::~RicfFieldHandle()
|
||||
{
|
||||
}
|
@ -1,48 +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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
#include "cafPdmFieldScriptability.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmObjectFactory;
|
||||
class PdmFieldHandle;
|
||||
class PdmScriptIOMessages;
|
||||
} // namespace caf
|
||||
|
||||
class QTextStream;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RicfFieldHandle : public caf::PdmFieldScriptability
|
||||
{
|
||||
public:
|
||||
RicfFieldHandle( caf::PdmFieldHandle* owner, const QString& scriptFieldName, bool giveOwnership );
|
||||
~RicfFieldHandle() override;
|
||||
|
||||
private:
|
||||
caf::PdmFieldHandle* m_owner;
|
||||
QString m_fieldName;
|
||||
bool m_IOWriteable;
|
||||
};
|
@ -19,9 +19,9 @@
|
||||
#include "RifcCommandFileReader.h"
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
#include "RicfObjectCapability.h"
|
||||
|
||||
#include "cafPdmObjectFactory.h"
|
||||
#include "cafPdmObjectScriptability.h"
|
||||
#include "cafPdmScriptIOMessages.h"
|
||||
|
||||
#include <QTextStream>
|
||||
@ -127,7 +127,7 @@ std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands( QTextStream
|
||||
else
|
||||
{
|
||||
readCommands.push_back( cObj );
|
||||
auto rcfCap = cObj->capability<RicfObjectCapability>();
|
||||
auto rcfCap = cObj->capability<caf::PdmObjectScriptability>();
|
||||
errorMessageContainer->currentCommand = commandName;
|
||||
rcfCap->readFields( inputStream, objectFactory, errorMessageContainer );
|
||||
errorMessageContainer->currentCommand = "";
|
||||
@ -144,7 +144,7 @@ void RicfCommandFileReader::writeCommands( QTextStream& outputStream, const std:
|
||||
{
|
||||
for ( const auto& cmdObj : commandsToWrite )
|
||||
{
|
||||
auto rcfCap = cmdObj->capability<RicfObjectCapability>();
|
||||
auto rcfCap = cmdObj->capability<caf::PdmObjectScriptability>();
|
||||
if ( !rcfCap ) continue;
|
||||
|
||||
outputStream << cmdObj->classKeyword();
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -25,13 +26,13 @@ CAF_PDM_SOURCE_INIT( RicfCloneView, "cloneView" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCloneView::RicfCloneView()
|
||||
{
|
||||
RICF_InitField( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCloneView::execute()
|
||||
caf::PdmScriptResponse RicfCloneView::execute()
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
std::vector<Rim3dView*> allViews;
|
||||
@ -66,7 +67,7 @@ RicfCommandResponse RicfCloneView::execute()
|
||||
|
||||
if ( newViewId >= 0 )
|
||||
{
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
response.setResult( new RicfCreateViewResult( newViewId ) );
|
||||
return response;
|
||||
}
|
||||
@ -75,5 +76,5 @@ RicfCommandResponse RicfCloneView::execute()
|
||||
|
||||
QString error = QString( "cloneView: Could not clone view with id %1" ).arg( m_viewId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class RicfCloneView : public RicfCommandObject
|
||||
public:
|
||||
RicfCloneView();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_viewId;
|
||||
|
@ -32,8 +32,8 @@ RicfCloseProject::RicfCloseProject()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCloseProject::execute()
|
||||
caf::PdmScriptResponse RicfCloseProject::execute()
|
||||
{
|
||||
RiaApplication::instance()->closeProject();
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class RicfCloseProject : public RicfCommandObject
|
||||
public:
|
||||
RicfCloseProject();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
};
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfComputeCaseGroupStatistics, "computeCaseGroupStatistics" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -37,16 +39,16 @@ CAF_PDM_SOURCE_INIT( RicfComputeCaseGroupStatistics, "computeCaseGroupStatistics
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfComputeCaseGroupStatistics::RicfComputeCaseGroupStatistics()
|
||||
{
|
||||
RICF_InitField( &m_groupId, "caseGroupId", -1, "Case Group ID", "", "", "" );
|
||||
RICF_InitField( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_groupId, "caseGroupId", -1, "Case Group ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfComputeCaseGroupStatistics::execute()
|
||||
caf::PdmScriptResponse RicfComputeCaseGroupStatistics::execute()
|
||||
{
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
|
||||
std::vector<int> caseIds = m_caseIds.v();
|
||||
|
||||
@ -83,7 +85,7 @@ RicfCommandResponse RicfComputeCaseGroupStatistics::execute()
|
||||
"statistics case, cannot compute statistics." )
|
||||
.arg( caseId );
|
||||
RiaLogging::warning( warning );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||
}
|
||||
foundCase = true;
|
||||
break;
|
||||
@ -99,7 +101,7 @@ RicfCommandResponse RicfComputeCaseGroupStatistics::execute()
|
||||
QString( "computeCaseGroupStatistics: Could not find statistics case with ID %1." ).arg( caseId );
|
||||
|
||||
RiaLogging::warning( warning );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||
}
|
||||
}
|
||||
return response;
|
||||
|
@ -34,7 +34,7 @@ class RicfComputeCaseGroupStatistics : public RicfCommandObject
|
||||
public:
|
||||
RicfComputeCaseGroupStatistics();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_groupId;
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QStringList>
|
||||
@ -47,13 +49,13 @@ CAF_PDM_SOURCE_INIT( RicfCreateGridCaseGroup, "createGridCaseGroup" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCreateGridCaseGroup::RicfCreateGridCaseGroup()
|
||||
{
|
||||
RICF_InitFieldNoDefault( &m_casePaths, "casePaths", "List of Paths to Case Files", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_casePaths, "casePaths", "List of Paths to Case Files", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCreateGridCaseGroup::execute()
|
||||
caf::PdmScriptResponse RicfCreateGridCaseGroup::execute()
|
||||
{
|
||||
QStringList casePaths;
|
||||
for ( QString casePath : m_casePaths() )
|
||||
@ -71,10 +73,10 @@ RicfCommandResponse RicfCreateGridCaseGroup::execute()
|
||||
|
||||
if ( RiaImportEclipseCaseTools::addEclipseCases( casePaths, &caseGroup ) && caseGroup )
|
||||
{
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
response.setResult( new RicfCreateGridCaseGroupResult( caseGroup->groupId(), caseGroup->name() ) );
|
||||
return response;
|
||||
}
|
||||
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, "Could not load grid case group" );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, "Could not load grid case group" );
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class RicfCreateGridCaseGroup : public RicfCommandObject
|
||||
public:
|
||||
RicfCreateGridCaseGroup();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<std::vector<QString>> m_casePaths;
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfCreateLgrForCompletions, "createLgrForCompletions" );
|
||||
@ -47,19 +49,19 @@ CAF_PDM_SOURCE_INIT( RicfCreateLgrForCompletions, "createLgrForCompletions" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCreateLgrForCompletions::RicfCreateLgrForCompletions()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_timeStep, "timeStep", 0, "Time Step Index", "", "", "" );
|
||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
RICF_InitField( &m_refinementI, "refinementI", -1, "RefinementI", "", "", "" );
|
||||
RICF_InitField( &m_refinementJ, "refinementJ", -1, "RefinementJ", "", "", "" );
|
||||
RICF_InitField( &m_refinementK, "refinementK", -1, "RefinementK", "", "", "" );
|
||||
RICF_InitField( &m_splitType, "splitType", Lgr::SplitTypeEnum(), "SplitType", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", 0, "Time Step Index", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_refinementI, "refinementI", -1, "RefinementI", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_refinementJ, "refinementJ", -1, "RefinementJ", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_refinementK, "refinementK", -1, "RefinementK", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_splitType, "splitType", Lgr::SplitTypeEnum(), "SplitType", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
||||
caf::PdmScriptResponse RicfCreateLgrForCompletions::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -74,7 +76,7 @@ RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
||||
QString error = QString( "createLgrForCompletions: These well paths were not found: " ) +
|
||||
wellsNotFound.join( ", " );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +84,7 @@ RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
||||
{
|
||||
QString error( "No well paths found" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
|
||||
@ -103,7 +105,7 @@ RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
||||
{
|
||||
QString error( QString( "createLgrForCompletions: Could not find case with ID %1" ).arg( m_caseId() ) );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +124,7 @@ RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
||||
|
||||
feature->updateViews( eclipseCase );
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
if ( !wellsIntersectingOtherLgrs.empty() )
|
||||
{
|
||||
auto wellsList = wellsIntersectingOtherLgrs.join( ", " );
|
||||
@ -130,7 +132,7 @@ RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
||||
"LGR(s).Affected wells : " +
|
||||
wellsList );
|
||||
RiaLogging::warning( warning );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class RicfCreateLgrForCompletions : public RicfCommandObject
|
||||
public:
|
||||
RicfCreateLgrForCompletions();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfCreateMultipleFractures, "createMultipleFractures" );
|
||||
|
||||
@ -58,27 +59,27 @@ void AppEnum<MultipleFractures::Action>::setUp()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCreateMultipleFractures::RicfCreateMultipleFractures()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
RICF_InitField( &m_minDistFromWellTd, "minDistFromWellTd", 100.0, "Min Distance From Well TD", "", "", "" );
|
||||
RICF_InitField( &m_maxFracturesPerWell, "maxFracturesPerWell", 100, "Max Fractures per Well", "", "", "" );
|
||||
RICF_InitField( &m_templateId, "templateId", -1, "Template ID", "", "", "" );
|
||||
RICF_InitField( &m_topLayer, "topLayer", -1, "Top Layer", "", "", "" );
|
||||
RICF_InitField( &m_baseLayer, "baseLayer", -1, "Base Layer", "", "", "" );
|
||||
RICF_InitField( &m_spacing, "spacing", 300.0, "Spacing", "", "", "" );
|
||||
RICF_InitField( &m_action,
|
||||
"action",
|
||||
caf::AppEnum<MultipleFractures::Action>( MultipleFractures::APPEND_FRACTURES ),
|
||||
"Action",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_minDistFromWellTd, "minDistFromWellTd", 100.0, "Min Distance From Well TD", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_maxFracturesPerWell, "maxFracturesPerWell", 100, "Max Fractures per Well", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_templateId, "templateId", -1, "Template ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_topLayer, "topLayer", -1, "Top Layer", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_baseLayer, "baseLayer", -1, "Base Layer", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_spacing, "spacing", 300.0, "Spacing", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_action,
|
||||
"action",
|
||||
caf::AppEnum<MultipleFractures::Action>( MultipleFractures::APPEND_FRACTURES ),
|
||||
"Action",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCreateMultipleFractures::execute()
|
||||
caf::PdmScriptResponse RicfCreateMultipleFractures::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -99,7 +100,7 @@ RicfCommandResponse RicfCreateMultipleFractures::execute()
|
||||
QString error =
|
||||
QString( "createMultipleFractures: These well paths were not found: %1" ).arg( wellsNotFound.join( ", " ) );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +108,7 @@ RicfCommandResponse RicfCreateMultipleFractures::execute()
|
||||
{
|
||||
QString error = QString( "createMultipleFractures: Could not find case with ID %1" ).arg( m_caseId );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
if ( !fractureTemplate )
|
||||
@ -115,21 +116,21 @@ RicfCommandResponse RicfCreateMultipleFractures::execute()
|
||||
QString error =
|
||||
QString( "createMultipleFractures: Could not find fracture template with ID %1" ).arg( m_templateId );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
if ( wellPaths.empty() )
|
||||
{
|
||||
QString error( "createMultipleFractures: No wellpaths found" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
if ( !validateArguments() )
|
||||
{
|
||||
QString error( "createMultipleFractures: Mandatory argument(s) missing" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RicCreateMultipleFracturesOptionItemUi* options = new RicCreateMultipleFracturesOptionItemUi();
|
||||
@ -163,7 +164,7 @@ RicfCommandResponse RicfCreateMultipleFractures::execute()
|
||||
if ( m_action == MultipleFractures::APPEND_FRACTURES ) feature->appendFractures();
|
||||
if ( m_action == MultipleFractures::REPLACE_FRACTURES ) feature->replaceFractures();
|
||||
}
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,7 +49,7 @@ class RicfCreateMultipleFractures : public RicfCommandObject
|
||||
public:
|
||||
RicfCreateMultipleFractures();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
bool validateArguments() const;
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "RimProject.h"
|
||||
#include "RimSaturationPressurePlotCollection.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfCreateSaturationPressurePlots, "createSaturationPressurePlots" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -36,13 +38,13 @@ CAF_PDM_SOURCE_INIT( RicfCreateSaturationPressurePlots, "createSaturationPressur
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCreateSaturationPressurePlots::RicfCreateSaturationPressurePlots()
|
||||
{
|
||||
RICF_InitField( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCreateSaturationPressurePlots::execute()
|
||||
caf::PdmScriptResponse RicfCreateSaturationPressurePlots::execute()
|
||||
{
|
||||
std::vector<int> caseIds = m_caseIds();
|
||||
if ( caseIds.empty() )
|
||||
@ -62,7 +64,7 @@ RicfCommandResponse RicfCreateSaturationPressurePlots::execute()
|
||||
{
|
||||
QString error( "createSaturationPressurePlots: No cases found" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
@ -70,7 +72,7 @@ RicfCommandResponse RicfCreateSaturationPressurePlots::execute()
|
||||
{
|
||||
QString error( "No project loaded" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
auto eclipeCases = project->eclipseCases();
|
||||
@ -93,5 +95,5 @@ RicfCommandResponse RicfCreateSaturationPressurePlots::execute()
|
||||
collection->updateAllRequiredEditors();
|
||||
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ class RicfCreateSaturationPressurePlots : public RicfCommandObject
|
||||
public:
|
||||
RicfCreateSaturationPressurePlots();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<std::vector<int>> m_caseIds;
|
||||
};
|
||||
};
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -49,13 +50,13 @@ CAF_PDM_SOURCE_INIT( RicfCreateStatisticsCase, "createStatisticsCase" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCreateStatisticsCase::RicfCreateStatisticsCase()
|
||||
{
|
||||
RICF_InitField( &m_caseGroupId, "caseGroupId", -1, "Case Group Id", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseGroupId, "caseGroupId", -1, "Case Group Id", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCreateStatisticsCase::execute()
|
||||
caf::PdmScriptResponse RicfCreateStatisticsCase::execute()
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
|
||||
@ -68,10 +69,10 @@ RicfCommandResponse RicfCreateStatisticsCase::execute()
|
||||
RimEclipseStatisticsCase* createdObject = gridCaseGroup->createAndAppendStatisticsCase();
|
||||
project->assignCaseIdToCase( createdObject );
|
||||
gridCaseGroup->updateConnectedEditors();
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
response.setResult( new RicfCreateStatisticsCaseResult( createdObject->caseId() ) );
|
||||
return response;
|
||||
}
|
||||
}
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, "Could not find grid case group" );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, "Could not find grid case group" );
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class RicfCreateStatisticsCase : public RicfCommandObject
|
||||
public:
|
||||
RicfCreateStatisticsCase();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseGroupId;
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -34,13 +35,13 @@ CAF_PDM_SOURCE_INIT( RicfCreateView, "createView" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCreateView::RicfCreateView()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case Id", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case Id", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCreateView::execute()
|
||||
caf::PdmScriptResponse RicfCreateView::execute()
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
std::vector<RimCase*> allCases;
|
||||
@ -72,7 +73,7 @@ RicfCommandResponse RicfCreateView::execute()
|
||||
|
||||
if ( viewId >= 0 )
|
||||
{
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
response.setResult( new RicfCreateViewResult( viewId ) );
|
||||
return response;
|
||||
}
|
||||
@ -81,5 +82,5 @@ RicfCommandResponse RicfCreateView::execute()
|
||||
|
||||
QString error = QString( "createView: Could not create view for case id %1" ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class RicfCreateView : public RicfCommandObject
|
||||
public:
|
||||
RicfCreateView();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "RimWellBoreStabilityPlot.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfCreateWbsPlotResult, "createWbsPlotResult" );
|
||||
@ -49,9 +51,9 @@ CAF_PDM_SOURCE_INIT( RicfCreateWellBoreStabilityPlotFeature, "createWellBoreStab
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCreateWellBoreStabilityPlotFeature::RicfCreateWellBoreStabilityPlotFeature()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "GeoMech Case Id", "", "", "" );
|
||||
RICF_InitField( &m_wellPath, "wellPath", QString( "" ), "Well Path", "", "", "" );
|
||||
RICF_InitField( &m_timeStep, "timeStep", -1, "Time Step", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "GeoMech Case Id", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_wellPath, "wellPath", QString( "" ), "Well Path", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", -1, "Time Step", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_wbsParameters, "wbsParameters", "WbsParameters", "", "", "" );
|
||||
}
|
||||
@ -59,7 +61,7 @@ RicfCreateWellBoreStabilityPlotFeature::RicfCreateWellBoreStabilityPlotFeature()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfCreateWellBoreStabilityPlotFeature::execute()
|
||||
caf::PdmScriptResponse RicfCreateWellBoreStabilityPlotFeature::execute()
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
|
||||
@ -93,17 +95,17 @@ RicfCommandResponse RicfCreateWellBoreStabilityPlotFeature::execute()
|
||||
QString error = QString( "The well path %1 has no geometry. Cannot create a Well Bore Stability Plot" )
|
||||
.arg( chosenWellPath->name() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RimWellBoreStabilityPlot* wbsPlot =
|
||||
RicNewWellBoreStabilityPlotFeature::createPlot( chosenCase, chosenWellPath, m_timeStep(), m_wbsParameters() );
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
response.setResult( new RicfCreateWbsPlotResult( wbsPlot->id() ) );
|
||||
return response;
|
||||
}
|
||||
|
||||
QString error = QString( "createWellBoreStabilityPlot: Could not find GeoMech case with id %1" ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class RicfCreateWellBoreStabilityPlotFeature : public RicfCommandObject
|
||||
|
||||
public:
|
||||
RicfCreateWellBoreStabilityPlotFeature();
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
@ -40,19 +42,19 @@ CAF_PDM_SOURCE_INIT( RicfExportFlowCharacteristics, "exportFlowCharacteristics"
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportFlowCharacteristics::RicfExportFlowCharacteristics()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_selectedTimeSteps, "timeSteps", std::vector<int>(), "Selected Time Steps", "", "", "" );
|
||||
RICF_InitField( &m_injectors, "injectors", std::vector<QString>(), "Injectors", "", "", "" );
|
||||
RICF_InitField( &m_producers, "producers", std::vector<QString>(), "Producers", "", "", "" );
|
||||
RICF_InitField( &m_fileName, "fileName", QString(), "Export File Name", "", "", "" );
|
||||
RICF_InitField( &m_minCommunication, "minimumCommunication", 0.0, "Minimum Communication", "", "", "" );
|
||||
RICF_InitField( &m_maxPvFraction, "aquiferCellThreshold", 0.1, "Aquifer Cell Threshold", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_selectedTimeSteps, "timeSteps", std::vector<int>(), "Selected Time Steps", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_injectors, "injectors", std::vector<QString>(), "Injectors", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_producers, "producers", std::vector<QString>(), "Producers", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_fileName, "fileName", QString(), "Export File Name", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_minCommunication, "minimumCommunication", 0.0, "Minimum Communication", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_maxPvFraction, "aquiferCellThreshold", 0.1, "Aquifer Cell Threshold", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportFlowCharacteristics::execute()
|
||||
caf::PdmScriptResponse RicfExportFlowCharacteristics::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -61,7 +63,7 @@ RicfCommandResponse RicfExportFlowCharacteristics::execute()
|
||||
{
|
||||
QString error = QString( "exportFlowCharacteristics: Could not find case with ID %1." ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
{
|
||||
@ -79,7 +81,7 @@ RicfCommandResponse RicfExportFlowCharacteristics::execute()
|
||||
if ( !exportDir.mkpath( "." ) )
|
||||
{
|
||||
QString msg = QString( "Failed to create folder - %1" ).arg( exportFolder );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, msg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, msg );
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,10 +113,10 @@ RicfCommandResponse RicfExportFlowCharacteristics::execute()
|
||||
else
|
||||
{
|
||||
QString msg = QString( "Failed to export file - %1" ).arg( exportFileName );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, msg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class RicfExportFlowCharacteristics : public RicfCommandObject
|
||||
public:
|
||||
RicfExportFlowCharacteristics();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfExportLgrForCompletions, "exportLgrForCompletions" );
|
||||
@ -45,19 +47,19 @@ CAF_PDM_SOURCE_INIT( RicfExportLgrForCompletions, "exportLgrForCompletions" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportLgrForCompletions::RicfExportLgrForCompletions()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
RICF_InitField( &m_refinementI, "refinementI", -1, "RefinementI", "", "", "" );
|
||||
RICF_InitField( &m_refinementJ, "refinementJ", -1, "RefinementJ", "", "", "" );
|
||||
RICF_InitField( &m_refinementK, "refinementK", -1, "RefinementK", "", "", "" );
|
||||
RICF_InitField( &m_splitType, "splitType", Lgr::SplitTypeEnum(), "SplitType", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_refinementI, "refinementI", -1, "RefinementI", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_refinementJ, "refinementJ", -1, "RefinementJ", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_refinementK, "refinementK", -1, "RefinementK", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_splitType, "splitType", Lgr::SplitTypeEnum(), "SplitType", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportLgrForCompletions::execute()
|
||||
caf::PdmScriptResponse RicfExportLgrForCompletions::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -72,7 +74,7 @@ RicfCommandResponse RicfExportLgrForCompletions::execute()
|
||||
QString error( QString( "exportLgrForCompletions: These well paths were not found: " ) +
|
||||
wellsNotFound.join( ", " ) );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +82,7 @@ RicfCommandResponse RicfExportLgrForCompletions::execute()
|
||||
{
|
||||
QString error( "exportLgrForCompletions: Could not find any well paths" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::LGRS );
|
||||
@ -97,7 +99,7 @@ RicfCommandResponse RicfExportLgrForCompletions::execute()
|
||||
{
|
||||
QString error( QString( "exportLgrForCompletions: Could not find case with ID %1" ).arg( m_caseId() ) );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
caf::VecIjk lgrCellCounts( m_refinementI, m_refinementJ, m_refinementK );
|
||||
@ -112,7 +114,7 @@ RicfCommandResponse RicfExportLgrForCompletions::execute()
|
||||
{RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES},
|
||||
&wellsIntersectingOtherLgrs );
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
if ( !wellsIntersectingOtherLgrs.empty() )
|
||||
{
|
||||
auto wellsList = wellsIntersectingOtherLgrs.join( ", " );
|
||||
@ -120,7 +122,7 @@ RicfCommandResponse RicfExportLgrForCompletions::execute()
|
||||
"exportLgrForCompletions: No export for some wells due to existing intersecting LGR(s).Affected wells : " +
|
||||
wellsList );
|
||||
RiaLogging::warning( warning );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class RicfExportLgrForCompletions : public RicfCommandObject
|
||||
public:
|
||||
RicfExportLgrForCompletions();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
|
||||
#include "CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfExportMsw, "exportMsw" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -43,18 +45,24 @@ CAF_PDM_SOURCE_INIT( RicfExportMsw, "exportMsw" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportMsw::RicfExportMsw()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_wellPathName, "wellPath", QString(), "Well Path Name", "", "", "" );
|
||||
RICF_InitField( &m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "" );
|
||||
RICF_InitField( &m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "" );
|
||||
RICF_InitField( &m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "" );
|
||||
RICF_InitField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathName, "wellPath", QString(), "Well Path Name", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_fileSplit,
|
||||
"fileSplit",
|
||||
RicExportCompletionDataSettingsUi::ExportSplitType(),
|
||||
"File Split",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportMsw::execute()
|
||||
caf::PdmScriptResponse RicfExportMsw::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -65,7 +73,7 @@ RicfCommandResponse RicfExportMsw::execute()
|
||||
{
|
||||
QString error = QString( "exportMsw: Could not find case with ID %1." ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::COMPLETIONS );
|
||||
@ -85,10 +93,10 @@ RicfCommandResponse RicfExportMsw::execute()
|
||||
{
|
||||
QString error = QString( "exportMsw: Could not find well path with name %1" ).arg( m_wellPathName() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( exportSettings, {wellPath} );
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class RicfExportMsw : public RicfCommandObject
|
||||
public:
|
||||
RicfExportMsw();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
@ -45,4 +45,4 @@ private:
|
||||
caf::PdmField<bool> m_includeFishbones;
|
||||
caf::PdmField<bool> m_includeFractures;
|
||||
caf::PdmField<RicExportCompletionDataSettingsUi::ExportSplitType> m_fileSplit;
|
||||
};
|
||||
};
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaProjectModifier.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfExportMultiCaseSnapshots, "exportMultiCaseSnapshots" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -31,26 +33,26 @@ CAF_PDM_SOURCE_INIT( RicfExportMultiCaseSnapshots, "exportMultiCaseSnapshots" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportMultiCaseSnapshots::RicfExportMultiCaseSnapshots()
|
||||
{
|
||||
RICF_InitField( &m_gridListFile, "gridListFile", QString(), "Grid List File", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_gridListFile, "gridListFile", QString(), "Grid List File", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportMultiCaseSnapshots::execute()
|
||||
caf::PdmScriptResponse RicfExportMultiCaseSnapshots::execute()
|
||||
{
|
||||
RiaGuiApplication* app = RiaGuiApplication::instance();
|
||||
if ( !app )
|
||||
{
|
||||
QString error( "exportMultiCaseSnapshots: Requires GUI Application" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
if ( m_gridListFile().isNull() )
|
||||
{
|
||||
QString error( "exportMultiCaseSnapshots: Required parameter gridListFile." );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
||||
@ -59,7 +61,7 @@ RicfCommandResponse RicfExportMultiCaseSnapshots::execute()
|
||||
QString error( "exportMultiCaseSnapshots: 'openProject' must be called before 'exportMultiCaseSnapshots' to "
|
||||
"specify project file to replace cases in." );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
std::vector<QString> listFileNames = RiaApplication::readFileListFromTextFile( m_gridListFile() );
|
||||
@ -67,5 +69,5 @@ RicfCommandResponse RicfExportMultiCaseSnapshots::execute()
|
||||
listFileNames,
|
||||
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::SNAPSHOTS ) );
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class RicfExportMultiCaseSnapshots : public RicfCommandObject
|
||||
public:
|
||||
RicfExportMultiCaseSnapshots();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_gridListFile;
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QDir>
|
||||
@ -47,19 +48,19 @@ CAF_PDM_SOURCE_INIT( RicfExportProperty, "exportProperty" );
|
||||
RicfExportProperty::RicfExportProperty()
|
||||
{
|
||||
// clang-format off
|
||||
RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", "");
|
||||
RICF_InitField(&m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", "");
|
||||
RICF_InitField(&m_propertyName, "property", QString(), "Property Name", "", "", "");
|
||||
RICF_InitField(&m_eclipseKeyword, "eclipseKeyword", QString(), "Eclipse Keyword", "", "", "");
|
||||
RICF_InitField(&m_undefinedValue, "undefinedValue", 0.0, "Undefined Value", "", "", "");
|
||||
RICF_InitField(&m_exportFileName, "exportFile", QString(), "Export FileName", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_caseId, "caseId", -1, "Case ID", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_propertyName, "property", QString(), "Property Name", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_eclipseKeyword, "eclipseKeyword", QString(), "Eclipse Keyword", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_undefinedValue, "undefinedValue", 0.0, "Undefined Value", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_exportFileName, "exportFile", QString(), "Export FileName", "", "", "");
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportProperty::execute()
|
||||
caf::PdmScriptResponse RicfExportProperty::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -69,7 +70,7 @@ RicfCommandResponse RicfExportProperty::execute()
|
||||
{
|
||||
QString error = QString( "exportProperty: Could not find case with ID %1" ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
if ( !eclipseCase->eclipseCaseData() )
|
||||
@ -78,7 +79,7 @@ RicfCommandResponse RicfExportProperty::execute()
|
||||
{
|
||||
QString error = QString( "exportProperty: Could not find eclipseCaseData with ID %1" ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -91,7 +92,7 @@ RicfCommandResponse RicfExportProperty::execute()
|
||||
{
|
||||
QString error = QString( "exportProperty: Could not find result property : %1" ).arg( m_propertyName() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
QString filePath = m_exportFileName;
|
||||
@ -118,8 +119,8 @@ RicfCommandResponse RicfExportProperty::execute()
|
||||
m_undefinedValue,
|
||||
&errMsg ) )
|
||||
{
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||
}
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class RicfExportProperty : public RicfCommandObject
|
||||
public:
|
||||
RicfExportProperty();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <limits>
|
||||
@ -47,16 +48,16 @@ CAF_PDM_SOURCE_INIT( RicfExportPropertyInViews, "exportPropertyInViews" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportPropertyInViews::RicfExportPropertyInViews()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_viewIds, "viewIds", std::vector<int>(), "View IDs", "", "", "" );
|
||||
RICF_InitField( &m_viewNames, "viewNames", std::vector<QString>(), "View Names", "", "", "" );
|
||||
RICF_InitField( &m_undefinedValue, "undefinedValue", 0.0, "Undefined Value", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewIds, "viewIds", std::vector<int>(), "View IDs", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewNames, "viewNames", std::vector<QString>(), "View Names", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_undefinedValue, "undefinedValue", 0.0, "Undefined Value", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportPropertyInViews::execute()
|
||||
caf::PdmScriptResponse RicfExportPropertyInViews::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -65,7 +66,7 @@ RicfCommandResponse RicfExportPropertyInViews::execute()
|
||||
{
|
||||
QString error( QString( "exportProperty: Could not find case with ID %1" ).arg( m_caseId() ) );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
std::vector<RimEclipseView*> viewsForExport;
|
||||
@ -110,7 +111,7 @@ RicfCommandResponse RicfExportPropertyInViews::execute()
|
||||
}
|
||||
}
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
|
||||
for ( const auto& view : viewsForExport )
|
||||
{
|
||||
@ -134,7 +135,7 @@ RicfCommandResponse RicfExportPropertyInViews::execute()
|
||||
.arg( view->currentTimeStep() )
|
||||
.arg( propertyName );
|
||||
RiaLogging::warning( warning );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -160,7 +161,7 @@ RicfCommandResponse RicfExportPropertyInViews::execute()
|
||||
&errorMsg );
|
||||
if ( !worked )
|
||||
{
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errorMsg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errorMsg );
|
||||
}
|
||||
}
|
||||
return response;
|
||||
|
@ -40,7 +40,7 @@ class RicfExportPropertyInViews : public RicfCommandObject
|
||||
public:
|
||||
RicfExportPropertyInViews();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -37,6 +37,8 @@
|
||||
|
||||
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfExportSimWellFractureCompletions, "exportSimWellFractureCompletions" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -44,25 +46,37 @@ CAF_PDM_SOURCE_INIT( RicfExportSimWellFractureCompletions, "exportSimWellFractur
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportSimWellFractureCompletions::RicfExportSimWellFractureCompletions()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||
RICF_InitField( &m_viewName, "viewName", QString( "" ), "View Name", "", "", "" );
|
||||
RICF_InitField( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||
RICF_InitField( &m_simWellNames, "simulationWellNames", std::vector<QString>(), "Simulation Well Names", "", "", "" );
|
||||
RICF_InitField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split", "", "", "" );
|
||||
RICF_InitField( &m_compdatExport,
|
||||
"compdatExport",
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType(),
|
||||
"Compdat Export",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewName, "viewName", QString( "" ), "View Name", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_simWellNames,
|
||||
"simulationWellNames",
|
||||
std::vector<QString>(),
|
||||
"Simulation Well Names",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_fileSplit,
|
||||
"fileSplit",
|
||||
RicExportCompletionDataSettingsUi::ExportSplitType(),
|
||||
"File Split",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_compdatExport,
|
||||
"compdatExport",
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType(),
|
||||
"Compdat Export",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportSimWellFractureCompletions::execute()
|
||||
caf::PdmScriptResponse RicfExportSimWellFractureCompletions::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -79,7 +93,7 @@ RicfCommandResponse RicfExportSimWellFractureCompletions::execute()
|
||||
{
|
||||
QString error = QString( "exportSimWellCompletions: Could not find case with ID %1" ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
exportSettings->caseToApply = eclipseCase;
|
||||
}
|
||||
@ -108,10 +122,10 @@ RicfCommandResponse RicfExportSimWellFractureCompletions::execute()
|
||||
.arg( m_viewName )
|
||||
.arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
|
||||
std::vector<RimSimWellInView*> simWells;
|
||||
if ( m_simWellNames().empty() )
|
||||
@ -146,7 +160,7 @@ RicfCommandResponse RicfExportSimWellFractureCompletions::execute()
|
||||
.arg( m_viewName )
|
||||
.arg( m_caseId() );
|
||||
RiaLogging::warning( warning );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class RicfExportSimWellFractureCompletions : public RicfCommandObject
|
||||
public:
|
||||
RicfExportSimWellFractureCompletions();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfExportSnapshots, "exportSnapshots" );
|
||||
@ -58,24 +60,24 @@ void RicfExportSnapshots::SnapshotsTypeEnum::setUp()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportSnapshots::RicfExportSnapshots()
|
||||
{
|
||||
RICF_InitField( &m_type, "type", RicfExportSnapshots::SnapshotsTypeEnum(), "Type", "", "", "" );
|
||||
RICF_InitField( &m_prefix, "prefix", QString(), "Prefix", "", "", "" );
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case Id", "", "", "" );
|
||||
RICF_InitField( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
||||
RICF_InitField( &m_exportFolder, "exportFolder", QString(), "Export Folder", "", "", "" );
|
||||
RICF_InitFieldNoDefault( &m_plotOutputFormat, "plotOutputFormat", "Output Format", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_type, "type", RicfExportSnapshots::SnapshotsTypeEnum(), "Type", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_prefix, "prefix", QString(), "Prefix", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case Id", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_exportFolder, "exportFolder", QString(), "Export Folder", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_plotOutputFormat, "plotOutputFormat", "Output Format", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportSnapshots::execute()
|
||||
caf::PdmScriptResponse RicfExportSnapshots::execute()
|
||||
{
|
||||
if ( !RiaGuiApplication::isRunning() )
|
||||
{
|
||||
QString error( "RicfExportSnapshot: Command cannot run without a GUI" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
@ -129,5 +131,5 @@ RicfCommandResponse RicfExportSnapshots::execute()
|
||||
mainWnd->loadWinGeoAndDockToolBarLayout();
|
||||
RiaGuiApplication::instance()->processEvents();
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
public:
|
||||
RicfExportSnapshots();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<SnapshotsTypeEnum> m_type;
|
||||
|
@ -38,8 +38,7 @@
|
||||
|
||||
#include "RifEclipseInputFileTools.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include <cafUtils.h>
|
||||
|
||||
#include <QDir>
|
||||
@ -63,31 +62,43 @@ void AppEnum<RicfExportVisibleCells::ExportKeyword>::setUp()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportVisibleCells::RicfExportVisibleCells()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||
RICF_InitField( &m_viewName, "viewName", QString(), "View Name", "", "", "" );
|
||||
RICF_InitField( &m_exportKeyword,
|
||||
"exportKeyword",
|
||||
caf::AppEnum<RicfExportVisibleCells::ExportKeyword>(),
|
||||
"Export Keyword",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
RICF_InitField( &m_visibleActiveCellsValue, "visibleActiveCellsValue", 1, "Visible Active Cells Value", "", "", "" );
|
||||
RICF_InitField( &m_hiddenActiveCellsValue, "hiddenActiveCellsValue", 0, "Hidden Active Cells Value", "", "", "" );
|
||||
RICF_InitField( &m_inactiveCellsValue, "inactiveCellsValue", 0, "Inactive Cells Value", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewName, "viewName", QString(), "View Name", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_exportKeyword,
|
||||
"exportKeyword",
|
||||
caf::AppEnum<RicfExportVisibleCells::ExportKeyword>(),
|
||||
"Export Keyword",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_visibleActiveCellsValue,
|
||||
"visibleActiveCellsValue",
|
||||
1,
|
||||
"Visible Active Cells Value",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_hiddenActiveCellsValue,
|
||||
"hiddenActiveCellsValue",
|
||||
0,
|
||||
"Hidden Active Cells Value",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_inactiveCellsValue, "inactiveCellsValue", 0, "Inactive Cells Value", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportVisibleCells::execute()
|
||||
caf::PdmScriptResponse RicfExportVisibleCells::execute()
|
||||
{
|
||||
if ( m_caseId < 0 || ( m_viewName().isEmpty() && m_viewId() < 0 ) )
|
||||
{
|
||||
QString error( "exportVisibleCells: CaseId or view name or view id not specified" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
RimEclipseView* eclipseView = nullptr;
|
||||
if ( m_viewId() >= 0 )
|
||||
@ -105,7 +116,7 @@ RicfCommandResponse RicfExportVisibleCells::execute()
|
||||
.arg( m_viewName )
|
||||
.arg( m_caseId ) );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::CELLS );
|
||||
@ -120,7 +131,7 @@ RicfCommandResponse RicfExportVisibleCells::execute()
|
||||
buildExportSettings( exportFolder, &exportSettings );
|
||||
RicSaveEclipseInputVisibleCellsFeature::executeCommand( eclipseView, exportSettings, "exportVisibleCells" );
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -45,7 +45,7 @@ class RicfExportVisibleCells : public RicfCommandObject
|
||||
public:
|
||||
RicfExportVisibleCells();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
void buildExportSettings( const QString& exportFolder, RicSaveEclipseInputVisibleCellsUi* exportSettings );
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include "RimProject.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QStringList>
|
||||
@ -59,24 +61,24 @@ CAF_PDM_SOURCE_INIT( RicfExportWellLogPlotData, "exportWellLogPlotData" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportWellLogPlotData::RicfExportWellLogPlotData()
|
||||
{
|
||||
RICF_InitFieldNoDefault( &m_format, "exportFormat", "", "", "", "" );
|
||||
RICF_InitField( &m_viewId, "viewId", -1, "", "", "", "" );
|
||||
RICF_InitField( &m_folder, "exportFolder", QString(), "", "", "", "" );
|
||||
RICF_InitField( &m_filePrefix, "filePrefix", QString(), "", "", "", "" );
|
||||
RICF_InitField( &m_exportTvdRkb, "exportTvdRkb", false, "", "", "", "" );
|
||||
RICF_InitField( &m_capitalizeFileNames, "capitalizeFileNames", false, "", "", "", "" );
|
||||
RICF_InitField( &m_resampleInterval, "resampleInterval", 0.0, "", "", "", "" );
|
||||
RICF_InitField( &m_convertCurveUnits, "convertCurveUnits", false, "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_format, "exportFormat", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_folder, "exportFolder", QString(), "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_filePrefix, "filePrefix", QString(), "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_exportTvdRkb, "exportTvdRkb", false, "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_capitalizeFileNames, "capitalizeFileNames", false, "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_resampleInterval, "resampleInterval", 0.0, "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_convertCurveUnits, "convertCurveUnits", false, "", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportWellLogPlotData::execute()
|
||||
caf::PdmScriptResponse RicfExportWellLogPlotData::execute()
|
||||
{
|
||||
QStringList errorMessages;
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
|
||||
if ( QFileInfo::exists( m_folder ) )
|
||||
{
|
||||
@ -133,7 +135,7 @@ RicfCommandResponse RicfExportWellLogPlotData::execute()
|
||||
|
||||
for ( QString errorMessage : errorMessages )
|
||||
{
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
public:
|
||||
RicfExportWellLogPlotData();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<ExportFormatEnum> m_format;
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfExportWellPathCompletions, "exportWellPathCompletions" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -41,55 +43,79 @@ CAF_PDM_SOURCE_INIT( RicfExportWellPathCompletions, "exportWellPathCompletions"
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportWellPathCompletions::RicfExportWellPathCompletions()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
|
||||
RICF_InitField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split", "", "", "" );
|
||||
RICF_InitField( &m_compdatExport,
|
||||
"compdatExport",
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType(),
|
||||
"Compdat Export",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
RICF_InitField( &m_combinationMode,
|
||||
"combinationMode",
|
||||
RicExportCompletionDataSettingsUi::CombinationModeType(),
|
||||
"Combination Mode",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_fileSplit,
|
||||
"fileSplit",
|
||||
RicExportCompletionDataSettingsUi::ExportSplitType(),
|
||||
"File Split",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_compdatExport,
|
||||
"compdatExport",
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType(),
|
||||
"Compdat Export",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_combinationMode,
|
||||
"combinationMode",
|
||||
RicExportCompletionDataSettingsUi::CombinationModeType(),
|
||||
"Combination Mode",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
RICF_InitField( &m_useLateralNTG, "useNtgHorizontally", false, "Use NTG Horizontally", "", "", "" );
|
||||
RICF_InitField( &m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "" );
|
||||
RICF_InitField( &m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "" );
|
||||
RICF_InitField( &m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_useLateralNTG, "useNtgHorizontally", false, "Use NTG Horizontally", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "" );
|
||||
|
||||
RICF_InitField( &m_excludeMainBoreForFishbones,
|
||||
"excludeMainBoreForFishbones",
|
||||
false,
|
||||
"Exclude Main Bore for Fishbones",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_excludeMainBoreForFishbones,
|
||||
"excludeMainBoreForFishbones",
|
||||
false,
|
||||
"Exclude Main Bore for Fishbones",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
RICF_InitField( &m_performTransScaling, "performTransScaling", false, "Perform Transmissibility Scaling", "", "", "" );
|
||||
RICF_InitField( &m_transScalingTimeStep, "transScalingTimeStep", 0, "Transmissibility Scaling Pressure Time Step", "", "", "" );
|
||||
RICF_InitField( &m_transScalingInitialWBHP,
|
||||
"transScalingWBHPFromSummary",
|
||||
RicExportCompletionDataSettingsUi::TransScalingWBHPSource(),
|
||||
"Transmissibility Scaling WBHP from summary",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
RICF_InitField( &m_transScalingWBHP, "transScalingWBHP", 200.0, "Transmissibility Scaling Constant WBHP Value", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_performTransScaling,
|
||||
"performTransScaling",
|
||||
false,
|
||||
"Perform Transmissibility Scaling",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_transScalingTimeStep,
|
||||
"transScalingTimeStep",
|
||||
0,
|
||||
"Transmissibility Scaling Pressure Time Step",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_transScalingInitialWBHP,
|
||||
"transScalingWBHPFromSummary",
|
||||
RicExportCompletionDataSettingsUi::TransScalingWBHPSource(),
|
||||
"Transmissibility Scaling WBHP from summary",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_transScalingWBHP,
|
||||
"transScalingWBHP",
|
||||
200.0,
|
||||
"Transmissibility Scaling Constant WBHP Value",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportWellPathCompletions::execute()
|
||||
caf::PdmScriptResponse RicfExportWellPathCompletions::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -127,7 +153,7 @@ RicfCommandResponse RicfExportWellPathCompletions::execute()
|
||||
{
|
||||
QString error = QString( "exportWellPathCompletions: Could not find case with ID %1" ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
exportSettings->caseToApply = eclipseCase;
|
||||
}
|
||||
@ -139,7 +165,7 @@ RicfCommandResponse RicfExportWellPathCompletions::execute()
|
||||
}
|
||||
exportSettings->folder = exportFolder;
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
if ( m_wellPathNames().empty() )
|
||||
@ -167,7 +193,7 @@ RicfCommandResponse RicfExportWellPathCompletions::execute()
|
||||
QString warning =
|
||||
QString( "exportWellPathCompletions: Could not find well path with name %1" ).arg( wellPathName );
|
||||
RiaLogging::warning( warning );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class RicfExportWellPathCompletions : public RicfCommandObject
|
||||
public:
|
||||
RicfExportWellPathCompletions();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfExportWellPaths, "exportWellPaths" );
|
||||
|
||||
@ -44,14 +45,14 @@ CAF_PDM_SOURCE_INIT( RicfExportWellPaths, "exportWellPaths" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportWellPaths::RicfExportWellPaths()
|
||||
{
|
||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
RICF_InitField( &m_mdStepSize, "mdStepSize", 5.0, "MD Step Size", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_mdStepSize, "mdStepSize", 5.0, "MD Step Size", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfExportWellPaths::execute()
|
||||
caf::PdmScriptResponse RicfExportWellPaths::execute()
|
||||
{
|
||||
using TOOLS = RicfApplicationTools;
|
||||
|
||||
@ -66,7 +67,7 @@ RicfCommandResponse RicfExportWellPaths::execute()
|
||||
QString error( QString( "exportWellPaths: These well paths were not found: " ) +
|
||||
wellsNotFound.join( ", " ) );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,7 +75,7 @@ RicfCommandResponse RicfExportWellPaths::execute()
|
||||
{
|
||||
QString error( "No well paths found" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::WELLPATHS );
|
||||
@ -94,5 +95,5 @@ RicfCommandResponse RicfExportWellPaths::execute()
|
||||
feature->exportWellPath( wellPath, m_mdStepSize, exportFolder, false );
|
||||
}
|
||||
}
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class RicfExportWellPaths : public RicfCommandObject
|
||||
public:
|
||||
RicfExportWellPaths();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<std::vector<QString>> m_wellPathNames;
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "RimFormationNames.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfImportFormationNames, "importFormationNames" );
|
||||
@ -33,14 +35,14 @@ CAF_PDM_SOURCE_INIT( RicfImportFormationNames, "importFormationNames" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfImportFormationNames::RicfImportFormationNames()
|
||||
{
|
||||
RICF_InitFieldNoDefault( &m_formationFiles, "formationFiles", "", "", "", "" );
|
||||
RICF_InitField( &m_applyToCaseId, "applyToCaseId", -1, "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_formationFiles, "formationFiles", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_applyToCaseId, "applyToCaseId", -1, "", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfImportFormationNames::execute()
|
||||
caf::PdmScriptResponse RicfImportFormationNames::execute()
|
||||
{
|
||||
QStringList errorMessages, warningMessages;
|
||||
|
||||
@ -87,14 +89,14 @@ RicfCommandResponse RicfImportFormationNames::execute()
|
||||
errorMessages << "No formation files provided";
|
||||
}
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
for ( QString warningMessage : warningMessages )
|
||||
{
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warningMessage );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warningMessage );
|
||||
}
|
||||
for ( QString errorMessage : errorMessages )
|
||||
{
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class RicfImportFormationNames : public RicfCommandObject
|
||||
public:
|
||||
RicfImportFormationNames();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<std::vector<QString>> m_formationFiles;
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RimWellLogFile.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QStringList>
|
||||
@ -44,11 +46,11 @@ CAF_PDM_SOURCE_INIT( RicfImportWellLogFiles, "importWellLogFiles" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfImportWellLogFiles::RicfImportWellLogFiles()
|
||||
{
|
||||
RICF_InitFieldNoDefault( &m_wellLogFileFolder, "wellLogFolder", "", "", "", "" );
|
||||
RICF_InitFieldNoDefault( &m_wellLogFilePaths, "wellLogFiles", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_wellLogFileFolder, "wellLogFolder", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_wellLogFilePaths, "wellLogFiles", "", "", "", "" );
|
||||
}
|
||||
|
||||
RicfCommandResponse RicfImportWellLogFiles::execute()
|
||||
caf::PdmScriptResponse RicfImportWellLogFiles::execute()
|
||||
{
|
||||
QStringList errorMessages, warningMessages;
|
||||
QStringList wellLogFilePaths;
|
||||
@ -94,7 +96,7 @@ RicfCommandResponse RicfImportWellLogFiles::execute()
|
||||
}
|
||||
}
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
|
||||
if ( !wellLogFilePaths.empty() )
|
||||
{
|
||||
@ -117,12 +119,12 @@ RicfCommandResponse RicfImportWellLogFiles::execute()
|
||||
|
||||
for ( QString warningMessage : warningMessages )
|
||||
{
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warningMessage );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warningMessage );
|
||||
}
|
||||
|
||||
for ( QString errorMessage : errorMessages )
|
||||
{
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||
}
|
||||
|
||||
return response;
|
||||
|
@ -50,7 +50,7 @@ class RicfImportWellLogFiles : public RicfCommandObject
|
||||
public:
|
||||
RicfImportWellLogFiles();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_wellLogFileFolder;
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QStringList>
|
||||
@ -45,13 +47,13 @@ CAF_PDM_SOURCE_INIT( RicfLoadCase, "loadCase" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfLoadCase::RicfLoadCase()
|
||||
{
|
||||
RICF_InitField( &m_path, "path", QString(), "Path to Case File", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_path, "path", QString(), "Path to Case File", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfLoadCase::execute()
|
||||
caf::PdmScriptResponse RicfLoadCase::execute()
|
||||
{
|
||||
QString absolutePath = m_path;
|
||||
QFileInfo projectPathInfo( absolutePath );
|
||||
@ -67,10 +69,10 @@ RicfCommandResponse RicfLoadCase::execute()
|
||||
{
|
||||
QString error = QString( "loadCase: Unable to load case from %1" ).arg( absolutePath );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
CAF_ASSERT( fileCaseIdMap.size() == 1u );
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
response.setResult( new RicfLoadCaseResult( fileCaseIdMap.begin()->second ) );
|
||||
return response;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class RicfLoadCase : public RicfCommandObject
|
||||
public:
|
||||
RicfLoadCase();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_path;
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
@ -33,13 +35,13 @@ CAF_PDM_SOURCE_INIT( RicfOpenProject, "openProject" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfOpenProject::RicfOpenProject()
|
||||
{
|
||||
RICF_InitField( &m_path, "path", QString(), "Path", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_path, "path", QString(), "Path", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfOpenProject::execute()
|
||||
caf::PdmScriptResponse RicfOpenProject::execute()
|
||||
{
|
||||
QString projectPath = m_path;
|
||||
QFileInfo projectPathInfo( projectPath );
|
||||
@ -53,10 +55,10 @@ RicfCommandResponse RicfOpenProject::execute()
|
||||
{
|
||||
QString errMsg = QString( "openProject: Unable to open project at %1" ).arg( m_path() );
|
||||
RiaLogging::error( errMsg );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||
}
|
||||
|
||||
RicfCommandFileExecutor::instance()->setLastProjectPath( projectPath );
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class RicfOpenProject : public RicfCommandObject
|
||||
public:
|
||||
RicfOpenProject();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_path;
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
@ -36,8 +38,8 @@ CAF_PDM_SOURCE_INIT( RicfSingleCaseReplace, "replaceCase" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfSingleCaseReplace::RicfSingleCaseReplace()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_newGridFile, "newGridFile", QString(), "New Grid File", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_newGridFile, "newGridFile", QString(), "New Grid File", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -59,7 +61,7 @@ QString RicfSingleCaseReplace::filePath() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfSingleCaseReplace::execute()
|
||||
caf::PdmScriptResponse RicfSingleCaseReplace::execute()
|
||||
{
|
||||
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
||||
if ( lastProjectPath.isNull() )
|
||||
@ -67,7 +69,7 @@ RicfCommandResponse RicfSingleCaseReplace::execute()
|
||||
QString errMsg( "replaceCase: 'openProject' must be called before 'replaceCase' to specify project file to "
|
||||
"replace case in." );
|
||||
RiaLogging::error( errMsg );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||
}
|
||||
|
||||
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
||||
@ -93,10 +95,10 @@ RicfCommandResponse RicfSingleCaseReplace::execute()
|
||||
{
|
||||
QString errMsg( "Could not reload project" );
|
||||
RiaLogging::error( errMsg );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||
}
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfMultiCaseReplace, "replaceMultipleCases" );
|
||||
@ -119,13 +121,13 @@ void RicfMultiCaseReplace::setCaseReplacePairs( const std::map<int, QString>& ca
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfMultiCaseReplace::execute()
|
||||
caf::PdmScriptResponse RicfMultiCaseReplace::execute()
|
||||
{
|
||||
if ( m_caseIdToGridFileNameMap.empty() )
|
||||
{
|
||||
QString errMsg( "replaceCaseImpl: No replacements available." );
|
||||
RiaLogging::error( errMsg );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||
}
|
||||
|
||||
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
||||
@ -134,7 +136,7 @@ RicfCommandResponse RicfMultiCaseReplace::execute()
|
||||
QString errMsg( "replaceCase: 'openProject' must be called before 'replaceCase' to specify project file to "
|
||||
"replace case in." );
|
||||
RiaLogging::error( errMsg );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||
}
|
||||
|
||||
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
||||
@ -163,8 +165,8 @@ RicfCommandResponse RicfMultiCaseReplace::execute()
|
||||
{
|
||||
QString errMsg( "Could not reload project" );
|
||||
RiaLogging::error( errMsg );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||
}
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
int caseId() const;
|
||||
QString filePath() const;
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_newGridFile;
|
||||
@ -63,7 +63,7 @@ public:
|
||||
|
||||
void setCaseReplacePairs( const std::map<int, QString>& caseIdToGridFileNameMap );
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
std::map<int, QString> m_caseIdToGridFileNameMap;
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaProjectModifier.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfReplaceSourceCases, "replaceSourceCases" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -31,20 +33,20 @@ CAF_PDM_SOURCE_INIT( RicfReplaceSourceCases, "replaceSourceCases" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfReplaceSourceCases::RicfReplaceSourceCases()
|
||||
{
|
||||
RICF_InitField( &m_caseGroupId, "caseGroupId", -1, "Case Group ID", "", "", "" );
|
||||
RICF_InitField( &m_gridListFile, "gridListFile", QString(), "Grid List File", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseGroupId, "caseGroupId", -1, "Case Group ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_gridListFile, "gridListFile", QString(), "Grid List File", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfReplaceSourceCases::execute()
|
||||
caf::PdmScriptResponse RicfReplaceSourceCases::execute()
|
||||
{
|
||||
if ( m_gridListFile().isNull() )
|
||||
{
|
||||
QString error( "replaceSourceCases: Required parameter gridListFile." );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
||||
@ -53,7 +55,7 @@ RicfCommandResponse RicfReplaceSourceCases::execute()
|
||||
QString error( "replaceSourceCases: 'openProject' must be called before 'replaceSourceCases' to specify "
|
||||
"project file to replace cases in." );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
||||
@ -74,7 +76,7 @@ RicfCommandResponse RicfReplaceSourceCases::execute()
|
||||
{
|
||||
QString error( "Could not reload project" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class RicfReplaceSourceCases : public RicfCommandObject
|
||||
public:
|
||||
RicfReplaceSourceCases();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_gridListFile;
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfRunOctaveScript, "runOctaveScript" );
|
||||
@ -35,14 +37,14 @@ CAF_PDM_SOURCE_INIT( RicfRunOctaveScript, "runOctaveScript" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfRunOctaveScript::RicfRunOctaveScript()
|
||||
{
|
||||
RICF_InitField( &m_path, "path", QString(), "Path", "", "", "" );
|
||||
RICF_InitField( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_path, "path", QString(), "Path", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfRunOctaveScript::execute()
|
||||
caf::PdmScriptResponse RicfRunOctaveScript::execute()
|
||||
{
|
||||
QString octavePath = RiaApplication::instance()->octavePath();
|
||||
|
||||
@ -77,12 +79,12 @@ RicfCommandResponse RicfRunOctaveScript::execute()
|
||||
RiaApplication::instance()->octaveProcessEnvironment() );
|
||||
}
|
||||
|
||||
RicfCommandResponse response;
|
||||
caf::PdmScriptResponse response;
|
||||
if ( !ok )
|
||||
{
|
||||
QString error = QString( "runOctaveScript: Could not execute script %1" ).arg( m_path() );
|
||||
RiaLogging::error( error );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -34,9 +34,9 @@ class RicfRunOctaveScript : public RicfCommandObject
|
||||
public:
|
||||
RicfRunOctaveScript();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_path;
|
||||
caf::PdmField<std::vector<int>> m_caseIds;
|
||||
};
|
||||
};
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfScaleFractureTemplate, "scaleFractureTemplate" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -35,13 +37,13 @@ RicfScaleFractureTemplate::RicfScaleFractureTemplate()
|
||||
{
|
||||
// clang-format off
|
||||
|
||||
RICF_InitField(&m_id, "id", -1, "Id", "", "", "");
|
||||
RICF_InitField(&m_halfLengthScaleFactor, "halfLength", 1.0, "HalfLengthScaleFactor", "", "", "");
|
||||
RICF_InitField(&m_heightScaleFactor, "height", 1.0, "HeightScaleFactor", "", "", "");
|
||||
RICF_InitField(&m_dFactorScaleFactor, "dFactor", 1.0, "DFactorScaleFactor", "", "", "");
|
||||
RICF_InitField(&m_conductivityScaleFactor, "conductivity", 1.0, "ConductivityScaleFactor", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_id, "id", -1, "Id", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_halfLengthScaleFactor, "halfLength", 1.0, "HalfLengthScaleFactor", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_heightScaleFactor, "height", 1.0, "HeightScaleFactor", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_dFactorScaleFactor, "dFactor", 1.0, "DFactorScaleFactor", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_conductivityScaleFactor, "conductivity", 1.0, "ConductivityScaleFactor", "", "", "");
|
||||
|
||||
RICF_InitField(&m_OBSOLETE_widthScaleFactor, "width", 1.0, "WidthScaleFactor", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_OBSOLETE_widthScaleFactor, "width", 1.0, "WidthScaleFactor", "", "", "");
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
@ -49,13 +51,13 @@ RicfScaleFractureTemplate::RicfScaleFractureTemplate()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfScaleFractureTemplate::execute()
|
||||
caf::PdmScriptResponse RicfScaleFractureTemplate::execute()
|
||||
{
|
||||
if ( m_id < 0 )
|
||||
{
|
||||
QString error( "scaleFractureTemplate: Fracture template id not specified" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
@ -64,7 +66,7 @@ RicfCommandResponse RicfScaleFractureTemplate::execute()
|
||||
{
|
||||
QString error( "scaleFractureTemplate: Project not found" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RimFractureTemplateCollection* templColl =
|
||||
@ -75,12 +77,12 @@ RicfCommandResponse RicfScaleFractureTemplate::execute()
|
||||
{
|
||||
QString error = QString( "scaleFractureTemplate: Fracture template not found. Id=%1" ).arg( m_id );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
templ->setScaleFactors( m_halfLengthScaleFactor, m_heightScaleFactor, m_dFactorScaleFactor, m_conductivityScaleFactor );
|
||||
templ->loadDataAndUpdateGeometryHasChanged();
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -36,7 +36,7 @@ class RicfScaleFractureTemplate : public RicfCommandObject
|
||||
public:
|
||||
RicfScaleFractureTemplate();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
void initAfterRead() override;
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfSetExportFolder, "setExportFolder" );
|
||||
@ -31,16 +33,16 @@ CAF_PDM_SOURCE_INIT( RicfSetExportFolder, "setExportFolder" );
|
||||
RicfSetExportFolder::RicfSetExportFolder()
|
||||
{
|
||||
// clang-format off
|
||||
RICF_InitField(&m_type, "type", RicfCommandFileExecutor::ExportTypeEnum(RicfCommandFileExecutor::COMPLETIONS), "Type", "", "", "");
|
||||
RICF_InitField(&m_path, "path", QString(), "Path", "", "", "");
|
||||
RICF_InitField(&m_createFolder, "createFolder", false, "Create Folder", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_type, "type", RicfCommandFileExecutor::ExportTypeEnum(RicfCommandFileExecutor::COMPLETIONS), "Type", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_path, "path", QString(), "Path", "", "", "");
|
||||
CAF_PDM_InitScriptableFieldWithIO(&m_createFolder, "createFolder", false, "Create Folder", "", "", "");
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfSetExportFolder::execute()
|
||||
caf::PdmScriptResponse RicfSetExportFolder::execute()
|
||||
{
|
||||
if ( m_createFolder )
|
||||
{
|
||||
@ -54,12 +56,12 @@ RicfCommandResponse RicfSetExportFolder::execute()
|
||||
{
|
||||
QString error = QString( "Could not create folder : %1" ).arg( m_path );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RicfCommandFileExecutor* executor = RicfCommandFileExecutor::instance();
|
||||
executor->setExportPath( m_type(), m_path );
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class RicfSetExportFolder : public RicfCommandObject
|
||||
public:
|
||||
RicfSetExportFolder();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<RicfCommandFileExecutor::ExportTypeEnum> m_type;
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfSetFractureContainment, "setFractureContainment" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -33,21 +35,21 @@ CAF_PDM_SOURCE_INIT( RicfSetFractureContainment, "setFractureContainment" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfSetFractureContainment::RicfSetFractureContainment()
|
||||
{
|
||||
RICF_InitField( &m_id, "id", -1, "Id", "", "", "" );
|
||||
RICF_InitField( &m_topLayer, "topLayer", -1, "TopLayer", "", "", "" );
|
||||
RICF_InitField( &m_baseLayer, "baseLayer", -1, "BaseLayer", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_id, "id", -1, "Id", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_topLayer, "topLayer", -1, "TopLayer", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_baseLayer, "baseLayer", -1, "BaseLayer", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfSetFractureContainment::execute()
|
||||
caf::PdmScriptResponse RicfSetFractureContainment::execute()
|
||||
{
|
||||
if ( m_id < 0 || m_topLayer < 0 || m_baseLayer < 0 )
|
||||
{
|
||||
QString error( "setFractureContainment: Required argument missing" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
@ -56,7 +58,7 @@ RicfCommandResponse RicfSetFractureContainment::execute()
|
||||
{
|
||||
QString error( "setFractureContainment: Project not found" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RimFractureTemplateCollection* templColl =
|
||||
@ -67,11 +69,11 @@ RicfCommandResponse RicfSetFractureContainment::execute()
|
||||
{
|
||||
QString error = QString( "setFractureContainment: Fracture template not found. Id=%1" ).arg( m_id );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
templ->setContainmentTopKLayer( m_topLayer );
|
||||
templ->setContainmentBaseKLayer( m_baseLayer );
|
||||
templ->loadDataAndUpdateGeometryHasChanged();
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class RicfSetFractureContainment : public RicfCommandObject
|
||||
public:
|
||||
RicfSetFractureContainment();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_id;
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfSetMainWindowSize, "setMainWindowSize" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -28,15 +30,15 @@ CAF_PDM_SOURCE_INIT( RicfSetMainWindowSize, "setMainWindowSize" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfSetMainWindowSize::RicfSetMainWindowSize()
|
||||
{
|
||||
RICF_InitField( &m_height, "height", -1, "Height", "", "", "" );
|
||||
RICF_InitField( &m_width, "width", -1, "Width", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_height, "height", -1, "Height", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_width, "width", -1, "Width", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfSetMainWindowSize::execute()
|
||||
caf::PdmScriptResponse RicfSetMainWindowSize::execute()
|
||||
{
|
||||
RiuMainWindow::instance()->resize( m_width, m_height );
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class RicfSetMainWindowSize : public RicfCommandObject
|
||||
public:
|
||||
RicfSetMainWindowSize();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_height;
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfSetPlotWindowSize, "setPlotWindowSize" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -28,20 +30,20 @@ CAF_PDM_SOURCE_INIT( RicfSetPlotWindowSize, "setPlotWindowSize" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfSetPlotWindowSize::RicfSetPlotWindowSize()
|
||||
{
|
||||
RICF_InitField( &m_height, "height", -1, "Height", "", "", "" );
|
||||
RICF_InitField( &m_width, "width", -1, "Width", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_height, "height", -1, "Height", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_width, "width", -1, "Width", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfSetPlotWindowSize::execute()
|
||||
caf::PdmScriptResponse RicfSetPlotWindowSize::execute()
|
||||
{
|
||||
RiaGuiApplication* guiApp = RiaGuiApplication::instance();
|
||||
if ( guiApp )
|
||||
{
|
||||
guiApp->getOrCreateAndShowMainPlotWindow()->resize( m_width, m_height );
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, "Need GUI ResInsight to set plot window size" );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, "Need GUI ResInsight to set plot window size" );
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class RicfSetPlotWindowSize : public RicfCommandObject
|
||||
public:
|
||||
RicfSetPlotWindowSize();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_height;
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfSetStartDir, "setStartDir" );
|
||||
@ -30,28 +32,28 @@ CAF_PDM_SOURCE_INIT( RicfSetStartDir, "setStartDir" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfSetStartDir::RicfSetStartDir()
|
||||
{
|
||||
RICF_InitField( &m_path, "path", QString(), "Path", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_path, "path", QString(), "Path", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfSetStartDir::execute()
|
||||
caf::PdmScriptResponse RicfSetStartDir::execute()
|
||||
{
|
||||
QDir directory( m_path );
|
||||
if ( !directory.exists() )
|
||||
{
|
||||
QString error = QString( "Path does not exist: %1" ).arg( m_path );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
if ( !directory.isReadable() )
|
||||
{
|
||||
QString error = QString( "Path does not exist: %1" ).arg( m_path );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RiaApplication::instance()->setStartDir( m_path );
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class RicfSetStartDir : public RicfCommandObject
|
||||
public:
|
||||
RicfSetStartDir();
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_path;
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicfSetTimeStep, "setTimeStep" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -34,9 +36,9 @@ CAF_PDM_SOURCE_INIT( RicfSetTimeStep, "setTimeStep" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfSetTimeStep::RicfSetTimeStep()
|
||||
{
|
||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
RICF_InitField( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||
RICF_InitField( &m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -66,7 +68,7 @@ void RicfSetTimeStep::setTimeStepIndex( int timeStepIndex )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfSetTimeStep::execute()
|
||||
caf::PdmScriptResponse RicfSetTimeStep::execute()
|
||||
{
|
||||
RimCase* rimCase = nullptr;
|
||||
std::vector<RimCase*> allCases;
|
||||
@ -88,7 +90,7 @@ RicfCommandResponse RicfSetTimeStep::execute()
|
||||
{
|
||||
QString error = QString( "setTimeStep: Could not find case with ID %1" ).arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,7 +102,7 @@ RicfCommandResponse RicfSetTimeStep::execute()
|
||||
.arg( maxTimeStep )
|
||||
.arg( m_caseId() );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
for ( Rim3dView* view : rimCase->views() )
|
||||
@ -112,5 +114,5 @@ RicfCommandResponse RicfSetTimeStep::execute()
|
||||
}
|
||||
}
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
void setViewId( int viewId );
|
||||
void setTimeStepIndex( int timeStepIndex );
|
||||
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "RicSaveProjectFeature.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QMessageBox>
|
||||
|
||||
@ -33,21 +35,21 @@ RICF_SOURCE_INIT( RicSaveProjectAsFeature, "RicSaveProjectAsFeature", "saveProje
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSaveProjectAsFeature::RicSaveProjectAsFeature()
|
||||
{
|
||||
RICF_InitFieldNoDefault( &m_filePath, "filePath", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_filePath, "filePath", "", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicSaveProjectAsFeature::execute()
|
||||
caf::PdmScriptResponse RicSaveProjectAsFeature::execute()
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
QString errorMessage;
|
||||
if ( !RiaApplication::instance()->saveProjectAs( m_filePath(), &errorMessage ) )
|
||||
{
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||
}
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -73,7 +75,7 @@ void RicSaveProjectAsFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
auto response = execute();
|
||||
|
||||
if ( response.status() != RicfCommandResponse::COMMAND_OK )
|
||||
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
|
||||
{
|
||||
QString displayMessage = response.messages().join( "\n" );
|
||||
if ( RiaGuiApplication::isRunning() )
|
||||
|
@ -32,7 +32,7 @@ class RicSaveProjectAsFeature : public caf::CmdFeature, public RicfCommandObject
|
||||
|
||||
public:
|
||||
RicSaveProjectAsFeature();
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
|
@ -38,7 +38,7 @@ RicSaveProjectFeature::RicSaveProjectFeature()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicSaveProjectFeature::execute()
|
||||
caf::PdmScriptResponse RicSaveProjectFeature::execute()
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
@ -55,10 +55,10 @@ RicfCommandResponse RicSaveProjectFeature::execute()
|
||||
|
||||
if ( !worked )
|
||||
{
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
||||
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||
}
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -88,7 +88,7 @@ void RicSaveProjectFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
|
||||
auto response = execute();
|
||||
if ( response.status() != RicfCommandResponse::COMMAND_OK )
|
||||
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
|
||||
{
|
||||
QString displayMessage = response.messages().join( "\n" );
|
||||
if ( RiaGuiApplication::isRunning() )
|
||||
|
@ -32,7 +32,7 @@ class RicSaveProjectFeature : public caf::CmdFeature, public RicfCommandObject
|
||||
|
||||
public:
|
||||
RicSaveProjectFeature();
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafUtils.h"
|
||||
@ -49,11 +50,11 @@ RICF_SOURCE_INIT( RicExportContourMapToTextFeature, "RicExportContourMapToTextFe
|
||||
|
||||
RicExportContourMapToTextFeature::RicExportContourMapToTextFeature()
|
||||
{
|
||||
RICF_InitFieldNoDefault( &m_exportFileName, "exportFileName", "", "", "", "" );
|
||||
RICF_InitFieldNoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" );
|
||||
RICF_InitFieldNoDefault( &m_undefinedValueLabel, "undefinedValueLabel", "", "", "", "" );
|
||||
RICF_InitFieldNoDefault( &m_excludeUndefinedValues, "excludeUndefinedValues", "", "", "", "" );
|
||||
RICF_InitField( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_exportFileName, "exportFileName", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_undefinedValueLabel, "undefinedValueLabel", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_excludeUndefinedValues, "excludeUndefinedValues", "", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -127,13 +128,13 @@ void RicExportContourMapToTextFeature::onActionTriggered( bool isChecked )
|
||||
m_undefinedValueLabel = featureUi.undefinedValueLabel();
|
||||
m_excludeUndefinedValues = featureUi.excludeUndefinedValues();
|
||||
|
||||
RicfCommandResponse response = execute();
|
||||
QStringList messages = response.messages();
|
||||
caf::PdmScriptResponse response = execute();
|
||||
QStringList messages = response.messages();
|
||||
|
||||
if ( !messages.empty() )
|
||||
{
|
||||
QString displayMessage = QString( "Problem exporting contour map:\n%2" ).arg( messages.join( "\n" ) );
|
||||
if ( response.status() == RicfCommandResponse::COMMAND_ERROR )
|
||||
if ( response.status() == caf::PdmScriptResponse::COMMAND_ERROR )
|
||||
{
|
||||
RiaLogging::error( displayMessage );
|
||||
}
|
||||
@ -273,10 +274,10 @@ void RicExportContourMapToTextFeature::setupActionLook( QAction* actionToSetup )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
||||
caf::PdmScriptResponse RicExportContourMapToTextFeature::execute()
|
||||
{
|
||||
RicfCommandResponse response;
|
||||
QStringList errorMessages, warningMessages;
|
||||
caf::PdmScriptResponse response;
|
||||
QStringList errorMessages, warningMessages;
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
@ -297,7 +298,7 @@ RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
||||
|
||||
if ( !myView )
|
||||
{
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, "No contour map view found" );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, "No contour map view found" );
|
||||
return response;
|
||||
}
|
||||
|
||||
@ -339,7 +340,7 @@ RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
||||
|
||||
for ( QString errorMessage : errorMessages )
|
||||
{
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
||||
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||
}
|
||||
|
||||
return response;
|
||||
|
@ -39,7 +39,7 @@ class RicExportContourMapToTextFeature : public caf::CmdFeature, public RicfComm
|
||||
|
||||
public:
|
||||
RicExportContourMapToTextFeature();
|
||||
RicfCommandResponse execute() override;
|
||||
caf::PdmScriptResponse execute() override;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
|
@ -79,6 +79,12 @@ void RicFlyToObjectFeature::onActionTriggered( bool isChecked )
|
||||
directionNormalToLargesExtent = cvf::Vec3d::Y_AXIS;
|
||||
}
|
||||
|
||||
double zExtent = fabs( bb.extent().z() ) * activeView->scaleZ();
|
||||
largesExtent = std::max( largesExtent, zExtent );
|
||||
|
||||
// Scale to make the object fit in view
|
||||
largesExtent *= 2.0;
|
||||
|
||||
cvf::Vec3d cameraEye = centerInDisplayCoords + directionNormalToLargesExtent * std::max( largesExtent, 30.0 );
|
||||
cvf::Vec3d cameraViewRefPoint = centerInDisplayCoords;
|
||||
cvf::Vec3d cameraUp = cvf::Vec3d::Z_AXIS;
|
||||
@ -113,7 +119,11 @@ cvf::BoundingBox RicFlyToObjectFeature::boundingBoxForSelectedObjects()
|
||||
{
|
||||
if ( obj )
|
||||
{
|
||||
bb.add( obj->boundingBoxInDomainCoords() );
|
||||
auto candidate = obj->boundingBoxInDomainCoords();
|
||||
if ( candidate.isValid() )
|
||||
{
|
||||
bb.add( candidate );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "RimMultiPlotCollection.h"
|
||||
#include "RimPlot.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSaturationPressurePlot.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include <QAction>
|
||||
@ -47,7 +48,7 @@ RicNewMultiPlotFeature::RicNewMultiPlotFeature()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicNewMultiPlotFeature::execute()
|
||||
caf::PdmScriptResponse RicNewMultiPlotFeature::execute()
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
RimMultiPlotCollection* plotCollection = project->mainPlotCollection()->multiPlotCollection();
|
||||
@ -68,6 +69,21 @@ RicfCommandResponse RicNewMultiPlotFeature::execute()
|
||||
for ( auto plot : plots )
|
||||
{
|
||||
auto copy = dynamic_cast<RimPlot*>( plot->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
|
||||
{
|
||||
// TODO: Workaround for fixing the PdmPointer in RimEclipseResultDefinition
|
||||
// caf::PdmPointer<RimEclipseCase> m_eclipseCase;
|
||||
// This pdmpointer must be changed to a ptrField
|
||||
|
||||
auto saturationPressurePlotOriginal = dynamic_cast<RimSaturationPressurePlot*>( plot );
|
||||
auto saturationPressurePlotCopy = dynamic_cast<RimSaturationPressurePlot*>( copy );
|
||||
if ( saturationPressurePlotCopy && saturationPressurePlotOriginal )
|
||||
{
|
||||
RimSaturationPressurePlot::fixPointersAfterCopy( saturationPressurePlotOriginal,
|
||||
saturationPressurePlotCopy );
|
||||
}
|
||||
}
|
||||
|
||||
plotWindow->addPlot( copy );
|
||||
|
||||
copy->resolveReferencesRecursively();
|
||||
@ -84,7 +100,7 @@ RicfCommandResponse RicNewMultiPlotFeature::execute()
|
||||
RiuPlotMainWindowTools::setExpanded( plotCollection, true );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plotWindow, true );
|
||||
|
||||
return RicfCommandResponse();
|
||||
return caf::PdmScriptResponse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -37,7 +37,7 @@ class RicNewMultiPlotFeature : public caf::CmdFeature, public RicfCommandObject
|
||||
public:
|
||||
RicNewMultiPlotFeature();
|
||||
|
||||
virtual RicfCommandResponse execute() override;
|
||||
virtual caf::PdmScriptResponse execute() override;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
|
@ -52,7 +52,7 @@ bool RicNewDerivedEnsembleFeature::showWarningDialogWithQuestion()
|
||||
msgBox.setIcon( QMessageBox::Question );
|
||||
msgBox.setWindowTitle( "Ensemble Matching" );
|
||||
msgBox.setText( "None of the cases in the ensembles match" );
|
||||
msgBox.setInformativeText( "Do you want to keep the derived ensemble?" );
|
||||
msgBox.setInformativeText( "Do you want to keep the delta ensemble?" );
|
||||
msgBox.setStandardButtons( QMessageBox::Yes | QMessageBox::No );
|
||||
|
||||
int ret = msgBox.exec();
|
||||
@ -113,6 +113,6 @@ void RicNewDerivedEnsembleFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewDerivedEnsembleFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "New Derived Ensemble" );
|
||||
actionToSetup->setText( "New Delta Ensemble" );
|
||||
actionToSetup->setIcon( QIcon( ":/SummaryEnsemble16x16.png" ) );
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user