From c217ceadbda4c92c63a1d7fbe8042f1ec11e5626 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20A=2E=20Holm?= Date: Fri, 13 Mar 2009 07:42:37 +0100 Subject: [PATCH] =?utf8?q?*=20/trunk/vg=20=20=20La=20inn=20=C2=AB-2/--2d?= =?utf8?q?=C2=BB-valget.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 21d3979e-0f9a-11de-8f3a-000475e441b9 git-svn-id: svn+ssh://svnhost/utils@3080 ddca7c6a-6bd8-0310-abd8-a0f6a7c394c1 --- vg | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/vg b/vg index e6ebb0e..68bb8f1 100755 --- a/vg +++ b/vg @@ -24,6 +24,7 @@ our $Debug = 0; our %Opt = ( + '2d' => 0, 'debug' => 0, 'help' => 0, 'time' => 0, @@ -45,6 +46,7 @@ my @cmdl = @ARGV; Getopt::Long::Configure("bundling"); GetOptions( + "2d|2" => \$Opt{'2d'}, "debug" => \$Opt{'debug'}, "help|h" => \$Opt{'help'}, "time|t" => \$Opt{'time'}, @@ -60,6 +62,8 @@ if ($Opt{'version'}) { exit(0); } +($Opt{'2d'} && $Opt{'time'}) && die("$progname: Cannot mix --2d and --time options\n"); + my $cmdl_str = join(" ", @cmdl); if ($Opt{'time'}) { @@ -81,6 +85,22 @@ pause -1 "Trykk Enter..." END close(FP); system("gnuplot -persist $cmd_file"); +} elsif ($Opt{'2d'}) { + my $dat_file = "/tmp/vg-2.tmp"; + open(FP, ">$dat_file") || die("$progname: $dat_file: Cannot open file for write: $!\n"); + my @gpst_array = ("gpst", "-o", "clean", "-rp", "-d", "-t", @ARGV, "|", "rmspcall", "|", "uniq"); + print(FP `@gpst_array`); + close(FP); + my $cmd_file = "/tmp/vg-2-cmd.tmp"; + open(FP, ">$cmd_file") || die("$progname: $cmd_file: Cannot open file for write: $!\n"); + print(FP <$dat_file") || die("$progname: $dat_file: Cannot open file for write: $!\n"); @@ -121,6 +141,9 @@ Usage: $progname [options] [file [files [...]]] Options: + -2, --2d + Create 2D plot instead of 3D. Bigger window by default in gnuplot, + and it’s faster when plotting lots of data. -h, --help Show this help. -t, --time -- 2.11.4.GIT