From 5dec4bebd9ee334497326ec2687d92bec53b0bc2 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 1 May 2020 08:51:30 -0700 Subject: [PATCH] kpi: Add links to latest test run info. For easier click-through to see recent results. --- gui/kpi.java | 30 +++++++++++++++++++++++++----- gui/testbed_template.html | 9 ++++++++- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/gui/kpi.java b/gui/kpi.java index 16e8e49f..32f762b2 100644 --- a/gui/kpi.java +++ b/gui/kpi.java @@ -154,6 +154,9 @@ public class kpi { runs.sort(new SortbyDate()); + // Link to latest test run that has the test id + Hashtable test_id_links = new Hashtable(); + // We have read everything into memory. // For each test, generate data over time. Hashtable hist_data = new Hashtable(); @@ -164,6 +167,7 @@ public class kpi { Run run = runs.elementAt(i); Test t = run.findTest(tname); if (t != null) { + test_id_links.put(tname, run); try { History hist = hist_data.get(tname); if (hist == null) { @@ -252,7 +256,13 @@ public class kpi { String npngt = hk + "::" + ck + "-thumb.png"; png.renameTo(new File(dir + File.separator + npngt)); - plots.append("" + hk + "" + title + "\n"); + String hk_str = hk; + Run last = test_id_links.get(hk); + if (last != null) { + hk_str = "" + hk + ""; + } + + plots.append("" + hk_str + "" + title + "\n"); } catch (Exception ee) { @@ -342,7 +352,13 @@ public class kpi { String npngt = hk + "::" + g + "-thumb.png"; png.renameTo(new File(dir + File.separator + npngt)); - groups.append("" + hk + "" + title + "\n"); + String hk_str = hk; + Run last = test_id_links.get(hk); + if (last != null) { + hk_str = "" + hk + ""; + } + + groups.append("" + hk_str + "" + title + "\n"); } catch (Exception ee) { @@ -353,14 +369,17 @@ public class kpi { } String test_bed = "Test Bed"; + String last_run = ""; boolean cp = true; for (int i = 0; i" + i + "" + run.getName() + "" + run.getDate() - + "" + run.getDutHwVer() + "" + run.getDutSwVer() - + "" + run.getDutModelNum() + "\n"); + String row_text = ("" + i + "" + run.getName() + "" + run.getDate() + + "" + run.getDutHwVer() + "" + run.getDutSwVer() + + "" + run.getDutModelNum() + "\n"); + last_run = row_text; + runs_rows.append(row_text); if (cp) { try { @@ -390,6 +409,7 @@ public class kpi { line = line.replace("___GROUP_GRAPHS___", groups.toString()); line = line.replace("___DATA_GRAPHS___", plots.toString()); line = line.replace("___TEST_RUNS___", runs_rows.toString()); + line = line.replace("___LATEST_RUN___", last_run); bw.write(line); } diff --git a/gui/testbed_template.html b/gui/testbed_template.html index 081a011c..df5e479a 100644 --- a/gui/testbed_template.html +++ b/gui/testbed_template.html @@ -23,6 +23,13 @@

+

Latest test run details.

+ + +___LATEST_RUN___ +
Test IDTest RunDateDUT HardwareDUT SofwareDUT Model
+

+

Historical graphs for each Data Set Group.

@@ -31,7 +38,7 @@

-

Individual Test Run Details.

+

All Individual Test Run Details.

___TEST_RUNS___
Test IDTest RunDateDUT HardwareDUT SofwareDUT Model