drivegnuplots: only output the header if we've data for this data set

Ignore-this: effce8f31a4e9d8272927ed9faaf92c1

darcs-hash:20090204213924-0cb85-17f735f088325e37142d41dd987212c90e343950.gz
This commit is contained in:
Dima Kogan 2009-02-04 13:39:24 -08:00
parent 6d2c3ccd0b
commit bb9a00994c

View File

@ -66,10 +66,10 @@ sub main {
my $streamIdx = 0;
select((select(STDOUT), $| = 1)[0]);
my $xcounter = 0;
plotHeader($xcounter, $samples, $numberOfStreams, *PIPE);
while(<>) {
chomp;
my $line = $_;
plotHeader($xcounter, $samples, $numberOfStreams, *PIPE) if($streamIdx == 0);
foreach my $point ($line =~ /([-]?[0-9\.]+)/g)
{
my $buf = $buffers[$streamIdx];
@ -92,7 +92,6 @@ sub main {
if ($streamIdx == $numberOfStreams) {
$streamIdx = 0;
$xcounter++;
plotHeader($xcounter, $samples, $numberOfStreams, *PIPE);
}
}
}