1 #ifndef PipelineApplication_h 2 #define PipelineApplication_h 34 class PipelineParameter;
94 const QString &
Name()
const {
111 return p_outBranches;
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);
187 if(p_next == NULL)
return p_next;
194 if(p_previous == NULL)
return p_previous;
201 if(p_previous == NULL)
return p_previous;
203 if(p_previous->p_output.empty())
return p_previous->
Previous();
219 for(
int i=0; i<(int)p_inBranches.size(); i++) {
220 if (p_inBranches[i].contains(branch))
221 p_enableBranch[i] = flag;
235 if (branch >= 0 && branch >= (
int)p_enableBranch.size())
237 return p_enableBranch[branch] ;
263 bool FutureOutputFileCreated();
264 bool LastApplicationWithOutput();
272 if(p_inBranches.size() >= p_outBranches.size())
return false;
278 if(p_inBranches.size() == 1)
return false;
279 if(p_outBranches.size() == 1)
return true;
289 bool StringStartsWith(QString from, QString compare) {
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;
298 QString CalculateInputFile(
int branch);
299 QString CalculateOutputFile(
int branch);
300 QString GetRealLastOutput(
bool skipOne =
false);
301 PipelineParameter &GetInputParameter(
int branch);
303 int FindBranch(QString name,
bool input =
true);
307 bool p_supportsVirtualBands;
309 std::vector<QString> p_outputs;
310 std::vector<QString> p_tempFiles;
311 std::vector<QString> p_paramString;
312 std::vector<QString> p_inBranches;
313 std::vector<QString> p_outBranches;
314 std::vector<bool> p_enableBranch;
316 std::vector<PipelineParameter> p_output;
318 QString p_outputExtension;
319 std::vector<QString> p_virtualBands;
321 std::vector<PipelineParameter> p_input;
322 std::vector<PipelineParameter> p_params;
326 Pipeline *p_pipeline;
348 p_paramName = paramName;
362 p_paramName = paramName;
363 p_paramValue = value;
378 p_paramName = paramName;
393 p_paramValue = paramValue;
394 p_paramName = paramName;
407 p_paramName = paramName;
422 p_paramName = paramName;
436 return (p_branch == -1 || p_branch == branch);
457 return p_branch == -1;
463 QString p_paramValue;
void SetPrevious(PipelineApplication *prev)
Link to the previous application in the pipeline.
Definition: PipelineApplication.h:179
bool BranchEnabled(int branch)
Check whether a branch is enabled given branch index.
Definition: PipelineApplication.h:234
PipelineParameter(QString paramName)
Construct the parameter with only a parameter name; affects all branches and is not a special value...
Definition: PipelineApplication.h:347
PipelineParameter(int branch, QString paramName)
Construct the parameter with only a parameter name; affects only the specified branch and is not a sp...
Definition: PipelineApplication.h:376
const QString & Name() const
Get the name of this pipeline application.
Definition: PipelineApplication.h:94
const std::vector< QString > & InputBranches() const
Get the branches this program expects as input.
Definition: PipelineApplication.h:102
std::vector< QString > & GetOutputs()
This returns this application's output files. Only valid after BuildParamString is called...
Definition: PipelineApplication.cpp:855
PipelineApplication::CustomParameterValue Special()
Special value of the parameter.
Definition: PipelineApplication.h:452
~PipelineApplication()
This is the destructor.
Definition: PipelineApplication.h:68
QString OutputNameModifier()
This returns this application's output name modifier.
Definition: PipelineApplication.h:152
void BuildParamString()
This method calculates the inputs, outputs and necessary calls to this program for the pipeline...
Definition: PipelineApplication.cpp:302
PipelineApplication * PreviousOutputer() const
This returns the previous enabled pipeline application that makes output or null. ...
Definition: PipelineApplication.h:200
void Disable()
This method disables this program, causing it to be ignored.
Definition: PipelineApplication.h:124
The very last output file. Do not use this for input parameters if it's not necessary, that is done automatically.
Definition: PipelineApplication.h:84
This class helps to call other Isis Applications in a Pipeline.
Definition: Pipeline.h:162
PipelineParameter(int branch, QString paramName, QString paramValue)
Construct the parameter with a parameter name and value; affects only the specified branch and is not...
Definition: PipelineApplication.h:391
PipelineApplication * Next() const
This returns the next enabled pipeline application or null.
Definition: PipelineApplication.h:186
PipelineParameter(int branch, QString paramName, PipelineApplication::CustomParameterValue special)
Construct the parameter with a parameter name and special value; affects only the specified branch...
Definition: PipelineApplication.h:421
const std::vector< QString > & ParamString() const
Get the parameters for running this program; one element in the vector per run.
Definition: PipelineApplication.h:98
const bool & Enabled() const
Returns true if this program will be run.
Definition: PipelineApplication.h:129
void SetContinue(bool pbFlag)
Set the continue flag status.
Definition: PipelineApplication.h:247
void AddBranch(const QString &modString, NameModifierType type)
This method adds branch to this program.
Definition: PipelineApplication.cpp:157
PipelineParameter(QString paramName, QString value)
Construct the parameter with a parameter name and value; affects all branches and is not special...
Definition: PipelineApplication.h:361
NameModifierType
This is used for branches.
Definition: PipelineApplication.h:74
PipelineApplication * Previous() const
This returns the last enabled pipeline application or null.
Definition: PipelineApplication.h:193
This class represents one application in the pipeline.
Definition: PipelineApplication.h:62
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...
Definition: PipelineApplication.cpp:238
void SetNext(PipelineApplication *next)
Link to the next application in the pipeline.
Definition: PipelineApplication.h:169
bool SupportsVirtualBands()
Returns true if virtual bands are supported.
Definition: PipelineApplication.cpp:838
QString Name()
Name of the parameter.
Definition: PipelineApplication.h:440
Known strings.
Definition: PipelineApplication.h:76
This class represents a parameter of some type for the PipelineApplication.
Definition: PipelineApplication.h:339
PipelineApplication(QString appName, Pipeline *pipe)
Constructs the first pipeline application.
Definition: PipelineApplication.cpp:19
void SetVirtualBands(std::vector< QString > bands)
Set the virtual bands that this application is to apply.
Definition: PipelineApplication.cpp:850
bool IsSpecial()
True if the parameter value is special.
Definition: PipelineApplication.h:448
QString Value()
Non-special value of the parameter.
Definition: PipelineApplication.h:444
CustomParameterValue
This is used to set custom values that must be calculated on the fly.
Definition: PipelineApplication.h:82
bool Continue(void)
Get the continue flag status.
Definition: PipelineApplication.h:258
void AddParameter(const QString &inputParamName, const QString &appParamName)
This method adds knowledge of a parameter to the application.
Definition: PipelineApplication.cpp:204
const std::vector< QString > & OutputBranches() const
Get the branches this program has as output.
Definition: PipelineApplication.h:106
void EnableBranch(QString branch, bool flag)
Enable/Disable Branch given the branch name.
Definition: PipelineApplication.h:218
bool AffectsAllBranches()
True if branch-independant.
Definition: PipelineApplication.h:456
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void SetInputParameter(const QString &inputParamName, bool supportsVirtualBands)
Set the input parameter for this application and whether or not this application supports the virtual...
Definition: PipelineApplication.cpp:73
A list of files from the last run application's output.
Definition: PipelineApplication.h:87
QString OutputExtension()
This returns this application's output file name's extension.
Definition: PipelineApplication.h:156
void SetOutputParameter(const QString &outputParamName, const QString &outNameModifier, const QString &outFileExtension="cub")
Set the output parameter for this application and it's naming convention.
Definition: PipelineApplication.cpp:131
void Enable()
This method enables this program to be run.
Definition: PipelineApplication.h:119
A list of files from the last run application's output.
Definition: PipelineApplication.h:90
PipelineParameter(QString paramName, PipelineApplication::CustomParameterValue special)
Construct the parameter with a parameter name and special value; affects all branches.
Definition: PipelineApplication.h:406
bool AppliesToBranch(int branch)
Returns whether or not the specified branch is affected.
Definition: PipelineApplication.h:435
std::vector< QString > TemporaryFiles()
This method returns a list of the temporary files generated by this program.
Definition: PipelineApplication.cpp:793