microscope-cockpit / cockpit

Cockpit is a microscope graphical user interface. It is a flexible and easy to extend platform aimed at life scientists using bespoke microscopes.
https://microscope-cockpit.org
GNU General Public License v3.0
35 stars 26 forks source link

Changing objective in simulation mode generates an error. #854

Closed iandobbie closed 1 year ago

iandobbie commented 1 year ago

There is an error in the transform updates when changing objective in simulation mode. To reproduce start cockpit with cockpit --no-config-files

Then go to the main window and select a different objective in the top right hand corner. Presumably this is because there is some missing info on the simulated camera.

Log output is:

Error in subscribed callable cockpit.devices.microscopeCamera.onObjectiveChange(). Traceback (most recent call last): File “/Users/ID/src/cockpit/cockpit/events.py”, line 242, in publish func(*args, **kwargs) File “/Users/ID/src/cockpit/cockpit/devices/microscopeCamera.py”, line 150, in onObjectiveChange self.updateTransform(handler.transform) File “/Users/ID/src/cockpit/cockpit/devices/camera.py”, line 81, in updateTransform lr = base[0] ^ pathTransform[0]


TypeError: ‘NoneType’ object is not subscriptable
iandobbie commented 1 year ago

fixed in commit 0a70d1e2511bc8ac89dcbdd172416e932f683ade