查找uialert/uiconfirm Windows/box的手柄
20次观看(最近30天)
节目older comments
你好,
我使用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窗口。不幸的是,这些功能不会返回手柄或任何其他标识属性,我可以用来关闭警报窗口。您知道如何解决这个问题吗?
感谢您的时间并提前帮助!
答案(1)
肖恩·德·沃尔斯基(Sean de Wolski)
on 22 Apr 2020
编辑:肖恩·德·沃尔斯基(Sean de Wolski)
on 10 Sep 2021
编辑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.