jcarmody Posted July 23, 2009 Report Share Posted July 23, 2009 Can you tell me how to get a list of Selector Labels from an Event Structure refnum? I'd like to expand my CaseSelect RCF to accommodate those as well. Thanks, Jim Quote Link to comment
jcarmody Posted July 23, 2009 Author Report Share Posted July 23, 2009 Is this the way to start? Except for choosing Color... Quote Link to comment
Yair Posted July 24, 2009 Report Share Posted July 24, 2009 That wouldn't help you because the reference you get is for a diagram, which wouldn't have the specific info you need from the event structure. It looks like nothing at all about the event structure is exposed in the scripting API - there's no way to get the event structure data, there's no method for registering events, etc. Even the Register for Events doesn't appear in the New VI Object list. I'm assuming that means NI will need to do some work to expose it. 1 Quote Link to comment
Ed Dickens Posted July 26, 2009 Report Share Posted July 26, 2009 There's goes my first idea for RCF plugin. Quote Link to comment
jcarmody Posted July 26, 2009 Author Report Share Posted July 26, 2009 There's goes my first idea for RCF plugin. What did you have in mind? Quote Link to comment
Ed Dickens Posted July 26, 2009 Report Share Posted July 26, 2009 What did you have in mind? I wanted to be able to right click a control or terminal and have it look up if it's attached to a case in an Event Structure and display that case. Quote Link to comment
Kurt Friday Posted July 26, 2009 Report Share Posted July 26, 2009 I wanted to be able to right click a control or terminal and have it look up if it's attached to a case in an Event Structure and display that case. What you can do is get all frames, then for each frame get all objects, cast all objects to Control Terminal ref and keep the refs that do cast and get the terminal label text. Now you have a list of terminal refs against frame refs by terminal label text. If you search for your control by label text you can get its Terminal ref and also the ref of the frame that it belongs to. Quote Link to comment
Ed Dickens Posted July 27, 2009 Report Share Posted July 27, 2009 What you can do is get all frames, then for each frame get all objects, cast all objects to Control Terminal ref and keep the refs that do cast and get the terminal label text. Now you have a list of terminal refs against frame refs by terminal label text. If you search for your control by label text you can get its Terminal ref and also the ref of the frame that it belongs to. I guess I should have explained why I'm building the plugin. If the terminal is in the Event Frame, you can just double click the control and it will bring you to the correct Event Frame. Don't need a plugin for that. And if you're already looking at it in the code, you're already there as well. Sometimes the terminal is not in the Event Frame it's linked to, and that's was going to be the real purpose of this plugin. Say you double click a control and it gets highlighted in the code, but it's not in the Event Structure, but you know there's an Event configured for it. You can now right click the terminal and select "Find Event Case" and automagically you're looking at the correct Event Frame. If I'm reading what you're suggesting correctly, it will only work if the terminal is in its Event Frame. Good solution if that use case will work for you though. Thanks Quote Link to comment
Kurt Friday Posted July 27, 2009 Report Share Posted July 27, 2009 If I'm reading what you're suggesting correctly, it will only work if the terminal is in its Event Frame. Good solution if that use case will work for you though. Thanks Ahh, true, but I agree not much use for what you want to do. I had a bit more of a play now understanding what you want to do and I can't get the user event case names attached to a particular terminal either. Yair is right, doesn't look like its exposed. Quote Link to comment
Rolf Kalbermatter Posted July 27, 2009 Report Share Posted July 27, 2009 Sometimes the terminal is not in the Event Frame it's linked to, and that's was going to be the real purpose of this plugin. Say you double click a control and it gets highlighted in the code, but it's not in the Event Structure, but you know there's an Event configured for it. You can now right click the terminal and select "Find Event Case" and automagically you're looking at the correct Event Frame. Better would be even if that menu was in the front panel too and of course disabled for controls that do not have an event associated. But for now this is something only NI can do in their LabVIEW C(++) code. Rolf Kalbermatter Quote Link to comment
Ed Dickens Posted July 27, 2009 Report Share Posted July 27, 2009 Better would be even if that menu was in the front panel too and of course disabled for controls that do not have an event associated. But for now this is something only NI can do in their LabVIEW C(++) code. Rolf Kalbermatter That was part of it as well. I already had the Initialization code done when I realized I couldn't get the "TextLables" property for an Event Straucture. It looks to make sure that the selected item is either a panel control OR a diagram terminal AND that there's an Event Structure or the menu won't show. I like the idea doing the search at this stage so the menu only shows if there's a linked Event Frame. Quote Link to comment
Yair Posted July 27, 2009 Report Share Posted July 27, 2009 Well, I was thinking of a "Create value change events for these controls", with some nice touches, but I ran into not having any of the event stuff exposed as soon as I started writing some experimental code. 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.