Exemple #1
0
 def test_constructor(self):
     m1_param = ModuleParam(val="1.2",
                            type="Float",
                            alias="",
                            )
     m1_function = ModuleFunction(name="value",
                                  parameters=[m1_param],
                                  )
     m1 = Module(id=0,
                 name='Float',
                 functions=[m1_function],
                 )
                 
     m2 = Module()
     m2.name = "Float"
     m2.id = 0
     f = ModuleFunction()
     f.name = "value"
     m2.functions.append(f)
     param = ModuleParam()
     param.strValue = "1.2"
     param.type = "Float"
     param.alias = ""
     f.params.append(param)
     assert m1 == m2
Exemple #2
0
    def test_constructor(self):
        m1_param = ModuleParam(
            val="1.2",
            type="Float",
            alias="",
        )
        m1_function = ModuleFunction(
            name="value",
            parameters=[m1_param],
        )
        m1 = Module(
            id=0,
            name='Float',
            functions=[m1_function],
        )

        m2 = Module()
        m2.name = "Float"
        m2.id = 0
        f = ModuleFunction()
        f.name = "value"
        m2.functions.append(f)
        param = ModuleParam()
        param.strValue = "1.2"
        param.type = "Float"
        param.alias = ""
        f.params.append(param)
        assert m1 == m2
Exemple #3
0
    def perform(self, pipeline, step):
        """ perform(pipeline: VisPipeline, step: int) -> None        
        This will takes a pipeline and apply the interpolated values
        at step 'step' to the pipeline. Then return the updated
        pipeline

        """
        m = pipeline.modules[self.module.id]
        f = ModuleFunction()
        f.name = self.function
        f.returnType = 'void'
        value = self.values[step]
        for v in value:
            p = ModuleParam()
            convert = {'int':'Integer', 'str':'String',
                       'float':'Float', 'double':'Float'}
            p.type = convert[type(v).__name__]
            p.strValue = str(v)
            f.params.append(p)
        m.functions.append(f)
Exemple #4
0
    def perform(self, pipeline, step):
        """ perform(pipeline: VisPipeline, step: int) -> None        
        This will takes a pipeline and apply the interpolated values
        at step 'step' to the pipeline. Then return the updated
        pipeline

        """
        m = pipeline.modules[self.module.id]
        f = ModuleFunction()
        f.name = self.function
        f.returnType = 'void'
        value = self.values[step]
        for v in value:
            p = ModuleParam()
            convert = {
                'int': 'Integer',
                'str': 'String',
                'float': 'Float',
                'double': 'Float'
            }
            p.type = convert[type(v).__name__]
            p.strValue = str(v)
            f.params.append(p)
        m.functions.append(f)