mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-06 06:21:16 +08:00
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:
parent
6d2c3ccd0b
commit
bb9a00994c
@ -66,10 +66,10 @@ sub main {
|
|||||||
my $streamIdx = 0;
|
my $streamIdx = 0;
|
||||||
select((select(STDOUT), $| = 1)[0]);
|
select((select(STDOUT), $| = 1)[0]);
|
||||||
my $xcounter = 0;
|
my $xcounter = 0;
|
||||||
plotHeader($xcounter, $samples, $numberOfStreams, *PIPE);
|
|
||||||
while(<>) {
|
while(<>) {
|
||||||
chomp;
|
chomp;
|
||||||
my $line = $_;
|
my $line = $_;
|
||||||
|
plotHeader($xcounter, $samples, $numberOfStreams, *PIPE) if($streamIdx == 0);
|
||||||
foreach my $point ($line =~ /([-]?[0-9\.]+)/g)
|
foreach my $point ($line =~ /([-]?[0-9\.]+)/g)
|
||||||
{
|
{
|
||||||
my $buf = $buffers[$streamIdx];
|
my $buf = $buffers[$streamIdx];
|
||||||
@ -92,7 +92,6 @@ sub main {
|
|||||||
if ($streamIdx == $numberOfStreams) {
|
if ($streamIdx == $numberOfStreams) {
|
||||||
$streamIdx = 0;
|
$streamIdx = 0;
|
||||||
$xcounter++;
|
$xcounter++;
|
||||||
plotHeader($xcounter, $samples, $numberOfStreams, *PIPE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user