Zapit-Optostim / zapit

General purpose optostimulation system
GNU Lesser General Public License v2.1
6 stars 1 forks source link

Failed previous start sometimes gives non-intuitive message regarding camera settings #90

Closed raacampbell closed 1 year ago

raacampbell commented 1 year ago

If the constructor failed, we can get errors that look like this:

Error using indexing
VideoResolution width exceeded. The sum of the ROIPosition X offset and Width values is too large.

Error in zapit.hardware.camera/set.ROI (line 241)
                obj.vid.ROIPosition = ROIpos;

Error in zapit.pointer (line 106)
                obj.cam.ROI = round(obj.settings.cache.ROI);

Error in start_zapit (line 68)
            hZP = zapit.pointer(ZPargs{:});

We see the following orphan devices exist:

Warning: Objects of 'videosource' class exist.  Cannot clear this class or any of its superclasses. 
Warning: Objects of 'zapit.pointer' class exist.  Cannot clear this class or any of its superclasses. 
Warning: The following classes still have existing instances that cannot be cleared:
imaqdevice (4 instances)
videoinput (4 instances)

We can find a device of class videoinput like this:

'videoinput'

So if we Tag this when we set up, we can search and delete during startup because this fixes it: delete(s).

raacampbell commented 1 year ago

Fixed: b57746d1692a3e227a09e3cb45850928ec4b7486