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