]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
add option for setting thresholds on DiRich and other internal registers
authorJan Michel <j.michel@gsi.de>
Sat, 24 Sep 2016 17:31:39 +0000 (19:31 +0200)
committerJan Michel <j.michel@gsi.de>
Sat, 24 Sep 2016 17:31:39 +0000 (19:31 +0200)
web/htdocs/thresh/threshold.htm

index 5b920388f542f825092f4b6799a05bc9ff6a36d9..ac453542d6c969185ef72d041ffff07d628c9762 100644 (file)
@@ -14,8 +14,8 @@
 <table class="form"><tr class="head"><th colspan="2">Configuration
 <tr><td><u>B</u>oard<td><input onKeypress="catchEnter(event)" onChange="setValues()" type="text" id="form_board" name="board" maxlength="4" value="fccc">
 <tr><td>DAC-Chain<td><select onChange="setValues()"  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 onChange="setValues()" 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 onChange="setValues()" id="form_type" name="chain"><option value='3'>LTC242x DAC<option value='8' selected>Padiwa SPI</select>
+<tr><td>Channel<td><select onChange="setValues()" 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<option>16<option>17<option>18<option>19<option>20<option>21<option>22<option>23<option>24<option>25<option>26<option>27<option>28<option>29<option>30<option>31</select>
+<tr><td>Board Type<td><select onChange="setValues()" id="form_type" name="chain"><option value='3'>LTC242x DAC<option value='8' selected>Padiwa SPI<option value="0">on-board 0xa000</select>
 <tr><td><u>U</u>pdate Interval (ms)<td><input onKeypress="catchEnter(event)" onChange="setValues()" type="text" id="form_rate" name="rate" maxlength="5" value="500">
 <tr><td><u>R</u>eference (mV)<td><input onKeypress="catchEnter(event)" onChange="setValues()" type="text" id="form_ref" name="reference" maxlength="4" value="3330">
 <tr><td>Last read <td id="timeget">
@@ -77,8 +77,13 @@ function update(bar,scale) {
   document.getElementById("bar"+bar+"value").innerHTML = value[bar-1];
   total = Math.min(value[0]+value[1],65535);
   document.getElementById("total").innerHTML = total+" - 0x"+total.toString(16)+" - "+Math.round(total/655.36*reference)/100+" mV";
-  command = (type << 20) + (chan << 16) + (total);
-  command = command.toString(16);
+  if(type != 0) {
+    command = (type << 20) + (chan << 16) + (total);
+    command = command.toString(16);
+    }
+  else {
+    command = total.toString(16);
+    }
   if(wasRead == 0) {
     dataWaiting = 1;
     if(updateTask == 0) {  
@@ -93,7 +98,14 @@ function update(bar,scale) {
   
 function doUpdate() {
   if(dataWaiting) {
-    cmdstring = "../commands/put.pl?"+board+"-d400-"+command+"-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-"+(1<<chain)+"-1";
+    if(type != 0)  {
+      cmdstring = "../commands/put.pl?"+board+"-d400-"+command+"-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-"+(1<<chain)+"-1";
+      }
+    else {
+      adr = 0xa000 + chan*1;
+      adr = adr.toString(16);
+      cmdstring = "../commands/put.pl?"+board+"-"+adr+"-"+command;
+      }
     document.getElementById("timeset").style.background = "#a55";    
     getdata(cmdstring,showret);
     dataWaiting = 0;
@@ -141,6 +153,13 @@ function setValues() {
     document.getElementById("timeget").style.background = "#a55";
     getdata(cmdstring,anaret2);
     }
+  else if(type == 0) {
+    adr = 0xa000 + chan*1;
+    adr = adr.toString(16);
+    cmdstring = "../commands/get.pl?"+board+"-"+adr;
+    document.getElementById("timeget").style.background = "#a55";
+    getdata(cmdstring,anaret2);
+    }
   else{  
     updateTask = setTimeout("doUpdate()",updaterate);
     }
@@ -156,7 +175,7 @@ Mousetrap.bind('A', function() { board = (parseInt(board,16)-1).toString(16); do
   
 Mousetrap.bind('c', function() { ++chan; chan %= 16; document.getElementById("form_channel").value = chan; setValues(); });  
 Mousetrap.bind('d', function() { ++chain; chain %= 16; document.getElementById("form_chain").value = chain; setValues(); });  
-Mousetrap.bind(['C','v'], function() { --chan;  chan%=16;  if (chan<0)  chan=15;  document.getElementById("form_channel").value = chan; setValues(); });  
+Mousetrap.bind(['C','v'], function() { --chan;  chan%=32;  if (chan<0)  chan=31;  document.getElementById("form_channel").value = chan; setValues(); });  
 Mousetrap.bind(['D','f'], function() { --chain; chain%=16; if (chain<0) chain=15; document.getElementById("form_chain").value = chain; setValues(); });  
 Mousetrap.bind('r', function() { setValues(); });