The websockets interface is useless
This commit is contained in:
@@ -28,6 +28,9 @@ class StdDaqClientDevice(Device):
|
||||
self.n_image.set(100)
|
||||
self.file_path.set("/gpfs/test/test-beamline")
|
||||
|
||||
def connect(self):
|
||||
self._client = connect(self.ws_server_url)
|
||||
|
||||
def configure(self, d: dict) -> tuple:
|
||||
"""
|
||||
Example:
|
||||
@@ -77,12 +80,12 @@ class StdDaqClientDevice(Device):
|
||||
|
||||
Note: finishing acquisition meang StdDAQ will close connections
|
||||
"""
|
||||
print(d)
|
||||
reply = None
|
||||
if isinstance(d, dict):
|
||||
msg = json.dumps(d)
|
||||
else:
|
||||
msg = str(d)
|
||||
print("Q: ", msg)
|
||||
# Send message (reopen connection if needed)
|
||||
try:
|
||||
self._client.send(msg)
|
||||
@@ -105,9 +108,10 @@ class StdDaqClientDevice(Device):
|
||||
# Wait for reply
|
||||
try:
|
||||
reply = self._client.recv(timeout)
|
||||
print(reply)
|
||||
except ConnectionClosedError:
|
||||
pass
|
||||
print("A: ", reply)
|
||||
except ConnectionClosedError as ex:
|
||||
print(ex)
|
||||
pass
|
||||
except TimeoutError:
|
||||
pass
|
||||
return reply
|
||||
|
||||
Reference in New Issue
Block a user