<h2>Padiwa</h2>
<form acion="">
<table class="form"><tr class="head"><th colspan=2>Configuration
-<tr><td>Board<td><input onChange="setValues()" type="text" id="form_board" name="board" maxlength="4" value="fe48">
-<tr><td>Update Interval (ms)<td><input onChange="setValues()" type="text" id="form_rate" name="rate" maxlength="6" value="10000">
-<tr><td>Option<td><select onChange="setValues()" id="form_option" name="option"><option value="temp">Temperature<option value="id">ID<option value="thresh">Thresholds</select>
-<tr><td>Min/Max<td><input onChange="setValues()" type="text" id="form_min" name="min" maxlength="6" value="10"><input onChange="setValues()" type="text" id="form_max" name="max" maxlength="6" value="80">
-<tr><td><td><input type="button" onClick="setValues()" value="OK">
+<tr title="4-digit hex board address for data query"><td>Board
+ <td><input onChange="setValues()" type="text" id="form_board" name="board" maxlength="4" value="fe48">
+<tr title="list of 4-digit hex addresses of boards to show"><td>Filter
+ <td><input onChange="setValues()" type="text" id="form_filter" name="filter" value="" >
+<tr title="Update interval in milliseconds"><td>Update Interval (ms)
+ <td><input onChange="setValues()" type="text" id="form_rate" name="rate" maxlength="6" value="10000">
+<tr title="Select the value to show"><td>Option
+ <td><select onChange="setValues()" id="form_option" name="option">
+ <option value="temp">Temperature
+ <option value="id">ID
+ <option value="thresh">Thresholds
+ </select>
+<tr title="Minimum & Maximum value for temperature color code"><td>Min/Max
+ <td><input onChange="setValues()" type="text" id="form_min" name="min" maxlength="6" value="10">
+ <input onChange="setValues()" type="text" id="form_max" name="max" maxlength="6" value="80">
+<tr title="Just for your convenience, you actually don't need this button..."><td>
+ <td><input type="button" onClick="setValues()" value="OK">
</table>
</form>
+
<div style="float:left"><table id="content"><tr><th>Board</table></div>
<script language="javascript">
var updaterate = document.getElementById("form_rate").value;
var board = document.getElementById("form_board").value;
+var filter = document.getElementById("form_filter").value;
var option = document.getElementById("form_option").value;
var min = document.getElementById("form_min").value;
var max = document.getElementById("form_max").value;
function setValues() {
updaterate = document.getElementById("form_rate").value;
board = document.getElementById("form_board").value;
+ filter = document.getElementById("form_filter").value;
option = document.getElementById("form_option").value;
min = document.getElementById("form_min").value;
max = document.getElementById("form_max").value;
if(!document.getElementById("content").innerHTML) return;
var b = data.split("&");
var c = {};
+ var isShown = new Array();
o = "<tr class=\"head\"><th>Board";
for(j=0;j<b.length-1;j++) {
c[j] = b[j].split(" ");
- o += "<th>"+c[j][0];
+ if(filter == "" || filter.indexOf(c[j][0]) != -1)
+ isShown[j] = 1;
+ else
+ isShown[j] = 0;
+ if(isShown[j])
+ o += "<th>"+c[j][0];
}
for(i = 1; i <= 4; i++) {
o += "<tr class=\""+(i%2?"odd":"even")+"\"><th>"+(i-1);
for(j=0;j<b.length-1;j++) {
- if(option == "temp") {
- val = (((c[j][i]) & 0xFFF)/16);
- if(val <= 0 || val > 100 || (c[j][i])&0xf000) val = "---";
- else val = val.toFixed(1)
- o += "<td class=\"colored\" style=\"background:"+findcolor(val,min,max,0)+"\">"+(val);
- }
- else if(option == "id") {
- val = c[j][(i-1)*4+4]+c[j][(i-1)*4+3]+c[j][(i-1)*4+2]+c[j][(i-1)*4+1];
- if(c[j][(i-1)*4+1].substr(2,2) != "28") val = "---";
- o += "<td class=\"fixed\">"+(val);
- }
- else if(option == "thresh") {
- o += "<td>";
- for(k=1;k<=16;k++) {
- val = c[j][(i-1)*16+k]*1.;
- if((c[j][(i-1)*16+k]&0x7fff0000) != (((k-1)<<15) & 0x7fff0000)) {
- val = "---";
- col = "transparent";
- }
- else {
- col = findcolor((val&0xffff),0x6500,0x9000,0);
- val =((val&0xffff).toString(16));
+ if(isShown[j]) {
+ if(option == "temp") {
+ val = (((c[j][i]) & 0xFFF)/16);
+ if(val <= 0 || val > 100 || (c[j][i])&0xf000) val = "---";
+ else val = val.toFixed(1)
+ o += "<td class=\"colored\" style=\"background:"+findcolor(val,min,max,0)+"\">"+(val);
+ }
+ else if(option == "id") {
+ val = c[j][(i-1)*4+4]+c[j][(i-1)*4+3]+c[j][(i-1)*4+2]+c[j][(i-1)*4+1];
+ if(c[j][(i-1)*4+1].substr(2,2) != "28") val = "---";
+ o += "<td class=\"fixed\">"+(val);
+ }
+ else if(option == "thresh") {
+ o += "<td>";
+ for(k=1;k<=16;k++) {
+ val = c[j][(i-1)*16+k]*1.;
+ if((c[j][(i-1)*16+k]&0x7fff0000) != (((k-1)<<15) & 0x7fff0000)) {
+ val = "---";
+ col = "transparent";
+ }
+ else {
+ col = findcolor((val&0xffff),0x6500,0x9000,0);
+ val =((val&0xffff).toString(16));
+ }
+ o += "<span class=\"fixed\" style=\"background:"+col+"\">"+val+"</span><br>";
}
- o += "<span class=\"fixed\" style=\"background:"+col+"\">"+val+"</span><br>";
}
}
}