Isis 3 Programmer Reference
Pipeline.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include <iostream>
8
9#include <QFile>
10
11#include "Pipeline.h"
12#include "PipelineApplication.h"
13#include "ProgramLauncher.h"
14#include "IException.h"
15#include "Application.h"
16#include "Preference.h"
17#include "Progress.h"
18#include "FileList.h"
19#include "FileName.h"
20
21using namespace Isis;
22using namespace std;
23
24namespace Isis {
25
26
36 Pipeline::Pipeline(const QString &procAppName) {
37 p_pausePosition = -1;
38 p_procAppName = procAppName;
39 p_addedCubeatt = false;
40 p_outputListNeedsModifiers = false;
41 p_continue = false;
42 }
43
44
50 for (int i = 0; i < (int)p_apps.size(); i++) {
51 delete p_apps[i];
52 }
53
54 p_apps.clear();
55 }
56
57
70 // Nothing in the pipeline? quit
71 if (p_apps.size() == 0) return;
72
73 // We might have to modify the pipeline and try again, so keep track of if this is necessary
74 bool successfulPrepare = false;
75
76 while (!successfulPrepare) {
77 // Assume we'll be successful
78 successfulPrepare = true;
79 bool foundFirst = false;
80
81 // Keep track of whether or not we must remove virtual bands
82 bool mustElimBands = false;
83
84 // Look to see if we need to eliminate virtual bands...
85 for (unsigned int i = 0; i < p_virtualBands.size(); i++) {
86 mustElimBands |= !p_virtualBands[i].isEmpty();
87 }
88
89 // Keep track of temp files for conflicts
90 vector<QString> tmpFiles;
91
92 // Loop through all the pipeline apps, look for a good place to remove virtual
93 // bands and tell the apps the prepare themselves. Double check the first program
94 // is not branched (expecting multiple inputs).
95 for (int i = 0; i < (int)p_apps.size() && successfulPrepare; i++) {
96 if (p_apps[i] == NULL) continue;
97 if (mustElimBands && p_apps[i]->SupportsVirtualBands()) {
98 if (i != 0 && p_virtualBands.size() != 1) {
99 QString message = "If multiple original inputs were set in the pipeline, the first application must support virtual bands.";
100 throw IException(IException::Programmer, message, _FILEINFO_);
101 }
102
103 p_apps[i]->SetVirtualBands(p_virtualBands);
104 mustElimBands = false;
105
106 // We might have added the "cubeatt" program to eliminate bands,
107 // remove it if we found something else to do the virtual bands.
108 // **This causes a failure in our calculations, start over.
109 if (p_addedCubeatt && i != (int)p_apps.size() - 1) {
110 delete p_apps[p_apps.size() - 1];
111 p_apps.resize(p_apps.size() - 1);
112 p_appIdentifiers.resize(p_appIdentifiers.size() - 1);
113 p_apps[p_apps.size() - 1]->SetNext(NULL);
114 p_addedCubeatt = false;
115 successfulPrepare = false;
116 continue;
117 }
118 }
119 else {
120 // Pipeline is responsible for the virtual bands, reset any apps
121 // who have an old virtual bands setting.
122 vector<QString> empty;
123 p_apps[i]->SetVirtualBands(empty);
124 }
125
126 // This instructs the pipeline app to prepare itself; all previous pipeline apps must
127 // be already prepared. Future pipeline apps do not have to be.
128 p_apps[i]->BuildParamString();
129
130 // keep track of tmp files
131 vector<QString> theseTempFiles = p_apps[i]->TemporaryFiles();
132 for (int tmpFile = 0; tmpFile < (int)theseTempFiles.size(); tmpFile++) {
133 // no need to delete blank files
134 if (theseTempFiles[tmpFile].contains("blank")) {
135 tmpFiles.push_back(theseTempFiles[tmpFile]);
136 }
137 }
138
139 if (!foundFirst && p_apps[i]->Enabled()) {
140 foundFirst = true;
141
142 if (p_apps[i]->InputBranches().size() != OriginalBranches().size()) {
143 QString msg = "The program [" + p_apps[i]->Name() + "] can not be the first in the pipeline";
144 msg += " because it must be run multiple times with unspecified varying inputs";
145 throw IException(IException::Programmer, msg, _FILEINFO_);
146 }
147 }
148 }
149
150 // Make sure we found an app!
151 if (!foundFirst) {
152 string msg = "No applications are enabled in the pipeline";
153 throw IException(IException::Programmer, msg, _FILEINFO_);
154 }
155
156 // Make sure all tmp files are unique!
157 for (int i = 0; successfulPrepare && i < (int)tmpFiles.size(); i++) {
158 for (int j = i + 1; j < (int)tmpFiles.size(); j++) {
159 if (tmpFiles[i] == tmpFiles[j]) {
160 QString msg = "There is a conflict with the temporary file naming. The temporary file [";
161 msg += tmpFiles[i] + "] is created twice.";
162 throw IException(IException::Programmer, msg, _FILEINFO_);
163 }
164 }
165 }
166
167 // We failed at eliminating bands, add stretch to our programs and try again
168 if (successfulPrepare && mustElimBands) {
169 AddToPipeline("cubeatt", "~PIPELINE_RESERVED_FOR_BANDS~");
170 Application("~PIPELINE_RESERVED_FOR_BANDS~").SetInputParameter("FROM", true);
171 Application("~PIPELINE_RESERVED_FOR_BANDS~").SetOutputParameter("TO", "final");
172 p_addedCubeatt = true;
173 successfulPrepare = false;
174 }
175
176 int lastApp = p_apps.size()-1;
177 if (p_apps[p_apps.size()-1] == NULL)
178 lastApp = p_apps.size() - 2;
179
180 if (p_apps[lastApp]->GetOutputs().size() == 0) {
181 string msg = "There are no outputted files in the pipeline. At least one program must generate an output file.";
182 throw IException(IException::Programmer, msg, _FILEINFO_);
183 }
184 }
185 }
186
187
200 // Prepare the pipeline programs
201 Prepare();
202
203 // Get the starting point
204 p_pausePosition++;
205
206 Progress pipelineProg;
207 pipelineProg.SetText(p_procAppName);
208 pipelineProg.SetMaximumSteps(1);
209 pipelineProg.CheckStatus();
210
211 // Go through these programs, executing them
212 for (int i = p_pausePosition; i < Size(); i++) {
213
214 // Return to caller for a pause
215 if (p_apps[i] == NULL) {
216 p_pausePosition = i;
217 return;
218 }
219
220 if (Application(i).Enabled()) {
221 Progress appName;
222 appName.SetText("Running " + Application(i).Name());
223 appName.SetMaximumSteps(1);
224 appName.CheckStatus();
225
226 // grab the sets of parameters this program needs to be run with
227 const vector<QString> &params = Application(i).ParamString();
228 for (int j = 0; j < (int)params.size(); j++) {
229
230 // check for non-program run special strings
231 QString special(params[j].mid(0, 7));
232
233 // If ">>LIST", then we need to make a list file
234 if (special == ">>LIST ") {
235 QString cmd = params[j].mid(7);
236
237 QStringList listData = cmd.split(" ");
238 QString listFileName = listData.takeFirst();
239 FileList listFile;
240
241 while (!listData.isEmpty()) {
242 listFile.push_back(listData.takeFirst());
243 }
244
245 listFile.write(listFileName);
246 }
247 else {
248 // Nothing special is happening, just execute the program
249 try {
251 }
252 catch (IException &e) {
253 if (!p_continue && !Application(i).Continue()) {
254 throw;
255 }
256 else {
257 e.print();
258 cerr << "Continuing ......" << endl;
259 }
260 }
261 }
262 }
263 }
264 }
265
266 // Remove temporary files now
267 if (!KeepTemporaryFiles()) {
268 for (int i = 0; i < Size(); i++) {
269 if (p_apps[i] == NULL) continue;
270 if (Application(i).Enabled()) {
271 vector<QString> tmpFiles = Application(i).TemporaryFiles();
272 for (int file = 0; file < (int)tmpFiles.size(); file++) {
273 QFile::remove(tmpFiles[file]);
274 }
275 }
276 }
277 }
278
279 // Reset pause position
280 p_pausePosition = -1;
281 }
282
283
292 void Pipeline::SetInputFile(const char *inputParam) {
293 SetInputFile(QString(inputParam));
294 }
295
296
307 void Pipeline::SetInputFile(const QString &inputParam) {
309 p_originalInput.push_back(ui.GetCubeName(inputParam));
310 p_inputBranches.push_back(inputParam);
311 p_virtualBands.push_back(ui.GetInputAttribute(inputParam).toString());
312 }
313
314
324 void Pipeline::SetInputFile(const FileName &inputFile) {
325 p_originalInput.push_back(inputFile.original());
326 p_inputBranches.push_back(inputFile.original());
327 p_virtualBands.push_back("");
328 }
329
330
339 void Pipeline::SetInputListFile(const char *inputParam) {
340 SetInputListFile(QString(inputParam));
341 }
342
343
354 void Pipeline::SetInputListFile(const QString &inputParam) {
356 FileName inputFileName = FileName(ui.GetFileName(inputParam));
357
358 SetInputListFile(inputFileName);
359 }
360
361
370 void Pipeline::SetInputListFile(const FileName &inputFileName) {
371 FileList filelist(inputFileName.expanded());
372 FileName filename;
373 int branch = 1;
374
375 while (!filelist.isEmpty()) {
376 filename = filelist.takeFirst();
377 p_originalInput.push_back(filename.expanded());
378 p_inputBranches.push_back(inputFileName.name() + toString(branch));
379 p_virtualBands.push_back("");
380 p_finalOutput.push_back(filename.name());
381
382 branch ++;
383 }
384
385 p_outputListNeedsModifiers = true;
386 }
387
388
400 void Pipeline::SetInputFile(const char *inputParam, const char *virtualBandsParam) {
401 SetInputFile(QString(inputParam), QString(virtualBandsParam));
402 }
403
404
418 void Pipeline::SetInputFile(const QString &inputParam, const QString &virtualBandsParam) {
420 p_originalInput.push_back(ui.GetAsString(inputParam));
421 p_inputBranches.push_back(inputParam);
422
423 if (!virtualBandsParam.isEmpty() && ui.WasEntered(virtualBandsParam)) {
424 p_virtualBands.push_back(ui.GetAsString(virtualBandsParam));
425 }
426 else {
427 p_virtualBands.push_back("");
428 }
429 }
430
431
441 void Pipeline::SetOutputFile(const char *outputParam) {
442 SetOutputFile(QString(outputParam));
443 }
444
445
455 void Pipeline::SetOutputFile(const QString &outputParam) {
457 p_finalOutput.clear();
458
459 if (ui.WasEntered(outputParam)) {
460 p_finalOutput.push_back(ui.GetAsString(outputParam));
461 }
462 }
463
464
473 void Pipeline::SetOutputFile(const FileName &outputFile) {
474 p_finalOutput.clear();
475 p_finalOutput.push_back(outputFile.expanded());
476 }
477
478
487 void Pipeline::SetOutputListFile(const char *outputFileNameParam) {
488 SetOutputListFile(QString(outputFileNameParam));
489 }
490
491
500 void Pipeline::SetOutputListFile(const QString &outputFileNameParam) {
502
503 if (ui.WasEntered(outputFileNameParam)) {
504 SetOutputListFile(FileName(ui.GetFileName(outputFileNameParam)));
505 }
506 else {
507 p_finalOutput.clear();
508
509 // Calculate output files
510 for (unsigned int i = 0; i < p_originalInput.size(); i++) {
511 p_finalOutput.push_back(FileName(p_originalInput[i]).name());
512 }
513
514 p_outputListNeedsModifiers = true;
515 }
516 }
517
518
525 void Pipeline::SetOutputListFile(const FileName &outputFileNameList) {
526 p_finalOutput.clear();
527
528 FileList filelist(outputFileNameList.expanded());
529 QString filename;
530
531 while (!filelist.isEmpty()) {
532 filename = filelist.takeFirst().expanded();
533 p_finalOutput.push_back(filename);
534 }
535
536 p_outputListNeedsModifiers = false;
537 }
538
539
547 p_keepTemporary = keep;
548 }
549
550
559 // Add the pause
560 QString pauseAppId = "";
561 PipelineApplication *pauseApp = NULL;
562
563 p_apps.push_back(pauseApp);
564 p_appIdentifiers.push_back(pauseAppId);
565 }
566
567
581 void Pipeline::AddToPipeline(const QString &appname, const QString &identifier) {
582 // Check uniqueness first
583 for (unsigned int appIdentifier = 0; appIdentifier < p_appIdentifiers.size(); appIdentifier++) {
584 if (p_appIdentifiers[appIdentifier] == identifier) {
585 QString message = "The application identifier [" + identifier + "] is not unique. " +
586 "Please providing a unique identifier";
587 throw IException(IException::Programmer, message, _FILEINFO_);
588 }
589 }
590
591 // If we've got cubeatt on our list of applications for band eliminating, take it away temporarily
592 PipelineApplication *cubeAtt = NULL;
593 QString cubeAttId = "";
594 if (p_addedCubeatt) {
595 cubeAtt = p_apps[p_apps.size()-1];
596 cubeAttId = p_appIdentifiers[p_appIdentifiers.size()-1];
597 p_apps.resize(p_apps.size() - 1);
598 p_appIdentifiers.resize(p_appIdentifiers.size() - 1);
599 p_apps[p_apps.size()-1]->SetNext(NULL);
600 }
601
602 //Check for non nulls instead of size ie. find last non null or use this
603 int appsSize = 0;
604 QString pauseAppId = "";
605
606 for (int iapp = 0; iapp < (int) p_apps.size(); iapp++)
607 if (p_apps[iapp] != NULL) appsSize++;
608
609 // Add the new application
610 if (p_apps.size() == 0) {
611 p_apps.push_back(new PipelineApplication(appname, this));
612 }
613 else {
614 if (p_apps[p_apps.size()-1] != NULL)
615 p_apps.push_back(new PipelineApplication(appname, p_apps[p_apps.size()-1]));
616 else // We know we have app NULL before this new app
617 p_apps.push_back(new PipelineApplication(appname, p_apps[p_apps.size()-2]));
618 }
619
620 p_appIdentifiers.push_back(identifier);
621
622 // If we have stretch, put it back where it belongs
623 if (cubeAtt) {
624 p_apps[p_apps.size()-1]->SetNext(cubeAtt);
625 cubeAtt->SetPrevious(p_apps[p_apps.size()-1]);
626 p_apps.push_back(cubeAtt);
627 p_appIdentifiers.push_back(cubeAttId);
628 }
629 }
630
631
643 void Pipeline::AddToPipeline(const QString &appname) {
644 // Check uniqueness first
645 for (unsigned int appIdentifier = 0; appIdentifier < p_appIdentifiers.size(); appIdentifier++) {
646 if (p_appIdentifiers[appIdentifier] == appname) {
647 QString message = "The application identifier [" + appname + "] is not unique. Please use " +
648 "the other AddToPipeline method providing a unique identifier";
649 throw IException(IException::Programmer, message, _FILEINFO_);
650 }
651 }
652
653 // If we've got cubeatt on our list of applications for band eliminating, take it away temporarily
654 PipelineApplication *cubeAtt = NULL;
655 QString cubeAttId = "";
656 if (p_addedCubeatt) {
657 cubeAtt = p_apps[p_apps.size()-1];
658 cubeAttId = p_appIdentifiers[p_appIdentifiers.size()-1];
659 p_apps.resize(p_apps.size() - 1);
660 p_appIdentifiers.resize(p_appIdentifiers.size() - 1);
661 p_apps[p_apps.size()-1]->SetNext(NULL);
662 }
663
664 // Add the new application
665 if (p_apps.size() == 0) {
666 p_apps.push_back(new PipelineApplication(appname, this));
667 }
668 else {
669 if (p_apps[p_apps.size()-1] != NULL)
670 p_apps.push_back(new PipelineApplication(appname, p_apps[p_apps.size()-1]));
671 else // We know we have app NULL before this new app
672 p_apps.push_back(new PipelineApplication(appname, p_apps[p_apps.size()-2]));
673 }
674
675 p_appIdentifiers.push_back(appname);
676
677 // If we have stretch, put it back where it belongs
678 if (cubeAtt) {
679 p_apps[p_apps.size()-1]->SetNext(cubeAtt);
680 cubeAtt->SetPrevious(p_apps[p_apps.size()-1]);
681 p_apps.push_back(cubeAtt);
682 p_appIdentifiers.push_back(cubeAttId);
683 }
684 }
685
686
696 PipelineApplication &Pipeline::Application(const QString &identifier) {
697 int index = 0;
698 bool found = false;
699
700 while (!found && index < Size()) {
701 if (p_appIdentifiers[index] == identifier) {
702 found = true;
703 }
704 else {
705 index ++;
706 }
707 }
708
709 if (!found) {
710 QString msg = "Application identified by [" + identifier + "] has not been added to the pipeline";
711 throw IException(IException::Programmer, msg, _FILEINFO_);
712 }
713
714 return *p_apps[index];
715 }
716
717
727 if (index > Size()) {
728 QString msg = "Index [" + QString(index) + "] out of bounds";
729 throw IException(IException::Programmer, msg, _FILEINFO_);
730 }
731
732 return *p_apps[index];
733 }
734
735
748 void Pipeline::SetFirstApplication(const QString &appname) {
749 int appIndex = 0;
750 for (appIndex = 0; appIndex < (int)p_apps.size() &&
751 p_apps[appIndex]->Name() != appname; appIndex++) {
752 if (p_apps[appIndex] == NULL) continue;
753 p_apps[appIndex]->Disable();
754 }
755 // for (appIndex = 0; appIndex < (int)p_apps.size() && p_apps[appIndex]->Name() != appname; appIndex++) {
756 // p_apps[appIndex]->Disable();
757 // }
758
759 if (appIndex >= (int)p_apps.size()) {
760 QString msg = "Pipeline could not find application [" + appname + "]";
761 throw IException(IException::Programmer, msg, _FILEINFO_);
762 }
763 }
764
765
778 void Pipeline::SetLastApplication(const QString &appname) {
779 int appIndex = p_apps.size() - 1;
780 for (appIndex = p_apps.size() - 1; appIndex >= 0 && p_apps[appIndex]->Name() != appname; appIndex --) {
781 if (p_apps[appIndex] == NULL) continue;
782 p_apps[appIndex]->Disable();
783 }
784
785 if (appIndex < 0) {
786 QString msg = "Pipeline could not find application [" + appname + "]";
787 throw IException(IException::Programmer, msg, _FILEINFO_);
788 }
789 }
790
791
805 QString Pipeline::FinalOutput(int branch, bool addModifiers) {
806 QString output = ((p_finalOutput.size() != 0) ? p_finalOutput[0] : "");
807
808 if (p_apps.size() == 0) return output;
809
810 if (p_finalOutput.size() > 1) {
811 if ((unsigned int)branch >= p_finalOutput.size()) {
812 QString msg = "Output not set for branch [" + QString(branch) + "]";
813 throw IException(IException::Programmer, msg, _FILEINFO_);
814 }
815
816 if (!p_outputListNeedsModifiers) {
817 return p_finalOutput[branch];
818 }
819 else {
820 output = p_finalOutput[branch];
821 addModifiers = true;
822 }
823 }
824
825 PipelineApplication *last = p_apps[p_apps.size()-1];
826 if (last == NULL) last = p_apps[p_apps.size()-2];
827 if (!last->Enabled()) last = last->Previous();
828
829 if (output == "" || p_finalOutput.size() > 1) {
830 if (output == "") {
831 output = "./" + FileName(p_originalInput[0]).baseName();
832 }
833 else {
834 output = "./" + FileName(p_originalInput[branch]).baseName();
835 }
836
837 // Base filename off of first input file
838 if (!addModifiers || last->OutputBranches().size() == 1) {
839 if (addModifiers && p_finalOutput.size() > 1)
840 output += "." + last->OutputNameModifier();
841
842 output += "." + last->OutputExtension();
843 }
844 else {
845 // If we have multiple final outputs, rely on them to
846 // differentiate the branches
847 if (p_finalOutput.size() <= 1) {
848 output += "." + last->OutputBranches()[branch];
849 }
850
851 if (addModifiers && p_finalOutput.size() > 1)
852 output += "." + last->OutputNameModifier();
853
854 output += "." + last->OutputExtension();
855 }
856 }
857 else if (addModifiers) {
858 PipelineApplication *last = p_apps[p_apps.size()-1];
859 if (!last->Enabled()) last = last->Previous();
860
861 output = FileName(p_finalOutput[0]).path() + "/" +
862 FileName(p_finalOutput[0]).baseName() + "." +
863 last->OutputBranches()[branch] + ".";
864
865 if (p_finalOutput.size() > 1) {
866 output += last->OutputNameModifier() + ".";
867 }
868
869 output += last->OutputExtension();
870 }
871
872 return output;
873 }
874
875
883 Pvl &pref = Preference::Preferences();
884 return pref.findGroup("DataDirectory")["Temporary"];
885 }
886
887
897 for (int i = 0; i < Size(); i++) {
898 if (p_apps[i] != NULL) p_apps[i]->Enable();
899 }
900 }
901
902
919 ostream &operator<<(ostream &os, Pipeline &pipeline) {
920 pipeline.Prepare();
921
922 if (!pipeline.Name().isEmpty()) {
923 os << "PIPELINE -------> " << pipeline.Name() << " <------- PIPELINE" << endl;
924 }
925
926 for (int i = 0; i < pipeline.Size(); i++) {
927 if (pipeline.Application(i).Enabled()) {
928 const vector<QString> &params = pipeline.Application(i).ParamString();
929 for (int j = 0; j < (int)params.size(); j++) {
930 QString special(params[j].mid(0, 7));
931 if (special == ">>LIST ") {
932 QString cmd = params[j].mid(7);
933
934 QStringList listFileData = cmd.split(" ");
935 QString file = listFileData.takeFirst();
936 os << "echo -e \"" << listFileData.join("\\n") << "\" > " << file << endl;
937 }
938 else {
939 os << pipeline.Application(i).Name() << " " << params[j] << endl;
940 }
941 }
942 }
943 }
944
945 if (!pipeline.KeepTemporaryFiles()) {
946 for (int i = 0; i < pipeline.Size(); i++) {
947 if (pipeline.Application(i).Enabled()) {
948 vector<QString> tmpFiles = pipeline.Application(i).TemporaryFiles();
949 for (int file = 0; file < (int)tmpFiles.size(); file++) {
950 if (!tmpFiles[file].contains("blank")) {
951 os << "rm " << tmpFiles[file] << endl;
952 }
953 }
954 }
955 }
956 }
957
958 if (!pipeline.Name().isEmpty()) {
959 os << "PIPELINE -------> " << pipeline.Name() << " <------- PIPELINE" << endl;
960 }
961
962 return os;
963 }
964}
static UserInterface & GetUserInterface()
Returns the UserInterface object.
Internalizes a list of files.
Definition FileList.h:54
void write(FileName outputFileList)
writes to a FileName obj
Definition FileList.cpp:158
File name manipulation and expansion.
Definition FileName.h:100
QString path() const
Returns the path of the file name.
Definition FileName.cpp:103
QString baseName() const
Returns the name of the file without the path and without extensions.
Definition FileName.cpp:145
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition FileName.cpp:162
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition FileName.cpp:196
Isis exception class.
Definition IException.h:91
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
This class represents one application in the pipeline.
const QString & Name() const
Get the name of this pipeline application.
PipelineApplication * Previous() const
This returns the last enabled pipeline application or null.
const std::vector< QString > & ParamString() const
Get the parameters for running this program; one element in the vector per run.
const bool & Enabled() const
Returns true if this program will be run.
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.
void SetNext(PipelineApplication *next)
Link to the next application in the pipeline.
void SetInputParameter(const QString &inputParamName, bool supportsVirtualBands)
Set the input parameter for this application and whether or not this application supports the virtual...
This class helps to call other Isis Applications in a Pipeline.
Definition Pipeline.h:151
void Run()
This method executes the pipeline.
Definition Pipeline.cpp:199
void SetInputFile(const char *inputParam)
This method is used to set the original input file.
Definition Pipeline.cpp:292
bool p_keepTemporary
True if keeping temporary files.
Definition Pipeline.h:283
std::vector< PipelineApplication * > p_apps
The pipeline applications.
Definition Pipeline.h:285
void SetInputListFile(const char *inputParam)
This method is used to set the original input files.
Definition Pipeline.cpp:339
void AddPause()
Add a pause to the pipeline.
Definition Pipeline.cpp:558
bool KeepTemporaryFiles()
Returns true if temporary files will not be deleted, false if they will.
Definition Pipeline.h:176
std::vector< QString > p_appIdentifiers
The strings to identify the pipeline applications.
Definition Pipeline.h:286
bool p_addedCubeatt
True if the "cubeatt" program was added.
Definition Pipeline.h:284
PipelineApplication & Application(const QString &identifier)
This is an accessor to get a specific PipelineApplication.
Definition Pipeline.cpp:696
QString p_procAppName
The name of the pipeline.
Definition Pipeline.h:277
QString FinalOutput(int branch=0, bool addModifiers=true)
This gets the final output for the specified branch; this is necessary for the PipelineApplications t...
Definition Pipeline.cpp:805
QString TemporaryFolder()
This method returns the user's temporary folder for temporary files.
Definition Pipeline.cpp:882
void Prepare()
This method is the core of the pipeline class.
Definition Pipeline.cpp:69
Pipeline(const QString &procAppName="")
This is the one and only Pipeline constructor.
Definition Pipeline.cpp:36
std::vector< QString > p_inputBranches
Branches for input list.
Definition Pipeline.h:279
std::vector< QString > p_finalOutput
The final output file (empty if needs calculated)
Definition Pipeline.h:281
void AddToPipeline(const QString &appname)
Add a new program to the pipeline.
Definition Pipeline.cpp:643
std::vector< QString > p_virtualBands
The virtual bands string.
Definition Pipeline.h:282
int Size() const
Returns the number of applications in the pipeline.
Definition Pipeline.h:196
~Pipeline()
This destroys the pipeline.
Definition Pipeline.cpp:49
void SetLastApplication(const QString &appname)
This method disables all applications after to this one.
Definition Pipeline.cpp:778
void SetFirstApplication(const QString &appname)
This method disables all applications up to this one.
Definition Pipeline.cpp:748
void EnableAllApplications()
This method re-enables all applications.
Definition Pipeline.cpp:896
void SetOutputFile(const char *outputParam)
This method is used to set the final output file.
Definition Pipeline.cpp:441
std::vector< QString > p_originalInput
The original input file.
Definition Pipeline.h:278
QString Name() const
Returns the name of the pipeline.
Definition Pipeline.h:192
std::vector< QString > OriginalBranches()
Returns the names of the original branches of the pipeline (input files * branches if any)
Definition Pipeline.h:233
void SetOutputListFile(const char *outputFileNameParam)
This method is used to set an output list file.
Definition Pipeline.cpp:487
bool p_continue
continue the execution even if exception is encountered.
Definition Pipeline.h:288
static void RunIsisProgram(QString isisProgramName, QString arguments)
Executes the Isis program with the given arguments.
Program progress reporter.
Definition Progress.h:42
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition Progress.cpp:61
Container for cube-like labels.
Definition Pvl.h:119
Command Line and Xml loader, validation, and access.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Namespace for the standard library.