kt corrected values are read from a file in the settings. The file can include differents same ABS (that is to say with different serial number).

This commit is contained in:
brahim committed 2024-10-24 16:53:35 +02:00
1 parent 8af3e16a1c
commit ffcc3e6eff
4 files changed
+103 -87

No files matched your search

+11 -14
View File
@@ -38,9 +38,9 @@ class CalibrationConstantKt(QDialog):
self.tab = QTabWidget()
self.verticalLayout_Main.addWidget(self.tab)
data_ABS = pd.read_excel("../ABS_calibration_constant_kt.xlsx", header=0, sheet_name=None)
self.data_ABS = pd.read_excel("ABS_calibration_constant_kt.xlsx", header=0, sheet_name=None)
for t_index, t_value in enumerate(list(data_ABS.keys())):
for t_index, t_value in enumerate(list(self.data_ABS.keys())):
print("t = ", t_index, t_value)
exec("self.tab_" + str(t_index) + "= QWidget()")
eval("self.tab.addTab(self.tab_" + str(t_index) + ", '" + str(t_value) + "')")
@@ -61,24 +61,21 @@ class CalibrationConstantKt(QDialog):
exec("self.label_kt_" + str(t_index) + " = QLabel('kt')")
eval("self.gridLayout_tab_" + str(t_index) + ".addWidget(self.label_kt_" + str(t_index) + ", 0, 1, 1, 1, Qt.AlignCenter)")
print(data_ABS[t_value].shape[0])
print(type(data_ABS[t_value]))
for x in range(data_ABS[t_value].shape[0]):
exec("self.label_freq_" + str(x) + "_ABS_" + str(t_index) + " = QLabel('" + str(data_ABS[t_value].iloc[x][0]) + " MHz')")
for x in range(self.data_ABS[t_value].shape[0]):
exec("self.label_freq_" + str(x) + "_ABS_" + str(t_index) + " = QLabel('" + str(self.data_ABS[t_value].iloc[x][0]) + " MHz')")
eval("self.gridLayout_tab_" + str(t_index) + ".addWidget(self.label_freq_" + str(x) + "_ABS_" + str(t_index) +
", " + str(x + 1) + ", 0, 1, 1,Qt.AlignCenter)")
exec("self.lineEdit_" + str(x) + "_ABS_" + str(t_index) + " = QLineEdit()")
exec("self.lineEdit_" + str(x) + "_ABS_" + str(t_index) + ".setText('" + str(data_ABS[t_value].iloc[x][1]) + "')")
exec("self.lineEdit_" + str(x) + "_ABS_" + str(t_index) + ".setText('" + str(self.data_ABS[t_value].iloc[x][1]) + "')")
exec("self.lineEdit_" + str(x) + "_ABS_" + str(t_index) + ".setMaximumWidth(" + str(100) + ")")
eval("self.gridLayout_tab_" + str(t_index) + ".addWidget(self.lineEdit_" + str(x) + "_ABS_" + str(t_index) +
", " + str(x+1) + ", 1, 1, 1, Qt.AlignCenter)")
if __name__ == "__main__":
app = QApplication(sys.argv)
cal = CalibrationConstantKt()
cal.show()
# sys.exit(app.exec_())
app.exec()
# if __name__ == "__main__":
# app = QApplication(sys.argv)
# cal = CalibrationConstantKt()
# cal.show()
# # sys.exit(app.exec_())
# app.exec()