A client that can receive and buffer data.
Definition at line 70 of file clients.py.
◆ __init__()
| microscope.clients.DataClient.__init__ |
( |
| self, |
|
|
| url ) |
Reimplemented from microscope.clients.Client.
Definition at line 73 of file clients.py.
73 def __init__(self, url):
74 super().__init__(url)
75 self._buffer = queue.Queue()
76
77 if self._url.split("@")[1].split(":")[0] in ["127.0.0.1", "localhost"]:
78 iface = "127.0.0.1"
79 else:
80
81
82 iface = socket.gethostbyname(socket.gethostname())
83 if iface not in LISTENERS:
84 LISTENERS[iface] = Pyro4.Daemon(host=iface)
85 lthread = threading.Thread(target=LISTENERS[iface].requestLoop)
86 lthread.daemon = True
87 lthread.start()
88 self._client_uri = LISTENERS[iface].register(self)
89
◆ enable()
| microscope.clients.DataClient.enable |
( |
| self | ) |
|
Set the client on the remote and enable it.
Definition at line 90 of file clients.py.
90 def enable(self):
91 """Set the client on the remote and enable it."""
92 self.set_client(self._client_uri)
93 self._proxy.enable()
94
◆ receiveData()
| microscope.clients.DataClient.receiveData |
( |
| self, |
|
|
| data, |
|
|
| timestamp, |
|
|
* | args ) |
Definition at line 99 of file clients.py.
99 def receiveData(self, data, timestamp, *args):
100 del args
101 self._buffer.put((data, timestamp))
102
◆ trigger_and_wait()
| microscope.clients.DataClient.trigger_and_wait |
( |
| self | ) |
|
Definition at line 103 of file clients.py.
103 def trigger_and_wait(self):
104 if not hasattr(self, "trigger"):
105 raise Exception("Device has no trigger method.")
106 self.trigger()
107 return self._buffer.get(block=True)
◆ _buffer
| microscope.clients.DataClient._buffer = queue.Queue() |
|
protected |
◆ _client_uri
| microscope.clients.DataClient._client_uri = LISTENERS[iface].register(self) |
|
protected |
The documentation for this class was generated from the following file: