Changeset 17856 for trunk/FACT++/www


Ignore:
Timestamp:
05/14/14 17:31:23 (11 years ago)
Author:
tbretz
Message:
Added the possibility to retrieve different file names in the additional controls and the possibility to get the geometry.
Location:
trunk/FACT++/www/viewer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/viewer/index.html

    r17847 r17856  
    405405<div id="ctrlcontainer" class="ui-widget-content">
    406406   <form id="controls" method="POST" style="margin-bottom:0">
     407      <input id="getgeometry" type="button" onclick="onGetGeometry();" value="Get geometry"></input>
    407408      <input id="getcamera"   type="button" onclick="onGetCameras();" value="Get camera data"></input>
    408409      <input id="getwaveform" type="button" onclick="onGetWaveforms();" value="Get waveforms"></input>
    409410      <input id="data" name="data" type="hidden"></input>
     411      <input id="name" name="name" type="hidden"></input>
    410412   </form>
    411413</div>
     
    618620disp=1.42*(1-width/length).
    619621
     622<H3>What are the additional controls</H3>
     623<i>Get geometry</i>: You will get a file with the pixel positions in arbitrary units.
     624The three columns are the pixel index, and the x and y coordinate
     625in degree.<br>
     626<i>Get camera data</i>: You will get a file with the data from the currently
     627displayed cameras. The columns are pixel index and value of the cameras
     6281, 2, 3 and 4.<br>
     629<i>Get waveforms</i>: You will get a file with the data from the currently
     630displayed waveforms. The columns are sample index and amplitude  of the waveforms
     6311, 2, 3 and 4.
     632
    620633<H3>Why is loading the page so slow?</H3>
    621634The total contents of the javascript libraries is about 1MB which
  • trunk/FACT++/www/viewer/index.js

    r17852 r17856  
    267267
    268268    $('#controls > input[name=data]').val(JSON.stringify(arr));
     269    $('#controls > input[name=name]').val('cameras.txt');
    269270    $('#controls').attr('action','index.php');
    270271    $('#controls').submit();
     
    276277
    277278    $('#controls > input[name=data]').val(JSON.stringify(arr));
     279    $('#controls > input[name=name]').val('waveforms.txt');
     280    $('#controls').attr('action','index.php');
     281    $('#controls').submit();
     282}
     283
     284function onGetGeometry()
     285{
     286    var sqrt32 = Math.sqrt(3)/2;
     287   
     288    var arr = [ new Array(1440), new Array(1440) ];
     289
     290    for (var i=0; i<1440; i++)
     291    {
     292        arr[0][i] = coord[i][0]*0.1111;
     293        arr[1][i] = coord[i][1]*0.1111*sqrt32;
     294    }
     295
     296    $('#controls > input[name=data]').val(JSON.stringify(arr));
     297    $('#controls > input[name=name]').val('geometry.txt');
    278298    $('#controls').attr('action','index.php');
    279299    $('#controls').submit();
     
    793813        return;
    794814
    795     if (!f.type.match('text/plain') && !f.type.match('application/javascript'))
    796     {
    797         alert("ERROR - Unknown file type.");
     815    if (!f.type.match('text/plain') && !f.type.match('application/javascript') && !f.type.match('application/x-javascript'))
     816    {
     817        alert("ERROR - Unknown file type: "+f.type);
    798818        return;
    799819    }
  • trunk/FACT++/www/viewer/index.php

    r17841 r17856  
    3737    header('Content-Type: text/plain');
    3838    header('Content-Transfer-Encoding: Text');
    39     header('Content-Disposition: attachment; filename="data.txt"');
     39    header('Content-Disposition: attachment; filename="'.$_POST['name'].'"');
    4040
    4141    $json = json_decode($_POST['data']);
Note: See TracChangeset for help on using the changeset viewer.