File failed to load: https://isis.astrogeology.usgs.gov/9.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
Pipeline.cpp
1
5
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 QString pauseAppId = "";
604
605 // Add the new application
606 if (p_apps.size() == 0) {
607 p_apps.push_back(new PipelineApplication(appname, this));
608 }
609 else {
610 if (p_apps[p_apps.size()-1] != NULL)
611 p_apps.push_back(new PipelineApplication(appname, p_apps[p_apps.size()-1]));
612 else // We know we have app NULL before this new app
613 p_apps.push_back(new PipelineApplication(appname, p_apps[p_apps.size()-2]));
614 }
615
616 p_appIdentifiers.push_back(identifier);
617
618 // If we have stretch, put it back where it belongs
619 if (cubeAtt) {
620 p_apps[p_apps.size()-1]->SetNext(cubeAtt);
621 cubeAtt->SetPrevious(p_apps[p_apps.size()-1]);
622 p_apps.push_back(cubeAtt);
623 p_appIdentifiers.push_back(cubeAttId);
624 }
625 }
626
627
639 void Pipeline::AddToPipeline(const QString &appname) {
640 // Check uniqueness first
641 for (unsigned int appIdentifier = 0; appIdentifier < p_appIdentifiers.size(); appIdentifier++) {
642 if (p_appIdentifiers[appIdentifier] == appname) {
643 QString message = "The application identifier [" + appname + "] is not unique. Please use " +
644 "the other AddToPipeline method providing a unique identifier";
645 throw IException(IException::Programmer, message, _FILEINFO_);
646 }
647 }
648
649 // If we've got cubeatt on our list of applications for band eliminating, take it away temporarily
650 PipelineApplication *cubeAtt = NULL;
651 QString cubeAttId = "";
652 if (p_addedCubeatt) {
653 cubeAtt = p_apps[p_apps.size()-1];
654 cubeAttId = p_appIdentifiers[p_appIdentifiers.size()-1];
655 p_apps.resize(p_apps.size() - 1);
656 p_appIdentifiers.resize(p_appIdentifiers.size() - 1);
657 p_apps[p_apps.size()-1]->SetNext(NULL);
658 }
659
660 // Add the new application
661 if (p_apps.size() == 0) {
662 p_apps.push_back(new PipelineApplication(appname, this));
663 }
664 else {
665 if (p_apps[p_apps.size()-1] != NULL)
666 p_apps.push_back(new PipelineApplication(appname, p_apps[p_apps.size()-1]));
667 else // We know we have app NULL before this new app
668 p_apps.push_back(new PipelineApplication(appname, p_apps[p_apps.size()-2]));
669 }
670
671 p_appIdentifiers.push_back(appname);
672
673 // If we have stretch, put it back where it belongs
674 if (cubeAtt) {
675 p_apps[p_apps.size()-1]->SetNext(cubeAtt);
676 cubeAtt->SetPrevious(p_apps[p_apps.size()-1]);
677 p_apps.push_back(cubeAtt);
678 p_appIdentifiers.push_back(cubeAttId);
679 }
680 }
681
682
692 PipelineApplication &Pipeline::Application(const QString &identifier) {
693 int index = 0;
694 bool found = false;
695
696 while (!found && index < Size()) {
697 if (p_appIdentifiers[index] == identifier) {
698 found = true;
699 }
700 else {
701 index ++;
702 }
703 }
704
705 if (!found) {
706 QString msg = "Application identified by [" + identifier + "] has not been added to the pipeline";
707 throw IException(IException::Programmer, msg, _FILEINFO_);
708 }
709
710 return *p_apps[index];
711 }
712
713
723 if (index > Size()) {
724 QString msg = "Index [" + QString(index) + "] out of bounds";
725 throw IException(IException::Programmer, msg, _FILEINFO_);
726 }
727
728 return *p_apps[index];
729 }
730
731
744 void Pipeline::SetFirstApplication(const QString &appname) {
745 int appIndex = 0;
746 for (appIndex = 0; appIndex < (int)p_apps.size() &&
747 p_apps[appIndex]->Name() != appname; appIndex++) {
748 if (p_apps[appIndex] == NULL) continue;
749 p_apps[appIndex]->Disable();
750 }
751 // for (appIndex = 0; appIndex < (int)p_apps.size() && p_apps[appIndex]->Name() != appname; appIndex++) {
752 // p_apps[appIndex]->Disable();
753 // }
754
755 if (appIndex >= (int)p_apps.size()) {
756 QString msg = "Pipeline could not find application [" + appname + "]";
757 throw IException(IException::Programmer, msg, _FILEINFO_);
758 }
759 }
760
761
774 void Pipeline::SetLastApplication(const QString &appname) {
775 int appIndex = p_apps.size() - 1;
776 for (appIndex = p_apps.size() - 1; appIndex >= 0 && p_apps[appIndex]->Name() != appname; appIndex --) {
777 if (p_apps[appIndex] == NULL) continue;
778 p_apps[appIndex]->Disable();
779 }
780
781 if (appIndex < 0) {
782 QString msg = "Pipeline could not find application [" + appname + "]";
783 throw IException(IException::Programmer, msg, _FILEINFO_);
784 }
785 }
786
787
801 QString Pipeline::FinalOutput(int branch, bool addModifiers) {
802 QString output = ((p_finalOutput.size() != 0) ? p_finalOutput[0] : "");
803
804 if (p_apps.size() == 0) return output;
805
806 if (p_finalOutput.size() > 1) {
807 if ((unsigned int)branch >= p_finalOutput.size()) {
808 QString msg = "Output not set for branch [" + QString(branch) + "]";
809 throw IException(IException::Programmer, msg, _FILEINFO_);
810 }
811
812 if (!p_outputListNeedsModifiers) {
813 return p_finalOutput[branch];
814 }
815 else {
816 output = p_finalOutput[branch];
817 addModifiers = true;
818 }
819 }
820
821 PipelineApplication *last = p_apps[p_apps.size()-1];
822 if (last == NULL) last = p_apps[p_apps.size()-2];
823 if (!last->Enabled()) last = last->Previous();
824
825 if (output == "" || p_finalOutput.size() > 1) {
826 if (output == "") {
827 output = "./" + FileName(p_originalInput[0]).baseName();
828 }
829 else {
830 output = "./" + FileName(p_originalInput[branch]).baseName();
831 }
832
833 // Base filename off of first input file
834 if (!addModifiers || last->OutputBranches().size() == 1) {
835 if (addModifiers && p_finalOutput.size() > 1)
836 output += "." + last->OutputNameModifier();
837
838 output += "." + last->OutputExtension();
839 }
840 else {
841 // If we have multiple final outputs, rely on them to
842 // differentiate the branches
843 if (p_finalOutput.size() <= 1) {
844 output += "." + last->OutputBranches()[branch];
845 }
846
847 if (addModifiers && p_finalOutput.size() > 1)
848 output += "." + last->OutputNameModifier();
849
850 output += "." + last->OutputExtension();
851 }
852 }
853 else if (addModifiers) {
854 PipelineApplication *last = p_apps[p_apps.size()-1];
855 if (!last->Enabled()) last = last->Previous();
856
857 output = FileName(p_finalOutput[0]).path() + "/" +
858 FileName(p_finalOutput[0]).baseName() + "." +
859 last->OutputBranches()[branch] + ".";
860
861 if (p_finalOutput.size() > 1) {
862 output += last->OutputNameModifier() + ".";
863 }
864
865 output += last->OutputExtension();
866 }
867
868 return output;
869 }
870
871
879 Pvl &pref = Preference::Preferences();
880 return pref.findGroup("DataDirectory")["Temporary"];
881 }
882
883
893 for (int i = 0; i < Size(); i++) {
894 if (p_apps[i] != NULL) p_apps[i]->Enable();
895 }
896 }
897
898
915 ostream &operator<<(ostream &os, Pipeline &pipeline) {
916 pipeline.Prepare();
917
918 if (!pipeline.Name().isEmpty()) {
919 os << "PIPELINE -------> " << pipeline.Name() << " <------- PIPELINE" << endl;
920 }
921
922 for (int i = 0; i < pipeline.Size(); i++) {
923 if (pipeline.Application(i).Enabled()) {
924 const vector<QString> &params = pipeline.Application(i).ParamString();
925 for (int j = 0; j < (int)params.size(); j++) {
926 QString special(params[j].mid(0, 7));
927 if (special == ">>LIST ") {
928 QString cmd = params[j].mid(7);
929
930 QStringList listFileData = cmd.split(" ");
931 QString file = listFileData.takeFirst();
932 os << "echo -e \"" << listFileData.join("\\n") << "\" > " << file << endl;
933 }
934 else {
935 os << pipeline.Application(i).Name() << " " << params[j] << endl;
936 }
937 }
938 }
939 }
940
941 if (!pipeline.KeepTemporaryFiles()) {
942 for (int i = 0; i < pipeline.Size(); i++) {
943 if (pipeline.Application(i).Enabled()) {
944 vector<QString> tmpFiles = pipeline.Application(i).TemporaryFiles();
945 for (int file = 0; file < (int)tmpFiles.size(); file++) {
946 if (!tmpFiles[file].contains("blank")) {
947 os << "rm " << tmpFiles[file] << endl;
948 }
949 }
950 }
951 }
952 }
953
954 if (!pipeline.Name().isEmpty()) {
955 os << "PIPELINE -------> " << pipeline.Name() << " <------- PIPELINE" << endl;
956 }
957
958 return os;
959 }
960}
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
QString original() const
Returns the full file name including the file path.
Definition FileName.cpp:212
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
void print() const
Prints a string representation of this exception to stderr.
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.
QString OutputExtension()
This returns this application's output file name's extension.
const bool & Enabled() const
Returns true if this program will be run.
QString OutputNameModifier()
This returns this application's output name modifier.
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 SetPrevious(PipelineApplication *prev)
Link to the previous 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...
const std::vector< QString > & OutputBranches() const
Get the branches this program has as output.
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 KeepTemporaryFiles(bool keep)
Set whether or not to keep temporary files (files generated in the middle of the pipeline that are ne...
Definition Pipeline.cpp:546
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:692
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:801
QString TemporaryFolder()
This method returns the user's temporary folder for temporary files.
Definition Pipeline.cpp:878
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:639
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:774
void SetFirstApplication(const QString &appname)
This method disables all applications up to this one.
Definition Pipeline.cpp:744
void EnableAllApplications()
This method re-enables all applications.
Definition Pipeline.cpp:892
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 SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition Progress.cpp:85
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition Progress.cpp:61
void CheckStatus()
Checks and updates the status.
Definition Progress.cpp:105
Container for cube-like labels.
Definition Pvl.h:119
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition PvlObject.h:129
Command Line and Xml loader, validation, and access.
Isis::CubeAttributeInput & GetInputAttribute(const QString &paramName)
Gets the attributes for an input cube.
Definition IsisAml.cpp:2059
QString GetFileName(const QString &paramName, QString extension="") const
Allows the retrieval of a value for a parameter of type "filename".
Definition IsisAml.cpp:641
bool WasEntered(const QString &paramName) const
Returns a true if the parameter has a value, and false if it does not.
Definition IsisAml.cpp:2020
QString GetCubeName(const QString &paramName, QString extension="") const
Retrieves of a value for a parameter of type "cubename".
Definition IsisAml.cpp:724
QString GetAsString(const QString &paramName) const
Allows the retrieval of a value for a parameter of any type.
Definition IsisAml.cpp:570
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.