From: hadeshyp Date: Mon, 15 Oct 2012 11:06:39 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=0467c44a4e0390975170ec83082906fafbe4074c;p=daqtools.git *** empty log message *** --- diff --git a/cts/htdocs/thresh/get.pl b/cts/htdocs/thresh/get.pl new file mode 100755 index 0000000..9d48100 --- /dev/null +++ b/cts/htdocs/thresh/get.pl @@ -0,0 +1,39 @@ +&htsponse(200, "OK"); +print "Content-type: text/html\r\n\r\n"; + + + +use HADES::TrbNet; +use Data::Dumper; + + if (!defined &trb_init_ports()) { + die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}"); + } + +my ($board,$addr,$amount) = split('-',$ENV{'QUERY_STRING'}); + +$board = hex($board); +$addr = hex($addr); +$amount = 1 unless $amount; + +if($amount != 1) { + my $hits = trb_register_read_mem($board,$addr,0,$amount); + foreach my $b (sort keys %$hits) { + printf ("%04x",$b); + for(my $c =0; $c < $amount; $c++) { + printf(" %d",$hits->{$b}->[$c]); + } + print "&"; + } + } +else { + my $hits = trb_register_read($board,$addr); + foreach my $b (sort keys %$hits) { + printf ("%04x",$b); + printf(" %d",$hits->{$b}); + print "&"; + } + + } + +exit 1; \ No newline at end of file diff --git a/cts/htdocs/thresh/hitcounter.pl b/cts/htdocs/thresh/hitcounter.pl new file mode 100755 index 0000000..e61d40a --- /dev/null +++ b/cts/htdocs/thresh/hitcounter.pl @@ -0,0 +1,103 @@ +&htsponse(200, "OK"); +print "Content-type: text/html\r\n\r\n"; + + +use HADES::TrbNet; +use Data::Dumper; + +my $header = qq$ + + + + + + +Hmon $.$ENV{'QUERY_STRING'}.qq$ + + +$; +print $header; + + + if (!defined &trb_init_ports()) { + die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}"); + } + + +my $board = 0xffff; +my $e = <Hit Counters +
+
Board: +
Update Interval (ms) +
Differences +
+
+
+ +EOD + +print $e; + + +print "
ChannelValue\n"; +for(my $c =0; $c < 64; $c++) { + print "
$c"; + } + +print "
"; + + +$e = < +var updaterate = document.getElementById("form_rate").value; +var board = document.getElementById("form_board").value; +var updateTask = setInterval("getdata('get.pl?"+board+"-4000-64',update)",updaterate); +var differences= document.getElementById("form_diff").checked; +var oldvalues = {}; + + +function update(data) { + if(!document.getElementById("content").innerHTML) return; + var b = data.split("&"); + var c = {}; + o = "Channel"; + + for(j=0;j + +EOD + +print $e; +print ""; +exit 1; + diff --git a/cts/htdocs/thresh/put.pl b/cts/htdocs/thresh/put.pl new file mode 100755 index 0000000..6d2d6fe --- /dev/null +++ b/cts/htdocs/thresh/put.pl @@ -0,0 +1,26 @@ +&htsponse(200, "OK"); +print "Content-type: text/html\r\n\r\n"; + + + +use HADES::TrbNet; +use Data::Dumper; + + if (!defined &trb_init_ports()) { + die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}"); + } + +my ($board,$addr,@values) = split('-',$ENV{'QUERY_STRING'}); + +if(!defined $board || !defined $addr || !defined $values[0]) {exit -1;} +$board = hex($board); +$addr = hex($addr); + +for(my $x = 0; $x < scalar @values; $x++) { + $values[$x] = hex($values[$x]); + } + + +my $hits = trb_register_write_mem($board,$addr,0,\@values,scalar @values); + +exit 1; \ No newline at end of file diff --git a/cts/htdocs/thresh/scripts.js b/cts/htdocs/thresh/scripts.js new file mode 100644 index 0000000..29b53a1 --- /dev/null +++ b/cts/htdocs/thresh/scripts.js @@ -0,0 +1,39 @@ + + +function getdata(command,callback) { + xmlhttp=new XMLHttpRequest(); + xmlhttp.onreadystatechange = function() { + if(xmlhttp.readyState == 4) { + if(callback) + callback(xmlhttp.responseText); + } + } + xmlhttp.open("GET",command,true); + xmlhttp.send(null); + } + + + +// function reload() { +// xmlhttp=new XMLHttpRequest(); +// xmlhttp.onreadystatechange = function() { +// if(xmlhttp.readyState == 4) { +// document.getElementById("content").innerHTML=xmlhttp.responseText; +// if(document.getElementById('logbox')) { +// if(saveScrollTop) { +// document.getElementById('logbox').scrollTop = saveScrollTop; +// } +// } +// +// document.getElementById("stop").style.background="#444"; +// reloadevery = setTimeout('reload()',$.($delay*1000).qq$); +// } +// }; +// if(document.getElementById('logbox')) { +// saveScrollTop = document.getElementById('logbox').scrollTop; +// if (saveScrollTop == 0) {saveScrollTop = 0.1;} +// } +// xmlhttp.open("GET","get.cgi?$.$ENV{'QUERY_STRING'}.qq$",true); +// xmlhttp.send(null); +// document.getElementById("stop").style.background="#111"; +// } \ No newline at end of file diff --git a/cts/htdocs/thresh/styles.css b/cts/htdocs/thresh/styles.css new file mode 100644 index 0000000..0b06ac0 --- /dev/null +++ b/cts/htdocs/thresh/styles.css @@ -0,0 +1,48 @@ +body { + background:#def; +} + + +table#content { + border:1px solid #aaa; + border-collapse:collapse; +} + + +table#content td, table#content th { + border:1px solid #aaa; + width:100px; + text-align:right; + padding-right:15px; +} + +table#content { + border:1px solid #aaa; +} + + +div#bar1 { + width:900px; + overflow-x:scroll; + } + +div#bar1 div { + width:66000px; + height:0px; +} + +div#bar2 { + width:900px; + overflow-x:scroll; + } + +div#bar2 div { + width:65536px; + height:0px; +} + + +#total { + text-align:center; + font-weight:bold; + } \ No newline at end of file diff --git a/cts/htdocs/thresh/threshold.htm b/cts/htdocs/thresh/threshold.htm new file mode 100644 index 0000000..5a915a8 --- /dev/null +++ b/cts/htdocs/thresh/threshold.htm @@ -0,0 +1,92 @@ + + + + + + +Threshold settings + + + +

Threshold Settings

+
+
Board: +
DAC-Chain: +
Channel +
Update Interval (ms) +
+
+
+ +
+
+
 
+
+
+
+
 
+
+
+
   +
   +
   +
+ + + + + +