09-17-2013 03:44 AM
Hi all,
I have an application vi in which I need to take care of several user generated events like menu bar selections, mouse clicks on controls (both single & double clicks) and many more.Also, all these events can occur simultaneously.Which would be the best method or architecture to handle all these events with ease?..All suggestions are welcome.
Can I use dynamic event handling for this?..If so,how can I implement it? (I went through several documents & examples for dynamic handling but none of them explained properly in this context).
09-17-2013 03:46 AM
Using producer consumer with event structure in producer loop. Event has a built-in queue and user will not miss any events.
09-17-2013 03:49 AM
@mnx wrote:
[..] several user generated events like menu bar selections, mouse clicks on controls (both single & double clicks) and many more.Also, all these events can occur simultaneously.[...]
Hm, can you enlighten us how a user will create these events simultaneously?
Or maybe i am a bad user as i always use either mouse OR keyboard to control an application, most often not both the same time (starting different "events" concurrently).
Beside of this discussion, Producer/Consumer is a very good starting point to address this kind of requirement, as already stated above.
Norbert
09-17-2013 04:01 AM
Hi Norbert_B,
There are events in my application which can get triggered automatically due to the application state while in run and in addition to this there are several user events like mouse clicks etc. (simultaneous: "user generated"+"on the fly by application state"). Now the thing is suppose if the user has generated an event and while processing the same if any other event occurs, I should not miss any of those events. Also the processing has to be smooth and the vi should be able to accept any new events while processing the previous events without any hassles.
09-17-2013 04:08 AM
Ok, i understand your point of concurrent events.
Nevertheless, you should limit the number of possible events by disabling controls for the user. Simple reason: When using programmatic events, you are most likely working of some kind of "sequencer". Once an automatic sequence runs, only certain controls are still relevant for the user (e.g. Break/Stop/Quit buttons), but most controls (e.g. configuration controls) SHALL not change their values once the sequence runs....
Still, look into producer/consumer.
Norbert
09-17-2013 04:15 AM
Can you please post a simple architecture vi which handles both types of events together using a producer-consumer loop and can be used in this context?