mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-06 06:21:16 +08:00
getRangeSize() function added to ocnsolidate that logic
This commit is contained in:
parent
888583abe9
commit
a48b834512
@ -57,6 +57,17 @@ mainThread();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sub getRangeSize
|
||||||
|
{
|
||||||
|
my ($id) = @_;
|
||||||
|
|
||||||
|
# I'd like to use //, but I guess some people are still on perl 5.8
|
||||||
|
return
|
||||||
|
exists $options{rangesize_hash}{$id} ?
|
||||||
|
$options{rangesize_hash}{$id} :
|
||||||
|
$options{rangesize_default};
|
||||||
|
}
|
||||||
|
|
||||||
sub interpretCommandline
|
sub interpretCommandline
|
||||||
{
|
{
|
||||||
# if I'm using a self-plotting data file with a #! line, then $ARGV[0] will contain ALL of the
|
# if I'm using a self-plotting data file with a #! line, then $ARGV[0] will contain ALL of the
|
||||||
@ -222,7 +233,10 @@ sub interpretCommandline
|
|||||||
|
|
||||||
|
|
||||||
# I now set up the rangesize to always be
|
# I now set up the rangesize to always be
|
||||||
# $options{rangesize_hash}{$id} // $options{rangesize_default}
|
#
|
||||||
|
# $options{rangesize_hash}{$id} // $options{rangesize_default}
|
||||||
|
#
|
||||||
|
# which is available as getRangeSize($id)
|
||||||
if ( $options{rangesizeall} )
|
if ( $options{rangesizeall} )
|
||||||
{
|
{
|
||||||
$options{rangesize_default} = $options{rangesizeall};
|
$options{rangesize_default} = $options{rangesizeall};
|
||||||
@ -749,20 +763,10 @@ sub mainThread
|
|||||||
|
|
||||||
while(@fields)
|
while(@fields)
|
||||||
{
|
{
|
||||||
if($options{dataid})
|
if($options{dataid}) { $id = shift @fields; }
|
||||||
{
|
else { $id++; }
|
||||||
$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};
|
|
||||||
|
|
||||||
|
my $rangesize = getRangeSize($id);
|
||||||
last if @fields < $rangesize;
|
last if @fields < $rangesize;
|
||||||
|
|
||||||
pushPoint(getCurve($id),
|
pushPoint(getCurve($id),
|
||||||
@ -886,12 +890,7 @@ sub updateCurveOptions
|
|||||||
# as 1 + rangesize). I also need to start the range at the first column
|
# as 1 + rangesize). I also need to start the range at the first column
|
||||||
# past the timefmt
|
# past the timefmt
|
||||||
|
|
||||||
# I'd like to use //, but I guess some people are still on perl 5.8
|
my @rest = map {$_ + $options{timefmt_Ncols}} (1..getRangeSize($id));
|
||||||
my $rangesize = exists $options{rangesize_hash}{$id} ?
|
|
||||||
$options{rangesize_hash}{$id} :
|
|
||||||
$options{rangesize_default};
|
|
||||||
|
|
||||||
my @rest = map {$_ + $options{timefmt_Ncols}} (1..$rangesize);
|
|
||||||
|
|
||||||
$usingoptions = "using 1:" . join(':', @rest);
|
$usingoptions = "using 1:" . join(':', @rest);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user