Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to translate GUI events into AF messages?

I've been learning AF and noticed a pattern that my GUI is just an Event Structure helper loop in Actor Core.vi. All it does is translate Events into Messages, sent to self-enqueuer. Is there some way to abstract this functionality into a generic GUI Actor parent class?

 

I can wrap my head around dynamic event subscription. The child's Actor Core.vi passes Front Panel references and the event type into a GUI Actor method that registers for those events. Then GUI Actor has a helper loop with Event Structure.

 

But I can't figure out how the GUI Actor's Event Structure can map these dynamically registered events to child messages. I have a feeling that "zero-coupled messages" might be involved, but I just can't put my finger on the solution. Any ideas? Any alternative approaches to GUIs, events, and messages?

0 Kudos
Message 1 of 5
(305 Views)

Check out the MVA Framework - its available as a GPackage. (@cs/mva-framework)

 

Viewable actors can register for control events, and dedicated event handling actors pass a message back to the view when an event occurs with information about the event.

0 Kudos
Message 2 of 5
(223 Views)

Interesting, that looks like what I described. First time hearing about "GPackage" though. I'll need to look into that. Seems like a whole package management system. Maybe their license allows exporting the code out of the package manager.

0 Kudos
Message 3 of 5
(198 Views)

Yes, Gpackage manager is a package management system - the two main differences between it and other package management systems are that is fully open source, and it deals with packages on a per project basis, instead of just installing packages to your VI lib folder.

 

You are free to just download the repo as well. (But using GPackage Manager is awesome, and there are lots of other cool packages there as well)

0 Kudos
Message 4 of 5
(152 Views)

You can use the Event Source Actor to achieve this with minimal additional code. You will need to create an actor with event structure and triggering generation of Events.

 

I will write a bunch more examples this week.


https://forums.ni.com/t5/Actor-Framework-Documents/Event-Source-Actor-Package/ta-p/3538542?profile.l...

Piotr Kruczkowski
Certified TestStand Architect
Certified LabVIEW Architect
0 Kudos
Message 5 of 5
(84 Views)