[bugfix] 修复channel按钮无法切换filters异常
This commit is contained in:
parent
a648da50a5
commit
10bc056c39
2
app.py
2
app.py
@ -238,7 +238,7 @@ class MainWindow(QWidget):
|
|||||||
item = self.widget_main.ui.verticalLayout_Filter.takeAt(0)
|
item = self.widget_main.ui.verticalLayout_Filter.takeAt(0)
|
||||||
if item.widget():
|
if item.widget():
|
||||||
item.widget().hide()
|
item.widget().hide()
|
||||||
|
print(f"on_channel_btn_clicked: {channel_id}")
|
||||||
# Add the selected channel's filter widget to the layout
|
# Add the selected channel's filter widget to the layout
|
||||||
filter_widget = self.widget_filter_list[channel_id]
|
filter_widget = self.widget_filter_list[channel_id]
|
||||||
self.widget_main.ui.verticalLayout_Filter.addWidget(filter_widget)
|
self.widget_main.ui.verticalLayout_Filter.addWidget(filter_widget)
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -2387,10 +2387,10 @@ class Ui_Widget(object):
|
|||||||
self.gridLayout_4.setObjectName(u"gridLayout_4")
|
self.gridLayout_4.setObjectName(u"gridLayout_4")
|
||||||
self.gridLayout_4.setVerticalSpacing(4)
|
self.gridLayout_4.setVerticalSpacing(4)
|
||||||
self.gridLayout_4.setContentsMargins(-1, 14, -1, 4)
|
self.gridLayout_4.setContentsMargins(-1, 14, -1, 4)
|
||||||
self.pushButton_7pushButton_Channel_CH4 = QPushButton(self.groupBox_CH4)
|
self.pushButton_Channel_CH4 = QPushButton(self.groupBox_CH4)
|
||||||
self.pushButton_7pushButton_Channel_CH4.setObjectName(u"pushButton_7pushButton_Channel_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 = QPushButton(self.groupBox_CH4)
|
||||||
self.pushButton_8.setObjectName(u"pushButton_8")
|
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.pushButton_6.setText(QCoreApplication.translate("Widget", u"SOLO", None))
|
||||||
self.checkBox_3.setText(QCoreApplication.translate("Widget", u"Mute", None))
|
self.checkBox_3.setText(QCoreApplication.translate("Widget", u"Mute", None))
|
||||||
self.groupBox_CH4.setTitle(QCoreApplication.translate("Widget", u"CH4", 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.pushButton_8.setText(QCoreApplication.translate("Widget", u"SOLO", None))
|
||||||
self.checkBox_4.setText(QCoreApplication.translate("Widget", u"Mute", None))
|
self.checkBox_4.setText(QCoreApplication.translate("Widget", u"Mute", None))
|
||||||
self.groupBox_CH5.setTitle(QCoreApplication.translate("Widget", u"CH5", None))
|
self.groupBox_CH5.setTitle(QCoreApplication.translate("Widget", u"CH5", None))
|
||||||
|
@ -2380,7 +2380,7 @@ PlotWidget {
|
|||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QPushButton" name="pushButton_7pushButton_Channel_CH4">
|
<widget class="QPushButton" name="pushButton_Channel_CH4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Channel 4</string>
|
<string>Channel 4</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -22,7 +22,7 @@ class Widget_Channel(QWidget):
|
|||||||
self.channel_counts = 24
|
self.channel_counts = 24
|
||||||
|
|
||||||
# 设置连接
|
# 设置连接
|
||||||
# self.setup_connections()
|
self.setup_connections()
|
||||||
|
|
||||||
self.visible_channels = 24 # 默认显示24个通道
|
self.visible_channels = 24 # 默认显示24个通道
|
||||||
self.update_channel_visibility()
|
self.update_channel_visibility()
|
||||||
@ -52,7 +52,11 @@ class Widget_Channel(QWidget):
|
|||||||
# 调整布局
|
# 调整布局
|
||||||
self.adjustSize()
|
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
|
# Connect channel buttons using a loop
|
||||||
# for i in range(self.channel_counts):
|
# for i in range(self.channel_counts):
|
||||||
# Connect Channel buttons
|
# Connect Channel buttons
|
||||||
|
@ -2373,7 +2373,7 @@ class Ui_Main_Widget(object):
|
|||||||
|
|
||||||
self.horizontalLayout_3.addLayout(self.verticalLayout_Filter)
|
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.horizontalLayout_3.setStretch(1, 5)
|
||||||
|
|
||||||
self.verticalLayout_2.addLayout(self.horizontalLayout_3)
|
self.verticalLayout_2.addLayout(self.horizontalLayout_3)
|
||||||
|
Binary file not shown.
@ -2309,7 +2309,7 @@ PlotWidget {
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="2,5">
|
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="3,5">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_Log"/>
|
<layout class="QVBoxLayout" name="verticalLayout_Log"/>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user