0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

fix: fixed logic in data subscription

This commit is contained in:
2023-08-09 21:39:28 +02:00
parent 7bec0b5e6c
commit c2d469b454

View File

@ -382,7 +382,7 @@ class BasicPlot(QtWidgets.QWidget):
time.sleep(0.1) time.sleep(0.1)
continue continue
endpoint = f"px_stream/projection_{self._current_proj}/data" endpoint = f"px_stream/projection_{self._current_proj}/data"
msgs = client.producer.lrange(topic=endpoint, start=-1, end=-1) msgs = client.producer.lrange(topic=endpoint, start=0, end=0)
data = [BECMessage.DeviceMessage.loads(msg) for msg in msgs] data = [BECMessage.DeviceMessage.loads(msg) for msg in msgs]
if not data: if not data:
continue continue
@ -399,7 +399,8 @@ class BasicPlot(QtWidgets.QWidget):
@pyqtSlot(dict, dict) @pyqtSlot(dict, dict)
def on_dap_update(self, data: dict, metadata: dict): def on_dap_update(self, data: dict, metadata: dict):
time.sleep(0.1) self.img.setImage(data["z"].T)
# time.sleep(0,1)
@pyqtSlot(dict) @pyqtSlot(dict)
def new_proj(self, data): def new_proj(self, data):