--- rat/client/parameter.html 2000/06/28 03:41:48 1.1 +++ rat/client/parameter.html 2000/11/19 03:23:54 1.2 @@ -2,7 +2,7 @@ LON-CAPA @@ -14,14 +14,26 @@ var ptype=''; var pvalue=''; var preturn=''; var pcode=''; -var poptions=''; +var pscat=''; +var pmarker=''; var pname=''; var svalue; +var stype; +var smarker; -var scat; var vars=new Array(); +var cdate=new Date(); + +var csec; +var cmin; +var chour; +var cday; + +var months=new Array(); + + function selwrite(text) { this.window.selector.document.write(text); } @@ -52,6 +64,195 @@ function valline(text,id1,id2) { id2+'>'); } +function datecalc() { + var sform=choices.document.forms.sch; + + cdate.setHours(sform.hours.options[sform.hours.selectedIndex].value); + cdate.setMinutes(sform.minutes.options[sform.minutes.selectedIndex].value); + cdate.setSeconds(sform.minutes.options[sform.seconds.selectedIndex].value); + cdate.setDate(sform.date.options[sform.date.selectedIndex].value); + cdate.setMonth(sform.month.options[sform.month.selectedIndex].value); + cdate.setFullYear(sform.year.options[sform.year.selectedIndex].value); + + draw(); +} + +function hour() { + var thishour=cdate.getHours(); + var i; var j; + choicewrite(''); +} + +function minute() { + var thisminutes=cdate.getMinutes(); + var i; + choicewrite(''); +} + +function second() { + var thisseconds=cdate.getSeconds(); + var i; + choicewrite(''); +} + + +function date() { + var thisdate=cdate.getDate(); + var i; + choicewrite(''); +} + +function year() { + var thisyear=cdate.getFullYear(); + var i; + choicewrite(''); +} + +function month() { + var thismonth=cdate.getMonth(); + var i; + choicewrite(''); +} + + +function intminute() { + var thisminutes=cmins; + var i; + choicewrite(''); +} + +function inthour() { + var thishours=chours; + var i; + choicewrite(''); +} + +function intsecond() { + var thisseconds=csecs; + var i; + choicewrite(''); +} + + +function intday() { + var thisdate=cdays; + var i; + choicewrite(''); +} + +function intcalc() { + var sform=choices.document.forms.sch; + svalue=((sform.date.options[sform.date.selectedIndex].value*24+ + sform.hours.options[sform.hours.selectedIndex].value*1)*60+ + sform.minutes.options[sform.minutes.selectedIndex].value*1)*60+ + sform.seconds.options[sform.seconds.selectedIndex].value*1; + draw(); +} + +function intervaldis() { + csecs=svalue; + cdays=Math.floor(csecs/86400); + csecs-=cdays*86400; + chours=Math.floor(csecs/3600); + csecs-=chours*3600; + cmins=Math.floor(csecs/60); + csecs-=cmins*60; + choicewrite(cdays+' days '+chours+' hours ' + +cmins+' mins '+csecs+' secs'); +} + + + function afterproc() { choicewrite('Error after rounding: ' +''); @@ -61,23 +262,23 @@ function draw() { choicestart(); choicewrite('
'); if (ptype=='tolerance') { -// 0: scat +// 0: pscat // 1: after processing - if (scat=='default') { + if (pscat=='default') { tablestart('Use default value or algorithm of resource'); } - if (scat=='exact') { + if (pscat=='exact') { tablestart('Accept only exact value, zero tolerance'); afterproc(); } - if (scat=='relative_sym') { + if (pscat=='relative_sym') { // 2: percentage // 3: open tablestart('Percentage error, symmetric around value'); valline('Percentage',2,3); afterproc(); } - if (scat=='relative') { + if (pscat=='relative') { // 2: left // 3: open // 4: right @@ -87,18 +288,18 @@ function draw() { valline('Lower percentage',4,5); afterproc(); } - if (scat=='absolute_sym') { + if (pscat=='absolute_sym') { tablestart('Absolute error, symmetric around value'); valline('Value',2,3); afterproc(); } - if (scat=='absolute') { + if (pscat=='absolute') { tablestart('Absolute error, asymmetric around value'); valline('Upper value',2,3); valline('Lower value',4,5); afterproc(); } - if (scat=='sigdigits') { + if (pscat=='sigdigits') { tablestart('Agreement on significant digits'); choicewrite('Number of digits: ' +''); @@ -110,7 +311,37 @@ function draw() { } if (ptype=='date') { - choicewrite(''); + if (pscat=='default') { + tablestart('Default value or none'); + choicewrite(''); + } else { + if (pscat=='start') { + tablestart('Starting or opening date and time'); + } + if (pscat=='end') { + tablestart('Ending or closing date and time'); + } + if (pscat=='interval') { + tablestart('Time interval'); + choicewrite(''); + intervaldis(); + choicewrite('Time:' + +''); + intday();choicewrite('days '); + inthour();choicewrite('hours '); + intminute(); choicewrite('mins '); intsecond(); + choicewrite('secs'); + } else { + choicewrite('' + +cdate.toString()+ + 'Date:'); + month();date();year(); + choicewrite('Time:' + +'');hour();choicewrite('h ');minute(); + choicewrite('m ');second(); + choicewrite('s'); + } + } } if (ptype=='value') { @@ -130,7 +361,7 @@ function draw() { function sopt(va,text) { selwrite(''); @@ -138,29 +369,38 @@ function sopt(va,text) { function catchange() { var sform=selector.document.forms.fsel.fcat; - scat=sform.options[sform.selectedIndex].value; + pscat=sform.options[sform.selectedIndex].value; draw(); } function assemble() { + if ((ptype=='date') && (pscat!='interval')) { + svalue=Math.round(cdate.getTime()/1000); + } + stype=ptype+'_'+pscat; + alert(stype+' '+svalue); } -function disassemble() { -} function init() { var i; - + var subs=new Array(); var namevalue=this.window.location.search.split('&'); namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1); for (i=0;i'); - selwrite('Store'); selwrite(''); this.window.selector.document.close(); + draw(); } - +