mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-05 22:11:12 +08:00
removed unneeded if()
This looks like a large patch, but it's 99% re-indentation
This commit is contained in:
parent
4cfcf0fc35
commit
42a8218fbe
153
bin/feedgnuplot
153
bin/feedgnuplot
@ -657,96 +657,93 @@ sub mainThread
|
|||||||
last if /^exit/o;
|
last if /^exit/o;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! /^replot/o)
|
# parse the incoming data lines. The format is
|
||||||
|
# x id0 dat0 id1 dat1 ....
|
||||||
|
# where idX is the ID of the curve that datX corresponds to
|
||||||
|
#
|
||||||
|
# $options{domain} indicates whether the initial 'x' is given or not (if not, the line
|
||||||
|
# number is used)
|
||||||
|
# $options{dataid} indicates whether idX is given or not (if not, the point order in the
|
||||||
|
# line is used)
|
||||||
|
# 3d plots require $options{domain}, and dictate "x y" for the domain instead of just "x"
|
||||||
|
|
||||||
|
my @fields = split;
|
||||||
|
|
||||||
|
if($options{domain})
|
||||||
{
|
{
|
||||||
# parse the incoming data lines. The format is
|
if( $options{timefmt} )
|
||||||
# x id0 dat0 id1 dat1 ....
|
|
||||||
# where idX is the ID of the curve that datX corresponds to
|
|
||||||
#
|
|
||||||
# $options{domain} indicates whether the initial 'x' is given or not (if not, the line
|
|
||||||
# number is used)
|
|
||||||
# $options{dataid} indicates whether idX is given or not (if not, the point order in the
|
|
||||||
# line is used)
|
|
||||||
# 3d plots require $options{domain}, and dictate "x y" for the domain instead of just "x"
|
|
||||||
|
|
||||||
my @fields = split;
|
|
||||||
|
|
||||||
if($options{domain})
|
|
||||||
{
|
{
|
||||||
if( $options{timefmt} )
|
# no point if doing anything unless I have at least the domain and
|
||||||
{
|
# 1 piece of data
|
||||||
# no point if doing anything unless I have at least the domain and
|
next if @fields < $options{timefmt_Ncols}+1;
|
||||||
# 1 piece of data
|
|
||||||
next if @fields < $options{timefmt_Ncols}+1;
|
|
||||||
|
|
||||||
$domain[0] = join (' ', splice( @fields, 0, $options{timefmt_Ncols}) );
|
$domain[0] = join (' ', splice( @fields, 0, $options{timefmt_Ncols}) );
|
||||||
$domain0_numeric = makeDomainNumeric( $domain[0] );
|
$domain0_numeric = makeDomainNumeric( $domain[0] );
|
||||||
}
|
}
|
||||||
elsif(!$options{'3d'})
|
elsif(!$options{'3d'})
|
||||||
{
|
{
|
||||||
# no point if doing anything unless I have at least the domain and
|
# no point if doing anything unless I have at least the domain and
|
||||||
# 1 piece of data
|
# 1 piece of data
|
||||||
next if @fields < 1+1;
|
next if @fields < 1+1;
|
||||||
|
|
||||||
$domain[0] = $domain0_numeric = shift @fields;
|
$domain[0] = $domain0_numeric = shift @fields;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
# no point if doing anything unless I have at least the domain and
|
|
||||||
# 1 piece of data
|
|
||||||
next if @fields < 2+1;
|
|
||||||
|
|
||||||
@domain = splice(@fields, 0, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( $options{monotonic} )
|
|
||||||
{
|
|
||||||
if( defined $latestX && $domain0_numeric < $latestX )
|
|
||||||
{
|
|
||||||
# the x-coordinate of the new point is in the past, so I wipe out
|
|
||||||
# all the data and start anew. Before I wipe the old data, I
|
|
||||||
# replot the old data
|
|
||||||
replot( $domain0_numeric );
|
|
||||||
clearCurves();
|
|
||||||
$latestX = undef;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ $latestX = $domain0_numeric; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$domain[0] = $.;
|
# no point if doing anything unless I have at least the domain and
|
||||||
$domain0_numeric = makeDomainNumeric( $domain[0] );
|
# 1 piece of data
|
||||||
|
next if @fields < 2+1;
|
||||||
|
|
||||||
|
@domain = splice(@fields, 0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $id = -1;
|
if( $options{monotonic} )
|
||||||
|
|
||||||
while(@fields)
|
|
||||||
{
|
{
|
||||||
if($options{dataid})
|
if( defined $latestX && $domain0_numeric < $latestX )
|
||||||
{
|
{
|
||||||
$id = shift @fields;
|
# the x-coordinate of the new point is in the past, so I wipe out
|
||||||
}
|
# all the data and start anew. Before I wipe the old data, I
|
||||||
else
|
# replot the old data
|
||||||
{
|
replot( $domain0_numeric );
|
||||||
$id++;
|
clearCurves();
|
||||||
}
|
$latestX = undef;
|
||||||
|
}
|
||||||
# I'd like to use //, but I guess some people are still on perl 5.8
|
else
|
||||||
my $rangesize = exists $options{rangesize_hash}{$id} ?
|
{ $latestX = $domain0_numeric; }
|
||||||
$options{rangesize_hash}{$id} :
|
|
||||||
$options{rangesize_default};
|
|
||||||
|
|
||||||
last if @fields < $rangesize;
|
|
||||||
|
|
||||||
pushPoint(getCurve($id),
|
|
||||||
join(' ',
|
|
||||||
@domain,
|
|
||||||
splice( @fields, 0, $rangesize ) ) . "\n",
|
|
||||||
$domain0_numeric);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$domain[0] = $.;
|
||||||
|
$domain0_numeric = makeDomainNumeric( $domain[0] );
|
||||||
|
}
|
||||||
|
|
||||||
|
my $id = -1;
|
||||||
|
|
||||||
|
while(@fields)
|
||||||
|
{
|
||||||
|
if($options{dataid})
|
||||||
|
{
|
||||||
|
$id = shift @fields;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$id++;
|
||||||
|
}
|
||||||
|
|
||||||
|
# I'd like to use //, but I guess some people are still on perl 5.8
|
||||||
|
my $rangesize = exists $options{rangesize_hash}{$id} ?
|
||||||
|
$options{rangesize_hash}{$id} :
|
||||||
|
$options{rangesize_default};
|
||||||
|
|
||||||
|
last if @fields < $rangesize;
|
||||||
|
|
||||||
|
pushPoint(getCurve($id),
|
||||||
|
join(' ',
|
||||||
|
@domain,
|
||||||
|
splice( @fields, 0, $rangesize ) ) . "\n",
|
||||||
|
$domain0_numeric);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# finished reading in all. Plot what we have
|
# finished reading in all. Plot what we have
|
||||||
|
Loading…
Reference in New Issue
Block a user