10-22-2019 03:58 PM
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?
10-23-2019 09:35 AM
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.
10-24-2019 02:56 PM
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.
10-29-2019 09:19 AM - edited 10-29-2019 09:25 AM
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)
11-11-2019 03:51 PM
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.