Beispiel #1
0
def init_extra_module(self, component_instance, function, mw_data):
    """ Setup the middleware connection with this data

    Prepare the middleware to handle the serialised data as necessary.
    """
    component_name = component_instance.blender_obj.name
    parent_name = component_instance.robot_parent.blender_obj.name
    # Check if the name of the poster has been given in mw_data
    try:
        # It should be the 4th parameter
        poster_name = mw_data[3]
    except IndexError as detail:
        # Compose the name of the poster, based on the parent and module names
        poster_name = '{0}_{1}'.format(parent_name, component_name)

    poster_id = ors_genpos_poster.createPosterHandler(poster_name)
    self._poster_in_dict[component_name] = poster_id
    component_instance.input_functions.append(function)
Beispiel #2
0
 def __init__(self, poster_name):
     self.poster_id = ors_genpos_poster.createPosterHandler(poster_name)
     if not self.poster_id.found:
         raise PosterNotFound(poster_name)