]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
corrected handling of decimal addresses
authorhadaq@CountingHouse <hadaq@CountingHouse>
Sun, 13 Jul 2014 15:58:27 +0000 (17:58 +0200)
committerhadaq@CountingHouse <hadaq@CountingHouse>
Sun, 13 Jul 2014 15:58:40 +0000 (17:58 +0200)
tools/hadplot

index e077ad05498c434d6c2fb914bdee742033e3ea9b..0987a72b961a216dd6fd8993b4e09374f3b9d497 100755 (executable)
@@ -128,9 +128,19 @@ for(my $i=0;$i<16;$i++) {
   $fifomode->[$i]    = 0   unless defined $fifomode->[$i];
   }
 
+
+for(my $k = 0; $k < scalar @$address; $k++) {
+  if($address->[$k] =~ /^0x/) {
+    $address->[$k] = hex($address->[$k]);
+    }
+  if($register->[$k] =~ /^0x/) {
+    $register->[$k] = hex($register->[$k]);
+    }
+  }       
+  
 for(my $i=0;$i < scalar @{$address};$i++) {
   if(!defined($title->[$i])) {
-    $title->[$i] = hex($address->[$i])." $register->[$i] $regoffset->[$i]..".($regoffset->[$i]+$regwidth->[$i]-1);
+    $title->[$i] = "$address->[$i] $register->[$i] $regoffset->[$i]..".($regoffset->[$i]+$regwidth->[$i]-1);
     }
   }
 
@@ -142,11 +152,6 @@ if($style == 3) {$curvestyle="histo";      $xticks=1;}
 if($style == 4) {$curvestyle="histostacked";      $xticks=0;}
 if($style == 5) {$curvestyle="histostacked";      $xticks=1;}
 
-for(my $k = 0; $k < scalar @$address; $k++) {
-  $address->[$k] = hex($address->[$k]);
-  $register->[$k] = hex($register->[$k]);
-  }
-
 #Open Gnuplot
 our $fh;
 my $fn = "gnuplot -noraise -geometry $geom -bg 'ghost white'";