|
Isis Developer Reference
|
Go to the documentation of this file. 1 #ifndef PipelineApplication_h
2 #define PipelineApplication_h
18 class PipelineParameter;
78 const QString &
Name()
const {
117 void SetInputParameter(
const QString &inputParamName,
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);
171 if(p_next == NULL)
return p_next;
178 if(p_previous == NULL)
return p_previous;
185 if(p_previous == NULL)
return p_previous;
187 if(p_previous->p_output.empty())
return p_previous->
Previous();
203 for(
int i=0; i<(int)p_inBranches.size(); i++) {
204 if (p_inBranches[i].contains(branch))
205 p_enableBranch[i] = flag;
219 if (branch >= 0 && branch >= (
int)p_enableBranch.size())
221 return p_enableBranch[branch] ;
247 bool FutureOutputFileCreated();
248 bool LastApplicationWithOutput();
256 if(p_inBranches.size() >= p_outBranches.size())
return false;
262 if(p_inBranches.size() == 1)
return false;
263 if(p_outBranches.size() == 1)
return true;
273 bool StringStartsWith(QString from, QString compare) {
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;
282 QString CalculateInputFile(
int branch);
283 QString CalculateOutputFile(
int branch);
284 QString GetRealLastOutput(
bool skipOne =
false);
285 PipelineParameter &GetInputParameter(
int branch);
287 int FindBranch(QString name,
bool input =
true);
291 bool p_supportsVirtualBands;
293 std::vector<QString> p_outputs;
294 std::vector<QString> p_tempFiles;
295 std::vector<QString> p_paramString;
296 std::vector<QString> p_inBranches;
297 std::vector<QString> p_outBranches;
298 std::vector<bool> p_enableBranch;
300 std::vector<PipelineParameter> p_output;
302 QString p_outputExtension;
303 std::vector<QString> p_virtualBands;
305 std::vector<PipelineParameter> p_input;
306 std::vector<PipelineParameter> p_params;
310 Pipeline *p_pipeline;
332 p_paramName = paramName;
346 p_paramName = paramName;
347 p_paramValue = value;
362 p_paramName = paramName;
377 p_paramValue = paramValue;
378 p_paramName = paramName;
391 p_paramName = paramName;
406 p_paramName = paramName;
420 return (p_branch == -1 || p_branch == branch);
441 return p_branch == -1;
447 QString p_paramValue;
void SetNext(PipelineApplication *next)
Link to the next application in the pipeline.
Definition: PipelineApplication.h:153
This class represents one application in the pipeline.
Definition: PipelineApplication.h:46
bool AffectsAllBranches()
True if branch-independant.
Definition: PipelineApplication.h:440
@ ConstantStrings
Known strings.
Definition: PipelineApplication.h:60
QString GetAsString(const QString ¶mName) const
Allows the retrieval of a value for a parameter of any type.
Definition: IsisAml.cpp:537
bool AppliesToBranch(int branch)
Returns whether or not the specified branch is affected.
Definition: PipelineApplication.h:419
bool Continue(void)
Get the continue flag status.
Definition: PipelineApplication.h:242
File name manipulation and expansion.
Definition: FileName.h:100
QString Name()
Name of the parameter.
Definition: PipelineApplication.h:424
CustomParameterValue
This is used to set custom values that must be calculated on the fly.
Definition: PipelineApplication.h:66
void SetContinue(bool pbFlag)
Set the continue flag status.
Definition: PipelineApplication.h:231
PipelineApplication * Previous() const
This returns the last enabled pipeline application or null.
Definition: PipelineApplication.h:177
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:244
PipelineApplication * PreviousOutputer() const
This returns the previous enabled pipeline application that makes output or null.
Definition: PipelineApplication.h:184
@ LastAppOutputList
A list of files from the last run application's output.
Definition: PipelineApplication.h:71
std::vector< QString > TemporaryFiles()
This method returns a list of the temporary files generated by this program.
Definition: PipelineApplication.cpp:799
@ LastAppOutputListNoMerge
A list of files from the last run application's output.
Definition: PipelineApplication.h:74
QString OutputExtension()
This returns this application's output file name's extension.
Definition: PipelineApplication.h:140
QString Value()
Non-special value of the parameter.
Definition: PipelineApplication.h:428
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:360
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
PipelineParameter(QString paramName, PipelineApplication::CustomParameterValue special)
Construct the parameter with a parameter name and special value; affects all branches.
Definition: PipelineApplication.h:390
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:137
void BuildParamString()
This method calculates the inputs, outputs and necessary calls to this program for the pipeline.
Definition: PipelineApplication.cpp:308
This class represents a parameter of some type for the PipelineApplication.
Definition: PipelineApplication.h:323
void SetPrevious(PipelineApplication *prev)
Link to the previous application in the pipeline.
Definition: PipelineApplication.h:163
bool IsSpecial()
True if the parameter value is special.
Definition: PipelineApplication.h:432
PipelineApplication(QString appName, Pipeline *pipe)
Constructs the first pipeline application.
Definition: PipelineApplication.cpp:25
QString baseName() const
Returns the name of the file without the path and without extensions.
Definition: FileName.cpp:145
static UserInterface & GetUserInterface()
Returns the UserInterface object.
Definition: Application.cpp:463
std::vector< QString > OriginalBranches()
Returns the names of the original branches of the pipeline (input files * branches if any)
Definition: Pipeline.h:233
void AddBranch(const QString &modString, NameModifierType type)
This method adds branch to this program.
Definition: PipelineApplication.cpp:163
bool BranchEnabled(int branch)
Check whether a branch is enabled given branch index.
Definition: PipelineApplication.h:218
const QString & Name() const
Get the name of this pipeline application.
Definition: PipelineApplication.h:78
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
const std::vector< QString > & OutputBranches() const
Get the branches this program has as output.
Definition: PipelineApplication.h:90
const std::vector< QString > & InputBranches() const
Get the branches this program expects as input.
Definition: PipelineApplication.h:86
bool SupportsVirtualBands()
Returns true if virtual bands are supported.
Definition: PipelineApplication.cpp:844
~PipelineApplication()
This is the destructor.
Definition: PipelineApplication.h:52
PipelineApplication * Next() const
This returns the next enabled pipeline application or null.
Definition: PipelineApplication.h:170
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:405
Isis exception class.
Definition: IException.h:91
QString OutputNameModifier()
This returns this application's output name modifier.
Definition: PipelineApplication.h:136
void Disable()
This method disables this program, causing it to be ignored.
Definition: PipelineApplication.h:108
const bool & Enabled() const
Returns true if this program will be run.
Definition: PipelineApplication.h:113
void SetVirtualBands(std::vector< QString > bands)
Set the virtual bands that this application is to apply.
Definition: PipelineApplication.cpp:856
PipelineParameter(QString paramName)
Construct the parameter with only a parameter name; affects all branches and is not a special value.
Definition: PipelineApplication.h:331
void AddParameter(const QString &inputParamName, const QString &appParamName)
This method adds knowledge of a parameter to the application.
Definition: PipelineApplication.cpp:210
This class helps to call other Isis Applications in a Pipeline.
Definition: Pipeline.h:151
bool WasEntered(const QString ¶mName) const
Returns a true if the parameter has a value, and false if it does not.
Definition: IsisAml.cpp:1836
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Namespace for the standard library.
PipelineParameter(QString paramName, QString value)
Construct the parameter with a parameter name and value; affects all branches and is not special.
Definition: PipelineApplication.h:345
Command Line and Xml loader, validation, and access.
Definition: UserInterface.h:140
void EnableBranch(QString branch, bool flag)
Enable/Disable Branch given the branch name.
Definition: PipelineApplication.h:202
const std::vector< QString > & ParamString() const
Get the parameters for running this program; one element in the vector per run.
Definition: PipelineApplication.h:82
PipelineApplication::CustomParameterValue Special()
Special value of the parameter.
Definition: PipelineApplication.h:436
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:375
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:79
@ LastOutput
The very last output file. Do not use this for input parameters if it's not necessary,...
Definition: PipelineApplication.h:68
NameModifierType
This is used for branches.
Definition: PipelineApplication.h:58
std::vector< QString > & GetOutputs()
This returns this application's output files. Only valid after BuildParamString is called.
Definition: PipelineApplication.cpp:861
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
void Enable()
This method enables this program to be run.
Definition: PipelineApplication.h:103