[SCM] Feedgnuplot. Pipe-oriented frontend to Gnuplot. branch, debian, updated. debian/1.24-2-3-g854a045

Dima Kogan dima at secretsauce.net
Sat Jun 15 08:26:08 UTC 2013


The following commit has been merged in the debian branch:
commit b7965cac2eb5b6c212dab7e313cf21ddebe3aac8
Author: Dima Kogan <dima at secretsauce.net>
Date:   Fri Jun 14 23:20:17 2013 -0700

    cleared up --stream option logic
    
    - minor refactoring
    - --hardcopy and --stream together now generate a warning and turn off --stream

diff --git a/bin/feedgnuplot b/bin/feedgnuplot
index 091be88..dd13c41 100755
--- a/bin/feedgnuplot
+++ b/bin/feedgnuplot
@@ -34,18 +34,14 @@ my $dataQueue;
 my $latestX;
 
 my $streamingFinished : shared = undef;
+
 if($options{stream})
 {
-  if( $options{hardcopy})
-  {
-    $options{stream} = undef;
-  }
-
   $dataQueue  = Thread::Queue->new();
   my $addThr  = threads->create(\&mainThread);
 
   # spawn the plot updating thread. If I'm replotting from a data trigger, I don't need this
-  my $plotThr = threads->create(\&plotUpdateThread) unless $options{stream} < 0;
+  my $plotThr = threads->create(\&plotUpdateThread) if $options{stream} > 0;
 
   while(<>)
   {
@@ -155,14 +151,21 @@ sub interpretCommandline
     }
   }
 
-  # parse stream option. Allowed only numbers >= 0 or 'trigger'
+  if ( defined $options->{hardcopy} && defined $options->{stream} )
+  {
+    print STDERR "Warning: since we're making a hardcopy, I'm disabling streaming\n";
+    delete $options->{stream};
+  }
+
+  # parse stream option. Allowed only numbers >= 0 or 'trigger'. After this code
+  # $options->{stream} is
+  #  -1 for triggered replotting
+  #  >0 for timed replotting
+  #  undef if not streaming
   if(defined $options->{stream})
   {
-    if ( $options->{stream} eq '')
-    {
-      # if no streaming period is given, default to 1Hz.
-      $options->{stream} = 1;
-    }
+    # if no streaming period is given, default to 1Hz.
+    $options->{stream} = 1 if $options->{stream} eq '';
 
     if( !looks_like_number $options->{stream} )
     {
@@ -969,7 +972,7 @@ As an example, if line 3 of the input is "0 9 1 20"
   --stream [period]    Plot the data as it comes in, in realtime. If period is given,
                        replot every period seconds. If no period is given, replot at
                        1Hz. If the period is given as 0 or 'trigger', replot ONLY when
-                       the incoming data dictates this . See the "Real-time streaming
+                       the incoming data dictates this. See the "Real-time streaming
                        data" section of the man page.
 
   --[no]lines          Do [not] draw lines to connect consecutive points

-- 
Feedgnuplot. Pipe-oriented frontend to Gnuplot.



More information about the debian-science-commits mailing list