App Designer Interrupt while evaluating ... PrivateValueChangedFcn

Hello,
I've created an app to stream data over bluetooth and display the data on an App Designer GUI. I am by no means a matlab expert however, attached is my project which worked in the past and then x, y, and z changes have left me unsure why it doesn't work now. If I break a process by CTRL-C the program will actually resume and work semi-properly but that is not ideal. I'm only a few days from a final presentation and demo day, so any help is greatly appreciated. I also appreciate critiques to coding techniques so I may become a better matlab programmer.
Thank you!
Project exported from .mlapp to .m
Problems occur when I change tabs or toggle a switch after changing tabs.
Here are the error messages after I Ctrl-C because the program is not responding:
After changing tabs...
In PL3GUI/readData (line 279)
data = fgetl(app.Bt);
In PL3GUI/TabGroupSelectionChanged (line 729)
readData(app);
In appdesigner.internal.service.AppManagementService/tryCallback (line 330)
callback(app, event);
In
matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event)
Error using matlab.ui.internal.WebTabGroupController/handlePropertyUpdate (line 97)
Interrupt while evaluating TabGroup SelectionChangedFcn.
After toggling a switch...
In
matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 378)
Interrupt while evaluating ToggleSwitch PrivateValueChangedFcn.

댓글 수: 1

Solved it.
I created a workaround by checking active tab and switch state based on global variables instead of strcmpi(app.someSwitch.Value, 'On') => isequal(app.someSwitch, 1). I think the issue sprung from changing tab or switch state while it's inside of the loop which executes code when the state is high but changed low or vice versa. I changed a plethora of other things as well like nested functions into functions with return values and so on.
15 stressful hours later I'm good to go. Attached is the working code.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2018년 11월 26일

댓글:

2018년 11월 27일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by