From bed7dc6811975ccd7b2fde588c6532357ec18e33 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Mon, 22 Oct 2012 11:35:02 +0000 Subject: [PATCH] *** empty log message *** --- cts/htdocs/thresh/setbit.pl | 26 ++++++++++++++++++++++++ cts/htdocs/thresh/spiexec.pl | 36 +++++++++++++++++++++++++++++++++ cts/htdocs/thresh/tdc.htm | 6 +++--- cts/htdocs/thresh/threshold.htm | 24 ++++++++++++++++------ 4 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 cts/htdocs/thresh/setbit.pl create mode 100755 cts/htdocs/thresh/spiexec.pl diff --git a/cts/htdocs/thresh/setbit.pl b/cts/htdocs/thresh/setbit.pl new file mode 100644 index 0000000..6d2d6fe --- /dev/null +++ b/cts/htdocs/thresh/setbit.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/spiexec.pl b/cts/htdocs/thresh/spiexec.pl new file mode 100755 index 0000000..e372cb4 --- /dev/null +++ b/cts/htdocs/thresh/spiexec.pl @@ -0,0 +1,36 @@ +&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); + +$hits = trb_register_read($board,0xd412); + + foreach my $b (sort keys %$hits) { + printf ("%04x",$b); + printf(" %d",($hits->{$b})&0xffff); + print "&"; + } + + +exit 1; \ No newline at end of file diff --git a/cts/htdocs/thresh/tdc.htm b/cts/htdocs/thresh/tdc.htm index 3ee87a0..dc2eb3f 100644 --- a/cts/htdocs/thresh/tdc.htm +++ b/cts/htdocs/thresh/tdc.htm @@ -55,16 +55,16 @@ function update(data) { } for(i = 1; i <= channels; i++) { - o += ""+(i-1+0xc000).toString(16)+""+(i-1); + o += ""+(i-1+0xc000).toString(16)+""+(i-1); for(j=0;jThreshold Settings
-
Configuration
Board: -
DAC-Chain: +
Configuration
Board +
DAC-Chain
Channel
Board Type
Update Interval (ms) @@ -47,6 +47,7 @@ var chan = document.getElementById("form_channel").value; var type = document.getElementById("form_type").value; var reference = document.getElementById("form_ref").value; var updateTask = setInterval("doUpdate()",updaterate); +var total = 0; function update(bar,scale) { @@ -75,20 +76,31 @@ function doUpdate() { } } -function showret(d) { -// document.getElementById("err").innerHTML = d; +function showret(d) {} + +function anaret2(d) { + var s = d.split("&"); + var t = s[0].split(" "); + document.getElementById("bar2").scrollLeft = 128*256; + document.getElementById("bar1").scrollLeft = t[1]-128; } function setValues() { + clearInterval(updateTask); updaterate = document.getElementById("form_rate").value; board = document.getElementById("form_board").value; chain = 1<