USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::ProgramLauncher Class Reference

Execute External Programs and Commands. More...

#include <ProgramLauncher.h>

Collaboration diagram for Isis::ProgramLauncher:
Collaboration graph

Static Public Member Functions

static void RunIsisProgram (QString isisProgramName, QString arguments)
 Executes the Isis program with the given arguments.
 
static void RunSystemCommand (QString commandLine)
 This runs arbitrary system commands.
 

Private Member Functions

 ProgramLauncher ()
 Construction is not allowed.
 
 ~ProgramLauncher ()
 Destruction is not allowed.
 
 ProgramLauncher (ProgramLauncher &other)
 Copy construction is not allowed.
 
ProgramLauncheroperator= (ProgramLauncher &other)
 Assignment is not allowed.
 

Static Private Member Functions

static IException ProcessIsisMessageFromChild (QString code, QString msg)
 This interprets a message sent along the pipe from a child process to us (the parent).
 

Detailed Description

Execute External Programs and Commands.

This class is designed to handle running any other programs or commands.

Author
2010-12-03 Steven Lambright
History:

2010-12-03 Steven Lambright - Original version

2011-08-19 Jeannie Backer - Modified unitTest to use $temporary variable instead of /tmp directory.

Definition at line 45 of file ProgramLauncher.h.

Constructor & Destructor Documentation

Isis::ProgramLauncher::ProgramLauncher ( )
private

Construction is not allowed.

Isis::ProgramLauncher::~ProgramLauncher ( )
private

Destruction is not allowed.

Isis::ProgramLauncher::ProgramLauncher ( ProgramLauncher other)
private

Copy construction is not allowed.

Parameters
other

Member Function Documentation

ProgramLauncher& Isis::ProgramLauncher::operator= ( ProgramLauncher other)
private

Assignment is not allowed.

Parameters
other
Returns
IException Isis::ProgramLauncher::ProcessIsisMessageFromChild ( QString  code,
QString  msg 
)
staticprivate

This interprets a message sent along the pipe from a child process to us (the parent).

Parameters
codeThe text code of the message - this is used to determine what the message contains.
msgThe data sent along with a code. This is a string, number, PvlGroup, Pvl, etc... really anything. It depends on the code parameter.

Definition at line 165 of file ProgramLauncher.cpp.

References Isis::IException::append(), Isis::Application::GuiLog(), Isis::Application::Log(), Isis::toInt(), and Isis::Application::UpdateProgress().

void Isis::ProgramLauncher::RunIsisProgram ( QString  programName,
QString  parameters 
)
static

Executes the Isis program with the given arguments.

This will handle logs, GUI updates, and similar tasks. Please use this even when there is no instance of Isis::Application, so long as the thing you are running has an Isis::Application (do not use this for qview, qnet, qtie, etc for now).

Please do not specify -pid.

Parameters
programNameThe Isis program name to be run (i.e. catlab, cubeatt)
parametersThe arguments to give to the program that is being run

Definition at line 53 of file ProgramLauncher.cpp.

References _FILEINFO_, Isis::IException::append(), and Isis::toString().

Referenced by Isis::Pipeline::Run().

void Isis::ProgramLauncher::RunSystemCommand ( QString  fullCommand)
static

This runs arbitrary system commands.

You can run programs like "qview" with this, or commands like "ls | grep *.cpp > out.txt". Please do not use this for Isis programs not in qisis.

Example: qview should use RunIsisProgram to run camstats. camstats should use RunSystemCommand to run qview.

Parameters
fullCommandA string containing the command formatted like what you would type in a terminal

Definition at line 223 of file ProgramLauncher.cpp.

References _FILEINFO_, and Isis::toString().

Referenced by Isis::UserInterface::evaluateOption(), Isis::ControlPointEdit::saveChips(), and Isis::GuiCubeParameter::ViewCube().


The documentation for this class was generated from the following files: