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:
@@ -2,17 +2,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -28,56 +28,62 @@
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfRunOctaveScript, "runOctaveScript");
|
||||
CAF_PDM_SOURCE_INIT( RicfRunOctaveScript, "runOctaveScript" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfRunOctaveScript::RicfRunOctaveScript()
|
||||
{
|
||||
RICF_InitField(&m_path, "path", QString(), "Path", "", "", "");
|
||||
RICF_InitField(&m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "");
|
||||
RICF_InitField( &m_path, "path", QString(), "Path", "", "", "" );
|
||||
RICF_InitField( &m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfRunOctaveScript::execute()
|
||||
{
|
||||
QString octavePath = RiaApplication::instance()->octavePath();
|
||||
|
||||
QStringList processArguments = RimCalcScript::createCommandLineArguments(m_path());
|
||||
QStringList processArguments = RimCalcScript::createCommandLineArguments( m_path() );
|
||||
|
||||
std::vector<int> caseIds = m_caseIds();
|
||||
if (caseIds.empty())
|
||||
if ( caseIds.empty() )
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
if (project)
|
||||
if ( project )
|
||||
{
|
||||
auto eclipeCases = project->eclipseCases();
|
||||
for (auto c : eclipeCases)
|
||||
for ( auto c : eclipeCases )
|
||||
{
|
||||
caseIds.push_back(c->caseId());
|
||||
caseIds.push_back( c->caseId() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ok;
|
||||
if (caseIds.empty())
|
||||
if ( caseIds.empty() )
|
||||
{
|
||||
ok = RiaApplication::instance()->launchProcess(octavePath, processArguments, RiaApplication::instance()->octaveProcessEnvironment());
|
||||
ok = RiaApplication::instance()->launchProcess( octavePath,
|
||||
processArguments,
|
||||
RiaApplication::instance()->octaveProcessEnvironment() );
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = RiaApplication::instance()->launchProcessForMultipleCases(octavePath, processArguments, caseIds, RiaApplication::instance()->octaveProcessEnvironment());
|
||||
ok = RiaApplication::instance()
|
||||
->launchProcessForMultipleCases( octavePath,
|
||||
processArguments,
|
||||
caseIds,
|
||||
RiaApplication::instance()->octaveProcessEnvironment() );
|
||||
}
|
||||
|
||||
RicfCommandResponse response;
|
||||
if (!ok)
|
||||
if ( !ok )
|
||||
{
|
||||
QString error = QString("runOctaveScript: Could not execute script %1").arg(m_path());
|
||||
RiaLogging::error(error);
|
||||
response.updateStatus(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
QString error = QString( "runOctaveScript: Could not execute script %1" ).arg( m_path() );
|
||||
RiaLogging::error( error );
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user