Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Then disconnecting the pvcam camera, the program fails to close the camera. #162

Open
dboonz opened this issue Apr 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@dboonz
Copy link

dboonz commented Apr 27, 2023

Bug description
When I connect a pvcam camera and close imswitch, a runtimeerror is raised as the camera cannot be closed. The camera works fine the next time, so it seems that the camera is closed twice.

How to reproduce
Steps to reproduce the behavior:

  1. Connect a pvcam camera
  2. Start imswitch
  3. Close imswitch
  4. Look at the console, you'll see:
ERROR:imswitch:[launchApp] Traceback (most recent call last):
  File "C:\Users\dirk\mambaforge\envs\imswitch\lib\site-packages\pyvcam-2.1.5-py3.9-win-amd64.egg\pyvcam\camera.py", line 258, in close
    pvc.close_camera(self.__handle)
RuntimeError: This is not the handle of an open device (PL_ERR_DEVICE_HANDLE_INVALID)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\dirk\PycharmProjects\imswitch_hackathon\ImSwitch_xavier\imswitch\imcommon\applaunch.py", line 49, in launchApp
    controller.closeEvent()
  File "C:\Users\dirk\PycharmProjects\imswitch_hackathon\ImSwitch_xavier\imswitch\imcontrol\controller\ImConMainController.py", line 148, in closeEvent
    self.__masterController.closeEvent()
  File "C:\Users\dirk\PycharmProjects\imswitch_hackathon\ImSwitch_xavier\imswitch\imcontrol\controller\MasterController.py", line 91, in closeEvent
    attr.finalize()
  File "C:\Users\dirk\PycharmProjects\imswitch_hackathon\ImSwitch_xavier\imswitch\imcontrol\model\managers\MultiManager.py", line 63, in finalize
    subManager.finalize()
  File "C:\Users\dirk\PycharmProjects\imswitch_hackathon\ImSwitch_xavier\imswitch\imcontrol\model\managers\detectors\PhotometricsManager.py", line 219, in finalize
    self._camera.close()
  File "C:\Users\dirk\mambaforge\envs\imswitch\lib\site-packages\pyvcam-2.1.5-py3.9-win-amd64.egg\pyvcam\camera.py", line 262, in close
    raise RuntimeError('Failed to close camera.')
RuntimeError: Failed to close camera.

Expected behavior
Imswitch should not complain about closing the camera. @mcfaddendavid do you have this behaviour as well?

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • OS: "Windows 10"
  • ImSwitch version: Latest development version
  • How you downloaded ImSwitch: git

Additional context
Add any other context about the problem here, if applicable.

@dboonz dboonz added the bug Something isn't working label Apr 27, 2023
@jacopoabramo
Copy link
Collaborator

@dboonz did you ever manage to fix this bug at some point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants