]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
show MAC in extra column, correct MAC for TRB3sc
authorJan Michel <j.michel@gsi.de>
Fri, 26 Jan 2018 11:06:07 +0000 (12:06 +0100)
committerJan Michel <j.michel@gsi.de>
Fri, 26 Jan 2018 11:06:07 +0000 (12:06 +0100)
web/htdocs/network/map.htm [deleted file]
web/htdocs/network/map.pl

diff --git a/web/htdocs/network/map.htm b/web/htdocs/network/map.htm
deleted file mode 100644 (file)
index e2762bf..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<!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><a href="../">Network Map</a></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="content 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<th>Temperature";
-
-  for(j=0;j<b.length-1;j++) {
-    c[j] = b[j].split("#");
-    o += "<tr class=\"level level"+c[j][2]+" ";
-    if(lastlevel!=c[j][2])  o += "newlevel"; else o += "oldlevel";
-    o += "\"><td>";
-//     if(c[j][2]>1)  
-      o += "<div>"+c[j][1]+"</div>";
-    o += 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 0x93: o+= "CBM-Tof"; 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 title=\"0x"+(c[j][4]*1).toString(16)+"\">";
-    if(type == 0x91) {
-      switch(c[j][4]>>12 & 0x7) {
-        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;
-        case 5: o += "GPIN"; break;
-        case 6: o += "Nxyter"; break;
-       case 7: o += "32PinAddOn"; break;
-        default: o+= "---";
-        }
-      }
-    else 
-      o+= "---";
-    o += "<td title=\"0x"+(c[j][4]*1).toString(16)+"\">";
-    if(type == 0x91 || type == 0x92 || type == 0x93) {
-      if((c[j][4] & 0x8000) == 0x8000) o += "RX sync, ";
-      if((c[j][4] & 0x0b00) == 0x000 && (c[j][4]>>12 & 0x7) != 6 && (c[j][4]>>12 & 0x7) != 3 && (c[j][4]>>7 & 0x1) != 1) {o += "TDC, single, "+(Math.pow(2,(c[j][4]>>4)&0xf))+"ch, ";}
-      if((c[j][4] & 0xf000) == 0x6000) {o += "Nxyter RDO, ";}
-      if((c[j][4] & 0x0900) == 0x100) {o += "TDC, double, "+(Math.pow(2,(c[j][4]>>4)&0xf))+"ch, ";}
-      if((c[j][4] & 0x0900) == 0x800) {o += "TDC, dbl-sep, "+(Math.pow(2,(c[j][4]>>4)&0xf))+"ch, ";}
-      if((c[j][4] & 0x0200) == 0x200) o += "Hub, ";
-      if((c[j][4] & 0x0400) == 0x400) o += "SPI, ";
-      if((c[j][4] & 0x00f0) == 0x090) o += "MVD rdo 2013, ";
-      o = o.substring(0,o.length-2);  
-      }
-    if(type == 0x90) {
-      if((c[j][4] & 0xf001) == 0xc000) o += "CTS, ";
-      if((c[j][4] & 0xf001) == 0xc001) o += "CTS w/AddOn, ";
-      if((c[j][4] & 0x0f00) == 0x0e00) o += "GbE sctrl rdo, ";
-      if((c[j][4] & 0x0f00) == 0x0d00) o += "GbE rdo, ";
-      if((c[j][4] & 0x0010) != 0x0000) o += "opt. trg in, ";
-      if((c[j][4] & 0x0020) != 0x0000) o += "opt. sctrl in, ";
-      if((c[j][4] & 0x0040) != 0x0000) o += "opt. trg out, ";
-      if((c[j][4] & 0x0080) != 0x0000) o += "opt. sctrl out, ";
-      if(c[j][4] & 0xffff)
-        o = o.substring(0,o.length-2); 
-      }
-
-    o += "<td>"+c[j][5];
-    o += "<td>"+c[j][6]+"°C";
-    
-    lastlevel = c[j][2];
-    } 
-  document.getElementById("content").innerHTML  = o;
-  }
-
-    
-getdata('../commands/nettrace.pl',update);
-
-  
-//parent port layer board type compiletime  
-</script>
-</body></html>
-
index f86e908c02beb51bf734c4d9a7578fd80c3fce15..9e0707c605a57c49edaf41f702437be4fa68f989 100755 (executable)
@@ -63,7 +63,7 @@ if($ENV{'QUERY_STRING'} =~ /getmap/) {
     }
     
 
-    print "<table id=\"content\" class=\"content map\"><tr class=\"head map\"><th>Board<th>Hardware<th>Design<th>Compile Time<th>Temperature<th>UID - Endp (MAC)<th>serial\n";
+    print "<table id=\"content\" class=\"content map\"><tr class=\"head map\"><th>Board<th>Hardware<th>Design<th>Compile Time<th>Temperature<th>UID - Endp<th>MAC<th>serial\n";
     printlist(0,1);
     print "</table>";
     
@@ -215,8 +215,8 @@ if($ENV{'QUERY_STRING'} =~ /getmap/) {
 
       my $serial = GetSerial($uids->{$addr},$hardware->{$addr}>>24&0xff);
       my $mac = '';
-         $mac = GetMac($uids->{$addr}) if $feat =~ /GbE/;
-      printf("<tr class=\"level level%i%s\"><td><div>%i</div>0x%04x<td title=\"0x%08x\">%s<td title=\"0x%08x%08x\n%s\">%s<td title=\"0x%08x\">%s<td>%.1f°C<td title=\"%s\">%016x&nbsp;-&nbsp;%i<td>%s\n",
+         $mac = GetMac($uids->{$addr},$btype) if $feat =~ /GbE/;
+      printf("<tr class=\"level level%i%s\"><td><div>%i</div>0x%04x<td title=\"0x%08x\">%s<td title=\"0x%08x%08x\n%s\">%s<td title=\"0x%08x\">%s<td>%.1f°C<td>%016x&nbsp;-&nbsp;%i<td>%s<td>%s\n",
              $layer,
              ($layer!=$lastlayer?' newlevel':' oldlevel'),
              $p,
@@ -230,9 +230,9 @@ if($ENV{'QUERY_STRING'} =~ /getmap/) {
              $ctime->{$addr},
              time2str('%Y-%m-%d %H:%M',$ctime->{$addr}),
              ($temp->{$addr}>>20)/16,
-             $mac,
              $uids->{$addr},
              $endpid->{$addr},
+             $mac,
              $serial);
       
       $lastlayer = $layer;
@@ -316,8 +316,12 @@ sub GetSerial {
 
 sub GetMac {
   my $id = shift @_;
+  my $btype = shift @_;
   $id = sprintf('%08x',$id);
   my $r = 'da:7a:3'.substr($id,7,1).':'.substr($id,8,2).':'.substr($id,10,2).':'.substr($id,12,2);
+  if ($btype =~ /TRB3sc/) {
+     $r = 'da:7a:0'.substr($id,7,1).':'.substr($id,8,2).':'.substr($id,10,2).':'.substr($id,12,2);
+     }
   return $r;
   }