From 71419eab44c367db0c65adbc9b13aaabc1cef15f Mon Sep 17 00:00:00 2001
From: Runner PC Cavity Lab <johannes.schabbauer@tuwien.ac.at>
Date: Wed, 5 Mar 2025 13:18:52 +0100
Subject: [PATCH] Bugfix: Make sure DCAM also works without using 'occupation
 receiver'

---
 DCAMCamera/blacs_tabs.py    | 2 +-
 DCAMCamera/blacs_workers.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/DCAMCamera/blacs_tabs.py b/DCAMCamera/blacs_tabs.py
index b55abdf..ac3d46f 100644
--- a/DCAMCamera/blacs_tabs.py
+++ b/DCAMCamera/blacs_tabs.py
@@ -40,7 +40,7 @@ class DCAMCameraTab(IMAQdxCameraTab):
             ],
             'mock': connection_table_properties['mock'],
             'image_receiver_port': self.image_receiver.port,
-            'occupation_receiver_port' : connection_table_properties['occupation_receiver_port']
+            'occupation_receiver_port' : connection_table_properties.get('occupation_receiver_port',None)
         }
         self.create_worker(
             'main_worker', self.worker_class, worker_initialisation_kwargs
diff --git a/DCAMCamera/blacs_workers.py b/DCAMCamera/blacs_workers.py
index 65f655f..b5e6026 100644
--- a/DCAMCamera/blacs_workers.py
+++ b/DCAMCamera/blacs_workers.py
@@ -320,7 +320,7 @@ class DCAMCameraWorker(IMAQdxCameraWorker):
 
             ### ADDED CODE TO PASS OCCUPATION RECEIVER ARGUMENTS TO grab_multiple() ###
             self.images = []
-            if properties["occupation_receiver_image_index"] is not None:
+            if properties.get("occupation_receiver_image_index", False):
                 tweezers_centers = f["globals"].attrs["tweezers_centers"]
                 thresholds = f["globals"].attrs["tweezers_thresholds"]
                 ROI_size = f["globals"].attrs["tweezers_ROI"]
-- 
GitLab