From 10bc056c39c3fa8048098455c055b01f89f9dadf Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 25 Feb 2025 20:10:53 +0800 Subject: [PATCH] =?UTF-8?q?[bugfix]=20=E4=BF=AE=E5=A4=8Dchannel=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=97=A0=E6=B3=95=E5=88=87=E6=8D=A2filters=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 2 +- .../ui_widget_channel.cpython-313.pyc | Bin 109048 -> 109032 bytes .../widget_channel.cpython-313.pyc | Bin 5787 -> 6555 bytes component/widget_channel/ui_widget_channel.py | 8 ++++---- component/widget_channel/widget.ui | 2 +- component/widget_channel/widget_channel.py | 8 ++++++-- component/widget_main/Ui_widget.py | 2 +- .../__pycache__/Ui_widget.cpython-313.pyc | Bin 61895 -> 61890 bytes component/widget_main/widget.ui | 2 +- 9 files changed, 14 insertions(+), 10 deletions(-) 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 1b24e3d7cb84687242cc9fb1f4fe2c5b0009c84b..6e08042a02c9a7ba805045493ee9f1d6f0df7fff 100644 GIT binary patch delta 97 zcmexyneD}8Hr~&?yj%=G@OabS^x#I`t-OqXY#7C+PjqG!-L7rR7|g}^XnVao<0aPZ z2fP_4GEN7QUfcEk8B;tMzipo~ospAiy1^_)we3e{GOp#FUbdVup3!;x#pR6ZOaQO6 BBB}r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k{%+3>gYY-r!c^!2~wANj#<5t~q_b2;Uj^dD?|mb@@)MIz^lOdJnD} zqr`+I<3|22zf;Vkb&h>GzS74kd^L{v@+(kChW;m|4~t1md6N7Xn&)*riQQ+k1`8>p zK5Umh0Lk8vVf^Q6`K|K6iM)_|#sHTbl 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 ea7d2bf179266448b3cc125a761ec875ab95e84f..61e8ef32b9032ba00c14fb8a64c2ace177eb6363 100644 GIT binary patch delta 164 zcmX^9nEB9SX0Fe?yj%=Guxs5$E@A%3l6-uVwfVIeWhRI5FJ+Y7{DSmLt>YPG8 zKt;t&Kte&G$PY*rc}>oJ_n$Fva_;-dn*Lw`AaP4HKEAjlu_QA&KCz^vC^MmoPuGj49LPg>U31+w+St%L3WQvZ`OON!71bmWEF$B3JOL3K&r@la>l#=j6st#-cM!=fCw;tkYx)3G5sg2 nd{76<`F!{#l>`!ihyq!+IBatBQ%ZAE?TXSTCwz=!0m%RWQOYgt 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 { - +