mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-13 19:21:50 +02:00
fix: dispatcher argparse and scan_plot tests
This commit is contained in:
@ -222,7 +222,6 @@ class _BECDispatcher(QObject):
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--bec-config", default=None)
|
||||
parser.add_argument("args", nargs=argparse.REMAINDER)
|
||||
args = parser.parse_args()
|
||||
args, _ = parser.parse_known_args()
|
||||
|
||||
bec_dispatcher = _BECDispatcher(args.bec_config)
|
||||
|
@ -1,7 +1,6 @@
|
||||
import itertools
|
||||
|
||||
import pyqtgraph as pg
|
||||
from bec_lib.core import MessageEndpoints
|
||||
from bec_lib.core.logger import bec_logger
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSlot
|
||||
|
||||
@ -62,9 +61,8 @@ class BECScanPlot(pg.GraphicsView):
|
||||
|
||||
plot_curve.setData(x=[*x, x_new], y=[*y, y_new])
|
||||
|
||||
@pyqtSlot("PyQt_PyObject")
|
||||
def redraw_dap(self, msg):
|
||||
data = msg.content["data"]
|
||||
@pyqtSlot(dict, dict)
|
||||
def redraw_dap(self, data, _metadata):
|
||||
for chan, plot_curve in self.dap_curves.items():
|
||||
if not chan:
|
||||
continue
|
||||
@ -88,8 +86,7 @@ class BECScanPlot(pg.GraphicsView):
|
||||
chan_removed = [chan for chan in self._y_channel_list if chan not in new_list]
|
||||
if chan_removed and chan_removed[0].startswith("dap."):
|
||||
chan_removed = chan_removed[0].partition("dap.")[-1]
|
||||
chan_removed_ep = MessageEndpoints.processed_data(chan_removed)
|
||||
bec_dispatcher.disconnect_slot(self.redraw_dap, chan_removed_ep)
|
||||
bec_dispatcher.disconnect_dap_slot(self.redraw_dap, chan_removed)
|
||||
|
||||
self._y_channel_list = new_list
|
||||
|
||||
@ -103,8 +100,7 @@ class BECScanPlot(pg.GraphicsView):
|
||||
if y_chan.startswith("dap."):
|
||||
y_chan = y_chan.partition("dap.")[-1]
|
||||
curves = self.dap_curves
|
||||
y_chan_ep = MessageEndpoints.processed_data(y_chan)
|
||||
bec_dispatcher.connect_slot(self.redraw_dap, y_chan_ep)
|
||||
bec_dispatcher.connect_dap_slot(self.redraw_dap, y_chan)
|
||||
else:
|
||||
curves = self.scan_curves
|
||||
|
||||
|
Reference in New Issue
Block a user