From 854abe1c6936fea1b068e25fe52585f59937fc6c Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Mon, 22 May 2017 17:37:21 +0200 Subject: [PATCH] Threshold GUI: add DiRich2 --- web/htdocs/thresh/threshold.htm | 48 +++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/web/htdocs/thresh/threshold.htm b/web/htdocs/thresh/threshold.htm index 0502aef..d463043 100644 --- a/web/htdocs/thresh/threshold.htm +++ b/web/htdocs/thresh/threshold.htm @@ -15,9 +15,10 @@ Board DAC-Chain Channel -Board Type +Board Type Update Interval (ms) Reference (mV) +DiRich2 Flash: Last read Last set @@ -77,12 +78,16 @@ 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"; - if(type != 0) { - command = (type << 20) + (chan << 16) + (total); + if(type == 0) { + command = total.toString(16); + } + else if(type == 2) { + command = (0x8 << 20) + ((chan%16+16) << 24) + (total); command = command.toString(16); } else { - command = total.toString(16); + command = (type << 20) + (chan << 16) + (total); + command = command.toString(16); } if(wasRead == 0) { dataWaiting = 1; @@ -95,17 +100,39 @@ function update(bar,scale) { } } +function FlashStore() { + if(type == 2) { + command = "20800000"; + cmdstring = "../commands/put.pl?"+board+"-d400-"+command+"-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-3-1"; + document.getElementById("timeset").style.background = "#a55"; + getdata(cmdstring,showret); + dataWaiting = 0; + } + } + +function FlashLoad() { + if(type == 2) { + command = "21800000"; + cmdstring = "../commands/put.pl?"+board+"-d400-"+command+"-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-3-1"; + document.getElementById("timeset").style.background = "#a55"; + getdata(cmdstring,showret); + dataWaiting = 0; + } + } function doUpdate() { if(dataWaiting) { - 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<