dev: добавлено ограничение количества отркытых графиков
This commit is contained in:
parent
384d52309f
commit
84d3e3a88d
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -19,6 +19,8 @@ class MainWindow(BaseMainWindow):
|
||||
|
||||
def initUI(self) -> None:
|
||||
self.tabWidget = QtWidgets.QTabWidget()
|
||||
self.tabWidget.setTabsClosable(True)
|
||||
self.tabWidget.tabCloseRequested.connect(self._close_tab)
|
||||
layout = QtWidgets.QVBoxLayout()
|
||||
layout.addWidget(self.tabWidget)
|
||||
self.settings_button = QtWidgets.QPushButton("Show settings")
|
||||
@ -35,6 +37,12 @@ class MainWindow(BaseMainWindow):
|
||||
self.tabWidget.addTab(tab, "SF_trace_" + dt.now().strftime('%Y_%m_%d-%H_%M_%S'))
|
||||
self.tabWidget.setCurrentWidget(tab)
|
||||
|
||||
tab_count = self.tabWidget.count()
|
||||
if tab_count > 10:
|
||||
for i in range(0, tab_count-2):
|
||||
self._close_tab(i)
|
||||
|
||||
|
||||
def keyPressEvent(self, a0):
|
||||
if a0.key() == Qt.Key_F5:
|
||||
self.clear()
|
||||
@ -52,6 +60,8 @@ class MainWindow(BaseMainWindow):
|
||||
system_params = self.sysSettings.getParams()
|
||||
self._controller.push_settings([operator_params, system_params])
|
||||
|
||||
def _close_tab(self, index:int) -> None:
|
||||
self.tabWidget.removeTab(index)
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user