[feedgnuplot] 01/05: the rangesizes are now precomputed and easily assessed

Dima Kogan dima at secretsauce.net
Fri Feb 7 07:20:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

dkogan-guest pushed a commit to branch debian
in repository feedgnuplot.

commit 5db86810b50ac52b4066e44120f4d1f541d9f8b8
Author: Dima Kogan <dima at secretsauce.net>
Date:   Thu Feb 6 23:07:39 2014 -0800

    the rangesizes are now precomputed and easily assessed
---
 bin/feedgnuplot | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/bin/feedgnuplot b/bin/feedgnuplot
index ea36bf9..d77d84f 100755
--- a/bin/feedgnuplot
+++ b/bin/feedgnuplot
@@ -202,6 +202,23 @@ sub interpretCommandline
     exit -1;
   }
 
+
+  # I now set up the rangesize to always be
+  #  $options{rangesize_hash}{$id} // $options{rangesize_default}
+  if ( $options{rangesizeall} )
+  {
+      $options{rangesize_default} = $options{rangesizeall};
+  }
+  else
+  {
+      $options{rangesize_default} = 1;
+
+      $options{rangesize_default} += $options{extraValuesPerPoint} if ($options{extraValuesPerPoint});
+      $options{rangesize_default}++                                if ($options{colormap});
+      $options{rangesize_default}++                                if ($options{circles} );
+  }
+
+
   # parse stream option. Allowed only numbers >= 0 or 'trigger'. After this code
   # $options{stream} is
   #  -1 for triggered replotting
@@ -434,19 +451,6 @@ sub makeDomainNumeric
 
 sub mainThread
 {
-    my $valuesPerPoint;
-    if( $options{rangesizeall} )
-    {
-        $valuesPerPoint = $options{rangesizeall};
-    }
-    else
-    {
-        $valuesPerPoint = 1;
-        if($options{extraValuesPerPoint}) { $valuesPerPoint += $options{extraValuesPerPoint}; }
-        if($options{colormap})            { $valuesPerPoint++; }
-        if($options{circles} )            { $valuesPerPoint++; }
-    }
-
     local *PIPE;
     my $dopersist = '';
 
@@ -720,8 +724,6 @@ sub mainThread
 
         while(@fields)
         {
-            my $rangesize = $valuesPerPoint;
-
             if($options{dataid})
             {
                 $id = shift @fields;
@@ -731,10 +733,10 @@ sub mainThread
                 $id++;
             }
 
-            if( $options{rangesize_hash}{$id} )
-            {
-                $rangesize = $options{rangesize_hash}{$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;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/feedgnuplot.git



More information about the debian-science-commits mailing list