]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
almost final nxyter for today
authorHadaq@styx <hadaq@styx>
Fri, 11 Oct 2013 14:33:43 +0000 (16:33 +0200)
committerHadaq@styx <hadaq@styx>
Fri, 11 Oct 2013 14:33:50 +0000 (16:33 +0200)
19 files changed:
users/cosy_test/config/hubconfig.sh
users/cosy_test/config/nxyter/nxsetup.dat
users/cosy_test/config/nxyter/setup.sh
users/cosy_test/nxscripts/mode_p.sh [new file with mode: 0755]
users/cosy_test/nxscripts/mode_st.sh [new file with mode: 0755]
users/cosy_test/nxscripts/mode_t.sh [new file with mode: 0755]
users/cosy_test/nxscripts/mode_tp.sh [new file with mode: 0755]
users/cosy_test/nxscripts/quicklook.sh [new file with mode: 0755]
users/cosy_test/nxscripts/reset.sh [new file with mode: 0755]
users/cosy_test/nxscripts/set_dacs.sh [new file with mode: 0755]
users/cosy_test/nxscripts/trig_no.sh [new file with mode: 0755]
users/cosy_test/nxscripts/trig_pulser.sh [new file with mode: 0755]
web/htdocs/commands/xmlpage.pm [new file with mode: 0644]
web/htdocs/layout/blue.css [moved from web/htdocs/nxyter/blue.css with 98% similarity]
web/htdocs/nxyter/index.pl
web/htdocs/scripts/scriptsnew.js [moved from web/htdocs/nxyter/scripts.js with 100% similarity]
web/htdocs/trbnet/index.pl [new file with mode: 0755]
xml-db/database/TrbNet.xml
xml-db/get.pl

index 3c55ef3e72da905862fadf0a99c5d540724f8096..dedd2048961359144c18eb34d37290b45ea9451a 100755 (executable)
@@ -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
index 397a8d60e1d5581a3e1cbe10f2a458cc6f79440c..4a85babfe4aa4057418b9a6e69dc74ed91e69994 100644 (file)
@@ -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
index 23b3188561b65fad5b512572c4bdfe4bfc25c957..9088ab397303d4b05a842614552e7dc36323aa05 100755 (executable)
@@ -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 (executable)
index 0000000..3a2426b
--- /dev/null
@@ -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 (executable)
index 0000000..c0d497f
--- /dev/null
@@ -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 (executable)
index 0000000..f796aba
--- /dev/null
@@ -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 (executable)
index 0000000..5e9fa59
--- /dev/null
@@ -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 (executable)
index 0000000..cf6d477
--- /dev/null
@@ -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 (executable)
index 0000000..fc28403
--- /dev/null
@@ -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 (executable)
index 0000000..5af4ede
--- /dev/null
@@ -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 (executable)
index 0000000..4e1e37c
--- /dev/null
@@ -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 (executable)
index 0000000..53d1e24
--- /dev/null
@@ -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 (file)
index 0000000..b17b3ba
--- /dev/null
@@ -0,0 +1,91 @@
+
+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
similarity index 98%
rename from web/htdocs/nxyter/blue.css
rename to web/htdocs/layout/blue.css
index 65e1b0693a1c2db6966f2fc59c073e6c6e45d023..c84a02f1e203d9b8ceda823635071e15a9c565bc 100644 (file)
@@ -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  {
index 49fdb04b0f16d9267163316090bbd139549b5d60..1353051588e9b2291fa23343251afd3d62543b53 100755 (executable)
@@ -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 <<EOF;
 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
-}
-
-
-
diff --git a/web/htdocs/trbnet/index.pl b/web/htdocs/trbnet/index.pl
new file mode 100755 (executable)
index 0000000..9571455
--- /dev/null
@@ -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;
+
+
index 14256e5cda44be9ca4768952bb226d9bb800d033..f54ec9da9ee9630866e00135c537761482ae658c 100644 (file)
         <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">
@@ -50,7 +50,7 @@
       <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">
@@ -72,7 +72,7 @@
       <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>
index 37a009e5b5f2db623cfbf3c2a392948ccb1961ee..6ab5ccd2255183c32ef6d4c62d1f47a5a94229d2 100755 (executable)
@@ -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 = "<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;
 
@@ -261,8 +261,8 @@ sub generateoutput {
         }
       
       } while($once != 1 && defined $obj->{repeat} && ++$slice < $obj->{repeat});
-    }
     $t .= "</table><hr class=\"queryresult\">";
+    }
   print $t;
   }