add codes.

This commit is contained in:
pandx 2025-11-13 17:27:22 +08:00
parent dfe6dd1647
commit b212882709
2 changed files with 4 additions and 3 deletions

View File

@ -742,7 +742,8 @@ class CalibrationDialog(QDialog):
def process_wave_packet(self, wave_data):
data = wave_data # 接收所有数据
data = np.frombuffer(data, dtype=np.int32) # 根据实际数据格式转换
LSB_32BIT = (2.8 / (2 ** 31)) * ((750 + 249) / 249) * 1000 / 10.2
LSB_32BIT = (2.8 / (2 ** 31)) * ((300 + 100) / 100) * 1000
# LSB_32BIT = (2.8 / (2 ** 31)) * ((750 + 249) / 249) * 1000 / 10.2
# LSB_32BIT = (2.8 / (2 ** 31)) * ((750 + 287) / 287) * 1000 / 10.2
self.scaled_data = data * LSB_32BIT
@ -753,7 +754,7 @@ class CalibrationDialog(QDialog):
print(f"top10_max 去除最大的数据后的平均值1{mean_max}")
mean_min = self.mean_without_min_optimized(result['top10_min'])
print(f"top10_min 去除最大的数据后的平均值2{mean_min}")
pp = (mean_max - mean_min) / 100
pp = (mean_max - mean_min)
if self.type_cb.currentIndex() == 2:
self.value_labels[self.type_index].setText(str(round(pp, 6)))
print(f"pp :{mean_max - mean_min}")

View File

@ -625,7 +625,7 @@ class SocketClientApp(QMainWindow):
for i in range(min(5, len(data))): # 确保不超过数据长度
print(f"{data[i]:.3f}", end=" ")
print() # 换行
LSB_32BIT = (2.8 / (2 ** 31)) * ((750 + 249) / 249) * 1000 / 10.2
LSB_32BIT = (2.8 / (2 ** 31)) * ((300 + 100) / 100) * 1000 / 10.2
# LSB_32BIT = (2.8 / (2 ** 31)) * ((750 + 287) / 287) * 1000 / 10.2
# LSB_32BIT = (2.8 / (2 ** 31)) * ((750 + 287) / 287) * 1000
self.scaled_data = data * LSB_32BIT