--- rat/client/parameter.html 2001/08/08 15:40:52 1.12 +++ rat/client/parameter.html 2001/08/08 16:41:28 1.13 @@ -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,15 +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=parseInt(range[0]); + if (range[0].indexOf('+')!=-1) { + choices.document.forms.sch.val3.checked=true; + } + choices.document.forms.sch.val4.value=parseInt(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=parseInt(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); + 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]); + if (range[0].indexOf('+')!=-1) { + choices.document.forms.sch.val3.checked=true; + } + choices.document.forms.sch.val4.value=parseInt(range[1]); + if (range[1].indexOf('+')!=-1) { + choices.document.forms.sch.val5.checked=true; + } + } } if (pscat=='sigdigits') { tablestart('Agreement on significant digits'); @@ -500,7 +534,6 @@ function assemble() { } if (pscat=='default') { svalue=''; } stype=ptype+'_'+pscat; -// prompt(stype+' - '+svalue); } @@ -536,6 +569,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 +591,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 +625,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'); }