mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Move RicfMessages to CAF and simplify RicfFieldCapability
This commit is contained in:
@@ -36,7 +36,6 @@
|
|||||||
#include "RicImportGeneralDataFeature.h"
|
#include "RicImportGeneralDataFeature.h"
|
||||||
#include "RicfCommandFileExecutor.h"
|
#include "RicfCommandFileExecutor.h"
|
||||||
#include "RicfFieldHandle.h"
|
#include "RicfFieldHandle.h"
|
||||||
#include "RicfMessages.h"
|
|
||||||
#include "RicfObjectCapability.h"
|
#include "RicfObjectCapability.h"
|
||||||
|
|
||||||
#include "Rim2dIntersectionViewCollection.h"
|
#include "Rim2dIntersectionViewCollection.h"
|
||||||
@@ -98,6 +97,7 @@
|
|||||||
#include "cafPdmCodeGenerator.h"
|
#include "cafPdmCodeGenerator.h"
|
||||||
#include "cafPdmDataValueField.h"
|
#include "cafPdmDataValueField.h"
|
||||||
#include "cafPdmDefaultObjectFactory.h"
|
#include "cafPdmDefaultObjectFactory.h"
|
||||||
|
#include "cafPdmScriptIOMessages.h"
|
||||||
#include "cafPdmSettings.h"
|
#include "cafPdmSettings.h"
|
||||||
#include "cafPdmUiModelChangeDetector.h"
|
#include "cafPdmUiModelChangeDetector.h"
|
||||||
#include "cafProgressInfo.h"
|
#include "cafProgressInfo.h"
|
||||||
@@ -1260,8 +1260,8 @@ 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 );
|
||||||
RicfMessages messages;
|
caf::PdmScriptIOMessages messages;
|
||||||
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
||||||
{
|
{
|
||||||
// TODO : Error logging?
|
// TODO : Error logging?
|
||||||
|
|||||||
@@ -31,13 +31,13 @@
|
|||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
#include "RicfCommandFileExecutor.h"
|
#include "RicfCommandFileExecutor.h"
|
||||||
#include "RicfMessages.h"
|
|
||||||
|
|
||||||
#include "ExportCommands/RicSnapshotAllPlotsToFileFeature.h"
|
#include "ExportCommands/RicSnapshotAllPlotsToFileFeature.h"
|
||||||
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
|
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
|
||||||
#include "ExportCommands/RicSnapshotViewToFileFeature.h"
|
#include "ExportCommands/RicSnapshotViewToFileFeature.h"
|
||||||
#include "RicImportSummaryCasesFeature.h"
|
#include "RicImportSummaryCasesFeature.h"
|
||||||
|
|
||||||
|
#include "cafPdmScriptIOMessages.h"
|
||||||
#include "cvfProgramOptions.h"
|
#include "cvfProgramOptions.h"
|
||||||
#include "cvfqtUtils.h"
|
#include "cvfqtUtils.h"
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfFieldCapability.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicfFieldHandle.h
|
${CMAKE_CURRENT_LIST_DIR}/RicfFieldHandle.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicfObjectCapability.h
|
${CMAKE_CURRENT_LIST_DIR}/RicfObjectCapability.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.h
|
${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicfMessages.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@@ -16,7 +15,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfFieldCapability.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicfFieldHandle.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicfFieldHandle.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicfObjectCapability.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicfObjectCapability.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicfMessages.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RicfFieldCapability.h"
|
#include "RicfFieldCapability.h"
|
||||||
#include "RicfMessages.h"
|
|
||||||
|
|
||||||
#include "RiaColorTools.h"
|
#include "RiaColorTools.h"
|
||||||
|
|
||||||
@@ -26,10 +25,10 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfFieldReader<QString>::readFieldData( QString& fieldValue,
|
void RicfFieldIOHandler<QString>::writeToField( QString& fieldValue,
|
||||||
QTextStream& inputStream,
|
QTextStream& inputStream,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted )
|
bool stringsAreQuoted )
|
||||||
{
|
{
|
||||||
fieldValue = "";
|
fieldValue = "";
|
||||||
|
|
||||||
@@ -99,10 +98,10 @@ void RicfFieldReader<QString>::readFieldData( QString& fieldValue,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfFieldWriter<QString>::writeFieldData( const QString& fieldValue,
|
void RicfFieldIOHandler<QString>::readFromField( const QString& fieldValue,
|
||||||
QTextStream& outputStream,
|
QTextStream& outputStream,
|
||||||
bool quoteStrings,
|
bool quoteStrings,
|
||||||
bool quoteNonBuiltin )
|
bool quoteNonBuiltin )
|
||||||
{
|
{
|
||||||
outputStream << "\"";
|
outputStream << "\"";
|
||||||
for ( int i = 0; i < fieldValue.size(); ++i )
|
for ( int i = 0; i < fieldValue.size(); ++i )
|
||||||
@@ -119,10 +118,10 @@ void RicfFieldWriter<QString>::writeFieldData( const QString& fieldValue,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfFieldReader<bool>::readFieldData( bool& fieldValue,
|
void RicfFieldIOHandler<bool>::writeToField( bool& fieldValue,
|
||||||
QTextStream& inputStream,
|
QTextStream& inputStream,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted )
|
bool stringsAreQuoted )
|
||||||
{
|
{
|
||||||
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
||||||
QString accumulatedFieldValue;
|
QString accumulatedFieldValue;
|
||||||
@@ -158,10 +157,10 @@ void RicfFieldReader<bool>::readFieldData( bool& fieldValue,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfFieldWriter<bool>::writeFieldData( const bool& fieldValue,
|
void RicfFieldIOHandler<bool>::readFromField( const bool& fieldValue,
|
||||||
QTextStream& outputStream,
|
QTextStream& outputStream,
|
||||||
bool quoteStrings,
|
bool quoteStrings,
|
||||||
bool quoteNonBuiltin )
|
bool quoteNonBuiltin )
|
||||||
{
|
{
|
||||||
// Lower-case true/false is used in the documentation.
|
// Lower-case true/false is used in the documentation.
|
||||||
outputStream << ( fieldValue ? "true" : "false" );
|
outputStream << ( fieldValue ? "true" : "false" );
|
||||||
@@ -170,13 +169,13 @@ void RicfFieldWriter<bool>::writeFieldData( const bool& fieldValue,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfFieldReader<cvf::Color3f>::readFieldData( cvf::Color3f& fieldValue,
|
void RicfFieldIOHandler<cvf::Color3f>::writeToField( cvf::Color3f& fieldValue,
|
||||||
QTextStream& inputStream,
|
QTextStream& inputStream,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted )
|
bool stringsAreQuoted )
|
||||||
{
|
{
|
||||||
QString fieldStringValue;
|
QString fieldStringValue;
|
||||||
RicfFieldReader<QString>::readFieldData( fieldStringValue, inputStream, errorMessageContainer, stringsAreQuoted );
|
RicfFieldIOHandler<QString>::writeToField( fieldStringValue, inputStream, errorMessageContainer, stringsAreQuoted );
|
||||||
|
|
||||||
QColor qColor( fieldStringValue );
|
QColor qColor( fieldStringValue );
|
||||||
if ( qColor.isValid() )
|
if ( qColor.isValid() )
|
||||||
@@ -188,12 +187,12 @@ void RicfFieldReader<cvf::Color3f>::readFieldData( cvf::Color3f& fieldValue,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfFieldWriter<cvf::Color3f>::writeFieldData( const cvf::Color3f& fieldValue,
|
void RicfFieldIOHandler<cvf::Color3f>::readFromField( const cvf::Color3f& fieldValue,
|
||||||
QTextStream& outputStream,
|
QTextStream& outputStream,
|
||||||
bool quoteStrings,
|
bool quoteStrings,
|
||||||
bool quoteNonBuiltin )
|
bool quoteNonBuiltin )
|
||||||
{
|
{
|
||||||
QColor qColor = RiaColorTools::toQColor( fieldValue );
|
QColor qColor = RiaColorTools::toQColor( fieldValue );
|
||||||
QString fieldStringValue = qColor.name();
|
QString fieldStringValue = qColor.name();
|
||||||
RicfFieldWriter<QString>::writeFieldData( fieldStringValue, outputStream, quoteStrings );
|
RicfFieldIOHandler<QString>::readFromField( fieldStringValue, outputStream, quoteStrings );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "RicfFieldHandle.h"
|
#include "RicfFieldHandle.h"
|
||||||
#include "RicfMessages.h"
|
|
||||||
|
|
||||||
#include "cafAppEnum.h"
|
#include "cafAppEnum.h"
|
||||||
|
#include "cafPdmScriptIOMessages.h"
|
||||||
|
|
||||||
#include "cvfColor3.h"
|
#include "cvfColor3.h"
|
||||||
|
|
||||||
@@ -29,12 +29,12 @@
|
|||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
template <typename DataType>
|
template <typename DataType>
|
||||||
struct RicfFieldReader
|
struct RicfFieldIOHandler
|
||||||
{
|
{
|
||||||
static void readFieldData( DataType& fieldValue,
|
static void writeToField( DataType& fieldValue,
|
||||||
QTextStream& inputStream,
|
QTextStream& inputStream,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted = true )
|
bool stringsAreQuoted = true )
|
||||||
{
|
{
|
||||||
inputStream >> fieldValue;
|
inputStream >> fieldValue;
|
||||||
if ( inputStream.status() == QTextStream::ReadCorruptData )
|
if ( inputStream.status() == QTextStream::ReadCorruptData )
|
||||||
@@ -46,81 +46,62 @@ struct RicfFieldReader
|
|||||||
inputStream.setStatus( QTextStream::Ok );
|
inputStream.setStatus( QTextStream::Ok );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
template <typename DataType>
|
static void readFromField( const DataType& fieldValue,
|
||||||
struct RicfFieldWriter
|
QTextStream& outputStream,
|
||||||
{
|
bool quoteStrings = true,
|
||||||
static void writeFieldData( const DataType& fieldValue,
|
bool quoteNonBuiltins = false )
|
||||||
QTextStream& outputStream,
|
|
||||||
bool quoteStrings = true,
|
|
||||||
bool quoteNonBuiltins = false )
|
|
||||||
{
|
{
|
||||||
outputStream << fieldValue;
|
outputStream << fieldValue;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct RicfFieldReader<QString>
|
struct RicfFieldIOHandler<QString>
|
||||||
{
|
{
|
||||||
static void readFieldData( QString& fieldValue,
|
static void writeToField( QString& fieldValue,
|
||||||
QTextStream& inputStream,
|
QTextStream& inputStream,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted = true );
|
bool stringsAreQuoted = true );
|
||||||
|
static void readFromField( const QString& fieldValue,
|
||||||
|
QTextStream& outputStream,
|
||||||
|
bool quoteStrings = true,
|
||||||
|
bool quoteNonBuiltins = false );
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct RicfFieldWriter<QString>
|
struct RicfFieldIOHandler<bool>
|
||||||
{
|
{
|
||||||
static void writeFieldData( const QString& fieldValue,
|
static void writeToField( bool& fieldValue,
|
||||||
QTextStream& outputStream,
|
QTextStream& inputStream,
|
||||||
bool quoteStrings = true,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool quoteNonBuiltins = false );
|
bool stringsAreQuoted = true );
|
||||||
|
static void readFromField( const bool& fieldValue,
|
||||||
|
QTextStream& outputStream,
|
||||||
|
bool quoteStrings = true,
|
||||||
|
bool quoteNonBuiltins = false );
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct RicfFieldReader<bool>
|
struct RicfFieldIOHandler<cvf::Color3f>
|
||||||
{
|
{
|
||||||
static void readFieldData( bool& fieldValue,
|
static void writeToField( cvf::Color3f& fieldValue,
|
||||||
QTextStream& inputStream,
|
QTextStream& inputStream,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted = true );
|
bool stringsAreQuoted = true );
|
||||||
};
|
static void readFromField( const cvf::Color3f& fieldValue,
|
||||||
|
QTextStream& outputStream,
|
||||||
template <>
|
bool quoteStrings = true,
|
||||||
struct RicfFieldWriter<bool>
|
bool quoteNonBuiltins = false );
|
||||||
{
|
|
||||||
static void writeFieldData( const bool& fieldValue,
|
|
||||||
QTextStream& outputStream,
|
|
||||||
bool quoteStrings = true,
|
|
||||||
bool quoteNonBuiltins = false );
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct RicfFieldReader<cvf::Color3f>
|
|
||||||
{
|
|
||||||
static void readFieldData( cvf::Color3f& fieldValue,
|
|
||||||
QTextStream& inputStream,
|
|
||||||
RicfMessages* errorMessageContainer,
|
|
||||||
bool stringsAreQuoted = true );
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct RicfFieldWriter<cvf::Color3f>
|
|
||||||
{
|
|
||||||
static void writeFieldData( const cvf::Color3f& fieldValue,
|
|
||||||
QTextStream& outputStream,
|
|
||||||
bool quoteStrings = true,
|
|
||||||
bool quoteNonBuiltins = false );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct RicfFieldReader<caf::AppEnum<T>>
|
struct RicfFieldIOHandler<caf::AppEnum<T>>
|
||||||
{
|
{
|
||||||
static void readFieldData( caf::AppEnum<T>& fieldValue,
|
static void writeToField( caf::AppEnum<T>& fieldValue,
|
||||||
QTextStream& inputStream,
|
QTextStream& inputStream,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted = true )
|
bool stringsAreQuoted = true )
|
||||||
{
|
{
|
||||||
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
||||||
QString accumulatedFieldValue;
|
QString accumulatedFieldValue;
|
||||||
@@ -148,15 +129,11 @@ struct RicfFieldReader<caf::AppEnum<T>>
|
|||||||
errorMessageContainer->currentCommand + "\"" );
|
errorMessageContainer->currentCommand + "\"" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
static void readFromField( const caf::AppEnum<T>& fieldValue,
|
||||||
struct RicfFieldWriter<caf::AppEnum<T>>
|
QTextStream& outputStream,
|
||||||
{
|
bool quoteStrings = true,
|
||||||
static void writeFieldData( const caf::AppEnum<T>& fieldValue,
|
bool quoteNonBuiltins = false )
|
||||||
QTextStream& outputStream,
|
|
||||||
bool quoteStrings = true,
|
|
||||||
bool quoteNonBuiltins = false )
|
|
||||||
{
|
{
|
||||||
if ( quoteNonBuiltins )
|
if ( quoteNonBuiltins )
|
||||||
{
|
{
|
||||||
@@ -170,12 +147,12 @@ struct RicfFieldWriter<caf::AppEnum<T>>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct RicfFieldReader<std::vector<T>>
|
struct RicfFieldIOHandler<std::vector<T>>
|
||||||
{
|
{
|
||||||
static void readFieldData( std::vector<T>& fieldValue,
|
static void writeToField( std::vector<T>& fieldValue,
|
||||||
QTextStream& inputStream,
|
QTextStream& inputStream,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted = true )
|
bool stringsAreQuoted = true )
|
||||||
{
|
{
|
||||||
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
errorMessageContainer->skipWhiteSpaceWithLineNumberCount( inputStream );
|
||||||
QChar chr = errorMessageContainer->readCharWithLineNumberCount( inputStream );
|
QChar chr = errorMessageContainer->readCharWithLineNumberCount( inputStream );
|
||||||
@@ -197,7 +174,7 @@ struct RicfFieldReader<std::vector<T>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
T value;
|
T value;
|
||||||
RicfFieldReader<T>::readFieldData( value, inputStream, errorMessageContainer, true );
|
RicfFieldIOHandler<T>::writeToField( value, inputStream, errorMessageContainer, true );
|
||||||
fieldValue.push_back( value );
|
fieldValue.push_back( value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,20 +185,16 @@ struct RicfFieldReader<std::vector<T>>
|
|||||||
errorMessageContainer->currentCommand + "\"" );
|
errorMessageContainer->currentCommand + "\"" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
static void readFromField( const std::vector<T>& fieldValue,
|
||||||
struct RicfFieldWriter<std::vector<T>>
|
QTextStream& outputStream,
|
||||||
{
|
bool quoteStrings = true,
|
||||||
static void writeFieldData( const std::vector<T>& fieldValue,
|
bool quoteNonBuiltins = false )
|
||||||
QTextStream& outputStream,
|
|
||||||
bool quoteStrings = true,
|
|
||||||
bool quoteNonBuiltins = false )
|
|
||||||
{
|
{
|
||||||
outputStream << "[";
|
outputStream << "[";
|
||||||
for ( size_t i = 0; i < fieldValue.size(); ++i )
|
for ( size_t i = 0; i < fieldValue.size(); ++i )
|
||||||
{
|
{
|
||||||
RicfFieldWriter<T>::writeFieldData( fieldValue[i], outputStream, quoteNonBuiltins );
|
RicfFieldIOHandler<T>::readFromField( fieldValue[i], outputStream, quoteNonBuiltins );
|
||||||
if ( i < fieldValue.size() - 1 )
|
if ( i < fieldValue.size() - 1 )
|
||||||
{
|
{
|
||||||
outputStream << ", ";
|
outputStream << ", ";
|
||||||
@@ -250,14 +223,14 @@ public:
|
|||||||
public:
|
public:
|
||||||
void readFieldData( QTextStream& inputStream,
|
void readFieldData( QTextStream& inputStream,
|
||||||
caf::PdmObjectFactory* objectFactory,
|
caf::PdmObjectFactory* objectFactory,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted = true ) override
|
bool stringsAreQuoted = true ) override
|
||||||
{
|
{
|
||||||
typename FieldType::FieldDataType value;
|
typename FieldType::FieldDataType value;
|
||||||
RicfFieldReader<typename FieldType::FieldDataType>::readFieldData( value,
|
RicfFieldIOHandler<typename FieldType::FieldDataType>::writeToField( value,
|
||||||
inputStream,
|
inputStream,
|
||||||
errorMessageContainer,
|
errorMessageContainer,
|
||||||
stringsAreQuoted );
|
stringsAreQuoted );
|
||||||
|
|
||||||
if ( this->isIOWriteable() )
|
if ( this->isIOWriteable() )
|
||||||
{
|
{
|
||||||
@@ -267,10 +240,10 @@ public:
|
|||||||
|
|
||||||
void writeFieldData( QTextStream& outputStream, bool quoteStrings = true, bool quoteNonBuiltins = false ) const override
|
void writeFieldData( QTextStream& outputStream, bool quoteStrings = true, bool quoteNonBuiltins = false ) const override
|
||||||
{
|
{
|
||||||
RicfFieldWriter<typename FieldType::FieldDataType>::writeFieldData( m_field->value(),
|
RicfFieldIOHandler<typename FieldType::FieldDataType>::readFromField( m_field->value(),
|
||||||
outputStream,
|
outputStream,
|
||||||
quoteStrings,
|
quoteStrings,
|
||||||
quoteNonBuiltins );
|
quoteNonBuiltins );
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -25,10 +25,9 @@ namespace caf
|
|||||||
{
|
{
|
||||||
class PdmObjectFactory;
|
class PdmObjectFactory;
|
||||||
class PdmFieldHandle;
|
class PdmFieldHandle;
|
||||||
|
class PdmScriptIOMessages;
|
||||||
} // namespace caf
|
} // namespace caf
|
||||||
|
|
||||||
class RicfMessages;
|
|
||||||
|
|
||||||
class QTextStream;
|
class QTextStream;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@@ -42,10 +41,10 @@ public:
|
|||||||
RicfFieldHandle( caf::PdmFieldHandle* owner, const QString& scriptFieldName, bool giveOwnership );
|
RicfFieldHandle( caf::PdmFieldHandle* owner, const QString& scriptFieldName, bool giveOwnership );
|
||||||
~RicfFieldHandle() override;
|
~RicfFieldHandle() override;
|
||||||
|
|
||||||
virtual void readFieldData( QTextStream& inputStream,
|
virtual void readFieldData( QTextStream& inputStream,
|
||||||
caf::PdmObjectFactory* objectFactory,
|
caf::PdmObjectFactory* objectFactory,
|
||||||
RicfMessages* errorMessageContainer,
|
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||||
bool stringsAreQuoted = true ) = 0;
|
bool stringsAreQuoted = true ) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmFieldHandle* m_owner;
|
caf::PdmFieldHandle* m_owner;
|
||||||
|
|||||||
@@ -1,90 +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 "RicfMessages.h"
|
|
||||||
#include <QTextStream>
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicfMessages::addWarning( const QString& message )
|
|
||||||
{
|
|
||||||
m_messages.push_back(
|
|
||||||
std::make_pair( MESSAGE_WARNING, "Line " + QString::number( m_currentLineNumber ) + ": " + message ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicfMessages::addError( const QString& message )
|
|
||||||
{
|
|
||||||
m_messages.push_back(
|
|
||||||
std::make_pair( MESSAGE_ERROR, "Line " + QString::number( m_currentLineNumber ) + ": " + message ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicfMessages::skipWhiteSpaceWithLineNumberCount( QTextStream& inputStream )
|
|
||||||
{
|
|
||||||
while ( !inputStream.atEnd() )
|
|
||||||
{
|
|
||||||
QChar ch = readCharWithLineNumberCount( inputStream );
|
|
||||||
if ( !ch.isSpace() )
|
|
||||||
{
|
|
||||||
inputStream.seek( inputStream.pos() - 1 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
QChar RicfMessages::readCharWithLineNumberCount( QTextStream& inputStream )
|
|
||||||
{
|
|
||||||
QChar ch;
|
|
||||||
inputStream >> ch;
|
|
||||||
if ( ch == QChar( '\n' ) )
|
|
||||||
{
|
|
||||||
m_currentLineNumber++;
|
|
||||||
}
|
|
||||||
return ch;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
QChar RicfMessages::peekNextChar( QTextStream& inputStream )
|
|
||||||
{
|
|
||||||
QChar ch;
|
|
||||||
if ( !inputStream.atEnd() )
|
|
||||||
{
|
|
||||||
inputStream >> ch;
|
|
||||||
inputStream.seek( inputStream.pos() - 1 );
|
|
||||||
}
|
|
||||||
return ch;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicfMessages::skipLineWithLineNumberCount( QTextStream& inputStream )
|
|
||||||
{
|
|
||||||
inputStream.readLine();
|
|
||||||
m_currentLineNumber++;
|
|
||||||
}
|
|
||||||
@@ -1,54 +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 <QString>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
class QTextStream;
|
|
||||||
|
|
||||||
class RicfMessages
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RicfMessages()
|
|
||||||
: m_currentLineNumber( 1 )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
enum MessageType
|
|
||||||
{
|
|
||||||
MESSAGE_WARNING,
|
|
||||||
MESSAGE_ERROR
|
|
||||||
};
|
|
||||||
|
|
||||||
void addWarning( const QString& message );
|
|
||||||
void addError( const QString& message );
|
|
||||||
|
|
||||||
void skipWhiteSpaceWithLineNumberCount( QTextStream& inputStream );
|
|
||||||
void skipLineWithLineNumberCount( QTextStream& inputStream );
|
|
||||||
|
|
||||||
QChar readCharWithLineNumberCount( QTextStream& inputStream );
|
|
||||||
QChar peekNextChar( QTextStream& inputStream );
|
|
||||||
|
|
||||||
QString currentCommand;
|
|
||||||
QString currentArgument;
|
|
||||||
std::vector<std::pair<MessageType, QString>> m_messages;
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_currentLineNumber;
|
|
||||||
};
|
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
#include "RicfObjectCapability.h"
|
#include "RicfObjectCapability.h"
|
||||||
#include "RicfFieldHandle.h"
|
#include "RicfFieldHandle.h"
|
||||||
#include "RicfMessages.h"
|
|
||||||
|
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmObjectHandle.h"
|
#include "cafPdmObjectHandle.h"
|
||||||
|
#include "cafPdmScriptIOMessages.h"
|
||||||
#include "cafPdmXmlFieldHandle.h"
|
#include "cafPdmXmlFieldHandle.h"
|
||||||
|
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
@@ -45,9 +45,9 @@ RicfObjectCapability::~RicfObjectCapability()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfObjectCapability::readFields( QTextStream& inputStream,
|
void RicfObjectCapability::readFields( QTextStream& inputStream,
|
||||||
caf::PdmObjectFactory* objectFactory,
|
caf::PdmObjectFactory* objectFactory,
|
||||||
RicfMessages* errorMessageContainer )
|
caf::PdmScriptIOMessages* errorMessageContainer )
|
||||||
{
|
{
|
||||||
std::set<QString> readFields;
|
std::set<QString> readFields;
|
||||||
bool isLastArgumentRead = false;
|
bool isLastArgumentRead = false;
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ namespace caf
|
|||||||
class PdmObject;
|
class PdmObject;
|
||||||
class PdmObjectHandle;
|
class PdmObjectHandle;
|
||||||
class PdmObjectFactory;
|
class PdmObjectFactory;
|
||||||
|
class PdmScriptIOMessages;
|
||||||
} // namespace caf
|
} // namespace caf
|
||||||
|
|
||||||
class QTextStream;
|
class QTextStream;
|
||||||
class RicfMessages;
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@@ -45,7 +45,9 @@ public:
|
|||||||
|
|
||||||
~RicfObjectCapability() override;
|
~RicfObjectCapability() override;
|
||||||
|
|
||||||
void readFields( QTextStream& inputStream, caf::PdmObjectFactory* objectFactory, RicfMessages* errorMessageContainer );
|
void readFields( QTextStream& inputStream,
|
||||||
|
caf::PdmObjectFactory* objectFactory,
|
||||||
|
caf::PdmScriptIOMessages* errorMessageContainer );
|
||||||
void writeFields( QTextStream& outputStream ) const;
|
void writeFields( QTextStream& outputStream ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -19,19 +19,19 @@
|
|||||||
#include "RifcCommandFileReader.h"
|
#include "RifcCommandFileReader.h"
|
||||||
|
|
||||||
#include "RicfCommandObject.h"
|
#include "RicfCommandObject.h"
|
||||||
#include "RicfMessages.h"
|
|
||||||
#include "RicfObjectCapability.h"
|
#include "RicfObjectCapability.h"
|
||||||
|
|
||||||
#include "cafPdmObjectFactory.h"
|
#include "cafPdmObjectFactory.h"
|
||||||
|
#include "cafPdmScriptIOMessages.h"
|
||||||
|
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands( QTextStream& inputStream,
|
std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands( QTextStream& inputStream,
|
||||||
caf::PdmObjectFactory* objectFactory,
|
caf::PdmObjectFactory* objectFactory,
|
||||||
RicfMessages* errorMessageContainer )
|
caf::PdmScriptIOMessages* errorMessageContainer )
|
||||||
{
|
{
|
||||||
std::vector<RicfCommandObject*> readCommands;
|
std::vector<RicfCommandObject*> readCommands;
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,8 @@ class QTextStream;
|
|||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
class PdmObjectFactory;
|
class PdmObjectFactory;
|
||||||
}
|
class PdmScriptIOMessages;
|
||||||
|
} // namespace caf
|
||||||
class RicfMessages;
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@@ -38,9 +37,9 @@ class RicfMessages;
|
|||||||
class RicfCommandFileReader
|
class RicfCommandFileReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static std::vector<RicfCommandObject*> readCommands( QTextStream& inputStream,
|
static std::vector<RicfCommandObject*> readCommands( QTextStream& inputStream,
|
||||||
caf::PdmObjectFactory* objectFactory,
|
caf::PdmObjectFactory* objectFactory,
|
||||||
RicfMessages* errorMessageContainer );
|
caf::PdmScriptIOMessages* errorMessageContainer );
|
||||||
|
|
||||||
static void writeCommands( QTextStream& outputStream, const std::vector<RicfCommandObject*>& commandsToWrite );
|
static void writeCommands( QTextStream& outputStream, const std::vector<RicfCommandObject*>& commandsToWrite );
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ RicfCommandFileExecutor::~RicfCommandFileExecutor()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfCommandFileExecutor::executeCommands( QTextStream& stream )
|
void RicfCommandFileExecutor::executeCommands( QTextStream& stream )
|
||||||
{
|
{
|
||||||
RicfMessages messages;
|
caf::PdmScriptIOMessages messages;
|
||||||
std::vector<RicfCommandObject*> executableCommands;
|
std::vector<RicfCommandObject*> executableCommands;
|
||||||
{
|
{
|
||||||
clearCachedData();
|
clearCachedData();
|
||||||
@@ -70,7 +70,7 @@ void RicfCommandFileExecutor::executeCommands( QTextStream& stream )
|
|||||||
RicfCommandFileReader::readCommands( stream, caf::PdmDefaultObjectFactory::instance(), &messages );
|
RicfCommandFileReader::readCommands( stream, caf::PdmDefaultObjectFactory::instance(), &messages );
|
||||||
for ( auto message : messages.m_messages )
|
for ( auto message : messages.m_messages )
|
||||||
{
|
{
|
||||||
if ( message.first == RicfMessages::MESSAGE_WARNING )
|
if ( message.first == caf::PdmScriptIOMessages::MESSAGE_WARNING )
|
||||||
{
|
{
|
||||||
RiaLogging::warning( QString( "Command file parsing warning: %1" ).arg( message.second ) );
|
RiaLogging::warning( QString( "Command file parsing warning: %1" ).arg( message.second ) );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "RicfMessages.h"
|
|
||||||
|
|
||||||
#include "cafAppEnum.h"
|
#include "cafAppEnum.h"
|
||||||
|
#include "cafPdmScriptIOMessages.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
#include "RicfFieldHandle.h"
|
#include "RicfFieldHandle.h"
|
||||||
#include "RicfMessages.h"
|
|
||||||
#include "RicfObjectCapability.h"
|
#include "RicfObjectCapability.h"
|
||||||
|
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
@@ -31,6 +30,7 @@
|
|||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmObjectScriptabilityRegister.h"
|
#include "cafPdmObjectScriptabilityRegister.h"
|
||||||
#include "cafPdmProxyValueField.h"
|
#include "cafPdmProxyValueField.h"
|
||||||
|
#include "cafPdmScriptIOMessages.h"
|
||||||
#include "cafPdmXmlFieldHandle.h"
|
#include "cafPdmXmlFieldHandle.h"
|
||||||
|
|
||||||
#include <grpcpp/grpcpp.h>
|
#include <grpcpp/grpcpp.h>
|
||||||
@@ -173,8 +173,8 @@ bool RiaGrpcServiceInterface::assignFieldValue( const QString& stringValue,
|
|||||||
auto ricfHandle = field->template capability<RicfFieldHandle>();
|
auto ricfHandle = field->template capability<RicfFieldHandle>();
|
||||||
if ( field && ricfHandle != nullptr )
|
if ( field && ricfHandle != nullptr )
|
||||||
{
|
{
|
||||||
QTextStream stream( stringValue.toLatin1() );
|
QTextStream stream( stringValue.toLatin1() );
|
||||||
RicfMessages messages;
|
caf::PdmScriptIOMessages messages;
|
||||||
*oldValue = field->toQVariant();
|
*oldValue = field->toQVariant();
|
||||||
ricfHandle->readFieldData( stream, nullptr, &messages, false );
|
ricfHandle->readFieldData( stream, nullptr, &messages, false );
|
||||||
*newValue = field->toQVariant();
|
*newValue = field->toQVariant();
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
#include "RicfCommandFileExecutor.h"
|
#include "RicfCommandFileExecutor.h"
|
||||||
#include "RicfCommandObject.h"
|
#include "RicfCommandObject.h"
|
||||||
#include "RicfMessages.h"
|
|
||||||
#include "RifcCommandFileReader.h"
|
#include "RifcCommandFileReader.h"
|
||||||
|
|
||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmScriptIOMessages.h"
|
||||||
|
|
||||||
class TestCommand1 : public RicfCommandObject
|
class TestCommand1 : public RicfCommandObject
|
||||||
{
|
{
|
||||||
@@ -80,8 +80,8 @@ TEST( RicfCommands, Test1 )
|
|||||||
|
|
||||||
// std::cout << commandString.toStdString() << std::endl;
|
// std::cout << commandString.toStdString() << std::endl;
|
||||||
|
|
||||||
QTextStream inputStream( &commandString );
|
QTextStream inputStream( &commandString );
|
||||||
RicfMessages errors;
|
caf::PdmScriptIOMessages errors;
|
||||||
|
|
||||||
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
||||||
EXPECT_EQ( (size_t)5, objects.size() );
|
EXPECT_EQ( (size_t)5, objects.size() );
|
||||||
@@ -138,8 +138,8 @@ TEST( RicfCommands, ErrorMessages )
|
|||||||
|
|
||||||
std::cout << commandString.toStdString() << std::endl;
|
std::cout << commandString.toStdString() << std::endl;
|
||||||
|
|
||||||
QTextStream inputStream( &commandString );
|
QTextStream inputStream( &commandString );
|
||||||
RicfMessages errors;
|
caf::PdmScriptIOMessages errors;
|
||||||
|
|
||||||
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ TEST( RicfCommands, ErrorMessages )
|
|||||||
for ( const auto& msg : errors.m_messages )
|
for ( const auto& msg : errors.m_messages )
|
||||||
{
|
{
|
||||||
QString label;
|
QString label;
|
||||||
if ( msg.first == RicfMessages::MESSAGE_ERROR )
|
if ( msg.first == caf::PdmScriptIOMessages::MESSAGE_ERROR )
|
||||||
{
|
{
|
||||||
label = "Error : ";
|
label = "Error : ";
|
||||||
}
|
}
|
||||||
@@ -180,8 +180,8 @@ TEST( RicfCommands, EmptyArgumentList )
|
|||||||
// Ensure no error messages when command with no arguments is read
|
// Ensure no error messages when command with no arguments is read
|
||||||
QString commandString( "TestCommand1()" );
|
QString commandString( "TestCommand1()" );
|
||||||
|
|
||||||
QTextStream inputStream( &commandString );
|
QTextStream inputStream( &commandString );
|
||||||
RicfMessages errors;
|
caf::PdmScriptIOMessages errors;
|
||||||
|
|
||||||
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
||||||
|
|
||||||
@@ -215,8 +215,8 @@ TEST( RicfCommands, TransformFileCommandObjectsToExecutableCommandObjects )
|
|||||||
|
|
||||||
)";
|
)";
|
||||||
|
|
||||||
QTextStream inputStream( &commandString );
|
QTextStream inputStream( &commandString );
|
||||||
RicfMessages errors;
|
caf::PdmScriptIOMessages errors;
|
||||||
|
|
||||||
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
||||||
EXPECT_TRUE( errors.m_messages.empty() );
|
EXPECT_TRUE( errors.m_messages.empty() );
|
||||||
@@ -252,8 +252,8 @@ TEST( RicfCommands, IgnoreCommentLines )
|
|||||||
|
|
||||||
)";
|
)";
|
||||||
|
|
||||||
QTextStream inputStream( &commandString );
|
QTextStream inputStream( &commandString );
|
||||||
RicfMessages errors;
|
caf::PdmScriptIOMessages errors;
|
||||||
|
|
||||||
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
||||||
EXPECT_TRUE( errors.m_messages.empty() );
|
EXPECT_TRUE( errors.m_messages.empty() );
|
||||||
@@ -283,8 +283,8 @@ TEST( RicfCommands, IgnoreCommentLinesShowErrorLine )
|
|||||||
|
|
||||||
)";
|
)";
|
||||||
|
|
||||||
QTextStream inputStream( &commandString );
|
QTextStream inputStream( &commandString );
|
||||||
RicfMessages errors;
|
caf::PdmScriptIOMessages errors;
|
||||||
|
|
||||||
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
auto objects = RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
||||||
EXPECT_EQ( (size_t)1, errors.m_messages.size() );
|
EXPECT_EQ( (size_t)1, errors.m_messages.size() );
|
||||||
@@ -315,8 +315,8 @@ TEST( RicfCommands, WriteCommand )
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QTextStream inputStream( &commandString );
|
QTextStream inputStream( &commandString );
|
||||||
RicfMessages errors;
|
caf::PdmScriptIOMessages errors;
|
||||||
|
|
||||||
auto objects =
|
auto objects =
|
||||||
RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
RicfCommandFileReader::readCommands( inputStream, caf::PdmDefaultObjectFactory::instance(), &errors );
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ set( PROJECT_FILES
|
|||||||
cafPdmObjectScriptabilityRegister.cpp
|
cafPdmObjectScriptabilityRegister.cpp
|
||||||
cafPdmPythonGenerator.h
|
cafPdmPythonGenerator.h
|
||||||
cafPdmPythonGenerator.cpp
|
cafPdmPythonGenerator.cpp
|
||||||
|
cafPdmScriptIOMessages.h
|
||||||
|
cafPdmScriptIOMessages.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user