1#ifndef PipelineApplication_h
2#define PipelineApplication_h
14#include "IException.h"
18 class PipelineParameter;
78 const QString &
Name()
const {
117 void SetInputParameter(
const QString &inputParamName,
bool supportsVirtualBands);
118 void SetInputParameter(
const QString &inputParamName, CustomParameterValue value,
bool supportsVirtualBands);
120 void SetOutputParameter(
const QString &outputParamName,
const QString &outNameModifier,
const QString &outFileExtension =
"cub");
122 const QString &outNameModifier,
const QString &outFileExtension);
126 void AddParameter(
const QString &inputParamName,
const QString &appParamName);
127 void AddParameter(
const QString &branch,
const QString &inputParamName,
const QString &appParamName);
129 void AddConstParameter(
const QString &appParamName,
const QString &appParamValue);
130 void AddConstParameter(
const QString &branch,
const QString &appParamName,
const QString &appParamValue);
132 void AddParameter(
const QString &appParamName, CustomParameterValue value);
133 void AddParameter(
const QString &branch,
const QString &appParamName, CustomParameterValue value);
274 if(compare.size() > from.size())
return false;
276 for(
int index = 0; index < compare.size(); index++)
277 if(from[index] != compare[index])
return false;
287 int FindBranch(QString name,
bool input =
true);
This class represents one application in the pipeline.
void SetVirtualBands(std::vector< QString > bands)
Set the virtual bands that this application is to apply.
bool Merges()
Returns true if this application does merge branches (multiple input branches, one output)
std::vector< bool > p_enableBranch
Branch enabled/disabled.
const QString & Name() const
Get the name of this pipeline application.
Pipeline * GetPipeline()
Returns the pipeline.
NameModifierType
This is used for branches.
@ ConstantStrings
Known strings.
std::vector< QString > p_outBranches
Output branches.
QString p_outputExtension
Output file name extension.
PipelineApplication * Previous() const
This returns the last enabled pipeline application or null.
QString CalculateOutputFile(int branch)
This method calculates the output file for the specified branch.
bool p_supportsVirtualBands
This application supports virtual bands?
bool SupportsVirtualBands()
Returns true if virtual bands are supported.
QString p_outputMod
Output file name modifier.
std::vector< QString > p_virtualBands
Virtual bands string to add (empty if none)
~PipelineApplication()
This is the destructor.
Pipeline * p_pipeline
The pipeline.
const std::vector< QString > & ParamString() const
Get the parameters for running this program; one element in the vector per run.
QString GetRealLastOutput(bool skipOne=false)
This method is used to calculate the value for CustomParameterValue::LastOutput.
bool Continue(void)
Get the continue flag status.
bool BranchEnabled(int branch)
Check whether a branch is enabled given branch index.
std::vector< QString > p_paramString
Built parameter strings.
bool p_enabled
This application enabled?
bool p_continue
Continue the pipeline execution even if an error is encountered by this app.
std::vector< PipelineParameter > p_input
Input parameters.
PipelineApplication * Next() const
This returns the next enabled pipeline application or null.
const std::vector< QString > & InputBranches() const
Get the branches this program expects as input.
bool FutureOutputFileCreated()
Returns true if a future application creates output.
void EnableBranch(QString branch, bool flag)
Enable/Disable Branch given the branch name.
void AddParameter(const QString &inputParamName, const QString &appParamName)
This method adds knowledge of a parameter to the application.
void BuildParamString()
This method calculates the inputs, outputs and necessary calls to this program for the pipeline.
PipelineApplication * p_next
Next pipeline application.
std::vector< PipelineParameter > p_output
Output parameters.
CustomParameterValue
This is used to set custom values that must be calculated on the fly.
@ LastAppOutputListNoMerge
A list of files from the last run application's output.
@ LastOutput
The very last output file. Do not use this for input parameters if it's not necessary,...
@ LastAppOutputList
A list of files from the last run application's output.
QString CalculateInputFile(int branch)
This method calculates the input file for the specified branch.
PipelineApplication(QString appName, Pipeline *pipe)
Constructs the first pipeline application.
QString OutputExtension()
This returns this application's output file name's extension.
const bool & Enabled() const
Returns true if this program will be run.
void AddBranch(const QString &modString, NameModifierType type)
This method adds branch to this program.
std::vector< QString > & GetOutputs()
This returns this application's output files. Only valid after BuildParamString is called.
void Enable()
This method enables this program to be run.
PipelineApplication * PreviousOutputer() const
This returns the previous enabled pipeline application that makes output or null.
PipelineApplication * p_previous
Previous pipeline application.
PipelineParameter & GetInputParameter(int branch)
This gets the input parameter for the specified branch.
void Disable()
This method disables this program, causing it to be ignored.
std::vector< PipelineParameter > p_params
Regular parameters.
QString p_name
Name of this application.
void SetContinue(bool pbFlag)
Set the continue flag status.
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 in...
QString OutputNameModifier()
This returns this application's output name modifier.
bool Branches()
Return true is this application does branch (one input branch, multiple output)
void SetOutputParameter(const QString &outputParamName, const QString &outNameModifier, const QString &outFileExtension="cub")
Set the output parameter for this application and it's naming convention.
std::vector< QString > TemporaryFiles()
This method returns a list of the temporary files generated by this program.
bool LastApplicationWithOutput()
Returns true if this is the last application with output.
void SetPrevious(PipelineApplication *prev)
Link to the previous application in the pipeline.
void SetNext(PipelineApplication *next)
Link to the next application in the pipeline.
int FindBranch(QString name, bool input=true)
The method, given a string, finds the index of a branch.
void SetInputParameter(const QString &inputParamName, bool supportsVirtualBands)
Set the input parameter for this application and whether or not this application supports the virtual...
bool StringStartsWith(QString from, QString compare)
String comparison helper, returns true if from starts with compare bool.
std::vector< QString > p_outputs
Actual output files.
std::vector< QString > p_inBranches
Input branches.
const std::vector< QString > & OutputBranches() const
Get the branches this program has as output.
std::vector< QString > p_tempFiles
Actial temporary files.
This class helps to call other Isis Applications in a Pipeline.
This class represents a parameter of some type for the PipelineApplication.
PipelineParameter(int branch, QString paramName, PipelineApplication::CustomParameterValue special)
Construct the parameter with a parameter name and special value; affects only the specified branch.
PipelineParameter(QString paramName)
Construct the parameter with only a parameter name; affects all branches and is not a special value.
PipelineParameter(int branch, QString paramName)
Construct the parameter with only a parameter name; affects only the specified branch and is not a sp...
PipelineParameter(int branch, QString paramName, QString paramValue)
Construct the parameter with a parameter name and value; affects only the specified branch and is not...
QString p_paramValue
Parameter non-special value.
QString Value()
Non-special value of the parameter.
PipelineParameter(QString paramName, QString value)
Construct the parameter with a parameter name and value; affects all branches and is not special.
PipelineParameter(QString paramName, PipelineApplication::CustomParameterValue special)
Construct the parameter with a parameter name and special value; affects all branches.
PipelineApplication::CustomParameterValue Special()
Special value of the parameter.
int p_branch
Branch this affects.
bool IsSpecial()
True if the parameter value is special.
bool AppliesToBranch(int branch)
Returns whether or not the specified branch is affected.
QString p_paramName
Parameter name.
QString Name()
Name of the parameter.
bool AffectsAllBranches()
True if branch-independant.
PipelineApplication::CustomParameterValue p_special
Parameter special value.
This is free and unencumbered software released into the public domain.