diff --git a/bec_widgets/widgets/monitor/config_dialog.py b/bec_widgets/widgets/monitor/config_dialog.py index 8b8e732f..13a7165c 100644 --- a/bec_widgets/widgets/monitor/config_dialog.py +++ b/bec_widgets/widgets/monitor/config_dialog.py @@ -40,12 +40,23 @@ class MainApp(QWidget, Ui_Form): new_tab.pushButton_y_new.clicked.connect( lambda: self.add_new_signal(new_tab.tableWidget_y_signals) ) + new_tab.pushButton_remove_current_plot.clicked.connect(self.remove_current_plot) + + # Tab header name new_tab_name = f"Plot {self.tabWidget_plots.count() + 1}" + + # Add new tab self.tabWidget_plots.addTab( new_tab_widget, new_tab_name ) # Add the new QWidget as a new tab self.tab_ui_objects.append(new_tab) # Append the Tab_Ui_Form object to the list + def remove_current_plot(self): + current_index = self.tabWidget_plots.currentIndex() + if current_index != -1: # Ensure there is a tab to remove + self.tabWidget_plots.removeTab(current_index) + del self.tab_ui_objects[current_index] + def add_new_signal(self, tableWidget_y_signals): row_position = tableWidget_y_signals.rowCount() tableWidget_y_signals.insertRow(row_position) @@ -64,7 +75,7 @@ class MainApp(QWidget, Ui_Form): } for index in range(self.tabWidget_plots.count()): - tab = self.tabWidget_plots.widget(index) + # tab = self.tabWidget_plots.widget(index) #TODO can be removed ui_object = self.tab_ui_objects[index] table = ui_object.tableWidget_y_signals signals = [ diff --git a/bec_widgets/widgets/monitor/config_dialog.ui b/bec_widgets/widgets/monitor/config_dialog.ui index b7fc6f59..946115d4 100644 --- a/bec_widgets/widgets/monitor/config_dialog.ui +++ b/bec_widgets/widgets/monitor/config_dialog.ui @@ -6,7 +6,7 @@ 0 0 - 558 + 572 769 @@ -21,77 +21,106 @@ Plot Layout Settings - - - - - - - - Scan Types - - - - - - - Default Color Palette - - - - - - - - magma - + + + + + + + Number of Columns + + - - - viridis - + + - - - reds - + + + + Scan Types + + - + + + + + Disabled + + + + + Enabled + + + + + + + + Add New Plot + + + + - - - - Number of Columns - - - - + Qt::Vertical - - + + - - Disabled - + + + Appearance + + - - Enabled - + + + + dark + + + + + bright + + + - - - - - - Add New Plot - - + + + + Default Color Palette + + + + + + + + magma + + + + + viridis + + + + + reds + + + + +