Closedown

This commit is contained in:
boccioli_m
2015-08-27 15:31:57 +02:00
parent 400c94aeda
commit e37ebd9000
8 changed files with 731 additions and 392 deletions

View File

@@ -1,4 +1,11 @@
.\\home\\plugins\\EditTestingList.java=enabled
.\\home\\plugins\\EditTestingList - Copy.java=disabled
.\\home\\plugins\\NewTest - Copy.java=disabled
.\\home\\plugins\\EditTestingList - Copy.java=disabled
.\\home\\plugins\\EditTestingList - Copy.java=disabled
.\\home\\plugins\\EditTestingListNew.java=disabled
.\\home\\plugins\\FilterTable.java=disabled
.\\home\\plugins\\NewTest.java=enabled
.\\home\\plugins\\EditTestingList.java=disabled
.\\home\\plugins\\new_main.py=disabled
.\\home\\plugins\\TestMain.java=disabled
.\\home\\plugins\\TestingListDetails.java=enabled

View File

@@ -16,16 +16,47 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBoxMenuShowSelectedTestsActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItemOpenLog">
<MenuItem class="javax.swing.JMenuItem" name="jMenuItemReload">
<Properties>
<Property name="text" type="java.lang.String" value="Open Log"/>
<Property name="text" type="java.lang.String" value="Reload tests"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItemOpenLogActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItemReloadActionPerformed"/>
</Events>
</MenuItem>
<Component class="javax.swing.JPopupMenu$Separator" name="jSeparator1">
</Component>
<Menu class="javax.swing.JMenu" name="jMenuAdvanced">
<Properties>
<Property name="text" type="java.lang.String" value="Advanced"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItemNewTest">
<Properties>
<Property name="text" type="java.lang.String" value="New Test..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItemNewTestActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItemOpenLog">
<Properties>
<Property name="text" type="java.lang.String" value="Open Log"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItemOpenLogActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Container>
<Container class="javax.swing.JPopupMenu" name="jPopupMenuConfigs">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
</Container>
</NonVisualComponents>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
@@ -106,13 +137,13 @@
</Property>
<Property name="toolTipText" type="java.lang.String" value="Run selected tests"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[33, 39]"/>
<Dimension value="[330000, 39]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[90, 90]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[33, 39]"/>
<Dimension value="[90, 39]"/>
</Property>
</Properties>
<Events>
@@ -125,6 +156,14 @@
</Constraints>
</Component>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 80]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 80]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="East"/>
@@ -133,14 +172,23 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Component class="javax.swing.JButton" name="jButtonShowCheckedOnly">
<Component class="javax.swing.JButton" name="jButtonOptions">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons/settings-32px.png"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[60, 40]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 40]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 40]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonShowCheckedOnlyActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonOptionsActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
@@ -154,6 +202,15 @@
<Image iconType="3" name="/icons/android-save-24-000000.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Save current configuration"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[60, 40]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 40]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 40]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonSaveActionPerformed"/>
@@ -170,6 +227,9 @@
<Image iconType="3" name="/icons/folder-open-24-000000.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Open configuration"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 9]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[33, 50]"/>
</Property>

File diff suppressed because it is too large Load Diff

View File

@@ -38,15 +38,9 @@
<Component id="jScrollPane3" alignment="0" max="32767" attributes="0"/>
<Component id="jScrollPane2" alignment="0" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="0" pref="513" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="cmDefault" min="-2" pref="132" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="cmOk" min="-2" pref="96" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cmCancel" min="-2" pref="98" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Component id="jPanel1" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jScrollPane4" pref="317" max="32767" attributes="0"/>
@@ -93,16 +87,12 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="229" max="32767" attributes="0"/>
<EmptySpace min="0" pref="192" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane1" pref="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="cmCancel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cmOk" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cmDefault" alignment="3" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jScrollPane4" max="32767" attributes="0"/>
@@ -245,36 +235,6 @@
<Property name="text" type="java.lang.String" value="Test Parameters"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="cmCancel">
<Properties>
<Property name="text" type="java.lang.String" value="Cancel"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmCancelActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="this.cmCancel.setVisible(false);&#xd;&#xa;this.cmOk.setVisible(false);&#xd;&#xa;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="cmOk">
<Properties>
<Property name="text" type="java.lang.String" value="Ok"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="this.cmCancel.setVisible(false);&#xd;&#xa;this.cmOk.setVisible(false);&#xd;&#xa;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="cmDefault">
<Properties>
<Property name="text" type="java.lang.String" value="Save as Default"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmDefaultActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="this.cmCancel.setVisible(false);&#xd;&#xa;this.cmOk.setVisible(false);&#xd;&#xa;this.cmDefault.setVisible(false);&#xd;&#xa;"/>
</AuxValues>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
@@ -353,5 +313,47 @@
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel1">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jButtonOk" min="-2" pref="96" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButtonCancel" min="-2" pref="98" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jButtonCancel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButtonOk" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="jButtonCancel">
<Properties>
<Property name="text" type="java.lang.String" value="Cancel"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButtonOk">
<Properties>
<Property name="text" type="java.lang.String" value="Ok"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonOkActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

View File

@@ -2,10 +2,21 @@
* Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
*/
import ch.psi.utils.swing.SwingUtils;
import java.awt.Desktop;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
@@ -39,6 +50,9 @@ public class TestingListDetails extends javax.swing.JPanel {
initComponents();
fillComponents(hDetails);
}
public static String TESTS_CONFIG_FILENAME = ".config";
public static Path TESTS_TESTS_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "tests");
/**
* This method is called from within the constructor to initialize the form.
@@ -61,9 +75,6 @@ public class TestingListDetails extends javax.swing.JPanel {
jScrollPane1 = new javax.swing.JScrollPane();
jTableParams = new javax.swing.JTable();
jLabel7 = new javax.swing.JLabel();
cmCancel = new javax.swing.JButton();
cmOk = new javax.swing.JButton();
cmDefault = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
txtTestResult = new javax.swing.JTextArea();
jLabel8 = new javax.swing.JLabel();
@@ -71,6 +82,9 @@ public class TestingListDetails extends javax.swing.JPanel {
txtTestDescription = new javax.swing.JTextArea();
jScrollPane4 = new javax.swing.JScrollPane();
jEditorPaneHelp = new javax.swing.JEditorPane();
jPanel1 = new javax.swing.JPanel();
jButtonCancel = new javax.swing.JButton();
jButtonOk = new javax.swing.JButton();
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel1.setText("Device name");
@@ -134,29 +148,6 @@ public class TestingListDetails extends javax.swing.JPanel {
jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel7.setText("Test Parameters");
cmCancel.setText("Cancel");
this.cmCancel.setVisible(false);
this.cmOk.setVisible(false);
cmCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmCancelActionPerformed(evt);
}
});
cmOk.setText("Ok");
this.cmCancel.setVisible(false);
this.cmOk.setVisible(false);
cmDefault.setText("Save as Default");
this.cmCancel.setVisible(false);
this.cmOk.setVisible(false);
this.cmDefault.setVisible(false);
cmDefault.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmDefaultActionPerformed(evt);
}
});
jScrollPane2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
txtTestResult.setEditable(false);
@@ -183,6 +174,35 @@ public class TestingListDetails extends javax.swing.JPanel {
jEditorPaneHelp.setDropMode(javax.swing.DropMode.INSERT);
jScrollPane4.setViewportView(jEditorPaneHelp);
jButtonCancel.setText("Cancel");
jButtonOk.setText("Ok");
jButtonOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOkActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonOk, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButtonCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonCancel)
.addComponent(jButtonOk))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -207,13 +227,8 @@ public class TestingListDetails extends javax.swing.JPanel {
.addComponent(txtTestName)
.addComponent(jScrollPane3)
.addComponent(jScrollPane2)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 513, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(cmDefault, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmOk, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cmCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 513, Short.MAX_VALUE)))
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)
.addContainerGap())
@@ -251,13 +266,10 @@ public class TestingListDetails extends javax.swing.JPanel {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7)
.addGap(0, 229, Short.MAX_VALUE))
.addGap(0, 192, Short.MAX_VALUE))
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cmCancel)
.addComponent(cmOk)
.addComponent(cmDefault)))
.addGap(18, 18, 18)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane4)
.addContainerGap())))
@@ -332,20 +344,103 @@ public class TestingListDetails extends javax.swing.JPanel {
}
}
}
/**
* Build a map with optional parameters to be passed to the testing script.
* The map is like this: parameters \_ name | \_ value | \_ description \_
* name | \_ value | \_ description ... the name 'name' is the mapping key.
* 'value' and 'description' are constant mapping keys of a nested map.
*
* @param parametersString string containing the parameters. Syntax:
* name:value:description[;name:value:description;...]
*/
private HashMap buildParametersMap(String parametersString) {
HashMap mParameters = new HashMap(); // contains name and attributes
HashMap mParameterAttributes = new HashMap(); //contians value and description
String[] dsParameterAttributes = null;
String[] dsParameters = parametersString.split(";");
for (String sParameter : dsParameters) {
dsParameterAttributes = sParameter.split(":");
if (dsParameterAttributes.length > 2) {
mParameterAttributes = new HashMap();
mParameterAttributes.put("value", (Object) dsParameterAttributes[1]);
mParameterAttributes.put("description", dsParameterAttributes[2]);
//add parameter name and attributes (value + description)
mParameters.put(dsParameterAttributes[0], mParameterAttributes);
}
}
return mParameters;
}
private HashMap getParametersFromTable(){
HashMap mParameters = new HashMap(); // contains name and attributes
HashMap mParameterAttributes = new HashMap(); //contians value and description
for(int row=0 ; row<jTableParams.getRowCount() ; row++){
String sParam = jTableParams.getValueAt(row, 0).toString();
String sVal = jTableParams.getValueAt(row, 1).toString();
String sDescr = jTableParams.getValueAt(row, 2).toString();
mParameterAttributes = new HashMap();
mParameterAttributes.put("value", (Object) sVal);
mParameterAttributes.put("description", sDescr);
//add parameter name and attributes (value + description)
mParameters.put(sParam, mParameterAttributes);
}
return mParameters;
}
public boolean updateTestConfig(Path testDir,
String sTestName,
String sTestSuite,
HashMap hmTestParams){
//generate test config file from template
boolean success = false;
try {
Path path = Paths.get(testDir + FilenameUtils.separatorsToSystem("/"+TESTS_CONFIG_FILENAME));
File configFile = path.toFile();
//Loop among the test parameters and generate variable assignement syntax for python
String sTestParameters = "";
String name="", value="", description="";
for(Object entry : hmTestParams.keySet()){
Object param = entry;
if(param instanceof String){
name = (String) param;
HashMap attributes = (HashMap) hmTestParams.get(param);
value = (String) attributes.get("value");
description = (String) attributes.get("description");
//build the python code for getting the test parameter
sTestParameters = sTestParameters + name + ":" + value + ":" + description + ";" ;
}
}
FileOutputStream out = new FileOutputStream(path.toFile());
FileInputStream in = new FileInputStream(path.toFile());
Properties props = new Properties();
props.load(in);
in.close();
props.setProperty("parameters", "sTestParameters");
props.store(out, null);
out.close();
private void cmCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmCancelActionPerformed
}//GEN-LAST:event_cmCancelActionPerformed
success = true;
} catch (FileNotFoundException ex) {
SwingUtils.showMessage(this, "generateTestConfig()", "Cannot find file: " + ex.toString());
Logger.getLogger(NewTest.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
SwingUtils.showMessage(this, "generateTestConfig()", "Problem with file aaccess: " + ex.toString());
Logger.getLogger(NewTest.class.getName()).log(Level.SEVERE, null, ex);
}
return success;
}
private void cmDefaultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmDefaultActionPerformed
private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cmDefaultActionPerformed
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
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cmCancel;
private javax.swing.JButton cmDefault;
private javax.swing.JButton cmOk;
private javax.swing.JButton jButtonCancel;
private javax.swing.JButton jButtonOk;
private javax.swing.JEditorPane jEditorPaneHelp;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
@@ -354,6 +449,7 @@ public class TestingListDetails extends javax.swing.JPanel {
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;

View File

@@ -1,3 +1,3 @@
name=Move Ref 2
description=Moves to the Reference 2 Position
name=Move Ref 2
description=Moves to the Reference 2 Position
filename=Move Ref 2.xml

View File

@@ -1,3 +0,0 @@
name=Stop
description=Sends the STOP command
filename=Stop.xml

View File

@@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
<data fileName="Stop.fda"/>
<scan>
<!-- Send STOP Command -->
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="{DEVICE}:COM:2" value="STOP"/>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" settlingTime="0.1" id="id000000">
<counts>3000</counts>
</positioner>
<!-- Motor Drive Status -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:1" id="id000001"/>
<!-- Logical Status -->
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:2" id="id00001B"/> -->
<!-- Interlock Status -->
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IIST:2" id="id000002"/> -->
<!-- Logical Position -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST:2" id="id000003"/>
<!-- Collimator Diameter -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:DIAM:2" id="id000004"/>
<!-- Position Counter: Raw -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:1" id="id000005"/>
<!-- Position Counter: Processed -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:2" id="id000006"/>
<!-- Potentiometer: Raw -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:1" id="id000007"/>
<!-- Potentiometer: Processed -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:2" id="id000008"/>
<!-- BTVS Digitiser: Raw -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:1" id="id000009"/>
<!-- BTVS Digitiser: Processed -->
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:2" id="id000010"/>
</dimension>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000001" title="Drive Status: {DEVICE}:STA:1"/>
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000002" title="ILK Status: {DEVICE}:IIST:2"/> -->
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000003" title="Logical Pos: {DEVICE}:IST:2"/>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000004" title="Diameter: {DEVICE}:DIAM:2 (mm)"/>
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000005" title="Cpc: {DEVICE}:IST1:1 (mm)"/> -->
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000006" title="Cpc: {DEVICE}:IST1:2 (mm)"/>
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000007" title="Pot: {DEVICE}:IST2:1 (mm)"/> -->
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000008" title="Pot: {DEVICE}:IST2:2 (mm)"/>
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000009" title="Btvs: {DEVICE}:IST3:1 (ADC raw)"/> -->
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000010" title="Btvs: {DEVICE}:IST3:2 (mm)"/>
</configuration>