diff --git a/app.py b/app.py index bb6a908..e34fb2c 100644 --- a/app.py +++ b/app.py @@ -238,7 +238,7 @@ class MainWindow(QWidget): item = self.widget_main.ui.verticalLayout_Filter.takeAt(0) if item.widget(): item.widget().hide() - + print(f"on_channel_btn_clicked: {channel_id}") # Add the selected channel's filter widget to the layout filter_widget = self.widget_filter_list[channel_id] self.widget_main.ui.verticalLayout_Filter.addWidget(filter_widget) diff --git a/component/widget_channel/__pycache__/ui_widget_channel.cpython-313.pyc b/component/widget_channel/__pycache__/ui_widget_channel.cpython-313.pyc index 1b24e3d..6e08042 100644 Binary files a/component/widget_channel/__pycache__/ui_widget_channel.cpython-313.pyc and b/component/widget_channel/__pycache__/ui_widget_channel.cpython-313.pyc differ diff --git a/component/widget_channel/__pycache__/widget_channel.cpython-313.pyc b/component/widget_channel/__pycache__/widget_channel.cpython-313.pyc index 9e61003..54418c6 100644 Binary files a/component/widget_channel/__pycache__/widget_channel.cpython-313.pyc and b/component/widget_channel/__pycache__/widget_channel.cpython-313.pyc differ diff --git a/component/widget_channel/ui_widget_channel.py b/component/widget_channel/ui_widget_channel.py index d2d0005..94a55be 100644 --- a/component/widget_channel/ui_widget_channel.py +++ b/component/widget_channel/ui_widget_channel.py @@ -2387,10 +2387,10 @@ class Ui_Widget(object): self.gridLayout_4.setObjectName(u"gridLayout_4") self.gridLayout_4.setVerticalSpacing(4) self.gridLayout_4.setContentsMargins(-1, 14, -1, 4) - self.pushButton_7pushButton_Channel_CH4 = QPushButton(self.groupBox_CH4) - self.pushButton_7pushButton_Channel_CH4.setObjectName(u"pushButton_7pushButton_Channel_CH4") + self.pushButton_Channel_CH4 = QPushButton(self.groupBox_CH4) + self.pushButton_Channel_CH4.setObjectName(u"pushButton_Channel_CH4") - self.gridLayout_4.addWidget(self.pushButton_7pushButton_Channel_CH4, 0, 0, 1, 2) + self.gridLayout_4.addWidget(self.pushButton_Channel_CH4, 0, 0, 1, 2) self.pushButton_8 = QPushButton(self.groupBox_CH4) self.pushButton_8.setObjectName(u"pushButton_8") @@ -2929,7 +2929,7 @@ class Ui_Widget(object): self.pushButton_6.setText(QCoreApplication.translate("Widget", u"SOLO", None)) self.checkBox_3.setText(QCoreApplication.translate("Widget", u"Mute", None)) self.groupBox_CH4.setTitle(QCoreApplication.translate("Widget", u"CH4", None)) - self.pushButton_7pushButton_Channel_CH4.setText(QCoreApplication.translate("Widget", u"Channel 4", None)) + self.pushButton_Channel_CH4.setText(QCoreApplication.translate("Widget", u"Channel 4", None)) self.pushButton_8.setText(QCoreApplication.translate("Widget", u"SOLO", None)) self.checkBox_4.setText(QCoreApplication.translate("Widget", u"Mute", None)) self.groupBox_CH5.setTitle(QCoreApplication.translate("Widget", u"CH5", None)) diff --git a/component/widget_channel/widget.ui b/component/widget_channel/widget.ui index f86b09e..df2795c 100644 --- a/component/widget_channel/widget.ui +++ b/component/widget_channel/widget.ui @@ -2380,7 +2380,7 @@ PlotWidget { 4 - + Channel 4 diff --git a/component/widget_channel/widget_channel.py b/component/widget_channel/widget_channel.py index a2f55d5..6b93731 100644 --- a/component/widget_channel/widget_channel.py +++ b/component/widget_channel/widget_channel.py @@ -22,7 +22,7 @@ class Widget_Channel(QWidget): self.channel_counts = 24 # 设置连接 - # self.setup_connections() + self.setup_connections() self.visible_channels = 24 # 默认显示24个通道 self.update_channel_visibility() @@ -52,7 +52,11 @@ class Widget_Channel(QWidget): # 调整布局 self.adjustSize() - # def setup_connections(self): + def setup_connections(self): + for i in range(self.channel_counts): + channel_btn = getattr(self.ui, f'pushButton_Channel_CH{i+1}') + if channel_btn: + channel_btn.clicked.connect(lambda checked, index=i: self.channel_btn_clicked.emit(index)) # Connect channel buttons using a loop # for i in range(self.channel_counts): # Connect Channel buttons diff --git a/component/widget_main/Ui_widget.py b/component/widget_main/Ui_widget.py index efa232f..53b57b5 100644 --- a/component/widget_main/Ui_widget.py +++ b/component/widget_main/Ui_widget.py @@ -2373,7 +2373,7 @@ class Ui_Main_Widget(object): self.horizontalLayout_3.addLayout(self.verticalLayout_Filter) - self.horizontalLayout_3.setStretch(0, 2) + self.horizontalLayout_3.setStretch(0, 3) self.horizontalLayout_3.setStretch(1, 5) self.verticalLayout_2.addLayout(self.horizontalLayout_3) diff --git a/component/widget_main/__pycache__/Ui_widget.cpython-313.pyc b/component/widget_main/__pycache__/Ui_widget.cpython-313.pyc index ea7d2bf..61e8ef3 100644 Binary files a/component/widget_main/__pycache__/Ui_widget.cpython-313.pyc and b/component/widget_main/__pycache__/Ui_widget.cpython-313.pyc differ diff --git a/component/widget_main/widget.ui b/component/widget_main/widget.ui index 1e5660c..397103b 100644 --- a/component/widget_main/widget.ui +++ b/component/widget_main/widget.ui @@ -2309,7 +2309,7 @@ PlotWidget { - +