================================ ModelListener (hwx.inspire.core) ================================ Listens to the data model for object creation, modification and deletion. -------------- Public Methods -------------- +------------------------------------------------+ | activateModelListener_ (self, *typesOrObjects) | +------------------------------------------------+ | deactivateModelListener_ (self) | +------------------------------------------------+ | isModelListenerActive_ (self) | +------------------------------------------------+ | modelListenerInactive_ (self) | +------------------------------------------------+ | onObjectCreated_ (self, obj) | +------------------------------------------------+ | onObjectDeleted_ (self, obj) | +------------------------------------------------+ | onObjectModified_ (self, obj, attr) | +------------------------------------------------+ -------------- Method Details -------------- .. _activateModelListener: .. method:: activateModelListener(self, *typesOrObjects) Activates or start listening to the data model and call the handlers, when the specified types are created, destroyed or modified. :param \*typesOrObjects: Types or objects to listen to. Sub classes of Named (Features are not supported). :type \*typesOrObjects: Part, BC, Motor, ... .. _deactivateModelListener: .. method:: deactivateModelListener(self) Stops listening for data model changes. .. _isModelListenerActive: .. method:: isModelListenerActive(self) Returns, True if the model listener is active else False. .. _modelListenerInactive: .. method:: modelListenerInactive(self) Context to temporarily disable all the callbacks. .. _onObjectCreated: .. method:: onObjectCreated(self, obj) Callback method when an object is created. Reimplement if interested when an object is created. :param obj: Object that got created. Sub classes of Named (Features are not supported). :type obj: Part, BC, Motor, ... .. _onObjectDeleted: .. method:: onObjectDeleted(self, obj) Callback method when an object is deleted or destroyed.. Reimplement if interested when an object is destroyed. :param obj: Object that got destroyed. Sub classes of Named (Features are not supported). :type obj: Part, BC, Motor, ... .. _onObjectModified: .. method:: onObjectModified(self, obj, attr) Callback method when an object is modified. Reimplement if interested when an object's attribute is modified. :param obj: Object whose attribute got modified. Sub classes of Named (Features are not supported). :type obj: Part, BC, Motor, ... :param attr: Attribute in the object that got modified. attr can be location, mass, name, ... :type attr: str