09-08-2014 09:42 AM
Hello.
I have some doubts about using User events in application because I have small experience with them
I want to split program into 3 loops: GUI, IO and Processing module.
There is also some async thread running in background working on Listbox.
GUI needs to sent and get data from IO.
So this is what I am thinking:
Async user event for listbox functionality
To GUI user event for Init/shutdown etc and way to sent messages to gui
Queues for other loops
I have written simple concept here:
My intuition says this is a bad idea but couldn't come with something better tooday...
09-08-2014 09:57 AM
pawhan11 wrote:
My intuition says this is a bad idea but couldn't come with something better tooday...
What's wrong with this setup? I use it all the time. Just be careful about when you close the references to the queues and user events and be sure to use commands through the queue to close down your queued loops.
09-08-2014 10:19 AM
I also use this setup. One thing I do is put all of my Synchronization references and user events into a FGV so I don't have the wires cluttering up the diagram. Personal preference.
09-08-2014 10:29 AM
I also put those references in FGV or in Global variable as variant atributes to avoid these annoing vires. My teacher used to put them all into cluster to get only one wire.
My concern is because in GUI I will for sure have have some popups/login/panels/forms and other stuff that blocks this loop and waits for user interaction. When IO writes some important message when Popup is active it won't be serviced until popup is finished by user...
09-08-2014 10:31 AM
Put the popup in your consumer loop....not in the event structure.
09-08-2014 10:43 AM
@pawhan11 wrote:
I also put those references in FGV or in Global variable as variant atributes to avoid these annoing vires.
I make an Action Engine for each of my communication Queue/Notifier/Event. That way I don't have to pass any wires around and anybody can send a message to anybody else.
You can check out my templates here: http://lavag.org/topic/16171-new-messaging-vis/
09-08-2014 04:10 PM - edited 09-08-2014 04:11 PM
@crossrulz wrote:
@pawhan11 wrote:
I also put those references in FGV or in Global variable as variant atributes to avoid these annoing vires.
I make an Action Engine for each of my communication Queue/Notifier/Event. That way I don't have to pass any wires around and anybody can send a message to anybody else.
You can check out my templates here: http://lavag.org/topic/16171-new-messaging-vis/
I have to look at this. It sounds SWEET.
[edit]
oops, kudos
[/edit]
09-09-2014 02:05 AM
Moving some things to other loop solved my problem.
I had other idea tooday.
I always wanted to handle all GUI in one loop. Placing all controlls in tab controll switch pages and resize app window at runtime to make it look good. Is that good practise??
09-09-2014 04:06 AM
@pawhan11 wrote:
I had other idea tooday.
I always wanted to handle all GUI in one loop. Placing all controlls in tab controll switch pages and resize app window at runtime to make it look good. Is that good practise??
That's what I do. And then I update the GUI from other threads using User Events that the Event Structure is registered for. Makes things a lot simpler when you can separate things like that.
09-09-2014 04:41 AM
Thanks for reply. 🙂
I attached simple concept of what I mean. You are doing it like that?
So I can resize FP bounds and change active tab to allow user see what He needs, keeping all clean in one loop without Popup windows..
But some things trouble me. FP bounds reffer to global screen coordinates. So changing resolution and monitor may cause some problems. So next step would be to get resolution and make it scalable for different resolutions ?