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. 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... | |
PipelineApplication * | Next () const |
This returns the next enabled pipeline application or null. More... | |
PipelineApplication * | Previous () const |
This returns the last enabled pipeline application or null. More... | |
PipelineApplication * | PreviousOutputer () 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... | |
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 |
|
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 |
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 IsisAml::GetAsString(), Isis::Application::GetUserInterface(), and IsisAml::WasEntered().
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 IsisAml::GetAsString(), Isis::Application::GetUserInterface(), and IsisAml::WasEntered().
|
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(), GetOutputs(), Isis::PipelineParameter::IsSpecial(), Isis::IsSpecial(), Name(), OutputBranches(), Previous(), Isis::IException::Programmer, and Isis::PipelineParameter::Special().
|
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 Isis::Pipeline::FinalOutput(), Next(), Isis::operator<<(), OutputBranches(), Previous(), and PreviousOutputer().
vector< QString > & Isis::PipelineApplication::GetOutputs | ( | ) |
This returns this application's output files. Only valid after BuildParamString is called.
Referenced by BuildParamString().
|
inline |
Get the branches this program expects as input.
|
inline |
Get the name of this pipeline application.
Referenced by BuildParamString(), and Isis::operator<<().
|
inline |
|
inline |
Get the branches this program has as output.
References Enabled(), OutputBranches(), and Previous().
Referenced by BuildParamString(), Isis::Pipeline::FinalOutput(), and OutputBranches().
|
inline |
This returns this application's output file name's extension.
References OutputExtension(), and Previous().
Referenced by Isis::Pipeline::FinalOutput(), and OutputExtension().
|
inline |
This returns this application's output name modifier.
References OutputNameModifier(), and Previous().
Referenced by Isis::Pipeline::FinalOutput(), and OutputNameModifier().
|
inline |
Get the parameters for running this program; one element in the vector per run.
Referenced by Isis::operator<<().
|
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().
|
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 |
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 |
|
inline |
Link to the next application in the pipeline.
next | The next pipeline application |
Referenced by Isis::Pipeline::AddToPipeline().
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) |
|
inline |
Link to the previous application in the pipeline.
prev | The previous pipeline application |
Referenced by Isis::Pipeline::AddToPipeline().
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.
vector< QString > Isis::PipelineApplication::TemporaryFiles | ( | ) |
This method returns a list of the temporary files generated by this program.
Referenced by Isis::operator<<().