refine codes.
This commit is contained in:
parent
2bbd391407
commit
2d65ab71f5
@ -13,7 +13,7 @@ class BatchOperationDialog(QDialog):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setWindowTitle("批量操作节点")
|
self.setWindowTitle("批量操作节点")
|
||||||
self.setGeometry(100, 100, 800, 400)
|
self.setGeometry(100, 100, 1093, 737)
|
||||||
|
|
||||||
# 初始化分页
|
# 初始化分页
|
||||||
self.current_page = 0
|
self.current_page = 0
|
||||||
|
@ -14,6 +14,7 @@ from scipy.fft import fft, fftfreq
|
|||||||
|
|
||||||
from SamplingDialog import *
|
from SamplingDialog import *
|
||||||
from feauture_calculate import *
|
from feauture_calculate import *
|
||||||
|
from batch_dialog import BatchOperationDialog
|
||||||
|
|
||||||
# 启用高DPI支持
|
# 启用高DPI支持
|
||||||
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
|
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
|
||||||
@ -176,6 +177,7 @@ class SocketClientApp(QMainWindow):
|
|||||||
self.get_mac_button = QPushButton("获取MAC地址")
|
self.get_mac_button = QPushButton("获取MAC地址")
|
||||||
self.mac_config_button = QPushButton("mac配置")
|
self.mac_config_button = QPushButton("mac配置")
|
||||||
self.ipv4_config_button = QPushButton("网络配置")
|
self.ipv4_config_button = QPushButton("网络配置")
|
||||||
|
self.batch_process_button = QPushButton("批量操作")
|
||||||
self.calibration_config_button = QPushButton("校准")
|
self.calibration_config_button = QPushButton("校准")
|
||||||
self.get_version_button = QPushButton("版本")
|
self.get_version_button = QPushButton("版本")
|
||||||
self.upgrade_button_sampling = QPushButton("采样率/时间")
|
self.upgrade_button_sampling = QPushButton("采样率/时间")
|
||||||
@ -235,6 +237,7 @@ class SocketClientApp(QMainWindow):
|
|||||||
button_layout.addWidget(self.get_mac_button)
|
button_layout.addWidget(self.get_mac_button)
|
||||||
button_layout.addWidget(self.mac_config_button)
|
button_layout.addWidget(self.mac_config_button)
|
||||||
button_layout.addWidget(self.ipv4_config_button)
|
button_layout.addWidget(self.ipv4_config_button)
|
||||||
|
button_layout.addWidget(self.batch_process_button)
|
||||||
button_layout.addWidget(self.calibration_config_button)
|
button_layout.addWidget(self.calibration_config_button)
|
||||||
button_layout.addWidget(self.get_version_button)
|
button_layout.addWidget(self.get_version_button)
|
||||||
button_layout.addWidget(self.save_button_csv)
|
button_layout.addWidget(self.save_button_csv)
|
||||||
@ -295,9 +298,15 @@ class SocketClientApp(QMainWindow):
|
|||||||
self.ipv4_config_button.clicked.connect(self.ipv4_config_dialog)
|
self.ipv4_config_button.clicked.connect(self.ipv4_config_dialog)
|
||||||
self.calibration_config_button.clicked.connect(self.calibration_dialog)
|
self.calibration_config_button.clicked.connect(self.calibration_dialog)
|
||||||
self.get_version_button.clicked.connect(self.on_button_get_version)
|
self.get_version_button.clicked.connect(self.on_button_get_version)
|
||||||
|
self.batch_process_button.clicked.connect(self.on_button_batch)
|
||||||
# 设置布局策略,确保控件大小随窗口调整
|
# 设置布局策略,确保控件大小随窗口调整
|
||||||
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
||||||
|
|
||||||
|
def on_button_batch(self):
|
||||||
|
dialog = BatchOperationDialog()
|
||||||
|
if dialog.exec_() == QDialog.Accepted:
|
||||||
|
dialog.close()
|
||||||
|
|
||||||
def get_extremes(self, data):
|
def get_extremes(self, data):
|
||||||
"""获取最大和最小的10个值(排序法)"""
|
"""获取最大和最小的10个值(排序法)"""
|
||||||
sorted_data = np.sort(data)
|
sorted_data = np.sort(data)
|
||||||
@ -688,7 +697,7 @@ class SocketClientApp(QMainWindow):
|
|||||||
print(f"Sending packet {i + 1}/{num_packets}, size: {len(packet_chunk)} bytes")
|
print(f"Sending packet {i + 1}/{num_packets}, size: {len(packet_chunk)} bytes")
|
||||||
self.socket.write(packet_chunk)
|
self.socket.write(packet_chunk)
|
||||||
print(f"Packet {i + 1} sent successfully")
|
print(f"Packet {i + 1} sent successfully")
|
||||||
time.sleep(0.05)
|
time.sleep(0.03)
|
||||||
print("Upgrade packet ready to send (commented out actual send code)")
|
print("Upgrade packet ready to send (commented out actual send code)")
|
||||||
QMessageBox.information(
|
QMessageBox.information(
|
||||||
self,
|
self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user