mike_spacex Posted February 7, 2012 Report Share Posted February 7, 2012 (edited) It's neat and clean that you took the event structure out of the preference dialog page VI, BUT now how would one add functionaly to their preferences VI. As an example, I'd like a drop down box to select a category, then a second drop down box to dynamically modify its items accordingly. Another example: Browse for path to csv file, which populates a table of numbers (in this case, it's only the data in the table that I care to store to file, not the path, since I don't want to perform the file access later). Does this framework allow such behavior? <update> You already answered my question above I think where you said 'Also I envisage that you could run the Engine in parallel with other code'. I see now that it's possible. Edited February 7, 2012 by mike_nrao Quote Link to comment
jgcode Posted February 7, 2012 Author Report Share Posted February 7, 2012 <update> You already answered my question above I think where you said 'Also I envisage that you could run the Engine in parallel with other code'. I see now that it's possible. No probs. Please post any examples you do (if you can) - would love to see Don't forget you could always cut and paste the engine code and start from there. Quote Link to comment
jgcode Posted February 10, 2012 Author Report Share Posted February 10, 2012 v1.0.0.27 in the LAVA-CR includes the following features: Following up to mike_nrao's comment I have included a basic example of how to extend a Page and run code in parallel to the engine. To "do stuff" as opposed to just being static: The BD looks like this (from the example): New VIs that allow you to interact with the Framework (wraps dynamic calls). You can set the cursors and enable/disable the Ok button and FP Close X: In the <example> I have included a simple screen to demonstrate what these VIs do: I have added support for horizontal scrollbars. Only vertical scrollbars were supported in the original Framework, but I have extended it to work with both: I have added a Polymorphic API for launching the Dialog. It wraps loading from a folder: Quote Link to comment
wesramm Posted May 17, 2012 Report Share Posted May 17, 2012 I started down the road of using this as it allows me to make a much more modern looking configuration engine for a large project. And, I'll be honest when I say that I LOVE reusable code. Makes my life easy!! However, have you anticipated the need to populate the front panel controls when you load the pages? I didn't see this implemented, and am wondering if I am just missing something. If you had this capability, where the page FP controls could be populated with the last values in the cfg file, it would make this the way to go. Thanks, Wes Quote Link to comment
jgcode Posted May 17, 2012 Author Report Share Posted May 17, 2012 I started down the road of using this as it allows me to make a much more modern looking configuration engine for a large project. And, I'll be honest when I say that I LOVE reusable code. Makes my life easy!! However, have you anticipated the need to populate the front panel controls when you load the pages? I didn't see this implemented, and am wondering if I am just missing something. If you had this capability, where the page FP controls could be populated with the last values in the cfg file, it would make this the way to go. Thanks, Wes Hi Wes Yes, that use case is handled by and encapsulated in the 'Engine'. If you run the examples included with the package you should see it in action. Cheers -Jon Quote Link to comment
wesramm Posted May 28, 2012 Report Share Posted May 28, 2012 Thanks for the response. I'll have a look. Quote Link to comment
Aristos Queue Posted May 28, 2012 Report Share Posted May 28, 2012 JGCode: Have you tried this in LV 2012? Opening and running your example project, it is taking 24 seconds to launch the Preferences Dialog and between 5 and 10 seconds to switch pages within the dialog. No idea why. Just doing Tools>>Options within LV comes up within half a second (human counting, didn't bother actually benchmarking). (I would try installing into my LV 2011 to compare, but VI Package Manager won't talk to LV 2011 on my machine... keeps complaining about the VI Server security settings no matter how I set them... it's almost certainly my fault -- I've got my 2011 loaded with almost every module and who knows how many packages in an attempt to replicate a weird CAR report, but until I get that untangled, I don't have a 2011 to look at.) 1 Quote Link to comment
Aristos Queue Posted May 28, 2012 Report Share Posted May 28, 2012 JGCode: I checked the Perforce logs... all changes to the Preferences Dialog in 2012 were in before the first beta, so you should be able to investigate this further on your machine. I have to go now. I may get another chance to look at this later this week, but probably not. Quote Link to comment
jgcode Posted May 29, 2012 Author Report Share Posted May 29, 2012 JGCode: Have you tried this in LV 2012? Opening and running your example project, it is taking 24 seconds to launch the Preferences Dialog and between 5 and 10 seconds to switch pages within the dialog. No idea why. It must be because of this code I wrote No seriously, thanks for the info - I was able to easily debug the issue. This API was written in 2009 and dynamically calls the <resource> VIs. There was a connector pane change to optionsFrame_GetPageReadyNotifier.vi which stopped everything from working. This is good as it may provide an opportunity to improve the error handling/logic of the API (although I will be refactoring it when 2012 is released). JGCode: I checked the Perforce logs... all changes to the Preferences Dialog in 2012 were in before the first beta, so you should be able to investigate this further on your machine. I have to go now. I may get another chance to look at this later this week, but probably not. As a side note - it actually worked in Beta 1 and not Beta 2 so it seems the changes were done for Beta 2. Cheers! -JG Quote Link to comment
Aristos Queue Posted May 29, 2012 Report Share Posted May 29, 2012 For the timing of the changes: I forgot that the date that we give the beta to you is a few days after we build the final version from our source code. Yes, the changes are only in Beta 2 -- they were submitted in the small window after we cut our final image but before it was actually released to you, and I compared against the actual release date. Quote Link to comment
lordexod Posted June 25, 2012 Report Share Posted June 25, 2012 Preference Page: General model (no password): "LabVIEW 2011\resource\dialog\PreferencesDialog\PreferencePages\pageTemplate.vit" Example (no password): "LabVIEW 2011\resource\dialog\PreferencesDialog\PreferencePages\prefPage_NISearch.vi" Quote Link to comment
jgcode Posted June 25, 2012 Author Report Share Posted June 25, 2012 Preference Page: General model (no password): "LabVIEW 2011\resource\dialog\PreferencesDialog\PreferencePages\pageTemplate.vit" Example (no password): "LabVIEW 2011\resource\dialog\PreferencesDialog\PreferencePages\prefPage_NISearch.vi" Hi lordexod, I am not sure what your post is referring to? Can you go into detail. Cheers Quote Link to comment
lordexod Posted June 29, 2012 Report Share Posted June 29, 2012 (edited) "pageTemplate.vit" - This is a model according to which created by all prefPage_<name>.vi file, example:"prefPage_NISearch.vi". Edited June 29, 2012 by lordexod Quote Link to comment
jgcode Posted June 29, 2012 Author Report Share Posted June 29, 2012 "pageTemplate.vit" - This is a model according to which created by all prefPage_<name>.vi file, example:"prefPage_NISearch.vi". I know these files exist but sorry, how does this fit in with this thread? Quote Link to comment
lordexod Posted July 5, 2012 Report Share Posted July 5, 2012 Already irrelevant. Quote Link to comment
Jordan Kuehn Posted July 10, 2012 Report Share Posted July 10, 2012 If I were to want to place a single typdef'd cluster on one of the pages, but write just the individual items from the cluster to the ini file all under the same section, is there an easy way to accomplish this? I want to maintain my typedef and not break things apart on the page, but it currently writes the entire control into the section which makes it difficult to use the OpenG read INI or Section Cluster VI's (though perhaps I'm missing something). I've looked at your example readfromdisk.vi, but it's pretty much what I've already tried. The workaround is to place the cluster into another cluster when reading and then pull the desired cluster back out and that makes me cringe. Quote Link to comment
jgcode Posted July 11, 2012 Author Report Share Posted July 11, 2012 If I were to want to place a single typdef'd cluster on one of the pages, but write just the individual items from the cluster to the ini file all under the same section, is there an easy way to accomplish this? I want to maintain my typedef and not break things apart on the page, but it currently writes the entire control into the section which makes it difficult to use the OpenG read INI or Section Cluster VI's (though perhaps I'm missing something). I've looked at your example readfromdisk.vi, but it's pretty much what I've already tried. The workaround is to place the cluster into another cluster when reading and then pull the desired cluster back out and that makes me cringe. I guess that's a side-effect you are getting from mixing your data and view (which LabVIEW makes it easy to do). Wrapping your typedef in a cluster is the correct approach and is how the framework works. It will allow for scalability if you want to add elements (that may not belong in the typedef in the future) to your page (or section). Not sure if there is any other way but pls post if you come up with anything cool. Cheers -JG Quote Link to comment
Jordan Kuehn Posted July 11, 2012 Report Share Posted July 11, 2012 I guess that's a side-effect you are getting from mixing your data and view (which LabVIEW makes it easy to do). Wrapping your typedef in a cluster is the correct approach and is how the framework works. It will allow for scalability if you want to add elements (that may not belong in the typedef in the future) to your page (or section). Not sure if there is any other way but pls post if you come up with anything cool. Cheers -JG True, especially in this use case. I see your point about it being correct in terms of the framework. I'll mull it over and post if I come up with anything interesting. 1 Quote Link to comment
LewisG Posted August 21, 2012 Report Share Posted August 21, 2012 Hi all, I'm looking to use this Preferences Dialog Library and wanted to ask some questions about it. Is it possible to run the preferences popup in a sub panel instead? My guess is that you can't because it is called within "the engine" ? I don't understand what all of the global variables are for? Where do you write to them and what is the need for them? For example, in the readFromDisk.vi, we specify the sections we would like to read, where can I add a global variable like the example has? Why can’t you view the block diagram for appVars.vi? Apologies for my blunt questions, I’m just getting straight to the point Thanks for the code JG Lewis Quote Link to comment
jgcode Posted August 22, 2012 Author Report Share Posted August 22, 2012 Hi Lewis Is it possible to run the preferences popup in a sub panel instead? My guess is that you can't because it is called within "the engine" ? Yes, that is how the framework essentially works You could call the Preference Pages in your own subpanel (they are just VIs) - but you would have to handle the synchronization built into the Engine/Page VIs tho Why can’t you view the block diagram for appVars.vi? AppVars is a Global Variable, a Global Variable does not have a block diagram I don't understand what all of the global variables are for? Where do you write to them and what is the need for them? For example, in the readFromDisk.vi, we specify the sections we would like to read The Global Variables are used for Application Variables in the example only - you can change this to whatever you like. However, I prefer Globals over constants for this use case so I can edit them all in one location when developing e.g. AppVars.vi) Quote Link to comment
LewisG Posted August 24, 2012 Report Share Posted August 24, 2012 Hey, Thanks JG. I can understand the benefit of global variables here. I have never really used them before which is why I didn't know why the Block Diagram was missing. I have always been taught to avoid them although I understand they have their use case. "You could call the Preference Pages in your own subpanel (they are just VIs) - but you would have to handle the synchronization built into the Engine/Page VIs tho" At the moment, I don't want to call each individual page in a sub panel (if that is what you meant). I would like to load resource\dialog\PreferencesDialog\PreferenceDialog.vi into a subpanel. For example, on my top level VI, I could have a Tab with a sub panel to handle all of the configuration. How could I implement this? At the moment I can see you call PreferenceDialog.vi by reference in the Preferences Dialog - Dynamic__jgcode_lib_preferences_dialog.vi Some guidance would be appreciated Quote Link to comment
Ton Plomp Posted October 16, 2012 Report Share Posted October 16, 2012 I managed to get this working in a build application. Use a conditional case structure to load the NI Resource file in an executable: Place the Option VIs outside of the exe (otherwise I got an error 13) Place all of the dependencies inside of the executable (previous step would add a lot of files to the build result from within %resource%) You get the path by adding the VIs as a static VI members After those steps you can use the Preferences dialog in an executable. However it is slow. Really slow. And sometimes the framework will not load the data properly. Not sure why. However the timing (and complexity of the structure seems the culprit). Ton Quote Link to comment
PeeGee Posted August 1, 2013 Report Share Posted August 1, 2013 Dears, 1st of all: thx JG! nice code! it seems that the bug described earlier (see JGs post May 29th '12: [...] There was a connector pane change to optionsFrame_GetPageReadyNotifier.vi which stopped everything from working.[...]) is still in (Version 1.0.0.27, using LV2012) had to correct the vi-typedef in vi.libJGCODEpreferences_dialog_jgcode_lib_preferences_dialog.llbGet Page Ready Notifier - Dynamic__jgcode_lib_preferences_dialog.vi to be typed to resourcedialogPreferencesDialogoptionsFrame_GetPageReadyNotifier.vi regards peegee (Detailed descrition: In the Preference Dialog Engine FGV, in the setup event, there's a call of vi.libJGCODEpreferences_dialog_jgcode_lib_preferences_dialog.llbGet Page Ready Notifier - Dynamic__jgcode_lib_preferences_dialog.vi In there is a dynamic call to the vi referenced in the global vi.libJGCODEpreferences_dialog_jgcode_lib_preferences_dialog.llbApplication Config - Global__jgcode_lib_preferences_dialog.viin GET_PAGE_NOTIFIER_PATHwhich is set to resourcedialogPreferencesDialogoptionsFrame_GetPageReadyNotifier.vi To get the vi-reference for this dynamic call, a wrong type is given: the boolean output is missing.This caused the first load each page to take about ten seconds.correcting the type definition gave nice, fast behaviour. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.