From: Michael Traxler Date: Mon, 3 May 2021 02:03:15 +0000 (+0200) Subject: added TDCv4 support, mt X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a50518d4bcb1574747fb41ea107dfef294e1f5c4;p=daqtools.git added TDCv4 support, mt --- diff --git a/web/htdocs/commands/getv4_hitrates.pl b/web/htdocs/commands/getv4_hitrates.pl new file mode 100755 index 0000000..89952ff --- /dev/null +++ b/web/htdocs/commands/getv4_hitrates.pl @@ -0,0 +1,96 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use CGI::Carp qw(warningsToBrowser fatalsToBrowser); +use HADES::TrbNet; +use Data::Dumper; +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print "Content-type: text/html\r\n\r\n"; + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), "apacheEnv"; + print "Content-type: text/html\n\n"; + } + + + if (!defined &trb_init_ports()) { + die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}"); + } + +#print Dumper \%ENV; +my ($board,$addr,$amount,$split) = split('-',$ENV{'QUERY_STRING'}); + +#print Dumper ($board,$addr,$amount,$split); +#exit; + +$board = hex($board); +$addr = hex($addr); +$amount = 1 unless $amount; +$split = 1 unless $split; + +my $rh_values = {}; + +if($amount != 1) { + if ($split <= 1) { + #printf ("%04x ",$board); + trb_register_write($board, 0xcd30, 0x100); + foreach my $hitcounter_offset ( 0x00, 0x10, 0x20, 0x30, 0x40) { + my $hits = trb_register_read_mem($board,$addr+$hitcounter_offset,0,$amount); + foreach my $b (sort {$a <=> $b} keys %$hits) { + for(my $c =0; $c < 8; $c++) { + push (@{$rh_values->{$b}}, $hits->{$b}->[$c]); + #printf(" %d",$hits->{$b}->[$c]); + } + } + } + + foreach my $b (sort {$a <=> $b} keys %$rh_values) { + printf ("%04x",$b); + for(my $c =0; $c < $amount+4; $c++) { + #push (@{$rh_values->{$b}}, $hits->{$b}->[$c]); + printf(" %d",$rh_values->{$b}->[$c]); + } + print "&"; + } + + + } + else { + my $chunk = int($amount/$split); + if($amount%$split) {$chunk++;} + + my $i = 0; + my @hits; + do { + $hits[$i] = trb_register_read_mem($board,$addr+$i*$chunk,0,$chunk); +# print Dumper %{$hits[$i]}; +# print ($board." ".($addr+$i*$chuink)." ".($amount/$split)."\n"); + } while(++$i < $split); + foreach my $b (sort {$a <=> $b} keys %{$hits[0]}) { + printf ("%04x",$b); + for(my $i = 0; $i < scalar @hits; $i++) { + for(my $c =0; $c < $chunk; $c++) { + if($i*$chunk + $c < $amount) { + printf(" %d",$hits[$i]->{$b}->[$c]); + } + } + } + print "&"; + } + } + } +else { + my $hits = trb_register_read($board,$addr); + foreach my $b (sort {$a <=> $b} keys %$hits) { + printf ("%04x",$b); + printf(" %d",$hits->{$b}); + print "&"; + } + + } + +exit 1; diff --git a/web/htdocs/tdc/tdcv4.htm b/web/htdocs/tdc/tdcv4.htm new file mode 100644 index 0000000..f21658a --- /dev/null +++ b/web/htdocs/tdc/tdcv4.htm @@ -0,0 +1,561 @@ + + + + + + + TDCv4 Hit Counter + + + +

TDCv4 Hit Counters & TDCv4 Enable

+
+
Configuration +
Board + +
Filter + +
# of Channels + +
Update Interval (ms) + + + +
Split Table + + Differences + + + +
Input Status + + Enable + + +
Hit Rate Status +   + +
+ + +
+
+ +
ChannelValue
+
RegisterValues
+
RegisterValues
+ + + +