Changeset 711


Ignore:
Timestamp:
11/17/05 14:00:59 (18 years ago)
Author:
mar637
Message:

removed hidden naming prefix, added source selection

Location:
trunk/monitor/htdocs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/monitor/htdocs/asapmon.css

    r703 r711  
    2424}
    2525
     26abbr, acronym {
     27    text-decoration: none;
     28    border: 0;
     29    cursor: help;
     30}
     31
     32#sourcelist,#filelist {
     33    vertical-align: top;
     34}
     35
     36tr,td {
     37    padding:0;
     38}
     39
    2640legend {
    2741        color: white;
     
    2943        border-width: 1px;
    3044        padding: 0.3em;
    31         margin-bottom: 0.2em;
     45        margin-bottom: 0.5em;
    3246        background-color: #ADADD9;
    3347        font-weight: bold;
     
    3751
    3852fieldset {
    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;
    4861}
    4962
    5063fieldset.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;
    5279}
    5380
    5481#plotrange {
    55 width:250px;
    56 
     82    //width:250px;
    5783}
    5884
    59 #rangeunit {
    60 //float:left;
     85#prangeunit,#brangeunit {
     86    color: #888888;
    6187}
    6288
  • trunk/monitor/htdocs/asapmon.html.template

    r703 r711  
    44    <head>
    55        <title tal:content="title">ASAP Online Monitor</title>
    6         <link rel="stylesheet" href="/asapmon/asapmon.css" type="text/css">
     6        <link rel="stylesheet" href="/asaptest/fields.css" type="text/css">
    77        <script type="text/javascript" src="/asapmon/prototype.js"></script>
    88        <script type="text/javascript" src="/asapmon/asapmon.js"></script>
    9 
    109    </head>
    1110
    12 <body>
     11<body onload="javascript:repopulate();">
    1312    <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>
    1427    <form name="specplot" action="/cgi-bin/asapmon/asapmon.py">
    1528        <fieldset>
    1629        <legend>File selection</legend>
    1730            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>
    2137            </select>
    22            <input class="plot" type="button" name="flist" onClick="insertFields();" value="Update --&gt;"></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 --&gt;"></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>
    2650            </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>
    2765        </fieldset>
    2866        <p>
    2967        <fieldset>
    30         <legend>Plot parameters</legend>
     68        <legend>Spectral line settings</legend>
    3169            <div id="velunit">
    32             <fieldset class="velocity">
     70            <fieldset name="unitset" class="velocity">
    3371                <legend>Unit</legend>
    34                 <label>Channel
    35                     <input type="radio" checked name="unit" onclick="unitswitch('channel');" value="channel">
    36                 </label>
    37                 <label>km/s
    38                     <input type="radio" name="unit" onclick="unitswitch('km/s');" value="km/s">
    39                 </label>
    40                 <label>GHz
    41                     <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>
    4381            </fieldset>
    4482            </div>
     
    4684            <fieldset class="velocity">
    4785                <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
    5393                </label>
    5494            </fieldset>
     
    5797            <fieldset class="velocity">
    5898                <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
    64106                </label>
    65107            </fieldset>
    66108            </div>
    67109            <div id="velrest">
     110
    68111            <fieldset class="velocity">
    69112                <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>
    73131                </select>
    74                 </label>&nbsp;
    75                 <label>IF 2
    76                 <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;">
    83132                &nbsp;
    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>
    92139        </fieldset>
    93140        <p>
    94141        <fieldset>
    95142        <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 &nbsp;</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>
    108165                <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>
    110168                </select>
    111169            </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>
    114180                <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>
    115203            </div>
    116204        <div style="clear: both;">
     
    118206        </fieldset>
    119207        <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>
    120221        <div align="center">
    121222            <input class="plot" type="submit" name="plot" value="plot">
     223            <input class="plot" type="button" id="summary" name="summary" value="summary" onclick="javascript:summaryPopUp();">
    122224        </div>
    123225    </form>
    124226    <div align="center">
    125227        <img tal:attributes="src fields/imagename">
     228        <div style="color: red;font-size: 16pt" tal:content="fields/debug"></div>
    126229    </div>
    127230</body>
  • trunk/monitor/htdocs/asapmon.js

    r703 r711  
    1 function validateranges() {
    2     var fields = ["plotwindow","brangewindow"];
    3 }
    4 
    5 function baselineswitch(par) {
     1var 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
     23function 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
     35function 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
     45function 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
     60function 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
     69function 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
     80function baselineswitch() {
    681    var fields = ["polyorder","baselinerange"];
     82    var elem = document.getElementById("baseline");
    783    for (i=0; i<fields.length; ++i) {
    884        var cont = document.getElementById(fields[i]);
    9         if (par.checked) {
    10             this.value = "True";
     85        if (elem.checked) {
     86            elem.value = 1;
    1187            cont.style.display = "block";
    1288        } else {
    1389            cont.style.display = "none";
    14             this.value = "False";
     90            elem.value = 0;
    1591        }
    1692    }
     
    46122    ulblcont.innerHTML = "";
    47123    ulblcont.innerHTML = unitval;
    48     clearunit();
     124    if ( unitval != document.getElementById('cunit').value ) {
     125        clearunit();
     126    }
    49127}
    50128
     
    82160    var opts = document.getElementById("directory");
    83161    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);
    85165    return;
    86166}
    87167
     168
     169function 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
     181function invalidateFiles() {
     182    insertFields();
     183    invalidateSources();
     184}
    88185
    89186var callbackHandler = {
Note: See TracChangeset for help on using the changeset viewer.