aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2012-10-19 16:14:24 +0800
committerAndy Green <andy.green@linaro.org>2012-10-19 16:14:24 +0800
commit341326e80f0b37c5a69bcb3f93e03b3cdd5335e2 (patch)
treea66f9c2408aa50e4fc23735d5b1e66e6af6a28cc
parent771b62ccd0e47065572455f8f44f810ee2abdcfe (diff)
allow rail view selection by clicking on colour key plus prettify
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r--aepd/share/aepscope.html162
1 files changed, 95 insertions, 67 deletions
diff --git a/aepd/share/aepscope.html b/aepd/share/aepscope.html
index 4c32623..4972452 100644
--- a/aepd/share/aepscope.html
+++ b/aepd/share/aepscope.html
@@ -30,7 +30,9 @@
td.measname { text-align:left; }
div.topmeas { text-align:right; font-weight:bold; }
td.topmeasname { text-align:left; ; font-weight:bold; }
- td.heading { text-align:center; vertical-align:middle; color:#ffffff; }
+ div.greymeas { text-align:right; opacity: 0.2; }
+ div.greytopmeas { text-align:right; font-weight:bold; opacity: 0.2; }
+
div.caliper_invalid { font-size:8pt; font: Arial; font-weight:normal; opacity: 0.2; }
div.caliper_valid { font-size:8pt; font: Arial; font-weight:normal; background-color:#f0f0f0; color:#000000 }
div.control { font-size:9pt; font: Arial; font-weight:bold; color:#404040; }
@@ -39,14 +41,16 @@
div.groupwhite { height:60px; vertical-align:middle; text-align:center; padding:4px; -webkit-border-radius:10px; -moz-border-radius:10px; border-radius:10px; }
div.group { height:60px; vertical-align:middle; text-align:center; background:#f0f0f0; padding:4px; -webkit-border-radius:10px; -moz-border-radius:10px; border-radius:10px; }
div.group2 { vertical-align:middle; text-align:center; background:#f0f0f0; padding:4px; -webkit-border-radius:10px; -moz-border-radius:10px; border-radius:10px; }
+ td.heading { font-size:9pt; font: Arial; font-weight:bold; vertical-align:middle; text-align:center; background:#e0e0e0; color:#a0a0a0; padding:3px; -webkit-border-radius:16px; -moz-border-radius:16px; border-radius:16px; }
div.group::after {
content: ".";
visibility: hidden;
}
-
div.group img {
vertical-align: middle;
}
+ div.btn { height:12px; width: 12px; vertical-align:middle; text-align:center; padding:2px; -webkit-border-radius:8px; -moz-border-radius:8px; border-radius:8px; }
+
</style>
<meta charset=utf-8 http-equiv="Content-Language" content="en"/>
<title>ARM Energy Probe aepd UI</title>
@@ -107,7 +111,7 @@ div.group img {
var caliper_headroom = 16;
var x_axis_height = 16 + /* scroll */ 16;
-var y_axis_width = 24;
+var y_axis_width = 32;
var xlen = 600;
var ylen = 400;
@@ -174,6 +178,8 @@ var sigs = [ 0, 0, 0, 0, 0, 0, 0, 1,
cal_pos[0] = 100;
cal_pos[1] = 200;
+var chan_view = -1;
+
function event_wheel(e)
{
var f;
@@ -308,8 +314,11 @@ if (localStorage["aepd.measure"])
cal_pos[0] = parseFloat(read_local_stg("aepd.caliper0", "", 100));
cal_pos[1] = parseFloat(read_local_stg("aepd.caliper1", "", 200));
+chan_view = parseFloat(read_local_stg("aepd.chan_view", "", -1));
+
update_measure();
+
if (cal_pos[0] < 0 || isNaN(cal_pos[0]))
cal_pos[0] = 100;
if (cal_pos[1] < 0 || isNaN(cal_pos[1]))
@@ -357,9 +366,17 @@ function get_toplevel_supply(name)
return get_toplevel_supply(ch_supply[n]);
}
+function update_chans(n)
+{
+ dirty = 1;
+ chan_view = n;
+ localStorage["aepd.chan_view"] = chan_view;
+ channel_list_changed();
+}
+
function do_all_children(name, depth, total_depth)
{
- var n, cl;
+ var n, cl, v;
if (depth > worst_depth)
worst_depth = depth;
@@ -372,8 +389,12 @@ function do_all_children(name, depth, total_depth)
fcol = "#000000";
if (total_depth) {
- tab += '<tr><td style="background-color: '+ch_colour[n]+'">&nbsp;&nbsp;&nbsp;&nbsp;</td>';
+ tab += '<tr>';
tab += '<td colspan="'+ depth +'">&nbsp;</td>';
+ v = n;
+ if (ch_flags[n] & CHFLAG_TOPLEVEL)
+ v = -1;
+ tab += '<td><div class="btn" style="background: '+ch_colour[n]+'; cursor:crosshair;" onclick="update_chans('+v+');"></div></td>';
tab += '<td colspan="'+(total_depth - depth)+'" ';
if (ch_flags[n] & CHFLAG_TOPLEVEL) {
tab += ' class="topmeasname"';
@@ -382,6 +403,8 @@ function do_all_children(name, depth, total_depth)
tab += ' class="measname"';
cl = "meas";
}
+ if (chan_view != -1 && n != chan_view)
+ cl = "grey"+cl;
tab += '><font style="color:' + fcol + '">';
tab += name;
tab += '</font></td><td><div id="v'+n+'" class="'+cl+'"></div></td><td><div id="a'+n+'" class="'+cl+'"></div></td><td><div id="w'+n+'" class="'+cl+'"></div></td></tr>';
@@ -437,6 +460,65 @@ function caliper_data_update()
}
}
+function channel_list_changed()
+{
+ var n, b, found, done_list;
+
+ done_list = new Array;
+ worst_depth = 0;
+ order = 0;
+ b = "?";
+
+ for (n = 0; n < ov; n++) {
+
+ b = get_toplevel_supply(ch_name[n]);
+
+ found = 0;
+ for (y = 0; y < done_list.length; y++)
+ if (done_list[y] == b) {
+ found = 1;
+ y = done_list.length;
+ }
+
+ if (found)
+ continue;
+ done_list.push(b);
+
+ do_all_children(b, 1, 0);
+ }
+
+ do_title = 0;
+
+ tab = '<table><tr style="background-color: #000000"><td class="heading" colspan="'+(worst_depth + 2)+'">Rail</td>';
+ tab+= '<td class="heading" width="45">Voltage</td>';
+ tab+= '<td class="heading" width="80">Current</td>';
+ tab+= '<td class="heading" width="80">Power</td>';
+ tab += '</tr>';
+
+ done_list = new Array;
+ for (n = 0; n < ov; n++) {
+
+ b = get_toplevel_supply(ch_name[n]);
+
+ found = 0;
+ for (y = 0; y < done_list.length; y++)
+ if (done_list[y] == b) {
+ found = 1;
+ y = done_list.length;
+ }
+
+ if (found)
+ continue;
+ done_list.push(b);
+
+ do_all_children(b, 1, worst_depth + 1);
+ }
+
+ tab += "</table>";
+
+ document.getElementById("cha").innerHTML = tab;
+}
+
function conn_retry()
{
var r1, r2, r3, x, y, chan, z, block, channel_data = 0;
@@ -631,68 +713,8 @@ function conn_retry()
- if (!channel_data && do_title) {
- var n, b, found, done_list;
-
- done_list = new Array;
- worst_depth = 0;
- order = 0;
- b = "?";
-
- for (n = 0; n < ov; n++) {
-
- b = get_toplevel_supply(ch_name[n]);
-
- found = 0;
- for (y = 0; y < done_list.length; y++)
- if (done_list[y] == b) {
- found = 1;
- y = done_list.length;
- }
-
- if (found)
- continue;
- done_list.push(b);
-
- do_all_children(b, 1, 0);
- }
-
- do_title = 0;
-
- tab = '<table><tr style="background-color: #000000"><td></td>';
-
- for (n = 0; n < worst_depth; n++)
- tab += "<td>&nbsp;</td>";
-
- tab+= '<td class="heading">Rail</td>';
- tab+= '<td class="heading" width="45">Voltage</td>';
- tab+= '<td class="heading" width="80">Current</td>';
- tab+= '<td class="heading" width="80">Power</td>';
- tab += '</tr>';
-
- done_list = new Array;
- for (n = 0; n < ov; n++) {
-
- b = get_toplevel_supply(ch_name[n]);
-
- found = 0;
- for (y = 0; y < done_list.length; y++)
- if (done_list[y] == b) {
- found = 1;
- y = done_list.length;
- }
-
- if (found)
- continue;
- done_list.push(b);
-
- do_all_children(b, 1, worst_depth + 1);
- }
-
- tab += "</table>";
-
- document.getElementById("cha").innerHTML = tab;
- }
+ if (!channel_data && do_title)
+ channel_list_changed();
if (!loading)
dirty = 1;
@@ -851,6 +873,12 @@ function show(cv)
continue;
}
+
+ if (chan_view >= 0 && z != chan_view) {
+ chan++;
+ continue;
+ }
+
ctx.lineWidth = 1;
ctx.strokeStyle = ch_colour[z];