LabVIEW让一切控件可见

简介: LabVIEW让一切控件可见

LabVIEW让一切控件可见


这是一个由单个VI组成的简单示例,一些程序员可能会觉得有用。当时遇到的情况是,正在处理一个相当大的复杂程序,该程序具有复杂的UI。为了优化UI并在执行的不同部分提供清晰的界面,许多控件和指示器被隐藏,然后在不同时间可见。添加新功能时出现了一个困难,因为人们无法始终记住所有隐藏的UI 元素的位置。此VI旨在将其放入顶级程序的框图中。当“设为可见?”输入为假(默认情况下为假)时,不会发生任何反应。但是,如果将其设置为true(通过程序设置的框图编辑或“调试”标志),则它会搜索其调用VI的前面板对象,使每个对象可见。由于在编辑大型项目时使用此VI,因此也让它停止调用VI。此时,调用VI已准备好进行编辑,其所有控件和指示器都可见。


功能:


将“MakeEverything Visible.vi”放在 UI 密集型程序的框图上。通常把它放在程序的开头,甚至在主循环之外。当程序运行时,如果使可见?输入为true,调用程序将停止,其所有控件和指示器都可见。请注意,此版本循环访问选项卡控件和群集的所有级别和子对象。如有必要,可以添加其他类型的控件。



执行代码的步骤:


打开 UIExample.vi。


使用“MakeVisible?”控件 False 运行它,然后退出。


更改“MakeVisible?”控制为 True,然后再次运行它。


Summary:


This is asimple example consisting of a single VI that some programmers might finduseful. The situation I was in was thatI was dealing with a fairly large, complex program that had a complicated UI. To optimize the UI and present a clearinterface during different sections of the execution, many controls andindicators were hidden and then made visible at different times. A difficulty then arose when adding newfunctionality, in that one could not always remember where all the hidden UIelements were. This VI is designed sothat you can drop it into the block diagram of a top-level program. When the "Make Visible?" input isfalse (as it is by default), nothing happens. But if it is set to true (through a block diagram edit or a"debug" flag that the program sets, then it searches through thefront panel objects of its calling VI, making each one visible. Since I use this VI when editing large projects,I also have it stop the calling VI. Atthat point, the calling VI is ready to edit with all its controls andindicators visible.


Function:


Drop the"Make Everything Visible.vi" on the block diagram of a UI-heavyprogram. Usually I place it at thebeginning of the program, even outside the main loop. When the program runs, if the Make Visible?input is true, the calling program will be stopped with all its controls andindicators visible. Note that thisversion iterates through all levels and sub-objects of tab controls andclusters. Additional types of controlscould be added if necessary.


Steps toexecute code:


Open theUI Example.vi.


Run itwith the "Make Visible?" control False, then exit.


Changethe Make Visible? control to True, then run it again.


需要说明的是,上述的例程和文档,都是可以下载的,双击即可打开,其中压缩文件是可以采用粘贴复制的方式,拷贝到硬盘上。这不是图片,各位小伙伴看到后尝试一下,这个问题就不用加微信咨询了。有关LabVIEW编程、LabVIEW开发等相关项目,可联系们。附件中的资料这里无法上传,可去公司网站搜索下载。


LabVIEW程序,如下附件所示。

相关文章
|
机器学习/深度学习 存储 算法
【强化学习】常用算法之一 “DQN”
DQN算法是深度学习领域首次广泛应用于强化学习的算法模型之一。它于2013年由DeepMind公司的研究团队提出,通过将深度神经网络与经典的强化学习算法Q-learning结合,实现了对高维、连续状态空间的处理,具备了学习与规划的能力。本文对DQN算法进行了详细的讲解,包括发展史、算法公式和原理、功能、示例代码以及如何使用。DQN算法通过结合深度学习和Q-learning算法,实现了对高维、连续状态空间的处理,具备了学习和规划的能力。
3204 0
【强化学习】常用算法之一 “DQN”
|
前端开发 程序员 API
前端反卷计划-组件库-05-Menu组件开发
前端反卷计划-组件库-05-Menu组件开发
247 2
|
设计模式 Java 编译器
面向对象编程中的继承与多态:深入理解父类引用指向子类实例
面向对象编程中的继承与多态:深入理解父类引用指向子类实例
|
SQL 消息中间件 数据处理
DataX读取Hive Orc格式表丢失数据处理记录
DataX读取Hive Orc格式表丢失数据处理记录
599 0
|
XML Java Maven
Maven资源拷贝插件和常用依赖
Maven资源拷贝插件和常用依赖
481 0
|
数据采集 安全 测试技术
LabVIEW调用DLL时需注意的问题
LabVIEW调用DLL时需注意的问题
684 0
【qt】 QGridLayout布局管理器怎么用?
【qt】 QGridLayout布局管理器怎么用?
581 0
|
数据采集 传感器 监控
LabVIEW在SpaceX的应用
LabVIEW在SpaceX的应用
233 0
|
网络协议 安全 网络安全
LabVIEW程序的常见加密方式
LabVIEW程序的常见加密方式
700 1