Isis Developer Reference
|
This class represents one application in the pipeline. More...
#include <PipelineApplication.h>
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. | |
PipelineApplication * | Next () const |
This returns the next enabled pipeline application or null. | |
PipelineApplication * | Previous () const |
This returns the last enabled pipeline application or null. | |
PipelineApplication * | PreviousOutputer () 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. | |
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.
This is used to set custom values that must be calculated on the fly.
Isis::PipelineApplication::PipelineApplication | ( | QString | appName, |
Pipeline * | pipe ) |
Constructs the first pipeline application.
appName | The name of this application |
pipe | The pipeline |
References Isis::Pipeline::OriginalBranches().
Isis::PipelineApplication::PipelineApplication | ( | QString | appName, |
PipelineApplication * | previous ) |
Constructs subsequent pipeline applications.
appName | The name of this application |
previous | The previously last pipeline application |
References OutputBranches(), and SetNext().
|
inline |
This is the destructor.
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:
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.
modString | Branch name |
type | Modifier type; currently only supports constant strings |
References _FILEINFO_, and Isis::IException::Programmer.
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).
appParamName | Name of the parameter |
appParamValue | Value of the parameter |
References Name().
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.
branch | Branch this parameter affects |
appParamName | Name of the parameter |
appParamValue | Value of the parameter |
void Isis::PipelineApplication::AddParameter | ( | const QString & | appParamName, |
CustomParameterValue | value ) |
This method adds a parameter with a calculated value (special) to this application.
appParamName | Parameter name |
value | Value type |
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.
branch | Branch this parameter affects |
appParamName | Parameter name |
value | Value type |
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.
branch | The branch this parameter affects |
inputParamName | Parameter in the proc program |
appParamName | Parameter in the this application |
References Isis::Application::GetUserInterface().
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.
inputParamName | Parameter in the proc program |
appParamName | Parameter in this application |
References Isis::Application::GetUserInterface().
|
inline |
Check whether a branch is enabled given branch index.
branch | - index into the branch |
Referenced by 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.
References _FILEINFO_, Isis::FileName::baseName(), BranchEnabled(), Enabled(), Isis::IsSpecial(), LastAppOutputList, LastOutput, Isis::PipelineParameter::Name(), Name(), Previous(), Isis::IException::Programmer, and Isis::Pipeline::TemporaryFolder().
|
inline |
Get the continue flag status.
|
inline |
This method disables this program, causing it to be ignored.
|
inline |
This method enables this program to be run.
|
inline |
Enable/Disable Branch given the branch name.
branch | - branch name |
flag | - true/false |
|
inline |
Returns true if this program will be run.
Referenced by BuildParamString(), GetOutputs(), Next(), OutputBranches(), Previous(), PreviousOutputer(), Isis::Pipeline::Run(), and SupportsVirtualBands().
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().
|
inline |
Get the branches this program expects as input.
|
inline |
Get the name of this pipeline application.
Referenced by AddConstParameter(), BuildParamString(), and Isis::Pipeline::Run().
|
inline |
|
inline |
Get the branches this program has as output.
References Enabled(), OutputBranches(), and Previous().
Referenced by OutputBranches(), and PipelineApplication().
|
inline |
This returns this application's output file name's extension.
References OutputExtension(), and Previous().
Referenced by OutputExtension().
|
inline |
This returns this application's output name modifier.
References OutputNameModifier(), and Previous().
Referenced by OutputNameModifier().
|
inline |
Get the parameters for running this program; one element in the vector per run.
Referenced by Isis::Pipeline::Run().
|
inline |
This returns the last enabled pipeline application or null.
References Enabled(), and Previous().
Referenced by BuildParamString(), GetOutputs(), OutputBranches(), OutputExtension(), OutputNameModifier(), Previous(), and PreviousOutputer().
|
inline |
This returns the previous enabled pipeline application that makes output or null.
References Enabled(), and Previous().
|
inline |
Set the continue flag status.
pbFlag | - true/false |
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.
inputParamName | Name of the input parameter, typically "FROM" |
supportsVirtualBands | True if this application supports virtual bands |
Referenced by Isis::Pipeline::Prepare().
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.
inputParamName | Name of the input parameter, typically "FROM" |
value | Custom parameter value; Recommended to use an alternate SetInputParameter instead of specifying LastOutput |
supportsVirtualBands | True if this application supports virtual bands |
References LastAppOutputList, and LastAppOutputListNoMerge.
|
inline |
Link to the next application in the pipeline.
next | The next pipeline application |
Referenced by PipelineApplication().
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.
branch | Branch this output parameter applies to |
outputParamName | Name of the output parameter |
outNameModifier | Modifier to add to the cube name, such as "lev1" |
outFileExtension | Extension of the output file (usually "cub" for cube) |
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.
outputParamName | Name of the output parameter |
outNameModifier | Modifier to add to the cube name, such as "lev1" |
outFileExtension | Extension of the output file (usually "cub" for cube) |
Referenced by Isis::Pipeline::Prepare().
|
inline |
Link to the previous application in the pipeline.
prev | The previous pipeline application |
void Isis::PipelineApplication::SetVirtualBands | ( | std::vector< QString > | bands | ) |
Set the virtual bands that this application is to apply.
Empty for none.
bands | The virtual bands string, excluding the "+". For example, "2,4-5,8" |
bool Isis::PipelineApplication::SupportsVirtualBands | ( | ) |
Returns true if virtual bands are supported.
References Enabled().
vector< QString > Isis::PipelineApplication::TemporaryFiles | ( | ) |
This method returns a list of the temporary files generated by this program.
Referenced by Isis::Pipeline::Run().