mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-06 06:21:16 +08:00
Initial implementation of --vnlog. Undocumented
This commit is contained in:
parent
f2ac9c91b8
commit
851eb46aa8
@ -104,7 +104,7 @@ sub interpretCommandline
|
|||||||
$options{rangesize} = [];
|
$options{rangesize} = [];
|
||||||
$options{tuplesize} = [];
|
$options{tuplesize} = [];
|
||||||
|
|
||||||
GetOptions(\%options, 'stream:s', 'domain!', 'dataid!', '3d!', 'colormap!', 'lines!', 'points!',
|
GetOptions(\%options, 'stream:s', 'domain!', 'dataid!', 'vnlog!', '3d!', 'colormap!', 'lines!', 'points!',
|
||||||
'circles', 'legend=s{2}', 'autolegend!', 'xlabel=s', 'ylabel=s', 'y2label=s', 'zlabel=s',
|
'circles', 'legend=s{2}', 'autolegend!', 'xlabel=s', 'ylabel=s', 'y2label=s', 'zlabel=s',
|
||||||
'title=s', 'xlen=f', 'ymin=f', 'ymax=f', 'xmin=s', 'xmax=s', 'y2min=f', 'y2max=f',
|
'title=s', 'xlen=f', 'ymin=f', 'ymax=f', 'xmin=s', 'xmax=s', 'y2min=f', 'y2max=f',
|
||||||
'zmin=f', 'zmax=f', 'y2=s@',
|
'zmin=f', 'zmax=f', 'y2=s@',
|
||||||
@ -157,6 +157,11 @@ sub interpretCommandline
|
|||||||
delete $options{with};
|
delete $options{with};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( $options{dataid} && $options{vnlog} )
|
||||||
|
{
|
||||||
|
print STDERR "--dataid and --vnlog are mutually exclusive. Please just use one.\n";
|
||||||
|
exit -1;
|
||||||
|
}
|
||||||
|
|
||||||
# expand options that are given as comma-separated lists
|
# expand options that are given as comma-separated lists
|
||||||
for my $listkey (qw(histogram y2))
|
for my $listkey (qw(histogram y2))
|
||||||
@ -788,6 +793,33 @@ sub mainThread
|
|||||||
# The domain of the current point
|
# The domain of the current point
|
||||||
my @domain;
|
my @domain;
|
||||||
|
|
||||||
|
# column headers from vnlog
|
||||||
|
my @vnlog_headers;
|
||||||
|
if($options{vnlog})
|
||||||
|
{
|
||||||
|
use lib '../../vnlog/lib';
|
||||||
|
use Vnlog::Parser;
|
||||||
|
use Vnlog::Util;
|
||||||
|
|
||||||
|
my $parser = Vnlog::Parser->new();
|
||||||
|
while (defined ($_ = Vnlog::Util::get_unbuffered_line(*STDIN)))
|
||||||
|
{
|
||||||
|
if ( !$parser->parse($_) )
|
||||||
|
{
|
||||||
|
die "";#"Reading '$filename': Error parsing vnlog line '$_': " . $parser->error();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $keys = $parser->getKeys();
|
||||||
|
if (defined $keys)
|
||||||
|
{
|
||||||
|
@vnlog_headers = @$keys;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# The x-axis domain represented as a number. This is exactly the same as
|
# The x-axis domain represented as a number. This is exactly the same as
|
||||||
# $domain[0] unless the x-axis domain uses a timefmt. Then this is the
|
# $domain[0] unless the x-axis domain uses a timefmt. Then this is the
|
||||||
# number of seconds since the UNIX epoch.
|
# number of seconds since the UNIX epoch.
|
||||||
@ -876,10 +908,11 @@ sub mainThread
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $id = -1;
|
my $id = -1;
|
||||||
|
my $i_curve = 0;
|
||||||
while(@fields)
|
while(@fields)
|
||||||
{
|
{
|
||||||
if ($options{dataid}) { $id = shift @fields; }
|
if ($options{dataid}) { $id = shift @fields; }
|
||||||
|
elsif($options{vnlog} ) { $id = $vnlog_headers[$i_curve]; }
|
||||||
else { $id++; }
|
else { $id++; }
|
||||||
|
|
||||||
my $rangesize = getRangeSize($id);
|
my $rangesize = getRangeSize($id);
|
||||||
@ -890,6 +923,8 @@ sub mainThread
|
|||||||
@domain,
|
@domain,
|
||||||
splice( @fields, 0, $rangesize ) ) . "\n",
|
splice( @fields, 0, $rangesize ) ) . "\n",
|
||||||
$domain0_numeric);
|
$domain0_numeric);
|
||||||
|
|
||||||
|
$i_curve++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user