Esempio n. 1
0
    def createModule(self, name, key=None):
        """ createModule(name: str, key: str)

        createModule creates a new module given the name and adds it to the
        current workflow.  If key is specified, use the key instead of the name
        as the key into the workflow's module dictionary.

        Note: For Variable modules I pass key = variabe name (the tabName)
        """
        # If module is the 'open' module, create a new workflow
        if name == open_name:
            self.createNewWorkflow()

        # If module is 'quickplot' module, and it already exists, do nothing
        if name == quickplot_name:
            if self.currentWorkflow.moduleExists(quickplot_name.lower()):
                return

        # Create & add the module
        x, y = self.getCoordinates(name)
        module = api.add_module(x, y, cdat_id, name, namespace[name])

        if key is not None:
            self.currentWorkflow.addModule(key, module, isVariable=True)
        else:
            self.currentWorkflow.addModule(name, module)
Esempio n. 2
0
    def createModule(self, name, key=None):
        """ createModule(name: str, key: str)

        createModule creates a new module given the name and adds it to the
        current workflow.  If key is specified, use the key instead of the name
        as the key into the workflow's module dictionary.

        Note: For Variable modules I pass key = variabe name (the tabName)
        """
        # If module is the 'open' module, create a new workflow
        if name == open_name:
            self.createNewWorkflow()
            
        # If module is 'quickplot' module, and it already exists, do nothing
        if name == quickplot_name:
            if self.currentWorkflow.moduleExists(quickplot_name.lower()):
                return

        # Create & add the module
        x, y = self.getCoordinates(name)
        module = api.add_module(x, y, cdat_id, name, namespace[name])
        
        if key is not None:
            self.currentWorkflow.addModule(key, module, isVariable=True)
        else:
            self.currentWorkflow.addModule(name, module)
Esempio n. 3
0
    def createModule(self):
        """ createModule() -> None
        Collect parameters, values and operator, and create a
        PythonCalc module to the current pipeline using the API
        provided in vistrails.api.

        """
        pythoncalc = "edu.utah.sci.vistrails.pythoncalc"
        module = api.add_module(0, 0, pythoncalc, 'PythonCalc', '')
        api.get_current_controller().update_function(
            module, 'value1', [str(self.value1Edit.text())])
        api.get_current_controller().update_function(
            module, 'value2', [str(self.value2Edit.text())])
        api.get_current_controller().update_function(
            module, 'op', [str(self.opCombo.currentText())])
        api.switch_to_pipeline_view()
    def createModule(self):
        """ createModule() -> None
        Collect parameters, values and operator, and create a
        PythonCalc module to the current pipeline using the API
        provided in vistrails.api.

        """
        pythoncalc = "edu.utah.sci.vistrails.pythoncalc"
        module = api.add_module(0, 0, pythoncalc, 'PythonCalc', '')
        api.get_current_controller().update_function(module, 'value1',
                                                     [str(self.value1Edit.text())])
        api.get_current_controller().update_function(module, 'value2',
                                                     [str(self.value2Edit.text())])
        api.get_current_controller().update_function(module, 'op',
                                                     [str(self.opCombo.currentText())])
        api.switch_to_pipeline_view()