Closedown

This commit is contained in:
gac-x12sa
2023-01-05 14:48:47 +01:00
parent d30c312dae
commit 70b259b9e2
3 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -265,7 +265,7 @@
</Component>
<Component class="javax.swing.JButton" name="buttonStop">
<Properties>
<Property name="text" type="java.lang.String" value="Stop"/>
<Property name="text" type="java.lang.String" value="Abort"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStopActionPerformed"/>
+2 -2
View File
@@ -203,7 +203,7 @@ public class Eiger extends Panel {
}
});
buttonStop.setText("Stop");
buttonStop.setText("Abort");
buttonStop.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonStopActionPerformed(evt);
@@ -419,7 +419,7 @@ public class Eiger extends Panel {
private void buttonStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStopActionPerformed
try{
if (stddaq!=null){
evalAsync("std_daq.stop()");
evalAsync("std_daq.abort()");
}
} catch (Exception ex){
showException(ex);
+5 -2
View File
@@ -33,16 +33,18 @@ class StdDaq(DeviceBase):
else:
self.req_id = self.simulated_id
self.simulated_id=self.simulated_id+1
print "Started request: ", self.req_id
self.setCache(self.req_id, None)
self.setState(State.Busy)
fork (self.monitor)
def stop(self):
def abort(self):
self.state.assertIs(State.Busy)
if not self.simulated:
print "Aborting request: ", self.req_id
data = {"request_id":self.req_id}
headers = {'Content-type': 'application/json'}
r = requests.post(url = self.url + "/write_kill", json=data, headers=headers)
r = requests.post(url = self.url + "/write_kill", json=data, headers=headers)
self.setCache(None, None)
self.setState(State.Ready)
@@ -56,6 +58,7 @@ class StdDaq(DeviceBase):
if not self.simulated:
pass #TODO: Check Status
if done:
print "Finished request: ", self.req_id
self.setCache(None, None)
self.setState(State.Ready)
time.sleep(0.2)