From: Jan Michel Date: Wed, 31 Jul 2013 10:02:00 +0000 (+0200) Subject: changed timer handling X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=51449eb87e6df6f8a2e3eb3e7ce82cb6987dff30;p=daqtools.git changed timer handling --- diff --git a/web/htdocs/thresh/threshold.htm b/web/htdocs/thresh/threshold.htm index 5a55265..c775d67 100644 --- a/web/htdocs/thresh/threshold.htm +++ b/web/htdocs/thresh/threshold.htm @@ -17,7 +17,8 @@ Board Type Update Interval (ms) Reference (mV) -Last read-back +Last read +Last set @@ -60,7 +61,7 @@ var chain = document.getElementById("form_chain").value; 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 updateTask = 0; var total = 0; @@ -73,7 +74,7 @@ function update(bar,scale) { command = command.toString(16); dataWaiting = 1; if(updateTask == 0) { - updateTask = setInterval("doUpdate()",updaterate); + updateTask = setTimeout("doUpdate()",updaterate); } } @@ -81,16 +82,22 @@ 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< 65535) - document.getElementById("bar1").scrollLeft = 65535; -if(document.getElementById("bar1").scrollLeft < 0) - document.getElementById("bar1").scrollLeft = 0; -update(1,1); -} + document.getElementById("bar1").scrollLeft+=i; + if(document.getElementById("bar1").scrollLeft > 65535) + document.getElementById("bar1").scrollLeft = 65535; + if(document.getElementById("bar1").scrollLeft < 0) + document.getElementById("bar1").scrollLeft = 0; + update(1,1); + } Mousetrap.bind('pageup', function(){changebar(256); return false;}); Mousetrap.bind('pagedown', function(){changebar(-256); return false;}); @@ -144,6 +156,10 @@ Mousetrap.bind('up', function(){changebar(1); return false;}); Mousetrap.bind('down', function(){changebar(-1); return false;}); Mousetrap.bind('shift+up', function(){changebar(16); return false;}); Mousetrap.bind('shift+down', function(){changebar(-16); return false;}); + + +setTimeout("setValues()",100); +