It looks like you're new here. If you want to get involved, click one of these buttons!
Greetings,
I would like to ask your support on a callbacks-related issue.
Currently using KLayout 0.29.12
The flows I raise my concern about are:
1. The instantiation of a PyCell.
2. The update of it's parameter set.
More specifically, when instantiating a PyCell, I get multiple redundant triggers of the callbacks some for empty string and others for None values. Filtering None values was easy but i can't filter empty string values as no callback would trigger upon instantiation.
Opening the Object properties widget also triggers one unnecessary callback, each time I open the window.
Lastly, updating the PyCell's parameter set again triggers the callbacks multiple redundant times.
If there is anything more that you require from me to further explain the issue let me know.
Kind Regards,
Chris
Comments
Hi Chris,
callbacks arise from deep inside the Qt system. Basically those are translated Qt signals. There is little I can do against this, except maybe filtering them, but finally there is a certain risk someone misses the important ones.
What specifically is your problem? Are you worried about waste of CPU cycles?
In case the order of events gives you a headache: you cannot rely on a specific order. A callback says 'this and that has been updated'. The empty-string callbacks indicate a general refresh request. Nothing else. The events may come multiple times, in different order you expect them etc. Callbacks are meant to implement widget enabling/disabling for example or refreshing computed values. They are not meant to indicate state transitions - BTW: there is no place to store a state anyway, except maybe in other parameters.
Matthias
Hello Matthias,
My thought was "Is it possible to avoid running the PyCell callbacks everytime something happens, only when needed (once per instantiate/update to be more clear)".
Having less redundant callback runs would definitely improve performance (some PyCells have 30+ parameter methods) and our QA timings.
I fully understand the complications considering the Qt signals and the risk of missing something important so if nothing can be done, It's ok.
Chris