Exemplo n.º 1
0
def _makehtml():
  global cfg
  html="""
<HTML>
<HEAD>
<meta HTTP-EQUIV="Refresh" CONTENT=60>
<TITLE>LTU counters</TITLE> 
<!-- <link type="text/css" rel="stylesheet" href="trigsim.css"> -->
<style type="text/css">
  body { color: black; background: white; }
  textarea { background: rgb(204,204,255); font-size:80%;} 
  input { background: rgb(204,204,255); } 
  TD.busy { background: #ccff00; } 
  TD.l0   { background: #cc9933; } 
  TD.l1   { background: #cc33cc; } 
  TD.l2   { background: #ccff99; } 
  TD.int  { background: #ccffff; } 
  TD.ltu  { background: #ccff00; } 
  TD.fo1,TD.fo2,TD.fo3,TD.fo4,TD.fo5,TD.fo6 { background: #cccccc; } 
  div.color {
    background: rgb(204,204,255);
    padding: 0.5em;
    border: none;
  }
</style>

<SCRIPT LANGUAGE="JavaScript">
var Result=""
function testSelect(select) {
  //Item = select.selectedIndex;
  for(Item=0; Item<select.length; Item++) {
    if(select.options[Item].selected) {
      Result = Result + select.options[Item].text + " ";
    }
  };
  //alert ("Index:"+select.selectedIndex+" Value:"+Result);
  //document.writeln("<HTML><HEAD></HEAD><BODY><h1>docwrit</h1></BODY></HTML>")
  alert (" Selected:"+Result);
}
function testButton (what){
    alert ("what:"+what+" Result:"+Result);
}
</SCRIPT>
</HEAD>
<BODY>
<center><H2> LTU counters </H2></center>
<FORM NAME="testform" METHOD="GET" ACTION="show">
<TABLE>
<TR>
"""
  #nebavi:
  #<FORM NAME="testform" METHOD="GET" ACTION="cnt/show">
  #<FORM NAME="testform" METHOD="GET" ACTION="http://pcalicebhm05.cern.ch/CNTWEB/show">
  for brd in ["allltus", "ltu"]:
  #for brd in ("l0",):
    print "board:",brd
    html= html + cfg.allboards[brd].makeTD()
  # brief help:
  html= html + """
<TD>
<ul>
<li> <b>time: </b> 1 second interval in 0.4 micsecs units (2.5M) </li>
<li> <b>busy: </b> the average time (in 0.4micsecs units), when LTU was busy during 1 second</li>
<li><b>busy_ts: </b> the average number of busy transitions per second</li>
<li><b>l2a_strobe: </b> the average number of accepted triggers per second</li>
<li><b>temp: </b> the board temperature</li>
<li><b>dead-busy_ts: </b>the average deadtime calculated as: busy*0.4/busy_ts  </li>
<li><b>dead-l2a: </b>the average deadtime calculated as: busy*0.4/l2a_strobe  </li>
<li><b>busyOverTime: </b>the fraction of the busy time caculated as: busy/time  </li>
</ul>
"""
  #html= html + "<TR>"
  html= html + cntcom.userrequest(cfg)
  for ixcnt in range(len(cfg.allboards["ltu"].counters)):
    cnt= cfg.allboards["ltu"].counters[ixcnt]
    if cnt.selected:
      #html=html+' '+cnt.coname
      for ixltu in range(len(cfg.allboards["allltus"].counters)):
        ltu= cfg.allboards["allltus"].counters[ixltu]
        if ltu.selected:
          #html=html+': '+ltu.coname
          html= html + cnt.makeImage(ltu.coname)
  html= html +"<BR>\n"
  #pf= os.popen("printenv"); cmdout=pf.read(); pf.close()
  #html= html +cmdout +"<BR>\n"
  #html= html +"<img src=graf.png>\n"
  #pf= os.popen("ls"); cmdout=pf.read(); pf.close()
  #html= html +cmdout +"<BR>\n"
  html= html +"<HR> dbg:" + cfg.cfginit + ':' + cfg.period + ':'
  html= html + """<BR>Warning: I (Renato Borges) have changed this page in 9/5/2009 to self-refresh every minute. If this causes problems, it can be reverted by running the following commands on a terminal:<BR>
  sshs<BR>
  mv /data/ClientCommonRootFs/usr/local/trigger/v/vme/CNTWEB/ltus.py.old /data/ClientCommonRootFs/usr/local/trigger/v/vme/CNTWEB/ltus.py<BR>
  </BODY>
</HTML>
"""
  return html
Exemplo n.º 2
0
def _makehtml():
  global cfg
  html="""
<HTML>
<HEAD>
<meta HTTP-EQUIV="Refresh" CONTENT=10>
<TITLE>CTP counters</TITLE> 
<!-- <link type="text/css" rel="stylesheet" href="trigsim.css"> -->
<style type="text/css">
  body { color: black; background: white; }
  textarea { background: rgb(204,204,255); font-size:80%;} 
  input { background: rgb(204,204,255); } 
  TD.busy { background: #ccff00; } 
  TD.l0   { background: #cc9933; } 
  TD.l1   { background: #cc33cc; } 
  TD.l2   { background: #ccff99; } 
  TD.int  { background: #ccffff; } 
  TD.ltu  { background: #ccff00; } 
  TD.fo1,TD.fo2,TD.fo3,TD.fo4,TD.fo5,TD.fo6 { background: #cccccc; } 
  div.color {
    background: rgb(204,204,255);
    padding: 0.5em;
    border: none;
  }
</style>

<SCRIPT LANGUAGE="JavaScript">
var Result=""
function testSelect(select) {
  //Item = select.selectedIndex;
  for(Item=0; Item<select.length; Item++) {
    if(select.options[Item].selected) {
      Result = Result + select.options[Item].text + " ";
    }
  };
  //alert ("Index:"+select.selectedIndex+" Value:"+Result);
  //document.writeln("<HTML><HEAD></HEAD><BODY><h1>docwrit</h1></BODY></HTML>")
  alert (" Selected:"+Result);
}
function testButton (what){
    alert ("what:"+what+" Result:"+Result);
}
</SCRIPT>
</HEAD>
<BODY>
<center><H2> CTP counters </H2></center>
<FORM NAME="testform" METHOD="GET" ACTION="show">
<TABLE>
<TR>
"""
  #nebavi:
  #<FORM NAME="testform" METHOD="GET" ACTION="cnt/show">
  #<FORM NAME="testform" METHOD="GET" ACTION="http://pcalicebhm05.cern.ch/CNTWEB/show">
  for brd in BL012I:
  #for brd in ("l0",):
    print "board:",brd
    html= html + cfg.allboards[brd].makeTD()
  html= html + "<TR>\n"
  for brd in FOS:
    html= html + cfg.allboards[brd].makeTD()
  #<INPUT TYPE="submit" NAME="deselect" VALUE="deselect all">
  html= html + cntcom.userrequest(cfg)
  for brd in BL012I + FOS:
  #for brd in ("l0",):
    for ixcnt in range(len(cfg.allboards[brd].counters)):
      cnt= cfg.allboards[brd].counters[ixcnt]
      if cnt.selected:
        html= html + cnt.makeImage()
  html= html +"<BR>\n"
  #pf= os.popen("printenv"); cmdout=pf.read(); pf.close()
  #html= html +cmdout +"<BR>\n"
  #html= html +"<img src=graf.png>\n"
  #pf= os.popen("ls"); cmdout=pf.read(); pf.close()
  #html= html +cmdout +"<BR>\n"
  html= html +"<HR> dbg:" + cfg.cfginit
  #html= html + str(os.environ)
  html= html + """<BR>Warning: I (Renato Borges) have changed this page in 9/7/2009 to self-refresh every 10 seconds. If this causes problems, it can be reverted by running the following commands on a terminal:<BR>
  sshs<BR>
  mv /data/ClientCommonRootFs/usr/local/trigger/v/vme/CNTWEB/cnt.py.old /data/ClientCommonRootFs/usr/local/trigger/v/vme/CNTWEB/cnt.py<BR>
  </BODY>
</HTML>
"""
  return html
Exemplo n.º 3
0
def _makehtml():
  global cfg
  html="""
<HTML>
<HEAD>
<TITLE>LTU counters</TITLE> 
<!-- <link type="text/css" rel="stylesheet" href="trigsim.css"> -->
<style type="text/css">
  body { color: black; background: white; }
  textarea { background: rgb(204,204,255); font-size:80%;} 
  input,select { background: rgb(204,204,255); } 
  TD.busy { background: #ccff00; } 
  TD.l0   { background: #cc9933; } 
  TD.l1   { background: #cc33cc; } 
  TD.l2   { background: #ccff99; } 
  TD.int  { background: #ccffff; } 
  TD.ltu  { background: #ccff00; } 
  TD.fo1,TD.fo2,TD.fo3,TD.fo4,TD.fo5,TD.fo6 { background: #cccccc; } 
  div.color {
    background: rgb(204,204,255);
    padding: 0.5em;
    border: none;
  }
</style>

<SCRIPT LANGUAGE="JavaScript">
var Result=""
function testSelect(select) {
  //Item = select.selectedIndex;
  for(Item=0; Item<select.length; Item++) {
    if(select.options[Item].selected) {
      Result = Result + select.options[Item].text + " ";
    }
  };
  //alert ("Index:"+select.selectedIndex+" Value:"+Result);
  //document.writeln("<HTML><HEAD></HEAD><BODY><h1>docwrit</h1></BODY></HTML>")
  alert (" Selected:"+Result);
}
function testButton (what){
    alert ("what:"+what+" Result:"+Result);
}
</SCRIPT>
</HEAD>
<BODY>
<center><H2> LTU counters </H2></center>
<FORM NAME="testform" METHOD="GET" ACTION="show">
<TABLE>
<TR>
"""
  #nebavi dajak:
  #<FORM NAME="testform" METHOD="GET" ACTION="ltus/show">
  #<FORM NAME="testform" METHOD="GET" ACTION="http://pcalicebhm05.cern.ch/CNTWEB/show">
  for brd in ["allltus", "ltu"]:
  #for brd in ("l0",):
    print "board:",brd
    html= html + cfg.allboards[brd].makeTD()
  # brief help:
  html= html + """
<TD>
<ul>
<li> <b>time: </b> 1 second interval in 0.4 micsecs units (2.5M) </li>
<li> <b>busy: </b> the average time (in 0.4micsecs units), when LTU was busy during 1 second</li>
<li><b>busy_ts: </b> the average number of busy transitions per second</li>
<li><b>l2a_strobe: </b> the average number of accepted triggers per second</li>
<li><b>temp: </b> the board temperature</li>
<li><b>dead-busy_ts: </b>the average deadtime in ms calculated as: busy*0.4/busy_ts  </li>
<li><b>dead-l2a: </b>the average deadtime calculated as: busy*0.4/l2a_strobe  </li>
<li><b>busyOverTime: </b>the fraction of the busy time caculated as: busy/time  </li>
</ul>
"""
  #html= html + "<TR>"
  assmbling= cfg.grouping ; linlog= cfg.yaxis
  html= html + cntcom.userrequest(cfg, getddm(assmbling, linlog))
  if assmbling == "none":
    for ixcnt in range(len(cfg.allboards["ltu"].counters)):
      cnt= cfg.allboards["ltu"].counters[ixcnt]
      if cnt.selected:
        #html=html+' '+cnt.coname
        for ixltu in range(len(cfg.allboards["allltus"].counters)):
          ltu= cfg.allboards["allltus"].counters[ixltu]
          if ltu.selected:
            #html=html+': '+ltu.coname
            html= html + RRDimg.MakeImage([ltu.coname],[cnt.coname])
  elif assmbling == "alls":
    cntnames= []
    for ixcnt in range(len(cfg.allboards["ltu"].counters)):   #over signals
      cnt= cfg.allboards["ltu"].counters[ixcnt]
      if cnt.selected:
        #html=html+' '+cnt.coname
        # assembling all ltus into 1 signal-graph
        cntnames.append(cnt.coname)
        ltunames= []   # list of LTU names
        for ixltu in range(len(cfg.allboards["allltus"].counters)):
          ltu= cfg.allboards["allltus"].counters[ixltu]
          if ltu.selected:
            ltunames.append(ltu.coname)
    #html= html + ' ' + str(ltunames) + str(cntnames)+ "<BR>\n"
    html= html + RRDimg.MakeImage(ltunames, cntnames)
  elif assmbling == "ltus":
    for ixcnt in range(len(cfg.allboards["ltu"].counters)):   #over signals
      cnt= cfg.allboards["ltu"].counters[ixcnt]
      if cnt.selected:
        #html=html+' '+cnt.coname
        # assembling all ltus into 1 signal-graph
        conames= []   # list of LTU names
        for ixltu in range(len(cfg.allboards["allltus"].counters)):
          ltu= cfg.allboards["allltus"].counters[ixltu]
          if ltu.selected:
            conames.append(ltu.coname)
        #html= html + ' ' + str(conames) + cnt.coname + "<BR>\n"
        html= html + RRDimg.MakeImage(conames, [cnt.coname])
  elif assmbling == "sigs":
    for ixltu in range(len(cfg.allboards["allltus"].counters)):   # over ltus
      ltu= cfg.allboards["allltus"].counters[ixltu]
      if ltu.selected:
        #html=html+': '+ltu.coname
        conames= []   # list of CNT names
        for ixcnt in range(len(cfg.allboards["ltu"].counters)):
          ltusig= cfg.allboards["ltu"].counters[ixcnt]
          if ltusig.selected:
            conames.append(ltusig.coname)
        #html= html + ltu.coname + ' ' + str(conames) + "<BR>\n"
        html= html + RRDimg.MakeImage([ltu.coname], conames)
  #else   # 1 signal = 1 png
  html= html +"<BR>\n"
  #pf= os.popen("printenv"); cmdout=pf.read(); pf.close()
  #html= html +cmdout +"<BR>\n"
  #html= html +"<img src=graf.png>\n"
  #pf= os.popen("ls"); cmdout=pf.read(); pf.close()
  #html= html +cmdout +"<BR>\n"
  #html= html +"<HR> dbg:" + cfg.cfginit + ' period:' + cfg.period + ':'
  html= html + """</BODY>
</HTML>
"""
  return html
Exemplo n.º 4
0
def _makehtml():
  global cfg
  html="""
<HTML>
<HEAD>
<TITLE>CTP counters</TITLE> 
<!-- <link type="text/css" rel="stylesheet" href="trigsim.css"> -->
<style type="text/css">
  body { color: black; background: white; }
  textarea { background: rgb(204,204,255); font-size:80%;} 
  input { background: rgb(204,204,255); } 
  TD.busy { background: #ccff00; } 
  TD.l0   { background: #cc9933; } 
  TD.l1   { background: #cc33cc; } 
  TD.l2   { background: #ccff99; } 
  TD.int  { background: #ccffff; } 
  TD.ltu  { background: #ccff00; } 
  TD.fo1,TD.fo2,TD.fo3,TD.fo4,TD.fo5,TD.fo6 { background: #cccccc; } 
  div.color {
    background: rgb(204,204,255);
    padding: 0.5em;
    border: none;
  }
</style>

<SCRIPT LANGUAGE="JavaScript">
var Result=""
function testSelect(select) {
  //Item = select.selectedIndex;
  for(Item=0; Item<select.length; Item++) {
    if(select.options[Item].selected) {
      Result = Result + select.options[Item].text + " ";
    }
  };
  //alert ("Index:"+select.selectedIndex+" Value:"+Result);
  //document.writeln("<HTML><HEAD></HEAD><BODY><h1>docwrit</h1></BODY></HTML>")
  alert (" Selected:"+Result);
}
function testButton (what){
    alert ("what:"+what+" Result:"+Result);
}
</SCRIPT>
</HEAD>
<BODY>
<center><H2> CTP counters </H2></center>
<FORM NAME="testform" METHOD="GET" ACTION="show">
<TABLE>
<TR>
"""
  #nebavi:
  #<FORM NAME="testform" METHOD="GET" ACTION="cnt/show">
  #<FORM NAME="testform" METHOD="GET" ACTION="http://pcalicebhm05.cern.ch/CNTWEB/show">
  for brd in BL012I:
  #for brd in ("l0",):
    print "board:",brd
    html= html + cfg.allboards[brd].makeTD()
  html= html + "<TR>\n"
  for brd in FOS:
    html= html + cfg.allboards[brd].makeTD()
  #<INPUT TYPE="submit" NAME="deselect" VALUE="deselect all">
  uplimentry="""
&nbsp&nbsp&nbsp Upper limit:
<INPUT TYPE="text" NAME="upperlimit" SIZE="8" VALUE="%s" TITLE="e.g.: 1000 -limit upper shown rate to 1khz"
onMouseOver="window.status='Example: 1000 (1khz)   1000000  (1mhz)'; return true">
"""%cfg.upperlimit
  html= html + cntcom.userrequest(cfg, uplimentry)
  for brd in BL012I + FOS:
  #for brd in ("l0",):
    for ixcnt in range(len(cfg.allboards[brd].counters)):
      cnt= cfg.allboards[brd].counters[ixcnt]
      if cnt.selected:
        html= html + cnt.makeImage()
  html= html +"<BR>\n"
  #pf= os.popen("printenv"); cmdout=pf.read(); pf.close()
  #html= html +cmdout +"<BR>\n"
  #html= html +"<img src=graf.png>\n"
  #pf= os.popen("ls"); cmdout=pf.read(); pf.close()
  #html= html +cmdout +"<BR>\n"
  #html= html +"<HR> dbglog:" + cfg.dbgmsg
  #html= html + str(os.environ)
  html= html + """</BODY>
</HTML>
"""
  return html