AU-ExoMars / PCOT

Pancam Operations Toolkit
MIT License
3 stars 0 forks source link

More uichange sorting - too many calls. #35

Closed jimfinnis closed 3 years ago

jimfinnis commented 3 years ago
jimfinnis commented 3 years ago

Keeping some notes. Have an image feeding into a multidot. On run all, there are the following paths run into multidot's perform:

So that's six iterations (!) and for some reason it's performing the whole shebang twice. Obviously we need to eliminate that. Looking at the top bits, they're the same, so the run all event is happening twice. I see what's happening - _init() for MainUI is called each time a thing is loaded, which means the slots are reconnected, which means you get multiple slot connections and an event occurs for each connection! That's amusing when you do lots of loads! Fixed by moving the slot connections into the ctor, where they should have been.

jimfinnis commented 3 years ago

OK, I've put in more debugging things. The recursive calls to perform are OK, only happening once per change, but calls to uichange are more problematic. They happen a lot, particularly in ROI nodes. Consider multidot, and what happens when you click on the canvas:

Removing the redundant calls to uichanged and redisplay in the mousePressEvent reduces this to the last three calls. Changing things more so that uichanged() now does nothing, and we instead call changed() (without redisplay) when mouse pressed, moved or released is much better.

jimfinnis commented 3 years ago

Generally much better now - it was mainly ROI nodes that were the problem.