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

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

◆ ~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

◆ 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 &  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 IsisAml::GetAsString(), Isis::Application::GetUserInterface(), and IsisAml::WasEntered().

◆ AddParameter() [2/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 IsisAml::GetAsString(), Isis::Application::GetUserInterface(), and IsisAml::WasEntered().

◆ AddParameter() [3/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() [4/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

◆ 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(), GetOutputs(), Isis::IsSpecial(), Isis::PipelineParameter::IsSpecial(), Name(), OutputBranches(), Previous(), Isis::IException::Programmer, and Isis::PipelineParameter::Special().

◆ 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

Returns true if this program will be run.

Referenced by Isis::Pipeline::FinalOutput(), Next(), Isis::operator<<(), OutputBranches(), Previous(), and PreviousOutputer().

◆ GetOutputs()

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

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

Referenced by BuildParamString().

◆ 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 BuildParamString(), and Isis::operator<<().

◆ 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 BuildParamString(), Isis::Pipeline::FinalOutput(), and OutputBranches().

◆ OutputExtension()

QString Isis::PipelineApplication::OutputExtension ( )
inline

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

References OutputExtension(), and Previous().

Referenced by Isis::Pipeline::FinalOutput(), and OutputExtension().

◆ OutputNameModifier()

QString Isis::PipelineApplication::OutputNameModifier ( )
inline

This returns this application's output name modifier.

References OutputNameModifier(), and Previous().

Referenced by Isis::Pipeline::FinalOutput(), and 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::operator<<().

◆ Previous()

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

This returns the last enabled pipeline application or null.

References Enabled(), and Previous().

Referenced by BuildParamString(), Isis::Pipeline::FinalOutput(), 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 3 cube.

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

◆ 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 3 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

◆ SetNext()

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

Link to the next application in the pipeline.

Parameters
nextThe next pipeline application

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

◆ SetOutputParameter() [1/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)

◆ SetOutputParameter() [2/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)

◆ SetPrevious()

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

Link to the previous application in the pipeline.

Parameters
prevThe previous pipeline application

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

◆ 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

◆ 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::operator<<().


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