Closedown
This commit is contained in:
@@ -54,9 +54,12 @@ public class TestingList extends Panel {
|
||||
switch(fileName){
|
||||
case "power-supply":
|
||||
Object ret = eval("ret");
|
||||
boolean success = (boolean) eval("success");
|
||||
Object deviceName = eval("deviceName");
|
||||
Object testName = eval("testName");
|
||||
if (ret != null) {
|
||||
//SwingUtils.showMessage(getComponent(), "", ret.toString() + " - " + ret.getClass().getName());
|
||||
testingList.showResult(ret.toString());
|
||||
testingList.showResult(deviceName.toString(), testName.toString(), ret.toString(), success);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -75,12 +78,39 @@ public class TestingList extends Panel {
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
|
||||
|
||||
|
||||
public void showResult(String res){
|
||||
txtOutput.setText(res);
|
||||
jTable1.setValueAt(res, 1, 3);
|
||||
public void showResult(String deviceName, String testName, String res, boolean success){
|
||||
|
||||
int COL_RESULT = 3;
|
||||
int COL_SUCCESS = 4;
|
||||
|
||||
txtOutput.setText(res);
|
||||
boolean bDeviceFound = false, bTestFound = false;
|
||||
int rowD, colT, colD;
|
||||
//search for device name in table
|
||||
for (rowD = 0; rowD <= jTable1.getRowCount() - 1; rowD++) {
|
||||
|
||||
for (colD = 0; colD <= jTable1.getColumnCount() - 1; colD++) {
|
||||
|
||||
if (deviceName.equals(jTable1.getValueAt(rowD, colD))) {
|
||||
|
||||
bDeviceFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bDeviceFound){
|
||||
//search for test name in table
|
||||
for (colT = 0; colT <= jTable1.getColumnCount() - 1; colT++) {
|
||||
|
||||
if (testName.equals(jTable1.getValueAt(rowD, colT))) {
|
||||
|
||||
bTestFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
jTable1.setValueAt(res, rowD, COL_RESULT);
|
||||
jTable1.setValueAt(success, rowD, COL_SUCCESS);
|
||||
}
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
@@ -172,23 +202,7 @@ public class TestingList extends Panel {
|
||||
SwingUtils.showException(this, ex);
|
||||
}
|
||||
}//GEN-LAST:event_jButton1ActionPerformed
|
||||
|
||||
public void onExecutedFile(String fileName) {
|
||||
try {
|
||||
switch(fileName){
|
||||
case "power-supply":
|
||||
Object ret = eval("ret");
|
||||
if (ret != null) {
|
||||
showResult(ret.toString());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private ch.psi.pshell.swing.DeviceStatePanel deviceStatePanel1;
|
||||
private javax.swing.JButton jButton1;
|
||||
|
||||
Reference in New Issue
Block a user