From 6273a07643cc065e80d6235ea8c0d36a12b1a253 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 15:44:57 +0000 Subject: [PATCH] Do not fail at import when no camera or spectrometer is found Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg --- .../daq_move_plugins/daq_move_ShamrockPll.py | 2 +- .../daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorCCDPll.py | 2 +- .../daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorSCMOSPll.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pymodaq_plugins_andor/daq_move_plugins/daq_move_ShamrockPll.py b/src/pymodaq_plugins_andor/daq_move_plugins/daq_move_ShamrockPll.py index 5dfe5c1..f21ff50 100644 --- a/src/pymodaq_plugins_andor/daq_move_plugins/daq_move_ShamrockPll.py +++ b/src/pymodaq_plugins_andor/daq_move_plugins/daq_move_ShamrockPll.py @@ -29,7 +29,7 @@ class DAQ_Move_ShamrockPll(DAQ_Move_base): spectro_params = [ - {'title': 'Spectro SN:', 'name': 'spectro_sn', 'type': 'list', 'value': SPEC_NAMES[0], + {'title': 'Spectro SN:', 'name': 'spectro_sn', 'type': 'list', 'value': SPEC_NAMES[0] if SPEC_NAMES else '', 'limits': SPEC_NAMES}, {'title': 'Spectro Settings:', 'name': 'spectro_settings', 'type': 'group', 'expanded': True, 'children': [ {'title': 'Wavelength (nm):', 'name': 'spectro_wl', 'type': 'float', 'value': 600, 'min': 0}, diff --git a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorCCDPll.py b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorCCDPll.py index b7f3850..e6f11a0 100644 --- a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorCCDPll.py +++ b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorCCDPll.py @@ -95,7 +95,7 @@ class DAQ_2DViewer_AndorCCDPll(CameraBasePyLabLib): hardware_averaging = True # will use the accumulate acquisition mode if averaging is necessary cam_params = cam_params - serial_params = [{'title': 'Camera:', 'name': 'serial_number', 'type': 'list', 'value': CAM_NAMES[0], + serial_params = [{'title': 'Camera:', 'name': 'serial_number', 'type': 'list', 'value': CAM_NAMES[0] if CAM_NAMES else '', 'limits': CAM_NAMES}] params = comon_parameters + serial_params + cam_params diff --git a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorSCMOSPll.py b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorSCMOSPll.py index 7e85417..6c9e31f 100644 --- a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorSCMOSPll.py +++ b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorSCMOSPll.py @@ -76,7 +76,7 @@ class DAQ_2DViewer_AndorSCMOSPll(CameraBasePyLabLib): hardware_averaging = True # will use the accumulate acquisition mode if averaging is neccessary live_mode_available = True - serial_params = [{'title': 'Camera:', 'name': 'serial_number', 'type': 'list', 'value': CAM_NAMES[0], + serial_params = [{'title': 'Camera:', 'name': 'serial_number', 'type': 'list', 'value': CAM_NAMES[0] if CAM_NAMES else '', 'limits': CAM_NAMES}] params = comon_parameters + serial_params + cam_params