UI Interest Group Documents

Showing results for 
Search instead for 
Did you mean: 

User Interface Manager

by PrimaryKey ‎11-17-2016 06:22 AM - edited ‎03-26-2017 07:37 AM

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.

 

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

Currently available User Interface Properties (UIPs):

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

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.

 

Updates

Version 1.5.4.95 - 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.94 - 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.88 - 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.78 - Due to unforseen 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.67 - 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


 

Picture2.png

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


 

Picture3.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


 

 

Picture5.png

 

Figure 5. 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...

Comments
djac91
N/A

seems to be a great tool. Nice work

Zbigniew_StS
N/A

Looks nice, well, even far better than nice.

Do you plan to add some simple examples?

PrimaryKey
N/A

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

Zbigniew_StS
N/A

Perfect. Thanks.

Hooovahh
N/A

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.

PrimaryKey
N/A

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.

StefanLemmens
N/A

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

PrimaryKey
N/A

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

StefanLemmens
N/A

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.

PrimaryKey
N/A

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

StefanLemmens
N/A

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

PrimaryKey
N/A

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.

PrimaryKey
N/A

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

PrimaryKey
N/A

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.

JGSaenz
N/A

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

PrimaryKey
N/A

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.

kosist90
N/A

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

JGSaenz
N/A

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

PrimaryKey
N/A

@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

PrimaryKey
N/A

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.

PAW59
N/A

@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.

PrimaryKey
N/A

@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.

PAW59
N/A

@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. 

PrimaryKey
N/A

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

kosist90
N/A

@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.

kosist90
N/A

@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...

PrimaryKey
N/A

@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.