Matlab的GUI自动化? [英] Matlab GUI Automation?

查看:278
本文介绍了Matlab的GUI自动化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说有人做一个Matlab GUI的使用说明。现在,我想使用code的编程环境 - 这是没有人在中环。什么是最简单的方法对我来说,脚本人类互动与GUI,从而操纵各个控制在适当的顺序,以使刀具紧缩我的号码,并得到其结果如何?我在寻找一种非侵入性的方式来重新使用这个工具的能力。用于调用Matlab的功能将是我的Java编程的理想环境。

Lets say someone made a Matlab GUI using GUIDE. Now I want to use that code in a programmatic environment - that is no human-in-the-loop. What's the easiest way for me to "script" the human interactions with the GUI so as to manipulate the various controls in the appropriate sequence to make the tool crunch my numbers and get its results? I'm looking for a non-invasive way to reuse the capabilities of this tool. My ideal programmatic environment for invoking the Matlab functionality would be Java.

我可以打开了GUIDE .FIG,并描绘出的各种控制所有的回调函数,但设计图案似乎是所有的数据推入把手变量。

I can open up the GUIDE .fig and trace out all the callback functions on the various controls, but the design pattern seems to be to shove all the data into the handles variable.

我必须使用Matlab的生成器JA for Java来生成Java类,如果是在任何方面有帮助的能力。任何建议将是AP preciated。

I've got the ability to use the Matlab Builder JA for Java to generate java classes, if that is helpful in any way. Any suggestions would be appreciated.

推荐答案

MATLAB语言GUI是Java的GUI。对于GUI自动化上有亚伊尔奥特曼的博客最近的文章:的http:// undocumentedmatlab。 COM /博客/ GUI自动化机器人/

MTALAB GUI is Java GUI. For the GUI automation there is a recent post on the blog of Yair Altman: http://undocumentedmatlab.com/blog/gui-automation-robot/

以下内容仅适用,如果你可以重写应用程序。

Following applies only if you can rewrite the application.

有通常不需要任何形式的GUI自动化任务,例如你的事。应用程序应该有以下架构型号 - >业务逻辑 - > GUI 。每一层由上面层分离 - 型号一无所知的商业逻辑这一无所知的 GUI 。然后可以以编程方式调用业务逻辑,甚至没有显示GUI。 <一href=\"http://stackoverflow.com/questions/3490481/how-to-implement-the-idea-of-mvc-design-in-matlab-guis/3492461#3492461\">Here是在MATLAB MVC实现的例子。

There is usually no need for any form of GUI automation for such tasks as yours. Application should have following architecture: Model->Business Logic->GUI. Each layer is decoupled from layers above it - Model knows nothing about Business Logic which knows nothing about the GUI. It is then possible to call Business Logic programmatically without even displaying the GUI. Here is an example for MVC implementation in MATLAB.

有关这个原因指南应该避免。有一个在MATLAB无证布局管理器,也有一些关于文件交换。

For this reason GUIDE should be avoided. There is an undocumented layout manager in MATLAB, there are also some on the file exchange.

在你的情况,你可以把整个业务逻辑的GUI逻辑之外做指南回调做什么,但打电话给你的业务逻辑功能。

In your case you could put the whole Business Logic outside the GUI Logic making GUIDE callbacks do nothing but call your Business Logic functions.

这篇关于Matlab的GUI自动化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆