From 505c23fab7a7eff684f8b3c27c08bcd15f10ba40 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Thu, 27 Oct 2016 19:31:14 +0200 Subject: [PATCH] Update Frankfurt test setup --- tools/HPlot.pm | 55 ++++++++++++++-------- users/frankfurt_test/dmon_config.pl | 39 +++++++++++++++ users/frankfurt_test/register_configgbe.db | 1 + users/frankfurt_test/startup.sh | 24 ++++++++-- 4 files changed, 95 insertions(+), 24 deletions(-) create mode 100644 users/frankfurt_test/dmon_config.pl diff --git a/tools/HPlot.pm b/tools/HPlot.pm index dd49f87..fd301fd 100755 --- a/tools/HPlot.pm +++ b/tools/HPlot.pm @@ -8,6 +8,7 @@ use Storable qw(lock_store lock_retrieve); my $p; my $storefile; +my $plotstring; use constant {TYPE_HISTORY => 1, TYPE_BARGRAPH => 2, TYPE_HEATMAP => 3}; @@ -19,7 +20,7 @@ my @color= ('#2222dd','#dd2222','#22dd22','#dd8822','#dd22dd','#22dddd','#dddd22 '#2222dd','#dd2222','#22dd22','#dd8822','#dd22dd','#22dddd','#dddd22','#8888dd','#8822bb','#444444'); sub plot_write { - my ($file,$str,$no) = @_; + my ($file,$str,$no,$save) = @_; return unless $str; if($no || 0) { print $file $str; @@ -29,6 +30,7 @@ sub plot_write { print $file $str."\n"; # print $str."\n"; } + if(defined $save) {$plotstring->{$save} .= $str;} } @@ -74,6 +76,7 @@ sub PlotInit { $p->{$name}->{colors} = $p->{$name}->{colors} || \@color; $p->{$name}->{showvalues} = $p->{$name}->{showvalues} || 0; $p->{$name}->{storable} = $p->{$name}->{storable} || 0; + $p->{$name}->{xticks} = $p->{$name}->{xticks} || 0; my $filename = $p->{$name}->{file}; $filename =~ s%/%%; @@ -138,26 +141,31 @@ sub PlotInit { plot_write($fh,"set xtics autofreq"); #$p->{$name}->{entries} plot_write($fh,"set grid"); # plot_write($fh,"set style fill solid 1.0"); - plot_write($fh,"plot ",1); + plot_write($fh,"plot ",1,$name); for(my $j=0; $j<$p->{$name}->{curves};$j++) { if($p->{$name}->{fill}) { - plot_write($fh,"'-' using 1:2 with filledcurves x1 lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1); + plot_write($fh,"'-' using 1:2 with filledcurves x1 lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1,$name); } elsif($p->{$name}->{dots}) { - plot_write($fh,"'-' using 1:2 with points pointsize 0.6 pointtype 2 lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1); + plot_write($fh,"'-' using 1:2 with points pointsize 0.6 pointtype 2 lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1,$name); } else { - plot_write($fh,"'-' using 1:2 with lines lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1); + plot_write($fh,"'-' using 1:2 with lines lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1,$name); } - plot_write($fh,', ',1) unless ($j+1==$p->{$name}->{curves}); + plot_write($fh,', ',1,$name) unless ($j+1==$p->{$name}->{curves}); } - plot_write($fh," "); + plot_write($fh," ",0,$name); } elsif($p->{$name}->{type} == TYPE_BARGRAPH) { plot_write($fh,"set style fill solid 1.00 border -1"); plot_write($fh,"set grid noxtics ytics"); plot_write($fh,"set boxwidth ".($p->{$name}->{curvewidth}||4)." absolute"); plot_write($fh,"set style histogram gap ".($p->{$name}->{bargap}||1)); + + if($p->{$name}->{xticks}) { + plot_write("set xtics rotate by 90 offset .7,-1.7 scale .7 "); + } + if(defined $p->{$name}->{bartitle} && scalar @{$p->{$name}->{bartitle}}) { plot_write($fh,"set xtics (",1); for(my $j=0; $j{$name}->{bartitle}};$j++) { @@ -168,12 +176,14 @@ sub PlotInit { } plot_write($fh,"set style histogram title offset character 0, 0, 0"); plot_write($fh,"set style data histograms"); - plot_write($fh,"plot ",1); + plot_write($fh,"plot ",1,$name); for(my $j=0; $j<$p->{$name}->{curves};$j++) { - plot_write($fh,', ',1) if $j; - plot_write($fh,"'-' lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1); + plot_write($fh,', ',1,$name) if $j; + plot_write($fh,"'-'",1,$name); + plot_write($fh,"using 2:xticlabels(1) ",1,$name) if ($p->{$name}->{xticks}); + plot_write($fh, "lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1,$name); } - plot_write($fh," "); + plot_write($fh," ",0,$name); } elsif($p->{$name}->{type} == TYPE_HEATMAP) { plot_write($fh,"set view map"); @@ -184,10 +194,10 @@ sub PlotInit { plot_write($fh,"set palette rgbformulae 22,13,-31"); } if ($p->{$name}->{showvalues} == 0) { - plot_write($fh,"splot '-' matrix with image"); + plot_write($fh,"splot '-' matrix with image",0,$name); } else { - plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)) with labels tc rgb \"#ffffff\" font ',10'"); + plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)) with labels tc rgb \"#ffffff\" font ',10'",0,$name); # plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)):3 with labels tc palette font ',10'"); } } @@ -206,17 +216,18 @@ sub PlotDraw { if($p->{$name}->{run}>=1) { plot_write($p->{$name}->{fh},"set out \"".$p->{$name}->{file}.($p->{$name}->{buffer}?"tmp":"").".png\""); plot_write($p->{$name}->{fh},makeTimeString()); - plot_write($p->{$name}->{fh},"replot"); + plot_write($p->{$name}->{fh},$plotstring->{$name}); } if($p->{$name}->{type} == TYPE_HISTORY) { + my $realentries = $p->{$name}{limitentries} || $p->{$name}->{entries}; for(my $j=0; $j<$p->{$name}->{curves}; $j++) { - for(my $i=0; $i< $p->{$name}->{entries}; $i++) { + for(my $i=$p->{$name}->{entries}-$realentries; $i< $p->{$name}->{entries}; $i++) { if ($p->{$name}->{countup}) { - plot_write($p->{$name}->{fh},($i/$p->{$name}->{xscale})." ".$p->{$name}->{value}->[$j]->[$i]); + plot_write($p->{$name}->{fh},(($i-($p->{$name}->{entries}-$realentries))/$p->{$name}->{xscale})." ".$p->{$name}->{value}->[$j]->[$i]); } else { - plot_write($p->{$name}->{fh},(($i-$p->{$name}->{entries})/($p->{$name}->{xscale}||1))." ".($p->{$name}->{value}->[$j]->[$i]||0)); + plot_write($p->{$name}->{fh},(($i-$realentries)/($p->{$name}->{xscale}||1))." ".($p->{$name}->{value}->[$j]->[$i]||0)); } } plot_write($p->{$name}->{fh},"e"); @@ -225,8 +236,9 @@ sub PlotDraw { if($p->{$name}->{type} == TYPE_BARGRAPH) { + my $realentries = $p->{$name}{limitentries} || $p->{$name}->{entries}; for(my $j=0; $j<$p->{$name}->{curves}; $j++) { - for(my $i=0; $i< $p->{$name}->{entries}; $i++) { + for(my $i=$p->{$name}->{entries}-$realentries; $i< $p->{$name}->{entries}; $i++) { plot_write($p->{$name}->{fh},' '.$p->{$name}->{value}->[$j]->[$i]); } plot_write($p->{$name}->{fh},"e"); @@ -281,5 +293,10 @@ sub PlotFill { $p->{$name}->{value}->[$curve]->[$slot] = $value||0; } - +sub PlotLimitEntries { + my($name,$entries) = @_; + $p->{$name}{limitentries} = $entries; + } + + 1; diff --git a/users/frankfurt_test/dmon_config.pl b/users/frankfurt_test/dmon_config.pl new file mode 100644 index 0000000..94ee19f --- /dev/null +++ b/users/frankfurt_test/dmon_config.pl @@ -0,0 +1,39 @@ +#This a an example configuration file. Copy this file to your user directory and give +#start.pl a link to this file as first argument. + +#Scripts to start & order of icons in the Overview +activeScripts => [['time','ping','-','-','daqop'], + ['numfee','temperature','reftime','',''], + ['','','-','',''], + ['trgrate','datarate','deadtime','-','-'], + ['adcvolt','adccurr','','',''], + ['','','','-','-']], + +#Names to be shown in left column of Overview (max 4 letters!) +qaNames => ['sys','main','beam','rate','pwr','-','-'], + +#Expected number of FPGAs in system +NumberOfFpga => 10, + +#The address of the individual boards +CtsAddress => 0xc000, + +HubTrbAdresses => [0xfffe], + + +#Addresses of all TDCs. Either single or broadcast addresses +TdcAddress => [0xfe51], + +#ADC voltage monitoring +AdcCombinerAddress => [0xfe52], +AdcDiRichAddress => [0xfe51], +AdcTrb3sc => [0xfe61], + +#IPs of all devices which should react on a ping +TrbIP => ['192.168.0.247'], + + +#User directory +UserDirectory => '/home/hadaq/trbsoft/daqtools/users/frankfurt_test/', +# PowerSupScript => 'measure_powers.sh' # relative to user dir + diff --git a/users/frankfurt_test/register_configgbe.db b/users/frankfurt_test/register_configgbe.db index bcf59e5..b581eec 100755 --- a/users/frankfurt_test/register_configgbe.db +++ b/users/frankfurt_test/register_configgbe.db @@ -20,5 +20,6 @@ 0x8820 0 0x8200 0x00020001 0x00030062 0xFDE8 0x578 1 0 0 0xffffff 0x7 0xf3ce 0 0x8200 0x00020001 0x00030062 0xFDE8 0x578 1 0 0 0xffffff 0x7 0xc000 0 0x8000 0x00020001 0x00030062 0xFDE8 0x578 1 0 0 0xffffff 0x7 + 0xc148 0 0xc148 0x00020001 0x00030062 0xFDE8 0x578 1 0 0 0xffffff 0x7 diff --git a/users/frankfurt_test/startup.sh b/users/frankfurt_test/startup.sh index cfcdfe3..a6a00e3 100755 --- a/users/frankfurt_test/startup.sh +++ b/users/frankfurt_test/startup.sh @@ -30,28 +30,42 @@ trbcmd s 0x9400000313233728 0x01 0x5821 trbcmd s 0x4e000003131c0328 0x02 0x5822 trbcmd s 0xa0000003133cae28 0x03 0x5823 +#148 +trbcmd s 0x250000070ef43028 0x05 0xc148 +trbcmd s 0xed0000070ee63128 0x01 0x0481 +trbcmd s 0x4e0000070ef49128 0x00 0x0480 +trbcmd s 0x790000070ef49028 0x02 0x0482 +trbcmd s 0x270000070ef42328 0x03 0x0483 + +#Dirich +trbcmd s 0x58000007125dbc28 0x01 0xf3d2 + +#ADC AddOn +trbcmd s 0x7a0000050df02428 0x01 0xf4cc + echo "Hubs" trbcmd w 0xfffe 0xc5 0x50ff trbcmd w 0xfc00 0xc5 0x50ff -trbcmd w 0x8000 0xc0 0x0fef -trbcmd w 0x8000 0xc1 0x0fef +#trbcmd w 0x8000 0xc0 0x0fef +#trbcmd w 0x8000 0xc1 0x0fef ../../tools/loadregisterdb.pl register_configgbe.db ../../tools/loadregisterdb.pl register_configgbe_ip.db echo "cts" -trbcmd w 0x8000 0xa150 1000000 +trbcmd w 0xc000 0xa156 1000000 +trbcmd w 0xc148 0xa150 1000000 echo "tdc" trbcmd w 0xfe48 0xc801 0x000f0000 trbcmd w 0xfe4e 0xc801 0x000f0000 -trbcmd w 0x8000 0xc801 0x000f0000 +#trbcmd w 0x8000 0xc801 0x000f0000 trbcmd w 0xfe48 0xc804 0x00000040 trbcmd w 0xfe4e 0xc804 0x00000040 -trbcmd w 0x8000 0xc804 0x00000010 +#trbcmd w 0x8000 0xc804 0x00000010 -- 2.43.0