Isis 3 Programmer Reference
UserInterface.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */#include "UserInterface.h"
7 
8 #include <sstream>
9 #include <vector>
10 
11 #include <QDir>
12 
13 #include "Application.h"
14 #include "FileName.h"
15 #include "Gui.h"
16 #include "IException.h"
17 #include "IString.h"
18 #include "Message.h"
19 #include "Preference.h"
20 #include "ProgramLauncher.h"
21 #include "TextFile.h"
22 
23 using namespace std;
24 namespace Isis {
35  UserInterface::UserInterface(const QString &xmlfile, QVector<QString> &args) : IsisAml::IsisAml(xmlfile) {
36  p_interactive = false;
37  p_info = false;
38  p_infoFileName = "";
39  p_gui = NULL;
40  p_errList = "";
41  p_saveFile = "";
42  p_abortOnError = true;
43  p_parentId = 0;
44 
45  // Make sure the user has a .Isis and .Isis/history directory
46  try {
47  FileName setup = "$HOME/.Isis/history";
48  // cannot completely test this if in unit test
49  if ( !setup.fileExists() ) {
50  setup.dir().mkpath(".");
51  }
52  }
53  catch (IException &) {
54  }
55 
56  // Parse the user input
57  loadCommandLine(args);
58  }
59 
60 
71  UserInterface::UserInterface(const QString &xmlfile, int &argc,
72  char *argv[]) : IsisAml::IsisAml(xmlfile) {
73  p_interactive = false;
74  p_info = false;
75  p_infoFileName = "";
76  p_gui = NULL;
77  p_errList = "";
78  p_saveFile = "";
79  p_abortOnError = true;
80  p_parentId = 0;
81 
82  // Make sure the user has a .Isis and .Isis/history directory
83  try {
84  FileName setup = "$HOME/.Isis/history";
85  // cannot completely test this if in unit test
86  if ( !setup.fileExists() ) {
87  setup.dir().mkpath(".");
88  }
89  }
90  catch (IException &) {
91  }
92 
93  // Parse the user input
94  loadCommandLine(argc, argv);
95 
96  // See if we need to create the gui
97  // can't unit test - don't want to create a Gui object while unit testing
98  if (p_interactive) {
99  Gui::checkX11();
100  p_gui = Gui::Create(*this, argc, argv);
101  }
102  }
103 
106  // can't unit test - p_gui will be NULL in unit test
107  if (p_gui) {
108  delete p_gui;
109  p_gui = NULL;
110  }
111  }
112 
120  return p_infoFileName;
121  }
122 
123 
131  return p_info;
132  }
133 
134 
144  //Clear all parameters currently in the gui
145  for (int k = 0; k < NumGroups(); k++) {
146  for (int j = 0; j < NumParams(k); j++) {
147  Clear( ParamName(k, j) );
148  }
149  }
150 
151  //Load the new parameters into the gui
152  cout << p_progName << " ";
153 
154  for (unsigned int currArgument = 1; currArgument < p_cmdline.size(); currArgument ++) {
155  QString paramName;
156  vector<QString> paramValue;
157 
158 
159  try {
160  getNextParameter(currArgument, paramName, paramValue);
161 
162  if (paramName[0] == '-')
163  continue;
164 
165  for (unsigned int value = 0; value < paramValue.size(); value++) {
166  IString thisValue = paramValue[value];
167  QString token = thisValue.Token("$").ToQt();
168 
169  QString newValue;
170 
171  while (thisValue != "") {
172  newValue += token;
173  try {
174  int j = toInt( thisValue.substr(0, 1).c_str() ) - 1;
175  newValue += p_batchList[i][j];
176  thisValue.replace(0, 1, "");
177  token = thisValue.Token("$").ToQt();
178  }
179  catch (IException &e) {
180  // Let the variable be parsed by the application
181  newValue += "$";
182  token = thisValue.Token("$").ToQt();
183  }
184  }
185 
186  if (token != "")
187  newValue += token;
188 
189  paramValue[value] = newValue;
190  }
191  }
192  // can't test with unit test - command line is already parsed before SetBatchList() is called
193  catch (IException &e) {
194  throw IException(IException::User, "Invalid command line", _FILEINFO_);
195  }
196 
197  PutAsString(paramName, paramValue);
198 
199  cout << paramName;
200 
201  if(paramValue.size() == 1) {
202  cout << "=" << paramValue[0] << " ";
203  }
204  else if (paramValue.size() > 1) {
205  cout << "=(";
206 
207  for (unsigned int value = 0; value < paramValue.size(); value++) {
208  if(value != 0)
209  cout << ",";
210 
211  cout << paramValue[value] << endl;
212  }
213 
214  cout << ") ";
215  }
216  }
217  cout << endl;
218 
219  // Verify the command line
220  VerifyAll();
221  }
222 
223 
235  if (p_errList != "") {
236  std::ofstream os;
237  QString fileName( FileName(p_errList).expanded() );
238  os.open(fileName.toLatin1().data(), std::ios::app);
239 
240  // did not unit test since it is assumed ofstream will be instantiated correctly
241  if ( !os.good() ) {
242  QString msg = "Unable to create error list [" + p_errList
243  + "] Disk may be full or directory permissions not writeable";
244  throw IException(IException::User, msg, _FILEINFO_);
245  }
246 
247  for (int j = 0; j < (int) p_batchList[i].size(); j++) {
248  os << p_batchList[i][j] << " ";
249  }
250 
251  os << endl;
252  os.close();
253  }
254  }
255 
256 
262 
263  // If history recording is off, return
264  Preference &p = Preference::Preferences();
265  PvlGroup &grp = p.findGroup("UserInterface", Isis::Pvl::Traverse);
266  if (grp["HistoryRecording"][0] == "Off")
267  return;
268 
269  // Get the current history file
270  Isis::FileName histFile(grp["HistoryPath"][0] + "/" + ProgramName() + ".par");
271 
272  // If a save file is specified, override the default file path
273  if (p_saveFile != "")
274  histFile = p_saveFile;
275 
276  // Get the current command line
277  Isis::Pvl cmdLine;
278  CommandLine(cmdLine);
279 
280  Isis::Pvl hist;
281 
282  // If the history file's Pvl is corrupted, then
283  // leave hist empty such that the history gets
284  // overwriten with the new entry.
285  try {
286  if ( histFile.fileExists() ) {
287  hist.read( histFile.expanded() );
288  }
289  }
290  catch (IException &) {
291  }
292 
293  // Add it
294  hist.addGroup( cmdLine.findGroup("UserParameters") );
295 
296  // See if we have exceeded history length
297  while( hist.groups() > toInt(grp["HistoryLength"][0]) ) {
298  hist.deleteGroup("UserParameters");
299  }
300 
301  // Write it
302  try {
303  hist.write( histFile.expanded() );
304  }
305  catch (IException &) {
306  }
307  }
308 
309 
322  void UserInterface::loadBatchList(const QString file) {
323  // Read in the batch list
324  TextFile temp;
325  try {
326  temp.Open(file);
327  }
328  catch (IException &e) {
329  QString msg = "The batchlist file [" + file + "] could not be opened";
330  throw IException(IException::User, msg, _FILEINFO_);
331  }
332 
333  p_batchList.resize( temp.LineCount() );
334 
335  for (int i = 0; i < temp.LineCount(); i++) {
336  QString t;
337  temp.GetLine(t);
338 
339  // Convert tabs to spaces but leave tabs inside quotes alone
340  t = IString(t).Replace("\t", " ", true).ToQt();
341 
342  t = IString(t).Compress().ToQt().trimmed();
343  // Allow " ," " , " or ", " as a valid single seperator
344  t = IString(t).Replace(" ,", ",", true).ToQt();
345  t = IString(t).Replace(", ", ",", true).ToQt();
346  // Convert all spaces to "," the use "," as delimiter
347  t = IString(t).Replace(" ", ",", true).ToQt();
348  int j = 0;
349 
350  QStringList tokens = t.split(",");
351 
352  foreach (QString token, tokens) {
353  // removes quotes from tokens. NOTE: also removes escaped quotes.
354  token = token.remove( QRegExp("[\"']") );
355  p_batchList[i].push_back(token);
356  j++ ;
357  }
358 
359  p_batchList[i].resize(j);
360  // Every row in the batchlist must have the same number of columns
361  if (i == 0)
362  continue;
363  if ( p_batchList[i - 1].size() != p_batchList[i].size() ) {
364  QString msg = "The number of columns must be constant in batchlist";
365  throw IException(IException::User, msg, _FILEINFO_);
366  }
367  }
368  // The batchlist cannot be empty
369  if (p_batchList.size() < 1) {
370  QString msg = "The list file [" + file + "] does not contain any data";
371  throw IException(IException::User, msg, _FILEINFO_);
372  }
373  }
374 
375 
376 
390  void UserInterface::loadCommandLine(QVector<QString> &args, bool ignoreAppName) {
391  char **c_args;
392 
393  if (ignoreAppName) {
394  args.prepend("someapp");
395  }
396 
397  c_args = (char**)malloc(sizeof(char*)*args.size());
398 
399  for (int i = 0; i < args.size(); i++) {
400  c_args[i] = (char*)malloc(sizeof(char)*args[i].size()+1);
401  strcpy(c_args[i], args[i].toLatin1().data());
402  }
403 
404  loadCommandLine(args.size(), c_args);
405  }
406 
407 
423  void UserInterface::loadCommandLine(int argc, char *argv[]) {
424  // The program will be interactive if it has no arguments or
425  // if it has the name unitTest
426  p_progName = argv[0];
428  // cannot completely test in a unit test since unitTest will always evaluate to true
429  if ( (argc == 1) && (file.name() != "unitTest") ) {
430  p_interactive = true;
431  }
432 
433  p_cmdline.clear();
434  for (int i = 0; i < argc; i++) {
435  p_cmdline.push_back(argv[i]);
436  }
437 
438  // Check for special tokens (reserved parameters) (those beginning with a dash)
439  vector<QString> options;
440  options.push_back("-GUI");
441  options.push_back("-NOGUI");
442  options.push_back("-BATCHLIST");
443  options.push_back("-LAST");
444  options.push_back("-RESTORE");
445  options.push_back("-WEBHELP");
446  options.push_back("-HELP");
447  options.push_back("-ERRLIST");
448  options.push_back("-ONERROR");
449  options.push_back("-SAVE");
450  options.push_back("-INFO");
451  options.push_back("-PREFERENCE");
452  options.push_back("-LOG");
453  options.push_back("-VERBOSE");
454  options.push_back("-PID");
455 
456  bool usedDashLast = false;
457  bool usedDashRestore = false; //< for throwing -batchlist exceptions at end of function
458 
459  // pre-process command line for -HELP first
460  preProcess("-HELP", options);
461  // pre-process command line for -WEBHELP
462  preProcess("-WEBHELP", options);
463  // now, parse command line to evaluate -LAST
464  preProcess("-LAST", options);
465 
466  for (unsigned int currArgument = 1; currArgument < (unsigned)argc; currArgument++) {
467  QString paramName;
468  vector<QString> paramValue;
469 
470  getNextParameter(currArgument, paramName, paramValue);
471 
472  // we now have a name,value pair
473  if (paramName[0] == '-') {
474  paramName = paramName.toUpper();
475 
476  // where if(paramname == -last ) to continue } was originally
477 
478  if (paramValue.size() > 1) {
479  QString msg = "Invalid value for reserve parameter ["
480  + paramName + "]";
481  throw IException(IException::User, msg, _FILEINFO_);
482  }
483 
484  // resolve the reserved parameter (e.g. set -h to -HELP)
485  paramName = resolveParameter(paramName, options);
486 
487  // Prevent double handling of -LAST to prevent conflicts
488  // Keep track of using -LAST to prevent conflicts with -BATCHLIST
489  if (paramName == "-LAST") {
490  usedDashLast = true;
491  continue;
492  }
493 
494 
495  // Keep track of using -RESTORE to prevent conflicts with -BATCHLIST
496  if (paramName == "-RESTORE") {
497  usedDashRestore = true;
498  }
499 
500 
501  QString realValue = "";
502 
503  if ( paramValue.size() ) {
504  realValue = paramValue[0];
505  }
506 
507  evaluateOption(paramName, realValue);
508 
509  continue;
510  }
511 
512  try {
513  Clear(paramName);
514  PutAsString(paramName, paramValue);
515  }
516  catch (IException &e) {
517  throw IException(e, IException::User, "Invalid command line", _FILEINFO_);
518  }
519 
520  }
521 
522  // Can't use the batchlist with the gui, save, last or restore option
523  if ( BatchListSize() != 0 && (p_interactive || usedDashLast || p_saveFile != ""
524  || usedDashRestore) ) {
525  QString msg = "-BATCHLIST cannot be used with -GUI, -SAVE, -RESTORE, ";
526  msg += "or -LAST";
527  throw IException(IException::User, msg, _FILEINFO_);
528  }
529 
530  // Must use batchlist if using errorlist or onerror=continue
531  if ( (BatchListSize() == 0) && (!p_abortOnError || p_errList != "") ) {
532  QString msg = "-ERRLIST and -ONERROR=continue cannot be used without ";
533  msg += " the -BATCHLIST option";
534  throw IException(IException::User, msg, _FILEINFO_);
535  }
536  }
537 
538 
550  void UserInterface::loadHistory(const QString file) {
551  Isis::FileName hist(file);
552  if ( hist.fileExists() ) {
553  try {
554  Isis::Pvl lab( hist.expanded() );
555 
556  int g = lab.groups() - 1;
557  if (g >= 0 && lab.group(g).isNamed("UserParameters") ) {
558  Isis::PvlGroup &up = lab.group(g);
559  QString commandline(p_progName + " ");
560  for (int k = 0; k < up.keywords(); k++) {
561  QString keyword = up[k].name();
562 
563  vector<QString> values;
564 
565  for (int i = 0; i < up[k].size(); i++) {
566  values.push_back(up[k][i]);
567  }
568 
569  const IsisParameterData *paramData = ReturnParam(keyword);
570 
571  bool matchesDefault = false;
572  if (values.size() == 1 && paramData->internalDefault == values[0])
573  matchesDefault = true;
574 
575  if (!matchesDefault) {
576  matchesDefault =
577  (values.size() == paramData->defaultValues.size());
578 
579  for (int i = 0; matchesDefault && i < (int)values.size(); i++) {
580  matchesDefault = matchesDefault &&
581  values[i] == paramData->defaultValues[i];
582  }
583  }
584 
585  if (!matchesDefault) {
586  PutAsString(keyword, values);
587  commandline += keyword + "=";
588  foreach(QString val, values) {
589  commandline += val + " ";
590  }
591  }
592  }
593 
594  cout << commandline << endl;
595  return;
596  }
597 
598  for (int o = lab.objects() - 1; o >= 0; o--) {
599  if ( lab.object(o).isNamed( ProgramName() ) ) {
600  Isis::PvlObject &obj = lab.object(o);
601  for (int g = obj.groups() - 1; g >= 0; g--) {
602  Isis::PvlGroup &up = obj.group(g);
603  if ( up.isNamed("UserParameters") ) {
604  for (int k = 0; k < up.keywords(); k++) {
605  QString keyword = up[k].name();
606  QString value = up[k][0];
607  PutAsString(keyword, value);
608  }
609  }
610  return;
611  }
612  }
613  }
614 
615  /*QString msg = "[" + hist.expanded() +
616  "] does not contain any parameters to restore";
617  throw Isis::iException::Message( Isis::iException::User, msg, _FILEINFO_ );*/
618  }
619  catch (...) {
620  QString msg = "The history file [" + file + "] is for a different application or corrupt, "\
621  "please fix or delete this file";
622  throw IException(IException::User, msg, _FILEINFO_);
623  }
624  }
625  else {
626  QString msg = "The history file [" + file + "] does not exist";
627  throw IException(IException::User, msg, _FILEINFO_);
628  }
629  }
630 
631 
649  void UserInterface::evaluateOption(const QString name,
650  const QString value) {
651  // check to see if the program is a unitTest
652  bool unitTest = false;
653  if (FileName(p_progName).name() == "unitTest") {
654  unitTest = true;
655  }
656  Preference &p = Preference::Preferences();
657 
658  if (name == "-GUI") {
659  p_interactive = true;
660  }
661  else if (name == "-NOGUI") {
662  p_interactive = false;
663  }
664  else if (name == "-BATCHLIST") {
665  loadBatchList(value);
666  }
667  else if (name == "-LAST") {
668  QString histFile;
669  // need to handle for unit test since -LAST is preprocessed
670  if (unitTest) {
671  histFile = "./" + FileName(p_progName).name() + ".par";
672  }
673  else {
674  PvlGroup &grp = p.findGroup("UserInterface", Isis::Pvl::Traverse);
675  histFile = grp["HistoryPath"][0] + "/" + FileName(p_progName).name() + ".par";
676  }
677 
678  loadHistory(histFile);
679  }
680  else if(name == "-RESTORE") {
681  loadHistory(value);
682  }
683  else if(name == "-WEBHELP") {
684  Isis::PvlGroup &pref = Isis::Preference::Preferences().findGroup("UserInterface");
685  QString command = pref["GuiHelpBrowser"];
686  command += " $ISISROOT/docs/Application/presentation/Tabbed/";
687  command += FileName(p_progName).name() + "/" + FileName(p_progName).name() + ".html";
688  // cannot test else in unit test - don't want to open webhelp
689  if (unitTest) {
691  "Evaluating -WEBHELP should only throw this exception during a unitTest",
692  _FILEINFO_);
693  }
694  else {
696  exit(0);
697  }
698 
699  }
700  else if (name == "-INFO") {
701  p_info = true;
702 
703  // check for filename and set value
704  if (value.size() != 0) {
705  p_infoFileName = value;
706  }
707  }
708  else if (name == "-HELP") {
709  if (value.size() == 0) {
710  Pvl params;
711  params.setTerminator("");
712  for (int k = 0; k < NumGroups(); k++) {
713  for (int j = 0; j < NumParams(k); j++) {
714  if (ParamListSize(k, j) == 0) {
715  params += PvlKeyword( ParamName(k, j), ParamDefault(k, j) );
716  }
717  else {
718  PvlKeyword key( ParamName(k, j) );
719  QString def = ParamDefault(k, j);
720  for (int l = 0; l < ParamListSize(k, j); l++) {
721  if (ParamListValue(k, j, l) == def)
722  key.addValue("*" + def);
723  else
724  key.addValue( ParamListValue(k, j, l) );
725  }
726  params += key;
727  }
728  }
729  }
730  cout << params;
731  }
732  else {
733  Pvl param;
734  param.setTerminator("");
735  QString key = value;
736  for (int k = 0; k < NumGroups(); k++) {
737  for (int j = 0; j < NumParams(k); j++) {
738  if (ParamName(k, j) == key) {
739  param += PvlKeyword("ParameterName", key);
740  param += PvlKeyword( "Brief", ParamBrief(k, j) );
741  param += PvlKeyword( "Type", ParamType(k, j) );
742  if (PixelType(k, j) != "") {
743  param += PvlKeyword( "PixelType", PixelType(k, j) );
744  }
745  if (ParamInternalDefault(k, j) != "") {
746  param += PvlKeyword( "InternalDefault", ParamInternalDefault(k, j) );
747  }
748  else {
749  param += PvlKeyword( "Default", ParamDefault(k, j) );
750  }
751  if (ParamMinimum(k, j) != "") {
752  if (ParamMinimumInclusive(k, j).toUpper() == "YES") {
753  param += PvlKeyword( "GreaterThanOrEqual",
754  ParamMinimum(k, j) );
755  }
756  else {
757  param += PvlKeyword( "GreaterThan",
758  ParamMinimum(k, j) );
759  }
760  }
761  if (ParamMaximum(k, j) != "") {
762  if (ParamMaximumInclusive(k, j).toUpper() == "YES") {
763  param += PvlKeyword( "LessThanOrEqual",
764  ParamMaximum(k, j) );
765  }
766  else {
767  param += PvlKeyword( "LessThan",
768  ParamMaximum(k, j) );
769  }
770  }
771  if (ParamLessThanSize(k, j) > 0) {
772  PvlKeyword key("LessThan");
773  for(int l = 0; l < ParamLessThanSize(k, j); l++) {
774  key.addValue( ParamLessThan(k, j, l) );
775  }
776  param += key;
777  }
778  if (ParamLessThanOrEqualSize(k, j) > 0) {
779  PvlKeyword key("LessThanOrEqual");
780  for (int l = 0; l < ParamLessThanOrEqualSize(k, j); l++) {
781  key.addValue( ParamLessThanOrEqual(k, j, l) );
782  }
783  param += key;
784  }
785  if (ParamNotEqualSize(k, j) > 0) {
786  PvlKeyword key("NotEqual");
787  for (int l = 0; l < ParamNotEqualSize(k, j); l++) {
788  key.addValue( ParamNotEqual(k, j, l) );
789  }
790  param += key;
791  }
792  if (ParamGreaterThanSize(k, j) > 0) {
793  PvlKeyword key("GreaterThan");
794  for (int l = 0; l < ParamGreaterThanSize(k, j); l++) {
795  key.addValue( ParamGreaterThan(k, j, l) );
796  }
797  param += key;
798  }
799  if (ParamGreaterThanOrEqualSize(k, j) > 0) {
800  PvlKeyword key("GreaterThanOrEqual");
801  for(int l = 0; l < ParamGreaterThanOrEqualSize(k, j); l++) {
802  key.addValue( ParamGreaterThanOrEqual(k, j, l) );
803  }
804  param += key;
805  }
806  if (ParamIncludeSize(k, j) > 0) {
807  PvlKeyword key("Inclusions");
808  for (int l = 0; l < ParamIncludeSize(k, j); l++) {
809  key.addValue( ParamInclude(k, j, l) );
810  }
811  param += key;
812  }
813  if (ParamExcludeSize(k, j) > 0) {
814  PvlKeyword key("Exclusions");
815  for (int l = 0; l < ParamExcludeSize(k, j); l++) {
816  key.addValue( ParamExclude(k, j, l) );
817  }
818  param += key;
819  }
820  if (ParamOdd(k, j) != "") {
821  param += PvlKeyword( "Odd", ParamOdd(k, j) );
822  }
823  if (ParamListSize(k, j) != 0) {
824  for (int l = 0; l < ParamListSize(k, j); l++) {
825  PvlGroup grp( ParamListValue(k, j, l) );
826  grp += PvlKeyword( "Brief", ParamListBrief(k, j, l) );
827  if (ParamListIncludeSize(k, j, l) != 0) {
828  PvlKeyword include("Inclusions");
829  for (int m = 0; m < ParamListIncludeSize(k, j, l); m++) {
830  include.addValue( ParamListInclude(k, j, l, m) );
831  }
832  grp += include;
833  }
834  if (ParamListExcludeSize(k, j, l) != 0) {
835  PvlKeyword exclude("Exclusions");
836  for (int m = 0; m < ParamListExcludeSize(k, j, l); m++) {
837  exclude.addValue( ParamListExclude(k, j, l, m) );
838  }
839  grp += exclude;
840  }
841  param.addGroup(grp);
842  }
843  }
844  cout << param;
845  }
846  }
847  }
848  }
849  // we must throw an exception for unitTest to handle to continue testing
850  if (unitTest) {
852  "Evaluating -HELP should only throw this exception during a unitTest",
853  _FILEINFO_);
854  }
855  // all other apps shall exit when -HELP is present
856  else {
857  exit(0);
858  }
859  }
860  else if (name == "-PID") {
861  p_parentId = toInt(value);
862  }
863  else if (name == "-ERRLIST") {
864  p_errList = value;
865 
866  if (value == "") {
867  QString msg = "-ERRLIST expects a file name";
868  throw IException(IException::User, msg, _FILEINFO_);
869  }
870 
871  if ( FileName(p_errList).fileExists() ) {
872  QFile::remove(p_errList);
873  }
874  }
875  else if (name == "-ONERROR") {
876  if (value.toUpper() == "CONTINUE") {
877  p_abortOnError = false;
878  }
879 
880  else if (value.toUpper() == "ABORT") {
881  p_abortOnError = true;
882  }
883 
884  else {
885  QString msg = "[" + value
886  + "] is an invalid value for -ONERROR, options are ABORT or CONTINUE";
887  throw IException(IException::User, msg, _FILEINFO_);
888  }
889  }
890  else if (name == "-SAVE") {
891  if (value.size() == 0) {
892  p_saveFile = ProgramName() + ".par";
893  }
894  else {
895  p_saveFile = value;
896  }
897  }
898  else if (name == "-PREFERENCE") {
899  p.Load(value);
900  }
901  else if (name == "-LOG") {
902  if( value.isEmpty() ) {
903  p.findGroup("SessionLog")["FileOutput"].setValue("On");
904  }
905  else {
906  p.findGroup("SessionLog")["FileOutput"].setValue("On");
907  p.findGroup("SessionLog")["FileName"].setValue(value);
908  }
909  }
910  // this only evaluates to true in unit test since this is last else if
911  else if (name == "-VERBOSE") {
912  p.findGroup("SessionLog")["TerminalOutput"].setValue("On");
913  }
914 
915  // Can't have a parent id and the gui
916  if (p_parentId > 0 && p_interactive) {
917  QString msg = "-GUI and -PID are incompatible arguments";
918  throw IException(IException::Unknown, msg, _FILEINFO_);
919  }
920  }
921 
922 
934  void UserInterface::getNextParameter(unsigned int &curPos,
935  QString &name,
936  std::vector<QString> &value) {
937  QString paramName = p_cmdline[curPos];
938  QString paramValue = "";
939 
940  // we need to split name and value, they can either be in 1, 2 or 3 arguments,
941  // try to see if "=" is end of argument to distinguish. Some options have no
942  // "=" and they are value-less (-gui for example).
943  if ( !paramName.contains("=") ) {
944  // This looks value-less, but lets make sure
945  // the next argument is not an equals sign by
946  // itself
947  if (curPos < p_cmdline.size() - 2) {
948  if (QString(p_cmdline[curPos + 1]).compare("=") == 0) {
949  paramValue = p_cmdline[curPos + 2];
950 
951  // increment extra to skip 2 elements next time around
952  curPos += 2;
953  }
954  }
955  }
956  // = is end of parameter, next item must be value
957  else if ( paramName.endsWith("=") ) {
958  paramName = paramName.mid(0, paramName.size() - 1);
959 
960  if (curPos + 1 < p_cmdline.size() ) {
961  paramValue = p_cmdline[curPos + 1];
962  }
963 
964  // increment extra to skip next element next time around
965  curPos++ ;
966  }
967  // we found "=" in the middle
968  else if (paramName.indexOf("=") > 0) {
969  QString parameterLiteral = p_cmdline[curPos];
970  paramName = parameterLiteral.mid( 0, parameterLiteral.indexOf("=") );
971  paramValue = parameterLiteral.mid(parameterLiteral.indexOf("=") + 1);
972  }
973  // We found "=" at the beginning - did we find "appname param =value" ?
974  else {
975  // parameters can not start with "="
976  QString msg = "Unknown parameter [" + QString(p_cmdline[curPos])
977  + "]";
978  throw IException(IException::User, msg, _FILEINFO_);
979  }
980 
981  name = paramName;
982  value.clear();
983 
984  // read arrays out of paramValue
985  paramValue = paramValue.trimmed();
986 
987  if (paramValue.length() > 0 && paramValue[0] != '(') {
988  // We dont have an array... if they escaped
989  // an open paren, undo their escape
990 
991  // escape: \‍( result: (
992  if (paramValue.length() > 1 && paramValue.mid(0, 2) =="\\(") {
993  paramValue = paramValue.mid(1);
994  }
995  // escape: \\‍( result: \‍(
996  else if (paramValue.length() > 2 && paramValue.mid(0, 3) == "\\\\(") {
997  paramValue = paramValue.mid(1);
998  }
999 
1000  value.push_back(paramValue);
1001  }
1002  else if ( paramValue.length() ) {
1003  // We have an array...
1004  value = readArray(paramValue);
1005  }
1006  }
1007 
1008 
1021  void UserInterface::preProcess(QString fullReservedName,
1022  std::vector<QString> &reservedParams) {
1023  for (unsigned int currArgument = 1; currArgument < (unsigned)p_cmdline.size();
1024  currArgument++) {
1025 
1026  QString paramName = p_cmdline[currArgument];
1027  QString trueParamValue = "";
1028  vector<QString> paramValue;
1029 
1030  // reserved parameters start with -
1031  if (paramName[0] == '-') {
1032 
1033  // grab the current argument
1034  getNextParameter(currArgument, paramName, paramValue);
1035  paramName = paramName.toUpper();
1036 
1037  // grab the argument's value
1038  if ( paramValue.size() ) {
1039  trueParamValue = paramValue[0].toUpper();
1040  }
1041 
1042  // resolve the reserved parameter token
1043  paramName = resolveParameter(paramName, reservedParams, false);
1044 
1045  // evaluate the resolved parameter if it matches fullReservedName
1046  if (fullReservedName == paramName) {
1047  evaluateOption(paramName, trueParamValue);
1048  }
1049  }
1050  }
1051  }
1052 
1053 
1067  std::vector<QString> UserInterface::readArray(QString arrayString) {
1068  std::vector<QString> values;
1069 
1070  bool inDoubleQuotes = false;
1071  bool inSingleQuotes = false;
1072  bool arrayClosed = false;
1073  bool nextElementStarted = false;
1074  QString currElement = "";
1075 
1076  for (int strPos = 0; strPos < arrayString.size(); strPos++) {
1077  if (strPos == 0) {
1078  if (arrayString[strPos] != '(') {
1079  QString msg = "Invalid array format [" + arrayString + "]";
1080  throw IException(IException::User, msg, _FILEINFO_);
1081  }
1082 
1083  continue;
1084  }
1085 
1086  // take literally anything that is escaped and not quoted
1087  if ( arrayString[strPos] == '\\' && strPos + 1 < (int)arrayString.size() ) {
1088  currElement += arrayString[strPos+1];
1089  strPos++;
1090  continue;
1091  }
1092  // ends in a backslash??
1093  else if (arrayString[strPos] == '\\') {
1094  QString msg = "Invalid array format [" + arrayString + "]";
1095  throw IException(IException::User, msg, _FILEINFO_);
1096  }
1097 
1098  // not in quoted part of QString
1099  if (!inDoubleQuotes && !inSingleQuotes) {
1100  if (arrayClosed) {
1101  QString msg = "Invalid array format [" + arrayString + "]";
1102  throw IException(IException::User, msg, _FILEINFO_);
1103  }
1104 
1105  nextElementStarted = (nextElementStarted || arrayString[strPos] != ' ');
1106 
1107  if (!nextElementStarted) {
1108  continue;
1109  }
1110 
1111  if (arrayString[strPos] == '"') {
1112  inDoubleQuotes = true;
1113  }
1114  else if (arrayString[strPos] == '\'') {
1115  inSingleQuotes = true;
1116  }
1117  else if (arrayString[strPos] == ',') {
1118  values.push_back(currElement);
1119  currElement = "";
1120  nextElementStarted = false;
1121  }
1122  else if (arrayString[strPos] == ')') {
1123  values.push_back(currElement);
1124  currElement = "";
1125  arrayClosed = true;
1126  nextElementStarted = false;
1127  }
1128  else if (nextElementStarted && arrayString[strPos] == ' ') {
1129  // Make sure there's something before the next ',' or ')'
1130  bool onlyWhite = true;
1131  int closingPos = strPos + 1;
1132 
1133  for( int pos = strPos;
1134  onlyWhite && arrayString[pos] != ',' && arrayString[pos] != ')' &&
1135  pos < arrayString.size(); pos++) {
1136  closingPos++;
1137  onlyWhite &= (arrayString[pos] == ' ');
1138  }
1139 
1140  if (!onlyWhite) {
1141  currElement += arrayString[strPos];
1142  }
1143  }
1144  else if (nextElementStarted) {
1145  currElement += arrayString[strPos];
1146  }
1147  }
1148  else if (inSingleQuotes) {
1149  if(arrayString[strPos] == '\'') {
1150  inSingleQuotes = false;
1151  }
1152  else {
1153  currElement += arrayString[strPos];
1154  }
1155  }
1156  // in double quotes
1157  else {
1158  if (arrayString[strPos] == '"') {
1159  inDoubleQuotes = false;
1160  }
1161  else {
1162  currElement += arrayString[strPos];
1163  }
1164  }
1165  }
1166 
1167  if (!arrayClosed || currElement != "") {
1168  QString msg = "Invalid array format [" + arrayString + "]";
1169  throw IException(IException::User, msg, _FILEINFO_);
1170  }
1171 
1172  return values;
1173  }
1174 
1175 
1194  QString UserInterface::resolveParameter(QString &unresolvedParam,
1195  std::vector<QString> &reservedParams,
1196  bool handleNoMatches) {
1197  // index of the reserved parameter in options that matches the cmdline parameter
1198  int matchOption = -1;
1199  // determine if the reserved parameter on cmdline is shortened (e.g. -h for -HELP)
1200  for (int option = 0; option < (int)reservedParams.size(); option++) {
1201  // If our option starts with the parameter name so far, this is it
1202  if ( reservedParams[option].startsWith(unresolvedParam) ) {
1203  if (matchOption >= 0) {
1204  QString msg = "Ambiguous Reserve Parameter ["
1205  + unresolvedParam + "]. Please clarify.";
1206  throw IException(IException::User, msg, _FILEINFO_);
1207  }
1208  // set match to current iteration in loop
1209  matchOption = option;
1210  }
1211  }
1212  // handle matches by default
1213  if (handleNoMatches) {
1214  // handle no matches
1215  if (matchOption < 0) {
1216  QString msg = "Invalid Reserve Parameter Option ["
1217  + unresolvedParam + "]. Choices are ";
1218 
1219  QString msgOptions;
1220  for (int option = 0; option < (int)reservedParams.size(); option++) {
1221  // Make sure not to show -PID as an option
1222  if (reservedParams[option].compare("-PID") == 0) {
1223  continue;
1224  }
1225 
1226  msgOptions += reservedParams[option];
1227  msgOptions += ",";
1228 
1229  // this condition will never evaluate to FALSE -
1230  // this condition is only reachable when reservedParams.size() == 0 (empty) -
1231  // if this is the case, this for loop will never be entered
1232 // if ( !reservedParams.empty() ) {
1233 // msgOptions += ",";
1234 // }
1235  }
1236 
1237  // remove the terminating ',' from msgOptions
1238  msgOptions.chop(1);
1239  msg += " [" + msgOptions + "]";
1240 
1241  throw IException(IException::User, msg, _FILEINFO_);
1242  }
1243  }
1244  if (matchOption < 0) {
1245  return "";
1246  }
1247  else {
1248  return reservedParams[matchOption];
1249  }
1250  }
1251 } // end namespace isis
Isis::IString::Replace
IString Replace(const std::string &from, const std::string &to, int maxReplaceCount=20)
Replaces all instances of the first input string with the second input string.
Definition: IString.cpp:1037
Isis::UserInterface::GetInfoFileName
QString GetInfoFileName()
This method returns the filename where the debugging info is stored when the "-info" tag is used.
Definition: UserInterface.cpp:119
IsisAml::PutAsString
void PutAsString(const QString &paramName, const QString &value)
Allows the insertion of a value for any parameter.
Definition: IsisAml.cpp:65
IsisAml::ParamListSize
int ParamListSize(const int &group, const int &param) const
Returns the number of options in the specified parameter's list.
Definition: IsisAml.cpp:1601
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::PvlObject::group
PvlGroup & group(const int index)
Return the group at the specified index.
Definition: PvlObject.cpp:452
Isis::UserInterface::evaluateOption
void evaluateOption(const QString name, const QString value)
This interprets the "-" options for reserved parameters.
Definition: UserInterface.cpp:649
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::UserInterface::p_errList
QString p_errList
FileName to write batchlist line that caused error on.
Definition: UserInterface.h:223
Isis::ProgramLauncher::RunSystemCommand
static void RunSystemCommand(QString commandLine)
This runs arbitrary system commands.
Definition: ProgramLauncher.cpp:207
IsisAml::ParamListValue
QString ParamListValue(const int &group, const int &param, const int &option) const
Returns the option value for a specific option to a parameter.
Definition: IsisAml.cpp:1615
IsisAml::NumGroups
int NumGroups() const
Returns the number of groups found in the XML.
Definition: IsisAml.cpp:1087
IsisAml::ParamMinimumInclusive
QString ParamMinimumInclusive(const int &group, const int &param) const
Returns whether the minimum value is inclusive or not.
Definition: IsisAml.cpp:1284
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::UserInterface::p_info
bool p_info
Boolean value representing if it's in debug mode.
Definition: UserInterface.h:227
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::PvlKeyword::addValue
void addValue(QString value, QString unit="")
Adds a value with units.
Definition: PvlKeyword.cpp:252
Isis::UserInterface::SetErrorList
void SetErrorList(int i)
This method adds the line specified in the BatchList that the error occured on.
Definition: UserInterface.cpp:234
Isis::PvlObject::groups
int groups() const
Returns the number of groups contained.
Definition: PvlObject.h:75
Isis::FileName::fileExists
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:449
Isis::UserInterface::p_batchList
std::vector< std::vector< QString > > p_batchList
Vector of batchlist data.
Definition: UserInterface.h:219
IsisAml::ParamBrief
QString ParamBrief(const int &group, const int &param) const
Returns the brief description of a parameter in a specified group.
Definition: IsisAml.cpp:1232
IsisAml::ParamGreaterThanOrEqual
QString ParamGreaterThanOrEqual(const int &group, const int &param, const int &great) const
Returns the name of the specified greaterThanOrEqual parameter.
Definition: IsisAml.cpp:1402
IsisParameterData
Definition: IsisAmlData.h:53
Isis::UserInterface::p_interactive
bool p_interactive
Boolean value representing whether the program is interactive or not.
Definition: UserInterface.h:231
Isis::TextFile
Provides access to sequential ASCII stream I/O.
Definition: TextFile.h:38
IsisAml::ParamMaximum
QString ParamMaximum(const int &group, const int &param) const
Returns the maximum value of a parameter in a specified group.
Definition: IsisAml.cpp:1271
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::TextFile::GetLine
bool GetLine(QString &line, const bool skipComments=true)
Gets next line from file.
Definition: TextFile.cpp:411
Isis::PvlObject::objects
int objects() const
Returns the number of objects.
Definition: PvlObject.h:219
Isis::Pvl::write
void write(const QString &file)
Opens and writes PVL information to a file and handles the end of line sequence.
Definition: Pvl.cpp:130
Isis::UserInterface::GetInfoFlag
bool GetInfoFlag()
This method returns the flag state of info.
Definition: UserInterface.cpp:130
IsisAml::ParamGreaterThan
QString ParamGreaterThan(const int &group, const int &param, const int &great) const
Returns the name of the specified greaterThan parameter.
Definition: IsisAml.cpp:1387
Isis::PvlObject::object
PvlObject & object(const int index)
Return the object at the specified index.
Definition: PvlObject.cpp:489
IsisAml::ParamDefault
QString ParamDefault(const int &group, const int &param) const
Returns the default for a parameter in a specified group.
Definition: IsisAml.cpp:1505
QStringList
IsisAml::ParamListBrief
QString ParamListBrief(const int &group, const int &param, const int &option) const
Returns the brief description for a specific option to a parameter.
Definition: IsisAml.cpp:1630
IsisAml::ParamIncludeSize
int ParamIncludeSize(const int &group, const int &param) const
Returns the number of parameters included in this parameter's inclusions.
Definition: IsisAml.cpp:1731
Isis::UserInterface::p_infoFileName
QString p_infoFileName
FileName to save debugging info.
Definition: UserInterface.h:229
Isis::UserInterface::readArray
std::vector< QString > readArray(QString arrayString)
This interprets an array value from the command line.
Definition: UserInterface.cpp:1067
Isis::UserInterface::loadBatchList
void loadBatchList(const QString file)
Loads the user entered batchlist file into a private variable for later use.
Definition: UserInterface.cpp:322
IsisAml::ParamType
QString ParamType(const int &group, const int &param) const
Returns the parameter type of a parameter in a specified group.
Definition: IsisAml.cpp:1492
Isis::UserInterface::BatchListSize
int BatchListSize()
Returns the size of the batchlist.
Definition: UserInterface.h:162
Isis::UserInterface::p_parentId
int p_parentId
This is a status to indicate if the GUI is running or not.
Definition: UserInterface.h:233
IsisAml::ParamInternalDefault
QString ParamInternalDefault(const int &group, const int &param) const
Returns the internal default for a parameter in a specified group.
Definition: IsisAml.cpp:1524
IsisAml::ParamListExcludeSize
int ParamListExcludeSize(const int &group, const int &param, const int &option) const
Returns the number of items in a parameters list exclude section.
Definition: IsisAml.cpp:1660
Isis::UserInterface::~UserInterface
~UserInterface()
Destroys the UserInterface object.
Definition: UserInterface.cpp:105
Isis::IString::Compress
IString Compress(bool force=false)
Collapses multiple spaces into single spaces.
Definition: IString.cpp:974
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::TextFile::Open
void Open(const QString &filename, const char *openmode="input", const char *extension="")
Opens a text file.
Definition: TextFile.cpp:217
IsisAml::VerifyAll
void VerifyAll()
Verify all parameters.
Definition: IsisAml.cpp:2387
Isis::TextFile::LineCount
int LineCount(const int &maxLinesToRead=0)
Counts number of lines in file.
Definition: TextFile.cpp:607
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
IsisAml::ParamNotEqualSize
int ParamNotEqualSize(const int &group, const int &param) const
Returns the number of values in the not equal list.
Definition: IsisAml.cpp:1374
Isis::UserInterface::p_gui
Gui * p_gui
Pointer to the gui object.
Definition: UserInterface.h:225
Isis::UserInterface::loadCommandLine
void loadCommandLine(QVector< QString > &args, bool ignoreAppName=true)
This is used to load the command line into p_cmdline and the Aml object using information contained i...
Definition: UserInterface.cpp:390
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::FileName::dir
QDir dir() const
Returns the path of the file's parent directory as a QDir object.
Definition: FileName.cpp:465
Isis::UserInterface::p_progName
QString p_progName
Name of program to run.
Definition: UserInterface.h:235
Isis::Pvl::read
void read(const QString &file)
Loads PVL information from a stream.
Definition: Pvl.cpp:90
Isis::PvlContainer::isNamed
bool isNamed(const QString &match) const
Returns whether the given string is equal to the container name or not.
Definition: PvlContainer.h:72
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
IsisAml
Application program XML file parameter manager.
Definition: IsisAml.h:138
Isis::UserInterface::SetBatchList
void SetBatchList(int i)
Clears the gui parameters and sets the batch list information at line i as the new parameters.
Definition: UserInterface.cpp:143
Isis::UserInterface::p_cmdline
std::vector< char * > p_cmdline
This variable will contain argv.
Definition: UserInterface.h:221
IsisAml::ParamExclude
QString ParamExclude(const int &group, const int &param, const int &exclude) const
Returns the name of the specified excluded parameter.
Definition: IsisAml.cpp:1462
IsisAml::ParamNotEqual
QString ParamNotEqual(const int &group, const int &param, const int &notEq) const
Returns the name of the specified notEqual parameter.
Definition: IsisAml.cpp:1447
IsisAml::ParamListInclude
QString ParamListInclude(const int &group, const int &param, const int &option, const int &include) const
Returns the parameter name to be included if this option is selected.
Definition: IsisAml.cpp:1705
IsisAml::ParamMinimum
QString ParamMinimum(const int &group, const int &param) const
Returns the minimum value of a parameter in a specified group.
Definition: IsisAml.cpp:1258
IsisAml::ParamExcludeSize
int ParamExcludeSize(const int &group, const int &param) const
Returns the number of parameters excluded in this parameter's exclusions.
Definition: IsisAml.cpp:1719
IsisAml::ParamListExclude
QString ParamListExclude(const int &group, const int &param, const int &option, const int &exclude) const
Returns the parameter name to be excluded if this option is selected.
Definition: IsisAml.cpp:1675
Isis::Preference
Reads user preferences from a data file.
Definition: Preference.h:60
IsisAml::ParamInclude
QString ParamInclude(const int &group, const int &param, const int &include) const
Returns the name of the specified included parameter.
Definition: IsisAml.cpp:1477
IsisAml::ReturnParam
const IsisParameterData * ReturnParam(const QString &paramName) const
Returns a pointer to a parameter whose name starts with paramName.
Definition: IsisAml.cpp:1965
Isis::UserInterface::getNextParameter
void getNextParameter(unsigned int &curPos, QString &unresolvedParam, std::vector< QString > &value)
This gets the next parameter in the list of arguments.
Definition: UserInterface.cpp:934
Isis::PvlContainer::name
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
Isis::IException
Isis exception class.
Definition: IException.h:91
IsisAml::PixelType
QString PixelType(const int &group, const int &param) const
Returns the default pixel type from the XML.
Definition: IsisAml.cpp:1743
IsisAml::ParamGreaterThanOrEqualSize
int ParamGreaterThanOrEqualSize(const int &group, const int &param) const
Returns the number of values in the parameters greater than or equal list.
Definition: IsisAml.cpp:1336
Isis::UserInterface::preProcess
void preProcess(QString fullReservedName, std::vector< QString > &reservedParams)
This parses the command line and looks for the specified reserved parameter name passed.
Definition: UserInterface.cpp:1021
IsisAml::ParamGreaterThanSize
int ParamGreaterThanSize(const int &group, const int &param) const
Returns the number of values in the parameters greater than list.
Definition: IsisAml.cpp:1324
Isis::UserInterface::p_saveFile
QString p_saveFile
FileName to save last history to.
Definition: UserInterface.h:237
IsisAml::ParamLessThan
QString ParamLessThan(const int &group, const int &param, const int &great) const
Returns the name of the specified lessThan parameter.
Definition: IsisAml.cpp:1417
Isis::PvlObject::addGroup
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
IsisAml::ParamListIncludeSize
int ParamListIncludeSize(const int &group, const int &param, const int &option) const
Returns the number of items in a parameters list include section.
Definition: IsisAml.cpp:1690
IsisAml::Clear
void Clear(const QString &paramName)
Clears the value(s) in the named parameter.
Definition: IsisAml.cpp:1852
IsisAml::ParamLessThanSize
int ParamLessThanSize(const int &group, const int &param) const
Returns the number of values in the parameters less than list.
Definition: IsisAml.cpp:1349
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
std
Namespace for the standard library.
Isis::UserInterface::SaveHistory
void SaveHistory()
Saves the user parameter information in the history of the program for later use.
Definition: UserInterface.cpp:261
IsisAml::ParamLessThanOrEqualSize
int ParamLessThanOrEqualSize(const int &group, const int &param) const
Returns the number of values in the parameters less than or equal list.
Definition: IsisAml.cpp:1361
Isis::UserInterface::resolveParameter
QString resolveParameter(QString &name, std::vector< QString > &reservedParams, bool handleNoMatches=true)
This resolves a reserved parameter token on the command line to its fullname.
Definition: UserInterface.cpp:1194
IsisAml::CommandLine
void CommandLine(Isis::Pvl &lab) const
Creates a QString which could be used as a command line.
Definition: IsisAml.cpp:2910
Isis::IString::Token
IString Token(const IString &separator)
Returns the first token in the IString.
Definition: IString.cpp:897
IsisAml::ParamLessThanOrEqual
QString ParamLessThanOrEqual(const int &group, const int &param, const int &les) const
Returns the name of the specified lessThanOrEqual parameter.
Definition: IsisAml.cpp:1432
Isis::Gui::checkX11
static void checkX11()
check to see if X is available
Definition: Gui.cpp:55
Isis::UserInterface::p_abortOnError
bool p_abortOnError
Boolean value representing whether to abort or continue on error.
Definition: UserInterface.h:217
Isis::PvlContainer::keywords
int keywords() const
Returns the number of keywords contained in the PvlContainer.
Definition: PvlContainer.h:86
Isis::UserInterface::UserInterface
UserInterface(const QString &xmlfile, int &argc, char *argv[])
Constructs an UserInterface object.
Definition: UserInterface.cpp:71
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
QVector< QString >
IsisAml::ParamMaximumInclusive
QString ParamMaximumInclusive(const int &group, const int &param) const
Returns whether the maximum value is inclusive or not.
Definition: IsisAml.cpp:1297
Isis::PvlObject::deleteGroup
void deleteGroup(const QString &name)
Remove a group from the current PvlObject.
Definition: PvlObject.cpp:408
IsisAml::ProgramName
QString ProgramName() const
Returns the Program name.
Definition: IsisAml.cpp:1057
IsisAml::ParamOdd
QString ParamOdd(const int &group, const int &param) const
Returns whether the selected parameter has a restriction on odd values or not.
Definition: IsisAml.cpp:1311
IsisAml::ParamName
QString ParamName(const int &group, const int &param) const
Returns the parameter name.
Definition: IsisAml.cpp:1219
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Pvl::setTerminator
void setTerminator(const QString &term)
Sets the terminator used to signify the end of the PVL informationDefaults to "END".
Definition: Pvl.h:144
Isis::IString::ToQt
QString ToQt() const
Retuns the object string as a QString.
Definition: IString.cpp:869
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
Isis::UserInterface::loadHistory
void loadHistory(const QString file)
Loads the previous history for the program.
Definition: UserInterface.cpp:550
IsisAml::NumParams
int NumParams(const int &) const
Returns the number of parameters in a group.
Definition: IsisAml.cpp:1207