Closedown

This commit is contained in:
boccioli_m
2015-06-08 15:44:23 +02:00
parent 5bb2154fd4
commit ec63e1dfcf
4 changed files with 22 additions and 13 deletions

View File

@@ -83,11 +83,9 @@ public class TestingList extends Panel {
buildTable();
}
@SuppressWarnings("unchecked")
public void showResult(String deviceName, String testName, String res, String success){
public void showResult(String deviceName, String testName, String res, String status){
int COL_RESULT = 4;
int COL_SUCCESS = 5;
int COL_ICON = 6;
@@ -114,21 +112,34 @@ public class TestingList extends Panel {
}
}
}
ImageIcon icon = new ImageIcon(getClass().getResource("/icons/button_ok-16px.png"));
jTable1.setValueAt(icon, rowD, COL_ICON);
String iconSource = "/icons/button_help-16px.png";
switch(status){
case "Success":
iconSource = "/icons/button_ok-16px.png";
break;
case "Fail":
iconSource = "/icons/button_delete-16px.png";
break;
case "Running":
iconSource = "/icons/button_play-16px.png";
break;
}
ImageIcon icon = new ImageIcon(getClass().getResource(iconSource));
jTable1.setValueAt(icon, rowD, COL_ICON);
if(colT>0 && rowD>0){
jTable1.setValueAt(res, rowD, COL_RESULT);
jTable1.setValueAt(success, rowD, COL_SUCCESS);
jTable1.setValueAt(status, rowD, COL_SUCCESS);
jTable1.getCellEditor(rowD, COL_SUCCESS);
}
else{ //no test found in table. appen new one
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
model.addRow(new Object[]{true, getNow(), deviceName, testName,res, success,icon });
}
model.addRow(new Object[]{true, getNow(), deviceName, testName, res, status, icon });
}
}
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
@@ -139,7 +150,6 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
setLayout(new java.awt.BorderLayout());
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/button_play.png"))); // NOI18N
jButton1.setText("Test PS");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
@@ -191,7 +201,7 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
args.put("relative", var1);
args.put("steps", var2);
run("power-supply", args);
showResult("RS", "Calibrate", "Test running", "Running");
//evalAsync("run('args', locals = {'relative':" + (var1 ? "True" :"False") + ", 'steps':" + var2 + "})");
} catch (Exception ex) {