]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Tue, 4 Dec 2012 16:40:31 +0000 (16:40 +0000)
committerhadeshyp <hadeshyp>
Tue, 4 Dec 2012 16:40:31 +0000 (16:40 +0000)
cts/htdocs/commands/nettrace.pl [new file with mode: 0755]
cts/htdocs/index.html [moved from cts/htdocs/index.htm with 95% similarity]
cts/htdocs/layout/styles.css
cts/htdocs/network/map.htm [new file with mode: 0644]

diff --git a/cts/htdocs/commands/nettrace.pl b/cts/htdocs/commands/nettrace.pl
new file mode 100755 (executable)
index 0000000..24472d7
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/perl -w
+&htsponse(200, "OK");
+print "Content-type: text/html\r\n\r\n";
+
+
+use Date::Format;
+use HADES::TrbNet;
+use Data::Dumper;
+
+ if (!defined &trb_init_ports()) {
+   die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}");
+ }
+
+
+my $boards = trb_read_uid(0xffff);
+my $types = trb_register_read(0xffff,0x42);
+my $ctime = trb_register_read(0xffff,0x40);
+my @store;
+
+foreach my $id (sort keys %{$boards}) {
+  foreach my $f (sort keys %{$boards->{$id}}) {
+    my $addr = $boards->{$id}->{$f};
+    my @path = trb_nettrace($addr);
+#     print Dumper @path;
+    my $o;
+    if(scalar @path == 0) {
+      $o->{parent} = 0;
+      }
+    else {
+      $o->{parent} = $path[-1][-1]->{address};
+      $o->{port}   = $path[-1][-1]->{port};
+      }
+    $o->{ctime}  = $ctime->{$addr};
+    $o->{type}   = $types->{$addr};
+    $o->{addr}   = $addr;
+    push (@store,$o);
+    }
+  }
+
+print printlist(0,1);
+
+sub printlist {
+  my ($parent,$layer) = @_;
+  if($layer > 16) {die "More than 16 layers of network devices found. Aborting."}
+  my @o;
+  foreach my $b (@store) {
+    if ($b->{parent} == $parent) {
+      push(@o,sprintf("%04x#%d#%d#%04x#%d#%s&",$b->{parent},$b->{port},$layer,$b->{addr},$b->{type},time2str('%Y-%m-%d %H:%M',$b->{ctime})));      $o[-1] .= printlist($b->{addr},$layer+1);
+      }
+    }
+  return join("",sort @o);
+  }
+sprintf("%4s\t%s\t%8s",$a, time2str('%Y-%m-%d %H:%M',hex($t)),$t);
+
+# parent port layer board type compiletime
similarity index 95%
rename from cts/htdocs/index.htm
rename to cts/htdocs/index.html
index c414c8bc75ddec990f3e669ccc1ceaec5bd43f07..551937da741ae1420cb68ea3e5bbd383388ea49e 100644 (file)
@@ -30,6 +30,7 @@ The main documentation of the network can be found in these two documents:
 <li><a href="padiwa/padiwa.htm">Padiwa</a>
 <li><a href="thresh/threshold.htm">Threshold settings</a>
 <li><a href="network/gbe.htm">GbE status</a>
+<li><a href="network/map.htm">Network Map</a>
 </ul>
 </div>
 </body>
index 082b64e6e1feda051cb963a650a1008af5bdbdce..2678db713a9e1cb5fbbc9f7d4f8230373e3b42fa 100644 (file)
@@ -179,15 +179,39 @@ width: 89px;
 
 
 #content .checkbox {
-
-
   display: block;
   float:left;
   margin:0px -15px 2px 0px;
-  padding:0px -15px 0px 0px;
+  padding:0px 0px 0px 0px;
 }
 
 
 .onoffbutton {
   width:22px;
-}
\ No newline at end of file
+}
+
+table#content.map td {border-bottom:none; margin-left:10px; text-align:right}
+table#content.map td:first-child {text-align:left;padding-left:15px; }
+table#content.map td + td + td + td {width:120px;}
+
+#content .level1 {background:#f5f5f5;}
+#content .level2 {background:#eaeaea;}
+#content .level3 {background:#dedede;}
+#content .level4 {background:#d0d0d0;}
+#content .level5 {background:#f5f5f5;}
+#content .level6 {background:#eaeaea;}
+#content .level7 {background:#dedede;}
+#content .level8 {background:#d0d0d0;}
+#content .level9 {background:#d0d0d0;}
+
+#content .level1 > td:first-child {   border-left:10px solid #333;}
+#content .level2 > td:first-child {   border-left:30px solid #333;}
+#content .level3 > td:first-child {   border-left:50px solid #333;}
+#content .level4 > td:first-child {  }
+#content .level5 > td:first-child {  }
+#content .level6 > td:first-child {  }
+#content .level7 > td:first-child {  }
+#content .level8 > td:first-child {  }
+#content .level9 > td:first-child {  }
+#content .newlevel td {border-top:1px solid #aaa;}
+/* #content .oldlevel td {border-top-style:hidden;}  */
diff --git a/cts/htdocs/network/map.htm b/cts/htdocs/network/map.htm
new file mode 100644 (file)
index 0000000..d718f87
--- /dev/null
@@ -0,0 +1,81 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<link href="../layout/styles.css" rel="stylesheet" type="text/css"/>
+<script src="../scripts/scripts.js" type="text/javascript"></script>
+<title>Network Map</title>
+</head>
+<body>
+
+
+<h2>Network Map</h2>
+<form acion="">
+<table class="form"><tr class="head"><th colspan=2>Configuration
+<tr><td><td><input type="button" onClick="location.reload()" value="Reload">
+</table>
+</form>
+
+<div style="float:left"><table id="content" class="map"><tr><th>Register<th>Values</table></div>
+
+
+<script language="javascript">
+
+
+
+function update(data) {
+  if(!document.getElementById("content").innerHTML) return;
+  var b = data.split("&");
+  var c = {};
+  var lastlevel = 1;
+  o = "<tr class=\"head map\"><th>Board<th>Hardware<th>AddOn<th>Design<th>Compile Time";
+
+  for(j=0;j<b.length-1;j++) {
+    c[j] = b[j].split("#");
+    o += "<tr class=\"level"+c[j][2]+" ";
+    if(lastlevel!=c[j][2])  o += "newlevel"; else o += "oldlevel";
+    o += "\"><td>"+c[j][3];
+    o += "<td>";
+    
+    type = (c[j][4]>>24&0xff);
+    switch(type) {
+      case 0x90: o+= "TRB3 central"; break;
+      case 0x91: o+= "TRB3 periph"; break;
+      case 0x92: o+= "CBM-Rich"; break;
+      case 0x62: o+= "Hub AddOn"; break;
+      case 0x52: o+= "CTS"; break;
+      case 0x42: o+= "Shower AddOn"; break;
+      case 0x33: o+= "RICH ADCM"; break;
+      case 0x23: o+= "MDC OEP"; break;
+      case 0x12: o+= "MDC Hub"; break;
+      }
+    
+    o += "<td>";
+    if(type == 0x91) {
+      switch(c[j][4]>>12 & 0xF) {
+        case 0: o += "ADA v1"; break;
+        case 1: o += "ADA v2"; break;
+        case 2: o += "Multitest"; break;
+        case 3: o += "SFP"; break;
+        case 4: o += "Padiwa"; break;
+        default: o+= "---";
+        }
+      }
+    else 
+      o+= "---";
+    o += "<td>";
+    o += "<td>"+c[j][5];
+    
+    lastlevel = c[j][2];
+    } 
+  document.getElementById("content").innerHTML  = o;
+  }
+
+    
+getdata('../commands/nettrace.pl',update);
+
+  
+//parent port layer board type compiletime  
+</script>
+</body></html>
+