mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
fix,refactor: config_dialog.ui changed design of general box, remove plot works
This commit is contained in:
@ -40,12 +40,23 @@ class MainApp(QWidget, Ui_Form):
|
|||||||
new_tab.pushButton_y_new.clicked.connect(
|
new_tab.pushButton_y_new.clicked.connect(
|
||||||
lambda: self.add_new_signal(new_tab.tableWidget_y_signals)
|
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}"
|
new_tab_name = f"Plot {self.tabWidget_plots.count() + 1}"
|
||||||
|
|
||||||
|
# Add new tab
|
||||||
self.tabWidget_plots.addTab(
|
self.tabWidget_plots.addTab(
|
||||||
new_tab_widget, new_tab_name
|
new_tab_widget, new_tab_name
|
||||||
) # Add the new QWidget as a new tab
|
) # Add the new QWidget as a new tab
|
||||||
self.tab_ui_objects.append(new_tab) # Append the Tab_Ui_Form object to the list
|
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):
|
def add_new_signal(self, tableWidget_y_signals):
|
||||||
row_position = tableWidget_y_signals.rowCount()
|
row_position = tableWidget_y_signals.rowCount()
|
||||||
tableWidget_y_signals.insertRow(row_position)
|
tableWidget_y_signals.insertRow(row_position)
|
||||||
@ -64,7 +75,7 @@ class MainApp(QWidget, Ui_Form):
|
|||||||
}
|
}
|
||||||
|
|
||||||
for index in range(self.tabWidget_plots.count()):
|
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]
|
ui_object = self.tab_ui_objects[index]
|
||||||
table = ui_object.tableWidget_y_signals
|
table = ui_object.tableWidget_y_signals
|
||||||
signals = [
|
signals = [
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>558</width>
|
<width>572</width>
|
||||||
<height>769</height>
|
<height>769</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -21,77 +21,106 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Plot Layout Settings</string>
|
<string>Plot Layout Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item row="0" column="1">
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBox"/>
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
</item>
|
<item row="0" column="0">
|
||||||
<item row="2" column="0">
|
<widget class="QLabel" name="label_5">
|
||||||
<widget class="QLabel" name="label_2">
|
<property name="text">
|
||||||
<property name="text">
|
<string>Number of Columns</string>
|
||||||
<string>Scan Types</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Default Color Palette</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="3" rowspan="3">
|
|
||||||
<widget class="QComboBox" name="comboBox_2">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>magma</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="1">
|
||||||
<property name="text">
|
<widget class="QSpinBox" name="spinBox"/>
|
||||||
<string>viridis</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<property name="text">
|
<widget class="QLabel" name="label_6">
|
||||||
<string>reds</string>
|
<property name="text">
|
||||||
</property>
|
<string>Scan Types</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBox_scanTypes">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Disabled</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Enabled</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QPushButton" name="pushButton_add_new_plot">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add New Plot</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Columns</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" rowspan="4">
|
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item>
|
||||||
<widget class="QComboBox" name="comboBox">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<widget class="QLabel" name="label_4">
|
||||||
<string>Disabled</string>
|
<property name="text">
|
||||||
</property>
|
<string>Appearance</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<widget class="QComboBox" name="comboBox_appearance">
|
||||||
<string>Enabled</string>
|
<item>
|
||||||
</property>
|
<property name="text">
|
||||||
|
<string>dark</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>bright</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QLabel" name="label_3">
|
||||||
<item row="3" column="0" colspan="2">
|
<property name="text">
|
||||||
<widget class="QPushButton" name="pushButton_add_new_plot">
|
<string>Default Color Palette</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Add New Plot</string>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBox_colormap">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>magma</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>viridis</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>reds</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
Reference in New Issue
Block a user