From 8928cae5d3167b3dfb133cbeda80412c6d8918ca Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Fri, 15 Jan 2016 10:48:54 +0100 Subject: [PATCH] Startup --- plugins/Marco.form | 53 -------- plugins/Marco.java | 113 ------------------ plugins/TestMain.java | 88 -------------- plugins/new_main.py | 11 -- plugins/plublic.java | 13 -- .../{-tests.properties => tests.properties} | 2 +- 6 files changed, 1 insertion(+), 279 deletions(-) delete mode 100644 plugins/Marco.form delete mode 100644 plugins/Marco.java delete mode 100644 plugins/TestMain.java delete mode 100644 plugins/new_main.py delete mode 100644 plugins/plublic.java rename script/tests/{-tests.properties => tests.properties} (75%) diff --git a/plugins/Marco.form b/plugins/Marco.form deleted file mode 100644 index 41ac8fa..0000000 --- a/plugins/Marco.form +++ /dev/null @@ -1,53 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/plugins/Marco.java b/plugins/Marco.java deleted file mode 100644 index 161590b..0000000 --- a/plugins/Marco.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2014 Paul Scherrer Institute. All rights reserved. - */ - -import ch.psi.jcae.Channel; -import ch.psi.jcae.ChannelException; -import ch.psi.pshell.device.Device; -import ch.psi.pshell.device.DeviceAdapter; -import ch.psi.pshell.device.DeviceListener; -import ch.psi.pshell.epics.ChannelDouble; -import ch.psi.pshell.epics.Epics; -import ch.psi.pshell.epics.EpicsRegister; -import ch.psi.pshell.ui.Panel; -import ch.psi.utils.State; -import java.util.concurrent.TimeoutException; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - */ -public class Marco extends javax.swing.JPanel { - - public Marco() { - initComponents(); - } - public Marco (String params) { - initComponents(); - //connect("XPROLUFT"); - connect(""); - } - - ChannelDouble channel; - - //Overridable callbacks - public void onInitialize(int runCount) { - initComponents(); - connect(""); - } - - public void connect(String device) { - try { - ChannelDouble channel = new ChannelDouble(device+"SIM-MMAC3:STR:2", device+"SIM-MMAC3:STR:2", 3); - channel.setMonitored(true); - channel.initialize(); - - channel.addListener(new DeviceAdapter() { - @Override - public void onValueChanged(Device device, Object value, Object former) { - Double val = (Double )value; - valueText.setText(String.valueOf(val)); - valueText.setToolTipText(device.getName()); - } - }); - //channel.close(); - } catch (Exception ex) { - System.out.println(ex.toString()); - } - } - - public void onStateChange(State state, State former) { - - } - - public void onExecutedFile(String fileName, Object result) { - } - - - //Callback to perform update - in event thread - protected void doUpdate() { - } - - public void animate(String deviceName) { - } - - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - jLabel2 = new javax.swing.JLabel(); - valueText = new javax.swing.JTextField(); - - jLabel2.setText("Value:"); - - valueText.setEditable(false); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(valueText, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(226, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(valueText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel2)) - .addGap(0, 0, 0)) - ); - }// //GEN-END:initComponents - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLabel jLabel2; - private javax.swing.JTextField valueText; - // End of variables declaration//GEN-END:variables -} diff --git a/plugins/TestMain.java b/plugins/TestMain.java deleted file mode 100644 index 28e3813..0000000 --- a/plugins/TestMain.java +++ /dev/null @@ -1,88 +0,0 @@ - -import java.io.IOException; -import java.util.HashMap; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.JFrame; - -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/** - * - * @author boccioli_m - */ -public class TestMain { - - /** - * @param args the command line arguments - */ - public static void main(String[] args) { - try { - // TODO code application logic here - HashMap details = new HashMap(); - details.put("deviceName", "Device name"); - details.put("deviceDescription", "Device des"); - details.put("testSuite", "test suite"); - details.put("testName", "test name"); - details.put("testResult", "Device res"); - details.put("time", "time"); - HashMap params = new HashMap(); - params = aBuildParametersMap("repeatTimes:3:Repeat times;midPoint:41.0:Middle point;spanFromMidPoint:11.0:Span around middle point"); - details.put("parameters", params); - details.put("testDescription", "TestDescription"); - details.put("testPath", "C:\\Users\\boccioli_m\\Documents\\pshell\\home\\script\\tests\\tests\\Collimator Tests\\Calibrate\\Calibrate.py"); - details.put("testHelp", "this is a help directly from config file"); -// details.put("testHelpUrl", "file:\\\\C:\\Users\\boccioli_m\\Documents\\pshell\\home\\script\\tests\\tests\\Collimator Tests\\Calibrate\\help.html"); -// details.put("testHelpUrl", "http://www.google.com"); - System.out.print(new java.io.File(".").getCanonicalPath()); - - JFrame frame = new JFrame(); - frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - frame.getContentPane().add(new TestingListDetails(details)); - frame.pack(); - frame.setVisible(true); - } catch (IOException ex) { - Logger.getLogger(TestMain.class.getName()).log(Level.SEVERE, null, ex); - } - } - - - public static HashMap aBuildParametersMap(String parametersString){ - /* - 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. - */ - 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; - } -} diff --git a/plugins/new_main.py b/plugins/new_main.py deleted file mode 100644 index 328ae41..0000000 --- a/plugins/new_main.py +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/python - -# To change this license header, choose License Headers in Project Properties. -# To change this template file, choose Tools | Templates -# and open the template in the editor. - -__author__ = "boccioli_m" -__date__ = "$Aug 17, 2015 2:59:50 PM$" - -if __name__ == "__main__": - print "Hello World"; diff --git a/plugins/plublic.java b/plugins/plublic.java deleted file mode 100644 index d8967f8..0000000 --- a/plugins/plublic.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/** - * - * @author boccioli_m - */ -class plublic { - -} diff --git a/script/tests/-tests.properties b/script/tests/tests.properties similarity index 75% rename from script/tests/-tests.properties rename to script/tests/tests.properties index 9b6075e..be25d69 100644 --- a/script/tests/-tests.properties +++ b/script/tests/tests.properties @@ -1,5 +1,5 @@ #TestingList for pshell: configuration properties -#Wed Jan 13 15:10:45 CET 2016 +#Fri Jan 15 10:48:47 CET 2016 customPanel= showEnabledTestsOnly= listFilter=LabTests2