is there a way to get a trigger that confirms...

For general discussion related FlowStone
Post Reply
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

is there a way to get a trigger that confirms...

Post by tester »

Is there a way to get a trigger that confirms, that gui element was refreshed/redrawed? Something sent from somewhere after successful redraw. It's for operations on hidden elements, and it can't be done with timers.

(FS304)
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: is there a way to get a trigger that confirms...

Post by Perfect Human Interface »

Off the top of my head, you could route whatever triggers are going to the redraw prim to wherever else you need it and just use a trigger switch with the Editor Open prim to block the triggers if the window is closed.

Not sure if that's good enough for what you're trying to accomplish.
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: is there a way to get a trigger that confirms...

Post by Tronic »

i use this:

Code: Select all

def draw v
    output 0, nil
end

it send an trig every time the portion of view is refreshed.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: is there a way to get a trigger that confirms...

Post by tester »

Tronic - you just saved my project, thanks. :-)

PHI - I mean something like this (schematic).

Basically, the scenario is like this. Some amount of data is calculated in the background, and a dynamic sized image (a sort of color map) is created from that calculated data. Now - using stock prims to save custom bmp like that is tricky. First - data must be calculated, second - (invisible to user but still present) image must be created from these data, and after all portions of that image are present on the invisible display - bitmap can be saved. But without trigger that confirms, that the image was refreshed - how the saving trigger can know, when to take a snapshot? One way to workaround this - is to use trigger collector from data nodes, and delay after that - in the hope, that all operations will be done before it fires.

The triggers (set in simple order) to area redraw and then to saving the bitmap - seem to not wait until redraw is complete, so it's good that ruby can tell on "v" node, that the image is created. Hopefully this will work fine, but I will check it tomorrow.
Attachments
refrr.fsm
(1.04 KiB) Downloaded 883 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: is there a way to get a trigger that confirms...

Post by Tronic »

when I can is always a pleasure to help
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: is there a way to get a trigger that confirms...

Post by tester »

It appears, that although solution is interesting and theoretically proper - it seems to not work in real life circumstances (while area is refreshed - otherwise it would not produce a picture - mgui isn't triggering; but the problem may be more complex - including ruby itself and it's excessive processing stuff). Getting back to work around. Longer delay should do, I guess...
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply