added 'clear' string to allow the data to purge itself

This commit is contained in:
Dima Kogan 2011-05-22 15:16:57 -07:00
parent de242bad32
commit 70f508ece6

View File

@ -403,7 +403,10 @@ sub mainThread
{ {
next if /^#/o; next if /^#/o;
if($_ !~ /^replot/o) if( $options{stream} && /^clear/o )
{ clearCurves(); }
if(! /^replot/o)
{ {
# parse the incoming data lines. The format is # parse the incoming data lines. The format is
# x id0 dat0 id1 dat1 .... # x id0 dat0 id1 dat1 ....
@ -606,6 +609,13 @@ sub setCurveLabel
updateCurveOptions($curve->[0], $id); 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 # function to add a point to the plot. Assumes that the curve indexed by $idx already exists
sub pushPoint sub pushPoint
{ {