mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
This commit is contained in:
parent
94703d72c2
commit
48401d5a85
@ -217,6 +217,8 @@ RiaApplication::RiaApplication(int& argc, char** argv)
|
||||
|
||||
m_runningRegressionTests = false;
|
||||
|
||||
m_runningWorkerProcess = false;
|
||||
|
||||
m_mainPlotWindow = NULL;
|
||||
|
||||
m_recentFileActionProvider = std::unique_ptr<RiuRecentFileActionProvider>(new RiuRecentFileActionProvider);
|
||||
@ -1943,6 +1945,7 @@ void RiaApplication::slotWorkerProcessFinished(int exitCode, QProcess::ExitStatu
|
||||
if (exitStatus == QProcess::CrashExit)
|
||||
{
|
||||
// MFLog::error("Simulation execution crashed or was aborted.");
|
||||
m_runningWorkerProcess = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1954,6 +1957,7 @@ void RiaApplication::slotWorkerProcessFinished(int exitCode, QProcess::ExitStatu
|
||||
if (exitCode != 0)
|
||||
{
|
||||
// MFLog::error(QString("Simulation execution failed (exit code %1).").arg(exitCode));
|
||||
m_runningWorkerProcess = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1966,6 +1970,7 @@ void RiaApplication::slotWorkerProcessFinished(int exitCode, QProcess::ExitStatu
|
||||
{
|
||||
// Disable concept of current case
|
||||
m_socketServer->setCurrentCaseId(-1);
|
||||
m_runningWorkerProcess = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1990,6 +1995,7 @@ bool RiaApplication::launchProcess(const QString& program, const QStringList& ar
|
||||
m_socketServer->setCurrentCaseId(-1);
|
||||
}
|
||||
|
||||
m_runningWorkerProcess = true;
|
||||
m_workerProcess = new caf::UiProcess(this);
|
||||
|
||||
QProcessEnvironment penv = QProcessEnvironment::systemEnvironment();
|
||||
@ -2026,6 +2032,7 @@ bool RiaApplication::launchProcess(const QString& program, const QStringList& ar
|
||||
{
|
||||
m_workerProcess->close();
|
||||
m_workerProcess = NULL;
|
||||
m_runningWorkerProcess = false;
|
||||
|
||||
RiuMainWindow::instance()->processMonitor()->stopMonitorWorkProcess();
|
||||
|
||||
@ -2145,9 +2152,21 @@ void RiaApplication::terminateProcess()
|
||||
m_workerProcess->close();
|
||||
}
|
||||
|
||||
m_runningWorkerProcess = false;
|
||||
m_workerProcess = NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::waitForProcess() const
|
||||
{
|
||||
while (m_runningWorkerProcess)
|
||||
{
|
||||
Sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -165,6 +165,7 @@ public:
|
||||
bool launchProcess(const QString& program, const QStringList& arguments);
|
||||
bool launchProcessForMultipleCases(const QString& program, const QStringList& arguments, const std::vector<int>& caseIds);
|
||||
void terminateProcess();
|
||||
void waitForProcess() const;
|
||||
|
||||
RiaPreferences* preferences();
|
||||
void applyPreferences();
|
||||
@ -267,6 +268,8 @@ private:
|
||||
QString m_helpText;
|
||||
bool m_runningRegressionTests;
|
||||
|
||||
bool m_runningWorkerProcess;
|
||||
|
||||
RiuMainPlotWindow* m_mainPlotWindow;
|
||||
|
||||
std::unique_ptr<RiuRecentFileActionProvider> m_recentFileActionProvider;
|
||||
|
@ -60,4 +60,8 @@ void RicfRunOctaveScript::execute()
|
||||
{
|
||||
RiaLogging::error(QString("runOctaveScript: Could not execute script %1").arg(m_path()));
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaApplication::instance()->waitForProcess();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user