Ignore:
Timestamp:
04/29/14 18:37:36 (11 years ago)
Author:
tbretz
Message:
Added another accordion for the display of additional controls; removed some obsoslet stuff from the debug text; store waveform data in the object to allow access when retrirveing it to a file.
File:
1 edited

Legend:

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

    r17727 r17732  
    1515
    1616    header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
    17     header("Cache-Control: public"); // needed for i.e.
    18     header("Content-Type: text/plain");
    19     header("Content-Transfer-Encoding: Text");
    20     header("Content-Disposition: attachment; filename=\"".$name."\"");
     17    header('Cache-Control: public'); // needed for i.e.
     18    header('Content-Type: text/plain');
     19    header('Content-Transfer-Encoding: Text');
     20    header('Content-Disposition: attachment; filename="'.$name.'"');
    2121    print($source);
     22    return;
     23}
     24
     25// This is a pretty weird hack because it does first convert
     26// all data to ascii (json) to print it...
     27if (isset($_POST['data']))
     28{
     29    header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
     30    header('Cache-Control: public'); // needed for i.e.
     31    header('Content-Type: text/plain');
     32    header('Content-Transfer-Encoding: Text');
     33    header('Content-Disposition: attachment; filename="data.txt"');
     34
     35    $json = json_decode($_POST['data']);
     36
     37    $n   = count($json[0]);
     38    $cnt = count($json);
     39
     40    for ($i=0; $i<$n; $i++)
     41    {
     42        print($i." ".$json[0][$i]);
     43
     44        if ($cnt>1)
     45            print(" ".$json[1][$i]);
     46        if ($cnt>2)
     47            print(" ".$json[2][$i]);
     48        if ($cnt>3)
     49            print(" ".$json[3][$i]);
     50        print("\n");
     51    }
    2252    return;
    2353}
     
    347377// Output result as JSON object
    348378print(json_encode($rc));
    349 
    350379?>
Note: See TracChangeset for help on using the changeset viewer.