From b1a9320774e8ac786fbca7d86f1b1873d3af463d Mon Sep 17 00:00:00 2001 From: Manuel Penschuck Date: Thu, 23 May 2013 12:03:25 +0200 Subject: [PATCH] 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) --- web/include/CtsCommands.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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"; -- 2.51.0