From 7288512701b65a167d63e7aabbc78edbf07be8f1 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Tue, 20 Mar 2018 13:49:40 +0100 Subject: [PATCH] Startup --- plugins/Music.lnk | Bin 0 -> 916 bytes plugins/TestingList.form | 2 +- plugins/TestingList.java | 107 ++++++-------------------------- plugins/TestingListDetails.form | 24 ++----- plugins/TestingListDetails.java | 48 +++++--------- script/tests/tests.properties | 2 +- 6 files changed, 38 insertions(+), 145 deletions(-) create mode 100644 plugins/Music.lnk diff --git a/plugins/Music.lnk b/plugins/Music.lnk new file mode 100644 index 0000000000000000000000000000000000000000..c5a1bbca83b0e6e026b0de9f63b5bf4adacd3568 GIT binary patch literal 916 zcmchVT}V@57{~w92$N>>BMK>89Ngh(M=Y8 z>0LtJgwWST5m=3g5R4$YiPkqpP(e2$8Qygz{ok3(i=eyS!|!>Yuk)V&dCu_zu+)^$ z0&@k6t}&FsZU-E_U#wS7Q=M|QG@!<#v^s5mrp(o%(xf2 z9{4BT@gUS<>G8^Lz=rbMRSmJ{E8W+QTNjc(i&Ncvmh2$vJhks9YMmk5NGYj4b$Y)QcoME5zUBxnG74Frtr&9 zT1(4_DFP#=)SdA{oOL8jU=L@o37DSZL)^ihpliAD;SXP}?Z$G+(D>EGJ3E;#C#WYI zNdO}-A)(W6AR9=bSjOGYLI`PSB+Ga!*+S5+%#%kIYOX4|S;fj(8>;dvRI*)}<^yeN z^2(hdO4xVT>_-nS_-_5oS6?@yyC#_rs|F>kldONXM1&&kXo3f=5a?qRp(c}l2nNOL zRB9kjJBS3c9Z2!=QhA05^s=h4B9X)};{ZLKCm1}#K$Kkq{e^0n@hG!Xp{Mq_Z%HKOfG)7w5mRZVl1r|2RGH zJD1Yk?&g-3V#l+kiThuBT;4JJxvHbVd$C;T{NlwA-zqPC9{=?ArM&yEx;p3=wCK<( literal 0 HcmV?d00001 diff --git a/plugins/TestingList.form b/plugins/TestingList.form index a18d41d..8378978 100644 --- a/plugins/TestingList.form +++ b/plugins/TestingList.form @@ -462,7 +462,7 @@ - + diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 00a519c..49324f3 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -88,17 +88,16 @@ public class TestingList extends Panel { STARTSEQUENCE(1), TIME(2), DEVICENAME(3), - DEVICEPATH(4), - DEVICEDESCR(5), - TESTSUITE(6), - TESTNAME(7), - TESTPATH(8), - TESTPARAMS(9), - TESTDESCR(10), - TESTHELP(11), - RESULT(12), - STATUS(13), - ICON(14); + DEVICEDESCR(4), + TESTSUITE(5), + TESTNAME(6), + TESTPATH(7), + TESTPARAMS(8), + TESTDESCR(9), + TESTHELP(10), + RESULT(11), + STATUS(12), + ICON(13); private int value; private COL(int value) { @@ -298,36 +297,6 @@ public class TestingList extends Panel { * initialise panel */ private void initialise(){ - System.out.println("msg:"); - int PORT1 = 0x8899; // this port - String mode = "2,IQCOM,$BMA1,1,DIA"; - int i = 0; - byte[] msg = new byte[128]; - msg[0] = 50; //bytecount - msg[2] = 105; // transfer function - msg[4] = (byte) PORT1; - msg[5] = (byte) (PORT1 >>> 8); - msg[6] = 1; // message id - msg[16] = 1; //io-func reset=2 read mode=0 write mode=1 - byte[] buffer = mode.getBytes(); - while (i < buffer.length) { - msg[28 + i] = buffer[i]; - i++; - } - for (i=0 ; i < msg.length; i++) { - System.out.print(String.format("%02X ", msg[i])); - } - System.out.println(""); - - - - - - - - - - initComponents(); initLogger(); buildTable(); @@ -410,7 +379,7 @@ public class TestingList extends Panel { try { if (!configFile.isFile()) configFile.createNewFile(); FileReader reader = new FileReader(configFile); - System.out.println("save property: "+ key + " = " + val); + //System.out.println("save property: "+ key + " = " + val); properties.setProperty(key, val); Properties props = properties; @@ -1004,14 +973,14 @@ public class TestingList extends Panel { }, new String [] { - "Enable", "Start Mode", "Time", "Device Name", "Device Path", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Parameters", "Test Description", "Test Help", "Last Test Result", "Status", "" + "Enable", "Start Mode", "Time", "Device Name", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Parameters", "Test Description", "Test Help", "Last Test Result", "Status", "" } ) { Class[] types = new Class [] { - java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class + java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class }; boolean[] canEdit = new boolean [] { - true, true, false, false, false, false, false, false, false, false, false, false, false, false, false + true, true, false, false, false, false, false, false, false, false, false, false, false, false }; public Class getColumnClass(int columnIndex) { @@ -1619,12 +1588,11 @@ public class TestingList extends Panel { String sTestPath = String.valueOf(jTable1.getValueAt(row, COL.TESTPATH.ordinal())).replace("\\", File.separator); String sTestCaseName = jTable1.getValueAt(row, COL.TESTSUITE.ordinal()).toString(); String sTestDescription = getTestDescription(sTestPath); - String sDevicePath = jTable1.getValueAt(row, COL.DEVICEPATH.ordinal()).toString(); String sDeviceDescription = jTable1.getValueAt(row, COL.DEVICEDESCR.ordinal()).toString(); String sLastResult = jTable1.getValueAt(row, COL.RESULT.ordinal()).toString(); String sResultTime = jTable1.getValueAt(row, COL.TIME.ordinal()).toString(); String sTestHelp = String.valueOf(jTable1.getValueAt(row, COL.TESTHELP.ordinal())); - HashMap mParameters = getParameters(sTestPath, sDevicePath); + HashMap mParameters = getTestParameters(sTestPath); //create map for passing details to Details Panel HashMap details = new HashMap(); details.put("deviceName", sDeviceName); @@ -1979,14 +1947,13 @@ public class TestingList extends Panel { */ private HashMap buildMapFromTableRow(int row) { String sDeviceName = jTable1.getValueAt(row, COL.DEVICENAME.ordinal()).toString(); - String sDevicePath = jTable1.getValueAt(row, COL.DEVICEPATH.ordinal()).toString().replace("\\", File.separator); String sTestName = jTable1.getValueAt(row, COL.TESTNAME.ordinal()).toString(); String sTestCaseName = jTable1.getValueAt(row, COL.TESTSUITE.ordinal()).toString(); String sTestPath = jTable1.getValueAt(row, COL.TESTPATH.ordinal()).toString().replace("\\", File.separator); // HashMap mParameters = buildParametersMap(String.valueOf(jTable1.getValueAt(row, COL.TESTPARAMS.ordinal()))); //get the parameters directly frm he config file // System.out.println("sTestPath: " + sTestPath); - HashMap mParameters = getParameters(sTestPath, sDevicePath); + HashMap mParameters = getTestParameters(sTestPath); HashMap testArgs = new HashMap(); //args.put("ret", ""); testArgs.put(testArgNames.PARAMETERS.toString(), mParameters); @@ -2214,13 +2181,13 @@ public class TestingList extends Panel { DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); renderer.setToolTipText("Click for options"); jTable1.getColumnModel().getColumn(COL.STARTSEQUENCE.ordinal()).setCellRenderer(renderer); + jTable1.getColumnModel().getColumn(COL.STARTSEQUENCE.ordinal()).setPreferredWidth(30); jTable1.getColumnModel().getColumn(COL.ICON.ordinal()).setMaxWidth(27); jTable1.getColumnModel().getColumn(COL.CHECK.ordinal()).setMaxWidth(27); jTable1.getColumnModel().getColumn(COL.DEVICENAME.ordinal()).setPreferredWidth(30); jTable1.getColumnModel().getColumn(COL.STATUS.ordinal()).setPreferredWidth(20); hideColumn(COL.DEVICEDESCR); - hideColumn(COL.DEVICEPATH); hideColumn(COL.TESTPATH); hideColumn(COL.TESTDESCR); hideColumn(COL.TESTPARAMS); @@ -2267,9 +2234,8 @@ public class TestingList extends Panel { DefaultTableModel model = (DefaultTableModel) jTable1.getModel(); //String testPath = FilenameUtils.separatorsToSystem(TESTS_TESTS_DEFAULT_DIR + testSuite + "/" + testName + "/" + testName + ".py"); String testPath = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(), testSuite, testName, testName + ".py").toString(); - String devicePath = Paths.get(TESTS_DEVICES_DEFAULT_DIR.toString(), deviceName, deviceName + ".config").toString(); System.out.println("Path = " + testPath); - Object rowData[] = new Object[]{false, "", sDate, deviceName, devicePath, deviceDescription, testSuite, testName, testPath, testParams, testDescription, testHelp, "", "Pending", icon}; + Object rowData[] = new Object[]{false, "", sDate, deviceName, deviceDescription, testSuite, testName, testPath, testParams, testDescription, testHelp, "", "Pending", icon}; //vedify that this test is not already in the table int totalRows = model.getRowCount(); boolean bTestAlreadyInTable = false; @@ -2504,43 +2470,6 @@ public class TestingList extends Panel { return buildParametersMap(testParams); } - - /** - * get the parameters from the test and device config file. - * the test config params are default params. if the same param name - * is also in the device config, it will override the test param. - * - * @param sTestPath directory where the test files are (directory with the - * test name) - * @param sdevicePath device config file path - * @return HashMap of the test parameters. See buildParametersMap() for - * details. - */ - private HashMap getParameters(String sTestPath, String sDevicePath) { - HashMap deviceParams = buildParametersMap(getConfigItem("parameters", sDevicePath)); - HashMap testParams = buildParametersMap(getConfigItem("parameters", sTestPath)); - HashMap params = new HashMap(); - if(deviceParams.isEmpty()){ - return testParams; - } - Iterator itD = deviceParams.entrySet().iterator(); - System.out.println("deviceParams: " + deviceParams.size()); - while (itD.hasNext()) { - Map.Entry pairD = (Map.Entry)itD.next(); - System.out.println(pairD.getKey() + " = " + pairD.getValue()); - params.putIfAbsent(pairD.getKey(), pairD.getValue()); - } - Iterator it = testParams.entrySet().iterator(); - System.out.println("testParams: " + testParams.size()); - while (it.hasNext()) { - Map.Entry pair = (Map.Entry)it.next(); - System.out.println(pair.getKey() + " = " + pair.getValue()); - // add parameter only if not already on device parameters - params.putIfAbsent(pair.getKey(), pair.getValue()); - } - return params; - } - /** * Get the description of the test. * diff --git a/plugins/TestingListDetails.form b/plugins/TestingListDetails.form index c0a0c59..b095de3 100644 --- a/plugins/TestingListDetails.form +++ b/plugins/TestingListDetails.form @@ -57,11 +57,7 @@ - - - - - + @@ -124,10 +120,7 @@ - - - - + @@ -397,8 +390,8 @@ - - + + @@ -448,14 +441,5 @@ - - - - - - - - - diff --git a/plugins/TestingListDetails.java b/plugins/TestingListDetails.java index 68f0a05..c128636 100644 --- a/plugins/TestingListDetails.java +++ b/plugins/TestingListDetails.java @@ -54,7 +54,6 @@ public class TestingListDetails extends javax.swing.JPanel { public static String TESTS_CONFIG_FILENAME = ".config"; public static Path TESTS_TESTS_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "tests"); - public static Path TESTS_DEVICES_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "devices"); /** * This method is called from within the constructor to initialize the form. @@ -90,7 +89,6 @@ public class TestingListDetails extends javax.swing.JPanel { jButtonMoreTest = new javax.swing.JButton(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); - jButtonOk1 = new javax.swing.JButton(); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel1.setText("Device name"); @@ -198,8 +196,8 @@ public class TestingListDetails extends javax.swing.JPanel { jEditorPaneHelp.setPreferredSize(new java.awt.Dimension(6, 400)); jScrollPaneHtml.setViewportView(jEditorPaneHelp); - jButtonOk.setText("Save as default"); - jButtonOk.setToolTipText("Save parameters values as default (fo this test)"); + jButtonOk.setText("Save"); + jButtonOk.setToolTipText("Save parameters values"); jButtonOk.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonOkActionPerformed(evt); @@ -231,14 +229,6 @@ public class TestingListDetails extends javax.swing.JPanel { jLabel10.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel10.setText("(Value valid for all devices)"); - jButtonOk1.setText("Save for this device"); - jButtonOk1.setToolTipText("Save parameters values for this specific device"); - jButtonOk1.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButtonOk1ActionPerformed(evt); - } - }); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -276,10 +266,7 @@ public class TestingListDetails extends javax.swing.JPanel { .addComponent(txtTestName, javax.swing.GroupLayout.PREFERRED_SIZE, 441, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButtonMoreTest)))) - .addGroup(layout.createSequentialGroup() - .addComponent(jButtonOk1) - .addGap(18, 18, 18) - .addComponent(jButtonOk, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(jButtonOk, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(jScrollPaneHtml, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE) .addContainerGap()) @@ -329,9 +316,7 @@ public class TestingListDetails extends javax.swing.JPanel { .addComponent(jLabel10) .addGap(0, 0, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButtonOk) - .addComponent(jButtonOk1))) + .addComponent(jButtonOk)) .addComponent(jScrollPaneHtml, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE)) .addContainerGap()) ); @@ -498,7 +483,8 @@ public class TestingListDetails extends javax.swing.JPanel { } private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed - Path testPath = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(), this.txtTestSuite.getText(), this.txtTestName.getText()); + // TODO add your handling code here: + Path testPath = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(), this.txtTestSuite.getText(), this.txtTestName.getText()); updateTestConfig(testPath, this.txtTestName.getText(), this.txtTestSuite.getText(),getParametersFromTable()); }//GEN-LAST:event_jButtonOkActionPerformed @@ -507,29 +493,29 @@ public class TestingListDetails extends javax.swing.JPanel { this.jButtonMoreResult.setText("Less"); this.jScrollPaneRes.setVisible(true); this.jLabel9.setVisible(true); + this.txtDeviceName.setVisible(true); + this.jLabel1.setVisible(true); + this.jLabel2.setVisible(true); + this.txtDeviceDescription.setVisible(true); }else{ this.jScrollPaneRes.setVisible(false); this.jLabel9.setVisible(false); + this.txtDeviceName.setVisible(false); + this.jLabel1.setVisible(false); + this.jLabel2.setVisible(false); + this.txtDeviceDescription.setVisible(false); this.jButtonMoreResult.setText("More"); } }//GEN-LAST:event_jButtonMoreResultActionPerformed private void jButtonMoreTestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMoreTestActionPerformed if(this.jButtonMoreTest.getText()=="More"){ - this.txtDeviceName.setVisible(true); - this.jLabel1.setVisible(true); - this.jLabel2.setVisible(true); - this.txtDeviceDescription.setVisible(true); this.jButtonMoreTest.setText("Less"); this.jScrollPaneTestDesc.setVisible(true); this.jLabel4.setVisible(true); this.txtTestSuite.setVisible(true); this.jLabel8.setVisible(true); }else{ - this.txtDeviceName.setVisible(false); - this.jLabel1.setVisible(false); - this.jLabel2.setVisible(false); - this.txtDeviceDescription.setVisible(false); this.jScrollPaneTestDesc.setVisible(false); this.jLabel4.setVisible(false); this.txtTestSuite.setVisible(false); @@ -538,17 +524,11 @@ public class TestingListDetails extends javax.swing.JPanel { } }//GEN-LAST:event_jButtonMoreTestActionPerformed - private void jButtonOk1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOk1ActionPerformed - Path devicePath = Paths.get(TESTS_DEVICES_DEFAULT_DIR.toString(), this.txtDeviceName.getText()); - updateTestConfig(devicePath, this.txtTestName.getText(), this.txtTestSuite.getText(),getParametersFromTable()); - }//GEN-LAST:event_jButtonOk1ActionPerformed - // // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButtonMoreResult; private javax.swing.JButton jButtonMoreTest; private javax.swing.JButton jButtonOk; - private javax.swing.JButton jButtonOk1; private javax.swing.JEditorPane jEditorPaneHelp; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; diff --git a/script/tests/tests.properties b/script/tests/tests.properties index 50d01ec..b4139d7 100644 --- a/script/tests/tests.properties +++ b/script/tests/tests.properties @@ -1,5 +1,5 @@ #TestingList for pshell: configuration properties -#Tue Mar 20 13:42:32 CET 2018 +#Tue Mar 20 13:49:25 CET 2018 customPanel= showEnabledTestsOnly= listFilter=rps-test