added checkboxe to control whether new plots are automatically opened
This commit is contained in:
@ -6,6 +6,7 @@ from .dictlist import DictListWidget
|
||||
from .mdi import MDIArea, MDISubPlot
|
||||
from .rpc import RPCServerThread
|
||||
from .plotdesc import PlotDescription
|
||||
from .menus import BarMenu
|
||||
from .exampledata import exampledata
|
||||
|
||||
|
||||
@ -24,6 +25,10 @@ class MainWindow(QMainWindow):
|
||||
lst.itemDoubleClicked.connect(self.on_select_list_item)
|
||||
|
||||
bar = self.menuBar()
|
||||
|
||||
self.menu_settings = menu = BarMenu(bar, "&Settings")
|
||||
menu.addCheckbox("Open new plots", state=True)
|
||||
|
||||
self.mdi = mdi = MDIArea(bar)
|
||||
|
||||
splitter = QSplitter(Qt.Horizontal)
|
||||
@ -44,8 +49,9 @@ class MainWindow(QMainWindow):
|
||||
def new_plot(self, name, cfg):
|
||||
desc = PlotDescription(**cfg)
|
||||
self.lst.set(name, desc)
|
||||
if not self.mdi.findSubWindow(name):
|
||||
self.sig_make_new_plot.emit(name, desc)
|
||||
if self.menu_settings.checkboxes["Open new plots"].isChecked():
|
||||
if not self.mdi.findSubWindow(name):
|
||||
self.sig_make_new_plot.emit(name, desc)
|
||||
|
||||
|
||||
def append_data(self, name, point):
|
||||
@ -55,6 +61,7 @@ class MainWindow(QMainWindow):
|
||||
sub = self.mdi.findSubWindow(name)
|
||||
if sub:
|
||||
sub.plot.setData(*desc.data)
|
||||
item.set_alarm(False)
|
||||
else:
|
||||
item.set_alarm(True)
|
||||
|
||||
|
Reference in New Issue
Block a user