]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Total Dead Counter in CTS
authorManuel Penschuck <manuel.penschuck@stud.uni-frankfurt.de>
Tue, 4 Nov 2014 15:32:04 +0000 (16:32 +0100)
committerManuel Penschuck <manuel.penschuck@stud.uni-frankfurt.de>
Tue, 4 Nov 2014 15:32:04 +0000 (16:32 +0100)
web/CtsPlugins/CtsModStatic.pm
web/htdocs/cts/cts.htm
web/htdocs/scripts/cts.js

index ed0d6a52e5daa0d781f77c89f4512e94b5b8ffee..d87195ff73a5ae15b38f9de1b704288991f2a502 100755 (executable)
@@ -184,6 +184,19 @@ sub init {
       }
    }
 
+   if ($prop->{'trb_compiletime'} >  1415039170) {
+    eval {
+        $regs->{'cts_cnt_total_dead_time'} = TrbRegister->new(0x0e + $debug_block, $trb, {}, {
+            'accessmode' => "ro",
+            'label' => "Total Dead Time Counter",
+            'monitorrate' => 1
+        });   
+        $regs->{'cts_cnt_total_dead_time'}->read();
+        1;
+    } and do {
+        $prop->{'cts_cnt_total_dead_time'} = 1;
+    }
+  }
 }
 
 1;
index 2f4efd21c607b6c038f497281d3aa7368d6ec988..fa466401c4bf872109da838e954ce5a9cc54c18f 100644 (file)
                      <td class="value autoupdate" slice="cts_cnt_dead_time.value" format="countToTime" suffix=" ns">n/a</td>
                      <td class="rate  autoupdate" slice="cts_cnt_dead_time.value" format="countToFreq">n/a</td>
                   <tr>
+                  
+                  <tr id="cnt_total_dead_time_row">
+                     <td class="label">Total Dead Time</td>
+                     <td class="rate autorate" slice="cts_cnt_total_dead_time.value" format="countToTime" suffix=" ns">n/a</td>
+                     <td class="rate autorate" slice="cts_cnt_total_dead_time.value" format="rateToRatio">n/a</td>
+                  <tr>
 
                   <tr>
                      <td colspan="3">&nbsp;</td>
index cebfd19f4d27a740ae95f8e50e09bf7154f7661c..462ba073c446f6391a86edd2a8a50349605f7006 100644 (file)
@@ -105,6 +105,10 @@ var CTS = new Class({
 
       this.initEventBuilderRR();
       
+      if (!this.defs.properties.cts_cnt_total_dead_time) {
+        $('cnt_total_dead_time_row').destroy();
+      }
+
       this.initAutoCommit();
       this.initSliceTitle();
    },
@@ -836,6 +840,7 @@ function countToTime(val) {return (1.0*val / cts.defs.properties.cts_clock_frq *
 function countToFreq(val) {return formatFreq (1 / (val / cts.defs.properties.cts_clock_frq)); }
 function timeToCount(val) {return (parseNum(val) / 1.0e9 * cts.defs.properties.cts_clock_frq).round();}
 function rateToFrac(val) {return appendScalingPrefix(val) + 'cnt/s'}
+function rateToRatio(val) {return (val / 1e6).toFixed(1) + '%';}
 
 function formatFreq(val, sigDigits) {
    return appendScalingPrefix(val, sigDigits) + "Hz";