mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -23,54 +23,54 @@
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QStringList>
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfLoadCaseResult, "loadCaseResult");
|
||||
CAF_PDM_SOURCE_INIT( RicfLoadCaseResult, "loadCaseResult" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfLoadCaseResult::RicfLoadCaseResult(int caseId)
|
||||
RicfLoadCaseResult::RicfLoadCaseResult( int caseId )
|
||||
{
|
||||
CAF_PDM_InitObject("case_result", "", "", "");
|
||||
CAF_PDM_InitField(&this->caseId, "id", caseId, "", "", "", "");
|
||||
CAF_PDM_InitObject( "case_result", "", "", "" );
|
||||
CAF_PDM_InitField( &this->caseId, "id", caseId, "", "", "", "" );
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfLoadCase, "loadCase");
|
||||
CAF_PDM_SOURCE_INIT( RicfLoadCase, "loadCase" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfLoadCase::RicfLoadCase()
|
||||
{
|
||||
RICF_InitField(&m_path, "path", QString(), "Path to Case File", "", "", "");
|
||||
RICF_InitField( &m_path, "path", QString(), "Path to Case File", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfLoadCase::execute()
|
||||
{
|
||||
QString absolutePath = m_path;
|
||||
QFileInfo projectPathInfo(absolutePath);
|
||||
if (!projectPathInfo.exists())
|
||||
QFileInfo projectPathInfo( absolutePath );
|
||||
if ( !projectPathInfo.exists() )
|
||||
{
|
||||
QDir startDir(RiaApplication::instance()->startDir());
|
||||
absolutePath = startDir.absoluteFilePath(m_path);
|
||||
QDir startDir( RiaApplication::instance()->startDir() );
|
||||
absolutePath = startDir.absoluteFilePath( m_path );
|
||||
}
|
||||
|
||||
RiaImportEclipseCaseTools::FileCaseIdMap fileCaseIdMap;
|
||||
bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile(QStringList({absolutePath}), &fileCaseIdMap, true);
|
||||
if (!ok)
|
||||
bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile( QStringList( {absolutePath} ), &fileCaseIdMap, true );
|
||||
if ( !ok )
|
||||
{
|
||||
QString error = QString("loadCase: Unable to load case from %1").arg(absolutePath);
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
QString error = QString( "loadCase: Unable to load case from %1" ).arg( absolutePath );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
CAF_ASSERT(fileCaseIdMap.size() == 1u);
|
||||
CAF_ASSERT( fileCaseIdMap.size() == 1u );
|
||||
RicfCommandResponse response;
|
||||
response.setResult(new RicfLoadCaseResult(fileCaseIdMap.begin()->second));
|
||||
response.setResult( new RicfLoadCaseResult( fileCaseIdMap.begin()->second ) );
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user