]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
fixed to work with dirich, mt
authorMichael Traxler <M.Traxler@gsi.de>
Fri, 20 Dec 2019 18:16:21 +0000 (19:16 +0100)
committerMichael Traxler <M.Traxler@gsi.de>
Fri, 20 Dec 2019 18:16:21 +0000 (19:16 +0100)
thresholds/write_thresholds.pl

index c2b567fea28b7715c8758feb90a09850a152ecc2..e090ab613221a6b35ebffcc753ba77d4e5a85ce0 100755 (executable)
@@ -73,13 +73,13 @@ foreach my $cl (@f) {
     $chain = int($chain);
     $channel = int($channel);
     $thresh = hex($thresh);
+
     next if($thresh > 0xffff);
 
     $thresh -= $offset;
         #MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
         # usleep(100000);
-    write_threshold("padiwa", $ep, $chain, $channel, $thresh);
+    write_threshold($mode, $ep, $chain, $channel, $thresh);
     $count++;
 
 }
@@ -94,7 +94,8 @@ sub write_threshold {
 
   my $fixed_bits;
   my $shift_bits;
-  
+  my $channel_shift=16;
+
   if($mode eq "padiwa") {
       $fixed_bits = 0x00800000;
       $shift_bits = 0;
@@ -102,11 +103,27 @@ sub write_threshold {
   elsif ($mode eq "cbmrich") {
       $fixed_bits = 0x00300000;
       $shift_bits = 4;
+    }
+  elsif ($mode eq "dirich2") {
+    $fixed_bits = 0x8 << 20;
+    $shift_bits = 0;
+    $channel_shift = 24;
+    }
+
+
+  my $command= $fixed_bits | ( ($current_channel&0xf) << $channel_shift) | ($thresh << $shift_bits);
+
+  if ($mode eq "dirich2") {
+    if ($current_channel<16) {
+      Dmon::PadiwaSendCmd($command,$endpoint, 0);
+    } else {
+      Dmon::PadiwaSendCmd($command,$endpoint, 1);
+    }
+  } elsif ($mode eq "padiwa") {
+    Dmon::PadiwaSendCmd($command,$endpoint, $chain);
   }
 
-  my $command= $fixed_bits | ($current_channel << 16) | ($thresh << $shift_bits);
-
-  Dmon::PadiwaSendCmd($command, $endpoint, $chain);
+  #Dmon::PadiwaSendCmd($command, $endpoint, $chain);
   #send_command($endpoint, $chain, $command);
 }