mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
* General PdmObjectMethods for scripting.
This commit is contained in:
@@ -35,8 +35,6 @@
|
|||||||
#include "HoloLensCommands/RicHoloLensSessionManager.h"
|
#include "HoloLensCommands/RicHoloLensSessionManager.h"
|
||||||
#include "RicImportGeneralDataFeature.h"
|
#include "RicImportGeneralDataFeature.h"
|
||||||
#include "RicfCommandFileExecutor.h"
|
#include "RicfCommandFileExecutor.h"
|
||||||
#include "RicfFieldHandle.h"
|
|
||||||
#include "RicfObjectCapability.h"
|
|
||||||
|
|
||||||
#include "Rim2dIntersectionViewCollection.h"
|
#include "Rim2dIntersectionViewCollection.h"
|
||||||
#include "RimAnnotationCollection.h"
|
#include "RimAnnotationCollection.h"
|
||||||
@@ -1260,7 +1258,7 @@ QVariant RiaApplication::cacheDataObject( const QString& key ) const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiaApplication::executeCommandFile( const QString& commandFile )
|
void RiaApplication::executeCommandFile( const QString& commandFile )
|
||||||
{
|
{
|
||||||
QFile file( commandFile );
|
QFile file( commandFile );
|
||||||
caf::PdmScriptIOMessages messages;
|
caf::PdmScriptIOMessages messages;
|
||||||
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,19 +1,11 @@
|
|||||||
|
|
||||||
set (SOURCE_GROUP_HEADER_FILES
|
set (SOURCE_GROUP_HEADER_FILES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.h
|
${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
|
${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.cpp
|
${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
|
${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -18,13 +18,11 @@
|
|||||||
|
|
||||||
#include "RicfCommandObject.h"
|
#include "RicfCommandObject.h"
|
||||||
|
|
||||||
#include "cafPdmPythonGenerator.h"
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandObject::RicfCommandObject()
|
RicfCommandObject::RicfCommandObject()
|
||||||
: RicfObjectCapability( this, false )
|
: PdmObjectScriptability( this, false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,66 +17,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "RicfCommandResponse.h"
|
|
||||||
#include "RicfFieldCapability.h"
|
|
||||||
#include "RicfObjectCapability.h"
|
|
||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmObjectScriptabilityRegister.h"
|
#include "cafPdmObjectScriptability.h"
|
||||||
#include "cafPdmPythonGenerator.h"
|
#include "cafPdmScriptResponse.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 )
|
|
||||||
|
|
||||||
#define RICF_HEADER_INIT \
|
#define RICF_HEADER_INIT \
|
||||||
CAF_CMD_HEADER_INIT; \
|
CAF_CMD_HEADER_INIT; \
|
||||||
@@ -91,3 +36,17 @@ public:
|
|||||||
} \
|
} \
|
||||||
CAF_FACTORY_REGISTER2( caf::CmdFeature, ClassName, std::string, ClassName::idNameStatic() ); \
|
CAF_FACTORY_REGISTER2( caf::CmdFeature, ClassName, std::string, ClassName::idNameStatic() ); \
|
||||||
CAF_PDM_SOURCE_INIT( ClassName, CommandKeyword )
|
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;
|
|
||||||
};
|
|
||||||
@@ -1,55 +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 "cafPdmObjectCapability.h"
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
class PdmObject;
|
|
||||||
class PdmObjectHandle;
|
|
||||||
class PdmObjectFactory;
|
|
||||||
class PdmScriptIOMessages;
|
|
||||||
} // namespace caf
|
|
||||||
|
|
||||||
class QTextStream;
|
|
||||||
|
|
||||||
//==================================================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//==================================================================================================
|
|
||||||
class RicfObjectCapability : public caf::PdmObjectCapability
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RicfObjectCapability( caf::PdmObjectHandle* owner, bool giveOwnership );
|
|
||||||
|
|
||||||
~RicfObjectCapability() override;
|
|
||||||
|
|
||||||
void readFields( QTextStream& inputStream,
|
|
||||||
caf::PdmObjectFactory* objectFactory,
|
|
||||||
caf::PdmScriptIOMessages* errorMessageContainer );
|
|
||||||
void writeFields( QTextStream& outputStream ) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
caf::PdmObjectHandle* m_owner;
|
|
||||||
};
|
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
#include "RifcCommandFileReader.h"
|
#include "RifcCommandFileReader.h"
|
||||||
|
|
||||||
#include "RicfCommandObject.h"
|
#include "RicfCommandObject.h"
|
||||||
#include "RicfObjectCapability.h"
|
|
||||||
|
|
||||||
#include "cafPdmObjectFactory.h"
|
#include "cafPdmObjectFactory.h"
|
||||||
|
#include "cafPdmObjectScriptability.h"
|
||||||
#include "cafPdmScriptIOMessages.h"
|
#include "cafPdmScriptIOMessages.h"
|
||||||
|
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
@@ -127,7 +127,7 @@ std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands( QTextStream
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
readCommands.push_back( cObj );
|
readCommands.push_back( cObj );
|
||||||
auto rcfCap = cObj->capability<RicfObjectCapability>();
|
auto rcfCap = cObj->capability<caf::PdmObjectScriptability>();
|
||||||
errorMessageContainer->currentCommand = commandName;
|
errorMessageContainer->currentCommand = commandName;
|
||||||
rcfCap->readFields( inputStream, objectFactory, errorMessageContainer );
|
rcfCap->readFields( inputStream, objectFactory, errorMessageContainer );
|
||||||
errorMessageContainer->currentCommand = "";
|
errorMessageContainer->currentCommand = "";
|
||||||
@@ -144,7 +144,7 @@ void RicfCommandFileReader::writeCommands( QTextStream& outputStream, const std:
|
|||||||
{
|
{
|
||||||
for ( const auto& cmdObj : commandsToWrite )
|
for ( const auto& cmdObj : commandsToWrite )
|
||||||
{
|
{
|
||||||
auto rcfCap = cmdObj->capability<RicfObjectCapability>();
|
auto rcfCap = cmdObj->capability<caf::PdmObjectScriptability>();
|
||||||
if ( !rcfCap ) continue;
|
if ( !rcfCap ) continue;
|
||||||
|
|
||||||
outputStream << cmdObj->classKeyword();
|
outputStream << cmdObj->classKeyword();
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "Riu3DMainWindowTools.h"
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@@ -25,13 +26,13 @@ CAF_PDM_SOURCE_INIT( RicfCloneView, "cloneView" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCloneView::RicfCloneView()
|
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();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
std::vector<Rim3dView*> allViews;
|
std::vector<Rim3dView*> allViews;
|
||||||
@@ -66,7 +67,7 @@ RicfCommandResponse RicfCloneView::execute()
|
|||||||
|
|
||||||
if ( newViewId >= 0 )
|
if ( newViewId >= 0 )
|
||||||
{
|
{
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
response.setResult( new RicfCreateViewResult( newViewId ) );
|
response.setResult( new RicfCreateViewResult( newViewId ) );
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -75,5 +76,5 @@ RicfCommandResponse RicfCloneView::execute()
|
|||||||
|
|
||||||
QString error = QString( "cloneView: Could not clone view with id %1" ).arg( m_viewId() );
|
QString error = QString( "cloneView: Could not clone view with id %1" ).arg( m_viewId() );
|
||||||
RiaLogging::error( error );
|
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:
|
public:
|
||||||
RicfCloneView();
|
RicfCloneView();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_viewId;
|
caf::PdmField<int> m_viewId;
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ RicfCloseProject::RicfCloseProject()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfCloseProject::execute()
|
caf::PdmScriptResponse RicfCloseProject::execute()
|
||||||
{
|
{
|
||||||
RiaApplication::instance()->closeProject();
|
RiaApplication::instance()->closeProject();
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class RicfCloseProject : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfCloseProject();
|
RicfCloseProject();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfComputeCaseGroupStatistics, "computeCaseGroupStatistics" );
|
CAF_PDM_SOURCE_INIT( RicfComputeCaseGroupStatistics, "computeCaseGroupStatistics" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -37,16 +39,16 @@ CAF_PDM_SOURCE_INIT( RicfComputeCaseGroupStatistics, "computeCaseGroupStatistics
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfComputeCaseGroupStatistics::RicfComputeCaseGroupStatistics()
|
RicfComputeCaseGroupStatistics::RicfComputeCaseGroupStatistics()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_groupId, "caseGroupId", -1, "Case Group ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_groupId, "caseGroupId", -1, "Case Group ID", "", "", "" );
|
||||||
RICF_InitField( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
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();
|
std::vector<int> caseIds = m_caseIds.v();
|
||||||
|
|
||||||
@@ -83,7 +85,7 @@ RicfCommandResponse RicfComputeCaseGroupStatistics::execute()
|
|||||||
"statistics case, cannot compute statistics." )
|
"statistics case, cannot compute statistics." )
|
||||||
.arg( caseId );
|
.arg( caseId );
|
||||||
RiaLogging::warning( warning );
|
RiaLogging::warning( warning );
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||||
}
|
}
|
||||||
foundCase = true;
|
foundCase = true;
|
||||||
break;
|
break;
|
||||||
@@ -99,7 +101,7 @@ RicfCommandResponse RicfComputeCaseGroupStatistics::execute()
|
|||||||
QString( "computeCaseGroupStatistics: Could not find statistics case with ID %1." ).arg( caseId );
|
QString( "computeCaseGroupStatistics: Could not find statistics case with ID %1." ).arg( caseId );
|
||||||
|
|
||||||
RiaLogging::warning( warning );
|
RiaLogging::warning( warning );
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class RicfComputeCaseGroupStatistics : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfComputeCaseGroupStatistics();
|
RicfComputeCaseGroupStatistics();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_groupId;
|
caf::PdmField<int> m_groupId;
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include "RimIdenticalGridCaseGroup.h"
|
#include "RimIdenticalGridCaseGroup.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@@ -47,13 +49,13 @@ CAF_PDM_SOURCE_INIT( RicfCreateGridCaseGroup, "createGridCaseGroup" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCreateGridCaseGroup::RicfCreateGridCaseGroup()
|
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;
|
QStringList casePaths;
|
||||||
for ( QString casePath : m_casePaths() )
|
for ( QString casePath : m_casePaths() )
|
||||||
@@ -71,10 +73,10 @@ RicfCommandResponse RicfCreateGridCaseGroup::execute()
|
|||||||
|
|
||||||
if ( RiaImportEclipseCaseTools::addEclipseCases( casePaths, &caseGroup ) && caseGroup )
|
if ( RiaImportEclipseCaseTools::addEclipseCases( casePaths, &caseGroup ) && caseGroup )
|
||||||
{
|
{
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
response.setResult( new RicfCreateGridCaseGroupResult( caseGroup->groupId(), caseGroup->name() ) );
|
response.setResult( new RicfCreateGridCaseGroupResult( caseGroup->groupId(), caseGroup->name() ) );
|
||||||
return response;
|
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:
|
public:
|
||||||
RicfCreateGridCaseGroup();
|
RicfCreateGridCaseGroup();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<std::vector<QString>> m_casePaths;
|
caf::PdmField<std::vector<QString>> m_casePaths;
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
#include "RiaWellNameComparer.h"
|
#include "RiaWellNameComparer.h"
|
||||||
|
|
||||||
#include "cafCmdFeatureManager.h"
|
#include "cafCmdFeatureManager.h"
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfCreateLgrForCompletions, "createLgrForCompletions" );
|
CAF_PDM_SOURCE_INIT( RicfCreateLgrForCompletions, "createLgrForCompletions" );
|
||||||
@@ -47,19 +49,19 @@ CAF_PDM_SOURCE_INIT( RicfCreateLgrForCompletions, "createLgrForCompletions" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCreateLgrForCompletions::RicfCreateLgrForCompletions()
|
RicfCreateLgrForCompletions::RicfCreateLgrForCompletions()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_timeStep, "timeStep", 0, "Time Step Index", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", 0, "Time Step Index", "", "", "" );
|
||||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||||
RICF_InitField( &m_refinementI, "refinementI", -1, "RefinementI", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_refinementI, "refinementI", -1, "RefinementI", "", "", "" );
|
||||||
RICF_InitField( &m_refinementJ, "refinementJ", -1, "RefinementJ", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_refinementJ, "refinementJ", -1, "RefinementJ", "", "", "" );
|
||||||
RICF_InitField( &m_refinementK, "refinementK", -1, "RefinementK", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_refinementK, "refinementK", -1, "RefinementK", "", "", "" );
|
||||||
RICF_InitField( &m_splitType, "splitType", Lgr::SplitTypeEnum(), "SplitType", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_splitType, "splitType", Lgr::SplitTypeEnum(), "SplitType", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
caf::PdmScriptResponse RicfCreateLgrForCompletions::execute()
|
||||||
{
|
{
|
||||||
using TOOLS = RicfApplicationTools;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -74,7 +76,7 @@ RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
|||||||
QString error = QString( "createLgrForCompletions: These well paths were not found: " ) +
|
QString error = QString( "createLgrForCompletions: These well paths were not found: " ) +
|
||||||
wellsNotFound.join( ", " );
|
wellsNotFound.join( ", " );
|
||||||
RiaLogging::error( error );
|
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" );
|
QString error( "No well paths found" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
|
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() ) );
|
QString error( QString( "createLgrForCompletions: Could not find case with ID %1" ).arg( m_caseId() ) );
|
||||||
RiaLogging::error( error );
|
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 );
|
feature->updateViews( eclipseCase );
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
if ( !wellsIntersectingOtherLgrs.empty() )
|
if ( !wellsIntersectingOtherLgrs.empty() )
|
||||||
{
|
{
|
||||||
auto wellsList = wellsIntersectingOtherLgrs.join( ", " );
|
auto wellsList = wellsIntersectingOtherLgrs.join( ", " );
|
||||||
@@ -130,7 +132,7 @@ RicfCommandResponse RicfCreateLgrForCompletions::execute()
|
|||||||
"LGR(s).Affected wells : " +
|
"LGR(s).Affected wells : " +
|
||||||
wellsList );
|
wellsList );
|
||||||
RiaLogging::warning( warning );
|
RiaLogging::warning( warning );
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class RicfCreateLgrForCompletions : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfCreateLgrForCompletions();
|
RicfCreateLgrForCompletions();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include "RiaWellNameComparer.h"
|
#include "RiaWellNameComparer.h"
|
||||||
|
|
||||||
#include "cafCmdFeatureManager.h"
|
#include "cafCmdFeatureManager.h"
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfCreateMultipleFractures, "createMultipleFractures" );
|
CAF_PDM_SOURCE_INIT( RicfCreateMultipleFractures, "createMultipleFractures" );
|
||||||
|
|
||||||
@@ -58,27 +59,27 @@ void AppEnum<MultipleFractures::Action>::setUp()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCreateMultipleFractures::RicfCreateMultipleFractures()
|
RicfCreateMultipleFractures::RicfCreateMultipleFractures()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||||
RICF_InitField( &m_minDistFromWellTd, "minDistFromWellTd", 100.0, "Min Distance From Well TD", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_minDistFromWellTd, "minDistFromWellTd", 100.0, "Min Distance From Well TD", "", "", "" );
|
||||||
RICF_InitField( &m_maxFracturesPerWell, "maxFracturesPerWell", 100, "Max Fractures per Well", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_maxFracturesPerWell, "maxFracturesPerWell", 100, "Max Fractures per Well", "", "", "" );
|
||||||
RICF_InitField( &m_templateId, "templateId", -1, "Template ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_templateId, "templateId", -1, "Template ID", "", "", "" );
|
||||||
RICF_InitField( &m_topLayer, "topLayer", -1, "Top Layer", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_topLayer, "topLayer", -1, "Top Layer", "", "", "" );
|
||||||
RICF_InitField( &m_baseLayer, "baseLayer", -1, "Base Layer", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_baseLayer, "baseLayer", -1, "Base Layer", "", "", "" );
|
||||||
RICF_InitField( &m_spacing, "spacing", 300.0, "Spacing", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_spacing, "spacing", 300.0, "Spacing", "", "", "" );
|
||||||
RICF_InitField( &m_action,
|
CAF_PDM_InitScriptableFieldWithIO( &m_action,
|
||||||
"action",
|
"action",
|
||||||
caf::AppEnum<MultipleFractures::Action>( MultipleFractures::APPEND_FRACTURES ),
|
caf::AppEnum<MultipleFractures::Action>( MultipleFractures::APPEND_FRACTURES ),
|
||||||
"Action",
|
"Action",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"" );
|
"" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfCreateMultipleFractures::execute()
|
caf::PdmScriptResponse RicfCreateMultipleFractures::execute()
|
||||||
{
|
{
|
||||||
using TOOLS = RicfApplicationTools;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -99,7 +100,7 @@ RicfCommandResponse RicfCreateMultipleFractures::execute()
|
|||||||
QString error =
|
QString error =
|
||||||
QString( "createMultipleFractures: These well paths were not found: %1" ).arg( wellsNotFound.join( ", " ) );
|
QString( "createMultipleFractures: These well paths were not found: %1" ).arg( wellsNotFound.join( ", " ) );
|
||||||
RiaLogging::error( error );
|
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 );
|
QString error = QString( "createMultipleFractures: Could not find case with ID %1" ).arg( m_caseId );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !fractureTemplate )
|
if ( !fractureTemplate )
|
||||||
@@ -115,21 +116,21 @@ RicfCommandResponse RicfCreateMultipleFractures::execute()
|
|||||||
QString error =
|
QString error =
|
||||||
QString( "createMultipleFractures: Could not find fracture template with ID %1" ).arg( m_templateId );
|
QString( "createMultipleFractures: Could not find fracture template with ID %1" ).arg( m_templateId );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( wellPaths.empty() )
|
if ( wellPaths.empty() )
|
||||||
{
|
{
|
||||||
QString error( "createMultipleFractures: No wellpaths found" );
|
QString error( "createMultipleFractures: No wellpaths found" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !validateArguments() )
|
if ( !validateArguments() )
|
||||||
{
|
{
|
||||||
QString error( "createMultipleFractures: Mandatory argument(s) missing" );
|
QString error( "createMultipleFractures: Mandatory argument(s) missing" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RicCreateMultipleFracturesOptionItemUi* options = new RicCreateMultipleFracturesOptionItemUi();
|
RicCreateMultipleFracturesOptionItemUi* options = new RicCreateMultipleFracturesOptionItemUi();
|
||||||
@@ -163,7 +164,7 @@ RicfCommandResponse RicfCreateMultipleFractures::execute()
|
|||||||
if ( m_action == MultipleFractures::APPEND_FRACTURES ) feature->appendFractures();
|
if ( m_action == MultipleFractures::APPEND_FRACTURES ) feature->appendFractures();
|
||||||
if ( m_action == MultipleFractures::REPLACE_FRACTURES ) feature->replaceFractures();
|
if ( m_action == MultipleFractures::REPLACE_FRACTURES ) feature->replaceFractures();
|
||||||
}
|
}
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class RicfCreateMultipleFractures : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfCreateMultipleFractures();
|
RicfCreateMultipleFractures();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool validateArguments() const;
|
bool validateArguments() const;
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSaturationPressurePlotCollection.h"
|
#include "RimSaturationPressurePlotCollection.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfCreateSaturationPressurePlots, "createSaturationPressurePlots" );
|
CAF_PDM_SOURCE_INIT( RicfCreateSaturationPressurePlots, "createSaturationPressurePlots" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -36,13 +38,13 @@ CAF_PDM_SOURCE_INIT( RicfCreateSaturationPressurePlots, "createSaturationPressur
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCreateSaturationPressurePlots::RicfCreateSaturationPressurePlots()
|
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();
|
std::vector<int> caseIds = m_caseIds();
|
||||||
if ( caseIds.empty() )
|
if ( caseIds.empty() )
|
||||||
@@ -62,7 +64,7 @@ RicfCommandResponse RicfCreateSaturationPressurePlots::execute()
|
|||||||
{
|
{
|
||||||
QString error( "createSaturationPressurePlots: No cases found" );
|
QString error( "createSaturationPressurePlots: No cases found" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RimProject* project = RiaApplication::instance()->project();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
@@ -70,7 +72,7 @@ RicfCommandResponse RicfCreateSaturationPressurePlots::execute()
|
|||||||
{
|
{
|
||||||
QString error( "No project loaded" );
|
QString error( "No project loaded" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
auto eclipeCases = project->eclipseCases();
|
auto eclipeCases = project->eclipseCases();
|
||||||
@@ -93,5 +95,5 @@ RicfCommandResponse RicfCreateSaturationPressurePlots::execute()
|
|||||||
collection->updateAllRequiredEditors();
|
collection->updateAllRequiredEditors();
|
||||||
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||||
|
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ class RicfCreateSaturationPressurePlots : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfCreateSaturationPressurePlots();
|
RicfCreateSaturationPressurePlots();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<std::vector<int>> m_caseIds;
|
caf::PdmField<std::vector<int>> m_caseIds;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "Riu3DMainWindowTools.h"
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@@ -49,13 +50,13 @@ CAF_PDM_SOURCE_INIT( RicfCreateStatisticsCase, "createStatisticsCase" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCreateStatisticsCase::RicfCreateStatisticsCase()
|
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();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
|
|
||||||
@@ -68,10 +69,10 @@ RicfCommandResponse RicfCreateStatisticsCase::execute()
|
|||||||
RimEclipseStatisticsCase* createdObject = gridCaseGroup->createAndAppendStatisticsCase();
|
RimEclipseStatisticsCase* createdObject = gridCaseGroup->createAndAppendStatisticsCase();
|
||||||
project->assignCaseIdToCase( createdObject );
|
project->assignCaseIdToCase( createdObject );
|
||||||
gridCaseGroup->updateConnectedEditors();
|
gridCaseGroup->updateConnectedEditors();
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
response.setResult( new RicfCreateStatisticsCaseResult( createdObject->caseId() ) );
|
response.setResult( new RicfCreateStatisticsCaseResult( createdObject->caseId() ) );
|
||||||
return response;
|
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:
|
public:
|
||||||
RicfCreateStatisticsCase();
|
RicfCreateStatisticsCase();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseGroupId;
|
caf::PdmField<int> m_caseGroupId;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "Riu3DMainWindowTools.h"
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@@ -34,13 +35,13 @@ CAF_PDM_SOURCE_INIT( RicfCreateView, "createView" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCreateView::RicfCreateView()
|
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();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
std::vector<RimCase*> allCases;
|
std::vector<RimCase*> allCases;
|
||||||
@@ -72,7 +73,7 @@ RicfCommandResponse RicfCreateView::execute()
|
|||||||
|
|
||||||
if ( viewId >= 0 )
|
if ( viewId >= 0 )
|
||||||
{
|
{
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
response.setResult( new RicfCreateViewResult( viewId ) );
|
response.setResult( new RicfCreateViewResult( viewId ) );
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -81,5 +82,5 @@ RicfCommandResponse RicfCreateView::execute()
|
|||||||
|
|
||||||
QString error = QString( "createView: Could not create view for case id %1" ).arg( m_caseId() );
|
QString error = QString( "createView: Could not create view for case id %1" ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
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:
|
public:
|
||||||
RicfCreateView();
|
RicfCreateView();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#include "RimWellBoreStabilityPlot.h"
|
#include "RimWellBoreStabilityPlot.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfCreateWbsPlotResult, "createWbsPlotResult" );
|
CAF_PDM_SOURCE_INIT( RicfCreateWbsPlotResult, "createWbsPlotResult" );
|
||||||
@@ -49,9 +51,9 @@ CAF_PDM_SOURCE_INIT( RicfCreateWellBoreStabilityPlotFeature, "createWellBoreStab
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCreateWellBoreStabilityPlotFeature::RicfCreateWellBoreStabilityPlotFeature()
|
RicfCreateWellBoreStabilityPlotFeature::RicfCreateWellBoreStabilityPlotFeature()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "GeoMech Case Id", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "GeoMech Case Id", "", "", "" );
|
||||||
RICF_InitField( &m_wellPath, "wellPath", QString( "" ), "Well Path", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_wellPath, "wellPath", QString( "" ), "Well Path", "", "", "" );
|
||||||
RICF_InitField( &m_timeStep, "timeStep", -1, "Time Step", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", -1, "Time Step", "", "", "" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_wbsParameters, "wbsParameters", "WbsParameters", "", "", "" );
|
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();
|
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" )
|
QString error = QString( "The well path %1 has no geometry. Cannot create a Well Bore Stability Plot" )
|
||||||
.arg( chosenWellPath->name() );
|
.arg( chosenWellPath->name() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RimWellBoreStabilityPlot* wbsPlot =
|
RimWellBoreStabilityPlot* wbsPlot =
|
||||||
RicNewWellBoreStabilityPlotFeature::createPlot( chosenCase, chosenWellPath, m_timeStep(), m_wbsParameters() );
|
RicNewWellBoreStabilityPlotFeature::createPlot( chosenCase, chosenWellPath, m_timeStep(), m_wbsParameters() );
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
response.setResult( new RicfCreateWbsPlotResult( wbsPlot->id() ) );
|
response.setResult( new RicfCreateWbsPlotResult( wbsPlot->id() ) );
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString error = QString( "createWellBoreStabilityPlot: Could not find GeoMech case with id %1" ).arg( m_caseId() );
|
QString error = QString( "createWellBoreStabilityPlot: Could not find GeoMech case with id %1" ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
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:
|
public:
|
||||||
RicfCreateWellBoreStabilityPlotFeature();
|
RicfCreateWellBoreStabilityPlotFeature();
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
@@ -40,19 +42,19 @@ CAF_PDM_SOURCE_INIT( RicfExportFlowCharacteristics, "exportFlowCharacteristics"
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportFlowCharacteristics::RicfExportFlowCharacteristics()
|
RicfExportFlowCharacteristics::RicfExportFlowCharacteristics()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_selectedTimeSteps, "timeSteps", std::vector<int>(), "Selected Time Steps", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_selectedTimeSteps, "timeSteps", std::vector<int>(), "Selected Time Steps", "", "", "" );
|
||||||
RICF_InitField( &m_injectors, "injectors", std::vector<QString>(), "Injectors", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_injectors, "injectors", std::vector<QString>(), "Injectors", "", "", "" );
|
||||||
RICF_InitField( &m_producers, "producers", std::vector<QString>(), "Producers", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_producers, "producers", std::vector<QString>(), "Producers", "", "", "" );
|
||||||
RICF_InitField( &m_fileName, "fileName", QString(), "Export File Name", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_fileName, "fileName", QString(), "Export File Name", "", "", "" );
|
||||||
RICF_InitField( &m_minCommunication, "minimumCommunication", 0.0, "Minimum Communication", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_minCommunication, "minimumCommunication", 0.0, "Minimum Communication", "", "", "" );
|
||||||
RICF_InitField( &m_maxPvFraction, "aquiferCellThreshold", 0.1, "Aquifer Cell Threshold", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_maxPvFraction, "aquiferCellThreshold", 0.1, "Aquifer Cell Threshold", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfExportFlowCharacteristics::execute()
|
caf::PdmScriptResponse RicfExportFlowCharacteristics::execute()
|
||||||
{
|
{
|
||||||
using TOOLS = RicfApplicationTools;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -61,7 +63,7 @@ RicfCommandResponse RicfExportFlowCharacteristics::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "exportFlowCharacteristics: Could not find case with ID %1." ).arg( m_caseId() );
|
QString error = QString( "exportFlowCharacteristics: Could not find case with ID %1." ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
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( "." ) )
|
if ( !exportDir.mkpath( "." ) )
|
||||||
{
|
{
|
||||||
QString msg = QString( "Failed to create folder - %1" ).arg( exportFolder );
|
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
|
else
|
||||||
{
|
{
|
||||||
QString msg = QString( "Failed to export file - %1" ).arg( exportFileName );
|
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:
|
public:
|
||||||
RicfExportFlowCharacteristics();
|
RicfExportFlowCharacteristics();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -36,6 +36,8 @@
|
|||||||
#include "RiaWellNameComparer.h"
|
#include "RiaWellNameComparer.h"
|
||||||
|
|
||||||
#include "cafCmdFeatureManager.h"
|
#include "cafCmdFeatureManager.h"
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfExportLgrForCompletions, "exportLgrForCompletions" );
|
CAF_PDM_SOURCE_INIT( RicfExportLgrForCompletions, "exportLgrForCompletions" );
|
||||||
@@ -45,19 +47,19 @@ CAF_PDM_SOURCE_INIT( RicfExportLgrForCompletions, "exportLgrForCompletions" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportLgrForCompletions::RicfExportLgrForCompletions()
|
RicfExportLgrForCompletions::RicfExportLgrForCompletions()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||||
RICF_InitField( &m_refinementI, "refinementI", -1, "RefinementI", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_refinementI, "refinementI", -1, "RefinementI", "", "", "" );
|
||||||
RICF_InitField( &m_refinementJ, "refinementJ", -1, "RefinementJ", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_refinementJ, "refinementJ", -1, "RefinementJ", "", "", "" );
|
||||||
RICF_InitField( &m_refinementK, "refinementK", -1, "RefinementK", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_refinementK, "refinementK", -1, "RefinementK", "", "", "" );
|
||||||
RICF_InitField( &m_splitType, "splitType", Lgr::SplitTypeEnum(), "SplitType", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_splitType, "splitType", Lgr::SplitTypeEnum(), "SplitType", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfExportLgrForCompletions::execute()
|
caf::PdmScriptResponse RicfExportLgrForCompletions::execute()
|
||||||
{
|
{
|
||||||
using TOOLS = RicfApplicationTools;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -72,7 +74,7 @@ RicfCommandResponse RicfExportLgrForCompletions::execute()
|
|||||||
QString error( QString( "exportLgrForCompletions: These well paths were not found: " ) +
|
QString error( QString( "exportLgrForCompletions: These well paths were not found: " ) +
|
||||||
wellsNotFound.join( ", " ) );
|
wellsNotFound.join( ", " ) );
|
||||||
RiaLogging::error( error );
|
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" );
|
QString error( "exportLgrForCompletions: Could not find any well paths" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::LGRS );
|
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() ) );
|
QString error( QString( "exportLgrForCompletions: Could not find case with ID %1" ).arg( m_caseId() ) );
|
||||||
RiaLogging::error( error );
|
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 );
|
caf::VecIjk lgrCellCounts( m_refinementI, m_refinementJ, m_refinementK );
|
||||||
@@ -112,7 +114,7 @@ RicfCommandResponse RicfExportLgrForCompletions::execute()
|
|||||||
{RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES},
|
{RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES},
|
||||||
&wellsIntersectingOtherLgrs );
|
&wellsIntersectingOtherLgrs );
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
if ( !wellsIntersectingOtherLgrs.empty() )
|
if ( !wellsIntersectingOtherLgrs.empty() )
|
||||||
{
|
{
|
||||||
auto wellsList = wellsIntersectingOtherLgrs.join( ", " );
|
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 : " +
|
"exportLgrForCompletions: No export for some wells due to existing intersecting LGR(s).Affected wells : " +
|
||||||
wellsList );
|
wellsList );
|
||||||
RiaLogging::warning( warning );
|
RiaLogging::warning( warning );
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class RicfExportLgrForCompletions : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfExportLgrForCompletions();
|
RicfExportLgrForCompletions();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -36,6 +36,8 @@
|
|||||||
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
|
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
|
||||||
#include "CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h"
|
#include "CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfExportMsw, "exportMsw" );
|
CAF_PDM_SOURCE_INIT( RicfExportMsw, "exportMsw" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -43,18 +45,24 @@ CAF_PDM_SOURCE_INIT( RicfExportMsw, "exportMsw" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportMsw::RicfExportMsw()
|
RicfExportMsw::RicfExportMsw()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_wellPathName, "wellPath", QString(), "Well Path Name", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathName, "wellPath", QString(), "Well Path Name", "", "", "" );
|
||||||
RICF_InitField( &m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "" );
|
||||||
RICF_InitField( &m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "" );
|
||||||
RICF_InitField( &m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "" );
|
||||||
RICF_InitField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_fileSplit,
|
||||||
|
"fileSplit",
|
||||||
|
RicExportCompletionDataSettingsUi::ExportSplitType(),
|
||||||
|
"File Split",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfExportMsw::execute()
|
caf::PdmScriptResponse RicfExportMsw::execute()
|
||||||
{
|
{
|
||||||
using TOOLS = RicfApplicationTools;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -65,7 +73,7 @@ RicfCommandResponse RicfExportMsw::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "exportMsw: Could not find case with ID %1." ).arg( m_caseId() );
|
QString error = QString( "exportMsw: Could not find case with ID %1." ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::COMPLETIONS );
|
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() );
|
QString error = QString( "exportMsw: Could not find well path with name %1" ).arg( m_wellPathName() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( exportSettings, {wellPath} );
|
RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( exportSettings, {wellPath} );
|
||||||
|
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class RicfExportMsw : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfExportMsw();
|
RicfExportMsw();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
@@ -45,4 +45,4 @@ private:
|
|||||||
caf::PdmField<bool> m_includeFishbones;
|
caf::PdmField<bool> m_includeFishbones;
|
||||||
caf::PdmField<bool> m_includeFractures;
|
caf::PdmField<bool> m_includeFractures;
|
||||||
caf::PdmField<RicExportCompletionDataSettingsUi::ExportSplitType> m_fileSplit;
|
caf::PdmField<RicExportCompletionDataSettingsUi::ExportSplitType> m_fileSplit;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaProjectModifier.h"
|
#include "RiaProjectModifier.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfExportMultiCaseSnapshots, "exportMultiCaseSnapshots" );
|
CAF_PDM_SOURCE_INIT( RicfExportMultiCaseSnapshots, "exportMultiCaseSnapshots" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -31,26 +33,26 @@ CAF_PDM_SOURCE_INIT( RicfExportMultiCaseSnapshots, "exportMultiCaseSnapshots" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportMultiCaseSnapshots::RicfExportMultiCaseSnapshots()
|
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();
|
RiaGuiApplication* app = RiaGuiApplication::instance();
|
||||||
if ( !app )
|
if ( !app )
|
||||||
{
|
{
|
||||||
QString error( "exportMultiCaseSnapshots: Requires GUI Application" );
|
QString error( "exportMultiCaseSnapshots: Requires GUI Application" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
if ( m_gridListFile().isNull() )
|
if ( m_gridListFile().isNull() )
|
||||||
{
|
{
|
||||||
QString error( "exportMultiCaseSnapshots: Required parameter gridListFile." );
|
QString error( "exportMultiCaseSnapshots: Required parameter gridListFile." );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
||||||
@@ -59,7 +61,7 @@ RicfCommandResponse RicfExportMultiCaseSnapshots::execute()
|
|||||||
QString error( "exportMultiCaseSnapshots: 'openProject' must be called before 'exportMultiCaseSnapshots' to "
|
QString error( "exportMultiCaseSnapshots: 'openProject' must be called before 'exportMultiCaseSnapshots' to "
|
||||||
"specify project file to replace cases in." );
|
"specify project file to replace cases in." );
|
||||||
RiaLogging::error( error );
|
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() );
|
std::vector<QString> listFileNames = RiaApplication::readFileListFromTextFile( m_gridListFile() );
|
||||||
@@ -67,5 +69,5 @@ RicfCommandResponse RicfExportMultiCaseSnapshots::execute()
|
|||||||
listFileNames,
|
listFileNames,
|
||||||
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::SNAPSHOTS ) );
|
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::SNAPSHOTS ) );
|
||||||
|
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class RicfExportMultiCaseSnapshots : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfExportMultiCaseSnapshots();
|
RicfExportMultiCaseSnapshots();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_gridListFile;
|
caf::PdmField<QString> m_gridListFile;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -47,19 +48,19 @@ CAF_PDM_SOURCE_INIT( RicfExportProperty, "exportProperty" );
|
|||||||
RicfExportProperty::RicfExportProperty()
|
RicfExportProperty::RicfExportProperty()
|
||||||
{
|
{
|
||||||
// clang-format off
|
// clang-format off
|
||||||
RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_caseId, "caseId", -1, "Case ID", "", "", "");
|
||||||
RICF_InitField(&m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", "");
|
||||||
RICF_InitField(&m_propertyName, "property", QString(), "Property Name", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_propertyName, "property", QString(), "Property Name", "", "", "");
|
||||||
RICF_InitField(&m_eclipseKeyword, "eclipseKeyword", QString(), "Eclipse Keyword", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_eclipseKeyword, "eclipseKeyword", QString(), "Eclipse Keyword", "", "", "");
|
||||||
RICF_InitField(&m_undefinedValue, "undefinedValue", 0.0, "Undefined Value", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_undefinedValue, "undefinedValue", 0.0, "Undefined Value", "", "", "");
|
||||||
RICF_InitField(&m_exportFileName, "exportFile", QString(), "Export FileName", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_exportFileName, "exportFile", QString(), "Export FileName", "", "", "");
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfExportProperty::execute()
|
caf::PdmScriptResponse RicfExportProperty::execute()
|
||||||
{
|
{
|
||||||
using TOOLS = RicfApplicationTools;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ RicfCommandResponse RicfExportProperty::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "exportProperty: Could not find case with ID %1" ).arg( m_caseId() );
|
QString error = QString( "exportProperty: Could not find case with ID %1" ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !eclipseCase->eclipseCaseData() )
|
if ( !eclipseCase->eclipseCaseData() )
|
||||||
@@ -78,7 +79,7 @@ RicfCommandResponse RicfExportProperty::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "exportProperty: Could not find eclipseCaseData with ID %1" ).arg( m_caseId() );
|
QString error = QString( "exportProperty: Could not find eclipseCaseData with ID %1" ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
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() );
|
QString error = QString( "exportProperty: Could not find result property : %1" ).arg( m_propertyName() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString filePath = m_exportFileName;
|
QString filePath = m_exportFileName;
|
||||||
@@ -118,8 +119,8 @@ RicfCommandResponse RicfExportProperty::execute()
|
|||||||
m_undefinedValue,
|
m_undefinedValue,
|
||||||
&errMsg ) )
|
&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:
|
public:
|
||||||
RicfExportProperty();
|
RicfExportProperty();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@@ -47,16 +48,16 @@ CAF_PDM_SOURCE_INIT( RicfExportPropertyInViews, "exportPropertyInViews" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportPropertyInViews::RicfExportPropertyInViews()
|
RicfExportPropertyInViews::RicfExportPropertyInViews()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_viewIds, "viewIds", std::vector<int>(), "View IDs", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewIds, "viewIds", std::vector<int>(), "View IDs", "", "", "" );
|
||||||
RICF_InitField( &m_viewNames, "viewNames", std::vector<QString>(), "View Names", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewNames, "viewNames", std::vector<QString>(), "View Names", "", "", "" );
|
||||||
RICF_InitField( &m_undefinedValue, "undefinedValue", 0.0, "Undefined Value", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_undefinedValue, "undefinedValue", 0.0, "Undefined Value", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfExportPropertyInViews::execute()
|
caf::PdmScriptResponse RicfExportPropertyInViews::execute()
|
||||||
{
|
{
|
||||||
using TOOLS = RicfApplicationTools;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ RicfCommandResponse RicfExportPropertyInViews::execute()
|
|||||||
{
|
{
|
||||||
QString error( QString( "exportProperty: Could not find case with ID %1" ).arg( m_caseId() ) );
|
QString error( QString( "exportProperty: Could not find case with ID %1" ).arg( m_caseId() ) );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<RimEclipseView*> viewsForExport;
|
std::vector<RimEclipseView*> viewsForExport;
|
||||||
@@ -110,7 +111,7 @@ RicfCommandResponse RicfExportPropertyInViews::execute()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
|
|
||||||
for ( const auto& view : viewsForExport )
|
for ( const auto& view : viewsForExport )
|
||||||
{
|
{
|
||||||
@@ -134,7 +135,7 @@ RicfCommandResponse RicfExportPropertyInViews::execute()
|
|||||||
.arg( view->currentTimeStep() )
|
.arg( view->currentTimeStep() )
|
||||||
.arg( propertyName );
|
.arg( propertyName );
|
||||||
RiaLogging::warning( warning );
|
RiaLogging::warning( warning );
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warning );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +161,7 @@ RicfCommandResponse RicfExportPropertyInViews::execute()
|
|||||||
&errorMsg );
|
&errorMsg );
|
||||||
if ( !worked )
|
if ( !worked )
|
||||||
{
|
{
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errorMsg );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errorMsg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class RicfExportPropertyInViews : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfExportPropertyInViews();
|
RicfExportPropertyInViews();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
|
|
||||||
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfExportSimWellFractureCompletions, "exportSimWellFractureCompletions" );
|
CAF_PDM_SOURCE_INIT( RicfExportSimWellFractureCompletions, "exportSimWellFractureCompletions" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -44,25 +46,37 @@ CAF_PDM_SOURCE_INIT( RicfExportSimWellFractureCompletions, "exportSimWellFractur
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportSimWellFractureCompletions::RicfExportSimWellFractureCompletions()
|
RicfExportSimWellFractureCompletions::RicfExportSimWellFractureCompletions()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||||
RICF_InitField( &m_viewName, "viewName", QString( "" ), "View Name", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewName, "viewName", QString( "" ), "View Name", "", "", "" );
|
||||||
RICF_InitField( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||||
RICF_InitField( &m_simWellNames, "simulationWellNames", std::vector<QString>(), "Simulation Well Names", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_simWellNames,
|
||||||
RICF_InitField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split", "", "", "" );
|
"simulationWellNames",
|
||||||
RICF_InitField( &m_compdatExport,
|
std::vector<QString>(),
|
||||||
"compdatExport",
|
"Simulation Well Names",
|
||||||
RicExportCompletionDataSettingsUi::CompdatExportType(),
|
"",
|
||||||
"Compdat Export",
|
"",
|
||||||
"",
|
"" );
|
||||||
"",
|
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;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -79,7 +93,7 @@ RicfCommandResponse RicfExportSimWellFractureCompletions::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "exportSimWellCompletions: Could not find case with ID %1" ).arg( m_caseId() );
|
QString error = QString( "exportSimWellCompletions: Could not find case with ID %1" ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
exportSettings->caseToApply = eclipseCase;
|
exportSettings->caseToApply = eclipseCase;
|
||||||
}
|
}
|
||||||
@@ -108,10 +122,10 @@ RicfCommandResponse RicfExportSimWellFractureCompletions::execute()
|
|||||||
.arg( m_viewName )
|
.arg( m_viewName )
|
||||||
.arg( m_caseId() );
|
.arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
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;
|
std::vector<RimSimWellInView*> simWells;
|
||||||
if ( m_simWellNames().empty() )
|
if ( m_simWellNames().empty() )
|
||||||
@@ -146,7 +160,7 @@ RicfCommandResponse RicfExportSimWellFractureCompletions::execute()
|
|||||||
.arg( m_viewName )
|
.arg( m_viewName )
|
||||||
.arg( m_caseId() );
|
.arg( m_caseId() );
|
||||||
RiaLogging::warning( warning );
|
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:
|
public:
|
||||||
RicfExportSimWellFractureCompletions();
|
RicfExportSimWellFractureCompletions();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfExportSnapshots, "exportSnapshots" );
|
CAF_PDM_SOURCE_INIT( RicfExportSnapshots, "exportSnapshots" );
|
||||||
@@ -58,24 +60,24 @@ void RicfExportSnapshots::SnapshotsTypeEnum::setUp()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportSnapshots::RicfExportSnapshots()
|
RicfExportSnapshots::RicfExportSnapshots()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_type, "type", RicfExportSnapshots::SnapshotsTypeEnum(), "Type", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_type, "type", RicfExportSnapshots::SnapshotsTypeEnum(), "Type", "", "", "" );
|
||||||
RICF_InitField( &m_prefix, "prefix", QString(), "Prefix", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_prefix, "prefix", QString(), "Prefix", "", "", "" );
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case Id", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case Id", "", "", "" );
|
||||||
RICF_InitField( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
||||||
RICF_InitField( &m_exportFolder, "exportFolder", QString(), "Export Folder", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_exportFolder, "exportFolder", QString(), "Export Folder", "", "", "" );
|
||||||
RICF_InitFieldNoDefault( &m_plotOutputFormat, "plotOutputFormat", "Output Format", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_plotOutputFormat, "plotOutputFormat", "Output Format", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfExportSnapshots::execute()
|
caf::PdmScriptResponse RicfExportSnapshots::execute()
|
||||||
{
|
{
|
||||||
if ( !RiaGuiApplication::isRunning() )
|
if ( !RiaGuiApplication::isRunning() )
|
||||||
{
|
{
|
||||||
QString error( "RicfExportSnapshot: Command cannot run without a GUI" );
|
QString error( "RicfExportSnapshot: Command cannot run without a GUI" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||||
@@ -129,5 +131,5 @@ RicfCommandResponse RicfExportSnapshots::execute()
|
|||||||
mainWnd->loadWinGeoAndDockToolBarLayout();
|
mainWnd->loadWinGeoAndDockToolBarLayout();
|
||||||
RiaGuiApplication::instance()->processEvents();
|
RiaGuiApplication::instance()->processEvents();
|
||||||
|
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
RicfExportSnapshots();
|
RicfExportSnapshots();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<SnapshotsTypeEnum> m_type;
|
caf::PdmField<SnapshotsTypeEnum> m_type;
|
||||||
|
|||||||
@@ -38,8 +38,7 @@
|
|||||||
|
|
||||||
#include "RifEclipseInputFileTools.h"
|
#include "RifEclipseInputFileTools.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <cafUtils.h>
|
#include <cafUtils.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -63,31 +62,43 @@ void AppEnum<RicfExportVisibleCells::ExportKeyword>::setUp()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportVisibleCells::RicfExportVisibleCells()
|
RicfExportVisibleCells::RicfExportVisibleCells()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||||
RICF_InitField( &m_viewName, "viewName", QString(), "View Name", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewName, "viewName", QString(), "View Name", "", "", "" );
|
||||||
RICF_InitField( &m_exportKeyword,
|
CAF_PDM_InitScriptableFieldWithIO( &m_exportKeyword,
|
||||||
"exportKeyword",
|
"exportKeyword",
|
||||||
caf::AppEnum<RicfExportVisibleCells::ExportKeyword>(),
|
caf::AppEnum<RicfExportVisibleCells::ExportKeyword>(),
|
||||||
"Export Keyword",
|
"Export Keyword",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"" );
|
"" );
|
||||||
RICF_InitField( &m_visibleActiveCellsValue, "visibleActiveCellsValue", 1, "Visible Active Cells Value", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_visibleActiveCellsValue,
|
||||||
RICF_InitField( &m_hiddenActiveCellsValue, "hiddenActiveCellsValue", 0, "Hidden Active Cells Value", "", "", "" );
|
"visibleActiveCellsValue",
|
||||||
RICF_InitField( &m_inactiveCellsValue, "inactiveCellsValue", 0, "Inactive Cells Value", "", "", "" );
|
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 ) )
|
if ( m_caseId < 0 || ( m_viewName().isEmpty() && m_viewId() < 0 ) )
|
||||||
{
|
{
|
||||||
QString error( "exportVisibleCells: CaseId or view name or view id not specified" );
|
QString error( "exportVisibleCells: CaseId or view name or view id not specified" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
RimEclipseView* eclipseView = nullptr;
|
RimEclipseView* eclipseView = nullptr;
|
||||||
if ( m_viewId() >= 0 )
|
if ( m_viewId() >= 0 )
|
||||||
@@ -105,7 +116,7 @@ RicfCommandResponse RicfExportVisibleCells::execute()
|
|||||||
.arg( m_viewName )
|
.arg( m_viewName )
|
||||||
.arg( m_caseId ) );
|
.arg( m_caseId ) );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::CELLS );
|
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::CELLS );
|
||||||
@@ -120,7 +131,7 @@ RicfCommandResponse RicfExportVisibleCells::execute()
|
|||||||
buildExportSettings( exportFolder, &exportSettings );
|
buildExportSettings( exportFolder, &exportSettings );
|
||||||
RicSaveEclipseInputVisibleCellsFeature::executeCommand( eclipseView, exportSettings, "exportVisibleCells" );
|
RicSaveEclipseInputVisibleCellsFeature::executeCommand( eclipseView, exportSettings, "exportVisibleCells" );
|
||||||
|
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class RicfExportVisibleCells : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfExportVisibleCells();
|
RicfExportVisibleCells();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void buildExportSettings( const QString& exportFolder, RicSaveEclipseInputVisibleCellsUi* exportSettings );
|
void buildExportSettings( const QString& exportFolder, RicSaveEclipseInputVisibleCellsUi* exportSettings );
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimWellLogPlot.h"
|
#include "RimWellLogPlot.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@@ -59,24 +61,24 @@ CAF_PDM_SOURCE_INIT( RicfExportWellLogPlotData, "exportWellLogPlotData" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportWellLogPlotData::RicfExportWellLogPlotData()
|
RicfExportWellLogPlotData::RicfExportWellLogPlotData()
|
||||||
{
|
{
|
||||||
RICF_InitFieldNoDefault( &m_format, "exportFormat", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_format, "exportFormat", "", "", "", "" );
|
||||||
RICF_InitField( &m_viewId, "viewId", -1, "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "", "", "", "" );
|
||||||
RICF_InitField( &m_folder, "exportFolder", QString(), "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_folder, "exportFolder", QString(), "", "", "", "" );
|
||||||
RICF_InitField( &m_filePrefix, "filePrefix", QString(), "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_filePrefix, "filePrefix", QString(), "", "", "", "" );
|
||||||
RICF_InitField( &m_exportTvdRkb, "exportTvdRkb", false, "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_exportTvdRkb, "exportTvdRkb", false, "", "", "", "" );
|
||||||
RICF_InitField( &m_capitalizeFileNames, "capitalizeFileNames", false, "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_capitalizeFileNames, "capitalizeFileNames", false, "", "", "", "" );
|
||||||
RICF_InitField( &m_resampleInterval, "resampleInterval", 0.0, "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_resampleInterval, "resampleInterval", 0.0, "", "", "", "" );
|
||||||
RICF_InitField( &m_convertCurveUnits, "convertCurveUnits", false, "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_convertCurveUnits, "convertCurveUnits", false, "", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfExportWellLogPlotData::execute()
|
caf::PdmScriptResponse RicfExportWellLogPlotData::execute()
|
||||||
{
|
{
|
||||||
QStringList errorMessages;
|
QStringList errorMessages;
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
|
|
||||||
if ( QFileInfo::exists( m_folder ) )
|
if ( QFileInfo::exists( m_folder ) )
|
||||||
{
|
{
|
||||||
@@ -133,7 +135,7 @@ RicfCommandResponse RicfExportWellLogPlotData::execute()
|
|||||||
|
|
||||||
for ( QString errorMessage : errorMessages )
|
for ( QString errorMessage : errorMessages )
|
||||||
{
|
{
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
RicfExportWellLogPlotData();
|
RicfExportWellLogPlotData();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<ExportFormatEnum> m_format;
|
caf::PdmField<ExportFormatEnum> m_format;
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfExportWellPathCompletions, "exportWellPathCompletions" );
|
CAF_PDM_SOURCE_INIT( RicfExportWellPathCompletions, "exportWellPathCompletions" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -41,55 +43,79 @@ CAF_PDM_SOURCE_INIT( RicfExportWellPathCompletions, "exportWellPathCompletions"
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportWellPathCompletions::RicfExportWellPathCompletions()
|
RicfExportWellPathCompletions::RicfExportWellPathCompletions()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_timeStep, "timeStep", -1, "Time Step Index", "", "", "" );
|
||||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||||
|
|
||||||
RICF_InitField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_fileSplit,
|
||||||
RICF_InitField( &m_compdatExport,
|
"fileSplit",
|
||||||
"compdatExport",
|
RicExportCompletionDataSettingsUi::ExportSplitType(),
|
||||||
RicExportCompletionDataSettingsUi::CompdatExportType(),
|
"File Split",
|
||||||
"Compdat Export",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"" );
|
||||||
"" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_compdatExport,
|
||||||
RICF_InitField( &m_combinationMode,
|
"compdatExport",
|
||||||
"combinationMode",
|
RicExportCompletionDataSettingsUi::CompdatExportType(),
|
||||||
RicExportCompletionDataSettingsUi::CombinationModeType(),
|
"Compdat Export",
|
||||||
"Combination Mode",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"" );
|
||||||
"" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_combinationMode,
|
||||||
|
"combinationMode",
|
||||||
|
RicExportCompletionDataSettingsUi::CombinationModeType(),
|
||||||
|
"Combination Mode",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"" );
|
||||||
|
|
||||||
RICF_InitField( &m_useLateralNTG, "useNtgHorizontally", false, "Use NTG Horizontally", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_useLateralNTG, "useNtgHorizontally", false, "Use NTG Horizontally", "", "", "" );
|
||||||
RICF_InitField( &m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "" );
|
||||||
RICF_InitField( &m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "" );
|
||||||
RICF_InitField( &m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "" );
|
||||||
|
|
||||||
RICF_InitField( &m_excludeMainBoreForFishbones,
|
CAF_PDM_InitScriptableFieldWithIO( &m_excludeMainBoreForFishbones,
|
||||||
"excludeMainBoreForFishbones",
|
"excludeMainBoreForFishbones",
|
||||||
false,
|
false,
|
||||||
"Exclude Main Bore for Fishbones",
|
"Exclude Main Bore for Fishbones",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"" );
|
"" );
|
||||||
|
|
||||||
RICF_InitField( &m_performTransScaling, "performTransScaling", false, "Perform Transmissibility Scaling", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_performTransScaling,
|
||||||
RICF_InitField( &m_transScalingTimeStep, "transScalingTimeStep", 0, "Transmissibility Scaling Pressure Time Step", "", "", "" );
|
"performTransScaling",
|
||||||
RICF_InitField( &m_transScalingInitialWBHP,
|
false,
|
||||||
"transScalingWBHPFromSummary",
|
"Perform Transmissibility Scaling",
|
||||||
RicExportCompletionDataSettingsUi::TransScalingWBHPSource(),
|
"",
|
||||||
"Transmissibility Scaling WBHP from summary",
|
"",
|
||||||
"",
|
"" );
|
||||||
"",
|
CAF_PDM_InitScriptableFieldWithIO( &m_transScalingTimeStep,
|
||||||
"" );
|
"transScalingTimeStep",
|
||||||
RICF_InitField( &m_transScalingWBHP, "transScalingWBHP", 200.0, "Transmissibility Scaling Constant WBHP Value", "", "", "" );
|
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;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -127,7 +153,7 @@ RicfCommandResponse RicfExportWellPathCompletions::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "exportWellPathCompletions: Could not find case with ID %1" ).arg( m_caseId() );
|
QString error = QString( "exportWellPathCompletions: Could not find case with ID %1" ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
exportSettings->caseToApply = eclipseCase;
|
exportSettings->caseToApply = eclipseCase;
|
||||||
}
|
}
|
||||||
@@ -139,7 +165,7 @@ RicfCommandResponse RicfExportWellPathCompletions::execute()
|
|||||||
}
|
}
|
||||||
exportSettings->folder = exportFolder;
|
exportSettings->folder = exportFolder;
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
|
|
||||||
std::vector<RimWellPath*> wellPaths;
|
std::vector<RimWellPath*> wellPaths;
|
||||||
if ( m_wellPathNames().empty() )
|
if ( m_wellPathNames().empty() )
|
||||||
@@ -167,7 +193,7 @@ RicfCommandResponse RicfExportWellPathCompletions::execute()
|
|||||||
QString warning =
|
QString warning =
|
||||||
QString( "exportWellPathCompletions: Could not find well path with name %1" ).arg( wellPathName );
|
QString( "exportWellPathCompletions: Could not find well path with name %1" ).arg( wellPathName );
|
||||||
RiaLogging::warning( warning );
|
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:
|
public:
|
||||||
RicfExportWellPathCompletions();
|
RicfExportWellPathCompletions();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "RiaWellNameComparer.h"
|
#include "RiaWellNameComparer.h"
|
||||||
|
|
||||||
#include "cafCmdFeatureManager.h"
|
#include "cafCmdFeatureManager.h"
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfExportWellPaths, "exportWellPaths" );
|
CAF_PDM_SOURCE_INIT( RicfExportWellPaths, "exportWellPaths" );
|
||||||
|
|
||||||
@@ -44,14 +45,14 @@ CAF_PDM_SOURCE_INIT( RicfExportWellPaths, "exportWellPaths" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfExportWellPaths::RicfExportWellPaths()
|
RicfExportWellPaths::RicfExportWellPaths()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_wellPathNames, "wellPathNames", std::vector<QString>(), "Well Path Names", "", "", "" );
|
||||||
RICF_InitField( &m_mdStepSize, "mdStepSize", 5.0, "MD Step Size", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_mdStepSize, "mdStepSize", 5.0, "MD Step Size", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfExportWellPaths::execute()
|
caf::PdmScriptResponse RicfExportWellPaths::execute()
|
||||||
{
|
{
|
||||||
using TOOLS = RicfApplicationTools;
|
using TOOLS = RicfApplicationTools;
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ RicfCommandResponse RicfExportWellPaths::execute()
|
|||||||
QString error( QString( "exportWellPaths: These well paths were not found: " ) +
|
QString error( QString( "exportWellPaths: These well paths were not found: " ) +
|
||||||
wellsNotFound.join( ", " ) );
|
wellsNotFound.join( ", " ) );
|
||||||
RiaLogging::error( error );
|
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" );
|
QString error( "No well paths found" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::WELLPATHS );
|
QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::WELLPATHS );
|
||||||
@@ -94,5 +95,5 @@ RicfCommandResponse RicfExportWellPaths::execute()
|
|||||||
feature->exportWellPath( wellPath, m_mdStepSize, exportFolder, false );
|
feature->exportWellPath( wellPath, m_mdStepSize, exportFolder, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class RicfExportWellPaths : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfExportWellPaths();
|
RicfExportWellPaths();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<std::vector<QString>> m_wellPathNames;
|
caf::PdmField<std::vector<QString>> m_wellPathNames;
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#include "RimFormationNames.h"
|
#include "RimFormationNames.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfImportFormationNames, "importFormationNames" );
|
CAF_PDM_SOURCE_INIT( RicfImportFormationNames, "importFormationNames" );
|
||||||
@@ -33,14 +35,14 @@ CAF_PDM_SOURCE_INIT( RicfImportFormationNames, "importFormationNames" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfImportFormationNames::RicfImportFormationNames()
|
RicfImportFormationNames::RicfImportFormationNames()
|
||||||
{
|
{
|
||||||
RICF_InitFieldNoDefault( &m_formationFiles, "formationFiles", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_formationFiles, "formationFiles", "", "", "", "" );
|
||||||
RICF_InitField( &m_applyToCaseId, "applyToCaseId", -1, "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_applyToCaseId, "applyToCaseId", -1, "", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfImportFormationNames::execute()
|
caf::PdmScriptResponse RicfImportFormationNames::execute()
|
||||||
{
|
{
|
||||||
QStringList errorMessages, warningMessages;
|
QStringList errorMessages, warningMessages;
|
||||||
|
|
||||||
@@ -87,14 +89,14 @@ RicfCommandResponse RicfImportFormationNames::execute()
|
|||||||
errorMessages << "No formation files provided";
|
errorMessages << "No formation files provided";
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
for ( QString warningMessage : warningMessages )
|
for ( QString warningMessage : warningMessages )
|
||||||
{
|
{
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warningMessage );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warningMessage );
|
||||||
}
|
}
|
||||||
for ( QString errorMessage : errorMessages )
|
for ( QString errorMessage : errorMessages )
|
||||||
{
|
{
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class RicfImportFormationNames : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfImportFormationNames();
|
RicfImportFormationNames();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<std::vector<QString>> m_formationFiles;
|
caf::PdmField<std::vector<QString>> m_formationFiles;
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RimWellLogFile.h"
|
#include "RimWellLogFile.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@@ -44,11 +46,11 @@ CAF_PDM_SOURCE_INIT( RicfImportWellLogFiles, "importWellLogFiles" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfImportWellLogFiles::RicfImportWellLogFiles()
|
RicfImportWellLogFiles::RicfImportWellLogFiles()
|
||||||
{
|
{
|
||||||
RICF_InitFieldNoDefault( &m_wellLogFileFolder, "wellLogFolder", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_wellLogFileFolder, "wellLogFolder", "", "", "", "" );
|
||||||
RICF_InitFieldNoDefault( &m_wellLogFilePaths, "wellLogFiles", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_wellLogFilePaths, "wellLogFiles", "", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandResponse RicfImportWellLogFiles::execute()
|
caf::PdmScriptResponse RicfImportWellLogFiles::execute()
|
||||||
{
|
{
|
||||||
QStringList errorMessages, warningMessages;
|
QStringList errorMessages, warningMessages;
|
||||||
QStringList wellLogFilePaths;
|
QStringList wellLogFilePaths;
|
||||||
@@ -94,7 +96,7 @@ RicfCommandResponse RicfImportWellLogFiles::execute()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
|
|
||||||
if ( !wellLogFilePaths.empty() )
|
if ( !wellLogFilePaths.empty() )
|
||||||
{
|
{
|
||||||
@@ -117,12 +119,12 @@ RicfCommandResponse RicfImportWellLogFiles::execute()
|
|||||||
|
|
||||||
for ( QString warningMessage : warningMessages )
|
for ( QString warningMessage : warningMessages )
|
||||||
{
|
{
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warningMessage );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warningMessage );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( QString errorMessage : errorMessages )
|
for ( QString errorMessage : errorMessages )
|
||||||
{
|
{
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class RicfImportWellLogFiles : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfImportWellLogFiles();
|
RicfImportWellLogFiles();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_wellLogFileFolder;
|
caf::PdmField<QString> m_wellLogFileFolder;
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#include "RiaImportEclipseCaseTools.h"
|
#include "RiaImportEclipseCaseTools.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@@ -45,13 +47,13 @@ CAF_PDM_SOURCE_INIT( RicfLoadCase, "loadCase" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfLoadCase::RicfLoadCase()
|
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;
|
QString absolutePath = m_path;
|
||||||
QFileInfo projectPathInfo( absolutePath );
|
QFileInfo projectPathInfo( absolutePath );
|
||||||
@@ -67,10 +69,10 @@ RicfCommandResponse RicfLoadCase::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "loadCase: Unable to load case from %1" ).arg( absolutePath );
|
QString error = QString( "loadCase: Unable to load case from %1" ).arg( absolutePath );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
CAF_ASSERT( fileCaseIdMap.size() == 1u );
|
CAF_ASSERT( fileCaseIdMap.size() == 1u );
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
response.setResult( new RicfLoadCaseResult( fileCaseIdMap.begin()->second ) );
|
response.setResult( new RicfLoadCaseResult( fileCaseIdMap.begin()->second ) );
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class RicfLoadCase : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfLoadCase();
|
RicfLoadCase();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_path;
|
caf::PdmField<QString> m_path;
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
@@ -33,13 +35,13 @@ CAF_PDM_SOURCE_INIT( RicfOpenProject, "openProject" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfOpenProject::RicfOpenProject()
|
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;
|
QString projectPath = m_path;
|
||||||
QFileInfo projectPathInfo( projectPath );
|
QFileInfo projectPathInfo( projectPath );
|
||||||
@@ -53,10 +55,10 @@ RicfCommandResponse RicfOpenProject::execute()
|
|||||||
{
|
{
|
||||||
QString errMsg = QString( "openProject: Unable to open project at %1" ).arg( m_path() );
|
QString errMsg = QString( "openProject: Unable to open project at %1" ).arg( m_path() );
|
||||||
RiaLogging::error( errMsg );
|
RiaLogging::error( errMsg );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandFileExecutor::instance()->setLastProjectPath( projectPath );
|
RicfCommandFileExecutor::instance()->setLastProjectPath( projectPath );
|
||||||
|
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class RicfOpenProject : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfOpenProject();
|
RicfOpenProject();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_path;
|
caf::PdmField<QString> m_path;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
@@ -36,8 +38,8 @@ CAF_PDM_SOURCE_INIT( RicfSingleCaseReplace, "replaceCase" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfSingleCaseReplace::RicfSingleCaseReplace()
|
RicfSingleCaseReplace::RicfSingleCaseReplace()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_newGridFile, "newGridFile", QString(), "New Grid File", "", "", "" );
|
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();
|
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
||||||
if ( lastProjectPath.isNull() )
|
if ( lastProjectPath.isNull() )
|
||||||
@@ -67,7 +69,7 @@ RicfCommandResponse RicfSingleCaseReplace::execute()
|
|||||||
QString errMsg( "replaceCase: 'openProject' must be called before 'replaceCase' to specify project file to "
|
QString errMsg( "replaceCase: 'openProject' must be called before 'replaceCase' to specify project file to "
|
||||||
"replace case in." );
|
"replace case in." );
|
||||||
RiaLogging::error( errMsg );
|
RiaLogging::error( errMsg );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||||
}
|
}
|
||||||
|
|
||||||
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
||||||
@@ -93,10 +95,10 @@ RicfCommandResponse RicfSingleCaseReplace::execute()
|
|||||||
{
|
{
|
||||||
QString errMsg( "Could not reload project" );
|
QString errMsg( "Could not reload project" );
|
||||||
RiaLogging::error( errMsg );
|
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" );
|
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() )
|
if ( m_caseIdToGridFileNameMap.empty() )
|
||||||
{
|
{
|
||||||
QString errMsg( "replaceCaseImpl: No replacements available." );
|
QString errMsg( "replaceCaseImpl: No replacements available." );
|
||||||
RiaLogging::error( errMsg );
|
RiaLogging::error( errMsg );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
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 "
|
QString errMsg( "replaceCase: 'openProject' must be called before 'replaceCase' to specify project file to "
|
||||||
"replace case in." );
|
"replace case in." );
|
||||||
RiaLogging::error( errMsg );
|
RiaLogging::error( errMsg );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, errMsg );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
|
||||||
}
|
}
|
||||||
|
|
||||||
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
||||||
@@ -163,8 +165,8 @@ RicfCommandResponse RicfMultiCaseReplace::execute()
|
|||||||
{
|
{
|
||||||
QString errMsg( "Could not reload project" );
|
QString errMsg( "Could not reload project" );
|
||||||
RiaLogging::error( errMsg );
|
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;
|
int caseId() const;
|
||||||
QString filePath() const;
|
QString filePath() const;
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_newGridFile;
|
caf::PdmField<QString> m_newGridFile;
|
||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
void setCaseReplacePairs( const std::map<int, QString>& caseIdToGridFileNameMap );
|
void setCaseReplacePairs( const std::map<int, QString>& caseIdToGridFileNameMap );
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<int, QString> m_caseIdToGridFileNameMap;
|
std::map<int, QString> m_caseIdToGridFileNameMap;
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaProjectModifier.h"
|
#include "RiaProjectModifier.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfReplaceSourceCases, "replaceSourceCases" );
|
CAF_PDM_SOURCE_INIT( RicfReplaceSourceCases, "replaceSourceCases" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -31,20 +33,20 @@ CAF_PDM_SOURCE_INIT( RicfReplaceSourceCases, "replaceSourceCases" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfReplaceSourceCases::RicfReplaceSourceCases()
|
RicfReplaceSourceCases::RicfReplaceSourceCases()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseGroupId, "caseGroupId", -1, "Case Group ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseGroupId, "caseGroupId", -1, "Case Group ID", "", "", "" );
|
||||||
RICF_InitField( &m_gridListFile, "gridListFile", QString(), "Grid List File", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_gridListFile, "gridListFile", QString(), "Grid List File", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfReplaceSourceCases::execute()
|
caf::PdmScriptResponse RicfReplaceSourceCases::execute()
|
||||||
{
|
{
|
||||||
if ( m_gridListFile().isNull() )
|
if ( m_gridListFile().isNull() )
|
||||||
{
|
{
|
||||||
QString error( "replaceSourceCases: Required parameter gridListFile." );
|
QString error( "replaceSourceCases: Required parameter gridListFile." );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
QString lastProjectPath = RicfCommandFileExecutor::instance()->getLastProjectPath();
|
||||||
@@ -53,7 +55,7 @@ RicfCommandResponse RicfReplaceSourceCases::execute()
|
|||||||
QString error( "replaceSourceCases: 'openProject' must be called before 'replaceSourceCases' to specify "
|
QString error( "replaceSourceCases: 'openProject' must be called before 'replaceSourceCases' to specify "
|
||||||
"project file to replace cases in." );
|
"project file to replace cases in." );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
||||||
@@ -74,7 +76,7 @@ RicfCommandResponse RicfReplaceSourceCases::execute()
|
|||||||
{
|
{
|
||||||
QString error( "Could not reload project" );
|
QString error( "Could not reload project" );
|
||||||
RiaLogging::error( error );
|
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:
|
public:
|
||||||
RicfReplaceSourceCases();
|
RicfReplaceSourceCases();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_gridListFile;
|
caf::PdmField<QString> m_gridListFile;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfRunOctaveScript, "runOctaveScript" );
|
CAF_PDM_SOURCE_INIT( RicfRunOctaveScript, "runOctaveScript" );
|
||||||
@@ -35,14 +37,14 @@ CAF_PDM_SOURCE_INIT( RicfRunOctaveScript, "runOctaveScript" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfRunOctaveScript::RicfRunOctaveScript()
|
RicfRunOctaveScript::RicfRunOctaveScript()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_path, "path", QString(), "Path", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_path, "path", QString(), "Path", "", "", "" );
|
||||||
RICF_InitField( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfRunOctaveScript::execute()
|
caf::PdmScriptResponse RicfRunOctaveScript::execute()
|
||||||
{
|
{
|
||||||
QString octavePath = RiaApplication::instance()->octavePath();
|
QString octavePath = RiaApplication::instance()->octavePath();
|
||||||
|
|
||||||
@@ -77,12 +79,12 @@ RicfCommandResponse RicfRunOctaveScript::execute()
|
|||||||
RiaApplication::instance()->octaveProcessEnvironment() );
|
RiaApplication::instance()->octaveProcessEnvironment() );
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
{
|
{
|
||||||
QString error = QString( "runOctaveScript: Could not execute script %1" ).arg( m_path() );
|
QString error = QString( "runOctaveScript: Could not execute script %1" ).arg( m_path() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, error );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ class RicfRunOctaveScript : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfRunOctaveScript();
|
RicfRunOctaveScript();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_path;
|
caf::PdmField<QString> m_path;
|
||||||
caf::PdmField<std::vector<int>> m_caseIds;
|
caf::PdmField<std::vector<int>> m_caseIds;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
#include "RimFractureTemplateCollection.h"
|
#include "RimFractureTemplateCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfScaleFractureTemplate, "scaleFractureTemplate" );
|
CAF_PDM_SOURCE_INIT( RicfScaleFractureTemplate, "scaleFractureTemplate" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -35,13 +37,13 @@ RicfScaleFractureTemplate::RicfScaleFractureTemplate()
|
|||||||
{
|
{
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
||||||
RICF_InitField(&m_id, "id", -1, "Id", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_id, "id", -1, "Id", "", "", "");
|
||||||
RICF_InitField(&m_halfLengthScaleFactor, "halfLength", 1.0, "HalfLengthScaleFactor", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_halfLengthScaleFactor, "halfLength", 1.0, "HalfLengthScaleFactor", "", "", "");
|
||||||
RICF_InitField(&m_heightScaleFactor, "height", 1.0, "HeightScaleFactor", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_heightScaleFactor, "height", 1.0, "HeightScaleFactor", "", "", "");
|
||||||
RICF_InitField(&m_dFactorScaleFactor, "dFactor", 1.0, "DFactorScaleFactor", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_dFactorScaleFactor, "dFactor", 1.0, "DFactorScaleFactor", "", "", "");
|
||||||
RICF_InitField(&m_conductivityScaleFactor, "conductivity", 1.0, "ConductivityScaleFactor", "", "", "");
|
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
|
// clang-format on
|
||||||
}
|
}
|
||||||
@@ -49,13 +51,13 @@ RicfScaleFractureTemplate::RicfScaleFractureTemplate()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfScaleFractureTemplate::execute()
|
caf::PdmScriptResponse RicfScaleFractureTemplate::execute()
|
||||||
{
|
{
|
||||||
if ( m_id < 0 )
|
if ( m_id < 0 )
|
||||||
{
|
{
|
||||||
QString error( "scaleFractureTemplate: Fracture template id not specified" );
|
QString error( "scaleFractureTemplate: Fracture template id not specified" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RimProject* project = RiaApplication::instance()->project();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
@@ -64,7 +66,7 @@ RicfCommandResponse RicfScaleFractureTemplate::execute()
|
|||||||
{
|
{
|
||||||
QString error( "scaleFractureTemplate: Project not found" );
|
QString error( "scaleFractureTemplate: Project not found" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RimFractureTemplateCollection* templColl =
|
RimFractureTemplateCollection* templColl =
|
||||||
@@ -75,12 +77,12 @@ RicfCommandResponse RicfScaleFractureTemplate::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "scaleFractureTemplate: Fracture template not found. Id=%1" ).arg( m_id );
|
QString error = QString( "scaleFractureTemplate: Fracture template not found. Id=%1" ).arg( m_id );
|
||||||
RiaLogging::error( error );
|
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->setScaleFactors( m_halfLengthScaleFactor, m_heightScaleFactor, m_dFactorScaleFactor, m_conductivityScaleFactor );
|
||||||
templ->loadDataAndUpdateGeometryHasChanged();
|
templ->loadDataAndUpdateGeometryHasChanged();
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class RicfScaleFractureTemplate : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfScaleFractureTemplate();
|
RicfScaleFractureTemplate();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initAfterRead() override;
|
void initAfterRead() override;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfSetExportFolder, "setExportFolder" );
|
CAF_PDM_SOURCE_INIT( RicfSetExportFolder, "setExportFolder" );
|
||||||
@@ -31,16 +33,16 @@ CAF_PDM_SOURCE_INIT( RicfSetExportFolder, "setExportFolder" );
|
|||||||
RicfSetExportFolder::RicfSetExportFolder()
|
RicfSetExportFolder::RicfSetExportFolder()
|
||||||
{
|
{
|
||||||
// clang-format off
|
// clang-format off
|
||||||
RICF_InitField(&m_type, "type", RicfCommandFileExecutor::ExportTypeEnum(RicfCommandFileExecutor::COMPLETIONS), "Type", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_type, "type", RicfCommandFileExecutor::ExportTypeEnum(RicfCommandFileExecutor::COMPLETIONS), "Type", "", "", "");
|
||||||
RICF_InitField(&m_path, "path", QString(), "Path", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_path, "path", QString(), "Path", "", "", "");
|
||||||
RICF_InitField(&m_createFolder, "createFolder", false, "Create Folder", "", "", "");
|
CAF_PDM_InitScriptableFieldWithIO(&m_createFolder, "createFolder", false, "Create Folder", "", "", "");
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfSetExportFolder::execute()
|
caf::PdmScriptResponse RicfSetExportFolder::execute()
|
||||||
{
|
{
|
||||||
if ( m_createFolder )
|
if ( m_createFolder )
|
||||||
{
|
{
|
||||||
@@ -54,12 +56,12 @@ RicfCommandResponse RicfSetExportFolder::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "Could not create folder : %1" ).arg( m_path );
|
QString error = QString( "Could not create folder : %1" ).arg( m_path );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandFileExecutor* executor = RicfCommandFileExecutor::instance();
|
RicfCommandFileExecutor* executor = RicfCommandFileExecutor::instance();
|
||||||
executor->setExportPath( m_type(), m_path );
|
executor->setExportPath( m_type(), m_path );
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class RicfSetExportFolder : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfSetExportFolder();
|
RicfSetExportFolder();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<RicfCommandFileExecutor::ExportTypeEnum> m_type;
|
caf::PdmField<RicfCommandFileExecutor::ExportTypeEnum> m_type;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
#include "RimFractureTemplateCollection.h"
|
#include "RimFractureTemplateCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfSetFractureContainment, "setFractureContainment" );
|
CAF_PDM_SOURCE_INIT( RicfSetFractureContainment, "setFractureContainment" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -33,21 +35,21 @@ CAF_PDM_SOURCE_INIT( RicfSetFractureContainment, "setFractureContainment" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfSetFractureContainment::RicfSetFractureContainment()
|
RicfSetFractureContainment::RicfSetFractureContainment()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_id, "id", -1, "Id", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_id, "id", -1, "Id", "", "", "" );
|
||||||
RICF_InitField( &m_topLayer, "topLayer", -1, "TopLayer", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_topLayer, "topLayer", -1, "TopLayer", "", "", "" );
|
||||||
RICF_InitField( &m_baseLayer, "baseLayer", -1, "BaseLayer", "", "", "" );
|
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 )
|
if ( m_id < 0 || m_topLayer < 0 || m_baseLayer < 0 )
|
||||||
{
|
{
|
||||||
QString error( "setFractureContainment: Required argument missing" );
|
QString error( "setFractureContainment: Required argument missing" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RimProject* project = RiaApplication::instance()->project();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
@@ -56,7 +58,7 @@ RicfCommandResponse RicfSetFractureContainment::execute()
|
|||||||
{
|
{
|
||||||
QString error( "setFractureContainment: Project not found" );
|
QString error( "setFractureContainment: Project not found" );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RimFractureTemplateCollection* templColl =
|
RimFractureTemplateCollection* templColl =
|
||||||
@@ -67,11 +69,11 @@ RicfCommandResponse RicfSetFractureContainment::execute()
|
|||||||
{
|
{
|
||||||
QString error = QString( "setFractureContainment: Fracture template not found. Id=%1" ).arg( m_id );
|
QString error = QString( "setFractureContainment: Fracture template not found. Id=%1" ).arg( m_id );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
templ->setContainmentTopKLayer( m_topLayer );
|
templ->setContainmentTopKLayer( m_topLayer );
|
||||||
templ->setContainmentBaseKLayer( m_baseLayer );
|
templ->setContainmentBaseKLayer( m_baseLayer );
|
||||||
templ->loadDataAndUpdateGeometryHasChanged();
|
templ->loadDataAndUpdateGeometryHasChanged();
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class RicfSetFractureContainment : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfSetFractureContainment();
|
RicfSetFractureContainment();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_id;
|
caf::PdmField<int> m_id;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfSetMainWindowSize, "setMainWindowSize" );
|
CAF_PDM_SOURCE_INIT( RicfSetMainWindowSize, "setMainWindowSize" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -28,15 +30,15 @@ CAF_PDM_SOURCE_INIT( RicfSetMainWindowSize, "setMainWindowSize" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfSetMainWindowSize::RicfSetMainWindowSize()
|
RicfSetMainWindowSize::RicfSetMainWindowSize()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_height, "height", -1, "Height", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_height, "height", -1, "Height", "", "", "" );
|
||||||
RICF_InitField( &m_width, "width", -1, "Width", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_width, "width", -1, "Width", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfSetMainWindowSize::execute()
|
caf::PdmScriptResponse RicfSetMainWindowSize::execute()
|
||||||
{
|
{
|
||||||
RiuMainWindow::instance()->resize( m_width, m_height );
|
RiuMainWindow::instance()->resize( m_width, m_height );
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class RicfSetMainWindowSize : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfSetMainWindowSize();
|
RicfSetMainWindowSize();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_height;
|
caf::PdmField<int> m_height;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfSetPlotWindowSize, "setPlotWindowSize" );
|
CAF_PDM_SOURCE_INIT( RicfSetPlotWindowSize, "setPlotWindowSize" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -28,20 +30,20 @@ CAF_PDM_SOURCE_INIT( RicfSetPlotWindowSize, "setPlotWindowSize" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfSetPlotWindowSize::RicfSetPlotWindowSize()
|
RicfSetPlotWindowSize::RicfSetPlotWindowSize()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_height, "height", -1, "Height", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_height, "height", -1, "Height", "", "", "" );
|
||||||
RICF_InitField( &m_width, "width", -1, "Width", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_width, "width", -1, "Width", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicfSetPlotWindowSize::execute()
|
caf::PdmScriptResponse RicfSetPlotWindowSize::execute()
|
||||||
{
|
{
|
||||||
RiaGuiApplication* guiApp = RiaGuiApplication::instance();
|
RiaGuiApplication* guiApp = RiaGuiApplication::instance();
|
||||||
if ( guiApp )
|
if ( guiApp )
|
||||||
{
|
{
|
||||||
guiApp->getOrCreateAndShowMainPlotWindow()->resize( m_width, m_height );
|
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:
|
public:
|
||||||
RicfSetPlotWindowSize();
|
RicfSetPlotWindowSize();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_height;
|
caf::PdmField<int> m_height;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfSetStartDir, "setStartDir" );
|
CAF_PDM_SOURCE_INIT( RicfSetStartDir, "setStartDir" );
|
||||||
@@ -30,28 +32,28 @@ CAF_PDM_SOURCE_INIT( RicfSetStartDir, "setStartDir" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfSetStartDir::RicfSetStartDir()
|
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 );
|
QDir directory( m_path );
|
||||||
if ( !directory.exists() )
|
if ( !directory.exists() )
|
||||||
{
|
{
|
||||||
QString error = QString( "Path does not exist: %1" ).arg( m_path );
|
QString error = QString( "Path does not exist: %1" ).arg( m_path );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
if ( !directory.isReadable() )
|
if ( !directory.isReadable() )
|
||||||
{
|
{
|
||||||
QString error = QString( "Path does not exist: %1" ).arg( m_path );
|
QString error = QString( "Path does not exist: %1" ).arg( m_path );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
RiaApplication::instance()->setStartDir( m_path );
|
RiaApplication::instance()->setStartDir( m_path );
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class RicfSetStartDir : public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicfSetStartDir();
|
RicfSetStartDir();
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_path;
|
caf::PdmField<QString> m_path;
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicfSetTimeStep, "setTimeStep" );
|
CAF_PDM_SOURCE_INIT( RicfSetTimeStep, "setTimeStep" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -34,9 +36,9 @@ CAF_PDM_SOURCE_INIT( RicfSetTimeStep, "setTimeStep" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfSetTimeStep::RicfSetTimeStep()
|
RicfSetTimeStep::RicfSetTimeStep()
|
||||||
{
|
{
|
||||||
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
|
||||||
RICF_InitField( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View ID", "", "", "" );
|
||||||
RICF_InitField( &m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", "" );
|
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;
|
RimCase* rimCase = nullptr;
|
||||||
std::vector<RimCase*> allCases;
|
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() );
|
QString error = QString( "setTimeStep: Could not find case with ID %1" ).arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
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( maxTimeStep )
|
||||||
.arg( m_caseId() );
|
.arg( m_caseId() );
|
||||||
RiaLogging::error( error );
|
RiaLogging::error( error );
|
||||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( Rim3dView* view : rimCase->views() )
|
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 setViewId( int viewId );
|
||||||
void setTimeStepIndex( int timeStepIndex );
|
void setTimeStepIndex( int timeStepIndex );
|
||||||
|
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#include "RicSaveProjectFeature.h"
|
#include "RicSaveProjectFeature.h"
|
||||||
#include "Riu3DMainWindowTools.h"
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
@@ -33,21 +35,21 @@ RICF_SOURCE_INIT( RicSaveProjectAsFeature, "RicSaveProjectAsFeature", "saveProje
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicSaveProjectAsFeature::RicSaveProjectAsFeature()
|
RicSaveProjectAsFeature::RicSaveProjectAsFeature()
|
||||||
{
|
{
|
||||||
RICF_InitFieldNoDefault( &m_filePath, "filePath", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_filePath, "filePath", "", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicSaveProjectAsFeature::execute()
|
caf::PdmScriptResponse RicSaveProjectAsFeature::execute()
|
||||||
{
|
{
|
||||||
this->disableModelChangeContribution();
|
this->disableModelChangeContribution();
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if ( !RiaApplication::instance()->saveProjectAs( m_filePath(), &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();
|
auto response = execute();
|
||||||
|
|
||||||
if ( response.status() != RicfCommandResponse::COMMAND_OK )
|
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
|
||||||
{
|
{
|
||||||
QString displayMessage = response.messages().join( "\n" );
|
QString displayMessage = response.messages().join( "\n" );
|
||||||
if ( RiaGuiApplication::isRunning() )
|
if ( RiaGuiApplication::isRunning() )
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class RicSaveProjectAsFeature : public caf::CmdFeature, public RicfCommandObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RicSaveProjectAsFeature();
|
RicSaveProjectAsFeature();
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ RicSaveProjectFeature::RicSaveProjectFeature()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicSaveProjectFeature::execute()
|
caf::PdmScriptResponse RicSaveProjectFeature::execute()
|
||||||
{
|
{
|
||||||
this->disableModelChangeContribution();
|
this->disableModelChangeContribution();
|
||||||
|
|
||||||
@@ -55,10 +55,10 @@ RicfCommandResponse RicSaveProjectFeature::execute()
|
|||||||
|
|
||||||
if ( !worked )
|
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();
|
auto response = execute();
|
||||||
if ( response.status() != RicfCommandResponse::COMMAND_OK )
|
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
|
||||||
{
|
{
|
||||||
QString displayMessage = response.messages().join( "\n" );
|
QString displayMessage = response.messages().join( "\n" );
|
||||||
if ( RiaGuiApplication::isRunning() )
|
if ( RiaGuiApplication::isRunning() )
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class RicSaveProjectFeature : public caf::CmdFeature, public RicfCommandObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RicSaveProjectFeature();
|
RicSaveProjectFeature();
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "RiuViewer.h"
|
#include "RiuViewer.h"
|
||||||
|
|
||||||
#include "cafCmdFeatureManager.h"
|
#include "cafCmdFeatureManager.h"
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
#include "cafPdmUiPropertyViewDialog.h"
|
#include "cafPdmUiPropertyViewDialog.h"
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
@@ -49,11 +50,11 @@ RICF_SOURCE_INIT( RicExportContourMapToTextFeature, "RicExportContourMapToTextFe
|
|||||||
|
|
||||||
RicExportContourMapToTextFeature::RicExportContourMapToTextFeature()
|
RicExportContourMapToTextFeature::RicExportContourMapToTextFeature()
|
||||||
{
|
{
|
||||||
RICF_InitFieldNoDefault( &m_exportFileName, "exportFileName", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_exportFileName, "exportFileName", "", "", "", "" );
|
||||||
RICF_InitFieldNoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" );
|
||||||
RICF_InitFieldNoDefault( &m_undefinedValueLabel, "undefinedValueLabel", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_undefinedValueLabel, "undefinedValueLabel", "", "", "", "" );
|
||||||
RICF_InitFieldNoDefault( &m_excludeUndefinedValues, "excludeUndefinedValues", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_excludeUndefinedValues, "excludeUndefinedValues", "", "", "", "" );
|
||||||
RICF_InitField( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIO( &m_viewId, "viewId", -1, "View Id", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -127,13 +128,13 @@ void RicExportContourMapToTextFeature::onActionTriggered( bool isChecked )
|
|||||||
m_undefinedValueLabel = featureUi.undefinedValueLabel();
|
m_undefinedValueLabel = featureUi.undefinedValueLabel();
|
||||||
m_excludeUndefinedValues = featureUi.excludeUndefinedValues();
|
m_excludeUndefinedValues = featureUi.excludeUndefinedValues();
|
||||||
|
|
||||||
RicfCommandResponse response = execute();
|
caf::PdmScriptResponse response = execute();
|
||||||
QStringList messages = response.messages();
|
QStringList messages = response.messages();
|
||||||
|
|
||||||
if ( !messages.empty() )
|
if ( !messages.empty() )
|
||||||
{
|
{
|
||||||
QString displayMessage = QString( "Problem exporting contour map:\n%2" ).arg( messages.join( "\n" ) );
|
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 );
|
RiaLogging::error( displayMessage );
|
||||||
}
|
}
|
||||||
@@ -273,10 +274,10 @@ void RicExportContourMapToTextFeature::setupActionLook( QAction* actionToSetup )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
caf::PdmScriptResponse RicExportContourMapToTextFeature::execute()
|
||||||
{
|
{
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
QStringList errorMessages, warningMessages;
|
QStringList errorMessages, warningMessages;
|
||||||
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
|
|
||||||
@@ -297,7 +298,7 @@ RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
|||||||
|
|
||||||
if ( !myView )
|
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;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +340,7 @@ RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
|||||||
|
|
||||||
for ( QString errorMessage : errorMessages )
|
for ( QString errorMessage : errorMessages )
|
||||||
{
|
{
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class RicExportContourMapToTextFeature : public caf::CmdFeature, public RicfComm
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RicExportContourMapToTextFeature();
|
RicExportContourMapToTextFeature();
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ RicNewMultiPlotFeature::RicNewMultiPlotFeature()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicNewMultiPlotFeature::execute()
|
caf::PdmScriptResponse RicNewMultiPlotFeature::execute()
|
||||||
{
|
{
|
||||||
RimProject* project = RiaApplication::instance()->project();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
RimMultiPlotCollection* plotCollection = project->mainPlotCollection()->multiPlotCollection();
|
RimMultiPlotCollection* plotCollection = project->mainPlotCollection()->multiPlotCollection();
|
||||||
@@ -84,7 +84,7 @@ RicfCommandResponse RicNewMultiPlotFeature::execute()
|
|||||||
RiuPlotMainWindowTools::setExpanded( plotCollection, true );
|
RiuPlotMainWindowTools::setExpanded( plotCollection, true );
|
||||||
RiuPlotMainWindowTools::selectAsCurrentItem( plotWindow, true );
|
RiuPlotMainWindowTools::selectAsCurrentItem( plotWindow, true );
|
||||||
|
|
||||||
return RicfCommandResponse();
|
return caf::PdmScriptResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class RicNewMultiPlotFeature : public caf::CmdFeature, public RicfCommandObject
|
|||||||
public:
|
public:
|
||||||
RicNewMultiPlotFeature();
|
RicNewMultiPlotFeature();
|
||||||
|
|
||||||
virtual RicfCommandResponse execute() override;
|
virtual caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ RimEnsembleCurveSet* RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSet( R
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetsAndUpdate( std::vector<RimSummaryCaseCollection*> ensembles )
|
RimSummaryPlot*
|
||||||
|
RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetsAndUpdate( std::vector<RimSummaryCaseCollection*> ensembles )
|
||||||
{
|
{
|
||||||
RiaGuiApplication* app = RiaGuiApplication::instance();
|
RiaGuiApplication* app = RiaGuiApplication::instance();
|
||||||
RimProject* proj = app->project();
|
RimProject* proj = app->project();
|
||||||
@@ -102,6 +103,7 @@ void RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetsAndUpdate( std:
|
|||||||
mainPlotWindow->selectAsCurrentItem( firstCurveSetCreated );
|
mainPlotWindow->selectAsCurrentItem( firstCurveSetCreated );
|
||||||
mainPlotWindow->updateSummaryPlotToolBar();
|
mainPlotWindow->updateSummaryPlotToolBar();
|
||||||
}
|
}
|
||||||
|
return plot;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class RicNewSummaryEnsembleCurveSetFeature : public caf::CmdFeature
|
|||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void createPlotForCurveSetsAndUpdate( std::vector<RimSummaryCaseCollection*> ensembles );
|
static RimSummaryPlot* createPlotForCurveSetsAndUpdate( std::vector<RimSummaryCaseCollection*> ensembles );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
|
|
||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
#include "cafPdmFieldScriptability.h"
|
||||||
#include "cafSelectionManagerTools.h"
|
#include "cafSelectionManagerTools.h"
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
@@ -208,6 +210,29 @@ void extractPlotObjectsFromSelection( std::vector<RimSummaryCase*>* se
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryPlot* RicNewDefaultSummaryPlotFeature::createFromSummaryCases( RimSummaryPlotCollection* plotCollection,
|
||||||
|
const std::vector<RimSummaryCase*>& summaryCases )
|
||||||
|
{
|
||||||
|
RimSummaryPlot* newPlot = plotCollection->createSummaryPlotWithAutoTitle();
|
||||||
|
|
||||||
|
for ( RimSummaryCase* sumCase : summaryCases )
|
||||||
|
{
|
||||||
|
RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot( newPlot, sumCase );
|
||||||
|
}
|
||||||
|
|
||||||
|
newPlot->applyDefaultCurveAppearances();
|
||||||
|
newPlot->loadDataAndUpdate();
|
||||||
|
|
||||||
|
plotCollection->updateConnectedEditors();
|
||||||
|
|
||||||
|
RiuPlotMainWindowTools::setExpanded( newPlot );
|
||||||
|
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot );
|
||||||
|
return newPlot;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -234,20 +259,7 @@ void RicNewDefaultSummaryPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
{
|
{
|
||||||
RimSummaryPlotCollection* sumPlotColl =
|
RimSummaryPlotCollection* sumPlotColl =
|
||||||
RiaApplication::instance()->project()->mainPlotCollection()->summaryPlotCollection();
|
RiaApplication::instance()->project()->mainPlotCollection()->summaryPlotCollection();
|
||||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
createFromSummaryCases( sumPlotColl, selectedIndividualSummaryCases );
|
||||||
|
|
||||||
for ( RimSummaryCase* sumCase : selectedIndividualSummaryCases )
|
|
||||||
{
|
|
||||||
RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot( newPlot, sumCase );
|
|
||||||
}
|
|
||||||
|
|
||||||
newPlot->applyDefaultCurveAppearances();
|
|
||||||
newPlot->loadDataAndUpdate();
|
|
||||||
|
|
||||||
sumPlotColl->updateConnectedEditors();
|
|
||||||
|
|
||||||
RiuPlotMainWindowTools::setExpanded( newPlot );
|
|
||||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -276,3 +288,42 @@ void RicNewDefaultSummaryPlotFeature::setupActionLook( QAction* actionToSetup )
|
|||||||
}
|
}
|
||||||
actionToSetup->setIcon( QIcon( ":/SummaryPlotLight16x16.png" ) );
|
actionToSetup->setIcon( QIcon( ":/SummaryPlotLight16x16.png" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimSummaryPlotCollection, RimSummaryPlotCollection_newSummaryPlot, "NewSummaryPlot" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryPlotCollection_newSummaryPlot::RimSummaryPlotCollection_newSummaryPlot( caf::PdmObjectHandle* self )
|
||||||
|
: caf::PdmObjectMethod( self )
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject( "Create Summary Plot", "", "", "Create a new Summary Plot" );
|
||||||
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_summaryCases, "SummaryCases", "", "", "", "Summary Cases" );
|
||||||
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_ensembles, "Ensembles", "", "", "", "Ensembles" );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
caf::PdmObjectHandle* RimSummaryPlotCollection_newSummaryPlot::execute()
|
||||||
|
{
|
||||||
|
if ( !m_summaryCases.empty() )
|
||||||
|
{
|
||||||
|
return RicNewDefaultSummaryPlotFeature::createFromSummaryCases( self<RimSummaryPlotCollection>(),
|
||||||
|
m_summaryCases.ptrReferencedObjects() );
|
||||||
|
}
|
||||||
|
else if ( !m_ensembles.empty() )
|
||||||
|
{
|
||||||
|
return RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetsAndUpdate( m_ensembles.ptrReferencedObjects() );
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimSummaryPlotCollection_newSummaryPlot::deleteObjectAfterReply() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,10 +18,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "RicfCommandObject.h"
|
||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
#include "cafPdmPtrArrayField.h"
|
||||||
|
|
||||||
class RimSummaryPlotCollection;
|
class RimSummaryPlotCollection;
|
||||||
class RimSummaryCase;
|
class RimSummaryCase;
|
||||||
|
class RimSummaryCaseCollection;
|
||||||
class RimSummaryPlot;
|
class RimSummaryPlot;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@@ -45,9 +49,31 @@ class RicNewDefaultSummaryPlotFeature : public caf::CmdFeature
|
|||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static RimSummaryPlot* createFromSummaryCases( RimSummaryPlotCollection* plotCollection,
|
||||||
|
const std::vector<RimSummaryCase*>& summaryCases );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
void onActionTriggered( bool isChecked ) override;
|
void onActionTriggered( bool isChecked ) override;
|
||||||
void setupActionLook( QAction* actionToSetup ) override;
|
void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimSummaryPlotCollection_newSummaryPlot : public caf::PdmObjectMethod
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimSummaryPlotCollection_newSummaryPlot( caf::PdmObjectHandle* self );
|
||||||
|
|
||||||
|
caf::PdmObjectHandle* execute();
|
||||||
|
bool deleteObjectAfterReply() const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmPtrArrayField<RimSummaryCase*> m_summaryCases;
|
||||||
|
caf::PdmPtrArrayField<RimSummaryCaseCollection*> m_ensembles;
|
||||||
|
};
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
#include "Riu3DMainWindowTools.h"
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -62,11 +64,11 @@ RICF_SOURCE_INIT( RicImportWellPaths, "RicWellPathsImportFileFeature", "importWe
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicImportWellPaths::RicImportWellPaths()
|
RicImportWellPaths::RicImportWellPaths()
|
||||||
{
|
{
|
||||||
RICF_InitFieldNoDefault( &m_wellPathFolder, "wellPathFolder", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_wellPathFolder, "wellPathFolder", "", "", "", "" );
|
||||||
RICF_InitFieldNoDefault( &m_wellPathFiles, "wellPathFiles", "", "", "", "" );
|
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_wellPathFiles, "wellPathFiles", "", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandResponse RicImportWellPaths::execute()
|
caf::PdmScriptResponse RicImportWellPaths::execute()
|
||||||
{
|
{
|
||||||
QStringList errorMessages, warningMessages;
|
QStringList errorMessages, warningMessages;
|
||||||
QStringList wellPathFiles;
|
QStringList wellPathFiles;
|
||||||
@@ -115,7 +117,7 @@ RicfCommandResponse RicImportWellPaths::execute()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RicfCommandResponse response;
|
caf::PdmScriptResponse response;
|
||||||
if ( !wellPathFiles.empty() )
|
if ( !wellPathFiles.empty() )
|
||||||
{
|
{
|
||||||
std::vector<RimWellPath*> importedWellPaths = importWellPaths( wellPathFiles, &warningMessages );
|
std::vector<RimWellPath*> importedWellPaths = importWellPaths( wellPathFiles, &warningMessages );
|
||||||
@@ -137,12 +139,12 @@ RicfCommandResponse RicImportWellPaths::execute()
|
|||||||
|
|
||||||
for ( QString warningMessage : warningMessages )
|
for ( QString warningMessage : warningMessages )
|
||||||
{
|
{
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_WARNING, warningMessage );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warningMessage );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( QString errorMessage : errorMessages )
|
for ( QString errorMessage : errorMessages )
|
||||||
{
|
{
|
||||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
|
response.updateStatus( caf::PdmScriptResponse::COMMAND_ERROR, errorMessage );
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
@@ -219,9 +221,9 @@ void RicImportWellPaths::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
if ( wellPathFilePaths.size() >= 1 )
|
if ( wellPathFilePaths.size() >= 1 )
|
||||||
{
|
{
|
||||||
m_wellPathFiles.v() = std::vector<QString>( wellPathFilePaths.begin(), wellPathFilePaths.end() );
|
m_wellPathFiles.v() = std::vector<QString>( wellPathFilePaths.begin(), wellPathFilePaths.end() );
|
||||||
RicfCommandResponse response = execute();
|
caf::PdmScriptResponse response = execute();
|
||||||
QStringList messages = response.messages();
|
QStringList messages = response.messages();
|
||||||
|
|
||||||
if ( !messages.empty() )
|
if ( !messages.empty() )
|
||||||
{
|
{
|
||||||
@@ -231,7 +233,7 @@ void RicImportWellPaths::onActionTriggered( bool isChecked )
|
|||||||
{
|
{
|
||||||
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "Well Path Loading", displayMessage );
|
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "Well Path Loading", displayMessage );
|
||||||
}
|
}
|
||||||
if ( response.status() == RicfCommandResponse::COMMAND_ERROR )
|
if ( response.status() == caf::PdmScriptResponse::COMMAND_ERROR )
|
||||||
{
|
{
|
||||||
RiaLogging::error( displayMessage );
|
RiaLogging::error( displayMessage );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class RicImportWellPaths : public caf::CmdFeature, public RicfCommandObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RicImportWellPaths();
|
RicImportWellPaths();
|
||||||
RicfCommandResponse execute() override;
|
caf::PdmScriptResponse execute() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static std::vector<RimWellPath*> importWellPaths( const QStringList& wellPathFilePaths, QStringList* errorMessages );
|
static std::vector<RimWellPath*> importWellPaths( const QStringList& wellPathFilePaths, QStringList* errorMessages );
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ service PdmObjectService
|
|||||||
rpc GetAncestorPdmObject(PdmParentObjectRequest) returns (PdmObject) {}
|
rpc GetAncestorPdmObject(PdmParentObjectRequest) returns (PdmObject) {}
|
||||||
rpc CreateChildPdmObject(CreatePdmChildObjectRequest) returns (PdmObject) {}
|
rpc CreateChildPdmObject(CreatePdmChildObjectRequest) returns (PdmObject) {}
|
||||||
rpc UpdateExistingPdmObject(PdmObject) returns (Empty) {}
|
rpc UpdateExistingPdmObject(PdmObject) returns (Empty) {}
|
||||||
rpc CallPdmObjectGetMethod(PdmObjectMethodRequest) returns (stream PdmObjectGetMethodReply) {}
|
rpc CallPdmObjectGetter(PdmObjectGetterRequest) returns (stream PdmObjectGetterReply) {}
|
||||||
rpc CallPdmObjectSetMethod(stream PdmObjectSetMethodChunk) returns (ClientToServerStreamReply) {}
|
rpc CallPdmObjectSetter(stream PdmObjectSetterChunk) returns (ClientToServerStreamReply) {}
|
||||||
|
rpc CallPdmObjectMethod(PdmObjectMethodRequest) returns (PdmObject) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
message PdmDescendantObjectRequest
|
message PdmDescendantObjectRequest
|
||||||
@@ -45,6 +46,7 @@ message PdmObject
|
|||||||
uint64 address = 2;
|
uint64 address = 2;
|
||||||
map<string, string> parameters = 3;
|
map<string, string> parameters = 3;
|
||||||
bool visible = 4;
|
bool visible = 4;
|
||||||
|
bool persistent = 5; // Does this object live on in ResInsight?
|
||||||
}
|
}
|
||||||
|
|
||||||
message PdmObjectArray
|
message PdmObjectArray
|
||||||
@@ -52,26 +54,26 @@ message PdmObjectArray
|
|||||||
repeated PdmObject objects = 1;
|
repeated PdmObject objects = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PdmObjectMethodRequest
|
message PdmObjectGetterRequest
|
||||||
{
|
{
|
||||||
PdmObject object = 1;
|
PdmObject object = 1;
|
||||||
string method = 2;
|
string method = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PdmObjectSetMethodRequest
|
message PdmObjectSetterRequest
|
||||||
{
|
{
|
||||||
PdmObjectMethodRequest request = 1;
|
PdmObjectGetterRequest request = 1;
|
||||||
int32 data_count = 2;
|
int32 data_count = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PdmObjectSetMethodChunk
|
message PdmObjectSetterChunk
|
||||||
{
|
{
|
||||||
oneof data
|
oneof data
|
||||||
{
|
{
|
||||||
PdmObjectSetMethodRequest set_request = 1;
|
PdmObjectSetterRequest set_request = 1;
|
||||||
DoubleArray doubles = 2;
|
DoubleArray doubles = 2;
|
||||||
IntArray ints = 3;
|
IntArray ints = 3;
|
||||||
StringArray strings = 4;
|
StringArray strings = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +93,7 @@ message StringArray
|
|||||||
repeated string data = 1;
|
repeated string data = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PdmObjectGetMethodReply
|
message PdmObjectGetterReply
|
||||||
{
|
{
|
||||||
oneof data
|
oneof data
|
||||||
{
|
{
|
||||||
@@ -99,4 +101,11 @@ message PdmObjectGetMethodReply
|
|||||||
IntArray ints = 2;
|
IntArray ints = 2;
|
||||||
StringArray strings = 3;
|
StringArray strings = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message PdmObjectMethodRequest
|
||||||
|
{
|
||||||
|
PdmObject object = 1;
|
||||||
|
string method = 2;
|
||||||
|
PdmObject params = 3;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Load ResInsight Processing Server Client Library
|
||||||
|
import rips
|
||||||
|
# Connect to ResInsight instance
|
||||||
|
resinsight = rips.Instance.find()
|
||||||
|
# Example code
|
||||||
|
project = resinsight.project
|
||||||
|
|
||||||
|
summary_cases = project.descendants(rips.SummaryCase)
|
||||||
|
summary_plot_collection = project.descendants(rips.SummaryPlotCollection)[0]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
summary_plot = summary_plot_collection.new_summary_plot(summary_cases=summary_cases)
|
||||||
@@ -179,10 +179,12 @@ def __convert_to_grpc_value(self, value):
|
|||||||
if value:
|
if value:
|
||||||
return "true"
|
return "true"
|
||||||
return "false"
|
return "false"
|
||||||
|
if isinstance(value, PdmObject):
|
||||||
|
return value.__class__.__name__ + ":" + str(value.address())
|
||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
list_of_strings = []
|
list_of_strings = []
|
||||||
for val in value:
|
for val in value:
|
||||||
list_of_strings.append(self.__convert_to_grpc_value('\"' + val + '\"'))
|
list_of_strings.append('\"' + self.__convert_to_grpc_value(val) + '\"')
|
||||||
return "[" + ", ".join(list_of_strings) + "]"
|
return "[" + ", ".join(list_of_strings) + "]"
|
||||||
return str(value)
|
return str(value)
|
||||||
|
|
||||||
@@ -301,8 +303,8 @@ def ancestor(self, class_definition):
|
|||||||
|
|
||||||
@add_method(PdmObject)
|
@add_method(PdmObject)
|
||||||
def _call_get_method_async(self, method_name):
|
def _call_get_method_async(self, method_name):
|
||||||
request = PdmObject_pb2.PdmObjectMethodRequest(object=self._pb2_object, method=method_name)
|
request = PdmObject_pb2.PdmObjectGetterRequest(object=self._pb2_object, method=method_name)
|
||||||
for chunk in self._pdm_object_stub.CallPdmObjectGetMethod(request):
|
for chunk in self._pdm_object_stub.CallPdmObjectGetter(request):
|
||||||
yield chunk
|
yield chunk
|
||||||
|
|
||||||
@add_method(PdmObject)
|
@add_method(PdmObject)
|
||||||
@@ -320,40 +322,48 @@ def __generate_set_method_chunks(self, array, method_request):
|
|||||||
index = -1
|
index = -1
|
||||||
|
|
||||||
while index < len(array):
|
while index < len(array):
|
||||||
chunk = PdmObject_pb2.PdmObjectSetMethodChunk()
|
chunk = PdmObject_pb2.PdmObjectSetterChunk()
|
||||||
if index is -1:
|
if index is -1:
|
||||||
chunk.set_request.CopyFrom(PdmObject_pb2.PdmObjectSetMethodRequest(request=method_request, data_count=len(array)))
|
chunk.set_request.CopyFrom(PdmObject_pb2.PdmObjectSetterRequest(request=method_request, data_count=len(array)))
|
||||||
index += 1
|
index += 1
|
||||||
else:
|
else:
|
||||||
actual_chunk_size = min(len(array) - index + 1, self.__chunk_size)
|
actual_chunk_size = min(len(array) - index + 1, self.__chunk_size)
|
||||||
if isinstance(array[0], float):
|
if isinstance(array[0], float):
|
||||||
chunk.CopyFrom(
|
chunk.CopyFrom(
|
||||||
PdmObject_pb2.PdmObjectSetMethodChunk(doubles=PdmObject_pb2.DoubleArray(data=array[index:index +
|
PdmObject_pb2.PdmObjectSetterChunk(doubles=PdmObject_pb2.DoubleArray(data=array[index:index +
|
||||||
actual_chunk_size])))
|
actual_chunk_size])))
|
||||||
elif isinstance(array[0], int):
|
elif isinstance(array[0], int):
|
||||||
chunk.CopyFrom(
|
chunk.CopyFrom(
|
||||||
PdmObject_pb2.PdmObjectSetMethodChunk(ints=PdmObject_pb2.IntArray(data=array[index:index +
|
PdmObject_pb2.PdmObjectSetterChunk(ints=PdmObject_pb2.IntArray(data=array[index:index +
|
||||||
actual_chunk_size])))
|
actual_chunk_size])))
|
||||||
elif isinstance(array[0], str):
|
elif isinstance(array[0], str):
|
||||||
chunk.CopyFrom(
|
chunk.CopyFrom(
|
||||||
PdmObject_pb2.PdmObjectSetMethodChunk(strings=PdmObject_pb2.StringArray(data=array[index:index +
|
PdmObject_pb2.PdmObjectSetterChunk(strings=PdmObject_pb2.StringArray(data=array[index:index +
|
||||||
actual_chunk_size])))
|
actual_chunk_size])))
|
||||||
else:
|
else:
|
||||||
raise Exception("Wrong data type for set method")
|
raise Exception("Wrong data type for set method")
|
||||||
index += actual_chunk_size
|
index += actual_chunk_size
|
||||||
yield chunk
|
yield chunk
|
||||||
# Final empty message to signal completion
|
# Final empty message to signal completion
|
||||||
chunk = PdmObject_pb2.PdmObjectSetMethodChunk()
|
chunk = PdmObject_pb2.PdmObjectSetterChunk()
|
||||||
yield chunk
|
yield chunk
|
||||||
|
|
||||||
@add_method(PdmObject)
|
@add_method(PdmObject)
|
||||||
def _call_set_method(self, method_name, values):
|
def _call_set_method(self, method_name, values):
|
||||||
method_request = PdmObject_pb2.PdmObjectMethodRequest(object=self._pb2_object, method=method_name)
|
method_request = PdmObject_pb2.PdmObjectGetterRequest(object=self._pb2_object, method=method_name)
|
||||||
request_iterator = self.__generate_set_method_chunks(values, method_request)
|
request_iterator = self.__generate_set_method_chunks(values, method_request)
|
||||||
reply = self._pdm_object_stub.CallPdmObjectSetMethod(request_iterator)
|
reply = self._pdm_object_stub.CallPdmObjectSetter(request_iterator)
|
||||||
if reply.accepted_value_count < len(values):
|
if reply.accepted_value_count < len(values):
|
||||||
raise IndexError
|
raise IndexError
|
||||||
|
|
||||||
|
@add_method(PdmObject)
|
||||||
|
def _call_pdm_method(self, method_name, **kwargs):
|
||||||
|
pb2_params = PdmObject_pb2.PdmObject(class_keyword=method_name)
|
||||||
|
for key, value in kwargs.items():
|
||||||
|
pb2_params.parameters[snake_to_camel(key)] = self.__convert_to_grpc_value(value)
|
||||||
|
request = PdmObject_pb2.PdmObjectMethodRequest(object=self._pb2_object, method=method_name, params=pb2_params)
|
||||||
|
return self._pdm_object_stub.CallPdmObjectMethod(request)
|
||||||
|
|
||||||
@add_method(PdmObject)
|
@add_method(PdmObject)
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Sync all fields from the Python Object to ResInsight"""
|
"""Sync all fields from the Python Object to ResInsight"""
|
||||||
|
|||||||
@@ -79,14 +79,14 @@ grpc::Status RiaGrpcCommandService::Execute( grpc::ServerContext* context, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Execute command
|
// Execute command
|
||||||
RicfCommandResponse response = commandHandle->execute();
|
caf::PdmScriptResponse response = commandHandle->execute();
|
||||||
|
|
||||||
// Copy results
|
// Copy results
|
||||||
if ( response.status() == RicfCommandResponse::COMMAND_ERROR )
|
if ( response.status() == caf::PdmScriptResponse::COMMAND_ERROR )
|
||||||
{
|
{
|
||||||
return grpc::Status( grpc::FAILED_PRECONDITION, response.sanitizedResponseMessage().toStdString() );
|
return grpc::Status( grpc::FAILED_PRECONDITION, response.sanitizedResponseMessage().toStdString() );
|
||||||
}
|
}
|
||||||
else if ( response.status() == RicfCommandResponse::COMMAND_WARNING )
|
else if ( response.status() == caf::PdmScriptResponse::COMMAND_WARNING )
|
||||||
{
|
{
|
||||||
context->AddTrailingMetadata( "warning", response.sanitizedResponseMessage().toStdString() );
|
context->AddTrailingMetadata( "warning", response.sanitizedResponseMessage().toStdString() );
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user