mje Posted November 9, 2017 Report Share Posted November 9, 2017 I'm wondering if there's a way to hook into VI server and register for notification any time a front panel is loaded. Not a specific front panel, but any in the owning application instance. I'm thinking of a VI that can run in the background and inspect each front panel that gets loaded to operate on it. Immediate use cases of interest are to apply automated interface scaling and language translation at run-time. I'm brainstorming ideas trying to find something that scales better than having to modify each and every user interface VI in an existing code base to make calls into a new API that is created. 1 Quote Link to comment
ensegre Posted November 9, 2017 Report Share Posted November 9, 2017 (edited) Maybe not the smartest or more efficient answer. I would think at this: I'd run it periodically and generate a notification for every one of the newly open FPs. Names are identificative as long as no two VI can be in memory with the same name. Now there is the problem of clones, as I was asking here. One suggestion given in the thread points to the fact that the naming scheme of clones is known, only their number a priori is not. Edited November 9, 2017 by ensegre Quote Link to comment
mje Posted November 10, 2017 Author Report Share Posted November 10, 2017 Indeed, it's your solution that got me wondering if there's a way to get notification. All the data is clearly available in VI server to do a polling solution, but that would be pretty adverse to performance. A few hundred UIs to poll and it would have to be frequent enough such to catch freshly loaded VIs before they're displayed to avoid twitchy behavior. All in I think I'd be back to square one having to modify each VI to keep the panels hidden until the global API has had a crack at transforming the panel otherwise it could look pretty hack-ish. Quote Link to comment
mje Posted November 10, 2017 Author Report Share Posted November 10, 2017 Now that I'm doing more thinking about this, a VI that crawls the loaded VIs in memory as part of the splash load may do the trick. Dynamically liked VIs and clones would need to be handled differently. Quote Link to comment
AdvancedSolutionsDiscover Posted November 10, 2017 Report Share Posted November 10, 2017 I don't know if this idea may help: Dynamic Event Registration This get dropped into each VI that may be called: The Top Level VI gets this (each time a VI opens it will trigger an event here) Good Luck. Quote Link to comment
ensegre Posted November 10, 2017 Report Share Posted November 10, 2017 interesting idea. With some modifications like firing only the first time the FP is Standard or Maximized it should do what the OP is asking, and work for clones too. I presume that the cost of dropping it in every BD is minimal and could automated with scripting. Going a step further, such a drop-in could even hold the opening of the FP till it receives a notification in return, that the cosmetic job has been done by the actor which handled it. Quote Link to comment
ShaunR Posted November 10, 2017 Report Share Posted November 10, 2017 (edited) 14 hours ago, mje said: Indeed, it's your solution that got me wondering if there's a way to get notification. All the data is clearly available in VI server to do a polling solution, but that would be pretty adverse to performance. A few hundred UIs to poll and it would have to be frequent enough such to catch freshly loaded VIs before they're displayed to avoid twitchy behavior. All in I think I'd be back to square one having to modify each VI to keep the panels hidden until the global API has had a crack at transforming the panel otherwise it could look pretty hack-ish. Do you remember the "Callbacks" demo that I once posted? You can hook the application or VIs events (eg VI Activation) by injecting your own event into the VI externally. I don't recall there being an event for front panel open, but the VI Activation should fire and you can use the callback to filter for specific criteria (panel visible etc) Edited November 10, 2017 by ShaunR 1 Quote Link to comment
mje Posted November 11, 2017 Author Report Share Posted November 11, 2017 Good one, you may be onto something. I'll do some investigating and see what surfaces. Cheers! 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.