From: Hadaq@styx Date: Fri, 11 Oct 2013 14:33:43 +0000 (+0200) Subject: almost final nxyter for today X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=b7e60cccfa445090052f660ce3c7ece24a3a4170;p=daqtools.git almost final nxyter for today --- diff --git a/users/cosy_test/config/hubconfig.sh b/users/cosy_test/config/hubconfig.sh index 3c55ef3..dedd204 100755 --- a/users/cosy_test/config/hubconfig.sh +++ b/users/cosy_test/config/hubconfig.sh @@ -10,7 +10,11 @@ echo "Loading hub configuration" #Timeouts trbcmd w 0xfffe 0xc5 0x40ff - +#Trb3 for nxyter + trbcmd w 0x8900 0xc0 0xfff1 + trbcmd w 0x8900 0xc1 0xfff1 + trbcmd w 0x8900 0xc3 0xfff5 + #Gbe configuration echo "Load GbE configuration" ../../../tools/loadregisterdb.pl gbe/register_configgbe.db diff --git a/users/cosy_test/config/nxyter/nxsetup.dat b/users/cosy_test/config/nxyter/nxsetup.dat index 397a8d6..4a85bab 100644 --- a/users/cosy_test/config/nxyter/nxsetup.dat +++ b/users/cosy_test/config/nxyter/nxsetup.dat @@ -19,7 +19,7 @@ 0x00000000 # 15 Channel Masks END 0x000000a0 # 16 0x000000ff # 17 -0x0000003c # 18 Common Threshold, default 0x80 +0x000000aa # 18 Common Threshold, default 0x80 0x0000001e # 19 0x0000005f # 20 0x00000057 # 21 @@ -33,8 +33,8 @@ 0x00000045 # 29 0x000000be # 30 0x000000be # 31 -0x00000004 # 32 TestTrigger setup etc. , default 0x00 -0x00000008 # 33 clock input 256A, set bit #3, default 0x08 (normal mode) +0x00000000 # 32 TestTrigger setup etc. , default 0x00 +0x0000000c # 33 clock input 256A, set bit #3, default 0x08 (normal mode) 0x000000be # 34 0x000000be # 35 0x000000be # 36 diff --git a/users/cosy_test/config/nxyter/setup.sh b/users/cosy_test/config/nxyter/setup.sh index 23b3188..9088ab3 100755 --- a/users/cosy_test/config/nxyter/setup.sh +++ b/users/cosy_test/config/nxyter/setup.sh @@ -37,8 +37,10 @@ echo "clear data fifo" trbcmd rm 0x3800 0x8600 4000 2>/dev/null # Set readout Mode -trbcmd w 0x3800 0x8180 0x00 # normal mode +trbcmd w 0x3800 0x8180 0x01 # was: 0: normal mode trbcmd w 0x3800 0x8182 100 # window width = 100 * 4ns +trbcmd w 0x3800 0x8184 0xffe # read-out time max + # Decoder Settings trbcmd w 0x3800 0x8120 0 # reset all counters @@ -47,6 +49,6 @@ trbcmd w 0x3800 0x8120 0 # reset all counters trbcmd w 0x3800 0x8103 0 #Debugging to test ADC alignment / reset feature -sleep 1; -trbcmd w 0x3800 0x8501 1 +# sleep 1; +# trbcmd w 0x3800 0x8501 1 diff --git a/users/cosy_test/nxscripts/mode_p.sh b/users/cosy_test/nxscripts/mode_p.sh new file mode 100755 index 0000000..3a2426b --- /dev/null +++ b/users/cosy_test/nxscripts/mode_p.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +[ -n $1 ] && addr=0x3800 || addr=$1 + +# TP +trb_i2c w $addr 0x0008 32 0x01 +trb_i2c w $addr 0x0008 33 15 diff --git a/users/cosy_test/nxscripts/mode_st.sh b/users/cosy_test/nxscripts/mode_st.sh new file mode 100755 index 0000000..c0d497f --- /dev/null +++ b/users/cosy_test/nxscripts/mode_st.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +[ -n $1 ] && addr=0x3800 || addr=$1 + +# cfg reg +# TP TT +trb_i2c w $addr 0x0008 32 0x00 +trb_i2c w $addr 0x0008 33 0x0f diff --git a/users/cosy_test/nxscripts/mode_t.sh b/users/cosy_test/nxscripts/mode_t.sh new file mode 100755 index 0000000..f796aba --- /dev/null +++ b/users/cosy_test/nxscripts/mode_t.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +[ -n $1 ] && addr=0x3800 || addr=$1 + +# TT +trb_i2c w $addr 0x0008 32 0x08 +trb_i2c w $addr 0x0008 33 15 diff --git a/users/cosy_test/nxscripts/mode_tp.sh b/users/cosy_test/nxscripts/mode_tp.sh new file mode 100755 index 0000000..5e9fa59 --- /dev/null +++ b/users/cosy_test/nxscripts/mode_tp.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +[ -n $1 ] && addr=0x3800 || addr=$1 + +# cfg reg +# TP TT +trb_i2c w $addr 0x0008 32 0x09 +trb_i2c w $addr 0x0008 33 0x0f diff --git a/users/cosy_test/nxscripts/quicklook.sh b/users/cosy_test/nxscripts/quicklook.sh new file mode 100755 index 0000000..cf6d477 --- /dev/null +++ b/users/cosy_test/nxscripts/quicklook.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +watch -n 1 " \ +trbcmd -d1 r 0x3800 0x8124; \ +trbcmd -d1 r 0x3800 0x8125; \ +trbcmd -d1 r 0x3800 0x8162; \ +" + diff --git a/users/cosy_test/nxscripts/reset.sh b/users/cosy_test/nxscripts/reset.sh new file mode 100755 index 0000000..fc28403 --- /dev/null +++ b/users/cosy_test/nxscripts/reset.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +[ -n $1 ] && addr=0x3800 || addr=$1 + +trbcmd w $addr 0x8100 1 +trbcmd w $addr 0x8101 1 diff --git a/users/cosy_test/nxscripts/set_dacs.sh b/users/cosy_test/nxscripts/set_dacs.sh new file mode 100755 index 0000000..5af4ede --- /dev/null +++ b/users/cosy_test/nxscripts/set_dacs.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +[ -n $1 ] && addr=0x3800 || addr=$1 + +# nx settings + +trb_i2c w $addr 0x0008 16 160 +trb_i2c w $addr 0x0008 17 255 +trb_i2c w $addr 0x0008 18 35 +trb_i2c w $addr 0x0008 19 30 +trb_i2c w $addr 0x0008 20 95 +trb_i2c w $addr 0x0008 21 87 +trb_i2c w $addr 0x0008 22 100 +trb_i2c w $addr 0x0008 23 137 +trb_i2c w $addr 0x0008 24 255 +trb_i2c w $addr 0x0008 25 69 +trb_i2c w $addr 0x0008 26 15 +trb_i2c w $addr 0x0008 27 54 +trb_i2c w $addr 0x0008 28 92 +trb_i2c w $addr 0x0008 29 69 diff --git a/users/cosy_test/nxscripts/trig_no.sh b/users/cosy_test/nxscripts/trig_no.sh new file mode 100755 index 0000000..4e1e37c --- /dev/null +++ b/users/cosy_test/nxscripts/trig_no.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +[ -n $1 ] && addr=0x3800 || addr=$1 + +trbcmd w $addr 0x8180 1 +trbcmd w $addr 0x8181 0 +trbcmd w $addr 0x8182 1000 +trbcmd w $addr 0x8183 0 +trbcmd w $addr 0x8183 1000 + +trbcmd w $addr 0x8140 0 +#trbcmd w $addr 0x8144 1 + +trbcmd w $addr 0x8160 0 +trbcmd w $addr 0x8161 0 +#trbcmd w $addr 0x8144 1 + +trbcmd w $addr 0x8102 1 +trbcmd w $addr 0x8103 0 diff --git a/users/cosy_test/nxscripts/trig_pulser.sh b/users/cosy_test/nxscripts/trig_pulser.sh new file mode 100755 index 0000000..53d1e24 --- /dev/null +++ b/users/cosy_test/nxscripts/trig_pulser.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +[ -n $1 ] && addr=0x3800 || addr=$1 + +trbcmd w $addr 0x8180 1 +trbcmd w $addr 0x8181 0 +trbcmd w $addr 0x8182 1000 +trbcmd w $addr 0x8183 0 +trbcmd w $addr 0x8183 1000 + +#trbcmd w $addr 0x8140 1 +#trbcmd w $addr 0x8144 1 + +trbcmd w $addr 0x8160 0 +trbcmd w $addr 0x8161 1 +#trbcmd w $addr 0x8144 1 + +trbcmd w $addr 0x8102 1 +trbcmd w $addr 0x8103 0 diff --git a/web/htdocs/commands/xmlpage.pm b/web/htdocs/commands/xmlpage.pm new file mode 100644 index 0000000..b17b3ba --- /dev/null +++ b/web/htdocs/commands/xmlpage.pm @@ -0,0 +1,91 @@ + +package xmlpage; + + +my $active = -1; +my @setup; + +sub getView { + my ($n) = @_; + $active = $n; + + if($setup[$n]->{refresh}) { + print qq||; + } + print qq||; + print qq|
|; + + +} + + +sub initPage { + my ($ref_setup) = @_; + @setup = @$ref_setup; + + my ($command,$style) = split("-",$ENV{'QUERY_STRING'}); + $command = "" unless defined $command; + $style = "" unless defined $style; + for(my $i=0; $i{name} eq $command) { + $active = $i; + last; + } + } + + print < + +TrbNet Overview + + +EOF + printJavaScripts(); + print qq( + + +

TrbNet Overview

+
+
); + +for ( my $s = 0; $s < scalar @setup; $s++) { + print qq||.$setup[$s]->{name}.qq||; + } +print qq(
); + +if ($active!=-1) { + getView($active); + } + +print < +
+
Debug Output
+debug text +
+ + + + +EOF +} + + + + +sub printJavaScripts { + +####### javascript function land ################ + + print < + + +EOF +} + + +1; \ No newline at end of file diff --git a/web/htdocs/nxyter/blue.css b/web/htdocs/layout/blue.css similarity index 98% rename from web/htdocs/nxyter/blue.css rename to web/htdocs/layout/blue.css index 65e1b06..c84a02f 100644 --- a/web/htdocs/nxyter/blue.css +++ b/web/htdocs/layout/blue.css @@ -8,7 +8,7 @@ body { #roterBereich, #blauerBereich, #fileSelection, #debug, #overview, #debugpane { float:left; position:relative; - width:320px; +/* width:320px; */ padding:10px; margin:50px 10px 0 30px; border-radius:5px; @@ -42,7 +42,7 @@ body { } #overview { - width:1000px; + min-width:1000px; margin:50px 0 0 20px; } @@ -284,6 +284,7 @@ table.queryresult td:first-child, table.queryresult th:first-child{ max-width:100px; overflow:hidden; text-align:left; + background:#dde; } hr.queryresult { diff --git a/web/htdocs/nxyter/index.pl b/web/htdocs/nxyter/index.pl index 49fdb04..1353051 100755 --- a/web/htdocs/nxyter/index.pl +++ b/web/htdocs/nxyter/index.pl @@ -7,27 +7,26 @@ use XML::LibXML; use POSIX; use CGI::Carp qw(fatalsToBrowser); -# use FindBin; -# use lib "$FindBin::Bin/.."; -# use Environment; +use lib qw|../commands htdocs/commands|; +use xmlpage; +my @setup; +$setup[0]->{name} = "DataValid"; +$setup[0]->{cmd} = "Nxyter-0x3800-DataValidate"; +$setup[0]->{refresh} = 1; +$setup[0]->{period} = 0; -my $configFile = SETUPFILE; -my $setup; +$setup[1]->{name} = "TrigValid"; +$setup[1]->{cmd} = "Nxyter-0x3800-TriggerValidate"; +$setup[1]->{refresh} = 1; +$setup[1]->{period} = 0; +xmlpage::initPage(\@setup); + -my ($command,$style) = split("-",$ENV{'QUERY_STRING'}); + -$command = "" unless defined $command; -$style = "" unless defined $style; - -# my $isSetup = $command eq "setup"; - my $isDataValidate = $command eq "DataValidate"; - my $isTriggerValidate = $command eq "TriggerValidate"; -# my $isErrors = $command eq "errors"; - - -initPage(); +1; @@ -49,68 +48,3 @@ print < - -NXyter Status - - -EOF - printJavaScripts(); - print qq( - - -

NXyter Status

-
- - -); -if($isSetup) { - print '
'; - print '
'; - } -if ($isDataValidate) { - getDataValidate(); - } -if ($isTriggerValidate) { - getTriggerValidate(); - } -print < -
-
Debug Output
-debug text -
- - - - -EOF -} - - - - -sub printJavaScripts { - -####### javascript function land ################ - - print < - - -EOF -} - - - diff --git a/web/htdocs/nxyter/scripts.js b/web/htdocs/scripts/scriptsnew.js similarity index 100% rename from web/htdocs/nxyter/scripts.js rename to web/htdocs/scripts/scriptsnew.js diff --git a/web/htdocs/trbnet/index.pl b/web/htdocs/trbnet/index.pl new file mode 100755 index 0000000..9571455 --- /dev/null +++ b/web/htdocs/trbnet/index.pl @@ -0,0 +1,28 @@ +&htsponse(200, "OK"); +print "Content-type: text/html\r\n\r\n"; + + +use CGI ':standard'; +use XML::LibXML; +use POSIX; +use CGI::Carp qw(fatalsToBrowser); + +use lib qw|../commands htdocs/commands|; +use xmlpage; + +my @setup; +$setup[0]->{name} = "StatusRegisters"; +$setup[0]->{cmd} = "TrbNet-0xffff-StatusRegisters"; +$setup[0]->{refresh} = 1; +$setup[0]->{period} = 0; + + + +xmlpage::initPage(\@setup); + + + + +1; + + diff --git a/xml-db/database/TrbNet.xml b/xml-db/database/TrbNet.xml index 14256e5..f54ec9d 100644 --- a/xml-db/database/TrbNet.xml +++ b/xml-db/database/TrbNet.xml @@ -35,13 +35,13 @@ tmg and lvl1 dont match Done - + Last reference time was too short - + Missing reference time - + Spurious reference time @@ -50,7 +50,7 @@ Reference time to LVL1 too long delay - + Internal and received trigger number match @@ -72,7 +72,7 @@ Number of edges on trigger input - + Length of last reference time signal diff --git a/xml-db/get.pl b/xml-db/get.pl index 37a009e..6ab5ccd 100755 --- a/xml-db/get.pl +++ b/xml-db/get.pl @@ -124,7 +124,7 @@ sub FormatPretty { if($obj->{errorflag}) { $ret .= "$cl>".($value?"true":"false");} else { $ret .= "$cl>".($value?"true":"false");} } - when ("float") {$ret = sprintf("$cl>%.2f",$value);} + when ("float") {$ret .= sprintf("$cl>%.2f",$value);} when ("integer") {$ret .= sprintf("$cl>%i",$value);} when ("unsigned") {$ret .= sprintf("$cl>%u",$value);} when ("signed") {$ret .= sprintf("$cl>%d",$value);} @@ -146,7 +146,7 @@ sub FormatPretty { else { for($obj->{format}) { when ("boolean") {$ret = $value?"true":"false";} - when ("float") {$ret = sprintf("%.2f",$value);} + when ("float") {$ret = sprintf("%.2f",$value);} when ("integer") {$ret = sprintf("%i",$value);} when ("unsigned") {$ret = sprintf("%u",$value);} when ("signed") {$ret = sprintf("%d",$value);} @@ -220,13 +220,13 @@ sub requestdata { sub generateoutput { my ($obj,$name,$slice,$once) = @_; my $t = ""; - $t = ""; if($obj->{type} eq "group") { foreach my $c (@{$obj->{children}}) { generateoutput($db->{$c},$c,$slice,$once); } } elsif($obj->{type} eq "register" || $obj->{type} eq "registerfield" || $obj->{type} eq "field") { + $t = "
"; my $stepsize = $obj->{stepsize} || 1; $slice = 0 unless defined $slice; @@ -261,8 +261,8 @@ sub generateoutput { } } while($once != 1 && defined $obj->{repeat} && ++$slice < $obj->{repeat}); - } $t .= "

"; + } print $t; }