Add crystal control

This commit is contained in:
2022-03-21 12:25:15 +01:00
parent ed0b082c7c
commit b59303da6e
3 changed files with 178 additions and 76 deletions

View File

@@ -808,66 +808,116 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="66" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel15" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel14" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="discretePositionerSelector1" linkSize="12" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="registerPanel1" linkSize="12" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="553" max="32767" attributes="0"/>
<Component id="jPanel8" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="595" 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="52" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="registerPanel1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="discretePositionerSelector1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="306" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Component id="jPanel8" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="265" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.swing.RegisterPanel" name="registerPanel1">
<Properties>
<Property name="deviceName" type="java.lang.String" value="psss_energy_set"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DiscretePositionerSelector" name="discretePositionerSelector1">
<Properties>
<Property name="deviceName" type="java.lang.String" value="psss_grating"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Energy:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel15">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Grating:"/>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="jPanel8">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel19" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="discretePositionerSelector2" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel15" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel14" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="discretePositionerSelector1" linkSize="12" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="registerPanel1" linkSize="12" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace 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="0" attributes="0">
<Component id="discretePositionerSelector1" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="discretePositionerSelector2" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Component id="jLabel19" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="registerPanel1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel14" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.swing.DiscretePositionerSelector" name="discretePositionerSelector2">
<Properties>
<Property name="deviceName" type="java.lang.String" value="psss_crystal"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DiscretePositionerSelector" name="discretePositionerSelector1">
<Properties>
<Property name="deviceName" type="java.lang.String" value="psss_grating"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Energy:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel15">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Grating:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel19">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Crystal:"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.RegisterPanel" name="registerPanel1">
<Properties>
<Property name="deviceName" type="java.lang.String" value="psss_energy_set"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>

View File

@@ -236,10 +236,13 @@ public class PSSS extends Panel {
btStartCr = new javax.swing.JButton();
plotScan = new ch.psi.pshell.plot.LinePlotJFree();
jPanel6 = new javax.swing.JPanel();
registerPanel1 = new ch.psi.pshell.swing.RegisterPanel();
jPanel8 = new javax.swing.JPanel();
discretePositionerSelector2 = new ch.psi.pshell.swing.DiscretePositionerSelector();
discretePositionerSelector1 = new ch.psi.pshell.swing.DiscretePositionerSelector();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
registerPanel1 = new ch.psi.pshell.swing.RegisterPanel();
tab.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
@@ -732,7 +735,7 @@ public class PSSS extends Panel {
tab.addTab("Alignment", jPanel3);
registerPanel1.setDeviceName("psss_energy_set");
discretePositionerSelector2.setDeviceName("psss_crystal");
discretePositionerSelector1.setDeviceName("psss_grating");
@@ -742,39 +745,71 @@ public class PSSS extends Panel {
jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel15.setText("Grating:");
jLabel19.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel19.setText("Crystal:");
registerPanel1.setDeviceName("psss_energy_set");
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addComponent(jLabel19)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(discretePositionerSelector2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel8Layout.createSequentialGroup()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(discretePositionerSelector1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(registerPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
jPanel8Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {discretePositionerSelector1, registerPanel1});
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(discretePositionerSelector1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(8, 8, 8)
.addComponent(jLabel15)))
.addGap(18, 18, 18)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(discretePositionerSelector2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(8, 8, 8)
.addComponent(jLabel19)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(registerPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14))
.addContainerGap())
);
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addGap(66, 66, 66)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(discretePositionerSelector1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(registerPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(553, Short.MAX_VALUE))
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 595, Short.MAX_VALUE))
);
jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {discretePositionerSelector1, registerPanel1});
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addGap(52, 52, 52)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(registerPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14))
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(discretePositionerSelector1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel6Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(jLabel15)))
.addContainerGap(306, Short.MAX_VALUE))
.addGap(20, 20, 20)
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(265, Short.MAX_VALUE))
);
tab.addTab("Control", jPanel6);
@@ -871,6 +906,7 @@ public class PSSS extends Panel {
private javax.swing.JButton btStartEn;
private javax.swing.ButtonGroup buttonGroup1;
private ch.psi.pshell.swing.DiscretePositionerSelector discretePositionerSelector1;
private ch.psi.pshell.swing.DiscretePositionerSelector discretePositionerSelector2;
private ch.psi.pshell.swing.HistogramGeneratorPanel histogramGeneratorFwhm;
private ch.psi.pshell.swing.HistogramGeneratorPanel histogramGeneratorPanelCenter;
private ch.psi.pshell.plot.TimePlotJFree history;
@@ -884,6 +920,7 @@ public class PSSS extends Panel {
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
@@ -899,6 +936,7 @@ public class PSSS extends Panel {
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel panelCameraScan;
private javax.swing.JPanel panelCrystalScan;
private javax.swing.JPanel panelEnergyScan;

View File

@@ -180,6 +180,20 @@ class PSSSGratingSet(DiscretePositioner):
add_device(PSSSGratingSet("psss_grating", "SARFE10-PSSS055:GRATING_SP"), True)
psss_grating.alias = "grating"
psss_grating.monitored=True
class PSSSCrystalSet(DiscretePositioner):
def doWrite(self, val):
if not is_dry_run():
super(PSSSCrystalSet, self).doWrite(val)
#caput(psss_grating.getSetpoint().getChannelName(), val)
#self.setCache(val)
exec_cpython("/ioc/modules/qt/PSSS_motion.py", args = ["-m2", "SARFE10-PSSS059"])
# python / ioc / modules / qt / PSSS_motion.py - m1 SARFE10 - PSSS059
time.sleep(1)
add_device(PSSSCrystalSet("psss_crystal", "SARFE10-PSSS059:CRYSTAL_SP"), True)
psss_crystal.alias = "grating"
psss_crystal.monitored=True
###################################################################################################
# Tools
###################################################################################################