OpendTect
6.6
|
Launches machine commands. More...
Public Member Functions | |
CommandLauncher (const MachineCommand &) | |
~CommandLauncher () | |
uiString | errorMsg () const |
bool | execute (BufferString &output_stdout, BufferString *output_stderr=nullptr, const char *workdir=nullptr) |
run &, wait until finished, catch output More... | |
bool | execute (const CommandExecPars &) |
bool | execute (LaunchType lt=Wait4Finish, const char *workdir=nullptr) |
od_istream * | getStdError () |
od_ostream * | getStdInput () |
od_istream * | getStdOutput () |
const char * | monitorFileName () const |
PID_Type | processID () const |
void | set (const MachineCommand &) |
bool | startServer (bool inpythonenv, const char *stdoutfnm, const char *stderrfnm, double maxwaittm=20) |
bool | startServer (bool inpythonenv=false, double maxwaittm=20) |
Static Public Member Functions | |
static void | addQuotesIfNeeded (BufferString &cmd) |
static void | addShellIfNeeded (BufferString &cmd) |
static void | manageQProcess (QProcess *) |
static bool | openTerminal (const char *cmd, const BufferStringSet *args, BufferString *errmsg=nullptr, uiString *launchermsg=nullptr, const char *workdir=nullptr) |
static bool | openTerminal (const char *workdir) |
Protected Member Functions | |
int | catchError () |
bool | doExecute (const MachineCommand &, const CommandExecPars &) |
void | reset () |
bool | startDetached (const MachineCommand &, bool inconsole=false, const char *workingdir=nullptr) |
void | startMonitor () |
Protected Attributes | |
uiString | errmsg_ |
MachineCommand | machcmd_ |
BufferString | monitorfnm_ |
const BufferString | odprogressviewer_ |
PID_Type | pid_ |
QProcess * | process_ |
BufferString | progvwrcmd_ |
bool | redirectoutput_ |
od_istream * | stderror_ |
qstreambuf * | stderrorbuf_ |
od_ostream * | stdinput_ |
qstreambuf * | stdinputbuf_ |
od_istream * | stdoutput_ |
qstreambuf * | stdoutputbuf_ |
Private Member Functions | |
void | adaptForV7 (const OS::MachineCommand &) |
void | setIsolated () |
Launches machine commands.
<>
OS::CommandLauncher::CommandLauncher | ( | const MachineCommand & | ) |
OS::CommandLauncher::~CommandLauncher | ( | ) |
|
private |
|
static |
Checks for spaces in command, and surrounds command with quotes them if not already done.
|
static |
Analyses the cmd and looks for pipes or redirects. If these are found, the cmd is converted to a shell command.
|
protected |
|
protected |
|
inline |
bool OS::CommandLauncher::execute | ( | BufferString & | output_stdout, |
BufferString * | output_stderr = nullptr , |
||
const char * | workdir = nullptr |
||
) |
run &, wait until finished, catch output
bool OS::CommandLauncher::execute | ( | const CommandExecPars & | ) |
bool OS::CommandLauncher::execute | ( | LaunchType | lt = Wait4Finish , |
const char * | workdir = nullptr |
||
) |
|
inline |
|
inline |
|
inline |
|
static |
Add a QProcess and it will be deleted one day.
|
inline |
|
static |
|
static |
PID_Type OS::CommandLauncher::processID | ( | ) | const |
|
protected |
void OS::CommandLauncher::set | ( | const MachineCommand & | ) |
|
private |
|
protected |
|
protected |
bool OS::CommandLauncher::startServer | ( | bool | inpythonenv, |
const char * | stdoutfnm, | ||
const char * | stderrfnm, | ||
double | maxwaittm = 20 |
||
) |
bool OS::CommandLauncher::startServer | ( | bool | inpythonenv = false , |
double | maxwaittm = 20 |
||
) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022