From e05c79ee35c914aa7bd359fc5da235efd4d570d0 Mon Sep 17 00:00:00 2001 From: Michael Traxler Date: Tue, 4 Nov 2014 11:11:46 +0100 Subject: [PATCH] some bugfixes to dmon scripts --- dmon/code/Dmon.pm | 3 ++- dmon/scripts/dmon_cbmnetsync.pl | 3 ++- dmon/scripts/dmon_heatmaprich.pl | 5 +++-- dmon/scripts/dmon_trgrate.pl | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dmon/code/Dmon.pm b/dmon/code/Dmon.pm index be39057..6ee69ce 100644 --- a/dmon/code/Dmon.pm +++ b/dmon/code/Dmon.pm @@ -34,7 +34,8 @@ my $OldValues; my $firstrun = 1; sub MakeRate { my ($pos,$width,$usets,$t) = @_; my $res; - + return unless defined $t; + foreach my $b (keys $t) { for my $i (0..((scalar @{$t->{$b}{value}})-1)) { my $value = $t->{$b}{value}[$i]||0; diff --git a/dmon/scripts/dmon_cbmnetsync.pl b/dmon/scripts/dmon_cbmnetsync.pl index ce85610..1e9ea26 100755 --- a/dmon/scripts/dmon_cbmnetsync.pl +++ b/dmon/scripts/dmon_cbmnetsync.pl @@ -22,7 +22,8 @@ while(1) { if( defined $regs->{$config{CtsAddress}}) { my $linkActive = $regs->{$config{CtsAddress}}[0] & 0x20; - my $pulserFreqKHz = 125e3 / $regs->{$config{CtsAddress}}[1]; + my $pulserFreqKHz = $regs->{$config{CtsAddress}}[1] | 0; + $pulserFreqKHz = 125e3 / ($regs->{$config{CtsAddress}}[1]) if $regs->{$config{CtsAddress}}[1]; $dlmCnt = $linkActive ? $regs->{$config{CtsAddress}}[0xa] : -1; $value = "$dlmCnt DLMs"; diff --git a/dmon/scripts/dmon_heatmaprich.pl b/dmon/scripts/dmon_heatmaprich.pl index e8f4380..e25c9ee 100755 --- a/dmon/scripts/dmon_heatmaprich.pl +++ b/dmon/scripts/dmon_heatmaprich.pl @@ -20,7 +20,7 @@ my %config = Dmon::StartUp(); my $plot2 = (); $plot2->{name} = "HeatmapRich"; -$plot2->{file} = Dmon::DMONDIR."heatmaprich"; +$plot2->{file} = Dmon::DMONDIR."HeatmapRich"; $plot2->{entries} = 33; $plot2->{curves} = 33; $plot2->{type} = HPlot::TYPE_HEATMAP; @@ -34,7 +34,7 @@ $plot2->{xmin} = 0.5; $plot2->{xmax} = 32.5; $plot2->{ymin} = 0.5; $plot2->{ymax} = 32.5; -$plot2->{showvalues} = 1; +$plot2->{showvalues} = 0; $plot2->{xlabel} = "column"; $plot2->{ylabel} = "row"; HPlot::PlotInit($plot2); @@ -54,6 +54,7 @@ my $diff; while (1) { my $t = trb_register_read_mem(0xfe48,0xc000,0,33); + if (defined $old) { foreach my $b (keys %$o) { for my $v (0..32) { diff --git a/dmon/scripts/dmon_trgrate.pl b/dmon/scripts/dmon_trgrate.pl index 8a564dd..e05099b 100755 --- a/dmon/scripts/dmon_trgrate.pl +++ b/dmon/scripts/dmon_trgrate.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +M#!/usr/bin/perl -w use warnings; use POSIX qw(strftime); @@ -40,7 +40,8 @@ Dmon::WriteFile("TriggerRate",$str); while(1) { my $r = trb_registertime_read($config{CtsAddress},0xa002) ; - my $t = Dmon::MakeRate(0,32,1,$r); + my $t; + $t = Dmon::MakeRate(0,32,1,$r) if( defined $r ); if( defined $t) { $summing += $t->{$config{CtsAddress}}{rate}[0]; -- 2.43.0