Jelajahi Sumber

```
fix(mcu): 调整拍照前延时时间并移除重复代码

调整ProgramItem类中拍照前的延时时间从0.5秒改为1秒,
同时移除多余的sleep调用以优化代码逻辑。

移除customer_template_service中无用的图片路径赋值代码,
改用pass语句保持代码结构清晰。
```

rambo 1 Minggu lalu
induk
melakukan
ab7a85286a
2 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 1 2
      python/mcu/ProgramItem.py
  2. 2 1
      python/service/customer_template_service.py

+ 1 - 2
python/mcu/ProgramItem.py

@@ -208,7 +208,7 @@ class ProgramItem(BaseClass):
                     ]
                 ):
                 logger.info("拍照前运动检测状态[成功]")
-                # await asyncio.sleep(0.5)
+                await asyncio.sleep(1)
                 return True
             else:
                 check_times += 1
@@ -354,7 +354,6 @@ class ProgramItem(BaseClass):
             if not await self.camera_check_mcu_move_is_stop(re_check=True):
                 logger.info("拍照前运动检测失败===>")
                 return
-            await asyncio.sleep(0.5)
             is_af = True if self.af_times > 0 else False
             if self.smart_shooter != None:
                 # 拍照

+ 2 - 1
python/service/customer_template_service.py

@@ -302,7 +302,8 @@ class CustomerTemplateService:
                         print(f"读取图片失败: {pic_path}, 错误: {e}")
                 else:
                     # 非 -抠图 字段保持不变
-                    new_pics[pic_key] = pic_path
+                    # new_pics[pic_key] = pic_path
+                    pass
                 # 更新 pics 字段
                 product["pics"] = new_pics
                 index += 1