From 341326e80f0b37c5a69bcb3f93e03b3cdd5335e2 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 19 Oct 2012 16:14:24 +0800 Subject: allow rail view selection by clicking on colour key plus prettify Signed-off-by: Andy Green --- aepd/share/aepscope.html | 162 +++++++++++++++++++++++++++-------------------- 1 file 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; } + ARM Energy Probe aepd UI @@ -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 += '    '; + tab += ''; tab += ' '; + v = n; + if (ch_flags[n] & CHFLAG_TOPLEVEL) + v = -1; + tab += '
'; tab += ''; tab += name; tab += '
'; @@ -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 = ''; + tab+= ''; + tab+= ''; + tab+= ''; + tab += ''; + + 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 += "
RailVoltageCurrentPower
"; + + 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 = ''; - - for (n = 0; n < worst_depth; n++) - tab += ""; - - tab+= ''; - tab+= ''; - tab+= ''; - tab+= ''; - tab += ''; - - 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 += "
 RailVoltageCurrentPower
"; - - 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]; -- cgit v1.2.3