From: Manuel Penschuck Date: Thu, 23 May 2013 10:03:25 +0000 (+0200) Subject: Gnuplot now generates a temporary plot file which is afterwards moved. This way the... X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=b1a9320774e8ac786fbca7d86f1b1873d3af463d;p=daqtools.git Gnuplot now generates a temporary plot file which is afterwards moved. This way the web-server should not deliver empty images anymore (or atleast less frequently) --- diff --git a/web/include/CtsCommands.pm b/web/include/CtsCommands.pm index 47cdd69..00afc09 100644 --- a/web/include/CtsCommands.pm +++ b/web/include/CtsCommands.pm @@ -489,13 +489,13 @@ EOF print $gnuplot_fh <<"EOF" set xrange [*:0] -set output "$filename/plot.png" +set output "$filename/_tmp_plot.png" plot \\ "$filename/plot.data" using 1:3:(\$3 / 1000) with yerrorlines title "Edges", \\ "$filename/plot.data" using 1:4:(\$4 / 1000) with yerrorlines title "Accepted" set xrange [-5:0] -set output "$filename/plotshort.png" +set output "$filename/_tmp_plotshort.png" plot \\ "$filename/plot.data" using 1:3:(\$3 / 1000) with yerrorlines title "Edges", \\ "$filename/plot.data" using 1:4:(\$4 / 1000) with yerrorlines title "Accepted" @@ -503,6 +503,10 @@ plot \\ EOF ; + rename "$filename/_tmp_plot.png", "$filename/plot.png"; + rename "$filename/_tmp_plotshort.png", "$filename/plotshort.png"; + + print ($quiet ? "." : "Plot produced\n"); } else { print "Plotting delayed as too few points captured yet\n";