Sfoglia il codice sorgente

```
feat(capture): 优化智能拍摄器的相机配置逻辑

当检测到相机发生变动时才进行配置更新,避免重复操作。
新增相机键值比对功能,确保只在必要时更新配置。
调整代码结构以提高多相机模式下的配置同步效率。
```

rambo 2 settimane fa
parent
commit
09ff852af4
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      python/mcu/capture/smart_shooter_class.py

+ 8 - 2
python/mcu/capture/smart_shooter_class.py

@@ -366,13 +366,18 @@ class SmartShooter(metaclass=SingletonType):
             None,
         )
         temp_A_point = camera_configs.get("A", None)
-        points = {"A": {}, "B": {}, "C": {}}
         if temp_A_point is not None:
             print("已配置无需更新")
+            itemSettings = CameraLists[0]
+            OldCameraKey = temp_A_point.get("CameraKey", None)
+            if OldCameraKey == itemSettings.get("CameraKey", None):
+                print("相机无变动。无需自动更改配置")
+                return None
             basic_iso = temp_A_point.get("iso", {"low": 100, "high": 6400})
             if isMultCameraMode == False:
+                points = {"A": {}}
+                print("相机发生变动。需要更改配置")
                 # 如果客户是单相机版本用户,需要每次同步camera信息
-                itemSettings = CameraLists[0]
                 points["A"] = {
                     **itemSettings,
                     "iso": basic_iso,
@@ -384,6 +389,7 @@ class SmartShooter(metaclass=SingletonType):
                 # 同步本地到线上
                 settings.sync_sys_configs2Online()
             return None
+        points = {"A": {}, "B": {}, "C": {}}
         for idx,item in enumerate(points):
             low_iso = camera_configs.get("low", 100)
             high_iso = camera_configs.get("high", 6400)