mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-06 06:21:16 +08:00
fixed a bug in the drivegnuplot scripts. when a new curve is added, they now make sure to add all
the curves leading up to those. So if I'm trying to create curve 5, it'll create 0,1,2,3,4 if they aren't there
This commit is contained in:
parent
8834e11a87
commit
0a2226594a
@ -182,7 +182,7 @@ sub mainThread {
|
||||
}
|
||||
else
|
||||
{
|
||||
newCurve("", $str);
|
||||
newCurve("", $str, undef, $y2idx);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,11 +208,7 @@ sub mainThread {
|
||||
my $idx = $1;
|
||||
my $point = $2;
|
||||
|
||||
# if this curve index doesn't exist, create curve up-to this index
|
||||
while(!exists $curves[$idx])
|
||||
{
|
||||
newCurve("", "");
|
||||
}
|
||||
newCurve("", "", undef, $idx);
|
||||
|
||||
push @{$curves[$idx]}, [$xlast, $point];
|
||||
}
|
||||
@ -304,20 +300,43 @@ sub plotStoredData
|
||||
|
||||
sub newCurve()
|
||||
{
|
||||
my ($title, $opts, $newpoint) = @_;
|
||||
my ($title, $opts, $newpoint, $idx) = @_;
|
||||
|
||||
# if this curve index doesn't exist, create curve up-to this index
|
||||
if(defined $idx)
|
||||
{
|
||||
while(!exists $curves[$idx])
|
||||
{
|
||||
pushNewEmptyCurve();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# if we're not given an index, create a new one at the end, and fill it in
|
||||
pushNewEmptyCurve();
|
||||
$idx = $#curves;
|
||||
}
|
||||
|
||||
if($title) { $opts = "title \"$title\" $opts" }
|
||||
else { $opts = "notitle $opts" }
|
||||
|
||||
if( defined $newpoint )
|
||||
{
|
||||
push @curves, [" $opts", $newpoint];
|
||||
$curves[$idx] = [" $opts", $newpoint];
|
||||
}
|
||||
else
|
||||
{
|
||||
push @curves, [" $opts"];
|
||||
$curves[$idx] = [" $opts"];
|
||||
}
|
||||
}
|
||||
|
||||
sub pushNewEmptyCurve
|
||||
{
|
||||
my $opts = "notitle ";
|
||||
push @curves, [" $opts"];
|
||||
}
|
||||
|
||||
|
||||
sub usage {
|
||||
print "Usage: $0 <options>\n";
|
||||
print <<OEF;
|
||||
|
Loading…
Reference in New Issue
Block a user