Ulm-IQO / qudi-iqo-modules

A collection of qudi measurement modules originally developed for experiments on colorcenters in semiconductor materials.
GNU General Public License v3.0
12 stars 29 forks source link

[Bug] Can't load POI Manager toolchain #154

Closed TobiasSpohn closed 2 months ago

TobiasSpohn commented 2 months ago

Version

current main

What is affected by the bug?

Since #136 one can no longer start the POI manager toolchain. poi_manager_logic will throw an exception during on_activate. If no ROI has been saved as StatusVar before the module will not activate. The default creation of the ROI does not seem to work. I have inserted a warning message at the beginning of on_activate and as the log shows self._roi is None. By switching to one commit before the merge of PR #136, not clearing the StatusVars and then activating the module on the current commit, POI toolchain launches.

When does the bug occur?

It occurs during activation of poi_manager_logic with all StatusVars cleared.

How do we replicate the issue?

Expected behavior

poi_manager_logic starts and the correct default ROI is created if none is already present.

Relevant log output

2024-09-05 17:05:48 info qudi.core.modulemanager Activating logic module "poi_manager_logic.PoiManagerLogic"
2024-09-05 17:05:48 info qudi.core.modulemanager Activating logic module "scanning_probe_logic.ScanningProbeLogic"
2024-09-05 17:05:48 info qudi.core.modulemanager Activating hardware module "dummy.scanning_probe_dummy.ScanningProbeDummy"
2024-09-05 17:05:48 debug qudi.core.threadmanager Creating thread: "mod-hardware-scanner_dummy".
2024-09-05 17:05:48 debug qudi.core.threadmanager Creating thread: "mod-logic-scanning_probe_logic".
2024-09-05 17:05:48 info qudi.core.modulemanager Activating logic module "scanning_optimize_logic.ScanningOptimizeLogic"
2024-09-05 17:05:48 debug qudi.core.threadmanager Creating thread: "mod-logic-scanning_optimize_logic".
2024-09-05 17:05:48 info qudi.core.modulemanager Activating logic module "scanning_data_logic.ScanningDataLogic"
2024-09-05 17:05:48 debug qudi.core.threadmanager Creating thread: "mod-logic-scanning_data_logic".
2024-09-05 17:05:48 debug qudi.core.threadmanager Creating thread: "mod-logic-poi_manager_logic".
2024-09-05 17:05:48 warning qudi.logic.poi_manager_logic.PoiManagerLogic self._roi=None
2024-09-05 17:05:48 error qudi.logic.poi_manager_logic.PoiManagerLogic Exception during activation:
Traceback (most recent call last):
  File "C:\qudi\qudi-core\src\qudi\core\module.py", line 301, in __activation_callback
    self.on_activate()
  File "C:\qudi\qudi-iqo-modules\src\qudi\logic\poi_manager_logic.py", line 488, in on_activate
    if self._roi.scan_image is None:
AttributeError: 'NoneType' object has no attribute 'scan_image'
2024-09-05 17:05:48 debug qudi.core.threadmanager Quitting thread mod-logic-poi_manager_logic.
2024-09-05 17:05:48 debug qudi.core.threadmanager Waiting for thread mod-logic-poi_manager_logic to end.
2024-09-05 17:05:48 error qudi.core.modulemanager.ManagedModule 
Traceback (most recent call last):
  File "C:\qudi\qudi-core\src\qudi\core\modulemanager.py", line 210, in activate_module
    self._modules[module_name].activate()
  File "C:\qudi\qudi-core\src\qudi\core\modulemanager.py", line 601, in activate
    module.activate()
  File "C:\qudi\qudi-core\src\qudi\core\modulemanager.py", line 642, in activate
    raise RuntimeError(f'Failed to activate {self.module_base} module "{self.name}"!')
RuntimeError: Failed to activate logic module "poi_manager_logic"!

Additional Comments

No response

Contact Details

No response

timoML commented 2 months ago

Could you test this hotfix branch?

TobiasSpohn commented 2 months ago

This works for me, I can launch the toolchain again. I only get the warning / caught exception:

 Scan settings in Status Variable empty or invalid, using defaults.

KeyError: 'x'
Traceback (most recent call last):

  File "C:\qudi\qudi-iqo-modules\src\qudi\logic\scanning_optimize_logic.py", line 93, in on_activate
    self._check_scan_settings()

  File "C:\qudi\qudi-iqo-modules\src\qudi\logic\scanning_optimize_logic.py", line 377, in _check_scan_settings
    ax.position.check(self.scan_range[name])

But this is also thrown when using previous main and launching the optimizer logic for the first time after clearing status variables.

timoML commented 2 months ago

Solved by PR #156.