--- rat/client/parameter.html 2000/11/27 12:11:55 1.4 +++ rat/client/parameter.html 2001/07/25 03:10:15 1.9 @@ -2,7 +2,9 @@ LON-CAPA @@ -239,6 +241,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 +287,17 @@ function afterproc() { function draw() { choicestart(); - choicewrite('
'); + choicewrite(''); if (ptype=='tolerance') { // 0: pscat // 1: after processing @@ -304,7 +341,7 @@ function draw() { choicewrite('Number of digits: ' +''); - choicewrite('Accept if more digits given: ' +choicewrite('Accept if more digits given: ' +''); } @@ -344,17 +381,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 +460,7 @@ function assemble() { if ((ptype=='date') && (pscat!='interval')) { svalue=Math.round(cdate.getTime()/1000); } + if (pscat=='default') { svalue=''; } stype=ptype+'_'+pscat; } @@ -394,9 +478,10 @@ function init() { if (pair[0]=='type') { subs=pair[1].split('_'); ptype=subs[0]; pscat=subs[1]; - if (subs[2]!=undefined) { pscat+='_'+subs[2]; } - if ((pscat=='') || (pscat==undefined)) - { pscat='default'; } + if (typeof(subs[2])!="undefined") { pscat+='_'+subs[2]; } + if ((pscat=='') || (typeof(pscat)=="undefined")) { + pscat='default'; + } } if (pair[0]=='return') { preturn=pair[1]; } if (pair[0]=='call') { pcode=pair[1]; } @@ -405,11 +490,14 @@ function init() { } svalue=pvalue; + if (((ptype=='float') || (ptype=='string') || (ptype=='int')) && + (pscat=='default') && + (typeof(svalue)!="undefined") && (svalue!=0) && (svalue!='')) { pscat='any'; } this.window.selector.document.clear(); selwrite(''); - selwrite('

'+pname+'

'); + selwrite(''+pname+'
'); selwrite('
'); @@ -474,6 +570,18 @@ function init() { selwrite('parent.opener.'+pcode+'();'); } selwrite('">Store  '); + + selwrite('Delete  '); selwrite('