From: Hadaq@styx Date: Fri, 11 Oct 2013 09:18:30 +0000 (+0200) Subject: still working on nxyter X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=eedde40b6d866569c57874be22de0a67528fb0cc;p=daqtools.git still working on nxyter --- diff --git a/users/cosy_test/config/nxyter/read_i2cregs.sh b/users/cosy_test/config/nxyter/read_i2cregs.sh new file mode 100755 index 0000000..8fb4b6e --- /dev/null +++ b/users/cosy_test/config/nxyter/read_i2cregs.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +trbcmd w 0x3800 0x8240 1 +trbcmd rm 0x3800 0x8200 46 0 diff --git a/users/cosy_test/config/nxyter/setup.sh b/users/cosy_test/config/nxyter/setup.sh index 6e7ce33..23b3188 100755 --- a/users/cosy_test/config/nxyter/setup.sh +++ b/users/cosy_test/config/nxyter/setup.sh @@ -45,3 +45,8 @@ trbcmd w 0x3800 0x8120 0 # reset all counters # Enable nxyter trbcmd w 0x3800 0x8103 0 + +#Debugging to test ADC alignment / reset feature +sleep 1; +trbcmd w 0x3800 0x8501 1 + diff --git a/users/cosy_test/config/nxyter/write_i2cregs.sh b/users/cosy_test/config/nxyter/write_i2cregs.sh new file mode 100755 index 0000000..1800741 --- /dev/null +++ b/users/cosy_test/config/nxyter/write_i2cregs.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +trbcmd wm 0x3800 0x8200 0 nxsetup.dat + diff --git a/web/htdocs/layout/styles.css b/web/htdocs/layout/styles.css index 0711cd3..8b15a8a 100644 --- a/web/htdocs/layout/styles.css +++ b/web/htdocs/layout/styles.css @@ -3,6 +3,7 @@ body { font-size:10pt; margin:0px 0 0 25px; padding:0; + font-family:sans-serif; } @@ -10,12 +11,13 @@ body.index { background:#f5f5f5 url("/layout/background.png") fixed no-repeat; } +table { + font-size: 10pt; + } + + h2 { -/* position:absolute; */ width:100%; -/* top:-15px; */ -/* left:0px; */ -/* float:left; */ background:#f9f9f9; border-bottom:1px solid #ccc; padding:10px 10px 5px 10px; diff --git a/web/htdocs/nxyter/blue.css b/web/htdocs/nxyter/blue.css new file mode 100644 index 0000000..65e1b06 --- /dev/null +++ b/web/htdocs/nxyter/blue.css @@ -0,0 +1,293 @@ +body { + background:#efeff5; + color:#445; +} + + + +#roterBereich, #blauerBereich, #fileSelection, #debug, #overview, #debugpane { + float:left; + position:relative; + width:320px; + padding:10px; + margin:50px 10px 0 30px; + border-radius:5px; + background:#eef; + box-shadow: 0 0 10px 5px #fff, 0 0 4px 1px #78b inset; + } + +#fileSelection { + width:700px; + min-height:50px; + margin:50px 0 0 20px; +} + +#roterBereich { + clear:both; + } + +#debug { + position:absolute; + top:100px; + left:800px; + width:220px; + margin:0px; +} + +#debugpane { + float:left; + width:1000px; + margin:50px 0 0 20px; + +} + +#overview { + width:1000px; + margin:50px 0 0 20px; + } + + +input[type="text"] { + background-color:#dde; + color:#444; + font-size:10px; + height:20px; + width:90px; + text-align:right; + padding-right:5px; + border:1px solid #78b; + transition:background .4s; +} + +select { + background:#dde; + color:#444; + border:1px solid #78b; + transition:background .4s; +} + +input:hover, input:active, input:focus, select:hover, select:active { +background:#eed; +} + +.stdbutton, input.stdbutton:active, input.stdbutton:focus { + width:100px; + height:25px; + background:#dde; + color:#444; + border:1px solid #78b; + margin:0 5px; + padding:0 0 3px 0; + transition: background .4s; +} + +input.stdbutton:hover { + background:#eed; + } + + +table.registers { + border-collapse:collapse; + border:0px solid #eef; + color:#336; + cursor:default; +} + + +table.registers td { + border: 2px solid #eef; + height:25px; +} + +table.fields { + background:#dea; + border-collapse:collapse; + border:hidden; + cursor:default; +} + +table.fields td { + border:solid #eef; + border-width:2px 0; + border-collapse:collapse; + height:25px; +} + +table.registers>tbody>tr>td:nth-child(2) { + background:#dde; + } + + +.fileLevel tr{ + vertical-align:center; + +} + +.fieldError {background:red;} + +.fileLevel {background:#dde;} +.fileLevel1 {background:#ded;} +.fileLevel2 {background:#ede;} +.fileLevel3 {background:#fdf;} +.fileLevel4 {background:#fdd;} +.fileLevel5 {background:#ffd;} +.fileLevel6 {background:#fff;} + +table.fields td.button_move, table.registers td.button_move, .button_move { + background:#dde; + cursor:pointer; + text-align:center; + color:#228; + width:25px; + border:2px solid #eef; + transition:background .4s; +} + + +table.fields td.button_move_deac { + background:#eef; + cursor:normal; + text-align:center; + color:transparent; + width:25px; + border:2px solid #eef; +} + +.regheader { + background:lightgrey; + font-variant:small-caps; +} + +.bitfield { + background:#dea; + visibility:collapse; +} + +table.registers td.fieldcontainer { + margin:0; + padding:0; + border:0; +} + +table.registers tr td:first-child { + cursor:pointer; + background:#dde; + transition: background .4s; + } + +table.registers tr td:first-child:hover { + background:#eed; +} + +table.fields tr td:nth-child(3){ + font-family:monospace; + padding-right:10px; + color:#228; +} + +tr.bitfield{ + background:transparent; + cursor:auto; +} + + + + + +table.registers tr.bitfield td:first-child{ + background:transparent; + cursor:default; +} + +table.fields td.button_move:hover, table.registers td.button_move:hover{ + background:#eed; +} + + +div.header { + font-size:13pt; + position:absolute; + font-weight:bold; + top:-20px; + color:#88a; + z-index:-1; + } + +ul { padding-left:20px;} + +div.header span{ + display:block; + float:left; + position:relative; + top:-2px; + margin:0 10px 0 0; + padding:2px 0px 0 0px; + border:0px solid transparent; + width:100px; + list-style:none; + cursor:hand; +/* text-align:center; */ + border-radius:5px; +} + +div.header span.inactive a:hover { +/* background:#78b; */ +/* box-shadow: 0 0 10px 5px #78b; */ + color:#78b; +} + +div.header span.selected a{ + color:#88a; +} + +div.header span.inactive a{ + color:#bbd; + transition:all .4s; +} + +div.header span a { + text-decoration:none; +} + +div.header span a:hover { +} + + +.high { + background:#ded; +} +.low { + background:#edd; +} + +.good { + background:#cfc; +} +.bad { + background:#fcc; +} + + +table.conversion { + visibility:collapse; + font-size:9pt; + background:transparent; +} +table.conversion tr td{ + background:transparent!important; + border:none!important; + height:10px; +} + +table.queryresult td:first-child, table.queryresult th:first-child{ + width:130px; + max-width:100px; + overflow:hidden; + text-align:left; +} + +hr.queryresult { + border:none; + width:100%; + border-top:1px solid #aaa; +} diff --git a/web/htdocs/nxyter/index.pl b/web/htdocs/nxyter/index.pl new file mode 100755 index 0000000..49fdb04 --- /dev/null +++ b/web/htdocs/nxyter/index.pl @@ -0,0 +1,116 @@ +&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 FindBin; +# use lib "$FindBin::Bin/.."; +# use Environment; + + +my $configFile = SETUPFILE; +my $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(); + + + + + +sub getDataValidate { +print < + +
+EOF + } + +sub getTriggerValidate { +print < + +
+EOF + } + + + +sub initPage { + + 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/nxyter/scripts.js new file mode 100644 index 0000000..dfdf5a4 --- /dev/null +++ b/web/htdocs/nxyter/scripts.js @@ -0,0 +1,102 @@ + + +function getdata(command,callback) { + var xmlhttp = null; + var cb = null; + xmlhttp=new XMLHttpRequest(); + cb = callback; + + xmlhttp.onreadystatechange = function() { + if(xmlhttp.readyState == 4) { + if(cb) + cb(xmlhttp.responseText); + } + } + xmlhttp.open("GET",command,true); + xmlhttp.send(null); + } + + +function getdataprint(command,dId,async) { + //async==true : do what you can when you can do it :D + //async==false : do the task after you finished the previous task! + + // super duper debug line! +// alert("caller is " + arguments.callee.caller.toString()); + + var xmlhttp = null; + //var cb = null; + xmlhttp=new XMLHttpRequest(); + //cb = callback; + var destId = dId; + + xmlhttp.onreadystatechange = function() { + if(xmlhttp.readyState == 4 && xmlhttp.status==200) { + //if(cb) + if(document.getElementById(destId)){ + document.getElementById(destId).innerHTML = xmlhttp.responseText; + } + //cb(xmlhttp.responseText); + //document.getElementById(destId).innerHTML = xmlhttp.responseText; + } + } + + xmlhttp.open("GET",command,async); + xmlhttp.send(null); + } + + +function SciNotation(v) { + if (v == 0) return "0"; + if (v < 1000) return v; + if (v < 20000) return (v/1E3).toFixed(3)+"k" ; + if (v < 1E6) return (v/1E3).toFixed(2)+"k" ; + if (v < 20E6) return (v/1E6).toFixed(3)+"M" ; + if (v < 1E9) return (v/1E6).toFixed(2)+"M" ; + if (v < 20E9) return (v/1E9).toFixed(3)+"G" ; + if (v < 1E12) return (v/1E9).toFixed(2)+"G" ; + return v; + } + + + +function findcolor(v,min,max,lg) { + if (!(v>0)){ v = 0;} + if (v && lg){ v = log(v);} + if (min && lg){ min = log(min);} + if (max && lg){ max = log(max);} + if (max == undefined){max = 1;} + + step = ((max-min)/655); + v = Math.round(v); + + if (v == 0 || vNumber of hit overflows - - Trigger Rate - - - - Number of Hits on nxyter - - + + + Total hit rate summed over all channels + + + + Number of Hits on nxyter + + + diff --git a/xml-db/get.pl b/xml-db/get.pl index 4530549..37a009e 100755 --- a/xml-db/get.pl +++ b/xml-db/get.pl @@ -128,15 +128,16 @@ sub FormatPretty { when ("integer") {$ret .= sprintf("$cl>%i",$value);} when ("unsigned") {$ret .= sprintf("$cl>%u",$value);} when ("signed") {$ret .= sprintf("$cl>%d",$value);} - when ("binary"|"bitmask") {$ret .= sprintf("%0".$obj->{bits}."b",$value);} + when ("binary") {$ret .= sprintf("$cl>%0".$obj->{bits}."b",$value);} + when ("bitmask") {$ret .= sprintf("$cl>%0".$obj->{bits}."b",$value);} when ("time") {$ret .= time2str('>%Y-%m-%d %H:%M',$value);} when ("hex") {$ret .= sprintf("$cl>%8x",$value);} - when ("enum") { my $t = sprintf(">%x",$value); + when ("enum") { my $t = sprintf("%x",$value); if (exists $obj->{enumItems}->{$t}) { - $ret .= $obj->{enumItems}->{$t} + $ret .= '>'.$obj->{enumItems}->{$t} } else { - $ret .= $t; + $ret .= '>'.$t; } } default {$ret .= sprintf(">%08x",$value);} @@ -219,6 +220,7 @@ 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); @@ -228,25 +230,25 @@ sub generateoutput { my $stepsize = $obj->{stepsize} || 1; $slice = 0 unless defined $slice; - do { my $addr = $obj->{address}+$slice*$stepsize; #### Prepare table header line - $t = "
"; - $t .= sprintf("
{description}\">".$name,$addr); + $t .= sprintf("
{description}\">".$name,$addr); if($obj->{type} eq "registerfield" || $obj->{type} eq "field"){ $t .= "{description}\">$name"; + $t .= ".$slice" if(defined $obj->{repeat}); } elsif($obj->{type} eq "register"){ foreach my $c (@{$obj->{children}}){ $oc = $db->{$c}; - $t .= sprintf("{description}\">$c",$oc->{bits},$oc->{start}); + $t .= sprintf("{description}\">$c",$c,$oc->{bits},$oc->{start}); } - } + } + # print DumpTree($data->{$addr}); - foreach my $b (sort keys %$data->{$addr}) { + foreach my $b (sort keys %{$data->{$addr}}) { $t .= sprintf("
%04x",$data->{$addr}->{$b},$b); if($obj->{type} eq "register") { foreach my $c (@{$obj->{children}}) { @@ -257,10 +259,10 @@ sub generateoutput { $t .= FormatPretty($data->{$addr}->{$b},$obj,"td"); } } - + } while($once != 1 && defined $obj->{repeat} && ++$slice < $obj->{repeat}); - $t .= "
"; } + $t .= "
"; print $t; }