This commit is contained in:
2018-08-15 17:04:21 +02:00
parent 1de8ced3d5
commit 3e41debde1
55 changed files with 1015 additions and 277 deletions

BIN
plugins/MXSC-1.10.0.jar Normal file

Binary file not shown.

View File

@@ -24,6 +24,11 @@
</Group>
<EmptySpace pref="467" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jCheckBox1" min="-2" pref="167" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="141" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@@ -33,7 +38,9 @@
<Component id="buttonRun" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="151" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="110" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -55,5 +62,10 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonAbortActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="jCheckBox1">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
</Properties>
</Component>
</SubComponents>
</Form>

View File

@@ -44,6 +44,7 @@ buttonRun.setEnabled(state==State.Ready);
buttonRun = new javax.swing.JButton();
buttonAbort = new javax.swing.JButton();
jCheckBox1 = new javax.swing.JCheckBox();
buttonRun.setText("Run");
buttonRun.addActionListener(new java.awt.event.ActionListener() {
@@ -59,6 +60,8 @@ buttonRun.setEnabled(state==State.Ready);
}
});
jCheckBox1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -69,6 +72,10 @@ buttonRun.setEnabled(state==State.Ready);
.addComponent(buttonAbort, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonRun, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(467, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(141, 141, 141))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -77,7 +84,9 @@ buttonRun.setEnabled(state==State.Ready);
.addComponent(buttonRun)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonAbort)
.addContainerGap(151, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addComponent(jCheckBox1)
.addContainerGap(110, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
@@ -100,5 +109,6 @@ buttonRun.setEnabled(state==State.Ready);
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonAbort;
private javax.swing.JButton buttonRun;
private javax.swing.JCheckBox jCheckBox1;
// End of variables declaration//GEN-END:variables
}

View File

@@ -3428,30 +3428,33 @@ public class ScreenPanel3 extends Panel {
ChannelInteger setpoint = null;
try {
int index = comboScreen.getSelectedIndex();
if (cameraName.contains("DSRM")) {
setpoint = new ChannelInteger(null, cameraName + ":POSITION_SP");
} else {
setpoint = new ChannelInteger(null, cameraName + ":SET_SCREEN1_POS");
if (index>=0){
if (cameraName.contains("DSRM")) {
setpoint = new ChannelInteger(null, cameraName + ":POSITION_SP");
} else {
setpoint = new ChannelInteger(null, cameraName + ":SET_SCREEN1_POS");
}
setpoint.initialize();
Integer readback = setpoint.read();
if ((readback==null) || (setpoint.read() != index)) {
setpoint.write(index);
//Must be threaded to control the laser because of sleep in setLaserState
/*
boolean laserOn = getLaserState();
if (laserOn) {
setLaserState(false);
}
try {
setpoint.write(index);
} finally {
if (laserOn) {
setLaserState(true);
}
}
*/
}
screen.read();
}
setpoint.initialize();
if (setpoint.read() != index) {
setpoint.write(index);
//Must be threaded to control the laser because of sleep in setLaserState
/*
boolean laserOn = getLaserState();
if (laserOn) {
setLaserState(false);
}
try {
setpoint.write(index);
} finally {
if (laserOn) {
setLaserState(true);
}
}
*/
}
screen.read();
} catch (Exception ex) {
showException(ex);
} finally {
@@ -3467,8 +3470,10 @@ public class ScreenPanel3 extends Panel {
private void comboFilterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboFilterActionPerformed
try {
String setpoint = (String) comboFilter.getSelectedItem();
if (!setpoint.equals(filter.read())) {
filter.write(setpoint);
if (setpoint!=null){
if (!setpoint.equals(filter.read())) {
filter.write(setpoint);
}
}
} catch (Exception ex) {
showException(ex);

46
plugins/Tomaz.form Normal file
View File

@@ -0,0 +1,46 @@
<?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" alignment="0" attributes="0">
<EmptySpace min="-2" pref="133" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="219" 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="-2" pref="38" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="70" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" value="jButton1"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

112
plugins/Tomaz.java Normal file
View File

@@ -0,0 +1,112 @@
/*
* Copyright (c) 2014-2018 Paul Scherrer Institute. All rights reserved.
*/
import ch.psi.pshell.bs.ProviderConfig;
import ch.psi.pshell.ui.Console;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.Config;
import ch.psi.utils.State;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
*/
public class Tomaz extends Panel {
final Console console;
public Tomaz() {
initComponents();
console = new Console() {
protected void onConsoleCommand(String name, String[] pars, String trimming) throws Exception {
switch (name) {
case "test":
System.out.println("OK");
break;
}
}
};
}
@Override
public void onStart() {
super.onStart();
console.start();
}
@Override
public void onStop() {
super.onStart();
console.stop();
}
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
}
@Override
public void onStateChange(State state, State former) {
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
//Callback to perform update - in event thread
@Override
protected void doUpdate() {
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jButton1 = new javax.swing.JButton();
jButton1.setText("jButton1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(133, 133, 133)
.addComponent(jButton1)
.addContainerGap(219, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(38, 38, 38)
.addComponent(jButton1)
.addContainerGap(70, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
//showSettingsEditor(false);
//showSettingsEditor(true);
Config cfg = new ProviderConfig();
try {
cfg.load("~/test.cfg");
} catch (IOException ex) {
Logger.getLogger(Tomaz.class.getName()).log(Level.SEVERE, null, ex);
}
showConfigEditor(cfg, true);
}//GEN-LAST:event_jButton1ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
// End of variables declaration//GEN-END:variables
}