mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-06 06:21:16 +08:00
streaming plots no longer go away once the input pipe goes away
This commit is contained in:
parent
cf57de689f
commit
064f522097
@ -513,33 +513,25 @@ sub mainThread
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# finished reading in all of the data
|
# finished reading in all. Plot what we have
|
||||||
if($options{stream})
|
plotStoredData();
|
||||||
|
|
||||||
|
if ( $options{hardcopy})
|
||||||
{
|
{
|
||||||
print PIPE "exit;\n";
|
print PIPE "set output\n";
|
||||||
close PIPE;
|
# sleep until the plot file exists, and it is closed. Sometimes the output is
|
||||||
|
# still being written at this point
|
||||||
|
usleep(100_000) until -e $outputfile;
|
||||||
|
usleep(100_000) until(system("fuser -s \"$outputfile\""));
|
||||||
|
|
||||||
|
print "Wrote output to $outputfile\n";
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
plotStoredData();
|
|
||||||
|
|
||||||
if( $options{hardcopy})
|
# we persist gnuplot, so we shouldn't need this sleep. However, once
|
||||||
{
|
# gnuplot exits, but the persistent window sticks around, you can no
|
||||||
print PIPE "set output\n";
|
# longer interactively zoom the plot. So we still sleep
|
||||||
# sleep until the plot file exists, and it is closed. Sometimes the output is
|
sleep(100000);
|
||||||
# still being written at this point
|
|
||||||
usleep(100_000) until -e $outputfile;
|
|
||||||
usleep(100_000) until(system("fuser -s \"$outputfile\""));
|
|
||||||
|
|
||||||
print "Wrote output to $outputfile\n";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
# we persist gnuplot, so we shouldn't need this sleep. However, once
|
|
||||||
# gnuplot exits, but the persistent window sticks around, you can no
|
|
||||||
# longer interactively zoom the plot. So we still sleep
|
|
||||||
sleep(100000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub pruneOldData
|
sub pruneOldData
|
||||||
|
Loading…
Reference in New Issue
Block a user