From 70f508ece6fa67c4875ba473941b6ad74f5acb94 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 22 May 2011 15:16:57 -0700 Subject: [PATCH] added 'clear' string to allow the data to purge itself --- bin/feedGnuplot | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/feedGnuplot b/bin/feedGnuplot index 21b06de..d79e062 100755 --- a/bin/feedGnuplot +++ b/bin/feedGnuplot @@ -403,7 +403,10 @@ sub mainThread { next if /^#/o; - if($_ !~ /^replot/o) + if( $options{stream} && /^clear/o ) + { clearCurves(); } + + if(! /^replot/o) { # parse the incoming data lines. The format is # x id0 dat0 id1 dat1 .... @@ -606,6 +609,13 @@ sub setCurveLabel updateCurveOptions($curve->[0], $id); } +# remove all the curve data +sub clearCurves +{ + foreach my $curve(@curves) + { splice( @$curve, 1 ); } +} + # function to add a point to the plot. Assumes that the curve indexed by $idx already exists sub pushPoint {