]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
updates to dmon
authorCbm Rich <richdaq@wuppertal>
Sun, 16 Nov 2014 13:48:30 +0000 (14:48 +0100)
committerCbm Rich <richdaq@wuppertal>
Sun, 16 Nov 2014 13:48:30 +0000 (14:48 +0100)
dmon/scripts/dmon_beammonitors.pl
dmon/scripts/dmon_billboard.pl
dmon/scripts/dmon_heatmaprich.pl

index c3c2f6de4d85b6e52f361509f1958176e4c7a78a..a9279677f3f93a3501460af892492d0d9d54cc20 100755 (executable)
@@ -23,7 +23,7 @@ HPlot::PlotInit({
   sizex   => 430,
   sizey   => 360,
   curvewidth => 1.5,
-#   ymin    => -1,
+  ymin    => 0,
   ymax    => "1000<*",
 #   xscale  => 5,
   nokey   => 1,
index 755be5a6d6fbde75838ee0850c9be2325ff0f5a9..68345fad9339c9b624fd96ebf1fc093df4a69ee4 100755 (executable)
@@ -33,9 +33,9 @@ while(1) {
 
   # temp & pressure
   push @billboardValues,
-    (($billboardVersion  & 0x3)      << 30) | # version   2 bit
-    (($epicsData{"Pres"} & 0x1fffff) <<  9) | # pressure 21 bit
-    (($epicsData{"Temp"} & 0x1ff   ) <<  0);  # temp      9 bit
+    (( 0                      )      << 30) | # version   2 bit
+    (($epicsData->{"Pres"}->{"val"} & 0x1fffff) <<  9) | # pressure 21 bit
+    (($epicsData->{"Temp"}->{"val"} & 0x1ff   ) <<  0);  # temp      9 bit
 
   # padiwa currents
   for(my $i = 0; $i < 16; $i++) {
@@ -52,8 +52,10 @@ while(1) {
   # hv values
   for(my $i=0; $i < 16; $i++) {
     push @billboardValues,
-      ((("HV_I".$i) * 1e6) & 0xffff) << 16) |
-      ((("HV_U".$i) * 1e2) & 0xffff) <<  0);
+      ((($epicsData->{"HV_I".$i}->{"val"} * 1e6) & 0xffff) << 16) |
+      ((($epicsData->{"HV_U".$i}->{"val"} * 1e2) & 0xffff) <<  0);
+      
+    #print(($epicsData->{"HV_I".$i}->{"val"} * 1e6) . "uA @ " . ($epicsData->{"HV_U".$i}->{"val"} * 1e3) . " mV \n");
   }
   
   trb_register_write_mem($config{BillboardAddress}, 0xb100, 0, \@billboardValues, scalar @billboardValues); # copy data
index b79db389bbc886820987c0fd42cbf54c967bc8bb..234c55d98a47601b3379bd17cdcda7b0cc6bc8c3 100755 (executable)
@@ -4,6 +4,8 @@ use warnings;
 use strict;
 use POSIX qw(strftime);
 use FileHandle;
+use lib "./code";
+use lib "../tools";
 use lib "../users/cern_cbmrich";
 use HADES::TrbNet;
 use Time::HiRes qw(usleep);
@@ -34,26 +36,53 @@ $plot2->{xmax}    = 32.5;
 $plot2->{ymin}    = 0.5;
 $plot2->{ymax}    = 32.5;
 $plot2->{cbmin}   = "0";
-$plot2->{cbmax}   = "100<*";
+$plot2->{cbmax}   = "100<*<1000000";
 $plot2->{showvalues} = 0;
 $plot2->{xlabel} = "column";
 $plot2->{ylabel} = "row";
-$plot2->{addCmd} = "set lmargin at screen 0.07\nset rmargin at screen 0.85\nset bmargin at screen 0.07\nset tmargin at screen 0.95";
+$plot2->{addCmd} = "set lmargin at screen 0.07\nset rmargin at screen 0.80\nset bmargin at screen 0.07\nset tmargin at screen 0.95";
 HPlot::PlotInit($plot2);
 
 my $str = Dmon::MakeTitle(9,14,"HeatmapRich",0);
-   $str .= qq@<img src="%ADDPNG HeatmapRich.png%" type="image/png">@;
+   $str .= qq@<div style="padding:0"><img src="%ADDPNG HeatmapRich.png%" type="image/png" id="heatmap-img"></div><div id="heatmap-caption" style="margin-top: -5px;"></div>@;
    $str .= Dmon::MakeFooter();
 Dmon::WriteFile("HeatmapRich",$str);
 
+sub generateDef {
+  my $x = 56; my $y = 51; my $w = (564-$x) / 32.0; my $h = (619-$y) / 32.0;
+
+  $str = qq@
+  var HeatmapDef = {
+    'x': $x, 'y': $y, 'w': $w, 'h': $h,
+    'labels': [
+  @;
+
+  for my $ix (1..32) {
+    $str .= '[';
+    for my $iy (1..32) {
+      my $fpga    = $ChannelMapping::chanmap->{fpga}->[$ix]->[$iy];
+      my $channel = ($ChannelMapping::chanmap->{chan}->[$ix]->[$iy]-1) / 2;
+
+      $str .= sprintf("'0x%04x CH: %d'", $fpga, $channel) . ($iy == 32 ? '' : ',');
+    }
+    $str .= ']' . ($ix == 32 ? '' : ',') . "\n";
+  }
+
+  $str .= ']};';
+  return $str;
+}
+
+open FH, ">", Dmon::DMONDIR . '/HeatmapRichDefs.js';
+print FH generateDef;
+close FH;
 
 my $old;
 my $oldtime = time();
 my $time = time();
 my $diff;
 
+
 while (1) {
-  my $sum = 0;
   my $o = trb_register_read_mem($config{PadiwaBroadcastAddress},0xc000,0,33);
 
   if (defined $old) {
@@ -71,15 +100,14 @@ while (1) {
         my $fpga    = $ChannelMapping::chanmap->{fpga}->[$x]->[$y];
         my $channel = $ChannelMapping::chanmap->{chan}->[$x]->[$y];
         HPlot::PlotFill('HeatmapRich',$diff->{$fpga}->[$channel],$x,$y);
-        $sum += $diff->{$fpga}->[$channel];
         }
       }
     HPlot::PlotDraw('HeatmapRich');      
     }
   my $status = Dmon::OK;
   my $title  = "Heatmap";
-  my $value = Dmon::SciNotation($sum);
-  my $longtext = "Total: ".$value;
+  my $value = "";
+  my $longtext = "See plot";
   Dmon::WriteQALog($config{flog},"heatmaprich",5,$status,$title,$value,$longtext,'1-HeatmapRich');
   $old = $o;
   $oldtime = time();