Jump to content
mje

Notification of a front panel load

Recommended Posts

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.

  • Like 1

Share this post


Link to post
Share on other sites

Maybe not the smartest or more efficient answer. I would think at this:

 

u.png

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 by ensegre

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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)

Capture.PNGCapture1.PNG

Good Luck.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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 by ShaunR
  • Like 1

Share this post


Link to post
Share on other sites

Good one, you may be onto something. I'll do some investigating and see what surfaces. Cheers! 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.