修复UCD调用异常、保存结果按钮异常
This commit is contained in:
@@ -1087,12 +1087,7 @@ def _show_list_context_menu(self: "PQAutomationApp", event):
|
||||
_switch_to_session(self, sid, show_message=False, refresh_list=False)
|
||||
|
||||
has_selection = self.ai_image_current is not None
|
||||
ucd = getattr(self, "ucd", None)
|
||||
can_send = (
|
||||
has_selection
|
||||
and ucd is not None
|
||||
and getattr(ucd, "status", False)
|
||||
)
|
||||
can_send = has_selection and self.is_ucd_connected
|
||||
try:
|
||||
self.ai_image_menu.entryconfigure(
|
||||
0, state=("normal" if can_send else "disabled")
|
||||
@@ -1120,8 +1115,7 @@ def _send_to_ucd(self: "PQAutomationApp"):
|
||||
if not os.path.isfile(rec.image_path):
|
||||
messagebox.showerror("错误", f"图片文件不存在:\n{rec.image_path}")
|
||||
return
|
||||
ucd = getattr(self, "ucd", None)
|
||||
if ucd is None or not getattr(ucd, "status", False):
|
||||
if not self.is_ucd_connected:
|
||||
messagebox.showwarning("警告", "请先连接 UCD323 设备")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user