Startup
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="valueText" min="-2" pref="179" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="226" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="valueText" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Value:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="valueText">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
@@ -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")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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))
|
||||
);
|
||||
}// </editor-fold>//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
|
||||
}
|
||||
@@ -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", "<html>this is a <b>help</b><code> directly from config file</code></html>");
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
@@ -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";
|
||||
@@ -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 {
|
||||
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user