made MDISubMultiPlot input descs and .plots dicts

This commit is contained in:
2023-01-24 23:34:47 +01:00
parent 30410766d0
commit 4ea13a5d5c
2 changed files with 3 additions and 3 deletions

View File

@ -113,8 +113,8 @@ class MainWindow(QMainWindow):
def plot_multiple_items(self, items):
#TODO: unset alarm status for all items?
pairs = ((i.key, i.value) for i in items)
names, descs = zip(*pairs)
descs = {i.key: i.value for i in items}
names = descs.keys()
name = " | ".join(names)
self.activate_or_make_subwin(MDISubMultiPlot, name, descs)

View File

@ -26,7 +26,7 @@ class MDISubMultiPlot(MDISubWindow):
plt = pg.PlotWidget()
plt.addLegend(**ls)
self.plots = [d.make_plot(plt, s) for d, s in zip(descs, psc)]
self.plots = {n: d.make_plot(plt, s) for (n, d), s in zip(descs.items(), psc)}
self.setWidget(plt)