Internally the property is changed every time and follows the mechanism as I have described above.ģ. Click on the property you want to modify and change the value. Select your object and go to the property editorĢ.
leaving the focus of the widget in the property editor where you changed the properties. Don't worry about the execute() method, it's gets called from a Document.recompute() and this is triggered when e.g. You should not call execute() from within onChanged() because if you are not careful enough you can even cause and infinite recursion.
#Suspend itimer while in handler update#
All you do is update something regarding the property that is being updated.Īll the rest is being done in execute(), where you for instance update your Property values from your calculations. In general you should not change any other properties in onChanged(). Why do you call execute() from onChanged? When you change a property in the GUI, it will touch that object and recompute. Or any other suggestion to work-around these nested-loops ! When I enter in onChanged = STOP the App event handler or ObjetsObserver It turn around 150 to 500 depending of the method ant the time cost is between 5 and 45sec. I change also other "width" property in the same object or in others!īecause I change properties of the same objects it call's onChanged Methods on the same object =nested loops ! When I change by GUI the "width" property of one piece, it's automatically handled by the onChanged method of it's class.įrom the onChanged method, I lauch an "execute" method to redraw the piece with the width parameters. There is multiple objects in the scene (each refers to a particular class) but they have all the property like "width". I order to be a "little" more precise I have:ġ- a Module, with "main" = several objects made with "doc.addObject("Part::FeaturePython"Ģ- one "class" is specific for each objectģ- In each class the _init_ add properties made by "obj.addProperty("App::PropertyLength."ĥ- The pieces appears in GUI and all there parametric properties ( _init_ and execute methods)ĥ- In the GUI I change one property in the panelĦ- The changes are automatically re-drawn for each individuals objects
#Suspend itimer while in handler code#
Unfortunately, because of my lack of python skills and know-how, it won't help me very much.īut, if you have any example of python code for the points you mentionned or only to stop the event or ObjectObserver in App it will be of great help for me. Your explanation are very interesting to improve my comprehension. I'am very new to python, and as far as I know I only use object from documents. Trying to stop the object to say "touched", I only found one thing that can be usefull: "fp.purgeTouched" applied on properties. It's my own way of handling things in onChanged that makes nested noodles! Here you might save the most time.Īnother performance boost is to switch off the undo/redo mechanism because this saves a lot of memory (and time). The simplest solution is probably to block the App document that it cannot inform the Gui document. If a property of a view provider has changed then it only calls the onChanged() method and nothing else.Īt the moment there is no mechanism implemented to block the notifications. The view provider may or may not handle the change. the document in Gui gets the corresponding view provider of the document object and forwards the changed property to him. the document in App informs the document in GuiĤ. The document object is set to "touched"ģ. the document objects (can handle the change directly but does this only in a few cases and) informs the document. a property informs his parent "document object". You have to distinguish between data objects and view objects.ġ.
The behaviour of the onChanged() method is as follows: And the onChanged() method never touches other objects. There are only a few that does and then only to keep the values synchronized. In general the onChanged() method doesn't touch other properties.
The result is "nested loops" and very bad performance. The problem : When a property is modified by user in the GUI, in the onChanged method, the code modifies other properties or objects (or objects properties).