#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
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
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
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
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
--- /dev/null
+#!/bin/bash
+
+[ -n $1 ] && addr=0x3800 || addr=$1
+
+# TP
+trb_i2c w $addr 0x0008 32 0x01
+trb_i2c w $addr 0x0008 33 15
--- /dev/null
+#!/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
--- /dev/null
+#!/bin/bash
+
+[ -n $1 ] && addr=0x3800 || addr=$1
+
+# TT
+trb_i2c w $addr 0x0008 32 0x08
+trb_i2c w $addr 0x0008 33 15
--- /dev/null
+#!/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
--- /dev/null
+#!/bin/bash
+
+watch -n 1 " \
+trbcmd -d1 r 0x3800 0x8124; \
+trbcmd -d1 r 0x3800 0x8125; \
+trbcmd -d1 r 0x3800 0x8162; \
+"
+
--- /dev/null
+#!/bin/bash
+
+[ -n $1 ] && addr=0x3800 || addr=$1
+
+trbcmd w $addr 0x8100 1
+trbcmd w $addr 0x8101 1
--- /dev/null
+#!/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
--- /dev/null
+#!/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
--- /dev/null
+#!/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
--- /dev/null
+
+package xmlpage;
+
+
+my $active = -1;
+my @setup;
+
+sub getView {
+ my ($n) = @_;
+ $active = $n;
+
+ if($setup[$n]->{refresh}) {
+ print qq|<input type="button" class="stdbutton" onClick="getdataprint('../xml-db/get.pl?|.$setup[$n]->{cmd}.qq|','content',false);" value="Refresh">|;
+ }
+ print qq|<script language="javascript">setTimeout("getdataprint('../xml-db/get.pl?|.$setup[$n]->{cmd}.qq|','content',false)",400);</script>|;
+ print qq|<div id="content"></div>|;
+
+
+}
+
+
+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<scalar @setup;$i++) {
+ if($setup[$i]->{name} eq $command) {
+ $active = $i;
+ last;
+ }
+ }
+
+ print <<EOF;
+<HTML>
+<HEAD>
+<title>TrbNet Overview</title>
+<link href="../layout/styles.css" rel="stylesheet" type="text/css"/>
+<link href="../layout/blue.css" rel="stylesheet" title="Light Blue" type="text/css"/>
+EOF
+ printJavaScripts();
+ print qq(
+</HEAD>
+<BODY>
+<h2>TrbNet Overview</h2>
+<div id="overview">
+<div class="header">);
+
+for ( my $s = 0; $s < scalar @setup; $s++) {
+ print qq|<span class="|.(($n == $s)?"selected":"inactive").qq|"><a href="?|.$setup[$s]->{name}.qq|">|.$setup[$s]->{name}.qq|</a></span>|;
+ }
+print qq(</div>);
+
+if ($active!=-1) {
+ getView($active);
+ }
+
+print <<EOF ;
+
+</div>
+<div id="debugpane">
+<div class="header">Debug Output</div>
+debug text
+</div>
+
+
+</BODY>
+</HTML>
+EOF
+}
+
+
+
+
+sub printJavaScripts {
+
+####### javascript function land ################
+
+ print <<EOF;
+<script language="javascript" src="../scripts/scriptsnew.js"></script>
+
+<script language="javascript">
+
+</script>
+EOF
+}
+
+
+1;
\ No newline at end of file
#roterBereich, #blauerBereich, #fileSelection, #debug, #overview, #debugpane {
float:left;
position:relative;
- width:320px;
+/* width:320px; */
padding:10px;
margin:50px 10px 0 30px;
border-radius:5px;
}
#overview {
- width:1000px;
+ min-width:1000px;
margin:50px 0 0 20px;
}
max-width:100px;
overflow:hidden;
text-align:left;
+ background:#dde;
}
hr.queryresult {
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;
EOF
}
-
-
-sub initPage {
-
- print <<EOF;
-<HTML>
-<HEAD>
-<title>NXyter Status</title>
-<link href="../layout/styles.css" rel="stylesheet" type="text/css"/>
-<link href="blue.css" rel="stylesheet" title="Light Blue" type="text/css"/>
-EOF
- printJavaScripts();
- print qq(
-</HEAD>
-<BODY>
-<h2>NXyter Status</h2>
-<div id="overview">
-<div class="header">
- <span class=").($isDataValidate?"selected":"inactive").qq("><a href="?DataValidate">DataVal.</a></span>
- <span class=").($isTriggerValidate?"selected":"inactive").qq("><a href="?TriggerValidate">TrigVal.</a></span>
-</div>
-
-);
-if($isSetup) {
- print '<div class="content">';
- print '</div>';
- }
-if ($isDataValidate) {
- getDataValidate();
- }
-if ($isTriggerValidate) {
- getTriggerValidate();
- }
-print <<EOF ;
-
-</div>
-<div id="debugpane">
-<div class="header">Debug Output</div>
-debug text
-</div>
-
-
-</BODY>
-</HTML>
-EOF
-}
-
-
-
-
-sub printJavaScripts {
-
-####### javascript function land ################
-
- print <<EOF;
-<script language="javascript" src="scripts.js"></script>
-
-<script language="javascript">
-
-</script>
-EOF
-}
-
-
-
--- /dev/null
+&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;
+
+
<enumItem value="5">tmg and lvl1 dont match</enumItem>
<enumItem value="7">Done</enumItem>
</field>
- <field name="ShortPulse" start="4" bits="1" format="boolean">
+ <field name="ShortPulse" start="4" bits="1" format="boolean" errorflag="true">
<description>Last reference time was too short</description>
</field>
- <field name="MissingPulse" start="5" bits="1" format="boolean">
+ <field name="MissingPulse" start="5" bits="1" format="boolean" errorflag="true">
<description>Missing reference time</description>
</field>
- <field name="SpuriousPulse" start="6" bits="1" format="boolean">
+ <field name="SpuriousPulse" start="6" bits="1" format="boolean" errorflag="true">
<description>Spurious reference time</description>
</field>
<field name="WrongPolarity" start="7" bits="1" format="boolean" errorflag="true">
<field name="PulseTimeout" start="11" bits="1" format="boolean" errorflag="true">
<description>Reference time to LVL1 too long delay</description>
</field>
- <field name="TriggerNumberMatch" start="12" bits="1" format="boolean">
+ <field name="TriggerNumberMatch" start="12" bits="1" format="boolean" errorflag="true">
<description>Internal and received trigger number match</description>
</field>
<field name="MultiplePulse" start="13" bits="1" format="boolean" errorflag="true">
<field name="TriggerInputCount" start="0" bits="16" format="integer">
<description>Number of edges on trigger input</description>
</field>
- <field name="TriggerLength" start="16" bits="16" format="integer" scale="10" unit=" ns">
+ <field name="TriggerLength" start="16" bits="16" format="integer" scaleoffset="10" scale="10" unit=" ns">
<description>Length of last reference time signal</description>
</field>
</register>
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);}
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);}
sub generateoutput {
my ($obj,$name,$slice,$once) = @_;
my $t = "";
- $t = "<table class='queryresult'>";
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 = "<table class='queryresult'>";
my $stepsize = $obj->{stepsize} || 1;
$slice = 0 unless defined $slice;
}
} while($once != 1 && defined $obj->{repeat} && ++$slice < $obj->{repeat});
- }
$t .= "</table><hr class=\"queryresult\">";
+ }
print $t;
}