From 0ae7858b6f41dc12a8fd33cdbf38f0b383e70c46 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Wed, 28 Nov 2012 18:03:45 +0000 Subject: [PATCH] first padiwa GUI --- cts/htdocs/thresh/getpadiwa.pl | 63 ++++++++++++++++++++++++++ cts/htdocs/thresh/padiwa.htm | 81 ++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100755 cts/htdocs/thresh/getpadiwa.pl create mode 100644 cts/htdocs/thresh/padiwa.htm diff --git a/cts/htdocs/thresh/getpadiwa.pl b/cts/htdocs/thresh/getpadiwa.pl new file mode 100755 index 0000000..c41384a --- /dev/null +++ b/cts/htdocs/thresh/getpadiwa.pl @@ -0,0 +1,63 @@ +#!/usr/bin/perl -w +&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,$task) = split('-',$ENV{'QUERY_STRING'}); +$board = hex($board); + + + +sub sendcmd { + my ($cmd,$chain) = @_; + my $c = [$cmd,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1<<$chain,1]; + trb_register_write_mem($board,0xd400,0,$c,scalar @{$c}); + return trb_register_read($board,0xd412); + } + + + + +my $ret; +my $num = 1; + +for(my $i=0; $i < 4; $i++) { + if ($task eq "temp") { + $ret->[$i] = sendcmd(0x10040000,$i); + } + elsif ($task eq "id") { + $num = 4; + $ret->[$i*4+0] = sendcmd(0x10000000,$i); + $ret->[$i*4+1] = sendcmd(0x10010000,$i); + $ret->[$i*4+2] = sendcmd(0x10020000,$i); + $ret->[$i*4+3] = sendcmd(0x10030000,$i); + } + } + + + + +foreach my $b (sort keys %{$ret->[0]}) { + printf ("%04x",$b); + for(my $i=0; $i < 4*$num; $i++) { + if($task eq "id"){ + printf(" %04x",$ret->[$i]->{$b} & 0xffff); + } + else { + printf(" %d",$ret->[$i]->{$b}); + } + } + print "&"; + } + + + +exit 1; diff --git a/cts/htdocs/thresh/padiwa.htm b/cts/htdocs/thresh/padiwa.htm new file mode 100644 index 0000000..2c21127 --- /dev/null +++ b/cts/htdocs/thresh/padiwa.htm @@ -0,0 +1,81 @@ + + + + + + +Padiwa + + + + +

Padiwa

+
+
Configuration +
Board +
Update Interval (ms) +
Option +
Min/Max +
+
+
+ +
Board
+ + + + + + + \ No newline at end of file -- 2.43.0