]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Update Frankfurt test setup
authorJan Michel <j.michel@gsi.de>
Thu, 27 Oct 2016 17:31:14 +0000 (19:31 +0200)
committerJan Michel <j.michel@gsi.de>
Thu, 27 Oct 2016 17:31:14 +0000 (19:31 +0200)
tools/HPlot.pm
users/frankfurt_test/dmon_config.pl [new file with mode: 0644]
users/frankfurt_test/register_configgbe.db
users/frankfurt_test/startup.sh

index dd49f877448dd50d7357e16771b9217d733078e9..fd301fde030b806322265ae18591948f1ed4ca14 100755 (executable)
@@ -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<scalar @{$p->{$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 (file)
index 0000000..94ee19f
--- /dev/null
@@ -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
+
index bcf59e5319deeb71119f45e89e2809e44897e13b..b581eecd431cab6f8b207e1a117ceb0587f8d1fe 100755 (executable)
@@ -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 
 
 
index cfcdfe3f5366c7d31f9b0ec539cd72fc0d796414..a6a00e3ea9cd0f8bc005606d609b03886e1354fb 100755 (executable)
@@ -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