From 1509696f8cef644fe449a76f64f2c0a5ec2454de Mon Sep 17 00:00:00 2001 From: "hadaq@CountingHouse" Date: Sun, 13 Jul 2014 17:58:27 +0200 Subject: [PATCH] corrected handling of decimal addresses --- tools/hadplot | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/hadplot b/tools/hadplot index e077ad0..0987a72 100755 --- a/tools/hadplot +++ b/tools/hadplot @@ -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'"; -- 2.43.0