Page 1 of 1

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

Posted: Fri Oct 10, 2014 5:45 pm
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)

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

Posted: Sat Oct 11, 2014 12:10 am
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.

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

Posted: Sat Oct 11, 2014 12:32 am
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.

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

Posted: Sat Oct 11, 2014 1:01 am
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.

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

Posted: Sat Oct 11, 2014 1:20 am
by Tronic
when I can is always a pleasure to help

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

Posted: Sat Oct 11, 2014 12:29 pm
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...