updat20131129
This commit is contained in:
28
createplot.php
Normal file
28
createplot.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
$testPath = $_GET["path"];
|
||||
$dir = opendir($testPath);
|
||||
|
||||
while ($file = readdir($dir)) {
|
||||
if (eregi("[0-9]{2,3}.json_rv1", $file)) {
|
||||
$sourceString = file_get_contents($testPath . $file);
|
||||
$source = json_decode($sourceString, true);
|
||||
|
||||
|
||||
$content = "";
|
||||
foreach ($source as $key => $value) {
|
||||
if ($key == 0) {
|
||||
continue;
|
||||
}
|
||||
$content .= $key . "\t" . $value . "\n";
|
||||
}
|
||||
|
||||
file_put_contents($testPath . $file. ".dat", $content);
|
||||
|
||||
$script = "set terminal svg;set xrange [1:];set style data lines;set out \"$testPath$file.svg\";plot \"$testPath$file.dat\";";
|
||||
file_put_contents($testPath . $file. ".pl", $script);
|
||||
exec("gnuplot $testPath$file.pl");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user