예제 #1
0
    def __init__(self, *args, **kargs):
        """
        CompositeNodeFactory accept more optional parameters:

        - inputs: list of dict(name = '', interface='', value='')
        - outputs: list of dict(name = '', interface='', value='')
        - doc: documentation
        - elt_factory: map of elements with its corresponding factory
        - elt_connections: map of ( dst_id , input_port ):(src_id,output_port)
        - elt_data: Dictionary containing associated data
        - elt_value: Dictionary containing Lists of 2-uples (port, value)
        """
        # Init parent (name, description, category, doc, node, widget=None)
        AbstractFactory.__init__(self, *args, **kargs)
        # A CompositeNode is composed by a set of element indexed by an elt_id
        # Each element is associated to NodeFactory
        # Each element will generate an node instance in the real CompositeNode

        # Dict mapping elt_id with its corresponding factory
        # the factory is identified by its unique id (package_id, factory_id)
        self.elt_factory = kargs.get("elt_factory", {})

        # Dictionnary which contains tuples describing connection
        # ( source_vid , source_port ) : ( target_vid, target_port )
        self.connections = kargs.get("elt_connections", {})

        self.elt_data = kargs.get("elt_data", {})
        self.elt_value = kargs.get("elt_value", {})
        self.elt_ad_hoc = kargs.get("elt_ad_hoc", {})
        from openalea.core.algo.dataflow_evaluation import DefaultEvaluation
        self.eval_algo = kargs.get("eval_algo", DefaultEvaluation.__name__)

        # Documentation
        self.doc = kargs.get('doc', "")
        self.__doc__ = self.doc
예제 #2
0
    def __init__(self, *args, **kargs):
        """
        CompositeNodeFactory accept more optional parameters:

        - inputs: list of dict(name = '', interface='', value='')
        - outputs: list of dict(name = '', interface='', value='')
        - doc: documentation
        - elt_factory: map of elements with its corresponding factory
        - elt_connections: map of ( dst_id , input_port ):(src_id,output_port)
        - elt_data: Dictionary containing associated data
        - elt_value: Dictionary containing Lists of 2-uples (port, value)
        """
        # Init parent (name, description, category, doc, node, widget=None)
        AbstractFactory.__init__(self, *args, **kargs)
        # A CompositeNode is composed by a set of element indexed by an elt_id
        # Each element is associated to NodeFactory
        # Each element will generate an node instance in the real CompositeNode

        # Dict mapping elt_id with its corresponding factory
        # the factory is identified by its unique id (package_id, factory_id)
        self.elt_factory = kargs.get("elt_factory", {})

        # Dictionnary which contains tuples describing connection
        # ( source_vid , source_port ) : ( target_vid, target_port )
        self.connections = kargs.get("elt_connections", {})

        self.elt_data = kargs.get("elt_data", {})
        self.elt_value = kargs.get("elt_value", {})
        self.elt_ad_hoc = kargs.get("elt_ad_hoc", {})
        from openalea.core.algo.dataflow_evaluation import DefaultEvaluation
        self.eval_algo = kargs.get("eval_algo", DefaultEvaluation.__name__)

        # Documentation
        self.doc = kargs.get('doc', "")
        self.__doc__ = self.doc
예제 #3
0
    def __init__(self,
                 name,
                 description='',
                 editors=None,
                 includes=None,
                 **kargs):
        """
        name : filename
        description : file description
        editors : dictionnary listing external command to execute
        includes : List of data files that are included in the file.
        """

        AbstractFactory.__init__(self, name, description,
                                 category='data', **kargs)
        self.pkgdata_cache = None

        self.editors = editors
        self.includes = includes