From 700faef4a230a38b2e856191c0b371b77cca7f4e Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Fri, 11 Apr 2014 09:55:33 -0400 Subject: [PATCH] Softlink make_cratemap.pl to avoid multiple copies. --- hcal_calib/make_cratemap.pl | 71 +------------------------------------ 1 file changed, 1 insertion(+), 70 deletions(-) mode change 100755 => 120000 hcal_calib/make_cratemap.pl diff --git a/hcal_calib/make_cratemap.pl b/hcal_calib/make_cratemap.pl deleted file mode 100755 index 6ee8d5e..0000000 --- a/hcal_calib/make_cratemap.pl +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/perl - -# Read a Hall C style MAP file and output a -# Hall A style crate map DB file. -# -# 22.03.2012 (saw) - -%crates=(); - -$crate = 0; -$nsubadd = 0; -$bsub = 0; -$modtype = 0; -$slot = 0; -while(<>) { - $line=chomp; - if($line=/^\s*ROC=\s*(\d*)/i) { - $i++; - $crate = $1; - if(not $crates{$crate}) { - $slotlist={}; - $crates{$crate} = $slotlist; - } - $modtype = 0; - $slot = 0; - } elsif ($line=/^\s*nsubadd=\s*(\d*)/i) { - $nsubadd = $1; - $modtype = 0; - } elsif ($line=/^\s*bsub=\s*(\d*)/i) { - $bsub = $1; - $modtype = 0; - } elsif ($line=/^\s*slot=\s*(\d*)/i) { - $slot = $1; - $modtype = 0; - } elsif ($line=/^\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)/) { - if($modtype == 0) { # Slot not yet registered - if($nsubadd == 96) { - $modtype = 1877; - } elsif($nsubadd == 64) { - if($bsub == 16) { - $modtype = 1875; - } elsif($bsub == 17) { - $modtype = 1881; - } - } - if($modtype == 0) { - print "Unknown module Crate $crate, Slot $slot\n"; - } - $crates{$crate}{$slot} = $modtype; - # print "$crate $slot $modtype\n"; - } - } -} -print "# Hall C Crate map\n"; -foreach $crate (sort {$a <=> $b} keys %crates) { - print "==== Crate $crate type fastbus\n"; - print "# slot model clear header mask nchan ndata\n"; - foreach $slot (sort {$a <=> $b} keys %{ $crates{$crate}}) { - $modtype = $crates{$crate}{$slot}; - if($modtype == 1877) { - $ndata = 256; - } else { - $ndata = 64; - } - printf " %2d %d 1 0x0 0x0 %3d %d\n" - ,$slot,$modtype,$nsubadd, $ndata; - } -} - - diff --git a/hcal_calib/make_cratemap.pl b/hcal_calib/make_cratemap.pl new file mode 120000 index 0000000..8d3d2ef --- /dev/null +++ b/hcal_calib/make_cratemap.pl @@ -0,0 +1 @@ +../examples/make_cratemap.pl \ No newline at end of file -- GitLab