From c5aea0f3877512b9d2b54883d801910a37aa2ead Mon Sep 17 00:00:00 2001 From: edo-neo Date: Tue, 19 Aug 2025 14:35:08 +0200 Subject: [PATCH] Fix AttributeError: 'ConfigReader' object has no attribute 'vision_config' in hikrobot_sc.py --- src/components/hikrobot_sc/hikrobot_sc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/hikrobot_sc/hikrobot_sc.py b/src/components/hikrobot_sc/hikrobot_sc.py index 522858f..4db396e 100644 --- a/src/components/hikrobot_sc/hikrobot_sc.py +++ b/src/components/hikrobot_sc/hikrobot_sc.py @@ -85,8 +85,8 @@ class HikrobotSmartCamera(Component): return -2 # Set the camera recipe - if self.config.vision_config.get("solution_name",None) is not None: - solutionName = self.config.vision_config["solution_name"] + if self.config.get("general", {}).get("solution_name", None) is not None: + solutionName = self.config["general"]["solution_name"] mv_lib.MV_VS_SetStringValue(pHandle, "SrcOperateSolutionName", solutionName) mv_lib.MV_VS_SetCommandValue(pHandle, "CommandProjectLoad") time.sleep(5) @@ -105,7 +105,7 @@ class HikrobotSmartCamera(Component): return concat_frame = None concat_results = [] - rot = self.config.vision_config["rotations"].split(",") + rot = self.config["general"]["rotations"].split(",") for cam_idx in range(self.num_cameras): cam = self.cam_list[cam_idx] self.log.info(f"GET FRAME CAMERA # {cam_idx}")