Closedown

This commit is contained in:
gac-x12sa
2023-01-05 11:34:00 +01:00
parent fb99e7553f
commit 1809c74aef
3 changed files with 431 additions and 17 deletions
+169 -7
View File
@@ -17,7 +17,10 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jPanel2" max="32767" attributes="0"/>
</Group>
@@ -26,9 +29,13 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel2" max="32767" attributes="0"/>
<Component id="jPanel1" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="jPanel3" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jPanel1" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
</Group>
@@ -52,15 +59,85 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="238" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonStartDet" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonStopDet" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonConfigDet" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonParsDet" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="deviceStatePanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="25" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonStartDet" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonStopDet" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="buttonConfigDet" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonParsDet" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="deviceStatePanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="buttonStartDet">
<Properties>
<Property name="text" type="java.lang.String" value="Start"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStartDetActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonStopDet">
<Properties>
<Property name="text" type="java.lang.String" value="Stop"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStopDetActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonConfigDet">
<Properties>
<Property name="text" type="java.lang.String" value="Config"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigDetActionPerformed"/>
</Events>
</Component>
<Component class="ch.psi.pshell.swing.DeviceStatePanel" name="deviceStatePanel2">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="State"/>
</Border>
</Property>
<Property name="deviceName" type="java.lang.String" value="detector"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonParsDet">
<Properties>
<Property name="text" type="java.lang.String" value="Pars"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonParsDetActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
@@ -74,12 +151,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="renderer" pref="434" max="32767" attributes="0"/>
<Component id="renderer" pref="454" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="renderer" alignment="0" pref="349" max="32767" attributes="0"/>
<Component id="renderer" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@@ -91,5 +168,90 @@
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="STD DAQ">
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Detector"/>
</Border>
</TitledBorder>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonStart" linkSize="2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonStop" linkSize="2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonConfig" linkSize="2" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="deviceStatePanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="25" 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 max="-2" attributes="0"/>
<Component id="buttonStart" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonStop" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="buttonConfig" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="deviceStatePanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="buttonStart">
<Properties>
<Property name="text" type="java.lang.String" value="Start"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStartActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonStop">
<Properties>
<Property name="text" type="java.lang.String" value="Stop"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStopActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonConfig">
<Properties>
<Property name="text" type="java.lang.String" value="Config"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigActionPerformed"/>
</Events>
</Component>
<Component class="ch.psi.pshell.swing.DeviceStatePanel" name="deviceStatePanel1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="State"/>
</Border>
</Property>
<Property name="deviceName" type="java.lang.String" value="std_daq"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
+259 -8
View File
@@ -1,13 +1,19 @@
import ch.psi.pshell.device.Device;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.EncoderJson;
import ch.psi.utils.State;
import ch.psi.utils.swing.ScriptDialog;
import java.nio.file.Paths;
import java.util.Map;
/**
*
*/
public class Eiger extends Panel {
final String RENDERER_PERSIST_FILE = "{context}/EigerRenderer";
Device detector;
Device stddaq;
public Eiger() {
initComponents();
@@ -17,11 +23,27 @@ public class Eiger extends Panel {
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
detector = (Device) getDevice("detector");
stddaq = (Device) getDevice("std_daq");
}
void updateControls(){
boolean enabled = getState().isReady();
buttonStart.setEnabled(enabled && ((stddaq!=null) || (stddaq.getState().isReady())));
buttonStop.setEnabled(enabled && ((stddaq!=null) || (stddaq.getState()==State.Busy)));
buttonConfig.setEnabled(enabled && ((stddaq!=null) || (stddaq.getState().isInitialized())));
buttonStartDet.setEnabled(enabled && ((detector!=null) || (detector.getState().isReady())));
buttonStopDet.setEnabled(enabled && ((detector!=null) || (detector.getState()==State.Busy)));
buttonConfigDet.setEnabled(enabled && ((detector!=null) || (detector.getState().isInitialized())));
buttonParsDet.setEnabled(enabled && ((detector!=null) || (detector.getState().isInitialized())));
}
@Override
public void onStateChange(State state, State former) {
updateControls();
}
@Override
@@ -52,20 +74,86 @@ public class Eiger extends Panel {
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
buttonStartDet = new javax.swing.JButton();
buttonStopDet = new javax.swing.JButton();
buttonConfigDet = new javax.swing.JButton();
deviceStatePanel2 = new ch.psi.pshell.swing.DeviceStatePanel();
buttonParsDet = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
renderer = new ch.psi.pshell.imaging.Renderer();
jPanel3 = new javax.swing.JPanel();
buttonStart = new javax.swing.JButton();
buttonStop = new javax.swing.JButton();
buttonConfig = new javax.swing.JButton();
deviceStatePanel1 = new ch.psi.pshell.swing.DeviceStatePanel();
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Detector")));
buttonStartDet.setText("Start");
buttonStartDet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonStartDetActionPerformed(evt);
}
});
buttonStopDet.setText("Stop");
buttonStopDet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonStopDetActionPerformed(evt);
}
});
buttonConfigDet.setText("Config");
buttonConfigDet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonConfigDetActionPerformed(evt);
}
});
deviceStatePanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("State"));
deviceStatePanel2.setDeviceName("detector");
buttonParsDet.setText("Pars");
buttonParsDet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonParsDetActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 238, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonStartDet)
.addComponent(buttonStopDet)
.addComponent(buttonConfigDet)
.addComponent(buttonParsDet))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(deviceStatePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(25, Short.MAX_VALUE))
);
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonConfigDet, buttonParsDet, buttonStartDet, buttonStopDet});
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(buttonStartDet)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonStopDet)
.addGap(18, 18, Short.MAX_VALUE)
.addComponent(buttonConfigDet)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonParsDet)
.addGap(18, 18, Short.MAX_VALUE)
.addComponent(deviceStatePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Stream"));
@@ -76,11 +164,70 @@ public class Eiger extends Panel {
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 434, Short.MAX_VALUE)
.addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
.addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Detector"), "STD DAQ"));
buttonStart.setText("Start");
buttonStart.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonStartActionPerformed(evt);
}
});
buttonStop.setText("Stop");
buttonStop.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonStopActionPerformed(evt);
}
});
buttonConfig.setText("Config");
buttonConfig.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonConfigActionPerformed(evt);
}
});
deviceStatePanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("State"));
deviceStatePanel1.setDeviceName("std_daq");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonStart)
.addComponent(buttonStop)
.addComponent(buttonConfig))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(deviceStatePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(25, Short.MAX_VALUE))
);
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonConfig, buttonStart, buttonStop});
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(buttonStart)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonStop)
.addGap(18, 18, Short.MAX_VALUE)
.addComponent(buttonConfig)
.addGap(18, 18, Short.MAX_VALUE)
.addComponent(deviceStatePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -88,23 +235,127 @@ public class Eiger extends Panel {
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGap(0, 0, 0))
);
}// </editor-fold>//GEN-END:initComponents
private void buttonConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigActionPerformed
}//GEN-LAST:event_buttonConfigActionPerformed
private void buttonConfigDetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigDetActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_buttonConfigDetActionPerformed
private void buttonParsDetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonParsDetActionPerformed
try{
if (stddaq!=null){
String title = "Detector Parameters";
this.evalAsync("detector.get_pars()").handle((ret,ex)->{
if (ex!=null){
showException((Exception) ex);
} else {
try{
Map cfg = (Map) ret;
String json = EncoderJson.encode(cfg, true);
ScriptDialog dlg = new ScriptDialog(getWindow(), true, title, json, "json");
dlg.setVisible(true);
if (dlg.getResult()){
json = dlg.getText();
cfg = (Map) EncoderJson.decode(json, Map.class);
setGlobalVar("_detector_config", cfg);
evalAsync("detector.set_pars(_detector_config)").handle((r,e)->{
if (e!=null){
showException((Exception) e);
} else {
showMessage(title, "Success");
}
return ret;
});
}
} catch (Exception e){
showException(e);
}
}
return ret;
});
}
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_buttonParsDetActionPerformed
private void buttonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartActionPerformed
try{
if (stddaq!=null){
evalAsync("stddaq.start()");
}
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_buttonStartActionPerformed
private void buttonStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStopActionPerformed
try{
if (stddaq!=null){
evalAsync("stddaq.stop()");
}
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_buttonStopActionPerformed
private void buttonStartDetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartDetActionPerformed
try{
if (stddaq!=null){
evalAsync("detector.start()");
}
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_buttonStartDetActionPerformed
private void buttonStopDetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStopDetActionPerformed
try{
if (stddaq!=null){
evalAsync("detector.stop()");
}
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_buttonStopDetActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonConfig;
private javax.swing.JButton buttonConfigDet;
private javax.swing.JButton buttonParsDet;
private javax.swing.JButton buttonStart;
private javax.swing.JButton buttonStartDet;
private javax.swing.JButton buttonStop;
private javax.swing.JButton buttonStopDet;
private ch.psi.pshell.swing.DeviceStatePanel deviceStatePanel1;
private ch.psi.pshell.swing.DeviceStatePanel deviceStatePanel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private ch.psi.pshell.imaging.Renderer renderer;
// End of variables declaration//GEN-END:variables
}
+3 -2
View File
@@ -6,10 +6,11 @@ class Detector(DeviceBase):
DeviceBase.doInitialize(self)
def start():
print "startd"
setState(State.Busy)
def stop():
print "stopd"
setState(State.Ready)
def doClose(self):
DeviceBase.doClose(self)