修改日志/细节问题

This commit is contained in:
xinzhu.yin
2026-04-21 16:03:11 +08:00
parent e27312d0a3
commit 9a2ac69afb
14 changed files with 230 additions and 144 deletions

View File

@@ -232,10 +232,10 @@ def start_custom_row_single_step(self):
children = list(self.custom_result_tree.get_children())
row_no = children.index(item_id) + 1 if item_id in children else 1
self._clear_custom_result_row(item_id, row_no)
_clear_custom_result_row(item_id, row_no)
threading.Thread(
target=self._run_custom_row_single_step,
target=_run_custom_row_single_step,
args=(item_id, row_no),
daemon=True,
).start()
@@ -295,7 +295,7 @@ def _run_custom_row_single_step(self, item_id, row_no):
)
if row_no > len(converted_params):
self.log_gui.log(f"[Error] 行号超出 pattern 范围: {row_no}/{len(converted_params)}", level="error")
self.log_gui.log(f"行号超出 pattern 范围: {row_no}/{len(converted_params)}", level="error")
self._dispatch_ui(self.status_var.set, "单步测试失败:行号超范围")
return
@@ -332,14 +332,14 @@ def _run_custom_row_single_step(self, item_id, row_no):
}
self._dispatch_ui(
self._update_custom_result_row, item_id, row_no, row_data
_update_custom_result_row, item_id, row_no, row_data
)
self.log_gui.log(f"{row_no} 行单步测试完成并已覆盖", level="success")
self._dispatch_ui(self.status_var.set, f"{row_no} 行单步测试完成")
except Exception as e:
self.log_gui.log(f"[Error] 单步测试失败: {str(e)}", level="error")
self.log_gui.log(f"单步测试失败: {str(e)}", level="error")
self._dispatch_ui(self.status_var.set, "单步测试失败")
@@ -425,49 +425,6 @@ def copy_custom_result_table(self):
if hasattr(self, "log_gui"):
self.log_gui.log(f"已复制客户模板表格数据({len(items)} 行)", level="success")
def fill_custom_result_test_data(self):
"""填充 147 行客户模板测试数据(用于界面验证)"""
if not hasattr(self, "custom_result_tree"):
return
self.clear_custom_template_results()
pattern_names = []
if hasattr(self, "config") and hasattr(self.config, "get_temp_pattern_names"):
pattern_names = self.config.get_temp_pattern_names()
total_rows = 147
for i in range(1, total_rows + 1):
ratio = (i - 1) / (total_rows - 1) if total_rows > 1 else 0
row_data = {
"pattern_name": (
pattern_names[i - 1] if i - 1 < len(pattern_names) else f"P {i}"
),
"X": 0.8 + ratio * 120,
"Y": 0.9 + ratio * 135,
"Z": 1.1 + ratio * 145,
"x": 0.24 + ratio * 0.10,
"y": 0.26 + ratio * 0.10,
"Lv": 1.0 + ratio * 500,
"u_prime": 0.16 + ratio * 0.12,
"v_prime": 0.42 + ratio * 0.08,
"Tcp": 1800 + ratio * 12000,
"duv": -0.01 + ratio * 0.03,
"lambda_d": 430 + ratio * 200,
"Pe": 10 + ratio * 90,
}
self.append_custom_template_result(i, row_data)
if hasattr(self, "chart_notebook") and hasattr(self, "custom_template_tab_frame"):
self.chart_notebook.select(self.custom_template_tab_frame)
if hasattr(self, "status_var"):
self.status_var.set("已填充 147 行客户模板测试数据")
if hasattr(self, "log_gui"):
self.log_gui.log("已填充 147 行客户模板测试数据", level="success")
def clear_custom_template_results(self):
"""清空客户模板结果表格"""
if not hasattr(self, "custom_result_tree"):
@@ -615,3 +572,45 @@ def update_custom_button_visibility(self):
else:
if self.custom_btn.winfo_manager():
self.custom_btn.pack_forget()
# def fill_custom_result_test_data(self):
# """填充 147 行客户模板测试数据(用于界面验证)"""
# if not hasattr(self, "custom_result_tree"):
# return
# self.clear_custom_template_results()
# pattern_names = []
# if hasattr(self, "config") and hasattr(self.config, "get_temp_pattern_names"):
# pattern_names = self.config.get_temp_pattern_names()
# total_rows = 147
# for i in range(1, total_rows + 1):
# ratio = (i - 1) / (total_rows - 1) if total_rows > 1 else 0
# row_data = {
# "pattern_name": (
# pattern_names[i - 1] if i - 1 < len(pattern_names) else f"P {i}"
# ),
# "X": 0.8 + ratio * 120,
# "Y": 0.9 + ratio * 135,
# "Z": 1.1 + ratio * 145,
# "x": 0.24 + ratio * 0.10,
# "y": 0.26 + ratio * 0.10,
# "Lv": 1.0 + ratio * 500,
# "u_prime": 0.16 + ratio * 0.12,
# "v_prime": 0.42 + ratio * 0.08,
# "Tcp": 1800 + ratio * 12000,
# "duv": -0.01 + ratio * 0.03,
# "lambda_d": 430 + ratio * 200,
# "Pe": 10 + ratio * 90,
# }
# self.append_custom_template_result(i, row_data)
# if hasattr(self, "chart_notebook") and hasattr(self, "custom_template_tab_frame"):
# self.chart_notebook.select(self.custom_template_tab_frame)
# if hasattr(self, "status_var"):
# self.status_var.set("已填充 147 行客户模板测试数据")
# if hasattr(self, "log_gui"):
# self.log_gui.log("已填充 147 行客户模板测试数据", level="success")