From efb96438905fbc860a56c211ca29e400b40d70e2 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Wed, 28 Nov 2012 18:03:33 +0000 Subject: [PATCH] first padiwa GUI --- cts/htdocs/thresh/scripts.js | 67 +++++++++++++++++++++++------------- cts/htdocs/thresh/styles.css | 2 +- cts/htdocs/thresh/tdc.htm | 2 +- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/cts/htdocs/thresh/scripts.js b/cts/htdocs/thresh/scripts.js index 65503b7..7aef44d 100644 --- a/cts/htdocs/thresh/scripts.js +++ b/cts/htdocs/thresh/scripts.js @@ -30,26 +30,47 @@ function SciNotation(v) { } -// function reload() { -// xmlhttp=new XMLHttpRequest(); -// xmlhttp.onreadystatechange = function() { -// if(xmlhttp.readyState == 4) { -// document.getElementById("content").innerHTML=xmlhttp.responseText; -// if(document.getElementById('logbox')) { -// if(saveScrollTop) { -// document.getElementById('logbox').scrollTop = saveScrollTop; -// } -// } -// -// document.getElementById("stop").style.background="#444"; -// reloadevery = setTimeout('reload()',$.($delay*1000).qq$); -// } -// }; -// if(document.getElementById('logbox')) { -// saveScrollTop = document.getElementById('logbox').scrollTop; -// if (saveScrollTop == 0) {saveScrollTop = 0.1;} -// } -// xmlhttp.open("GET","get.cgi?$.$ENV{'QUERY_STRING'}.qq$",true); -// xmlhttp.send(null); -// document.getElementById("stop").style.background="#111"; -// } \ No newline at end of file + +function findcolor(v,min,max,lg) { + if (!(v>0)){ v = 0;} + if (v && lg){ v = log(v);} + if (min && lg){ min = log(min);} + if (max && lg){ max = log(max);} + if (max == undefined){max = 1;} + + step = ((max-min)/655); + + + if (v == 0) { + r = 220; + g = 220; + b = 220; + } else { + v -= min; + if (step) { + v = v/step; + } + if (v<156) { + r = 0; + g = v+100; + b = 0; + } else if (v<412) { + v -= 156; + r = v; + g = 255; + b = 0; + } else { + v -= 412; + r = 255; + g = 255-v; + b = 0; + } + } +r = Math.round(r); +g = Math.round(g); +b = Math.round(b); + + alert("rgb("+(r%256)+","+(g%256)+","+(b%256)+")"); + return "rgb("+(r%256)+","+(g%256)+","+(b%256)+")"; + +} \ No newline at end of file diff --git a/cts/htdocs/thresh/styles.css b/cts/htdocs/thresh/styles.css index d6967fb..da9705d 100644 --- a/cts/htdocs/thresh/styles.css +++ b/cts/htdocs/thresh/styles.css @@ -136,6 +136,6 @@ input { width:182px; } -#form_rate, #form_rate2 { +#form_rate, #form_rate2, #form_min, #form_max { width: 89px; } \ No newline at end of file diff --git a/cts/htdocs/thresh/tdc.htm b/cts/htdocs/thresh/tdc.htm index f901b2f..87d39e3 100644 --- a/cts/htdocs/thresh/tdc.htm +++ b/cts/htdocs/thresh/tdc.htm @@ -37,7 +37,7 @@ var showstatus = document.getElementById("form_status").checked; var oldvalues = {}; -var reglist = "c100-c103-c104-c105-c106-c107-c108-c109-c10a-c10b-c10c-c10d-c10f-c110-c0-c2-c3"; +var reglist = "0-c100-c103-c104-c105-c106-c107-c108-c109-c10a-c10b-c10c-c10d-c10f-c110-c0-c2-c3"; //var reglist = "0-80-83-84-85-86-87-88-89-8a-8b-8c-8d-8f-90-c0-c2-c3"; var regs = reglist.split('-'); -- 2.43.0