Ton Plomp Posted January 10, 2007 Report Share Posted January 10, 2007 This post has the beta version of the "XControl Hierarchical Property" creator Alpha is found here (that thread also discusses the need for Hierachical properties A screenshot: The code: Download File:post-2399-1168457690.zip The main VI is called: GenerateProperties\GeneratePropsMethsMainVI.vi You will get a warning two VIs are missing, they are located under the LabVIEW 8.2 directory, at the location of the vi in the code the path to the vi is given! You will need a special XControl: Download File:post-2399-1168457877.zip Which is slightly modified, the state.ctl has an array of control references! and the time-out of the facade vi will load the references into the control! This XControl is rather big, but it has 48 property VI's already created. Have fun and please give some feedback! If you have some errors inside the XControl, save the xcontrol and close it and then reload it into memory. Ton PS Thanks Micheal for the ':' Quote Link to comment
LAVA 1.0 Content Posted January 10, 2007 Report Share Posted January 10, 2007 Have fun and pleas give some feedback! I don't have time to test it now, but your tool sounds excellent :thumbup: Quote Link to comment
Michael Aivaliotis Posted January 11, 2007 Report Share Posted January 11, 2007 I ran it on my machine and it works great! Excellent work. :thumbup: Yet again, another case study in the argument for opening up VI scripting to the masses. ...Which is slightly modified, the state.ctl has an array of control references! and the time-out of the facade vi will load the references into the control!Can you explain how this would work a little bit more? I didn't see this implemented anywhere in your template. Is this a manual edit step in the process?In general, you shouldn't do real work in the timeout case but perhaps this is the only way. Quote Link to comment
Ton Plomp Posted January 11, 2007 Author Report Share Posted January 11, 2007 In general, you shouldn't do real work in the timeout case but perhaps this is the only way. I believe it is (unfortunately), let me explain. An XControl property VI (Prop.VI) has no knowledge about it's facade VI beside the display state in. So you need to get the reference to the facade controls from the facade VI into the Prop.VI. There are just 2 interfaces: "Container State" and "Display State In". The "Container State" has a reference to the instance of the control on the owning VI, not what we need. "Display State In" is configurable as you want. So I added a cluster member called "XCTRLRefs", this is an array with all the references I need for my custom properties. I identify the Array members by the label.text property: So I'll need the control reference in the "Display State In", this should be done inside the facade VI. Now I need to be sure that always the references are loaded into memory, the issue is that documentation about the working of XControls is (to say the least) sloppy. When does which event occure? I need the event that happens when: The XControl is executed (eg. the containing VI is running), but I'm not sure the "Exec State Change" when a VI is loaded into memory and runs directly. I only know one event that covers this: "TimeOut", so.... I use this: (oh, I see the Facade VI I added was not correct, it missed this piece of code, please update) Ton Quote Link to comment
Michael Aivaliotis Posted January 12, 2007 Report Share Posted January 12, 2007 I need the event that happens when:The XControl is executed (eg. the containing VI is running), but I'm not sure the "Exec State Change" when a VI is loaded into memory and runs directly. I only know one event that covers this: "TimeOut", so.... I use this: Have you tried this? Does it work? The reason why I'm asking is because in order for you to use the references from within the Property nodes, you have to set State Changed boolean to TRUE every time you update the references from within the Timeout case. Quote Link to comment
Ton Plomp Posted January 12, 2007 Author Report Share Posted January 12, 2007 Have you tried this? Does it work? The reason why I'm asking is because in order for you to use the references from within the Property nodes, you have to set State Changed boolean to TRUE every time you update the references from within the Timeout case. Hopefully you misunderstood me In the property VI I use the XCTLRefs array to get a valid reference to the control inside the XControl. In order to get the reference there I use the Display State Change. To load them into the Display State Change I use the shown snippet in the time-out case. I got the feeling you thought I used it the other way round, am I right? So I am not updating the display state changed, and I don't have to set the State Changed to true. I have used it on some simple properties, but it is not fully tested. If the property couldn't locate the right control it will give an error saying which it found. Sometimes it just found nothing.... :headbang: When I get the methods right (haven't started yet) I'll probably start with a tree control and tables because if you resize them the collumns visible change ahhhhhh Ton Quote Link to comment
Michael Aivaliotis Posted January 12, 2007 Report Share Posted January 12, 2007 Can you attach the Facade VI showing this? I still can't find it in your last attachment. Quote Link to comment
Ton Plomp Posted January 12, 2007 Author Report Share Posted January 12, 2007 Yes I missed that in the demo XControl, here it is. Download File:post-2399-1168586343.vi Please overwrite the original Facade_1.vi Ton 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.