mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-05 21:53:27 -06:00
#4284 runOctaveScript : If no case id is specified, run script on all cases
This commit is contained in:
parent
93d960d211
commit
f99a332277
@ -23,6 +23,8 @@
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimCalcScript.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
@ -46,14 +48,28 @@ void RicfRunOctaveScript::execute()
|
||||
|
||||
QStringList processArguments = RimCalcScript::createCommandLineArguments(m_path());
|
||||
|
||||
std::vector<int> caseIds = m_caseIds();
|
||||
if (caseIds.empty())
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
if (project)
|
||||
{
|
||||
auto eclipeCases = project->eclipseCases();
|
||||
for (auto c : eclipeCases)
|
||||
{
|
||||
caseIds.push_back(c->caseId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ok;
|
||||
if (m_caseIds().empty())
|
||||
if (caseIds.empty())
|
||||
{
|
||||
ok = RiaApplication::instance()->launchProcess(octavePath, processArguments);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = RiaApplication::instance()->launchProcessForMultipleCases(octavePath, processArguments, m_caseIds());
|
||||
ok = RiaApplication::instance()->launchProcessForMultipleCases(octavePath, processArguments, caseIds);
|
||||
}
|
||||
if (!ok)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user