Isis Developer Reference
Isis::PipelineApplication Class Reference

This class represents one application in the pipeline. More...

#include <PipelineApplication.h>

Collaboration diagram for Isis::PipelineApplication:
Collaboration graph

Public Types

enum  NameModifierType { ConstantStrings }
 This is used for branches. More...
 
enum  CustomParameterValue { LastOutput , LastAppOutputList , LastAppOutputListNoMerge }
 This is used to set custom values that must be calculated on the fly. More...
 

Public Member Functions

 PipelineApplication (QString appName, Pipeline *pipe)
 Constructs the first pipeline application.
 
 PipelineApplication (QString appName, PipelineApplication *previous)
 Constructs subsequent pipeline applications.
 
 ~PipelineApplication ()
 This is the destructor.
 
const QString & Name () const
 Get the name of this pipeline application.
 
const std::vector< QString > & ParamString () const
 Get the parameters for running this program; one element in the vector per run.
 
const std::vector< QString > & InputBranches () const
 Get the branches this program expects as input.
 
const std::vector< QString > & OutputBranches () const
 Get the branches this program has as output.
 
void Enable ()
 This method enables this program to be run.
 
void Disable ()
 This method disables this program, causing it to be ignored.
 
const bool & Enabled () const
 Returns true if this program will be run.
 
void SetInputParameter (const QString &inputParamName, bool supportsVirtualBands)
 Set the input parameter for this application and whether or not this application supports the virtual bands functionality.
 
void SetInputParameter (const QString &inputParamName, CustomParameterValue value, bool supportsVirtualBands)
 Set the input parameter for this application and whether or not this application supports the virtual bands functionality.
 
void SetOutputParameter (const QString &outputParamName, const QString &outNameModifier, const QString &outFileExtension="cub")
 Set the output parameter for this application and it's naming convention.
 
void SetOutputParameter (const QString &branch, const QString &outputParamName, const QString &outNameModifier, const QString &outFileExtension)
 Set the output parameter for a branch of this application and it's naming convention.
 
void AddBranch (const QString &modString, NameModifierType type)
 This method adds branch to this program.
 
void AddParameter (const QString &inputParamName, const QString &appParamName)
 This method adds knowledge of a parameter to the application.
 
void AddParameter (const QString &branch, const QString &inputParamName, const QString &appParamName)
 This method adds knowledge of a parameter to this application, that will only affect the specified branch.
 
void AddConstParameter (const QString &appParamName, const QString &appParamValue)
 This method adds a parameter to this application with a known value (does not get it from the user interface, must be specified).
 
void AddConstParameter (const QString &branch, const QString &appParamName, const QString &appParamValue)
 This method adds a parameter to this application with a known value (does not get it from the user interface, must be specified) that only affects a single branch.
 
void AddParameter (const QString &appParamName, CustomParameterValue value)
 This method adds a parameter with a calculated value (special) to this application.
 
void AddParameter (const QString &branch, const QString &appParamName, CustomParameterValue value)
 This method adds a parameter with a calculated value (special) to this application that only affects the specified branch.
 
QString OutputNameModifier ()
 This returns this application's output name modifier.
 
QString OutputExtension ()
 This returns this application's output file name's extension.
 
std::vector< QString > & GetOutputs ()
 This returns this application's output files. Only valid after BuildParamString is called.
 
std::vector< QString > TemporaryFiles ()
 This method returns a list of the temporary files generated by this program.
 
void SetNext (PipelineApplication *next)
 Link to the next application in the pipeline.
 
void SetPrevious (PipelineApplication *prev)
 Link to the previous application in the pipeline.
 
void BuildParamString ()
 This method calculates the inputs, outputs and necessary calls to this program for the pipeline.
 
PipelineApplicationNext () const
 This returns the next enabled pipeline application or null.
 
PipelineApplicationPrevious () const
 This returns the last enabled pipeline application or null.
 
PipelineApplicationPreviousOutputer () const
 This returns the previous enabled pipeline application that makes output or null.
 
bool SupportsVirtualBands ()
 Returns true if virtual bands are supported.
 
void SetVirtualBands (std::vector< QString > bands)
 Set the virtual bands that this application is to apply.
 
void EnableBranch (QString branch, bool flag)
 Enable/Disable Branch given the branch name.
 
bool BranchEnabled (int branch)
 Check whether a branch is enabled given branch index.
 
void SetContinue (bool pbFlag)
 Set the continue flag status.
 
bool Continue (void)
 Get the continue flag status.
 

Detailed Description

This class represents one application in the pipeline.

This contains methods for setting application-specific parameters, such as application inputs and outputs. Only pipeline should be instantiating these!

The applications work as a doubly-linked list in order to calculate inputs and outputs correctly. Calling SetNext or SetPrevious is not recommended.

Author
2008-08-04 Steven Lambright

Member Enumeration Documentation

◆ CustomParameterValue

This is used to set custom values that must be calculated on the fly.

Enumerator
LastOutput 

The very last output file. Do not use this for input parameters if it's not necessary, that is done automatically.

LastAppOutputList 

A list of files from the last run application's output.

LastAppOutputListNoMerge 

A list of files from the last run application's output.

◆ NameModifierType

This is used for branches.

Right now, only known strings can be used to specify each branch.

Enumerator
ConstantStrings 

Known strings.

Constructor & Destructor Documentation

◆ PipelineApplication() [1/2]

Isis::PipelineApplication::PipelineApplication ( QString appName,
Pipeline * pipe )

Constructs the first pipeline application.

Parameters
appNameThe name of this application
pipeThe pipeline
History
2010-12-20 Sharmila Prasad Initialise & enable the branches

References Isis::Pipeline::OriginalBranches().

◆ PipelineApplication() [2/2]

Isis::PipelineApplication::PipelineApplication ( QString appName,
PipelineApplication * previous )

Constructs subsequent pipeline applications.

Parameters
appNameThe name of this application
previousThe previously last pipeline application
History
2010-12-20 Sharmila Prasad Initialise & enable the branches

References OutputBranches(), and SetNext().

◆ ~PipelineApplication()

Isis::PipelineApplication::~PipelineApplication ( )
inline

This is the destructor.

Member Function Documentation

◆ AddBranch()

void Isis::PipelineApplication::AddBranch ( const QString & modString,
NameModifierType type )

This method adds branch to this program.

A branch means with one input, multiple outputs are automatically created.

Example:

thm2isis from=input.img to=output.cub

In this code, thm2isis could actually create output.even.cub and output.odd.cub. The branches are then "even" and "odd". This is used only for the case where the program outputs multiple images based upon one "TO" parameter.

Parameters
modStringBranch name
typeModifier type; currently only supports constant strings
History
2010-12-20 Sharmila Prasad Enable the branch at the time of creation

References _FILEINFO_, and Isis::IException::Programmer.

◆ AddConstParameter() [1/2]

void Isis::PipelineApplication::AddConstParameter ( const QString & appParamName,
const QString & appParamValue )

This method adds a parameter to this application with a known value (does not get it from the user interface, must be specified).

Parameters
appParamNameName of the parameter
appParamValueValue of the parameter

References Name().

◆ AddConstParameter() [2/2]

void Isis::PipelineApplication::AddConstParameter ( const QString & branch,
const QString & appParamName,
const QString & appParamValue )

This method adds a parameter to this application with a known value (does not get it from the user interface, must be specified) that only affects a single branch.

Parameters
branchBranch this parameter affects
appParamNameName of the parameter
appParamValueValue of the parameter

◆ AddParameter() [1/4]

void Isis::PipelineApplication::AddParameter ( const QString & appParamName,
CustomParameterValue value )

This method adds a parameter with a calculated value (special) to this application.

Parameters
appParamNameParameter name
valueValue type

◆ AddParameter() [2/4]

void Isis::PipelineApplication::AddParameter ( const QString & branch,
const QString & appParamName,
CustomParameterValue value )

This method adds a parameter with a calculated value (special) to this application that only affects the specified branch.

Parameters
branchBranch this parameter affects
appParamNameParameter name
valueValue type

◆ AddParameter() [3/4]

void Isis::PipelineApplication::AddParameter ( const QString & branch,
const QString & inputParamName,
const QString & appParamName )

This method adds knowledge of a parameter to this application, that will only affect the specified branch.

The parameter value is taken directly from the user interface; internal defaults are supported by not using the parameter.

Parameters
branchThe branch this parameter affects
inputParamNameParameter in the proc program
appParamNameParameter in the this application

References Isis::Application::GetUserInterface().

◆ AddParameter() [4/4]

void Isis::PipelineApplication::AddParameter ( const QString & inputParamName,
const QString & appParamName )

This method adds knowledge of a parameter to the application.

The parameter value is taken directly from the user interface.

Parameters
inputParamNameParameter in the proc program
appParamNameParameter in this application

References Isis::Application::GetUserInterface().

◆ BranchEnabled()

bool Isis::PipelineApplication::BranchEnabled ( int branch)
inline

Check whether a branch is enabled given branch index.

Author
Sharmila Prasad (12/20/2010)
Parameters
branch- index into the branch
Returns
bool - true/false

Referenced by BuildParamString().

◆ BuildParamString()

void Isis::PipelineApplication::BuildParamString ( )

This method calculates the inputs, outputs and necessary calls to this program for the pipeline.

This should only be used by Pipeline.

History
2010-12-20 Sharmila Prasad Set appropriate inputs to the branch taking into consideration whether the previous branch was enabled/disabled. Also set the input list accordingly if needlist is true

References _FILEINFO_, Isis::FileName::baseName(), BranchEnabled(), Enabled(), Isis::IsSpecial(), LastAppOutputList, LastOutput, Isis::PipelineParameter::Name(), Name(), Previous(), Isis::IException::Programmer, and Isis::Pipeline::TemporaryFolder().

◆ Continue()

bool Isis::PipelineApplication::Continue ( void )
inline

Get the continue flag status.

Author
Sharmila Prasad (2/9/2011)
Returns
bool - return continue status

◆ Disable()

void Isis::PipelineApplication::Disable ( )
inline

This method disables this program, causing it to be ignored.

◆ Enable()

void Isis::PipelineApplication::Enable ( )
inline

This method enables this program to be run.

◆ EnableBranch()

void Isis::PipelineApplication::EnableBranch ( QString branch,
bool flag )
inline

Enable/Disable Branch given the branch name.

Author
Sharmila Prasad (12/20/2010)
Parameters
branch- branch name
flag- true/false

◆ Enabled()

const bool & Isis::PipelineApplication::Enabled ( ) const
inline

◆ GetOutputs()

vector< QString > & Isis::PipelineApplication::GetOutputs ( )

This returns this application's output files. Only valid after BuildParamString is called.

References Enabled(), GetOutputs(), and Previous().

Referenced by GetOutputs().

◆ InputBranches()

const std::vector< QString > & Isis::PipelineApplication::InputBranches ( ) const
inline

Get the branches this program expects as input.

◆ Name()

const QString & Isis::PipelineApplication::Name ( ) const
inline

Get the name of this pipeline application.

Referenced by AddConstParameter(), BuildParamString(), and Isis::Pipeline::Run().

◆ Next()

PipelineApplication * Isis::PipelineApplication::Next ( ) const
inline

This returns the next enabled pipeline application or null.

References Enabled(), and Next().

Referenced by Next().

◆ OutputBranches()

const std::vector< QString > & Isis::PipelineApplication::OutputBranches ( ) const
inline

Get the branches this program has as output.

References Enabled(), OutputBranches(), and Previous().

Referenced by OutputBranches(), and PipelineApplication().

◆ OutputExtension()

QString Isis::PipelineApplication::OutputExtension ( )
inline

This returns this application's output file name's extension.

References OutputExtension(), and Previous().

Referenced by OutputExtension().

◆ OutputNameModifier()

QString Isis::PipelineApplication::OutputNameModifier ( )
inline

This returns this application's output name modifier.

References OutputNameModifier(), and Previous().

Referenced by OutputNameModifier().

◆ ParamString()

const std::vector< QString > & Isis::PipelineApplication::ParamString ( ) const
inline

Get the parameters for running this program; one element in the vector per run.

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

◆ Previous()

PipelineApplication * Isis::PipelineApplication::Previous ( ) const
inline

This returns the last enabled pipeline application or null.

References Enabled(), and Previous().

Referenced by BuildParamString(), GetOutputs(), OutputBranches(), OutputExtension(), OutputNameModifier(), Previous(), and PreviousOutputer().

◆ PreviousOutputer()

PipelineApplication * Isis::PipelineApplication::PreviousOutputer ( ) const
inline

This returns the previous enabled pipeline application that makes output or null.

References Enabled(), and Previous().

◆ SetContinue()

void Isis::PipelineApplication::SetContinue ( bool pbFlag)
inline

Set the continue flag status.

Author
Sharmila Prasad (2/9/2011)
Parameters
pbFlag- true/false

◆ SetInputParameter() [1/2]

void Isis::PipelineApplication::SetInputParameter ( const QString & inputParamName,
bool supportsVirtualBands )

Set the input parameter for this application and whether or not this application supports the virtual bands functionality.

It supports the virtual bands functionality if the input is an Isis cube.

Parameters
inputParamNameName of the input parameter, typically "FROM"
supportsVirtualBandsTrue if this application supports virtual bands

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

◆ SetInputParameter() [2/2]

void Isis::PipelineApplication::SetInputParameter ( const QString & inputParamName,
CustomParameterValue value,
bool supportsVirtualBands )

Set the input parameter for this application and whether or not this application supports the virtual bands functionality.

It supports the virtual bands functionality if the input is an Isis cube.

Parameters
inputParamNameName of the input parameter, typically "FROM"
valueCustom parameter value; Recommended to use an alternate SetInputParameter instead of specifying LastOutput
supportsVirtualBandsTrue if this application supports virtual bands

References LastAppOutputList, and LastAppOutputListNoMerge.

◆ SetNext()

void Isis::PipelineApplication::SetNext ( PipelineApplication * next)
inline

Link to the next application in the pipeline.

Parameters
nextThe next pipeline application

Referenced by PipelineApplication().

◆ SetOutputParameter() [1/2]

void Isis::PipelineApplication::SetOutputParameter ( const QString & branch,
const QString & outputParamName,
const QString & outNameModifier,
const QString & outFileExtension )

Set the output parameter for a branch of this application and it's naming convention.

This is meant for an application that splits the input into two output files via two output parameters.

Parameters
branchBranch this output parameter applies to
outputParamNameName of the output parameter
outNameModifierModifier to add to the cube name, such as "lev1"
outFileExtensionExtension of the output file (usually "cub" for cube)

◆ SetOutputParameter() [2/2]

void Isis::PipelineApplication::SetOutputParameter ( const QString & outputParamName,
const QString & outNameModifier,
const QString & outFileExtension = "cub" )

Set the output parameter for this application and it's naming convention.

Parameters
outputParamNameName of the output parameter
outNameModifierModifier to add to the cube name, such as "lev1"
outFileExtensionExtension of the output file (usually "cub" for cube)

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

◆ SetPrevious()

void Isis::PipelineApplication::SetPrevious ( PipelineApplication * prev)
inline

Link to the previous application in the pipeline.

Parameters
prevThe previous pipeline application

◆ SetVirtualBands()

void Isis::PipelineApplication::SetVirtualBands ( std::vector< QString > bands)

Set the virtual bands that this application is to apply.

Empty for none.

Parameters
bandsThe virtual bands string, excluding the "+". For example, "2,4-5,8"

◆ SupportsVirtualBands()

bool Isis::PipelineApplication::SupportsVirtualBands ( )

Returns true if virtual bands are supported.

Returns
bool Virtual bands supported

References Enabled().

◆ TemporaryFiles()

vector< QString > Isis::PipelineApplication::TemporaryFiles ( )

This method returns a list of the temporary files generated by this program.

Returns
vector<QString> The temporary files

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


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