mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 15:41:00 -05:00
Add preferences for HPC/Batch scheduler Add Slurm and LSF support Add batch job monitor Support launcher specific user settings Use internal timer to refresh job state Add some more options to batch monitor Improve naming Add tests for job lists Change WSL handling for processes.
58 lines
1.7 KiB
C++
58 lines
1.7 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2021 Equinor 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 <QObject>
|
|
#include <QProcess>
|
|
|
|
#include <QString>
|
|
#include <QStringList>
|
|
|
|
class RimProcessMonitor : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit RimProcessMonitor( size_t processId, bool logStdOutErr = true );
|
|
|
|
void clearStdOutErr();
|
|
const QStringList& stdOut() const;
|
|
const QStringList& stdErr() const;
|
|
|
|
virtual void appendStdOut( QString line );
|
|
virtual void appendStdErr( QString line );
|
|
|
|
void setProcessId( size_t processId );
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
virtual void error( QProcess::ProcessError error );
|
|
virtual void finished( int exitCode, QProcess::ExitStatus exitStatus );
|
|
virtual void readyReadStandardError();
|
|
virtual void readyReadStandardOutput();
|
|
virtual void started();
|
|
|
|
protected:
|
|
QString addPrefix( QString message );
|
|
size_t m_processId;
|
|
bool m_logStdOutErr;
|
|
QStringList m_stdOut;
|
|
QStringList m_stdErr;
|
|
};
|