UI Interest Group Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

User Interface Manager

 

This tool is provided as an example to the LabVIEW user community under the Sample Code License (ni.com/samplecodelicense). It is not a National Instruments product and not supported through the regular support channels. Please leave questions and feedback about the UI Manager in the comment section below and rate the document. Please provide suggestions for new features and improvements and related use cases.

 

The VI Package is built using VI Package Manager 2017. You can get it by installing LV 2017 or by downloading VIPM for this page - https://vipm.jki.net/

 

User Interface Manager is compatible with LV 2016 or later.

 

This tool is designed to help programmers capture and apply complex UI configurations to any LV VI, both at edit and run time. Using the User Interface Manager Tool and its API, you will be able to configure your UI, capture that configuration, export and import it from XML file, and apply any previously captured configuration. Using this tool you can separate the configuration of your UIs from your application functionality and still be able to achieve any effect as you would using standard VI Server methods and properties.

 

If the user interface property you want to capture is not handled by the standard provided UIPs, you can create a new one, using the UIP Class Template. By providing your own implementation for five simple methods, you will be able to capture any property from the controls on your VI front panel.

 

This tool has not been tested on LINUX RT with UI.

 

Some of the use cases that can be handled by this tool include:

  • Localization of the UI
  • Changing visibility of controls
  • Changing the enabled state of controls
  • Changing the color scheme of the UI
  • Resizing UI to fit resolution
  • Setting the values of controls

Currently available User Interface Properties (UIPs):

  • CaptionUIP
  • VisibleUIP
  • DisabledUIP
  • SizeUIP 
  • PositionUIP
  • DescriptionUIP
  • TipStripUIP
  • ValueUIP

Example additional UIPs (in ZIP archive):

  • Waveform Chart Color
  • Boolean Color
  • Owning Pane Color

 

The package provided below, installs the UI Manager API to be used programmatically in your applications and the UI Manager Tool in the LabVIEW Tools menu, which allows you to capture UI states interactively in a user friendly way.

 

Version 1.9.0 (Comming Soon)

- Added new functionality for specifying the UIPs used by UIM. Now the UIPs are specified within the XML itself in the UIPList tag.
- Flatten and Unflatten from String XML functions added to make it easier to specify the UIM strucutre in code, by string.
- Save XML function modified to generate Pretty Printed files.

 

Version 1.8.0

- New ValueUIP supporting: String, Numeric, Boolean, Slide, Knob, TabControl, Path, Enum, Ring. The parsing of these values happens while getting and setting the values. Because of this they are a little slower than other properties. Use with caution.
- Included example about the ValueUIP

 

Version 1.7.1

- Updated interface for adding new UIPs to make it easier to use in executable.
- Filtered the list of VIs in memory to only the ones that have FP open and valid (UI Manager Tool).
- Reformated some of the interfaces of the UIP related methods.
- Added to Capture State checking for duplicated label names and returning error in that case.

- Added detailed description link to UIM community web-page to VI and tool.

- Added right click menu to controls on the FP to capture state from only specified controls on right click.

- Corrected bug that would cause crash in different LV versions when using the UIM.
- Rearranged some of the functions and API to work easier and less error prone with inbuilt UIPs.

- Removed project from package not to confuse users
- Added a plugin UIP folder handling. The folder location is <User Documents>\LabVIEW Data\UIP
- Removed the compiled EXE version of the example because it caused confusion

 

Version 1.5.4

- Changed the behavior when user wires CTL reference into Apply or Capture method. Right now the behavior is that the wired references are used and the VI is not traversed for references. This improves performance in big applications, by specifying up front, which CTL refs to use.

 

Version 1.5.3

- Updated the examples with more descriptive names. Modified one example to show how an app with UIM API can be built into an executable.

 

Version 1.5.2

- Removed the requirement for other packages to be installed with this tool. Now it is an independent package. Removed some small errors related to running the tool from the menu.

 

Version  1.4.3

- Due to unforeseen bug while loading had to revert back to LV 2016. The package is again only available in LV 2016 and higher.

 

Version 1.1.1

- Includes a QuickDrop shortcut for capturing the UI state into an XML file. Now, to capture state of the UI you just need to press Ctrl+Space Ctrl+U. The file generated this way will have the same name as the VI and the extension XML. It can be then loaded using the API or the UI Manager Tool from the tools menu.

An additional option you can use is the <Ctrl><Shift>+<U> which will take the text from the QuickDrop ComboBox and use this text as the UI state name. 


 

Picture1.png

 

Figure 1: Main window of the UI Manager Tool


uim67.png

 

Figure 2: UI Properties specification pane in the UI Manager Tool


uim68.png

 

Figure 3: Function palette for the UI Manager showing the API functions


 

Picture4.png

 

Figure 4: Example of programmatically setting the UI configuration using the UI Manager API


 

Picture1.png

 

Figure 5: Capturing UI State for many controls using Right Click Menu

Picture5.png

 

Figure 6. XML representation for the UI Manager



 

Please provide comments, feedback and feature suggestions in this forum post: http://forums.ni.com/t5/UI-Interest-Group-Discussions/Feature-suggestions-for-User-Interface-Manager...

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Comments
Member djac91
Member

seems to be a great tool. Nice work

Waiting For the inner calling Smiley Happy


Member Zbigniew_StS Member
Member

Looks nice, well, even far better than nice.

Do you plan to add some simple examples?

Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
Active Participant PrimaryKey
Active Participant

Hejka Zbigniew, the examples are installed together in the package.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member Zbigniew_StS Member
Member

Perfect. Thanks.

Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
Proven Zealot Proven Zealot
Proven Zealot

Pretty neat.  The UI looks typically LabVIEW, I'd prefer system controls over silver but whatever.  

 

I love that this is expandable with other classes.  You are right that the 4 included are probably the most common and should be included by default, but I'd hope that several less common ones are included but not selected by default.  Things like size, and value could be useful.  The next set of properties I think of are control specific like graph axis ranges, graph cursors, MCLB column widths, slider ranges, etc.  I think it would be useful if these classes were already made and just not selected by default.

 

The next thing I think of that I didn't see is maybe an exclude control list.  Maybe be able to specify controls to not get applied, or not get saved.

 

Why is 2016 or newer required?  2016 is only a few months old and I think the community would benefit if 2015 were supported as long as there isn't a technical limitation.

 

Lastly I see the license is described as "Sample Code License 2016".  I'm unfamiliar with this license and would highly suggest it be set to BSD in the built package.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communicatin? Checkout my 9 part CAN Blog series.

Active Participant PrimaryKey
Active Participant

Thanks for the comment Smiley Happy

 

1. I included the SizeUIP.lvclass in the newest version. I was thinking of adding also ValueUIP but i dont want to just write the binary value to the XML. I need to think of a more elegant solution than that. I have an idea that requires rewriting the core functions a little, so that will be a direction for future development.

2. I will not write UIP for any more specific properties. Maybe some examples will include some of those but im not promising anything here. The point of this tool is to make it very easy for users to write their own UIPs. They can export anything they need for any project, and they can share it online. I will think however about a scripting based tool to generate UIPs.

3. 2016 version is just the version on which I built it. I had a lot of feeback about that and the next version will be released for LV2014 and compatible with 15 and 16.

4. Sample Code License is the license that is official for NI example code. I cannot use any other licence.

Stay tuned for updates Smiley Happy

 

UPDATE: Bug in LV 2016 prevents me from being able to convert code to previous versions. Once the bug is fixed I will post 2015 version of package here. Untill then I will be posting 2016 versions only.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member StefanLemmens
Member

Also tip strip and help description might be useful to include.

Active Participant PrimaryKey
Active Participant

@StefanLemmens - where would you like to see those? I thought I added help description and tip strips where needed.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member StefanLemmens
Member

As a UIP of the front panel controls. So you can set them from your tool. This would make a front panel more multi-language.

Active Participant PrimaryKey
Active Participant

Ah, so you would like to get plugin for tip-strip and description. I might add those, but in the mean time you can easily add the yourself Smiley Happy

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member StefanLemmens
Member

I think I will, but it was just a suggestion to get it in the "official" version. Great tool by the way Smiley Happy

Active Participant PrimaryKey
Active Participant

Thanks, if you would like to please share in the community some projects where you used it. You can also add links to the plugins, if you make them.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Active Participant PrimaryKey
Active Participant

@StefanLemmens - as per your request, two new plugins Smiley Happy

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Active Participant PrimaryKey
Active Participant

Due to unforseen error I had to revert back to only installing on LV 2016 or later. I do not know how long and if I will be able to fix the tool for LV 2015. Sorry about that.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member JGSaenz
Member

Hi, I have only tried it for a couple of tests, and I think it is a powerfull tool with a lot of potencial. But I just make an appointment, I think that you could resize first the control and then move it, I say this because it failed when resizing and moving an item from a test VI.

 

Thank you for your effort

Active Participant PrimaryKey
Active Participant

Thanks for the feedback. I'm thinking about enforcing some order in the UIP handling, maybe using some INT value like "priority". In the mean time you can put the size and movement updates into separate states and invoke them in sequence. This way you make sure the ordering of properties will be like you want.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Active Participant kosist90
Active Participant

Hello,

I've got one question, please? Does it support localization by Unicode symbols (like for Hungarian, Slovakian, Russian, etc.)? Fast test what I've tried shows that it saves and reads back text; but in xml file all the symbols are messed up and not readable for "unicode" text. Thus, I can not edit xml file manually.

Should I then somehow change coding of xml-file, in its header? Or I am wrong somewhere?

 

Thanks a lot,

 

Sincerely, kosist90

 

logos_middle.jpg

Member JGSaenz
Member

@PrimaryKey - thank you for the quick answear, I think that the priority idea would be great. Meanwhile I'll try the solution you suggested. 

Active Participant PrimaryKey
Active Participant

@kosist90 - the caption capture does not support unicode right now but it's on my radar. I'm thinking about including the Unicode tools for LabVIEW in the caption plugin. In the mean time you can work on it yourself and if you prepare something that works I can add it to the tool Smiley Happy

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Active Participant PrimaryKey
Active Participant

Right now I'm focusing on working out a couple of things in regard to building apps with UIM functions into EXE. I want to make this process as easy at the whole tool is designed to be. You guys should expect updates about that soon.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member PAW59
Member

@PrimaryKey – Nice tool and great job on the support documentation. I look forward to giving this a try.  If I understand things correctly, this is used to create different “Visual States” of the UI which I see a lot of value in.  Have you considered creating different “Value States” of the controls in the UI as well?  Maybe there are other tools available to do this, but I see where it might be implemented in this tool as well, hence eliminating the need for another.  My thoughts are that these value states might apply only to controls with a given label prefix/filter (ie “Cfg_”).  You could programmatically load or save “Value States” for any controls that match the prefix filter, and thereby get different value configurations for various uses of the application.  In my LV apps, I often change DAQ channels, VISA resources, parts on test, etc so I have made something like this, but not anything as elegant as your UI manager.

 My apologies if you already do this (or have dismissed the idea), but I did not see this in my reading / watching, and thought this could be a great addition to what I see as a very useful tool.  Thanks for sharing your work.

Active Participant PrimaryKey
Active Participant

@PAW59 - Values are just another property. You can easily work with values, and that requires you to use a mechanism to flatten variants to strings and unflatten them in a meaningful way. I did not create a value plugin in UIM because I couldn't figure out an elegant way to do this, but if you have one you just need to create a new plugin, edit it to work with values and you can use it. You can also point to it here so that the whole community benefits. 

 

Also if I find a good way to make this work, I will add it myself. You also don't need to add any tags to the names of controls, just define that your specific UIM state handles all of the controls on the UI by Label Name. I don't want to add any custom tags to the tool because that introduces a lot of complexity for a questionable gain in functionality.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member PAW59
Member

@PrimaryKey  - Maybe I need to get more familiar with the app, and see what's possible.  In any event I like the general idea of what you have done, and will look to try it out soon.  Thanks. 

Active Participant PrimaryKey
Active Participant

@PAW59 - I forgot to thank you for your feedback in the previous post Smiley Happy

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Active Participant kosist90
Active Participant

@PAW59, if you want to apply some states just to particular controls at some moment, then I guess that you can create your custom plugin for UIM, which will filter out controls by label mask, and apply/read the states what you need. It'll be a bit overhead inside of the plugins, but it seems, that it's possible to do in this way.

Active Participant kosist90
Active Participant

@PrimaryKey – is it possible to have UIM tool in a way, that it'll load plugins and config files not just from default location, but from one what you can set up? Let's say, UIM tool will have advanced settings, where you can define new path for plugins, and xml files storing. B/c going to default folder (to check plugins, or whatever) sometimes is quite annoying... I understand, that from application and API I can load files from wherever I want, but maybe it worth to have such possibility for tool itself? It's just an idea...

Active Participant PrimaryKey
Active Participant

@kosist90 - You can put your own plugins in the plugin folder. The XML only represents one UIM so I will probably not allow to point to a location, because it doesnt make sense to load many XMLs. I think that providing API functions for that is opening the functionality enough. However if more people vote for this to be included I will give it a second thought.

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member Terry_ALE
Member

This looks like a great tool and we plan to check it out.

Question: if I am implementing a theme for my application where various picture controls load images (from disk) based on a theme setting, could UIM support the loading of these images?  I know it could not automatically deduce the path of the image but maybe it could detect that an image is loaded and then I tell it where the paths are?  Or maybe I name the files (in a given path) a certain way so that the UIM knows to load the images into the appropriate picture control?


Certified LabVIEW Architect, Certified Professional Instructor, LabVIEW FPGA expert
ALE Consultants
Active Participant kosist90
Active Participant

Interesting topic, Terry_ALE...

I have one (but maybe a little bit stupid or crazy) idea.

By UIM plugin, you can read image data from the picture control. If you could setup for UIM plugin VI path to the folder, which contains images/pictures, then you can read those images from the disk, and compare one-by-one with the image data in the picture control (at the end, data in array "image" of the cluster "Image Data" will be the same). If you will find correspondance, then you can save file path to image to xml-configuration file, for UIM. If there is no such image on the disk, then you can create such an image, and also store path to it.

And next time, when UIM plugin will check data for picture control types, you can verify, whether it contains some image path, or not. If it contains, then you just load images to controls by those paths. If no, then you again do verification algorithm.

Maybe if I would have time, I'd play with it a bit also...

What do you think about this?

Member Terry_ALE
Member

That's cool, I like this idea!


Certified LabVIEW Architect, Certified Professional Instructor, LabVIEW FPGA expert
ALE Consultants
Active Participant PrimaryKey
Active Participant

Unlimited power! Smiley Very Happy

Best regards, Piotr

Certified TestStand Architect
Certified LabVIEW Architect
Member ravyh
Member

This is a great tool, thank you for that, here are my thoughts and observations:

- CaptionUIP behaves strangely with control labels. I have rewritten my copy of the UIP so i might not be 100% correct but if i remember well it was manipulating the control's label.visible property - i would leave this job to the potential LabelUIP.

- Is there a reason not to consider the 'Traverse Clusters' option when specific CTL references are wired in (in capture & apply VIs)?

- Is there any place where we could submit custom UIPs or 'braches' of the already included ones? There is a lot of potential in UIPs and i'm sure that many developers go through the same path of writing the same ones.

Active Participant kosist90
Active Participant

Good idea, ravyh - this is something, what I'd also like to ask Piotr, whether it's possible to put this project somewhere on GitHub, let's say? So everyone could collaborate, fix/update application and create new plugins?

 

Recently I was playing with the tool again, and I'd like to share some thoughts about possible updates, maybe?

 

1) UIP tool - add storing to config file also list of active plugins. B/c now when xml file is opened, tool enables all plugins by default, and it's not directly visible from the first tab. So when states are selected/applied, all plugins are active, although just some specific are used. It causes a bit issues, when updating current configuration - instead of couple plugins, it can store information from all of them.
2) Add to final exit dialog window option "Remember choise for future use", or something - so all the time when user closes window, it'll rather ask confirmation, or simply would be closed. Now it asks confirmation all the time...
3) If file is loaded, and some states are changed but not saved to file, and user closes tool, then ask user whether to save changes, or not.

 

Thank you,

sincerely, kosist90.