Changeset 711
- Timestamp:
- 11/17/05 14:00:59 (19 years ago)
- Location:
- trunk/monitor/htdocs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/monitor/htdocs/asapmon.css
r703 r711 24 24 } 25 25 26 abbr, acronym { 27 text-decoration: none; 28 border: 0; 29 cursor: help; 30 } 31 32 #sourcelist,#filelist { 33 vertical-align: top; 34 } 35 36 tr,td { 37 padding:0; 38 } 39 26 40 legend { 27 41 color: white; … … 29 43 border-width: 1px; 30 44 padding: 0.3em; 31 margin-bottom: 0. 2em;45 margin-bottom: 0.5em; 32 46 background-color: #ADADD9; 33 47 font-weight: bold; … … 37 51 38 52 fieldset { 39 40 border: 1px solid; 41 border-top-width: 2px; 42 border-color: rgb(230,230,230); 43 border-top-color: #ABB8C7; 44 padding: 0 0 1em 1em; 45 background-color: #F4F4F4; 46 width: auto; 47 margin-right: 0.5em; 53 border: 0px solid; 54 border-top-width: 2px; 55 border-color: rgb(230,230,230); 56 border-top-color: #ABB8C7; 57 padding: 0.2em 0 0.5em 0.5em; 58 background-color: #F4F4F4; 59 width: auto; 60 margin-right: 0.5em; 48 61 } 49 62 50 63 fieldset.velocity { 51 height: 45px; 64 //height: 45px; 65 } 66 67 .floatleft { 68 height: 22px; 69 float:left; 70 } 71 72 73 .labeled { 74 padding-left:0.5em; 75 padding-right:0.5em; 76 margin-left: 2px; 77 margin-right: 2px; 78 border: solid 1px #a4a4a4; 52 79 } 53 80 54 81 #plotrange { 55 width:250px; 56 82 //width:250px; 57 83 } 58 84 59 # rangeunit {60 //float:left;85 #prangeunit,#brangeunit { 86 color: #888888; 61 87 } 62 88 -
trunk/monitor/htdocs/asapmon.html.template
r703 r711 4 4 <head> 5 5 <title tal:content="title">ASAP Online Monitor</title> 6 <link rel="stylesheet" href="/asap mon/asapmon.css" type="text/css">6 <link rel="stylesheet" href="/asaptest/fields.css" type="text/css"> 7 7 <script type="text/javascript" src="/asapmon/prototype.js"></script> 8 8 <script type="text/javascript" src="/asapmon/asapmon.js"></script> 9 10 9 </head> 11 10 12 <body >11 <body onload="javascript:repopulate();"> 13 12 <h1 tal:content="title">ASAP Online Monitor</h1> 13 <form name="hidform" id="hidform"> 14 <input type="hidden" id="cunit" tal:attributes="value python:fields['units'][fields['cunit']]"/> 15 <input type="hidden" id="cdoppler" tal:attributes="value fields/doppler"/> 16 <input type="hidden" id="cframe" tal:attributes="value fields/frame"/> 17 <input type="hidden" id="cfilesel" tal:attributes="value fields/cfile"/> 18 <input type="hidden" id="nif" tal:attributes="value fields/nif"/> 19 <input type="hidden" 20 tal:repeat="i fields/restn" 21 tal:attributes="id string: cif${repeat/i/index};value i" 22 /> 23 <input type="hidden" id="debug" tal:attributes="value fields/debug"/> 24 <input type="hidden" id="sum" tal:attributes="value fields/summary"/> 25 <input type="hidden" id="csource" tal:attributes="value fields/csource"/> 26 </form> 14 27 <form name="specplot" action="/cgi-bin/asapmon/asapmon.py"> 15 28 <fieldset> 16 29 <legend>File selection</legend> 17 30 Directory: 18 <select id="directory" name="dlist"> 19 <option tal:repeat="entry fields/directories" tal:content="entry" tal:attributes=" value repeat/entry/index;selected python: int(fields['cdir'])==int(repeat['entry'].getIndex()) and 'selected' or None"> 20 somewhere over the rainbow</option> 31 <select id="directory" name="dlist" onclick="invalidateFiles();"> 32 <option 33 tal:repeat="entry fields/directories" 34 tal:content="entry" 35 tal:attributes=" value repeat/entry/index;selected python:int(fields['cdir'])==int(repeat['entry'].getIndex()) and 'selected' or None" 36 >somewhere over the rainbow</option> 21 37 </select> 22 <input class="plot" type="button" name="flist" onClick="insertFields();" value="Update -->"></input> 23 File: 24 <select id="filelist" name="list"> 25 <option tal:repeat="entry fields/files" tal:content="entry" tal:attributes=" value repeat/entry/index;selected python: int(fields['cfile'])==int(repeat['entry'].getIndex()) or None">---</option> 38 <input class="plot" style="display: none" type="button" name="flist" onClick="insertFields();" value="Update -->"></input> 39 <label id="filelbl"> 40 <abbr title="Select one or more file(s)."> 41 File: 42 </abbr> 43 <select id="filelist" name="list" multiple size="5" onclick="invalidateSources();"> 44 <option 45 tal:repeat="entry fields/files" 46 tal:content="entry" 47 tal:attributes="value repeat/entry/index" 48 > 49 </option> 26 50 </select> 51 </label> 52 <label id="sourcelbl"> 53 <abbr title="Select a source if your file contains multiple sources."> 54 Source: 55 </abbr> 56 <select id="sourcelist" name="csource" size="5"> 57 <option 58 tal:repeat="entry fields/sourcenames" 59 tal:content="entry" 60 tal:attributes="value entry" 61 > 62 </option> 63 </select> 64 </label> 27 65 </fieldset> 28 66 <p> 29 67 <fieldset> 30 <legend> Plot parameters</legend>68 <legend>Spectral line settings</legend> 31 69 <div id="velunit"> 32 <fieldset class="velocity">70 <fieldset name="unitset" class="velocity"> 33 71 <legend>Unit</legend> 34 < label>Channel35 <input type="radio" checked name="unit" onclick="unitswitch('channel');" value="channel">36 </label>37 <label>km/s38 <input type="radio" name="unit" onclick="unitswitch('km/s');" value="km/s">39 </label>40 <label>GHz41 <input type="radio" name="unit" onclick="unitswitch('GHz');" value="GHz"> 42 </label>72 <span tal:repeat="u fields/units"> 73 <input type="radio" name="unit" 74 tal:attributes="value repeat/u/index; 75 checked python: int(fields['cunit'])==int(repeat['u'].getIndex()) and 'checked' or None;onclick string:unitswitch('${u}'); 76 id string: unit${repeat/u/index}" 77 > 78 <label tal:content="u"></label> 79 80 </span> 43 81 </fieldset> 44 82 </div> … … 46 84 <fieldset class="velocity"> 47 85 <legend>Frame</legend> 48 <label>LSRK 49 <input type="radio" checked name="frame" value="LSRK"> 50 </label> 51 <label>BARY 52 <input type="radio" name="frame" value="BARY"> 86 <label> 87 <input type="radio" name="frame" id="frame0" value="LSRK"> 88 LSRK 89 </label> 90 <label> 91 <input type="radio" name="frame" id="frame1" value="BARY"> 92 BARY 53 93 </label> 54 94 </fieldset> … … 57 97 <fieldset class="velocity"> 58 98 <legend>Doppler</legend> 59 <label>optical 60 <input type="radio" name="doppler" value="OPTICAL"> 61 </label> 62 <label>radio 63 <input type="radio" checked name="doppler" value="RADIO"> 99 <label> 100 <input type="radio" name="doppler" id="doppler0" value="RADIO"> 101 RADIO 102 </label> 103 <label> 104 <input type="radio" name="doppler" id="doppler1" value="OPTICAL"> 105 OPTICAL 64 106 </label> 65 107 </fieldset> 66 108 </div> 67 109 <div id="velrest"> 110 68 111 <fieldset class="velocity"> 69 112 <legend>Rest Frequencies</legend> 70 <label>IF 1 71 <select name="rest1"> 72 <option tal:repeat="line fields/restfreqs" tal:content="line" tal:attributes="value line"></option> 113 <table> 114 <tr 115 tal:repeat="i fields/nif" 116 > 117 <td> 118 <label 119 tal:attributes="id string: if${i}lbl;name string: if${i}lbl" 120 tal:content="string: IF${i}" 121 >IF 122 </label> 123 <select 124 tal:attributes="id string: rest${i};name string: rest${i}" 125 > 126 <option 127 tal:repeat="line fields/restfreqs" 128 tal:content="line" 129 tal:attributes="value repeat/line/index" 130 ></option> 73 131 </select> 74 </label> 75 <label>IF 276 <select name="rest2">77 <option tal:repeat="line fields/restfreqs" tal:content="line" tal:attributes="value line"></option>78 </select>79 </label>80 </fieldset>81 </div>82 <div style="clear: both;">83 132 84 </div> 85 <div id="plotrange"> 86 <fieldset> 87 <legend>Plot Range</legend> 88 <label id="plotlbl"><input id="plotwindow" name="plotwindow" value=""></input></label> 89 <label id ="prangeunit"></label> 90 </fieldset> 91 </div> 133 </td> 134 </tr> 135 </table> 136 </fieldset> 137 </div> 138 <div style="clear: both;"></div> 92 139 </fieldset> 93 140 <p> 94 141 <fieldset> 95 142 <legend>Processing</legend> 96 <div style="float: left;padding-left:0.5em;"> 97 <label>Quotient 98 <input type="checkbox" name="quotient" value="True"> 99 </label> 100 </div> 101 <div style="float: left;padding-left:0.5em;"> 102 <label>Baseline 103 <input type="checkbox" name="baseline" value="True" onClick="baselineswitch(this);"> 104 </label> 105 </div> 106 <div id="polyorder" style="float: left;display:none;padding-left:0.5em;"> 107 <label>Order </label> 143 <div class="labeled floatleft"> 144 <label> 145 <abbr title="Build the quotient spectrum: Toff * (on/off) - Toff"> 146 Quotient 147 </abbr> 148 <input type="checkbox" name="quotient" tal:attributes="checked python: fields['quotient'] or None;value fields/quotient"> 149 </label> 150 </div> 151 <div class="labeled floatleft"> 152 <label> 153 <abbr title="Fit a polynomial baseline to the data"> 154 Baseline 155 </abbr> 156 <input type="checkbox" id="baseline" name="baseline" tal:attributes="checked python: fields['baseline'] or None;value fields/baseline" onClick="baselineswitch();"> 157 </label> 158 </div> 159 <div id="polyorder" class="labeled floatleft"> 160 <label> 161 <abbr title="Order of the polynomial baseline fit"> 162 Order 163 </abbr> 164 </label> 108 165 <select name="polyorder"> 109 <option tal:repeat="order fields/border" tal:content="order" tal:attributes=" value order"></option> 166 <option tal:repeat="order fields/border" 167 tal:content="order" tal:attributes="value order;selected python: int(fields['cpolyorder'])==int(repeat['order'].getIndex()) or None"></option> 110 168 </select> 111 169 </div> 112 <div id="baselinerange" style="float: left;display:none;padding-left:0.5em;"> 113 <label id="brange">Baseline range<input id="brangewindow" name="brangewindow" value=""></input></label> 170 <div id="baselinerange" class="labeled floatleft"> 171 <label id="brange"> 172 <abbr title="Specify Windows in pairs, e.g. [min0,max0],[min1,max1]"> 173 Baseline Windows 174 </abbr> 175 <input id="brangewindow" name="brangewindow" 176 tal:attributes="value fields/brangewindow" 177 /> 178 179 </label> 114 180 <label id ="brangeunit"></label> 181 </div> 182 <div class="labeled floatleft"> 183 <label> 184 <abbr title="Bin the data by 5 channels"> 185 Bin 186 </abbr> 187 <input type="checkbox" name="bin" tal:attributes="checked python: fields['bin'] or None;value fields/bin"> 188 </label> 189 </div> 190 <div class="labeled floatleft"> 191 <label> 192 <abbr title="Average all integrations in all selected files (Tsys weighted)">Average 193 </abbr> 194 <input type="checkbox" name="average" tal:attributes="checked python: fields['average'] or None;value fields/average"> 195 </label> 196 </div> 197 <div class="labeled floatleft"> 198 <label> 199 <abbr title="Display Stokes IQUV instead of raw pols">Stokes 200 </abbr> 201 <input type="checkbox" name="stokes" tal:attributes="checked python: fields['stokes'] or None;value fields/stokes"> 202 </label> 115 203 </div> 116 204 <div style="clear: both;"> … … 118 206 </fieldset> 119 207 <p> 208 <div id="plotrange"> 209 <fieldset> 210 <legend> 211 <abbr title="Set the min/max for the abcissa, e.g 100,200"> 212 Plot Window 213 </abbr> 214 </legend> 215 <label id="plotlbl"><input id="plotwindow" name="plotwindow" tal:attributes="value fields/plotwindow"></input></label> 216 <label id="prangeunit"></label> 217 </fieldset> 218 </div> 219 220 <p> 120 221 <div align="center"> 121 222 <input class="plot" type="submit" name="plot" value="plot"> 223 <input class="plot" type="button" id="summary" name="summary" value="summary" onclick="javascript:summaryPopUp();"> 122 224 </div> 123 225 </form> 124 226 <div align="center"> 125 227 <img tal:attributes="src fields/imagename"> 228 <div style="color: red;font-size: 16pt" tal:content="fields/debug"></div> 126 229 </div> 127 230 </body> -
trunk/monitor/htdocs/asapmon.js
r703 r711 1 function validateranges() { 2 var fields = ["plotwindow","brangewindow"]; 3 } 4 5 function baselineswitch(par) { 1 var repopulate = function() { 2 unitswitch(document.getElementById('cunit').value); 3 baselineswitch(); 4 checkbuttons("cdoppler",["doppler0","doppler1"]); 5 checkbuttons("cframe",["frame0","frame1"]); 6 selectFiles(); 7 selectIFs(); 8 selectSources(); 9 var sumtext = document.getElementById('sum').value; 10 if (sumtext == "") { 11 document.getElementById('summary').style.display = 'none'; 12 } else { 13 document.getElementById('summary').style.display = 'inline'; 14 } 15 var csource = document.getElementById('csource').value; 16 if (csource == "") { 17 document.getElementById('sourcelbl').style.display = 'none'; 18 } else { 19 document.getElementById('sourcelbl').style.display = 'inline'; 20 } 21 } 22 23 function summaryPopUp() { 24 var sumtext = document.getElementById('sum').value; 25 if (sumtext == "") {return false;} 26 TheNewWin = window.open('','name','height=500,width=600,toolbar=no,directories=no,status=no,menubar=no'); 27 TheNewWin.document.write('<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd"><html xmlns="http:\/\/www.w3.org\/1999\/xhtml">'); 28 TheNewWin.document.write('<head><title>Popup<\/title><\/head><body style="overflow:hidden" bgcolor="#ffffff"><pre>'); 29 TheNewWin.document.write(sumtext); 30 TheNewWin.document.write('</pre><hr \/> <p align="right"><a href="#" onclick="self.close();return false;">Close'); 31 TheNewWin.document.write(' Window<\/a><\/p> <\/body><\/html>'); 32 return false; 33 } 34 35 function checkbuttons(hiddenfields, fields){ 36 var theval = document.getElementById(hiddenfields).value; 37 for (i=0; i<fields.length;++i ){ 38 var elem = document.getElementById(fields[i]); 39 if ( elem.value == theval ) { 40 elem.checked = 'checked'; 41 } 42 } 43 } 44 45 function selectSources() { 46 var sl = document.getElementById("sourcelist"); 47 var cs = document.getElementById("csource").value; 48 var opts = sl.options; 49 for (k=0; k<opts.length;++k) { 50 if (opts[k].value == cs ) { 51 opts[k].selected = 'selected'; 52 } 53 } 54 if (cs) { 55 var sourcediv = document.getElementById("sourcelbl"); 56 sourcediv.style.display = "inline"; 57 } 58 } 59 60 function selectFiles() { 61 var indeces = eval(document.getElementById("cfilesel").value); 62 var fl = document.getElementById("filelist"); 63 var opts = fl.options; 64 for (k=0; k<indeces.length;++k) { 65 opts[indeces[k]].selected = 'selected'; 66 } 67 } 68 69 function selectIFs() { 70 nif = eval(document.getElementById("nif").value); 71 for (i=0; i<nif.length;++i ) { 72 p0 = "cif"+nif[i] 73 p1 = "rest"+nif[i] 74 var ifsel = eval(document.getElementById(p0).value); 75 var f = document.getElementById(p1); 76 f.options[ifsel].selected = 'selected'; 77 } 78 } 79 80 function baselineswitch() { 6 81 var fields = ["polyorder","baselinerange"]; 82 var elem = document.getElementById("baseline"); 7 83 for (i=0; i<fields.length; ++i) { 8 84 var cont = document.getElementById(fields[i]); 9 if ( par.checked) {10 this.value = "True";85 if (elem.checked) { 86 elem.value = 1; 11 87 cont.style.display = "block"; 12 88 } else { 13 89 cont.style.display = "none"; 14 this.value = "False";90 elem.value = 0; 15 91 } 16 92 } … … 46 122 ulblcont.innerHTML = ""; 47 123 ulblcont.innerHTML = unitval; 48 clearunit(); 124 if ( unitval != document.getElementById('cunit').value ) { 125 clearunit(); 126 } 49 127 } 50 128 … … 82 160 var opts = document.getElementById("directory"); 83 161 var path = opts.selectedIndex; 84 listFiles(path,"http://localhost/cgi-bin/asapmon/filelist.py", callbackHandler); 162 scripturl = new String(window.document.location); 163 scripturl = scripturl.replace(/\w+\.py.*$/gi,"filelist.py"); 164 listFiles(path,scripturl, callbackHandler); 85 165 return; 86 166 } 87 167 168 169 function invalidateSources() { 170 var opts = document.getElementById("sourcelist"); 171 var fileopt = opts.options; 172 //clear 173 for (i=0;i<fileopt.length;++i) { 174 fileopt[i] = null; 175 } 176 fileopt.length = 0; 177 var sourcediv = document.getElementById("sourcelbl"); 178 sourcediv.style.display = "none"; 179 } 180 181 function invalidateFiles() { 182 insertFields(); 183 invalidateSources(); 184 } 88 185 89 186 var callbackHandler = {
Note:
See TracChangeset
for help on using the changeset viewer.