version 1.12, 2001/08/08 15:40:52
|
version 1.13, 2001/08/08 16:41:28
|
Line 301 function draw() {
|
Line 301 function draw() {
|
choicewrite('>'); |
choicewrite('>'); |
if (ptype=='tolerance') { |
if (ptype=='tolerance') { |
// 0: pscat |
// 0: pscat |
// 1: after processing |
|
if (pscat=='default') { |
if (pscat=='default') { |
tablestart('Use default value or algorithm of resource'); |
tablestart('Use default value or algorithm of resource'); |
} |
} |
if (pscat=='exact') { |
|
tablestart('Accept only exact value, zero tolerance'); |
|
} |
|
if (pscat=='relative_sym') { |
if (pscat=='relative_sym') { |
// 2: percentage |
// 2: percentage |
// 3: open |
// 3: open |
tablestart('Percentage error, symmetric around value'); |
tablestart('Percentage error, symmetric around value'); |
valline('Percentage',2,3); |
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') { |
if (pscat=='relative') { |
// 2: left |
// 2: left |
Line 322 function draw() {
|
Line 324 function draw() {
|
tablestart('Percentage error, asymmetric around value'); |
tablestart('Percentage error, asymmetric around value'); |
valline('Upper percentage',2,3); |
valline('Upper percentage',2,3); |
valline('Lower percentage',4,5); |
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') { |
if (pscat=='absolute_sym') { |
tablestart('Absolute error, symmetric around value'); |
tablestart('Absolute error, symmetric around value'); |
valline('Value',2,3); |
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') { |
if (pscat=='absolute') { |
tablestart('Absolute error, asymmetric around value'); |
tablestart('Absolute error, asymmetric around value'); |
valline('Upper value',2,3); |
valline('Upper value',2,3); |
valline('Lower value',4,5); |
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') { |
if (pscat=='sigdigits') { |
tablestart('Agreement on significant digits'); |
tablestart('Agreement on significant digits'); |
Line 500 function assemble() {
|
Line 534 function assemble() {
|
} |
} |
if (pscat=='default') { svalue=''; } |
if (pscat=='default') { svalue=''; } |
stype=ptype+'_'+pscat; |
stype=ptype+'_'+pscat; |
// prompt(stype+' - '+svalue); |
|
} |
} |
|
|
|
|
Line 536 function init() {
|
Line 569 function init() {
|
(typeof(svalue)!="undefined") && |
(typeof(svalue)!="undefined") && |
(svalue!=0) && (svalue!='')) { pscat='any'; } |
(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(); |
this.window.selector.document.clear(); |
selwrite('<html><body bgcolor="#FFFFFF">'); |
selwrite('<html><body bgcolor="#FFFFFF">'); |
|
|
Line 544 function init() {
|
Line 591 function init() {
|
|
|
if (ptype=='tolerance') { |
if (ptype=='tolerance') { |
sopt('default','Default'); |
sopt('default','Default'); |
sopt('exact','Exact Value (no tolerance)'); |
|
sopt('relative_sym','Relative Tolerance, Symmetric (percent)'); |
sopt('relative_sym','Relative Tolerance, Symmetric (percent)'); |
sopt('relative','Relative Tolerance (percentages)'); |
sopt('relative','Relative Tolerance (percentages)'); |
sopt('absolute_sym','Absolute Tolerance, Symmetric (value)'); |
sopt('absolute_sym','Absolute Tolerance, Symmetric (value)'); |
sopt('absolute','Absolute Tolerance (values)'); |
sopt('absolute','Absolute Tolerance (values)'); |
sopt('sigdigits','Significant Digits (number)'); |
|
} |
} |
|
|
if (ptype=='date') { |
if (ptype=='date') { |
Line 580 function init() {
|
Line 625 function init() {
|
sopt('default','Default'); |
sopt('default','Default'); |
sopt('pos','Positive Integer, Not Zero'); |
sopt('pos','Positive Integer, Not Zero'); |
sopt('zeropos','Positive Integer or Zero'); |
sopt('zeropos','Positive Integer or Zero'); |
sopt('range','Integer Range'); |
sopt('inrange','Integer in Range'); |
|
sopt('range','Range of Integers'); |
sopt('any','Integer'); |
sopt('any','Integer'); |
} |
} |
|
|