--- rat/client/parameter.html 2001/08/08 15:40:52 1.12
+++ rat/client/parameter.html 2001/08/08 18:47:17 1.15
@@ -301,18 +301,20 @@ function draw() {
choicewrite('>');
if (ptype=='tolerance') {
// 0: pscat
-// 1: after processing
if (pscat=='default') {
tablestart('Use default value or algorithm of resource');
}
- if (pscat=='exact') {
- tablestart('Accept only exact value, zero tolerance');
- }
if (pscat=='relative_sym') {
// 2: percentage
// 3: open
tablestart('Percentage error, symmetric around value');
valline('Percentage',2,3);
+ if ((svalue!='') && (typeof(svalue)!="undefined")) {
+ choices.document.forms.sch.val2.value=parseInt(svalue);
+ if (svalue.indexOf('+')!=-1) {
+ choices.document.forms.sch.val3.checked=true;
+ }
+ }
}
if (pscat=='relative') {
// 2: left
@@ -322,24 +324,47 @@ function draw() {
tablestart('Percentage error, asymmetric around value');
valline('Upper percentage',2,3);
valline('Lower percentage',4,5);
+ var range=new Array;
+ if ((svalue!='') && (typeof(svalue)!="undefined")) {
+ range=svalue.split(',');
+ if (typeof(range[1])=='undefined') { range[1]=range[0]; }
+ choices.document.forms.sch.val2.value=parseFloat(range[0]);
+ if (range[0].indexOf('+')!=-1) {
+ choices.document.forms.sch.val3.checked=true;
+ }
+ choices.document.forms.sch.val4.value=parseFloat(range[1]);
+ if (range[1].indexOf('+')!=-1) {
+ choices.document.forms.sch.val5.checked=true;
+ }
+ }
}
if (pscat=='absolute_sym') {
tablestart('Absolute error, symmetric around value');
valline('Value',2,3);
+ if ((svalue!='') && (typeof(svalue)!="undefined")) {
+ choices.document.forms.sch.val2.value=parseFloat(svalue);
+ if (svalue.indexOf('+')!=-1) {
+ choices.document.forms.sch.val3.checked=true;
+ }
+ }
}
if (pscat=='absolute') {
tablestart('Absolute error, asymmetric around value');
valline('Upper value',2,3);
valline('Lower value',4,5);
- }
- if (pscat=='sigdigits') {
- tablestart('Agreement on significant digits');
- choicewrite('
Number of digits: '
- +' |
');
-
-choicewrite('Accept if more digits given: '
- +' |
');
-
+ var range=new Array;
+ if ((svalue!='') && (typeof(svalue)!="undefined")) {
+ range=svalue.split(',');
+ if (typeof(range[1])=='undefined') { range[1]=range[0]; }
+ choices.document.forms.sch.val2.value=parseFloat(range[0]);
+ if (range[0].indexOf('+')!=-1) {
+ choices.document.forms.sch.val3.checked=true;
+ }
+ choices.document.forms.sch.val4.value=parseFloat(range[1]);
+ if (range[1].indexOf('+')!=-1) {
+ choices.document.forms.sch.val5.checked=true;
+ }
+ }
}
}
@@ -380,8 +405,24 @@ choicewrite('');
+ choicewrite('');
} else {
+ if (pscat=='range') {
+ tablestart('Integer range');
+ choicewrite(' |
Lower Value:'+
+ ' | |
');
+ choicewrite('Upper Value:'+
+ ' | |
');
+ var range=new Array;
+ if ((svalue!='') && (typeof(svalue)!="undefined")) {
+ range=svalue.split(',');
+ if (typeof(range[1])=='undefined') { range[1]=range[0]; }
+ choices.document.forms.sch.val2.value=parseInt(range[0]);
+ choices.document.forms.sch.val4.value=parseInt(range[1]);
+ }
+ } else {
if (pscat=='pos') {
tablestart('Positive (non-zero) integer');
}
@@ -393,9 +434,6 @@ choicewrite(' | ');
choicewrite(' | ');
}
+ }
}
if (ptype=='float') {
@@ -498,9 +537,12 @@ function assemble() {
}
}
}
+ if ((ptype=='int') && (pscat=='range')) {
+ svalue=choices.document.forms.sch.val2.value+','+
+ choices.document.forms.sch.val4.value;
+ }
if (pscat=='default') { svalue=''; }
stype=ptype+'_'+pscat;
-// prompt(stype+' - '+svalue);
}
@@ -536,6 +578,20 @@ function init() {
(typeof(svalue)!="undefined") &&
(svalue!=0) && (svalue!='')) { pscat='any'; }
+ if (ptype=='tolerance') {
+ var tperc=0;
+ var trange=0;
+ if (typeof(svalue)!='undefined') {
+ if (svalue.indexOf('%')!=-1) { tperc=1; }
+ if (svalue.indexOf(',')!=-1) { trange=1; }
+ if (trange) {
+ if (tperc) { pscat='relative'; } else { pscat='absolute'; }
+ } else {
+ if (tperc) { pscat='relative_sym'; } else { pscat='absolute_sym'; }
+ }
+ }
+ }
+
this.window.selector.document.clear();
selwrite('');
@@ -544,12 +600,10 @@ function init() {
if (ptype=='tolerance') {
sopt('default','Default');
- sopt('exact','Exact Value (no tolerance)');
sopt('relative_sym','Relative Tolerance, Symmetric (percent)');
sopt('relative','Relative Tolerance (percentages)');
sopt('absolute_sym','Absolute Tolerance, Symmetric (value)');
sopt('absolute','Absolute Tolerance (values)');
- sopt('sigdigits','Significant Digits (number)');
}
if (ptype=='date') {
@@ -580,7 +634,8 @@ function init() {
sopt('default','Default');
sopt('pos','Positive Integer, Not Zero');
sopt('zeropos','Positive Integer or Zero');
- sopt('range','Integer Range');
+ sopt('inrange','Integer in Range');
+ sopt('range','Range of Integers');
sopt('any','Integer');
}