--- rat/client/parameter.html 2000/11/28 15:40:42 1.5 +++ rat/client/parameter.html 2000/12/16 19:51:30 1.6 @@ -2,7 +2,7 @@ LON-CAPA @@ -239,6 +239,31 @@ function intcalc() { draw(); } +function integereval() { + svalue=choices.document.forms.sch.intval.value; + svalue=Math.round(svalue); + if (pscat=='zeropos') { svalue=Math.abs(svalue); } + if ((pscat=='pos') && (svalue==0)) { + svalue=''; + } + draw(); +} + +function floateval() { + svalue=choices.document.forms.sch.floatval.value; + svalue=1.0*svalue; + if (pscat=='pos') { svalue=Math.abs(svalue); } + if ((pscat=='zeroone') && ((svalue<0) || (svalue>1))) { + svalue=''; + } + draw(); +} + +function stringeval() { + svalue=choices.document.forms.sch.stringval.value; + draw(); +} + function intervaldis() { csecs=svalue; cdays=Math.floor(csecs/86400); @@ -260,7 +285,17 @@ function afterproc() { function draw() { choicestart(); - choicewrite('
'); + choicewrite(''); if (ptype=='tolerance') { // 0: pscat // 1: after processing @@ -304,7 +339,7 @@ function draw() { choicewrite('Number of digits: ' +''); - choicewrite('Accept if more digits given: ' +choicewrite('Accept if more digits given: ' +''); } @@ -344,17 +379,63 @@ function draw() { } } - if (ptype=='value') { + if (ptype=='int') { + if (pscat=='default') { + tablestart('Default value or none'); + choicewrite(''); + } else { + if (pscat=='pos') { + tablestart('Positive (non-zero) integer'); + } + if (pscat=='zeropos') { + tablestart('Positive integer or zero'); + } + if (pscat=='any') { + tablestart('Integer'); + } + choicewrite('Value:'); + choicewrite(''); + choicewrite(''); + } } - if (ptype=='truefalse') { + if (ptype=='float') { + if (pscat=='default') { + tablestart('Default value or none'); + choicewrite(''); + } else { + if (pscat=='pos') { + tablestart('Positive floating point number or zero'); + } + if (pscat=='zeroone') { + tablestart('Floating point number between zero and one'); + } + if (pscat=='any') { + tablestart('Floating point number'); + } + choicewrite('Value:'); + choicewrite(''); + choicewrite(''); + } } - if (ptype=='check') { + if (ptype=='string') { + if (pscat=='default') { + tablestart('Default value or none'); + choicewrite(''); + } else { + if (pscat=='any') { + tablestart('Text'); + } + choicewrite('Value:'); + choicewrite(''); + choicewrite(''); + } } - if (ptype=='radio') { - } choicewrite('
'); choiceend(); } @@ -377,6 +458,7 @@ function assemble() { if ((ptype=='date') && (pscat!='interval')) { svalue=Math.round(cdate.getTime()/1000); } + if (pscat=='default') { svalue=''; } stype=ptype+'_'+pscat; } @@ -395,8 +477,9 @@ function init() { ptype=subs[0]; pscat=subs[1]; if (subs[2]!=undefined) { pscat+='_'+subs[2]; } - if ((pscat=='') || (pscat==undefined)) - { pscat='default'; } + if ((pscat=='') || (pscat==undefined)) { + pscat='default'; + } } if (pair[0]=='return') { preturn=pair[1]; } if (pair[0]=='call') { pcode=pair[1]; } @@ -405,6 +488,9 @@ function init() { } svalue=pvalue; + if (((ptype=='float') || (ptype=='string') || (ptype=='int')) && + (pscat=='default') && + (svalue!=undefined) && (svalue!=0) && (svalue!='')) { pscat='any'; } this.window.selector.document.clear(); selwrite(''); @@ -445,16 +531,24 @@ function init() { months[11]='December'; } - if (ptype=='value') { + if (ptype=='int') { + sopt('default','Default'); + sopt('pos','Positive Integer, Not Zero'); + sopt('zeropos','Positive Integer or Zero'); + sopt('any','Integer'); } - if (ptype=='truefalse') { - } + if (ptype=='float') { + sopt('default','Default'); + sopt('zeroone','Floating Point between 0 and 1'); + sopt('pos','Positive Floating Point'); + sopt('any','Floating Point'); - if (ptype=='check') { } - if (ptype=='radio') { + if (ptype=='string') { + sopt('default','Default'); + sopt('string','String Value'); } selwrite('');