when streaming, don't plot unless there's new data

Ignore-this: ad73a697f4fdff7f269321aab8ea78f9

darcs-hash:20091206225531-0cb85-8951ac75504fb61c7ee2e9c7b20fae76f8fe4196.gz
This commit is contained in:
Dima Kogan 2009-12-06 14:55:31 -08:00
parent d4ddf5f001
commit 8834e11a87

View File

@ -189,11 +189,14 @@ sub mainThread {
# regexp for a possibly floating point, possibly scientific notation number, fully captured
my $numRE = qr/([-]?[0-9\.]+(?:e[-]?[0-9]+)?)/o;
my $xlast;
my $haveNewData;
while( $_ = ($dataQueue && $dataQueue->dequeue()) // <> )
{
if($_ ne "Plot now")
{
$haveNewData = 1;
# parse the incoming data lines. The format is
# x idx0 dat0 idx1 dat1 ....
# where idxX is the index of the curve that datX corresponds to
@ -217,6 +220,9 @@ sub mainThread {
elsif($options{"stream"} && defined $xlast)
{
next unless $haveNewData;
$haveNewData = undef;
cutOld($xlast - $xwindow);
plotStoredData($xlast - $xwindow, $xlast);
}