]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
add fix for differential fifo mode
authorhadaq <hadaq@hades33.gsi.de>
Sun, 31 May 2020 05:20:03 +0000 (07:20 +0200)
committerhadaq <hadaq@hades33.gsi.de>
Wed, 5 Aug 2020 12:37:44 +0000 (14:37 +0200)
tools/hadplot

index ca130e37c504b4a40e9bebe77b3cd5bf96ac1610..78ab050f532319f844d61da895b8fa62bf9a5870 100755 (executable)
@@ -573,6 +573,7 @@ Options:
   -m regamount    Number of consecutive registers to show
   -z style        Selects one of the possible styles (deprecated)
   -t title        Name of the curve shown in key
+  -f fifomode
   -output         expects a string "(PNG|SVG).\$filename.\$xsize.\$ysize" to write to a file
   -windowname     Name of window (shown in titlebar after "Hadplot - "
   -timeref        In a differential plot, the endpoint with this addressis used for timestamping
@@ -775,6 +776,7 @@ sub genreg {
         $c = trb_register_read_mem(($address->[$i]),($register->[$i]),$fifomode->[$i],$regamount->[$i]) or die trb_strerror();
         }
       foreach my $s (sort keys %$c) {
+        my $lasttmp;
         for(my $r = 0; $r < scalar @{$c->{$s}};$r++) {
           my $tmp = ($c->{$s}->[$r]>>$regoffset->[$i])&(2**$regwidth->[$i]-1);
           my $val = $tmp;
@@ -782,7 +784,13 @@ sub genreg {
           my $reg = $register->[$i]+$r;
 
           if($ydiff) {
-            if(defined $oldvals{$i}->{$board.$reg}) {
+            if ($fifomode->[$i]) {
+              $val = $tmp - $lasttmp;
+              $val +=  2**$regwidth->[$i] if $val < 0;
+             $lasttmp = $tmp;
+              next if $r == 0;
+              }
+            elsif(defined $oldvals{$i}->{$board.$reg}) {
               if ($oldvals{$i}->{$board.$reg} > $tmp) {
                 $val = $tmp - $oldvals{$i}->{$board.$reg} + 2**$regwidth->[$i];
                 }