]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
HPlot update for heatmaps
authorJan Michel <jan@mueschelsoft.de>
Fri, 8 Jun 2018 18:03:49 +0000 (20:03 +0200)
committerJan Michel <jan@mueschelsoft.de>
Fri, 8 Jun 2018 18:03:49 +0000 (20:03 +0200)
hmon/HPlot.pm

index 114f40b733645bfdaf3e8aba6d731aa1f6053bd5..0d8124f77abba8301ca9720a10ed48f6eae122b6 100755 (executable)
@@ -83,12 +83,13 @@ sub PlotInit {
   $filename =~ s%/%%;
   $storefile->{$name} = "/dev/shm/".$name.'-'.$p->{$name}->{curves}.'-'.$p->{$name}->{entries}.'-'.$filename.'.store';
 
-
-  foreach my $i (0..($c->{entries}-1)) {
-    for my $j (0..($c->{curves}-1)) {
-      push(@{$p->{$name}->{value}->[$j]},0) ;
+  unless ($p->{$name}{noinit}) {
+    foreach my $i (0..($c->{entries}-1)) {
+      for my $j (0..($c->{curves}-1)) {
+        push(@{$p->{$name}->{value}->[$j]},0) ;
+        }
       }
-    }
+    }  
 
   if($p->{$name}->{storable}) {
     if (-e $storefile->{$name}) {
@@ -194,7 +195,7 @@ sub PlotInit {
     plot_write($fh,"set palette rgbformulae 22,13,-31");
     if ($p->{$name}->{showvalues} == 0) {
       #plot_write($fh,"splot '-' matrix with image");
-      $p->{$name}->{plot_string} .= "splot '-' matrix with image \n"
+      $p->{$name}->{plot_string} .= "plot '-' matrix with image \n"
     }
     else {
       #plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)) with labels tc rgb \"#ffffff\" font ',10'");
@@ -251,21 +252,22 @@ sub PlotDraw {
   if($p->{$name}->{type} == TYPE_HEATMAP) {
       for(my $j=0; $j<$p->{$name}->{curves}; $j++) {
         for(my $i=0; $i< $p->{$name}->{entries}; $i++) {
-          plot_write($p->{$name}->{fh},($p->{$name}->{value}->[$j]->[$i]||0)." ",1);
+          plot_write($p->{$name}->{fh},($p->{$name}->{value}->[$j]->[$i]//"NaN")." ",1);
           }
         plot_write($p->{$name}->{fh}," ",0);
         }
       plot_write($p->{$name}->{fh},"e");
       plot_write($p->{$name}->{fh},"e");
-
-      for(my $j=0; $j<$p->{$name}->{curves}; $j++) {
-        for(my $i=0; $i< $p->{$name}->{entries}; $i++) {
-          plot_write($p->{$name}->{fh},($p->{$name}->{value}->[$j]->[$i]||0)." ",1);
+      if ($p->{$name}{showvalues}) {
+        for(my $j=0; $j<$p->{$name}->{curves}; $j++) {
+          for(my $i=0; $i< $p->{$name}->{entries}; $i++) {
+            plot_write($p->{$name}->{fh},($p->{$name}->{value}->[$j]->[$i]||0)." ",1);
+            }
+          plot_write($p->{$name}->{fh}," ",0);
           }
-        plot_write($p->{$name}->{fh}," ",0);
+        plot_write($p->{$name}->{fh},"e");
+        plot_write($p->{$name}->{fh},"e");
         }
-      plot_write($p->{$name}->{fh},"e");
-      plot_write($p->{$name}->{fh},"e");
 
     }