mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31: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 = argparse.ArgumentParser()
|
||||||
parser.add_argument("--bec-config", default=None)
|
parser.add_argument("--bec-config", default=None)
|
||||||
parser.add_argument("args", nargs=argparse.REMAINDER)
|
args, _ = parser.parse_known_args()
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
bec_dispatcher = _BECDispatcher(args.bec_config)
|
bec_dispatcher = _BECDispatcher(args.bec_config)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
import pyqtgraph as pg
|
import pyqtgraph as pg
|
||||||
from bec_lib.core import MessageEndpoints
|
|
||||||
from bec_lib.core.logger import bec_logger
|
from bec_lib.core.logger import bec_logger
|
||||||
from PyQt5.QtCore import pyqtProperty, pyqtSlot
|
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])
|
plot_curve.setData(x=[*x, x_new], y=[*y, y_new])
|
||||||
|
|
||||||
@pyqtSlot("PyQt_PyObject")
|
@pyqtSlot(dict, dict)
|
||||||
def redraw_dap(self, msg):
|
def redraw_dap(self, data, _metadata):
|
||||||
data = msg.content["data"]
|
|
||||||
for chan, plot_curve in self.dap_curves.items():
|
for chan, plot_curve in self.dap_curves.items():
|
||||||
if not chan:
|
if not chan:
|
||||||
continue
|
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]
|
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."):
|
if chan_removed and chan_removed[0].startswith("dap."):
|
||||||
chan_removed = chan_removed[0].partition("dap.")[-1]
|
chan_removed = chan_removed[0].partition("dap.")[-1]
|
||||||
chan_removed_ep = MessageEndpoints.processed_data(chan_removed)
|
bec_dispatcher.disconnect_dap_slot(self.redraw_dap, chan_removed)
|
||||||
bec_dispatcher.disconnect_slot(self.redraw_dap, chan_removed_ep)
|
|
||||||
|
|
||||||
self._y_channel_list = new_list
|
self._y_channel_list = new_list
|
||||||
|
|
||||||
@ -103,8 +100,7 @@ class BECScanPlot(pg.GraphicsView):
|
|||||||
if y_chan.startswith("dap."):
|
if y_chan.startswith("dap."):
|
||||||
y_chan = y_chan.partition("dap.")[-1]
|
y_chan = y_chan.partition("dap.")[-1]
|
||||||
curves = self.dap_curves
|
curves = self.dap_curves
|
||||||
y_chan_ep = MessageEndpoints.processed_data(y_chan)
|
bec_dispatcher.connect_dap_slot(self.redraw_dap, y_chan)
|
||||||
bec_dispatcher.connect_slot(self.redraw_dap, y_chan_ep)
|
|
||||||
else:
|
else:
|
||||||
curves = self.scan_curves
|
curves = self.scan_curves
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user