查找uialert/uiconfirm Windows/box的手柄

20次观看(最近30天)
Julian Schmid
Julian Schmid on 19 Apr 2020
你好,
我使用Uialert/Uiconfirm功能有问题。
The short version of my question is: is there a way to find uialert/uiconfirm windows/boxes and close them programmatically if they are no longer required? I don't want to close the underlying uifigure.
The long version:
I'm currently working on a program with a GUI (using the new appdesigner/ uifigure utilities) in order to control an instrument. The setup is as following:
The instrument takes commands through the serial interface from the matlab program and executes them. The instrument has 2 buttons: one which allows to user to stop the instrument in case of an emergency and another to continue the operation. When one of these buttons is pushed the instrument state flag changes (Hold = on/off);
The program on the other side sends commands to the instrument depending on the user input. Before sending a new command, it querries the instrument state flag in order to determine whether the istrument state is Hold = off and ready to execute the next command. In case the flag changed to Hold = on, the program uses the uialert/uiconfirm functionality to notify the user and block additional input through the gui.
一旦触发了hold = on flag,就有两种方法可以禁用它。通过按下仪器按钮或使用uialert/uiconfirm选项按钮。如果用户应按下仪器按钮,我可以使用仪器状态标志的计时器函数对其进行监控,则我将要删除Uialert窗口。不幸的是,这些功能不会返回手柄或任何其他标识属性,我可以用来关闭警报窗口。您知道如何解决这个问题吗?
感谢您的时间并提前帮助!
2 Comments
Julian Schmid
Julian Schmid on 22 Apr 2020
I just want to get the access to the handle of the tiny window which pops up in my uifigure window when I'm using the uialert() function. For example, with d = uiprogressdlg(f) , d is the handle to the progress bar which I can use to modify or close the dialog. However, this does not work with the uialer() function, so I can't modify it once it's been created and have to wait until the user triggers the response by pressing a button.

Sign in to comment.

答案(1)

肖恩·德·沃尔斯基(Sean de Wolski)
编辑2021年9月:
在21a中,您可以解雇和警报:
原来的:
I don't think it's possible to get a handle to and do what you're asking.
That being said, I question the usability of an app that has popups appearing and disappearing. I think there is probably a better way to lay this out. Perhaps with just a regular uiswitch with a corresponding uilamp showing if it's running.
1 Comment
Julian Schmid
Julian Schmid on 22 Apr 2020
好吧,我正在考虑使用 msgbox() 做类似的事情的功能,但是根据文档,建议“创建一个 modal 单窗口应用程序设计师的警报对话框或 uifigure -based apps, use the uialert function instead.".
I already have a lamp implemented which indicates the maschine state, but unfortunatly, there are a lot of instrument states (something I cant change) and I thought a lot of different lamp colors might put the user into trouble telling whats going on. So I thought a window with a clear message with what happend and how to fix that might be a lot more helpful.

Sign in to comment.

s manbetx 845


发布

R2020a

社区寻宝

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

开始狩猎!

被某某人翻译