Skip to content

Refactor devices#1055

Merged
AdvancedImagingUTSW merged 26 commits into
TheDeanLab:developfrom
annie-xd-wang:refactor_devices
Feb 12, 2025
Merged

Refactor devices#1055
AdvancedImagingUTSW merged 26 commits into
TheDeanLab:developfrom
annie-xd-wang:refactor_devices

Conversation

@annie-xd-wang
Copy link
Copy Markdown
Collaborator

Will test the code with real devices and fix test cases.

@conorhughmcfadden
Copy link
Copy Markdown
Collaborator

Just letting you guys know, I get an error on this PR related to the Mirror:

(navigate) C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate>python main.py
2025-02-07 17:03:23,335 - model - ERROR - device_startup_functions: Device not found in configuration: ('OPM-VAST', 'mirror', 'ImagineOptics', 0)
Device not found in configuration: ('OPM-VAST', 'mirror', 'ImagineOptics', 0)
vvvvvvvvvvvvvvvvvvvvvvvvvvv Child Process Traceback vvvvvvvvvvvvvvvvvvvvvvvvvvv
 Traceback (most recent call last):
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\model\concurrency\concurrency_tools.py", line 501, in _child_loop
    obj = initializer(*initargs, **initkwargs)
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\model\model.py", line 138, in __init__
    self.microscopes[microscope_name] = Microscope(
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\model\microscope.py", line 270, in __init__
    self.load_and_start_devices(
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\model\microscope.py", line 1024, in load_and_start_devices
    exec(
  File "<string>", line 1, in <module>
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\model\device_startup_functions.py", line 462, in start_device
    device_not_found(microscope_name, device_category, device_type, device_id)
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\model\device_startup_functions.py", line 524, in device_not_found
    raise RuntimeError()
RuntimeError
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Child Process Traceback ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 vvvvvvvvvvvvvvvvvvvvvvvvvvv Main Process Traceback vvvvvvvvvvvvvvvvvvvvvvvvvvvv
Traceback (most recent call last):
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\main.py", line 131, in <module>
    main()
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\main.py", line 114, in main
    Controller(
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\controller\controller.py", line 222, in __init__
    self.model = ObjectInSubprocess(
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\model\concurrency\concurrency_tools.py", line 383, in __init__
    assert _get_response(self) == "Successfully initialized"
  File "C:\Users\vastopmv3\Documents\GitHub\navigate\src\navigate\model\concurrency\concurrency_tools.py", line 438, in _get_response
    raise resp
RuntimeError

I don't get this on /develop so I'm thinking it is related to the refactor.

My logs/model_debug.txt is as follows:

2025-02-07 17:03:23,303 - model - INFO - decorators: DAQBase, (<DictProxy object, typeid 'dict' at 0x1798692f460>,), {}
2025-02-07 17:03:23,304 - model - INFO - decorators: NIDAQ, (<DictProxy object, typeid 'dict' at 0x1798692f460>,), {}
2025-02-07 17:03:23,335 - model - ERROR - device_startup_functions: Device not found in configuration: ('OPM-VAST', 'mirror', 'ImagineOptics', 0)

@AdvancedImagingUTSW
Copy link
Copy Markdown
Collaborator

@dpshepherd @SJShep - This is a major overhaul to how devices are handled. Much cleaner than it was previously. We have tested it on all of our local machines, which cover a lot of different combinations of hardware. We will now take a look at your PR and see if we can integrate it now. However, please let us know if you have any problems.

@AdvancedImagingUTSW AdvancedImagingUTSW merged commit e4836a5 into TheDeanLab:develop Feb 12, 2025
This was referenced Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants