Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Bug?: redraws in ruby even wo events

For general discussion related FlowStone

Bug?: redraws in ruby even wo events

Postby Walter Sommerfeld » Wed Apr 01, 2015 2:00 pm

Hi guys,

this maybe related to other trigger mysteries in your projects too:

please load my little fsm and test it...
click on the schematic and/or slowly move your mouse cursor over a link line...

Some triggers appear but nothing unexpected happens - right?!
But in my way bigger project (in FS and the compiled exe) on the front panel the led continuously lights up and the trigger rate is around 50 per sec...
=> even w/o any redraw or input event inside or from outside...
looks like it back fires a trigger in a loop?!...

Please check this behaviour in your project!
Attachments
draw event 2 much triggers!.fsm
(88.39 KiB) Downloaded 770 times
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Re: Bug?: redraws in ruby even wo events

Postby KG_is_back » Wed Apr 01, 2015 6:16 pm

I can't confirm this by testing, but here's my theory:

When a module is redrawed, it must trigger redraw of all modules, that occupy the same area, because they are overlayed. This seems logical, because the final view is an overlay of multiple bitmaps. This might be implemented via redraw-area-type of algorithm. That way, modules that do not share the view area will not cause CPU increase, because they will draw nothing (area of zero size). Nevertheless the redraw happens - redraw method is called (there might be some algorithm that prevents this, when the redraw area should be zero. I don't really know - we'll have to test that).

I will do some testing to confirm this, but it'll take time...
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Bug?: redraws in ruby even wo events

Postby Walter Sommerfeld » Wed Apr 01, 2015 10:46 pm

Thanks KG for ur supply.

I thought 2 it must be something u described...
but how could we limit redraws if the hole ruby view is always refreshed > 50 Hz ???

Keep on doing!
Walter
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Re: Bug?: redraws in ruby even wo events

Postby KG_is_back » Thu Apr 02, 2015 1:05 am

I've wrote E-mail to DSProbotics support, hopefully they will reply. Meanwhile I can think of one way to minimize the issue - limit the output method, so it doesn't shoot outputs like crazy.
Code: Select all
def init
@time
end
def draw v

#some code

if @time<time then output 0,something end

#some code

#put this in the end of redraw method
#0.2 is just an example, which will limit outputs to max 5 per second
if @time<time then @time=time+0.2 end
end

KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Bug?: redraws in ruby even wo events

Postby tulamide » Thu Apr 02, 2015 3:45 pm

Do you remember this thread?

From there:
tulamide wrote:Yes, I think so, too. Had some testing with the sprite font project. Remember that I complained about continous redraws? It's because of the output triggers. They can cause feedback loops, and that's what's happening there (A char list is drawn, the number of rows is sent to a slider. The slider takes it as input and sends out the current position. As soon as both are directly adjacent, one of those "redraw areas outside the view area" triggers redraws, which forces the loop).


There are two ways to avoid that behaviour: Either don't place panels directly adjacent in the top front panel, or don't use 'output' from within the draw method. (This second route was how I solved it in my project)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Bug?: redraws in ruby even wo events

Postby Walter Sommerfeld » Fri Apr 03, 2015 11:01 am

@KG: Will try your code asap!

@tulamide: Yes i remember - but must have over read the 'adjacent' or simply misinterpreted it...
Now i get it and will try to avoid it and follow your hint:
don't use 'output' from within the draw method.


Thanks to you both...

btw: i thought i got rid of this with my external redraw :o :cry:
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany


Return to General

Who is online

Users browsing this forum: No registered users and 49 guests