Zapit-Optostim / zapit

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

Cat and Mouse then zap leads to an error message #104

Closed raacampbell closed 1 year ago

raacampbell commented 1 year ago

Describe the bug Hot Cat & Mouse. Then on Sample Calib tab click a button that will stop C&M (e.g. the Zap or paint border)

Expected behavior Should be no error

Screenshots

Setting obj.CatMouseButton.Value to zero
Warning: Error occurred while executing the listener callback for the zapit.gui.main.controller class GUIstate property PostSet event:
Error using matlab.graphics.internal.hgdelete
Invalid or deleted object.

Error in zapit.gui.main.controller/removeOverlays>@(x)delete(x) (line 51)
            structfun(@(x) delete(x), t_Handles)

Error in zapit.gui.main.controller/removeOverlays (line 51)
            structfun(@(x) delete(x), t_Handles)

Error in zapit.gui.main.controller/catAndMouseButton_Callback (line 20)
        obj.removeOverlays('hLastPoint')

Error in zapit.gui.main.controller/harmonizeGUIstate (line 40)
            obj.(tS.GUIstate); %Because callback name == GUI state

Error in zapit.gui.main.controller/buildListeners>@(varargin)obj.harmonizeGUIstate(varargin{:}) (line 21)
    obj.listeners{end+1} = addlistener(obj, 'GUIstate', 'PostSet', @obj.harmonizeGUIstate);

Error in zapit.gui.main.controller/zapAllCoords_Callback (line 22)
        obj.GUIstate = mfilename;

Error in zapit.gui.main.controller/prepareWindow>@(varargin)obj.zapAllCoords_Callback(varargin{:}) (line 72)
    obj.ZapallcoordsButton.ValueChangedFcn = @obj.zapAllCoords_Callback; 
Operation terminated by the user.

Desktop (please complete the following information):

raacampbell commented 1 year ago

Seems this fixes the bug: 38b97ea64d8aeca2fbca4053c619c62cd9b80636