Jump to content

Notification of a front panel load


mje

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
Link to comment

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
Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment
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
Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.