Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Handle Parameter Updates

Next to describing the parameters, the node is also responsible to act when a parameter changes. This is accomplished by using a ParameterEventHandler from the class constructor:

self.parameter_event_handler = ParameterEventHandler(self)
self.parameter_event_handler.add_parameter_callback('my_parameter',self.get_name(),self.update_my_parameter)

And then declare the method update_my_parameter to handle the parameter updates:

def update_my_parameter(self,event):
   
   # get new parameter value
   value = self.get_parameter('my_parameter').value

   # update or restart part of the node to reflect the changes

Parameter Updates from Other Nodes

If the node has to respond to parameters from other nodes, use a parameter callback with the corresponding node name, like so:

self.parameter_event_handler.add_parameter_callback('their_parameter','/their_namespace/their_node',self.update_their_parameter)

And declare the method update_their_parameter.