twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
1 stars 2 forks source link

__draw_canv__() could be slowing things down #148

Open twVolc opened 1 month ago

twVolc commented 1 month ago

Most (if not all) of the analysis GUI classes have a __draw_canv__() which updates matplotlib figure canvases (i.e. redraws them) regularly. Some of these methods are permanently running whilst others are closed whenever that frame isn't open - they're closed by putting anything but a 1 into the q attribute of that class - done in close_frame(). When the frame is opened again __draw_canv__() is started up again. This seems the logical way to do things, but I've just noticed that some frames don't do this and leave __draw__canv__() permanently running in the background. I've no idea how expensive this is - it may be very minimal as the method would just refresh and quickly exit again as it wouldn't have anything further to draw if not in_frame, but this is still unnecessary processing. Perhaps all of these classes should be setup to exit __draw_canv__() when not in_frame, by stopping it in close_frame?

Note I do remember I've had a few issues with canvas drawing and matplotlib in the past, particularly as the GUI has quite a few threads which potential confuse things, so there's a chance classes are constructed how they are based on my previous findings. But I'm not certain.