File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
IsisAml.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 
8 #include <sstream>
9 #include <xercesc/util/PlatformUtils.hpp>
10 #include <xercesc/util/TransService.hpp>
11 #include <xercesc/sax2/XMLReaderFactory.hpp>
12 
13 #include "FileName.h"
14 #include "IException.h"
15 #include "IsisAml.h"
16 #include "IsisXMLChTrans.h"
17 #include "IString.h"
18 #include "Preference.h"
19 #include "Pvl.h"
20 #include "PvlGroup.h"
21 #include "PvlKeyword.h"
22 #include "PvlObject.h"
23 
24 using namespace std;
25 
30 namespace XERCES = XERCES_CPP_NAMESPACE;
31 
38 IsisAml::IsisAml(const QString &xmlfile) {
39  StartParser(xmlfile.toLatin1().data());
40 }
41 
46 }
47 
65 void IsisAml::PutAsString(const QString &paramName,
66  const QString &value) {
67 
68  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
69 
70  if(param->values.size() > 0) {
71  QString message = "A value for this parameter [" + paramName + "] has "
72  "already been entered.";
73  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
74  }
75 
76  param->values.clear();
77  param->values.push_back(value);
78 
79 }
80 
93 void IsisAml::PutAsString(const QString &paramName,
94  const vector<QString> &value) {
95 
96  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
97 
98  if(param->values.size() > 0) {
99  QString message = "A value for this parameter [" + paramName + "] has "
100  "already been entered.";
101  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
102  }
103 
104  param->values.resize(value.size());
105  param->values = value;
106 
107 }
108 
109 
110 // Public: Sets the value member of a parameter of type QString whose name
111 // starts with paramName
112 
128 void IsisAml::PutString(const QString &paramName, const QString &value) {
129 
130  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
131 
132  if(param->type != "string" && param->type != "combo") {
133  QString message = "Parameter [" + paramName + "] is not a string.";
134  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
135  }
136 
137  if(param->values.size() > 0) {
138  QString message = "A value for this parameter [" + paramName + "] has "
139  "already been saved (possibly by IsisGui). If you need to "
140  "change the value use \"Clear\" before the Put.";
141  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
142  }
143 
144  param->values.clear();
145  param->values.push_back(value);
146 
147  Verify(param);
148 }
149 
150 
151 // Public: Sets the value member of a parameter of type QString whose name
152 // starts with paramName
160 void IsisAml::PutString(const QString &paramName,
161  const vector<QString> &value) {
162 
163  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
164 
165  if(param->type != "string" && param->type != "combo") {
166  QString message = "Parameter [" + paramName + "] is not a string.";
167  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
168  }
169 
170  if(param->values.size() > 0) {
171  QString message = "A value for this parameter [" + paramName + "] has "
172  "already been saved (possibly by IsisGui). If you need to "
173  "change the value use \"Clear\" before the Put.";
174  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
175  }
176 
177  param->values.resize(value.size());
178  param->values = value;
179 
180  Verify(param);
181 }
182 
183 
184 // Public: Sets the value member of a parameter of type filename whose name
185 // starts with paramName
186 
195 void IsisAml::PutFileName(const QString &paramName,
196  const QString &value) {
197 
198  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
199 
200  if((param->type != "filename") && (param->type != "cube")) {
201  QString message = "Parameter [" + paramName + "] is not a filename.";
202  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
203  }
204 
205  if(param->values.size() > 0) {
206  QString message = "A value for this parameter [" + paramName + "] has "
207  "already been saved (possibly by IsisGui). If you need to "
208  "change the value use \"Clear\" before the Put.";
209  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
210  }
211 
212  param->values.clear();
213  param->values.push_back(value);
214 
215  Verify(param);
216 }
217 
218 
219 // Public: Sets the value member of a parameter of type filename whose name
220 // starts with paramName
221 
237 void IsisAml::PutFileName(const QString &paramName,
238  const vector<QString> &value) {
239 
240  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
241 
242  if((param->type != "filename") && (param->type != "cube")) {
243  QString message = "Parameter [" + paramName + "] is not a filename.";
244  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
245  }
246 
247  if(param->values.size() > 0) {
248  QString message = "A value for this parameter [" + paramName + "] has "
249  "already been saved (possibly by IsisGui). If you need to "
250  "change the value use \"Clear\" before the Put.";
251  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
252  }
253 
254  param->values.resize(value.size());
255  param->values = value;
256 
257  Verify(param);
258 }
259 
260 
261 // Public: Sets the value member of a parameter of type integer whose name
262 // starts with paramName
263 
275 void IsisAml::PutInteger(const QString &paramName,
276  const int &value) {
277 
278  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
279 
280  if(param->type != "integer") {
281  QString message = "Parameter [" + paramName + "] is not an integer.";
282  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
283  }
284 
285  if(param->values.size() > 0) {
286  QString message = "A value for this parameter [" + paramName + "] has "
287  "already been saved (possibly by IsisGui). If you need to "
288  "change the value use \"Clear\" before the Put.";
289  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
290  }
291 
292  param->values.clear();
293  param->values.push_back(Isis::toString(value));
294 
295  Verify(param);
296 }
297 
298 
299 // Public: Sets the value member of a parameter of type integer whose name
300 // starts with paramName
301 
316 void IsisAml::PutInteger(const QString &paramName,
317  const vector<int> &value) {
318 
319  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
320 
321  if(param->type != "integer") {
322  QString message = "Parameter [" + paramName + "] is not an integer.";
323  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
324  }
325 
326  if(param->values.size() > 0) {
327  QString message = "A value for this parameter [" + paramName + "] has "
328  "already been saved (possibly by IsisGui). If you need to "
329  "change the value use \"Clear\" before the Put.";
330  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
331  }
332 
333  param->values.resize(value.size());
334  for(unsigned int i = 0; i < value.size(); i++) {
335  param->values[i] = Isis::toString(value[i]);
336  }
337 
338  Verify(param);
339 }
340 
341 
342 
343 
344 // Public: Sets the value member of a parameter of type double whose name
345 // starts with paramName
361 void IsisAml::PutDouble(const QString &paramName,
362  const double &value) {
363 
364  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
365 
366  if(param->type != "double") {
367  QString message = "Parameter [" + paramName + "] is not a double.";
368  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
369  }
370 
371  if(param->values.size() > 0) {
372  QString message = "A value for this parameter [" + paramName + "] has "
373  "already been saved (possibly by IsisGui). If you need to "
374  "change the value use \"Clear\" before the Put.";
375  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
376  }
377 
378  param->values.clear();
379  param->values.push_back(Isis::toString(value));
380 
381  Verify(param);
382 }
383 
384 
385 // Public: Sets the value member of a parameter of type double whose name
386 // starts with paramName
402 void IsisAml::PutDouble(const QString &paramName,
403  const vector<double> &value) {
404 
405  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
406 
407  if(param->type != "double") {
408  QString message = "Parameter [" + paramName + "] is not a double.";
409  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
410  }
411 
412  if(param->values.size() > 0) {
413  QString message = "A value for this parameter [" + paramName + "] has "
414  "already been saved (possibly by IsisGui). If you need to "
415  "change the value use \"Clear\" before the Put.";
416  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
417  }
418 
419  param->values.resize(value.size());
420  for(unsigned int i = 0; i < value.size(); i++) {
421  param->values[i] = Isis::toString(value[i]);
422  }
423 
424  Verify(param);
425 }
426 
427 
428 
429 // Public: Sets the value member of a parameter of type boolean whose name
430 // starts with paramName
446 void IsisAml::PutBoolean(const QString &paramName,
447  const bool &value) {
448 
449  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
450 
451  if(param->type != "boolean") {
452  QString message = "Parameter [" + paramName + "] is not a boolean.";
453  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
454  }
455 
456  if(param->values.size() > 0) {
457  QString message = "A value for this parameter [" + paramName + "] has "
458  "already been saved (possibly by IsisGui). If you need to "
459  "change the value use \"Clear\" before the Put.";
460  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
461  }
462 
463  param->values.clear();
464  if(value) {
465  param->values.push_back("YES");
466  }
467  else {
468  param->values.push_back("NO");
469  }
470 
471  Verify(param);
472 }
473 
474 
475 // Public: Sets the value member of a parameter of type boolean whose name
476 // starts with paramName
492 void IsisAml::PutBoolean(const QString &paramName,
493  const vector<bool> &value) {
494 
495  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
496 
497  if(param->type != "boolean") {
498  QString message = "Parameter [" + paramName + "] is not a boolean.";
499  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
500  }
501 
502  if(param->values.size() > 0) {
503  QString message = "A value for this parameter [" + paramName + "] has "
504  "already been saved (possibly by IsisGui). If you need to "
505  "change the value use \"Clear\" before the Put.";
506  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
507  }
508 
509  param->values.resize(value.size());
510  for(unsigned int i = 0; i < value.size(); i++) {
511  if(value[i]) {
512  param->values.push_back("YES");
513  }
514  else {
515  param->values.push_back("NO");
516  }
517  }
518 
519  Verify(param);
520 }
521 
522 
523 // Accessor methods for getting the value(s) of a parameter
524 
525 // Public: Returns the first element of the value member of a parameter whos
526 // name starts with paramName as a QString. Any type can be retrieve with this member.
537 QString IsisAml::GetAsString(const QString &paramName) const {
538 
539  const IsisParameterData *param = ReturnParam(paramName);
540  QString value;
541  if(param->values.size() == 0) {
542  if(param->defaultValues.size() == 0) {
543  QString message = "Parameter [" + paramName + "] has no value.";
544  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
545  }
546  else {
547  value = param->defaultValues[0];
548  }
549  }
550  else {
551  value = param->values[0];
552  }
553 
554  return value;
555 }
556 
557 // Public: Returns the value member of a parameter whose name starts with paramName
558 // as a vector<QString>
569 void IsisAml::GetAsString(const QString &paramName,
570  vector<QString> &values) const {
571 
572  const IsisParameterData *param = ReturnParam(paramName);
573 
574  values.clear();
575  QString value;
576  if(param->values.size() == 0) {
577  if(param->defaultValues.size() == 0) {
578  QString message = "Parameter [" + paramName + "] has no value.";
579  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
580  }
581  else {
582  for(unsigned int i = 0; i < param->defaultValues.size(); i++)
583  values.push_back(param->defaultValues[i]);
584  }
585  }
586  else {
587  for(unsigned int i = 0; i < param->values.size(); i++)
588  values.push_back(param->values[i]);
589  }
590 
591  return;
592 }
593 
594 
595 // Public: Returns the first element of the value member of a parameter whose
596 // name starts with paramName as a QString/filename
607 QString IsisAml::GetFileName(const QString &paramName, QString extension) const {
608 
609  const IsisParameterData *param = ReturnParam(paramName);
610 
611  if((param->type != "filename") && (param->type != "cube")) {
612  QString message = "Parameter [" + paramName + "] is not a filename.";
613  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
614  }
615 
616  QString value;
617  if(param->values.size() == 0) {
618  if(param->defaultValues.size() == 0) {
619  QString message = "Parameter [" + paramName + "] has no value.";
620  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
621  }
622  else {
623  value = param->defaultValues[0];
624  }
625  }
626  else {
627  value = param->values[0];
628  }
629 
630  Isis::FileName name(value);
631  if(extension != "") name = name.addExtension(extension);
632  value = name.expanded();
633 
634  return value;
635 }
636 
637 
638 // Public: Returns the value member of a parameter whose name starts with paramName
639 // as a vector<QString/filename>
647 void IsisAml::GetFileName(const QString &paramName,
648  vector<QString> &values) const {
649 
650  const IsisParameterData *param = ReturnParam(paramName);
651 
652  if((param->type != "filename") && (param->type != "cube")) {
653  QString message = "Parameter [" + paramName + "] is not a filename.";
654  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
655  }
656 
657  values.clear();
658  if(param->values.size() == 0) {
659  if(param->defaultValues.size() == 0) {
660  QString message = "Parameter [" + paramName + "] has no value.";
661  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
662  }
663  else {
664  for(unsigned int i = 0; i < param->defaultValues.size(); i++) {
665  Isis::FileName name(param->defaultValues[i]);
666  values.push_back(name.expanded());
667  }
668  }
669  }
670  else {
671  for(unsigned int i = 0; i < param->values.size(); i++) {
672  Isis::FileName name(param->values[i]);
673  values.push_back(name.expanded());
674  }
675  }
676 
677  return;
678 }
679 
680 
681 // Public: Returns the first element of the value member of a parameter whos
682 // name starts with paramName as a QString
692 QString IsisAml::GetString(const QString &paramName) const {
693 
694  const IsisParameterData *param = ReturnParam(paramName);
695  QString value;
696 
697  if(param->type != "string" && param->type != "combo") {
698  QString message = "Parameter [" + paramName + "] is not a string.";
699  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
700  }
701 
702  if(param->values.size() == 0) {
703  if(param->defaultValues.size() == 0) {
704  QString message = "Parameter [" + paramName + "] has no value.";
705  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
706  }
707  else {
708  value = param->defaultValues[0];
709  }
710  }
711  else {
712  value = param->values[0];
713  // If there is a list of legal values return the list option that matches
714  // or begins with what was entered rather than exactly what was entered
715  if(param->listOptions.size() > 0) {
716  value = value.toUpper();
717  int found = -1;
718  int foundcount = 0;
719  for(unsigned int p = 0; p < param->listOptions.size(); p++) {
720  QString option = param->listOptions[p].value;
721  option = option.toUpper();
722  if(value == option) {
723  return value;
724  }
725  else if(value.startsWith(option) || option.startsWith(value)) {
726  found = p;
727  foundcount = foundcount + 1;
728  }
729  }
730  if(foundcount == 0) {
731  QString message = "Value [" + value + "] for parameter [" +
732  paramName + "] is not a valid value.";
733  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
734  }
735  if(foundcount > 1) {
736  QString message = "Value [" + value + "] for parameter [" +
737  paramName + "] is not unique.";
738  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
739  }
740  return param->listOptions[found].value;
741  }
742 
743  // Just return what is in the value
744  else {
745  value = param->values[0];
746  }
747  }
748  return value;
749 }
750 
751 
752 // Public: Returns the value member of a parameter whose name starts with paramName
753 // as a vector<QString>
764 void IsisAml::GetString(const QString &paramName,
765  vector<QString> &values) const {
766 
767  const IsisParameterData *param = ReturnParam(paramName);
768 
769  if(param->type != "string" && param->type != "combo") {
770  QString message = "Parameter [" + paramName + "] is not a string.";
771  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
772  }
773 
774  values.clear();
775  QString value;
776  if(param->values.size() == 0) {
777  if(param->defaultValues.size() == 0) {
778  QString message = "Parameter [" + paramName + "] has no value.";
779  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
780  }
781  else {
782  for(unsigned int i = 0; i < param->defaultValues.size(); i++)
783  values.push_back(param->defaultValues[i]);
784  }
785  }
786  else {
787  for(unsigned int i = 0; i < param->values.size(); i++)
788  values.push_back(param->values[i]);
789  }
790 
791  return;
792 }
793 
794 
795 
796 // Public: Returns the first element of the value member of a parameter whos
797 // name starts with paramName as an integer
807 int IsisAml::GetInteger(const QString &paramName) const {
808 
809  const IsisParameterData *param = ReturnParam(paramName);
810 
811  if(param->type != "integer") {
812  QString message = "Parameter [" + paramName + "] is not an integer.";
813  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
814  }
815 
816  Isis::IString value;
817  if(param->values.size() == 0) {
818  if(param->defaultValues.size() == 0) {
819  QString message = "Parameter [" + paramName + "] has no value.";
820  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
821  }
822  else {
823  value = param->defaultValues[0];
824  }
825  }
826  else {
827  value = param->values[0];
828  }
829 
830  return value.ToInteger();
831 }
832 
833 
834 // Public: Returns the value member of a parameter whose name starts with paramName
835 // as a vector<int>
846 void IsisAml::GetInteger(const QString &paramName,
847  vector<int> &values) const {
848 
849  const IsisParameterData *param = ReturnParam(paramName);
850 
851  if(param->type != "integer") {
852  QString message = "Parameter [" + paramName + "] is not an integer.";
853  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
854  }
855 
856  values.clear();
857  Isis::IString value;
858  if(param->values.size() == 0) {
859  if(param->defaultValues.size() == 0) {
860  QString message = "Parameter [" + paramName + "] has no value.";
861  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
862  }
863  else {
864  for(unsigned int i = 0; i < param->defaultValues.size(); i++)
865  value = param->defaultValues[i];
866  values.push_back(value.ToInteger());
867  }
868  }
869  else {
870  for(unsigned int i = 0; i < param->values.size(); i++)
871  value = param->values[i];
872  values.push_back(value.ToInteger());
873  }
874 
875  return;
876 }
877 
878 
879 
880 // Public: Returns the first element of the value member of a parameter whos
881 // name starts with paramName as a doubble
891 double IsisAml::GetDouble(const QString &paramName) const {
892 
893  const IsisParameterData *param = ReturnParam(paramName);
894 
895  if(param->type != "double") {
896  QString message = "Parameter [" + paramName + "] is not a double.";
897  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
898  }
899 
900  Isis::IString value;
901  if(param->values.size() == 0) {
902  if(param->defaultValues.size() == 0) {
903  QString message = "Parameter [" + paramName + "] has no value.";
904  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
905  }
906  else {
907  value = param->defaultValues[0];
908  }
909  }
910  else {
911  value = param->values[0];
912  }
913 
914  return value.ToDouble();
915 }
916 
917 // Public: Returns the value member of a parameter whose name starts with paramName
918 // as a vector<doubble>
929 void IsisAml::GetDouble(const QString &paramName,
930  vector<double> &values) const {
931 
932  const IsisParameterData *param = ReturnParam(paramName);
933 
934  if(param->type != "double") {
935  QString message = "Parameter [" + paramName + "] is not a double.";
936  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
937  }
938 
939  values.clear();
940  Isis::IString value;
941  if(param->values.size() == 0) {
942  if(param->defaultValues.size() == 0) {
943  QString message = "Parameter [" + paramName + "] has no value.";
944  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
945  }
946  else {
947  for(unsigned int i = 0; i < param->defaultValues.size(); i++)
948  value = param->defaultValues[i];
949  values.push_back(value.ToDouble());
950  }
951  }
952  else {
953  for(unsigned int i = 0; i < param->values.size(); i++)
954  value = param->values[i];
955  values.push_back(value.ToDouble());
956  }
957 
958  return;
959 }
960 
961 
962 // Public: Returns the first element of the value member of a parameter whos
963 // name starts with paramName as a bool
973 bool IsisAml::GetBoolean(const QString &paramName) const {
974 
975  const IsisParameterData *param = ReturnParam(paramName);
976 
977  if(param->type != "boolean") {
978  QString message = "Parameter [" + paramName + "] is not a boolean.";
979  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
980  }
981 
982  QString value;
983  if(param->values.size() == 0) {
984  if(param->defaultValues.size() == 0) {
985  QString message = "Parameter [" + paramName + "] has no value.";
986  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
987  }
988  else {
989  value = param->defaultValues[0];
990  }
991  }
992  else {
993  value = param->values[0];
994  }
995 
996  return Isis::toBool(value);
997 
998 }
999 
1000 
1001 // Public: Returns the value member of a parameter whose name starts with paramName
1002 // as a vector<bool>
1013 void IsisAml::GetBoolean(const QString &paramName,
1014  vector<bool> &values) const {
1015 
1016  const IsisParameterData *param = ReturnParam(paramName);
1017 
1018  if(param->type != "boolean") {
1019  QString message = "Parameter [" + paramName + "] is not a boolean.";
1020  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
1021  }
1022 
1023  values.clear();
1024  vector <QString> value;
1025  QString tmp;
1026  if(param->values.size() == 0) {
1027  if(param->defaultValues.size() == 0) {
1028  QString message = "Parameter [" + paramName + "] has no value.";
1029  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
1030  }
1031  else {
1032  for(unsigned int i = 0; i < param->defaultValues.size(); i++) {
1033  tmp = param->defaultValues[i].toUpper();
1034  value.push_back(tmp);
1035  }
1036  }
1037  }
1038  else {
1039  for(unsigned int i = 0; i < param->values.size(); i++) {
1040  tmp = param->values[i].toUpper();
1041  value.push_back(tmp);
1042  }
1043  }
1044 
1045  for(unsigned int i = 0; i < value.size(); i++) {
1046  values.push_back(StringToBool(value[i]));
1047 
1048  }
1049 
1050  return;
1051 }
1057 QString IsisAml::ProgramName() const {
1058  QString tmp = name;
1059  return tmp;
1060 }
1061 
1062 
1068 QString IsisAml::Brief() const {
1069  return brief;
1070 }
1071 
1072 
1078 QString IsisAml::Description() const {
1079  return description;
1080 }
1081 
1087 int IsisAml::NumGroups() const {
1088  return groups.size();
1089 }
1090 
1098 QString IsisAml::GroupName(const int &index) const {
1099  QString s = groups[index].name;
1100  return s;
1101 }
1102 
1112 int IsisAml::GroupIndex(const QString & grpName) const {
1113  for(int i=0; i<(int)groups.size(); i++) {
1114  if(Isis::IString(grpName).DownCase() == Isis::IString(groups[i].name).DownCase()) {
1115  return i;
1116  }
1117  }
1118  return -1;
1119 }
1120 
1134 void IsisAml::CreatePVL(Isis::Pvl &pvlDef , QString guiGrpName, QString pvlObjName, QString pvlGrpName, vector<QString> & include) {
1135 
1136  Isis::PvlObject *pvlObj = NULL;
1137  if (pvlObjName != "") {
1138  pvlObj = new Isis::PvlObject(pvlObjName);
1139  }
1140 
1141  // Get Gui Group index
1142  int grpIndex= GroupIndex(guiGrpName);
1143 
1144  if (pvlGrpName == "" || grpIndex == -1 ) {
1145  QString errMsg = "Must provide Group Name\n";
1146  throw Isis::IException(Isis::IException::User, errMsg, _FILEINFO_);
1147  }
1148 
1149  Isis::PvlGroup grp(pvlGrpName);
1150  for(int i=0; i<NumParams(grpIndex); i++) {
1151  QString paramName = ParamName(grpIndex, i);
1152 
1153  if(IsParamInPvlInclude(paramName,include)) {
1154  Isis::IString paramType = Isis::IString(ParamType(grpIndex, i)).DownCase();
1155  if(paramType == "double") {
1156  grp += Isis::PvlKeyword(paramName, Isis::toString(GetDouble(paramName)));
1157  }
1158  if(paramType == "integer") {
1159  grp += Isis::PvlKeyword(paramName, Isis::toString(GetInteger(paramName)));
1160  }
1161  if(paramType == "boolean") {
1162  grp += Isis::PvlKeyword(paramName, Isis::toString(GetBoolean(paramName)));
1163  }
1164  if(paramType == "string" || paramType == "filename" || paramType == "combo") {
1165  grp += Isis::PvlKeyword(paramName, GetAsString(paramName));
1166  }
1167  }
1168  }
1169 
1170  if(pvlObj != NULL) {
1171  *pvlObj += grp;
1172  pvlDef += *pvlObj;
1173  delete (pvlObj);
1174  pvlObj = NULL;
1175  }
1176  else {
1177  pvlDef += grp;
1178  }
1179 }
1180 
1191 bool IsisAml::IsParamInPvlInclude(QString & paramName, vector<QString> & include) {
1192 
1193  for(int i=0; i<(int)include.size(); i++) {
1194  if(Isis::IString(paramName).DownCase() == Isis::IString(include[i]).DownCase()) {
1195  return true;
1196  }
1197  }
1198  return false;
1199 }
1207 int IsisAml::NumParams(const int &group) const {
1208  return groups[group].parameters.size();
1209 }
1210 
1219 QString IsisAml::ParamName(const int &group, const int &param) const {
1220  QString s = groups[group].parameters[param].name;
1221  return s;
1222 }
1223 
1232 QString IsisAml::ParamBrief(const int &group, const int &param) const {
1233  QString s = groups[group].parameters[param].brief;
1234  return s;
1235 }
1236 
1245 QString IsisAml::ParamDescription(const int &group, const int &param) const {
1246  QString s = groups[group].parameters[param].description;
1247  return s;
1248 }
1249 
1258 QString IsisAml::ParamMinimum(const int &group, const int &param) const {
1259  QString s = groups[group].parameters[param].minimum;
1260  return s;
1261 }
1262 
1271 QString IsisAml::ParamMaximum(const int &group, const int &param) const {
1272  QString s = groups[group].parameters[param].maximum;
1273  return s;
1274 }
1275 
1284 QString IsisAml::ParamMinimumInclusive(const int &group, const int &param) const {
1285  QString s = groups[group].parameters[param].minimum_inclusive;
1286  return s;
1287 }
1288 
1297 QString IsisAml::ParamMaximumInclusive(const int &group, const int &param) const {
1298  QString s = groups[group].parameters[param].maximum_inclusive;
1299  return s;
1300 }
1301 
1311 QString IsisAml::ParamOdd(const int &group, const int &param) const {
1312  QString s = groups[group].parameters[param].odd;
1313  return s;
1314 }
1315 
1324 int IsisAml::ParamGreaterThanSize(const int &group, const int &param) const {
1325  return groups[group].parameters[param].greaterThan.size();
1326 }
1327 
1337  const int &param) const {
1338  return groups[group].parameters[param].greaterThanOrEqual.size();
1339 }
1340 
1349 int IsisAml::ParamLessThanSize(const int &group, const int &param) const {
1350  return groups[group].parameters[param].lessThan.size();
1351 }
1352 
1362  const int &param) const {
1363  return groups[group].parameters[param].lessThanOrEqual.size();
1364 }
1365 
1374 int IsisAml::ParamNotEqualSize(const int &group, const int &param) const {
1375  return groups[group].parameters[param].notEqual.size();
1376 }
1377 
1387 QString IsisAml::ParamGreaterThan(const int &group, const int &param,
1388  const int &great) const {
1389  QString s = groups[group].parameters[param].greaterThan[great];
1390  return s;
1391 }
1392 
1402 QString IsisAml::ParamGreaterThanOrEqual(const int &group, const int &param,
1403  const int &great) const {
1404  QString s = groups[group].parameters[param].greaterThanOrEqual[great];
1405  return s;
1406 }
1407 
1417 QString IsisAml::ParamLessThan(const int &group, const int &param,
1418  const int &les) const {
1419  QString s = groups[group].parameters[param].lessThan[les];
1420  return s;
1421 }
1422 
1432 QString IsisAml::ParamLessThanOrEqual(const int &group, const int &param,
1433  const int &les) const {
1434  QString s = groups[group].parameters[param].lessThanOrEqual[les];
1435  return s;
1436 }
1437 
1447 QString IsisAml::ParamNotEqual(const int &group, const int &param,
1448  const int &notEq) const {
1449  QString s = groups[group].parameters[param].notEqual[notEq];
1450  return s;
1451 }
1452 
1462 QString IsisAml::ParamExclude(const int &group, const int &param,
1463  const int &exclude) const {
1464  QString s = groups[group].parameters[param].exclude[exclude];
1465  return s;
1466 }
1467 
1477 QString IsisAml::ParamInclude(const int &group, const int &param,
1478  const int &include) const {
1479  QString s = groups[group].parameters[param].include[include];
1480  return s;
1481 }
1482 
1483 
1492 QString IsisAml::ParamType(const int &group, const int &param) const {
1493  QString s = groups[group].parameters[param].type;
1494  return s;
1495 }
1496 
1505 QString IsisAml::ParamDefault(const int &group, const int &param) const {
1506  QString s;
1507  if(groups[group].parameters[param].defaultValues.size() == 0) {
1508  s = "";
1509  }
1510  else {
1511  s = groups[group].parameters[param].defaultValues[0];
1512  }
1513  return s;
1514 }
1515 
1524 QString IsisAml::ParamInternalDefault(const int &group, const int &param) const {
1525  QString s;
1526  if(groups[group].parameters[param].internalDefault.size() == 0) {
1527  s = "";
1528  }
1529  else {
1530  s = groups[group].parameters[param].internalDefault;
1531  }
1532  return s;
1533 }
1534 
1543 QString IsisAml::ParamFilter(const int &group, const int &param) const {
1544  QString s;
1545  if(groups[group].parameters[param].filter.size() == 0) {
1546  s = "";
1547  }
1548  else {
1549  s = groups[group].parameters[param].filter;
1550  }
1551  return s;
1552 }
1553 
1562 QString IsisAml::ParamPath(const int &group, const int &param) const {
1563  QString s;
1564  if(groups[group].parameters[param].path.size() == 0) {
1565  s = "";
1566  }
1567  else {
1568  s = groups[group].parameters[param].path;
1569  }
1570  return s;
1571 }
1572 
1581 QString IsisAml::ParamFileMode(const int &group, const int &param) const {
1582  QString s;
1583  if(groups[group].parameters[param].fileMode.size() == 0) {
1584  s = "";
1585  }
1586  else {
1587  s = groups[group].parameters[param].fileMode;
1588  }
1589  return s;
1590 }
1591 
1601 int IsisAml::ParamListSize(const int &group, const int &param) const {
1602  return groups[group].parameters[param].listOptions.size();
1603 }
1604 
1605 
1615 QString IsisAml::ParamListValue(const int &group, const int &param,
1616  const int &option) const {
1617  QString s = groups[group].parameters[param].listOptions[option].value;
1618  return s;
1619 }
1620 
1630 QString IsisAml::ParamListBrief(const int &group, const int &param,
1631  const int &option) const {
1632  QString s = groups[group].parameters[param].listOptions[option].brief;
1633  return s;
1634 }
1635 
1645 QString IsisAml::ParamListDescription(const int &group, const int &param,
1646  const int &option) const {
1647  QString s = groups[group].parameters[param].listOptions[option].description;
1648  return s;
1649 }
1650 
1660 int IsisAml::ParamListExcludeSize(const int &group, const int &param,
1661  const int &option) const {
1662  return groups[group].parameters[param].listOptions[option].exclude.size();
1663 }
1664 
1675 QString IsisAml::ParamListExclude(const int &group, const int &param,
1676  const int &option, const int &exclude) const {
1677  QString s = groups[group].parameters[param].listOptions[option].exclude[exclude];
1678  return s;
1679 }
1680 
1690 int IsisAml::ParamListIncludeSize(const int &group, const int &param,
1691  const int &option) const {
1692  return groups[group].parameters[param].listOptions[option].include.size();
1693 }
1694 
1705 QString IsisAml::ParamListInclude(const int &group, const int &param,
1706  const int &option, const int &include) const {
1707  QString s = groups[group].parameters[param].listOptions[option].include[include];
1708  return s;
1709 }
1710 
1719 int IsisAml::ParamExcludeSize(const int &group, const int &param) const {
1720  return groups[group].parameters[param].exclude.size();
1721 }
1722 
1731 int IsisAml::ParamIncludeSize(const int &group, const int &param) const {
1732  return groups[group].parameters[param].include.size();
1733 }
1734 
1743 QString IsisAml::PixelType(const int &group, const int &param) const {
1744  return groups[group].parameters[param].pixelType;
1745 }
1746 
1755 int IsisAml::HelpersSize(const int &group, const int &param) const {
1756  return groups[group].parameters[param].helpers.size();
1757 }
1758 
1768 QString IsisAml::HelperButtonName(const int &group, const int &param,
1769  const int &helper) const {
1770  return groups[group].parameters[param].helpers[helper].name;
1771 }
1772 
1782 QString IsisAml::HelperFunction(const int &group, const int &param,
1783  const int &helper) const {
1784  return groups[group].parameters[param].helpers[helper].function;
1785 }
1786 
1796 QString IsisAml::HelperBrief(const int &group, const int &param,
1797  const int &helper) const {
1798  return groups[group].parameters[param].helpers[helper].brief;
1799 }
1800 
1810 QString IsisAml::HelperDescription(const int &group, const int &param,
1811  const int &helper) const {
1812  return groups[group].parameters[param].helpers[helper].description;
1813 }
1814 
1824 QString IsisAml::HelperIcon(const int &group, const int &param,
1825  const int &helper) const {
1826  return groups[group].parameters[param].helpers[helper].icon;
1827 }
1828 
1836 bool IsisAml::WasEntered(const QString &paramName) const {
1837 
1838  const IsisParameterData *param = ReturnParam(paramName);
1839 
1840  if(param->values.size() == 0) {
1841  return false;
1842  }
1843 
1844  return true;
1845 }
1846 
1852 void IsisAml::Clear(const QString &paramName) {
1853 
1854  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
1855  param->values.clear();
1856 
1857  param->outCubeAtt.setAttributes("+" + param->pixelType);
1858  param->inCubeAtt.setAttributes("");
1859 
1860  return;
1861 }
1862 
1863 
1875 
1876  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
1877 
1878  if(param->type != "cube") {
1879  QString message = "Unable to get input cube attributes. Parameter ["
1880  + paramName + "] is not a cube. Parameter type = [" + param->type + "].";
1881  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
1882  }
1883 
1884  QString value;
1885  if(param->values.size() == 0) {
1886  if(param->defaultValues.size() == 0) {
1887  value.clear();
1888 // QString message = "Parameter [" + paramName + "] has no value.";
1889 // throw Isis::IException(Isis::IException::User,message, _FILEINFO_);
1890  }
1891  else {
1892  value = param->defaultValues[0];
1893  }
1894  }
1895  else {
1896  value = param->values[0];
1897  }
1898  if(param->fileMode == "input") {
1899  param->inCubeAtt.setAttributes(value);
1900  }
1901  else {
1902  QString message = "Unable to get input cube attributes. Parameter ["
1903  + paramName + "] is not an input. Parameter fileMode = [" + param->fileMode + "].";
1904  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
1905  }
1906  return param->inCubeAtt;
1907 }
1908 
1920 
1921  IsisParameterData *param = const_cast <IsisParameterData *>(ReturnParam(paramName));
1922 
1923  if(param->type != "cube") {
1924  QString message = "Unable to get output cube attributes. Parameter ["
1925  + paramName + "] is not a cube. Parameter type = [" + param->type + "].";
1926  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
1927  }
1928 
1929  QString value;
1930  if(param->values.size() == 0) {
1931  if(param->defaultValues.size() == 0) {
1932  value.clear();
1933 // QString message = "Parameter [" + paramName + "] has no value.";
1934 // throw Isis::IException(Isis::IException::User,message, _FILEINFO_);
1935  }
1936  else {
1937  value = param->defaultValues[0];
1938  }
1939  }
1940  else {
1941  value = param->values[0];
1942  }
1943  if(param->fileMode == "output") {
1944  param->outCubeAtt.setAttributes("+" + param->pixelType);
1945  param->outCubeAtt.addAttributes(Isis::FileName(value));
1946  }
1947  else {
1948  QString message = "Unable to get output cube attributes. Parameter ["
1949  + paramName + "] is not an output. Parameter fileMode = [" + param->fileMode + "].";
1950  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
1951  }
1952  return param->outCubeAtt;
1953 }
1954 
1965 const IsisParameterData *IsisAml::ReturnParam(const QString &paramName) const {
1966  Isis::IString pn = paramName;
1967  pn.UpCase();
1968  int found = 0;
1969  bool exact = false;
1970  const IsisParameterData *param = NULL;
1971  Isis::IString cur_pn;
1972 
1973  for(unsigned int g = 0; g < groups.size(); g++) {
1974  for(unsigned int p = 0; p < groups[g].parameters.size(); p++) {
1975  cur_pn = groups[g].parameters[p].name;
1976  cur_pn.UpCase();
1977  if(cur_pn.find(pn) == 0) {
1978  if(cur_pn == pn) {
1979  if(exact) {
1980  QString message = "Parameter [" + paramName + "] is not unique.";
1981  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
1982  }
1983  else {
1984  exact = true;
1985  found = 0;
1986  param = &(groups[g].parameters[p]);
1987  }
1988  }
1989  else if(!exact) {
1990  found++;
1991  param = &(groups[g].parameters[p]);
1992  }
1993  }
1994  }
1995  }
1996  if(param == NULL) {
1997  QString message = "Unknown parameter [" + paramName + "].";
1998  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
1999  }
2000  else if((found > 1) && (!exact)) {
2001  QString message = "Parameter [" + paramName + "] is not unique.";
2002  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2003  }
2004  return param;
2005 }
2006 
2018 
2019  // Check to make sure the value QString can be converted to the correct type
2020  for(unsigned int i = 0; i < param->values.size(); i++) {
2021  if(param->type == "integer") {
2022  try {
2023  Isis::IString value(param->values[i]);
2024  value.ToInteger();
2025  }
2026  catch(Isis::IException &e) {
2027  QString message = "Unable to convert [" + param->values[i] + "] to an integer,"
2028  " parameter [" + param->name + "].";
2029  throw Isis::IException(e, Isis::IException::User, message, _FILEINFO_);
2030  }
2031  }
2032  else if(param->type == "double") {
2033  try {
2034  Isis::IString value(param->values[i]);
2035  value.ToDouble();
2036  }
2037  catch(Isis::IException &e) {
2038  QString message = "Unable to convert [" + param->values[i] + "] to a double,"
2039  " parameter [" + param->name + "].";
2040  throw Isis::IException(e, Isis::IException::User, message, _FILEINFO_);
2041  }
2042  }
2043  else if(param->type == "boolean") {
2044  QString v = param->values[i].toUpper();
2045 
2046  try {
2047  StringToBool(v);
2048  }
2049  catch(Isis::IException &e) {
2050  QString message = "Illegal value for [" + param->name + "], [" + param->values[i] + "].";
2051  throw Isis::IException(e, Isis::IException::User, message, _FILEINFO_);
2052  }
2053  }
2054  else if(param->type == "filename") {
2055  // If this is an output file and a file with this name already exists,
2056  // check user filename customization preferences.
2057  QString value(param->values[i]);
2058  Isis::FileName name(value);
2059  value = name.expanded();
2060  if(name.fileExists() && param->fileMode == "output") {
2061  CheckFileNamePreference(value, param->name);
2062  }
2063  }
2064  // THIS IS CURRENTLY HANDLED IN THE CUBE CLASS, see CubeIoHandler.cpp
2065  // 2010-07-15 Jeannie Walldren
2066  //
2067  // else if(param->type == "cube") {
2068  // Isis::IString value(param->values[i]);
2069  // Isis::FileName name(value);
2070  // value = name.expanded();
2071  // if (name.Exists() && param->fileMode == "output"
2072  // && Isis::Preference::Preferences().findGroup("CubeCustomization").findKeyword("Overwrite")[0] == "Error") {
2073  // QString message = "Invalid output cube for [" + param->name + "]. The cube file [" + value + "] already exists. " +
2074  // "The user preference cube customization group is set to disallow cube overwrites.";
2075  // throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2076  // }
2077  // }
2078  }
2079 
2080  // Check the default values if there were no values
2081  if(param->values.size() == 0) {
2082  for(unsigned int i = 0; i < param->defaultValues.size(); i++) {
2083  // Check to make sure the DefaultValue QString can be converted to the
2084  // correct type
2085  if(param->type == "integer") {
2086  try {
2087  Isis::IString value(param->defaultValues[i]);
2088  value.ToInteger();
2089  }
2090  catch(Isis::IException &e) {
2091  QString message = "Unable to convert default [" + param->defaultValues[i] +
2092  "] to an integer, parameter [" + param->name + "].";
2093  throw Isis::IException(e, Isis::IException::Programmer, message, _FILEINFO_);
2094  }
2095  }
2096  else if(param->type == "double") {
2097  try {
2098  Isis::IString value(param->defaultValues[i]);
2099  value.ToDouble();
2100  }
2101  catch(Isis::IException &e) {
2102  QString message = "Unable to convert default [" + param->defaultValues[i] +
2103  "] to a double, parameter [" + param->name + "].";
2104  throw Isis::IException(e, Isis::IException::Programmer, message, _FILEINFO_);
2105  }
2106  }
2107  else if(param->type == "boolean") {
2108  QString v = param->defaultValues[i].toUpper();
2109 
2110  try {
2111  StringToBool(v);
2112  }
2113  catch(Isis::IException &e) {
2114  QString message = "Illegal default value for [" + param->name + "], ["
2115  + param->defaultValues[i] + "].";
2116  throw Isis::IException(e, Isis::IException::User, message, _FILEINFO_);
2117  }
2118  }
2119  else if(param->type == "filename") {
2120  // Put something here once we figure out what to do with filenames
2121  QString value(param->defaultValues[i]);
2122  Isis::FileName name(value);
2123  value = name.expanded();
2124  if(name.fileExists() && param->fileMode == "output") {
2125  CheckFileNamePreference(value, param->name);
2126  }
2127  }
2128  }
2129  }
2130 
2131  // Check the values against the values list if there is one
2132  if(param->listOptions.size() > 0) {
2133  for(unsigned int i = 0; i < param->values.size(); i++) {
2134  Isis::IString value = param->values[i];
2135  value = value.UpCase();
2136  int partial = 0;
2137  bool exact = false;
2138  for(unsigned int p = 0; p < param->listOptions.size(); p++) {
2139  Isis::IString option = param->listOptions[p].value;
2140  option = option.UpCase();
2141  // Check to see if the value matches the list option exactly
2142  if(value == option) {
2143  // If we already have one exact match then there is an error
2144  if(exact) {
2145  QString message = "Duplicate list options [" +
2146  param->listOptions[p].value +
2147  "] in parameter [" + param->name + "].";
2148  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
2149  }
2150  exact = true;
2151  }
2152  // Check for a partial match
2153  // Compare the shorter of the two (values[i]) to a subQString of the
2154  // longer QString (listOptions[p].value)
2155  else if(option.compare(0, min(value.size(), option.size()),
2156  value, 0, min(value.size(), option.size())) == 0) {
2157  partial++;
2158  }
2159  }
2160  if(!exact && partial == 0) {
2161  QString message = "Value of [" + param->name + "] must be one of [" +
2162  param->listOptions[0].value;
2163  for(unsigned int p = 1; p < param->listOptions.size(); p++) {
2164  message += ", " + param->listOptions[p].value;
2165  }
2166  message += "].";
2167  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2168  }
2169  else if(!exact && partial > 1) {
2170  QString msg = "Value of [" + param->name +
2171  "] does not match a list option uniquely.";
2172  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2173  }
2174  }
2175  }
2176 
2177  // Check the values against the minimum
2178  if(param->minimum.length() > 0) {
2179  QString incl = param->minimum_inclusive;
2180  for(unsigned int i = 0; i < param->values.size(); i++) {
2181  if(param->type == "integer") {
2182  QString value(param->values[i]);
2183  int temp = Isis::toInt(value);
2184  value = param->minimum;
2185  int min = Isis::toInt(value);
2186  if(StringToBool(incl) && (temp < min)) {
2187  QString message = "Parameter [" + param->name +
2188  "] must be greater than or equal to [" + param->minimum + "].";
2189  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2190  }
2191  else if(!StringToBool(incl) && (temp <= min)) {
2192  QString message = "Parameter [" + param->name +
2193  "] must be greater than [" + param->minimum + "].";
2194  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2195  }
2196  }
2197  else if(param->type == "double") {
2198  Isis::IString value(param->values[i]);
2199  double temp = value.ToDouble();
2200  value = param->minimum;
2201  double min = value.ToDouble();
2202  if(StringToBool(incl) && (temp < min)) {
2203  QString message = "Parameter [" + param->name +
2204  "] must be greater than or equal to [" + param->minimum + "].";
2205  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2206  }
2207  else if(!StringToBool(incl) && (temp <= min)) {
2208  QString message = "Parameter [" + param->name +
2209  "] must be greater than [" + param->minimum + "].";
2210  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2211  }
2212  }
2213  }
2214  if(param->values.size() == 0) {
2215  for(unsigned int i = 0; i < param->defaultValues.size(); i++) {
2216  if(param->type == "integer") {
2217  Isis::IString value(param->defaultValues[i]);
2218  int temp = value.ToInteger();
2219  value = param->minimum;
2220  int min = value.ToInteger();
2221  if(StringToBool(incl) && (temp < min)) {
2222  QString message = "Parameter [" + param->name +
2223  "] must be greater than or equal to [" + param->minimum + "].";
2224  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2225  }
2226  else if(!StringToBool(incl) && (temp <= min)) {
2227  QString message = "Parameter [" + param->name +
2228  "] must be greater than [" + param->minimum + "].";
2229  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2230  }
2231  }
2232  else if(param->type == "double") {
2233  Isis::IString value(param->defaultValues[i]);
2234  double temp = value.ToDouble();
2235  value = param->minimum;
2236  double min = value.ToDouble();
2237  if(StringToBool(incl) && (temp < min)) {
2238  QString message = "Parameter [" + param->name +
2239  "] must be greater than or equal to [" + param->minimum + "].";
2240  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2241  }
2242  else if(!StringToBool(incl) && (temp <= min)) {
2243  QString message = "Parameter [" + param->name +
2244  "] must be greater than [" + param->minimum + "].";
2245  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2246  }
2247  }
2248  }
2249  }
2250  }
2251 
2252  // Check the values against the maximum
2253  if(param->maximum.length() > 0) {
2254  QString incl = param->maximum_inclusive.toLower();
2255  for(unsigned int i = 0; i < param->values.size(); i++) {
2256  if(param->type == "integer") {
2257  QString value(param->values[i]);
2258  int temp = Isis::toInt(value);
2259  value = param->maximum;
2260  int max = Isis::toInt(value);
2261  if(StringToBool(incl) && (temp > max)) {
2262  QString message = "Parameter [" + param->name +
2263  "] must be less than or equal to [" + param->maximum + "].";
2264  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2265  }
2266  else if(!StringToBool(incl) && (temp >= max)) {
2267  QString message = "Parameter [" + param->name +
2268  "] must be less than [" + param->maximum + "].";
2269  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2270  }
2271  }
2272  else if(param->type == "double") {
2273  Isis::IString value(param->values[i]);
2274  double temp = value.ToDouble();
2275  value = param->maximum;
2276  double max = value.ToDouble();
2277  if(StringToBool(incl) && (temp > max)) {
2278  QString message = "Parameter [" + param->name +
2279  "] must be less than or equal to [" + param->maximum + "].";
2280  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2281  }
2282  else if(!StringToBool(incl) && (temp >= max)) {
2283  QString message = "Parameter [" + param->name +
2284  "] must be less than [" + param->maximum + "].";
2285  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2286  }
2287  }
2288  }
2289  if(param->values.size() == 0) {
2290  for(unsigned int i = 0; i < param->defaultValues.size(); i++) {
2291  if(param->type == "integer") {
2292  Isis::IString value(param->defaultValues[i]);
2293  int temp = value.ToInteger();
2294  value = param->maximum;
2295  int max = value.ToInteger();
2296  if(StringToBool(incl) && (temp > max)) {
2297  QString message = "Parameter [" + param->name +
2298  "] must be less than or equal to [" + param->maximum + "].";
2299  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2300  }
2301  else if(!StringToBool(incl) && (temp >= max)) {
2302  QString message = "Parameter [" + param->name +
2303  "] must be less than [" + param->maximum + "].";
2304  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2305  }
2306  }
2307  else if(param->type == "double") {
2308  Isis::IString value(param->defaultValues[i]);
2309  double temp = value.ToDouble();
2310  value = param->maximum;
2311  double max = value.ToDouble();
2312  if(StringToBool(incl) && (temp > max)) {
2313  QString message = "Parameter [" + param->name +
2314  "] must be less than or equal to [" + param->maximum + "].";
2315  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2316  }
2317  else if(!StringToBool(incl) && (temp >= max)) {
2318  QString message = "Parameter [" + param->name +
2319  "] must be less than [" + param->maximum + "].";
2320  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2321  }
2322  }
2323  }
2324  }
2325  }
2326 
2327  // Check the value for an odd test
2328  QString odd = param->odd.toLower();
2329 
2330  if((odd != "") || StringToBool(odd)) {
2331  if(param->type != "integer") {
2332  QString message = "Parameter [" + param->name +
2333  "] must be of type integer to have an [odd] test.";
2334  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
2335  }
2336  else {
2337  for(unsigned int i = 0; i < param->values.size(); i++) {
2338  Isis::IString value(param->values[i]);
2339  if((value.ToInteger() % 2) != 1) {
2340  QString message = "Value for [" + param->name + "] must be odd.";
2341  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2342  }
2343  }
2344  }
2345  }
2346  return;
2347 }
2348 
2349 
2367 void IsisAml::CheckFileNamePreference(QString filename, QString paramname) {
2368  Isis::PvlGroup fileCustomization = Isis::Preference::Preferences().findGroup("FileCustomization");
2369  QString overwritePreference = fileCustomization.findKeyword("Overwrite")[0].simplified().trimmed();
2370  QString temp = overwritePreference;
2371  if(overwritePreference.toUpper() == "ERROR") {
2372  QString message = "Invalid output filename for [" + paramname + "]. The file [" + filename + "] already exists. " +
2373  "The user preference file customization group is set to disallow file overwrites.";
2374  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2375  }
2376  else if(overwritePreference.toUpper() != "ALLOW") { // not set to ERROR or ALLOW
2377  QString message = "Invalid entry in user preference file FileCustomization group.";
2378  message += " Overwrite = [" + temp + "]. Valid values: [Allow] or [Error].";
2379  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2380  }
2381 }
2382 
2383 
2388  for(unsigned int g = 0; g < groups.size(); g++) {
2389  for(unsigned int p = 0; p < groups[g].parameters.size(); p++) {
2390  IsisParameterData *param = &(this->groups[g].parameters[p]);
2391 
2392  Verify(param);
2393 
2394  // Check the values for inclusive clauses
2395  for(unsigned int item = 0; item < param->include.size(); item++) {
2396  // If this parameter is a boolean and it is true/yes
2397  // all included parameters must have some type of value
2398  if(param->type == "boolean") {
2399  if(((param->values.size() > 0) && StringToBool(param->values[0])) ||
2400  ((param->values.size() == 0) && (param->defaultValues.size() > 0)
2401  && StringToBool(param->defaultValues[0]))) {
2402 
2403  const IsisParameterData *param2 = ReturnParam(param->include[item]);
2404  if((param2->values.size()) == 0 &&
2405  (param2->defaultValues.size() == 0) &&
2406  (param2->internalDefault.size() == 0)) {
2407  QString message = "Parameter [" + param2->name +
2408  "] must be used if parameter [" +
2409  param->name + "] equates to true.";
2410  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2411  }
2412  }
2413  }
2414  // This parameter is NOT a boolean but the other one might be
2415  else {
2416  // If the other parameter is a boolean and it is true/yes
2417  // then this parameter must have some type of value
2418  const IsisParameterData *param2 = ReturnParam(param->include[item]);
2419  if(param2->type == "boolean") {
2420  if(((param2->values.size() > 0) && StringToBool(param2->values[0])) ||
2421  ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2422  StringToBool(param2->defaultValues[0]))) {
2423  if((param->values.size()) == 0 &&
2424  (param->defaultValues.size() == 0) &&
2425  (param->internalDefault.size() == 0)) {
2426  QString message = "Parameter [" + param2->name +
2427  "] must be used if parameter [" +
2428  param->name + "] is used.";
2429  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2430  }
2431  }
2432  }
2433  // Neithter parameter is a boolean so
2434  // If this one has a value the other parameter must have some type of value
2435  else {
2436  if(param->values.size() > 0 &&
2437  param2->values.size() == 0 &&
2438  param2->defaultValues.size() == 0 &&
2439  param2->internalDefault.size() == 0) {
2440  QString message = "Parameter [" + param2->name +
2441  "] must be used if parameter [" +
2442  param->name + "] is used.";
2443  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2444  }
2445  }
2446  }
2447  }
2448  // Check the values for exclusive clauses
2449  for(unsigned int item = 0; item < param->exclude.size(); item++) {
2450  // If this parameter is a boolean that is true/yes
2451  // the other parameter should not have a value
2452  if(param->type == "boolean") {
2453  if(((param->values.size() > 0) && StringToBool(param->values[0])) ||
2454  ((param->values.size() == 0) && (param->defaultValues.size() > 0) &&
2455  StringToBool(param->defaultValues[0]))) {
2456 
2457  const IsisParameterData *param2 = ReturnParam(param->exclude[item]);
2458  if(param2->values.size() > 0) {
2459  QString message = "Parameter [" + param2->name +
2460  "] must NOT be used if parameter [" +
2461  param->name + "] equates to true.";
2462  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2463  }
2464  }
2465  }
2466  // This parameter is NOT a boolean but the other one might be
2467  else {
2468  const IsisParameterData *param2 = ReturnParam(param->exclude[item]);
2469  if(param2->type == "boolean") {
2470  if(((param2->values.size() > 0) && StringToBool(param2->values[0])) ||
2471  ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2472  StringToBool(param2->defaultValues[0]))) {
2473  if(param->values.size() > 0) {
2474  QString message = "Parameter [" + param2->name +
2475  "] must be used if parameter [" +
2476  param->name + "] is used.";
2477  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2478  }
2479  }
2480  }
2481  // Neither parameter is a boolean
2482  else {
2483  if(param->values.size() > 0 && param2->values.size() > 0) {
2484  QString message = "Parameter [" + param2->name +
2485  "] must NOT be used if parameter [" +
2486  param->name + "] is used.";
2487  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2488  }
2489  }
2490  }
2491  }
2492 
2493  // Check the values for greaterThan clauses
2494  if(param->values.size() > 0) {
2495  for(unsigned int item = 0; item < param->greaterThan.size(); item++) {
2496  const IsisParameterData *param2 = ReturnParam(param->greaterThan[item]);
2497  if(param2->values.size() != 0) {
2498  double double1, double2;
2499  if(param->type == "integer") {
2500  double1 = (double) GetInteger(param->name);
2501  }
2502  else if(param->type == "double") {
2503  double1 = GetDouble(param->name);
2504  }
2505  else {
2506  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2507  param->name + "]";
2508  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2509  }
2510 
2511  if(param2->type == "integer") {
2512  double2 = GetInteger(param2->name);
2513  }
2514  else if(param2->type == "double") {
2515  double2 = GetDouble(param2->name);
2516  }
2517  else {
2518  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2519  param->name + "]";
2520  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2521  }
2522 
2523  if(double2 >= double1) {
2524  QString message = "Parameter [" + param->name +
2525  "] must be greater than parameter [" +
2526  param2->name + "].";
2527  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2528  }
2529  }
2530  }
2531  }
2532 
2533  // Check the values for greaterThanOrEqual clauses
2534  if(param->values.size() > 0) {
2535  for(unsigned int item = 0; item < param->greaterThanOrEqual.size(); item++) {
2536  const IsisParameterData *param2 =
2537  ReturnParam(param->greaterThanOrEqual[item]);
2538  if(param2->values.size() != 0) {
2539  double double1, double2;
2540  if(param->type == "integer") {
2541  double1 = (double) GetInteger(param->name);
2542  }
2543  else if(param->type == "double") {
2544  double1 = GetDouble(param->name);
2545  }
2546  else {
2547  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2548  param->name + "]";
2549  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2550  }
2551 
2552  if(param2->type == "integer") {
2553  double2 = GetInteger(param2->name);
2554  }
2555  else if(param2->type == "double") {
2556  double2 = GetDouble(param2->name);
2557  }
2558  else {
2559  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2560  param->name + "]";
2561  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2562  }
2563 
2564  if(double2 > double1) {
2565  QString message = "Parameter [" + param->name +
2566  "] must be greater than or equal to parameter [" +
2567  param2->name + "].";
2568  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2569  }
2570  }
2571  }
2572  }
2573  // Check the values for lessThan clauses
2574  if(param->values.size() > 0) {
2575  for(unsigned int item = 0; item < param->lessThan.size(); item++) {
2576  const IsisParameterData *param2 = ReturnParam(param->lessThan[item]);
2577  if(param2->values.size() != 0) {
2578  double double1, double2;
2579  if(param->type == "integer") {
2580  double1 = (double) GetInteger(param->name);
2581  }
2582  else if(param->type == "double") {
2583  double1 = GetDouble(param->name);
2584  }
2585  else {
2586  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2587  param->name + "]";
2588  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2589  }
2590 
2591  if(param2->type == "integer") {
2592  double2 = GetInteger(param2->name);
2593  }
2594  else if(param2->type == "double") {
2595  double2 = GetDouble(param2->name);
2596  }
2597  else {
2598  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2599  param->name + "]";
2600  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2601  }
2602 
2603  if(double2 <= double1) {
2604  QString message = "Parameter [" + param->name +
2605  "] must be less than parameter [" +
2606  param2->name + "].";
2607  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2608  }
2609  }
2610  }
2611  }
2612 
2613  // Check the values for lessThanOrEqual clauses
2614  if(param->values.size() > 0) {
2615  for(unsigned int item = 0; item < param->lessThanOrEqual.size(); item++) {
2616  const IsisParameterData *param2 =
2617  ReturnParam(param->lessThanOrEqual[item]);
2618  if(param2->values.size() != 0) {
2619  double double1, double2;
2620  if(param->type == "integer") {
2621  double1 = (double) GetInteger(param->name);
2622  }
2623  else if(param->type == "double") {
2624  double1 = GetDouble(param->name);
2625  }
2626  else {
2627  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2628  param->name + "]";
2629  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2630  }
2631 
2632  if(param2->type == "integer") {
2633  double2 = GetInteger(param2->name);
2634  }
2635  else if(param2->type == "double") {
2636  double2 = GetDouble(param2->name);
2637  }
2638  else {
2639  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2640  param->name + "]";
2641  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2642  }
2643 
2644  if(double2 < double1) {
2645  QString message = "Parameter [" + param->name +
2646  "] must be less than or equal to parameter [" +
2647  param2->name + "].";
2648  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2649  }
2650  }
2651  }
2652  }
2653 
2654  // Check the values for notEqual clauses
2655  if(param->values.size() > 0) {
2656  for(unsigned int item = 0; item < param->notEqual.size(); item++) {
2657  const IsisParameterData *param2 = ReturnParam(param->notEqual[item]);
2658  if(param2->values.size() != 0) {
2659  double double1, double2;
2660  if(param->type == "integer") {
2661  double1 = (double) GetInteger(param->name);
2662  }
2663  else if(param->type == "double") {
2664  double1 = GetDouble(param->name);
2665  }
2666  else {
2667  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2668  param->name + "]";
2669  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2670  }
2671 
2672  if(param2->type == "integer") {
2673  double2 = GetInteger(param2->name);
2674  }
2675  else if(param2->type == "double") {
2676  double2 = GetDouble(param2->name);
2677  }
2678  else {
2679  QString msg = "Parameter is not INTEGER or DOUBLE type [" +
2680  param->name + "]";
2681  throw Isis::IException(Isis::IException::Programmer, msg, _FILEINFO_);
2682  }
2683 
2684  if(double2 == double1) {
2685  QString message = "Parameter [" + param->name +
2686  "] must NOT be equal to parameter [" +
2687  param2->name + "].";
2688  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2689  }
2690  }
2691  }
2692  }
2693 
2694  // If this parameter has a value, and a list/option/exclude, make sure
2695  // the excluded parameter has NO value
2696  if(((param->values.size() > 0) || (param->defaultValues.size())) > 0) {
2697  for(unsigned int o2 = 0; o2 < param->listOptions.size(); o2++) {
2698  QString value, option;
2699  if(param->type == "string" || param->type == "combo") {
2700  value = GetString(param->name);
2701  value = value.toUpper();
2702  option = param->listOptions[o2].value;
2703  option = option.toUpper();
2704  }
2705  else if(param->type == "integer") {
2706  value = GetAsString(param->name);
2707  value = value.trimmed();
2708  option = param->listOptions[o2].value;
2709  option = option.trimmed();
2710  }
2711  if(value == option) {
2712  for(unsigned int e2 = 0; e2 < param->listOptions[o2].exclude.size(); e2++) {
2713  const IsisParameterData *param2 =
2714  ReturnParam(param->listOptions[o2].exclude[e2]);
2715  if(param2->values.size() > 0) {
2716  QString message = "Parameter [" + param2->name +
2717  "] can not be entered if parameter [" +
2718  param->name + "] is equal to [" +
2719  value + "]";
2720  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2721  }
2722  }
2723  }
2724  }
2725  }
2726 
2727  // If this parameter has a value, and a list/option/include, make sure
2728  // the included parameter has a value
2729  if(((param->values.size() > 0) || (param->defaultValues.size())) > 0) {
2730  for(unsigned int o2 = 0; o2 < param->listOptions.size(); o2++) {
2731  QString value, option;
2732  if(param->type == "string" || param->type == "combo") {
2733  value = GetString(param->name);
2734  value = value.toUpper();
2735  option = param->listOptions[o2].value;
2736  option = option.toUpper();
2737  }
2738  else if(param->type == "integer") {
2739  value = GetAsString(param->name);
2740  value = value.trimmed();
2741  option = param->listOptions[o2].value;
2742  option = option.trimmed();
2743  }
2744  if(value == option) {
2745  for(unsigned int e2 = 0; e2 < param->listOptions[o2].include.size(); e2++) {
2746  const IsisParameterData *param2 =
2747  ReturnParam(param->listOptions[o2].include[e2]);
2748  if((param2->values.size() == 0) &&
2749  (param2->defaultValues.size() == 0)) {
2750  QString message = "Parameter [" + param2->name +
2751  "] must be entered if parameter [" +
2752  param->name + "] is equal to [" +
2753  value + "]";
2754  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2755  }
2756  }
2757  }
2758  }
2759  }
2760 
2761  // If this parameter has no value, default value or internal default
2762  // value then it must be excluded by some other parameter with an
2763  // exclude or list/option/exclude
2764  // OR
2765  // it must include a boolean which is false
2766  if((param->values.size() == 0) && (param->defaultValues.size() == 0) &&
2767  (param->internalDefault.size() == 0)) {
2768  bool excluded = false;
2769  // See if another parameter has a list option excluding this parameter
2770  for(unsigned int g2 = 0; g2 < groups.size(); g2++) {
2771  for(unsigned int p2 = 0; p2 < groups[g2].parameters.size(); p2++) {
2772  for(unsigned int o2 = 0;
2773  o2 < groups[g2].parameters[p2].listOptions.size(); o2++) {
2774  for(unsigned int e2 = 0;
2775  e2 < groups[g2].parameters[p2].listOptions[o2].exclude.size();
2776  e2++) {
2777  QString excl =
2778  this->groups[g2].parameters[p2].listOptions[o2].exclude[e2];
2779  if(excl == param->name) {
2780  excluded = true;
2781  break;
2782  }
2783  }
2784  }
2785 
2786  if(groups[g2].parameters[p2].type == "boolean") {
2787  const IsisParameterData *param2 = &groups[g2].parameters[p2];
2788  if(((param2->values.size() > 0) && !StringToBool(param2->values[0])) ||
2789  ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2790  !StringToBool(param2->defaultValues[0]))) {
2791  for(unsigned int e2 = 0; e2 < groups[g2].parameters[p2].include.size();
2792  e2++) {
2793  QString incl =
2794  this->groups[g2].parameters[p2].include[e2];
2795  if(incl == param->name) {
2796  excluded = true;
2797  }
2798  }
2799  }
2800  else if(((param2->values.size() > 0) && StringToBool(param2->values[0])) ||
2801  ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2802  StringToBool(param2->defaultValues[0]))) {
2803  for(unsigned int e2 = 0; e2 < groups[g2].parameters[p2].exclude.size();
2804  e2++) {
2805  QString excl =
2806  this->groups[g2].parameters[p2].exclude[e2];
2807  if(excl == param->name) {
2808  excluded = true;
2809  }
2810  }
2811  }
2812  }
2813  }
2814  }
2815 
2816  // See if this parameter excludes any other (this implies the other
2817  // one also excludes this one too
2818  for(unsigned int item = 0; item < param->exclude.size(); item++) {
2819  const IsisParameterData *param2 = ReturnParam(param->exclude[item]);
2820  if((param2->values.size() != 0) ||
2821  (param2->defaultValues.size() != 0) ||
2822  (param2->internalDefault.size() != 0)) {
2823  if(param2->type != "boolean") {
2824  excluded = true;
2825  }
2826  else {
2827  if(((param2->values.size() > 0) && !StringToBool(param2->values[0])) ||
2828  ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2829  !StringToBool(param2->defaultValues[0]))) {
2830  excluded = true;
2831  }
2832  }
2833  }
2834  }
2835 
2836  // See if this parameter includes a boolean that is false
2837  // then it doesn't need a value
2838  for(unsigned int item = 0; item < param->include.size(); item++) {
2839  const IsisParameterData *param2 = ReturnParam(param->include[item]);
2840  if(param2->type == "boolean") {
2841  if(((param2->values.size() > 0) && !StringToBool(param2->values[0])) ||
2842  ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2843  !StringToBool(param2->defaultValues[0]))) {
2844  excluded = true;
2845  }
2846  }
2847  }
2848 
2849  if(!excluded) {
2850  QString message = "Parameter [" + param->name + "] must be entered.";
2851  throw Isis::IException(Isis::IException::User, message, _FILEINFO_);
2852  }
2853  }
2854  }
2855  }
2856 }
2857 
2867 bool IsisAml::StringToBool(QString value) const {
2868 
2869  value = value.toUpper();
2870  if(value == "") {
2871  return false;
2872  }
2873  else if(!value.compare("NO")) {
2874  return false;
2875  }
2876  else if(!value.compare("FALSE")) {
2877  return false;
2878  }
2879  else if(!value.compare("F")) {
2880  return false;
2881  }
2882  else if(!value.compare("N")) {
2883  return false;
2884  }
2885  else if(!value.compare("YES")) {
2886  return true;
2887  }
2888  else if(!value.compare("TRUE")) {
2889  return true;
2890  }
2891  else if(!value.compare("Y")) {
2892  return true;
2893  }
2894  else if(!value.compare("T")) {
2895  return true;
2896  }
2897  else {
2898  QString message = "Invalid boolean value [" + value + "].";
2899  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
2900  }
2901  return false;
2902 }
2903 
2904 
2910 void IsisAml::CommandLine(Isis::Pvl &cont) const {
2911  Isis::PvlGroup group("UserParameters");
2912 
2913  // Add appropriate keywords
2914  for(unsigned int g = 0; g < groups.size(); g++) {
2915  for(unsigned int p = 0; p < groups[g].parameters.size(); p++) {
2916  const IsisParameterData *param = ReturnParam(ParamName(g, p));
2917  // If this param has a value add it to the command line
2918  if(param->values.size() > 0) {
2919  Isis::PvlKeyword paramKeyword(param->name);
2920 
2921  for(unsigned int value = 0; value < param->values.size(); value++) {
2922  paramKeyword.addValue(param->values[value]);
2923  }
2924 
2925  group += paramKeyword;
2926  }
2927 
2928  // Or if it has a default value add it to the command line
2929  else if(param->defaultValues.size() > 0) {
2930  Isis::PvlKeyword paramKeyword(param->name);
2931 
2932  for(unsigned int value = 0;
2933  value < param->defaultValues.size();
2934  value++) {
2935  paramKeyword.addValue(param->defaultValues[value]);
2936  }
2937 
2938  group += paramKeyword;
2939  }
2940  }
2941  }
2942  // Remove excluded keywords
2943  for(unsigned int g = 0; g < groups.size(); g++) {
2944  for(unsigned int p = 0; p < groups[g].parameters.size(); p++) {
2945  const IsisParameterData *param = ReturnParam(ParamName(g, p));
2946 
2947  if(((param->values.size() > 0) || (param->defaultValues.size())) > 0) {
2948  for(unsigned int o2 = 0; o2 < param->listOptions.size(); o2++) {
2949  Isis::IString value, option;
2950  if(param->type == "string" || param->type == "combo") {
2951  value = GetAsString(param->name);
2952  value = value.UpCase();
2953  option = param->listOptions[o2].value;
2954  option = option.UpCase();
2955  }
2956  else if(param->type == "integer") {
2957  value = GetAsString(param->name);
2958  value = value.Trim("\n\r\t\f\v\b");
2959  option = param->listOptions[o2].value;
2960  option = option.Trim("\n\r\t\f\v\b");
2961  }
2962  if(value == option) {
2963  for(unsigned int e2 = 0; e2 < param->listOptions[o2].exclude.size(); e2++) {
2964  const IsisParameterData *param2 =
2965  ReturnParam(param->listOptions[o2].exclude[e2]);
2966  if(group.hasKeyword(param2->name)) {
2967  group.deleteKeyword(param2->name);
2968  }
2969  }
2970  }
2971  }
2972  }
2973  }
2974  }
2975 
2976  cont.clear();
2977  cont.addGroup(group);
2978  return;
2979 }
2980 
2981 
2987 QString IsisAml::Version() const {
2988  QString st = "000-00-00";
2989  for(unsigned int i = 0; i < changes.size(); i++) {
2990  if(changes[i].date > st) st = changes[i].date;
2991  }
2992  return st;
2993 }
2994 
2995 
3003 void IsisAml::StartParser(const char *xmlfile) {
3004 
3005  // Initialize the XML system
3006  try {
3007  XERCES::XMLPlatformUtils::Initialize();
3008  }
3009 
3010  catch(const XERCES::XMLException &toCatch) {
3011 
3012  QString message = "Error during XML parser initialization" +
3013  (QString)XERCES::XMLString::transcode(toCatch.getMessage());
3014  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
3015  return;
3016  }
3017 
3018  //
3019  // Create a SAX parser object. Then, set it to validate for an IsisAml file
3020  //
3021  parser = XERCES::XMLReaderFactory::createXMLReader();
3022 
3023 // SAX2XMLReader::ValSchemes valScheme = SAX2XMLReader::Val_Auto;
3024  XERCES::SAX2XMLReader::ValSchemes valScheme = XERCES::SAX2XMLReader::Val_Never;
3025  if(valScheme == XERCES::SAX2XMLReader::Val_Auto) {
3026  parser->setFeature(XERCES::XMLString::transcode("http://xml.org/sax/features/validation"), true);
3027  parser->setFeature(XERCES::XMLString::transcode("http://apache.org/xml/features/validation/dynamic"), true);
3028  }
3029  else if(valScheme == XERCES::SAX2XMLReader::Val_Never) {
3030  parser->setFeature(XERCES::XMLString::transcode("http://xml.org/sax/features/validation"), false);
3031  }
3032 
3033  else if(valScheme == XERCES::SAX2XMLReader::Val_Always) {
3034  parser->setFeature(XERCES::XMLString::transcode("http://xml.org/sax/features/validation"), true);
3035  parser->setFeature(XERCES::XMLString::transcode("http://apache.org/xml/features/validation/dynamic"), false);
3036  }
3037 
3038 // bool doSchema = true;
3039  bool doSchema = false;
3040  parser->setFeature(XERCES::XMLString::transcode("http://apache.org/xml/features/validation/schema"), doSchema);
3041 
3042  bool schemaFullChecking = false;
3043  parser->setFeature(XERCES::XMLString::transcode("http://apache.org/xml/features/validation/schema-full-checking"), schemaFullChecking);
3044 
3045  // Create the handler object for an application
3046  // Then parse the file
3047  char *encodingName = const_cast<char *>("LATIN1");
3048  bool expandNamespaces = false ;
3049 
3050  try {
3051  IsisAmlData *mydata = this;
3052  appHandler = new IsisXMLApplication(encodingName, expandNamespaces, parser, mydata);
3053  parser->parse(xmlfile);
3054  }
3055  catch (const XERCES::XMLException &toCatch) {
3056  QString message = "Error in application XML file: " +
3057  (QString)XERCES::XMLString::transcode(toCatch.getMessage());
3058  throw Isis::IException(Isis::IException::Programmer, message, _FILEINFO_);
3059  XERCES::XMLPlatformUtils::Terminate();
3060  return;
3061  }
3062  // This Exception is thrown whenever an error is encountered while parsing an XML file.
3063  // Stacked error messages are generated containing the file path and additional data about where the error occurred.
3064  catch (Isis::IException &e) {
3065  QString filePath = (QString) xmlfile;
3066  QString previousErrorMessage = (QString) e.toString();
3067  QString additionalErrorMessage = "Error while parsing application XML file [" + filePath + "]";
3068 
3069  throw Isis::IException(Isis::IException::Programmer, additionalErrorMessage + "\n" + previousErrorMessage, _FILEINFO_);
3070  XERCES::XMLPlatformUtils::Terminate();
3071  return;
3072  }
3073 
3074  // Delete the parser
3075  delete parser;
3076  XERCES::XMLPlatformUtils::Terminate();
3077  delete appHandler;
3078  return;
3079 }
3080 
Isis::PvlObject::clear
void clear()
Remove everything from the current PvlObject.
Definition: PvlObject.h:341
IsisAml::HelperIcon
QString HelperIcon(const int &group, const int &param, const int &helper) const
Returns the name of the icon for the helper button.
Definition: IsisAml.cpp:1824
IsisAml::GetOutputAttribute
Isis::CubeAttributeOutput & GetOutputAttribute(const QString &paramName)
Gets the attributes for an output cube.
Definition: IsisAml.cpp:1919
Isis::IString::ToDouble
double ToDouble() const
Returns the floating point value the IString represents.
Definition: IString.cpp:799
IsisXMLApplication
This is free and unencumbered software released into the public domain.
Definition: IsisXMLApplication.h:19
IsisAml::PutAsString
void PutAsString(const QString &paramName, const QString &value)
Allows the insertion of a value for any parameter.
Definition: IsisAml.cpp:65
IsisAml::PutFileName
void PutFileName(const QString &paramName, const QString &value)
Allows the insertion of a value for a parameter of type "filename".
Definition: IsisAml.cpp:195
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
IsisAml::HelperDescription
QString HelperDescription(const int &group, const int &param, const int &helper) const
Returns the long description of the helper button.
Definition: IsisAml.cpp:1810
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::IString::DownCase
IString DownCase()
Converts all upper case letters in the object IString into lower case characters.
Definition: IString.cpp:644
IsisAml::CheckFileNamePreference
void CheckFileNamePreference(QString filename, QString paramname)
This method checks whether the user preferences are set to allow overwrites of existing files.
Definition: IsisAml.cpp:2367
IsisAml::GetAsString
QString GetAsString(const QString &paramName) const
Allows the retrieval of a value for a parameter of any type.
Definition: IsisAml.cpp:537
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
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
File name manipulation and expansion.
Definition: FileName.h:100
Isis::PvlKeyword::addValue
void addValue(QString value, QString unit="")
Adds a value with units.
Definition: PvlKeyword.cpp:252
IsisAml::CreatePVL
void CreatePVL(Isis::Pvl &pvlDef, QString guiGrpName, QString pvlObjName, QString pvlGrpName, std::vector< QString > &exclude)
Create Pvl with the parameters in a user defined group given the Pvl object and group name.
Definition: IsisAml.cpp:1134
Isis::FileName::fileExists
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:449
Isis::IString::Trim
IString Trim(const std::string &chars)
Removes characters from the beginning and end of the IString.
Definition: IString.cpp:525
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
IsisAml::HelpersSize
int HelpersSize(const int &group, const int &param) const
Returns the number of helpers the parameter has.
Definition: IsisAml.cpp:1755
IsisAml::GetFileName
QString GetFileName(const QString &paramName, QString extension="") const
Allows the retrieval of a value for a parameter of type "filename".
Definition: IsisAml.cpp:607
IsisParameterData
Definition: IsisAmlData.h:53
IsisAml::GetDouble
double GetDouble(const QString &paramName) const
Allows the retrieval of a value for a parameter of type "double".
Definition: IsisAml.cpp:891
IsisAml::PutString
void PutString(const QString &paramName, const QString &value)
Allows the insertion of a value for any parameter.
Definition: IsisAml.cpp:128
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
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::CubeAttributeOutput
Manipulate and parse attributes of output cube filenames.
Definition: CubeAttribute.h:473
IsisAml::HelperFunction
QString HelperFunction(const int &group, const int &param, const int &helper) const
Returns the name of the helper function.
Definition: IsisAml.cpp:1782
IsisAml::PutBoolean
void PutBoolean(const QString &paramName, const bool &value)
Allows the insertion of a value for a parameter of type "boolean".
Definition: IsisAml.cpp:446
IsisAml::ParamListDescription
QString ParamListDescription(const int &group, const int &param, const int &option) const
Returns the full description for a specific option to a parameter.
Definition: IsisAml.cpp:1645
IsisAml::StartParser
void StartParser(const char *xmlfile)
Starts parsing an application xml file.
Definition: IsisAml.cpp:3003
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::IString::ToInteger
int ToInteger() const
Returns the object string as an integer.
Definition: IString.cpp:718
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
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
IsisAmlData
Definition: IsisAmlData.h:124
IsisAml::IsParamInPvlInclude
bool IsParamInPvlInclude(QString &paramName, std::vector< QString > &exclude)
Verify whether Parameter name is in the Include list Used in creation of DefFile.
Definition: IsisAml.cpp:1191
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::GetInputAttribute
Isis::CubeAttributeInput & GetInputAttribute(const QString &paramName)
Gets the attributes for an input cube.
Definition: IsisAml.cpp:1874
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
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
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
Isis::CubeAttribute::addAttributes
void addAttributes(const FileName &fileNameWithAtts)
Append the attributes found in the filename to these cube attributes.
Definition: CubeAttribute.h:222
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::CubeAttribute::setAttributes
void setAttributes(const FileName &fileName)
Replaces the current attributes with the attributes in the given file name.
Definition: CubeAttribute.h:262
IsisAml::ParamPath
QString ParamPath(const int &group, const int &param) const
Returns the default path for a filename/cube parameter.
Definition: IsisAml.cpp:1562
Isis::IString::UpCase
IString UpCase()
Converst any lower case characters in the object IString with uppercase characters.
Definition: IString.cpp:617
IsisAml::GetBoolean
bool GetBoolean(const QString &paramName) const
Allows the retrieval of a value for a parameter of type "boolean".
Definition: IsisAml.cpp:973
IsisAml::GroupName
QString GroupName(const int &group) const
Returns the group name of group[index].
Definition: IsisAml.cpp:1098
IsisAml::VerifyAll
void VerifyAll()
Verify all parameters.
Definition: IsisAml.cpp:2387
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::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
IsisAml::GroupIndex
int GroupIndex(const QString &grpName) const
Given the group name get its index in group array.
Definition: IsisAml.cpp:1112
IsisAml::HelperBrief
QString HelperBrief(const int &group, const int &param, const int &helper) const
Returns the brief description of the helper button.
Definition: IsisAml.cpp:1796
Isis::FileName::addExtension
FileName addExtension(const QString &extension) const
Adds a new extension to the file name.
Definition: FileName.cpp:225
IsisAml::IsisAml
IsisAml(const QString &xmlfile)
Constructs an IsisAml object and internalizes the XML data in the given file name.
Definition: IsisAml.cpp:38
Isis::IException::toString
QString toString() const
Returns a string representation of this exception.
Definition: IException.cpp:537
IsisAml::~IsisAml
~IsisAml()
Destructs an IsisAml object.
Definition: IsisAml.cpp:45
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
IsisAml::ParamDescription
QString ParamDescription(const int &group, const int &param) const
Returns the long description of a parameter in a specified group.
Definition: IsisAml.cpp:1245
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::ParamFileMode
QString ParamFileMode(const int &group, const int &param) const
Returns the file mode for a parameter in a specified group.
Definition: IsisAml.cpp:1581
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
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::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
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
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
IsisAml::Version
QString Version() const
Returns the application version date.
Definition: IsisAml.cpp:2987
Isis::PvlObject::addGroup
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
IsisAml::StringToBool
bool StringToBool(QString value) const
Returns a boolean value based on the QString contents.
Definition: IsisAml.cpp:2867
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
Isis::PvlContainer::deleteKeyword
void deleteKeyword(const QString &name)
Remove a specified keyword.
Definition: PvlContainer.cpp:97
IsisAml::WasEntered
bool WasEntered(const QString &paramName) const
Returns a true if the parameter has a value, and false if it does not.
Definition: IsisAml.cpp:1836
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
IsisAml::Brief
QString Brief() const
Returns the brief description of the program.
Definition: IsisAml.cpp:1068
IsisAml::GetInteger
int GetInteger(const QString &paramName) const
Allows the retrieval of a value for a parameter of type "integer".
Definition: IsisAml.cpp:807
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.
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
IsisAml::Description
QString Description() const
Returns the full description of the program.
Definition: IsisAml.cpp:1078
IsisAml::GetString
QString GetString(const QString &paramName) const
Allows the retrieval of a value for a parameter of type "string".
Definition: IsisAml.cpp:692
IsisAml::HelperButtonName
QString HelperButtonName(const int &group, const int &param, const int &helper) const
Returns the name of the helper button.
Definition: IsisAml.cpp:1768
Isis::toBool
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:38
IsisAml::CommandLine
void CommandLine(Isis::Pvl &lab) const
Creates a QString which could be used as a command line.
Definition: IsisAml.cpp:2910
IsisAml::PutInteger
void PutInteger(const QString &paramName, const int &value)
Allows the insertion of a value for a parameter of type "integer".
Definition: IsisAml.cpp:275
Isis::CubeAttributeInput
Manipulate and parse attributes of input cube filenames.
Definition: CubeAttribute.h:381
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
IsisAml::PutDouble
void PutDouble(const QString &paramName, const double &value)
Allows the insertion of a value for a parameter of type "double".
Definition: IsisAml.cpp:361
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Isis::PvlContainer::findKeyword
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Definition: PvlContainer.cpp:62
IsisAml::ParamFilter
QString ParamFilter(const int &group, const int &param) const
Returns the parameter filter for a parameter in a specified group.
Definition: IsisAml.cpp:1543
IsisAml::Verify
void Verify(const IsisParameterData *param)
Throws an Isis::iExceptionXxxxxxxx if the parameter value(s) is invalid.
Definition: IsisAml.cpp:2017
IsisAml::ParamMaximumInclusive
QString ParamMaximumInclusive(const int &group, const int &param) const
Returns whether the maximum value is inclusive or not.
Definition: IsisAml.cpp:1297
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::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
IsisAml::NumParams
int NumParams(const int &) const
Returns the number of parameters in a group.
Definition: IsisAml.cpp:1207

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:41