mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-06-26 12:41:09 +02:00
Spyder style fixes...
This commit is contained in:
@ -6,7 +6,7 @@ Created on Mon Jun 3 14:16:29 2024
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from ophyd import Device, Signal, SignalRO, Component
|
from ophyd import Device, SignalRO, Component
|
||||||
from std_daq_client import StdDaqClient
|
from std_daq_client import StdDaqClient
|
||||||
|
|
||||||
|
|
||||||
@ -74,9 +74,11 @@ class StdDaqClientDevice(Device):
|
|||||||
|
|
||||||
|
|
||||||
def stage(self):
|
def stage(self):
|
||||||
self.client.start_writer_async({'output_file': self._output_file, 'n_images': self._n_images})
|
self.client.start_writer_async(
|
||||||
|
{'output_file': self._output_file, 'n_images': self._n_images}
|
||||||
return
|
)
|
||||||
|
sleep(0.1)
|
||||||
|
return super().stage()
|
||||||
#while True:
|
#while True:
|
||||||
# sleep(0.1)
|
# sleep(0.1)
|
||||||
# daq_status = self.client.get_status()
|
# daq_status = self.client.get_status()
|
||||||
@ -84,13 +86,23 @@ class StdDaqClientDevice(Device):
|
|||||||
# break
|
# break
|
||||||
|
|
||||||
def unstage(self):
|
def unstage(self):
|
||||||
|
""" Stop a running acquisition """
|
||||||
|
self.client.stop_writer()
|
||||||
|
return super().unstage()
|
||||||
|
|
||||||
|
def stop(self, *, success=False):
|
||||||
|
""" Stop a running acquisition """
|
||||||
self.client.stop_writer()
|
self.client.stop_writer()
|
||||||
|
|
||||||
def stop(self):
|
if success:
|
||||||
self.client.stop_writer()
|
while True:
|
||||||
|
sleep(0.1)
|
||||||
|
daq_status = self.client.get_status()
|
||||||
|
if daq_status['acquisition']['state'] in ["STOPPED", "FINISHED"]:
|
||||||
|
break
|
||||||
|
|
||||||
def poll(self):
|
def poll(self):
|
||||||
|
""" Querry the currrent status from Std DAQ"""
|
||||||
daq_status = self.client.get_status()
|
daq_status = self.client.get_status()
|
||||||
|
|
||||||
# Put if new value (put runs subscriptions)
|
# Put if new value (put runs subscriptions)
|
||||||
@ -111,7 +123,7 @@ class StdDaqClientDevice(Device):
|
|||||||
|
|
||||||
|
|
||||||
def poll_device_config(self):
|
def poll_device_config(self):
|
||||||
|
""" Querry the currrent configuration from Std DAQ"""
|
||||||
daq_config = self.client.get_config()
|
daq_config = self.client.get_config()
|
||||||
|
|
||||||
# Put if new value (put runs subscriptions)
|
# Put if new value (put runs subscriptions)
|
||||||
@ -132,25 +144,3 @@ class StdDaqClientDevice(Device):
|
|||||||
|
|
||||||
if self.start_udp_port.value != daq_config['start_udp_port']:
|
if self.start_udp_port.value != daq_config['start_udp_port']:
|
||||||
self.start_udp_port.put(daq_config['start_udp_port'])
|
self.start_udp_port.put(daq_config['start_udp_port'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user