--- rat/client/parameter.html 2001/08/08 15:40:52 1.12
+++ rat/client/parameter.html 2003/02/03 18:03:54 1.20
@@ -2,9 +2,33 @@
@@ -149,9 +173,15 @@ function date() {
function year() {
var thisyear=cdate.getFullYear();
+ var nowdate=new Date();
+ var nowyear=nowdate.getFullYear();
+ var loweryear=thisyear-2;
+ var upperyear=thisyear+5;
+ if (thisyear>nowyear) { loweryear=nowyear-2; }
+ if (thisyear');
- for (i=thisyear-25;i<=thisyear+50;i++) {
+ for (i=loweryear;i<=upperyear;i++) {
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 +354,47 @@ function draw() {
tablestart('Percentage error, asymmetric around value');
valline('Upper percentage',2,3);
valline('Lower percentage',4,5);
+ var range1=new Array;
+ if ((svalue!='') && (typeof(svalue)!="undefined")) {
+ range1=svalue.split(',');
+ if (typeof(range1[1])=='undefined') { range1[1]=range1[0]; }
+ choices.document.forms.sch.val2.value=parseFloat(range1[0]);
+ if (range1[0].indexOf('+')!=-1) {
+ choices.document.forms.sch.val3.checked=true;
+ }
+ choices.document.forms.sch.val4.value=parseFloat(range1[1]);
+ if (range1[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 range2=new Array;
+ if ((svalue!='') && (typeof(svalue)!="undefined")) {
+ range=svalue.split(',');
+ if (typeof(range2[1])=='undefined') { range2[1]=range2[0]; }
+ choices.document.forms.sch.val2.value=parseFloat(range2[0]);
+ if (range2[0].indexOf('+')!=-1) {
+ choices.document.forms.sch.val3.checked=true;
+ }
+ choices.document.forms.sch.val4.value=parseFloat(range2[1]);
+ if (range2[1].indexOf('+')!=-1) {
+ choices.document.forms.sch.val5.checked=true;
+ }
+ }
}
}
@@ -378,10 +433,29 @@ 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 +467,6 @@ choicewrite('');
choicewrite(' ');
}
+ }
}
if (ptype=='float') {
@@ -436,7 +508,7 @@ choicewrite('Value: ');
- choicewrite(' ');
choicewrite(' ');
}
@@ -498,9 +570,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 +611,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 +633,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 +667,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');
}
@@ -628,16 +716,24 @@ function init() {
selwrite('">Delete ');
selwrite('Cancel ');
selwrite('');
@@ -655,4 +751,4 @@ function init() {
-
\ No newline at end of file
+