--- rat/client/parameter.html 2000/11/23 20:42:02 1.3 +++ rat/client/parameter.html 2001/03/23 19:16:13 1.8 @@ -2,7 +2,8 @@ LON-CAPA @@ -239,6 +240,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 +286,17 @@ function afterproc() { function draw() { choicestart(); - choicewrite('
'); + choicewrite(''); if (ptype=='tolerance') { // 0: pscat // 1: after processing @@ -304,7 +340,7 @@ function draw() { choicewrite('Number of digits: ' +''); - choicewrite('Accept if more digits given: ' +choicewrite('Accept if more digits given: ' +''); } @@ -344,17 +380,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,8 +459,8 @@ function assemble() { if ((ptype=='date') && (pscat!='interval')) { svalue=Math.round(cdate.getTime()/1000); } + if (pscat=='default') { svalue=''; } stype=ptype+'_'+pscat; - alert(stype+' '+svalue); } @@ -396,8 +478,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]; } @@ -406,11 +489,14 @@ 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(''); - selwrite('

'+pname+'

'); + selwrite(''+pname+'
'); selwrite('
'); selwrite('Store  '); + + selwrite('Delete  '); + + selwrite('Store'); + selwrite('">Cancel'); selwrite(''); this.window.selector.document.close();