From b7de52262dd15ea9f72f7e23ab9b8f91a7a9ec20 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Wed, 10 Jun 2015 09:48:39 +0200 Subject: [PATCH] Closedown --- plugins/TestingList.java | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 4fcd934..8b4fb56 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -87,6 +87,8 @@ public class TestingList extends Panel { private final int COL_RESULT = 6; private final int COL_STATUS = 7; private final int COL_ICON = 8; + + private void initLogger() { try { @@ -151,9 +153,32 @@ public class TestingList extends Panel { jTable1.setValueAt(getNow(), rowD, COL_TIME); jTable1.setValueAt(res, rowD, COL_RESULT); jTable1.setValueAt(status, rowD, COL_STATUS); - //jTable1.getCellEditor(rowD, COL_STATUS); } } + + //returns the status of the specified test name for specified device name + public String getResult(String deviceName, String testName){ + String sStatus = ""; + int rowD = -1, colT = -1; + //search for device name in table + for (int row = 0; row <= jTable1.getRowCount() - 1; row++) { + if (deviceName.equals(jTable1.getValueAt(row, COL_DEVICENAME))) { + rowD = row; + break; + } + } + if (rowD >= 0) { + //search for test name in table + if (testName.equals(jTable1.getValueAt(rowD, COL_TESTNAME))) { + colT = COL_TESTNAME; + } + } + if (colT >= 0 && rowD >= 0) { + sStatus = jTable1.getValueAt(rowD, colT).toString(); + } + + return sStatus; + } // //GEN-BEGIN:initComponents @@ -370,6 +395,9 @@ public class TestingList extends Panel { try{ args.put("DEVICE", sDeviceName); run(sTestName, args); + while(getResult(sDeviceName, sTestName) == "Running"){ + Thread.sleep(1000); + } } catch (Exception ex) { SwingUtils.showMessage(this, "", ex.toString()); }