]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Mon, 22 Oct 2012 11:35:02 +0000 (11:35 +0000)
committerhadeshyp <hadeshyp>
Mon, 22 Oct 2012 11:35:02 +0000 (11:35 +0000)
cts/htdocs/thresh/setbit.pl [new file with mode: 0644]
cts/htdocs/thresh/spiexec.pl [new file with mode: 0755]
cts/htdocs/thresh/tdc.htm
cts/htdocs/thresh/threshold.htm

diff --git a/cts/htdocs/thresh/setbit.pl b/cts/htdocs/thresh/setbit.pl
new file mode 100644 (file)
index 0000000..6d2d6fe
--- /dev/null
@@ -0,0 +1,26 @@
+&htsponse(200, "OK");
+print "Content-type: text/html\r\n\r\n";
+
+
+
+use HADES::TrbNet;
+use Data::Dumper;
+
+ if (!defined &trb_init_ports()) {
+   die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}");
+ }
+
+my ($board,$addr,@values) = split('-',$ENV{'QUERY_STRING'}); 
+
+if(!defined $board || !defined $addr || !defined $values[0]) {exit -1;}
+$board = hex($board);
+$addr = hex($addr);
+
+for(my $x = 0; $x < scalar @values; $x++) {
+  $values[$x] = hex($values[$x]);
+  }
+
+
+my $hits = trb_register_write_mem($board,$addr,0,\@values,scalar @values);
+  
+exit 1;
\ No newline at end of file
diff --git a/cts/htdocs/thresh/spiexec.pl b/cts/htdocs/thresh/spiexec.pl
new file mode 100755 (executable)
index 0000000..e372cb4
--- /dev/null
@@ -0,0 +1,36 @@
+&htsponse(200, "OK");
+print "Content-type: text/html\r\n\r\n";
+
+
+
+use HADES::TrbNet;
+use Data::Dumper;
+
+ if (!defined &trb_init_ports()) {
+   die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}");
+ }
+
+
+my ($board,$addr,@values) = split('-',$ENV{'QUERY_STRING'}); 
+
+if(!defined $board || !defined $addr || !defined $values[0]) {exit -1;}
+$board = hex($board);
+$addr = hex($addr);
+
+for(my $x = 0; $x < scalar @values; $x++) {
+  $values[$x] = hex($values[$x]);
+  }
+
+
+my $hits = trb_register_write_mem($board,$addr,0,\@values,scalar @values);
+
+$hits = trb_register_read($board,0xd412);
+
+  foreach my $b (sort keys %$hits) {
+    printf ("%04x",$b);
+    printf(" %d",($hits->{$b})&0xffff);
+    print "&";
+    }
+  
+  
+exit 1;
\ No newline at end of file
index 3ee87a054a48b81898bd83e5c890e752ff7c91cb..dc2eb3f0e361b3334b832e0eed6fccb66eca3a1c 100644 (file)
@@ -55,16 +55,16 @@ function update(data) {
     } 
   
   for(i = 1; i <= channels; i++) {
-    o += "<tr class=\""+(i%2?"odd":"even")+"\"><th>"+(i-1+0xc000).toString(16)+"<th>"+(i-1);
+    o += "<tr class=\""+(i%2?"odd":"even")+" "+((c[j][i]&0x80000000)?"high":"low")+"\"><th>"+(i-1+0xc000).toString(16)+"<th>"+(i-1);
     for(j=0;j<b.length-1;j++) {
       if(differences) {
-        val = c[j][i]- (oldvalues[j][i]||0);
+        val = (c[j][i] & 0xFFFFFF)- ((oldvalues[j][i]||0) & 0xFFFFFF);
         if (val < 0) {
           val += 0x1000000;
           }
         }
       else {
-        val = c[j][i];
+        val = c[j][i] & 0xFFFFFF;
         }
       o += "<td>"+(val & 0xffffff);
       }
index 5f842b02044cc43d4444a936cc20f53d52e189bf..c2d2fd49dcc6d4e5e2d90b056684d3cc655d2b25 100644 (file)
@@ -10,8 +10,8 @@
 
 <h2>Threshold Settings</h2>
 <form acion="">
-<table class="form"><tr class="head"><th colspan="2">Configuration<tr><td>Board:<td><input type="text" id="form_board" name="board" maxlength="4" value="fccc">
-<tr><td>DAC-Chain:<td><select id="form_chain" name="chain"><option>0<option>1<option>2<option>3<option>4<option>5<option>6<option>7<option>8<option>9<option>10<option>11<option>12<option>13<option>14<option>15</select>
+<table class="form"><tr class="head"><th colspan="2">Configuration<tr><td>Board<td><input type="text" id="form_board" name="board" maxlength="4" value="fccc">
+<tr><td>DAC-Chain<td><select id="form_chain" name="chain"><option>0<option>1<option>2<option>3<option>4<option>5<option>6<option>7<option>8<option>9<option>10<option>11<option>12<option>13<option>14<option>15</select>
 <tr><td>Channel<td><select id="form_channel" name="channel"><option>0<option>1<option>2<option>3<option>4<option>5<option>6<option>7<option>8<option>9<option>10<option>11<option>12<option>13<option>14<option>15</select>
 <tr><td>Board Type<td><select id="form_type" name="chain"><option value='3' selected>LTC242x DAC<option value='8'>Padiwa SPI</select>
 <tr><td>Update Interval (ms)<td><input type="text" id="form_rate" name="rate" maxlength="5" value="500">
@@ -47,6 +47,7 @@ var chan       = document.getElementById("form_channel").value;
 var type       = document.getElementById("form_type").value;
 var reference  = document.getElementById("form_ref").value;
 var updateTask = setInterval("doUpdate()",updaterate);
+var total      = 0;
 
 
 function update(bar,scale) {
@@ -75,20 +76,31 @@ function doUpdate() {
     }
   }
   
-function showret(d) {
-//   document.getElementById("err").innerHTML = d;
+function showret(d)  {}
+
+function anaret2(d) {
+  var s = d.split("&");
+  var t = s[0].split(" ");
+  document.getElementById("bar2").scrollLeft = 128*256;
+  document.getElementById("bar1").scrollLeft = t[1]-128;
   }
   
   
 function setValues() {
+  clearInterval(updateTask);
   updaterate = document.getElementById("form_rate").value;
   board      = document.getElementById("form_board").value;
   chain      = 1<<document.getElementById("form_chain").value;
   chan       = document.getElementById("form_channel").value;
   type       = document.getElementById("form_type").value;
   reference  = document.getElementById("form_ref").value;
-  clearInterval(updateTask);
-  updateTask = setInterval("doUpdate()",updaterate);
+  if(type == 8) {
+    cmdstring = "spiexec.pl?"+board+"-d400-"+(((chan << 16)).toString(16))+"-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-"+chain+"-1";
+    getdata(cmdstring,anaret2);
+    }
+  else{  
+    updateTask = setInterval("doUpdate()",updaterate);
+    }
   }