Closedown
This commit is contained in:
@@ -185,18 +185,47 @@
|
||||
<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 type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="buttonConfig" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="deviceStatePanel1" alignment="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerImages" linkSize="4" min="-2" pref="109" max="-2" attributes="0"/>
|
||||
<Component id="textFile" linkSize="4" min="-2" pref="109" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="deviceValuePanel1" linkSize="4" min="-2" pref="109" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="buttonStart" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="buttonStop" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -204,14 +233,28 @@
|
||||
<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"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerImages" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textFile" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonStart" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel3" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="deviceValuePanel1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" 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>
|
||||
@@ -251,6 +294,44 @@
|
||||
<Property name="deviceName" type="java.lang.String" value="std_daq"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Images:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerImages">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="10" maximum="100000" minimum="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="File:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textFile">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="4"/>
|
||||
<Property name="text" type="java.lang.String" value="/tmp/test.h5"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Req Id:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel1">
|
||||
<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/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="deviceName" type="java.lang.String" value="std_daq"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
||||
@@ -49,11 +49,15 @@ public class Eiger extends Panel {
|
||||
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())));
|
||||
textFile.setEnabled(buttonStart.isEnabled());
|
||||
spinnerImages.setEnabled(buttonStart.isEnabled());
|
||||
|
||||
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())));
|
||||
|
||||
textReqId
|
||||
|
||||
}
|
||||
|
||||
@@ -102,6 +106,12 @@ public class Eiger extends Panel {
|
||||
buttonStop = new javax.swing.JButton();
|
||||
buttonConfig = new javax.swing.JButton();
|
||||
deviceStatePanel1 = new ch.psi.pshell.swing.DeviceStatePanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
spinnerImages = new javax.swing.JSpinner();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
textFile = new javax.swing.JTextField();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
deviceValuePanel1 = new ch.psi.pshell.swing.DeviceValuePanel();
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Detector")));
|
||||
|
||||
@@ -213,37 +223,85 @@ public class Eiger extends Panel {
|
||||
deviceStatePanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("State"));
|
||||
deviceStatePanel1.setDeviceName("std_daq");
|
||||
|
||||
jLabel1.setText("Images:");
|
||||
|
||||
spinnerImages.setModel(new javax.swing.SpinnerNumberModel(10, 0, 100000, 1));
|
||||
|
||||
jLabel2.setText("File:");
|
||||
|
||||
textFile.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
|
||||
textFile.setText("/tmp/test.h5");
|
||||
|
||||
jLabel3.setText("Req Id:");
|
||||
|
||||
deviceValuePanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
|
||||
deviceValuePanel1.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))
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(buttonConfig)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addComponent(deviceStatePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addGap(6, 6, 6))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerImages, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(textFile, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(jLabel3)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(buttonStart))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(buttonStop)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonConfig, buttonStart, buttonStop});
|
||||
|
||||
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deviceValuePanel1, spinnerImages, textFile});
|
||||
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(buttonStart)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(spinnerImages, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(textFile, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonStart)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(deviceValuePanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.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))
|
||||
.addComponent(deviceStatePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
@@ -360,7 +418,9 @@ public class Eiger extends Panel {
|
||||
private void buttonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartActionPerformed
|
||||
try{
|
||||
if (stddaq!=null){
|
||||
evalAsync("std_daq.start()");
|
||||
int images = (Integer)spinnerImages.getValue();
|
||||
String file = textFile.getText();
|
||||
evalAsync("std_daq.start(n_images=" + images + ", output_file='" + file + "')");
|
||||
}
|
||||
} catch (Exception ex){
|
||||
showException(ex);
|
||||
@@ -407,9 +467,15 @@ public class Eiger extends Panel {
|
||||
private javax.swing.JButton buttonStopDet;
|
||||
private ch.psi.pshell.swing.DeviceStatePanel deviceStatePanel1;
|
||||
private ch.psi.pshell.swing.DeviceStatePanel deviceStatePanel2;
|
||||
private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel1;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private ch.psi.pshell.imaging.Renderer renderer;
|
||||
private javax.swing.JSpinner spinnerImages;
|
||||
private javax.swing.JTextField textFile;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
class Detector(DeviceBase):
|
||||
def __init__(self, name):
|
||||
DeviceBase.__init__(self, name)
|
||||
self.setSimulated()
|
||||
DeviceBase.__init__(self, name, simulated=False)
|
||||
if simulated:
|
||||
self.setSimulated()
|
||||
self.simulated_pars = {}
|
||||
|
||||
def doInitialize(self):
|
||||
|
||||
@@ -1,31 +1,46 @@
|
||||
class StdDaq(DeviceBase):
|
||||
def __init__(self, name):
|
||||
def __init__(self, name, url, simulated=False):
|
||||
DeviceBase.__init__(self, name)
|
||||
self.setSimulated()
|
||||
self.simulated_config = {
|
||||
"detector_name": "eg",
|
||||
"detector_type": "eiger",
|
||||
"n_modules": 2,
|
||||
"bit_depth": 32,
|
||||
"image_pixel_height": 514,
|
||||
"image_pixel_width": 1030,
|
||||
"start_udp_port": 50000
|
||||
}
|
||||
self.url=url
|
||||
self.req_id = None
|
||||
if simulated:
|
||||
self.setSimulated()
|
||||
self.simulated_id=1
|
||||
self.simulated_config = {
|
||||
"detector_name": "eg",
|
||||
"detector_type": "eiger",
|
||||
"n_modules": 2,
|
||||
"bit_depth": 32,
|
||||
"image_pixel_height": 514,
|
||||
"image_pixel_width": 1030,
|
||||
"start_udp_port": 50000
|
||||
}
|
||||
|
||||
|
||||
def doInitialize(self):
|
||||
pass
|
||||
|
||||
def start(self):
|
||||
def start(n_images, output_file):
|
||||
self.state.assertIs(State.Ready)
|
||||
if not self.simulated:
|
||||
pass
|
||||
data = {"sources":"eiger", "n_images":10, "output_file":"/tmp/test.h5"}
|
||||
headers = {'Content-type': 'application/json'}
|
||||
r = requests.post(url = self.url + "/write_async", json=data, headers=headers)
|
||||
self.req_id = str(r.json()["request_id"])
|
||||
|
||||
else:
|
||||
self.req_id = self.simulated_id
|
||||
self.simulated_id=self.simulated_id+1
|
||||
self.setCache(self.req_id, None)
|
||||
self.setState(State.Busy)
|
||||
|
||||
def stop(self):
|
||||
self.state.assertIs(State.Busy)
|
||||
if not self.simulated:
|
||||
pass
|
||||
data = {"request_id":self.req_id}
|
||||
headers = {'Content-type': 'application/json'}
|
||||
r = requests.post(url = self.url + "/write_kill", json=data, headers=headers)
|
||||
self.setCache(None, None)
|
||||
self.setState(State.Ready)
|
||||
|
||||
def get_config(self):
|
||||
|
||||
Reference in New Issue
Block a user