python-microscope / microscope

Python library for control of microscope devices, supporting hardware triggers and distribution of devices over the network for performance and flexibility.
https://www.python-microscope.org
GNU General Public License v3.0
66 stars 38 forks source link

picamera doesn't set ROI properly. #279

Closed iandobbie closed 10 months ago

iandobbie commented 10 months ago

The picamera module returns an error when you try to set the roi either interactively or via the settings menu.

Traceback (most recent call last): File "C:\Users\idobbie1\src\cockpit\cockpit\gui\imageViewer\viewCanvas.py", line 811, in onMouse camera.setROI(roi) File "C:\Users\idobbie1\src\cockpit\cockpit\handlers\deviceHandler.py", line 123, in wrapper return f(self, *args, **kwargs) File "C:\Users\idobbie1\src\cockpit\cockpit\handlers\camera.py", line 231, in setROI return self.callbacks['setROI'](self.name, roi) File "C:\Users\idobbie1\src\cockpit\cockpit\devices\microscopeCamera.py", line 345, in setROI result = self._proxy.set_roi(roi) File "C:\Users\idobbie1\AppData\Local\Programs\Python\Python310\lib\site-packages\Pyro4\core.py", line 185, in call return self.send(self.name, args, kwargs) File "C:\Users\idobbie1\AppData\Local\Programs\Python\Python310\lib\site-packages\Pyro4\core.py", line 476, in _pyroInvoke raise data # if you see this in your traceback, you should probably inspect the remote traceback as well TypeError: _set_roi() missing 3 required positional arguments: 'top', 'width', and 'height'

I suspect that the picamera modules isn't properly dealing roi objects. I will investigate.

iandobbie commented 10 months ago

As suspected the code was expecting 4 parameters not a named ROI() tuple. Fixed