25 #include <xercesc/util/PlatformUtils.hpp>
26 #include <xercesc/util/TransService.hpp>
27 #include <xercesc/sax2/XMLReaderFactory.hpp>
46 namespace XERCES = XERCES_CPP_NAMESPACE;
55 StartParser(xmlfile.toAscii().data());
82 const QString &value) {
86 if(param->values.size() > 0) {
87 QString message =
"A value for this parameter [" + paramName +
"] has "
88 "already been entered.";
92 param->values.clear();
93 param->values.push_back(value);
110 const vector<QString> &value) {
114 if(param->values.size() > 0) {
115 QString message =
"A value for this parameter [" + paramName +
"] has "
116 "already been entered.";
120 param->values.resize(value.size());
121 param->values = value;
148 if(param->type !=
"string" && param->type !=
"combo") {
149 QString message =
"Parameter [" + paramName +
"] is not a string.";
153 if(param->values.size() > 0) {
154 QString message =
"A value for this parameter [" + paramName +
"] has "
155 "already been saved (possibly by IsisGui). If you need to "
156 "change the value use \"Clear\" before the Put.";
160 param->values.clear();
161 param->values.push_back(value);
177 const vector<QString> &value) {
181 if(param->type !=
"string" && param->type !=
"combo") {
182 QString message =
"Parameter [" + paramName +
"] is not a string.";
186 if(param->values.size() > 0) {
187 QString message =
"A value for this parameter [" + paramName +
"] has "
188 "already been saved (possibly by IsisGui). If you need to "
189 "change the value use \"Clear\" before the Put.";
193 param->values.resize(value.size());
194 param->values = value;
212 const QString &value) {
216 if((param->type !=
"filename") && (param->type !=
"cube")) {
217 QString message =
"Parameter [" + paramName +
"] is not a filename.";
221 if(param->values.size() > 0) {
222 QString message =
"A value for this parameter [" + paramName +
"] has "
223 "already been saved (possibly by IsisGui). If you need to "
224 "change the value use \"Clear\" before the Put.";
228 param->values.clear();
229 param->values.push_back(value);
254 const vector<QString> &value) {
258 if((param->type !=
"filename") && (param->type !=
"cube")) {
259 QString message =
"Parameter [" + paramName +
"] is not a filename.";
263 if(param->values.size() > 0) {
264 QString message =
"A value for this parameter [" + paramName +
"] has "
265 "already been saved (possibly by IsisGui). If you need to "
266 "change the value use \"Clear\" before the Put.";
270 param->values.resize(value.size());
271 param->values = value;
296 if(param->type !=
"integer") {
297 QString message =
"Parameter [" + paramName +
"] is not an integer.";
301 if(param->values.size() > 0) {
302 QString message =
"A value for this parameter [" + paramName +
"] has "
303 "already been saved (possibly by IsisGui). If you need to "
304 "change the value use \"Clear\" before the Put.";
308 param->values.clear();
333 const vector<int> &value) {
337 if(param->type !=
"integer") {
338 QString message =
"Parameter [" + paramName +
"] is not an integer.";
342 if(param->values.size() > 0) {
343 QString message =
"A value for this parameter [" + paramName +
"] has "
344 "already been saved (possibly by IsisGui). If you need to "
345 "change the value use \"Clear\" before the Put.";
349 param->values.resize(value.size());
350 for(
unsigned int i = 0; i < value.size(); i++) {
378 const double &value) {
382 if(param->type !=
"double") {
383 QString message =
"Parameter [" + paramName +
"] is not a double.";
387 if(param->values.size() > 0) {
388 QString message =
"A value for this parameter [" + paramName +
"] has "
389 "already been saved (possibly by IsisGui). If you need to "
390 "change the value use \"Clear\" before the Put.";
394 param->values.clear();
419 const vector<double> &value) {
423 if(param->type !=
"double") {
424 QString message =
"Parameter [" + paramName +
"] is not a double.";
428 if(param->values.size() > 0) {
429 QString message =
"A value for this parameter [" + paramName +
"] has "
430 "already been saved (possibly by IsisGui). If you need to "
431 "change the value use \"Clear\" before the Put.";
435 param->values.resize(value.size());
436 for(
unsigned int i = 0; i < value.size(); i++) {
467 if(param->type !=
"boolean") {
468 QString message =
"Parameter [" + paramName +
"] is not a boolean.";
472 if(param->values.size() > 0) {
473 QString message =
"A value for this parameter [" + paramName +
"] has "
474 "already been saved (possibly by IsisGui). If you need to "
475 "change the value use \"Clear\" before the Put.";
479 param->values.clear();
481 param->values.push_back(
"YES");
484 param->values.push_back(
"NO");
509 const vector<bool> &value) {
513 if(param->type !=
"boolean") {
514 QString message =
"Parameter [" + paramName +
"] is not a boolean.";
518 if(param->values.size() > 0) {
519 QString message =
"A value for this parameter [" + paramName +
"] has "
520 "already been saved (possibly by IsisGui). If you need to "
521 "change the value use \"Clear\" before the Put.";
525 param->values.resize(value.size());
526 for(
unsigned int i = 0; i < value.size(); i++) {
528 param->values.push_back(
"YES");
531 param->values.push_back(
"NO");
557 if(param->values.size() == 0) {
558 if(param->defaultValues.size() == 0) {
559 QString message =
"Parameter [" + paramName +
"] has no value.";
563 value = param->defaultValues[0];
567 value = param->values[0];
586 vector<QString> &values)
const {
592 if(param->values.size() == 0) {
593 if(param->defaultValues.size() == 0) {
594 QString message =
"Parameter [" + paramName +
"] has no value.";
598 for(
unsigned int i = 0; i < param->defaultValues.size(); i++)
599 values.push_back(param->defaultValues[i]);
603 for(
unsigned int i = 0; i < param->values.size(); i++)
604 values.push_back(param->values[i]);
627 if((param->type !=
"filename") && (param->type !=
"cube")) {
628 QString message =
"Parameter [" + paramName +
"] is not a filename.";
633 if(param->values.size() == 0) {
634 if(param->defaultValues.size() == 0) {
635 QString message =
"Parameter [" + paramName +
"] has no value.";
639 value = param->defaultValues[0];
643 value = param->values[0];
647 if(extension !=
"") name = name.addExtension(extension);
648 value = name.expanded();
664 vector<QString> &values)
const {
668 if((param->type !=
"filename") && (param->type !=
"cube")) {
669 QString message =
"Parameter [" + paramName +
"] is not a filename.";
674 if(param->values.size() == 0) {
675 if(param->defaultValues.size() == 0) {
676 QString message =
"Parameter [" + paramName +
"] has no value.";
680 for(
unsigned int i = 0; i < param->defaultValues.size(); i++) {
682 values.push_back(name.expanded());
687 for(
unsigned int i = 0; i < param->values.size(); i++) {
689 values.push_back(name.expanded());
713 if(param->type !=
"string" && param->type !=
"combo") {
714 QString message =
"Parameter [" + paramName +
"] is not a string.";
718 if(param->values.size() == 0) {
719 if(param->defaultValues.size() == 0) {
720 QString message =
"Parameter [" + paramName +
"] has no value.";
724 value = param->defaultValues[0];
728 value = param->values[0];
731 if(param->listOptions.size() > 0) {
732 value = value.toUpper();
735 for(
unsigned int p = 0; p < param->listOptions.size(); p++) {
736 QString option = param->listOptions[p].value;
737 option = option.toUpper();
738 if(value == option) {
741 else if(value.startsWith(option) || option.startsWith(value)) {
743 foundcount = foundcount + 1;
746 if(foundcount == 0) {
747 QString message =
"Value [" + value +
"] for parameter [" +
748 paramName +
"] is not a valid value.";
752 QString message =
"Value [" + value +
"] for parameter [" +
753 paramName +
"] is not unique.";
756 return param->listOptions[found].value;
761 value = param->values[0];
781 vector<QString> &values)
const {
785 if(param->type !=
"string" && param->type !=
"combo") {
786 QString message =
"Parameter [" + paramName +
"] is not a string.";
792 if(param->values.size() == 0) {
793 if(param->defaultValues.size() == 0) {
794 QString message =
"Parameter [" + paramName +
"] has no value.";
798 for(
unsigned int i = 0; i < param->defaultValues.size(); i++)
799 values.push_back(param->defaultValues[i]);
803 for(
unsigned int i = 0; i < param->values.size(); i++)
804 values.push_back(param->values[i]);
827 if(param->type !=
"integer") {
828 QString message =
"Parameter [" + paramName +
"] is not an integer.";
833 if(param->values.size() == 0) {
834 if(param->defaultValues.size() == 0) {
835 QString message =
"Parameter [" + paramName +
"] has no value.";
839 value = param->defaultValues[0];
843 value = param->values[0];
863 vector<int> &values)
const {
867 if(param->type !=
"integer") {
868 QString message =
"Parameter [" + paramName +
"] is not an integer.";
874 if(param->values.size() == 0) {
875 if(param->defaultValues.size() == 0) {
876 QString message =
"Parameter [" + paramName +
"] has no value.";
880 for(
unsigned int i = 0; i < param->defaultValues.size(); i++)
881 value = param->defaultValues[i];
886 for(
unsigned int i = 0; i < param->values.size(); i++)
887 value = param->values[i];
911 if(param->type !=
"double") {
912 QString message =
"Parameter [" + paramName +
"] is not a double.";
917 if(param->values.size() == 0) {
918 if(param->defaultValues.size() == 0) {
919 QString message =
"Parameter [" + paramName +
"] has no value.";
923 value = param->defaultValues[0];
927 value = param->values[0];
946 vector<double> &values)
const {
950 if(param->type !=
"double") {
951 QString message =
"Parameter [" + paramName +
"] is not a double.";
957 if(param->values.size() == 0) {
958 if(param->defaultValues.size() == 0) {
959 QString message =
"Parameter [" + paramName +
"] has no value.";
963 for(
unsigned int i = 0; i < param->defaultValues.size(); i++)
964 value = param->defaultValues[i];
969 for(
unsigned int i = 0; i < param->values.size(); i++)
970 value = param->values[i];
993 if(param->type !=
"boolean") {
994 QString message =
"Parameter [" + paramName +
"] is not a boolean.";
999 if(param->values.size() == 0) {
1000 if(param->defaultValues.size() == 0) {
1001 QString message =
"Parameter [" + paramName +
"] has no value.";
1005 value = param->defaultValues[0];
1009 value = param->values[0];
1030 vector<bool> &values)
const {
1034 if(param->type !=
"boolean") {
1035 QString message =
"Parameter [" + paramName +
"] is not a boolean.";
1040 vector <QString> value;
1042 if(param->values.size() == 0) {
1043 if(param->defaultValues.size() == 0) {
1044 QString message =
"Parameter [" + paramName +
"] has no value.";
1048 for(
unsigned int i = 0; i < param->defaultValues.size(); i++) {
1049 tmp = param->defaultValues[i].toUpper();
1050 value.push_back(tmp);
1055 for(
unsigned int i = 0; i < param->values.size(); i++) {
1056 tmp = param->values[i].toUpper();
1057 value.push_back(tmp);
1061 for(
unsigned int i = 0; i < value.size(); i++) {
1062 values.push_back(StringToBool(value[i]));
1104 return groups.size();
1115 QString s = groups[index].name;
1129 for(
int i=0; i<(int)groups.size(); i++) {
1153 if (pvlObjName !=
"") {
1158 int grpIndex= GroupIndex(guiGrpName);
1160 if (pvlGrpName ==
"" || grpIndex == -1 ) {
1161 QString errMsg =
"Must provide Group Name\n";
1166 for(
int i=0; i<NumParams(grpIndex); i++) {
1167 QString paramName = ParamName(grpIndex, i);
1169 if(IsParamInPvlInclude(paramName,include)) {
1171 if(paramType ==
"double") {
1174 if(paramType ==
"integer") {
1177 if(paramType ==
"boolean") {
1180 if(paramType ==
"string" || paramType ==
"filename" || paramType ==
"combo") {
1186 if(pvlObj != NULL) {
1209 for(
int i=0; i<(int)include.size(); i++) {
1224 return groups[group].parameters.size();
1236 QString s = groups[group].parameters[param].name;
1249 QString s = groups[group].parameters[param].brief;
1262 QString s = groups[group].parameters[param].description;
1275 QString s = groups[group].parameters[param].minimum;
1288 QString s = groups[group].parameters[param].maximum;
1301 QString s = groups[group].parameters[param].minimum_inclusive;
1314 QString s = groups[group].parameters[param].maximum_inclusive;
1328 QString s = groups[group].parameters[param].odd;
1341 return groups[group].parameters[param].greaterThan.size();
1353 const int ¶m)
const {
1354 return groups[group].parameters[param].greaterThanOrEqual.size();
1366 return groups[group].parameters[param].lessThan.size();
1378 const int ¶m)
const {
1379 return groups[group].parameters[param].lessThanOrEqual.size();
1391 return groups[group].parameters[param].notEqual.size();
1404 const int &great)
const {
1405 QString s = groups[group].parameters[param].greaterThan[great];
1419 const int &great)
const {
1420 QString s = groups[group].parameters[param].greaterThanOrEqual[great];
1434 const int &les)
const {
1435 QString s = groups[group].parameters[param].lessThan[les];
1449 const int &les)
const {
1450 QString s = groups[group].parameters[param].lessThanOrEqual[les];
1464 const int ¬Eq)
const {
1465 QString s = groups[group].parameters[param].notEqual[notEq];
1479 const int &exclude)
const {
1480 QString s = groups[group].parameters[param].exclude[exclude];
1494 const int &include)
const {
1495 QString s = groups[group].parameters[param].include[include];
1509 QString s = groups[group].parameters[param].type;
1523 if(groups[group].parameters[param].defaultValues.size() == 0) {
1527 s = groups[group].parameters[param].defaultValues[0];
1542 if(groups[group].parameters[param].internalDefault.size() == 0) {
1546 s = groups[group].parameters[param].internalDefault;
1561 if(groups[group].parameters[param].filter.size() == 0) {
1565 s = groups[group].parameters[param].filter;
1580 if(groups[group].parameters[param].path.size() == 0) {
1584 s = groups[group].parameters[param].path;
1599 if(groups[group].parameters[param].fileMode.size() == 0) {
1603 s = groups[group].parameters[param].fileMode;
1618 return groups[group].parameters[param].listOptions.size();
1632 const int &option)
const {
1633 QString s = groups[group].parameters[param].listOptions[option].value;
1647 const int &option)
const {
1648 QString s = groups[group].parameters[param].listOptions[option].brief;
1662 const int &option)
const {
1663 QString s = groups[group].parameters[param].listOptions[option].description;
1677 const int &option)
const {
1678 return groups[group].parameters[param].listOptions[option].exclude.size();
1692 const int &option,
const int &exclude)
const {
1693 QString s = groups[group].parameters[param].listOptions[option].exclude[exclude];
1707 const int &option)
const {
1708 return groups[group].parameters[param].listOptions[option].include.size();
1722 const int &option,
const int &include)
const {
1723 QString s = groups[group].parameters[param].listOptions[option].include[include];
1736 return groups[group].parameters[param].exclude.size();
1748 return groups[group].parameters[param].include.size();
1760 return groups[group].parameters[param].pixelType;
1772 return groups[group].parameters[param].helpers.size();
1785 const int &helper)
const {
1786 return groups[group].parameters[param].helpers[helper].name;
1799 const int &helper)
const {
1800 return groups[group].parameters[param].helpers[helper].function;
1813 const int &helper)
const {
1814 return groups[group].parameters[param].helpers[helper].brief;
1827 const int &helper)
const {
1828 return groups[group].parameters[param].helpers[helper].description;
1841 const int &helper)
const {
1842 return groups[group].parameters[param].helpers[helper].icon;
1856 if(param->values.size() == 0) {
1871 param->values.clear();
1894 if(param->type !=
"cube") {
1895 QString message =
"Unable to get input cube attributes. Parameter ["
1896 + paramName +
"] is not a cube. Parameter type = [" + param->type +
"].";
1901 if(param->values.size() == 0) {
1902 if(param->defaultValues.size() == 0) {
1908 value = param->defaultValues[0];
1912 value = param->values[0];
1914 if(param->fileMode ==
"input") {
1918 QString message =
"Unable to get input cube attributes. Parameter ["
1919 + paramName +
"] is not an input. Parameter fileMode = [" + param->fileMode +
"].";
1922 return param->inCubeAtt;
1939 if(param->type !=
"cube") {
1940 QString message =
"Unable to get output cube attributes. Parameter ["
1941 + paramName +
"] is not a cube. Parameter type = [" + param->type +
"].";
1946 if(param->values.size() == 0) {
1947 if(param->defaultValues.size() == 0) {
1953 value = param->defaultValues[0];
1957 value = param->values[0];
1959 if(param->fileMode ==
"output") {
1964 QString message =
"Unable to get output cube attributes. Parameter ["
1965 + paramName +
"] is not an output. Parameter fileMode = [" + param->fileMode +
"].";
1968 return param->outCubeAtt;
1989 for(
unsigned int g = 0; g < groups.size(); g++) {
1990 for(
unsigned int p = 0; p < groups[g].parameters.size(); p++) {
1991 cur_pn = groups[g].parameters[p].name;
1993 if(cur_pn.find(pn) == 0) {
1996 QString message =
"Parameter [" + paramName +
"] is not unique.";
2002 param = &(groups[g].parameters[p]);
2007 param = &(groups[g].parameters[p]);
2013 QString message =
"Unknown parameter [" + paramName +
"].";
2016 else if((found > 1) && (!exact)) {
2017 QString message =
"Parameter [" + paramName +
"] is not unique.";
2036 for(
unsigned int i = 0; i < param->values.size(); i++) {
2037 if(param->type ==
"integer") {
2043 QString message =
"Unable to convert [" + param->values[i] +
"] to an integer,"
2044 " parameter [" + param->name +
"].";
2048 else if(param->type ==
"double") {
2054 QString message =
"Unable to convert [" + param->values[i] +
"] to a double,"
2055 " parameter [" + param->name +
"].";
2059 else if(param->type ==
"boolean") {
2060 QString v = param->values[i].toUpper();
2066 QString message =
"Illegal value for [" + param->name +
"], [" + param->values[i] +
"].";
2070 else if(param->type ==
"filename") {
2073 QString value(param->values[i]);
2075 value = name.expanded();
2076 if(name.fileExists() && param->fileMode ==
"output") {
2077 CheckFileNamePreference(value, param->name);
2097 if(param->values.size() == 0) {
2098 for(
unsigned int i = 0; i < param->defaultValues.size(); i++) {
2101 if(param->type ==
"integer") {
2107 QString message =
"Unable to convert default [" + param->defaultValues[i] +
2108 "] to an integer, parameter [" + param->name +
"].";
2112 else if(param->type ==
"double") {
2118 QString message =
"Unable to convert default [" + param->defaultValues[i] +
2119 "] to a double, parameter [" + param->name +
"].";
2123 else if(param->type ==
"boolean") {
2124 QString v = param->defaultValues[i].toUpper();
2130 QString message =
"Illegal default value for [" + param->name +
"], ["
2131 + param->defaultValues[i] +
"].";
2135 else if(param->type ==
"filename") {
2137 QString value(param->defaultValues[i]);
2139 value = name.expanded();
2140 if(name.fileExists() && param->fileMode ==
"output") {
2141 CheckFileNamePreference(value, param->name);
2148 if(param->listOptions.size() > 0) {
2149 for(
unsigned int i = 0; i < param->values.size(); i++) {
2154 for(
unsigned int p = 0; p < param->listOptions.size(); p++) {
2156 option = option.
UpCase();
2158 if(value == option) {
2161 QString message =
"Duplicate list options [" +
2162 param->listOptions[p].value +
2163 "] in parameter [" + param->name +
"].";
2171 else if(option.compare(0, min(value.size(), option.size()),
2172 value, 0, min(value.size(), option.size())) == 0) {
2176 if(!exact && partial == 0) {
2177 QString message =
"Value of [" + param->name +
"] must be one of [" +
2178 param->listOptions[0].value;
2179 for(
unsigned int p = 1; p < param->listOptions.size(); p++) {
2180 message +=
", " + param->listOptions[p].value;
2185 else if(!exact && partial > 1) {
2186 QString msg =
"Value of [" + param->name +
2187 "] does not match a list option uniquely.";
2194 if(param->minimum.length() > 0) {
2195 QString incl = param->minimum_inclusive;
2196 for(
unsigned int i = 0; i < param->values.size(); i++) {
2197 if(param->type ==
"integer") {
2198 QString value(param->values[i]);
2200 value = param->minimum;
2202 if(StringToBool(incl) && (temp < min)) {
2203 QString message =
"Parameter [" + param->name +
2204 "] must be greater than or equal to [" + param->minimum +
"].";
2207 else if(!StringToBool(incl) && (temp <= min)) {
2208 QString message =
"Parameter [" + param->name +
2209 "] must be greater than [" + param->minimum +
"].";
2213 else if(param->type ==
"double") {
2216 value = param->minimum;
2218 if(StringToBool(incl) && (temp < min)) {
2219 QString message =
"Parameter [" + param->name +
2220 "] must be greater than or equal to [" + param->minimum +
"].";
2223 else if(!StringToBool(incl) && (temp <= min)) {
2224 QString message =
"Parameter [" + param->name +
2225 "] must be greater than [" + param->minimum +
"].";
2230 if(param->values.size() == 0) {
2231 for(
unsigned int i = 0; i < param->defaultValues.size(); i++) {
2232 if(param->type ==
"integer") {
2235 value = param->minimum;
2237 if(StringToBool(incl) && (temp < min)) {
2238 QString message =
"Parameter [" + param->name +
2239 "] must be greater than or equal to [" + param->minimum +
"].";
2242 else if(!StringToBool(incl) && (temp <= min)) {
2243 QString message =
"Parameter [" + param->name +
2244 "] must be greater than [" + param->minimum +
"].";
2248 else if(param->type ==
"double") {
2251 value = param->minimum;
2253 if(StringToBool(incl) && (temp < min)) {
2254 QString message =
"Parameter [" + param->name +
2255 "] must be greater than or equal to [" + param->minimum +
"].";
2258 else if(!StringToBool(incl) && (temp <= min)) {
2259 QString message =
"Parameter [" + param->name +
2260 "] must be greater than [" + param->minimum +
"].";
2269 if(param->maximum.length() > 0) {
2270 QString incl = param->maximum_inclusive.toLower();
2271 for(
unsigned int i = 0; i < param->values.size(); i++) {
2272 if(param->type ==
"integer") {
2273 QString value(param->values[i]);
2275 value = param->maximum;
2277 if(StringToBool(incl) && (temp > max)) {
2278 QString message =
"Parameter [" + param->name +
2279 "] must be less than or equal to [" + param->maximum +
"].";
2282 else if(!StringToBool(incl) && (temp >= max)) {
2283 QString message =
"Parameter [" + param->name +
2284 "] must be less than [" + param->maximum +
"].";
2288 else if(param->type ==
"double") {
2291 value = param->maximum;
2293 if(StringToBool(incl) && (temp > max)) {
2294 QString message =
"Parameter [" + param->name +
2295 "] must be less than or equal to [" + param->maximum +
"].";
2298 else if(!StringToBool(incl) && (temp >= max)) {
2299 QString message =
"Parameter [" + param->name +
2300 "] must be less than [" + param->maximum +
"].";
2305 if(param->values.size() == 0) {
2306 for(
unsigned int i = 0; i < param->defaultValues.size(); i++) {
2307 if(param->type ==
"integer") {
2310 value = param->maximum;
2312 if(StringToBool(incl) && (temp > max)) {
2313 QString message =
"Parameter [" + param->name +
2314 "] must be less than or equal to [" + param->maximum +
"].";
2317 else if(!StringToBool(incl) && (temp >= max)) {
2318 QString message =
"Parameter [" + param->name +
2319 "] must be less than [" + param->maximum +
"].";
2323 else if(param->type ==
"double") {
2326 value = param->maximum;
2328 if(StringToBool(incl) && (temp > max)) {
2329 QString message =
"Parameter [" + param->name +
2330 "] must be less than or equal to [" + param->maximum +
"].";
2333 else if(!StringToBool(incl) && (temp >= max)) {
2334 QString message =
"Parameter [" + param->name +
2335 "] must be less than [" + param->maximum +
"].";
2344 QString odd = param->odd.toLower();
2346 if((odd !=
"") || StringToBool(odd)) {
2347 if(param->type !=
"integer") {
2348 QString message =
"Parameter [" + param->name +
2349 "] must be of type integer to have an [odd] test.";
2353 for(
unsigned int i = 0; i < param->values.size(); i++) {
2356 QString message =
"Value for [" + param->name +
"] must be odd.";
2385 QString overwritePreference = fileCustomization.
findKeyword(
"Overwrite")[0].simplified().trimmed();
2386 QString temp = overwritePreference;
2387 if(overwritePreference.toUpper() ==
"ERROR") {
2388 QString message =
"Invalid output filename for [" + paramname +
"]. The file [" + filename +
"] already exists. " +
2389 "The user preference file customization group is set to disallow file overwrites.";
2392 else if(overwritePreference.toUpper() !=
"ALLOW") {
2393 QString message =
"Invalid entry in user preference file FileCustomization group.";
2394 message +=
" Overwrite = [" + temp +
"]. Valid values: [Allow] or [Error].";
2404 for(
unsigned int g = 0; g < groups.size(); g++) {
2405 for(
unsigned int p = 0; p < groups[g].parameters.size(); p++) {
2411 for(
unsigned int item = 0; item < param->include.size(); item++) {
2414 if(param->type ==
"boolean") {
2415 if(((param->values.size() > 0) && StringToBool(param->values[0])) ||
2416 ((param->values.size() == 0) && (param->defaultValues.size() > 0)
2417 && StringToBool(param->defaultValues[0]))) {
2420 if((param2->values.size()) == 0 &&
2421 (param2->defaultValues.size() == 0) &&
2422 (param2->internalDefault.size() == 0)) {
2423 QString message =
"Parameter [" + param2->name +
2424 "] must be used if parameter [" +
2425 param->name +
"] equates to true.";
2435 if(param2->type ==
"boolean") {
2436 if(((param2->values.size() > 0) && StringToBool(param2->values[0])) ||
2437 ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2438 StringToBool(param2->defaultValues[0]))) {
2439 if((param->values.size()) == 0 &&
2440 (param->defaultValues.size() == 0) &&
2441 (param->internalDefault.size() == 0)) {
2442 QString message =
"Parameter [" + param2->name +
2443 "] must be used if parameter [" +
2444 param->name +
"] is used.";
2452 if(param->values.size() > 0 &&
2453 param2->values.size() == 0 &&
2454 param2->defaultValues.size() == 0 &&
2455 param2->internalDefault.size() == 0) {
2456 QString message =
"Parameter [" + param2->name +
2457 "] must be used if parameter [" +
2458 param->name +
"] is used.";
2465 for(
unsigned int item = 0; item < param->exclude.size(); item++) {
2468 if(param->type ==
"boolean") {
2469 if(((param->values.size() > 0) && StringToBool(param->values[0])) ||
2470 ((param->values.size() == 0) && (param->defaultValues.size() > 0) &&
2471 StringToBool(param->defaultValues[0]))) {
2474 if(param2->values.size() > 0) {
2475 QString message =
"Parameter [" + param2->name +
2476 "] must NOT be used if parameter [" +
2477 param->name +
"] equates to true.";
2485 if(param2->type ==
"boolean") {
2486 if(((param2->values.size() > 0) && StringToBool(param2->values[0])) ||
2487 ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2488 StringToBool(param2->defaultValues[0]))) {
2489 if(param->values.size() > 0) {
2490 QString message =
"Parameter [" + param2->name +
2491 "] must be used if parameter [" +
2492 param->name +
"] is used.";
2499 if(param->values.size() > 0 && param2->values.size() > 0) {
2500 QString message =
"Parameter [" + param2->name +
2501 "] must NOT be used if parameter [" +
2502 param->name +
"] is used.";
2510 if(param->values.size() > 0) {
2511 for(
unsigned int item = 0; item < param->greaterThan.size(); item++) {
2513 if(param2->values.size() != 0) {
2514 double double1, double2;
2515 if(param->type ==
"integer") {
2516 double1 = (double) GetInteger(param->name);
2518 else if(param->type ==
"double") {
2519 double1 = GetDouble(param->name);
2522 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2527 if(param2->type ==
"integer") {
2528 double2 = GetInteger(param2->name);
2530 else if(param2->type ==
"double") {
2531 double2 = GetDouble(param2->name);
2534 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2539 if(double2 >= double1) {
2540 QString message =
"Parameter [" + param->name +
2541 "] must be greater than parameter [" +
2542 param2->name +
"].";
2550 if(param->values.size() > 0) {
2551 for(
unsigned int item = 0; item < param->greaterThanOrEqual.size(); item++) {
2553 ReturnParam(param->greaterThanOrEqual[item]);
2554 if(param2->values.size() != 0) {
2555 double double1, double2;
2556 if(param->type ==
"integer") {
2557 double1 = (double) GetInteger(param->name);
2559 else if(param->type ==
"double") {
2560 double1 = GetDouble(param->name);
2563 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2568 if(param2->type ==
"integer") {
2569 double2 = GetInteger(param2->name);
2571 else if(param2->type ==
"double") {
2572 double2 = GetDouble(param2->name);
2575 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2580 if(double2 > double1) {
2581 QString message =
"Parameter [" + param->name +
2582 "] must be greater than or equal to parameter [" +
2583 param2->name +
"].";
2590 if(param->values.size() > 0) {
2591 for(
unsigned int item = 0; item < param->lessThan.size(); item++) {
2593 if(param2->values.size() != 0) {
2594 double double1, double2;
2595 if(param->type ==
"integer") {
2596 double1 = (double) GetInteger(param->name);
2598 else if(param->type ==
"double") {
2599 double1 = GetDouble(param->name);
2602 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2607 if(param2->type ==
"integer") {
2608 double2 = GetInteger(param2->name);
2610 else if(param2->type ==
"double") {
2611 double2 = GetDouble(param2->name);
2614 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2619 if(double2 <= double1) {
2620 QString message =
"Parameter [" + param->name +
2621 "] must be less than parameter [" +
2622 param2->name +
"].";
2630 if(param->values.size() > 0) {
2631 for(
unsigned int item = 0; item < param->lessThanOrEqual.size(); item++) {
2633 ReturnParam(param->lessThanOrEqual[item]);
2634 if(param2->values.size() != 0) {
2635 double double1, double2;
2636 if(param->type ==
"integer") {
2637 double1 = (double) GetInteger(param->name);
2639 else if(param->type ==
"double") {
2640 double1 = GetDouble(param->name);
2643 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2648 if(param2->type ==
"integer") {
2649 double2 = GetInteger(param2->name);
2651 else if(param2->type ==
"double") {
2652 double2 = GetDouble(param2->name);
2655 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2660 if(double2 < double1) {
2661 QString message =
"Parameter [" + param->name +
2662 "] must be less than or equal to parameter [" +
2663 param2->name +
"].";
2671 if(param->values.size() > 0) {
2672 for(
unsigned int item = 0; item < param->notEqual.size(); item++) {
2674 if(param2->values.size() != 0) {
2675 double double1, double2;
2676 if(param->type ==
"integer") {
2677 double1 = (double) GetInteger(param->name);
2679 else if(param->type ==
"double") {
2680 double1 = GetDouble(param->name);
2683 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2688 if(param2->type ==
"integer") {
2689 double2 = GetInteger(param2->name);
2691 else if(param2->type ==
"double") {
2692 double2 = GetDouble(param2->name);
2695 QString msg =
"Parameter is not INTEGER or DOUBLE type [" +
2700 if(double2 == double1) {
2701 QString message =
"Parameter [" + param->name +
2702 "] must NOT be equal to parameter [" +
2703 param2->name +
"].";
2712 if(((param->values.size() > 0) || (param->defaultValues.size())) > 0) {
2713 for(
unsigned int o2 = 0; o2 < param->listOptions.size(); o2++) {
2714 QString value, option;
2715 if(param->type ==
"string" || param->type ==
"combo") {
2716 value = GetString(param->name);
2717 value = value.toUpper();
2718 option = param->listOptions[o2].value;
2719 option = option.toUpper();
2721 else if(param->type ==
"integer") {
2722 value = GetAsString(param->name);
2723 value = value.trimmed();
2724 option = param->listOptions[o2].value;
2725 option = option.trimmed();
2727 if(value == option) {
2728 for(
unsigned int e2 = 0; e2 < param->listOptions[o2].exclude.size(); e2++) {
2730 ReturnParam(param->listOptions[o2].exclude[e2]);
2731 if(param2->values.size() > 0) {
2732 QString message =
"Parameter [" + param2->name +
2733 "] can not be entered if parameter [" +
2734 param->name +
"] is equal to [" +
2745 if(((param->values.size() > 0) || (param->defaultValues.size())) > 0) {
2746 for(
unsigned int o2 = 0; o2 < param->listOptions.size(); o2++) {
2747 QString value, option;
2748 if(param->type ==
"string" || param->type ==
"combo") {
2749 value = GetString(param->name);
2750 value = value.toUpper();
2751 option = param->listOptions[o2].value;
2752 option = option.toUpper();
2754 else if(param->type ==
"integer") {
2755 value = GetAsString(param->name);
2756 value = value.trimmed();
2757 option = param->listOptions[o2].value;
2758 option = option.trimmed();
2760 if(value == option) {
2761 for(
unsigned int e2 = 0; e2 < param->listOptions[o2].include.size(); e2++) {
2763 ReturnParam(param->listOptions[o2].include[e2]);
2764 if((param2->values.size() == 0) &&
2765 (param2->defaultValues.size() == 0)) {
2766 QString message =
"Parameter [" + param2->name +
2767 "] must be entered if parameter [" +
2768 param->name +
"] is equal to [" +
2782 if((param->values.size() == 0) && (param->defaultValues.size() == 0) &&
2783 (param->internalDefault.size() == 0)) {
2784 bool excluded =
false;
2786 for(
unsigned int g2 = 0; g2 < groups.size(); g2++) {
2787 for(
unsigned int p2 = 0; p2 < groups[g2].parameters.size(); p2++) {
2788 for(
unsigned int o2 = 0;
2789 o2 < groups[g2].parameters[p2].listOptions.size(); o2++) {
2790 for(
unsigned int e2 = 0;
2791 e2 < groups[g2].parameters[p2].listOptions[o2].exclude.size();
2794 this->groups[g2].parameters[p2].listOptions[o2].exclude[e2];
2795 if(excl == param->name) {
2802 if(groups[g2].parameters[p2].type ==
"boolean") {
2804 if(((param2->values.size() > 0) && !StringToBool(param2->values[0])) ||
2805 ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2806 !StringToBool(param2->defaultValues[0]))) {
2807 for(
unsigned int e2 = 0; e2 < groups[g2].parameters[p2].include.size();
2810 this->groups[g2].parameters[p2].include[e2];
2811 if(incl == param->name) {
2816 else if(((param2->values.size() > 0) && StringToBool(param2->values[0])) ||
2817 ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2818 StringToBool(param2->defaultValues[0]))) {
2819 for(
unsigned int e2 = 0; e2 < groups[g2].parameters[p2].exclude.size();
2822 this->groups[g2].parameters[p2].exclude[e2];
2823 if(excl == param->name) {
2834 for(
unsigned int item = 0; item < param->exclude.size(); item++) {
2836 if((param2->values.size() != 0) ||
2837 (param2->defaultValues.size() != 0) ||
2838 (param2->internalDefault.size() != 0)) {
2839 if(param2->type !=
"boolean") {
2843 if(((param2->values.size() > 0) && !StringToBool(param2->values[0])) ||
2844 ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2845 !StringToBool(param2->defaultValues[0]))) {
2854 for(
unsigned int item = 0; item < param->include.size(); item++) {
2856 if(param2->type ==
"boolean") {
2857 if(((param2->values.size() > 0) && !StringToBool(param2->values[0])) ||
2858 ((param2->values.size() == 0) && (param2->defaultValues.size() > 0) &&
2859 !StringToBool(param2->defaultValues[0]))) {
2866 QString message =
"Parameter [" + param->name +
"] must be entered.";
2885 value = value.toUpper();
2889 else if(!value.compare(
"NO")) {
2892 else if(!value.compare(
"FALSE")) {
2895 else if(!value.compare(
"F")) {
2898 else if(!value.compare(
"N")) {
2901 else if(!value.compare(
"YES")) {
2904 else if(!value.compare(
"TRUE")) {
2907 else if(!value.compare(
"Y")) {
2910 else if(!value.compare(
"T")) {
2914 QString message =
"Invalid boolean value [" + value +
"].";
2930 for(
unsigned int g = 0; g < groups.size(); g++) {
2931 for(
unsigned int p = 0; p < groups[g].parameters.size(); p++) {
2934 if(param->values.size() > 0) {
2937 for(
unsigned int value = 0; value < param->values.size(); value++) {
2938 paramKeyword.
addValue(param->values[value]);
2941 group += paramKeyword;
2945 else if(param->defaultValues.size() > 0) {
2948 for(
unsigned int value = 0;
2949 value < param->defaultValues.size();
2951 paramKeyword.
addValue(param->defaultValues[value]);
2954 group += paramKeyword;
2959 for(
unsigned int g = 0; g < groups.size(); g++) {
2960 for(
unsigned int p = 0; p < groups[g].parameters.size(); p++) {
2963 if(((param->values.size() > 0) || (param->defaultValues.size())) > 0) {
2964 for(
unsigned int o2 = 0; o2 < param->listOptions.size(); o2++) {
2966 if(param->type ==
"string" || param->type ==
"combo") {
2967 value = GetAsString(param->name);
2969 option = param->listOptions[o2].value;
2970 option = option.
UpCase();
2972 else if(param->type ==
"integer") {
2973 value = GetAsString(param->name);
2974 value = value.
Trim(
"\n\r\t\f\v\b");
2975 option = param->listOptions[o2].value;
2976 option = option.
Trim(
"\n\r\t\f\v\b");
2978 if(value == option) {
2979 for(
unsigned int e2 = 0; e2 < param->listOptions[o2].exclude.size(); e2++) {
2981 ReturnParam(param->listOptions[o2].exclude[e2]);
3004 QString st =
"000-00-00";
3005 for(
unsigned int i = 0; i < changes.size(); i++) {
3006 if(changes[i].date > st) st = changes[i].date;
3023 XERCES::XMLPlatformUtils::Initialize();
3026 catch(
const XERCES::XMLException &toCatch) {
3027 QString message =
"Error during XML parser initialization" +
3028 (QString)XERCES::XMLString::transcode(toCatch.getMessage());
3036 parser = XERCES::XMLReaderFactory::createXMLReader();
3039 XERCES::SAX2XMLReader::ValSchemes valScheme = XERCES::SAX2XMLReader::Val_Never;
3040 if(valScheme == XERCES::SAX2XMLReader::Val_Auto) {
3041 parser->setFeature(XERCES::XMLString::transcode(
"http://xml.org/sax/features/validation"),
true);
3042 parser->setFeature(XERCES::XMLString::transcode(
"http://apache.org/xml/features/validation/dynamic"),
true);
3044 else if(valScheme == XERCES::SAX2XMLReader::Val_Never) {
3045 parser->setFeature(XERCES::XMLString::transcode(
"http://xml.org/sax/features/validation"),
false);
3048 else if(valScheme == XERCES::SAX2XMLReader::Val_Always) {
3049 parser->setFeature(XERCES::XMLString::transcode(
"http://xml.org/sax/features/validation"),
true);
3050 parser->setFeature(XERCES::XMLString::transcode(
"http://apache.org/xml/features/validation/dynamic"),
false);
3054 bool doSchema =
false;
3055 parser->setFeature(XERCES::XMLString::transcode(
"http://apache.org/xml/features/validation/schema"), doSchema);
3057 bool schemaFullChecking =
false;
3058 parser->setFeature(XERCES::XMLString::transcode(
"http://apache.org/xml/features/validation/schema-full-checking"), schemaFullChecking);
3062 char *encodingName =
const_cast<char *
>(
"LATIN1");
3063 bool expandNamespaces = false ;
3068 parser->parse(xmlfile);
3070 catch(
const XERCES::XMLException &toCatch) {
3071 QString message =
"Error in application XML file: " +
3072 (QString)XERCES::XMLString::transcode(toCatch.getMessage());
3074 XERCES::XMLPlatformUtils::Terminate();
3080 XERCES::XMLPlatformUtils::Terminate();