LabVIEW让一切控件可见 您所在的位置:网站首页 labview组件说明 LabVIEW让一切控件可见

LabVIEW让一切控件可见

2023-04-02 20:36| 来源: 网络整理| 查看: 265

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程序,如下附件所示。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有