added and use a mapping DescType to MDISubType
This commit is contained in:
@ -14,6 +14,12 @@ from .shortcut import shortcut
|
|||||||
from .webview import WebView
|
from .webview import WebView
|
||||||
|
|
||||||
|
|
||||||
|
DESC_TYPE_TO_MDI_SUB_TYPE = {
|
||||||
|
ImageDescription: MDISubImage,
|
||||||
|
PlotDescription: MDISubPlot
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
|
|
||||||
sig_make_new_plot = pyqtSignal(str, PlotDescription)
|
sig_make_new_plot = pyqtSignal(str, PlotDescription)
|
||||||
@ -248,7 +254,8 @@ class MainWindow(QMainWindow):
|
|||||||
item.timestamps.access.update()
|
item.timestamps.access.update()
|
||||||
item.set_alarm(False)
|
item.set_alarm(False)
|
||||||
name, desc = item.key, item.value
|
name, desc = item.key, item.value
|
||||||
MDISubType = MDISubImage if isinstance(desc, ImageDescription) else MDISubPlot #TODO
|
DescType = type(desc)
|
||||||
|
MDISubType = DESC_TYPE_TO_MDI_SUB_TYPE[DescType]
|
||||||
self.activate_or_make_subwin(MDISubType, name, desc)
|
self.activate_or_make_subwin(MDISubType, name, desc)
|
||||||
|
|
||||||
def plot_multiple_items(self, items):
|
def plot_multiple_items(self, items):
|
||||||
|
Reference in New Issue
Block a user